Undertale Yellow script viewer

← back to main script listing

gml_Object_obj_attack_ace_dealing_controller_Create_0

(view raw script w/o annotations or w/e)
1
var battle_box = obj_dialogue_box_battle_transformation_any
2
var card_width = 41
3
var card_height = 61
4
var stack_x = battle_box.x - card_width * 0.5
5
var stack_y = battle_box.bbox_top - card_height - 12
6
var stack_y2 = battle_box.bbox_bottom + 12
7
var x_target = battle_box.bbox_left + 4
8
var y_target = battle_box.bbox_top + 4
9
for (var i = 1; i <= 8; i++)
10
{
11
    card_target_x[i] = x_target + 7 * i + card_width * (i - 1)
12
    card_target_y[i] = 6 + y_target + (max(0, sign(i - 4))) * (8 + card_height)
13
}
14
for (i = 1; i <= 4; i++)
15
{
16
    card[i] = instance_create(stack_x, stack_y, obj_attack_ace_dealing_cards)
17
    with (card[i])
18
    {
19
        card_target_x = other.card_target_x[i]
20
        card_target_y = other.card_target_y[i]
21
        card_id = i
22
    }
23
}
24
for (i = 1; i <= 4; i++)
25
{
26
    card[(i + 4)] = instance_create(stack_x, stack_y2, obj_attack_ace_dealing_cards)
27
    with (card[(i + 4)])
28
    {
29
        card_target_x = other.card_target_x[i]
30
        card_target_y = other.card_target_y[(i + 4)]
31
        card_id = i + 4
32
    }
33
}
34
alarm[0] = 30
alarm[0]

var inactive_card = irandom_range(1, 8) with (obj_attack_ace_dealing_cards) { if (card_id != inactive_card) event_perform(ev_alarm, 0) } if (attack_number <= 0) instance_destroy() attack_number--
35
attack_number = 3