public void SetParameters(EnemyPartyController e)
 {
     experienceGained    = e.experienceGained;
     remainderExperience = Mathf.RoundToInt(e.experienceGained / 2);
     coinsGained         = e.coinsGained;
     itemNames           = e.itemNames;
     itemCounts          = e.itemCounts;
 }
 // Use this for initialization
 void Start()
 {
     currentUnit  = gameObject.GetComponent <UnitStats>();
     enemyParty   = GameObject.Find("EnemyParty(Clone)").GetComponent <EnemyPartyController>();
     flow         = GameObject.Find("BattleControllers").GetComponent <BattleFlowController>();
     ui           = GameObject.Find("BattleControllers").GetComponent <BattleUIController>();
     attackDefend = GameObject.Find("BattleControllers").GetComponent <AttackDefendController>();
     mode         = GameObject.Find("BattleControllers").GetComponent <BattleModeController>();
     item         = GameObject.Find("BattleControllers").GetComponent <BattleItemController>();
     ability      = GameObject.Find("BattleControllers").GetComponent <BattleAbilityController>();
 }
    // Use this for initialization
    void Start()
    {
        units                = new List <UnitStats> ();
        friendlyUnits        = new List <UnitStats>();
        enemyUnits           = new List <UnitStats>();
        ui                   = GameObject.Find("BattleControllers").GetComponent <BattleUIController>();
        party                = GameObject.Find("PlayerParty").GetComponent <PartyController>();
        enemyEncounterObject = Instantiate(SceneMgmt.toFight);
        enemyEncounterObject.transform.SetParent(GameObject.Find("BattleHolder").transform);
        enemies = enemyEncounterObject.GetComponent <EnemyPartyController>();
        ui.SetPartyAndEnemies(party, enemies);
        arenaPrefab = Instantiate(SceneMgmt.arena);
        arenaPrefab.transform.SetParent(GameObject.Find("BattleHolder").transform);
        int members = 0;

        for (int i = 0; i < party.playerParty.Length; i++)
        {
            if (party.playerParty[i] != null && members < 4 && party.playerParty[i].GetComponent <UnitStats>().available)
            {
                UnitStats member = party.playerParty[i].GetComponent <UnitStats>();
                if (!member.IsDead())
                {
                    units.Add(member);
                }
                friendlyUnits.Add(member);
                members++;
                ui.CreatePartyButton(i, members);
            }
        }
        for (int i = 0; i < enemies.enemyParty.Length; i++)
        {
            if (enemies.enemyParty[i] != null && i < 4)
            {
                UnitStats enemy = enemies.enemyParty[i].GetComponent <UnitStats>();
                units.Add(enemy);
                enemyUnits.Add(enemy);
                ui.CreateEnemyButton(i);
            }
        }
        StartCoroutine(WaitAndThenSort());
    }
Beispiel #4
0
 public void SetPartyAndEnemies(PartyController p, EnemyPartyController e)
 {
     party   = p;
     enemies = e;
 }