ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/server/gods.C
(Generate patch)

Comparing deliantra/server/server/gods.C (file contents):
Revision 1.50 by root, Fri Nov 6 12:27:06 2009 UTC vs.
Revision 1.57 by root, Fri Mar 26 01:04:45 2010 UTC

1/* 1/*
2 * This file is part of Deliantra, the Roguelike Realtime MMORPG. 2 * This file is part of Deliantra, the Roguelike Realtime MMORPG.
3 * 3 *
4 * Copyright (©) 2005,2006,2007,2008 Marc Alexander Lehmann / Robin Redeker / the Deliantra team 4 * Copyright (©) 2005,2006,2007,2008,2009,2010 Marc Alexander Lehmann / Robin Redeker / the Deliantra team
5 * Copyright (©) 2002,2007 Mark Wedel & Crossfire Development Team 5 * Copyright (©) 2002 Mark Wedel & Crossfire Development Team
6 * Copyright (©) 1992,2007 Frank Tore Johansen 6 * Copyright (©) 1992 Frank Tore Johansen
7 * 7 *
8 * Deliantra is free software: you can redistribute it and/or modify it under 8 * Deliantra is free software: you can redistribute it and/or modify it under
9 * the terms of the Affero GNU General Public License as published by the 9 * the terms of the Affero GNU General Public License as published by the
10 * Free Software Foundation, either version 3 of the License, or (at your 10 * Free Software Foundation, either version 3 of the License, or (at your
11 * option) any later version. 11 * option) any later version.
36#include <sproto.h> 36#include <sproto.h>
37 37
38/** 38/**
39 * Returns the id of specified god. 39 * Returns the id of specified god.
40 */ 40 */
41int 41static int
42lookup_god_by_name (shstr_cmp name) 42lookup_god_by_name (shstr_cmp name)
43{ 43{
44 if (name) 44 if (name)
45 for (godlink *gl = first_god; gl; gl = gl->next) 45 for (godlink *gl = first_god; gl; gl = gl->next)
46 if (gl->name == name) 46 if (gl->name == name)
214 return 0; 214 return 0;
215 215
216 if (follower_has_similar_item (op, tr->item)) 216 if (follower_has_similar_item (op, tr->item))
217 return 0; 217 return 0;
218 218
219 object *tmp = arch_to_object (tr->item); 219 object *tmp = tr->item->instance ();
220 new_draw_info_format (NDI_UNIQUE, 0, op, "%s lets %s appear in your hands.", &god->name, query_short_name (tmp)); 220 new_draw_info_format (NDI_UNIQUE, 0, op, "%s lets %s appear in your hands.", &god->name, query_short_name (tmp));
221 op->insert (tmp); 221 op->insert (tmp);
222 222
223 return 1; 223 return 1;
224} 224}
282} 282}
283 283
284/** 284/**
285 * Unapplies up to number worth of items of type 285 * Unapplies up to number worth of items of type
286 */ 286 */
287void 287static void
288stop_using_item (object *op, int type, int number) 288stop_using_item (object *op, int type, int number)
289{ 289{
290 object *tmp; 290 object *tmp;
291 291
292 for (tmp = op->inv; tmp && number; tmp = tmp->below) 292 for (tmp = op->inv; tmp && number; tmp = tmp->below)
509 stop_using_item (op, GLOVES, 1); 509 stop_using_item (op, GLOVES, 1);
510 stop_using_item (op, SHIELD, 1); 510 stop_using_item (op, SHIELD, 1);
511 } 511 }
512 512
513 SET_FLAG (skop, FLAG_APPLIED); 513 SET_FLAG (skop, FLAG_APPLIED);
514 (void) change_abil (op, skop); 514 change_abil (op, skop);
515 515
516 /* return to previous skill status */ 516 /* return to previous skill status */
517 if (!sk_applied) 517 if (!sk_applied)
518 CLEAR_FLAG (skop, FLAG_APPLIED); 518 CLEAR_FLAG (skop, FLAG_APPLIED);
519 519
887 { 887 {
888 object *depl; 888 object *depl;
889 archetype *at; 889 archetype *at;
890 int i; 890 int i;
891 891
892 if ((at = archetype::find (ARCH_DEPLETION)) == NULL) 892 if ((at = archetype::find (shstr_depletion)) == NULL)
893 { 893 {
894 LOG (llevError, "Could not find archetype depletion.\n"); 894 LOG (llevError, "Could not find archetype depletion.\n");
895 continue; 895 continue;
896 } 896 }
897 897
1063 } 1063 }
1064 } 1064 }
1065} 1065}
1066 1066
1067/** 1067/**
1068 * Returns priest's god's id.
1069 * Straight calls lookup_god_by_name
1070 */
1071int
1072get_god (object *priest)
1073{
1074 return lookup_god_by_name (determine_god (priest));
1075}
1076
1077/**
1078 * Changes the attributes of cone, smite, and ball spells as needed by the code. 1068 * Changes the attributes of cone, smite, and ball spells as needed by the code.
1079 * Returns false if there was no race to assign to the slaying field of the spell, but 1069 * Returns false if there was no race to assign to the slaying field of the spell, but
1080 * the spell attacktype contains AT_HOLYWORD. -b.t. 1070 * the spell attacktype contains AT_HOLYWORD. -b.t.
1081 */ 1071 */
1082int 1072int

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines