summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2021-08-07 19:02:06 -0300
committerJesusaves <cpntb1@ymail.com>2021-08-07 19:02:06 -0300
commitb539f1de15fa1ce5a64c653d286aeba1ef389864 (patch)
treeb6380039060b74089ad6c10f69955cd74a2202a2
parent6d1d6054eee5027da3d44cc1bf1a01c069ae404d (diff)
downloadserver-b539f1de15fa1ce5a64c653d286aeba1ef389864.tar.gz
server-b539f1de15fa1ce5a64c653d286aeba1ef389864.tar.bz2
server-b539f1de15fa1ce5a64c653d286aeba1ef389864.tar.xz
server-b539f1de15fa1ce5a64c653d286aeba1ef389864.zip
Protocol update; Allow clients to alter spheres
-rw-r--r--battle/main.py7
1 files 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=[]