/////////////////////////////////////////////////////////// ////// Released under the GPL ////// see gpl.txt ////// Written by and copyrighted by: ////// Michael Gibson ////// (c)2003, 2004, 2006 /////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////// // player_comp // compute character's/player's defaults at beginning of game ////////////////////////////////////////////////////////////// void player_comp(int player_rac, int *player_str, int *player_dex, int *player_exp){ if(player_rac==1){ // if human *player_str=10; *player_dex=2; *player_exp=1; } if(player_rac==2){ // if elf *player_str=10; *player_dex=8; *player_exp=1; } if(player_rac==3){ //if Halfling *player_str=7; *player_dex=5; *player_exp=1; } if(player_rac==4){ //if Dwarf *player_str=10; *player_dex=3; *player_exp=1; } if(player_rac==5){ //if gnome *player_str=6; *player_dex=5; *player_exp=7; } } ///////////////////////////////////////////////////////////////// // weapon_comp // compute player's weapon defaults //////////////////////////////////////////////////////////////// void weapon_comp(int player_wep, int *wep_wear, int *dex_adj, int conf_wep_wear[], int conf_dex_adj[]){ if(player_wep==1){ //if battle Axe *wep_wear=conf_wep_wear[0]; *dex_adj =conf_dex_adj[0]; } if(player_wep==2){ //if sword or light/laser saber *wep_wear=conf_wep_wear[1]; *dex_adj=conf_dex_adj[1]; } if(player_wep==3){ //if dagger *wep_wear=conf_wep_wear[2]; *dex_adj=conf_dex_adj[2]; } if(player_wep==4){ //if wooden staff *wep_wear=conf_wep_wear[3]; *dex_adj=conf_dex_adj[3]; } if(player_wep==5){ //if Mace *wep_wear=conf_wep_wear[4]; *dex_adj=conf_dex_adj[4]; } if(player_wep==6){ // if sling or hand blaster *wep_wear=conf_wep_wear[5]; *dex_adj=conf_dex_adj[5]; } } //////////////////////////////////////////////////////////////////// // armor_comp // compute player's total armor protoection /////////////////////////////////////////////////////////////////// int armor_comp(int player_armor, int *dex_adj){ int return_value; if(player_armor == 0) return_value = 0; //if wearing no armor if(player_armor == 1) return_value = 1; //if leather body armor only if(player_armor == 2) return_value = 2; //if chain body armor only if(player_armor == 3) return_value = 3; //if plate body armor only if(player_armor == 10) return_value = 1; //if wooden shield only if(player_armor == 11) return_value = 2; //if wooden shield and leather body armor if(player_armor == 12) return_value = 3; if(player_armor == 13) return_value = 4; if(player_armor == 20) return_value = 2; //if plate shield only if(player_armor == 21) return_value = 3; //if plate shield and leather body armor if(player_armor == 22) return_value = 4; if(player_armor == 23) return_value = 5; if(player_armor == 100) return_value = 1; //if plate helmet only if(player_armor == 101) return_value = 2; //if plate helmet and leather body armor if(player_armor == 102) return_value = 3; //if plate helmet and chain body armor if(player_armor == 103) return_value = 4; //if plate helmet and plate body armor if(player_armor == 123){ //if plate helmet, plate shield, plate body armor return_value = 6; *dex_adj = *dex_adj +1; } return(return_value); } //////////////////////////////////////////////////////////////////// // eval_dex // evaluate player's dexterity //////////////////////////////////////////////////////////////////// void eval_dex(int *player_dex, int player_rac, int player_exp){ //increase dexter 1 for every 50 exp if(player_exp/50==0 || player_exp/100==0 || player_exp/150==0 || player_exp/200==0){ *player_dex++; } if(player_rac==1 && *player_dex >= 20) *player_dex = 20; //human max 20 dex if(player_rac==2 && *player_dex >= 22) *player_dex = 22; //elf max 22 dex if(player_rac==3 && *player_dex >= 20) *player_dex = 20; //halfling max 20 dex if(player_rac==4 && *player_dex >= 18) *player_dex = 18; //dwarf max 18 dex if(player_rac==5 && *player_dec >= 22) *player_dex = 22; //gnome max 22 dex }