예제 #1
0
    private void Start()
    {
        timer2 = timer;
        player = MetaScript.getPlayer();

        buildingCheck = player.GetComponent <InBuilding>();
        controls      = MetaScript.GetControls();
    }
예제 #2
0
    private void heatExhaust(GameObject victim)
    {
        InBuilding shelterCheck = victim.GetComponent <InBuilding>();

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

        if (shelterCheck == null || !shelterCheck.getPlayerInBuilding())
        {
            buffsys.slowApplyingSystem(victim, slowDuration, slowDecimal);
        }
    }
예제 #4
0
    private void setBuildingCheckOnNPC(GameObject npc, bool val)
    {
        InBuilding buildingCheck = npc.GetComponent <InBuilding>();

        if (buildingCheck == null)
        {
            buildingCheck = npc.AddComponent <InBuilding>();
        }
        buildingCheck.setPlayerInBuilding(val);
    }
예제 #5
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);
         }
     }
 }
예제 #6
0
    private bool checkIfInBuilding(GameObject victim)
    {
        InBuilding buildingCheck = victim.GetComponent <InBuilding>();

        if (buildingCheck == null)
        {
            return(false);
        }
        else
        {
            return(buildingCheck.getPlayerInBuilding());
        }
    }
예제 #7
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);
            }
        }
    }