protected override void InitializeInternal(SkillService skillService, IBattleUnit attacker)
 {
     _attackManager = new AttackManager(attacker)
     {
         AttackerDamageFactory = a => Convert.ToInt64(a.GetDamage() * DamageKoef) + BonusDamage
     };
 }
 public FightInfo(IBattleUnit attacker, IBattleUnit defender, int initialDamage, int reducedDamage)
 {
     this.Attacker = attacker;
     this.Defender = defender;
     this.InitialDamage = initialDamage;
     this.ReducedDamage = reducedDamage;
 }
 public SkillService(IBattleUnit attacker, Skills.Skills skills)
 {
     Attacker = attacker;
     Skills   = skills;
     Skills.DefaultSkill?.Initialize(this, Attacker);
     Skills.ActiveSkills.ForEach(s => s.Initialize(this, Attacker));
     Skills.TrigerringSkills.ForEach(s => s.Initialize(this, Attacker));
 }
Exemple #4
0
 protected override void InitializeInternal(SkillService skillService, IBattleUnit attacker)
 {
     _poisonEffect = new PoisonEffect()
     {
         Duration = Duration,
         ImageId  = "PoisonEffect"
     };
 }
Exemple #5
0
 public override void Initialize(SkillService skillService, IBattleUnit attacker)
 {
     base.Initialize(skillService, attacker);
     _attackManager = new AttackManager(attacker)
     {
         AttackerDamageFactory = a => Convert.ToInt64(a.GetEvasion() * DamageKoef) + BonusDamage
     };
 }
        public void AddBattleUnit(IBattleUnit battleUnit)
        {
            if (battleUnit == null)
            {
                throw new ArgumentNullException("Battle unit cannot be null.");
            }

            this.battleUnits.Add(battleUnit);
        }
        public override void Update(IBattleUnit attackTarget, double timeDelta)
        {
            base.Update(attackTarget, timeDelta);

            if (IsCasting)
            {
                return;
            }

            GetSkillsToCast().TakeRandomOne().StartCasting();
        }
 public virtual void Update(IBattleUnit attackTarget, double timeDelta)
 {
     Skills.DefaultSkill.Update(attackTarget, timeDelta);
     foreach (var skill in Skills.ActiveSkills)
     {
         skill.Update(attackTarget, timeDelta);
     }
     foreach (var skill in Skills.TrigerringSkills)
     {
         skill.Update(attackTarget, timeDelta);
     }
 }
 protected override void InternalStart(IBattleUnit effectOwner)
 {
     _attackManager = new AttackManager()
     {
         AttackerDamageFactory      = a => _currentDamage,
         AttackerAccuracyFactory    = a => 1,
         AttackTargetEvasionFactory = a => 0,
         IsAttackerEventsActive     = false,
         IsAttackTargetEventsActive = false,
         IsSoulShotActive           = false
     };
     _currentTime   = 0;
     _currentDamage = 0;
     _damageDealt   = 0;
 }
Exemple #10
0
 public override void Update(IBattleUnit attackTarget, double timeDelta)
 {
     base.Update(attackTarget, timeDelta);
     if (IsCasting)
     {
         CurrentCastingTime += timeDelta;
         if (CurrentCastingTime >= CastingTime)
         {
             DoSkill(attackTarget, timeDelta);
             StopCasting();
         }
     }
     else
     {
         CurrentCooldown = CurrentCooldown > timeDelta
             ? CurrentCooldown - timeDelta
             : 0;
     }
 }
Exemple #11
0
 public virtual void Update(IBattleUnit attackTarget, double timeDelta)
 {
 }
Exemple #12
0
 protected virtual void InitializeInternal(SkillService skillService, IBattleUnit attacker)
 {
 }
 public EffectService(IBattleUnit battleUnit, Effects.Effects effects)
 {
     Effects    = effects;
     BattleUnit = battleUnit;
 }
 public RepairingKit(string name, int healingPoints, IBattleUnit carrier)
     : base(name, carrier)
 {
     this.HealingPoints = healingPoints;
 }
 public MonsterSkillController(IBattleUnit attacker, Skills.Skills skills)
     : base(attacker, skills)
 {
 }
Exemple #16
0
 protected override void DoSkill(IBattleUnit attackTarget, double timeDelta)
 {
     _poisonEffect.DamagePerSecond = Convert.ToInt64(Attacker.GetDamage() * DamagePerSecondKoef + BonusDamagePerSecond);
     attackTarget.EffectService.Add(_poisonEffect);
 }
Exemple #17
0
 public void addUnit(IBattleUnit unit)
 {
     m_battleUnits.Add(unit);
 }
 protected Equipment(string name, IBattleUnit carrier)
 {
     this.Name = name;
     this.Carrier = carrier;
 }
Exemple #19
0
 public virtual void Initialize(SkillService skillService, IBattleUnit attacker)
 {
     SkillService = skillService;
     Attacker     = attacker;
     InitializeInternal(skillService, attacker);
 }
Exemple #20
0
 protected override void DoSkill(IBattleUnit attackTarget, double timeDelta)
 => _attackManager.DealDamage(attackTarget);
Exemple #21
0
 protected virtual void InternalStart(IBattleUnit effectOwner)
 {
 }
        public void Exit(IBattleUnit unit)
        {
            if(!this.units.Contains(unit))
            {
                throw new NotExistingElementException("There is no such unit in this place.");
            }

            this.units.Remove(unit);
        }
        public void Enter(IBattleUnit unit)
        {
            if (unit == null)
            {
                throw new ArgumentNullException("Unit should not be null.");
            }

            this.units.Add(unit);
        }
 protected override void DoSkill(IBattleUnit attackTarget, double timeDelta)
 {
     attackTarget.EffectService.Add(Effect);
 }
Exemple #25
0
 public virtual void Start(IBattleUnit effectOwner)
 {
     DurationLeft = Duration;
     EffectOwner  = effectOwner;
     InternalStart(effectOwner);
 }
Exemple #26
0
 protected abstract void DoSkill(IBattleUnit attackTarget, double timeDelta);
 public Shield(string name, int armor, IBattleUnit carrier)
     : base(name, carrier)
 {
     this.Armor = armor;
 }
 public Weapon(string name, int damage, IBattleUnit carrier)
     : base(name, carrier)
 {
     this.Damage = damage;
 }
Exemple #29
0
 public override void Update(IBattleUnit attackTarget, double timeDelta)
 {
     base.Update(attackTarget, timeDelta);
     _attackTarget = attackTarget;
 }
Exemple #30
0
 public void remoteUnit(IBattleUnit unit)
 {
     m_battleUnits.Remove(unit);
 }
Exemple #31
0
 public virtual void End()
 {
     EffectOwner = null;
 }