version 1.103 | | version 1.104 |
---|
| | |
/* | | /* |
* static char *rcsid_player_c = | | * static char *rcsid_player_c = |
* "$Id: player.c,v 1.103 2002/11/13 05:49:04 garbled Exp $"; | | * "$Id: player.c,v 1.104 2002/11/26 07:44:29 garbled Exp $"; |
*/ | | */ |
| | |
/* | | /* |
| | |
p->outputs_sync=16; /* Every 2 seconds */ | | p->outputs_sync=16; /* Every 2 seconds */ |
p->outputs_count=1; /* Keeps present behaviour */ | | p->outputs_count=1; /* Keeps present behaviour */ |
p->unapply = unapply_nochoice; | | p->unapply = unapply_nochoice; |
#ifdef USE_SWAP_STATS | | |
p->Swap_First = -1; | | p->Swap_First = -1; |
#endif | | |
| | |
#ifdef AUTOSAVE | | #ifdef AUTOSAVE |
p->last_save_tick = 9999999; | | p->last_save_tick = 9999999; |
| | |
op->stats.Con+op->stats.Wis+op->stats.Pow+ | | op->stats.Con+op->stats.Wis+op->stats.Pow+ |
op->stats.Cha; | | op->stats.Cha; |
} while(sum<82||sum>116); | | } while(sum<82||sum>116); |
#if defined( USE_SWAP_STATS) && defined(SORT_ROLLED_STATS) | | |
/* Sort the stats so that rerolling is easier... */ | | /* Sort the stats so that rerolling is easier... */ |
{ | | { |
int i = 0, j = 0; | | int i = 0, j = 0; |
| | |
op->stats.Pow = statsort[5]; | | op->stats.Pow = statsort[5]; |
op->stats.Cha = statsort[6]; | | op->stats.Cha = statsort[6]; |
} | | } |
#endif /* SWAP_STATS */ | | |
| | |
op->contr->orig_stats.Str=op->stats.Str; | | op->contr->orig_stats.Str=op->stats.Str; |
op->contr->orig_stats.Dex=op->stats.Dex; | | op->contr->orig_stats.Dex=op->stats.Dex; |
| | |
void Roll_Again(object *op) | | void Roll_Again(object *op) |
{ | | { |
esrv_new_player(op->contr, 0); | | esrv_new_player(op->contr, 0); |
#ifndef USE_SWAP_STATS | | |
send_query(&op->contr->socket,CS_QUERY_SINGLECHAR,"Roll again (y/n)? "); | | |
#else | | |
send_query(&op->contr->socket,CS_QUERY_SINGLECHAR,"[y] to roll new stats [n] to use stats\n[1-7] [1-7] to swap stats.\nRoll again (y/n/1-7)? "); | | send_query(&op->contr->socket,CS_QUERY_SINGLECHAR,"[y] to roll new stats [n] to use stats\n[1-7] [1-7] to swap stats.\nRoll again (y/n/1-7)? "); |
#endif /* USE_SWAP_STATS */ | | |
} | | } |
| | |
void Swap_Stat(object *op,int Swap_Second) | | void Swap_Stat(object *op,int Swap_Second) |
{ | | { |
#ifdef USE_SWAP_STATS | | |
signed char tmp; | | signed char tmp; |
char buf[MAX_BUF]; | | char buf[MAX_BUF]; |
| | |
| | |
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 /* USE_SWAP_STATS */ | | |
} | | } |
| | |
| | |
| | |
char buf[MAX_BUF]; | | char buf[MAX_BUF]; |
static sint8 stat_trans[] = {-1, STR, DEX, CON, INT, WIS, POW, CHA}; | | static sint8 stat_trans[] = {-1, STR, DEX, CON, INT, WIS, POW, CHA}; |
| | |
#ifdef USE_SWAP_STATS | | |
if (keynum>0 && keynum<=7) { | | if (keynum>0 && keynum<=7) { |
if (op->contr->Swap_First==-1) { | | if (op->contr->Swap_First==-1) { |
op->contr->Swap_First=stat_trans[keynum]; | | op->contr->Swap_First=stat_trans[keynum]; |
| | |
send_query(&op->contr->socket,CS_QUERY_SINGLECHAR,""); | | send_query(&op->contr->socket,CS_QUERY_SINGLECHAR,""); |
return 1; | | return 1; |
} | | } |
#endif | | |
switch (key) { | | switch (key) { |
case 'n': | | case 'n': |
case 'N': { | | case 'N': { |
| | |
return 1; | | return 1; |
| | |
default: | | default: |
#ifndef USE_SWAP_STATS | | |
send_query(&op->contr->socket,CS_QUERY_SINGLECHAR,"Yes, No or Quit. Roll again?"); | | |
#else | | |
send_query(&op->contr->socket,CS_QUERY_SINGLECHAR,"Yes, No, Quit or 1-6. Roll again?"); | | send_query(&op->contr->socket,CS_QUERY_SINGLECHAR,"Yes, No, Quit or 1-6. Roll again?"); |
#endif /* USE_SWAP_STATS */ | | |
return 0; | | return 0; |
} | | } |
return 0; | | return 0; |