From fc06a0a33c667c0c6eb231066cc7102612374318 Mon Sep 17 00:00:00 2001 From: NikolajDanger Date: Tue, 7 Apr 2020 23:26:58 +0200 Subject: [PATCH 1/9] :skull: Fixed typo in word Skulduggery --- resources/swskills.json | 2 +- resources/swtemplates.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/swskills.json b/resources/swskills.json index 697e734..698cafe 100644 --- a/resources/swskills.json +++ b/resources/swskills.json @@ -17,7 +17,7 @@ "Negotiation" : "Presence", "Piloting-planetary" : "Agility", "Stealth" : "Agility", - "Skullduggery" : "Cunning", + "skulduggery" : "Cunning", "Brawl" : "Brawn", "Discipline" : "Willpower", "Gunnery" : "Agility", diff --git a/resources/swtemplates.json b/resources/swtemplates.json index 4d04535..00773a9 100644 --- a/resources/swtemplates.json +++ b/resources/swtemplates.json @@ -48,7 +48,7 @@ "Ranged-heavy": 0, "Ranged-light": 0, "Resilience": 0, - "Skullduggery": 0, + "skulduggery": 0, "Stealth": 0, "Streetwise": 0, "Survival": 0, From f0da32aafa4cd5d5811a0140f8797a9f056ca255 Mon Sep 17 00:00:00 2001 From: NikolajDanger Date: Wed, 8 Apr 2020 16:22:28 +0200 Subject: [PATCH 2/9] =?UTF-8?q?Reacts=20with=20=F0=9F=91=8D=20when=20someo?= =?UTF-8?q?ne=20aswers=20trivia=20question?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Gwendolyn.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Gwendolyn.py b/Gwendolyn.py index a85865a..0ba8b83 100644 --- a/Gwendolyn.py +++ b/Gwendolyn.py @@ -246,7 +246,11 @@ async def on_message(message): elif message.content.lower().startswith("!trivia "): command = message.content.lower().replace("!trivia ","") - await message.channel.send(funcs.triviaOtherThing(message.author.name,str(message.channel),command)) + response = funcs.triviaOtherThing(message.author.name,str(message.channel),command) + if response.startswith("Locked in "): + await message.add_reaction("👍") + else: + await message.channel.send(response) else: funcs.logThis("I didn't understand that") await message.channel.send("I didn't understand that") From 338ad545d06f350684a549181d82b5cc47db2265 Mon Sep 17 00:00:00 2001 From: NikolajDanger Date: Wed, 8 Apr 2020 16:43:04 +0200 Subject: [PATCH 3/9] She's a bit sassy now --- Gwendolyn.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Gwendolyn.py b/Gwendolyn.py index 0ba8b83..d0a8b52 100644 --- a/Gwendolyn.py +++ b/Gwendolyn.py @@ -254,7 +254,10 @@ async def on_message(message): else: funcs.logThis("I didn't understand that") await message.channel.send("I didn't understand that") - + + + if ("gwendolyn" in message.content.lower() or message.content.startswith("!")) and ("bitch" in message.content.lower() or "fuck" in message.content.lower()): + await message.add_reaction("😠") # Runs the whole shabang client.run(token) From 767d607f3f898dd4a4bf2c49776322b783edf78b Mon Sep 17 00:00:00 2001 From: NikolajDanger Date: Wed, 8 Apr 2020 18:04:53 +0200 Subject: [PATCH 4/9] =?UTF-8?q?=F0=9F=93=9D=20Some=20more=20comments?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Gwendolyn.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/Gwendolyn.py b/Gwendolyn.py index d0a8b52..2558670 100644 --- a/Gwendolyn.py +++ b/Gwendolyn.py @@ -6,6 +6,7 @@ import pickle import codecs import string import json +import random import funcs @@ -201,6 +202,8 @@ async def on_message(message): else: await message.channel.send(desc) + + # Searches for a specific page on the Senkulpa Wiki elif message.content.lower().startswith("!wiki "): async with message.channel.typing(): funcs.logThis(message.author.name+" ran \""+message.content+"\"") @@ -217,6 +220,8 @@ async def on_message(message): else: await message.channel.send(content) + + # Runs a trivia game elif message.content.lower().startswith("!trivia"): funcs.logThis(message.author.name+" ran \""+message.content+"\"") if message.content.lower() == "!trivia" or message.content.lower() == "!trivia ": @@ -256,8 +261,10 @@ async def on_message(message): await message.channel.send("I didn't understand that") - if ("gwendolyn" in message.content.lower() or message.content.startswith("!")) and ("bitch" in message.content.lower() or "fuck" in message.content.lower()): - await message.add_reaction("😠") + # Is a bit sassy sometimes + if ("gwendolyn" in message.content.lower() or message.content.startswith("!")) and ("bitch" in message.content.lower() or "fuck" in message.content.lower()) and "ikke" in message.content.lower() and "not" in message.content.lower(): + emoji = random.choice(["😠", "🖕", "👎"]) + await message.add_reaction(emoji) # Runs the whole shabang client.run(token) From 1e1dc9bd5fcbe99581fa7891c8bba8f5fc010b6a Mon Sep 17 00:00:00 2001 From: NikolajDanger Date: Wed, 8 Apr 2020 19:05:41 +0200 Subject: [PATCH 5/9] =?UTF-8?q?=F0=9F=A9=B8=20Critical=20injury=20rolls?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Gwendolyn.py | 17 +++++++++++++ funcs/__init__.py | 2 +- funcs/swfuncs/__init__.py | 2 +- funcs/swfuncs/swroll.py | 51 +++++++++++++++++++++++++++++++++++++++ 4 files changed, 70 insertions(+), 2 deletions(-) diff --git a/Gwendolyn.py b/Gwendolyn.py index 2558670..d89dcb2 100644 --- a/Gwendolyn.py +++ b/Gwendolyn.py @@ -190,6 +190,23 @@ async def on_message(message): for messageItem in messageList: await message.channel.send(messageItem) + # Rolls for critical injuries + elif message.content.lower().startswith("!swcrit"): + funcs.logThis(message.author.name+" ran \""+message.content+"\"") + command = message.content.lower().replace("!swcrit","").replace(" ","").replace("+","") + + if command == "": + command = 0 + + try: + newMessage = funcs.critRoll(int(command)) + except: + newMessage = "Try using a number, stupid" + + messageList = newMessage.split("\n") + for messageItem in messageList: + await message.channel.send(messageItem) + # Accesses and changes character sheet data with the parseChar function # from funcs/swfuncs/swchar.py elif message.content.lower().startswith("!swchar") or message.content.lower().startswith("!sw"): diff --git a/funcs/__init__.py b/funcs/__init__.py index e12dd3c..49590ac 100644 --- a/funcs/__init__.py +++ b/funcs/__init__.py @@ -1,6 +1,6 @@ from .gwendolynFuncs import helloFunc, cap, imageFunc, logThis, findWikiPage, makeFiles -from .swfuncs import parseChar, parseRoll, parseDestiny +from .swfuncs import parseChar, parseRoll, parseDestiny, critRoll from .lookup import spellFunc, monsterFunc diff --git a/funcs/swfuncs/__init__.py b/funcs/swfuncs/__init__.py index b5d9864..8937758 100644 --- a/funcs/swfuncs/__init__.py +++ b/funcs/swfuncs/__init__.py @@ -1,3 +1,3 @@ from .swchar import parseChar -from .swroll import parseRoll +from .swroll import parseRoll, critRoll from .swdestiny import parseDestiny \ No newline at end of file diff --git a/funcs/swfuncs/swroll.py b/funcs/swfuncs/swroll.py index d27989d..4215dcd 100644 --- a/funcs/swfuncs/swroll.py +++ b/funcs/swfuncs/swroll.py @@ -232,6 +232,57 @@ def obligationRoll(): return random.choice(table) +def critRoll(addington : int): + dd = "<:difficulty:690973992470708296>" + sd = "<:setback:690972157890658415>" + bd = "<:boost:690972178216386561>" + roll = random.randint(1,100) + addington + injuries = [ + "**Minor nick**: The target suffers 1 strain, "+dd] * 5 + [ + "**Slowed down**: The target can only act during the last allied initiative slot this turn, "+dd] * 5 + [ + "**Sudden Jolt**: The target drops whatever is in hand, "+dd] * 5 + [ + "**Distracted**: The target cannot perform a Free maneuver during his next turn, "+dd] * 5 + [ + "**Off-Balance**: The target adds "+sd+" to his next skill check, "+dd] * 5 + [ + "**Discouraging Wound**: Flip one light side Destiny point to a dark side Destiny point (reverse if NPC), "+dd] * 5 + [ + "**Stunned**: The target is staggered until the end of his next turn, "+dd] * 5 + [ + "**Stinger**: Increase the difficulty of next check by one, "+dd] * 5 + [ + "**Bowled Over**: The target is knocked prone and suffers 1 sttrain, "+dd+dd] * 5 + [ + "**Head Ringer**: The target increases the difficulty of all Intellect and Cunning checks by one until the end of the encounter, "+dd+dd] * 5 + [ + "**Fearsome Wound**: The target increases the difficulty of all Presence and Willpower checks by one until the end of the encounter, "+dd+dd] * 5 + [ + "**Agonizing Wound**: The target increases the difficulty of all Brawn and Agility checks by one until the end of the encounter, "+dd+dd] * 5 + [ + "**Slightly Dazed**: The target is disoriented until the end of the encounter, "+dd+dd] * 5 + [ + "**Scattered Senses**: The target removes all "+bd+" from skill checks until the end of the encounter, "+dd+dd] * 5 + [ + "**Hamstrung**: The target loses his free maneuver until the end of the encounter, "+dd+dd] * 5 + [ + "**Overpowered**: The target leaves himselp open, and the attacker may immediately attempt another free attack agains him, using the exact same pool as the original, "+dd+dd] * 5 + [ + "**Winded**: Until the end of the encounter, the target cannot voluntarily suffer strain to activate any abilities or gain additional maneuvers, "+dd+dd] * 5 + [ + "**Compromised**: Incerase difficulty of all skill checks by one until the end of the encounter, "+dd+dd] * 5 + [ + "**At the brink**: The target suffers 1 strain each time he performs an action, "+dd+dd+dd] * 5 + [ + "**Crippled**: One of the target's limbs (selected by the GM) is crippled until healed or replaced. Increase difficulty of all checks that require use of that limb by one, "+dd+dd+dd] * 5 + [ + "**Maimed**: One of the target's limbs (selected by the GM) is permanently lost. Unless the target has a cybernetic replacement, the target cannot perform actions that would require the use of that limb. All other actions gain "+sd+", "+dd+dd+dd] * 5 + [ + "HI"] * 5 + [ + "**Temporarily Lame**: Until this critical injury is healed, the target cannot perform more than one maneuver during his turn, "+dd+dd+dd] * 5 + [ + "**Blinded**: The target can no longer see. Upgrade the difficulty of all checks twice. Upgrade the difficulty of perception checks three times, "+dd+dd+dd] * 5 + [ + "**Knocked Senseless**: The target is staggered for the remainder of the encounter, "+dd+dd+dd] * 5 + [ + "GI"] * 5 + [ + "**Bleeding Out**: Every round, the target suffers 1 wound and 1 strain at the beginning of his turn. For every five wounds he suffers beyond his wound threshold, he suffers one additional critical injury. (If he suffers this one again, roll again), "+dd+dd+dd+dd] * 10 + [ + "**The End is Nigh**: The target will die after the last initiative slot during the next round, "+dd+dd+dd+dd] * 10 + [ + "**Dead**: U B Dead :("] + + if roll >= len(injuries): + results = injuries[-1] + else: + results = injuries[roll] + + if results == "HI": + characteristic = random.choice(["brawn"] * 3 + ["agility"] * 3 + ["intellect", "cunning", "presence"]) + results = "**Horrific Injury**: Until this criticil injury is healed, treat the target's "+characteristic+" as if it's one lower, "+dd+dd+dd + + if results == "GI": + characteristic = random.choice(["brawn"] * 3 + ["agility"] * 3 + ["intellect", "cunning", "presence"]) + results = "**Gruesome Injury**: The target's "+characteristic+" is permanently one lower, "+dd+dd+dd+dd + + return "Roll: "+str(roll)+"\nInjury:\n"+results + def parseRoll(user : str,cmd : str = ""): cmd = re.sub(' +',' ',cmd.upper()) + " " if cmd[0] == " ": From 4e36070c29502fa5201ce9810616ba1ef7c89b98 Mon Sep 17 00:00:00 2001 From: NikolajDanger Date: Wed, 8 Apr 2020 22:06:51 +0200 Subject: [PATCH 6/9] =?UTF-8?q?=F0=9F=90=8D=20UnitTests=20added=20to=20git?= =?UTF-8?q?ignore?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- gwendolynTest.py | 46 ---------------------------------------------- 1 file changed, 46 deletions(-) delete mode 100644 gwendolynTest.py diff --git a/gwendolynTest.py b/gwendolynTest.py deleted file mode 100644 index 43fe87d..0000000 --- a/gwendolynTest.py +++ /dev/null @@ -1,46 +0,0 @@ -import unittest - -import funcs - -class testSwChar(unittest.TestCase): - def test1NewChar(self): - text1, result = funcs.parseChar("TestUser","") - self.assertEqual(result,"Character for TestUser created") - - def testChangeName(self): - text1, result = funcs.parseChar("TestUser","name TestChar") - self.assertEqual(result,"Changed TestChar's Name to TestChar") - - def testChangeChar(self): - text1, result = funcs.parseChar("TestUser","characteristics brawn 1") - self.assertEqual(result,"Changed New Character's Characteristics") - - def testXChar(self): - text1, result = funcs.parseChar("TestUser","Purge") - self.assertEqual(result,"Character for TestUser deleted") - - -class testGwendolynFuncs(unittest.TestCase): - def testCap(self): - self.assertEqual(funcs.cap("planet of the apes"),"Planet of the Apes") - self.assertEqual(funcs.cap("the greatest showman"),"The Greatest Showman") - self.assertEqual(funcs.cap("i'm the best person!"),"I'm the Best Person!") - - def testWikiExists(self): - title, content, thumbnail = funcs.findWikiPage("Vivo") - self.assertEqual(title,"Vivo (Gud)") - self.assertEqual(content,"Vivo er den Phenolske gud for liv. Hun er en af de tre store guder der kom af at Unua splittede sig i 3.") - - def testWikiDoesntExist(self): - title, content, thumbnail = funcs.findWikiPage("Big Butts") - self.assertEqual(title,"") - self.assertEqual(content,"Couldn't find page") - - def testWikiImage(self): - title, content, thumbnail = funcs.findWikiPage("Moldaw") - self.assertEqual(title,"Moldaw Dragniel") - self.assertEqual(content,"Moldaw Dragniel (Født: Moldaw Geisler Dragniel) er en Rock Gnome fra den sydvestlige del af Zules Kongeriget i kejserriget Crozea. Han kommer fra den store landsby Ginti, hvor hans forældre arbejdede som håndværkere.") - self.assertEqual(thumbnail,"https://vignette.wikia.nocookie.net/senkulpa/images/9/9e/Moldaw.png/revision/latest?path-prefix=da") - -if __name__ == "__main__": - unittest.main() \ No newline at end of file From ceb4dded57692b1bfc205de08bab2122ff037ed7 Mon Sep 17 00:00:00 2001 From: NikolajDanger Date: Wed, 8 Apr 2020 22:08:16 +0200 Subject: [PATCH 7/9] =?UTF-8?q?Revert=20"=F0=9F=90=8D=20UnitTests=20added?= =?UTF-8?q?=20to=20gitignore"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 9b4d10dca207156fd4a557bd3061b28ce90613bd. --- gwendolynTest.py | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 gwendolynTest.py diff --git a/gwendolynTest.py b/gwendolynTest.py new file mode 100644 index 0000000..43fe87d --- /dev/null +++ b/gwendolynTest.py @@ -0,0 +1,46 @@ +import unittest + +import funcs + +class testSwChar(unittest.TestCase): + def test1NewChar(self): + text1, result = funcs.parseChar("TestUser","") + self.assertEqual(result,"Character for TestUser created") + + def testChangeName(self): + text1, result = funcs.parseChar("TestUser","name TestChar") + self.assertEqual(result,"Changed TestChar's Name to TestChar") + + def testChangeChar(self): + text1, result = funcs.parseChar("TestUser","characteristics brawn 1") + self.assertEqual(result,"Changed New Character's Characteristics") + + def testXChar(self): + text1, result = funcs.parseChar("TestUser","Purge") + self.assertEqual(result,"Character for TestUser deleted") + + +class testGwendolynFuncs(unittest.TestCase): + def testCap(self): + self.assertEqual(funcs.cap("planet of the apes"),"Planet of the Apes") + self.assertEqual(funcs.cap("the greatest showman"),"The Greatest Showman") + self.assertEqual(funcs.cap("i'm the best person!"),"I'm the Best Person!") + + def testWikiExists(self): + title, content, thumbnail = funcs.findWikiPage("Vivo") + self.assertEqual(title,"Vivo (Gud)") + self.assertEqual(content,"Vivo er den Phenolske gud for liv. Hun er en af de tre store guder der kom af at Unua splittede sig i 3.") + + def testWikiDoesntExist(self): + title, content, thumbnail = funcs.findWikiPage("Big Butts") + self.assertEqual(title,"") + self.assertEqual(content,"Couldn't find page") + + def testWikiImage(self): + title, content, thumbnail = funcs.findWikiPage("Moldaw") + self.assertEqual(title,"Moldaw Dragniel") + self.assertEqual(content,"Moldaw Dragniel (Født: Moldaw Geisler Dragniel) er en Rock Gnome fra den sydvestlige del af Zules Kongeriget i kejserriget Crozea. Han kommer fra den store landsby Ginti, hvor hans forældre arbejdede som håndværkere.") + self.assertEqual(thumbnail,"https://vignette.wikia.nocookie.net/senkulpa/images/9/9e/Moldaw.png/revision/latest?path-prefix=da") + +if __name__ == "__main__": + unittest.main() \ No newline at end of file From 1619dd03a0f8a5b4d214871d7626c7e6e498124a Mon Sep 17 00:00:00 2001 From: NikolajDanger Date: Wed, 8 Apr 2020 22:10:50 +0200 Subject: [PATCH 8/9] =?UTF-8?q?=F0=9F=90=8D=20UnitTest=20added=20to=20giti?= =?UTF-8?q?gnore?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitignore b/.gitignore index 49dfe07..ed03e5c 100644 --- a/.gitignore +++ b/.gitignore @@ -146,8 +146,11 @@ cython_debug/ # static files generated from Django application using `collectstatic` media static + + .vscode/ token.txt resources/swcharacters.json resources/trivia.json resources/destinyPoints.txt +gwendolynTest.py From fc7871667e1922f090bb3fa08c0f8abeb732dbdd Mon Sep 17 00:00:00 2001 From: NikolajDanger Date: Wed, 8 Apr 2020 22:14:43 +0200 Subject: [PATCH 9/9] =?UTF-8?q?=F0=9F=9A=AB=20GwendolynTest=20removed?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- gwendolynTest.py | 46 ---------------------------------------------- 1 file changed, 46 deletions(-) delete mode 100644 gwendolynTest.py diff --git a/gwendolynTest.py b/gwendolynTest.py deleted file mode 100644 index 43fe87d..0000000 --- a/gwendolynTest.py +++ /dev/null @@ -1,46 +0,0 @@ -import unittest - -import funcs - -class testSwChar(unittest.TestCase): - def test1NewChar(self): - text1, result = funcs.parseChar("TestUser","") - self.assertEqual(result,"Character for TestUser created") - - def testChangeName(self): - text1, result = funcs.parseChar("TestUser","name TestChar") - self.assertEqual(result,"Changed TestChar's Name to TestChar") - - def testChangeChar(self): - text1, result = funcs.parseChar("TestUser","characteristics brawn 1") - self.assertEqual(result,"Changed New Character's Characteristics") - - def testXChar(self): - text1, result = funcs.parseChar("TestUser","Purge") - self.assertEqual(result,"Character for TestUser deleted") - - -class testGwendolynFuncs(unittest.TestCase): - def testCap(self): - self.assertEqual(funcs.cap("planet of the apes"),"Planet of the Apes") - self.assertEqual(funcs.cap("the greatest showman"),"The Greatest Showman") - self.assertEqual(funcs.cap("i'm the best person!"),"I'm the Best Person!") - - def testWikiExists(self): - title, content, thumbnail = funcs.findWikiPage("Vivo") - self.assertEqual(title,"Vivo (Gud)") - self.assertEqual(content,"Vivo er den Phenolske gud for liv. Hun er en af de tre store guder der kom af at Unua splittede sig i 3.") - - def testWikiDoesntExist(self): - title, content, thumbnail = funcs.findWikiPage("Big Butts") - self.assertEqual(title,"") - self.assertEqual(content,"Couldn't find page") - - def testWikiImage(self): - title, content, thumbnail = funcs.findWikiPage("Moldaw") - self.assertEqual(title,"Moldaw Dragniel") - self.assertEqual(content,"Moldaw Dragniel (Født: Moldaw Geisler Dragniel) er en Rock Gnome fra den sydvestlige del af Zules Kongeriget i kejserriget Crozea. Han kommer fra den store landsby Ginti, hvor hans forældre arbejdede som håndværkere.") - self.assertEqual(thumbnail,"https://vignette.wikia.nocookie.net/senkulpa/images/9/9e/Moldaw.png/revision/latest?path-prefix=da") - -if __name__ == "__main__": - unittest.main() \ No newline at end of file