Deltarune (Chapter 3) script viewer

← back to main script listing

gml_Object_obj_shutta_rotation_attack_Other_10

(view raw script w/o annotations or w/e)
1
with (obj_dbullet_maker)
2
    instance_destroy();
3
take_photo = false;
4
var _index = 0;
5
var _newbullet = 0;
6
var _snap_w = obj_growtangle.sprite_width + 50;
7
var _snap_h = obj_growtangle.sprite_height + 50;
8
if (!surface_exists(snapshot))
9
    snapshot = surface_create(shotsize, shotsize);
10
snd_play_volume(snd_camera_flash, 0.8);
11
scr_debug_print
scr_debug_print

function
scr_debug_print(arg0)
{ } function print_message(arg0) { } function debug_print(arg0) { } function scr_debug_clear_all() { }
("Click!");
12
var _px = choose(-25, 25);
13
var _py = choose(-25, 25);
14
if (difficulty > 2)
15
{
16
    _px = 0;
17
    _py = 0;
18
}
19
else if (difficulty > 0)
20
{
21
    _px = 0;
22
    _py = 0;
23
}
24
else if (sign(_px) == sign(obj_heart.x - obj_growtangle.x) && sign(_py) == sign(obj_heart.y - obj_growtangle.y))
25
{
26
    if (point_distance(obj_heart.x, obj_heart.y, obj_growtangle.x, obj_growtangle.y) > 25)
27
    {
28
        _px = 0;
29
        _py = 0;
30
    }
31
    else
32
    {
33
        var _flip = irandom(2);
34
        if (_flip == 0 || _flip == 1)
35
            _px *= -1;
36
        if (_flip == 1 || _flip == 2)
37
            _py *= -1;
38
    }
39
}
40
pivotx += _px;
41
pivoty += _py;
42
if (difficulty < 2)
43
{
44
    framex = obj_growtangle.x;
45
    framey = obj_growtangle.y;
46
}
47
else
48
{
49
    framex = pivotx;
50
    framey = pivoty;
51
}
52
debug_print("difficulty = " + string(difficulty));
53
surface_set_target(snapshot);
54
draw_clear(c_white);
55
gpu_set_blendmode_ext_sepalpha(bm_zero, bm_inv_src_color, bm_src_alpha, bm_inv_src_alpha);
56
draw_surface_part(application_surface, screenx(framex - (shotsize / 2)), screeny(framey - (shotsize / 2)), shotsize, shotsize, 0, 0);
57
surface_reset_target();
58
draw_set_blend_mode(bm_normal);
59
border = -4;
60
border = instance_create(framex, framey, obj_bulletparent);
61
border.sprite_index = spr_battlebg_stretch;
62
border.image_xscale = obj_growtangle.image_xscale * (shotsize / 150);
63
border.image_yscale = obj_growtangle.image_yscale * (shotsize / 150);
64
border.image_blend = c_gray;
65
border.image_speed = 0;
66
border.photo = true;
67
freeze = true;
68
with (obj_collidebullet)
69
{
70
    var _inbounds = point_in_rectangle(x, y, other.framex - (other.shotsize / 2), other.framey - (other.shotsize / 2), other.framex + (other.shotsize / 2), other.framey + (other.shotsize / 2));
71
    if (other.difficulty >= 2 && !_inbounds)
72
        continue;
73
    if (_inbounds)
74
        image_blend = #8ADCFF;
75
    var _bullet;
76
    if (other.difficulty >= 1 && _inbounds)
77
    {
78
        _bullet = self;
79
        
scr_copybullet
scr_copybullet

function
scr_copybullet(arg0 = 0, arg1 = true)
{ if (arg0 == 0) arg0 = id; with (arg0) { bullet_values = { gravity: gravity, speed: speed, direction: direction, gravity_direction: gravity_direction, friction: friction, image_blend: image_blend, destroyonhit: destroyonhit }; if (arg1) { gravity = 0; speed = 0; friction = 0; gravity_direction = 270; direction = 0; destroyonhit = false; } } } function scr_pastebullet(arg0 = 0) { if (arg0 == 0) arg0 = id; with (arg0) { if (v_ex("bullet_values")) { gravity = bullet_values.gravity; gravity_direction = bullet_values.gravity_direction; friction = bullet_values.friction; direction = bullet_values.direction; speed = bullet_values.speed; image_blend = bullet_values.image_blend; destroyonhit = bullet_values.destroyonhit; } else { debug_print("can't load values w/o saved values!!!!!"); } } }
();
80
        _bullet.photo = true;
81
        _bullet.image_blend = #8ADCFF;
82
        paused = true;
83
    }
84
    else if (other.difficulty <= 1)
85
    {
86
        _bullet = instance_create(x, y, obj_shutta_photobullet);
87
        with (_bullet)
88
            
scr_bullet_init
scr_bullet_init

function
scr_bullet_init()
{ grazed = 0; grazetimer = 0; destroyonhit = 1; target = 0; inv = 60; damage = 10; element = 0; grazepoints = 1; timepoints = 1; active = 1; updateimageangle = 0; }
();
89
        
scr_image_copy
scr_image_copy

function
scr_image_copy(arg0, arg1)
{ arg0.sprite_index = arg1.sprite_index; arg0.image_index = arg1.image_index; arg0.image_blend = arg1.image_blend; arg0.image_speed = arg1.image_speed; arg0.image_alpha = arg1.image_alpha; arg0.depth = arg1.depth; arg0.image_xscale = arg1.image_xscale; arg0.image_yscale = arg1.image_yscale; arg0.image_angle = arg1.image_angle; }
(_bullet, self);
90
        
scr_bullet_inherit
scr_bullet_inherit

function
scr_bullet_inherit(arg0)
{ if (i_ex(arg0)) { if (damage != -1) arg0.damage = damage; if (grazepoints != -1) arg0.grazepoints = grazepoints; if (timepoints != -1) arg0.timepoints = timepoints; if (inv != -1) arg0.inv = inv; if (target != -1) arg0.target = target; if (grazed != -1) arg0.grazed = 0; if (grazetimer != -1) arg0.grazetimer = 0; if (object_index == obj_dbulletcontroller) { arg0.creatorid = creatorid; arg0.creator = creator; } arg0.element = element; } }
(_bullet);
91
        _bullet.active = active;
92
        instance_destroy();
93
    }
94
    _bullet.friction = 0;
95
    _bullet.destroyonhit = false;
96
    _bullet.image_speed = 0;
97
    _bullet.speed = 0;
98
    if (_inbounds)
99
    {
100
        other.bullets[_index] = _bullet;
101
        _index++;
102
        if (other.motion_blur && v_ex("afterimage"))
103
        {
104
            var _af = 0;
105
            for (_af = 0; _af < other.afterimage_count; _af++)
106
            {
107
                if (i_ex(afterimage[_af]))
108
                {
109
                    afterimage[_af].image_alpha = afterimage[_af].saved_alpha;
110
                    afterimage[_af].image_blend = image_blend;
111
                    if (other.afterimage_style == 1)
112
                        afterimage[_af].image_angle = image_angle;
113
                }
114
            }
115
        }
116
    }
117
    else
118
    {
119
        _bullet.disappear = true;
120
    }
121
}
122
if (difficulty < 2)
123
{
124
    with (obj_bulletparent)
125
    {
126
        if (!v_ex("photo") && true)
127
        {
128
            var _bullet = instance_create(x, y, obj_shutta_photobullet);
129
            
scr_image_copy
scr_image_copy

function
scr_image_copy(arg0, arg1)
{ arg0.sprite_index = arg1.sprite_index; arg0.image_index = arg1.image_index; arg0.image_blend = arg1.image_blend; arg0.image_speed = arg1.image_speed; arg0.image_alpha = arg1.image_alpha; arg0.depth = arg1.depth; arg0.image_xscale = arg1.image_xscale; arg0.image_yscale = arg1.image_yscale; arg0.image_angle = arg1.image_angle; }
(_bullet, self);
130
            instance_destroy();
131
            if (gt_inbounds_tol(x, y, other.padding + 5))
132
                _bullet.disappear = true;
133
            _bullet.active = false;
134
        }
135
    }
136
    with (obj_shutta_photo_attack)
137
        con = 2;
138
}
139
var _total_time = edit_time + wait_time + 30;
140
with (obj_script_delayed)
141
{
142
    if (i_ex(target) && iv_ex(target, "paused") && target.paused)
143
        alarm[0]
 = alarm[0] + _total_time;
gml_Object_obj_shutta_rotation_attack_Alarm_0.gml

if (con == 0 && motion_blur && afterimage_index < afterimage_count) { with (obj_collidebullet) { var _afim = instance_create(x, y, obj_bulletparent);
scr_image_copy(_afim, self);
_afim.image_alpha = 0; _afim.saved_alpha = ((other.afterimage_index + 1) / other.afterimage_count) * 0.4; afterimage[other.afterimage_index] = _afim; afterimage[other.afterimage_index].image_speed = 0; } afterimage_index++; alarm[0]
 = afterimage_interval;
} else { con++; } if (con == 1) { take_photo = true; if (multiple) alarm[0]
 = 10;
else alarm[0]
 = 15;
} if (con == 2 && difficulty >= 1) { if (difficulty >= 4) lerp_time = edit_time; if (difficulty >= 3) alarm[0]
 = edit_time;
else alarm[0]
 = random_range(20, 50);
} if (con == 3) alarm[0]
 = wait_time;
if (con == 4) event_user(1);
144
}
145
with (obj_lerpvar)
146
{
147
    if (i_ex(target) && iv_ex(target, "paused") && target.paused)
148
        time -= _total_time;
149
}
150
draw_set_blend_mode(bm_normal);
151
if (instance_exists(obj_shadowman_sax_attack))
152
{
153
    var _extra_surface = surface_create(640, 480);
154
    surface_set_target(_extra_surface);
155
    with (obj_shadowman_sax_attack)
156
    {
157
        event_user(6);
158
        freeze = true;
159
    }
160
    surface_reset_target();
161
    draw_set_alpha(1);
162
    extra_sprite = sprite_create_from_surface(_extra_surface, screenx(framex - (shotsize / 2)), screeny(framey - (shotsize / 2)), shotsize, shotsize, false, false, 0, 0);
163
    extra_sprite_obj = 
scr_marker
scr_marker

function
scr_marker(arg0, arg1, arg2)
{ thismarker = instance_create(arg0, arg1, obj_marker); with (thismarker) { sprite_index = arg2; image_speed = 0; } return thismarker; }
(framex - (shotsize / 2), framex - (shotsize / 2), extra_sprite);
164
    extra_sprite_obj.depth = obj_heart.depth + 1;
165
    surface_free(_extra_surface);
166
}
167
listsize = _index;
168
if (attacktype == 146)
169
{
170
    with (obj_dbulletcontroller)
171
    {
172
        btimer = -20;
173
        timermax *= 2.5;
174
    }
175
}