version 1.196 | | version 1.197 |
---|
| | |
/* | | /* |
* static char *rcsid_player_c = | | * static char *rcsid_player_c = |
* "$Id: player.c,v 1.196 2006/04/06 21:18:35 tchize Exp $"; | | * "$Id: player.c,v 1.197 2006/05/05 09:26:35 ryo_saeba Exp $"; |
*/ | | */ |
| | |
/* | | /* |
| | |
#include <skills.h> | | #include <skills.h> |
#include <newclient.h> | | #include <newclient.h> |
| | |
| | static archetype *get_player_archetype(archetype* at); |
| | static int action_makes_visible (object *op); |
| | |
player *find_player(const char *plname) | | player *find_player(const char *plname) |
{ | | { |
player *pl; | | player *pl; |
| | |
* list. Not very efficient routine, but used only creating new players. | | * list. Not very efficient routine, but used only creating new players. |
* Note: there MUST be at least one player archetype! | | * Note: there MUST be at least one player archetype! |
*/ | | */ |
archetype *get_player_archetype(archetype* at) | | static archetype *get_player_archetype(archetype* at) |
{ | | { |
archetype *start = at; | | archetype *start = at; |
for (;;) { | | for (;;) { |
| | |
return 1; | | return 1; |
} | | } |
| | |
void flee_player(object *op) { | | static void flee_player(object *op) { |
int dir,diff; | | int dir,diff; |
rv_vector rv; | | rv_vector rv; |
| | |
| | |
* in the right type container (quiver). Pointer to the | | * in the right type container (quiver). Pointer to the |
* found object is returned. | | * found object is returned. |
*/ | | */ |
object *find_arrow(object *op, const char *type) | | static object *find_arrow(object *op, const char *type) |
{ | | { |
object *tmp = NULL; | | object *tmp = NULL; |
| | |
| | |
* the hall. Failing that it does it's best to pick the highest plus arrow. | | * the hall. Failing that it does it's best to pick the highest plus arrow. |
*/ | | */ |
| | |
object *find_better_arrow(object *op, object *target, const char *type, int *better) | | static object *find_better_arrow(object *op, object *target, const char *type, int *better) |
{ | | { |
object *tmp = NULL, *arrow, *ntmp; | | object *tmp = NULL, *arrow, *ntmp; |
int attacknum, attacktype, betterby=0, i; | | int attacknum, attacktype, betterby=0, i; |
| | |
* dir = fire direction | | * dir = fire direction |
*/ | | */ |
| | |
object *pick_arrow_target(object *op, const char *type, int dir) | | static object *pick_arrow_target(object *op, const char *type, int dir) |
{ | | { |
object *tmp = NULL; | | object *tmp = NULL; |
mapstruct *m; | | mapstruct *m; |
| | |
* this function should only be called if 'op' is a player, | | * this function should only be called if 'op' is a player, |
* hence the function name. | | * hence the function name. |
*/ | | */ |
int player_fire_bow(object *op, int dir) | | static int player_fire_bow(object *op, int dir) |
{ | | { |
int ret=0, wcmod=0; | | int ret=0, wcmod=0; |
| | |
| | |
* Fires a misc (wand/rod/horn) object in 'dir'. | | * Fires a misc (wand/rod/horn) object in 'dir'. |
* Broken apart from 'fire' to keep it more readable. | | * Broken apart from 'fire' to keep it more readable. |
*/ | | */ |
void fire_misc_object(object *op, int dir) | | static void fire_misc_object(object *op, int dir) |
{ | | { |
object *item; | | object *item; |
| | |
| | |
* function will descend into containers. op is the object to start the search | | * function will descend into containers. op is the object to start the search |
* from. | | * from. |
*/ | | */ |
void remove_unpaid_objects(object *op, object *env) | | static void remove_unpaid_objects(object *op, object *env) |
{ | | { |
object *next; | | object *next; |
| | |
| | |
* effected by this. If we arent invisible to begin with, we | | * effected by this. If we arent invisible to begin with, we |
* return 0. | | * return 0. |
*/ | | */ |
int action_makes_visible (object *op) { | | static int action_makes_visible (object *op) { |
| | |
if(op->invisible && QUERY_FLAG(op,FLAG_ALIVE)) { | | if(op->invisible && QUERY_FLAG(op,FLAG_ALIVE)) { |
if(QUERY_FLAG(op,FLAG_MAKE_INVIS)) | | if(QUERY_FLAG(op,FLAG_MAKE_INVIS)) |