Exemplo n.º 1
0
def MakeContraband(which):
    constructor = cargo_mission.cargo_mission
    numsys = vsrandom.randrange(2, 5)
    jumps = universe.getAdjacentSystems(VS.getSystemFile(), numsys)[1]
    diff = vsrandom.randrange(0, 3)
    creds = numsys * 2500 + diff * 800
    args = ('pirates', 0, 6, diff, creds, 1, 1200, 'Contraband', jumps)
    briefing0 = 'We need some...*cough*... cargo delivered to some of our pirates in a nearby system: ' + Jumplist(
        jumps
    ) + ' It\'d be preferable if ye kept the ole po\' off yo back durin the run. Will ya do it for ' + str(
        creds) + ' creds?'
    briefing1 = 'Thanks pal; keep it on the d&l if you know my meanin.'
    vars = {
        'MISSION_TYPE':
        'CONTRABAND',
        'MISSION_SHORTDESC':
        'Deliver contraband to %s for %s' % (Jumplist(jumps), creds)
    }
    try:
        vars['MISSION_ID'] = vars['MISSION_ID']
    except:
        vars['MISSION_ID'] = which
    description = vars['MISSION_SHORTDESC']
    AddNewMission(description, args, constructor, briefing0, briefing1, vars,
                  vars)
    return ("bases/fixers/pirate.spr", "Talk with the Pirate", which)
Exemplo n.º 2
0
 def __init__(self, you, numsystemsaway, jumps=(), preffaction=''):
     self.arrivedsys = 0
     self.jumps = ()
     self.destination = ""
     self.obj = 0
     self.com = 0
     self.you = you
     sys = VS.getSystemFile()
     if len(jumps) > 0:
         sys = jumps[-1]
     (self.destination,
      self.jumps) = universe.getAdjacentSystems(sys, numsystemsaway, jumps,
                                                preffaction)
     for i in self.jumps:
         key = "visited_" + i
         leng = Director.getSaveDataLength(VS.getCurrentPlayer(), key)
         if leng == 0:
             Director.pushSaveData(VS.getCurrentPlayer(), key, float(2))
     if (len(self.jumps) > 0):
         self.obj = VS.addObjective("")
         self.com = (1.0 / float(len(self.jumps)))
         VS.setCompleteness(self.obj, 0)
         if (self.you):
             VS.setOwner(self.obj, self.you)
         self.ChangeObjective(0)
     else:
         self.arrivedsys = 1
Exemplo n.º 3
0
 def __init__ (self,you, numsystemsaway,jumps=(),preffaction=''):
     self.arrivedsys=0
     self.jumps=()
     self.destination=""
     self.obj=0
     self.com=0
     self.you = you
     sys=VS.getSystemFile()
     if len(jumps)>0:
         sys=jumps[-1] 
     (self.destination,self.jumps)=universe.getAdjacentSystems(sys,numsystemsaway,jumps,preffaction)
     for i in self.jumps:
         key = "visited_"+i
         leng=Director.getSaveDataLength(VS.getCurrentPlayer(),key)
         if leng==0:
             Director.pushSaveData(VS.getCurrentPlayer(),key,float(2))
     if (len(self.jumps)>0):
         self.obj=VS.addObjective("")
         self.com=(1.0/float(len(self.jumps)))
         VS.setCompleteness(self.obj,0)
         if (self.you):
             VS.setOwner(self.obj,self.you)
         self.ChangeObjective(0)
     else:
         self.arrivedsys=1
 def teleportPlayer(self,un):
     if (un.DockedOrDocking()):
         print "YOWWW"
     else:
         if (vsrandom.randrange(0,3)==0):
             (adj,test) = universe.getAdjacentSystems(self.sysfile,1)
             un.JumpTo(adj)
         else:
             self.teleportNPC (un)
Exemplo n.º 5
0
 def teleportPlayer(self, un):
     if (un.DockedOrDocking()):
         print("YOWWW")
     else:
         if (vsrandom.randrange(0, 3) == 0):
             (adj, test) = universe.getAdjacentSystems(self.sysfile, 1)
             un.JumpTo(adj)
         else:
             self.teleportNPC(un)
Exemplo n.º 6
0
def MakeContraband(which):
    last_constructor[which] = cargo_mission.cargo_mission
    numsys=vsrandom.randrange(2,5)
    jumps=universe.getAdjacentSystems(VS.getSystemFile(),numsys)[1]
    diff=vsrandom.randrange(0,3)
    creds=numsys*2500+diff*800
    last_args[which] = ('pirates', 0, 6, diff,creds, 1, 1200, 'Contraband',jumps)
    last_briefing[0][which] = 'We need some...*cough*... cargo delivered to some of our pirates in a nearby system: '+ Jumplist(jumps)+ ' It\'d be preferable if ye kept the ole po\' off yo back durin the run. Will ya do it for '+str(creds)+' creds?'
    last_briefing[1][which] = 'Thanks pal; keep it on the d&l if you know my meanin.'
    return ("bases/fixers/pirate.spr","Talk with the Pirate")
Exemplo n.º 7
0
def makeSurplusShortage():
    (sys,mylist)=universe.getAdjacentSystems(VS.getSystemFile(),vsrandom.randrange(1,3))
    adj=vsrandom.uniform (-.5,.5)
    myquest=0
    cats = tuple(set([VS.getRandCargo(1,"").GetCategory(), VS.getRandCargo(1,"").GetCategory()]))
    news=""
    if (adj<0):
        news = "SURPLUS IN %s:  There are reports of surpluses of %s items in the %s system.  Wise Privateers have been purchasing the surpluses in hopes of future gains elsewhere." % (sys," and ".join(cats),sys)
    else:
        news = "DEMAND FOR %s in %s:  Citizens in the %s system have been frusterated by the expensive prices and low quantities of %s goods.  Privateers are currently banding together to try to bring supply to meet the demand.  But while prices are still high, some big traders could certainly capitalize on this shortage." % (" AND ".join(cats),sys,sys," and ".join(cats))
    return (sys,quest_surplus_factory(cats,1+adj,1-adj,1,1),news)
def MakeContraband(which):
	constructor = cargo_mission.cargo_mission
	numsys=vsrandom.randrange(2,5)
	jumps=universe.getAdjacentSystems(VS.getSystemFile(),numsys)[1]
	diff=vsrandom.randrange(0,3)
	creds=numsys*2500+diff*800
	args = ('pirates', 0, 6, diff,creds, 1, 1200, 'Contraband',jumps)
	briefing0 = 'We need some...*cough*... cargo delivered to some of our pirates in a nearby system: '+ Jumplist(jumps)+ ' It\'d be preferable if ye kept the ole po\' off yo back durin the run. Will ya do it for '+str(creds)+' creds?'
	briefing1 = 'Thanks pal; keep it on the d&l if you know my meanin.'
	vars = { 'MISSION_TYPE' : 'CONTRABAND',
			 'MISSION_SHORTDESC' : 'Deliver contraband to %s for %s' % (Jumplist(jumps),creds) }
	AddNewMission(which,args,constructor,briefing0,briefing1,vars,vars)
	return ("bases/fixers/pirate.spr","Talk with the Pirate")
Exemplo n.º 9
0
def makeSurplusShortage():
    (sys, mylist) = universe.getAdjacentSystems(VS.getSystemFile(),
                                                vsrandom.randrange(1, 3))
    adj = vsrandom.uniform(-0.5, 0.5)
    myquest = 0
    cats = (VS.getRandCargo(1, "").GetCategory(),
            VS.getRandCargo(1, "").GetCategory())
    news = ""
    if (adj < 0):
        news = "SURPLUS IN %s:  There are reports of surpluses of %s and %s items in the %s system.  Wise Privateers have been purchasing the surpluses in hopes of future gains elsewhere." % (
            sys, cats[0], cats[1], sys)
    else:
        news = "DEMAND FOR %s AND %s in %s:  Citizens in the %s system have been frusterated by the expensive prices and low quantities of %s and %s goods.  Privateers are currently banding together to try to bring supply to meet the demand.  But while prices are still high, some big traders could certainly capitalize on this shortage." % (
            cats[0], cats[1], sys, sys, cats[0], cats[1])
    return (sys, quest_surplus_factory(cats, 1 + adj, 1 - adj, 1, 1), news)
Exemplo n.º 10
0
def MakeContraband(which):
    last_constructor[which] = cargo_mission.cargo_mission
    numsys = vsrandom.randrange(2, 5)
    jumps = universe.getAdjacentSystems(VS.getSystemFile(), numsys)[1]
    diff = vsrandom.randrange(0, 3)
    creds = numsys * 2500 + diff * 800
    last_args[which] = ('pirates', 0, 6, diff, creds, 1, 1200, 'Contraband',
                        jumps)
    last_briefing[0][
        which] = 'We need some...*cough*... cargo delivered to some of our pirates in a nearby system: ' + Jumplist(
            jumps
        ) + ' It\'d be preferable if ye kept the ole po\' off yo back durin the run. Will ya do it for ' + str(
            creds) + ' creds?'
    last_briefing[1][
        which] = 'Thanks pal; keep it on the d&l if you know my meanin.'
    return ("bases/fixers/pirate.spr", "Talk with the Pirate")