From c2d8c394a150eae4b64c78738e00d0c8edf5d2f3 Mon Sep 17 00:00:00 2001 From: Gouvernathor <44340603+Gouvernathor@users.noreply.github.com> Date: Thu, 4 Apr 2024 23:15:35 +0200 Subject: [PATCH] Fix cds --- game/scripts/01cds.rpy | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/game/scripts/01cds.rpy b/game/scripts/01cds.rpy index 55e3a3f0..a22354cf 100644 --- a/game/scripts/01cds.rpy +++ b/game/scripts/01cds.rpy @@ -73,16 +73,23 @@ python early hide: class chibi: @staticmethod def parse(l): - who = l.simple_expression() - action = l.simple_expression() + who = l.name() + action = l.name() + arguments = l.arguments() # may be None + l.expect_eol() - return (who, action) + return (who, action, arguments) def execute(self): print(self) - who, action = self - chibi = DollChibi.instance[who] - getattr(chibi, action) + who, action, arguments = self + chibi = DollChibi.instances[who] + method = getattr(chibi, action) + if arguments is None: + args, kwargs = (), {} + else: + args, kwargs = arguments.evaluate() + method(*args, **kwargs) # print(f"Execution: {who} {action}")