Beispiel #1
0
    public void onSpawn()
    {
        Debug.Log(currentBuff);
        if (currentBuff == 1)
        {
            MainWeapons[currentMainWeapon].GetComponent<WeaponScript>().moreAmmo();
            SecondaryWeapons[currentSecondaryWeapon].GetComponent<WeaponScript>().moreAmmo();
        }
        else
        {
            MainWeapons[currentMainWeapon].GetComponent<WeaponScript>().resetAmmo();
            SecondaryWeapons[currentSecondaryWeapon].GetComponent<WeaponScript>().resetAmmo();

            if (currentBuff == 2)
            {
                ArmorAndWeapons armor = ArmorUI.GetComponent<ArmorAndWeapons>();

                armor.equipRandomArmorpiece();

            }
            else
            {

            }

        }
        equipMainWeapon();
        vanish();
    }
Beispiel #2
0
    public bool receiveDMG(double dmg, Vector3 direction)
    {
        ArmorAndWeapons armor     = ArmorUI.GetComponent <ArmorAndWeapons>();
        double          reduction = armor.getProtection();
        double          negDMG    = dmg / 10 * reduction;

        dmg           -= negDMG % 0.5;
        CurrentHealth -= dmg;

        canvasScript.SpawnIndicator(player.transform, direction);

        return(CurrentHealth <= 0);
    }
Beispiel #3
0
    public void spawnPlayer()
    {
        var evnt = PlayerVisibilityChanged.Create(Bolt.GlobalTargets.Others);

        evnt.Player  = player.GetComponent <FirstPersonController>().GetEntity();
        evnt.Visible = true;
        evnt.Send();

        player.SetActive(true);
        player.GetComponent <FirstPersonController>().bindMouse();
        activate_ALIVE_UI();
        ArmorAndWeapons armor   = ArmorUI.GetComponent <ArmorAndWeapons>();
        Stamina         stamina = StaminaUI.GetComponent <Stamina>();
        Hearts          health  = HealthUI.GetComponent <Hearts>();
        WeaponControl   weapons = EquipmentUI.GetComponent <WeaponControl>();

        armor.resetArmor();
        stamina.resetStamina();
        health.resetHealth();
        weapons.onSpawn();
        player.transform.position = randomSpawnpoint();
    }