Debian Codegraph @

content/bgkeyring/src/quests/keyring/cutscenes/cheaters_cataclysm.uc

raw
1 /*
2 *
3 * Copyright (C) 2006 The Exult Team
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 *
19 *
20 * This source file contains some functions specific to a cutscene
21 * from the Keyring Quest. This happens only if the player hackmoves
22 * Laurianna (with roots) near her father. Maybe I will change it
23 * in the future to trigger when the player takes too long to
24 * bring Laurianna to her father, but not yet.
25 *
26 * Author: Marzo Junior
27 * Last Modified: 2006-02-27
28 */
29
30 enum Cataclism_levels {
31 LAURIANNA_DIES = 1,
32 LAURIANNA_INSANE = 2,
33 CATACLISM_START = 3,
34 ARMAGEDDON = 4,
35 END_GAME = 5
36 };
37
38 void beginCataclysm object#() () {
39 if ((event == LAURIANNA_DIES) || (event == LAURIANNA_INSANE)) {
40 //Begin a magic storm:
41 gflags[MAGIC_STORM_SPELL] = true;
42 UI_set_weather(3);
43
44 //Get party list and append Zauriel to it:
45 var party = UI_get_party_list();
46 party &= ZAURIEL;
47
48 //Make everyone SHY away:
49 for (member in party) {
50 member->set_schedule_type(SHY);
51 }
52
53 //Long, long earthquake:
54 UI_earthquake(3600);
55
56 if (event == LAURIANNA_DIES) {
57 //Halt the above scripts:
58 ZAURIEL->halt_scheduled();
59 AVATAR->halt_scheduled();
60
61 //Zauriel's message:
62 ZAURIEL.say("@NO! Thou hast forgotten the necklace! NOOOOO!@");
63 ZAURIEL.hide();
64
65 //Unfreeze Zauriel and Avatar:
66 ZAURIEL->unfreeze();
67 AVATAR->unfreeze();
68
69 struct<Position> pos = LAURIANNA->get_object_position();
70 //Laurianna will lie down unconscious and trigger the cataclysm:
71 UI_sprite_effect(ANIMATION_BIG_BLAST, pos.x, pos.y, 0, 0, 0, -1);
72 script LAURIANNA {
73 call trueFreeze;
74 nohalt;
75 sfx SOUND_BIG_BLAST;
76 wait 2;
77 say "@Aaahhhh...@";
78 wait 3;
79 actor frame bowing;
80 wait 3;
81 actor frame kneeling;
82 wait 3;
83 actor frame sleeping;
84 wait 3;
85 call beginCataclysm, CATACLISM_START;
86 }
87 } else {
88 LAURIANNA->set_schedule_type(DANCE);
89 //Laurianna has gone insane. Not used yet.
90 script LAURIANNA {
91 repeat 20 {
92 wait 6;
93 say "@Tra-la-la...@";
94 wait 6;
95 say "@Let the world burn!@";
96 wait 6;
97 say "@Fire is so pretty...@";
98 wait 6;
99 say "@Look! It burns!@";
100 wait 6;
101 say "@Wilt thou die? For me?@";
102 wait 6;
103 say "@Can I burn those flowers?@";
104 wait 6;
105 say "@Pretty birds. Dead birds.@";
106 };
107 }
108
109 script AVATAR after 18 ticks call beginCataclysm, CATACLISM_START;
110 }
111 } else if (event == CATACLISM_START) {
112 //Get party list and append Zauriel:
113 var party = UI_get_party_list();
114 party &= ZAURIEL;
115
116 //Select one of them randomly:
117 var rand = UI_get_random(UI_get_array_size(party));
118 var member = party[rand];
119
120 //Get position for the above NPC and for the Avatar:
121 struct<Position> npc_pos = member->get_object_position();
122 struct<Position> avatar_pos = AVATAR->get_object_position();
123 //Get a random position around the Avatar:
124 struct<Position> rand_pos = [
125 avatar_pos.x + UI_get_random(41) - 21,
126 avatar_pos.y + UI_get_random(41) - 21,
127 0
128 ];
129
130 //Random barks:
131 var barks = ["@Argh!@", "@Ouch!@", "@That hurts!@", "@Please stop!@"];
132 rand = UI_get_random(UI_get_array_size(barks));
133
134 //Exploding lightning bolts:
135 //One for the randomly selected party member:
136 UI_sprite_effect(ANIMATION_BIG_BLAST, npc_pos.x, npc_pos.y, 0, 0, 0, -1);
137 UI_sprite_effect(ANIMATION_LIGHTNING, npc_pos.x, npc_pos.y, 0, 0, 0, -1);
138 UI_play_sound_effect2(SOUND_BIG_BLAST, member);
139 member->reduce_health(HEALTH, UI_die_roll(3, 9), MAGIC_DAMAGE);
140 script member {
141 say barks[rand];
142 wait 2;
143 actor frame bowing;
144 wait 2;
145 actor frame kneeling;
146 wait 2;
147 actor frame bowing;
148 wait 2;
149 actor frame standing;
150 }
151
152 //One for the random position:
153 UI_sprite_effect(ANIMATION_BIG_BLAST, rand_pos.x, rand_pos.y, 0, 0, 0, -1);
154 UI_sprite_effect(ANIMATION_LIGHTNING, rand_pos.x, rand_pos.y, 0, 0, 0, -1);
155 UI_play_sound_effect2(SOUND_BIG_BLAST, AVATAR);
156
157 //Queue the next lightning bolts:
158 script AVATAR after 12 ticks call beginCataclysm, CATACLISM_START;
159
160 if (AVATAR->get_npc_prop(HEALTH) <= 5) {
161 //The Avatar is dying
162 //Halt cataclysm:
163 AVATAR->halt_scheduled();
164 //make Avatar lie down to die:
165 script AVATAR {
166 call trueFreeze;
167 say "@Too hurt...@";
168 wait 6;
169 actor frame bowing;
170 wait 2;
171 actor frame kneeling;
172 wait 2;
173 actor frame sleeping;
174 wait 6;
175 call beginCataclysm, END_GAME;
176 }
177 }
178 } else if (event == END_GAME) {
179 //Thus we reach the end of Britannia:
180 AVATAR.say("With your dying breath, you see the world of Britannia being sundered appart by violent earthquakes... then, darkness surrounds you.");
181 UI_restart_game();
182 }
183 }