WTS/game/scripts/characters/cho/common.rpy

105 lines
3.4 KiB
Plaintext
Raw Normal View History

2022-05-16 23:48:22 +00:00
label update_cho:
# Chibi Update
$ cho_chibi.update()
$ cho_chibi.position(flip=False)
$ cho.xzoom = 1
hide screen cho_cloth_pile
return
label end_cho_event:
call cho_chibi("hide")
hide cho_main
with d3
pause.5
call update_cho
$ states.last_girl = states.active_girl
$ states.active_girl = None
$ states.cho.busy = True
2022-05-16 23:48:22 +00:00
$ cho.wear("all")
$ cho.set_cum(None)
$ cho.set_face(tears=False, cheeks=False)
2022-05-16 23:48:22 +00:00
call music_block
jump main_room_menu
define character.cho_say = Character("name_cho_genie", show_icon="cho", dynamic=True)
2022-05-16 23:48:22 +00:00
init python in character:
# Cho's name is short, therefore it needs to be initialised in character scope,
# otherwise we won't be able to use the same name for both Doll and Character calls.
def cho(what, mouth=None, eyes=None, eyebrows=None, pupils=None, cheeks=None, tears=None,
2022-05-16 23:48:22 +00:00
emote=None, face=None, xpos=None, ypos=None, pos=None, flip=None, trans=None, animation=False, **kwargs):
def show():
renpy.store.cho.show(force=True)
renpy.with_statement({"dolls": trans or renpy.store.d1})
face = {"mouth": mouth, "eyes": eyes, "eyebrows": eyebrows, "pupils": pupils, "cheeks": cheeks, "tears": tears}
temp_face = renpy.game.context().temporary_attributes
2022-05-16 23:48:22 +00:00
redraw = False
tag = renpy.store.cho.tag
layer = renpy.store.cho.layer
if xpos is not None or ypos is not None:
xpos = renpy.store.cho.pos[0] if xpos is None else renpy.store.sprite_pos.get("x").get(xpos, xpos)
ypos = renpy.store.cho.pos[1] if ypos is None else renpy.store.sprite_pos.get("y").get(ypos, ypos)
2022-05-16 23:48:22 +00:00
renpy.store.cho.pos = (xpos, ypos)
redraw = True
head_only = renpy.store.cho.pos[1] == renpy.store.sprite_pos.get("y").get("head")
if any(face.values()):
renpy.store.cho.set_face(**face)
redraw = True
if temp_face:
last_face = renpy.store.cho.get_face()
d = dict(zip(temp_face[::2], temp_face[1::2]))
renpy.store.cho.set_face(**d)
2022-05-16 23:48:22 +00:00
redraw = True
if emote:
renpy.store.cho.set_emote(emote)
redraw = True
2022-05-16 23:48:22 +00:00
if animation != False:
renpy.store.cho.animation = animation
2022-05-16 23:48:22 +00:00
redraw = True
if flip is not None:
2022-05-16 23:48:22 +00:00
renpy.store.cho.xzoom = -1 if flip else 1
redraw = True
if redraw and not head_only:
show()
elif head_only:
renpy.store.cho.hide()
2022-05-16 23:48:22 +00:00
2024-05-14 20:54:03 +00:00
# Figure out nickname
2024-05-15 18:29:46 +00:00
if renpy.store.name_cho_genie != "Cho":
2024-05-14 20:54:03 +00:00
name_prefix = "Cho {size=-20}\""
name_suffix = "\"{/size}"
else:
name_prefix = ""
name_suffix = ""
2022-05-16 23:48:22 +00:00
if what:
if head_only:
xpos = renpy.store.sprite_pos.get("x").get("right_corner") if renpy.store.cho.xzoom == 1 else renpy.store.sprite_pos.get("x").get("left_corner")
ypos = renpy.store.cho.pos[1]
side_doll = renpy.store.At(renpy.store.cho.image, renpy.store.doll_transform((xpos, ypos), renpy.store.cho.zoom, renpy.store.cho.xzoom))
else:
side_doll = None
cho_say(what, who_prefix=name_prefix, who_suffix=name_suffix, show_side_doll=side_doll, **kwargs)
2022-05-16 23:48:22 +00:00
if temp_face:
renpy.store.cho.set_face(**last_face)