Clean up legacy practice code

This commit is contained in:
kinther 2025-12-27 15:28:42 -08:00
parent e5515f4ca5
commit 8eb30084b0
16 changed files with 59 additions and 745 deletions

View file

@ -95,52 +95,18 @@ bitvector_t find_class_bitvector(const char *arg)
return (ret);
}
/* These are definitions which control the guildmasters for each class.
* The first field (top line) controls the highest percentage skill level a
* character of the class is allowed to attain in any skill. (After this
* level, attempts to practice will say "You are already learned in this area."
*
* The second line controls the maximum percent gain in learnedness a character
* is allowed per practice -- in other words, if the random die throw comes out
* higher than this number, the gain will only be this number instead.
*
* The third line controls the minimu percent gain in learnedness a character
* is allowed per practice -- in other words, if the random die throw comes
* out below this number, the gain will be set up to this number.
*
* The fourth line simply sets whether the character knows 'spells' or 'skills'.
* This does not affect anything except the message given to the character when
* trying to practice (i.e. "You know of the following spells" vs. "You know of
* the following skills" */
#define SPELL 0
#define SKILL 1
/* #define LEARNED_LEVEL 0 % known which is considered "learned" */
/* #define MAX_PER_PRAC 1 max percent gain in skill per practice */
/* #define MIN_PER_PRAC 2 min percent gain in skill per practice */
/* #define PRAC_TYPE 3 should it say 'spell' or 'skill'? */
int prac_params[4][NUM_CLASSES] = {
/* SOR CLE THE FIG BAR RAN BARD DRU */
{ 95, 95, 85, 80, 75, 85, 85, 95 }, /* learned level */
{ 100, 100, 12, 12, 11, 12, 13, 90 }, /* max per practice */
{ 25, 25, 0, 0, 0, 0, 25, 25 }, /* min per practice */
{ SPELL, SPELL, SKILL, SKILL, SKILL, SKILL, SKILL, SKILL }, /* prac name */
};
/* The appropriate rooms for each guildmaster/guildguard; controls which types
* of people the various guildguards let through. i.e., the first line shows
/* The appropriate rooms for each class gatekeeper; controls which types
* of people the various guards let through. i.e., the first line shows
* that from room 3017, only SORCERORS are allowed to go south. Don't forget
* to visit spec_assign.c if you create any new mobiles that should be a guild
* to visit spec_assign.c if you create any new mobiles that should be a
* master or guard so they can act appropriately. If you "recycle" the
* existing mobs that are used in other guilds for your new guild, then you
* don't have to change that file, only here. Guildguards are now implemented
* existing mobs that are used in other areas for your new one, then you
* don't have to change that file, only here. Guards are now implemented
* via triggers. This code remains as an example. */
/* TO-DO: Is this necessary anymore now that there are no official guild rooms? */
struct guild_info_type guild_info[] = {
/* Midgaard */
/* Main City */
{ CLASS_SORCEROR, 3017, SOUTH },
{ CLASS_CLERIC, 3004, NORTH },
{ CLASS_ROGUE, 3027, EAST },

View file

@ -29,7 +29,6 @@ void grant_class_skills(struct char_data *ch, bool reset);
extern const char *class_abbrevs[];
extern const char *pc_class_types[];
extern const char *class_menu;
extern int prac_params[][NUM_CLASSES];
extern struct guild_info_type guild_info[];
#endif /* _CLASS_H_*/

View file

@ -29,7 +29,6 @@
#define PFDEF_CONDITION 0
#define PFDEF_BADPWS 0
#define PFDEF_PREFFLAGS 0
#define PFDEF_PRACTICES 0
#define PFDEF_COINS 0
#define PFDEF_BANK_COINS 0
#define PFDEF_EXP 0

View file

@ -142,11 +142,10 @@ static variable_name_t VariableNameTable[eMSDP_MAX+1] =
{ eMSDP_LEVEL, "LEVEL", NUMBER_READ_ONLY },
{ eMSDP_RACE, "RACE", STRING_READ_ONLY },
{ eMSDP_CLASS, "CLASS", STRING_READ_ONLY },
{ eMSDP_MANA, "MANA", NUMBER_READ_ONLY },
{ eMSDP_MANA_MAX, "MANA_MAX", NUMBER_READ_ONLY },
{ eMSDP_WIMPY, "WIMPY", NUMBER_READ_ONLY },
{ eMSDP_PRACTICE, "PRACTICE", NUMBER_READ_ONLY },
{ eMSDP_MONEY, "MONEY", NUMBER_READ_ONLY },
{ eMSDP_MANA, "MANA", NUMBER_READ_ONLY },
{ eMSDP_MANA_MAX, "MANA_MAX", NUMBER_READ_ONLY },
{ eMSDP_WIMPY, "WIMPY", NUMBER_READ_ONLY },
{ eMSDP_MONEY, "MONEY", NUMBER_READ_ONLY },
{ eMSDP_MOVEMENT, "MOVEMENT", NUMBER_READ_ONLY },
{ eMSDP_MOVEMENT_MAX, "MOVEMENT_MAX", NUMBER_READ_ONLY },
{ eMSDP_AC, "AC", NUMBER_READ_ONLY },

View file

@ -106,11 +106,10 @@ typedef enum
eMSDP_LEVEL,
eMSDP_RACE,
eMSDP_CLASS,
eMSDP_MANA,
eMSDP_MANA_MAX,
eMSDP_WIMPY,
eMSDP_PRACTICE,
eMSDP_MONEY,
eMSDP_MANA,
eMSDP_MANA_MAX,
eMSDP_WIMPY,
eMSDP_MONEY,
eMSDP_MOVEMENT,
eMSDP_MOVEMENT_MAX,
eMSDP_AC,

View file

@ -81,22 +81,6 @@ static const char *how_good(int percent)
return " (superb)";
}
static const char *prac_types[] = {
"spell",
"skill"
};
/* TO-DO: Dig deeper and figure out if the min/max practice defines can be removed */
#define LEARNED_LEVEL 0 /* % known which is considered "learned" */
#define MAX_PER_PRAC 1 /* max percent gain in skill per practice */
#define MIN_PER_PRAC 2 /* min percent gain in skill per practice */
#define PRAC_TYPE 3 /* should it say 'spell' or 'skill'? */
#define LEARNED(ch) (prac_params[LEARNED_LEVEL][(int)GET_CLASS(ch)])
#define MINGAIN(ch) (prac_params[MIN_PER_PRAC][(int)GET_CLASS(ch)])
#define MAXGAIN(ch) (prac_params[MAX_PER_PRAC][(int)GET_CLASS(ch)])
#define SPLSKL(ch) (prac_types[prac_params[PRAC_TYPE][(int)GET_CLASS(ch)]])
void list_skills(struct char_data *ch)
{
const char *overflow = "\r\n**OVERFLOW**\r\n";
@ -104,7 +88,7 @@ void list_skills(struct char_data *ch)
size_t len = 0;
char buf2[MAX_STRING_LENGTH];
len = snprintf(buf2, sizeof(buf2), "You know of the following %ss:\r\n", SPLSKL(ch));
len = snprintf(buf2, sizeof(buf2), "You know of the following skills:\r\n");
if (IS_NPC(ch)) {
/* NPCs: show only the skills actually assigned to them */
@ -229,7 +213,7 @@ SPECIAL(mayor)
break;
case 'E':
act("$n says 'I hereby declare Midgaard closed!'", FALSE, ch, 0, 0, TO_ROOM);
act("$n says 'I hereby declare the city closed!'", FALSE, ch, 0, 0, TO_ROOM);
break;
case 'O':

View file

@ -136,7 +136,7 @@
/* New skills may be added here up to MAX_SKILLS (200) */
/* NON-PLAYER AND OBJECT SPELLS AND SKILLS: The practice levels for the spells
/* NON-PLAYER AND OBJECT SPELLS AND SKILLS: The skill levels for the spells
* and skills below are _not_ recorded in the players file; therefore, the
* intended use is for spells and skills associated with objects (such as
* SPELL_IDENTIFY used with scrolls of identify) or non-players (such as NPC

View file

@ -70,7 +70,7 @@ struct char_special_data_saved_plrtoascii {
struct player_special_data_saved_plrtoascii {
byte skills[MAX_SKILLS+1]; /* array of skills plus skill 0 */
byte PADDING0; /* used to be spells_to_learn */
byte legacy0; /* legacy unused byte */
bool talks[MAX_TONGUE]; /* PC s Tongues 0 for NPC */
int wimp_level; /* Below this # of hit points, flee! */
byte freeze_level; /* Level of god who froze char, if any */
@ -89,7 +89,7 @@ struct player_special_data_saved_plrtoascii {
ubyte spare3;
ubyte spare4;
ubyte page_length;
int spells_to_learn; /* How many can you learn yet this level*/
int spare5;
int olc_zone;
int spare8;
int spare9;
@ -263,8 +263,6 @@ void convert(char *filename)
if (psds->conditions[2] && player.level < LVL_IMMORT &&
psds->conditions[DRUNK] != PFDEF_DRUNK)
fprintf(outfile, "Drnk: %d\n", (int)psds->conditions[2]);
if (psds->spells_to_learn != PFDEF_PRACTICES)
fprintf(outfile, "Lern: %d\n", (int)psds->spells_to_learn);
/* char_ability_data */
cad = &(player.abilities);