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

Comparing deliantra/server/server/attack.C (file contents):
Revision 1.101 by root, Fri Dec 26 13:33:22 2008 UTC vs.
Revision 1.105 by root, Thu Jan 1 11:41:17 2009 UTC

79 int i, roll, saves = 0, attacks = 0, number; 79 int i, roll, saves = 0, attacks = 0, number;
80 materialtype_t *mt; 80 materialtype_t *mt;
81 81
82 if (!op->materialname) 82 if (!op->materialname)
83 { 83 {
84 for (mt = materialt; mt && mt->next; mt = mt->next) 84 for (mt = materialt; mt; mt = mt->next)
85 if (op->materials & mt->material) 85 if (op->materials & mt->material)
86 break; 86 break;
87 } 87 }
88 else 88 else
89 mt = name_to_material (op->materialname); 89 mt = name_to_material (op->materialname);
1068 if (attacknum == ATNR_INTERNAL) 1068 if (attacknum == ATNR_INTERNAL)
1069 return dam; 1069 return dam;
1070 1070
1071 if (hitter->slaying) 1071 if (hitter->slaying)
1072 { 1072 {
1073 if ((op->race && strstr (hitter->slaying, op->race)) 1073 if ((op->race && hitter->slaying.contains (op->race))
1074 || (op->arch && op->arch->archname && strstr (op->arch->archname, hitter->slaying))) 1074 || (op->arch && op->arch->archname && op->arch->archname.contains (hitter->slaying)))
1075 { 1075 {
1076 doesnt_slay = 0; 1076 doesnt_slay = 0;
1077 dam *= 3; 1077 dam *= 3;
1078 } 1078 }
1079 } 1079 }
1281 object *god = find_god (determine_god (owner)); 1281 object *god = find_god (determine_god (owner));
1282 int div = 1; 1282 int div = 1;
1283 1283
1284 /* if undead are not an enemy of your god, you turn them 1284 /* if undead are not an enemy of your god, you turn them
1285 * at half strength */ 1285 * at half strength */
1286 if (!god || !god->slaying || strstr (god->slaying, shstr_undead) == NULL) 1286 if (!god || !god->slaying || !god->slaying.contains (shstr_undead))
1287 div = 2; 1287 div = 2;
1288 1288
1289 /* Give a bonus if you resist turn undead */ 1289 /* Give a bonus if you resist turn undead */
1290 if (op->level * div < (turn_bonus[owner->stats.Wis] + owner->level + (op->resist[ATNR_TURN_UNDEAD] / 100))) 1290 if (op->level * div < (turn_bonus[owner->stats.Wis] + owner->level + (op->resist[ATNR_TURN_UNDEAD] / 100)))
1291 scare_creature (op, owner); 1291 scare_creature (op, owner);
1769 */ 1769 */
1770 if (type & AT_HOLYWORD) 1770 if (type & AT_HOLYWORD)
1771 { 1771 {
1772 object *god; 1772 object *god;
1773 1773
1774 if ((!hitter->slaying || 1774 if ((!hitter->slaying
1775 (!(op->race && strstr (hitter->slaying, op->race)) && 1775 || (!(op->race && hitter->slaying.contains (op->race))
1776 !(op->name && strstr (hitter->slaying, op->name)))) && 1776 && !(op->name && hitter->slaying.contains (op->name))))
1777 (!QUERY_FLAG (op, FLAG_UNDEAD) || 1777 && (!QUERY_FLAG (op, FLAG_UNDEAD)
1778 (hitter->title != NULL 1778 || (hitter->title
1779 && (god = find_god (determine_god (hitter))) != NULL && god->race != NULL && strstr (god->race, shstr_undead) != NULL))) 1779 && (god = find_god (determine_god (hitter))) != NULL
1780 && god->race
1781 && god->race.contains (shstr_undead))))
1780 return 0; 1782 return 0;
1781 } 1783 }
1782 1784
1783 maxattacktype = type; /* initialise this to something */ 1785 maxattacktype = type; /* initialise this to something */
1784 for (attacknum = 0; attacknum < NROFATTACKS; attacknum++, attacktype = 1 << attacknum) 1786 for (attacknum = 0; attacknum < NROFATTACKS; attacknum++, attacktype = 1 << attacknum)
2157 ** field of the deathstriking object */ 2159 ** field of the deathstriking object */
2158 2160
2159 int atk_lev, def_lev, kill_lev; 2161 int atk_lev, def_lev, kill_lev;
2160 2162
2161 if (hitter->slaying) 2163 if (hitter->slaying)
2162 if (!((QUERY_FLAG (op, FLAG_UNDEAD) && strstr (hitter->slaying, shstr_undead)) || (op->race && strstr (hitter->slaying, op->race)))) 2164 if (!((QUERY_FLAG (op, FLAG_UNDEAD) && hitter->slaying.contains (shstr_undead))
2165 || (op->race && hitter->slaying.contains (op->race))))
2163 return; 2166 return;
2164 2167
2165 def_lev = op->level; 2168 def_lev = op->level;
2166 if (def_lev < 1) 2169 if (def_lev < 1)
2167 { 2170 {
2266 { 2269 {
2267 /* target is unseen */ 2270 /* target is unseen */
2268 if (target->invisible || QUERY_FLAG (attacker, FLAG_BLIND)) 2271 if (target->invisible || QUERY_FLAG (attacker, FLAG_BLIND))
2269 adjust -= 10; 2272 adjust -= 10;
2270 /* dark map penalty for the hitter (lacks infravision if we got here). */ 2273 /* dark map penalty for the hitter (lacks infravision if we got here). */
2271 else if (target->map && target->map->darklevel () > 0 && !stand_in_light (target)) 2274 else if (!stand_in_light (target))
2272 adjust -= target->map->darklevel (); 2275 adjust -= target->map->darklevel ();
2273 } 2276 }
2274 2277
2275 if (QUERY_FLAG (attacker, FLAG_SCARED)) 2278 if (QUERY_FLAG (attacker, FLAG_SCARED))
2276 adjust -= 3; 2279 adjust -= 3;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines