Deltarune (Chapter 2) script viewer

← back to main script listing

gml_Object_obj_virospear_Collision_obj_queenscreen

(view raw script w/o annotations or w/e)
1
var redscreen = 26;
2
if (
scr_onscreen
scr_onscreen

function
scr_onscreen(arg0)
{ obj = arg0; spacer = 0; if ((obj.x + obj.sprite_width + spacer) < camerax() || (obj.x - spacer) > (camerax() + 640) || (obj.y + obj.sprite_height + spacer) < cameray() || (obj.y - spacer) > (cameray() + 480)) return false; else return true; }
(id) &&
scr_onscreen_tolerance
scr_onscreen_tolerance

function
scr_onscreen_tolerance(arg0, arg1)
{ obj = arg0; spacer = arg1; if ((obj.x + obj.sprite_width + spacer) < camerax() || (obj.x - spacer) > (camerax() + 640) || (obj.y + obj.sprite_height + spacer) < cameray() || (obj.y - spacer) > (cameray() + 480)) return false; else return true; }
(other, 64) && active == 1 && other.aligned == 1 && other.image_index != redscreen && other.image_index != 9 && other.sprite_index != spr_queenscreen_red)
3
{
4
    make_simple_bullet = 0;
5
    simple_bullet_index = 0;
6
    cause_explosion = 0;
7
    speed = 0;
8
    active = 0;
9
    exploded = 1;
10
    if (other.image_index == 27 || other.image_index == 31)
11
    {
12
        other.extflag = 0;
13
        make_simple_bullet = 1;
14
        btype = "dancer";
15
    }
16
    if (other.image_index == 28)
17
    {
18
        make_simple_bullet = 1;
19
        simple_bullet_index = 2;
20
        btype = "virus";
21
    }
22
    if (other.image_index == 29 || other.extflag == 6)
23
    {
24
        cause_explosion = 1;
25
        btype = "bomb";
26
    }
27
    if (other.image_index == 37)
28
    {
29
        cause_explosion = 1;
30
        btype = "tribomb";
31
    }
32
    if (other.extflag == 11 && room == room_dw_cyber_viro_ring)
33
    {
34
        with (obj_ow_viroring)
35
            con = 99;
36
        with (obj_virospear)
37
            exploded = 1;
38
        safe_delete(obj_forcefield);
39
        safe_delete(obj_overworld_bulletarea);
40
        obj_mainchara.battlemode = 0;
41
        
scr_shakescreen
scr_shakescreen

function
scr_shakescreen()
{ instance_create(x, y, obj_shake); }
();
42
        snd_play(snd_won);
43
        global.flag[352 solved_viro_dodge] = 1;
44
    }
45
    if (other.extflag == 10)
46
    {
47
        global.flag[427 unlocked_mint_chest] = 1;
48
        plat = 
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; }
(758, 1150, spr_viroring_hiddenplatform);
49
        plat.depth = 998000;
50
        leftlight = instance_create(760, 1200, obj_cyber_wall_lights_left);
51
        leftlight.image_xscale = 1;
52
        leftlight.depth = plat.depth - 10;
53
        midlight = instance_create(802, 1200, obj_cyber_wall_lights);
54
        midlight.depth = plat.depth - 10;
55
        midlight2 = instance_create(842, 1200, obj_cyber_wall_lights);
56
        midlight2.depth = plat.depth - 10;
57
        rightlight = instance_create(864, 1200, obj_cyber_wall_lights_right);
58
        rightlight.depth = plat.depth - 12;
59
        chest = instance_create(844, 1144, obj_treasure_room);
60
        shake = instance_create(x, y, obj_shake);
61
        snd_play(snd_impact);
62
        with (obj_ow_viroring)
63
        {
64
            if (trigNum == 3)
65
                con = 99;
66
        }
67
        if (instance_exists(obj_overworld_bulletarea))
68
            obj_overworld_bulletarea.image_yscale = 22;
69
    }
70
    if (make_simple_bullet == 1)
71
    {
72
        b = instance_create(other.x, other.y, obj_overworldbulletparent);
73
        if (btype != "dancer")
74
        {
75
            b.sprite_index = spr_queenscreen_bullets;
76
            b.image_index = simple_bullet_index;
77
            b.image_speed = 0;
78
            b.tolerance = 10;
79
        }
80
        if (btype == "dancer")
81
        {
82
            b.sprite_index = spr_queenscreen_bullet_dance;
83
            b.image_speed = 0.25;
84
            b.tolerance = 10;
85
        }
86
        b.active = 1;
87
        b.target = 3;
88
        b.damage = 16;
89
        b.depth = 200;
90
        b.alarm[0] = -10;
91
        b.image_xscale = 2;
92
        b.image_yscale = 2;
93
        with (b)
94
            move_towards_point(obj_mainchara.x + 2, obj_mainchara.y + 4, 4);
95
        b.friction = -0.2;
96
    }
97
    if (cause_explosion == 1)
98
    {
99
        if (btype == "bomb")
100
        {
101
            with (other)
102
                instance_create(x, y, obj_viroroom_bomb);
103
        }
104
        if (btype == "tribomb")
105
        {
106
            with (other)
107
                instance_create(x, y, obj_viroroom_tribullet);
108
        }
109
    }
110
    if (other.extflag == 11)
111
        other.image_index = 42;
112
    else
113
        other.sprite_index = spr_queenscreen_red;
114
    active = 0;
115
    snd_play_pitch(snd_jump, 2.5);
116
}
117
if (other.image_index == 9 && active == 1 && room == room_dw_mansion_east_1f_d)
118
{
119
    if (other.x >= camerax() && other.x <= (camerax() + 640) && other.y >= cameray() && other.y <= (cameray() + 480))
120
    {
121
        other.tasquecon = 1;
122
        global.interact = 1;
123
        if (instance_exists(obj_ow_virokun_mansion_east_1f_d))
124
            obj_ow_virokun_mansion_east_1f_d.con = 1.5;
125
        if (instance_exists(obj_mainchara))
126
            obj_mainchara.battlemode = 0;
127
        if (instance_exists(obj_overworld_bulletarea))
128
        {
129
            with (obj_overworld_bulletarea)
130
                instance_destroy();
131
        }
132
        other.sprite_index = spr_queenscreen_red;
133
        if (instance_exists(obj_overworldbulletparent))
134
        {
135
            with (obj_overworldbulletparent)
136
                instance_destroy();
137
        }
138
        if (instance_exists(obj_virospear))
139
        {
140
            with (obj_virospear)
141
                instance_destroy();
142
        }
143
    }
144
}