public static ICharacters Spell(ref ICharacters character, ref ICharacters opponent) { int AttackDealt; int HitPointsDefender; Random rand = new Random(); AttackDealt = OffensiveActionsOpponent.IntelligenceAction(opponent); HitPointsDefender = character.HitPoints; if (DefenseActionsOpponent.ArmorAction(character) > AttackDealt) { character.HitPoints = HitPointsDefender - 10; } else { character.HitPoints = HitPointsDefender - ((AttackDealt) * DefenseActionsOpponent.LuckAction(character)); } return(character); }
public static ICharacters Attack(ref ICharacters character, ref ICharacters opponent) { int AttackDealt; int HitPointsDefender; Random rand = new Random(); AttackDealt = OffensiveActionsOpponent.StrengthAction(opponent); HitPointsDefender = character.HitPoints; if (DefenseActionsOpponent.ArmorAction(character) > AttackDealt) { character.HitPoints = HitPointsDefender - 5; } else { character.HitPoints = HitPointsDefender - ((AttackDealt) - DefenseActionsOpponent.ArmorAction(character)) * DefenseActionsOpponent.LuckAction(character); } return(character); }