Exemplo n.º 1
0
    void OnMoldormDeath(EnemyAI_Moldorm moldorm)
    {
        Enemy       e  = GetComponent <Enemy>();
        DungeonRoom dr = e.DungeonRoomRef;


        if (dr != null)
        {
            dr.OnRoomEnemyDied(e);
        }
        if (enemyAnim != null)
        {
            enemyAnim.PlayDeathAnimation();
        }

        if (moldorm.IsLastWormPiece)
        {
            Enemy.EnemiesKilled++;
            Enemy.EnemiesKilledWithoutTakingDamage++;

            EnemyItemDrop itemDrop = GetComponent <EnemyItemDrop>();
            if (itemDrop != null)
            {
                itemDrop.DropRandomItem();
            }
        }

        moldorm.OnDeath();
        return;
    }
Exemplo n.º 2
0
 public override void OnDead()
 {
     GameplayState.KilledEnemies++;
     myAnimatorState.TriggerAnimation("dead", 1.0f);
     myEnemyItemDrop.DropRandomItem();
     myCollider.enabled       = false;
     myShowEnemyStats.enabled = false;
     myEnemySFX.enabled       = false;
 }
Exemplo n.º 3
0
    void Death(HealthController healthController, GameObject killer)
    {
        EnemyAI_Moldorm moldorm = GetComponent <EnemyAI_Moldorm>();

        if (moldorm != null)
        {
            OnMoldormDeath(moldorm);
            return;
        }

        EnemyAI_Vire vire = GetComponent <EnemyAI_Vire>();

        if (vire != null)
        {
            if (killer.name != "MagicSword_Weapon")
            {
                vire.SpawnKeese();
            }
        }

        EnemyAI_GleeokHead gleeokHead = GetComponent <EnemyAI_GleeokHead>();

        if (gleeokHead != null)
        {
            gleeokHead.gleeok.SendMessage("OnHeadDied", gleeokHead, SendMessageOptions.RequireReceiver);
        }

        EnemyAI_PatraSmall smallPatra = GetComponent <EnemyAI_PatraSmall>();

        if (smallPatra != null)
        {
            smallPatra.ParentPatra.SendMessage("OnSmallPatraDied", smallPatra, SendMessageOptions.RequireReceiver);
        }

        EnemyAI_DigdoggerSmall smallDigdogger = GetComponent <EnemyAI_DigdoggerSmall>();

        if (smallDigdogger != null)
        {
            smallDigdogger.ParentDigdogger.SendMessage("OnBabyDied", smallDigdogger, SendMessageOptions.RequireReceiver);
        }

        Enemy         e        = GetComponent <Enemy>();
        DungeonRoom   dr       = e.DungeonRoomRef;
        EnemyItemDrop itemDrop = GetComponent <EnemyItemDrop>();

        Enemy.EnemiesKilled++;
        Enemy.EnemiesKilledWithoutTakingDamage++;

        if (itemDrop != null)
        {
            itemDrop.DropRandomItem();
        }
        if (dr != null)
        {
            dr.OnRoomEnemyDied(e);
        }
        if (enemyAnim != null)
        {
            enemyAnim.PlayDeathAnimation();
        }

        SendMessage("OnEnemyDeath", SendMessageOptions.DontRequireReceiver);
    }