Compare commits
28 Commits
main
...
gouv-chibi
Author | SHA1 | Date |
---|---|---|
Gouvernathor | 4de4788b16 | |
Gouvernathor | 96767c63ae | |
Gouvernathor | 1a70aff3bc | |
Gouvernathor | 5f742d4525 | |
Gouvernathor | e88fda5a2c | |
Gouvernathor | 6b6ad56af4 | |
Gouvernathor | 0f80487dfc | |
Gouvernathor | 42d2a17a6a | |
Gouvernathor | 0d8e91b5a5 | |
Gouvernathor | 314f971609 | |
Gouvernathor | ec27f91904 | |
Gouvernathor | e129921bc0 | |
Gouvernathor | 94b5ea15a5 | |
Gouvernathor | 923384eb37 | |
Gouvernathor | c2d8c394a1 | |
Gouvernathor | 9befd927a8 | |
Gouvernathor | e9ec437d1c | |
Gouvernathor | dfd7972752 | |
Gouvernathor | 1e8f1ebfb8 | |
Gouvernathor | 878cec8c76 | |
Gouvernathor | b49129ad1f | |
Gouvernathor | 34547cb0ad | |
Gouvernathor | caa4cd0b2c | |
Gouvernathor | cd63abd27b | |
Gouvernathor | c0bc1cd69f | |
Gouvernathor | 00eda2aae5 | |
Gouvernathor | ae5ff121d9 | |
Gouvernathor | 2525bea67d |
|
@ -73,30 +73,42 @@ python early hide:
|
|||
class chibi:
|
||||
@staticmethod
|
||||
def parse(l):
|
||||
who = l.simple_expression()
|
||||
action = l.simple_expression()
|
||||
who = l.require(l.name)
|
||||
action = l.require(l.name)
|
||||
arguments = l.arguments() # may be None
|
||||
l.expect_eol()
|
||||
|
||||
return (who, action)
|
||||
return (who, action, arguments)
|
||||
|
||||
def execute(self):
|
||||
print(f"{self}")
|
||||
who, action = self
|
||||
func = eval(f"{who}_chibi.{action}")
|
||||
print(self)
|
||||
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}")
|
||||
|
||||
def lint(self):
|
||||
who, action = self
|
||||
try:
|
||||
chibi = eval(f"{who}_chibi")
|
||||
except Exception:
|
||||
who, action, arguments = self
|
||||
|
||||
if who not in DollChibi.instances:
|
||||
renpy.error(f"Character chibi not defined: {who}")
|
||||
|
||||
def predict(self):
|
||||
who, action = self
|
||||
chibi = DollChibi.instances[who]
|
||||
|
||||
chibi = eval(f"{who}_chibi")
|
||||
doll = eval(f"{who}")
|
||||
if not hasattr(chibi, action):
|
||||
renpy.error(f"Chibi action not defined: {who} {action}")
|
||||
|
||||
def predict(self):
|
||||
who, action, arguments = self
|
||||
|
||||
chibi = DollChibi.instances[who]
|
||||
doll = states.dolls[who]
|
||||
|
||||
layers = (
|
||||
l[0] for pose in chibi.poses.keys()
|
||||
|
@ -142,6 +154,23 @@ python early hide:
|
|||
|
||||
return {"blocks": blocks}
|
||||
|
||||
def lint(self):
|
||||
any_true = False
|
||||
for block, weight, condition in self["blocks"]:
|
||||
if not isinstance(weight, (int, float)):
|
||||
renpy.error(f"Weight must be a number, not {weight!r}")
|
||||
|
||||
if condition == "True":
|
||||
any_true = True
|
||||
else:
|
||||
try:
|
||||
eval(condition)
|
||||
except Exception:
|
||||
renpy.error(f"Condition could not be evaluated: {condition!r}")
|
||||
|
||||
if not any_true:
|
||||
renpy.error("All blocks have a condition, which will raise an exception if all conditions are False at the same time at runtime")
|
||||
|
||||
def next(self):
|
||||
blocks = [(block, weight) for block, weight, condition in self["blocks"] if eval(condition)]
|
||||
total_weight = sum(weight for _, weight in blocks)
|
|
@ -2115,7 +2115,7 @@ label gryffindor_match_return:
|
|||
hoo "Oh, look at the time. I think I better get going--" ("open", "shocked", "shocked", "R")
|
||||
|
||||
#hooch sprints out the office sound
|
||||
$ hooch_chibi.hide()
|
||||
chibi hooch hide
|
||||
play sound "sounds/run_03.ogg"
|
||||
pause 1.0
|
||||
play sound "sounds/door.ogg"
|
||||
|
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -16,9 +16,4 @@ init python:
|
|||
|
||||
char.set_face(mouth="base", eyes="base", eyebrows="base", pupils="mid", cheeks="none", tears="none")
|
||||
|
||||
def chibi_init():
|
||||
# TODO: Perhaps it could be automated?
|
||||
hooch_chibi.register("stand", 1, (600, 800))
|
||||
hooch_chibi.register("walk", 8, (600, 800))
|
||||
|
||||
config.start_callbacks.extend([wardrobe_init, chibi_init])
|
||||
config.start_callbacks.append(wardrobe_init)
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
define states.dolls = {}
|
||||
|
||||
init python:
|
||||
class Doll(DollMethods):
|
||||
# 0 - 50 = Skin/Body Layers
|
||||
|
@ -77,15 +79,11 @@ init python:
|
|||
|
||||
self.build_image()
|
||||
|
||||
# Add doll name to global doll states store
|
||||
try:
|
||||
renpy.store.states.dolls.add(name)
|
||||
except AttributeError:
|
||||
renpy.store.states.dolls = {name}
|
||||
states.dolls[name] = self
|
||||
|
||||
def generate_hash(self):
|
||||
clothes_hash = str([x[0]._hash for x in self.states.values() if istype(x[0], (DollCloth, DollClothDynamic, DollMakeup)) and x[2]])
|
||||
salt = str( [self.name, self.pose, str(self.body._hash), str(self.face._hash), str(self.cum._hash), clothes_hash] )
|
||||
salt = str([self.name, self.pose, str(self.body._hash), str(self.face._hash), str(self.cum._hash), clothes_hash])
|
||||
return hash(salt)
|
||||
|
||||
def show(self, force=False, ignore_skipping=False):
|
||||
|
|
|
@ -23,7 +23,7 @@ init -1 python:
|
|||
|
||||
def get_character_object(key):
|
||||
__check_exists(key)
|
||||
return getattr(store, key)
|
||||
return states.dolls[key]
|
||||
|
||||
def get_character_outfit(key, typ="default"):
|
||||
__check_exists(key)
|
||||
|
|
Loading…
Reference in New Issue