//UPDATE POWER EFFECTS
    public override void deliverPowerEffects(PersonStatus status, AnimationScript animator, UnitNavigationController navigator)
    {
        if (status.UnitStatus != PersonStatus.Status.Raged && status.UnitStatus != PersonStatus.Status.Dead && !started)
        {
            if (animator.powerEffect)
            {
                Object.Destroy(animator.powerEffect);
            }

            started           = true;
            status.UnitStatus = PersonStatus.Status.Panicked;
            BasePowerDealer fireDealer = (BasePowerDealer)GameObject.Find("Fire").GetComponent <BasePowerDealer>();
            Debug.Log(fireDealer.particleEffect);
            animator.powerEffect = (GameObject)Object.Instantiate(owner.particleEffect, new Vector3(status.transform.position.x, status.transform.position.y + 0.9f, status.transform.position.z), Quaternion.identity);
            animator.powerEffect.transform.parent = animator.transform;
            status.Fear       = owner.Fear;
            status.UnitStatus = PersonStatus.Status.Dead;
        }

        if (status.UnitStatus == PersonStatus.Status.Dead)
        {
            Object.Destroy(animator.powerEffect, 1f);
            status.ActivePower = null;
        }
    }
Пример #2
0
    void burnCalculations(Collider other)
    {
        if (other.name == "Fireball" && !isBurning)
        {
            isBurning = true;
            fireHouse.SetActive(true);
            fireDealer = (BasePowerDealer)other.transform.parent.GetComponent <BasePowerDealer>();
        }

        if (other.tag == GlobalManager.npcsTag && !isBurning)
        {
            PersonStatus status = other.GetComponent <PersonStatus>();

            if (status.ActivePower != null && status.ActivePower.effectName == "fuoco")
            {
                isBurning = true;
                fireHouse.SetActive(true);
                fireDealer = (BasePowerDealer)GameObject.Find("Fire").GetComponent <BasePowerDealer>();
            }
        }

        if (other.tag == GlobalManager.npcsTag && isBurning)
        {
            PersonStatus status = other.GetComponent <PersonStatus>();

            if (status.UnitStatus == PersonStatus.Status.Dead)
            {
                return;
            }

            if (status.ActivePower == null)
            {
                burnPerson(status);
            }
            else if (status.ActivePower.effectName == "calma" || status.UnitStatus == PersonStatus.Status.Raged)
            {
                status.ActivePower = null;

                if (status.UnitStatus == PersonStatus.Status.Raged)
                {
                    status.UnitStatus = PersonStatus.Status.Panicked;
                }

                burnPerson(status);
            }
        }
    }
    // Use this for initialization
    void Start()
    {
        tutorialLabel       = this.GetComponent <UILabel>();
        originalCamPosition = Camera.main.transform.position;
        GlobalManager.globalManager.standardVictoryConditions = false;
        var persons = GameObject.FindGameObjectsWithTag("Person");

        firstTze  = persons[0].GetComponent <PersonStatus>();
        secondTze = persons[1].GetComponent <PersonStatus>();
        thirdTze  = persons[2].GetComponent <PersonStatus>();

        GlobalManager.globalManager.onEndGame += endGame;

        controllerType = InputMapping.getValidControllersID() [InputMapping.getCurrentController()];

        tutorialLabel.text = "Welcome to the next step almighty god! This time we will take a look at some new cool powers !!";

        //WriteMessage("Welcome to the next step almighty god!",1.7f,0.25f,0f);
        //WriteMessage("This time we will take a look at some new cool powers !!",1.8f,0.25f,0f);


        ragePower = GlobalManager.globalManager.gameObject.transform.FindChild("Rage").GetComponent <BasePowerDealer>();
    }
Пример #4
0
 public void initialize(BasePowerDealer owner)
 {
     this.owner = owner;
 }