Consolidate rewind, expand spar
Build and Deploy Ren'Py Web / deploy (push) Failing after 1h1m40s

This commit is contained in:
Dynamitos
2026-09-11 11:38:32 +02:00
parent 995ae4b80b
commit 90e564f629
5 changed files with 143 additions and 36 deletions
+16 -26
View File
@@ -1,5 +1,5 @@
# ── Persistent flags ──────────────────────────────────────────────────────────
default checkpoint_set = False
# `checkpoint` (the rewind destination) is defined globally in script.rpy.
default rewind_used = False
default purpose_chosen = False
default silence_chosen = False # here Sara learns that Luno asks everyone the same question
@@ -31,38 +31,28 @@ label arrival:
jump .choice_screen
label .rewind_choice:
if not checkpoint_set:
if checkpoint is None:
# No checkpoint created yet — can't rewind, move on.
jump .kaeros_arrives
# The shared screen handles both buttons:
# Rewind -> .do_rewind -> rewind_to(checkpoint) (teal wash, then lands here)
# Continue -> hides the screen, and we resume below.
show screen rewind_prompt
menu:
"[[ Rewind ]":
hide screen rewind_prompt
$ rewind_used = True
scene black
with dissolve
show screen teal_wash
"The world pulls back."
"Colour drains to teal. Sound slows to nothing."
hide screen teal_wash
scene bg training_yard
with dissolve
show sara neutral at left
show luno curious at right
thinking "Let's try this again."
jump .choice_screen
"[[ Continue ]":
hide screen rewind_prompt
# reset flags
$ checkpoint_set = False
$ rewind_used = False
jump .kaeros_arrives
hide screen rewind_prompt
# Resuming after "Continue": clear the checkpoint and move on.
$ checkpoint = None
$ rewind_used = False
jump .kaeros_arrives
label .choice_screen:
menu:
"Why are you here?"
"[[ Create Checkpoint ]" if not checkpoint_set:
$ checkpoint_set = True
"[[ Create Checkpoint ]" if checkpoint is None:
# Store where a rewind should land, plus what to reset on rewind.
$ checkpoint = ".choice_screen"
$ rewind_reset = ["rewind_used = True"]
scene black
with dissolve
"A flash. Sara's hand, signing something. A contract. The ink is red."
+77 -6
View File
@@ -23,24 +23,95 @@ label first_test:
mercenary "Begin the match!"
scene black
with dissolve
"TODO: premonition"
"The feeling of a cold thread. The feeling of the air thickening."
scene bg training_yard
with dissolve
# Checkpoint: a rewind from anywhere in the spar lands back at the first
# exchange. `rewind_reset` is empty — the spar's state is re-derived from
# the choices, so there are no flags to reset.
$ checkpoint = ".first_attack_choice"
$ rewind_reset = []
eron "Hyaaa"
jump .first_attack_choice
label .first_attack_choice:
"Eron raises his sword over his right shoulder."
menu:
thinking "Fast!"
"Dodge left":
jump .first_attack_left
jump .dodge_left
"Dodge right":
jump .first_attack_right
jump .dodge_right
"Parry":
jump .first_attack_parry
jump .parry
label .first_attack_left:
# Initial left
label .dodge_left:
"Whizz! The sword almost grazes her right shoulder."
thinking "Hairs breadth!"
thinking "I need to regain my balance and counter"
menu:
thinking "I need to regain my balance and counter."
"Counterattack":
jump .dodge_left_counterattack
"Anticipate next attack":
jump .dodge_left_anticipate
## Left -> counter
label .dodge_left_counterattack:
"Whack! The sword turns quickly and strikes her leg."
sara "Ugh!"
thinking "He hit my leg! Should i try another attack or go back?"
menu:
"[[Rewind]":
# Shared mechanic: reads `checkpoint` (".first_attack_choice") and
# rewinds there via the teal-wash effect, then returns here.
call .do_rewind
"Press the attack":
jump .dodge_left_counterattack_press
label .dodge_left_counterattack_press:
"Whack! Eron takes the momentum of the recoil from the leg strike and makes a lightning fast spinning attack for Saras temple."
screen black with dissolve
jump .after_spar
## Left -> anticipate
label .dodge_left_anticipate:
thinking "I dodged to the left, so the next attack will come from the right."
menu:
"Dodge further left":
jump .dodge_left_anticipate_left
"Jump":
jump .dodge_left_anticipate_jump
"Parry":
jump .dodge_left_anticipate_parry
## Left -> anticipate -> left
label .dodge_left_anticipate_left:
"Erons sword that narrowly missed her right side quickly turns and aims for her legs."
"The tradjectory of the sword is faster than she can dodge away but the increased distance allows eron to adjust the trajectory."
"Eron upswings unter her raised arms quarely into Saras stomach"
sara "Ugh!"
thinking "That knocked the air out of me! I need to catch my breath. Or should I rewind?"
menu:
"[[Rewind]":
call .do_rewind
"Create distance":
jump .dodge_left_anticipate_left_distance
label .dodge_left_anticipate_left_distance:
"Whack! Eron takes the momentum of the recoil from the stomach strike and makes a lightning fast spinning attack for Saras temple."
screen black with dissolve
jump .after_spar
label .dodge_left_anticipate_jump:
"Sara jumps over the incoming strike, landing gracefully."
jump .eron_adjusts
# Initial right
label .dodge_right:
label .parry:
label .after_spar:
+1
View File
@@ -1,5 +1,6 @@
define sara = Character("Sara", color="#5acbd5")
define thinking = Character("Sara", color="#1d9fa4", what_italic=True)
define luno = Character("Luno", color="#1b449d")
define eron = Character("Eron", color="#c98a3a")
define narrator = Character(None)
define mercenary = Character("Iron Hollow Mercenary", color="#ff0000")
+47 -2
View File
@@ -4,15 +4,60 @@ label start:
jump arrival
# ── Rewind mechanic (shared across all scripts) ──────────────────────────────
# Where the next rewind lands. Set this at every checkpoint you create.
default checkpoint = None
# Optional: a list of $-statements to run when rewinding (reset flags, etc.).
# Kept separate from `checkpoint` so the destination label stays a plain string.
default rewind_reset = []
# Plays the shared rewind effect, then returns to `destination`.
# Uses `call` (not `jump`) so it is re-entrant: rewinding to a label that is
# already on the call stack (e.g. back to a choice mid-spar) returns cleanly
# to the caller instead of corrupting the stack.
# Call as: call rewind_to .some_label
label rewind_to(destination):
scene black
with dissolve
show screen teal_wash
"The world pulls back."
"Colour drains to teal. Sound slows to nothing."
hide screen teal_wash
scene black
with dissolve
# Run any per-checkpoint reset statements (e.g. $ rewind_used = False)
for _stmt in rewind_reset:
$ eval(_stmt)
call destination
# ── Screens ───────────────────────────────────────────────────────────────────
# Shared rewind prompt. "Rewind" jumps to .do_rewind, which reads the
# current `checkpoint` and routes through the reusable rewind_to label.
# "Continue" just hides the screen and lets the calling script resume.
screen rewind_prompt():
zorder 10
text "Rewind available":
textbutton "⟲ Rewind" action Jump(".do_rewind"):
xalign 0.05
yalign 0.95
color "#4ab8b8"
size 22
color "#4ab8b8"
textbutton "Continue" action Hide("rewind_prompt"):
xalign 0.05
xoffset 120
yalign 0.95
size 22
color "#4ab8b8"
# Reads the stored checkpoint and rewinds to it.
label .do_rewind:
hide screen rewind_prompt
if checkpoint is None:
# No checkpoint set — just resume.
return
call rewind_to checkpoint
screen teal_wash():
zorder 20
View File