Ejemplo n.º 1
0
    private void EnemyDied(EventInfo eventInfo)
    {
        EnemyDiedEventInfo info = (EnemyDiedEventInfo)eventInfo;

        if (info.killerPlayer != null)
        {
            PlayerStats stats;

            switch (info.killerPlayer.Id)
            {
            case 1:
                stats = p1Stats;
                break;

            case 2:
                stats = p2Stats;
                break;

            default:
                stats = p1Stats;
                break;
            }

            if (info.killedSameColor)
            {
                stats.EnemyKilledOk(info.color, info.specialKill);
            }
            else
            {
                stats.EnemyKilledWrong();
            }
        }
    }
Ejemplo n.º 2
0
    private void WormSectionDestroyed(EventInfo eventInfo)
    {
        EnemyDiedEventInfo info = (EnemyDiedEventInfo)eventInfo;

        --colorCount[(int)info.color];
        if (colorCount[(int)info.color] < 0)
        {
            colorCount[(int)info.color] = 0;
        }
    }
Ejemplo n.º 3
0
    private void EnemyDied(EventInfo eventInfo)
    {
        EnemyDiedEventInfo info = (EnemyDiedEventInfo)eventInfo;

        --colorCount[(int)info.color];
        if (colorCount[(int)info.color] < 0)
        {
            colorCount[(int)info.color] = 0;
        }
    }