version 1.56 | | version 1.57 |
---|
| | |
/* | | /* |
* static char *rcsid_player_c = | | * static char *rcsid_player_c = |
* "$Id: player.c,v 1.56 2001/05/25 02:42:26 mardahl Exp $"; | | * "$Id: player.c,v 1.57 2001/05/29 04:41:54 mwedel Exp $"; |
*/ | | */ |
| | |
/* | | /* |
| | |
CLEAR_FLAG(op, FLAG_CURSED); | | CLEAR_FLAG(op, FLAG_CURSED); |
CLEAR_FLAG(op, FLAG_DAMNED); | | CLEAR_FLAG(op, FLAG_DAMNED); |
} | | } |
#ifndef ALLOW_SKILLS /* no reason to start with these if no skills exist! */ | | |
if(op->type==SKILLSCROLL || op->type==SKILL) { | | |
remove_ob(op); | | |
free_object(op); | | |
continue; | | |
} | | |
#endif | | |
if(op->type==ABILITY) { | | if(op->type==ABILITY) { |
pl->contr->known_spells[pl->contr->nrofknownspells++]=op->stats.sp; | | pl->contr->known_spells[pl->contr->nrofknownspells++]=op->stats.sp; |
remove_ob(op); | | remove_ob(op); |
| | |
add_exp(op,0); | | add_exp(op,0); |
op->stats.sp=op->stats.maxsp; | | op->stats.sp=op->stats.maxsp; |
op->stats.hp=op->stats.maxhp; | | op->stats.hp=op->stats.maxhp; |
#ifndef ALLOW_SKILLS /* start grace at maxgrace if no skills */ | | |
op->stats.grace=op->stats.maxgrace; | | |
#else | | |
op->stats.grace=0; | | op->stats.grace=0; |
#endif | | |
op->contr->orig_stats=op->stats; | | op->contr->orig_stats=op->stats; |
} | | } |
| | |
| | |
op->stats.ac=0; | | op->stats.ac=0; |
add_exp(op,0); | | add_exp(op,0); |
op->stats.sp=op->stats.maxsp; | | op->stats.sp=op->stats.maxsp; |
#ifndef ALLOW_SKILLS | | |
op->stats.grace=op->stats.maxgrace; | | |
#else | | |
op->stats.grace=0; | | op->stats.grace=0; |
#endif | | |
op->stats.hp=op->stats.maxhp; | | op->stats.hp=op->stats.maxhp; |
add_exp(op,0); | | add_exp(op,0); |
op->contr->Swap_First=-1; | | op->contr->Swap_First=-1; |
| | |
#endif | | #endif |
start_info(op); | | start_info(op); |
CLEAR_FLAG(op, FLAG_WIZ); | | CLEAR_FLAG(op, FLAG_WIZ); |
#ifdef ALLOW_SKILLS | | |
(void) init_player_exp(op); | | (void) init_player_exp(op); |
#endif | | |
give_initial_items(op,op->randomitems); | | give_initial_items(op,op->randomitems); |
#ifdef ALLOW_SKILLS | | |
(void) link_player_skills(op); | | (void) link_player_skills(op); |
#endif | | |
esrv_send_inventory(op, op); | | esrv_send_inventory(op, op); |
return 0; | | return 0; |
} | | } |
| | |
fix_player(op); | | fix_player(op); |
op->stats.hp=op->stats.maxhp; | | op->stats.hp=op->stats.maxhp; |
op->stats.sp=op->stats.maxsp; | | op->stats.sp=op->stats.maxsp; |
#ifndef ALLOW_SKILLS | | |
op->stats.grace=op->stats.maxgrace; | | |
#else | | |
op->stats.grace=0; | | op->stats.grace=0; |
#endif | | |
op->contr->last_value= -1; | | op->contr->last_value= -1; |
if (op->msg) | | if (op->msg) |
new_draw_info(NDI_BLUE, 0, op, op->msg); | | new_draw_info(NDI_BLUE, 0, op, op->msg); |
| | |
* it handles whether cleric or mage spell is requested to be cast. | | * it handles whether cleric or mage spell is requested to be cast. |
* -b.t. | | * -b.t. |
*/ | | */ |
#ifdef ALLOW_SKILLS | | |
if(op->type==PLAYER) | | if(op->type==PLAYER) |
if(!check_skill_to_fire(op)) return; | | if(!check_skill_to_fire(op)) return; |
#endif | | |
| | |
switch(op->contr->shoottype) { | | switch(op->contr->shoottype) { |
case range_none: | | case range_none: |
| | |
| | |
op->contr->has_hit = 1; /* The last action was to hit, so use weapon_sp */ | | op->contr->has_hit = 1; /* The last action was to hit, so use weapon_sp */ |
| | |
#ifdef ALLOW_SKILLS | | |
skill_attack(tmp, op, 0, NULL); | | skill_attack(tmp, op, 0, NULL); |
#else | | |
(void) attack_ob(tmp, op); | | |
#endif | | |
/* If attacking another player, that player gets automatic | | /* If attacking another player, that player gets automatic |
* hitback, and doesn't loose luck either. | | * hitback, and doesn't loose luck either. |
*/ | | */ |
| | |
{ | | { |
short luck = tmp->stats.luck; | | short luck = tmp->stats.luck; |
tmp->contr->has_hit = 1; | | tmp->contr->has_hit = 1; |
#ifdef ALLOW_SKILLS | | |
skill_attack(op, tmp, 0, NULL); | | skill_attack(op, tmp, 0, NULL); |
#else | | |
(void) attack_ob(op, tmp); | | |
#endif | | |
tmp->stats.luck = luck; | | tmp->stats.luck = luck; |
} | | } |
if(action_makes_visible(op)) make_visible(op); | | if(action_makes_visible(op)) make_visible(op); |
| | |
/* Regenerate Grace */ | | /* Regenerate Grace */ |
/* I altered this a little - maximum grace is ony achieved through prayer -b.t.*/ | | /* I altered this a little - maximum grace is ony achieved through prayer -b.t.*/ |
if(--op->last_grace<0) { | | if(--op->last_grace<0) { |
#ifndef ALLOW_SKILLS /* allow regen 'naturally' to only 1/2 maxgrace w/ skills code */ | | |
if(op->stats.grace<op->stats.maxgrace) | | |
#else | | |
if(op->stats.grace<op->stats.maxgrace/2) | | if(op->stats.grace<op->stats.maxgrace/2) |
#endif | | |
op->stats.grace++; /* no penalty in food for regaining grace */ | | op->stats.grace++; /* no penalty in food for regaining grace */ |
if(max_grace>1) { | | if(max_grace>1) { |
over_grace = (gen_grace<20 ? 30 : gen_grace+10)/rate_grace; | | over_grace = (gen_grace<20 ? 30 : gen_grace+10)/rate_grace; |