예제 #1
0
 void HealthCheck()
 {
     //this boss health check will see if the battery is below 0 if so then
     //it checks the oower level to recharge the battery
     //then lowers the power level and weaponstates.
     if (activeBattery.batteryHP <= 0)
     {
         if (powerLevel > 0)
         {
             activeBattery.RechargeBattery();
             powerLevel--;
             rHGunState -= 1;
             lHGunState -= 1;
         }
         else
         {
             CompleteObjective(this);
             bossState = StateBoss.dead;
             Instantiate(deathExplosion, transform.position, transform.rotation);
             gameObject.SetActive(false);
         }
     }
     else
     {
         bossState = StateBoss.alive;
     }
 }
예제 #2
0
    // we will have a boss that will go down the levels of the armor and will take 3 dead batteries to kill about 30 hit points

    void Start()
    {
        //at the start boss will be at max levels
        bossState    = StateBoss.alive;
        armorState   = StateArmor.heavy;
        rHGunState   = StateRHGun.lvl3;
        lHGunState   = StateLHGun.lvl3;
        powerLevel   = 2;
        playerTarget = FindObjectOfType <TopDownControlls>().gameObject.transform;

        moveSpot.position = new Vector2(Random.Range(minX, maxX), Random.Range(minY, maxY));

        maxSpeed = speed;
    }