| 
									
										
										
										
											2024-03-05 09:59:55 -06:00
										 |  |  | # Small subfile to handle gifting info such as desired traits and giftbox management | 
					
						
							|  |  |  | import typing | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-08-31 06:15:00 -05:00
										 |  |  | if typing.TYPE_CHECKING: | 
					
						
							|  |  |  |     from SNIClient import SNIContext | 
					
						
							| 
									
										
										
										
											2024-03-05 09:59:55 -06:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-08-31 06:15:00 -05:00
										 |  |  | 
 | 
					
						
							|  |  |  | async def update_object(ctx: "SNIContext", key: str, value: typing.Dict[str, typing.Any]) -> None: | 
					
						
							| 
									
										
										
										
											2024-03-05 09:59:55 -06:00
										 |  |  |     await ctx.send_msgs([ | 
					
						
							|  |  |  |         { | 
					
						
							|  |  |  |             "cmd": "Set", | 
					
						
							|  |  |  |             "key": key, | 
					
						
							|  |  |  |             "default": {}, | 
					
						
							|  |  |  |             "want_reply": False, | 
					
						
							|  |  |  |             "operations": [ | 
					
						
							|  |  |  |                 {"operation": "update", "value": value} | 
					
						
							|  |  |  |             ] | 
					
						
							|  |  |  |         } | 
					
						
							|  |  |  |     ]) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-08-31 06:15:00 -05:00
										 |  |  | async def pop_object(ctx: "SNIContext", key: str, value: str) -> None: | 
					
						
							| 
									
										
										
										
											2024-03-05 09:59:55 -06:00
										 |  |  |     await ctx.send_msgs([ | 
					
						
							|  |  |  |         { | 
					
						
							|  |  |  |             "cmd": "Set", | 
					
						
							|  |  |  |             "key": key, | 
					
						
							|  |  |  |             "default": {}, | 
					
						
							|  |  |  |             "want_reply": False, | 
					
						
							|  |  |  |             "operations": [ | 
					
						
							|  |  |  |                 {"operation": "pop", "value": value} | 
					
						
							|  |  |  |             ] | 
					
						
							|  |  |  |         } | 
					
						
							|  |  |  |     ]) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-08-31 06:15:00 -05:00
										 |  |  | async def initialize_giftboxes(ctx: "SNIContext", giftbox_key: str, motherbox_key: str, is_open: bool) -> None: | 
					
						
							| 
									
										
										
										
											2024-03-05 09:59:55 -06:00
										 |  |  |     ctx.set_notify(motherbox_key, giftbox_key) | 
					
						
							|  |  |  |     await update_object(ctx, f"Giftboxes;{ctx.team}", {f"{ctx.slot}": | 
					
						
							| 
									
										
										
										
											2024-08-31 06:15:00 -05:00
										 |  |  |                                                        { | 
					
						
							| 
									
										
										
										
											2025-06-16 12:00:47 -05:00
										 |  |  |                                                            "is_open": is_open, | 
					
						
							| 
									
										
										
										
											2024-08-31 06:15:00 -05:00
										 |  |  |                                                            **kdl3_gifting_options | 
					
						
							|  |  |  |                                                        }}) | 
					
						
							| 
									
										
										
										
											2025-06-16 12:00:47 -05:00
										 |  |  |     await update_object(ctx, f"Giftbox;{ctx.team};{ctx.slot}", {}) | 
					
						
							| 
									
										
										
										
											2024-08-31 06:15:00 -05:00
										 |  |  |     ctx.client_handler.gifting = is_open | 
					
						
							| 
									
										
										
										
											2024-03-05 09:59:55 -06:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | kdl3_gifting_options = { | 
					
						
							| 
									
										
										
										
											2025-06-16 12:00:47 -05:00
										 |  |  |     "accepts_any_gift": True, | 
					
						
							|  |  |  |     "desired_traits": [ | 
					
						
							| 
									
										
										
										
											2024-03-05 09:59:55 -06:00
										 |  |  |         "Consumable", "Food", "Drink", "Candy", "Tomato", | 
					
						
							|  |  |  |         "Invincible", "Life", "Heal", "Health", "Trap", | 
					
						
							|  |  |  |         "Goo", "Gel", "Slow", "Slowness", "Eject", "Removal" | 
					
						
							|  |  |  |     ], | 
					
						
							| 
									
										
										
										
											2025-06-16 12:00:47 -05:00
										 |  |  |     "minimum_gift_version": 3, | 
					
						
							| 
									
										
										
										
											2024-03-05 09:59:55 -06:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | kdl3_gifts = { | 
					
						
							|  |  |  |     1: { | 
					
						
							| 
									
										
										
										
											2025-06-16 12:00:47 -05:00
										 |  |  |         "item_name": "1-Up", | 
					
						
							|  |  |  |         "amount": 1, | 
					
						
							|  |  |  |         "item_value": 400000, | 
					
						
							|  |  |  |         "traits": [ | 
					
						
							| 
									
										
										
										
											2024-03-05 09:59:55 -06:00
										 |  |  |             { | 
					
						
							| 
									
										
										
										
											2025-06-16 12:00:47 -05:00
										 |  |  |                 "trait": "Consumable", | 
					
						
							|  |  |  |                 "quality": 1, | 
					
						
							|  |  |  |                 "duration": 1, | 
					
						
							| 
									
										
										
										
											2024-03-05 09:59:55 -06:00
										 |  |  |             }, | 
					
						
							|  |  |  |             { | 
					
						
							| 
									
										
										
										
											2025-06-16 12:00:47 -05:00
										 |  |  |                 "trait": "Life", | 
					
						
							|  |  |  |                 "quality": 1, | 
					
						
							|  |  |  |                 "duration": 1 | 
					
						
							| 
									
										
										
										
											2024-03-05 09:59:55 -06:00
										 |  |  |             } | 
					
						
							|  |  |  |         ] | 
					
						
							|  |  |  |     }, | 
					
						
							|  |  |  |     2: { | 
					
						
							| 
									
										
										
										
											2025-06-16 12:00:47 -05:00
										 |  |  |         "item_name": "Maxim Tomato", | 
					
						
							|  |  |  |         "amount": 1, | 
					
						
							|  |  |  |         "item_value": 500000, | 
					
						
							|  |  |  |         "traits": [ | 
					
						
							| 
									
										
										
										
											2024-03-05 09:59:55 -06:00
										 |  |  |             { | 
					
						
							| 
									
										
										
										
											2025-06-16 12:00:47 -05:00
										 |  |  |                 "trait": "Consumable", | 
					
						
							|  |  |  |                 "quality": 5, | 
					
						
							|  |  |  |                 "duration": 1, | 
					
						
							| 
									
										
										
										
											2024-03-05 09:59:55 -06:00
										 |  |  |             }, | 
					
						
							|  |  |  |             { | 
					
						
							| 
									
										
										
										
											2025-06-16 12:00:47 -05:00
										 |  |  |                 "trait": "Heal", | 
					
						
							|  |  |  |                 "quality": 5, | 
					
						
							|  |  |  |                 "duration": 1, | 
					
						
							| 
									
										
										
										
											2024-03-05 09:59:55 -06:00
										 |  |  |             }, | 
					
						
							|  |  |  |             { | 
					
						
							| 
									
										
										
										
											2025-06-16 12:00:47 -05:00
										 |  |  |                 "trait": "Food", | 
					
						
							|  |  |  |                 "quality": 5, | 
					
						
							|  |  |  |                 "duration": 1, | 
					
						
							| 
									
										
										
										
											2024-03-05 09:59:55 -06:00
										 |  |  |             }, | 
					
						
							|  |  |  |             { | 
					
						
							| 
									
										
										
										
											2025-06-16 12:00:47 -05:00
										 |  |  |                 "trait": "Tomato", | 
					
						
							|  |  |  |                 "quality": 5, | 
					
						
							|  |  |  |                 "duration": 1, | 
					
						
							| 
									
										
										
										
											2024-03-05 09:59:55 -06:00
										 |  |  |             }, | 
					
						
							|  |  |  |             { | 
					
						
							| 
									
										
										
										
											2025-06-16 12:00:47 -05:00
										 |  |  |                 "trait": "Vegetable", | 
					
						
							|  |  |  |                 "quality": 5, | 
					
						
							|  |  |  |                 "duration": 1, | 
					
						
							| 
									
										
										
										
											2024-03-05 09:59:55 -06:00
										 |  |  |             } | 
					
						
							|  |  |  |         ] | 
					
						
							|  |  |  |     }, | 
					
						
							|  |  |  |     3: { | 
					
						
							| 
									
										
										
										
											2025-06-16 12:00:47 -05:00
										 |  |  |         "item_name": "Energy Drink", | 
					
						
							|  |  |  |         "amount": 1, | 
					
						
							|  |  |  |         "item_value": 100000, | 
					
						
							|  |  |  |         "traits": [ | 
					
						
							| 
									
										
										
										
											2024-03-05 09:59:55 -06:00
										 |  |  |             { | 
					
						
							| 
									
										
										
										
											2025-06-16 12:00:47 -05:00
										 |  |  |                 "trait": "Consumable", | 
					
						
							|  |  |  |                 "quality": 1, | 
					
						
							|  |  |  |                 "duration": 1, | 
					
						
							| 
									
										
										
										
											2024-03-05 09:59:55 -06:00
										 |  |  |             }, | 
					
						
							|  |  |  |             { | 
					
						
							| 
									
										
										
										
											2025-06-16 12:00:47 -05:00
										 |  |  |                 "trait": "Heal", | 
					
						
							|  |  |  |                 "quality": 1, | 
					
						
							|  |  |  |                 "duration": 1, | 
					
						
							| 
									
										
										
										
											2024-03-05 09:59:55 -06:00
										 |  |  |             }, | 
					
						
							|  |  |  |             { | 
					
						
							| 
									
										
										
										
											2025-06-16 12:00:47 -05:00
										 |  |  |                 "trait": "Drink", | 
					
						
							|  |  |  |                 "quality": 1, | 
					
						
							|  |  |  |                 "duration": 1, | 
					
						
							| 
									
										
										
										
											2024-03-05 09:59:55 -06:00
										 |  |  |             }, | 
					
						
							|  |  |  |         ] | 
					
						
							|  |  |  |     }, | 
					
						
							|  |  |  |     5: { | 
					
						
							| 
									
										
										
										
											2025-06-16 12:00:47 -05:00
										 |  |  |         "item_name": "Small Star Piece", | 
					
						
							|  |  |  |         "amount": 1, | 
					
						
							|  |  |  |         "item_value": 10000, | 
					
						
							|  |  |  |         "traits": [ | 
					
						
							| 
									
										
										
										
											2024-03-05 09:59:55 -06:00
										 |  |  |             { | 
					
						
							| 
									
										
										
										
											2025-06-16 12:00:47 -05:00
										 |  |  |                 "trait": "Currency", | 
					
						
							|  |  |  |                 "quality": 1, | 
					
						
							|  |  |  |                 "duration": 1, | 
					
						
							| 
									
										
										
										
											2024-03-05 09:59:55 -06:00
										 |  |  |             }, | 
					
						
							|  |  |  |             { | 
					
						
							| 
									
										
										
										
											2025-06-16 12:00:47 -05:00
										 |  |  |                 "trait": "Money", | 
					
						
							|  |  |  |                 "quality": 1, | 
					
						
							|  |  |  |                 "duration": 1, | 
					
						
							| 
									
										
										
										
											2024-03-05 09:59:55 -06:00
										 |  |  |             }, | 
					
						
							|  |  |  |             { | 
					
						
							| 
									
										
										
										
											2025-06-16 12:00:47 -05:00
										 |  |  |                 "trait": "Star", | 
					
						
							|  |  |  |                 "quality": 1, | 
					
						
							|  |  |  |                 "duration": 1 | 
					
						
							| 
									
										
										
										
											2024-03-05 09:59:55 -06:00
										 |  |  |             } | 
					
						
							|  |  |  |         ] | 
					
						
							|  |  |  |     }, | 
					
						
							|  |  |  |     6: { | 
					
						
							| 
									
										
										
										
											2025-06-16 12:00:47 -05:00
										 |  |  |         "item_name": "Medium Star Piece", | 
					
						
							|  |  |  |         "amount": 1, | 
					
						
							|  |  |  |         "item_value": 30000, | 
					
						
							|  |  |  |         "traits": [ | 
					
						
							| 
									
										
										
										
											2024-03-05 09:59:55 -06:00
										 |  |  |             { | 
					
						
							| 
									
										
										
										
											2025-06-16 12:00:47 -05:00
										 |  |  |                 "trait": "Currency", | 
					
						
							|  |  |  |                 "quality": 3, | 
					
						
							|  |  |  |                 "duration": 1, | 
					
						
							| 
									
										
										
										
											2024-03-05 09:59:55 -06:00
										 |  |  |             }, | 
					
						
							|  |  |  |             { | 
					
						
							| 
									
										
										
										
											2025-06-16 12:00:47 -05:00
										 |  |  |                 "trait": "Money", | 
					
						
							|  |  |  |                 "quality": 3, | 
					
						
							|  |  |  |                 "duration": 1, | 
					
						
							| 
									
										
										
										
											2024-03-05 09:59:55 -06:00
										 |  |  |             }, | 
					
						
							|  |  |  |             { | 
					
						
							| 
									
										
										
										
											2025-06-16 12:00:47 -05:00
										 |  |  |                 "trait": "Star", | 
					
						
							|  |  |  |                 "quality": 3, | 
					
						
							|  |  |  |                 "duration": 1 | 
					
						
							| 
									
										
										
										
											2024-03-05 09:59:55 -06:00
										 |  |  |             } | 
					
						
							|  |  |  |         ] | 
					
						
							|  |  |  |     }, | 
					
						
							|  |  |  |     7: { | 
					
						
							| 
									
										
										
										
											2025-06-16 12:00:47 -05:00
										 |  |  |         "item_name": "Large Star Piece", | 
					
						
							|  |  |  |         "amount": 1, | 
					
						
							|  |  |  |         "item_value": 50000, | 
					
						
							|  |  |  |         "traits": [ | 
					
						
							| 
									
										
										
										
											2024-03-05 09:59:55 -06:00
										 |  |  |             { | 
					
						
							| 
									
										
										
										
											2025-06-16 12:00:47 -05:00
										 |  |  |                 "trait": "Currency", | 
					
						
							|  |  |  |                 "quality": 5, | 
					
						
							|  |  |  |                 "duration": 1, | 
					
						
							| 
									
										
										
										
											2024-03-05 09:59:55 -06:00
										 |  |  |             }, | 
					
						
							|  |  |  |             { | 
					
						
							| 
									
										
										
										
											2025-06-16 12:00:47 -05:00
										 |  |  |                 "trait": "Money", | 
					
						
							|  |  |  |                 "quality": 5, | 
					
						
							|  |  |  |                 "duration": 1, | 
					
						
							| 
									
										
										
										
											2024-03-05 09:59:55 -06:00
										 |  |  |             }, | 
					
						
							|  |  |  |             { | 
					
						
							| 
									
										
										
										
											2025-06-16 12:00:47 -05:00
										 |  |  |                 "trait": "Star", | 
					
						
							|  |  |  |                 "quality": 5, | 
					
						
							|  |  |  |                 "duration": 1 | 
					
						
							| 
									
										
										
										
											2024-03-05 09:59:55 -06:00
										 |  |  |             } | 
					
						
							|  |  |  |         ] | 
					
						
							|  |  |  |     }, | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | kdl3_trap_gifts = { | 
					
						
							|  |  |  |     0: { | 
					
						
							| 
									
										
										
										
											2025-06-16 12:00:47 -05:00
										 |  |  |         "item_name": "Gooey Bag", | 
					
						
							|  |  |  |         "amount": 1, | 
					
						
							|  |  |  |         "item_value": 10000, | 
					
						
							|  |  |  |         "traits": [ | 
					
						
							| 
									
										
										
										
											2024-03-05 09:59:55 -06:00
										 |  |  |             { | 
					
						
							| 
									
										
										
										
											2025-06-16 12:00:47 -05:00
										 |  |  |                 "trait": "Trap", | 
					
						
							|  |  |  |                 "quality": 1, | 
					
						
							|  |  |  |                 "duration": 1, | 
					
						
							| 
									
										
										
										
											2024-03-05 09:59:55 -06:00
										 |  |  |             }, | 
					
						
							|  |  |  |             { | 
					
						
							| 
									
										
										
										
											2025-06-16 12:00:47 -05:00
										 |  |  |                 "trait": "Goo", | 
					
						
							|  |  |  |                 "quality": 1, | 
					
						
							|  |  |  |                 "duration": 1, | 
					
						
							| 
									
										
										
										
											2024-03-05 09:59:55 -06:00
										 |  |  |             }, | 
					
						
							|  |  |  |             { | 
					
						
							| 
									
										
										
										
											2025-06-16 12:00:47 -05:00
										 |  |  |                 "trait": "Gel", | 
					
						
							|  |  |  |                 "quality": 1, | 
					
						
							|  |  |  |                 "duration": 1 | 
					
						
							| 
									
										
										
										
											2024-03-05 09:59:55 -06:00
										 |  |  |             } | 
					
						
							|  |  |  |         ] | 
					
						
							|  |  |  |     }, | 
					
						
							|  |  |  |     1: { | 
					
						
							| 
									
										
										
										
											2025-06-16 12:00:47 -05:00
										 |  |  |         "item_name": "Slowness", | 
					
						
							|  |  |  |         "amount": 1, | 
					
						
							|  |  |  |         "item_value": 10000, | 
					
						
							|  |  |  |         "traits": [ | 
					
						
							| 
									
										
										
										
											2024-03-05 09:59:55 -06:00
										 |  |  |             { | 
					
						
							| 
									
										
										
										
											2025-06-16 12:00:47 -05:00
										 |  |  |                 "trait": "Trap", | 
					
						
							|  |  |  |                 "quality": 1, | 
					
						
							|  |  |  |                 "duration": 1, | 
					
						
							| 
									
										
										
										
											2024-03-05 09:59:55 -06:00
										 |  |  |             }, | 
					
						
							|  |  |  |             { | 
					
						
							| 
									
										
										
										
											2025-06-16 12:00:47 -05:00
										 |  |  |                 "trait": "Slow", | 
					
						
							|  |  |  |                 "quality": 1, | 
					
						
							|  |  |  |                 "duration": 1, | 
					
						
							| 
									
										
										
										
											2024-03-05 09:59:55 -06:00
										 |  |  |             }, | 
					
						
							|  |  |  |             { | 
					
						
							| 
									
										
										
										
											2025-06-16 12:00:47 -05:00
										 |  |  |                 "trait": "Slowness", | 
					
						
							|  |  |  |                 "quality": 1, | 
					
						
							|  |  |  |                 "duration": 1 | 
					
						
							| 
									
										
										
										
											2024-03-05 09:59:55 -06:00
										 |  |  |             } | 
					
						
							|  |  |  |         ] | 
					
						
							|  |  |  |     }, | 
					
						
							|  |  |  |     2: { | 
					
						
							| 
									
										
										
										
											2025-06-16 12:00:47 -05:00
										 |  |  |         "item_name": "Eject Ability", | 
					
						
							|  |  |  |         "amount": 1, | 
					
						
							|  |  |  |         "item_value": 10000, | 
					
						
							|  |  |  |         "traits": [ | 
					
						
							| 
									
										
										
										
											2024-03-05 09:59:55 -06:00
										 |  |  |             { | 
					
						
							| 
									
										
										
										
											2025-06-16 12:00:47 -05:00
										 |  |  |                 "trait": "Trap", | 
					
						
							|  |  |  |                 "quality": 1, | 
					
						
							|  |  |  |                 "duration": 1, | 
					
						
							| 
									
										
										
										
											2024-03-05 09:59:55 -06:00
										 |  |  |             }, | 
					
						
							|  |  |  |             { | 
					
						
							| 
									
										
										
										
											2025-06-16 12:00:47 -05:00
										 |  |  |                 "trait": "Eject", | 
					
						
							|  |  |  |                 "quality": 1, | 
					
						
							|  |  |  |                 "duration": 1, | 
					
						
							| 
									
										
										
										
											2024-03-05 09:59:55 -06:00
										 |  |  |             }, | 
					
						
							|  |  |  |             { | 
					
						
							| 
									
										
										
										
											2025-06-16 12:00:47 -05:00
										 |  |  |                 "trait": "Removal", | 
					
						
							|  |  |  |                 "quality": 1, | 
					
						
							|  |  |  |                 "duration": 1 | 
					
						
							| 
									
										
										
										
											2024-03-05 09:59:55 -06:00
										 |  |  |             } | 
					
						
							|  |  |  |         ] | 
					
						
							|  |  |  |     }, | 
					
						
							|  |  |  |     3: { | 
					
						
							| 
									
										
										
										
											2025-06-16 12:00:47 -05:00
										 |  |  |         "item_name": "Bad Meal", | 
					
						
							|  |  |  |         "amount": 1, | 
					
						
							|  |  |  |         "item_value": 10000, | 
					
						
							|  |  |  |         "traits": [ | 
					
						
							| 
									
										
										
										
											2024-03-05 09:59:55 -06:00
										 |  |  |             { | 
					
						
							| 
									
										
										
										
											2025-06-16 12:00:47 -05:00
										 |  |  |                 "trait": "Trap", | 
					
						
							|  |  |  |                 "quality": 1, | 
					
						
							|  |  |  |                 "duration": 1, | 
					
						
							| 
									
										
										
										
											2024-03-05 09:59:55 -06:00
										 |  |  |             }, | 
					
						
							|  |  |  |             { | 
					
						
							| 
									
										
										
										
											2025-06-16 12:00:47 -05:00
										 |  |  |                 "trait": "Damage", | 
					
						
							|  |  |  |                 "quality": 1, | 
					
						
							|  |  |  |                 "duration": 1, | 
					
						
							| 
									
										
										
										
											2024-03-05 09:59:55 -06:00
										 |  |  |             }, | 
					
						
							|  |  |  |             { | 
					
						
							| 
									
										
										
										
											2025-06-16 12:00:47 -05:00
										 |  |  |                 "trait": "Food", | 
					
						
							|  |  |  |                 "quality": 1, | 
					
						
							|  |  |  |                 "duration": 1 | 
					
						
							| 
									
										
										
										
											2024-03-05 09:59:55 -06:00
										 |  |  |             } | 
					
						
							|  |  |  |         ] | 
					
						
							|  |  |  |     }, | 
					
						
							|  |  |  | } |