diff --git a/data.json b/data.json index 1538da3..db8afdc 100644 --- a/data.json +++ b/data.json @@ -6,6 +6,7 @@ ["Aslak",0], ["Butterswick",0], ["Celiestra",0], + ["Cynthia",0], ["Darkwood",0], ["Edgar",0], ["Eggert",0], @@ -24,18 +25,19 @@ ["Silvan",0], ["Silvertongue",0], ["Tymna",0], + ["Valeria",0], ["Valindis",0], ["Virtus",0], ["Volynthia",0], ["bandit", 1], ["changeling", 1], - ["child", 1], ["diplomat", 1], ["dragon", 1], ["dwarf", 1], ["elf", 1], ["giant", 1], + ["guard", 1], ["human", 1], ["inn", 1], ["orc", 1], @@ -55,16 +57,19 @@ ["purple",2], ["red",2], - ["ambush",3], + ["attack",3], + ["capturing",3], ["deserted",3], + ["disguised",3], ["eating",3], ["escape",3], ["gathering",3], ["kidnapped",3], + ["kill",3], ["save",3], ["terrorizing",3], + ["trick",3], - ["adopted",4], ["half",4], ["high",4], ["flying",4], @@ -99,17 +104,17 @@ "The Party (Before Session)", "- [Adrian/0] [Goldenleaf/0], a [high/4] [elf/1] [rogue/7] from [Volantis/5] and owner of the [Goldenleaf/0] [inn/1].", "- [Andromedes/0] [Moklus/0], a [dwarf/1] [artificer/7] from [Hammerhome/5] and [diplomat/1] in [Dragonsong/5].", - "- [Aslak/0] ???, an [orc/1] [barbarian/7]/[monk/7] from The [The%Westerlands/5] and [adopted/4] [child/1] of [Nix/0] [McGalloway/0].", - "- [Marigold/0] [Sagemonger/0], a [high/4] [elf/1] [wizard/7] from The [The%Empire/5] and owner of [Sagemonger/0]'s.", - "- [Nix/0] [McGalloway/0], a [changeling/1] [monk/7] from The [The%Westerlands/5] and owner of the [flying/4] [pegasus/1].", - "- [Sam/0], a [satyr/1] [cleric/7] from The [The%Feywilds/5].", - "- [Silvan/0] ???, a [human/1] [fighter/7] from The [The%Empire/5] and formely a [trainee/1] of [Paterius/0] [Enkelton/0]." + "- [Aslak/0], an [orc/1] [barbarian/7]/[monk/7] from [The%Westerlands/5] and [trainee/1] of [Nix/0] [McGalloway/0].", + "- [Marigold/0] [Sagemonger/0], a [high/4] [elf/1] [wizard/7] from [The%Empire/5] and owner of [Sagemonger/0]'s.", + "- [Nix/0] [McGalloway/0], a [changeling/1] [monk/7] from [The%Westerlands/5] and owner of the [flying/4] [pegasus/1].", + "- [Sam/0], a [satyr/1] [cleric/7] from [The%Feywilds/5].", + "- [Silvan/0], a [human/1] [fighter/7] from [The%Empire/5] and formerly a [trainee/1] of [Paterius/0] [Enkelton/0]." ], [ "Present Threats", "- [Lord/6] [Edgar/0] [Darkwood/0] is [gathering/3] [power/1] in his [tower/1], far away from civilization.", - "- [Volynthia/0], a [green/2] [dragon/1], is trying to [escape/3] from The [The%Feywilds/5], helped by a group of [orc/1]s.", - "- A [war/1] is raging between [Lady/6] [Argyn/0] and the [giant/1]s, for control of [Giant's%Heart/5]." + "- [Volynthia/0], a [green/2] [dragon/1], is trying to [escape/3] from [The%Feywilds/5], helped by a group of [orc/1]s.", + "- A [war/1] is raging between [Lady/6] [Valeria/0] [Argyn/0] and the [giant/1]s, for control of [Giant's%Heart/5]." ], [ "Before the Session", @@ -117,7 +122,11 @@ ], [ "Into the Dark", - "The party head into the [Dragonsong/5] [sewers/1] to [ambush/3] the [purple/2] [rose/1] and [save/3] [Galinndan/0]. They meet and join up with ???, a [human/1] [rogue/7], who has [deserted/3] the [purple/2] [rose/1]." + "The party head into the [Dragonsong/5] [sewers/1] to [attack/3] the [purple/2] [rose/1] and [save/3] [Galinndan/0]. They meet and join up with [Cynthia/0], a [human/1] [rogue/7] who has [deserted/3] the [purple/2] [rose/1]. They then [kill/3] the 2 [guard/1]s outside the door." + ], + [ + "The Plan", + "The party [trick/3] [Valindis/0] [Half-ear/0] by \"[capturing/3]\" [Nix/0] [McGalloway/0] [disguised/3] as [Adrian/0] [Goldenleaf/0]." ] ] } \ No newline at end of file diff --git a/main.py b/main.py index 9eceaf0..4a73c2b 100644 --- a/main.py +++ b/main.py @@ -340,7 +340,7 @@ def main(data: dict): new_text.append("") text_words = t.split(" ") for w in text_words: - res = re.findall(r"\[(.*?)\/(\d)\]([^\[ ]*)",w) + res = re.findall(r"([^\] ]*)\[(.*?)\/(\d)\]([^\[ ]*)",w) if res == []: new_text = add_to_text(new_text,w) else: @@ -348,19 +348,19 @@ def main(data: dict): new_text = add_to_text(new_text,"") for slot in res: - new_text = add_to_text(new_text,WORD_SLOT_SPACING+slot[2],"") + new_text = add_to_text(new_text,slot[0]+WORD_SLOT_SPACING+slot[3],"") height = WORD_FONT_SIZE*len(new_text) width, _ = font.size(new_text[-1]) - extra_width, _ = font.size(slot[2]) + extra_width, _ = font.size(slot[3]) pos = Vector2( TEXT_MARGIN + width - extra_width - WORD_WIDTH, TEXT_MARGIN + height - WORD_HEIGHT//2 + TEXT_TOP_MARGIN*len(new_text) + WORD_SLOT_NUDGE_DOWN ) # if new_text[-1] != WORD_SLOT_SPACING+slot[2]: pos.x += WORD_SLOT_NUDGING - new_slot = WordSlot(WordColor(int(slot[1])),p,pos) + new_slot = WordSlot(WordColor(int(slot[2])),p,pos) word_slots.append(new_slot) - p.slots.append((slot[0].replace("%"," "),new_slot)) + p.slots.append((slot[1].replace("%"," "),new_slot)) p.text = new_text