2022-05-16 23:48:22 +00:00
|
|
|
|
2024-04-28 17:39:12 +00:00
|
|
|
define character.genie_say = Character(_("Genie"), show_icon="genie")
|
2022-05-16 23:48:22 +00:00
|
|
|
|
|
|
|
init python:
|
2022-05-26 20:50:54 +00:00
|
|
|
def gen(what, face=None, xpos=None, ypos=None, pos=None, flip=None, trans=None, animation=False, **kwargs):
|
2022-05-16 23:48:22 +00:00
|
|
|
redraw = False
|
|
|
|
tag = "genie_main"
|
2024-05-16 15:41:32 +00:00
|
|
|
layer = "dolls"
|
2022-05-16 23:48:22 +00:00
|
|
|
side = None
|
|
|
|
#showing = renpy.showing(name=tag, layer=layer)
|
|
|
|
|
2023-11-16 16:53:29 +00:00
|
|
|
if xpos is not None or ypos is not None:
|
|
|
|
xpos = states.gen.image.xpos if xpos is None else sprite_pos.get("x").get(xpos, xpos)
|
|
|
|
ypos = states.gen.image.ypos if ypos is None else sprite_pos.get("y").get(ypos, ypos)
|
2023-03-31 22:41:48 +00:00
|
|
|
states.gen.image.xpos = xpos
|
|
|
|
states.gen.image.ypos = ypos
|
2022-05-16 23:48:22 +00:00
|
|
|
|
|
|
|
head_ypos = sprite_pos.get("y").get("head")
|
|
|
|
far_xpos = sprite_pos.get("x").get("far_left")
|
|
|
|
|
2023-03-31 22:41:48 +00:00
|
|
|
if states.gen.image.ypos in ("head", head_ypos):
|
|
|
|
states.gen.image.offset = (-25, 630)
|
2022-05-16 23:48:22 +00:00
|
|
|
else:
|
2023-03-31 22:41:48 +00:00
|
|
|
states.gen.image.offset = (0, 600)
|
2022-05-16 23:48:22 +00:00
|
|
|
|
2022-05-26 20:50:54 +00:00
|
|
|
if face:
|
2024-03-26 19:31:41 +00:00
|
|
|
variant = f"genie {face}"
|
2022-05-16 23:48:22 +00:00
|
|
|
renpy.set_tag_attributes(variant)
|
|
|
|
side = "genie"
|
|
|
|
|
2023-06-19 17:25:44 +00:00
|
|
|
at_list = []
|
|
|
|
|
|
|
|
if animation:
|
|
|
|
at_list.append(animation)
|
|
|
|
|
2022-05-16 23:48:22 +00:00
|
|
|
if renpy.showing("genie", layer=layer):
|
2023-06-19 17:25:44 +00:00
|
|
|
renpy.show(variant, layer=layer, tag="genie", at_list=at_list)
|
2022-05-16 23:48:22 +00:00
|
|
|
|
2024-06-26 15:10:44 +00:00
|
|
|
renpy.with_statement({"dolls": trans or d1})
|
2024-05-21 20:00:35 +00:00
|
|
|
|
2023-11-16 16:53:29 +00:00
|
|
|
if flip is not None:
|
2023-03-31 22:41:48 +00:00
|
|
|
states.gen.image.xzoom = -1 if flip else 1
|
2022-05-16 23:48:22 +00:00
|
|
|
|
|
|
|
if what:
|
|
|
|
character.genie_say(what, image=side, **kwargs)
|
|
|
|
|
|
|
|
label update_genie:
|
|
|
|
|
2023-03-31 22:41:48 +00:00
|
|
|
$ states.gen.image.xzoom = 1
|
|
|
|
$ states.gen.image.zorder = 15
|
2022-05-16 23:48:22 +00:00
|
|
|
call gen_chibi("sit_behind_desk")
|
|
|
|
|
|
|
|
return
|