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

Required weapon categories for buffs & techniques #52788

Merged
merged 4 commits into from
Nov 17, 2021

Conversation

dseguin
Copy link
Member

@dseguin dseguin commented Nov 13, 2021

Summary

None

Purpose of change

Fixes #52783. Very simple addition.
For martial arts, add the ability to specify one or more weapon categories required to perform a technique or benefit from a buff.

Describe the solution

Weapon category requirements can be defined using "weapon_categories_allowed". This field can accept a single string or an array of strings:

  "weapon_categories_allowed": "POLEARMS",

  "weapon_categories_allowed": [ "POLEARMS", "BATONS" ]

Example of defining weapon category requirements for a buff:

"onmiss_buffs": [
  {
    "id": "buff_fencing_onmiss",
    "name": "Remise",
    "description": "Your feint is the perfect setup for a devastating followup attack!\n\n+1 Accuracy.\nEnables \"Compound Attack\" technique.\nLasts 1 turn.",
    "skill_requirements": [ { "name": "melee", "level": 3 } ],
    "melee_allowed": true,
    "buff_duration": 1,
    "weapon_categories_allowed": [ "POLEARMS", "BATONS" ],
    "flat_bonuses": [ { "stat": "hit", "scale": 1.0 } ]
  }
]

As displayed on the info screen:
buff_cat

In this case, the player would only benefit from the buff when wielding either a polearm or baton. (This is not accurate to this specific martial art, it's just used as an example)

Describe alternatives you've considered

I think originally this was meant to address unarmed type weapons being uncategorized. For this, we would probably need to treat weapons with "UNARMED_WEAPON" as a special case.

Testing

Load game with defined weapon category restrictions for techniques and buffs.

Also added a unit test to check that ma_technique::is_valid_character() and ma_buff::is_valid_character() properly evaluate the weapon categories.

Additional context

Updated to use the new translated weapon category ids from #52639.

@Termineitor244
Copy link
Contributor

Wow, that was fast! Thank you so much!! I'm basically jumping of happiness! Hahaha.

@Maleclypse Maleclypse added Martial Arts Arts, Techniques, weapons and anything touching martial arts. <Bugfix> This is a fix for a bug (or closes open issue) labels Nov 13, 2021
@dseguin dseguin force-pushed the ma_category_requirements branch from de57431 to b0741a4 Compare November 14, 2021 17:04
@dseguin dseguin marked this pull request as ready for review November 14, 2021 17:06
@kevingranade kevingranade merged commit 6d50c74 into CleverRaven:master Nov 17, 2021
@dseguin dseguin deleted the ma_category_requirements branch November 17, 2021 06:22
@catdach catdach mentioned this pull request Mar 14, 2022
12 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
<Bugfix> This is a fix for a bug (or closes open issue) Martial Arts Arts, Techniques, weapons and anything touching martial arts.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Using Weapon Categories to define weapon specific techniques and buffs
4 participants