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.209 by root, Fri Nov 6 12:49:19 2009 UTC vs.
Revision 1.210 by root, Fri Nov 6 13:03:34 2009 UTC

531 531
532/** 532/**
533 * This does the prepare weapon scroll. 533 * This does the prepare weapon scroll.
534 * Checks for sacrifice, and so on. 534 * Checks for sacrifice, and so on.
535 */ 535 */
536int 536static int
537prepare_weapon (object *op, object *improver, object *weapon) 537prepare_weapon (object *op, object *improver, object *weapon)
538{ 538{
539 int sacrifice_count, i; 539 int sacrifice_count, i;
540 char buf[MAX_BUF]; 540 char buf[MAX_BUF];
541 541
594 * 594 *
595 * We are hiding extra information about the weapon in the level and 595 * We are hiding extra information about the weapon in the level and
596 * last_eat numbers for an object. Hopefully this won't break anything ?? 596 * last_eat numbers for an object. Hopefully this won't break anything ??
597 * level == max improve last_eat == current improve 597 * level == max improve last_eat == current improve
598 */ 598 */
599int 599static int
600improve_weapon (object *op, object *improver, object *weapon) 600improve_weapon (object *op, object *improver, object *weapon)
601{ 601{
602 int sacrifice_count, sacrifice_needed = 0; 602 int sacrifice_count, sacrifice_needed = 0;
603 603
604 if (improver->stats.sp == IMPROVE_PREPARE) 604 if (improver->stats.sp == IMPROVE_PREPARE)
763 * the armour value of the piece of equipment exceed either 763 * the armour value of the piece of equipment exceed either
764 * the users level or 90) 764 * the users level or 90)
765 * Modified by MSW for partial resistance. Only support 765 * Modified by MSW for partial resistance. Only support
766 * changing of physical area right now. 766 * changing of physical area right now.
767 */ 767 */
768int 768static int
769improve_armour (object *op, object *improver, object *armour) 769improve_armour (object *op, object *improver, object *armour)
770{ 770{
771 object *tmp; 771 object *tmp;
772 772
773 if (armour->magic >= settings.armor_max_enchant) 773 if (armour->magic >= settings.armor_max_enchant)
2278 * 2278 *
2279 * Note: a owner in a 2 way exit is saved as the owner's name 2279 * Note: a owner in a 2 way exit is saved as the owner's name
2280 * in the field exit->name cause the field exit->owner doesn't 2280 * in the field exit->name cause the field exit->owner doesn't
2281 * survive in the swapping (in fact the whole exit doesn't survive). 2281 * survive in the swapping (in fact the whole exit doesn't survive).
2282 */ 2282 */
2283int 2283static int
2284is_legal_2ways_exit (object *op, object *exit) 2284is_legal_2ways_exit (object *op, object *exit)
2285{ 2285{
2286 if (exit->stats.exp != 1) 2286 if (exit->stats.exp != 1)
2287 return 1; /*This is not a 2 way, so it is legal */ 2287 return 1; /*This is not a 2 way, so it is legal */
2288 2288
2451} 2451}
2452 2452
2453/** 2453/**
2454 * This function generates a cursed effect for cursed lamps and torches. 2454 * This function generates a cursed effect for cursed lamps and torches.
2455 */ 2455 */
2456static void
2456void player_apply_lamp_cursed_effect (object *who, object *op) 2457player_apply_lamp_cursed_effect (object *who, object *op)
2457{ 2458{
2458 if (op->level) 2459 if (op->level)
2459 { 2460 {
2460 who->failmsg (format ( 2461 who->failmsg (format (
2461 "The %s was cursed, it explodes in a big fireball!", 2462 "The %s was cursed, it explodes in a big fireball!",
2476 * Apply for players and lamps 2477 * Apply for players and lamps
2477 * 2478 *
2478 * who - the player 2479 * who - the player
2479 * op - the lamp 2480 * op - the lamp
2480 */ 2481 */
2482static void
2481void player_apply_lamp (object *who, object *op) 2483player_apply_lamp (object *who, object *op)
2482{ 2484{
2483 bool switch_on = op->glow_radius ? false : true; 2485 bool switch_on = op->glow_radius ? false : true;
2484 2486
2485 if (switch_on) 2487 if (switch_on)
2486 { 2488 {
3186#define CANNOT_REMOVE_CURSED \ 3188#define CANNOT_REMOVE_CURSED \
3187 "H<You cannot remove cursed or damned items, you first have to remove the curse. " \ 3189 "H<You cannot remove cursed or damned items, you first have to remove the curse. " \
3188 "Praying over an altar, scrolls of remove curse/damnation, " \ 3190 "Praying over an altar, scrolls of remove curse/damnation, " \
3189 "priests or even other players might help.>" 3191 "priests or even other players might help.>"
3190 3192
3191int 3193static int
3192unapply_for_ob (object *who, object *op, int aflags) 3194unapply_for_ob (object *who, object *op, int aflags)
3193{ 3195{
3194 if (op->is_range ()) 3196 if (op->is_range ())
3195 for (object *tmp = who->inv; tmp; tmp = tmp->below) 3197 for (object *tmp = who->inv; tmp; tmp = tmp->below)
3196 if (QUERY_FLAG (tmp, FLAG_APPLIED) && tmp->is_range ()) 3198 if (QUERY_FLAG (tmp, FLAG_APPLIED) && tmp->is_range ())
3762 esrv_send_item (pl, op); 3764 esrv_send_item (pl, op);
3763 3765
3764 return 0; 3766 return 0;
3765} 3767}
3766 3768
3767int 3769static int
3768monster_apply_special (object *who, object *op, int aflags) 3770monster_apply_special (object *who, object *op, int aflags)
3769{ 3771{
3770 if (QUERY_FLAG (op, FLAG_UNPAID) && !QUERY_FLAG (op, FLAG_APPLIED)) 3772 if (QUERY_FLAG (op, FLAG_UNPAID) && !QUERY_FLAG (op, FLAG_APPLIED))
3771 return 1; 3773 return 1;
3772 3774

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines