Skip to content

Commit c81dd99

Browse files
committed
Add faces to Bread Showdown, and improve translation
Both with help from ShinKiseki
1 parent 777844a commit c81dd99

File tree

3 files changed

+173
-166
lines changed

3 files changed

+173
-166
lines changed

README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,5 +57,3 @@ there is a separate version for compatibility with that.
5757
You do not need to install the base version of Inevitable Zero for this,
5858
simply install `inevitable-portraits.tar.gz` after More Portraits and you're good to go.
5959
This version does not include the japanese scripts however.
60-
**Please note** that the dialogue *Ultimate Bread Showdown!* does not currently include the added faces;
61-
we are working on this.

patch.py

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -523,16 +523,23 @@ def quest58(ctx): # {{{1 Ultimate Bread Showdown!
523523
copy_clause(vita, pc, 9, "@IF", 0, 1) # -''-
524524
copy_clause(vita, pc, 11, "@IF:1", 0, 0) # Bennet
525525

526-
# }}}
527526
def traverse(insns):
528527
nfunc = []
529-
for i in insns:
530-
if len(nfunc) > 2 \
531-
and i.name == "TEXT_TALK" \
532-
and nfunc[-2].name == "TEXT_TALK" \
533-
and nfunc[-1].name == "TEXT_WAIT" \
534-
and nfunc[-2].args[0] == i.args[0]:
535-
print(nfunc[-2], nfunc[-1], i)
528+
import re
529+
rx = re.compile(r"\{(#\d+F)\}")
530+
for x, i in enumerate(insns):
531+
if i.name == "TEXT_TALK" and rx.search(i.args[1]):
532+
if ctx.portraits:
533+
while x < len(insns)-2 \
534+
and insns[x+1].name == "TEXT_WAIT" \
535+
and insns[x+2].name == "TEXT_TALK" \
536+
and insns[x+2].args[0] == i.args[0]:
537+
i.args[1] += "{page}" + insns[x+2].args[1]
538+
del insns[x+1]
539+
del insns[x+1]
540+
i.args[1] = insn.Text(rx.sub(r"\1", i.args[1]))
541+
else:
542+
i.args[1] = insn.Text(rx.sub(r"", i.args[1]))
536543

537544
if i.name == "IF":
538545
for _, b in i.args[0]:
@@ -546,9 +553,8 @@ def traverse(insns):
546553
insns[:] = nfunc
547554

548555
pc = ctx.copy("c0210_1", tr)
549-
if ctx.portraits:
550-
for func in pc.code:
551-
traverse(func)
556+
for func in pc.code:
557+
traverse(func)
552558

553559
# Set flag 1107. Not sure what that does
554560
with ctx.get("e3010") as (vita, pc):

0 commit comments

Comments
 (0)