Beispiel #1
0
    //Deal Damage
    void DealDamage(PlayerHealth hp)
    {
        if (hp)
        {
            hp.DealDamage((int)Damage);

            player.playerState = PlayerState.Combat;
            player.CheckForExitCombat();
        }
    }
Beispiel #2
0
    void DealDamage(Transform target)
    {
        Health hp = (Health)target.transform.GetComponent("Health");

        if (hp)
        {
            GameObject dmgTxt = (GameObject)Instantiate(globalPrefabs.floatingDamageText);
            dmgTxt.transform.parent = target;
            FloatingTextGUI ftg = dmgTxt.GetComponent <FloatingTextGUI>();
            ftg.SetDmgInfo("", target.position);
            MonsterAI fa = (MonsterAI)target.GetComponent <MonsterAI>();
            physicalDamageDealt = 0;
            int DamageDealt = CalculateWeaponDamage(ftg, fa);
            ProcHandler(fa);
            fa.inCombat           = true;
            hp.CurrentHealth      = hp.CurrentHealth - Damage;
            playerNew.playerState = PlayerState.Combat;
            playerNew.CheckForExitCombat();
        }
    }