Exemplo n.º 1
0
        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);
            }
        }
Exemplo n.º 2
0
        internal float FixDefense()
        {
            float fix = 1;

            if (eventListenerV != null)
            {
                eventListenerV.DispatchEvent(HeroAura.GetEventName(isMine, AuraEffect.FIX_DEFENSE), ref fix, this);
            }

            return((sds.GetDefense() * fix * DEFENSE_FIX + MAX_DEFENSE * (1 - DEFENSE_FIX)) * 2 * (1 + (((float)nowPower * 2 / MAX_POWER) - 1) * DEFENSE_FIX_WITH_POWER_RANGE) * defenseFix);
        }
Exemplo n.º 3
0
        //为了DamageCalculator才设置为public
        public int GetCounterDamage()
        {
            float fix = 1;

            if (eventListenerV != null)
            {
                eventListenerV.DispatchEvent(HeroAura.GetEventName(isMine, AuraEffect.FIX_COUNTER), ref fix, this);
            }

            return(FixDamageWithPowerAndRandom(sds.GetCounter() * fix * counterFix));
        }
Exemplo n.º 4
0
        //为了DamageCalculator才设置为public
        public int GetAttackDamage()
        {
            float fix = 1;

            if (eventListenerV != null)
            {
                eventListenerV.DispatchEvent(HeroAura.GetEventName(isMine, AuraEffect.FIX_ATTACK), ref fix, this);
            }

            return(FixDamageWithPowerAndRandom(sds.GetAttack() * fix * attackFix));
        }
Exemplo n.º 5
0
        //为了DamageCalculator才设置为public
        public int GetShootDamage()
        {
            float fix = 1;

            if (eventListenerV != null)
            {
                eventListenerV.DispatchEvent(HeroAura.GetEventName(isMine, AuraEffect.FIX_SHOOT), ref fix, this);
            }

            return(FixDamageWithPowerAndRandom(sds.GetShoot() * fix * shootFix));
        }