Пример #1
0
        void _rushTo(AWizard self, AWizard opp)
        {
            // TODO: check angle

            if (self.CanUseFrostBolt() &&
                self.GetDistanceTo(opp) <= Game.WizardCastRange + opp.Radius)
            {
                opp.ApplyMagicalDamage(self.FrostBoltDamage);
                opp.RemainingFrozen = Game.FrozenDurationTicks;
                self.RemainingFrostBoltCooldownTicks = Game.FrostBoltCooldownTicks;
                self.RemainingActionCooldownTicks    = Game.WizardActionCooldownTicks;
            }

            if (self.CanUseStaff() &&
                self.GetDistanceTo(opp) <= Game.StaffRange + opp.Radius)
            {
                opp.ApplyDamage(self.StaffDamage);
                self.RemainingStaffCooldownTicks  = Game.StaffCooldownTicks;
                self.RemainingActionCooldownTicks = Game.WizardActionCooldownTicks;
            }

            if (self.CanUseMagicMissile() &&
                self.GetDistanceTo(opp) <= Game.WizardCastRange + opp.Radius)
            {
                opp.ApplyMagicalDamage(self.MagicMissileDamage);
                self.RemainingMagicMissileCooldownTicks = self.MmSkillLevel == 5 ? 0 : Game.MagicMissileCooldownTicks;
                self.RemainingActionCooldownTicks       = Game.WizardActionCooldownTicks;
            }

            if (self.GetDistanceTo(opp) > Game.StaffRange + opp.Radius)
            {
                self.MoveTo(opp, opp);
            }
            self.SkipTick();
        }