Example #1
0
        public override bool UpdateView(FightView fightView)
        {
            if (numSteps == 0)
            {
                if (Damage == 0)
                {
                    fightView.AddLabelToCharacter(Target, "Miss", Color.LightGray, LabelPosition.TOP_RIGHT_ANIMATE, LABEL_FONT);
                }
                else if (Crit)
                {
                    fightView.AddLabelToCharacter(Target, Damage.ToString(), Color.DarkRed, LabelPosition.TOP_RIGHT_ANIMATE, CRIT_FONT);
                }
                else
                {
                    fightView.AddLabelToCharacter(Target, Damage.ToString(), Color.Tomato, LabelPosition.TOP_RIGHT_ANIMATE, LABEL_FONT);
                }
            }
            if (currentHp != DesiredHitPoints)
            {
                currentHp += damagePerStep;
                fightView.UpdateCharacterHealth(Target, Math.Max(currentHp, DesiredHitPoints));
            }
            // Last step
            if (numSteps == TOTAL_STEPS-1)
            {
                currentHp = DesiredHitPoints;
                fightView.UpdateCharacterHealth(Target, DesiredHitPoints);
            }
            if (currentHp == 0)
            {
                fightView.KillCharacter(Target);
            }

            numSteps++;
            return (numSteps == TOTAL_STEPS);
        }
Example #2
0
 public override bool UpdateView(FightView fightView)
 {
     fightView.MoveCharacter(Attacker, xMovement[numSteps], 0.0f);
     numSteps++;
     return (numSteps == TOTAL_STEPS);
 }
Example #3
0
 public override bool UpdateView(FightView fightView)
 {
     return true;
 }
Example #4
0
 public override bool UpdateView(FightView fightView)
 {
     fightView.DisplayText(Text);
     return true;
 }
Example #5
0
 public virtual bool UpdateView(FightView fightView)
 {
     throw new NotImplementedException();
 }