| class Plot: | class Plot: | ||||
| loc1 = ["friendly","hostile","derelict","airless","poison-filled/covered","overgrown","looted","burning","frozen","haunted","infested"] | loc1 = ["friendly","hostile","derelict","airless","poison-filled/covered","overgrown","looted","burning","frozen","haunted","infested"] | ||||
| loc2 = ["asteroid","moon","space station","spaceship","ringworld","Dyson sphere","planet","Space Whale","pocket of folded space","time vortex","Reroll"] | |||||
| loc2 = ["asteroid","moon","space station","spaceship","ringworld","Dyson sphere","planet","Space Whale","pocket of folded space","time vortex","battlefield"] | |||||
| miss = ["explore","loot everything not bolted down too securely","find the last group of kobolds who came here","find a rumored secret weapon","find a way to break someone else's secret weapon","claim this place in the name of the Kobold Empire","make friends","rediscover lost technology","find lost magical items","find and defeat a powerful enemy"] | miss = ["explore","loot everything not bolted down too securely","find the last group of kobolds who came here","find a rumored secret weapon","find a way to break someone else's secret weapon","claim this place in the name of the Kobold Empire","make friends","rediscover lost technology","find lost magical items","find and defeat a powerful enemy"] | ||||
| prob = adversaries.prob | prob = adversaries.prob | ||||
| self.locIndex = int(locIndex) if locIndex != None else r.randint(0, len(Plot.loc2)-1) | self.locIndex = int(locIndex) if locIndex != None else r.randint(0, len(Plot.loc2)-1) | ||||
| self.battlefield = int(battlefield) if battlefield != None else 0 | self.battlefield = int(battlefield) if battlefield != None else 0 | ||||
| self.location = location if location != None else Plot.loc2[self.locIndex] | self.location = location if location != None else Plot.loc2[self.locIndex] | ||||
| if locIndex == None and self.locIndex == len(Plot.loc2) - 2: | |||||
| if self.battlefield == 0: | |||||
| self.battlefield = 1 | |||||
| self.locIndex = r.randint(0, len(Plot.loc2)-3) | |||||
| if locIndex == None and loc2[self.locIndex] == "battlefield": | |||||
| self.battlefield = 1 | |||||
| self.locIndex = r.randint(0, len(Plot.loc2)-2) | |||||
| elif locIndex == None and self.locIndex != len(Plot.loc2) - 1: | elif locIndex == None and self.locIndex != len(Plot.loc2) - 1: | ||||
| if self.location == "": | if self.location == "": | ||||
| self.location = Plot.loc2[self.locIndex] | self.location = Plot.loc2[self.locIndex] | ||||
| secnote = "" | secnote = "" | ||||
| if self.params.problem["hasMinion"]: | if self.params.problem["hasMinion"]: | ||||
| secnote = "Their minion: " + self.params.secProblem["note"] | secnote = "Their minion: " + self.params.secProblem["note"] | ||||
| bf = "" | |||||
| if self.params.battlefield: | |||||
| bf = "a battlefield on " | |||||
| lines = [ | lines = [ | ||||
| f"The Kobolds of the {self.ship.fullname}", | f"The Kobolds of the {self.ship.fullname}", | ||||
| f"have been sent out to {self.art} {self.params.loc_desc} {self.params.location}!", | |||||
| f"have been sent out to {bf}{self.art} {self.params.loc_desc} {self.params.location}!", | |||||
| f"in order to {mission}", | f"in order to {mission}", | ||||
| f"but they're challenged by {self.params.fullProblem}!", | f"but they're challenged by {self.params.fullProblem}!", | ||||
| f"{note} {secnote}", | f"{note} {secnote}", | ||||
| f"<div id='themission' class='firstrow'>\n" | f"<div id='themission' class='firstrow'>\n" | ||||
| f" <span class='head'>The Mission</span>\n" | f" <span class='head'>The Mission</span>\n" | ||||
| f" <span id='missionloc'>\n" | f" <span id='missionloc'>\n" | ||||
| f" The kobolds have been sent to {self.art} {self.params.loc_desc} {self.params.location}\n" | |||||
| f" The kobolds have been sent to {bf}{self.art} {self.params.loc_desc} {self.params.location}\n" | |||||
| f" </span><br>\n" | f" </span><br>\n" | ||||
| f" <span id='missiontarget'>\n" | f" <span id='missiontarget'>\n" | ||||
| f" in order to {mission}!\n" | f" in order to {mission}!\n" | ||||
| s = c + s | s = c + s | ||||
| return s | return s | ||||
| def create_password(): | |||||
| pw = [] | |||||
| for _ in range(84): | |||||
| pw.append(r.choice(Campaign.ALPHABET)) | |||||
| return "".join(pw) | |||||
| if __name__ == "__main__": | if __name__ == "__main__": | ||||
| parser = argparse.ArgumentParser() | parser = argparse.ArgumentParser() | ||||
| group = parser.add_mutually_exclusive_group() | group = parser.add_mutually_exclusive_group() | ||||
| cmp.print_chars(html=html) | cmp.print_chars(html=html) | ||||
| cmp.print_password(html=html) | cmp.print_password(html=html) | ||||
| elif args.campaign: | elif args.campaign: | ||||
| #cmp = Campaign(fromPW = True, pw=create_password()) | |||||
| cmp = Campaign(args.campaign) | cmp = Campaign(args.campaign) | ||||
| cmp.print_params(html=html) | cmp.print_params(html=html) | ||||
| cmp.print_chars(html=html) | cmp.print_chars(html=html) |