protected override void CreateCharacter(string[] inputParams) { var type = inputParams[1]; var name = inputParams[2]; var x = int.Parse(inputParams[3]); var y = int.Parse(inputParams[4]); var team = inputParams[5]; switch (type) { case "mage": var mage = new Mage(name, x, y, team == "Blue" ? Team.Blue : Team.Red); this.characterList.Add(mage); break; case "warrior": var warrior = new Warrior(name, x, y, team == "Blue" ? Team.Blue : Team.Red); this.characterList.Add(warrior); break; case "healer": var healer = new Healer(name, x, y, team == "Blue" ? Team.Blue : Team.Red); this.characterList.Add(healer); break; } }
protected override void CreateCharacter(string[] inputParams) { int x; int y; Team team; Character character; switch (inputParams[1].ToLower()) { case "mage": x = int.Parse(inputParams[3]); y = int.Parse(inputParams[4]); team = (Team)Enum.Parse(typeof(Team), inputParams[5], true); character = new Mage(inputParams[2], x, y, team); this.characterList.Add(character); break; case "warrior": x = int.Parse(inputParams[3]); y = int.Parse(inputParams[4]); team = (Team)Enum.Parse(typeof(Team), inputParams[5], true); character = new Warrior(inputParams[2], x, y, team); this.characterList.Add(character); break; case "healer": x = int.Parse(inputParams[3]); y = int.Parse(inputParams[4]); team = (Team)Enum.Parse(typeof(Team), inputParams[5], true); character = new Healer(inputParams[2], x, y, team); this.characterList.Add(character); break; } }
protected override void CreateCharacter(string[] inputParams) { Character character = null; string id = inputParams[2]; int x = int.Parse(inputParams[3]); int y = int.Parse(inputParams[4]); Team team = (Team)Enum.Parse(typeof(Team), inputParams[5]); switch (inputParams[1]) { case "mage": character = new Mage(id, x, y, team); break; case "warrior": character = new Warrior(id, x, y, team); break; case "healer": character=new Healer(id,x,y,team); break; default: throw new InvalidOperationException("Character not found in the game!"); } this.characterList.Add(character); }
protected override void CreateCharacter(string[] inputParams) { Character newCharacter; switch (inputParams[1].ToLower()) { case "warrior": newCharacter = new Warrior( inputParams[2], int.Parse(inputParams[3]), int.Parse(inputParams[4]), (Team)Enum.Parse(typeof(Team), inputParams[5], true)); this.characterList.Add(newCharacter); break; case "mage": newCharacter = new Mage( inputParams[2], int.Parse(inputParams[3]), int.Parse(inputParams[4]), (Team)Enum.Parse(typeof(Team), inputParams[5], true)); this.characterList.Add(newCharacter); break; case "healer": newCharacter = new Healer( inputParams[2], int.Parse(inputParams[3]), int.Parse(inputParams[4]), (Team)Enum.Parse(typeof(Team), inputParams[5], true)); this.characterList.Add(newCharacter); break; } }
private void chooseCharacterButton_Click(object sender, EventArgs e) { if (string.IsNullOrEmpty(nameInput.Text)) { Label erroLabel = new Label(); erroLabel.Text = "You must enter character name before you press \"Choose character\" button"; erroLabel.Enabled = true; erroLabel.Visible = true; var labelLocation = new Point(200,450); erroLabel.Font = new Font(FontFamily.GenericSerif, 10); erroLabel.Location = labelLocation; erroLabel.AutoSize = true; this.Controls.Add(erroLabel); } else { if (this.warriorRadioButton.Checked) { Player player = new Warrior(new Position(0, 0), nameInput.Text); CreatePlayerAndStartGame(player); } else if (this.archerRadioButton.Checked) { Player player = new Archer(new Position(0, 0), nameInput.Text); CreatePlayerAndStartGame(player); } else if (this.mageRadioButton.Checked) { Player player = new Mage(new Position(0, 0), nameInput.Text); CreatePlayerAndStartGame(player); } } }
/// <summary> /// Let's the warrior evolve with the posibility to use buddy as a partner /// </summary> /// <param name="warrior">Main warrior</param> /// <param name="buddy">Possible mutation partner</param> /// <param name="crossover">True if crossover happend</param> /// <returns></returns> public Warrior EvolveWarrior(Warrior warrior, Warrior buddy, ref bool crossover) { Warrior cWarrior = warrior.DeepCopy(); Warrior cBuddy = buddy.DeepCopy(); int changes = 0; while(changes < Statics.MainRandom.Next(1,6)) { IEvolverPlugin selectedPlugin; while (true) { selectedPlugin = PluginManager[Statics.MainRandom.Next(PluginManager.Plugins.Count)]; if (!(selectedPlugin is IEvolverPluginExtended)) { break; } IEvolverPluginExtended extendedPlugin = (IEvolverPluginExtended) selectedPlugin; if (extendedPlugin.Possible(warrior, Parameters)) { break; } } if (!(Statics.MainRandom.NextDouble() > selectedPlugin.Chance)) continue; if (selectedPlugin.Name == "Crossover") { crossover = true; } cWarrior = selectedPlugin.Execute(cWarrior, cBuddy, Parameters); changes++; } cWarrior.Generation++; cWarrior.Author = "NetVolve"; cWarrior.SetWarriorName(); return cWarrior; }
protected override void CreateCharacter(string[] inputParams) { // create characterClass id x y team string type = inputParams[1]; string id = inputParams[2]; int x = int.Parse(inputParams[3]); int y = int.Parse(inputParams[4]); string teamTmp = inputParams[5]; Team team; if(teamTmp.ToLower() == "red") team = Team.Red; else if(teamTmp.ToLower() == "blue") team = Team.Blue; else throw new ArgumentOutOfRangeException("No such team, please choose either red or blue."); switch (type.ToLower()) { case "warrior": Character warrior = new Warrior(id, x, y, team); characterList.Add(warrior); break; case "mage": Character mage = new Mage(id, x, y, team); characterList.Add(mage); break; case "healer": Character healer = new Healer(id, x, y, team); characterList.Add(healer); break; default: break; } }
protected override void CreateCharacter(string[] inputParams) { var type = inputParams[1]; var name = inputParams[2]; var x = int.Parse(inputParams[3]); var y = int.Parse(inputParams[4]); var team = (Team)Enum.Parse(typeof(Team), inputParams[5], true); Character cha; switch (type) { case "warrior": cha = new Warrior(name, x, y, team); break; case "mage": cha = new Mage(name, x, y, team); break; case "healer": cha = new Healer(name, x, y, team); break; default: return; } this.characterList.Add(cha); }
protected override void CreateCharacter(string[] inputParams) { Character character; string characterType = inputParams[1]; string id = inputParams[2]; int x = int.Parse(inputParams[3]); int y = int.Parse(inputParams[4]); Team team = (Team)Enum.Parse(typeof(Team), inputParams[5]); switch (characterType) { case "mage": character = new Mage(id, x, y, team); break; case "warrior": character = new Warrior(id, x, y, team); break; case "healer": default: character = new Healer(id, x, y, team); break; } characterList.Add(character); }
protected override void CreateCharacter(string[] inputParams) { string typeOfCharacter = inputParams[1]; string characterId = inputParams[2]; int X = int.Parse(inputParams[3]); int Y = int.Parse(inputParams[4]); Team team = (Team) Enum.Parse(typeof (Team), inputParams[5]); Character character; switch (typeOfCharacter) { case "healer": character = new Mage(characterId, X, Y, team); break; case "mage": character = new Mage(characterId, X, Y, team); break; case "warrior": character = new Warrior(characterId, X, Y, team); break; default: throw new ArgumentException("Such character doesn't exist"); } characterList.Add(character); }
public ItemAbility(Warrior Attacker, Item Item) { this.attacker = Attacker; this.item = Item; this.target = this.attacker.Target; this.speedBonus = item.Speed; this.effectType = item.UsageAbility.EffectType; }
public Warrior Execute(Warrior father, Warrior mother, Parameter parameter) { if (father.CodeLines.Count() >= parameter.MarsParameters.MaxWarriorLen) return father; List<WarriorLine> newLines = new List<WarriorLine>(father.CodeLines); newLines.Insert(Statics.MainRandom.Next(father.CodeLines.Count()), Generator.GenerateRandomLine(parameter.MarsParameters.Coresize)); father.CodeLines = newLines.ToArray(); return father; }
public Warrior Execute(Warrior father, Warrior mother, Parameter parameter) { for (int i = 0; i < Statics.MainRandom.Next(father.CodeLines.Count() / 2); i++) { father.CodeLines[Statics.MainRandom.Next(father.CodeLines.Count())].Instructor = (Instructors)(byte)Statics.MainRandom.Next(EnumHelper.GetEnumLen(typeof(Instructors))); } return father; }
public Warrior Execute(Warrior father, Warrior mother, Parameter parameter) { if (father.CodeLines.Count() <= 2) return father; List<WarriorLine> newLines = new List<WarriorLine>(father.CodeLines); newLines.RemoveRange(Statics.MainRandom.Next(father.CodeLines.Count()), 1); father.CodeLines = newLines.ToArray(); return father; }
private Warrior Random(Warrior father, Warrior mother) { for (int i = 0; i < Statics.MainRandom.Next(father.CodeLines.Count() / 2); i++) { father.CodeLines[Statics.MainRandom.Next(father.CodeLines.Count())] = mother.CodeLines[Statics.MainRandom.Next(mother.CodeLines.Count())].DeepCopy(); } return father; }
protected override void CreateCharacter(string[] inputParams) { Character character; Team team; switch (inputParams[5].ToLower()) { case "red": team = Team.Red; break; case "blue": team = Team.Blue; break; default: throw new ApplicationException("Wrong color team."); } switch (inputParams[1].ToLower()) { case "warrior": character = new Warrior( id: inputParams[2], x: int.Parse(inputParams[3]), y: int.Parse(inputParams[4]), healthPoints: 100, defensePoints: 30, team: team, range: 10, attackPoints: 60); break; case "healer": character = new Healer( id: inputParams[2], x: int.Parse(inputParams[3]), y: int.Parse(inputParams[4]), healthPoints: 100, defensePoints: 0, team: team, range: 10, healingPoints: 30); break; case "mage": character = new Mage( id: inputParams[2], x: int.Parse(inputParams[3]), y: int.Parse(inputParams[4]), healthPoints: 100, defensePoints: 5, team: team, range: 10, attackPoints: 30); break; default: throw new ApplicationException("No such kind of hero."); } this.characterList.Add(character); }
static void Main() { var axeWarrior = new Warrior(new Axe()); var swordWarrior = new Warrior(new Sword()); var axeMage = new Mage(new Axe()); var swordMage = new Mage(new Sword()); Console.WriteLine(axeWarrior); Console.WriteLine(swordMage); }
public void convertWarrior(NPC npc){ if (ressource.gold >= 1 && ressource.blood >= 1 && ressource.holyWater>=1) { removeWarriorResource (); int position = npc.position; npc = new Warrior (); npc.setPosition (position); this.party.addNPC (npc); } }
static void Main() { Warrior stamat = new Warrior(); Priest maria = new Priest(); Mage kircho = new Mage(); stamat.Attack(kircho); Console.WriteLine(kircho.Health); }
public UnarmedAttack(Warrior Attacker, DamageType DamageType, int SpeedBonus, int AccuracyBonus, Ability Proc) { this.effectType = EffectType.Attack; this.attacker = Attacker; this.speedBonus = SpeedBonus; this.accuracyBonus = AccuracyBonus; this.effectiveness = this.attacker.Strength; this.damageType = DamageType; this.proc = Proc; }
private Warrior LowerUpper(Warrior father, Warrior mother) { for (int i = 0; i < father.CodeLines.Count() / 2; i++) { if (father.CodeLines.Length - 1 - i < 0 || i >= mother.CodeLines.Length) break; father.CodeLines[father.CodeLines.Length - 1 - i] = mother.CodeLines[i].DeepCopy(); } return father; }
public WeaponAttack(Warrior Attacker, Weapon Weapon) { this.name = weapon.Name; this.effectType = EffectType.Attack; this.attacker = Attacker; this.weapon = Weapon; this.speedBonus = this.weapon.Speed; this.effectiveness = this.attacker.Strength + this.weapon.Damage; this.damageType = this.weapon.DamageType; this.proc = this.weapon.Proc; }
public static void Main() { Character axeWarrior = new Warrior(new Axe()); Warrior swordWarrior = new Warrior(new Sword()); Mage axeMage = new Mage(new Axe()); Mage swordMage = new Mage(new Sword()); Console.WriteLine(axeWarrior); Console.WriteLine(swordWarrior); Console.WriteLine(axeMage); Console.WriteLine(swordMage); }
public Warrior Execute(Warrior father, Warrior mother, Parameter parameter) { for (int i = 0; i < Statics.MainRandom.Next(father.CodeLines.Count() / 2); i++) { if (Statics.MainRandom.NextDouble() >= 0.5) father.CodeLines[Statics.MainRandom.Next(father.CodeLines.Count())].Number1 = (short)Statics.MainRandom.Next(parameter.MarsParameters.Coresize); else father.CodeLines[Statics.MainRandom.Next(father.CodeLines.Count())].Number2 = (short)Statics.MainRandom.Next(parameter.MarsParameters.Coresize); } return father; }
/// <summary> /// Simulates a fight between two warrior's /// </summary> /// <param name="attacker">The attacking warrior</param> /// <param name="defender">The defending warrior</param> /// <returns></returns> public Result SimulateFight(Warrior attacker, Warrior defender) { int win1 = 0, win2 = 0, draw = 0; Fight2Warriors( attacker.ToShortString(), defender.ToShortString(), Parameters.MarsParameters.Coresize, Parameters.MarsParameters.Cycles, Parameters.MarsParameters.MaxProcess, Parameters.MarsParameters.Rounds, Parameters.MarsParameters.MaxWarriorLen, ref win1, ref win2, ref draw); return new Result(win1, win2, draw); }
public Warrior Execute(Warrior father, Warrior mother, Parameter parameter) { for (int i = 0; i < Statics.MainRandom.Next(father.CodeLines.Count() / 2); i++) { if (Statics.MainRandom.NextDouble() >= 0.5) father.CodeLines[Statics.MainRandom.Next(father.CodeLines.Count())].AddressingMode1 = (AddressingModes) (byte) Statics.MainRandom.Next(EnumHelper.GetEnumLen(typeof (AddressingModes))); else father.CodeLines[Statics.MainRandom.Next(father.CodeLines.Count())].AddressingMode2 = (AddressingModes) (byte) Statics.MainRandom.Next(EnumHelper.GetEnumLen(typeof (AddressingModes))); } return father; }
static void Main() { Axe axe = new Axe(); Sword sword = new Sword(); Warrior axeWarrior = new Warrior(axe); Warrior swordWarrior = new Warrior(sword); Mage axeMage = new Mage(axe); Mage swordMage = new Mage(sword); Console.WriteLine(axeWarrior); Console.WriteLine(swordWarrior); Console.WriteLine(axeMage); Console.WriteLine(swordMage); }
public static IUnit Create(UnitType type, string name, int x, int y) { switch (type) { case UnitType.Warrior: var warrior = new Warrior(x, y, name); return warrior; case UnitType.IceGiant: var iceGiant = new IceGiant(x, y, name); return iceGiant; case UnitType.Mage: var mage = new Mage(x, y, name); return mage; default: throw new NotImplementedException(); } }
protected override void CreateCharacter(string[] inputParams) { Character character = null; Team team; switch (inputParams[5].ToLower()) { case "red": team = Team.Red; break; case "blue": team = Team.Blue; break; default: throw new ArgumentException("Unknown team."); } switch (inputParams[1].ToLower()) { case "warrior": character = new Warrior( id: inputParams[2], x: int.Parse(inputParams[3]), y: int.Parse(inputParams[4]), team: team); break; case "healer": character = new Healer( id: inputParams[2], x: int.Parse(inputParams[3]), y: int.Parse(inputParams[4]), team: team); break; case "mage": character = new Mage( id: inputParams[2], x: int.Parse(inputParams[3]), y: int.Parse(inputParams[4]), team: team); break; default: throw new ArgumentException("Wrong character."); } this.characterList.Add(character); }
public Character CreateCharacter(charactertype type) { Character character = null; if (type.Equals(charactertype.orc)) { character = new Orc(); } else if (type.Equals(charactertype.sorcerer)) { character = new Sorcerer(); } else if (type.Equals(charactertype.townperson)) { character = new TownPerson(); } else if (type.Equals(charactertype.warrior)) { character = new Warrior(); } return character; }
public async Task <List <Warrior> > GetNonSelectedWarriors(Warrior warriorToExclude) { return(await _warriorRepository.GetNonSelectedWarriors(warriorToExclude)); }
public HireWarrior(CaptainId captainId, Warrior warrior) : base(captainId) { this.Warrior = warrior; }
public async Task <Warrior> AddWarrior(Warrior warrior) { return(await _warriorRepository.Add(warrior)); }
public void ThrowsArgumentException_WhenInvalidValueIsPassed() { var hero = new Warrior("Pessho", HeroClass.Warrior, 100, -4, 15); }
// this is a function inside a class because of that we call it method or action inside class public void Greeting(Warrior warrior) { System.Console.WriteLine($@"{this.name} Greetes {warrior.Name}!"); }
public void OnSurvive(Warrior survivor) { this.survivor = survivor; }
public void Setup() { warrior = new Warrior("Pesho", 50, 100); barbarian = new Warrior("Stoyan", 100, 100); arena = new Arena(); }
public void NewCharacter_CreatingAcharacter_ReturnLvlOfCharacter() { Warrior warrior = new Warrior("Valdemar"); Assert.Equal(1, warrior.Level); }
public void Setup() { testWarrior = new Warrior("testWarrior", 50, 80); newArena = new Arena(); }
void IHealth.DoBattle(Warrior w) { //warrior can transition to another state based on the outcome w.SetHealth(new Weak()); }
public void LevelUp_LevelingUpCharacterWithZeroOrNegativeNumber_ShouldThrowArgumentException(int lvl) { Warrior warrior = new Warrior("Valdemar"); Assert.Throws <ArgumentException>(() => warrior.LevelUp(lvl)); }
/// <summary> /// Lock timing for all the Warrior attacks and actions. /// </summary> public float TimingLock(Warrior warrior, string action) { float timing = 0f; if (warrior == Warrior.Archer) { if (action == "attack1") { timing = 0.7f; } } else if (warrior == Warrior.Brute) { if (action == "attack1") { timing = 1f; } } else if (warrior == Warrior.Crossbow) { if (action == "attack1") { timing = 0.8f; } } else if (warrior == Warrior.Hammer) { if (action == "attack1") { timing = 1.25f; } } else if (warrior == Warrior.Karate) { if (action == "attack1") { timing = 0.7f; } } else if (warrior == Warrior.Knight) { if (action == "attack1") { timing = 0.6f; } } else if (warrior == Warrior.Mage) { if (action == "attack1") { timing = 1.1f; } } else if (warrior == Warrior.Ninja) { if (action == "attack1") { timing = 0.6f; } } else if (warrior == Warrior.Sorceress) { if (action == "attack1") { timing = 1.2f; } } else if (warrior == Warrior.Spearman) { if (action == "attack1") { timing = 1f; } } else if (warrior == Warrior.Swordsman) { if (action == "attack1") { timing = 0.9f; } } else if (warrior == Warrior.TwoHanded) { if (action == "attack1") { timing = 0.9f; } } return(timing); }
/// <summary> /// Kauft einen Warrior. /// Zur Berechnung der Bewegungsreichweite einer Ameise wird die Diagonale des Spielfeldes mit dem gewählten moveRangeFactor multipliziert. /// (Eine Umrundung des Spielfeldes benötigt mindestens einen moveRangeFactor von Drei.) /// </summary> /// <param name="attackPower">Die Angriffsstärke der Ameise.</param> /// <param name="viewRange">Die Sichtweite der Ameise.</param> /// <param name="inventory">Die Maximale Anzahl an Zucker, die die Ameise tragen kann.</param> /// <param name="moveRangeFactor">Wie weit die Ameise gehen kann.</param> /// <param name="hp">Lebenspunkte der Ameise.</param> /// <returns>true wenn der Warrior erfolgreich gekauft wird andernfalls wenn man nicht genug Geld hat false.</returns> protected bool buyWarrior(int attackPower, int viewRange, int inventory, int moveRangeFactor, int hp) { Warrior w = new Warrior(attackPower, Game.Board, Player, viewRange, inventory, moveRangeFactor, hp); return(buyAnt(w)); }
public void Setup() { this.warrior = new Warrior("Maximus", 100, 100); }
public void Setup() { this.warrior = new Warrior("Ivan", 15, 100); }
public void OnDefeat(Warrior defeated) { this.defeated = defeated; }
public abstract void GiveBonus(Warrior warrior);
/// <summary> /// Returns units that are already children of UnitsParent object. /// </summary> public List <Unit> SpawnUnits(List <Cell> cells) { List <Unit> ret = new List <Unit>(); Vector2[] spawnPos = new Vector2[6]; spawnPos[0] = new Vector2(3, 1); spawnPos[1] = new Vector2(1, 1); spawnPos[2] = new Vector2(1, 3); spawnPos[3] = new Vector2(13, 8); spawnPos[4] = new Vector2(13, 10); spawnPos[5] = new Vector2(11, 10); SquadSelectionToFightScene Go = FindObjectOfType <SquadSelectionToFightScene>(); Debug.Log(Go.squad1.playerData[0].Skills[0].Name); List <UnitData> units = new List <UnitData>(); foreach (UnitData unitdata in Go.squad1.playerData) { units.Add(unitdata); } foreach (UnitData unitdata2 in Go.squad2.playerData) { units.Add(unitdata2); } for (int i = 0; i < units.Count; i++) { CurrentUnit = i; if (units[i].Class == "Warrior") { Transform Prefab = Instantiate(Resources.Load <Transform>("Prefabs/ASTR/Unit/Warrior0")); Warrior unit = Prefab.GetComponent <Warrior>(); if (unit != null) { var cell = cells.Find(x => x.OffsetCoord.Equals(spawnPos[i])); if (!cell.IsTaken) { cell.IsTaken = true; unit.Cell = cell; unit.transform.position = cell.transform.position; unit.Initialize(); unit.PlayerNumber = i; unit.TeamNumber = i / 3; unit.UnitName = units[i].Name; Prefab.transform.parent = UnitsParent; ret.Add(unit); }//Unit gets snapped to the nearest cell else { Destroy(unit.gameObject); }//If the nearest cell is taken, the unit gets destroyed. } else { Debug.LogError("Invalid object in Units Parent game object"); } } else if (units[i].Class == "Mage") { Transform Prefab = Instantiate(Resources.Load <Transform>("Prefabs/ASTR/Unit/Mage0")); Mage unit = Prefab.GetComponent <Mage>(); if (unit != null) { var cell = cells.Find(x => x.OffsetCoord.Equals(spawnPos[i])); if (!cell.IsTaken) { cell.IsTaken = true; unit.Cell = cell; unit.transform.position = cell.transform.position; unit.Initialize(); unit.PlayerNumber = i; unit.TeamNumber = i / 3; unit.UnitName = units[i].Name; Prefab.transform.parent = UnitsParent; ret.Add(unit); }//Unit gets snapped to the nearest cell else { Destroy(unit.gameObject); }//If the nearest cell is taken, the unit gets destroyed. } else { Debug.LogError("Invalid object in Units Parent game object"); } } else { Transform Prefab = Instantiate(Resources.Load <Transform>("Prefabs/ASTR/Unit/Rogue0")); Rogue unit = Prefab.GetComponent <Rogue>(); if (unit != null) { var cell = cells.Find(x => x.OffsetCoord.Equals(spawnPos[i])); if (!cell.IsTaken) { cell.IsTaken = true; unit.Cell = cell; unit.transform.position = cell.transform.position; unit.Initialize(); unit.PlayerNumber = i; unit.TeamNumber = i / 3; unit.UnitName = units[i].Name; Prefab.transform.parent = UnitsParent; ret.Add(unit); }//Unit gets snapped to the nearest cell else { Destroy(unit.gameObject); }//If the nearest cell is taken, the unit gets destroyed. } else { Debug.LogError("Invalid object in Units Parent game object"); } } } return(ret); }
static void Main(string[] args) { Console.WriteLine("----Demo: Generate some characters----"); Mage magica = new Mage("Magica-Raspotina"); magica.GainExperience(210); Console.WriteLine($"\nMage details: {magica}"); Warrior war = new Warrior("M - The unshackled"); war.GainExperience(2500); Console.WriteLine($"\nWarrior details: {war}"); Ranger rag = new Ranger("Nico Rock"); rag.GainExperience(1080); Console.WriteLine($"\nRanger details: {rag}"); Console.WriteLine("\n----Demo: Generate some items----"); MagicWeapon magicWeapon = new MagicWeapon("MagicWeapon"); Console.WriteLine($"\nMagic Weapon details: {magicWeapon}"); magicWeapon.LevelScale(2); Console.WriteLine($"\nMagic Weapon details on level 2: {magicWeapon}"); MeleeWeapon meele = new MeleeWeapon("Infinity Edge"); meele.LevelScale(11); Console.WriteLine($"\nMeele Weapon details on level 11: {meele}"); RangedWeapon rangedWeapon = new RangedWeapon("Beyond distance"); rangedWeapon.LevelScale(4); Console.WriteLine($"\nRanged Weapon details on level 4: {rangedWeapon}"); ClothArmor armorMask = new ClothArmor("Abyssal Mask", Slots.Head); armorMask.ScaleStatsByLevelAndSlot(6); Console.WriteLine($"\nCloth armor: {armorMask}"); PlateArmor armorPlate = new PlateArmor("Bramble Vest", Slots.Body); armorPlate.ScaleStatsByLevelAndSlot(3); Console.WriteLine($"\nPlate armor: {armorPlate}"); LeatherArmor armorLeather = new LeatherArmor("Legwraps ", Slots.Legs); armorLeather.ScaleStatsByLevelAndSlot(8); Console.WriteLine($"\nLeather armor: {armorLeather}"); ClothArmor clothPants = new ClothArmor("El Pj Pants", Slots.Legs); clothPants.ScaleStatsByLevelAndSlot(1); Console.WriteLine($"\nCloth armor: {clothPants}"); Console.WriteLine("\n----Demo: Hero's eqiup some items----"); HeroService warriorGame = new HeroService(war); warriorGame.EquipWeapon(meele); Console.WriteLine("\n----Warrior equips ClothAmor lvl 6:Head:----"); warriorGame.EquipArmor(armorMask); warriorGame.NewStats(); Console.WriteLine("\n----Warrior equips PlateArmor lvl 3: Body----"); warriorGame.EquipArmor(armorPlate); Console.WriteLine("\n----Warrior equips LeatherArmor lvl 8: Legs----"); warriorGame.EquipArmor(armorLeather); Console.WriteLine("\n----Warrior equips ClothArmor: Legs again----"); warriorGame.EquipArmor(clothPants); warriorGame.NewStats(); Console.WriteLine("\n----Demo: Hero's can't eqiup item with higher level----"); HeroService magicaGame = new HeroService(magica); magicaGame.EquipWeapon(meele); Console.WriteLine("\n----Demo: Hero:Warrior attacking with weapon: meele----"); warriorGame.Attack(); Console.WriteLine("\n----Demo: Hero's attacking without weapon----"); magicaGame.Attack(); }
public int Calculate(Warrior warrior) { return(warrior.Attributes.Strength * DAMAGE_CONSTANT); }
public void Setup() { this.warrior = new Warrior(Name, Damage, HP); }
public void Greetings(Warrior warrior) { System.Console.WriteLine($@"Greetings,{warrior.Names}!"); }
public async Task SelectWarrior(Player player, Warrior warrior) { await _playerRepository.SelectWarrior(player, warrior); }
public void Strike(Warrior enemy, int swings) { enemy.Health = Math.Max(0, enemy.Health - (swings * 10)); }
public WarriorHired(Warrior warrior) { this.Warrior = warrior; }
public void SpawnCharacter(int cardNum, CharacterProperties.UnitType unit) { CharacterProperties.Team tempOwner = CharacterProperties.Team.LEFT; CharacterProperties.CategoryColour colour = GlobalManager.GameSettings.csObj.characterProperties[cardNum].category; int rankLevel = cardNum; if (unit != CharacterProperties.UnitType.DRAGON) { GameObject go = Instantiate(characterPrefab, Vector3.zero, Quaternion.identity) as GameObject; go.transform.parent = this.transform.Find("Holder/Character Unit Holder").transform; go.transform.localScale = Vector3.one * 10; Vector3 pos = Vector3.zero; pos.y = 36f; go.transform.localPosition = pos; go.rigidbody2D.isKinematic = true; go.collider2D.enabled = false; switch (unit) { case CharacterProperties.UnitType.ARCHER: case CharacterProperties.UnitType.CANNON: Archer rangeObj = go.AddComponent <Archer>(); rangeObj.characterSettings = GlobalManager.GameSettings.csObj; rangeObj.rank = rankLevel; rangeObj.Category = colour; rangeObj.UnitType = unit; rangeObj.Team = tempOwner; rangeObj.DisplayUnit = true; break; case CharacterProperties.UnitType.ONE_HANDED_WARRIOR: case CharacterProperties.UnitType.TWO_HANDED_WARRIOR: case CharacterProperties.UnitType.SPEAR_WARRIOR: Warrior meleeObj = go.AddComponent <Warrior>(); meleeObj.characterSettings = GlobalManager.GameSettings.csObj; meleeObj.rank = rankLevel; meleeObj.Category = colour; meleeObj.UnitType = unit; meleeObj.Team = tempOwner; meleeObj.DisplayUnit = true; break; case CharacterProperties.UnitType.HEALER: Healer healerObj = go.AddComponent <Healer>(); healerObj.characterSettings = GlobalManager.GameSettings.csObj; healerObj.rank = rankLevel; healerObj.Category = colour; healerObj.UnitType = unit; healerObj.Team = tempOwner; healerObj.DisplayUnit = true; break; } } else if (unit == CharacterProperties.UnitType.DRAGON) { GameObject go = Instantiate(dragonPrefab, Vector3.zero, Quaternion.identity) as GameObject; go.transform.parent = this.transform.Find("Holder/Character Unit Holder").transform; go.transform.localScale = Vector3.one * 6; Vector3 pos = Vector3.zero; pos.y = 20f; go.transform.localPosition = pos; go.rigidbody2D.isKinematic = true; go.collider2D.enabled = false; go.GetComponent <DragonRider>().characterSettings = GlobalManager.GameSettings.csObj; go.GetComponent <DragonRider>().rank = rankLevel; go.GetComponent <DragonRider>().Category = colour; go.GetComponent <DragonRider>().Team = tempOwner; go.GetComponent <DragonRider>().DisplayUnit = true; } }
// Use this for initialization void Start() { cur_Health = max_Health; Instance = this; //InvokeRepeating("decreaseHealth", 1f, 1f); }
private static void Main(string[] args) { //Warrior Warrior warrior = new Warrior(); Move(warrior); Attack(warrior, "Wolf"); Console.ReadLine(); Console.Clear(); //Archer Archer archer = new Archer(); Move(archer); Attack(archer, "Wolf"); Console.ReadLine(); Console.Clear(); //Wizzard warrior WizzardDecorator wizzard = new WizzardDecorator(warrior); Move(wizzard); Attack(wizzard, "Wolf"); Console.ReadLine(); Console.Clear(); //Ninja archer NinjaDecorator ninja = new NinjaDecorator(archer); Move(ninja); Attack(ninja, "Wolf"); Console.ReadLine(); Console.Clear(); //Ninja wizzard warrior NinjaDecorator ninjaWizzard = new NinjaDecorator(wizzard); Move(ninjaWizzard); Attack(ninjaWizzard, "Wolf"); Console.ReadLine(); Console.Clear(); //Is he a wizzard? Console.WriteLine("Is he a wizzard?"); Console.ReadLine(); Console.Clear(); var maybeWizzard = ninjaWizzard.GetRole("Wizzard"); if (maybeWizzard != null) { Move(maybeWizzard); Attack(maybeWizzard, "Wolf"); } else { Console.WriteLine("Nop"); } Console.ReadLine(); Console.Clear(); //Delete role Console.WriteLine("Delete that wizzard!"); Console.ReadLine(); Console.Clear(); ninjaWizzard.DeleteRole("Wizzard"); Move(ninjaWizzard); Attack(ninjaWizzard, "Wolf"); Console.ReadLine(); Console.Clear(); }
public void Setup() { this.warrior = new Warrior("Name", 10, 50); }