Explorar el Código

Add challenger and minion stats

master
Noëlle hace 4 años
padre
commit
d5c4e64014
Se han modificado 1 ficheros con 57 adiciones y 33 borrados
  1. 57
    33
      koboldgen.py

+ 57
- 33
koboldgen.py Ver fichero

@@ -22,37 +22,6 @@ def gen_name(n=None):
return "".join(morae)


def gen_career():
return r.choice(["Soldier/Guard","Pilot","Medic","Mechanic","Politician","Spellcaster","Performer","Historian","Spy","Cook","Cartographer"])

def gen_plot():
loc1 = ["a friendly","a hostile","a derelict","an airless","a poison-filled/covered","an overgrown","a looted","a burning","a frozen","a haunted","an infested"]
loc2 = ["asteroid","moon","space station","spaceship","ringworld","Dyson sphere","planet","Space Whale","pocket of folded space","time vortex","Reroll"]
miss = ["to explore!","to loot everything not bolted down too securely","to find the last group of kobolds who came here","to find a rumored secret weapon","to find a way to break someone else’s secret weapon","to claim this place in the name of the Kobold Empire!","to make friends!","to rediscover lost technology","to find lost magical items","to find and defeat a powerful enemy","Reroll"]
prob = ["an army of undead","a rival band of kobolds","a detachment from the Elf Armada","refugees with parasites. Big parasites","an artificial intelligence bent on multi-world domination","robot spiders","semi-intelligent metal eating slime","a living asteroid that intends to follow the kobolds home like the largest puppy","an old lich that wants everyone to stay off of their “lawn”","elder gods hailing from the dark spaces between the stars","Reroll"]
cl1 = r.choice(loc1)
cl2 = r.choice(loc2)
cm = r.choice(miss)
cp = r.choice(prob)
if cl2 == "Reroll":
cl2p = r.choice(loc2[:-1])
if cl2p == "Asteroid":
cl2 = "battlefield on an asteroid"
else:
cl2 = "battlefield on a " + cl2p
if cm == "Reroll":
cm = "to ...well, the kobolds weren't paying attention, so don't tell them, but they're supposed to " + r.choice(miss[:-1])
if cp == "Reroll":
cp = "a Floating Brain Monster and its minion, " + r.choice(prob[:-1])
return [cl1, cl2, cm, cp]

# def gen_transpo():
# name1 = ["Red","Orange","Yellow","Green","Blue","Violet","Dark","Light","Frenzied","Maniacal","Ancient"]
# name2 = ["Moon","Comet","Star","Saber","World-Eater","Dancer","Looter","Phlogiston","Fireball","Mecha","Raptor"]
# prop1 = ["is stealthy & unarmored","is speedy & unarmored","is maneuverable & unarmored","is always repairable","is self-repairing","is flamboyant & speedy","is slow & armored","is flamboyant & armored","is hard to maneuver & armored","has Too Many Weapons!","has a prototype hyperdrive"]
# prop2 = ["has an annoying AI","has inconveniently crossed circuits","has an unpredictable power source","drifts to the right","is haunted","was recently 'found' so the kobolds are unused to it","is too cold","has a constant odd smell","its interior design... changes","its water pressure shifts between slow drip and power wash","it leaves a visible smoke trail"]
# return [r.choice(name1), r.choice(name2), r.choice(prop1), r.choice(prop2)]

class Character:
def __init__(self):
self.name = ""
@@ -107,7 +76,7 @@ class Character:
self.stats = stats

def gen_career(self):
self.career = gen_career()
self.career = r.choice(["Soldier/Guard","Pilot","Medic","Mechanic","Politician","Spellcaster","Performer","Historian","Spy","Cook","Cartographer","Inventor","Merchant"])

def print_name(self):
print(f"Name: {self.name} (Kobold {self.career})")
@@ -134,7 +103,7 @@ class Campaign:
def __init__(self, n=None):
n = 6 if n == None else n
self.ship = Ship()
self.params = gen_plot()
self.gen_plot()
self.characters = []
for _ in range(n):
c = Character()
@@ -142,11 +111,66 @@ class Campaign:
self.characters.append(c)
self.art = "an" if self.params[1][0] in ["A","E","I","O","U"] else "a"

def gen_plot(self):
loc1 = ["a friendly","a hostile","a derelict","an airless","a poison-filled/covered","an overgrown","a looted","a burning","a frozen","a haunted","an infested"]
loc2 = ["asteroid","moon","space station","spaceship","ringworld","Dyson sphere","planet","Space Whale","pocket of folded space","time vortex","Reroll"]
miss = ["to explore!","to loot everything not bolted down too securely","to find the last group of kobolds who came here","to find a rumored secret weapon","to find a way to break someone else’s secret weapon","to claim this place in the name of the Kobold Empire!","to make friends!","to rediscover lost technology","to find lost magical items","to find and defeat a powerful enemy","Reroll"]
prob = ["an Undead Sample Pack (swarm of zombies and skeletons)","a rival band of kobolds","a detachment from the Elf Armada","refugees with parasites. Big parasites","an artificial intelligence bent on multi-world domination","robot spiders","semi-intelligent metal eating slime","a living asteroid that intends to follow the kobolds home like the largest puppy","an old lich that wants everyone to stay off of their “lawn”","elder gods hailing from the dark spaces between the stars","Reroll"]
pstats = {
"an Undead Sample Pack (swarm of zombies and skeletons)": [0,5,2,6],
"a rival band of kobolds": [3,3,4,4],
"a detachment from the Elf Armada": [4,3,5,4],
"refugees with parasites. Big parasites": [2,4,0,0],
"an artificial intelligence bent on multi-world domination": [4,1,6,3],
"robot spiders": [3,3,2,4],
"semi-intelligent metal eating slime": [0,2,1,5],
"a living asteroid that intends to follow the kobolds home like the largest puppy": [2,3,1,6],
"an old lich that wants everyone to stay off of their “lawn”": [5,2,6,3],
"elder gods hailing from the dark spaces between the stars": [6,6,6,6],
"Reroll": [2,3,6,1]
}
cl1 = r.choice(loc1)
cl2 = r.choice(loc2)
cm = r.choice(miss)
cp = r.choice(prob)
cs1 = pstats[cp]
cs2 = None
cs3 = None
if cp == "refugees with parasites. Big parasites":
cs2 = [3,4,2,3]
if cl2 == "Reroll":
cl2p = r.choice(loc2[:-1])
if cl2p == "Asteroid":
cl2 = "battlefield on an asteroid"
else:
cl2 = "battlefield on a " + cl2p
if cm == "Reroll":
cm = "to ...well, the kobolds weren't paying attention, so don't tell them, but they're supposed to " + r.choice(miss[:-1])
if cp == "Reroll":
newprob = r.choice(prob[:-1])
if newprob == "refugees with parasites. Big parasites":
cs3 = [3,4,2,3]
cs2 = pstats[newprob]
cp = "a Floating Brain Monster and its minion, " + newprob
self.params = [cl1, cl2, cm, cp, cs1, cs2, cs3]

def print_params(self, endc=""):
st = ["Order:", "Chaos:", "Brains:", "Body:"]
print(f"The Kobolds of the {self.ship.fullname} ", end=endc)
print(f"have been sent out to {self.art} {self.params[0]} {self.params[1]} ", end=endc)
print(f"in order {self.params[2]} ", end=endc)
print(f"-- but they're challenged by {self.params[3]}!")
cst = ", ".join([" ".join(y) for y in list(zip(st, [str(x) for x in self.params[4]]))])
print(f"The challenger's stats: {cst}")
if self.params[5] != None:
mst = ", ".join([" ".join(y) for y in list(zip(st, [str(x) for x in self.params[5]]))])
if self.params[3][0] == "r":
print(f"- The parasites' stats: {mst}")
else:
print(f"- Its minion's stats: {mst}")
if self.params[6] != None:
pst = ", ".join([" ".join(y) for y in list(zip(st, [str(x) for x in self.params[6]]))])
print(f"- - The parasites' stats: {pst}")
print()
self.ship.print()


Cargando…
Cancelar
Guardar