diff options
author | Jesusaves <cpntb1@ymail.com> | 2020-12-24 20:25:57 -0300 |
---|---|---|
committer | Jesusaves <cpntb1@ymail.com> | 2020-12-24 20:25:57 -0300 |
commit | 2577c43010c346470fca09d415b2b2a1d6fe2003 (patch) | |
tree | b7be98a49c7a306be467dd6bbfd8b75284c69040 | |
parent | 8e3fd3eb61c82070bff74135fb45c4d275946fc2 (diff) | |
download | client-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?
-rw-r--r-- | game/battle.rpy | 12 | ||||
-rw-r--r-- | game/gui/battle.rpy | 9 | ||||
-rw-r--r-- | game/script.rpy | 1 |
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 |