summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2020-12-31 11:16:43 -0300
committerJesusaves <cpntb1@ymail.com>2020-12-31 11:16:43 -0300
commit09e6c79cef45b42c54cab44bb54f36265c3fbdca (patch)
tree614d0d9ae54b185d084cd2431bfb33af378cd461
parent8f3f73983c5cc90d595684b200e28aad285daeba (diff)
downloadclient-09e6c79cef45b42c54cab44bb54f36265c3fbdca.tar.gz
client-09e6c79cef45b42c54cab44bb54f36265c3fbdca.tar.bz2
client-09e6c79cef45b42c54cab44bb54f36265c3fbdca.tar.xz
client-09e6c79cef45b42c54cab44bb54f36265c3fbdca.zip
Add support for custom battle backgrounds
-rw-r--r--game/battle.rpy2
-rw-r--r--game/gui/battle.rpy2
-rw-r--r--game/quest.rpy1
-rw-r--r--game/script.rpy7
4 files changed, 10 insertions, 2 deletions
diff --git a/game/battle.rpy b/game/battle.rpy
index 731682e..02ac498 100644
--- a/game/battle.rpy
+++ b/game/battle.rpy
@@ -31,7 +31,7 @@ label combat:
# Implement combat view
$stdout("================= prepare for combat")
$ hud_clear()
- $ show_img("bg battle", False)
+ $ show_img("bg %s" % TMP_BACKG, False)
scene bg battle
# Load variables
python:
diff --git a/game/gui/battle.rpy b/game/gui/battle.rpy
index f180c1c..7f77bd9 100644
--- a/game/gui/battle.rpy
+++ b/game/gui/battle.rpy
@@ -338,7 +338,7 @@ screen battle_bars():
screen battle():
# Background and append all three battle sub-screens
# FIXME Our custom displayables are not 100.00% reliable
- add "bg battle"
+ add "bg %s" % TMP_BACKG
use battle_mobs
use battle_core
use battle_bars
diff --git a/game/quest.rpy b/game/quest.rpy
index 4ba1185..6bb7caf 100644
--- a/game/quest.rpy
+++ b/game/quest.rpy
@@ -165,6 +165,7 @@ label quest_selected:
# Okay, story-telling time is over: To arms!
#
$ TMP_MUSIC=get_sfx(quest["music"])
+ $ TMP_BACKG=quest["bg"]
#$ print("Stage music: "+str(TMP_MUSIC))
play music TMP_MUSIC fadein 0.5
#play music MUSIC_BATTLE.id() fadein 0.5
diff --git a/game/script.rpy b/game/script.rpy
index 4bd7081..946db3b 100644
--- a/game/script.rpy
+++ b/game/script.rpy
@@ -135,6 +135,13 @@ label loop:
$ renpy.call_screen("msgbox", "{b}Battle{/b}\n\nYou are in battle. You'll be brought back to combat.")
#window show None
$ Battle=reload_battle()
+ python:
+ try:
+ TMP_BACKG=dl_search(allquests[Battle["world"]], "quest_id", Battle["quest_id"])["bg"]
+ except:
+ traceback.print_exec()
+ stdout("Invalid background for reloaded battle")
+ pass
# TODO: Handle errors
if (Battle in [ERR_JSONDECODER]):
e "Unknown Error: [ERR_JSONDECODER]"