Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- string enemyName = map.GetLocation().GetEnemyName();
- Monster Monster = new enemyName(6);
- static void Combat(ref Map map, ref List<string> menuItems, ref Inventory Inventory, ref Player Player)
- {
- int choice;
- Player.SetInCombat(true);
- bool inCombat = Player.GetInCombat();
- string enemyName = map.GetLocation().GetEnemyName();
- Console.WriteLine(enemyName);
- Monster Monster = new Skeleton(6);
- //Player
- int hpPlayer = Player.GetHealth();
- int dpPlayer = Convert.ToInt32(Player.GetDefence());
- int attackPlayer = Player.GetAttackPoints();
- bool run = false;
- //Enemy
- string name = Monster.GetName();
- int hpEnemy = Monster.GetHealth();
- int dpEnemy = Monster.GetDefence();
- int enemyLevel = Monster.GetLevel();
- int attackEnemy = Monster.GetAttack();
- string attackName = Monster.GetAttackName();
- }
- abstract class Monster
- {
- protected int level;
- protected string name;
- protected string attackName;
- protected int maxHealth;
- protected int health;
- protected int attack;
- protected int defence;
- protected int healthMultiplier;
- protected int attackMultiplier;
- protected int defenceMultiplier;
- public Monster(int level)
- {
- this.level = level;
- }
- public string GetName()
- {
- return name;
- }
- public string GetAttackName()
- {
- return attackName;
- }
- public int GetMaxHealth()
- {
- return maxHealth;
- }
- public int GetHealth()
- {
- return health;
- }
- public int GetAttack()
- {
- return attack;
- }
- public int GetDefence()
- {
- return defence;
- }
- public abstract void TakeHit(int damage, ref Player Player);
- public int GetLevel()
- {
- return level;
- }
- }
- class Skeleton : Monster
- {
- public Skeleton(int level)
- : base(level)
- {
- //Monster stats
- name = "Skeleton";
- attackName = "Bone_thrower";
- healthMultiplier = 2;
- attackMultiplier = 1;
- defenceMultiplier = 25;
- maxHealth = (level * healthMultiplier);
- health = maxHealth;
- attack = (level / attackMultiplier);
- defence = (level / defenceMultiplier);
- }
- public override void TakeHit(int damage, ref Player Player)
- {
- if (health - damage <= 0)
- {
- Console.ForegroundColor = ConsoleColor.Red;
- Console.WriteLine("{0} took {1} points of damage.", name, damage);
- Console.ForegroundColor = ConsoleColor.White;
- Console.WriteLine("Press any keys to continue...");
- Console.ReadKey();
- Player.SetInCombat(false);
- }
- else
- {
- health -= damage;
- Console.ForegroundColor = ConsoleColor.Red;
- Console.WriteLine("{0} took {1} points of damage.", name, damage);
- Console.ForegroundColor = ConsoleColor.White;
- }
- }
- }
Add Comment
Please, Sign In to add comment