Deltarune (Chapter 3) script viewer

← back to main script listing

gml_Object_obj_tennatalkbubble_Step_0

(view raw script w/o annotations or w/e)
1
if (init == 0)
2
{
3
    if (tenna == -1)
4
        tenna = instance_find(obj_actor_tenna, 0);
5
    truetext = string_hash_to_newline(text);
6
    if (clear)
7
    {
8
        with (object_index)
9
        {
10
            if (id != other.id)
11
                instance_destroy();
12
        }
13
    }
14
    if (lifetime == -1)
15
        lifetime = string_length(text) * 4;
16
    if (i_ex(tenna))
17
        tennaDist = distance_to_point(tenna.x, tenna.y - (sprite_get_height(tenna.sprite_index) * tenna.image_yscale * 0.55));
18
    if (speaker != -1)
19
    {
20
        if (speaker == "none" || speaker == "")
21
            talksnd = 14;
22
        if (speaker == "ralsei" || speaker == "Ralsei" || speaker == "ra" || speaker == "r")
23
        {
24
            dropColor = hexcolor(#6FD213);
25
            talksnd = 131;
26
        }
27
        if (speaker == "susie" || speaker == "Susie" || speaker == "su" || speaker == "s")
28
        {
29
            dropColor = hexcolor(#740C83);
30
            talksnd = 128;
31
        }
32
        if (speaker == "tenna" || speaker == "Tenna" || speaker == "te" || speaker == "t")
33
        {
34
            specialtalk = "tenna";
35
            dropColor = 65535;
36
            talksnd = 128;
37
        }
38
        if (speaker == "lancer" || speaker == "Lancer" || speaker == "la" || speaker == "l")
39
        {
40
            dropColor = 12420437;
41
            talksnd = 134;
42
        }
43
    }
44
    else
45
    {
46
        speaker = "tenna";
47
        specialtalk = "tenna";
48
        dropColor = 65535;
49
        talksnd = 128;
50
        talkrate = 3;
51
        talkcount = 5;
52
    }
53
    if (talk == true)
54
    {
55
        if (specialtalk == "none")
56
        {
57
            for (var i = 0; i < talkcount; i++)
58
                snd_play_delay(talksnd, talkdelay + (i * talkrate), 1, 1 + (i * pitchmod));
59
        }
60
        if (specialtalk == "tenna")
61
        {
62
            for (var i = 0; i < talkcount; i++)
63
            {
64
                audio_stop_sound(snd_tv_voice_short);
65
                audio_stop_sound(snd_tv_voice_short_2);
66
                audio_stop_sound(snd_tv_voice_short_3);
67
                audio_stop_sound(snd_tv_voice_short_4);
68
                audio_stop_sound(snd_tv_voice_short_5);
69
                audio_stop_sound(snd_tv_voice_short_6);
70
                audio_stop_sound(snd_tv_voice_short_7);
71
                audio_stop_sound(snd_tv_voice_short_8);
72
                audio_stop_sound(snd_tv_voice_short_9);
73
                var pitchrandom = 0.86 + random(0.35);
74
                var soundindex = "snd_tv_voice_short";
75
                var rand = irandom(8) + 1;
76
                if (rand >= 2)
77
                    soundindex += ("_" + string(rand));
78
                soundindex = asset_get_index(soundindex);
79
                snd_play_delay(soundindex, talkdelay + (i * talkrate), 0.7, pitchrandom);
80
            }
81
        }
82
    }
83
    init = 1;
84
}
85
if (init)
86
{
87
    if (bubbletype == 0)
88
    {
89
        tx = tenna.x;
90
        ty = tenna.y - (sprite_get_height(tenna.sprite_index) * tenna.image_yscale * 0.55);
91
    }
92
    timer++;
93
    if (timer >= lifetime)
94
        instance_destroy();
95
}