Example #1
0
        private void ShouldTrigerVictimWarEffect(IHacherGroup attacker, IHacherGroup attacked)
        {
            double halfHealth = Math.Ceiling(((double)attacked.Health / 2));

            if (attacker.Attack == Attack.Paris)
            {
                attacked.Health -= attacker.Damage;
                if (attacked.Health < 0)
                {
                    attacked.Health = 0;
                }
                if (attacked.Health <= halfHealth)
                {
                    ApplyWarEffect(attacked);
                }
            }
            else if (attacker.Attack == Attack.SU24)
            {
                attacked.Health -= attacker.Damage * 2;
                // here
                double halfhealth = Math.Ceiling((double)attacker.Health / 2);
                attacker.Health = (int)halfhealth;

                if (attacked.Health < 0)
                {
                    attacked.Health = 0;
                }
                if (attacked.Health <= halfHealth)
                {
                    ApplyWarEffect(attacked);
                }
            }
        }
Example #2
0
 private void ShouldTriggerAttackerWarEffect(IHacherGroup group)
 {
     if (group.Attack == Attack.SU24)  // loses half the health
     {
         if (group.Health % 2 == 0)
         {
             ApplyWarEffect(group);
         }
     }
 }
Example #3
0
 public void PerformAttack(IHacherGroup attacker, IHacherGroup attacked)
 {
     if (attacker.Attack == Attack.Paris)
     {
         attacked.Health -= attacker.Damage;
     }
     else
     {
         double halfhealth = Math.Ceiling((double)attacker.Health / 2);
         attacker.Health  = (int)halfhealth;
         attacked.Health -= (attacker.Damage * 2);
     }
 }
Example #4
0
 public void PerformAttack(IHacherGroup attacker, IHacherGroup attacked)
 {
     if (attacker.Attack == Attack.Paris)
     {
         attacked.Health -= attacker.Damage;
     }
     else
     {
         double halfhealth = Math.Ceiling((double)attacker.Health / 2);
         attacker.Health = (int)halfhealth;
         attacked.Health -= (attacker.Damage*2);
     }
 }
Example #5
0
 private void ApplyWarEffect(IHacherGroup hacherGroup)
 {
     if (hacherGroup.WarEffect.WarEffectType == WarEffectType.Jihad)
     {
         hacherGroup.Damage *= 2;
         hacherGroup.WarEffect.IsEffectActive    = true;
         hacherGroup.WarEffect.IsWarEffectTogled = true;
     }
     else
     {
         hacherGroup.Health += 50;
         hacherGroup.WarEffect.IsEffectActive    = true;
         hacherGroup.WarEffect.IsWarEffectTogled = true;
     }
 }
Example #6
0
 public void AddGameData(string hackerGroupName, IHacherGroup hackerGroup)
 {
     Data.Add(hackerGroupName, hackerGroup);
 }
Example #7
0
 private void ShouldTriggerAttackerWarEffect(IHacherGroup group)
 {
     if (group.Attack == Attack.SU24 ) // loses half the health
     {
         if (group.Health % 2 == 0)
         {
          ApplyWarEffect(group);
         }
     }
 }
Example #8
0
        private void ShouldTrigerVictimWarEffect(IHacherGroup attacker, IHacherGroup attacked)
        {
            double halfHealth = Math.Ceiling(((double)attacked.Health/2));
            if (attacker.Attack == Attack.Paris)
            {
                attacked.Health -= attacker.Damage;
                if (attacked.Health < 0)
                {
                    attacked.Health = 0;
                }
                if (attacked.Health <= halfHealth)
                {
                    ApplyWarEffect(attacked);
                }
            }
            else if(attacker.Attack == Attack.SU24)
            {
                attacked.Health -= attacker.Damage*2;
                // here
                double halfhealth = Math.Ceiling((double)attacker.Health / 2);
                attacker.Health = (int)halfhealth;

                if (attacked.Health < 0)
                {
                    attacked.Health = 0;
                }
                if (attacked.Health <= halfHealth)
                {
                    ApplyWarEffect(attacked);
                }

            }
        }
Example #9
0
        private void ApplyWarEffect(IHacherGroup hacherGroup)
        {
            if (hacherGroup.WarEffect.WarEffectType == WarEffectType.Jihad)
            {
                hacherGroup.Damage *= 2;
                hacherGroup.WarEffect.IsEffectActive = true;
                hacherGroup.WarEffect.IsWarEffectTogled = true;
            }
            else
            {

                hacherGroup.Health += 50;
                hacherGroup.WarEffect.IsEffectActive = true;
                hacherGroup.WarEffect.IsWarEffectTogled = true;
            }
        }
Example #10
0
 public void AddGameData(string hackerGroupName, IHacherGroup hackerGroup)
 {
     Data.Add(hackerGroupName, hackerGroup);
 }