Example #1
0
    private void UseShield()
    {
        if (lastLoss != 0)
        {
            shield.interactable = false;

            if (isDead)
            {
                hero.setWP(lastLoss);

                isDead               = false;
                fight.fightOver      = false;
                fight.ResultMsg.text = "";
                fight.fighters.Add(this);
                fight.newRoundBtn.interactable = true;

                transform.Find("Image").gameObject.SetActive(true);
                transform.Find("RIP").gameObject.SetActive(false);
            }
            else
            {
                hero.setWP(hero.Willpower + lastLoss);
            }

            if (shieldToken is HalfShield)
            {
                hero.heroInventory.RemoveBigToken(shieldToken);
            }
            else
            {
                HalfShield hs = HalfShield.Factory();
                hero.heroInventory.ReplaceBigToken(shieldToken, hs, true);
            }
        }
    }
Example #2
0
    public static HalfShield Factory(int cellID)
    {
        HalfShield shield = HalfShield.Factory();

        shield.Cell = Cell.FromId(cellID);
        return(shield);
    }
Example #3
0
    public static HalfShield Factory()
    {
        GameObject shieldGO = PhotonNetwork.Instantiate("Prefabs/Tokens/ShieldBack", Vector3.zero, Quaternion.identity, 0);
        HalfShield shield   = shieldGO.GetComponent <HalfShield>();

        shield.Cell = null;
        return(shield);
    }
Example #4
0
    public override void UseEffect()
    {
        BigToken bigToken = GameManager.instance.MainHero.heroInventory.bigToken;

        if (!bigToken is Shield || bigToken.GetComponent <PhotonView>().ViewID != GetComponent <PhotonView>().ViewID)
        {
            return;
        }

        HalfShield shield = HalfShield.Factory();

        GameManager.instance.MainHero.heroInventory.ReplaceBigToken((BigToken)this, shield, true);
    }