summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2021-08-11 00:54:45 -0300
committerJesusaves <cpntb1@ymail.com>2021-08-11 00:54:45 -0300
commitab6ecd174125c398f892bf52e3a7c4ad96679f58 (patch)
treeb8cfccc771951d8adf68c13191bb1835e1dbefab
parent2561a1498b907073db0fca8a3b6986a514e0811b (diff)
downloadclient-ab6ecd174125c398f892bf52e3a7c4ad96679f58.tar.gz
client-ab6ecd174125c398f892bf52e3a7c4ad96679f58.tar.bz2
client-ab6ecd174125c398f892bf52e3a7c4ad96679f58.tar.xz
client-ab6ecd174125c398f892bf52e3a7c4ad96679f58.zip
Add the summon button (no protocol-level action yet)
-rw-r--r--game/01_init.rpy7
-rw-r--r--game/ATTRIBUTION3
-rw-r--r--game/battle.rpy14
-rw-r--r--game/gfx/gui/summon_hover.pngbin0 -> 25678 bytes
-rw-r--r--game/gfx/gui/summon_idle.pngbin0 -> 21258 bytes
-rw-r--r--game/gfx/gui/summon_none.pngbin0 -> 14750 bytes
-rw-r--r--game/gui/battle.rpy13
7 files changed, 34 insertions, 3 deletions
diff --git a/game/01_init.rpy b/game/01_init.rpy
index 9b12e74..1a774bc 100644
--- a/game/01_init.rpy
+++ b/game/01_init.rpy
@@ -78,6 +78,11 @@ init -3 python:
MUSIC_OPENING="sfx/bgm01.mp3"
MUSIC_TOWN="sfx/bgm02.mp3"
+ # Battle actions
+ ACT_NONE =0
+ ACT_TURN =1
+ ACT_SUMMON =2
+
# Spheres actions
AP_NONE =False
AP_SPHERE =1
@@ -122,6 +127,8 @@ init -3 python:
SRV_SKILL =1000
SRV_WAVE =9901
SRV_SPHERE =9902
+ SRV_SUMMON =9903
+ SRV_NOCAST =9904
# Special error structs
ERR_MOBSTRUCT ={
diff --git a/game/ATTRIBUTION b/game/ATTRIBUTION
index fed9b6f..4c0e5ae 100644
--- a/game/ATTRIBUTION
+++ b/game/ATTRIBUTION
@@ -96,6 +96,9 @@ Where relevant, you must also include a link to https://tmw2.org in your credit.
gfx/gui/ele_3.png (Chrisdesign) (CC0) (From OpenGameArt)
gfx/gui/ele_4.png (Chrisdesign) (CC0) (From OpenGameArt)
gfx/gui/ele_5.png (Chrisdesign) (CC0) (From OpenGameArt)
+ gfx/gui/summon_none.png (Jesusalva) (CC0) (Chrisdesign/sophokles/wayfarer)
+ gfx/gui/summon_idle.png (Jesusalva) (CC0) (Chrisdesign/sophokles/wayfarer)
+ gfx/gui/summon_hover.png (Jesusalva) (CC0) (Chrisdesign/sophokles/wayfarer)
## MOBS
gfx/mobs/0.png (-) (-) (-)
gfx/mobs/960000.png (Santiago Iborra) (CC BY SA) (Arcmage)
diff --git a/game/battle.rpy b/game/battle.rpy
index 6a0bea2..1d99471 100644
--- a/game/battle.rpy
+++ b/game/battle.rpy
@@ -84,9 +84,10 @@ label combat:
# TODO: Display Spheres in the right place
$ use_sphere=[AP_NONE, AP_NONE, AP_NONE, AP_NONE, AP_NONE]
$ btl_ready = False
+ $ do_action = ACT_NONE
python:
try:
- renpy.call_screen("battle", _with_none=True)
+ do_action = renpy.call_screen("battle", _with_none=True)
except:
traceback.print_exc()
stdout("FAILED to render battle screen, trying again...")
@@ -103,7 +104,13 @@ label combat:
# TODO: Send to server new arrangement of units
# Update Battle with server response
- $ response=loadbattle(Battle["party"])
+ if (do_action == ACT_TURN):
+ $ response=loadbattle(Battle["party"])
+ elif (do_action == ACT_SUMMON):
+ $ response=Battle
+ else:
+ $ stdout("INVALID ACTION CODE: %d" % do_action)
+ jump combat
# Maybe we error'ed out and should relog
if (response in [FAILUREMSG, OFFLINEMSG, ERR_JSONDECODER, ERR_LOGIN_DEFAULT]):
@@ -142,6 +149,9 @@ label combat:
entry[3])
sdelay(0.1)
print("Attacked Battle[%s][%d]" % (entry[4], entry[5]))
+ elif entry[2] == SRV_SUMMON:
+ # FIXME
+ print("Summoned %d to your aid! Show cutscene" % entry[3])
except:
traceback.print_exc()
diff --git a/game/gfx/gui/summon_hover.png b/game/gfx/gui/summon_hover.png
new file mode 100644
index 0000000..6524855
--- /dev/null
+++ b/game/gfx/gui/summon_hover.png
Binary files differ
diff --git a/game/gfx/gui/summon_idle.png b/game/gfx/gui/summon_idle.png
new file mode 100644
index 0000000..d475906
--- /dev/null
+++ b/game/gfx/gui/summon_idle.png
Binary files differ
diff --git a/game/gfx/gui/summon_none.png b/game/gfx/gui/summon_none.png
new file mode 100644
index 0000000..34252cf
--- /dev/null
+++ b/game/gfx/gui/summon_none.png
Binary files differ
diff --git a/game/gui/battle.rpy b/game/gui/battle.rpy
index f43ca65..d2f7f6d 100644
--- a/game/gui/battle.rpy
+++ b/game/gui/battle.rpy
@@ -390,7 +390,18 @@ screen battle():
button:
text _("I'm ready"):
outlines [(1,"#333",0,0)]
- action Return()
+ action Return(ACT_TURN)
+ showif not btl_ready and Player["quest"] >= 5:
+ hbox:
+ xanchor 1.0
+ yanchor 0.0
+ xpos config.screen_width-32
+ ypos 96
+ imagebutton:
+ insensitive "gfx/gui/summon_none.png"
+ idle "gfx/gui/summon_idle.png"
+ hover "gfx/gui/summon_hover.png"
+ action ifte(Battle["bp"] > 10, Return(ACT_SUMMON), None)