Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Begin moving mutation attacks to Martial Arts techniques #71874

Merged
merged 17 commits into from
Feb 28, 2024

Conversation

fairyarmadillo
Copy link
Contributor

@fairyarmadillo fairyarmadillo commented Feb 20, 2024

Summary

Features "FANGS and FANGS_VAMPIRE mutations now add martial arts techniques rather than being free attacks"

Purpose of change

Followup to #70797

Mutation attacks have long been kind of weirdly implemented, being free attacks that happen instantly, often multiple times in a quarter of a second, simultaneously with weapon attacks. The player had no control over them, and they did not respect a lot of the standard attack code.

Describe the solution

  • Adds infrastructure for jsonizing mutation attacks. This is currently done via integrated items, building off of Allow non wielded items to provide techniques #70214 , but in future PRs will be extended to also work with limbs where appropriate.
  • Allows martial arts techniques to scale bonuses off of skills. The primary reason for this is scaling mutation attack damage off of the player's Unarmed skill, however the door is left open here for more interesting things to be done with weapons, other mutations (a fish tail attack only usable underwater which is bonused by swimming skill?), martial arts (a krav maga pistol whip that scales with pistols?), or especially mods. All skills are currently included except those which are fully craft/intellectual related.
  • Builds off of the natural_stance buff and the conditions system to allow certain mutants to have some influence over how often they use attacks.
  • Begins the process of moving mutation venom to specific body parts.
  • Adds MOUTH as an attack vector.
  • Updates documentation to make adding future attacks easier. The doc will be updated as I go through cutting and bashing mutation attacks in future PRs.

Using Attacks
Mutation attacks will randomly replace your normal melee attack. Each attack currently has a 1/5 chance of firing. This randomness represents the unpredictability of your animal instincts, and depending on the situation, you may or may not want your attack to go off. Perhaps replacing 20% of your human brain with cat was not as brilliant as it seemed.

All mutation attacks use the Unarmed skill. This gives the skill some utility it was sorely lacking and may help push wannabe martial artists to pursue mutations to keep up with late-game enemies.

Some conditions can affect the chance that you will use certain mutation attacks. Currently, they are:

  1. Attacking an enemy which is grabbing you will increase your bite chance to 1 in 2. This will actually help fang-bearing mutants quite a bit, as it's not uncommon to have your weapon arm(s) grabbed.
  2. Having the Natural Stance effect, which is already implemented, will increase your bite chance to 1 in 2. This effect is granted to any mutant with both digitigrade legs and any paws mutation, or bow-legged and bat wings, when they crouch or run without holding anything. Having this buff increases the chance of making a FANGS or FANGS_VAMPIRE attack to 1 in 2. This buff also removes all penalties for crouching in combat, so that quadrupeds are not penalized for fighting naturally.
  3. If you would like to not use any bite attacks, you can cover your mouth with any piece of equipment which is not flagged to allow natural attacks. A muzzled Lupine will not bite.
  4. This is not done in this PR, but similar conditions can be added for later mutation attacks. SHARKTEETH might fire more often underwater, FOLDING_FANGS if the target is webbed, etc.

FANGS and VAMPIRE_FANGS
These two mutations have been balanced by using the martial arts system to duplicate the code for stabbing attacks found in melee.cpp, and can themselves serve as an example for creating similar mutations. Rather than the stab skill, they use unarmed to scale their damage, and currently that damage is entirely deterministic rather than randomized. This is an issue with martial arts in general and could probably be fixed another time. Due to how flat_bonuses work, damage and arpen scale linearly with skill/strength rather than variably before and after rank 5. I have averaged the bonuses as best I can. The result is that at 0-2 ranks, vampire fangs slightly outperform a stabbing weapon of equivalent base speed. At 3-7 ranks they behave about the same, at 8-10 ranks they perform a bit worse. This makes sense to me - a human can train and master a weapon. While an animal can learn, it relies to a large extent on raw power and ferocity.

One drawback to this method is that the damage output is entirely deterministic, as no dice are rolled for damage. This was however already the case for mutation attacks, so in any event this is a big improvement. Adding a random element to the flat_bonus system might be worthwhile at a later date. Mutation attacks already had this issue, so it's at least not introducing a new problem.

I chose the USMC bayonet to test against as per #69201 it's about in the middle in terms of knife DPS, and has the same attack speed as both fangs. For this test, I removed rapid strike from the blade so that it had the exact same attack speed as both sets of fangs. Note that fangs cannot block and receive no hit bonuses or penalties, nor do they qualify for any martial arts techniques.

The intent here is that Fangs (being a fairly basic mutation) are worse than a proper knife. At 11.5 base DPS, they land at the upper end of the "dangerous tools or crude dedicated weapons" category - they'll do the job, but you want a good muzzle to make them really useful. Bats don't get a muzzle, and vampire fangs are intended to be some of the best teeth in the game (behind shark teeth and saber teeth. IRL vampire bat fangs are some of the sharpest teeth in the animal kingdom and sometimes cause injury even when handling specimens in museums - https://en.wikipedia.org/wiki/Vampire_bat). At 18.85 base DPS, they're worse than any weapon of war, but on the high end of what a useful tool can do.

Draculin
Draculin (that's what it's called irl!) is a venom specific to Chiropteran mutants that prolongs bleeding, and was ported over here from #70797 . It does not increase the intensity of bleed effects, but bleeding wounds will take longer to reduce in intensity, so more damage will be done over time.

If they do damage, fangs deliver draculin 70% of the time, or 90% of the time on a crit.
If they damage, vampire fangs deliver draculin 90% of the time, or 100% of the time on a crit.

Describe alternatives you've considered

After a lot of testing and trying out different things, I think this is the best method for mutation attacks. The only alternative I can imagine would be to create weapon entries for each one and write up some kind of hardcoded method of attacking with them, but I think we have enough json power to do it this way.

Testing

Spawned a character, mutated fangs. Attacked, saw they procced fairly infrequently. Wore a mask, saw they didn't proc. Took the mask off and mutated paws and digitigrade legs, crouched, saw they procced often.

Did the same with chiropteran stuff. Also saw that venom and draculin were proccing as intended.

TEST CHARACTER: 10 str 10 dex 10 int 10 per, fangs mutation only
vs Debug Monster
All skills 0
Fangs Bite damage: 16
Critical Fangs Bite damage: 16
Vampire Bite damage: 22
Critical Vampire Bite damage: 22
USMC bayonet damage: 16-21
Critical USMC bayonet damage: 18-21

All skills 3
Fangs Bite damage: 19
Critical Fangs Bite damage: 30
Vampire Bite damage: 25
Critical Vampire Bite damage: 36
USMC bayonet damage: 25-28
Critical USMC bayonet damage: 34-44

All skills 6
Fangs Bite damage: 22
Critical Fangs Bite damage: 43
Vampire Bite damage: 28
Critical Vampire Bite damage: 49
USMC bayonet damage: 29-39 damage
Critical USMC bayonet damage: 50-60

All skills 9
Fangs Bite damage: 26
Critical Fangs Bite damage: 57
Vampire Bite damage: 32
Critical Vampire Bite damage: 63
USMC bayonet damage: 31-39 damage
Critical USMC bayonet damage: 65-84

Additional context

This currently removes some of the interaction FANGS had with various muzzle mutations. I fully intend to re-add those interactions, but in the interest of sanity I'd like to keep this PR from becoming another 1000 line monster.

@github-actions github-actions bot added [JSON] Changes (can be) made in JSON [C++] Changes (can be) made in C++. Previously named `Code` Melee Melee weapons, tactics, techniques, reach attack Martial Arts Arts, Techniques, weapons and anything touching martial arts. <Enhancement / Feature> New features, or enhancements on existing labels Feb 20, 2024
@github-actions github-actions bot added <Documentation> Design documents, internal info, guides and help. Mutations / Traits / Professions/ Hobbies Mutations / Traits / Professions/ Hobbies Monsters Monsters both friendly and unfriendly. [Markdown] Markdown issues and PRs Items: Armor / Clothing Armor and clothing json-styled JSON lint passed, label assigned by github actions astyled astyled PR, label is assigned by github actions and removed json-styled JSON lint passed, label assigned by github actions labels Feb 20, 2024
@RedMisao
Copy link
Contributor

Sharing these in case they're useful for you:

  1. MA techniques can proc SPELLs via eocs + u_cast_spell, and these spells can be casted automatically at the target (no targeting window) with loc, if you save their coordinates, done on the fly with the EOC event character_melee_attacks_monster
  2. MA buffs can be recognized, added and removed by EOCs when written as mabuff:buff_niten_onattack

@TheShadowFerret
Copy link
Contributor

Can you add draculin to the (actual) vampire fangs from Xedra Evolved 👉👈

@github-actions github-actions bot added json-styled JSON lint passed, label assigned by github actions and removed astyled astyled PR, label is assigned by github actions labels Feb 21, 2024
@fairyarmadillo fairyarmadillo marked this pull request as ready for review February 22, 2024 02:46
@fairyarmadillo
Copy link
Contributor Author

@TheShadowFerret It looks like it'll be a bit more complex than just sticking a flag on VAMPIRE2, so it's best handled in a separate PR as we're already over 500 lines in this one.

@github-actions github-actions bot added the astyled astyled PR, label is assigned by github actions label Feb 22, 2024
@github-actions github-actions bot added the BasicBuildPassed This PR builds correctly, label assigned by github actions label Feb 22, 2024
@github-actions github-actions bot added astyled astyled PR, label is assigned by github actions and removed astyled astyled PR, label is assigned by github actions labels Feb 22, 2024
@KittyTac
Copy link
Contributor

WOOOOOOOOOOOOOOOOOOOOOOOOOO!

Copy link
Member

@kevingranade kevingranade left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IRL vampire bat fangs are some of the sharpest teeth in the animal kingdom and sometimes cause injury even when handling specimens in museums - https://en.wikipedia.org/wiki/Vampire_bat). At 27.5 base DPS, they're right in the middle of "weapons of war", but at high skill levels, they drop off compared to the bayonet.

This rationale doesn't make sense, they're sharp in order to avoid causing pain when biting so vampire bats don't wake up sleeping prey, they're still a set of max 2" or so deep wounds, that can't possibly compete with a deep stab from a knife for damage caused. The bleed extending venom makes sense, but there's no possible world where it's competing with a serious weapon for DPS.

@fairyarmadillo
Copy link
Contributor Author

IRL vampire bat fangs are some of the sharpest teeth in the animal kingdom and sometimes cause injury even when handling specimens in museums - https://en.wikipedia.org/wiki/Vampire_bat). At 27.5 base DPS, they're right in the middle of "weapons of war", but at high skill levels, they drop off compared to the bayonet.

This rationale doesn't make sense, they're sharp in order to avoid causing pain when biting so vampire bats don't wake up sleeping prey, they're still a set of max 2" or so deep wounds, that can't possibly compete with a deep stab from a knife for damage caused. The bleed extending venom makes sense, but there's no possible world where it's competing with a serious weapon for DPS.

I assume they're larger than 2 inches as they're a further evolution of the Fangs mutation, which is itself described that way, but in any event I've dropped them down to 15 base damage. This puts them at 18.75 base DPS. A gas station butterfly knife, for comparison, does 21.28 base DPS.

The OP has been updated to include this information and the new test results.

@Fris0uman
Copy link
Contributor

I assume they're larger than 2 inches as they're a further evolution of the Fangs mutation,

This is not the right way to think about it, if you're adding bat fangs mutation it should relate to what bat fangs do: cause small bleeds that bats can lick. If you want a powerfull fighting mutation don't base it on bats.

@fairyarmadillo
Copy link
Contributor Author

fairyarmadillo commented Feb 23, 2024

I reduced the damage to below even a subpar knife. It is no longer a powerful fighting mutation.

These animals have proportionally very large teeth, they are just very small animals. A human-sized one would be capable of inflicting a pretty nasty bite. Wikipedia says the typical vampire bat creates an 8mm x 7mm wound. The bat itself is only 76mm. Scaled up directly to human size, that's a roughly 192mm x 168mm wound, or 7.5 x 6.6 inches deep. I'm sure the anatomy doesn't scale up 1:1, but it's at least illustrative. The bat has two daggerlike incisors that protrude forward and several big sharp fangs to the side.

If our regular fangs are 2 inches, these are a bit bigger, and certainly sharper, is all I'm saying.

@Maleclypse
Copy link
Member

I think with the additional net nerf to damage this does by removing fangs bonus attack, this makes a lot of sense.

@fairyarmadillo
Copy link
Contributor Author

I had my measurements wrong. I'd previously said that a scaled-up vampire bat would make a roughly 3 inch deep bite, but I think it's closer to 7, as a vampire bat is 3 inches long and a 6 foot tall man is 24 times that size. 8mm x 24 = 192mm = 7.5 inches. I've edited my post. A USMC bayonet is 8 inches long and 1.4 inches wide, for comparison. As I mentioned earlier, the mutant is a human hybrid and probably not scaled up 1:1 (their head would probably be proportionally smaller at least, which would scale down the fang size some), but again it is illustrative.

Despite correcting my math there, I've left the base DPS at 18.75, which is much lower than the bayonet's 27.5, or even the much smaller balisong's 21.28, as Fris0uman is right that they shouldn't be pulping enemies with 100 damage bites, because bats are not strong fighters like many of the other animals our mutants are based on. The intent is that they are sneaking around, tagging enemies with their venom, and then escaping to let them bleed out.

I do wonder if it might be more appropriate for the vampire fangs to be a cutting weapon. I'm not sure how exactly we draw that distinction.

image

@Maleclypse Maleclypse dismissed kevingranade’s stale review February 28, 2024 03:08

I believe the requested changes have been made. This has desirable changes in it in addition.

@Maleclypse Maleclypse merged commit b3f4173 into CleverRaven:master Feb 28, 2024
27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
astyled astyled PR, label is assigned by github actions BasicBuildPassed This PR builds correctly, label assigned by github actions [C++] Changes (can be) made in C++. Previously named `Code` <Documentation> Design documents, internal info, guides and help. <Enhancement / Feature> New features, or enhancements on existing Items: Armor / Clothing Armor and clothing [JSON] Changes (can be) made in JSON json-styled JSON lint passed, label assigned by github actions [Markdown] Markdown issues and PRs Martial Arts Arts, Techniques, weapons and anything touching martial arts. Melee Melee weapons, tactics, techniques, reach attack Monsters Monsters both friendly and unfriendly. Mutations / Traits / Professions/ Hobbies Mutations / Traits / Professions/ Hobbies
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants