From c0da6f373193bd20ea119408bc06140ecd33870c Mon Sep 17 00:00:00 2001 From: LoafyLemon Date: Sun, 19 Mar 2023 19:22:05 +0000 Subject: [PATCH] Bug fixes * Added a hint regarding the 'brutes' section of Cho's quidditch quest * Fixed face and cum submodule processors referencing a wrong vars * Fixed face and cum submodules custom zorder modifiers * Fixed cum submodule zorder assignments and simplified the code --- .../cum/hair/heavy/{ => default}/cum.webp | 0 .../cum/hair/light/{ => default}/cum.webp | 0 .../events/quidditch/slytherin_practice.rpy | 1 + game/scripts/doll/cum.rpy | 41 ++++++++----------- game/scripts/doll/face.rpy | 5 ++- game/scripts/doll/main.rpy | 12 ------ 6 files changed, 20 insertions(+), 39 deletions(-) rename game/characters/cho/poses/default/cum/hair/heavy/{ => default}/cum.webp (100%) rename game/characters/cho/poses/default/cum/hair/light/{ => default}/cum.webp (100%) diff --git a/game/characters/cho/poses/default/cum/hair/heavy/cum.webp b/game/characters/cho/poses/default/cum/hair/heavy/default/cum.webp similarity index 100% rename from game/characters/cho/poses/default/cum/hair/heavy/cum.webp rename to game/characters/cho/poses/default/cum/hair/heavy/default/cum.webp diff --git a/game/characters/cho/poses/default/cum/hair/light/cum.webp b/game/characters/cho/poses/default/cum/hair/light/default/cum.webp similarity index 100% rename from game/characters/cho/poses/default/cum/hair/light/cum.webp rename to game/characters/cho/poses/default/cum/hair/light/default/cum.webp diff --git a/game/scripts/characters/cho/events/quidditch/slytherin_practice.rpy b/game/scripts/characters/cho/events/quidditch/slytherin_practice.rpy index f8a1cd37..f9abce84 100644 --- a/game/scripts/characters/cho/events/quidditch/slytherin_practice.rpy +++ b/game/scripts/characters/cho/events/quidditch/slytherin_practice.rpy @@ -265,6 +265,7 @@ label cc_st_talk: elif cho_quid.E5_complete and not cho_quid.E6_complete: cho "I'm still a bit worried about those brutes..." ("annoyed", "base", "raised", "down") cho "You better find a foolproof way of dealing with them." ("soft", "base", "angry", "mid") + gen "(Perhaps I should {b}talk to her{/b} more, the problem might solve itself.)" ("base", xpos="far_left", ypos="head") elif cc_pf_talk.is_tier_complete() and not cho_quid.lock_tactic: cho "You really believe that showing off my ass is the best tactic against Slytherin?" ("soft", "base", "base", "R", cheeks="blush") gen "I'm certain of it..." ("base", xpos="far_left", ypos="head") diff --git a/game/scripts/doll/cum.rpy b/game/scripts/doll/cum.rpy index 2635481d..2e44e435 100644 --- a/game/scripts/doll/cum.rpy +++ b/game/scripts/doll/cum.rpy @@ -3,7 +3,7 @@ init python: layer_types = { "mask": "-1", "skin": 1, - "cum": 100, + "cum": None, } layer_modifiers = { @@ -53,38 +53,29 @@ init python: continue if part in face_layers: - zorder = face_layers.get(part) + zorder = face_layers.get(part) + 1 identifier = active_faces.get(part, "default") path = posixpath.join(self.char.modpath, "characters", self.char.name, "poses", self.char.pose, subpath, "cum", part, name, identifier) elif part in (clothing_layers | body_layers): cloth, zorder, is_worn = active_clothes.get(part, [None, None, None]) - if is_worn is None: - # Backwards compatibility for old layering system - path = posixpath.join("characters", self.char.name, "poses", self.char.pose, "cum", part, name) + if cloth is None or not is_worn: + continue - if config.developer: - renpy.notify(f"Using old-type cum layer, consider updating the code; Layer: \"{part}\"") - else: - if cloth is None or is_worn is False: - identifier = "default" - modpath = "" - zorder = None - else: - identifier = cloth.id - modpath = cloth.modpath - zorder = cloth.zorder + 1 + identifier = cloth.id + modpath = cloth.modpath + zorder = cloth.zorder + 1 - path = posixpath.join(modpath, "characters", self.char.name, "poses", self.char.pose, "cum", part, name, identifier) - path = path if _lookahead(path) else posixpath.join(os.path.split(path)[0], (identifier := "default")) - - if config.developer and not _lookahead(path): - print(f"Files and/or directories are missing: {path}/") + path = posixpath.join(modpath, "characters", self.char.name, "poses", self.char.pose, "cum", part, name, identifier) + path = path if _lookahead(path) else posixpath.join(os.path.split(path)[0], (identifier := "default")) else: - zorder = types.get("cum") + zorder = 100 path = posixpath.join(self.char.modpath, "characters", self.char.name, "poses", self.char.pose, "cum", part, name) + if config.developer and not _lookahead(path): + print(f"Files and/or directories are missing: {path}/") + for f in renpy.list_files(): fp, fn = os.path.split(f) fn, ext = os.path.splitext(fn) @@ -98,7 +89,7 @@ init python: print(f"Invalid layer type for file: {f}") continue - zorder = zorder or types.get(ltype) + zorder = types.get(ltype) or zorder if tails: lmodifier, *tails = tails @@ -108,7 +99,7 @@ init python: continue zorder_mod = modifiers.get(lmodifier) - zorder = (zorder + int(zorder_mod)) + zorder = (zorder + int(zorder_mod)) if lmodifier != "zorder" else int(tails[-1]) layers.setdefault(" ".join([part, name, ltype, lmodifier]), [f, zorder]) else: layers.setdefault(" ".join([part, name, ltype]), [f, zorder]) @@ -131,7 +122,7 @@ init python: for identifier, (file, zorder) in layers.items(): cum_type, name, ltype = identifier.rsplit(" ") - processor = processors.get(identifier, processors["default"]) + processor = processors.get(ltype, processors["default"]) processed_file = processor(file) sprites.append((identifier, processed_file, zorder)) diff --git a/game/scripts/doll/face.rpy b/game/scripts/doll/face.rpy index 3ad71b9c..feb1d619 100644 --- a/game/scripts/doll/face.rpy +++ b/game/scripts/doll/face.rpy @@ -63,7 +63,7 @@ init python: continue zorder_mod = modifiers.get(lmodifier) - zorder = (zorder + int(zorder_mod)) + zorder = (zorder + int(zorder_mod)) if lmodifier != "zorder" else int(tails[-1]) layers.setdefault(" ".join([part, name, ltype, lmodifier]), [f, zorder]) else: layers.setdefault(" ".join([part, name, ltype]), [f, zorder]) @@ -92,9 +92,10 @@ init python: if expr_type == "pupils": if not eyemask: continue + processor = processors["pupils"] else: - processor = processors.get(identifier, processors["default"]) + processor = processors.get(ltype, processors["default"]) processed_file = processor(file) sprites.append((identifier, processed_file, zorder)) diff --git a/game/scripts/doll/main.rpy b/game/scripts/doll/main.rpy index fca5f50f..192161af 100644 --- a/game/scripts/doll/main.rpy +++ b/game/scripts/doll/main.rpy @@ -441,12 +441,6 @@ init python: """Returns a dictionary containing currently set facial expressions. Used in character studio.""" return self.face._face - # def set_body(self, **kwargs): - # OBSOLETE! the code in scripts needs to be changed - # """Takes keyword argument(s) with the string name of body part file(s).""" - # if self.body.set_body(**kwargs): - # self.rebuild_image() - def set_body_hue(self, arg): """Takes integer between 0 - 359, rotates the character body colour by given amount.""" self.body.set_hue(arg) @@ -460,12 +454,6 @@ init python: if renpy.showing(get_character_tag(self.name), layer=self.layer): self.show() - # def set_body_zorder(self, **kwargs): - # OBSOLETE! the code in scripts needs to be changed - # """Takes keyword argument(s) with the name(s) of body part(s) and integer value(s)""" - # if self.body.set_zorder(**kwargs): - # self.rebuild_image() - def set_cum(self, *args, **kwargs): """Takes keyword argument(s) containing string name(s) of cum layers to apply or None.""" self.cum.set_cum(*args, **kwargs)