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.50 by pippijn, Thu Mar 1 12:28:16 2007 UTC vs.
Revision 1.52 by root, Mon Mar 19 13:28:15 2007 UTC

1529 skill = owner->current_weapon->skill; 1529 skill = owner->current_weapon->skill;
1530 else 1530 else
1531 LOG (llevError, "kill_object - unable to find skill that killed monster\n"); 1531 LOG (llevError, "kill_object - unable to find skill that killed monster\n");
1532 1532
1533 /* We have the skill we want to credit to - now find the object this goes 1533 /* We have the skill we want to credit to - now find the object this goes
1534 * to. Make sure skop is an actual skill, and not a skill tool! 1534 * to. Make sure skop is an actual skill, and not a skill tool!
1535 */ 1535 */
1536 if ((!skop || skop->type != SKILL) && skill) 1536 if ((!skop || skop->type != SKILL) && skill)
1537 { 1537 {
1538 int i; 1538 int i;
1539 1539
2189 op->speed_left = (float) -(FABS (op->speed) * max); 2189 op->speed_left = (float) -(FABS (op->speed) * max);
2190 2190
2191/* tmp->stats.food = (signed short) (max/FABS(op->speed)); */ 2191/* tmp->stats.food = (signed short) (max/FABS(op->speed)); */
2192} 2192}
2193 2193
2194
2195/* Attempts to kill 'op'. hitter is the attack object, dam is 2194/* Attempts to kill 'op'. hitter is the attack object, dam is
2196 * the computed damaged. 2195 * the computed damaged.
2197 */ 2196 */
2198void 2197void
2199deathstrike_player (object *op, object *hitter, int *dam) 2198deathstrike_player (object *op, object *hitter, int *dam)
2216 if (def_lev < 1) 2215 if (def_lev < 1)
2217 { 2216 {
2218 LOG (llevError, "BUG: arch %s, name %s with level < 1\n", &op->arch->name, &op->name); 2217 LOG (llevError, "BUG: arch %s, name %s with level < 1\n", &op->arch->name, &op->name);
2219 def_lev = 1; 2218 def_lev = 1;
2220 } 2219 }
2220
2221 atk_lev = (hitter->chosen_skill ? hitter->chosen_skill->level : hitter->level) / 2; 2221 atk_lev = (hitter->chosen_skill ? hitter->chosen_skill->level : hitter->level) / 2;
2222 /* LOG(llevDebug,"Deathstrike - attack level %d, defender level %d\n", 2222 /* LOG(llevDebug,"Deathstrike - attack level %d, defender level %d\n",
2223 atk_lev, def_lev); */ 2223 atk_lev, def_lev); */
2224 2224
2225 if (atk_lev >= def_lev) 2225 if (atk_lev >= def_lev)
2240 */ 2240 */
2241 *dam *= kill_lev / def_lev; 2241 *dam *= kill_lev / def_lev;
2242 } 2242 }
2243 } 2243 }
2244 else 2244 else
2245 {
2246 *dam = 0; /* no harm done */ 2245 *dam = 0; /* no harm done */
2247 }
2248} 2246}
2249 2247
2250/* thrown_item_effect() - handles any special effects of thrown 2248/* thrown_item_effect() - handles any special effects of thrown
2251 * items (like attacking living creatures--a potion thrown at a 2249 * items (like attacking living creatures--a potion thrown at a
2252 * monster). 2250 * monster).

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines