1 | /* |
1 | /* |
2 | * static char *rcsid_move_c = |
2 | * static char *rcsid_move_c = |
3 | * "$Id: move.C,v 1.5 2006/08/29 17:32:19 root Exp $"; |
3 | * "$Id: move.C,v 1.6 2006/09/03 00:18:42 root Exp $"; |
4 | */ |
4 | */ |
5 | |
5 | |
6 | /* |
6 | /* |
7 | CrossFire, A Multiplayer game for X-windows |
7 | CrossFire, A Multiplayer game for X-windows |
8 | |
8 | |
… | |
… | |
252 | if (!OB_TYPE_MOVE_BLOCK(user, GET_MAP_MOVE_BLOCK(m, sx, sy))) break; |
252 | if (!OB_TYPE_MOVE_BLOCK(user, GET_MAP_MOVE_BLOCK(m, sx, sy))) break; |
253 | |
253 | |
254 | } |
254 | } |
255 | if (k==9) { |
255 | if (k==9) { |
256 | LOG(llevError,"Shop mat %s (%d, %d) is in solid rock?\n", |
256 | LOG(llevError,"Shop mat %s (%d, %d) is in solid rock?\n", |
257 | other_teleporter->name, other_teleporter->x, other_teleporter->y); |
257 | &other_teleporter->name, other_teleporter->x, other_teleporter->y); |
258 | return 0; |
258 | return 0; |
259 | } |
259 | } |
260 | } |
260 | } |
261 | else return 0; |
261 | else return 0; |
262 | } |
262 | } |
… | |
… | |
435 | |
435 | |
436 | if(owner != pusher && pusher->type == PLAYER && who->type != PLAYER && |
436 | if(owner != pusher && pusher->type == PLAYER && who->type != PLAYER && |
437 | !QUERY_FLAG(who,FLAG_FRIENDLY)&& !QUERY_FLAG(who,FLAG_NEUTRAL)) { |
437 | !QUERY_FLAG(who,FLAG_FRIENDLY)&& !QUERY_FLAG(who,FLAG_NEUTRAL)) { |
438 | if(pusher->contr->run_on) /* only when we run */ { |
438 | if(pusher->contr->run_on) /* only when we run */ { |
439 | new_draw_info_format(NDI_UNIQUE, 0, pusher, |
439 | new_draw_info_format(NDI_UNIQUE, 0, pusher, |
440 | "You start to attack %s !!",who->name); |
440 | "You start to attack %s !!", &who->name); |
441 | CLEAR_FLAG(who,FLAG_UNAGGRESSIVE); /* the sucker don't like you anymore */ |
441 | CLEAR_FLAG(who,FLAG_UNAGGRESSIVE); /* the sucker don't like you anymore */ |
442 | who->enemy = pusher; |
442 | who->enemy = pusher; |
443 | return 1; |
443 | return 1; |
444 | } |
444 | } |
445 | else |
445 | else |
446 | { |
446 | { |
447 | new_draw_info_format(NDI_UNIQUE, 0, pusher, |
447 | new_draw_info_format(NDI_UNIQUE, 0, pusher, |
448 | "You avoid attacking %s .",who->name); |
448 | "You avoid attacking %s.", &who->name); |
449 | } |
449 | } |
450 | } |
450 | } |
451 | |
451 | |
452 | /* now, lets test stand still. we NEVER can push stand_still monsters. */ |
452 | /* now, lets test stand still. we NEVER can push stand_still monsters. */ |
453 | if(QUERY_FLAG(who,FLAG_STAND_STILL)) |
453 | if(QUERY_FLAG(who,FLAG_STAND_STILL)) |
454 | { |
454 | { |
455 | new_draw_info_format(NDI_UNIQUE, 0, pusher, |
455 | new_draw_info_format(NDI_UNIQUE, 0, pusher, |
456 | "You can't push %s.",who->name); |
456 | "You can't push %s.", &who->name); |
457 | return 0; |
457 | return 0; |
458 | } |
458 | } |
459 | |
459 | |
460 | /* This block is basically if you are pushing friendly but |
460 | /* This block is basically if you are pushing friendly but |
461 | * non pet creaturs. |
461 | * non pet creaturs. |
… | |
… | |
471 | random_roll(str2, str2/2+str2*2, pusher, PREFER_HIGH) || |
471 | random_roll(str2, str2/2+str2*2, pusher, PREFER_HIGH) || |
472 | !move_object(who,dir)) |
472 | !move_object(who,dir)) |
473 | { |
473 | { |
474 | if (who ->type == PLAYER) { |
474 | if (who ->type == PLAYER) { |
475 | new_draw_info_format(NDI_UNIQUE, 0, who, |
475 | new_draw_info_format(NDI_UNIQUE, 0, who, |
476 | "%s tried to push you.",pusher->name); |
476 | "%s tried to push you.", &pusher->name); |
477 | } |
477 | } |
478 | return 0; |
478 | return 0; |
479 | } |
479 | } |
480 | |
480 | |
481 | /* If we get here, the push succeeded. |
481 | /* If we get here, the push succeeded. |
482 | * Let everyone know the status. |
482 | * Let everyone know the status. |
483 | */ |
483 | */ |
484 | if (who->type == PLAYER) { |
484 | if (who->type == PLAYER) { |
485 | new_draw_info_format(NDI_UNIQUE, 0, who, |
485 | new_draw_info_format(NDI_UNIQUE, 0, who, |
486 | "%s pushed you.",pusher->name); |
486 | "%s pushed you.", &pusher->name); |
487 | } |
487 | } |
488 | if (pusher->type == PLAYER) { |
488 | if (pusher->type == PLAYER) { |
489 | new_draw_info_format(NDI_UNIQUE, 0, pusher, |
489 | new_draw_info_format(NDI_UNIQUE, 0, pusher, |
490 | "You pushed %s back.", who->name); |
490 | "You pushed %s back.", &who->name); |
491 | } |
491 | } |
492 | |
492 | |
493 | return 1; |
493 | return 1; |
494 | } |
494 | } |