public BaseHero ProduceHero(string type, string name) { BaseHero bhero = null; if (type == "Druid") { bhero = new Druid(name); } else if (type == "Paladin") { bhero = new Paladin(name); } else if (type == "Rogue") { bhero = new Rogue(name); } else if (type == "Warrior") { bhero = new Warrior(name); } if (bhero == null) { throw new ArgumentException(ExceptionMessages.InvalidHeroExcMsg); } return(bhero); }
private void InitialiseVariables() { paladin = GameObject.FindWithTag("Paladin"); valkyrie = GameObject.FindWithTag("Valkyrie"); sage = GameObject.FindWithTag("Sage"); enemy = GameObject.FindWithTag("Enemy"); paladinController = paladin.GetComponent <Paladin>(); sageController = sage.GetComponent <Sage>(); valkyrieController = valkyrie.GetComponent <Valkyrie>(); enemyController = enemy.GetComponent <Enemy>(); paladinPortraitRenderer = paladinPortrait.GetComponent <SpriteRenderer>(); valkyriePortraitRenderer = valkyriePortrait.GetComponent <SpriteRenderer>(); sagePortraitRenderer = sagePortrait.GetComponent <SpriteRenderer>(); potionButtonImage = potionButton.GetComponent <Image>(); manaButtonImage = manaButton.GetComponent <Image>(); magic1ButtonImage = magic1Button.GetComponent <Image>(); magic2ButtonImage = magic2Button.GetComponent <Image>(); magic3ButtonImage = magic3Button.GetComponent <Image>(); special1ButtonImage = special1Button.GetComponent <Image>(); paladinSelectImage = paladinSelectButton.GetComponent <Image>(); valkyrieSelectImage = valkyrieSelectButton.GetComponent <Image>(); sageSelectImage = sageSelectButton.GetComponent <Image>(); potionButtonText = potionButton.GetComponentInChildren <Text>(); manaButtonText = manaButton.GetComponentInChildren <Text>(); magic1ButtonText = magic1Button.GetComponentInChildren <Text>(); magic2ButtonText = magic2Button.GetComponentInChildren <Text>(); magic3ButtonText = magic3Button.GetComponentInChildren <Text>(); special1ButtonText = special1Button.GetComponentInChildren <Text>(); paladinSelectText = paladinSelectButton.GetComponentInChildren <Text>(); valkyrieSelectText = valkyrieSelectButton.GetComponentInChildren <Text>(); sageSelectText = sageSelectButton.GetComponentInChildren <Text>(); }
public BaseHero CreateHero(string name, string heroType) { BaseHero hero = null; if (heroType == "Druid") { hero = new Druid(name); } else if (heroType == "Paladin") { hero = new Paladin(name); } else if (heroType == "Rogue") { hero = new Rogue(name); } else if (heroType == "Warrior") { hero = new Warrior(name); } else { throw new ArgumentException(Common.Constants.InvalidHeroExcMsg); } return(hero); }
public static BaseHero CreateHero(string hero, string name) { BaseHero baseHero; if (hero == "Druid") { baseHero = new Druid(name); } else if (hero == "Paladin") { baseHero = new Paladin(name); } else if (hero == "Rogue") { baseHero = new Rogue(name); } else if (hero == "Warrior") { baseHero = new Warrior(name); } else { throw new InvalidHeroException(); } return(baseHero); }
public static BaseHero CreateHero(string name, string type) { BaseHero curHero; if (type == "Druid") { curHero = new Druid(name); } else if (type == "Paladin") { curHero = new Paladin(name); } else if (type == "Rogue") { curHero = new Rogue(name); } else if (type == "Warrior") { curHero = new Warrior(name); } else { throw new InvalidOperationException(INV_HERO); } return(curHero); }
public Player CreateCharacter(string Class, UserInteraction ui) { Class = Class.ToLower(); Player newChar; switch(Class) { case "barbarian": newChar = new Barbarian(new int[] { 15, 15, 15, 10, 9, 10 }); newChar.SetArmor(Armors.chainShirt); newChar.SetMainHand(new MasterworkWeapon(Weapons.battleaxe)); newChar.SetName("Bob"); break; case "bard": newChar = new Bard(new int[] { 15, 10, 15, 10, 9, 15 }); newChar.SetArmor(Armors.leatherArmor); newChar.SetMainHand(new MasterworkWeapon(Weapons.rapier)); newChar.SetName("Bill"); break; case "cleric": newChar = new Cleric(new int[] { 15, 10, 15, 15, 9, 10 }); newChar.SetArmor(Armors.breastplate); newChar.SetMainHand(new MasterworkWeapon(Weapons.heavyMace)); newChar.SetOffHand(Armors.heavyWoodenShield); newChar.SetName("Chad"); break; case "druid": newChar = new Druid(new int[] { 15, 10, 15, 15, 9, 10 }); newChar.SetArmor(Armors.hideArmor); newChar.SetMainHand(new MasterworkWeapon(Weapons.club)); newChar.SetOffHand(Armors.heavyWoodenShield); newChar.SetName("Dave"); break; case "fighter": newChar = new Fighter(new int[] { 15, 15, 15, 10, 9, 10 }); newChar.SetArmor(Armors.breastplate); newChar.SetMainHand(new MasterworkWeapon(Weapons.longsword)); newChar.SetOffHand(Armors.heavyWoodenShield); newChar.SetName("Frank"); break; case "monk": newChar = new Monk(new int[] { 15, 10, 15, 10, 15, 9 }); newChar.SetMainHand(new MasterworkWeapon(Weapons.quarterstaff)); newChar.SetName("Molly"); break; case "paladin": newChar = new Paladin(new int[] { 15, 10, 15, 9, 15, 10 }); newChar.SetArmor(Armors.breastplate); newChar.SetMainHand(new MasterworkWeapon(Weapons.longsword)); newChar.SetOffHand(Armors.heavyWoodenShield); newChar.SetName("Phil"); break; case "ranger": newChar = new Ranger(new int[] { 15, 10, 15, 9, 15, 10 }); newChar.SetArmor(Armors.leatherArmor); newChar.SetMainHand(new MasterworkWeapon(Weapons.longbow)); newChar.SetName("Randy"); break; case "rogue": newChar = new Rogue(new int[] { 15, 10, 15, 15, 9, 10 }); newChar.SetArmor(Armors.leatherArmor); newChar.SetMainHand(new MasterworkWeapon(Weapons.rapier)); newChar.SetName("Rudy"); break; case "sorcerer": newChar = new Sorcerer(new int[] { 10, 15, 15, 10, 9, 15 }); newChar.SetMainHand(new MasterworkWeapon(Weapons.lightCrossbow)); newChar.SetName("Steve"); break; case "wizard": newChar = new Wizard(new int[] { 10, 15, 15, 15, 9, 10 }); newChar.SetMainHand(new MasterworkWeapon(Weapons.lightCrossbow)); newChar.SetName("Willis"); break; default: newChar = new Barbarian(new int[] { 10, 10, 10, 10, 10, 10 }); newChar.SetArmor(Armors.chainShirt); newChar.SetMainHand(new MasterworkWeapon(Weapons.battleaxe)); newChar.SetName("Default"); break; } newChar.SetUI(ui); newChar.AddItems(new Item[] { Consumables.minorHealthPotion, Consumables.minorHealthPotion, Consumables.minorManaPotion, Consumables.minorManaPotion, Consumables.minorHarmingPotion, Consumables.minorHarmingPotion }); return newChar; }
private void AddPaladinLoss(HSCounter hsc) { Paladin paladin = new Paladin(); paladin.LoseButton_Clicked(hsc); }
private void AddPaladinWin(HSCounter hsc) { Paladin paladin = new Paladin(); paladin.WinButton_Clicked(hsc); }