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.86 by root, Fri May 11 20:06:33 2007 UTC vs.
Revision 1.87 by root, Fri May 11 21:07:14 2007 UTC

3156 switch (op->type) 3156 switch (op->type)
3157 { 3157 {
3158 case WEAPON: 3158 case WEAPON:
3159 if (!check_weapon_power (who, op->last_eat)) 3159 if (!check_weapon_power (who, op->last_eat))
3160 { 3160 {
3161 new_draw_info (NDI_UNIQUE, 0, who, "This weapon is too powerful for you to use."); 3161 new_draw_info (NDI_UNIQUE, 0, who, "This weapon is too powerful for you to use.\n"
3162 new_draw_info (NDI_UNIQUE, 0, who, "It would consume your soul!."); 3162 "It would consume your soul!.");
3163 3163
3164 if (tmp) 3164 if (tmp)
3165 insert_ob_in_ob (tmp, who); 3165 insert_ob_in_ob (tmp, who);
3166 3166
3167 return 1; 3167 return 1;
3189 3189
3190 SET_FLAG (op, FLAG_APPLIED); 3190 SET_FLAG (op, FLAG_APPLIED);
3191 change_skill (who, skop, 1); 3191 change_skill (who, skop, 1);
3192 3192
3193 if (who->contr) 3193 if (who->contr)
3194 {
3195 who->contr->combat_ob = op; 3194 who->set_weapon (who->contr->combat_ob = op);
3196 who->current_weapon = op;
3197 }
3198 3195
3199 if (!QUERY_FLAG (who, FLAG_READY_WEAPON)) 3196 if (!QUERY_FLAG (who, FLAG_READY_WEAPON))
3200 SET_FLAG (who, FLAG_READY_WEAPON); 3197 SET_FLAG (who, FLAG_READY_WEAPON);
3201 3198
3202 new_draw_info_format (NDI_UNIQUE, 0, who, "You wield %s.", query_name (op)); 3199 new_draw_info_format (NDI_UNIQUE, 0, who, "You wield %s.", query_name (op));
3280 if (skill_flags [op->subtype] & SF_NEED_WEAPON) 3277 if (skill_flags [op->subtype] & SF_NEED_WEAPON)
3281 { 3278 {
3282 for (object *item = who->inv; item; item = item->below) 3279 for (object *item = who->inv; item; item = item->below)
3283 if (item->type == WEAPON && item->flag [FLAG_APPLIED]) 3280 if (item->type == WEAPON && item->flag [FLAG_APPLIED])
3284 { 3281 {
3285 pl->combat_ob = who->current_weapon = item; 3282 who->set_weapon (pl->combat_ob = item);
3286 goto found_weapon; 3283 goto found_weapon;
3287 } 3284 }
3288 3285
3289 new_draw_info (NDI_UNIQUE, 0, who, "You need to apply a melee weapon before readying this skill"); 3286 new_draw_info (NDI_UNIQUE, 0, who, "You need to apply a melee weapon before readying this skill");
3290 return 1; 3287 return 1;
3291 3288
3292 found_weapon:; 3289 found_weapon:;
3293 } 3290 }
3294 else 3291 else
3295 {
3296 pl->combat_ob = op; 3292 who->set_weapon (pl->combat_ob = op);
3297 op->current_weapon = 0;
3298 }
3299 } 3293 }
3300 else if (IS_RANGED_SKILL (op->subtype)) 3294 else if (IS_RANGED_SKILL (op->subtype))
3301 { 3295 {
3302 if (skill_flags [op->subtype] & SF_NEED_BOW) 3296 if (skill_flags [op->subtype] & SF_NEED_BOW)
3303 { 3297 {
3304 for (object *item = who->inv; item; item = item->below) 3298 for (object *item = who->inv; item; item = item->below)
3305 if (item->type == BOW && item->flag [FLAG_APPLIED]) 3299 if (item->type == BOW && item->flag [FLAG_APPLIED])
3306 { 3300 {
3307 pl->ranged_ob = who->current_weapon = item; 3301 who->set_weapon (pl->ranged_ob = item);
3308 goto found_bow; 3302 goto found_bow;
3309 } 3303 }
3310 3304
3311 new_draw_info (NDI_UNIQUE, 0, who, "You need to apply a missile weapon before readying this skill"); 3305 new_draw_info (NDI_UNIQUE, 0, who, "You need to apply a missile weapon before readying this skill");
3312 return 1; 3306 return 1;
3317 { 3311 {
3318 for (object *item = who->inv; item; item = item->below) 3312 for (object *item = who->inv; item; item = item->below)
3319 if (item->flag [FLAG_APPLIED] 3313 if (item->flag [FLAG_APPLIED]
3320 && (item->type == WAND || item->type == ROD || item->type == HORN)) 3314 && (item->type == WAND || item->type == ROD || item->type == HORN))
3321 { 3315 {
3322 pl->ranged_ob = who->current_weapon = item; 3316 who->set_weapon (pl->ranged_ob = item);
3323 goto found_item; 3317 goto found_item;
3324 } 3318 }
3325 3319
3326 new_draw_info (NDI_UNIQUE, 0, who, "You need to apply a magic item before readying this skill"); 3320 new_draw_info (NDI_UNIQUE, 0, who, "You need to apply a magic item before readying this skill");
3327 return 1; 3321 return 1;
3328 3322
3329 found_item:; 3323 found_item:;
3330 } 3324 }
3331 else 3325 else
3332 {
3333 pl->ranged_ob = op; 3326 who->set_weapon (pl->ranged_ob = op);
3334 op->current_weapon = 0;
3335 }
3336 } 3327 }
3337 3328
3338 if (!op->invisible) 3329 if (!op->invisible)
3339 { 3330 {
3340 new_draw_info_format (NDI_UNIQUE, 0, who, "You ready %s.", query_name (op)); 3331 new_draw_info_format (NDI_UNIQUE, 0, who, "You ready %s.", query_name (op));

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines