123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using CommonAI.Data;
- using XmdsCommon.JSGModule;
- using XmdsCommon.JSGModule.Interface;
- using XmdsCommonServer.XLS.Data;
- using XmdsCommonServer.Plugin;
- using XmdsCommonServer.Plugin.CardSkill;
- using CommonAI.Zone.Formula;
- namespace XmdsCommonSkill.Plugin.CardSkill
- {
-
- public interface JSGCardInterface
- {
- }
-
- public enum CardRateChgType : byte
- {
- Add = 0,
- Del = 1,
- Set = 2,
- Double = 3,
- }
-
- public enum CardStrengthenType : byte
- {
- None = 0,
- Dmg = 1,
- Heal = 2,
- HuDun = 3,
- Shield = 4,
-
-
-
-
- Max,
- }
-
- public enum CreateCardBallSource : byte
- {
- Normal = 0,
- CardLogic = 1,
- }
-
- public class GetCardData
- {
- public CardType cardType;
- public long time;
- public void Set(CardType card)
- {
- this.cardType = card;
- this.time = CommonLang.CUtils.localTimeMS;
- }
- public void ReSet()
- {
- this.cardType = CardType.Max;
- this.time = 0;
- }
- }
-
- public class CardStrengthData
- {
- public CardStrengthenType type = CardStrengthenType.None;
- public IntIntData data;
- }
-
- public class CardLayerRule
- {
- public int uniqueID;
- public CardLayerType layerType;
- public int maxLayers;
- public CardLayerRule(int uniqueID, CardLayerType type, int maxLayer = 0)
- {
- this.uniqueID = uniqueID;
- this.layerType = type;
- this.maxLayers = maxLayer;
- }
- public bool IsValid()
- {
- if(layerType == CardLayerType.Layers)
- {
- return uniqueID > 0 && maxLayers > 0;
- }
- else if(layerType == CardLayerType.Replace)
- {
- return uniqueID > 0;
- }
- return true;
- }
- public override string ToString()
- {
- return uniqueID + "-" + layerType + "-" + maxLayers;
- }
- }
-
- public class NextCardStrengthenInfo
- {
-
- public CardLayerRule layerRules;
- public CardType pointCard;
- public byte needSames;
- public DamageType needDmgType = DamageType.None;
- public CardStrengthenType type;
- public int value1;
- public int value2;
- public long validTime;
- public int validTimes = -1;
- public int bindBuffID;
- public void Replace(NextCardStrengthenInfo data)
- {
- this.pointCard = data.pointCard;
- this.needSames = data.needSames;
- this.needDmgType = data.needDmgType;
- this.type = data.type;
- this.value1 = data.value1;
- this.value2 = data.value2;
- this.validTime = data.validTime;
- this.validTimes = data.validTimes;
- this.bindBuffID = data.bindBuffID;
- }
- public void AddLayers(NextCardStrengthenInfo data)
- {
- this.value1 = data.value1;
- this.value2 = Math.Min(this.value2 + data.value2, data.layerRules.maxLayers);
- this.validTime = data.validTime;
- this.validTimes = data.validTimes;
- }
- }
-
- public class CardRateChgData
- {
- public int uniqueID;
- public CardType cardType;
- public CardRateChgType chgType;
- public bool isPrecent = true;
- public short value;
- public short validTimes = -1;
- public long validTime;
- public void copy(CardRateChgData data)
- {
- this.cardType = data.cardType;
- this.chgType = data.chgType;
- this.isPrecent = data.isPrecent;
- this.value = data.value;
- this.validTimes = data.validTimes;
- this.validTime = data.validTime;
- }
- }
-
- public class GenCardData
- {
- public CardType type;
- public byte nums;
- public GenCardData(CardType type, int nums)
- {
- this.type = type;
- this.nums = (byte)nums;
- }
- }
-
- public class CardTriggerResult
- {
- public CardType type;
- public byte sameNums;
- public byte[] cardData = new byte[(int)CardType.Max];
- }
-
- public class CardSkillData
- {
- public IJSGCardSkill skill;
- public CardType type;
- public int skillId;
- public short skilLv;
- public int weight;
- public DamageType dmgType = DamageType.None;
- public CardSkillData(int skillId, CardType type)
- {
- this.skillId = skillId;
- this.type = type;
- }
- }
-
- public class TriggerCardSkillDelayData
- {
- public long validTime;
- public IJSGCardSkill skill;
- public XmdsVirtual launcher;
- public XmdsVirtual target;
- public CardSkillData skillData;
- public AttackSource source;
- public byte sames;
- public void init(IJSGCardSkill skill, XmdsVirtual launcher, XmdsVirtual target, AttackSource source, CardSkillData skillData, byte sames)
- {
- this.validTime = CommonLang.CUtils.localTimeMS + JSGCardModuleBase.S_TRIGGER_DLAY;
- this.skill = skill;
- this.launcher = launcher;
- this.target = target;
- this.source = source;
- this.skillData = skillData;
- this.sames = sames;
- }
- public void CheckTriggerSkill()
- {
- if(validTime <= 0 || validTime > CommonLang.CUtils.localTimeMS)
- {
- return;
- }
- this.validTime = 0;
- if(this.launcher != null && this.launcher.mUnit.IsActive)
- {
- this.skill.TriggerCardSkill(this.launcher, this.target, this.source, this.skillData, this.sames);
-
- this.launcher.DispatchTriggerCardSkillEvent(this.launcher, this.target, this.skillData.type, this.sames);
- }
- }
- }
- }
|