internal void RefreshRoundOver() { if (maxHp > sds.GetHp()) { nowHp -= maxHp - sds.GetHp(); if (nowHp < 1) { nowHp = 1; } maxHp = sds.GetHp(); } if (damage != sds.GetDamage()) { damage = sds.GetDamage(); } if (isSilent) { isSilent = false; } }
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; } } }