summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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} ...]