summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2021-08-13 00:13:25 -0300
committerJesusaves <cpntb1@ymail.com>2021-08-13 00:13:25 -0300
commitee57db8dbf77727846b9c9c203a78a0e79169cb4 (patch)
tree3108a99de34ee0dbc6e4c9b4dc987eb94af57225
parenta01837e928b4b7ec22b35a27f3222e9ce88c100a (diff)
downloadclient-ee57db8dbf77727846b9c9c203a78a0e79169cb4.tar.gz
client-ee57db8dbf77727846b9c9c203a78a0e79169cb4.tar.bz2
client-ee57db8dbf77727846b9c9c203a78a0e79169cb4.tar.xz
client-ee57db8dbf77727846b9c9c203a78a0e79169cb4.zip
Optimize some battle code because we'll be needing this soon
-rw-r--r--game/01_init.rpy6
-rw-r--r--game/battle.rpy32
2 files changed, 23 insertions, 15 deletions
diff --git a/game/01_init.rpy b/game/01_init.rpy
index d9e2168..84032c8 100644
--- a/game/01_init.rpy
+++ b/game/01_init.rpy
@@ -47,8 +47,6 @@ init -3 python:
persistent.serverlist.append(["Localhost", "localhost", 61000])
if (persistent.allfiles is None):
persistent.allfiles=[]
- if (persistent.summon is None):
- persistent.summon=ifte(config.developer, 15, 0)
allfiles=[]
HOST=str(persistent.host)
PORT=str(persistent.port)
@@ -335,6 +333,10 @@ init -3 python:
renpy.audio.audio.load=SpheresLoadAudioFile
+ ## Post setup
+ if (persistent.summon is None):
+ persistent.summon=ifte(config.developer, 15, 0)
+
#############################################################################
# URL3 Function
def GAME_UPDATER():
diff --git a/game/battle.rpy b/game/battle.rpy
index 1539203..fbc2cae 100644
--- a/game/battle.rpy
+++ b/game/battle.rpy
@@ -27,6 +27,22 @@ init python:
return ERR_JSONDECODER
return bt
+ def bt_handlelog(entry):
+ if entry[2] in [SPH_NONE, SPH_PIERCE, SPH_ASSAULT, SPH_HEAL]:
+ hit_someone_verbose(Battle[entry[4]][entry[5]],
+ entry[3])
+ sdelay(0.1)
+ print("Attacked Battle[%s][%d]" % (entry[4], entry[5]))
+ elif entry[2] == SRV_SUMMON:
+ # FIXME
+ print("Summoned %d to your aid! Show cutscene" % entry[3])
+ show_img("summon_%d" % entry[3], False)
+ renpy.show("summon_%d" % entry[3], at_list=[truecenter, tzoomin], tag="summon", zorder=29150, layer="overlay")
+ renpy.pause(2.0)
+ renpy.hide("summon", layer="overlay")
+ #renpy.with_statement(Dissolve(1.0))
+ return
+
label combat:
# Implement combat view
$stdout("================= prepare for combat")
@@ -148,19 +164,9 @@ label combat:
# TODO: Highlight caster
# TODO: Unmark cards
# TODO: SRV_WAVE (ends waves) SRV_SPHERE (updates spheres)
- if entry[2] in [SPH_NONE, SPH_PIERCE, SPH_ASSAULT, SPH_HEAL]:
- hit_someone_verbose(Battle[entry[4]][entry[5]],
- entry[3])
- sdelay(0.1)
- print("Attacked Battle[%s][%d]" % (entry[4], entry[5]))
- elif entry[2] == SRV_SUMMON:
- # FIXME
- print("Summoned %d to your aid! Show cutscene" % entry[3])
- show_img("summon_%d" % entry[3], False)
- renpy.show("summon_%d" % entry[3], at_list=[truecenter, tzoomin], tag="summon", zorder=29150, layer="overlay")
- renpy.pause(2.0)
- renpy.hide("summon", layer="overlay")
- #renpy.with_statement(Dissolve(1.0))
+ # TODO: SRV_NONE (saves action in tmp memory)
+ # (then at next non-none, bt_handlelog() tmp memory)
+ bt_handlelog(entry)
except:
traceback.print_exc()