示例#1
0
    void OnTriggerEnter(Collider col)
    {
        if ((this.gameObject.tag == "teamMLBomb" && col.gameObject.tag == "mlMonster") ||
            (this.gameObject.tag == "teamGOAPBomb" && col.gameObject.tag == "goapMonster"))
        {
            if (attachedToGO == null)
            {
                Monster attachedToMonster = col.gameObject.GetComponentInChildren <Monster>();
                if (attachedToMonster != null)
                {
                    attachedToGO = col.gameObject;
                    attachedToMonster.SetHasBomb(true);
                    isPickedUp = true;

                    //Rewarding Agent
                    MLMonsterAgent mlAgent = attachedToGO.GetComponentInChildren <MLMonsterAgent>();
                    if (mlAgent != null)
                    {
                        mlAgent.RewardAgentForPickingUpBomb();
                    }

                    if (academy.fulfillObjectivesCurriculum && academy.activeCurriculumPhase.Equals((int)MonsterTrainerAcademy.TrainingPhasesFullfillObjectives.phasePickupBomb))
                    {
                        academy.Done();
                    }
                }
            }
        }
    }
示例#2
0
    void changeAreaToTeamML()
    {
        if (!conqueredByTeamML)
        {
            Debug.Log(this.gameObject.tag + " changeAreaToTeamML");
            conqueredByNone     = false;
            conqueredByTeamML   = true;
            conqueredByTeamGOAP = false;
            changeColorToTeamML();
            masterAreaControl.NotifyAreaChanged();

            //TODO really reward all?
            List <Monster> teamMMonsters = teamMLController.teamMonsterList;
            foreach (Monster mMonsterEntity in teamMMonsters)
            {
                if (!mMonsterEntity.gameObject.activeInHierarchy)
                {
                    continue;
                }

                MLMonsterAgent mlAgent = mMonsterEntity.GetComponent <MLMonsterAgent>();
                if (mlAgent != null)
                {
                    mlAgent.RewardAgentForConqueringArea();
                }
            }

            if (academy.fulfillObjectivesCurriculum && academy.activeCurriculumPhase.Equals((int)MonsterTrainerAcademy.TrainingPhasesFullfillObjectives.phaseConquerOneArea))
            {
                academy.Done();
            }
        }
    }
示例#3
0
    public void DetonateBomb()
    {
        Debug.Log("Boom!");
        isDetonated = true;

        //Rewarding Agent
        if (attachedToGO != null)
        {
            MLMonsterAgent mlAgent = attachedToGO.GetComponentInChildren <MLMonsterAgent>();
            if (mlAgent != null)
            {
                mlAgent.RewardAgentForDetonatingBomb();
            }
        }
    }
示例#4
0
    public void DieAndRespawn()
    {
        MLMonsterAgent mlAgent = this.gameObject.GetComponentInParent <MLMonsterAgent>();

        if (mlAgent != null)
        {
            mlAgent.PunishAgentForDying();
        }

        if (hasBomb)
        {
            GameObject attachedBomb = thisTeamControler.teamBomb;
            Bomb       bombEntity   = attachedBomb.GetComponent <Bomb>();
            bombEntity.ResetBombMidGame();
            hasBomb = false;
        }

        isAlive = false;
        this.gameObject.SetActive(false);
        Debug.Log("INACTIVE!");
        Invoke("WaitForRespawnInvoke", gParameters.respawnTime);
    }
示例#5
0
    public void StartZoneMDetonates()
    {
        Debug.Log("Team GOAP wins the Game!");
        bombTeamGOAP.DetonateBomb();

        List <Monster> teamMMonsters = teamMLController.teamMonsterList;

        foreach (Monster mMonsterEntity in teamMMonsters)
        {
            if (!mMonsterEntity.gameObject.activeInHierarchy)
            {
                continue;
            }

            MLMonsterAgent mlAgent = mMonsterEntity.GetComponent <MLMonsterAgent>();
            if (mlAgent != null)
            {
                mlAgent.PunishAgentForLosing();
            }
        }

        academy.Done();
    }
示例#6
0
    public void ResetBombMidGame()
    {
        if (attachedToGO != null)
        {
            //Punishing Agent
            MLMonsterAgent mlAgent = attachedToGO.GetComponentInChildren <MLMonsterAgent>();
            if (mlAgent != null)
            {
                mlAgent.PunishAgentForLosingBomb();
            }

            attachedToGO.GetComponentInChildren <Monster>().SetHasBomb(false);
            attachedToGO = null;
        }

        if (this.tag == "teamMLBomb")
        {
            if (!(masterAreaControllerInstance.areaNorth.conqueredByTeamML && masterAreaControllerInstance.areaSouth.conqueredByTeamML))
            {
                this.gameObject.SetActive(false);
            }
        }
        else if (this.tag == "teamGOAPBomb")
        {
            if (!(masterAreaControllerInstance.areaNorth.conqueredByTeamGOAP && masterAreaControllerInstance.areaSouth.conqueredByTeamGOAP))
            {
                this.gameObject.SetActive(false);
            }
        }


        bombRB.transform.position = startPos;
        isPickedUp  = false;
        isDetonated = false;
        hasSpawned  = false;
    }
示例#7
0
    public void StartZoneADetonates()
    {
        Debug.Log("Team ML wins the Game!");
        bombTeamML.DetonateBomb();

        //TODO reward all?
        List <Monster> teamMMonsters = teamMLController.teamMonsterList;

        foreach (Monster mMonsterEntity in teamMMonsters)
        {
            if (!mMonsterEntity.gameObject.activeInHierarchy)
            {
                continue;
            }

            MLMonsterAgent mlAgent = mMonsterEntity.GetComponent <MLMonsterAgent>();
            if (mlAgent != null)
            {
                mlAgent.RewardAgentForWinning();
            }
        }

        academy.Done();
    }