1 | /* |
1 | /* |
2 | * CrossFire, A Multiplayer game for X-windows |
2 | * This file is part of Deliantra, the Roguelike Realtime MMORPG. |
3 | * |
3 | * |
4 | * Copyright (C) 2005, 2006, 2007 Marc Lehmann & Crossfire+ Development Team |
4 | * Copyright (©) 2005,2006,2007,2008 Marc Alexander Lehmann / Robin Redeker / the Deliantra team |
5 | * Copyright (C) 2002 Mark Wedel & Crossfire Development Team |
5 | * Copyright (©) 2002,2007 Mark Wedel & Crossfire Development Team |
6 | * Copyright (C) 1992 Frank Tore Johansen |
6 | * Copyright (©) 1992,2007 Frank Tore Johansen |
7 | * |
7 | * |
8 | * This program is free software; you can redistribute it and/or modify |
8 | * Deliantra is free software: you can redistribute it and/or modify |
9 | * it under the terms of the GNU General Public License as published by |
9 | * it under the terms of the GNU General Public License as published by |
10 | * the Free Software Foundation; either version 2 of the License, or |
10 | * the Free Software Foundation, either version 3 of the License, or |
11 | * (at your option) any later version. |
11 | * (at your option) any later version. |
12 | * |
12 | * |
13 | * This program is distributed in the hope that it will be useful, |
13 | * This program is distributed in the hope that it will be useful, |
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
16 | * GNU General Public License for more details. |
16 | * GNU General Public License for more details. |
17 | * |
17 | * |
18 | * You should have received a copy of the GNU General Public License |
18 | * You should have received a copy of the GNU General Public License |
19 | * along with this program; if not, write to the Free Software |
19 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
20 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
|
|
21 | * |
20 | * |
22 | * The authors can be reached via e-mail at <crossfire@schmorp.de> |
21 | * The authors can be reached via e-mail to <support@deliantra.net> |
23 | */ |
22 | */ |
24 | |
|
|
25 | |
23 | |
26 | /* Oct 3, 1995 - Code laid down for initial gods, priest alignment, and |
24 | /* Oct 3, 1995 - Code laid down for initial gods, priest alignment, and |
27 | * monster race initialization. b.t. |
25 | * monster race initialization. b.t. |
28 | */ |
26 | */ |
29 | |
27 | |
… | |
… | |
50 | godlink *gl; |
48 | godlink *gl; |
51 | |
49 | |
52 | for (gl = first_god; gl; gl = gl->next) |
50 | for (gl = first_god; gl; gl = gl->next) |
53 | if (!strncmp (name, gl->name, MIN ((size_t) strlen (gl->name), nmlen))) |
51 | if (!strncmp (name, gl->name, MIN ((size_t) strlen (gl->name), nmlen))) |
54 | break; |
52 | break; |
|
|
53 | |
55 | if (gl) |
54 | if (gl) |
56 | godnr = gl->id; |
55 | godnr = gl->id; |
57 | } |
56 | } |
|
|
57 | |
58 | return godnr; |
58 | return godnr; |
59 | } |
59 | } |
60 | |
60 | |
61 | /** |
61 | /** |
62 | * Returns pointer to specified god's object through pntr_to_god_obj.. |
62 | * Returns pointer to specified god's object through pntr_to_god_obj.. |
… | |
… | |
104 | { |
104 | { |
105 | |
105 | |
106 | /* find a god based on race */ |
106 | /* find a god based on race */ |
107 | if (!op->title) |
107 | if (!op->title) |
108 | { |
108 | { |
109 | if (op->race != NULL) |
109 | if (op->race) |
110 | { |
110 | { |
111 | godname = get_god_for_race (op->race); |
111 | godname = get_god_for_race (op->race); |
|
|
112 | |
112 | if (godname != NULL) |
113 | if (godname) |
113 | { |
|
|
114 | op->title = godname; |
114 | op->title = godname; |
115 | } |
|
|
116 | } |
115 | } |
117 | } |
116 | } |
118 | |
117 | |
119 | /* find a random god */ |
118 | /* find a random god */ |
120 | if (!op->title) |
119 | if (!op->title) |
… | |
… | |
124 | godnr = rndm (1, gl->id); |
123 | godnr = rndm (1, gl->id); |
125 | while (gl) |
124 | while (gl) |
126 | { |
125 | { |
127 | if (gl->id == godnr) |
126 | if (gl->id == godnr) |
128 | break; |
127 | break; |
|
|
128 | |
129 | gl = gl->next; |
129 | gl = gl->next; |
130 | } |
130 | } |
|
|
131 | |
131 | op->title = gl->name; |
132 | op->title = gl->name; |
132 | } |
133 | } |
133 | |
134 | |
134 | return op->title; |
135 | return op->title; |
135 | } |
136 | } |
… | |
… | |
140 | * that skill, once we find it, we can return, either with the |
141 | * that skill, once we find it, we can return, either with the |
141 | * title or "none". |
142 | * title or "none". |
142 | */ |
143 | */ |
143 | if (op->type == PLAYER) |
144 | if (op->type == PLAYER) |
144 | { |
145 | { |
145 | object *tmp; |
|
|
146 | |
|
|
147 | for (tmp = op->inv; tmp != NULL; tmp = tmp->below) |
146 | for (object *tmp = op->inv; tmp; tmp = tmp->below) |
148 | if (tmp->type == SKILL && tmp->subtype == SK_PRAYING) |
147 | if (tmp->type == SKILL && tmp->subtype == SK_PRAYING) |
149 | { |
148 | { |
150 | if (tmp->title) |
149 | if (tmp->title) |
151 | return (tmp->title); |
150 | return tmp->title; |
152 | else |
151 | else |
153 | return ("none"); |
152 | return "none"; |
154 | } |
153 | } |
155 | } |
154 | } |
|
|
155 | |
156 | return ("none"); |
156 | return "none"; |
157 | } |
157 | } |
158 | |
158 | |
159 | /** |
159 | /** |
160 | * Returns 1 if s1 and s2 are the same - either both NULL, or strcmp( ) == 0 |
160 | * Returns 1 if s1 and s2 are the same - either both NULL, or strcmp( ) == 0 |
161 | */ |
161 | */ |
… | |
… | |
171 | return 0; |
171 | return 0; |
172 | else |
172 | else |
173 | return strcmp (s1, s2) == 0; |
173 | return strcmp (s1, s2) == 0; |
174 | } |
174 | } |
175 | |
175 | |
176 | |
|
|
177 | /** |
176 | /** |
178 | * Checks for any occurrence of the given 'item' in the inventory of 'op' (recursively). |
177 | * Checks for any occurrence of the given 'item' in the inventory of 'op' (recursively). |
179 | * Any matching items in the inventory are deleted, and a |
178 | * Any matching items in the inventory are deleted, and a |
180 | * message is displayed to the player. |
179 | * message is displayed to the player. |
181 | */ |
180 | */ |
… | |
… | |
200 | if (tmp->nrof > 1) |
199 | if (tmp->nrof > 1) |
201 | new_draw_info_format (NDI_UNIQUE, 0, op, "The %s crumble to dust!", query_short_name (tmp)); |
200 | new_draw_info_format (NDI_UNIQUE, 0, op, "The %s crumble to dust!", query_short_name (tmp)); |
202 | else |
201 | else |
203 | new_draw_info_format (NDI_UNIQUE, 0, op, "The %s crumbles to dust!", query_short_name (tmp)); |
202 | new_draw_info_format (NDI_UNIQUE, 0, op, "The %s crumbles to dust!", query_short_name (tmp)); |
204 | |
203 | |
205 | tmp->remove (); /* remove obj from players inv. */ |
204 | tmp->destroy (); |
206 | esrv_del_item (op->contr, tmp->count); /* notify client */ |
|
|
207 | tmp->destroy (); /* free object */ |
|
|
208 | } |
205 | } |
209 | |
206 | |
210 | if (tmp->inv) |
207 | if (tmp->inv) |
211 | follower_remove_similar_item (tmp, item); |
208 | follower_remove_similar_item (tmp, item); |
212 | } |
209 | } |
… | |
… | |
238 | * God gives an item to the player. |
235 | * God gives an item to the player. |
239 | */ |
236 | */ |
240 | static int |
237 | static int |
241 | god_gives_present (object *op, object *god, treasure *tr) |
238 | god_gives_present (object *op, object *god, treasure *tr) |
242 | { |
239 | { |
243 | object *tmp; |
|
|
244 | |
|
|
245 | if (!tr->item) |
240 | if (!tr->item) |
246 | return 0; |
241 | return 0; |
247 | |
242 | |
248 | if (follower_has_similar_item (op, &tr->item->clone)) |
243 | if (follower_has_similar_item (op, tr->item)) |
249 | return 0; |
244 | return 0; |
250 | |
245 | |
251 | tmp = arch_to_object (tr->item); |
246 | object *tmp = arch_to_object (tr->item); |
252 | new_draw_info_format (NDI_UNIQUE, 0, op, "%s lets %s appear in your hands.", &god->name, query_short_name (tmp)); |
247 | new_draw_info_format (NDI_UNIQUE, 0, op, "%s lets %s appear in your hands.", &god->name, query_short_name (tmp)); |
253 | tmp = insert_ob_in_ob (tmp, op); |
248 | op->insert (tmp); |
254 | if (op->type == PLAYER) |
|
|
255 | esrv_send_item (op, tmp); |
|
|
256 | |
249 | |
257 | return 1; |
250 | return 1; |
258 | } |
251 | } |
259 | |
252 | |
260 | /** |
253 | /** |
… | |
… | |
274 | return; |
267 | return; |
275 | |
268 | |
276 | /* hmm. what happend depends on pl's current god, level, etc */ |
269 | /* hmm. what happend depends on pl's current god, level, etc */ |
277 | if (!pl_god) |
270 | if (!pl_god) |
278 | { /*new convert */ |
271 | { /*new convert */ |
279 | become_follower (pl, &altar->other_arch->clone); |
272 | become_follower (pl, altar->other_arch); |
280 | return; |
273 | return; |
281 | |
|
|
282 | } |
274 | } |
283 | else if (!strcmp (&pl_god->name, altar->other_arch->clone.name)) |
275 | else if (!strcmp (&pl_god->name, altar->other_arch->object::name)) |
284 | { |
276 | { |
285 | /* pray at your gods altar */ |
277 | /* pray at your gods altar */ |
286 | int bonus = (pl->stats.Wis + skill->level) / 10; |
278 | int bonus = (pl->stats.Wis + skill->level) / 10; |
287 | |
279 | |
288 | /* we can get neg grace up faster */ |
280 | /* we can get neg grace up faster */ |
289 | if (pl->stats.grace < 0) |
281 | if (pl->stats.grace < 0) |
290 | pl->stats.grace += (bonus > -1 * (pl->stats.grace / 10) ? bonus : -1 * (pl->stats.grace / 10)); |
282 | pl->stats.grace += (bonus > -1 * (pl->stats.grace / 10) ? bonus : -1 * (pl->stats.grace / 10)); |
|
|
283 | |
291 | /* we can super-charge grace to 2x max */ |
284 | /* we can super-charge grace to 2x max */ |
292 | if (pl->stats.grace < (2 * pl->stats.maxgrace)) |
285 | if (pl->stats.grace < 2 * pl->stats.maxgrace) |
293 | { |
|
|
294 | pl->stats.grace += bonus / 2; |
286 | pl->stats.grace += bonus / 2; |
295 | } |
287 | else |
296 | if (pl->stats.grace > (2 * pl->stats.maxgrace)) |
|
|
297 | { |
|
|
298 | pl->stats.grace = (2 * pl->stats.maxgrace); |
288 | pl->stats.grace = 2 * pl->stats.maxgrace; |
299 | } |
|
|
300 | |
289 | |
301 | /* Every once in a while, the god decides to checkup on their |
290 | /* Every once in a while, the god decides to checkup on their |
302 | * follower, and may intervene to help them out. |
291 | * follower, and may intervene to help them out. |
303 | */ |
292 | */ |
304 | bonus = MAX (1, bonus + MAX (pl->stats.luck, -3)); /* -- DAMN -- */ |
293 | bonus = MAX (1, bonus + MAX (pl->stats.luck, -3)); /* -- DAMN -- */ |
305 | |
294 | |
306 | if (((random_roll (0, 399, pl, PREFER_LOW)) - bonus) < 0) |
295 | if (((random_roll (0, 399, pl, PREFER_LOW)) - bonus) < 0) |
307 | god_intervention (pl, pl_god, skill); |
296 | god_intervention (pl, pl_god, skill); |
308 | |
|
|
309 | } |
297 | } |
310 | else |
298 | else |
311 | { /* praying to another god! */ |
299 | { /* praying to another god! */ |
312 | uint64 loss = 0; |
300 | uint64 loss = 0; |
313 | int angry = 1; |
301 | int angry = 1; |
… | |
… | |
317 | * points to the god of this altar (which we have |
305 | * points to the god of this altar (which we have |
318 | * already verified is non null). pl_god->other_arch |
306 | * already verified is non null). pl_god->other_arch |
319 | * is the opposing god - we need to verify that exists before |
307 | * is the opposing god - we need to verify that exists before |
320 | * using its values. |
308 | * using its values. |
321 | */ |
309 | */ |
322 | if (pl_god->other_arch && (altar->other_arch->name == pl_god->other_arch->name)) |
310 | if (pl_god->other_arch && (altar->other_arch->archname == pl_god->other_arch->archname)) |
323 | { |
311 | { |
324 | angry = 2; |
312 | angry = 2; |
325 | if (random_roll (0, skill->level + 2, pl, PREFER_LOW) - 5 > 0) |
313 | if (random_roll (0, skill->level + 2, pl, PREFER_LOW) - 5 > 0) |
326 | { |
314 | { |
327 | object *tmp; |
315 | object *tmp; |
… | |
… | |
348 | |
336 | |
349 | /* May switch Gods, but its random chance based on our current level |
337 | /* May switch Gods, but its random chance based on our current level |
350 | * note it gets harder to swap gods the higher we get |
338 | * note it gets harder to swap gods the higher we get |
351 | */ |
339 | */ |
352 | if ((angry == 1) && !(random_roll (0, skill->level, pl, PREFER_LOW))) |
340 | if ((angry == 1) && !(random_roll (0, skill->level, pl, PREFER_LOW))) |
353 | { |
|
|
354 | become_follower (pl, &altar->other_arch->clone); |
341 | become_follower (pl, altar->other_arch); |
355 | } |
|
|
356 | else |
342 | else |
357 | { |
343 | { |
358 | /* toss this player off the altar. He can try again. */ |
344 | /* toss this player off the altar. He can try again. */ |
359 | new_draw_info (NDI_UNIQUE | NDI_NAVY, 0, pl, "A divine force pushes you off the altar."); |
345 | new_draw_info (NDI_UNIQUE | NDI_NAVY, 0, pl, "A divine force pushes you off the altar."); |
|
|
346 | pl->contr->fire_on = 0; |
|
|
347 | pl->speed_left = 1.f; |
360 | move_player (pl, absdir (pl->facing + 4)); /* back him off the way he came. */ |
348 | move_player (pl, absdir (pl->facing + 4)); /* back him off the way he came. */ |
361 | } |
349 | } |
362 | } |
350 | } |
363 | } |
351 | } |
364 | |
352 | |
… | |
… | |
401 | { |
389 | { |
402 | object *item; |
390 | object *item; |
403 | |
391 | |
404 | if (!tr->item) |
392 | if (!tr->item) |
405 | continue; |
393 | continue; |
|
|
394 | |
406 | item = &tr->item->clone; |
395 | item = tr->item; |
407 | |
396 | |
408 | /* Basically, see if the matching spell is granted by this god. */ |
397 | /* Basically, see if the matching spell is granted by this god. */ |
409 | |
398 | |
410 | if (tr->item->clone.type == SPELL && tr->item->clone.name == tmp->name) |
399 | if (tr->item->type == SPELL && tr->item->object::name == tmp->name) |
411 | { |
400 | { |
412 | remove = 0; |
401 | remove = 0; |
413 | break; |
402 | break; |
414 | } |
403 | } |
415 | } |
404 | } |
|
|
405 | |
416 | if (remove) |
406 | if (remove) |
417 | { |
407 | do_forget_spell (op, tmp->name); |
418 | /* just do the work of removing the spell ourselves - we already |
|
|
419 | * know that the player knows the spell |
|
|
420 | */ |
|
|
421 | new_draw_info_format (NDI_UNIQUE | NDI_NAVY, 0, op, "You lose knowledge of %s.", &tmp->name); |
|
|
422 | player_unready_range_ob (op->contr, tmp); |
|
|
423 | tmp->destroy (); |
|
|
424 | } |
|
|
425 | |
|
|
426 | } |
408 | } |
427 | } |
409 | } |
428 | |
410 | |
429 | /** |
411 | /** |
430 | * This function is called whenever a player has |
412 | * This function is called whenever a player has |
… | |
… | |
438 | object *old_god = NULL; /* old god */ |
420 | object *old_god = NULL; /* old god */ |
439 | treasure *tr; |
421 | treasure *tr; |
440 | object *item, *skop, *next; |
422 | object *item, *skop, *next; |
441 | int i, sk_applied, undeadified = 0; /* Turns to true if changing god can changes the undead status of the player. */ |
423 | int i, sk_applied, undeadified = 0; /* Turns to true if changing god can changes the undead status of the player. */ |
442 | |
424 | |
443 | |
|
|
444 | old_god = find_god (determine_god (op)); |
425 | old_god = find_god (determine_god (op)); |
445 | |
426 | |
446 | /* take away any special god-characteristic items. */ |
427 | /* take away any special god-characteristic items. */ |
447 | for (item = op->inv; item != NULL; item = next) |
428 | for (item = op->inv; item; item = next) |
448 | { |
429 | { |
449 | next = item->below; |
430 | next = item->below; |
|
|
431 | |
450 | // remove all invisible startequip items which are not skill, exp or force |
432 | // remove all invisible startequip items which are not skill, exp or force |
451 | if (QUERY_FLAG (item, FLAG_STARTEQUIP) && item->invisible && |
433 | if (QUERY_FLAG (item, FLAG_STARTEQUIP) && item->invisible && |
452 | (item->type != SKILL) && (item->type != FORCE)) |
434 | (item->type != SKILL) && (item->type != FORCE)) |
453 | { |
435 | { |
454 | |
|
|
455 | if (item->type == SPELL) |
436 | if (item->type == SPELL) |
|
|
437 | { |
456 | new_draw_info_format (NDI_UNIQUE | NDI_NAVY, 0, op, "You lose knowledge of %s.", &item->name); |
438 | new_draw_info_format (NDI_UNIQUE | NDI_NAVY, 0, op, "You lose knowledge of %s.", &item->name); |
|
|
439 | esrv_remove_spell (op->contr, item); |
|
|
440 | } |
457 | |
441 | |
458 | player_unready_range_ob (op->contr, item); |
442 | player_unready_range_ob (op->contr, item); |
459 | item->destroy (); |
443 | item->destroy (); |
460 | } |
444 | } |
461 | } |
445 | } |
462 | |
446 | |
463 | /* remove any godgiven items from the old god */ |
447 | /* remove any godgiven items from the old god */ |
464 | if (old_god) |
448 | if (old_god) |
465 | { |
|
|
466 | for (tr = old_god->randomitems->items; tr != NULL; tr = tr->next) |
449 | for (tr = old_god->randomitems->items; tr; tr = tr->next) |
467 | { |
|
|
468 | if (tr->item && QUERY_FLAG (&tr->item->clone, FLAG_STARTEQUIP)) |
450 | if (tr->item && QUERY_FLAG (tr->item, FLAG_STARTEQUIP)) |
469 | follower_remove_similar_item (op, &tr->item->clone); |
451 | follower_remove_similar_item (op, tr->item); |
470 | } |
|
|
471 | } |
|
|
472 | |
452 | |
473 | if (!op || !new_god) |
453 | if (!op || !new_god) |
474 | return; |
454 | return; |
475 | |
455 | |
476 | if (op->race && new_god->slaying && strstr (op->race, new_god->slaying)) |
456 | if (op->race && new_god->slaying && strstr (op->race, new_god->slaying)) |
477 | { |
457 | { |
478 | new_draw_info_format (NDI_UNIQUE | NDI_NAVY, 0, op, "Fool! %s detests your kind!", &new_god->name); |
458 | new_draw_info_format (NDI_UNIQUE | NDI_NAVY, 0, op, "Fool! %s detests your kind!", &new_god->name); |
|
|
459 | |
479 | if (random_roll (0, op->level - 1, op, PREFER_LOW) - 5 > 0) |
460 | if (random_roll (0, op->level - 1, op, PREFER_LOW) - 5 > 0) |
480 | { |
461 | { |
481 | object *tmp = get_archetype (LOOSE_MANA); |
462 | object *tmp = get_archetype (LOOSE_MANA); |
482 | |
463 | |
483 | cast_magic_storm (op, tmp, new_god->level + 10); |
464 | cast_magic_storm (op, tmp, new_god->level + 10); |
484 | } |
465 | } |
|
|
466 | |
485 | return; |
467 | return; |
486 | } |
468 | } |
487 | |
469 | |
488 | |
|
|
489 | /* give the player any special god-characteristic-items. */ |
470 | /* give the player any special god-characteristic-items. */ |
490 | for (tr = new_god->randomitems->items; tr != NULL; tr = tr->next) |
471 | for (tr = new_god->randomitems->items; tr; tr = tr->next) |
491 | { |
472 | { |
492 | if (tr->item && tr->item->clone.invisible && tr->item->clone.type != SPELLBOOK && |
473 | if (tr->item && tr->item->invisible && tr->item->type != SPELLBOOK |
493 | tr->item->clone.type != BOOK && tr->item->clone.type != SPELL) |
474 | && tr->item->type != BOOK && tr->item->type != SPELL) |
494 | god_gives_present (op, new_god, tr); |
475 | god_gives_present (op, new_god, tr); |
495 | } |
476 | } |
496 | |
477 | |
497 | |
|
|
498 | new_draw_info_format (NDI_UNIQUE | NDI_NAVY, 0, op, "You become a follower of %s!", &new_god->name); |
478 | new_draw_info_format (NDI_UNIQUE | NDI_NAVY, 0, op, "You become a follower of %s!", &new_god->name); |
499 | |
479 | |
500 | for (skop = op->inv; skop != NULL; skop = skop->below) |
480 | for (skop = op->inv; skop; skop = skop->below) |
501 | if (skop->type == SKILL && skop->subtype == SK_PRAYING) |
481 | if (skop->type == SKILL && skop->subtype == SK_PRAYING) |
502 | break; |
482 | break; |
503 | |
483 | |
504 | /* Player has no skill - give them the skill */ |
484 | /* Player has no skill - give them the skill */ |
505 | if (!skop) |
485 | if (!skop) |
506 | { |
486 | { |
507 | /* The arhetype should always be defined - if we crash here because it doesn't, |
487 | /* The archetype should always be defined - if we crash here because it doesn't, |
508 | * things are really messed up anyways. |
488 | * things are really messed up anyways. |
509 | */ |
489 | */ |
510 | skop = give_skill_by_name (op, get_archetype_by_type_subtype (SKILL, SK_PRAYING)->clone.skill); |
490 | skop = give_skill_by_name (op, get_archetype_by_type_subtype (SKILL, SK_PRAYING)->skill); |
511 | link_player_skills (op); |
491 | link_player_skills (op); |
512 | } |
492 | } |
513 | |
493 | |
514 | sk_applied = QUERY_FLAG (skop, FLAG_APPLIED); /* save skill status */ |
494 | sk_applied = QUERY_FLAG (skop, FLAG_APPLIED); /* save skill status */ |
515 | |
495 | |
… | |
… | |
522 | CLEAR_FLAG (skop, FLAG_UNDEAD); |
502 | CLEAR_FLAG (skop, FLAG_UNDEAD); |
523 | undeadified = 1; |
503 | undeadified = 1; |
524 | } |
504 | } |
525 | |
505 | |
526 | if (skop->title) |
506 | if (skop->title) |
527 | { /* get rid of old god */ |
507 | { |
|
|
508 | /* get rid of old god */ |
528 | new_draw_info_format (NDI_UNIQUE, 0, op, "%s's blessing is withdrawn from you.", &skop->title); |
509 | new_draw_info_format (NDI_UNIQUE, 0, op, "%s's blessing is withdrawn from you.", &skop->title); |
|
|
510 | |
529 | /* The point of this is to really show what abilities the player just lost */ |
511 | /* The point of this is to really show what abilities the player just lost */ |
530 | if (sk_applied || undeadified) |
512 | if (sk_applied || undeadified) |
531 | { |
513 | { |
532 | |
|
|
533 | CLEAR_FLAG (skop, FLAG_APPLIED); |
514 | CLEAR_FLAG (skop, FLAG_APPLIED); |
534 | (void) change_abil (op, skop); |
515 | change_abil (op, skop); |
535 | } |
516 | } |
536 | } |
517 | } |
537 | |
518 | |
538 | /* now change to the new gods attributes to exp_obj */ |
519 | /* now change to the new gods attributes to exp_obj */ |
539 | skop->title = new_god->name; |
520 | skop->title = new_god->name; |
… | |
… | |
574 | * This also can happen for monks which cannot use weapons. In this case |
555 | * This also can happen for monks which cannot use weapons. In this case |
575 | * do not allow to use weapons even if the god otherwise would allow it. |
556 | * do not allow to use weapons even if the god otherwise would allow it. |
576 | */ |
557 | */ |
577 | if (!present_in_ob_by_name (FORCE, "no weapon force", op)) |
558 | if (!present_in_ob_by_name (FORCE, "no weapon force", op)) |
578 | update_priest_flag (new_god, skop, FLAG_USE_WEAPON); |
559 | update_priest_flag (new_god, skop, FLAG_USE_WEAPON); |
|
|
560 | |
579 | update_priest_flag (new_god, skop, FLAG_USE_ARMOUR); |
561 | update_priest_flag (new_god, skop, FLAG_USE_ARMOUR); |
580 | |
562 | |
581 | if (worship_forbids_use (op, skop, FLAG_USE_WEAPON, "weapons")) |
563 | if (worship_forbids_use (op, skop, FLAG_USE_WEAPON, "weapons")) |
582 | stop_using_item (op, WEAPON, 2); |
564 | stop_using_item (op, WEAPON, 2); |
583 | |
565 | |
… | |
… | |
609 | */ |
591 | */ |
610 | |
592 | |
611 | int |
593 | int |
612 | worship_forbids_use (object *op, object *exp_obj, uint32 flag, const char *string) |
594 | worship_forbids_use (object *op, object *exp_obj, uint32 flag, const char *string) |
613 | { |
595 | { |
614 | |
|
|
615 | if (QUERY_FLAG (&op->arch->clone, flag)) |
596 | if (QUERY_FLAG (op->arch, flag)) |
616 | if (QUERY_FLAG (op, flag) != QUERY_FLAG (exp_obj, flag)) |
597 | if (QUERY_FLAG (op, flag) != QUERY_FLAG (exp_obj, flag)) |
617 | { |
598 | { |
618 | update_priest_flag (exp_obj, op, flag); |
599 | update_priest_flag (exp_obj, op, flag); |
619 | if (QUERY_FLAG (op, flag)) |
600 | if (QUERY_FLAG (op, flag)) |
620 | new_draw_info_format (NDI_UNIQUE, 0, op, "You may use %s again.", string); |
601 | new_draw_info_format (NDI_UNIQUE, 0, op, "You may use %s again.", string); |
… | |
… | |
622 | { |
603 | { |
623 | new_draw_info_format (NDI_UNIQUE, 0, op, "You are forbidden to use %s.", string); |
604 | new_draw_info_format (NDI_UNIQUE, 0, op, "You are forbidden to use %s.", string); |
624 | return 1; |
605 | return 1; |
625 | } |
606 | } |
626 | } |
607 | } |
|
|
608 | |
627 | return 0; |
609 | return 0; |
628 | } |
610 | } |
629 | |
611 | |
630 | /** |
612 | /** |
631 | * Unapplies up to number worth of items of type |
613 | * Unapplies up to number worth of items of type |
… | |
… | |
668 | /* if (!(QUERY_FLAG(&(exp_ob->arch->clone),flag)))*/ |
650 | /* if (!(QUERY_FLAG(&(exp_ob->arch->clone),flag)))*/ |
669 | CLEAR_FLAG (exp_ob, flag); |
651 | CLEAR_FLAG (exp_ob, flag); |
670 | }; |
652 | }; |
671 | } |
653 | } |
672 | |
654 | |
673 | |
|
|
674 | |
|
|
675 | archetype * |
655 | archetype * |
676 | determine_holy_arch (object *god, const char *type) |
656 | determine_holy_arch (object *god, const char *type) |
677 | { |
657 | { |
678 | treasure *tr; |
658 | treasure *tr; |
679 | |
659 | |
680 | if (!god || !god->randomitems) |
660 | if (!god || !god->randomitems) |
681 | { |
661 | { |
682 | LOG (llevError, "BUG: determine_holy_arch(): no god or god without " "randomitems\n"); |
662 | LOG (llevError, "BUG: determine_holy_arch(): no god or god without " "randomitems\n"); |
683 | return NULL; |
663 | return 0; |
684 | } |
664 | } |
685 | |
665 | |
686 | for (tr = god->randomitems->items; tr != NULL; tr = tr->next) |
666 | for (tr = god->randomitems->items; tr; tr = tr->next) |
687 | { |
667 | { |
688 | object *item; |
|
|
689 | |
|
|
690 | if (!tr->item) |
668 | if (!tr->item) |
691 | continue; |
669 | continue; |
692 | |
670 | |
693 | item = &tr->item->clone; |
671 | object *item = tr->item; |
694 | |
672 | |
695 | if (item->type == BOOK && item->invisible && strcmp (item->name, type) == 0) |
673 | if (item->type == BOOK && item->invisible && strcmp (item->name, type) == 0) |
696 | return item->other_arch; |
674 | return item->other_arch; |
697 | } |
675 | } |
|
|
676 | |
698 | return NULL; |
677 | return 0; |
699 | } |
678 | } |
700 | |
679 | |
701 | /** |
680 | /** |
702 | * God helps player by removing curse and/or damnation. |
681 | * God helps player by removing curse and/or damnation. |
703 | */ |
682 | */ |
704 | static int |
683 | static int |
705 | god_removes_curse (object *op, int remove_damnation) |
684 | god_removes_curse (object *op, int remove_damnation) |
706 | { |
685 | { |
707 | object *tmp; |
|
|
708 | int success = 0; |
686 | int success = 0; |
709 | |
687 | |
710 | for (tmp = op->inv; tmp; tmp = tmp->below) |
688 | for (object *tmp = op->inv; tmp; tmp = tmp->below) |
711 | { |
689 | { |
712 | if (tmp->invisible) |
690 | if (tmp->invisible) |
713 | continue; |
691 | continue; |
|
|
692 | |
714 | if (QUERY_FLAG (tmp, FLAG_DAMNED) && !remove_damnation) |
693 | if (QUERY_FLAG (tmp, FLAG_DAMNED) && !remove_damnation) |
715 | continue; |
694 | continue; |
|
|
695 | |
716 | if (QUERY_FLAG (tmp, FLAG_CURSED) || QUERY_FLAG (tmp, FLAG_DAMNED)) |
696 | if (QUERY_FLAG (tmp, FLAG_CURSED) || QUERY_FLAG (tmp, FLAG_DAMNED)) |
717 | { |
697 | { |
718 | success = 1; |
698 | success = 1; |
719 | CLEAR_FLAG (tmp, FLAG_DAMNED); |
699 | CLEAR_FLAG (tmp, FLAG_DAMNED); |
720 | CLEAR_FLAG (tmp, FLAG_CURSED); |
700 | CLEAR_FLAG (tmp, FLAG_CURSED); |
721 | CLEAR_FLAG (tmp, FLAG_KNOWN_CURSED); |
701 | CLEAR_FLAG (tmp, FLAG_KNOWN_CURSED); |
722 | if (op->type == PLAYER) |
702 | |
|
|
703 | if (object *pl = tmp->visible_to ()) |
723 | esrv_send_item (op, tmp); |
704 | esrv_update_item (UPD_FLAGS, pl, tmp); |
724 | } |
705 | } |
725 | } |
706 | } |
726 | |
707 | |
727 | if (success) |
708 | if (success) |
728 | new_draw_info (NDI_UNIQUE, 0, op, "You feel like someone is helping you."); |
709 | new_draw_info (NDI_UNIQUE, 0, op, "You feel like someone is helping you."); |
|
|
710 | |
729 | return success; |
711 | return success; |
730 | } |
712 | } |
731 | |
713 | |
732 | static int |
714 | static int |
733 | follower_level_to_enchantments (int level, int difficulty) |
715 | follower_level_to_enchantments (int level, int difficulty) |
… | |
… | |
738 | return 0; |
720 | return 0; |
739 | } |
721 | } |
740 | |
722 | |
741 | if (level <= 20) |
723 | if (level <= 20) |
742 | return level / difficulty; |
724 | return level / difficulty; |
|
|
725 | |
743 | if (level <= 40) |
726 | if (level <= 40) |
744 | return (20 + (level - 20) / 2) / difficulty; |
727 | return (20 + (level - 20) / 2) / difficulty; |
|
|
728 | |
745 | return (30 + (level - 40) / 4) / difficulty; |
729 | return (30 + (level - 40) / 4) / difficulty; |
746 | } |
730 | } |
747 | |
731 | |
748 | /** |
732 | /** |
749 | * God wants to enchant weapon. |
733 | * God wants to enchant weapon. |
… | |
… | |
752 | * attacktype, slaying and such. |
736 | * attacktype, slaying and such. |
753 | */ |
737 | */ |
754 | static int |
738 | static int |
755 | god_enchants_weapon (object *op, object *god, object *tr, object *skill) |
739 | god_enchants_weapon (object *op, object *god, object *tr, object *skill) |
756 | { |
740 | { |
757 | char buf[MAX_BUF]; |
|
|
758 | object *weapon; |
741 | object *weapon; |
759 | uint32 attacktype; |
742 | uint32 attacktype; |
760 | int tmp; |
743 | int tmp; |
761 | |
744 | |
762 | for (weapon = op->inv; weapon; weapon = weapon->below) |
745 | for (weapon = op->inv; weapon; weapon = weapon->below) |
763 | if ((weapon->type == WEAPON || weapon->type == BOW) && QUERY_FLAG (weapon, FLAG_APPLIED)) |
746 | if ((weapon->type == WEAPON || weapon->type == BOW) && QUERY_FLAG (weapon, FLAG_APPLIED)) |
764 | break; |
747 | break; |
|
|
748 | |
765 | if (weapon == NULL || god_examines_item (god, weapon) <= 0) |
749 | if (!weapon || god_examines_item (god, weapon) <= 0) |
766 | return 0; |
750 | return 0; |
767 | |
751 | |
768 | /* First give it a title, so other gods won't touch it */ |
752 | /* First give it a title, so other gods won't touch it */ |
769 | if (!weapon->title) |
753 | if (!weapon->title) |
770 | { |
754 | { |
771 | sprintf (buf, "of %s", &god->name); |
755 | weapon->title = format ("of %s", &god->name); |
772 | weapon->title = buf; |
756 | |
773 | if (op->type == PLAYER) |
757 | if (object *pl = weapon->visible_to ()) |
774 | esrv_update_item (UPD_NAME, op, weapon); |
758 | esrv_update_item (UPD_NAME, pl, weapon); |
|
|
759 | |
775 | new_draw_info (NDI_UNIQUE, 0, op, "Your weapon quivers as if struck!"); |
760 | new_draw_info (NDI_UNIQUE, 0, op, "Your weapon quivers as if struck!"); |
776 | } |
761 | } |
777 | |
762 | |
778 | /* Allow the weapon to slay enemies */ |
763 | /* Allow the weapon to slay enemies */ |
779 | if (!weapon->slaying && god->slaying) |
764 | if (!weapon->slaying && god->slaying) |
… | |
… | |
796 | tmp = follower_level_to_enchantments (skill->level, tr->level); |
781 | tmp = follower_level_to_enchantments (skill->level, tr->level); |
797 | if (weapon->magic < tmp) |
782 | if (weapon->magic < tmp) |
798 | { |
783 | { |
799 | new_draw_info (NDI_UNIQUE, 0, op, "A phosphorescent glow envelops your weapon!"); |
784 | new_draw_info (NDI_UNIQUE, 0, op, "A phosphorescent glow envelops your weapon!"); |
800 | weapon->magic++; |
785 | weapon->magic++; |
801 | if (op->type == PLAYER) |
786 | |
|
|
787 | if (object *pl = weapon->visible_to ()) |
802 | esrv_update_item (UPD_NAME, op, weapon); |
788 | esrv_update_item (UPD_NAME, pl, weapon); |
|
|
789 | |
803 | return 1; |
790 | return 1; |
804 | } |
791 | } |
805 | |
792 | |
806 | return 0; |
793 | return 0; |
807 | } |
794 | } |
808 | |
|
|
809 | |
795 | |
810 | /** |
796 | /** |
811 | * Every once in a while the god will intervene to help the worshiper. |
797 | * Every once in a while the god will intervene to help the worshiper. |
812 | * Later, this fctn can be used to supply quests, etc for the |
798 | * Later, this fctn can be used to supply quests, etc for the |
813 | * priest. -b.t. |
799 | * priest. -b.t. |
814 | * called from pray_at_altar() currently. |
800 | * called from pray_at_altar() currently. |
815 | */ |
801 | */ |
816 | |
|
|
817 | void |
802 | void |
818 | god_intervention (object *op, object *god, object *skill) |
803 | god_intervention (object *op, object *god, object *skill) |
819 | { |
804 | { |
820 | treasure *tr; |
805 | treasure *tr; |
821 | |
806 | |
… | |
… | |
829 | |
814 | |
830 | /* lets do some checks of whether we are kosher with our god */ |
815 | /* lets do some checks of whether we are kosher with our god */ |
831 | if (god_examines_priest (op, god) < 0) |
816 | if (god_examines_priest (op, god) < 0) |
832 | return; |
817 | return; |
833 | |
818 | |
|
|
819 | op->play_sound (sound_find ("god_intervention")); |
834 | new_draw_info (NDI_UNIQUE, 0, op, "You feel a holy presence!"); |
820 | new_draw_info (NDI_UNIQUE, 0, op, "You feel a holy presence!"); |
835 | |
821 | |
836 | for (tr = god->randomitems->items; tr != NULL; tr = tr->next) |
822 | for (tr = god->randomitems->items; tr; tr = tr->next) |
837 | { |
823 | { |
838 | object *item; |
824 | object *item; |
839 | |
825 | |
840 | if (tr->chance <= random_roll (0, 99, op, PREFER_HIGH)) |
826 | if (tr->chance <= random_roll (0, 99, op, PREFER_HIGH)) |
841 | continue; |
827 | continue; |
842 | |
828 | |
843 | /* Treasurelist - generate some treasure for the follower */ |
829 | /* Treasurelist - generate some treasure for the follower */ |
844 | if (tr->name) |
830 | if (tr->name) |
845 | { |
831 | { |
846 | treasurelist *tl = find_treasurelist (tr->name); |
832 | treasurelist *tl = treasurelist::find (tr->name); |
847 | |
833 | |
848 | if (tl == NULL) |
834 | if (tl == NULL) |
849 | continue; |
835 | continue; |
850 | |
836 | |
851 | new_draw_info (NDI_UNIQUE, 0, op, "Something appears before your " "eyes. You catch it before it falls to the ground."); |
837 | new_draw_info (NDI_UNIQUE, 0, op, "Something appears before your eyes. You catch it before it falls to the ground."); |
852 | |
838 | |
853 | create_treasure (tl, op, GT_STARTEQUIP | GT_ONLY_GOOD | GT_UPDATE_INV, skill->level, 0); |
839 | create_treasure (tl, op, GT_STARTEQUIP | GT_ONLY_GOOD, skill->level, 0); |
854 | return; |
840 | return; |
855 | } |
841 | } |
856 | |
842 | |
857 | if (!tr->item) |
843 | if (!tr->item) |
858 | continue; |
844 | continue; |
859 | |
845 | |
860 | item = &tr->item->clone; |
846 | item = tr->item; |
861 | |
847 | |
862 | /* Grace limit */ |
848 | /* Grace limit */ |
863 | if (item->type == BOOK && item->invisible && strcmp (item->name, "grace limit") == 0) |
849 | if (item->type == BOOK && item->invisible && strcmp (item->name, "grace limit") == 0) |
864 | { |
850 | { |
865 | if (op->stats.grace < item->stats.grace || op->stats.grace < op->stats.maxgrace) |
851 | if (op->stats.grace < item->stats.grace || op->stats.grace < op->stats.maxgrace) |
… | |
… | |
872 | tmp = get_archetype (HOLY_POSSESSION); |
858 | tmp = get_archetype (HOLY_POSSESSION); |
873 | cast_change_ability (op, op, tmp, 0, 1); |
859 | cast_change_ability (op, op, tmp, 0, 1); |
874 | tmp->destroy (); |
860 | tmp->destroy (); |
875 | return; |
861 | return; |
876 | } |
862 | } |
|
|
863 | |
877 | continue; |
864 | continue; |
878 | } |
865 | } |
879 | |
866 | |
880 | /* Restore grace */ |
867 | /* Restore grace */ |
881 | if (item->type == BOOK && item->invisible && strcmp (item->name, "restore grace") == 0) |
868 | if (item->type == BOOK && item->invisible && strcmp (item->name, "restore grace") == 0) |
… | |
… | |
905 | /* Restore to 50 .. 100%, if sp < 50% */ |
892 | /* Restore to 50 .. 100%, if sp < 50% */ |
906 | int new_sp = (int) (random_roll (1000, 1999, op, PREFER_HIGH) / 2000.0 * max); |
893 | int new_sp = (int) (random_roll (1000, 1999, op, PREFER_HIGH) / 2000.0 * max); |
907 | |
894 | |
908 | if (op->stats.sp >= max / 2) |
895 | if (op->stats.sp >= max / 2) |
909 | continue; |
896 | continue; |
|
|
897 | |
910 | new_draw_info (NDI_UNIQUE, 0, op, "A blue lightning strikes " "your head but doesn't hurt you!"); |
898 | new_draw_info (NDI_UNIQUE, 0, op, "A blue lightning strikes your head but doesn't hurt you!"); |
911 | op->stats.sp = new_sp; |
899 | op->stats.sp = new_sp; |
912 | } |
900 | } |
913 | |
901 | |
914 | /* Various heal spells */ |
902 | /* Various heal spells */ |
915 | if (item->type == BOOK && item->invisible && strcmp (item->name, "heal spell") == 0) |
903 | if (item->type == BOOK && item->invisible && strcmp (item->name, "heal spell") == 0) |
916 | { |
904 | { |
917 | object *tmp; |
|
|
918 | int success; |
|
|
919 | |
|
|
920 | tmp = get_archetype_by_object_name (item->slaying); |
905 | object *tmp = archetype::get (item->slaying); |
921 | |
|
|
922 | success = cast_heal (op, op, tmp, 0); |
906 | int success = cast_heal (op, op, tmp, 0); |
923 | tmp->destroy (); |
907 | tmp->destroy (); |
|
|
908 | |
924 | if (success) |
909 | if (success) |
925 | return; |
910 | return; |
926 | else |
911 | else |
927 | continue; |
912 | continue; |
928 | } |
913 | } |
… | |
… | |
963 | continue; |
948 | continue; |
964 | |
949 | |
965 | new_draw_info (NDI_UNIQUE, 0, op, "Shimmering light surrounds and restores you!"); |
950 | new_draw_info (NDI_UNIQUE, 0, op, "Shimmering light surrounds and restores you!"); |
966 | |
951 | |
967 | for (i = 0; i < NUM_STATS; i++) |
952 | for (i = 0; i < NUM_STATS; i++) |
968 | if (get_attr_value (&depl->stats, i)) |
953 | if (depl->stats.stat (i)) |
969 | new_draw_info (NDI_UNIQUE, 0, op, restore_msg[i]); |
954 | new_draw_info (NDI_UNIQUE, 0, op, restore_msg[i]); |
970 | |
955 | |
971 | depl->destroy (); |
956 | depl->destroy (); |
972 | op->update_stats (); |
957 | op->update_stats (); |
973 | return; |
958 | return; |
974 | } |
959 | } |
975 | |
960 | |
976 | /* Voices */ |
961 | /* Voices */ |
977 | if (item->type == BOOK && item->invisible && strcmp (item->name, "voice_behind") == 0) |
962 | if (item->type == BOOK && item->invisible && strcmp (item->name, "voice_behind") == 0) |
978 | { |
963 | { |
979 | new_draw_info (NDI_UNIQUE, 0, op, "You hear a voice from behind you, but you don't dare to " "turn around:"); |
964 | new_draw_info (NDI_UNIQUE, 0, op, "You hear a voice from behind you, but you don't dare to turn around:"); |
980 | new_draw_info (NDI_WHITE, 0, op, item->msg); |
965 | new_draw_info (NDI_WHITE, 0, op, item->msg); |
981 | return; |
966 | return; |
982 | } |
967 | } |
983 | |
968 | |
984 | /* Messages */ |
969 | /* Messages */ |
… | |
… | |
1035 | { |
1020 | { |
1036 | int reaction = 1; |
1021 | int reaction = 1; |
1037 | object *item = NULL, *skop; |
1022 | object *item = NULL, *skop; |
1038 | |
1023 | |
1039 | for (item = op->inv; item; item = item->below) |
1024 | for (item = op->inv; item; item = item->below) |
1040 | { |
|
|
1041 | if (QUERY_FLAG (item, FLAG_APPLIED)) |
1025 | if (QUERY_FLAG (item, FLAG_APPLIED)) |
1042 | { |
|
|
1043 | reaction += god_examines_item (god, item) * (item->magic ? abs (item->magic) : 1); |
1026 | reaction += god_examines_item (god, item) * (item->magic ? abs (item->magic) : 1); |
1044 | } |
|
|
1045 | } |
|
|
1046 | |
1027 | |
1047 | /* well, well. Looks like we screwed up. Time for god's revenge */ |
1028 | /* well, well. Looks like we screwed up. Time for god's revenge */ |
1048 | if (reaction < 0) |
1029 | if (reaction < 0) |
1049 | { |
1030 | { |
1050 | int loss = 10000000; |
1031 | int loss = 10000000; |
1051 | int angry = abs (reaction); |
1032 | int angry = abs (reaction); |
1052 | |
1033 | |
1053 | for (skop = op->inv; skop != NULL; skop = skop->below) |
1034 | for (skop = op->inv; skop; skop = skop->below) |
1054 | if (skop->type == SKILL && skop->subtype == SK_PRAYING) |
1035 | if (skop->type == SKILL && skop->subtype == SK_PRAYING) |
1055 | break; |
1036 | break; |
1056 | |
1037 | |
1057 | if (skop) |
1038 | if (skop) |
1058 | loss = (int) (0.05 * (float) skop->stats.exp); |
1039 | loss = 0.05f * skop->stats.exp; |
|
|
1040 | |
1059 | change_exp (op, -random_roll (0, loss * angry - 1, op, PREFER_LOW), skop ? &skop->skill : "none", SK_SUBTRACT_SKILL_EXP); |
1041 | change_exp (op, -random_roll (0, loss * angry - 1, op, PREFER_LOW), skop ? &skop->skill : "none", SK_SUBTRACT_SKILL_EXP); |
|
|
1042 | |
1060 | if (random_roll (0, angry, op, PREFER_LOW)) |
1043 | if (random_roll (0, angry, op, PREFER_LOW)) |
1061 | { |
1044 | { |
1062 | object *tmp = get_archetype (LOOSE_MANA); |
1045 | object *tmp = get_archetype (LOOSE_MANA); |
1063 | |
1046 | |
1064 | cast_magic_storm (op, tmp, op->level + (angry * 3)); |
1047 | cast_magic_storm (op, tmp, op->level + (angry * 3)); |
1065 | } |
1048 | } |
|
|
1049 | |
1066 | new_draw_info_format (NDI_UNIQUE | NDI_NAVY, 0, op, "%s becomes angry and punishes you!", &god->name); |
1050 | new_draw_info_format (NDI_UNIQUE | NDI_NAVY, 0, op, "%s becomes angry and punishes you!", &god->name); |
1067 | } |
1051 | } |
|
|
1052 | |
1068 | return reaction; |
1053 | return reaction; |
1069 | } |
1054 | } |
1070 | |
1055 | |
1071 | /** |
1056 | /** |
1072 | * God checks item the player is using. |
1057 | * God checks item the player is using. |
… | |
… | |
1135 | |
1120 | |
1136 | if (race == NULL) |
1121 | if (race == NULL) |
1137 | return NULL; |
1122 | return NULL; |
1138 | while (gl) |
1123 | while (gl) |
1139 | { |
1124 | { |
1140 | if (!strcasecmp (gl->arch->clone.race, race)) |
1125 | if (!strcasecmp (gl->arch->race, race)) |
1141 | { |
1126 | { |
1142 | godname = gl->name; |
1127 | godname = gl->name; |
1143 | break; |
1128 | break; |
1144 | } |
1129 | } |
1145 | gl = gl->next; |
1130 | gl = gl->next; |