Inheritance: Entity
コード例 #1
0
 public MissionGoToLocation(Ship initMissionOwnerShip, int initTargetX, int initTargetY, string initMissionText)
     : base(MissionType.MISSION_TYPE_GO_TO_LOCATION, initMissionText)
 {
     missionOwnerShip = initMissionOwnerShip;
     targetLocationX = initTargetX;
     targetLocationY = initTargetY;
 }
コード例 #2
0
 public MissionStatus(Ship initShip)
 {
     missionStep = 0;
     missions = new Mission[7];
     int m = 0;
     missions[m++] = new MissionDefeatEnemy(initShip.StarSystem, "HQ: "+initShip.Name+", an enemy ship near you refuses to answer hails and... it is charging its weapons! Prepare for attack!");
     missions[m++] = new MissionGoToLocation(initShip, -422, 173, "HQ: Good work! Hold on... we are picking up a distress signal from an escape pod at 35, 73. We need you to investigate.");
     missions[m++] = new MissionDefeatEnemy(initShip.StarSystem, "Escape Pod: Thanks for coming, but be careful! Two enemy ships cloaked when you arrived. There's one now!");
     missions[m++] = new MissionDefeatEnemy(initShip.StarSystem, "Escape Pod: You got it! Nice work, "+initShip.Name+"! My name's Rogers by the way... Oh! Here comes the other one! Watch out!");
     missions[m++] = new MissionGoToLocation(initShip, 312, -936, "Rogers: That was close! My ship had a cardiac system anomaly and began a jump to the Outer Sector; I couldn't control it at all! Please, help me get it back. It should be located at 312, -936.");
     missions[m++] = new MissionGoToLocation(initShip, -55, -1111, "Rogers: There's my ship! But what is that huge mass...? And this sound; is that a heartbeat? Let's get a little closer. Approach -55, -1111.");
     missions[m++] = new MissionGoToLocation(initShip, 0, 400, "HQ: What are you doing, "+initShip.Name+"? Get out of there, now, as fast as you can! That’s an order! You cannot fight that thing! Rendezvous at Central Station located at 0, 400!");
     END_MISSION_STEP = m;
     missionChanged = true;  // first time is new
     missions[missionStep].MissionSetup();  // set up first mission
 }
コード例 #3
0
ファイル: Ship.cs プロジェクト: AdmiralPotato/ggj2013
 public void Update(TimeSpan elapsedTime, Ship currentShip)
 {
     var shieldRegenrationAmount = elapsedTime.TotalSeconds * shieldRegenerationRate;
     var energyCost = energyPerShield * shieldRegenrationAmount;
     Strength += shieldRegenrationAmount;
     currentShip.SpendRawEnergy(energyCost);
 }
コード例 #4
0
ファイル: Ship.cs プロジェクト: AdmiralPotato/ggj2013
 public static Ship Create(ShipType type, Vector3? position = null)
 {
     Ship result;
     switch (type)
     {
         case ShipType.Spearhead:
             result = new Ship(2000, position) { MaxShields = 500, Tubes = 2, PhaserBanks = 1, RepairCrews = 3 };
             result.BeamWeapons.AddRange((BeamType[])Enum.GetValues(typeof(BeamType)));
             result.BeamWeapons.Remove(BeamType.ShadowTether);
             result.Projectiles[ProjectileType.Torpedo] = 10;
             result.Projectiles[ProjectileType.Nuke] = 1;
             result.Projectiles[ProjectileType.Hardshell] = 1;
             result.Projectiles[ProjectileType.Knockshot] = 1;
             result.Projectiles[ProjectileType.Skattershot] = 1;
             break;
         case ShipType.Skirmisher:
             result = new Ship(2000, position) { MaxShields = 500, Tubes = 2, PhaserBanks = 2, RepairCrews = 3 };
             result.BeamWeapons.AddRange((BeamType[])Enum.GetValues(typeof(BeamType)));
             result.BeamWeapons.Remove(BeamType.ShadowTether);
             result.Projectiles[ProjectileType.Torpedo] = 10;
             break;
         case ShipType.Beserker:
             result = new Ship(5000, position) { MaxShields = 0, Tubes = 0, PhaserBanks = 1, MaximumForce = 12500, RepairCrews = 3 };
             result.BeamWeapons.Add(BeamType.HullPiercing);
             result.BeamWeapons.Add(BeamType.SelfDestruct);
             result.BeamWeapons.Add(BeamType.PlasmaVent);
             break;
         case ShipType.Gunboat:
             result = new Ship(1500, position) { MaxShields = 600, Tubes = 4, PhaserBanks = 1, RepairCrews = 3 };
             result.BeamWeapons.Add(BeamType.SuppresionPulse);
             result.BeamWeapons.Add(BeamType.ShadowTether);
             result.Projectiles[ProjectileType.Torpedo] = 10;
             result.Projectiles[ProjectileType.Nuke] = 1;
             result.Projectiles[ProjectileType.Hardshell] = 1;
             break;
         case ShipType.Capital:
             result = new Ship(3000, position) { MaxShields = 1000, Tubes = 5, RepairCrews = 3 };
             result.BeamWeapons.Add(BeamType.StandardPhaser);
             result.BeamWeapons.Add(BeamType.ShieldDampener);
             result.BeamWeapons.Add(BeamType.ShadowTether);
             result.Projectiles[ProjectileType.Torpedo] = 10;
             result.Projectiles[ProjectileType.Nuke] = 1;
             result.Projectiles[ProjectileType.Hardshell] = 1;
             break;
         default:
             throw new NotImplementedException("Unknown ship type " + type.ToString());
     }
     return result;
 }
コード例 #5
0
ファイル: GameHub.cs プロジェクト: AdmiralPotato/ggj2013
        internal static void Say(Game game, Ship ship, string message)
        {
            if (game != null && ship != null)
            {
                var groupName = GetShipGroupName(game.Id, ship.Id);

                var context = GlobalHost.ConnectionManager.GetHubContext<GameHub>();
                context.Clients.Group(groupName).addMessage(0, "System", message);
            }
        }
コード例 #6
0
ファイル: Entity.cs プロジェクト: AdmiralPotato/ggj2013
 internal void ReceiveCommand(Ship ship, Command command)
 {
 }