Deltarune (Chapter 3) script viewer

← back to main script listing

gml_GlobalScript_scr_copybullet

(view raw script w/o annotations or w/e)
1
function 
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!!!!!"); } } }
(arg0 = 0, arg1 = true)
2
{
3
    if (arg0 == 0)
4
        arg0 = id;
5
    with (arg0)
6
    {
7
        bullet_values = 
8
        {
9
            gravity: gravity,
10
            speed: speed,
11
            direction: direction,
12
            gravity_direction: gravity_direction,
13
            friction: friction,
14
            image_blend: image_blend,
15
            destroyonhit: destroyonhit
16
        };
17
        if (arg1)
18
        {
19
            gravity = 0;
20
            speed = 0;
21
            friction = 0;
22
            gravity_direction = 270;
23
            direction = 0;
24
            destroyonhit = false;
25
        }
26
    }
27
}
28
29
function scr_pastebullet(arg0 = 0)
30
{
31
    if (arg0 == 0)
32
        arg0 = id;
33
    with (arg0)
34
    {
35
        if (v_ex("bullet_values"))
36
        {
37
            gravity = bullet_values.gravity;
38
            gravity_direction = bullet_values.gravity_direction;
39
            friction = bullet_values.friction;
40
            direction = bullet_values.direction;
41
            speed = bullet_values.speed;
42
            image_blend = bullet_values.image_blend;
43
            destroyonhit = bullet_values.destroyonhit;
44
        }
45
        else
46
        {
47
            debug_print("can't load values w/o saved values!!!!!");
48
        }
49
    }
50
}