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.79 by root, Tue May 1 05:48:20 2007 UTC vs.
Revision 1.80 by root, Thu May 3 04:50:27 2007 UTC

3221 insert_ob_in_ob (tmp, who); 3221 insert_ob_in_ob (tmp, who);
3222 3222
3223 return 1; 3223 return 1;
3224 } 3224 }
3225 3225
3226 if (!skop)
3227 {
3228 new_draw_info_format (NDI_UNIQUE, 0, who, "The %s is broken, please report this to the dungeon master!", query_name (op));//TODO
3229 return 1;
3230 }
3231
3226 SET_FLAG (op, FLAG_APPLIED); 3232 SET_FLAG (op, FLAG_APPLIED);
3227
3228 if (!skop)
3229 new_draw_info_format (NDI_UNIQUE, 0, who, "The %s is broken, please report this to the dungeon master!", query_name (op));//TODO
3230 else//TODO
3231 change_skill (who, skop, 1); 3233 change_skill (who, skop, 1);
3232 3234
3233 if (who->contr) 3235 if (who->contr)
3234 { 3236 {
3235 who->contr->combat_ob = op; 3237 who->contr->combat_ob = op;
3236 who->current_weapon = op; 3238 who->current_weapon = op;
3317 3319
3318 if (player *pl = who->contr) 3320 if (player *pl = who->contr)
3319 { 3321 {
3320 if (IS_COMBAT_SKILL (op->subtype)) 3322 if (IS_COMBAT_SKILL (op->subtype))
3321 { 3323 {
3322 if (skill_flags [op->subtype] && SF_NEED_WEAPON) 3324 if (skill_flags [op->subtype] & SF_NEED_WEAPON)
3323 { 3325 {
3324 for (object *item = who->inv; item; item = item->below) 3326 for (object *item = who->inv; item; item = item->below)
3325 if (item->type == WEAPON && item->flag [FLAG_APPLIED]) 3327 if (item->type == WEAPON && item->flag [FLAG_APPLIED])
3326 { 3328 {
3327 pl->combat_ob = who->current_weapon = item; 3329 pl->combat_ob = who->current_weapon = item;
3332 return 1; 3334 return 1;
3333 3335
3334 found_weapon:; 3336 found_weapon:;
3335 } 3337 }
3336 else 3338 else
3339 {
3337 who->contr->combat_ob = op; 3340 pl->combat_ob = op;
3341 op->current_weapon = 0;
3342 }
3338 } 3343 }
3339 else if (IS_RANGED_SKILL (op->subtype)) 3344 else if (IS_RANGED_SKILL (op->subtype))
3340 { 3345 {
3341 if (skill_flags [op->subtype] && SF_NEED_BOW) 3346 if (skill_flags [op->subtype] & SF_NEED_BOW)
3342 { 3347 {
3343 for (object *item = who->inv; item; item = item->below) 3348 for (object *item = who->inv; item; item = item->below)
3344 if (item->type == BOW && item->flag [FLAG_APPLIED]) 3349 if (item->type == BOW && item->flag [FLAG_APPLIED])
3345 { 3350 {
3346 pl->ranged_ob = who->current_weapon = item; 3351 pl->ranged_ob = who->current_weapon = item;
3350 new_draw_info (NDI_UNIQUE, 0, who, "You need to apply a missile weapon before readying this skill"); 3355 new_draw_info (NDI_UNIQUE, 0, who, "You need to apply a missile weapon before readying this skill");
3351 return 1; 3356 return 1;
3352 3357
3353 found_bow:; 3358 found_bow:;
3354 } 3359 }
3355 else if (skill_flags [op->subtype] && SF_NEED_ITEM) 3360 else if (skill_flags [op->subtype] & SF_NEED_ITEM)
3356 { 3361 {
3357 for (object *item = who->inv; item; item = item->below) 3362 for (object *item = who->inv; item; item = item->below)
3358 if (item->flag [FLAG_APPLIED] 3363 if (item->flag [FLAG_APPLIED]
3359 && (item->type == WAND || item->type == ROD || item->type == HORN)) 3364 && (item->type == WAND || item->type == ROD || item->type == HORN))
3360 { 3365 {
3366 return 1; 3371 return 1;
3367 3372
3368 found_item:; 3373 found_item:;
3369 } 3374 }
3370 else 3375 else
3376 {
3371 pl->ranged_ob = op; 3377 pl->ranged_ob = op;
3378 op->current_weapon = 0;
3379 }
3372 } 3380 }
3373 3381
3374 if (!op->invisible) 3382 if (!op->invisible)
3375 { 3383 {
3376 new_draw_info_format (NDI_UNIQUE, 0, who, "You ready %s.", query_name (op)); 3384 new_draw_info_format (NDI_UNIQUE, 0, who, "You ready %s.", query_name (op));
3378 } 3386 }
3379 else 3387 else
3380 new_draw_info_format (NDI_UNIQUE, 0, who, "Readied skill: %s.", op->skill ? &op->skill : &op->name); 3388 new_draw_info_format (NDI_UNIQUE, 0, who, "Readied skill: %s.", op->skill ? &op->skill : &op->name);
3381 } 3389 }
3382 3390
3391 {
3383 SET_FLAG (op, FLAG_APPLIED); 3392 SET_FLAG (op, FLAG_APPLIED);
3384 change_abil (who, op); 3393 change_abil (who, op);
3385 who->chosen_skill = op; 3394 who->chosen_skill = op;
3386 SET_FLAG (who, FLAG_READY_SKILL); 3395 SET_FLAG (who, FLAG_READY_SKILL);
3387 break; 3396 break;
3410 /*FALLTHROUGH*/ 3419 /*FALLTHROUGH*/
3411 case WAND: 3420 case WAND:
3412 case ROD: 3421 case ROD:
3413 case HORN: 3422 case HORN:
3414 /* check for skill, alter player status */ 3423 /* check for skill, alter player status */
3424
3425 if (!skop)
3426 {
3427 new_draw_info_format (NDI_UNIQUE, 0, who, "The %s is broken, please report this to the dungeon master!", query_name (op));//TODO
3428 return 1;
3429 }
3430
3415 SET_FLAG (op, FLAG_APPLIED); 3431 SET_FLAG (op, FLAG_APPLIED);
3416
3417 if (!skop)
3418 new_draw_info_format (NDI_UNIQUE, 0, who, "The %s is broken, please report this to the dungeon master!", query_name (op));//TODO
3419 else//TODO
3420 change_skill (who, skop, 0); 3432 change_skill (who, skop, 0);
3421 3433
3422 if (who->contr) 3434 if (who->contr)
3423 { 3435 {
3424 who->contr->ranged_ob = op; 3436 who->contr->ranged_ob = op;
3425 3437

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines