From 4d972f8eaadf4e92e77335424184cba23f9acc9a Mon Sep 17 00:00:00 2001 From: lickthecheese Date: Mon, 6 Apr 2020 20:17:59 -0400 Subject: [PATCH] you see an egg --- modules/__pycache__/bake.cpython-36.pyc | Bin 1219 -> 2485 bytes modules/bake.py | 63 ++++++++++++++++++++++-- 2 files changed, 58 insertions(+), 5 deletions(-) diff --git a/modules/__pycache__/bake.cpython-36.pyc b/modules/__pycache__/bake.cpython-36.pyc index 56caae94e37a5570741f43fabc04d688823eaa5c..7679c6a8be51c7fb1a0be51714bee6fb01976c8f 100644 GIT binary patch literal 2485 zcma)-&ube;6vt=wx8xsj96PaH2pjhYQAn(|DWnwFw2+dv2NOt1sA&^cJ7a02)vi1< zvSVch1?5&!=)I@h`gat1>>n`Ko^wVeYS}lV**9-z-uE+aZ!av=AN~3B z<4+?({wC*s4)ni(TYUnC5k@nzSG9DHGKaa($)3YJ=0oeUfQ8U{EMhfieMTRUMtur1 z$!_Xl13!Ou{{gM~1x!i0q;w|q8;JWgQ8(Z}Eh(d2r-W+)SM`LF((SqoJjbr~N_Rq; z+avNjjo#jWUW`1zm_GB@$=EBsZlJ>w*0v7wS-4JE^a5f)wCX*z*Jn2ByQ7bujpL(4 z#Yx;s*y+6$!)UwEu^Og5&SH`4BGw%q7l%AQq45+`HL8hN^8KOWTgDanp`G7?>vGKtn(E&_U%U}pyq8qeM=b`nW-JtR^jGie9%ve>eqIKA; zhD?Jx6x7+AW%-@x3#GxkfLk)9(T&t~~utMls$m9F;TdC(0fWI}s^ zEb(87(SqD#!8icTBZyRKjYFu2uYbMfuC^*kr(tLtT)8mW?DvmR=`@Xx zi(#B5xdya)JWhnXX2oha5_2v?oUrmeII#kpI>{k8<;TF^^a4CGj$jQc*U%No8oh_E zHWUPw;C2(-SzHWtJSYZ;@w4$Y@z1MQuNoKRJWi{jSpZ|AeUY;#Mb2d%|9Y8F+SD-^ zyH^xU8L!8Wl?fQnxCRs@L@xR!9OeS4oVnhYBIO9YmWvn~m)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`+?wLGUQPh#oXsfAljX7&=zYRlSRCh%xiEFrW6S=rGsuflnxef_zA5xXq-fm zT-34*N|{zKo5L*DH3CJL2MP|%U}i%FbGeN57HAetNBrNPkEp3nw$Ak1JgWTMQb9{) z8Np-f!>(lKsoA;~vaH;Eb#oP|m?7XI!vR^4M)pt(=OQVHw5EZ A 2: + if len(m) < 2: await message(c, 'i refuse.') return inv = self.db['inv'] @@ -18,17 +19,69 @@ async def bake(self, c, n, m): await self.message(c, 'Dummy thicc you cant bake air!') return inv = self.db['inv'] - its = (inv.find(name=n, item=m)) - supp = len(list(its)) - if supp < 1: + its = (inv.find_one(name=n, item=m)) + if its == None: await self.message(c, 'You dont have any {}'.format(m)) return - await self.message(c, 'You bake one of your {}, and out pops a undefined!'.format(m)) + + # if item has value, use that, else use a okay value + if m in list(self.bakedGoods.keys()): + value = self.bakedGoods[m] + else: + value = 15 + + # consume the item + inv.delete(id=its['id']) + + # oooo randomize what will pop out + value += random.uniform(-15, 15) + + # choose the output + while value not in list(self.bakedPrice.keys()): + value = int(value - 1) + if value < 0: + value = 0 + newitem = self.bakedPrice[value] + + inv.insert(dict(name=n, item=newitem)) + + await self.message(c, 'You bake your {}, and out pops a {}!'.format(m, newitem)) + +async def invsee(self, c, n, m): + if len(m) < 1: + m = n + inv = self.db['inv'] + it = [ i['item'] for i in inv.find(name=m) ] + if len(it) < 1: + await self.message(c, 'you look through your kitchen and see nothing') + else: + await self.message(c, 'you look through your kitchen and see {}'.format(' '.join(it))) async def init(self): self.db = dataset.connect('sqlite:///database.db') self.cmd['bake'] = bake self.cmd['cheat'] = cheat + self.cmd['inv'] = invsee + self.cmd['items'] = invsee + self.cmd['goods'] = invsee + + self.bakedGoods = { + 'cheese': 50, + 'wheat': 1, + 'turd': 0, + 'flour': 10, + 'bread': 30, + 'crispy': 15, + 'tortilla': 35, + 'egg': 20, + 'bird': 32, + 'erotic': 69, + 'phallic': 65, + 'pizza': 34, + 'hairball': 6, + 'cookie': 44 + } + self.bakedPrice = dict((v,k) for k,v in self.bakedGoods.items())