Exemple #1
0
    def spawn(self, game, player, shipId=None):
        Scenario.spawn(self, game, player, shipId)

        player.race = game.stats.R_HUMAN
        shipStats = game.stats.HUMAN_CARGO

        (x, y) = (self.orbitalbase.xp + 50, self.orbitalbase.yp + 60)

        flagship = FlagShip(player, shipStats, AiCaptain(player), x, y, 0, 0,
                            0.0, 0.0, 0.0, 0)
        flagship.ore = 0
        flagship.energy = 0
        flagship.ori = 7 / 8 * pi + pi / 2

        flagship.turrets[1].buildInstall(game.stats.T_MASS_SR_0)
        flagship.turrets[0].buildInstall(game.stats.T_MASS_MR_0)

        player.flagship = flagship
        game.objects.append(flagship)

        for i in xrange(3):
            harvester = HarvesterShip(player, player.race.defaultHarvester,
                                      AiPilotHarvester(flagship), 0, 0, 0, 4,
                                      0.0, 0.0, 0.0, 0)
            flagship.shipyards[harvester.stats.img].docked.append(harvester)

        player.needToUpdateRelations = True
Exemple #2
0
    def spawn(self, game, player, shipId):
        #  if not player.flagship and player.points >= game.stats.PlayableShips[ shipId ].points:
        player.race = game.stats.PlayableShips[shipId].race
        shipStats = game.stats.PlayableShips[shipId].stats

        dist = randint(10, self.gamma[1].stats.maxRadius)
        angle = 2 * pi * random()
        (x, y) = (self.gamma[1].xp + dist * cos(angle),
                  self.gamma[1].yp + dist * sin(angle))

        flagship = FlagShip(player, shipStats, AiCaptain(player), x, y, 0, 0,
                            0.0, 0.0, 0.0, 0)
        flagship.ore = flagship.stats.maxOre / 2
        flagship.energy = flagship.stats.maxEnergy / 2
        flagship.ori = 2 * pi * random()

        if player.race == game.stats.R_EVOLVED:
            smallTurret = game.stats.T_BURST_LASER_0
            mediumTurret = game.stats.T_SUBSPACE_WAVE_0
        elif player.race == game.stats.R_NOMAD:
            smallTurret = game.stats.T_REPEATER_1
            mediumTurret = game.stats.T_NOMAD_CANNON_0
        elif player.race == game.stats.R_AI:
            smallTurret = game.stats.T_AI_FLAK_1
            mediumTurret = game.stats.T_AI_OMNI_LASER_0
        else:
            smallTurret = game.stats.T_MASS_SR_0
            mediumTurret = game.stats.T_MASS_MR_0

        for t in flagship.turrets[:2]:
            t.buildInstall(mediumTurret)

        for t in flagship.turrets[-2:]:
            t.buildInstall(smallTurret)

        player.flagship = flagship

        game.objects.append(flagship)

        for i in range(self.harvestersAtSpawn):
            harvester = HarvesterShip(player, player.race.defaultHarvester,
                                      AiPilotHarvester(flagship), 0, 0, 0, 4,
                                      0.0, 0.0, 0.0, 0)
            flagship.shipyards[harvester.stats.img].docked.append(harvester)

        Scenario.spawn(self, game, player, shipId=shipId)

        for i in xrange(0, 3):
            frigate = Frigate(player, player.race.defaults[ids.B_FRIGATE],
                              AiEscortFrigate(player), x + 100, y + 100)
            game.objects.append(frigate)
Exemple #3
0
    def spawn( self, game, player, shipId ):
        player.race = game.stats.PlayableShips[ shipId ].race
        shipStats = game.stats.PlayableShips[ shipId ].stats

        planet = choice( self.planets )
        dist = randint( 10, planet.stats.maxRadius )
        angle = 2*pi*random()
        (x,y) = ( planet.xp+dist*cos(angle), planet.yp+dist*sin(angle) )

        flagship = FlagShip( player, shipStats, AiCaptain( player ),x,y,0, 0, 0.0,0.0,0.0, 0)
        flagship.ore = flagship.stats.maxOre/2
        flagship.energy = flagship.stats.maxEnergy / 2
        flagship.ori = 2*pi*random()
        
        if player.race == game.stats.R_EVOLVED:
            smallTurret = game.stats.T_ESPHERE_0
            mediumTurret = game.stats.T_SUBSPACE_WAVE_0
        elif player.race == game.stats.R_NOMAD:
            smallTurret = game.stats.T_REPEATER_1
            mediumTurret = game.stats.T_NOMAD_CANNON_0
        elif player.race == game.stats.R_AI:
            smallTurret = game.stats.T_AI_FLAK_1
            mediumTurret = game.stats.T_AI_OMNI_LASER_0
        else:
            smallTurret = game.stats.T_MASS_SR_0
            mediumTurret = game.stats.T_MASS_MR_0

        for t in flagship.turrets[:2]:
            t.buildInstall( mediumTurret )
            
        for t in flagship.turrets[-2:]:
            t.buildInstall( smallTurret )
            
        player.flagship = flagship
        
        game.objects.append( flagship )

        for i in range(self.harvestersAtSpawn):
           harvester = HarvesterShip(player, player.race.defaultHarvester, AiPilotHarvester(flagship), 0,0,0, 4, 0.0,0.0,0.0, 0)
           flagship.shipyards[ harvester.stats.img ].docked.append( harvester )

        Scenario.spawn( self, game, player, shipId=shipId )

        for i in xrange( 0, 3 ):
            frigate = Frigate( player, player.race.defaults[ ids.B_FRIGATE ], 
                               AiEscortFrigate( player ), x+100, y+100 )
            game.objects.append( frigate )
Exemple #4
0
    def spawn( self, game, player, shipId=None ):
        Scenario.spawn( self, game, player, shipId )
        
        player.race = game.stats.R_HUMAN
        shipStats = game.stats.HUMAN_SCOUT

        (x,y) = self.startingPoint

        flagship = FlagShip( player, shipStats, AiCaptain( player ),x,y,0, 0, 0.0,0.0,0.0, 0)
        flagship.ore = flagship.stats.maxOre
        flagship.energy = 0
        flagship.ori = 7/8*pi+pi/2

        player.flagship = flagship        
        game.objects.append( flagship )

        player.needToUpdateRelations = True
Exemple #5
0
    def spawn(self, game, player, shipId=None):
        Scenario.spawn(self, game, player, shipId)

        player.race = game.stats.R_HUMAN
        shipStats = game.stats.HUMAN_SCOUT

        (x, y) = self.startingPoint

        flagship = FlagShip(player, shipStats, AiCaptain(player), x, y, 0, 0,
                            0.0, 0.0, 0.0, 0)
        flagship.ore = flagship.stats.maxOre
        flagship.energy = 0
        flagship.ori = 7 / 8 * pi + pi / 2

        player.flagship = flagship
        game.objects.append(flagship)

        player.needToUpdateRelations = True
Exemple #6
0
    def spawn( self, game, player, shipId=None ):
        print "spawning"
        
        player.race = game.stats.R_HUMAN
        shipStats = game.stats.HUMAN_FS_0

        (x,y) = self.startingPoint

        flagship = FlagShip( player, shipStats, AiCaptain( player ),x,y,0, 0, 0.0,0.0,0.0, 0)
        flagship.ore = flagship.stats.maxOre
        flagship.energy = 1000
        flagship.ori = 7/8*pi+pi/2
        
        for turret in flagship.turrets[2:4]:
            turret.buildInstall( game.stats.T_MASS_SR_1 )

        player.flagship = flagship        
        game.objects.append( flagship )

     #   self.player = player
        Scenario.spawn( self, game, player, shipId )
Exemple #7
0
    def spawn(self, game, player, shipId=None):
        print "spawning"

        player.race = game.stats.R_HUMAN
        shipStats = game.stats.HUMAN_FS_0

        (x, y) = self.startingPoint

        flagship = FlagShip(player, shipStats, AiCaptain(player), x, y, 0, 0,
                            0.0, 0.0, 0.0, 0)
        flagship.ore = flagship.stats.maxOre
        flagship.energy = 1000
        flagship.ori = 7 / 8 * pi + pi / 2

        for turret in flagship.turrets[2:4]:
            turret.buildInstall(game.stats.T_MASS_SR_1)

        player.flagship = flagship
        game.objects.append(flagship)

        #   self.player = player
        Scenario.spawn(self, game, player, shipId)
Exemple #8
0
    def spawn( self, game, player, shipId=None ):
        Scenario.spawn( self, game, player, shipId )
        
        player.race = game.stats.R_HUMAN
        shipStats = game.stats.HUMAN_CARGO

        (x,y) = ( self.orbitalbase.xp+50, self.orbitalbase.yp+60 )

        flagship = FlagShip( player, shipStats, AiCaptain( player ),x,y,0, 0, 0.0,0.0,0.0, 0)
        flagship.ore = 0
        flagship.energy = 0
        flagship.ori = 7/8*pi+pi/2

        flagship.turrets[1].buildInstall( game.stats.T_MASS_SR_0 )
        flagship.turrets[0].buildInstall( game.stats.T_MASS_MR_0 )

        player.flagship = flagship        
        game.objects.append( flagship )

        for i in xrange( 3 ):
           harvester = HarvesterShip(player, player.race.defaultHarvester, AiPilotHarvester(flagship), 0,0,0, 4, 0.0,0.0,0.0, 0)
           flagship.shipyards[ harvester.stats.img ].docked.append( harvester )

        player.needToUpdateRelations = True
Exemple #9
0
    def spawn( self, game, player, shipId=None ):
        
        player.race = game.stats.R_HUMAN
        shipStats = game.stats.HUMAN_BASE_MINING

        (x,y) = ( self.earth.xp-320, self.earth.yp+380 )

        flagship = OrbitalBase( player, shipStats, AiGovernor( player ),x,y,0, 0, 0.0,0.0,0.0, 0)
        flagship.ore = 5000
        flagship.energy = 1000
        flagship.ri = -0.01

        flagship.turrets[3].buildInstall( game.stats.T_MASS_MR_0 )
        flagship.turrets[1].buildInstall( game.stats.T_MASS_MR_0 )

        player.flagship = flagship        
        game.objects.append( flagship )

        for i in xrange( 6 ):
           harvester = HarvesterShip(player, player.race.defaultHarvester, AiPilotHarvester(flagship), 0,0,0, 4, 0.0,0.0,0.0, 0)
           flagship.shipyards[ harvester.stats.img ].docked.append( harvester )

        player.needToUpdateRelations = True
        Scenario.spawn( self, game, player, shipId )