Skip to content

Commit a4532f1

Browse files
add some output to SKILLS to more easily identify which skills are from skillsofts (#827)
add some output to SKILLS to more easily identify which skills are from skillsofts, and what your normal rank is (if any)
1 parent 38978bc commit a4532f1

File tree

4 files changed

+19
-7
lines changed

4 files changed

+19
-7
lines changed

src/act.comm.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ extern struct skill_data skills[];
3737

3838
extern void respond(struct char_data *ch, struct char_data *mob, char *str);
3939
extern bool can_send_act_to_target(struct char_data *ch, bool hide_invisible, struct obj_data * obj, void *vict_obj, struct char_data *to, int type);
40-
extern char *how_good(int skill, int percent);
40+
extern char *how_good(int skill, int percent, bool chipped, int natural);
4141
extern const char *get_voice_perceived_by(struct char_data *speaker, struct char_data *listener, bool invis_staff_should_be_identified);
4242
int find_skill_num(char *name);
4343
void ring_phone(struct phone_data *k);
@@ -1670,7 +1670,9 @@ ACMD(do_language)
16701670
continue;
16711671

16721672
if ((GET_SKILL(ch, i)) > 0) {
1673-
snprintf(buf, sizeof(buf), "%-20s %-17s", skills[i].name, how_good(i, GET_SKILL(ch, i)));
1673+
snprintf(buf, sizeof(buf), "%-20s %-17s", skills[i].name,
1674+
how_good(i, GET_SKILL(ch, i), GET_CHIPJACKED_SKILL(ch, i), GET_RAW_SKILL(ch, i))
1675+
);
16741676
if (GET_LANGUAGE(ch) == i)
16751677
strlcat(buf, " ^Y(Speaking)^n", sizeof(buf));
16761678
strlcat(buf, "\r\n", sizeof(buf));

src/act.other.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ SPECIAL(shop_keeper);
6363
SPECIAL(spraypaint);
6464
SPECIAL(johnson);
6565
SPECIAL(anticoagulant);
66-
extern char *how_good(int skill, int percent);
66+
extern char *how_good(int skill, int percent, bool chipped, int natural);
6767
extern void perform_tell(struct char_data *, struct char_data *, char *);
6868
extern void obj_magic(struct char_data * ch, struct obj_data * obj, char *argument);
6969
extern void end_quest(struct char_data *ch, bool succeeded);
@@ -1620,7 +1620,9 @@ void _send_alphabetized_skills_to_ch(struct char_data *ch, const char *arg, int
16201620
continue;
16211621

16221622
if ((GET_SKILL(ch, i)) > 0) {
1623-
snprintf(buf2, sizeof(buf2), "%-40s %s\r\n", skills[i].name, how_good(i, GET_SKILL(ch, i)));
1623+
snprintf(buf2, sizeof(buf2), "%-40s %s\r\n", skills[i].name,
1624+
how_good(i, GET_SKILL(ch, i), GET_CHIPJACKED_SKILL(ch, i), GET_RAW_SKILL(ch, i))
1625+
);
16241626
vec.push_back(std::string(buf2));
16251627
}
16261628
}

src/utils.cpp

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4386,10 +4386,18 @@ const char *skill_rank_name(int rank, bool knowledge)
43864386
#undef RANK_MESSAGE
43874387
}
43884388

4389-
char *how_good(int skill, int rank)
4389+
char *how_good(int skill, int rank, bool chipped, int natural)
43904390
{
4391+
static char practiced[256];
4392+
if (chipped && natural != 0) {
4393+
snprintf(practiced, sizeof(practiced), " (Practiced at rank ^c%2d^n)", natural);
4394+
}
43914395
static char buf[256];
4392-
snprintf(buf, sizeof(buf), " (rank ^c%2d^n: %s)", rank, skill_rank_name(rank, skills[skill].is_knowledge_skill == SKILL_TYPE_KNOWLEDGE));
4396+
snprintf(buf, sizeof(buf), " (rank ^c%2d^n: %s%s)%s", rank,
4397+
skill_rank_name(rank, skills[skill].is_knowledge_skill == SKILL_TYPE_KNOWLEDGE),
4398+
chipped ? ", ^yChipped^n" : "",
4399+
chipped && natural != 0 ? practiced : ""
4400+
);
43934401
return buf;
43944402
}
43954403

src/utils.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ vnum_t vnum_from_gridguide_coordinates(long x, long y, struct char_data *ch, str
247247
struct veh_data *get_veh_controlled_by_char(struct char_data *ch);
248248

249249
// Skill-related.
250-
char *how_good(int skill, int rank);
250+
char *how_good(int skill, int rank, bool chipped, int natural);
251251
const char *skill_rank_name(int rank, bool knowledge);
252252
void set_character_skill(struct char_data *ch, int skill_num, int new_value, bool send_message, bool save_immediately=TRUE);
253253

0 commit comments

Comments
 (0)