Beispiel #1
0
 public void AddMutantCharacter(MutantCharacter character)
 {
     _mutantsInScene.Add(character);
     _allCharacters.Add(character);
 }
    // this constructor will be used by the other one
    public MutantAnimStateAction(MutantCharacter parentCharacter)
    {
        this.ParentCharacter = parentCharacter;

        Initialize();
    }
	// this constructor will be used by the other one
	public MutantAnimStateAction(MutantCharacter parentCharacter)
	{
		this.ParentCharacter = parentCharacter;

		Initialize();
	}
Beispiel #4
0
    private void SpawnWave(int waveSize, Faction faction, bool isMultiSpawn)
    {
        AISquad enemySquad = new AISquad();

        enemySquad.Faction = faction;

        //select a spawn point
        GameObject [] spawnPoints = GameObject.FindGameObjectsWithTag("Respawn");
        int           point       = UnityEngine.Random.Range(0, spawnPoints.Length);



        for (int i = 0; i < waveSize; i++)
        {
            if (isMultiSpawn)
            {
                point = UnityEngine.Random.Range(0, spawnPoints.Length);
            }

            if (faction == Faction.Legionnaires)
            {
                enemySquad.AddMember(GameManager.Inst.NPCManager.SpawnRandomHumanCharacter("Bandit", enemySquad, spawnPoints[point].transform.position
                                                                                           + new Vector3(UnityEngine.Random.value * 3, 0, UnityEngine.Random.value * 3)));
            }
            else if (faction == Faction.Military)
            {
                enemySquad.AddMember(GameManager.Inst.NPCManager.SpawnRandomHumanCharacter("Military", enemySquad, spawnPoints[point].transform.position
                                                                                           + new Vector3(UnityEngine.Random.value * 3, 0, UnityEngine.Random.value * 3)));
            }
            else if (faction == Faction.Mutants)
            {
                string mutantName;
                int    goapID;

                if (this.Stage < 7)
                {
                    if (UnityEngine.Random.value > 0.6f)
                    {
                        mutantName = "Mutant1";
                        goapID     = 3;
                    }
                    else
                    {
                        mutantName = "Mutant1";
                        goapID     = 3;
                    }
                }
                else
                {
                    if (UnityEngine.Random.value < 0.3f)
                    {
                        mutantName = "Mutant1";
                        goapID     = 3;
                    }
                    else
                    {
                        if (UnityEngine.Random.value > 0.6f)
                        {
                            mutantName = "Mutant4";
                            goapID     = 2;
                        }
                        else
                        {
                            mutantName = "Mutant3";
                            goapID     = 2;
                        }
                    }
                }

                MutantCharacter mutant = GameManager.Inst.NPCManager.SpawnRandomMutantCharacter(mutantName, enemySquad, spawnPoints[point].transform.position
                                                                                                + new Vector3(UnityEngine.Random.value * 3, 0, UnityEngine.Random.value * 3));



                mutant.MyAI.BlackBoard.PatrolLoc     = new Vector3(62.7f, 0, -15);
                mutant.MyAI.BlackBoard.PatrolRange   = new Vector3(30, 5, 15);
                mutant.MyAI.BlackBoard.CombatRange   = new Vector3(40, 20, 20);
                mutant.MyAI.BlackBoard.HasPatrolInfo = true;
            }
        }



        enemySquad.IssueSquadCommand();
    }
Beispiel #5
0
	public void AddMutantCharacter(MutantCharacter character)
	{
		_mutantsInScene.Add(character);
		_allCharacters.Add(character);
	}