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); } } }
private void ShouldTriggerAttackerWarEffect(IHacherGroup group) { if (group.Attack == Attack.SU24) // loses half the health { if (group.Health % 2 == 0) { ApplyWarEffect(group); } } }
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); } }
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); } }
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; } }
public void AddGameData(string hackerGroupName, IHacherGroup hackerGroup) { Data.Add(hackerGroupName, hackerGroup); }
private void ShouldTriggerAttackerWarEffect(IHacherGroup group) { if (group.Attack == Attack.SU24 ) // loses half the health { if (group.Health % 2 == 0) { ApplyWarEffect(group); } } }
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); } } }