Beispiel #1
0
        public void AddSummonedStack(BattleUnitsStack summoned)
        {
            BattleUnitsStack stack = (BattleUnitsStack)summoned.Clone();

            battleUnitsStacks.Add(stack);
            refSummoned.Add(stack);
        }
Beispiel #2
0
        public void AttackStack(BattleUnitsStack target)
        {
            ApplyAttackEffects?.Invoke(target);
            float totalDamage = Damage * (1 + 0.05f * Math.Abs(Attack - target.Defence));

            target.GetDamage(totalDamage);
        }
Beispiel #3
0
        public void StackFight(BattleUnitsStack target)
        {
            GameAction gameAction = new GameAction(Actor, target);

            gameAction.Fight();
            StackAct();
        }
Beispiel #4
0
        public void StackCast(Skill skill, BattleUnitsStack target)
        {
            GameAction gameAction = new GameAction(Actor, target);

            gameAction.Cast(skill);
            StackAct();
        }
Beispiel #5
0
        protected override void Apply(BattleUnitsStack master)
        {
            BattleUnitsStack Master = this.master;

            Duration              = 1;
            baseDefence           = Master.Defence;
            Master.DefenceChange += HoldPosition;
        }
Beispiel #6
0
            public void Wait()
            {
                BattleUnitsStack waiting = ActiveStack;

                queue.Remove(waiting);
                queue.Insert(queue.Count - (waitCount % queue.Count), waiting);
                waitCount++;
                Update();
            }
Beispiel #7
0
 public BattleArmy(Army army)
 {
     Name = army.Name;
     battleUnitsStacks = new List <BattleUnitsStack>(9);
     refSummoned       = new List <BattleUnitsStack>(3);
     deadStacks        = new List <BattleUnitsStack>();
     foreach (var item in army.UnitsStacks)
     {
         BattleUnitsStack stack = new BattleUnitsStack(item.UnitClass, item.Count);
         battleUnitsStacks.Add(stack);
     }
 }
Beispiel #8
0
        public override object Clone()
        {
            UnitsStack       us       = (UnitsStack)base.Clone();
            BattleUnitsStack newStack = new BattleUnitsStack(us.UnitClass, us.Count);

            newStack.canRetaliate      = canRetaliate;
            newStack.LastUnitHitPoints = LastUnitHitPoints;
            newStack.StartCount        = StartCount;
            newStack.Count             = Count;
            newStack.Side = Side;
            return(newStack);
        }
Beispiel #9
0
            public void Add(BattleUnitsStack stack)
            {
                int i = queue.Count - waitCount;

                queue.Insert(i, stack);
                while (i > 0 && queue[i - 1].Initiative < queue[i].Initiative)
                {
                    BattleUnitsStack temp = queue[i - 1];
                    queue[i - 1] = queue[i];
                    queue[i]     = temp;
                    i--;
                }
            }
Beispiel #10
0
        public void Fight()
        {
            ApplyModifiers();
            BattleUnitsStack attacker = Subject;
            BattleUnitsStack target   = Object;

            attacker.AttackStack(target);
            Attacked?.Invoke();
            if (target.canRetaliate)
            {
                target.AttackStack(attacker);
            }
            target.canRetaliate = false;
            Revenged?.Invoke();
        }
Beispiel #11
0
 internal void Use(BattleUnitsStack subject, BattleUnitsStack target)
 {
     Cast(subject, target);
     Used = true;
 }
Beispiel #12
0
 protected abstract void Cast(BattleUnitsStack subject, BattleUnitsStack target);
Beispiel #13
0
 public GameAction(BattleUnitsStack subject, BattleUnitsStack _object)
 {
     Subject = subject;
     Object  = _object;
 }
Beispiel #14
0
 protected abstract void Apply(BattleUnitsStack master);
Beispiel #15
0
 public virtual void ApplyFeatures(BattleUnitsStack originStack)
 {
 }
Beispiel #16
0
 public void ResurrectStack(BattleUnitsStack target)
 {
     battleUnitsStacks.Add(target);
     deadStacks.Remove(target);
 }
Beispiel #17
0
 public void KillStack(BattleUnitsStack target)
 {
     battleUnitsStacks.Remove(target);
     deadStacks.Add(target);
 }
Beispiel #18
0
 internal void ApplyEffect(BattleUnitsStack master)
 {
     this.master = master;
     Apply(master);
 }