From 672459901d647007927118a89779b1b90d7bc9ff Mon Sep 17 00:00:00 2001 From: Jesusaves Date: Mon, 16 Aug 2021 10:53:01 -0300 Subject: Allow you to switch the summon during combat (this is what the cog does) --- game/01_init.rpy | 2 +- game/02_init.rpy | 2 +- game/ATTRIBUTION | 2 ++ game/gui/battle.rpy | 4 ++-- game/gui/up_off.png | Bin 0 -> 2930 bytes game/gui/up_on.png | Bin 0 -> 3115 bytes game/screens.rpy | 39 +++++++++++++++++++++++++++++++++++++++ 7 files changed, 45 insertions(+), 4 deletions(-) create mode 100644 game/gui/up_off.png create mode 100644 game/gui/up_on.png diff --git a/game/01_init.rpy b/game/01_init.rpy index 84032c8..a04b202 100644 --- a/game/01_init.rpy +++ b/game/01_init.rpy @@ -36,7 +36,7 @@ init -3 python: # Configuration config.autoreload = False config.save_on_mobile_background = False - persistent.release_name = "Christmas" + persistent.release_name = "Diamond Python" if persistent.host is None: persistent.host="spheres.tmw2.org" persistent.serverlist=[["TMW2", "spheres.tmw2.org", 61000]] diff --git a/game/02_init.rpy b/game/02_init.rpy index 2e8a489..3791413 100644 --- a/game/02_init.rpy +++ b/game/02_init.rpy @@ -113,7 +113,7 @@ init -1 python: def GAME_LOADER(): global allunitsbase, allunits, allquests, allstory, allworld, alltaverns - global allnews, tr_uptodate, tr_memcheck, tr_fatality + global allnews, allsummons, tr_uptodate, tr_memcheck, tr_fatality # Wait until everything is up to date while not tr_uptodate: diff --git a/game/ATTRIBUTION b/game/ATTRIBUTION index 2895b76..269de09 100644 --- a/game/ATTRIBUTION +++ b/game/ATTRIBUTION @@ -154,6 +154,8 @@ Where relevant, you must also include a link to https://tmw2.org in your credit. gui/green_btn.png (Melle) (CC0) (Open Game Art) gui/green_btn_hover.png (Melle) (CC0) (Open Game Art) gui/HUD.png (Melle) (CC0) (Open Game Art) + gui/up_off.png (wayfarer boy) (CC0) (Open Game Art) + gui/up_on.png (wayfarer boy) (CC0) (Open Game Art) gui/purple_btn.png (Melle) (CC0) (Open Game Art) gui/purple_btn_hover.png (Melle) (CC0) (Open Game Art) gui/tv_frame.webp (Melle) (CC0) (Open Game Art) diff --git a/game/gui/battle.rpy b/game/gui/battle.rpy index 0a4caa2..7579dce 100644 --- a/game/gui/battle.rpy +++ b/game/gui/battle.rpy @@ -401,7 +401,7 @@ screen battle(): yalign 0.0 # Preferences button null width 20 - imagebutton auto "gfx/gui/cog_%s.png" action ShowMenu('preferences') + imagebutton auto "gfx/gui/cog_%s.png" action ShowMenu('sumconf') null width 20 text "%d " % (Battle["turn"]) text _(" Turn") @@ -427,7 +427,7 @@ screen battle(): insensitive "gfx/gui/summon_none.png" idle "gfx/gui/summon_idle.png" hover "gfx/gui/summon_hover.png" - action ifte(Battle["bp"] > 10 or debug, Return(ACT_SUMMON), None) + action ifte(Battle["bp"] >= allsummons[persistent.summon]["cost"], Return(ACT_SUMMON), None) diff --git a/game/gui/up_off.png b/game/gui/up_off.png new file mode 100644 index 0000000..8e7d50a Binary files /dev/null and b/game/gui/up_off.png differ diff --git a/game/gui/up_on.png b/game/gui/up_on.png new file mode 100644 index 0000000..90db8b5 Binary files /dev/null and b/game/gui/up_on.png differ diff --git a/game/screens.rpy b/game/screens.rpy index 9a3c5e6..e5507a5 100644 --- a/game/screens.rpy +++ b/game/screens.rpy @@ -407,6 +407,10 @@ screen navigation(): ## Help isn't necessary or relevant to mobile devices. textbutton _("Help") action ShowMenu("help") + if not (main_menu or story_mode or hud_interface): + if Player["quest"] >= 5: + textbutton _("Summons") action ShowMenu("sumconf") + if not renpy.ios and not renpy.emscripten: ## The quit button is banned on iOS and unnecessary on Android and @@ -725,6 +729,41 @@ style slot_button_text: properties gui.button_text_properties("slot_button") +## About screen ################################################################ +## +## This screen gives credit and copyright information about the game and Ren'Py. +## +## There's nothing special about this screen, and hence it also serves as an +## example of how to make a custom screen. + +screen sumconf(): + + tag menu + + ## This use statement includes the game_menu screen inside this one. The + ## vbox child is then included inside the viewport inside the game_menu + ## screen. + use game_menu(_("Configure Summon"), scroll="viewport"): + + style_prefix "about" + + vbox: + for i, e in enumerate(allsummons): + if i < Player["max_sum"]: + hbox: + if persistent.summon == i: + image "gui/up_on.png" + else: + button: + action SetVariable("persistent.summon", i) + add "gui/up_off.png" + label _(" %s" % e["name"]) + text _("%s" % e["desc"]) + null height 10 + + text _("\n[config.name!t] [config.version!t] [persistent.release_name!t]") + + ## Preferences screen ########################################################## ## ## The preferences screen allows the player to configure the game to better suit -- cgit v1.2.3-60-g2f50