예제 #1
0
    private void heatExhaust(GameObject victim)
    {
        InBuilding shelterCheck = victim.GetComponent <InBuilding>();

        if (shelterCheck == null || !shelterCheck.getPlayerInBuilding())
        {
            victim.GetComponent <Health>().damage(damagePerTick);
        }
    }
예제 #2
0
    protected virtual void slow(GameObject victim)
    {
        InBuilding shelterCheck = victim.GetComponent <InBuilding>();

        if (shelterCheck == null || !shelterCheck.getPlayerInBuilding())
        {
            buffsys.slowApplyingSystem(victim, slowDuration, slowDecimal);
        }
    }
예제 #3
0
 protected override void slow(GameObject victim)
 {
     if (!MetaScript.getGlobal_Stats().getHasHeatProtection())
     {
         InBuilding shelterCheck = victim.GetComponent <InBuilding>();
         if (shelterCheck == null || !shelterCheck.getPlayerInBuilding())
         {
             buffsys.slowApplyingSystem(victim, slowDuration, slowDecimal);
         }
     }
 }
예제 #4
0
    private bool checkIfInBuilding(GameObject victim)
    {
        InBuilding buildingCheck = victim.GetComponent <InBuilding>();

        if (buildingCheck == null)
        {
            return(false);
        }
        else
        {
            return(buildingCheck.getPlayerInBuilding());
        }
    }
예제 #5
0
    // Update is called once per frame
    void Update()
    {
        if (controls.keyDown(controls.TownPortal))
        {
            bool inBuilding = false;
            if (buildingCheck != null)
            {
                inBuilding = buildingCheck.getPlayerInBuilding();
            }

            if (MetaScript.getRes().hasResource(costType, resourceCost) && !inBuilding)
            {
                MetaScript.getRes().addResource(costType, -resourceCost);
                MetaScript.preTeleport();
                transform.parent.transform.position = MetaScript.getTownCenter().transform.position + new Vector3(0.5f, 0, -0.5f);
                MetaScript.postTeleport();
                MetaScript.Poof(MetaScript.getPlayer().transform.position);
            }
        }
    }
예제 #6
0
    // Update is called once per frame
    void Update()
    {
        InBuilding shelterCheck = gameObject.GetComponentInParent <InBuilding>();

        if (shelterCheck == null || !shelterCheck.getPlayerInBuilding())
        {
            timeFromLastSpawn += Time.deltaTime;
            if (timeFromLastSpawn >= timeToNextSpawn)
            {
                float angle  = Random.Range(0, 2 * Mathf.PI);
                float radius = Random.Range(minRadius, maxRadius);

                Vector3 pos = gameObject.transform.position;
                pos.x += radius * Mathf.Cos(angle);
                pos.z += radius * Mathf.Sin(angle);
                pos.y  = 0.0000001f;

                Instantiate(trap, pos, Quaternion.identity, null);

                timeFromLastSpawn = 0;
                timeToNextSpawn   = Random.Range(minSecondsBetweenSpawns, maxSecondsBetweenSpawns);
            }
        }
    }