2022-05-16 23:48:22 +00:00
|
|
|
label update_snape:
|
2023-04-02 23:48:38 +00:00
|
|
|
$ states.sna.image.xzoom = 1
|
2022-05-16 23:48:22 +00:00
|
|
|
return
|
|
|
|
|
2024-05-01 18:08:10 +00:00
|
|
|
define character.snape_say = Character(_("Severus Snape"), show_icon="snape")
|
2022-05-16 23:48:22 +00:00
|
|
|
|
|
|
|
init python:
|
|
|
|
def sna(what, face=None, xpos=None, ypos=None, pos=None, flip=None, trans=None, animation=False, wand=False, **kwargs):
|
|
|
|
redraw = False
|
|
|
|
tag = "snape_main"
|
2024-05-16 15:41:32 +00:00
|
|
|
layer = "dolls"
|
2022-05-16 23:48:22 +00:00
|
|
|
#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.sna.image.xpos if xpos is None else sprite_pos.get("x").get(xpos, xpos)
|
|
|
|
ypos = states.sna.image.ypos if ypos is None else sprite_pos.get("y").get(ypos, ypos)
|
2023-04-02 23:48:38 +00:00
|
|
|
states.sna.image.xpos = xpos
|
|
|
|
states.sna.image.ypos = ypos
|
2022-05-16 23:48:22 +00:00
|
|
|
redraw = True
|
|
|
|
|
|
|
|
head_ypos = sprite_pos.get("y").get("head")
|
2023-04-02 23:48:38 +00:00
|
|
|
head_only = states.sna.image.ypos == head_ypos
|
2022-05-16 23:48:22 +00:00
|
|
|
|
|
|
|
# The easiest way to fix image positions for Snape is to use offsets.
|
|
|
|
# It's not ideal, but it's better than having to change all calls manually.
|
2023-04-02 23:48:38 +00:00
|
|
|
if states.sna.image.ypos in ("head", head_ypos):
|
2022-05-16 23:48:22 +00:00
|
|
|
xoffset = -25
|
|
|
|
yoffset = 150
|
|
|
|
else:
|
|
|
|
xoffset = -50
|
|
|
|
yoffset = 0
|
|
|
|
|
|
|
|
if face:
|
2023-04-02 23:48:38 +00:00
|
|
|
states.sna.image.face = face
|
2022-05-16 23:48:22 +00:00
|
|
|
redraw = True
|
|
|
|
|
|
|
|
if animation != False:
|
2023-04-02 23:48:38 +00:00
|
|
|
states.sna.image.animation = animation
|
2022-05-16 23:48:22 +00:00
|
|
|
redraw = True
|
|
|
|
|
2023-11-16 16:53:29 +00:00
|
|
|
if flip is not None:
|
2023-04-02 23:48:38 +00:00
|
|
|
states.sna.image.xzoom = -1 if flip else 1
|
2022-05-16 23:48:22 +00:00
|
|
|
redraw = True
|
|
|
|
|
|
|
|
if redraw:
|
2023-04-02 23:48:38 +00:00
|
|
|
base_transform = doll_transform((states.sna.image.xpos + xoffset, states.sna.image.ypos + yoffset), states.sna.image.zoom, states.sna.image.xzoom)
|
|
|
|
sprite = Image("characters/snape/main/"+states.sna.image.face+".webp")
|
2022-05-16 23:48:22 +00:00
|
|
|
|
|
|
|
if wand:
|
|
|
|
sprite = Fixed(sprite, "characters/snape/main/wand.webp")
|
|
|
|
|
2022-06-24 17:32:41 +00:00
|
|
|
at_list = [base_transform]
|
|
|
|
|
|
|
|
if animation:
|
2023-04-02 23:48:38 +00:00
|
|
|
at_list.append(states.sna.image.animation)
|
2022-06-24 17:32:41 +00:00
|
|
|
|
2023-04-02 23:48:38 +00:00
|
|
|
renpy.show(name=tag, at_list=at_list, layer=layer, what=sprite, zorder=states.sna.image.zorder)
|
2022-05-16 23:48:22 +00:00
|
|
|
|
|
|
|
if not renpy.in_rollback():
|
|
|
|
if trans:
|
|
|
|
renpy.with_statement(trans)
|
|
|
|
else:
|
|
|
|
renpy.with_statement(d2)
|
|
|
|
|
|
|
|
if what:
|
|
|
|
character.snape_say(what, **kwargs)
|
|
|
|
|
2022-05-19 15:44:36 +00:00
|
|
|
if head_only:
|
2022-05-16 23:48:22 +00:00
|
|
|
renpy.hide(name=tag, layer=layer)
|