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

Comparing deliantra/server/server/apply.C (file contents):
Revision 1.150 by root, Tue Apr 22 23:50:24 2008 UTC vs.
Revision 1.151 by root, Wed Apr 30 06:40:28 2008 UTC

2213 2213
2214 op->statusmsg ("Applying armour enchantment."); 2214 op->statusmsg ("Applying armour enchantment.");
2215 improve_armour (op, tmp, armor); 2215 improve_armour (op, tmp, armor);
2216} 2216}
2217 2217
2218extern void 2218void
2219apply_poison (object *op, object *tmp) 2219apply_poison (object *op, object *tmp)
2220{ 2220{
2221 object *poison = tmp->split (1);
2222
2221 if (op->type == PLAYER) 2223 if (op->type == PLAYER)
2222 { 2224 {
2223 op->contr->play_sound (sound_find ("drink_poison")); 2225 op->contr->play_sound (sound_find ("drink_poison"));
2224 op->failmsg ("Yech! That tasted poisonous!"); 2226 op->failmsg ("Yech! That tasted poisonous!");
2225 strcpy (op->contr->killer, "poisonous booze"); 2227 op->contr->killer = poison;
2226 } 2228 }
2227 2229
2228 if (tmp->stats.hp > 0) 2230 if (poison->stats.hp > 0)
2229 { 2231 {
2230 LOG (llevDebug, "Trying to poison player/monster for %d hp\n", tmp->stats.hp); 2232 LOG (llevDebug, "Trying to poison player/monster for %d hp\n", poison->stats.hp);
2231 hit_player (op, tmp->stats.hp, tmp, AT_POISON, 1); 2233 hit_player (op, poison->stats.hp, tmp, AT_POISON, 1);
2232 } 2234 }
2233 2235
2234 op->stats.food -= op->stats.food / 4; 2236 op->stats.food -= op->stats.food / 4;
2235 handle_apply_yield (tmp); 2237 handle_apply_yield (poison);
2236 tmp->decrease (); 2238 poison->destroy ();
2237} 2239}
2238 2240
2239/** 2241/**
2240 * This function return true if the exit is not a 2 ways one or it is 2 ways, valid exit. 2242 * This function return true if the exit is not a 2 ways one or it is 2 ways, valid exit.
2241 * A valid 2 way exit means: 2243 * A valid 2 way exit means:
3701 /* check for hp, sp change */ 3703 /* check for hp, sp change */
3702 if (food->stats.hp != 0) 3704 if (food->stats.hp != 0)
3703 { 3705 {
3704 if (QUERY_FLAG (food, FLAG_CURSED)) 3706 if (QUERY_FLAG (food, FLAG_CURSED))
3705 { 3707 {
3706 assign (who->contr->killer, food->name); 3708 who->contr->killer = food;
3707 hit_player (who, food->stats.hp, food, AT_POISON, 1); 3709 hit_player (who, food->stats.hp, food, AT_POISON, 1);
3708 who->failmsg ("Eck!...that was poisonous!"); 3710 who->failmsg ("Eck!...that was poisonous!");
3709 } 3711 }
3710 else 3712 else
3711 { 3713 {
3715 who->failmsg ("Eck!...that was poisonous!"); 3717 who->failmsg ("Eck!...that was poisonous!");
3716 3718
3717 who->stats.hp += food->stats.hp; 3719 who->stats.hp += food->stats.hp;
3718 } 3720 }
3719 } 3721 }
3722
3720 if (food->stats.sp != 0) 3723 if (food->stats.sp != 0)
3721 { 3724 {
3722 if (QUERY_FLAG (food, FLAG_CURSED)) 3725 if (QUERY_FLAG (food, FLAG_CURSED))
3723 { 3726 {
3724 who->failmsg ("You are drained of mana!"); 3727 who->failmsg ("You are drained of mana!");

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines