1
0
Fork 0
mirror of https://codeberg.org/noisytoot/notnotdnethack.git synced 2024-09-19 14:05:02 +01:00
notnotdnethack/include/spell.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

53 lines
2.1 KiB
C

/* SCCS Id: @(#)spell.h 3.4 1995/06/01 */
/* Copyright 1986, M. Stephenson */
/* NetHack may be freely redistributed. See license for details. */
#ifndef SPELL_H
#define SPELL_H
/* spellmenu arguments; 0 thru n-1 used as spl_book[] index when swapping */
#define SPELLMENU_QUIVER (-6)
#define SPELLMENU_PICK (-5)
#define SPELLMENU_MAINTAIN (-4)
#define SPELLMENU_DESCRIBE (-3)
#define SPELLMENU_CAST (-2)
#define SPELLMENU_VIEW (-1)
struct spell {
short sp_id; /* spell id (== object.otyp) */
xchar sp_lev; /* power level */
int sp_know; /* knowlege of spell */
boolean sp_ext; /* spell is externally provided (by an artifact) */
};
#define KEEN 20000
#define incrnknow(spell) spl_book[spell].sp_know = KEEN
#define percdecrnknow(spell, knw) spl_book[spell].sp_know = max(0, spl_book[spell].sp_know - (KEEN*knw)/100)
#define spellev(spell) spl_book[spell].sp_lev
#define spellname(spell) OBJ_NAME(objects[spellid(spell)])
#define spellet(spell) \
((char)((spell < 26) ? ('a' + spell) : ('A' + spell - 26)))
#define decrnknow(spell) spl_book[spell].sp_know--
#define ndecrnknow(spell, knw) spl_book[spell].sp_know = max(0, spl_book[spell].sp_know - knw)
#define spellid(spell) spl_book[spell].sp_id
#define spellknow(spell) spl_book[spell].sp_know
#define spellext(spell) spl_book[spell].sp_ext
#define emergency_spell(spell) (spellid(spell) == SPE_HEALING || spellid(spell) == SPE_EXTRA_HEALING || \
spellid(spell) == SPE_MASS_HEALING || \
spellid(spell) == SPE_CURE_BLINDNESS || spellid(spell) == SPE_FULL_HEALING || \
spellid(spell) == SPE_RESTORE_ABILITY || spellid(spell) == SPE_REMOVE_CURSE)
#define metal_blocks_spellcasting(otmp) (otmp && \
(is_metallic(otmp) || otmp->oartifact == ART_DRAGON_PLATE) && \
!(check_oprop(otmp, OPROP_BRIL) || otmp->otyp == HELM_OF_BRILLIANCE || (otmp->otyp == HELM_OF_TELEPATHY && base_casting_stat() == A_CHA)))
#define FIRST_LIGHT MAXSPELL+1
#define PART_WATER MAXSPELL+2
#define OVERGROW MAXSPELL+3
#define APPLE_WORD MAXSPELL+4
#define MAX_BONUS_DICE 10
#endif /* SPELL_H */