From b539f1de15fa1ce5a64c653d286aeba1ef389864 Mon Sep 17 00:00:00 2001 From: Jesusaves Date: Sat, 7 Aug 2021 19:02:06 -0300 Subject: Protocol update; Allow clients to alter spheres --- battle/main.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/battle/main.py b/battle/main.py index 19a558b..d104db8 100644 --- a/battle/main.py +++ b/battle/main.py @@ -28,6 +28,7 @@ from battle.common import (find_target, calc_dmg, conditions, advance_wave, from battle.spheres import sphere_attack #from battle.summons import summon # <-- Protocol? #from battle.skills import skill_core, handle_skill # <-- WIP +from copy import copy # Prepare a randomness seed random.seed() @@ -175,6 +176,8 @@ def battle(args, token): tmp=len(bt["unit"]) #stdout("vu: %d" % tmp) tmp=len(bt["sphere"]) + #stdout("vu: %d" % tmp) + tmp=len(bt["action"]) #stdout("vs: %d" % tmp) tmp=int(Player[token]["quest"]) # FIXME #stdout("ptq: %d pts: %d" % (tmp, Player[token]["status"])) @@ -196,11 +199,9 @@ def battle(args, token): """ # Check if all spheres you've told us are valid # FIXME: bt["sphere"] should be bt["action"] - """ if sorted(bt["sphere"]) != sorted(Battle[token]["spheres"]): stdout("Spheres differ: %s != %s" % (str(sorted(bt["sphere"])), str(sorted(Battle[token]["spheres"])))) raise Exception("Different spheres") - """ except: # Invalid data traceback.print_exc() @@ -208,6 +209,8 @@ def battle(args, token): ####################################### # Reorder your party based on your request. We already know its valid + Battle[token]["spheres"] = copy(bt["sphere"]) + bt["sphere"] = bt["action"] """ tmp=[] -- cgit v1.2.3-60-g2f50