summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2021-08-11 01:14:47 -0300
committerJesusaves <cpntb1@ymail.com>2021-08-11 01:14:47 -0300
commit251f016a921e3346948e0521695d66342cd41d8a (patch)
treea256565ce11e8e6d59b6fe777f1047bbf134132d
parentab6ecd174125c398f892bf52e3a7c4ad96679f58 (diff)
downloadclient-251f016a921e3346948e0521695d66342cd41d8a.tar.gz
client-251f016a921e3346948e0521695d66342cd41d8a.tar.bz2
client-251f016a921e3346948e0521695d66342cd41d8a.tar.xz
client-251f016a921e3346948e0521695d66342cd41d8a.zip
Summoning Protocol, Initial version (working)
Summon is currently hard-coded. Expansion required.
-rw-r--r--game/01_init.rpy1
-rw-r--r--game/battle.rpy6
-rw-r--r--game/quest.rpy10
3 files changed, 16 insertions, 1 deletions
diff --git a/game/01_init.rpy b/game/01_init.rpy
index 1a774bc..4d91263 100644
--- a/game/01_init.rpy
+++ b/game/01_init.rpy
@@ -69,6 +69,7 @@ init -3 python:
ERR_TIMEOUT=104
ERR_NOGEMS=105
ERR_INVFULL=106
+ ERR_SUMMON=108
ERR_OK=200
# All error code library
diff --git a/game/battle.rpy b/game/battle.rpy
index 1d99471..1f207a3 100644
--- a/game/battle.rpy
+++ b/game/battle.rpy
@@ -107,11 +107,15 @@ label combat:
if (do_action == ACT_TURN):
$ response=loadbattle(Battle["party"])
elif (do_action == ACT_SUMMON):
- $ response=Battle
+ $ response=loadsummon()
else:
$ stdout("INVALID ACTION CODE: %d" % do_action)
jump combat
+ # Maybe nothing happened
+ if response == ERR_SUMMON:
+ $ response = Battle
+
# Maybe we error'ed out and should relog
if (response in [FAILUREMSG, OFFLINEMSG, ERR_JSONDECODER, ERR_LOGIN_DEFAULT]):
$ renpy.call_screen("msgbox", "Error:\n\n%s" % response)
diff --git a/game/quest.rpy b/game/quest.rpy
index 2185450..b0af279 100644
--- a/game/quest.rpy
+++ b/game/quest.rpy
@@ -36,6 +36,16 @@ init python:
return ERR_JSONDECODER
return bt
+ def loadsummon():
+ global Battle
+ # FIXME: Retrieve summon ID, etc
+ raw=send_packet("summon", "[1]")
+
+ bt=json_decode(raw)
+ if (bt == ERR_JSONDECODER):
+ return ERR_JSONDECODER
+ return bt
+
###################################################################
# TODO: Quest menus and selections should be auto-generated
# World map structure: ["name", min_level, {quest1}, {quest2} ...]