Exemple #1
0
    public void SellTurret()
    {
        PlayerStats.Money += turretBlueprint.GetSellAmount();

        GameObject effect = (GameObject)Instantiate(buildManager.sellEffect, GetBuildPosition(), Quaternion.identity);

        Destroy(effect, 5f);

        Destroy(turret);
        turretBlueprint = null;
    }
Exemple #2
0
    public void SellTurret()
    {
        PlayerStats.Money += turretBlueprint.GetSellAmount();

        // Erzeugen des Effekts vom verkaufen
        GameObject sellEffectGO = (GameObject)Instantiate(buildManager.sellEffect, GetBuildPosition(), Quaternion.identity);

        Destroy(sellEffectGO, 5f);

        Destroy(turret);
        turretBlueprint = null;
    }
Exemple #3
0
    public void SellTurret()
    {
        PlayerStats.Money += turretBlueprint.GetSellAmount();

        //cool code animation
        GameObject effect = Instantiate(buildManager.sellEffect, GetBuildPosition(), Quaternion.identity); //when turret is sold, this effect happens

        Destroy(effect, 5f);

        Destroy(turret);
        turretBlueprint = null;
    }
Exemple #4
0
    public void SellTurret()
    {
        PlayerStats.Money += turretBlueprint.GetSellAmount();

        //spawn a cool effect;

        Destroy(turret);
        turretBlueprint = null;
        GameObject sellEffect = Instantiate(buildManager.buildEffect, transform.position + new Vector3(0f, 1f, 0f), Quaternion.identity);

        Destroy(sellEffect, 0.3f);
    }
    public void SellTurret()
    {
        PlayerStats.money += turretBlueprint.GetSellAmount(isUpgraded);

        //Spawn Effect
        GameObject timeEffect = (GameObject)Instantiate(buildManager.sellEffect, GetBuildPos(), Quaternion.Euler(180, 0, 0)); //change buildeffect to uprgadeEffect for variation (?)

        Destroy(timeEffect, 5f);

        Destroy(turret);
        turretBlueprint = null;
    }
Exemple #6
0
    public void SellTurret()
    {
        PlayerStats.Money += turretBlueprint.GetSellAmount();

        var effect = Instantiate(buildManager.sellEffect, GetBuildPosition(), Quaternion.identity);

        Destroy(effect, 5f);

        Destroy(turret);
        turretBlueprint = null;
        nodeSensorData.SetTurretType(TurretType.None);
    }
    public void SellTurret()
    {
        PlayerStats.Money += turretBlueprint.GetSellAmount();
        occupied           = false;
        Destroy(turret);
        img.color    = savedStartColor;
        startColor   = savedStartColor;
        hoverColor   = savedHoverColor;
        invalidColor = savedInvalidColor;

        turretBlueprint = null;
    }
    /// <summary>
    /// Selling buildt turret
    /// </summary>
    public void SellTurret()
    {
        PlayerStats.Money += turretBlueprint.GetSellAmount();

        //Creates selling effect and destroy it from Scene after 2s
        GameObject effect = Instantiate(buildManager.sellEffect, GetBuildPosition(), Quaternion.identity);

        Destroy(effect, 2f);

        Destroy(turret);
        turretBlueprint = null;
        isUpgraded      = false;
    }
    // sell the turret when the sell button is activated
    public void SellTurret()
    {
        // add half of the turret's cost to the player's money
        PlayerStats.Money += turretBlueprint.GetSellAmount();

        //spawn an effect and destroy turret
        GameObject effect = (GameObject)Instantiate(buildManager.sellEffect, GetBuildPosition(), Quaternion.identity);

        Destroy(effect, 5f);
        Destroy(turret);
        turretBlueprint = null;
        isUpgraded      = false;
    }
Exemple #10
0
    public void SellTurret()
    {
        PlayerStats.Money += turretBluePrint.GetSellAmount();

        GameObject sellEffect = (GameObject)Instantiate(buildManager.sellTurretEffect, getBuildPosition(), Quaternion.identity);

        Destroy(sellEffect, 1.0f);

        Destroy(turret);
        turretBluePrint = null;

        isUpgraded = false;
    }
Exemple #11
0
    public void SellTurret()
    {
        soundManager.PlaySoundEffect("ItemPurchase");

        PlayerStats.Money += turretBlueprint.GetSellAmount();
        Destroy(turret);

        GameObject effect = Instantiate(buildManager.sellEffectPrefab, GetBuildPosition(), Quaternion.identity) as GameObject;

        Destroy(effect, 5f);

        turretBlueprint = null;
    }
Exemple #12
0
    public void SellTurret()
    {
        if (!isUpgraded)
        {
            GameManager.instance.playerStats.Money += turretBlueprint.GetSellAmount();
        }
        else
        {
            GameManager.instance.playerStats.Money += turretBlueprint.GetSellAmount() * 2;
        }
        GameManager.instance.levelMgr.RefreshMoney();

        GameObject effect = Instantiate(buildManager.sellEffect, GetBuiltPosition(), Quaternion.identity);

        effect.GetComponent <Renderer>().material.color = turret.GetComponentInChildren <MeshRenderer>().material.color;
        effect.transform.parent = hierarchyManager.EffectsParent;
        Destroy(effect, 3f);

        Destroy(turret);
        turretBlueprint = null;
        isUpgraded      = false;
    }
Exemple #13
0
    public void SellTurret()
    {
        PlayerStats.Instance.ChangeMoney(turretBlueprint.GetSellAmount());

        GameObject _selleffect = MyObjectPooler.Instance.SpawnFromPool(buildManager.sellEffect);

        _selleffect.transform.position = GetBuildPosition();
        _selleffect.transform.rotation = Quaternion.identity;
        _selleffect.SetActive(true);

        MyObjectPooler.Instance.ReturnToPool(turret);
        turret          = null;
        turretBlueprint = null;
    }
Exemple #14
0
    public void SellTurret()
    {
        PlayerStats.Money += turretBlueprint.GetSellAmount();

        // Spawn a cool effect
        GameObject effect = (GameObject)Instantiate(buildManager.buildEffect, GetBuildPosition(), Quaternion.identity);

        Destroy(effect, 5f);

        isUpgraded = false;

        Destroy(turret);
        turretBlueprint = null;
    }
Exemple #15
0
    public void SellTurret()
    {
        PlayerStats.Money += turretBlueprint.GetSellAmount();

        GameObject sellEffect = (GameObject)Instantiate(buildManager.sellEffect, GetBuildPosition(), Quaternion.identity);

        Destroy(sellEffect, 5f);

        UpdateTempFavorValues("Selling");

        turretLevel = 0;

        Destroy(turret);
        turretBlueprint = null;
    }
Exemple #16
0
    public void SellTurret()
    {
        // Get the damn money
        PlayerStats.Money += turretBlueprint.GetSellAmount();

        // Destroy the object
        Destroy(turret);

        // Play a cool thing
        GameObject effect = (GameObject)Instantiate(buildManager.sellEffect, GetBuildPosition(), Quaternion.identity);

        Destroy(effect, 5f);

        turretBlueprint = null;
    }
Exemple #17
0
    public void SellTurret()
    {
        if (isUpgraded == false)
        {
            PlayerStats.Money += turretBlueprint.GetSellAmount();
        }
        else if (isUpgraded == true)
        {
            PlayerStats.Money += turretBlueprint.GetUpSellAmount();
        }

        Destroy(turret);
        turretBlueprint = null;
        turret          = null;
        isUpgraded      = false;
    }
Exemple #18
0
    public void CallSellTurret()
    {
        if (player == null)
        {
            player = FindObjectOfType <LocalPlayerCommands>();
        }

        if (turretBlueprint == null)
        {
            BuildManager.Instance.message.PlayMessage("No Turret To Sell!", transform, Color.red);
            return;
        }

        playerStats.money += turretBlueprint.GetSellAmount(isUpgraded);
        player.CmdSellTurret(nodeID);
    }
    public void SellTurret()
    {
        if (!isUpgraded)
        {
            PlayerStats.Money += turretBlueprint.GetSellAmount();
        }
        else
        {
            PlayerStats.Money += turretBlueprint.GetUpgradeSellAmount();
        }

        //TODO add cool effect

        Destroy(turret);
        turretBlueprint = null;
        isUpgraded      = false;
    }
Exemple #20
0
    public void SellTurret()
    {
        //adds money to the player's stats
        PlayerStats.money += turret_blueprint.GetSellAmount();
        //destroy the tower and reset the upgraded boolean to allow for upgrading again
        Destroy(tower);
        is_upgraded = false;
        //sets the blueprint to null because there is no current tower on this spot.
        turret_blueprint = null;

        click_scr = null;

        PlayerStats.building_amount--;
        if (PlayerStats.building_amount < 0)
        {
            PlayerStats.building_amount = 0;
        }
    }
Exemple #21
0
    public void SellTurret()
    {
        PlayerStats.Money += turretBlueprint.GetSellAmount();

        // TODO do better sound
        GameObject soundGameObject = new GameObject();

        soundGameObject.transform.position = turret.transform.position;
        AudioSource audioSource = soundGameObject.AddComponent <AudioSource>();

        audioSource.clip = Resources.Load("Sound/Cha Ching") as AudioClip;
        audioSource.Play();
        Destroy(soundGameObject, 5f);

        Destroy(turret);
        turret          = null;
        turretBlueprint = null;
        isUpgraded      = false;
    }
    public void SellTurret()
    {
        // Refund Player some Money
        PlayerStats.Money += turretBlueprint.GetSellAmount();

        // Stop Repeating Function checking turrets health
        CancelInvoke(nameof(CheckForDamage));

        //Spawn Effect
        GameObject effect = Instantiate(buildManager.sellEffect, GetBuildPosition(), Quaternion.identity);

        Destroy(effect, 5f);

        Destroy(turret);
        turretBlueprint = null;

        isDamaged   = false;
        isDestroyed = false;
    }
Exemple #23
0
    public void SellTurret()
    {
        if (!isUpgraded)
        {
            PlayerStats.money += turretBlueprint.GetSellAmount();
        }
        else
        {
            PlayerStats.money += turretBlueprint.GetSellAmountIsUpgraded();
            isUpgraded         = false;
        }

        Destroy(turret);
        turretBlueprint = null;

        GameObject temp = Instantiate(BuildManager.instance.sellEffect, GetBuildPosition(), Quaternion.identity);

        Destroy(temp, 4f);
    }
Exemple #24
0
    public void SellTurret()
    {
        if (turret == null)
        {
            return;
        }
        BattleManager.instance.stats.Money += turretBlueprint.GetSellAmount();
        GameObject effects = GameObject.Find("Effects");

        if (!effects)
        {
            effects = new GameObject("Effects");
        }
        GameObject effect = Instantiate(buildManager.sellEffect, GetBuildPosition(), Quaternion.identity, effects.transform);

        Destroy(effect, 5f);
        Destroy(turret);
        turretBlueprint = null;
        GameToast.Add("Turret sold!");
    }
Exemple #25
0
    public void SellTurret()
    {
        if (!isUpgraded)   //업그레이드 안된 경우
        //Destroy current Turret and earn some amount of money
        {
            PlayerStats.Money += turretBlueprint.GetSellAmount();
        }
        else
        { //업그레이드 된 경우
            PlayerStats.Money += turretBlueprint.Get_UpgradeSellAmount();
        }

        //Spawn a cool effect
        GameObject effect = (GameObject)Instantiate(buildManager.sellEffect, GetBuildPosition(), Quaternion.identity);

        Destroy(effect, 5f); //Destroy effect after 5 seconds

        Destroy(turret);
        isUpgraded      = false;
        turretBlueprint = null;
    }
    /*
     * void OnMouseDown()
     * {
     *  if (EventSystem.current.IsPointerOverGameObject())
     *  {
     *      return;
     *  }
     *
     *  if (buildManger.GetTurretToBuild() == null)
     *      return;
     *
     *  if (turret != null)
     *  {
     *      Debug.Log("Can't build there! ");
     *      return;
     *  }
     *
     *  GameObject turretToBuild = Red_BuildManager.instance.GetTurretToBuild();
     *  turret = (GameObject)Instantiate(turretToBuild, transform.position + positonOffset, transform.rotation);
     * }
     *
     * void OnMouseEnter()
     * {
     *  if (EventSystem.current.IsPointerOverGameObject())
     *  {
     *      return;
     *  }
     *  if (buildManger.GetTurretToBuild() != null)
     *  {
     *      rend.material.color = hColor;
     *  }
     *  return;
     * }
     *
     * void OnMouseExit()
     * {
     *  rend.material.color = startColor;
     * }
     *
     */

    public void SellTurret()
    {
        RedPlayerStats.Money += turretBlueprint.GetSellAmount();
        Destroy(turret);
        buildManger.DeselectNode();
    }
Exemple #27
0
 public void SellTurret()
 {
     PlayerStats.Money = PlayerStats.Money + turretBlueprint.GetSellAmount();
     Destroy(turret);
     turretBlueprint = null;
 }
Exemple #28
0
 public int getTurretBlueprintSaleProfit()
 {
     return(turretBlueprint.GetSellAmount());
 }