Ejemplo n.º 1
0
    public void newRound(BaseShip ship)
    {
        int    randEvent;
        Random rng = new Random();

        randEvent = rng.Next(1, 4);


        switch (randEvent)
        {
        case 1:
            if (ship.didEvade())
            {
                eventLog.AddEvent("Evaded attack by hostile ship! No damage taken.");
            }
            else
            {
                if (ship.CurrentShieldCount() > 0)
                {
                    ship.DamageShield(1);
                    eventLog.AddEvent("Taking fire! Shields hit.");
                }
                else
                {
                    ship.Damage(5);
                    eventLog.AddEvent("Taking fire! Impacts on the hull, but she's holding.");
                }
            }
            break;

        case 2:
            this.ActivateShield(1);
            eventLog.AddEvent("Enemy ship powered their shields! They're at " + this.CurrentShieldCount() + " shields!");
            break;

        case 3:
            this.Heal(2);
            eventLog.AddEvent("Enemy ship repaired their hull! They're at " + this.CurrentHP() + " health!");
            break;
        }
    }