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.44 by root, Sun Apr 29 21:44:34 2007 UTC vs.
Revision 1.45 by root, Mon Apr 30 04:25:29 2007 UTC

850 contr->gen_hp = 0; 850 contr->gen_hp = 0;
851 contr->gen_sp = 0; 851 contr->gen_sp = 0;
852 contr->gen_grace = 0; 852 contr->gen_grace = 0;
853 contr->gen_sp_armour = 10; 853 contr->gen_sp_armour = 10;
854 contr->item_power = 0; 854 contr->item_power = 0;
855
856 /* Don't clobber all the range_ values. range_golem otherwise
857 * gets reset for no good reason, and we don't want to reset
858 * range_magic (what spell is readied). These three below
859 * well get filled in based on what the player has equipped.
860 */
861 contr->ranges[range_bow] = 0;
862 contr->ranges[range_misc] = 0;
863 contr->ranges[range_skill] = 0;
864 } 855 }
865 856
866 memcpy (body_used, body_info, sizeof (body_info)); 857 memcpy (body_used, body_info, sizeof (body_info));
867 858
868 slaying = 0; 859 slaying = 0;
979 || (tmp->type == SKILL 970 || (tmp->type == SKILL
980 && tmp->subtype == SK_PRAYING)) 971 && tmp->subtype == SK_PRAYING))
981 { 972 {
982 if (type == PLAYER) 973 if (type == PLAYER)
983 { 974 {
984 if (tmp->type == BOW)
985 contr->ranges[range_bow] = tmp;
986
987 if (tmp->type == WAND || tmp->type == ROD || tmp->type == HORN)
988 contr->ranges[range_misc] = tmp;
989
990 for (i = 0; i < NUM_STATS; i++) 975 for (i = 0; i < NUM_STATS; i++)
991 change_attr_value (&stats, i, get_attr_value (&tmp->stats, i)); 976 change_attr_value (&stats, i, get_attr_value (&tmp->stats, i));
992 977
993 /* these are the items that currently can change digestion, regeneration, 978 /* these are the items that currently can change digestion, regeneration,
994 * spell point recovery and mana point recovery. Seems sort of an arbitary 979 * spell point recovery and mana point recovery. Seems sort of an arbitary
1089 added_speed += tmp->stats.exp; 1074 added_speed += tmp->stats.exp;
1090 } 1075 }
1091 1076
1092 switch (tmp->type) 1077 switch (tmp->type)
1093 { 1078 {
1079 case WAND:
1080 case ROD:
1081 case HORN:
1082 if (type == PLAYER)
1083 {
1084 contr->ranged_skill = this;
1085 contr->ranged_ob = tmp;
1086 }
1087 break;
1088
1094 /* skills modifying the character -b.t. */ 1089 /* skills modifying the character -b.t. */
1095 /* for all skills and skill granting objects */ 1090 /* for all skills and skill granting objects */
1096 case SKILL: 1091 case SKILL:
1097 if (!QUERY_FLAG (tmp, FLAG_APPLIED)) 1092 if (!QUERY_FLAG (tmp, FLAG_APPLIED))
1098 break; 1093 break;
1119 if (tmp->magic) 1114 if (tmp->magic)
1120 stats.dam += tmp->magic; 1115 stats.dam += tmp->magic;
1121 } 1116 }
1122 1117
1123 if (tmp->stats.wc) 1118 if (tmp->stats.wc)
1124 wc -= (tmp->stats.wc + tmp->magic); 1119 wc -= tmp->stats.wc + tmp->magic;
1125 1120
1126 if (tmp->slaying) 1121 if (tmp->slaying)
1127 slaying = tmp->slaying; 1122 slaying = tmp->slaying;
1128 1123
1129 if (tmp->stats.ac) 1124 if (tmp->stats.ac)
1130 ac -= (tmp->stats.ac + tmp->magic); 1125 ac -= tmp->stats.ac + tmp->magic;
1131 1126
1132 if (settings.spell_encumbrance == TRUE && type == PLAYER) 1127 if (settings.spell_encumbrance == TRUE && type == PLAYER)
1133 contr->encumbrance += (int) 3 *tmp->weight / 1000; 1128 contr->encumbrance += (int) 3 *tmp->weight / 1000;
1134 1129
1135 if (type == PLAYER) 1130 if (type == PLAYER)
1131 {
1136 contr->ranges[range_skill] = this; 1132 contr->ranged_skill = this;
1133 contr->ranged_ob = tmp;
1134 }
1137 1135
1138 break; 1136 break;
1139 1137
1140 case SKILL_TOOL: 1138 case SKILL_TOOL:
1141 if (chosen_skill) 1139 if (chosen_skill)
1142 LOG (llevDebug, "fix_player, op %s has multiple skills applied\n", &name); 1140 LOG (llevDebug, "fix_player, op %s has multiple skills applied\n", &name);
1143 1141
1144 chosen_skill = tmp; 1142 chosen_skill = tmp;
1145 1143
1146 if (type == PLAYER) 1144 if (type == PLAYER)
1145 {
1147 contr->ranges[range_skill] = this; 1146 contr->ranged_skill = this;
1147 contr->ranged_ob = tmp;
1148 }
1148 break; 1149 break;
1149 1150
1150 case SHIELD: 1151 case SHIELD:
1151 if (settings.spell_encumbrance == TRUE && type == PLAYER) 1152 if (settings.spell_encumbrance == TRUE && type == PLAYER)
1152 contr->encumbrance += (int) tmp->weight / 2000; 1153 contr->encumbrance += (int) tmp->weight / 2000;
1166 if (tmp->stats.ac) 1167 if (tmp->stats.ac)
1167 ac -= tmp->stats.ac + tmp->magic; 1168 ac -= tmp->stats.ac + tmp->magic;
1168 1169
1169 break; 1170 break;
1170 1171
1172 case BOW:
1171 case WEAPON: 1173 case WEAPON:
1174 if (type != PLAYER
1175 || (contr->combat_skill && contr->combat_skill->type == SKILL && (skill_flags [contr->combat_skill->subtype] & SF_NEED_BOW ) && tmp->type == BOW )
1176 || (contr->combat_skill && contr->combat_skill->type == SKILL && (skill_flags [contr->combat_skill->subtype] & SF_NEED_WEAPON) && tmp->type == WEAPON))
1177 {
1172 wc -= tmp->stats.wc + tmp->magic; 1178 wc -= tmp->stats.wc + tmp->magic;
1173 1179
1174 if (tmp->stats.ac && tmp->stats.ac + tmp->magic > 0) 1180 if (tmp->stats.ac && tmp->stats.ac + tmp->magic > 0)
1175 ac -= tmp->stats.ac + tmp->magic; 1181 ac -= tmp->stats.ac + tmp->magic;
1176 1182
1177 stats.dam += tmp->stats.dam + tmp->magic; 1183 stats.dam += tmp->stats.dam + tmp->magic;
1178 weapon_weight = tmp->weight; 1184 weapon_weight = tmp->weight;
1179 weapon_speed = (WEAPON_SPEED (tmp) * 2 - tmp->magic) / 2; 1185 weapon_speed = (WEAPON_SPEED (tmp) * 2 - tmp->magic) / 2;
1180 1186
1181 if (weapon_speed < 0) 1187 if (weapon_speed < 0)
1182 weapon_speed = 0; 1188 weapon_speed = 0;
1183 1189
1184 slaying = tmp->slaying; 1190 slaying = tmp->slaying;
1185 1191
1186 /* If there is desire that two handed weapons should do 1192 /* If there is desire that two handed weapons should do
1187 * extra strength damage, this is where the code should 1193 * extra strength damage, this is where the code should
1188 * go. 1194 * go.
1189 */ 1195 */
1190 1196
1191 current_weapon = tmp; 1197 current_weapon = tmp;
1198
1199 if (type == PLAYER)
1200 {
1201 contr->combat_ob = tmp;
1202
1192 if (type == PLAYER && settings.spell_encumbrance) 1203 if (settings.spell_encumbrance)
1193 contr->encumbrance += tmp->weight * 3 / 1000; 1204 contr->encumbrance += tmp->weight * 3 / 1000;
1205 }
1206 }
1194 1207
1195 break; 1208 break;
1196 1209
1197 case ARMOUR: /* Only the best of these three are used: */ 1210 case ARMOUR: /* Only the best of these three are used: */
1198 if (settings.spell_encumbrance == TRUE && type == PLAYER) 1211 if (settings.spell_encumbrance == TRUE && type == PLAYER)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines