public static Player CharacterSelection() { Game game = new Game(); Console.WriteLine("Choose Character"); Console.WriteLine(""); String[] CharacterSelect = { "Assassin", "Mage", "Tank" }; int MenuSelection = CIO.PromptForMenuSelection(CharacterSelect, true); if (MenuSelection == 1) { Player player = new Assassin(); return(player); } else if (MenuSelection == 2) { Player player = new Mage(); return(player); } else if (MenuSelection == 3) { Player player = new Tank(); return(player); } else { game.BeginGame(); return(null); } }
public Enemy spawn() { Enemy enemy; switch (enemyType) { case "Grunt": //set center to be top right or left of the screen enemy = new Grunt(x, y); break; case "Captain": //set center to be top right or left of the screen enemy = new Captain(x, y); break; case "Commander": //set center to be top right or left of the screen enemy = new Commander(x, y); break; case "Assassin": //set center to be top right or left of the screen enemy = new Assassin(x, y); break; case "General": //set center to center top of the screen enemy = new General(x, y); break; } enemyCount--; return(enemy); }
private static Action Cycle(Assassin role, PlayerVoteArea voteArea, TextMeshPro nameText) { void Listener() { if (MeetingHud.Instance.state == MeetingHud.VoteStates.Discussion) { return; } var currentGuess = role.Guesses[voteArea.TargetPlayerId]; var guessIndex = currentGuess == "None" ? -1 : role.PossibleGuesses.IndexOf(currentGuess); if (++guessIndex == role.PossibleGuesses.Count) { guessIndex = 0; } var newGuess = role.Guesses[voteArea.TargetPlayerId] = role.PossibleGuesses[guessIndex]; nameText.text = newGuess == "None" ? "Guess" : $"<color=#{role.ColorMapping[newGuess].ToHtmlStringRGBA()}>{newGuess}</color>"; } return(Listener); }
// CreateHero type name public string CreateHero(List <string> args) { string type = args[0]; string heroName = args[1]; if (heroes.ContainsKey(heroName)) { return($"Hero with name: {heroName} already exists!"); } Hero hero = null; if (type == "Assassin") { hero = new Assassin(heroName); } else if (type == "Priest") { hero = new Priest(heroName); } else if (type == "Warrior") { hero = new Warrior(heroName); } if (hero == null) { return($"Invalid type hero: {type}."); } this.heroes.Add(heroName, hero); return($"{type}: {heroName} joined the Arena!"); }
public static void Postfix(MeetingHud __instance) { Assassin.AssassinState.Guesses.Clear(); Assassin.AssassinState.Buttons.Clear(); if ( PlayerControl.LocalPlayer.Data.IsDead || !PlayerControl.LocalPlayer.Is(Faction.Impostors) ) { return; } Assassin assassin = Assassin.AssassinState; if (assassin.RemainingKills <= 0) { return; } foreach (var voteArea in __instance.playerStates) { IMeetingGuesser.GenButton( assassin, voteArea, playerControl => !IsExempt(playerControl), (playerControl, role) => { IMeetingGuesser.KillFromMeetingGuess(assassin, playerControl, role); assassin.RemainingKills--; }); } }
public static Player GeneratePlayer(OccupationType id, string name) { Player player = null; switch (id) { case OccupationType.Warrior: player = new Warrior(name); break; case OccupationType.Support: player = new Support(name); break; case OccupationType.Mage: player = new Mage(name); break; case OccupationType.Assassin: player = new Assassin(name); break; default: break; } return(player); }
public static void HideSingle( Assassin role, byte targetId, bool killedSelf ) { if ( killedSelf || role.RemainingKills == 0 || !CustomGameOptions.AssassinMultiKill ) { HideButtons(role); return; } var(cycle, guess, guessText) = role.Buttons[targetId]; if (cycle == null) { return; } cycle.SetActive(false); guess.SetActive(false); guessText.gameObject.SetActive(false); cycle.GetComponent <PassiveButton>().OnClick = new Button.ButtonClickedEvent(); guess.GetComponent <PassiveButton>().OnClick = new Button.ButtonClickedEvent(); role.Buttons[targetId] = (null, null, null); role.Guesses.Remove(targetId); }
private static Action Guess(Assassin role, PlayerVoteArea voteArea) { void Listener() { if ( MeetingHud.Instance.state == MeetingHud.VoteStates.Discussion || IsExempt(voteArea) ) { return; } var targetId = voteArea.TargetPlayerId; var currentGuess = role.Guesses[targetId]; if (currentGuess == "None") { return; } var playerRole = Role.GetRole(voteArea); var toDie = playerRole.Name == currentGuess ? playerRole.Player : role.Player; AssassinKill.RpcMurderPlayer(toDie); role.RemainingKills--; ShowHideButtons.HideSingle(role, targetId, toDie == role.Player); if (toDie.isLover() && CustomGameOptions.BothLoversDie) { var lover = ((Lover)playerRole).OtherLover.Player; ShowHideButtons.HideSingle(role, lover.PlayerId, false); } } return(Listener); }
private static Hero CreateHero(string heroName) { Hero hero; switch (heroName.ToLower()) { case "assassin": hero = new Assassin(); break; case "knight": hero = new Knight(); break; case "monk": hero = new Monk(); break; case "warrior": hero = new Warrior(); break; default: throw new ArgumentException("Invalid hero type!"); } return(hero); }
public Assassin AddAssassin(string codeName, string catchphrase, string preferredWeapon) { var newAssassin = new Assassin(codeName, catchphrase, preferredWeapon); newAssassin.Id = Assassins.Count + 1; Assassins.Add(newAssassin); return(newAssassin); }
public void TestAttackPlayer() { var me = new Assassin(PlayerTypes.Player, ControlTypes.Player); var enemy = new Assassin(PlayerTypes.Enemy, ControlTypes.NPC); me.attack(new CardAttack(me, null, enemy)); //me.attack(enemy); }
//----------------------------------- //----------------------------------- //----------------------------------- public static Assassin ParseToAssassin(StrongString theString) { StrongString[] myStrings = theString.Split(InCharSeparator); Assassin myAssassin = new Assassin(Unit.ConvertToUnit(myStrings[0]), myStrings[1].ToUInt16(), Unit.ConvertToUnit(myStrings[2])); return(myAssassin); }
public void Deve_viscerar_o_inimigo() { var tanker = new Tanker(); var assassin = new Assassin(); assassin.Viscerar(tanker); tanker.Health.Should().Be(115); }
public void Deve_causar_5_de_dano_no_assassino_com_soco() { var tanker = new Tanker(); var assassin = new Assassin(); tanker.Socar(assassin); assassin.Health.Should().Be(45); }
public static void MaybeHideButtons() { Assassin assassin = Assassin.AssassinState; if (!assassin.CanKeepGuessing()) { ShowHideButtons.HideButtons(assassin); } }
public static Troop[] GetBasicTroops() { Troop[] troops = new Troop[4]; troops[0] = Saber.GetBasicSaber(); troops[1] = Archer.GetBasicArcher(); troops[2] = Lancer.GetBasicLancer(); troops[3] = Assassin.GetBasicAssassin(); return(troops); }
static void Main(string[] args) { Assassin a = new Assassin(100, 200, 0, 10, 5, 0, 10, 999); Berserker b = new Berserker(200, 100, 0, 9, 8, 0, 10, 999); a.Poison_slash(b); b.Rage(); Console.Read(); }
//----------------------------------- /// <summary> /// Parse the string value to Troops in the following order: /// <see cref="Saber"/>, <see cref="Archer"/>, <see cref="Lancer"/>, <see cref="Assassin"/> /// </summary> /// <param name="theString"></param> /// <returns></returns> public static Troop[] ParseToTroops(StrongString theString) { Troop[] troops = new Troop[4]; //There is 4 types of Troop. StrongString[] myStrings = theString.Split(OutCharSeparator); troops[0] = Saber.ParseToSaber(myStrings[0]); troops[1] = Archer.ParseToArcher(myStrings[1]); troops[2] = Lancer.ParseToLancer(myStrings[2]); troops[3] = Assassin.ParseToAssassin(myStrings[3]); return(troops); }
public void Deve_considerar_resistencia_magica() { var mage = new Mage(); var assassin = new Assassin(); // 50 assassin.Equipar(new CapaExcusa()); // +18 mage.Blizzard(assassin); assassin.Health.Should().Be(32); }
public void Nao_deve_permitir_equipar_dois_equipamentos_iguais() { var assassin = new Assassin(); // 50 assassin.Equipar(new CapaExcusa()); // +18 Action equiparOutraCapa = () => assassin.Equipar(new CapaExcusa()); equiparOutraCapa.Should().Throw <InvalidOperationException>().WithMessage("Não pode equipar dois equipamentos iguais"); }
public void TestActIfAble() { Agent actor = new Assassin(); Agent target = new Drudge(); Agent blocker = new Saboteur(); // No target and IsActing is false => no action actor.ActIfAble(); Assert.IsFalse(target.WasAttacked); actor.Reset(); // IsActing is true but no target => no action actor.IsActing = true; Assert.Throws <NoTargetException>(() => actor.ActIfAble()); Assert.IsFalse(target.WasAttacked); actor.Reset(); // Has a target but IsActing is false => no action actor.Target = target; actor.ActIfAble(); Assert.IsFalse(target.WasAttacked); actor.Reset(); // Has a target and IsActing is true but blocked => no action actor.Target = target; actor.IsActing = true; actor.Block(blocker); actor.ActIfAble(); Assert.IsFalse(target.WasAttacked); actor.Reset(); // Has a target and IsActing is true, and not blocked => action actor.Target = target; actor.IsActing = true; actor.ActIfAble(); Assert.IsTrue(target.WasAttacked); actor.Reset(); target.Reset(); // Target is dead => no action actor.Target = target; actor.IsActing = true; actor.ActIfAble(); Assert.IsFalse(target.WasAttacked); actor.Reset(); target = new Drudge(); // Actor is dead => no action actor.Target = target; actor.IsActing = true; actor.Execute(); actor.ActIfAble(); Assert.IsFalse(target.WasAttacked); actor.Reset(); }
static void Main(string[] args) { Saber shiki = new Saber(); Archer atalanta = new Archer(); Lancer brynhild = new Lancer(); Rider ushiwakamaru = new Rider(); Assassin jack = new Assassin(); Caster xuanzang = new Caster(); Berserker penthesilea = new Berserker(); Ruler martha = new Ruler(); }
public void Deve_congelar_inimigo_com_ataques_magicos() { var mage = new Mage(); var assassin = new Assassin(); mage.Blizzard(assassin); assassin.Health.Should().Be(30); mage.ThrowFlames(assassin); assassin.Health.Should().Be(5); }
public int NewChar(Conta conta) { string charname; string charclass; library.slowWrite("Let's create a new character!", Constants.TEXT_SPEED2, true); library.slowWrite("What will be his/her name? ", Constants.TEXT_SPEED2, false); charname = Console.ReadLine(); //Colocar tabelhinha maneira aqui Console.WriteLine(""); library.slowWrite("Choose a class:", Constants.TEXT_SPEED2, true); Hero Warrior = new Warrior(""); Hero Mage = new Mage(""); Hero Assassin = new Assassin(""); Warrior.showPresentation(); Mage.showPresentation(); Assassin.showPresentation(); while (true) { library.slowWrite("Class: ", Constants.TEXT_SPEED2, false); charclass = Console.ReadLine(); if (charclass == "Assassin" || charclass == "assassin" || charclass == "a" || charclass == "A") { charclass = "Assassin"; library.slowWrite("Creation succeed! Welcome to Assassins' World.", Constants.TEXT_SPEED2, true); break; } else if (charclass == "Mage" || charclass == "mage" || charclass == "m" || charclass == "M") { charclass = "Mage"; library.slowWrite("Creation succeed! Welcome to Mages' World.", Constants.TEXT_SPEED2, true); break; } else if (charclass == "Warrior" || charclass == "warrior" || charclass == "w" || charclass == "W") { charclass = "Warrior"; library.slowWrite("Creation succeed! Welcome to Warriors' World.", Constants.TEXT_SPEED2, true); break; } else { Console.WriteLine("Incorret name! Try again"); } } conta.SalvaChar(conta.Username, conta.Senha, charname, charclass); this.ImprimeFala(1, charname); return(1); }
static void Main(string[] args) { var chars = new List <Character>(); var Max = new Mage("Max", 2, 100, 50); var Bob = new Assassin("Bob", 2, 120, 70); chars.Add(Max); chars.Add(Bob); Fight(chars); }
public Character ReadClass(int archetype, string wrmc) { int choice; Character player; MyTTY.Show("The following " + wrmc + " are available to you:\n\n"); switch (archetype) { case 1: MyTTY.Show("1) Knight\n"); MyTTY.Show("2) Berserker\n"); break; case 2: MyTTY.Show("1) Hunter\n"); MyTTY.Show("2) Assassin\n"); break; case 3: MyTTY.Show("1) Sorcerer\n"); MyTTY.Show("2) Warlock\n"); break; case 4: MyTTY.Show("1) Priest\n"); MyTTY.Show("2) Druid\n"); break; } choice = MyTTY.ReadIntLimit("\nEnter the number of your selection: ", 2); switch (archetype) { case 1: if (choice < 2) player = new Knight(); else player = new Berserker(); break; case 2: if (choice < 2) player = new Hunter(); else player = new Assassin(); break; case 3: if (choice < 2) player = new Sorcerer(); else player = new Warlock(); break; case 4: if (choice < 2) player = new Priest(); else player = new Druid(); break; default: player = null; } return player; }
static void Main(string[] args) { //Character character = new Warrior(100, 15, 1, 67); //character.PrintHealth(); //virtual zeby uzyc metod z warriora //character.PrintAttack(); //nie wirtual zeby uzyc z character //character.PrintMana(); //Warrior warrior = new Warrior(100, 10, 5, 15); //warrior.PrintHealth(); //nawet bez wirtual uzyje character //warrior.PrintAttack(); //warrior.PrintMana(); Character warrior = new Warrior(500, 70, 0, 65); Character rouge = new Rouge(400, 70, 0, 65); Character mage = new Mage(300, 30, 3000, 10); Character ranger = new Ranger(400, 60, 300, 30); Paladin paladin = new Paladin(700, 70, 100, 30, 50); Berserker berserker = new Berserker(700, 70, 0, 55); Assassin assassin = new Assassin(600, 80, 0, 79); Gambler gambler = new Gambler(600, 50, 0, 40, 3); Archmage archmage = new Archmage(500, 30, 5000, 60); Bloodmage bloodmage = new Bloodmage(500, 30, 2000, 60); Sniper sniper = new Sniper(600, 80, 100, 30); BeastMaster beastMaster = new BeastMaster(700, 60, 500, 50); // wip Fighting fighting = new Fighting(); List <Character> lista = new List <Character> { paladin, berserker, assassin, gambler, archmage, bloodmage, sniper, beastMaster }; Start start = new Start(); start.StartingInterface(lista); // if (berserker.GetHealth() <= 0) // { // for (int i = berserker.ImmortalRage(); i > 0; i--) // { // Fight(berserker, assassin, playerOneTurn = !playerOneTurn); // } // } Console.ReadKey(); }
public ActionResult AddAssassin(CreateAssassinRequest assassin) { if (!_validator.Validate(assassin)) { BadRequest(error: "Assassin needs a catch phrase, code name, and preferred weapon"); } var newAssassin = new Assassin(assassin.CodeName, assassin.CatchPhrase, assassin.PreferredWeapon); _assassinRepository.AddAssassin(newAssassin); return(Created($"api/assassin/register/{newAssassin.Id}", newAssassin)); }
public DoISeePlayer(IDecision _trueBranch, IDecision _falseBranch, Assassin assassin) { if (assassin.iSeePlayer) // use radius/collider { value = true; } else { value = false; } trueBranch = _trueBranch; falseBranch = _falseBranch; }
public static void NewClass() { Assassin.Clear(); Assassin.level = 0; CurrentGame.game.memoryGeneral.humanClassProgress.assassin.level = 0; CurrentGame.game.memoryGeneral.humanClassProgress.assassin.name = "Assassin"; CurrentGame.game.memoryGeneral.humanClassProgress.assassin.movement = 5; CurrentGame.game.memoryGeneral.humanClassProgress.assassin.classWeapons.classWeapon1.type = "Light Blades"; CurrentGame.game.memoryGeneral.humanClassProgress.assassin.classWeapons.classWeapon1.rank = 3; CurrentGame.game.memoryGeneral.humanClassProgress.assassin.classWeapons.classWeapon2.type = "Close"; CurrentGame.game.memoryGeneral.humanClassProgress.assassin.classWeapons.classWeapon2.rank = 3; CurrentGame.game.memoryGeneral.humanClassProgress.assassin.caps = Assassin.Caplist(); LevelUpClass(); }
private Hero SelectedHero(string hero, string name) { Hero player = null; switch (hero) { case "Warrior": player = new Warrior() { Name = name }; break; case "Knight": player = new Knight() { Name = name }; break; case "Assassin": player = new Assassin() { Name = name }; break; case "Monk": player = new Monk() { Name = name }; break; case "Paladin": player = new Paladin() { Name = name }; break; default: MessageBox.Show("Please select a player."); break; } return(player); }