Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using MortalEngines.Entities.Contracts;
- using System;
- using System.Collections.Generic;
- using System.Text;
- namespace MortalEngines.Entities
- {
- public class Fighter : BaseMachine, IFighter
- {
- private const double health = 200;
- private double attackPoints;
- private bool aggressiveMode;
- public Fighter(string name, double attackPoints, double defensePoints) : base(name, attackPoints, defensePoints, health)
- {
- this.aggressiveMode = true;
- this.attackPoints = attackPoints + 50;
- this.DefensePoints = defensePoints - 25;
- }
- public override double AttackPoints => attackPoints;
- public override double DefensePoints { get; set; }
- public bool AggressiveMode => aggressiveMode;
- public void ToggleAggressiveMode()
- {
- this.aggressiveMode = !this.aggressiveMode;
- if(this.AggressiveMode)
- {
- attackPoints += 50;
- DefensePoints -= 25;
- }
- else
- {
- attackPoints -= 50;
- DefensePoints += 25;
- }
- }
- public override string ToString()
- {
- var sb = new StringBuilder(base.ToString());
- sb.AppendLine();
- sb.Append($" *Aggressive: {(this.AggressiveMode ? "ON" : "OFF")}");
- return sb.ToString();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement