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.108 by root, Fri Mar 26 00:59:20 2010 UTC vs.
Revision 1.110 by root, Sun Mar 28 16:17:27 2010 UTC

810 path_repelled = arch->path_repelled; 810 path_repelled = arch->path_repelled;
811 path_denied = arch->path_denied; 811 path_denied = arch->path_denied;
812 glow_radius = arch->glow_radius; 812 glow_radius = arch->glow_radius;
813 move_type = arch->move_type; 813 move_type = arch->move_type;
814 814
815 chosen_skill = 0; 815 object *chosen_skill = 0;
816 816
817 /* initializing resistances from the values in player/monster's 817 /* initializing resistances from the values in player/monster's
818 * archetype clone 818 * archetype clone
819 */ 819 */
820 memcpy (&resist, &arch->resist, sizeof (resist)); 820 memcpy (&resist, &arch->resist, sizeof (resist));
895 * up, etc. 895 * up, etc.
896 */ 896 */
897 if ((tmp->flag [FLAG_APPLIED] 897 if ((tmp->flag [FLAG_APPLIED]
898 && tmp->type != CONTAINER 898 && tmp->type != CONTAINER
899 && tmp->type != CLOSE_CON) 899 && tmp->type != CLOSE_CON)
900 || (tmp->type == SKILL
901 && tmp->subtype == SK_PRAYING)) 900 || (tmp->type == SKILL && tmp->subtype == SK_PRAYING))
902 { 901 {
903 if (type == PLAYER) 902 if (type == PLAYER)
904 { 903 {
905 contr->item_power += tmp->item_power; 904 contr->item_power += tmp->item_power;
906 905
934 if (QUERY_FLAG (tmp, FLAG_APPLIED)) 933 if (QUERY_FLAG (tmp, FLAG_APPLIED))
935 for (int i = 0; i < NUM_BODY_LOCATIONS; i++) 934 for (int i = 0; i < NUM_BODY_LOCATIONS; i++)
936 slot[i].used += tmp->slot[i].info; 935 slot[i].used += tmp->slot[i].info;
937 936
938 if (tmp->type == SYMPTOM) 937 if (tmp->type == SYMPTOM)
939 speed_reduce_from_disease =
940 min (speed_reduce_from_disease, tmp->last_sp ? tmp->last_sp / 100.f : 1.f); 938 min_it (speed_reduce_from_disease, tmp->last_sp ? tmp->last_sp / 100.f : 1.f);
941 939
942 /* Pos. and neg. protections are counted separate (-> pro/vuln). 940 /* Pos. and neg. protections are counted separate (-> pro/vuln).
943 * (Negative protections are calculated exactly like positive.) 941 * (Negative protections are calculated exactly like positive.)
944 * Resistance from potions are treated special as well. If there's 942 * Resistance from potions are treated special as well. If there's
945 * more than one potion-effect, the bigger prot.-value is taken. 943 * more than one potion-effect, the bigger prot.-value is taken.
998 added_speed += tmp->stats.exp; 996 added_speed += tmp->stats.exp;
999 } 997 }
1000 998
1001 switch (tmp->type) 999 switch (tmp->type)
1002 { 1000 {
1003#if 0
1004 case WAND:
1005 case ROD:
1006 case HORN:
1007 if (type != PLAYER || current_weapon == tmp)
1008 chosen_skill = tmp;
1009 break;
1010#endif
1011
1012 /* skills modifying the character -b.t. */ 1001 /* skills modifying the character -b.t. */
1013 /* for all skills and skill granting objects */ 1002 /* for all skills and skill granting objects */
1014 case SKILL: 1003 case SKILL:
1015 { 1004 {
1016 if (!QUERY_FLAG (tmp, FLAG_APPLIED) || skill_flags [tmp->subtype] & SF_APPLY) 1005 if (!QUERY_FLAG (tmp, FLAG_APPLIED) || skill_flags [tmp->subtype] & SF_APPLY)
1051 1040
1052 if (tmp->stats.ac) 1041 if (tmp->stats.ac)
1053 ac -= tmp->stats.ac + tmp->magic; 1042 ac -= tmp->stats.ac + tmp->magic;
1054 1043
1055 if (settings.spell_encumbrance == TRUE && type == PLAYER) 1044 if (settings.spell_encumbrance == TRUE && type == PLAYER)
1056 contr->encumbrance += (int) 3 *tmp->weight / 1000; 1045 contr->encumbrance += 3 * tmp->weight / 1000;
1057 } 1046 }
1058 1047
1059 break; 1048 break;
1060 1049
1061 case SHIELD: 1050 case SHIELD:
1062 if (settings.spell_encumbrance == TRUE && type == PLAYER) 1051 if (settings.spell_encumbrance == TRUE && type == PLAYER)
1063 contr->encumbrance += (int) tmp->weight / 2000; 1052 contr->encumbrance += tmp->weight / 2000;
1053 //FALLTHROUGH
1064 case RING: 1054 case RING:
1065 case AMULET: 1055 case AMULET:
1066 case GIRDLE: 1056 case GIRDLE:
1067 case HELMET: 1057 case HELMET:
1068 case BOOTS: 1058 case BOOTS:
1077 if (tmp->stats.ac) 1067 if (tmp->stats.ac)
1078 ac -= tmp->stats.ac + tmp->magic; 1068 ac -= tmp->stats.ac + tmp->magic;
1079 1069
1080 break; 1070 break;
1081 1071
1072 case WAND:
1073 case ROD:
1074 case HORN:
1075 case SKILL_TOOL:
1076 if (type != PLAYER)
1077 chosen_skill = find_skill_by_name (this, tmp->skill);
1078 break;
1079
1082 case BOW: 1080 case BOW:
1083 case WEAPON: 1081 case WEAPON:
1084 if (type != PLAYER || current_weapon == tmp) 1082 if (type != PLAYER || current_weapon == tmp)
1085 { 1083 {
1084 chosen_skill = find_skill_by_name (this, tmp->skill);
1085
1086 wc -= tmp->stats.wc + tmp->magic; 1086 wc -= tmp->stats.wc + tmp->magic;
1087 1087
1088 if (tmp->stats.ac && tmp->stats.ac + tmp->magic > 0) 1088 if (tmp->stats.ac && tmp->stats.ac + tmp->magic > 0)
1089 ac -= tmp->stats.ac + tmp->magic; 1089 ac -= tmp->stats.ac + tmp->magic;
1090 1090
1148 1148
1149 break; 1149 break;
1150 } /* switch tmp->type */ 1150 } /* switch tmp->type */
1151 } /* item is equipped */ 1151 } /* item is equipped */
1152 } /* for loop of items */ 1152 } /* for loop of items */
1153
1154 if (type != PLAYER)
1155 this->chosen_skill = chosen_skill;
1153 1156
1154 glow_radius = min (glow_radius, MAX_LIGHT_RADIUS); 1157 glow_radius = min (glow_radius, MAX_LIGHT_RADIUS);
1155 1158
1156 /* We've gone through all the objects the player has equipped. For many things, we 1159 /* We've gone through all the objects the player has equipped. For many things, we
1157 * have generated intermediate values which we now need to assign. 1160 * have generated intermediate values which we now need to assign.

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines