summaryrefslogtreecommitdiff
path: root/game
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2020-12-24 20:25:57 -0300
committerJesusaves <cpntb1@ymail.com>2020-12-24 20:25:57 -0300
commit2577c43010c346470fca09d415b2b2a1d6fe2003 (patch)
treeb7be98a49c7a306be467dd6bbfd8b75284c69040 /game
parent8e3fd3eb61c82070bff74135fb45c4d275946fc2 (diff)
downloadclient-2577c43010c346470fca09d415b2b2a1d6fe2003.tar.gz
client-2577c43010c346470fca09d415b2b2a1d6fe2003.tar.bz2
client-2577c43010c346470fca09d415b2b2a1d6fe2003.tar.xz
client-2577c43010c346470fca09d415b2b2a1d6fe2003.zip
Change battle logic to make it a bit more seamless to user.
And hopefully, less error prone?
Diffstat (limited to 'game')
-rw-r--r--game/battle.rpy12
-rw-r--r--game/gui/battle.rpy9
-rw-r--r--game/script.rpy1
3 files changed, 16 insertions, 6 deletions
diff --git a/game/battle.rpy b/game/battle.rpy
index f41886c..44a3aba 100644
--- a/game/battle.rpy
+++ b/game/battle.rpy
@@ -38,6 +38,7 @@ label combat:
# TODO: Swap units support
# TODO: Display Spheres in the right place
$ use_sphere=[AP_NONE, AP_NONE, AP_NONE, AP_NONE, AP_NONE]
+ $ btl_ready = False
python:
try:
renpy.call_screen("battle")
@@ -47,7 +48,10 @@ label combat:
sdelay(0.5)
renpy.jump("combat")
- $stdout("================= call ended")
+ stdout("================= call ended")
+ btl_ready=True
+ renpy.show_screen("battle")
+
# TODO: Send to server new arrangement of units
# Update Battle with server response
@@ -81,7 +85,6 @@ label combat:
# Fight continues
# TODO this is suboptimal, and the loops are also wrong
# Maybe we should get info about what was used and whatnot?
- show screen battle
python:
# TODO: Render sphere usage
# Render enemy damage
@@ -188,6 +191,11 @@ label results:
story=dl_search(allstory, "quest_id", qid)
if (story != ERR_INVALID):
+ try:
+ renpy.hide_screen("battle")
+ except:
+ stdout("Failed to hide screen battle D:")
+ pass
hud_story()
print ".:: Story logs (%d) ::." % qid
diff --git a/game/gui/battle.rpy b/game/gui/battle.rpy
index 533a2aa..e71acae 100644
--- a/game/gui/battle.rpy
+++ b/game/gui/battle.rpy
@@ -157,10 +157,11 @@ screen battle():
xalign 0.5
yalign 0.0
text _("Wave %d/%d" % (Battle["wave"], Battle["max_wave"]))
- hbox:
- xalign 1.0
- yalign 0.0
- textbutton _("I'm ready") action Return()
+ showif not btl_ready:
+ hbox:
+ xalign 1.0
+ yalign 0.0
+ textbutton _("I'm ready") action Return()
####################################################
# Render enemies
diff --git a/game/script.rpy b/game/script.rpy
index 3606a86..1a8e34a 100644
--- a/game/script.rpy
+++ b/game/script.rpy
@@ -187,6 +187,7 @@ label loop:
label restore:
# Restore town view
scene bg town
+ $ renpy.hide_screen("battle")
play music MUSIC_TOWN fadein 0.5
$ hud_show()
jump loop