Ejemplo n.º 1
0
        private void ToPlayerAbilitySelectedState(Ability ability)
        {
            State = BattleGameStateType.AbilitySelected;

            SelectedAbility = ability;

            AbilitySelectedName.text = ability.Name.ToUpper();
            AbilitySelectedRoot.gameObject.SetActive(true);

            foreach (var actor in Actors)
            {
                if (SelectedAbility.IsValidTarget(actor))
                {
                    actor.SetValidTargetState(EnemyParty.Contains(actor));
                }
                else if (ability.User == actor)
                {
                    actor.SetSelectedState();
                }
                else
                {
                    actor.SetNormalState();
                }
            }
        }
Ejemplo n.º 2
0
 protected override void finishCleanup()
 {
     Logger.Log("Finishing battle");
     PlayerParty.FinishBattle(this);
     EnemyParty.FinishBattle(this);
     base.finishCleanup();
 }
    /// <summary>
    /// Called only once at the start of battle, this will generate the objSequence at
    /// random, where each  combatant occurs exactly once. It does not generate the turns
    /// themselves, except through a call to GenerateMoreTurns().
    /// </summary>
    /// <param name="heroes">the HeroParty in BattleLoader</param>
    /// <param name="enemies">the EnemyParty in BattleLoader</param>
    public static void GenerateFirstTurns(HeroParty heroes, EnemyParty enemies)
    {
        // Clear from previous battles
        objSequence.Clear();
        objTurns.Clear();
        turns.Clear();

        // Store provided references
        heroParty  = heroes;
        enemyParty = enemies;

        // Generate a sequence in order
        foreach (BattleHero hero in heroParty.Hero)
        {
            objSequence.Add(hero);
        }
        foreach (BattleEnemy enemy in enemyParty.Enemies)
        {
            objSequence.Add(enemy);
        }

        // Use custom Randomize class to randomize the sequence of objects
        objSequence = Randomize <object> .List(objSequence);

        // Generate turns using objSequence as a key
        GenerateMoreTurns();
    }
Ejemplo n.º 4
0
        public void CreateEnemyParty_ONCLICK()
        {
            CommonUIButtonFunction("UI_Button_Click1", "CreateEnemyParty_ONCLICK()");
            EnemyParty enemy_party = EnemyResourceManager.instance.CreateParty();

            enemy_party.DebugAddUnitToParty();
            EnemyResourceManager.instance.SetFieldParty(enemy_party.id);
        }
Ejemplo n.º 5
0
        public void DebugSetParty_ONCLICK()
        {
            CommonUIButtonFunction("UI_Button_Click1", "DebugSetParty_ONCLICK()");
            BattleManagerDirector battle_manager_director = new BattleManagerDirector(new NormalBattleManager());
            EnemyParty            enemy_party             = EnemyResourceManager.instance.CreateParty();

            enemy_party.DebugAddUnitToParty();
            battle_manager_director.EncountEnemy(PlayerResourceManager.g_hero_party[0], enemy_party);
        }
Ejemplo n.º 6
0
 public static EnemyPartyJson createEnemyPartyJson(EnemyParty enemyParty)
 {
     return(new EnemyPartyJson
     {
         x = 0,
         y = 0,
         enemies = createEnemyJsonList(enemyParty.enemies)
     });
 }
Ejemplo n.º 7
0
    public EnemyParty loadSpecificEnemyParty(int idOfCorridor, int idOfEnemyParty)
    {
        //Checks whatever there are already created parties of enemies
        EnemyParty generatedEnemyParty = dungeonManager.getLevelsArray().Find(x => x.getIdOfLevel() == idOfCorridor).getSpecificEnemyParty(idOfEnemyParty);

        //Adds EnemyParty to DungeonManager || DungeonLevel || enemyParties
        generatedEnemyParty.loadAlreadyExistingSettingOfEnemies(idOfCorridor, idOfEnemyParty, true);
        generatedEnemyParty.displayHealthBarsOnEnemies(idOfCorridor, idOfEnemyParty, true);
        return(generatedEnemyParty);
    }
Ejemplo n.º 8
0
 public void OnActorDied(Actor actor)
 {
     if (EnemyParty.Contains(actor))
     {
         GameController.Instance.Scrap += (actor.ScrapReward * (100 + GameController.Instance.GameDifficulty.ScrapModifier) / 100);
     }
     else if (SelectedActor == actor)
     {
         SetSelection(null);
     }
 }
Ejemplo n.º 9
0
    public void fixEnemiesPossition()
    {
        int        idOfCorridorToReset = fightMode.getCurrentCorridorId();
        int        idOfEnemyParty      = fightMode.getColidedWithPartyNumber();
        EnemyParty generatedEnemyParty = dungeonManager.getLevelsArray().Find(x => x.getIdOfLevel() == idOfCorridorToReset).getSpecificEnemyParty(idOfEnemyParty);

        for (int i = 0; i < dungeonManager.getLevelsArray().Find(x => x.getIdOfLevel() == idOfCorridorToReset).getEnemyParties()[idOfEnemyParty].getEnemyObjectArray().Count; i++)
        {
            generatedEnemyParty.getEnemyObjectArray()[i].transform.localPosition = new Vector3(generatedEnemyParty.getEnemyObjectArray()[i].transform.localPosition.x - movementButton.getHeroesObjects()[0].transform.localPosition.x, -100, 0);
        }
    }
Ejemplo n.º 10
0
 public PartyBattleLayout GetPartyBattleLayoutForPartyMember(PartyMember partyMember)
 {
     if (PlayerParty.Contains(partyMember))
     {
         return(PlayerPartyLayout);
     }
     if (EnemyParty.Contains(partyMember))
     {
         return(EnemyPartyLayout);
     }
     return(null);
 }
Ejemplo n.º 11
0
 public Party GetPartyForPartyMember(PartyMember partyMember)
 {
     if (PlayerParty.Contains(partyMember))
     {
         return(PlayerParty);
     }
     if (EnemyParty.Contains(partyMember))
     {
         return(EnemyParty);
     }
     return(null);
 }
Ejemplo n.º 12
0
        private void EnemyAIAct()
        {
            var next = EnemyParty.OrderByDescending(s => s.AIPriority).FirstOrDefault(s => s.CanAIAct);

            if (next != null)
            {
                AIAct(next);
            }
            else
            {
                EndTurn();
            }
        }
Ejemplo n.º 13
0
    public static void BoostFromVictoriousArenaCombat()
    {
        gold += 15;
        float percent = 100f * (float)EnemyParty.GetTotalPower() / (float)GetTotalPower();

        percent -= 50f;
        foreach (CharacterSheet c in partyMembers)
        {
            if (c.selected && PercentRoll((int)percent))
            {
                c.PowerUp();
            }
        }
    }
Ejemplo n.º 14
0
    public void generateFightModeScene(int idOfCorridor, int idOfEnemyParty)
    {
        GameObject     tempObject;
        SpriteRenderer spriteRender;
        string         filePath             = "FightSceneBackground/";
        string         typeOfDungeonTexture = "Icy_Background";

        tempObject = Instantiate(factoryObject);
        tempObject.SetActive(false);

        Debug.Log("DungeonsGenerator || generateFightModeScene || CreatedFightBackgroundScene ");

        //----------------------------------------------------------------------------------------------------------------------

        //Adding SpriteRenderer to component (later we can change it to add it into cloned object)
        spriteRender = tempObject.AddComponent <SpriteRenderer>();


        spriteRender.sprite = Resources.Load <Sprite>(filePath + typeOfDungeonTexture);
        tempObject.transform.SetParent(GameObject.Find("Dungeon").transform, false);
        tempObject.transform.localScale = new Vector3(100, 100, 1);

        tempObject.name = "BattleBackgroundObject";
        tempObject.SetActive(true);

        //Using minus here because coordinates are from -400 to 400
        float halfOfCanvasWidth = (float)(dungeonCanvas.GetComponent <RectTransform>().rect.width *(-0.5));
        //90 is original space and we're scaling it by 5/7
        float scaledSpaceBetweenHeroes = 90 * 5 / 7;

        //Due to order of drawing heroes in corridors i had to make a map of orders
        int[] heroesOrder = { 3, 1, 0, 2 };

        //After generating last chunk we are generating border chunks
        for (int i = 0; i < movementButton.getHeroesObjects().Count; i++)
        {
            movementButton.getHeroesObjects()[heroesOrder[3 - i]].transform.localPosition = new Vector3(halfOfCanvasWidth + (((3 - i) + 1) * scaledSpaceBetweenHeroes), movementButton.getHeroesObjects()[heroesOrder[3 - i]].transform.localPosition.y, 0);
            //Now i'm gonna scale it down to 5/7 of the original size (35)
            movementButton.getHeroesObjects()[heroesOrder[3 - i]].transform.localScale = new Vector3(25, 25, 1);
        }

        //Here i should load enemyParty
        EnemyParty encounteredEnemyParty = loadSpecificEnemyParty(idOfCorridor, idOfEnemyParty);

        for (int i = 0; i < dungeonManager.getLevelsArray().Find(x => x.getIdOfLevel() == idOfCorridor).getEnemyParties()[idOfEnemyParty].getEnemyObjectArray().Count; i++)
        {
            Debug.Log("EnemyObject_" + idOfEnemyParty + "." + i);
        }
    }
Ejemplo n.º 15
0
        public void Test_Decorator_Map()
        {
            EmptyMapComponent e = new EmptyMapComponent();

            e.draw(0, 0);
            PlayerDecorator pd = new PlayerDecorator(e);

            pd.draw(Convert.ToInt32(p.x), Convert.ToInt32(p.y));
            Assert.AreEqual(e.currentMap[p.x][p.y], 'P');
            EnemyDecorator ed           = new EnemyDecorator(e);
            EnemyParty     enemyParties = new EnemyParty(new Coordinates(3, 3));

            ed.draw(Convert.ToInt32(enemyParties.position.x), Convert.ToInt32(enemyParties.position.y));
            Assert.AreEqual(e.currentMap[Convert.ToInt32(enemyParties.position.x)][Convert.ToInt32(enemyParties.position.y)], 'E');
        }
Ejemplo n.º 16
0
        public EnemyParty CreateParty()
        {
            EnemyPartyBuilder enemy_party_builder = new EnemyPartyBuilder();
            PartyDirector     director            = new PartyDirector(enemy_party_builder);

            director.Construct();
            EnemyParty party = enemy_party_builder.GetResult();

            g_enemy_party.Add(party);
            Debug.Log("create_party:" + party.id);
            // if (updateHeroPartyList != null)
            // {
            // updateHeroPartyList();
            // }
            return(party);
        }
Ejemplo n.º 17
0
        public void OnLoad()
        {
            _songManager.Play("Battle of the Mind");

            Party = _worldState.Party;

            for (var i = 0; i < Party.Actors.Count; i++)
            {
                Party.Actors[i].X = 560;
                Party.Actors[i].Y = 140 + i * 48;
            }

            EnemyParty = new EnemyParty(new List <Enemy> {
                _enemyManager.Enemies["DarkTroll"]
            });
            EnemyParty.Init();
        }
Ejemplo n.º 18
0
    static void Main()
    {
        Knight sirKnigt = new Knight(4, 100);

        sirKnigt.AbilityUsedEvent += UseAbility;
        sirKnigt.AddXP(10);
        Wolf doge = new Wolf(sirKnigt.Level);

        Console.WriteLine(sirKnigt);
        Console.WriteLine(doge);
        Console.WriteLine();

        while (sirKnigt.IsAlive && doge.IsAlive)
        {
            var knightAttackLog = sirKnigt.DealDamage(doge);
            if (knightAttackLog.AttackPassed)
            {
                Console.WriteLine("{0} Remaining HP: {1}", knightAttackLog, doge.CurrentHitPoints);
            }

            var dogeAttackLog = doge.DealDamage(sirKnigt);
            if (dogeAttackLog.AttackPassed)
            {
                Console.WriteLine("{0} Remaining HP: {1}", dogeAttackLog, sirKnigt.CurrentHitPoints);
            }

            Console.WriteLine();

            sirKnigt.Update();
            doge.Update();
        }

        Console.WriteLine();
        Console.WriteLine(sirKnigt);
        Console.WriteLine(doge);

        Party newParty = new Party(sirKnigt, doge);

        newParty.AddToParty(new PetDog(2, 50));

        EnemyParty <Wolf> enemyParty = EnemyParty <Wolf> .GenerateParty(3, 2);

        Console.WriteLine(enemyParty[0]);

        SaveLoadSystem.LoadGameState();
    }
Ejemplo n.º 19
0
    public void generateEnemyParties()
    {
        bool thereIsEnoughSpace       = false;
        int  howManyEnemiesToGenerate = randomNumber.Next(0, 5);

        //It's getting random number of parties with limit up to 4 parties per corridor
        while (!thereIsEnoughSpace)
        {
            thereIsEnoughSpace = makeSureThereWillBeEnoughSpaceForThem(howManyEnemiesToGenerate);
            howManyEnemiesToGenerate--;
        }


        Debug.Log("DungeonsGenerator || generateEnemyParties || How many enemy parties to generate: " + howManyEnemiesToGenerate);
        string debugString = "";

        Debug.Log("DungeonsGenerator || generateEnemyParties || How many levels are generated already: " + dungeonManager.getLevelsArray().Count);
        Debug.Log("DungeonsGenerator || generateEnemyParties || Current corridor: " + idOfCorridor);

        for (int i = 0; i < howManyEnemiesToGenerate; i++)
        {
            for (int Ii = 0; Ii < dungeonManager.getLevelsArray().Count; Ii++)
            {
                debugString += dungeonManager.getLevelsArray()[Ii].getIdOfLevel() + " ";
            }
            Debug.Log("DungeonsGenerator || generateEnemyParties || SavedId's(already generated levels): " + debugString);
            Debug.Log("DungeonsGenerator || generateEnemyParties || How many enemies parties are there: " + dungeonManager.getLevelsArray().Find(x => x.getIdOfLevel() == idOfCorridor).getEnemyParties().Count);
            //Creates new party with current number of objects, and IdOfCorridor
            //Checks whatever there are already created parties of enemies
            EnemyParty generatedEnemyParty = new EnemyParty(idOfCorridor,
                                                            dungeonManager.getLevelsArray().Find(x => x.getIdOfLevel() == idOfCorridor).getEnemyParties().Count, i);
            //Adds newly created EnemyParty to DungeonManager || DungeonLevel || enemyParties
            dungeonManager.getLevelsArray().Find(x => x.getIdOfLevel() == idOfCorridor).addToEnemyParties(generatedEnemyParty);
            Debug.Log("DungeonsGenerator || generateEnemyParties || Generating party number " + i);
            debugString = "";
        }
        for (int i = 0; i < dungeonManager.getLevelsArray().Find(x => x.getIdOfLevel() == idOfCorridor).getEnemyParties().Count; i++)
        {
            debugString += dungeonManager.getLevelsArray().Find(x => x.getIdOfLevel() == idOfCorridor).getEnemyParties()[i].getInitialPositionX() + " ";
        }
        Debug.Log("DungeonsGenerator || generateEnemyParties || Possitions of " +
                  dungeonManager.getLevelsArray().Find(x => x.getIdOfLevel() == idOfCorridor).getEnemyParties().Count + " enemy parties on this levels: " + debugString);
    }
Ejemplo n.º 20
0
    public void Start()
    {
        EnemyParty.SpawnPartyMembers();
        PlayerParty.SpawnPartyMembers();

        // Find all the combatants and set them to be children of the Combat Manager.
        GameObject[] children = GameObject.FindGameObjectsWithTag("CombatantTag");
        foreach (GameObject child in children)
        {
            child.transform.SetParent(transform);
        }

        panel = GameObject.FindObjectOfType <GUIPanel>();
        rng   = new System.Random();

        combatants = GetComponentsInChildren <CombatController>().ToList();
        combatants.Sort(new SortCombatantDescendant());
        OnSetUpPlayers.Invoke(combatants);
    }
    // Use this for initialization
    void Start()
    {
        // Populate Tile Grid.
        manager.tileGrid = new Tile[Constants.COMBAT_WIDTH, Constants.COMBAT_HEIGHT];
        for (int x = 0; x < Constants.COMBAT_WIDTH; x++)
        {
            for (int y = 0; y < Constants.COMBAT_HEIGHT; y++)
            {
                GameObject     newTile = Instantiate(tilePrefab, new Vector3(x + y, x * 0.75f - y * 0.75f, 0), Quaternion.identity);
                SpriteRenderer rend    = newTile.GetComponent <SpriteRenderer>();
                rend.sortingOrder = y - x;
                Tile t = newTile.GetComponent <Tile>();
                manager.tileGrid[x, y] = t;
                t.x = x; t.y = y;
            }
        }
        EnemyParty.SpawnPartyMembers();
        PlayerParty.SpawnPartyMembers();

        manager.combatants.Sort(new SortCombatants());
    }
Ejemplo n.º 22
0
    void Start()
    {
        //*
        //TODO deleta isso
        if (playerParty == null)
        {
            playerParty = tempGambPrefab;
        }
        if (enemyParty == null)
        {
            enemyParty = tempGambPrefab2;
        }
        if (previousScene == null)
        {
            previousScene = "overworld";
        }
        //*/

        livePlayerParty = Instantiate(playerParty).GetComponent <PlayerParty>();
        liveEnemyParty  = Instantiate(enemyParty).GetComponent <EnemyParty>();
        StartCoroutine(BattleCycle());
    }
Ejemplo n.º 23
0
        private bool GameOverCheck()
        {
            if (!PlayerParty.First(p => p.Class == ClassType.Egg).IsAlive)
            {
                State = BattleGameStateType.GameOver;

                StartCoroutine(GameOverCrt());
                return(true);
            }


            if (EnemyParty.All(p => !p.IsAlive))
            {
                if (!VictoryScreen.gameObject.activeInHierarchy)
                {
                    State = BattleGameStateType.GameOver;

                    StartCoroutine(GameOverCrt());
                    return(true);
                }
            }

            return(false);
        }
Ejemplo n.º 24
0
    public void loadEnemyParties()
    {
        //Reading already written number of parties
        int howManyToLoad = dungeonManager.getLevelsArray().Find(x => x.getIdOfLevel() == idOfCorridor).getEnemyParties().Count;

        Debug.Log("DungeonsGenerator || loadEnemyParties || How many enemy parties to load: " + howManyToLoad);
        string debugString = "";

        for (int i = 0; i < howManyToLoad; i++)
        {
            Debug.Log("DungeonsGenerator || loadEnemyParties || How many levels are generated already: " + dungeonManager.getLevelsArray().Count);
            Debug.Log("DungeonsGenerator || loadEnemyParties || Current corridor: " + idOfCorridor);

            for (int Ii = 0; Ii < dungeonManager.getLevelsArray().Count; Ii++)
            {
                debugString += dungeonManager.getLevelsArray()[Ii].getIdOfLevel() + " ";
            }
            Debug.Log("DungeonsGenerator || loadEnemyParties || SavedId's(already generated levels): " + debugString);


            Debug.Log("DungeonsGenerator || loadEnemyParties || How many enemies parties are there: " + dungeonManager.getLevelsArray().Find(x => x.getIdOfLevel() == idOfCorridor).getEnemyParties().Count);
            //Creates new party with current number of objects, and IdOfCorridor
            //Checks whatever there are already created parties of enemies
            EnemyParty generatedEnemyParty = dungeonManager.getLevelsArray().Find(x => x.getIdOfLevel() == idOfCorridor).getSpecificEnemyParty(i);
            //Adds newly created EnemyParty to DungeonManager || DungeonLevel || enemyParties
            generatedEnemyParty.loadAlreadyExistingSettingOfEnemies(idOfCorridor, i);
            Debug.Log("DungeonsGenerator || loadEnemyParties || Generating party number " + i);
            debugString = "";
        }
        for (int i = 0; i < dungeonManager.getLevelsArray().Find(x => x.getIdOfLevel() == idOfCorridor).getEnemyParties().Count; i++)
        {
            debugString += dungeonManager.getLevelsArray().Find(x => x.getIdOfLevel() == idOfCorridor).getEnemyParties()[i].getInitialPositionX() + " ";
        }
        Debug.Log("DungeonsGenerator || loadEnemyParties || Possitions of " +
                  dungeonManager.getLevelsArray().Find(x => x.getIdOfLevel() == idOfCorridor).getEnemyParties().Count + " enemy parties on this levels: " + debugString);
    }
Ejemplo n.º 25
0
 public override void SetEnemyParty(EnemyParty party)
 {
     enemy_party = party;
 }
Ejemplo n.º 26
0
        public void Init(List <Actor> playerParty, List <Actor> enemyPartyDef)
        {
            SelectedActor   = null;
            SelectedAbility = null;

            IsEnemyTurn = false;

            VictoryScreen.gameObject.SetActive(false);
            GameOverScreen.gameObject.SetActive(false);

            PlayerParty.Clear();

            int i = 0;

            foreach (var p in playerParty)
            {
                if (p.IsAlive)
                {
                    p.transform.localPosition = new Vector3(i / 3 * -3.25f, -(i - 1) * 2.75f, 0);
                    if (i == 3)
                    {
                        var v = p.transform.localPosition;
                        v.y = 0;
                        p.transform.localPosition = v;
                    }
                    p.transform.SetParent(PlayerRoot.transform, worldPositionStays: false);
                    p.gameObject.SetActive(true);
                    p.Init();
                    PlayerParty.Add(p);
                }

                ++i;
            }

            foreach (var e in EnemyParty)
            {
                Destroy(e.gameObject);
            }
            EnemyParty.Clear();


            i = 0;
            foreach (var def in enemyPartyDef)
            {
                int onColumns = enemyPartyDef.Count - (i / 3) * 3;
                if (onColumns > 3)
                {
                    onColumns = 3;
                }
                float y = 0;

                float off = 2.75f;

                if (onColumns == 1)
                {
                    y = 2.75f;
                }
                else if (onColumns == 2)
                {
                    y   = 3.5f / 2.0f;
                    off = 3.5f;
                }

                var p = Instantiate(def, EnemeyRoot.transform);

                p.MaxHealth = (def.MaxHealth * (100 + GameController.Instance.GameDifficulty.EnemiesHealthModifier)) / 100;

                p.transform.localPosition = new Vector3(i / 3 * 3f - 0.5f, (i % 3 - 1) * off + y, 0);
                p.SetToMaxHP();
                p.gameObject.SetActive(true);
                p.Init();
                EnemyParty.Add(p);


                ++i;
            }

            SetSelection(PlayerParty.FirstOrDefault());

            foreach (var p in PlayerParty)
            {
                p.NewTurn();
            }

            ToIdleState();
        }
Ejemplo n.º 27
0
    public void ForceTurn(RbyTurn playerTurn, RbyTurn enemyTurn = null, bool speedTieWin = true)
    {
        bool useItem = Items[playerTurn.Move] != null;

        if (useItem)
        {
            if (playerTurn.Target != null)
            {
                UseItem(playerTurn.Move, playerTurn.Target, playerTurn.Target2);
            }
            else
            {
                UseItem(playerTurn.Move, playerTurn.Flags);
            }
        }
        else if ((playerTurn.Flags & Switch) != 0)
        {
            BattleMenu(1, 0);
            ChooseMenuItem(FindPokemon(playerTurn.Move));
            ChooseMenuItem(0);
        }
        else if (EnemyMon.UsingTrappingMove)
        {
            if (CpuRead("wTopMenuItemX") != 0x9 || CpuRead("wCurrentMenuItem") != 0)
            {
                MenuPress(Joypad.Left | Joypad.Up);
            }
        }
        else if (!BattleMon.ThrashingAbout && !BattleMon.Invulnerable)
        {
            if (CurrentMenuType != MenuType.Fight)
            {
                BattleMenu(0, 0);
            }
            int moveIndex = FindBattleMove(playerTurn.Move);

            // Reusing 'ChooseMenuItem' code, because the final AdvanceFrame advances past 'SelectEnemyMove.done',
            // and I don't have a good solution for this problem right now.
            RunUntil("_Joypad", "HandleMenuInput_.getJoypadState");
            var scroll = CalcScroll(moveIndex, CpuRead("wCurrentMenuItem"), CpuRead("wNumMovesMinusOne"), true);
            for (int i = 0; i < scroll.Amount; i++)
            {
                MenuPress(scroll.Input);
            }
            if ((CpuRead("hJoyLast") & (byte)Joypad.A) != 0)
            {
                Press(Joypad.None);
            }
            Inject(Joypad.A);
        }

        if (!(EnemyMon.StoringEnergy | EnemyMon.ChargingUp | EnemyMon.UsingRage | EnemyMon.Frozen | EnemyMon.UsingTrappingMove))
        {
            Hold(Joypad.A, SYM["SelectEnemyMove.done"]);
            A = enemyTurn != null && enemyTurn.Move != "" ? Moves[enemyTurn.Move].Id : 0;
        }

        bool playerFirst;
        int  speedtie = Hold(Joypad.A, SYM["MainInBattleLoop.speedEqual"] + 9, SYM["MainInBattleLoop.enemyMovesFirst"], SYM["MainInBattleLoop.playerMovesFirst"]);

        if (speedtie == SYM["MainInBattleLoop.enemyMovesFirst"])
        {
            playerFirst = false;
        }
        else if (speedtie == SYM["MainInBattleLoop.playerMovesFirst"])
        {
            playerFirst = true;
        }
        else
        {
            A           = speedTieWin ? 0x00 : 0xff;
            playerFirst = speedTieWin;
        }

        if (playerFirst)
        {
            if (!useItem)
            {
                ForceTurnInternal(playerTurn);
            }
            else
            {
                RunUntil(SYM["MainInBattleLoop.playerMovesFirst"] + 6);
            }
            if (enemyTurn != null)
            {
                ForceTurnInternal(enemyTurn);
            }
        }
        else
        {
            Debug.Assert(enemyTurn != null, "No enemy turn was specified even though the opponent moved first!");
            ForceTurnInternal(enemyTurn);
            if (!useItem)
            {
                ForceTurnInternal(playerTurn);
            }
        }

        CurrentMenuType = MenuType.None;

        // Semi-terrible code to get around thrash. TODO: fix
        if (BattleMon.ThrashingAbout)
        {
            if (EnemyMon.HP == 0)
            {
                if (EnemyParty.Where(mon => mon.HP > 0).Count() > 1)
                {
                    ClearTextUntil(Joypad.None, SYM["PlayCry"]);
                }
                else
                {
                    ClearText();
                }
            }
        }
        else if (!BattleMon.Invulnerable)
        {
            ClearText();
        }
    }
Ejemplo n.º 28
0
 public bool run(Player player, EnemyParty party)
 {
     return(false);
 }
Ejemplo n.º 29
0
        public void OnClose()
        {
            _songManager.Stop();

            EnemyParty = null;
        }
Ejemplo n.º 30
0
 public void EnterCombat()
 {
     EnemyParty.SetArenaFoes();
     SceneManager.LoadScene(Constants.SCENE_PRE_COMBAT);
 }