Deltarune (Chapter 4) script viewer

← back to main script listing

gml_Object_obj_homealone_rotating_fan_Step_0

(view raw script w/o annotations or w/e)
1
event_inherited();
2
if (dialogue_active && !d_ex())
3
{
4
    dialogue_active = false;
5
    global.interact = 0;
6
    with (obj_homealone_heart)
7
        onebuffer = 5;
8
alarm[10]
9
}
10
if (is_rotating)
11
{
12
    if (!i_ex(obj_homealone_heart))
13
        exit;
14
    if (distance_to_object(obj_homealone_heart) < 60)
15
        sfx_target_volume = 1;
16
    else
17
        sfx_target_volume = 0.5;
18
    sfx_volume = 
scr_movetowards
scr_movetowards

function
scr_movetowards(arg0, arg1, arg2)
{ if (arg0 == arg1) return arg0; else if (arg0 > arg1) return max(arg0 - arg2, arg1); else return min(arg0 + arg2, arg1); } function scr_obj_movetowards_obj(arg0, arg1, arg2 = 0, arg3 = 0) { scr_obj_movetowards_point(arg0.x + arg2, arg0.y + arg3, arg1); } function scr_obj_movetowards_point(arg0, arg1, arg2) { var _distance = point_distance(x, y, arg0, arg1); if (arg2 >= _distance) { x = arg0; y = arg1; } else { var _direction = point_direction(x, y, arg0, arg1); x += lengthdir_x(arg2, _direction); y += lengthdir_y(arg2, _direction); } }
(sfx_volume, sfx_target_volume, 0.15);
19
    snd_volume(sfx, sfx_volume, 0);
20
}