Esempio n. 1
0
    //*******************************************
    //BEGIN TAKE DAMAGE AND REMOVE UNIT PROCEDURE
    //*******************************************

    public void TakeDamage(int rawDamage, Vector3 impactPoint, WorldObject woDoingDamage)
    {
        if (rawDamage > 0 && paramManager.IsDead)
        {
            return;
        }
        int damage = ConsiderDamageMultipliers(rawDamage);

        paramManager.HPmod(damage);
        ConsiderShowingDamageOnWorldInfoCanvas(damage, impactPoint);
        if (StageManager.Instance)
        {
            foreach (Player p in StageManager.Instance.listOfPlayersWithWorldInfoCanvas)
            {
                p.worldInfoCanvasScript.UpdateWorldObjectStats(worldObject);
            }
        }
        if (paramManager.IsDead)
        {
            if (woDoingDamage && woDoingDamage.player)
            {
                RewardKiller(woDoingDamage.player);
            }
            ManageDeathOfWorldObject();
        }
    }