internal void RefreshData() { if (!isSilent && changeIsSilent) { isSilent = true; changeIsSilent = false; } if (changeDamage != 0) { damage += changeDamage; changeDamage = 0; } if (changeMaxHp != 0) { nowHp += changeMaxHp; maxHp += changeMaxHp; changeMaxHp = 0; } if (changeHp != 0) { nowHp += changeHp; changeHp = 0; if (nowHp < 0) { nowHp = 0; } else if (nowHp > maxHp) { nowHp = maxHp; } } if (changePower != 0) { nowPower += changePower; changePower = 0; if (nowPower < 0) { nowPower = 0; } else if (nowPower > sds.GetPower()) { nowPower = sds.GetPower(); } } }
internal Hero(Battle _battle, bool _isMine, IHeroSDS _sds, int _pos, int _uid) { eventListenerV = _battle.eventListenerV; isMine = _isMine; sds = _sds; PosChange(_pos); uid = _uid; nowHp = sds.GetHp(); nowPower = sds.GetPower(); action = HeroAction.NULL; if (sds.GetSkills().Length > 0) { HeroSkill.Init(_battle, this); } if (sds.GetAuras().Length > 0) { HeroAura.Init(_battle, this); } }
public Hero(bool _isMine, int _id, IHeroSDS _sds, int _pos) { isMine = _isMine; id = _id; sds = _sds; pos = _pos; nowHp = sds.GetHp(); nowPower = sds.GetPower(); canMove = false; isSummon = true; }
internal Hero(bool _isMine, IHeroSDS _sds, int _pos) { isMine = _isMine; sds = _sds; PosChange(_pos); nowHp = sds.GetHp(); nowPower = sds.GetPower(); action = HeroAction.NULL; }
public Hero2(Battle2 _battle, int _uid, bool _isMine, int _id, IHeroSDS _sds, int _pos) { battle = _battle; uid = _uid; isMine = _isMine; id = _id; sds = _sds; pos = _pos; maxHp = nowHp = sds.GetHp(); damage = sds.GetDamage(); nowPower = sds.GetPower(); //isMoved = false; isSummon = !sds.GetHeroTypeSDS().GetCanCharge(); eventIndexList = new List <int>(); for (int i = 0; i < sds.GetSkills().Length; i++) { ISkillSDS skillSDS = Battle2.skillDataDic[sds.GetSkills()[i]]; int index = i; Action <SuperEvent> del = delegate(SuperEvent e) { CastSkill(index, e); }; switch (skillSDS.GetTrigger()) { case SkillTrigger.ALL: int eventIndex = battle.superEventListener.AddListener(skillSDS.GetEventName().ToString(), del); eventIndexList.Add(eventIndex); break; case SkillTrigger.HERO: eventIndex = battle.superEventListener.AddListener(string.Format("{0}{1}", skillSDS.GetEventName(), uid), del); eventIndexList.Add(eventIndex); break; case SkillTrigger.ALLY: eventIndex = battle.superEventListener.AddListener(string.Format("{0}{1}", skillSDS.GetEventName(), isMine), del); eventIndexList.Add(eventIndex); break; case SkillTrigger.ENEMY: eventIndex = battle.superEventListener.AddListener(string.Format("{0}{1}", skillSDS.GetEventName(), !isMine), del); eventIndexList.Add(eventIndex); break; } } }