Example #1
0
    void SendAttack()
    {
        AttackObject attackCopy = GameObject.Instantiate(selectedAttack.attackObject, field.transform.position, field.transform.rotation);

        attackCopy.Setup(field, PlayerID, selectedAttack, cardToAttack);
        PopTextManager.CreateText(Vector3.zero + new Vector3(10f, 0f, 0f),
                                  string.Format("Player {0} used \n{1}\non Player {2}!", PlayerID, selectedAttack.attackName, cardToAttack.ownerID),
                                  Color.gray, 53, 120, 110, true);

        AudioSource.PlayClipAtPoint(attackCopy.attackSpawn, cam.transform.position);
    }
Example #2
0
    public void TakeDamage(int amount)
    {
        this.HP -= amount;
        PopTextManager.CreateText(this.transform.position + new Vector3(0, 02f, 0f),
                                  "-" + amount.ToString(), new Color(1f, 0.3f, 0.3f), 51, 60, 75, true);
        UpdateHPString();

        if (HP <= 0)
        {
            PopTextManager.CreateText(this.transform.position - new Vector3(3.25f, 0.2f, 0f),
                                      "FATAL!", Color.red, 52, 100, 100, true);

            Player owner = Table.GetPlayerFromID(ownerID);
            owner.DestroyFieldCard();
        }
    }
Example #3
0
 private void Awake()
 {
     instance = this;
 }
Example #4
0
 private void Awake()
 {
     instance = this;
     PopText  = this.gameObject.GetComponent <Text>();
 }