Exemplo n.º 1
0
        // Events for when Ship Takes Damage
        public void takehit(starship target, int dmg)
        {
            // Reduces Shield Level of Starship
            if (target.shield_level > 0)
            {
                target.shield_level = target.shield_level - dmg;

                //if (target.shield_level < 0)
                //{
                //    int tmp = Math.Abs(shield_level);
                //    target.health = target.health - tmp;
                //}
            }
            else if (target.shield_level <= 0)
            {
                target.health = target.health - dmg;
            }

            // Reduced Health of Starship
            if (target.health <= 0)
            {
                target.condition = condition_type[0];
            }
            else if (target.health < target.max_health || target.health > 0)
            {
                target.condition = condition_type[1];
            }
            else if (target.health == max_health)
            {
                target.condition = condition_type[2];
            }
        }
Exemplo n.º 2
0
        // Methods

        // Reduces Ammo and Calls takehit()
        public bool fire(starship target, int dmg)
        {
            if (condition != condition_type[0])
            {
                if (ordinance > 0)
                {
                    ordinance = ordinance - 1;
                    takehit(target, dmg);
                    return(true);
                }
                else
                {
                    MessageBox.Show("LOAD THE GUN IDIOT");
                    return(false);
                }
            }
            else
            {
                MessageBox.Show("SHIP IS DESTROYED CANNOT FIRE");
                return(false);
            }
        }
Exemplo n.º 3
0
 // Loads Ammo
 public void load(starship MyShip)
 {
     MyShip.ordinance = MyShip.ordinance + 2;
 }