mirror of
https://codeberg.org/noisytoot/notnotdnethack.git
synced 2025-07-31 01:42:24 +01:00
Show weapon skill on inspection.
This commit is contained in:
parent
63eed49dea
commit
817951504e
3 changed files with 44 additions and 6 deletions
|
@ -2996,6 +2996,7 @@ E int FDECL(weapon_hit_bonus, (struct obj *, int));
|
|||
E int FDECL(weapon_dam_bonus, (struct obj *, int));
|
||||
E void FDECL(skill_init, (const struct def_skill *));
|
||||
E void FDECL(skill_add, (const struct def_skill *));
|
||||
E const char * FDECL(P_NAME, (int));
|
||||
E int NDECL(aeshbon);
|
||||
|
||||
/* ### were.c ### */
|
||||
|
|
32
src/invent.c
32
src/invent.c
|
@ -2543,6 +2543,38 @@ winid *datawin;
|
|||
else {
|
||||
Sprintf(buf, "Thrown %smissile.", buf2);
|
||||
}
|
||||
/* special cases */
|
||||
if (oartifact == ART_PEN_OF_THE_VOID && obj && (obj->ovar1 & SEAL_EVE))
|
||||
Strcpy(eos(buf)-1, ", and launcher.");
|
||||
if (oartifact == ART_LIECLEAVER || oartifact == ART_ROGUE_GEAR_SPIRITS)
|
||||
Sprintf(eos(buf)-1, ", and %smelee weapon.", buf2);
|
||||
OBJPUTSTR(buf);
|
||||
|
||||
/* what skill does it use? */
|
||||
if (obj) {
|
||||
Sprintf(buf, "Uses your %s skill", P_NAME(abs(weapon_type(obj))));
|
||||
/* special cases */
|
||||
switch (oartifact) {
|
||||
case ART_LIECLEAVER:
|
||||
Strcpy(buf2, " at range, and your scimitar skill in melee.");
|
||||
break;
|
||||
case ART_ROGUE_GEAR_SPIRITS:
|
||||
Strcpy(buf2, " at range, and your pickaxe skill in melee.");
|
||||
break;
|
||||
case ART_PEN_OF_THE_VOID:
|
||||
if(obj->ovar1 & SEAL_EVE) {
|
||||
Strcpy(buf2, " in melee, and your ammo's skill at range.");
|
||||
}
|
||||
else
|
||||
Strcpy(buf2, ".");
|
||||
break;
|
||||
default:
|
||||
Strcpy(buf2, ".");
|
||||
}
|
||||
Strcat(buf, buf2);
|
||||
} else {
|
||||
Sprintf(buf, "Uses the %s skill.", P_NAME(oc.oc_skill));
|
||||
}
|
||||
OBJPUTSTR(buf);
|
||||
|
||||
/* weapon dice! */
|
||||
|
|
17
src/weapon.c
17
src/weapon.c
|
@ -157,12 +157,6 @@ STATIC_DCL void FDECL(skill_advance, (int));
|
|||
|
||||
#endif /* OVL1 */
|
||||
|
||||
#define P_NAME(type) ((skill_names_indices[type] > 0) ? \
|
||||
OBJ_NAME(objects[skill_names_indices[type]]) : \
|
||||
(type == P_BARE_HANDED_COMBAT) ? \
|
||||
barehands_or_martial[martial_bonus()] : \
|
||||
odd_skill_names[-skill_names_indices[type]])
|
||||
|
||||
#ifdef OVLB
|
||||
static NEARDATA const char kebabable[] = {
|
||||
S_XORN, S_DRAGON, S_JABBERWOCK, S_NAGA, S_GIANT, '\0'
|
||||
|
@ -3642,6 +3636,17 @@ const struct def_skill *class_skill;
|
|||
}
|
||||
}
|
||||
|
||||
const char *
|
||||
P_NAME(type)
|
||||
int type;
|
||||
{
|
||||
return ((skill_names_indices[type] > 0) ? \
|
||||
OBJ_NAME(objects[skill_names_indices[type]]) : \
|
||||
(type == P_BARE_HANDED_COMBAT) ? \
|
||||
barehands_or_martial[martial_bonus()] : \
|
||||
odd_skill_names[-skill_names_indices[type]]);
|
||||
}
|
||||
|
||||
int
|
||||
aeshbon()
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue