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

Comparing deliantra/server/server/player.C (file contents):
Revision 1.136 by root, Wed May 16 11:10:01 2007 UTC vs.
Revision 1.138 by root, Thu May 17 20:27:01 2007 UTC

272 { 272 {
273 case WAND: 273 case WAND:
274 case ROD: 274 case ROD:
275 case HORN: 275 case HORN:
276 case BOW: 276 case BOW:
277 case SKILL:
278 case SKILL_TOOL: 277 case SKILL_TOOL:
279 case WEAPON: 278 case WEAPON:
280 apply_special (ob, op, AP_UNAPPLY); 279 op->flag [FLAG_APPLIED] = false;
281 apply_special (ob, op, AP_APPLY); 280 apply_special (ob, op, AP_APPLY);
282 break; 281 break;
283 } 282 }
284 283
285 ob->update_stats (); 284 ob->update_stats ();
2104 2103
2105 /* If the creature is a pet, push it even if the player is not 2104 /* If the creature is a pet, push it even if the player is not
2106 * peaceful. Our assumption is the creature is a pet if the 2105 * peaceful. Our assumption is the creature is a pet if the
2107 * player owns it and it is either friendly or unagressive. 2106 * player owns it and it is either friendly or unagressive.
2108 */ 2107 */
2109 if ((op->type == PLAYER) 2108 if (op->type == PLAYER
2110#if COZY_SERVER
2111 &&
2112 ((mon->owner && mon->owner->contr 2109 && ((mon->owner && mon->owner->contr
2113 && same_party (mon->owner->contr->party, op->contr->party)) || mon->owner == op) 2110 && same_party (mon->owner->contr->party, op->contr->party))
2114#else
2115 && mon->owner == op 2111 || mon->owner == op)
2116#endif
2117 && (QUERY_FLAG (mon, FLAG_UNAGGRESSIVE) || QUERY_FLAG (mon, FLAG_FRIENDLY))) 2112 && (QUERY_FLAG (mon, FLAG_UNAGGRESSIVE) || QUERY_FLAG (mon, FLAG_FRIENDLY)))
2118 { 2113 {
2119 /* If we're braced, we don't want to switch places with it */ 2114 /* If we're braced, we don't want to switch places with it */
2120 if (op->contr->braced) 2115 if (op->contr->braced)
2121 return; 2116 return;
2131 /* in certain circumstances, you shouldn't attack friendly 2126 /* in certain circumstances, you shouldn't attack friendly
2132 * creatures. Note that if you are braced, you can't push 2127 * creatures. Note that if you are braced, you can't push
2133 * someone, but put it inside this loop so that you won't 2128 * someone, but put it inside this loop so that you won't
2134 * attack them either. 2129 * attack them either.
2135 */ 2130 */
2136 if ((mon->type == PLAYER || mon->enemy != op) && 2131 if ((mon->type == PLAYER || mon->enemy != op)
2137 (mon->type == PLAYER || QUERY_FLAG (mon, FLAG_UNAGGRESSIVE) || QUERY_FLAG (mon, FLAG_FRIENDLY)) && ( 2132 && (mon->type == PLAYER || QUERY_FLAG (mon, FLAG_UNAGGRESSIVE) || QUERY_FLAG (mon, FLAG_FRIENDLY))
2138#ifdef PROHIBIT_PLAYERKILL
2139 (op->contr->peaceful 2133 && ((op->contr->peaceful
2140 || (mon->type == PLAYER 2134 || (mon->type == PLAYER && mon->contr->peaceful))
2141 && mon->contr->
2142 peaceful)) &&
2143#else
2144 op->contr->peaceful &&
2145#endif
2146 !on_battleground)) 2135 && !on_battleground))
2147 { 2136 {
2148 if (!op->contr->braced) 2137 if (!op->contr->braced)
2149 { 2138 {
2150 play_sound_map (op->map, op->x, op->y, SOUND_PUSH_PLAYER); 2139 play_sound_map (op->map, op->x, op->y, SOUND_PUSH_PLAYER);
2151 push_ob (mon, dir, op); 2140 push_ob (mon, dir, op);
2574 } 2563 }
2575 2564
2576 /* Digestion */ 2565 /* Digestion */
2577 if (--op->last_eat < 0) 2566 if (--op->last_eat < 0)
2578 { 2567 {
2579#ifdef COZY_SERVER
2580 int dg = op->contr->digestion >= 0 && op->contr->digestion < 2 ? 2 : op->contr->digestion;
2581 int bonus = dg > 0 ? dg : 0, penalty = dg < 0 ? -dg : 0;
2582#else
2583 int bonus = op->contr->digestion > 0 ? op->contr->digestion : 0, penalty = op->contr->digestion < 0 ? -op->contr->digestion : 0; 2568 int bonus = op->contr->digestion > 0 ? op->contr->digestion : 0, penalty = op->contr->digestion < 0 ? -op->contr->digestion : 0;
2584#endif
2585 2569
2586 if (op->contr->gen_hp > 0) 2570 if (op->contr->gen_hp > 0)
2587 op->last_eat = 25 * (1 + bonus) / (op->contr->gen_hp + penalty + 1); 2571 op->last_eat = 25 * (1 + bonus) / (op->contr->gen_hp + penalty + 1);
2588 else 2572 else
2589 op->last_eat = 25 * (1 + bonus) / (penalty + 1); 2573 op->last_eat = 25 * (1 + bonus) / (penalty + 1);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines