public BattleScene(SpellswordGame game, Character player, Character enemy) : base(game, null) { this.game = game; ChangeCombatants(game, player, enemy); bothAlive = true; currentMenu = null; currentState = BattleSceneState.Idle; battleQueue = new Stack <BattleAction>(); gameOver = false; }
private void CreateEmptyTiles(SpellswordGame game, string[] mapFile) { for (int i = 0; i < thisWorld.ySize; i++) { for (int j = 0; j < thisWorld.xSize; j++) { if (mapFile[i][j] == '1') { Point newPoint = new Point(j, i); EmptyTile tile = new EmptyTile(game, thisWorld, newPoint); emptyTiles.Add(tile); thisWorld.RegisterEntity(tile, newPoint); } } } }
public void ChangeCombatants(SpellswordGame game, Character player, Character enemy) { if (player is Player) { this.player = new BattlePlayer(game, this, (Player)player); } this.enemy = new BattleEnemy(game, this, enemy); if (this.player is BattlePlayer) { ((BattlePlayer)this.player).FinishedTurn += OnPlayerFinishedTurn; } if (this.player.ThisEntity != null) { this.player.ThisEntity.Died += HandleDeath; } if (this.enemy.ThisEntity != null) { this.enemy.ThisEntity.Died += HandleDeath; } }
public WalkingScene(SpellswordGame game, World thisWorld, WalkingPlayer player) { inputHandler = game.Services.GetService <InputHandler>(); if (inputHandler == null) { inputHandler = new InputHandler(game); game.Components.Add(inputHandler); } this.game = game; this.thisWorld = thisWorld; this.player = player; string[] mapFile = { "11111110001111111", "11111110001111111", "11111110001111111", "11110000000001111", "11110000000001111", "11110000000001111", "00010000000001000", "00000000000000000", "00010000000001000", "11110000000001111", "11110000000001111", "11110000000001111", "00010000000001000", "00000000000000000", "00010000000001000", "11110000000001111", "11110000000001111", "11110000000001111", "11110000000001111", "11111111011111111", "11111110001111111", "11111110001111111", "11111110001111111" }; emptyTiles = new List <EmptyTile>(); CreateEmptyTiles(game, mapFile); //Temp test Enemy welp = new Welp("WelpSmall", "Welp"); Enemy zombie = new Zombie("ZombieSmall", "Zombie"); Enemy wraith = new Wraith("WraithSmall", "Wraith"); Enemy ghost = new Ghost("BackwardsStill", "Ghost"); Enemy flower = new Flower("FlowerWorld", "FlowerBattle"); Enemy dragon = new Dragon("Dragon", "Dragon", "DragonSpecial"); enemies = new List <WorldEnemy>(); this.enemies.Add(new WorldEnemy(game, thisWorld, new Point(3, 7), welp)); // Welp this.enemies.Add(new WorldEnemy(game, thisWorld, new Point(3, 13), zombie)); // Zombie this.enemies.Add(new WorldEnemy(game, thisWorld, new Point(13, 7), wraith)); // Wraith this.enemies.Add(new WorldEnemy(game, thisWorld, new Point(13, 13), ghost)); // Ghost this.enemies.Add(new WorldEnemy(game, thisWorld, new Point(8, 19), flower)); // Flower this.enemies.Add(new WorldEnemy(game, thisWorld, new Point(8, 1), dragon)); // Dragon Boss // More Temp Test swords = new List <WorldSword>(); Weapon iceShield = new IceShield("IceShield", 8, 15); Weapon iceSword = new IceSword("IceSword", 20, 5); Weapon lightningSword = new LightningSword("LightningSword", 30, 5); Weapon focus = new BasicFocus("SpellFocus"); this.swords.Add(new WorldSword(game, thisWorld, new Point(1, 7), iceShield)); // Ice Shield this.swords.Add(new WorldSword(game, thisWorld, new Point(1, 13), iceSword)); // Ice Blade this.swords.Add(new WorldSword(game, thisWorld, new Point(15, 7), lightningSword)); // Lightning Blade this.swords.Add(new WorldSword(game, thisWorld, new Point(15, 13), focus)); // Spell/Power Focus InitializePlayerToMiddle(); }