1
0
Fork 0
mirror of https://codeberg.org/noisytoot/notnotdnethack.git synced 2025-07-26 23:32:25 +01:00
notnotdnethack/include/skills.h
RikerW de3efe593e add knightly styles
following the etherpad outline wiith minor tweaks

all knights can get expert in any of the 4 style skills: shield bashing, great weapon fighting, half-sword style, and advanced knightly styles
in total, 6 styles exist - those 4, but advanced is one skill for "sacred style", "runic style", and "eldritch style". the same skill is used for the 3, so enhancing/training via any work for the others
all skills can be used when unskilled, they just probably don't do anything (shield/half sword have minor effects), because you need to be in the stance to train it

style breakdown:

shield bashing:
- allows you to make an offhand shield attack when in the style where uarms exists. does not really like two-weaponing + uarms exists, but that shouldn't happen, jsut don't add paired greatshields.... yet
- this shield attack uses hmon and treats this as a proper weapon attack, so it will add enchantment or property bonus damages like a normal weapon attack. this is treated as having a base die of d2/d4/d6/d8 for unskilled->expert skills, and dmod is factored in as normal so a large shield is larger funny numbers
- the whole dmod/damage thing doesn't go SUPER well with the assumption that all shields are one-handed regardless of size (cuz armor slot not weapon slot) but hey, it would be really badass...
- this actually would work well if a shield arti/otyp with bonus damage is added later, or even just a spiked kite shield or something in the knight quest
- note that any shield always has the same damage dice, regardless of size
- the offhand attack also lowers morale by a substantial chunk. caps at -0/-5/-10/-15 for unskilled->expert, dealing 1/1/2/3 points of morale damage each. is this really strong? possibly. I'm not really sure the balance implications of -15 damage to all attacks after 5/6 hits on something, but my logic here is that you're trading a shield with decent but mediocre damage for the debuff, and you'd kill most things in <6 hits anyway. if it lives longer, then the -15 morale is probably justified on that target
- trains shield bash skill by bashing with things, successful hits like any other weapon skill (just added a thing to wtype for shields)

great weapon fighting:
- reduces the minimum roll for bimanual weapons, depending on skill, by 0/1/2/3 for unskilled->expert. so unskilled is no effect, but expert makes d6 always roll 4-6
- this is implemented as NdX becoming Nd(X-i) + N*i, where i is the highest roll we're slicing off. so 3d6 becomes 3d3 + 9. this stacks with both exploding and lucky dice, but NOT exploding lucky dice, because 1. it's probably really strong as-is on an exploding d6 or something, and 2. i'm not fucking with those functions
- possibly the easiest here to use, since it has absolutely no downsides and only upsides. balance-wise, shouldn't actually be too much of a big deal for non-exploding weapons, since this doesn't add any extra damage (by definition) only makes your damage more consistent/raises your avg, not the peak damage
- trained by attacking with bimanual things while its active

half-sword style:
- basically, allows longswords to be shining and two-handed, but locks them to piercing and two-handed.
- the real-life thing apparently involves grasping the middle of the sword with your offhand to help aim/improve your thrusts, so this turns all longswords to bimanual. oversized ones presumably just require two-hands like normal, just positioned differently - ignore the whole thing about "your arms reaching the halfway point".
- this cannot be swapped to or off of with a cursed longsword/no free hands, since it involves repositioning your hands
- the gameplay effects are kind of odd. at first, the issue was "why train past basic if it pierces ac/dr at basic", or s/basic/whatever skill/. so i gave it like, 1d6-3d6 precision damage with skill, so that's a minor damage bonus. then i later implemented the two-handed thing, so now it also has the niche benefit of letting you forcibly two-hand your sword, so if you're fighting with only one sword (no shield or twoweap) then you can get the 2x str bonus + the precision damage. this is probably pretty good, becausee i'ts "free" damage (applies to almost everything), but the actual dmg values are kinda low sooo
- trained by making precision attacks while its active (no bonus damage at unskilled thouhg, just training)

sacred style:
- allows for bonus holy/unholy damage for any weapon
- costs 5 pw/hit, doesn't activate if <5 pw
- deals an extra 1d8/3d8/6d8 holy/unholy damage at basic-expert. unskilled is no damage
- holy/unholy is decided by being holy for holy/neutral gods with good align, or chaotic/void gods with bad align. vice versa for unholy damage
- the damage DOES require the sword to actually BE blessed/cursed, it's not like artifact holy dmg where its always applied and double for vulnerabilities, this extends the normal blessed/cursed item damage (and stacks with it, for things like excalibur etc.)
- trains your advanced techniques when successfully dealing bonus holy/unholy damage (even if no damage is applied bc unskilled)

runic style:
- allows for MR when wielding a long sword above basic skill
- that is it. does not do anything else, can't train it or anything (it woudl train advanced ofc but like, you just can't train it).
- if you are wielding a long sword, if you have above basic skill, and you're in the form -> MR get.

eldritch style:
- allows for extra elemental damage for any weapon
- basically, you select a spell that you know and can cast, and apply its damage type to your weapon
- valid spells are fireball/storm, cone of cold/blizzard, lightning bolt/storm, acid splash, poison spray, finger of death
- they each grant their element damage. dice are 1/3/6 for b/s/e, size is 13 for death, 8 for the storm spells, and 6 otherwise
- note that death checks AD_DARK because.... i think it's cool? and also probably easier htan fuckign with AD_DISN or some shit. i think its appropriate. poison also sets weapont o have basic poison because i want lawful penalties for poison. acid is OK lugh doesnt notice. not like u can easily get acid/poison without BOIS or ana bones, and poison isnt good so its fine
- to actually apply the damage, you must know the spell and have good odds of casting it. i think right now (i realize as i write this) you can probably set the spell, forget it, and it won't unset the damage - so that'll be fixed later, i have to write more messages too so
- the damage is applied with same odds of spell success, so percentage > rn2(100) basically. so a 75% fail rate with expert kni advance skill on finger of death gives a 25% of 6d13 dark damage per hit, 75% nothing. trains skill regardless though. doens't care about attack spell skill unless you need it to cast - so 0% fail artis DO work with this.
- trains every single time you hit with it active, regardless of whether its applying extra damage. i'll change that later to be "every time it would have applied damage if you weren't unskilled" probably.

oh yeah styles are blocked by
sacred, eldritch - nothing (eldritch cares about spell success)
great wep - no bimanual weapon
shield bash - no shield
runic - no long sword
half-sword - no long sword that you can two-hand (i.e. no uarms/twoweap/whatever)

TODO:
- add messages to sacred, eldritch styles
- move skill up code for eldritch styles
- need to double check when sacred/eldritch styles are applying. it SEEMED fine, and it's intentional that they should still work on some thrown items, but it definitely needs to be looked at
- all knights get this. should berith give some of this? i have NO clue. i will 99% chance not add it to anybody else, but for the future. dwarf knights do get this btw
2023-09-11 17:39:11 -07:00

181 lines
5.7 KiB
C

/* SCCS Id: @(#)skills.h 3.4 1999/10/27 */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985-1999. */
/* NetHack may be freely redistributed. See license for details. */
#ifndef SKILLS_H
#define SKILLS_H
/* Much of this code was taken from you.h. It is now
* in a separate file so it can be included in objects.c.
*/
/* Code to denote that no skill is applicable */
#define P_NONE 0
/* Weapon Skills -- Stephen White
* Order matters and are used in macros.
* Positive values denote hand-to-hand weapons or launchers.
* Negative values denote ammunition or missiles.
* Update weapon.c if you ammend any skills.
* Also used for oc_subtyp.
*/
#define P_DAGGER 1
#define P_KNIFE 2
#define P_AXE 3
#define P_PICK_AXE 4
#define P_SHORT_SWORD 5
#define P_BROAD_SWORD 6
#define P_LONG_SWORD 7
#define P_TWO_HANDED_SWORD 8
#define P_SCIMITAR 9
#define P_SABER 10
#define P_CLUB 11 /* Heavy-shafted bludgeon */
#define P_MACE 12
#define P_MORNING_STAR 13 /* Spiked bludgeon */
#define P_FLAIL 14 /* Two pieces hinged or chained together */
#define P_HAMMER 15 /* Heavy head on the end */
#define P_QUARTERSTAFF 16 /* Long-shafted bludgeon */
#define P_POLEARMS 17
#define P_SPEAR 18 /* includes javelin */
#define P_TRIDENT 19
#define P_LANCE 20
#define P_BOW 21
#define P_SLING 22
//#ifdef FIREARMS
#define P_FIREARM 23 /* KMH */
//#endif
#define P_CROSSBOW 24
#define P_DART 25
#define P_SHURIKEN 26
#define P_BOOMERANG 27
#define P_WHIP 28
#define P_HARVEST 29
#define P_UNICORN_HORN 30 /* last weapon */
#define P_FIRST_WEAPON P_DAGGER
#define P_LAST_WEAPON P_UNICORN_HORN
/* Spell Skills added by Larry Stewart-Zerba */
#define P_ATTACK_SPELL (P_LAST_WEAPON + 1)
#define P_HEALING_SPELL (P_LAST_WEAPON + 2)
#define P_DIVINATION_SPELL (P_LAST_WEAPON + 3)
#define P_ENCHANTMENT_SPELL (P_LAST_WEAPON + 4)
#define P_CLERIC_SPELL (P_LAST_WEAPON + 5)
#define P_ESCAPE_SPELL (P_LAST_WEAPON + 6)
#define P_MATTER_SPELL (P_LAST_WEAPON + 7)
#define P_WAND_POWER (P_LAST_WEAPON + 8)
#define P_FIRST_SPELL P_ATTACK_SPELL
#ifdef BARD
#define P_MUSICALIZE (P_LAST_WEAPON + 9) /* 'cast' spells as songs */
#define P_LAST_SPELL P_MUSICALIZE
#else
#define P_LAST_SPELL P_WAND_POWER
#endif
/* musicalize indices */
#define SNG_FEAR 1
#define SNG_SLEEP 2
#define SNG_HEAL 3
#define SNG_RLLY 4
#define SNG_CONFUSION 5
#define SNG_HASTE 6
#define SNG_CNCL 7
#define SNG_SLOW 8
#define SNG_TAME 9
#define SNG_COURAGE 10
/* Other types of combat */
#define P_BARE_HANDED_COMBAT (P_LAST_SPELL + 1)
#define P_MARTIAL_ARTS P_BARE_HANDED_COMBAT /* Role distinguishes */
#define P_TWO_WEAPON_COMBAT (P_LAST_SPELL + 2)
#define P_SHIELD (P_LAST_SPELL + 3)
#define P_BEAST_MASTERY (P_LAST_SPELL + 4)
#define P_SHII_CHO (P_LAST_SPELL + 5)
#define P_MAKASHI (P_SHII_CHO + 1)
#define P_SORESU (P_SHII_CHO + 2)
#define P_ATARU (P_SHII_CHO + 3)
#define P_DJEM_SO (P_SHII_CHO + 4)
#define P_SHIEN (P_SHII_CHO + 5)
#define P_NIMAN (P_SHII_CHO + 6)
#define P_JUYO (P_SHII_CHO + 7)
#define P_SHIELD_BASH (P_SHII_CHO + 8)
#define P_GREAT_WEP (P_SHII_CHO + 9)
#define P_HALF_SWORD (P_SHII_CHO + 10)
#define P_KNI_ADVANCED (P_SHII_CHO + 11)
#define P_RIDING (P_KNI_ADVANCED + 1) /* How well you control your steed */
#define P_LAST_H_TO_H P_RIDING
#define P_FIRST_H_TO_H P_BARE_HANDED_COMBAT
#define P_NUM_SKILLS (P_LAST_H_TO_H+1)
/* These roles qualify for a martial arts bonus */
#define martial_bonus() (u.umartial || Earth_crystal)
/* Fighting form IDs */
/* each batch of 32 is mutually exclusive, but not with other batches */
#define NO_FFORM 0
#define FFORM_SHII_CHO 1
#define FFORM_MAKASHI 2
#define FFORM_SORESU 3
#define FFORM_ATARU 4
#define FFORM_DJEM_SO 5
#define FFORM_SHIEN 6
#define FFORM_NIMAN 7
#define FFORM_JUYO 8
#define FIRST_LS_FFORM FFORM_SHII_CHO
#define LAST_LS_FFORM FFORM_JUYO
#define FFORM_SHIELD_BASH 1 + 32
#define FFORM_GREAT_WEP 2 + 32
#define FFORM_HALF_SWORD 3 + 32
#define FFORM_KNI_SACRED 4 + 32
#define FFORM_KNI_RUNIC 5 + 32
#define FFORM_KNI_ELDRITCH 6 + 32
#define FIRST_KNI_FFORM FFORM_SHIELD_BASH
#define LAST_KNI_FFORM FFORM_KNI_ELDRITCH
#define LAST_FFORM FFORM_KNI_ELDRITCH
#define FightingFormSkillLevel(i) P_SKILL(getFightingFormSkill(i))
/*
* These are the standard weapon skill levels. It is important that
* the lowest "valid" skill be be 1. The code calculates the
* previous amount to practice by calling practice_needed_to_advance()
* with the current skill-1. To work out for the UNSKILLED case,
* a value of 0 needed.
*/
#define P_ISRESTRICTED 0
#define P_UNSKILLED 1
#define P_BASIC 2
#define P_SKILLED 3
#define P_EXPERT 4
#define P_MASTER 5 /* Unarmed combat/martial arts only */
#define P_GRAND_MASTER 6 /* Unarmed combat/martial arts only */
#define practice_needed_to_advance(level) ((level)*(level)*20)
/* The hero's skill in various weapons. */
struct skills {
xchar skill;
xchar max_skill;
unsigned short advance;
};
#define OLD_P_SKILL(type) (u.weapon_skills[type].skill)
#define OLD_P_MAX_SKILL(type) (u.weapon_skills[type].max_skill)
#define P_ADVANCE(type) (u.weapon_skills[type].advance)
#define OLD_P_RESTRICTED(type) (u.weapon_skills[type].skill == P_ISRESTRICTED)
#define P_SKILL_LIMIT 90 /* Max number of skill advancements (added +30 for human bonus, even though shouldnt need that many) */
/* Initial skill matrix structure; used in u_init.c and weapon.c */
struct def_skill {
xchar skill;
xchar skmax;
};
#endif /* SKILLS_H */