public override Player InitialyPlayer() { #region fillVariables var createPlayer = new CreatePlayer(); createPlayer.ShowDialog(); //createPlayer Window will show when you run this program string name = createPlayer.name; classP = createPlayer.classP; int h = createPlayer.health; int dam = createPlayer.damage; int def = createPlayer.defense; whoP = 0; whoE = 1; int roll = dice.DiceRoll(); #endregion Player returnPlayer = null; switch (classP) { case 0: // warrior if (roll % 2 == 0) //if sude { inventoryPlayer = new Sword("Broken Sword", 5, 5); } else //if liche { inventoryPlayer = new Sword("Straight Sword", 10, 25); } inventoryListPlayer.Add(inventoryPlayer); //lets add that generated shit into player inventory returnPlayer = new Warrior(h, dam, def, name, whoP); //create player as warrior break; case 1: //mage returnPlayer = new Mage(h, dam, def, name, whoP); break; } return(returnPlayer); /* * * if (roll % 2 == 0) //if sude * inventoryEnemy = new Sword("Broken Sword", 5, 5); * else //if liche * inventoryEnemy = new Sword("Straight Sword", 10, 25); * * inventoryListEnemy.Add(inventoryEnemy); */ }
public Player ChooseOfEnemy(int whoE, Character player) { Player returnEnemy = null; int roll = dice.DiceRoll(); if (roll % 2 == 0) //if sude { returnEnemy = new Warrior(dice.DiceRoll(player.Health) + 5, dice.DiceRoll(player.Damage) + 6, dice.DiceRoll(player.Defense) + 6, "Ferda", whoE); } else //if liche { returnEnemy = new Mage(dice.DiceRoll(player.Health) + 3, dice.DiceRoll(player.Damage) + 7, dice.DiceRoll(player.Defense) + 2, "Janko", whoE); } return(returnEnemy); }