diff options
author | Jesusaves <cpntb1@ymail.com> | 2020-12-22 13:29:39 -0300 |
---|---|---|
committer | Jesusaves <cpntb1@ymail.com> | 2020-12-22 13:29:39 -0300 |
commit | 156f980e4f7f535f573aa3441f3623ecfe884f23 (patch) | |
tree | b4a4704e2917f87ecd65bd72109fe8490eb41b63 /game | |
parent | 643ca7d391728f28012e2ccbd57a0b85c09beb2d (diff) | |
download | client-156f980e4f7f535f573aa3441f3623ecfe884f23.tar.gz client-156f980e4f7f535f573aa3441f3623ecfe884f23.tar.bz2 client-156f980e4f7f535f573aa3441f3623ecfe884f23.tar.xz client-156f980e4f7f535f573aa3441f3623ecfe884f23.zip |
Initial tavern redesign (not fully operational yet)
Diffstat (limited to 'game')
-rw-r--r-- | game/02_init.rpy | 3 | ||||
-rw-r--r-- | game/ATTRIBUTION | 5 | ||||
-rw-r--r-- | game/gui/green_btn.png | bin | 0 -> 40509 bytes | |||
-rw-r--r-- | game/gui/green_btn_hover.png | bin | 0 -> 44841 bytes | |||
-rw-r--r-- | game/gui/purple_btn.png | bin | 0 -> 15252 bytes | |||
-rw-r--r-- | game/gui/purple_btn_hover.png | bin | 0 -> 16621 bytes | |||
-rw-r--r-- | game/gui/tv_frame.webp | bin | 0 -> 5124 bytes | |||
-rw-r--r-- | game/recruit.rpy | 225 | ||||
-rw-r--r-- | game/screens.rpy | 2 |
9 files changed, 233 insertions, 2 deletions
diff --git a/game/02_init.rpy b/game/02_init.rpy index c2c5629..9fc0663 100644 --- a/game/02_init.rpy +++ b/game/02_init.rpy @@ -119,6 +119,7 @@ init -1 python: while not tr_uptodate: sdelay() + # FIXME: Error handling # Load unit data #allunitsbase=json.loads(requests.get("http://"+HOST+'/units.json').text) f=open(get_path_if_exists("units.json"), "r") @@ -132,7 +133,7 @@ init -1 python: # Load summons data f=open(get_path_if_exists("summons.json"), "r") - allworld=json.load(f) + allsummons=json.load(f) f.close() # Load quest data diff --git a/game/ATTRIBUTION b/game/ATTRIBUTION index b555dbf..8e3ffbc 100644 --- a/game/ATTRIBUTION +++ b/game/ATTRIBUTION @@ -123,7 +123,12 @@ Where relevant, you must also include a link to https://tmw2.org in your credit. # GUI gui/elegant.png (?) (CC0) (Open Game Art) + 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/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) gui/WideBB_insensitive.png (Jesusalva) (CC0) ***All other assets are default Ren'Py assets (MIT)*** diff --git a/game/gui/green_btn.png b/game/gui/green_btn.png Binary files differnew file mode 100644 index 0000000..c4e327c --- /dev/null +++ b/game/gui/green_btn.png diff --git a/game/gui/green_btn_hover.png b/game/gui/green_btn_hover.png Binary files differnew file mode 100644 index 0000000..4725285 --- /dev/null +++ b/game/gui/green_btn_hover.png diff --git a/game/gui/purple_btn.png b/game/gui/purple_btn.png Binary files differnew file mode 100644 index 0000000..3b6d6ff --- /dev/null +++ b/game/gui/purple_btn.png diff --git a/game/gui/purple_btn_hover.png b/game/gui/purple_btn_hover.png Binary files differnew file mode 100644 index 0000000..9b9abad --- /dev/null +++ b/game/gui/purple_btn_hover.png diff --git a/game/gui/tv_frame.webp b/game/gui/tv_frame.webp Binary files differnew file mode 100644 index 0000000..fc4a70c --- /dev/null +++ b/game/gui/tv_frame.webp diff --git a/game/recruit.rpy b/game/recruit.rpy new file mode 100644 index 0000000..a12837e --- /dev/null +++ b/game/recruit.rpy @@ -0,0 +1,225 @@ +######################################################################################## +# This file is part of Spheres. +# Copyright (C) 2019 Jesusalva + +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. + +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. + +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +######################################################################################## +# Recruits +init python: + import json + def recruit(t, a): + global Player + raw=send_packet("recruit", recruitdata(t, a)) + + rc=json_decode(raw) + try: + return int(rc) + except: + pass + + # Update data + try: + Player[rc["currency"][0]]=rc["currency"][1] + except: + renpy.notify("ERROR, Currency is undefined.") + + for unit in rc["units"]: + _window_hide(None) + if (debug): + print str(unit) + idx=inventoryplace() + unit["unit_id"]=int(unit["unit_id"]) + if (debug): + print "Recruit index: %d" % idx + print "Player inventory: %s" % str(Player["inv"]) + print "Unit ID: %s" % str(unit["unit_id"]) + print "Unit Name: %s" % str(allunits[int(unit["unit_id"])]["name"]) + print "Unit Rarity: %d" % allunits[int(unit["unit_id"])]["rare"] + Player["inv"][idx]=unit + txt=allunits[int(unit["unit_id"])]["name"] + rar=allunits[int(unit["unit_id"])]["rare"] + star=star_write(rar) + sprite=str(unit["unit_id"]) + show_img("unit_"+sprite, at_list=[truecenter]) + renpy.pause(0.1) + renpy.call_screen("msgbox", "%s\n\nRecruited %d★ %s" % (star, rar, txt)) + renpy.hide("unit_"+sprite) + _window_show(None) + + # Return result + if (rc["code"] == ERR_NOGEMS): + renpy.notify("You don't have enough gems to complete.") + if (rc["code"] == ERR_INVFULL): + renpy.notify("You don't have enough space to complete!") + + return rc["code"] + + +label tavern: + $ show_img("bg tavern", False, ext=".jpg") # Validate + scene bg tavern + play music MUSIC_PARTY.id() fadein 0.5 + window hide + #alltaverns + + jump tv_loop + +screen tavern(): + default tavern = 0 + fixed: + #xmargin 50 + #ymargin 50 + #xalign 0.5 + #ypos 0.9 + #yanchor 1.0 + xfill True + yfill True + frame: + background "gui/tv_frame.webp" + xalign 0.5 + #yanchor 1.0 + #ypos 0.9 + yalign 0.5 + xmaximum 615 + xminimum 615 + ymaximum 1000 + yminimum 1000 + vbox: + box_wrap True + xoffset 50 + yoffset 50 + + if alltaverns[tavern]["banner"] != "": + label _("Insert banner") + else: + label _("No banner") + + label alltaverns[tavern]["details"] + null: + height 32 + label _("%d %s the draw!" % (alltaverns[tavern]["price"], alltaverns[tavern]["currency"])) + + vbox: + box_wrap True + xoffset 50 + yoffset 50 + ypos (1312-42) + yanchor 1.0 + xpos 255 + xanchor 0.0 + hbox: + spacing 24 + button: + xmaximum 250 #350 + yminimum 60 #111 + ymaximum 110 #111 + idle_background Frame("gui/green_btn.png", 60, 30) + hover_background Frame("gui/green_btn_hover.png", 60, 30) + action Return([tavern, 1]) + hbox: + yoffset 10 + null width 25 + text _("Summon %d" % 1): + color "#001864" + size 24 + outlines [(1,"#FFF",0,0)] + null width 25 + button: + xmaximum 250 #350 + yminimum 60 #111 + ymaximum 110 #111 + idle_background Frame("gui/green_btn.png", 60, 60) + hover_background Frame("gui/green_btn_hover.png", 60, 60) + action Return([tavern, alltaverns[tavern]["min_draws"]]) + hbox: + yoffset 10 + null width 25 + text _("Summon %d" % alltaverns[tavern]["min_draws"]): + color "#001864" + size 24 + outlines [(1,"#FFF",0,0)] + null width 25 + null: + height 42 + hbox: + showif tavern > 0: + button: + xmaximum 250 #350 + yminimum 60 #111 + ymaximum 110 #111 + idle_background Frame("gui/purple_btn.png", 60, 30) + hover_background Frame("gui/purple_btn_hover.png", 60, 30) + action SetScreenVariable("tavern", tavern-1) + hbox: + yoffset 5 + null width 25 + text _("«"): + color "#FFF" + size 24 + outlines [(1,"#000",0,0)] + null width 25 + showif len(alltaverns) > tavern+1: + button: + xmaximum 250 #350 + yminimum 60 #111 + ymaximum 110 #111 + idle_background Frame("gui/purple_btn.png", 60, 30) + hover_background Frame("gui/purple_btn_hover.png", 60, 30) + action SetScreenVariable("tavern", tavern+1) + hbox: + yoffset 5 + null width 25 + text _("»"): + color "#FFF" + size 24 + outlines [(1,"#000",0,0)] + null width 25 + + button: + xmaximum 250 #350 + yminimum 60 #111 + ymaximum 110 #111 + idle_background Frame("gui/green_btn.png", 60, 60) + hover_background Frame("gui/green_btn_hover.png", 60, 60) + action Return([-1, -1]) + hbox: + yoffset 10 + null width 25 + text _("Return"): + color "#001864" + size 24 + outlines [(1,"#FFF",0,0)] + null width 25 + +label tv_loop: + call screen tavern + + if (_return[0] < 1 or _return[1] < 1): + jump restore + + $ message=recruit(_return[0], _return[1]) + #menu: + # "Recruit 10 units for 2000 gems\n{i}One 4★ guaranteed!{/i}": + # $message=recruit(1, 10) + # "GP Tavern: Recruit 10 units for 10,000 GP\n{i}One Fairy or Mana Egg guaranteed!{/i}": + # $message=recruit(2, 10) + # "{b}This is a placeholder{/b}" "{i}It is possible to render each unit inidividual chance but we're not doing this (yet){/i}\nPlease be patient." + + if (message == OFFLINEMSG): + "Server replies:" "[message]\n\nYou are offline?" + return + + jump tv_loop + diff --git a/game/screens.rpy b/game/screens.rpy index c67a7af..2265998 100644 --- a/game/screens.rpy +++ b/game/screens.rpy @@ -262,7 +262,7 @@ screen quick_menu(): frame: style_prefix "quick" - background "gfx/actionarea.png" + background "#0000" xmargin 50 ymargin 50 vbox: |