コード例 #1
0
    /// <summary>
    /// Adds a monster from trainer encounter.
    /// </summary>
    /// <param name="monsterInfo">Monster info.</param>
    public void AddMonster(MonsterParty monstersInfo)
    {
        for (var count = 0; count < MAX_MONSTERS_IN_PARTY; count++)
        {
            var monsterInfo = monstersInfo[count];
            party[count].Initialize(HeavyMonsters.GetHeavyReference(monsterInfo.MonsterIndex), (ushort)monsterInfo.MonsterLevel);

            for (var index = 0; index < partyMovesContainer.Length; index++)
            {
                partyMovesContainer[index] = null;
            }

            //TODO clean this up.
            if (monsterInfo.MoveOne.MonsterMoveIndex >= 0)
            {
                partyMovesContainer[0] = MonsterMoves.GetMonsterMove(monsterInfo.MoveOne.MonsterMoveIndex).GetMonsterMoveInfoFromMonsterMove(monsterInfo.MoveOne.CurrentPP);
            }
            if (monsterInfo.MoveTwo.MonsterMoveIndex >= 0)
            {
                partyMovesContainer[1] = MonsterMoves.GetMonsterMove(monsterInfo.MoveTwo.MonsterMoveIndex).GetMonsterMoveInfoFromMonsterMove(monsterInfo.MoveTwo.CurrentPP);
            }
            if (monsterInfo.MoveThree.MonsterMoveIndex >= 0)
            {
                partyMovesContainer[2] = MonsterMoves.GetMonsterMove(monsterInfo.MoveThree.MonsterMoveIndex).GetMonsterMoveInfoFromMonsterMove(monsterInfo.MoveThree.CurrentPP);
            }
            if (monsterInfo.MoveFour.MonsterMoveIndex >= 0)
            {
                partyMovesContainer[3] = MonsterMoves.GetMonsterMove(monsterInfo.MoveFour.MonsterMoveIndex).GetMonsterMoveInfoFromMonsterMove(monsterInfo.MoveFour.CurrentPP);
            }

            var movesBundle = new MonsterMovesBundle(partyMovesContainer);
            party[count].InitializeMoves(movesBundle);
        }
    }
コード例 #2
0
    private void Awake()
    {
        if (instance == null)
        {
            instance = GameObject.FindObjectOfType <HeavyMonsters>();
        }

        PopulateMonsterReferences();
        PostMonstersPopulated();
    }
コード例 #3
0
 /// <summary>
 /// Adds a monster from wild encounter.
 /// </summary>
 /// <param name="monsterInfo">Monster info.</param>
 public void AddMonster(Vector2Int monsterInfo)
 {
     if (wildEncounter)
     {
         if (party.Count > 0)
         {
             party[0].Initialize(HeavyMonsters.GetHeavyReference(monsterInfo.x), (ushort)monsterInfo.y);
             return;
         }
     }
 }
コード例 #4
0
    private void PopulateParty()
    {
        if (party.Count == MAX_MONSTERS_IN_PARTY)
        {
            return;
        }

        for (var count = 0; count < MAX_MONSTERS_IN_PARTY; count++)
        {
            party.Add(new LightMonster(HeavyMonsters.GetHeavyReference(0)));
        }
    }