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

Comparing deliantra/server/common/living.C (file contents):
Revision 1.104 by root, Mon Nov 23 14:09:05 2009 UTC vs.
Revision 1.107 by root, Fri Mar 26 00:05:45 2010 UTC

1/* 1/*
2 * This file is part of Deliantra, the Roguelike Realtime MMORPG. 2 * This file is part of Deliantra, the Roguelike Realtime MMORPG.
3 * 3 *
4 * Copyright (©) 2005,2006,2007,2008 Marc Alexander Lehmann / Robin Redeker / the Deliantra team 4 * Copyright (©) 2005,2006,2007,2008,2009,2010 Marc Alexander Lehmann / Robin Redeker / the Deliantra team
5 * Copyright (©) 2002,2007 Mark Wedel & Crossfire Development Team 5 * Copyright (©) 2002,2007 Mark Wedel & Crossfire Development Team
6 * Copyright (©) 1992,2007 Frank Tore Johansen 6 * Copyright (©) 1992,2007 Frank Tore Johansen
7 * 7 *
8 * Deliantra is free software: you can redistribute it and/or modify it under 8 * Deliantra is free software: you can redistribute it and/or modify it under
9 * the terms of the Affero GNU General Public License as published by the 9 * the terms of the Affero GNU General Public License as published by the
262/* Rather than having a whole bunch of if (flag) new_draw.. else new_draw, 262/* Rather than having a whole bunch of if (flag) new_draw.. else new_draw,
263 * make this macro to clean those up. Not usuable outside change_abil 263 * make this macro to clean those up. Not usuable outside change_abil
264 * function since some of the values passed to new_draw_info are hardcoded. 264 * function since some of the values passed to new_draw_info are hardcoded.
265 */ 265 */
266#define DIFF_MSG(flag, msg1, msg2) \ 266#define DIFF_MSG(flag, msg1, msg2) \
267 new_draw_info(NDI_UNIQUE, 0, op, (flag>0)?msg1:msg2); 267 new_draw_info (NDI_UNIQUE, 0, op, (flag > 0) ? msg1 : msg2);
268 268
269/* return 1 if we sucessfully changed a stat, 0 if nothing was changed. */ 269/* return 1 if we sucessfully changed a stat, 0 if nothing was changed. */
270 270
271/* flag is set to 1 if we are applying the object, -1 if we are removing 271/* flag is set to 1 if we are applying the object, -1 if we are removing
272 * the object. 272 * the object.
415 (op->move_type & MOVE_FLY_LOW ? "You fly lower in the air" : "You float down to the ground.")); 415 (op->move_type & MOVE_FLY_LOW ? "You fly lower in the air" : "You float down to the ground."));
416 } 416 }
417 417
418 if (tmp->move_type & MOVE_SWIM) 418 if (tmp->move_type & MOVE_SWIM)
419 DIFF_MSG (flag, "You feel ready for a swim", "You no longer feel like swimming"); 419 DIFF_MSG (flag, "You feel ready for a swim", "You no longer feel like swimming");
420
421 /* Changing move status may mean you are affected by things you weren't before */
422 check_move_on (op, op);
423 } 420 }
424 421
425 /* becoming UNDEAD... a special treatment for this flag. Only those not 422 /* becoming UNDEAD... a special treatment for this flag. Only those not
426 * originally undead may change their status 423 * originally undead may change their status
427 */ 424 */
607 { 604 {
608 tmp = present_arch_in_ob (at, this); 605 tmp = present_arch_in_ob (at, this);
609 606
610 if (!tmp) 607 if (!tmp)
611 { 608 {
612 tmp = arch_to_object (at); 609 tmp = at->instance ();
613 tmp = insert_ob_in_ob (tmp, this); 610 tmp = insert_ob_in_ob (tmp, this);
614 SET_FLAG (tmp, FLAG_APPLIED); 611 SET_FLAG (tmp, FLAG_APPLIED);
615 } 612 }
616 } 613 }
617 614
637 if (!tmp) 634 if (!tmp)
638 { 635 {
639 if (!value) 636 if (!value)
640 return; 637 return;
641 638
642 tmp = arch_to_object (at); 639 tmp = at->instance ();
643 tmp = insert_ob_in_ob (tmp, this); 640 tmp = insert_ob_in_ob (tmp, this);
644 SET_FLAG (tmp, FLAG_APPLIED); 641 SET_FLAG (tmp, FLAG_APPLIED);
645 } 642 }
646 643
647 if (value) 644 if (value)
764 int prot[NROFATTACKS], vuln[NROFATTACKS], potion_resist[NROFATTACKS]; 761 int prot[NROFATTACKS], vuln[NROFATTACKS], potion_resist[NROFATTACKS];
765 object *grace_obj = NULL, *mana_obj = NULL, *tmp; 762 object *grace_obj = NULL, *mana_obj = NULL, *tmp;
766 float old_speed = speed; 763 float old_speed = speed;
767 int stat_sum [NUM_STATS]; 764 int stat_sum [NUM_STATS];
768 765
766 MoveType move_type; // we use change_move_type to change it, so use a local copy
767
769 /* First task is to clear all the values back to their original values */ 768 /* First task is to clear all the values back to their original values */
770 if (type == PLAYER) 769 if (type == PLAYER)
771 { 770 {
772 contr->delayed_update = false; 771 contr->delayed_update = false;
773 772
1401 if (move_type == 0) 1400 if (move_type == 0)
1402 move_type = MOVE_WALK; 1401 move_type = MOVE_WALK;
1403 else if (move_type & (MOVE_FLY_LOW | MOVE_FLY_HIGH)) 1402 else if (move_type & (MOVE_FLY_LOW | MOVE_FLY_HIGH))
1404 move_type &= ~MOVE_WALK; 1403 move_type &= ~MOVE_WALK;
1405 1404
1405 // now apply the new move_type
1406 if (this->move_type != move_type)
1407 change_move_type (move_type);
1408
1406 /* It is quite possible that a player's spell costing might have changed, 1409 /* It is quite possible that a player's spell costing might have changed,
1407 * so we will check that now. 1410 * so we will check that now.
1408 */ 1411 */
1409 if (is_player ()) 1412 if (is_player ())
1410 contr->update_spells (); 1413 contr->update_spells ();
1605 { 1608 {
1606 changed = true; 1609 changed = true;
1607 1610
1608 op->level++; 1611 op->level++;
1609 1612
1610 if (op && op == who && op->stats.exp > 1 && is_dragon_pl (who)) 1613 if (op && op == who && op->stats.exp > 1 && who->is_dragon ())
1611 dragon_level_gain (who); 1614 dragon_level_gain (who);
1612 1615
1613 /* Only roll these if it is the player (who) that gained the level */ 1616 /* Only roll these if it is the player (who) that gained the level */
1614 if (op == who && (who->level < 11) && who->type == PLAYER) 1617 if (op == who && (who->level < 11) && who->type == PLAYER)
1615 { 1618 {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines