rem stringlengths 1 322k | add stringlengths 0 2.05M | context stringlengths 4 228k | meta stringlengths 156 215 |
|---|---|---|---|
pass | if len(path)<=1: name+=" - In System" Director.pushSaveSting(plr, "mission_names", name) | def writemissionname(name,path): pass | 917e934f83ea781edca1e94264eaa8ce824151a8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2883/917e934f83ea781edca1e94264eaa8ce824151a8/dynamic_mission.py |
pass | Director.pushSaveSting(plr, "mission_descriptions", name) | def writedescription(name): pass | 917e934f83ea781edca1e94264eaa8ce824151a8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2883/917e934f83ea781edca1e94264eaa8ce824151a8/dynamic_mission.py |
pass | Director.pushSaveSting(plr, "mission_scripts", name) def eraseExtras(): import sys len=Director.getSaveStringLength(plr, "mission_scripts") if (len!=Director.getSaveStringLength(plr, "mission_names") or len!=Director.getSaveStringLength(plr, "mission_descriptions")): sys.stdout.write("Warning: Number of mission descs.... | def writemissionsavegame (name): pass | 917e934f83ea781edca1e94264eaa8ce824151a8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2883/917e934f83ea781edca1e94264eaa8ce824151a8/dynamic_mission.py |
if (rnd<.18): | if (rnd<.45): | def contractMissionsFor(fac,minsysaway,maxsysaway): fac=faction_ships.intToFaction(fac) enemies = list(faction_ships.enemies[fac]) script='' cursystem = VS.getSystemFile() thisfaction = VS.GetGalaxyFaction (cursystem) preferredfaction=None if (VS.GetRelation (fac,thisfaction)>0): preferredfaction=thisfaction#try to sta... | 917e934f83ea781edca1e94264eaa8ce824151a8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2883/917e934f83ea781edca1e94264eaa8ce824151a8/dynamic_mission.py |
elif (rnd<.41): | elif (rnd<.9): | def contractMissionsFor(fac,minsysaway,maxsysaway): fac=faction_ships.intToFaction(fac) enemies = list(faction_ships.enemies[fac]) script='' cursystem = VS.getSystemFile() thisfaction = VS.GetGalaxyFaction (cursystem) preferredfaction=None if (VS.GetRelation (fac,thisfaction)>0): preferredfaction=thisfaction#try to sta... | 917e934f83ea781edca1e94264eaa8ce824151a8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2883/917e934f83ea781edca1e94264eaa8ce824151a8/dynamic_mission.py |
elif (fac=='pirates'): | elif (fac=='pirates'): | def contractMissionsFor(fac,minsysaway,maxsysaway): fac=faction_ships.intToFaction(fac) enemies = list(faction_ships.enemies[fac]) script='' cursystem = VS.getSystemFile() thisfaction = VS.GetGalaxyFaction (cursystem) preferredfaction=None if (VS.GetRelation (fac,thisfaction)>0): preferredfaction=thisfaction#try to sta... | 917e934f83ea781edca1e94264eaa8ce824151a8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2883/917e934f83ea781edca1e94264eaa8ce824151a8/dynamic_mission.py |
else: | else: | def contractMissionsFor(fac,minsysaway,maxsysaway): fac=faction_ships.intToFaction(fac) enemies = list(faction_ships.enemies[fac]) script='' cursystem = VS.getSystemFile() thisfaction = VS.GetGalaxyFaction (cursystem) preferredfaction=None if (VS.GetRelation (fac,thisfaction)>0): preferredfaction=thisfaction#try to sta... | 917e934f83ea781edca1e94264eaa8ce824151a8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2883/917e934f83ea781edca1e94264eaa8ce824151a8/dynamic_mission.py |
def Check(): | def Check(self): | def Check(): if (not un): if (VS.systemInMemory (self.starsystem)): RemoveShipFromFG(self.fgname,self.faction,self.type) else: LandShip(self.fgname,self.faction,self.type) return 0 else: sys=un.getUnitSystemFile() if (len(sys)): self.starsystem=sys return 1 | 734bd52d6612e575301714e68f80f3b65387f681 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2883/734bd52d6612e575301714e68f80f3b65387f681/dynamic_universe.py |
,"middle" :{"success": {"good" : [(0.3,"all","Blockade in VAR_system_system System:\\VAR_aggressor_possessive media reports that the blockade which began recently in the VAR_system_system system is still continuing. According to <VAR_aggressor_possessive>'s reporters, their military has sustained only modest losses, w... | ,"middle" :{"success": {"good" : [(0.3,"all","Blockade in VAR_system_system System:\\ VAR_aggressor_possessive media reports that the blockade which began recently in the VAR_system_system system is still continuing. According to <VAR_aggressor_possessive>'s reporters, their military has sustained only modest losses, ... | def allNews(): | b35d196e59d7e40f4bc7237c909bb57f3adc6312 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2883/b35d196e59d7e40f4bc7237c909bb57f3adc6312/dynamic_news_content.py |
,"bad" : [(0.3,"all","Tragedy in VAR_system_system:\\An end to the VAR_aggressor_full's barbaric siege in the VAR_defender_possessive system VAR_system_system in the VAR_system_sector sector occured today. After several weeks of remorseless blockading, no-one was left alive in any critical part of the VAR_defender_po... | ,"bad" : [(0.3,"all","Tragedy in VAR_system_system:\\An end to the VAR_aggressor_full's barbaric siege in the VAR_defender_possessive system VAR_system_system in the VAR_system_sector sector occured today. After several weeks of remorseless blockading, no-one was left alive in any critical part of the VAR_defender_po... | def allNews(): | b35d196e59d7e40f4bc7237c909bb57f3adc6312 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2883/b35d196e59d7e40f4bc7237c909bb57f3adc6312/dynamic_news_content.py |
,"bad" : [(0.8,"all","VAR_aggressor_possessive Withdrawal from VAR_system_system:\\VAR_aggressor_possessive forces have lost the battle of wills in the VAR_system_system system today. After weeks of blockade action, VAR_aggressor_nicks forces have conceded that they are unable to stop VAR_defender_possessive forces f... | ,"bad" : [(0.8,"all","VAR_aggressor_possessive Withdrawal from VAR_system_system:\\ VAR_aggressor_possessive forces have lost the battle of wills in the VAR_system_system system today. After weeks of blockade action, VAR_aggressor_nicks forces have conceded that they are unable to stop VAR_defender_possessive forces ... | def allNews(): | b35d196e59d7e40f4bc7237c909bb57f3adc6312 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2883/b35d196e59d7e40f4bc7237c909bb57f3adc6312/dynamic_news_content.py |
,"neutral" : [(0.8,"all","Attempted VAR_aggressor_nicks attack backfires\\The VAR_aggressor_nicks VAR_aggressor_FG squadron engaged VAR_defender_nicks forces today. Utterly without a plan, their attack backfired as the VAR_defender_FG squad of VAR_defender_FGtype ships looped around and closed for the kill. What is s... | ,"neutral" : [(0.8,"all","Attempted VAR_aggressor_nicks attack backfires\\The VAR_aggressor_nicks VAR_aggressor_FG squadron engaged VAR_defender_nicks forces today. Utterly without a plan, their attack backfired as the VAR_defender_FG squad of VAR_defender_FGtype ships looped around and closed for the kill. What is s... | def allNews(): | b35d196e59d7e40f4bc7237c909bb57f3adc6312 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2883/b35d196e59d7e40f4bc7237c909bb57f3adc6312/dynamic_news_content.py |
,"bad" : [(0.3,"all","VAR_defender_possessive VAR_defender_FGtype Defence Force Fired Upon!\\VAR_aggressor_FGtype’s fired upon VAR_defender_FGtype ships in an unprovoked attack only hours ago! Casualties are currently unknown, but VAR_defender_possessive reinforcements are being rushed to the battle site even now.\\Th... | ,"bad" : [(0.3,"all","VAR_defender_possessive VAR_defender_FGtype Defence Force Fired Upon!\\ VAR_aggressor_FGtype’s fired upon VAR_defender_FGtype ships in an unprovoked attack only hours ago! Casualties are currently unknown, but VAR_defender_possessive reinforcements are being rushed to the battle site even now.\\T... | def allNews(): | b35d196e59d7e40f4bc7237c909bb57f3adc6312 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2883/b35d196e59d7e40f4bc7237c909bb57f3adc6312/dynamic_news_content.py |
,"bad" : [(0.8,"all","VAR_aggressor_nickp and VAR_defender_nickp eradicate each other in VAR_system_system\\In a sudden strike by the VAR_aggressor_nick VAR_aggressor_FG fleet, a well planned strategic missile assault went astray and both sides ended up fighting in a close, brutal beam battle. No starships were left i... | ,"bad" : [(0.8,"all","VAR_aggressor_nickp and VAR_defender_nickp eradicate each other in VAR_system_system\\In a sudden strike by the VAR_aggressor_nicks VAR_aggressor_FG fleet, a well planned strategic missile assault went astray and both sides ended up fighting in a close, brutal beam battle. No starships were left ... | def allNews(): | b35d196e59d7e40f4bc7237c909bb57f3adc6312 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2883/b35d196e59d7e40f4bc7237c909bb57f3adc6312/dynamic_news_content.py |
VS.IOmessage (4,"game","all"," | VS.IOmessage (4,"cargo mission",self.mplay," | def __init__ (self,factionname, numsystemsaway, cargoquantity, missiondifficulty, creds, launchoncapship, time_to_complete, category): Director.Mission.__init__(self); self.you=VS.Unit() self.base=VS.Unit() self.arrived=0 self.mplay="all" | 27088c10d8d97bf97a2c522e7574ac0bee71e6ca /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2883/27088c10d8d97bf97a2c522e7574ac0bee71e6ca/cargo_mission.py |
intseed = ( intseed * 1103515245 + 12345) intseed = intseed %RAND_MAX | intseed = long( long(intseed) * long(1103515245) + long(12345)) intseed = long(intseed) %long(RAND_MAX) | def rands(intseed): global RAND_MAX intseed = ( intseed * 1103515245 + 12345) intseed = intseed %RAND_MAX try: intseed=int(intseed) except: return intseed return intseed | d70dbd303018f864a848d99771956c21aef11f83 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2883/d70dbd303018f864a848d99771956c21aef11f83/seedrandom.py |
for i in range (Director.getSaveStringLength (ccp,key)): | len=Director.getSaveStringLength (ccp,key) i=0 while i<len: | def PurgeZeroShips (faction): key=MakeFactionKey(faction) for i in range (Director.getSaveStringLength (ccp,key)): curfg=Director.getSaveString(ccp,key,i) CheckFG (curfg,faction) numships=NumShipsInFG(curfg,faction) if (numships==0): DeleteFG(curfg,faction) | f592e3a26bee09b3b492ef480222d8bd32fe0064 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2883/f592e3a26bee09b3b492ef480222d8bd32fe0064/fg_util.py |
self.diff+=[newdiff] | print "done director" self.diff+=[newdiff] print "set diff start" | def __init__(self,credsMax): print "init diff" self.diff=[] self.creds=[] self.credsToMax=credsMax un=VS.getPlayerX(0) self.i=0 while (un): newdiff=0 if (Director.getSaveDataLength(self.i,_key)): newdiff=Director.getSaveData(self.i,_key,0) else: newdiff=VS.GetDifficulty() Director.pushSaveData(self.i,_key,newdiff) self... | 992aa10b78d0b5cf73dc2411b03462e76f0c213f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2883/992aa10b78d0b5cf73dc2411b03462e76f0c213f/difficulty.py |
persystemattacklist {} | def __init__(self,fgname,faction): self.fg=fgname self.fac=fact | 3a6594c8e5d0df4338b2735b23817abc9bdb720a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2883/3a6594c8e5d0df4338b2735b23817abc9bdb720a/dynamic_battle.py | |
global persystemattacklist global attacklist persystemattacklist = {} | def SimulateBattles(): deadbattles=[] for ally in attacklist: enemy = attacklist[ally] if (not attackFlightgroup (ally.fg,ally.fac,enemy.fg,enemy.fac)): deadbattles+=[ally] for i in deadbattles: stopAttack(i) | 3a6594c8e5d0df4338b2735b23817abc9bdb720a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2883/3a6594c8e5d0df4338b2735b23817abc9bdb720a/dynamic_battle.py | |
def BattlesInSystem(): if sys in persystemattacklist: return persystemattacklist[sys] return [] | def SimulateBattles(): deadbattles=[] for ally in attacklist: enemy = attacklist[ally] if (not attackFlightgroup (ally.fg,ally.fac,enemy.fg,enemy.fac)): deadbattles+=[ally] for i in deadbattles: stopAttack(i) | 3a6594c8e5d0df4338b2735b23817abc9bdb720a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2883/3a6594c8e5d0df4338b2735b23817abc9bdb720a/dynamic_battle.py | |
Director.Mission.__init__ () | Director.Mission.__init__ (self) | def __init__ (self,minnumsystemsaway, maxnumsystemsaway, creds, run_away, shipdifficulty, tempfaction): Director.Mission.__init__ () self.newship="" self.mplay="all" self.istarget=0 self.obj=0 self.curiter=0 self.arrived=0 self.faction = tempfaction self.difficulty = shipdifficulty self.runaway=run_away self.cred=creds... | a537f39c17600bf6b993994cfcfafc164c3f274f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2883/a537f39c17600bf6b993994cfcfafc164c3f274f/bounty.py |
if (you): VS.IOmessage (0,"bounty mission",self.mplay,"Good Day, %s. Your mission is as follows:" % (you.getName())) | if (self.you): VS.IOmessage (0,"bounty mission",self.mplay,"Good Day, %s. Your mission is as follows:" % (self.you.getName())) | def __init__ (self,minnumsystemsaway, maxnumsystemsaway, creds, run_away, shipdifficulty, tempfaction): Director.Mission.__init__ () self.newship="" self.mplay="all" self.istarget=0 self.obj=0 self.curiter=0 self.arrived=0 self.faction = tempfaction self.difficulty = shipdifficulty self.runaway=run_away self.cred=creds... | a537f39c17600bf6b993994cfcfafc164c3f274f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2883/a537f39c17600bf6b993994cfcfafc164c3f274f/bounty.py |
VS.IOmessage (2,"bounty mission",self.mplay,"Once there, you must destroy a %s unit." % (faction)) | VS.IOmessage (2,"bounty mission",self.mplay,"Once there, you must destroy a %s unit." % (self.faction)) | def __init__ (self,minnumsystemsaway, maxnumsystemsaway, creds, run_away, shipdifficulty, tempfaction): Director.Mission.__init__ () self.newship="" self.mplay="all" self.istarget=0 self.obj=0 self.curiter=0 self.arrived=0 self.faction = tempfaction self.difficulty = shipdifficulty self.runaway=run_away self.cred=creds... | a537f39c17600bf6b993994cfcfafc164c3f274f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2883/a537f39c17600bf6b993994cfcfafc164c3f274f/bounty.py |
def loop (self): | def Execute (self): | def loop (self): isSig=0 if (self.you.isNull()): self.Lose (1) return if (self.arrived==3): if (not self.istarget): curun=VS.getUnit(self.curiter) if (self.enemy): if (curun==self.enemy): self.enemy.setTarget(self.you) self.curiter+=1 if (you.isNull()): self.Lose(1) return if (self.enemy.isNull()): self.Win(you,1) retu... | a537f39c17600bf6b993994cfcfafc164c3f274f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2883/a537f39c17600bf6b993994cfcfafc164c3f274f/bounty.py |
if (you.isNull()): self.Lose(1) return | def loop (self): isSig=0 if (self.you.isNull()): self.Lose (1) return if (self.arrived==3): if (not self.istarget): curun=VS.getUnit(self.curiter) if (self.enemy): if (curun==self.enemy): self.enemy.setTarget(self.you) self.curiter+=1 if (you.isNull()): self.Lose(1) return if (self.enemy.isNull()): self.Win(you,1) retu... | a537f39c17600bf6b993994cfcfafc164c3f274f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2883/a537f39c17600bf6b993994cfcfafc164c3f274f/bounty.py | |
self.Win(you,1) | self.Win(self.you,1) | def loop (self): isSig=0 if (self.you.isNull()): self.Lose (1) return if (self.arrived==3): if (not self.istarget): curun=VS.getUnit(self.curiter) if (self.enemy): if (curun==self.enemy): self.enemy.setTarget(self.you) self.curiter+=1 if (you.isNull()): self.Lose(1) return if (self.enemy.isNull()): self.Win(you,1) retu... | a537f39c17600bf6b993994cfcfafc164c3f274f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2883/a537f39c17600bf6b993994cfcfafc164c3f274f/bounty.py |
Lose(1) | self.Lose(1) | def loop (self): isSig=0 if (self.you.isNull()): self.Lose (1) return if (self.arrived==3): if (not self.istarget): curun=VS.getUnit(self.curiter) if (self.enemy): if (curun==self.enemy): self.enemy.setTarget(self.you) self.curiter+=1 if (you.isNull()): self.Lose(1) return if (self.enemy.isNull()): self.Win(you,1) retu... | a537f39c17600bf6b993994cfcfafc164c3f274f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2883/a537f39c17600bf6b993994cfcfafc164c3f274f/bounty.py |
Win(you,1) | self.Win(self.you,1) | def loop (self): isSig=0 if (self.you.isNull()): self.Lose (1) return if (self.arrived==3): if (not self.istarget): curun=VS.getUnit(self.curiter) if (self.enemy): if (curun==self.enemy): self.enemy.setTarget(self.you) self.curiter+=1 if (you.isNull()): self.Lose(1) return if (self.enemy.isNull()): self.Win(you,1) retu... | a537f39c17600bf6b993994cfcfafc164c3f274f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2883/a537f39c17600bf6b993994cfcfafc164c3f274f/bounty.py |
if (you.getSignificantDistance(significant)<10000.0): | if (self.you.getSignificantDistance(significant)<10000.0): | def loop (self): isSig=0 if (self.you.isNull()): self.Lose (1) return if (self.arrived==3): if (not self.istarget): curun=VS.getUnit(self.curiter) if (self.enemy): if (curun==self.enemy): self.enemy.setTarget(self.you) self.curiter+=1 if (you.isNull()): self.Lose(1) return if (self.enemy.isNull()): self.Win(you,1) retu... | a537f39c17600bf6b993994cfcfafc164c3f274f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2883/a537f39c17600bf6b993994cfcfafc164c3f274f/bounty.py |
if (runaway): self.enemy.setTarget(significant) | if (self.runaway): self.enemy.SetTarget(significant) | def loop (self): isSig=0 if (self.you.isNull()): self.Lose (1) return if (self.arrived==3): if (not self.istarget): curun=VS.getUnit(self.curiter) if (self.enemy): if (curun==self.enemy): self.enemy.setTarget(self.you) self.curiter+=1 if (you.isNull()): self.Lose(1) return if (self.enemy.isNull()): self.Win(you,1) retu... | a537f39c17600bf6b993994cfcfafc164c3f274f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2883/a537f39c17600bf6b993994cfcfafc164c3f274f/bounty.py |
self.newship=faction_ships.getRandomFighter(faction) | self.newship=faction_ships.getRandomFighter(self.faction) | def loop (self): isSig=0 if (self.you.isNull()): self.Lose (1) return if (self.arrived==3): if (not self.istarget): curun=VS.getUnit(self.curiter) if (self.enemy): if (curun==self.enemy): self.enemy.setTarget(self.you) self.curiter+=1 if (you.isNull()): self.Lose(1) return if (self.enemy.isNull()): self.Win(you,1) retu... | a537f39c17600bf6b993994cfcfafc164c3f274f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2883/a537f39c17600bf6b993994cfcfafc164c3f274f/bounty.py |
if (runaway): | if (self.runaway): | def loop (self): isSig=0 if (self.you.isNull()): self.Lose (1) return if (self.arrived==3): if (not self.istarget): curun=VS.getUnit(self.curiter) if (self.enemy): if (curun==self.enemy): self.enemy.setTarget(self.you) self.curiter+=1 if (you.isNull()): self.Lose(1) return if (self.enemy.isNull()): self.Win(you,1) retu... | a537f39c17600bf6b993994cfcfafc164c3f274f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2883/a537f39c17600bf6b993994cfcfafc164c3f274f/bounty.py |
self.escortee = launch.launch_wave_around_unit("Escort", | global escort_num escort_num+=1 self.escortee = launch.launch_wave_around_unit("Escort"+str(escort_num), | def __init__ (self,factionname, missiondifficulty, our_dist_from_jump, dist_from_jump, distance_from_base, creds, enemy_time, numsysaway,jumps=(),var_to_set=''): Director.Mission.__init__(self); self.you = VS.getPlayer(); self.adjsys=go_to_adjacent_systems(self.you, numsysaway,jumps) self.var_to_set = var_to_set; print... | 7d3366aeebc5e0690eef9c2b325f7519959a5f85 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2883/7d3366aeebc5e0690eef9c2b325f7519959a5f85/escort_mission.py |
self.you.setFlightgroupLeader(self.you) | self.escortee.setFlightgroupLeader(self.you) | def Execute (self): self.escortee.setFgDirective('F') if self.you.isNull(): VS.IOmessage (0,"escort",self.mplay,"#ff0000You were to protect your escort. Mission failed.") VS.terminateMission(0) return self.you.setFlightgroupLeader(self.you) if (self.escortee.isNull()): VS.IOmessage (0,"escort",self.mplay,"#ff0000You we... | 7d3366aeebc5e0690eef9c2b325f7519959a5f85 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2883/7d3366aeebc5e0690eef9c2b325f7519959a5f85/escort_mission.py |
,"draw" : {"good" : [(0.8,"all","draw is good") ,(0.8, ] | ,"draw" : {"good" : [(0.8,"all","draw is good")] | def allNews(): | 5428a79f0bc58836ede099a1b96ab36ee1a2b42b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2883/5428a79f0bc58836ede099a1b96ab36ee1a2b42b/dynamic_news_content.py |
if len(shipext)>0: | if len(shipext)>1: | def formatShipName(string): """formats a standard ship name (ie firefly.blank) to something more natural (ie basic Firefly)""" shipext = string.split('.') extension = "millspec"; if len(shipext)>0: extension = shipext[1]; ship = shipext[0]; if extension == "blank": return "basic" + formatProperTitle(ship) elif extensio... | 11fee6f7a54d367b5e2a9b24850985789e17453c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2883/11fee6f7a54d367b5e2a9b24850985789e17453c/dynamic_news.py |
return pickle.dumps(self.pickil) | return pickle.dumps(self.diffcls) | def Pickle (self): return pickle.dumps(self.pickil) | a40388a69e71e478dcf35e5adea0a42e2dbb404a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2883/a40388a69e71e478dcf35e5adea0a42e2dbb404a/difficulty.py |
def UnPickle (self): return pickle.loads(self.pickil) | def UnPickle (self,fil): self.diffcls=pickle.loads(fil) VS.SetDifficulty(self.diffcls.diff) | def UnPickle (self): return pickle.loads(self.pickil) | a40388a69e71e478dcf35e5adea0a42e2dbb404a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2883/a40388a69e71e478dcf35e5adea0a42e2dbb404a/difficulty.py |
ret=0.0 if (playa): temp = VS.getSaveData (playa,"31337ness") if (len(temp)>0): ret = temp[0] return ret | return self.diffcls.diff | def getPlayerDifficulty (self,playa): ret=0.0 if (playa): temp = VS.getSaveData (playa,"31337ness") #??? if (len(temp)>0): | a40388a69e71e478dcf35e5adea0a42e2dbb404a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2883/a40388a69e71e478dcf35e5adea0a42e2dbb404a/difficulty.py |
player = _unit.getPlayerX(playeriterator) | player = VS.getPlayerX(playeriterator) | def Execute (self): player = _unit.getPlayerX(playeriterator) if (player): oldcreds = creds[playeriterator] newcreds = _unit.getCredits (player) if (newcreds!=oldcreds): | a40388a69e71e478dcf35e5adea0a42e2dbb404a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2883/a40388a69e71e478dcf35e5adea0a42e2dbb404a/difficulty.py |
newcreds = _unit.getCredits (player) | newcreds = player.getCredits () | def Execute (self): player = _unit.getPlayerX(playeriterator) if (player): oldcreds = creds[playeriterator] newcreds = _unit.getCredits (player) if (newcreds!=oldcreds): | a40388a69e71e478dcf35e5adea0a42e2dbb404a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2883/a40388a69e71e478dcf35e5adea0a42e2dbb404a/difficulty.py |
save = VS.getSaveData (player,"31337ness") if (len(save)>0): difficulty = save[0] else: difficulty = VS.GetDifficulty() difficulty+=((newcreds-oldcreds)/credsToMax) if (difficulty>0.99999): difficulty=0.99999 SetDiff(difficulty) | difficulty=self.diffcls.diff difficulty+=((newcreds-oldcreds)/credsToMax)/len(creds) if (difficulty>0.999999): difficulty=0.999999 | def Execute (self): player = _unit.getPlayerX(playeriterator) if (player): oldcreds = creds[playeriterator] newcreds = _unit.getCredits (player) if (newcreds!=oldcreds): | a40388a69e71e478dcf35e5adea0a42e2dbb404a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2883/a40388a69e71e478dcf35e5adea0a42e2dbb404a/difficulty.py |
return string.join(ls,',') | return string.join([str(vsrandom.randrange(0,4194304))]+ls,',') | def makeVarList(ls): """formats a list of variables to be stored in a save game for later reference""" return string.join(ls,',') | 3d999b687e07fad9dd6af794f9c23adad2fe9b2a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2883/3d999b687e07fad9dd6af794f9c23adad2fe9b2a/dynamic_news.py |
return getClosestScaleNews([(scale,"all","ERROR!\\Invalid news variables:\\(" + makeVarList([faction_base,type_event,stage_event,success,pov,str(scale),keyword]) + ")\\A suitable news story for this event could not be found.\\This is a placeholder error message.\\\\Contact the help-desk for any queries:\\dandandaman@us... | return getClosestScaleNews([(scale,"all","ERROR!\\Invalid news variables:\\(" + string.join([faction_base,type_event,stage_event,success,pov,str(scale),keyword],',') + ")\\A suitable news story for this event could not be found.\\This is a placeholder error message.\\\\Contact the help-desk for any queries:\\dandandama... | def getNewsItem(faction_base,type_event,stage_event,success,pov,scale,keyword,randint): """finds a suitable news string from the dynamic_news_content.allNews() dictionary""" faction = validateNewsItem(faction_base,type_event,stage_event,success,pov,keyword) if faction == "barf": print "Error: A suitable news story does... | 3d999b687e07fad9dd6af794f9c23adad2fe9b2a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2883/3d999b687e07fad9dd6af794f9c23adad2fe9b2a/dynamic_news.py |
return finallist[randint][2] | return finallist[randint%len(finallist)][2] | def getClosestScaleNews(listof,scale,randint): """returns the closest scaled news item from a list of news items""" valtable = [] for i in range (len(listof)): valtable.append(listof[i] + (abs(scale - listof[i][0]),)) finallist = [valtable[0]] for i in range (1,len(valtable)): if finallist[0][3] > valtable[i][3]: final... | 3d999b687e07fad9dd6af794f9c23adad2fe9b2a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2883/3d999b687e07fad9dd6af794f9c23adad2fe9b2a/dynamic_news.py |
def checkVarListRelevant(newslist): | def checkVarListRelevant(newslist,randint): | def checkVarListRelevant(newslist): """returns true only if the newslist is relevant (major or close to home)""" if (not (newslist[0] in minorNewsTypes())): return 1 if (newslist[0] in minorNewsTypes()) and (checkSystemRelevant(newslist[6])): return 1 | 3d999b687e07fad9dd6af794f9c23adad2fe9b2a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2883/3d999b687e07fad9dd6af794f9c23adad2fe9b2a/dynamic_news.py |
Base.Message ("You conspirator! I should have realized you were a kepitalizt pig when I first smelled our foul stench! You probably got paid to destroy our vessel. If I shared in your lack of honor I would kill you where you stand. But instead I shall ask my operatives to rid you of your ship. The next time any of us ... | Base.Message ("You conspirator! I should have realized you were a kepitalizt pig when I first smelled your foul stench! You probably got paid to destroy our vessel. If I shared in your lack of honor I would kill you where you stand. But instead I shall ask my operatives to rid you of your ship. The next time any of us... | def AssignMission (): fixers.DestroyActiveButtons () fixers.CreateChoiceButtons(Base.GetCurRoom(),[ fixers.Choice("bases/fixers/yes.spr","bases/fixers/iso_mission.py","Accept This Agreement"), fixers.Choice("bases/fixers/no.spr","bases/fixers/iso_decline.py","Decline This Agreement")]) | 4e891e1fc3cd297c96a4f9cd6e7bcdb37ce89759 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2883/4e891e1fc3cd297c96a4f9cd6e7bcdb37ce89759/iso.py |
diff=[] creds=[] credsToMax=1 i=0 | def SetDiff(diff): if (diff>VS.GetDifficulty()): VS.SetDifficulty(diff) | 474c553c0a5917564266c3a49d8cae7a28f5c3db /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2883/474c553c0a5917564266c3a49d8cae7a28f5c3db/difficulty.py | |
self.diff+=[newdiff] | def __init__(self,credsMax): self.credsToMax=credsMax un=VS.getPlayerX(0) self.i=0 while (un): newdiff=0 if (Director.getSaveDataLength(self.i,_key)): newdiff=Director.getSaveData(self.i,_key,0) self.diff+=[newdiff] else: newdiff=VS.GetDifficulty() self.diff+=[newdiff] Director.pushSaveData(self.i,_key,newdiff) SetDiff... | 474c553c0a5917564266c3a49d8cae7a28f5c3db /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2883/474c553c0a5917564266c3a49d8cae7a28f5c3db/difficulty.py | |
self.diff+=[newdiff] | def __init__(self,credsMax): self.credsToMax=credsMax un=VS.getPlayerX(0) self.i=0 while (un): newdiff=0 if (Director.getSaveDataLength(self.i,_key)): newdiff=Director.getSaveData(self.i,_key,0) self.diff+=[newdiff] else: newdiff=VS.GetDifficulty() self.diff+=[newdiff] Director.pushSaveData(self.i,_key,newdiff) SetDiff... | 474c553c0a5917564266c3a49d8cae7a28f5c3db /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2883/474c553c0a5917564266c3a49d8cae7a28f5c3db/difficulty.py | |
if (len(self.creds)<=0): if (self.i!=-1): self.i=-1 raise IndexError("Empty creds and diff arrays in difficulty module\nUnable to find any players...") return if (self.i>=len(self.creds)): self.i=0 | if (self.i>=len(self.creds)): self.i=0 else: | def Execute(self): | 474c553c0a5917564266c3a49d8cae7a28f5c3db /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2883/474c553c0a5917564266c3a49d8cae7a28f5c3db/difficulty.py |
newcreds=un.getCredits() if (self.creds[self.i]!=newcreds): if (self.creds[self.i]>newcreds): newdiff=((newcreds-self.creds[self.i])/self.credsToMax) Director.putSaveData(self.i,_key,0,newdiff) SetDiff(newdiff) self.creds[self.i]=newcreds self.i+=1 | if (un): newcreds=un.getCredits() if (self.creds[self.i]!=newcreds): if (self.creds[self.i]<newcreds): newdiff=self.getPlayerDifficulty(i)+((newcreds-self.creds[self.i])/self.credsToMax) if (newdiff>.999): newdiff=.999 Director.putSaveData(self.i,_key,0,newdiff) SetDiff(newdiff) self.creds[self.i]=newcreds self.i+=1 | def Execute(self): | 474c553c0a5917564266c3a49d8cae7a28f5c3db /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2883/474c553c0a5917564266c3a49d8cae7a28f5c3db/difficulty.py |
,"bad" : [(0.3,"all","VAR_defender_possessive VAR_defender_FGtype Defence Force Fired Upon!\\ VAR_aggressor_FGtype’s fired upon VAR_defender_FGtype ships in an unprovoked attack only hours ago! Casualties are currently unknown, but VAR_defender_possessive reinforcements are being rushed to the battle site even now.\\T... | ,"bad" : [(0.3,"all","VAR_defender_possessive VAR_defender_FGtype Defence Force Fired Upon!\\ VAR_aggressor_FGtype’s fired upon VAR_defender_FGtype cruisers in an unprovoked attack only hours ago! Casualties are currently unknown, but VAR_defender_possessive reinforcements are being rushed to the battle site even now.... | def allNews(): | 916c1cc86796b931aac65a915015310f7bd77a7e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2883/916c1cc86796b931aac65a915015310f7bd77a7e/dynamic_news_content.py |
return 'FG:'+str(VS.GetFactionIndex(faction)) | return 'FF:'+str(VS.GetFactionIndex(faction)) | def MakeFactionKey (faction): return 'FG:'+str(VS.GetFactionIndex(faction)) | d980c04c99a3b53d40a9df904239d6c2956d09ec /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2883/d980c04c99a3b53d40a9df904239d6c2956d09ec/fg_util.py |
return 'FG:'+str(starsystem) | return 'SS:'+str(starsystem) | def MakeStarSystemFGKey (starsystem): return 'FG:'+str(starsystem) | d980c04c99a3b53d40a9df904239d6c2956d09ec /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2883/d980c04c99a3b53d40a9df904239d6c2956d09ec/fg_util.py |
for i in range (len(tup)-1): | for i in range (1,len(tup)): | def ListToPipe (tup): fina='' if (len(tup)): fina=tup[0] for i in range (len(tup)-1): fina+='|'+tup[i] return fina | d980c04c99a3b53d40a9df904239d6c2956d09ec /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2883/d980c04c99a3b53d40a9df904239d6c2956d09ec/fg_util.py |
curun=VS.getUnit(curiter) if (enemy): | curun=VS.getUnit(self.curiter) if (not enemy.isNull()): | def loop (self): isSig=0 enemy=VS.Unit() if (self.you.isNull()): self.Lose (1) return if (self.arrived==3): enemy=self.enemy if (not self.istarget): curun=VS.getUnit(curiter) if (enemy): if (curun==enemy): enemy.setTarget(you) curiter+=1 if (you.isNull()): Lose(1) return if (enemy.isNull()): Win(you,1) return elif (sel... | afda00481ea93a9bb68ab6dd0605e7e59bf5d039 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2883/afda00481ea93a9bb68ab6dd0605e7e59bf5d039/bounty.py |
curiter+=1 | self.curiter+=1 | def loop (self): isSig=0 enemy=VS.Unit() if (self.you.isNull()): self.Lose (1) return if (self.arrived==3): enemy=self.enemy if (not self.istarget): curun=VS.getUnit(curiter) if (enemy): if (curun==enemy): enemy.setTarget(you) curiter+=1 if (you.isNull()): Lose(1) return if (enemy.isNull()): Win(you,1) return elif (sel... | afda00481ea93a9bb68ab6dd0605e7e59bf5d039 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2883/afda00481ea93a9bb68ab6dd0605e7e59bf5d039/bounty.py |
Lose(1) | self.Lose(1) | def loop (self): isSig=0 enemy=VS.Unit() if (self.you.isNull()): self.Lose (1) return if (self.arrived==3): enemy=self.enemy if (not self.istarget): curun=VS.getUnit(curiter) if (enemy): if (curun==enemy): enemy.setTarget(you) curiter+=1 if (you.isNull()): Lose(1) return if (enemy.isNull()): Win(you,1) return elif (sel... | afda00481ea93a9bb68ab6dd0605e7e59bf5d039 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2883/afda00481ea93a9bb68ab6dd0605e7e59bf5d039/bounty.py |
Win(you,1) | self.Win(you,1) | def loop (self): isSig=0 enemy=VS.Unit() if (self.you.isNull()): self.Lose (1) return if (self.arrived==3): enemy=self.enemy if (not self.istarget): curun=VS.getUnit(curiter) if (enemy): if (curun==enemy): enemy.setTarget(you) curiter+=1 if (you.isNull()): Lose(1) return if (enemy.isNull()): Win(you,1) return elif (sel... | afda00481ea93a9bb68ab6dd0605e7e59bf5d039 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2883/afda00481ea93a9bb68ab6dd0605e7e59bf5d039/bounty.py |
if (VS.getSystemFile()==destination): | if (VS.getSystemFile()==self.adjsys.DestinationSystem()): | def loop (self): isSig=0 enemy=VS.Unit() if (self.you.isNull()): self.Lose (1) return if (self.arrived==3): enemy=self.enemy if (not self.istarget): curun=VS.getUnit(curiter) if (enemy): if (curun==enemy): enemy.setTarget(you) curiter+=1 if (you.isNull()): Lose(1) return if (enemy.isNull()): Win(you,1) return elif (sel... | afda00481ea93a9bb68ab6dd0605e7e59bf5d039 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2883/afda00481ea93a9bb68ab6dd0605e7e59bf5d039/bounty.py |
intseed = ( intseed * 1103515245 + 12345); intseed %= RAND_MAX; return intseed; | intseed = ( intseed * 1103515245 + 12345) intseed = intseed %RAND_MAX try: intseed=int(intseed) except: return intseed return intseed | def rands(intseed): global RAND_MAX intseed = ( intseed * 1103515245 + 12345); intseed %= RAND_MAX; return intseed; | 682cb8f30dda7e4f5f3a7af9f290f4312dbc1e37 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2883/682cb8f30dda7e4f5f3a7af9f290f4312dbc1e37/seedrandom.py |
def contractMissionsFor(fac,minsysaway,maxsysaway): fac=faction_ships.intToFaction(fac) enemies = list(faction_ships.enemies[fac]) script='' while len(enemies): index=vsrandom.randrange(0,len(enemies)) script=contractMissionForTo(fac,enemies[index],minsysaway,maxsysaway) if (script): return script del enemies[index] re... | def contractMissionsFor(fac,minsysaway,maxsysaway): fac=faction_ships.intToFaction(fac) enemies = list(faction_ships.enemies[fac]) script='' while len(enemies): index=vsrandom.randrange(0,len(enemies)) script=contractMissionForTo(fac,enemies[index],minsysaway,maxsysaway) if (script): return script del enemies[index] re... | 903540045d6a5f19ccaa9039534586890266c181 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2883/903540045d6a5f19ccaa9039534586890266c181/dynamic_mission.py | |
generateEscortMission l = universe.getAdjacentSystemList(i) | l = universe.getAdjacentSystemList(i) | def getSystemsKAwayNoFaction( start, k ): set = [start]#set of systems that have been visited pathset = [[start]]#parallel data structure to set, but with paths pathtor = [[start]]#parallel data structure to raw return systems with path r = [start] #raw data structure containing systems n away where n<=k for n in range... | 903540045d6a5f19ccaa9039534586890266c181 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2883/903540045d6a5f19ccaa9039534586890266c181/dynamic_mission.py |
def generateEscortMission (path): | def generateEscortMission (path,fg,fac): | def generateEscortMission (path): ### | 903540045d6a5f19ccaa9039534586890266c181 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2883/903540045d6a5f19ccaa9039534586890266c181/dynamic_mission.py |
def generateBountyMission (path): | def generateBountyMission (path,fg,fac): | def generateBountyMission (path): ### | 903540045d6a5f19ccaa9039534586890266c181 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2883/903540045d6a5f19ccaa9039534586890266c181/dynamic_mission.py |
def generateDefendMission (path): | def generateDefendMission (path,defendfg,defendfac, attackfg,attackfac): | def generateDefendMission (path): ### | 903540045d6a5f19ccaa9039534586890266c181 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2883/903540045d6a5f19ccaa9039534586890266c181/dynamic_mission.py |
def contractMissionForTo (fac,enemy,minsysaway,maxsysaway): """Creates a mission for faction `fac' and against `enemy'""" | def contractMissionsFor(fac,minsysaway,maxsysaway): fac=faction_ships.intToFaction(fac) enemies = list(faction_ships.enemies[fac]) | def contractMissionForTo (fac,enemy,minsysaway,maxsysaway): """Creates a mission for faction `fac' and against `enemy'""" script='' cursystem = VS.getSystemFile() thisfaction = VS.GetGalaxyFaction (cursystem) preferredfaction=None if (VS.GetRelation (fac,thisfaction)>0): preferredfaction=fac#try to stay in this territo... | 903540045d6a5f19ccaa9039534586890266c181 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2883/903540045d6a5f19ccaa9039534586890266c181/dynamic_mission.py |
preferredfaction=fac | preferredfaction=thisfaction | def contractMissionForTo (fac,enemy,minsysaway,maxsysaway): """Creates a mission for faction `fac' and against `enemy'""" script='' cursystem = VS.getSystemFile() thisfaction = VS.GetGalaxyFaction (cursystem) preferredfaction=None if (VS.GetRelation (fac,thisfaction)>0): preferredfaction=fac#try to stay in this territo... | 903540045d6a5f19ccaa9039534586890266c181 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2883/903540045d6a5f19ccaa9039534586890266c181/dynamic_mission.py |
l.append(getSystemsNAway(cursystem,i,preferredfaction)): maxmissions=vsrandom.randrange(1,30) for cur in range(0,maxmissions): rnd=vsrandom.random() if (rnd<.5): dist=0 path=[] else: dist=vsrandom.randrange(maxsysaway+1-minsysaway) path=l[dist][len(l[dist])] | for j in getSystemsNAway(cursystem,i,preferredfaction): import dynamic_battle try: l = dynamic_battle.persystemattacklist except: l= [] for k in l: if (VS.GetRelation(fac,l[1][1])>0): generateDefendMission(j,l[1][0],l[1][1],l[0][0],l[0][1]) for k in range(vsrandom.randrange(1,4)): pass | def contractMissionForTo (fac,enemy,minsysaway,maxsysaway): """Creates a mission for faction `fac' and against `enemy'""" script='' cursystem = VS.getSystemFile() thisfaction = VS.GetGalaxyFaction (cursystem) preferredfaction=None if (VS.GetRelation (fac,thisfaction)>0): preferredfaction=fac#try to stay in this territo... | 903540045d6a5f19ccaa9039534586890266c181 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2883/903540045d6a5f19ccaa9039534586890266c181/dynamic_mission.py |
"""returns a particlar races stardate to day ration""" return daysinYear(monthsystem) / 1000.0 | """returns a particlar races stardate to day ratio""" return daysinYear(monthsystem) / 1000.0 | def getStarToDay(monthsystem): """returns a particlar races stardate to day ration""" return daysinYear(monthsystem) / 1000.0 #FIXME: make faction dependent | ce8594f6b6b9596941263c25b363f792ed1ac1eb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2883/ce8594f6b6b9596941263c25b363f792ed1ac1eb/stardate.py |
return 2003 | if faction == "confed": return 2403 else: return 2403 | def getZeroYear(faction): return 2003 #FIXME: make faction dependent | ce8594f6b6b9596941263c25b363f792ed1ac1eb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2883/ce8594f6b6b9596941263c25b363f792ed1ac1eb/stardate.py |
rad=_unit.getRSize (un) | rad=_unit.rSize (un) | def NextPos (un, pos): rad=_unit.getRSize (un) whichcoord = random.random(0,2) x = _olist.at (pos,whichcoord) x=x+3.0*rad _olist.set (pos,whichcoord,x) | 79a4a72427eea78a1eda0edc80d0661f3845c1a1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2883/79a4a72427eea78a1eda0edc80d0661f3845c1a1/launch_recycle.py |
x = _olist.at (pos,whichcoord) | x = pos[whichcoord] pos = [pos[0],pos[1],pos[2]] | def NextPos (un, pos): rad=_unit.getRSize (un) whichcoord = random.random(0,2) x = _olist.at (pos,whichcoord) x=x+3.0*rad _olist.set (pos,whichcoord,x) | 79a4a72427eea78a1eda0edc80d0661f3845c1a1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2883/79a4a72427eea78a1eda0edc80d0661f3845c1a1/launch_recycle.py |
_olist.set (pos,whichcoord,x) | pos[whichcoord]=x return (pos[0],pos[1],pos[2]) | def NextPos (un, pos): rad=_unit.getRSize (un) whichcoord = random.random(0,2) x = _olist.at (pos,whichcoord) x=x+3.0*rad _olist.set (pos,whichcoord,x) | 79a4a72427eea78a1eda0edc80d0661f3845c1a1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2883/79a4a72427eea78a1eda0edc80d0661f3845c1a1/launch_recycle.py |
NextPos (un,where) | return NextPos (un,where) | def move_to (un, where): un.setPosition(where) un.setTarget (VS.Unit()) NextPos (un,where) | 79a4a72427eea78a1eda0edc80d0661f3845c1a1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2883/79a4a72427eea78a1eda0edc80d0661f3845c1a1/launch_recycle.py |
pos=(pos[0]+rsize*random.randomsign() pos[1]+rsize*random.randomsign() pos[2]+rsize*random.randomsign()) return pos | return (pos[0]+rsize*random.randomsign() pos[1]+rsize*random.randomsign() pos[2]+rsize*random.randomsign()) | def whereTo (radius, launch_around): pos = launch_around.getPosition () rsize = ((launch_around.rSize())*2.0)+radius pos=(pos[0]+rsize*random.randomsign() pos[1]+rsize*random.randomsign() pos[2]+rsize*random.randomsign()) return pos | 79a4a72427eea78a1eda0edc80d0661f3845c1a1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2883/79a4a72427eea78a1eda0edc80d0661f3845c1a1/launch_recycle.py |
move_to (un,pos) | pos=move_to (un,pos) | def look_for (fg, faction, numships,myunit, pos, gcd): i=0 un = VS.getUnit (i) while (un): i+=1 un = VS.getUnit (i) i-=1 #now our i is on the last value while ((i>=0)&&(numships>0)): un = VS.getUnit (i) if (un): | 79a4a72427eea78a1eda0edc80d0661f3845c1a1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2883/79a4a72427eea78a1eda0edc80d0661f3845c1a1/launch_recycle.py |
return numships | return (numships,pos) | def look_for (fg, faction, numships,myunit, pos, gcd): i=0 un = VS.getUnit (i) while (un): i+=1 un = VS.getUnit (i) i-=1 #now our i is on the last value while ((i>=0)&&(numships>0)): un = VS.getUnit (i) if (un): | 79a4a72427eea78a1eda0edc80d0661f3845c1a1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2883/79a4a72427eea78a1eda0edc80d0661f3845c1a1/launch_recycle.py |
rad=_unit.getRSize (newship) | rad=unit.rSize (newship) | def LaunchNext (fg, fac, type, ai, pos, logo): newship = launch.launch (fg,fac,type,ai,1,1,pos,logo) rad=_unit.getRSize (newship) VS.playAnimation ("warp.ani",pos,(3.0*rad)) NextPos (newship,pos) | 79a4a72427eea78a1eda0edc80d0661f3845c1a1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2883/79a4a72427eea78a1eda0edc80d0661f3845c1a1/launch_recycle.py |
NextPos (newship,pos) | return NextPos (newship,pos) | def LaunchNext (fg, fac, type, ai, pos, logo): newship = launch.launch (fg,fac,type,ai,1,1,pos,logo) rad=_unit.getRSize (newship) VS.playAnimation ("warp.ani",pos,(3.0*rad)) NextPos (newship,pos) | 79a4a72427eea78a1eda0edc80d0661f3845c1a1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2883/79a4a72427eea78a1eda0edc80d0661f3845c1a1/launch_recycle.py |
LaunchNext (fg,faction,type, ai, pos,logo) | pos = LaunchNext (fg,faction,type, ai, pos,logo) | def launch_wave_around ( fg, faction, ai, nr_ships, capship, radius, myunit, garbage_collection_distance,logo): pos = whereTo(radius, myunit) nr_ships = look_for (fg,faction,nr_ships,myunit,pos,garbage_collection_distance) while (nr_ships>0): type="" if (capship): | 79a4a72427eea78a1eda0edc80d0661f3845c1a1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2883/79a4a72427eea78a1eda0edc80d0661f3845c1a1/launch_recycle.py |
Fixer ("rowenna","Speak with Rowenna",[("decided_iso_evil",0),("iso_mission3",0),("iso_mission2",1)],"bases/fixers/iso.spr","bases/fixers/iso.py") | Fixer ("rowenna","Speak with Rowenna",[("decided_iso_evil",0),("iso_mission3",0),("iso_mission2",1)],"bases/fixers/iso.spr","bases/fixers/iso.py"), Fixer ("rowenna","Speak with Rowenna",[("decided_iso_evil",0),("iso_mission3",0),("iso_mission2",-1)],"bases/fixers/iso.spr","bases/fixers/iso.py") | def drawobjs(self,room,x,y,wid,hei): Base.Texture(room,self.name,self.image,x+(wid/2),y+(hei/2)) Base.Python(room,self.name,x,y,wid,hei,self.text,self.choices,True) | 48d1c7446bcf1ad1d9765ef348c313d2d39646f9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2883/48d1c7446bcf1ad1d9765ef348c313d2d39646f9/fixers.py |
Fixer ("rowenna","Speak with Rowenna",[("decided_iso_evil",0),("iso_mission3",1)],"bases/fixers/iso.spr","bases/fixers/iso.py") | Fixer ("rowenna","Speak with Rowenna",[("decided_iso_evil",0),("iso_mission3",1)],"bases/fixers/iso.spr","bases/fixers/iso.py"), Fixer ("rowenna","Speak with Rowenna",[("decided_iso_evil",0),("iso_mission3",-1)],"bases/fixers/iso.spr","bases/fixers/iso.py") | def drawobjs(self,room,x,y,wid,hei): Base.Texture(room,self.name,self.image,x+(wid/2),y+(hei/2)) Base.Python(room,self.name,x,y,wid,hei,self.text,self.choices,True) | 48d1c7446bcf1ad1d9765ef348c313d2d39646f9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2883/48d1c7446bcf1ad1d9765ef348c313d2d39646f9/fixers.py |
num=0 | num=long(0) | def seedstring (stru): num=0 l=len (stru) for i in range(l): global totalnormchar,RAND_MAX num+=getNumFromChar(stru[l-i-1]) num*=totalnormchar; num = num % RAND_MAX try: num = int(num) except: print 'warning' return num | f9cfdac75d25857e6ae64a845896c3d100496a73 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2883/f9cfdac75d25857e6ae64a845896c3d100496a73/seedrandom.py |
num+=getNumFromChar(stru[l-i-1]) num*=totalnormchar; num = num % RAND_MAX try: num = int(num) except: print 'warning' | num+=long(getNumFromChar(stru[l-i-1])) num*=long(totalnormchar); num = (num % long(RAND_MAX)) try: num = int(num) except: print 'warning' | def seedstring (stru): num=0 l=len (stru) for i in range(l): global totalnormchar,RAND_MAX num+=getNumFromChar(stru[l-i-1]) num*=totalnormchar; num = num % RAND_MAX try: num = int(num) except: print 'warning' return num | f9cfdac75d25857e6ae64a845896c3d100496a73 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2883/f9cfdac75d25857e6ae64a845896c3d100496a73/seedrandom.py |
,"loss" : {"good" : [(0.5,"player","Tragic skirmish in VAR_system_system\\A small skirmish in VAR_system_system resulted in the defeat of the VAR_aggressor_nickp starship, type VAR_aggressor_FGtype. Authorities viewed the small skirmish as a sad but isolated case and state that this skirmish in no way should indicate... | ,"loss" : {"good" : [(0.8,"all","VAR_aggressor_dnicks attack repelled by valorous VAR_system_system - based VAR_defender_FG\\The resourceful and potent VAR_defender_nickp squadran was assaulted by the deceitful VAR_aggressor_nicks flightgroup of VAR_aggressor_FGtype starships. Far from running, the VAR_defender_nicks ... | def allNews(): | 567e2d395c6f20bfb9b9908dd52c5ca441e574a2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2883/567e2d395c6f20bfb9b9908dd52c5ca441e574a2/dynamic_news_content.py |
,"bad" : [(0.8,"all","VAR_aggressor_dnicks attack repelled by valorous VAR_system_system - based VAR_defender_FG\\The resourceful and potent VAR_defender_nickp squadran was assaulted by the deceitful VAR_aggressor_nicks flightgroup of VAR_aggressor_FGtype starships. Far from running, the VAR_defender_nicks squad made ... | ,"bad" : [(0.4,"all","VAR_system_system Skirmish ends in defeat for VAR_aggressor_nicks\\With hositilities rising in the VAR_system_sector, the VAR_aggressor_nicks flightgroup VAR_aggressor_FG initiated combat with the VAR_defender_nickp squadron of VAR_defender_FGtype, the VAR_defender_FG s. Initially the battle wen... | def allNews(): | 567e2d395c6f20bfb9b9908dd52c5ca441e574a2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2883/567e2d395c6f20bfb9b9908dd52c5ca441e574a2/dynamic_news_content.py |
flightgroupnamelist=[] | flightgroupnamelist={} | def AllFactions (): facs =[] for i in range (VS.GetNumFactions()): facs+= [VS.GetFactionName(i)] return facs | bced75b4defedad35c053ed425d73c5e16c6d7b4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2883/bced75b4defedad35c053ed425d73c5e16c6d7b4/fg_util.py |
def ReadBaseNameList(): | def ReadBaseNameList(faction): | def ReadBaseNameList(): bnl=[] try: f = open ('universe/names.txt','r') bnl = f.readlines() f.close() except: try: f = open ('../universe/names.txt','r') bnl = f.readlines() f.close() except: global genericalphabet bnl=genericalphabet for i in range(len(bnl)): bnl[i]=bnl[i].rstrip() return bnl | bced75b4defedad35c053ed425d73c5e16c6d7b4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2883/bced75b4defedad35c053ed425d73c5e16c6d7b4/fg_util.py |
f = open ('universe/names.txt','r') | f = open (filename,'r') | def ReadBaseNameList(): bnl=[] try: f = open ('universe/names.txt','r') bnl = f.readlines() f.close() except: try: f = open ('../universe/names.txt','r') bnl = f.readlines() f.close() except: global genericalphabet bnl=genericalphabet for i in range(len(bnl)): bnl[i]=bnl[i].rstrip() return bnl | bced75b4defedad35c053ed425d73c5e16c6d7b4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2883/bced75b4defedad35c053ed425d73c5e16c6d7b4/fg_util.py |
f = open ('../universe/names.txt','r') | f = open ('../'+filename,'r') | def ReadBaseNameList(): bnl=[] try: f = open ('universe/names.txt','r') bnl = f.readlines() f.close() except: try: f = open ('../universe/names.txt','r') bnl = f.readlines() f.close() except: global genericalphabet bnl=genericalphabet for i in range(len(bnl)): bnl[i]=bnl[i].rstrip() return bnl | bced75b4defedad35c053ed425d73c5e16c6d7b4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2883/bced75b4defedad35c053ed425d73c5e16c6d7b4/fg_util.py |
global genericalphabet bnl=genericalphabet | try: f = open ('../universe/names.txt','r') bnl = f.readlines() f.close() except: global genericalphabet bnl=genericalphabet | def ReadBaseNameList(): bnl=[] try: f = open ('universe/names.txt','r') bnl = f.readlines() f.close() except: try: f = open ('../universe/names.txt','r') bnl = f.readlines() f.close() except: global genericalphabet bnl=genericalphabet for i in range(len(bnl)): bnl[i]=bnl[i].rstrip() return bnl | bced75b4defedad35c053ed425d73c5e16c6d7b4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2883/bced75b4defedad35c053ed425d73c5e16c6d7b4/fg_util.py |
if (len(flightgroupnamelist)==0): flightgroupnamelist = ReadBaseNameList() | if (not (faction in flightgroupnamelist)): flightgroupnamelist[faction]=ReadBaseNameList(faction) | def GetRandomFGNames (numflightgroups, faction): global flightgroupnamelist if (len(flightgroupnamelist)==0): flightgroupnamelist = ReadBaseNameList() for i in range (numflightgroups-len(flightgroupnamelist)): flightgroupnamelist.append(str(i)) return flightgroupnamelist | bced75b4defedad35c053ed425d73c5e16c6d7b4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2883/bced75b4defedad35c053ed425d73c5e16c6d7b4/fg_util.py |
flightgroupnamelist.append(str(i)) | flightgroupnamelist[faction].append(str(i)) | def GetRandomFGNames (numflightgroups, faction): global flightgroupnamelist if (len(flightgroupnamelist)==0): flightgroupnamelist = ReadBaseNameList() for i in range (numflightgroups-len(flightgroupnamelist)): flightgroupnamelist.append(str(i)) return flightgroupnamelist | bced75b4defedad35c053ed425d73c5e16c6d7b4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2883/bced75b4defedad35c053ed425d73c5e16c6d7b4/fg_util.py |
def GetRandomBaseName (n): | def GetRandomBaseName (n,faction): | def GetRandomBaseName (n): retval=[] global basenamelist try: import seedrandom if (len(basenamelist)==0): basenamelist=ReadBaseNameList() for i in range (n): retval+=[basenamelist[seedrandom.rand()%len(basenamelist)]] except: retval=[] for i in range (n): retval+=[str(n)] n+=1 return retval | bced75b4defedad35c053ed425d73c5e16c6d7b4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2883/bced75b4defedad35c053ed425d73c5e16c6d7b4/fg_util.py |
basenamelist=ReadBaseNameList() | basenamelist=ReadBaseNameList(faction+'_base') | def GetRandomBaseName (n): retval=[] global basenamelist try: import seedrandom if (len(basenamelist)==0): basenamelist=ReadBaseNameList() for i in range (n): retval+=[basenamelist[seedrandom.rand()%len(basenamelist)]] except: retval=[] for i in range (n): retval+=[str(n)] n+=1 return retval | bced75b4defedad35c053ed425d73c5e16c6d7b4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2883/bced75b4defedad35c053ed425d73c5e16c6d7b4/fg_util.py |
nam=GetRandomBaseName (1); | nam=GetRandomBaseName (1,faction); | def launchBaseOrbit(type,faction,loc,orbitradius,orbitspeed,unit): import Vector import dynamic_universe R = Vector.Vector(vsrandom.uniform(.5*orbitradius,orbitradius), vsrandom.uniform(.5*orbitradius,orbitradius), vsrandom.uniform(.5*orbitradius,orbitradius)) RMag = Vector.Mag(R) T = Vector.Vector(vsrandom.uniform(.5*... | bced75b4defedad35c053ed425d73c5e16c6d7b4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2883/bced75b4defedad35c053ed425d73c5e16c6d7b4/fg_util.py |
def IOmessage(time,fr,to,message): sys.stderr.write("IOmessage [printed in %f seconds; from %s to %s: '%s']\n" % (time,fr,to,message)) def GetMasterPartList(a=None,b=None,c=None,d=None,e=None,f=None,g=None,h=None,i=None,j=None): print "GetMasterPartList" return Unit() def GetContrabandList(a=None,b=None,c=None,d=None,e... | def getOwner(a=None,b=None,c=None,d=None,e=None,f=None,g=None,h=None,i=None,j=None): print "getOwner" return Unit() | 04770d080dcbaf2f25f8a37ca2fa40c41b242413 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2883/04770d080dcbaf2f25f8a37ca2fa40c41b242413/VS.py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.