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)); }
protected override void InitializeInternal(SkillService skillService, IBattleUnit attacker) { _poisonEffect = new PoisonEffect() { Duration = Duration, ImageId = "PoisonEffect" }; }
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; }
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; } }
public virtual void Update(IBattleUnit attackTarget, double timeDelta) { }
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) { }
protected override void DoSkill(IBattleUnit attackTarget, double timeDelta) { _poisonEffect.DamagePerSecond = Convert.ToInt64(Attacker.GetDamage() * DamagePerSecondKoef + BonusDamagePerSecond); attackTarget.EffectService.Add(_poisonEffect); }
public void addUnit(IBattleUnit unit) { m_battleUnits.Add(unit); }
protected Equipment(string name, IBattleUnit carrier) { this.Name = name; this.Carrier = carrier; }
public virtual void Initialize(SkillService skillService, IBattleUnit attacker) { SkillService = skillService; Attacker = attacker; InitializeInternal(skillService, attacker); }
protected override void DoSkill(IBattleUnit attackTarget, double timeDelta) => _attackManager.DealDamage(attackTarget);
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); }
public virtual void Start(IBattleUnit effectOwner) { DurationLeft = Duration; EffectOwner = effectOwner; InternalStart(effectOwner); }
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; }
public override void Update(IBattleUnit attackTarget, double timeDelta) { base.Update(attackTarget, timeDelta); _attackTarget = attackTarget; }
public void remoteUnit(IBattleUnit unit) { m_battleUnits.Remove(unit); }
public virtual void End() { EffectOwner = null; }