/// <summary> /// Constructs the Main class. /// </summary> /// <param name="_mainWindow">Instance of the MainWindow.</param> /// <param name="bpwindow">Instance of the BackpackWindow</param> /// <param name="crcwindow">Instance of the ClassRaceChoiceWindow</param> /// <param name="swindow">Instance of the StatWindow</param> public Main(MainWindow _mainWindow, BackpackWindow bpwindow, ClassRaceChoiceWindow crcwindow, StatWindow swindow) { //save the windows mainWindow = _mainWindow; bw = bpwindow; cw = crcwindow; sw = swindow; //instantiate the player player = new Player(); //make a new map map = new Map(7); //for the libraries mainBookList = new List<Book>() { }; //these are for data binding in the ClassRaceChoiceWindow. And any other time you might want a list with all of the Classes and Races mainClassList = new List<PlayerClass>() { new Knight(), new Lancer(), new Brawler(), new Mage(), new Ranger(), new Rogue(), new BladeDancer(), new Assassin(), new DreadKnight(), new Jester() }; mainRaceList = new List<Race>() { new Human(), new Elf(), new Dwarf(), new Orc(), new Lycanthrope(), new Halfdragon(), new Revenant(), new Djinn(), new Vampire(), new Demon() }; }
public override int Attack(Player player, out string used) { Dice d = new Dice(); int dmg = 0; used = abilities[Program.random.Next(0, abilities.Count)]; switch(used) { case "Attack": dmg = Math.Max(d.roll(1, atk) - player.def, 1); break; case "Sticky Smash": dmg = Math.Max(d.roll(2, atk) - player.def, 1); break; } return dmg; }
public virtual void ApplyEffect(object Target) { turns--; //safe cast the target to a player to see what it is p = Target as Player; //if it isn't nu;;, it's a Player if (p != null) isPlayer = true; //otherwise it's an Enenmy else { isPlayer = false; //set the target to be an Enemy e = Target as Enemy; } }
public virtual int Attack(Player player, out string used) { used = ""; return 0; }