Deltarune script viewer

← back to main script listing

gml_GlobalScript_scr_act_charsprite

(view raw script w/o annotations or w/e)
1
function scr_act_charsprite
scr_act_charsprite

function scr_act_charsprite(arg0, arg1, arg2, arg3) { _charactor = arg0; _charinstance = obj_herokris; if (_charactor == "noelle") { _charinstance = obj_heronoelle; _charnum = 4; } if (_charactor == "ralsei") { _charinstance = obj_heroralsei; _charnum = 3; } if (_charactor == "susie") { _charinstance = obj_herosusie; _charnum = 2; } if (_charactor == "kris") { _charinstance = obj_herokris; _charnum = 1; } __returnvalue = _charactsprite[_charnum]; if (i_ex(_charinstance)) { with (_charinstance) { image_alpha = 0; state = 0; global.faceaction[myself] = 0; } _charactsprite[_charnum] = scr_dark_marker(_charinstance.x, _charinstance.y, arg1); with (_charactsprite[_charnum]) { depth = 20 - (__view_get(e__VW.YView, 0) / 40); scr_oflash(); if (arg2 > 0 && arg3 == 0) scr_animate(0, 0, arg2); if (arg2 > 0 && arg3 == 1) image_speed = arg2; a = scr_afterimage(); a.hspeed = 2.5; a.depth = depth + 1; b = scr_afterimage(); b.image_alpha = 0.6; b.hspeed = 5; b.depth = depth + 2; } __returnvalue = _charactsprite[_charnum]; } return __returnvalue; } enum e__VW { XView, YView, WView, HView, Angle, HBorder, VBorder, HSpeed, VSpeed, Object, Visible, XPort, YPort, WPort, HPort, Camera, SurfaceID }
(arg0, arg1, arg2, arg3)
2
{
3
    _charactor = arg0;
4
    _charinstance = obj_herokris;
5
    if (_charactor == "noelle")
6
    {
7
        _charinstance = obj_heronoelle;
8
        _charnum = 4;
9
    }
10
    if (_charactor == "ralsei")
11
    {
12
        _charinstance = obj_heroralsei;
13
        _charnum = 3;
14
    }
15
    if (_charactor == "susie")
16
    {
17
        _charinstance = obj_herosusie;
18
        _charnum = 2;
19
    }
20
    if (_charactor == "kris")
21
    {
22
        _charinstance = obj_herokris;
23
        _charnum = 1;
24
    }
25
    __returnvalue = _charactsprite[_charnum];
26
    if (i_ex(_charinstance))
27
    {
28
        with (_charinstance)
29
        {
30
            image_alpha = 0;
31
            state = 0;
32
            global.faceaction[myself] = 0;
33
        }
34
        _charactsprite[_charnum] = scr_dark_marker
scr_dark_marker

function scr_dark_marker(arg0, arg1, arg2) { thismarker = instance_create(arg0, arg1, obj_marker); with (thismarker) { sprite_index = arg2; image_speed = 0; image_xscale = 2; image_yscale = 2; } return thismarker; }
(_charinstance.x, _charinstance.y, arg1);
35
        with (_charactsprite[_charnum])
36
        {
37
            depth = 20 - (__view_get(e__VW.YView, 0) / 40);
38
            scr_oflash
scr_oflash

function scr_oflash() { _oflash = instance_create(x, y, obj_oflash); _oflash.image_xscale = image_xscale; _oflash.image_speed = 0; _oflash.image_index = image_index; _oflash.image_yscale = image_yscale; if (global.chapter == 2 && object_index == obj_mauswheel_enemy) _oflash.sprite_index = spr_mauswheel_idle; else _oflash.sprite_index = sprite_index; _oflash.depth = depth - 1; _oflash.target = id; return _oflash; }
();
39
            if (arg2 > 0 && arg3 == 0)
40
                scr_animate
scr_animate

function scr_animate(arg0, arg1, arg2) { __animator = instance_create(x, y, obj_animator); __animator.target = id; __animator.initframe = arg0; __animator.endframe = arg1; __animator.fake_image_speed = arg2; return __animator; }
(0, 0, arg2);
41
            if (arg2 > 0 && arg3 == 1)
42
                image_speed = arg2;
43
            a = scr_afterimage
scr_afterimage

function scr_afterimage() { afterimage = instance_create(x, y, obj_afterimage); afterimage.sprite_index = sprite_index; afterimage.image_index = image_index; afterimage.image_blend = image_blend; afterimage.image_speed = 0; afterimage.depth = depth; afterimage.image_xscale = image_xscale; afterimage.image_yscale = image_yscale; afterimage.image_angle = image_angle; return afterimage; }
();
44
            a.hspeed = 2.5;
45
            a.depth = depth + 1;
46
            b = scr_afterimage
scr_afterimage

function scr_afterimage() { afterimage = instance_create(x, y, obj_afterimage); afterimage.sprite_index = sprite_index; afterimage.image_index = image_index; afterimage.image_blend = image_blend; afterimage.image_speed = 0; afterimage.depth = depth; afterimage.image_xscale = image_xscale; afterimage.image_yscale = image_yscale; afterimage.image_angle = image_angle; return afterimage; }
();
47
            b.image_alpha = 0.6;
48
            b.hspeed = 5;
49
            b.depth = depth + 2;
50
        }
51
        __returnvalue = _charactsprite[_charnum];
52
    }
53
    return __returnvalue;
54
}
55
56
enum e__VW
57
{
58
    XView,
59
    YView,
60
    WView,
61
    HView,
62
    Angle,
63
    HBorder,
64
    VBorder,
65
    HSpeed,
66
    VSpeed,
67
    Object,
68
    Visible,
69
    XPort,
70
    YPort,
71
    WPort,
72
    HPort,
73
    Camera,
74
    SurfaceID
75
}