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; }
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; } }
internal void Init(bool _isMine, IHeroSDS _sds, int _x) { isMine = _isMine; fix = isMine ? 1 : -1; sds = _sds; x = _x; y = isMine ? 0 : BattleConst.mapWidth - 1; nowHp = _sds.GetHp(); moveNum = sds.GetMove(); }
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; } } }