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

Worn gloves count as unarmed weapons when no weapon is held #41209

Merged
merged 3 commits into from
Jun 18, 2020

Conversation

CodeBandit
Copy link
Contributor

@CodeBandit CodeBandit commented Jun 10, 2020

Summary

SUMMARY: Features "Worn gloves count as unarmed weapons when no weapon is held"

Purpose of change

To facilitate the use of worn gloves as weapons when nothing is wielded since we are technically punching the enemies with them. This allows a unique quality to unarmed combat as we can now be "wielding" our weapons as soon as we drop whatever it is we are holding.

This PR is to facilitate this ability. Glove weapons and/or updates to existing gloves to have damage still need to happen. For the sake of not having dead code, and to prove out the feature, studded gloves have also been added.

Describe the solution

If the selected weapon is null (we aren't holding anything), then use the highest layer of gloves as our weapon instead. If it does not inherently have the unarmed combat flag, add it, then remove it later down the line.

This also converts cur_weapon from a reference to a pointer since reference variables cannot be reassigned. If not done this way, the gloves will be duped and held as a weapon instead.

Allowed the cestus to be able to be worn as an outer layer on hands, and still be used as an unarmed weapon.

Testing

Spawn light gloves, and punch debug monster. Make sure it trains unarmed, and the gloves can take damage.
Turn on force unarmed while wielding a cudgel, and repeat above.
Attack with a cudgel to make sure it still attacks with a held weapon.

@ghost
Copy link

ghost commented Jun 10, 2020

Does this break martial arts that limit the unarmed weapons you're allowed to use, like Aikido and Judo?

data/json/items/armor/gloves.json Outdated Show resolved Hide resolved
src/melee.cpp Outdated Show resolved Hide resolved
@Fris0uman
Copy link
Contributor

If it does not inherently have the unarmed combat flag, add it, then remove it later down the line.

I don't understand the point of this?
" If it has the flag use it as a weapon, if it doesn't give it the flag and use it as a weapon" What's the point of the flag if everything has it?

@CodeBandit
Copy link
Contributor Author

CodeBandit commented Jun 10, 2020

Does this break martial arts that limit the unarmed weapons you're allowed to use, like Aikido and Judo?

After reading this, I had the suspicion that it did and had a fix in mind. But, upon testing, it did not break them -so all good on this case.

" If it has the flag use it as a weapon, if it doesn't give it the flag and use it as a weapon" What's the point of the flag if everything has it?

The point of the flag is that it treats all gloves as temporary unarmed weapons. This means the following:
-Without this, it is as if the player is slapping the enemy with the gloves instead.
-Allow techniques to be used with gloves as the primary weapon.
-Because the gloves are treated as unarmed, the player gains unarmed experience instead of bash/cut/stab.
-Adding the flag then removing it later also prevents it from displaying "this weapon can be used with unarmed" text if it did not previously have it. Not removing it will leave the flag, which could magically claim it to be a weapon designed for combat when the player examines it.

@Fris0uman
Copy link
Contributor

So that means that I can wield studded glove and attack with them as if it was a normal weapon? Isn't that a bit hacky? Why not give a damage entry to armor like maybe glove_bash and just use that if you're wearing gloves, the value would default to 0 and there would be no need to use temp flags.

@CodeBandit
Copy link
Contributor Author

CodeBandit commented Jun 10, 2020

So that means that I can wield studded glove and attack with them as if it was a normal weapon?Isn't that a bit hacky?

Sure, you can -but just wielding it won't count it as an unarmed weapon (maybe this is the root of misunderstanding). You'll just be smacking them with the gloves, therefore not subject to anything unarmed related. Having it worn would make it count as unarmed.

Why not give a damage entry to armor like maybe glove_bash and just use that if you're wearing gloves, the value would default to 0 and there would be no need to use temp flags.

Because the unarmed flag is required for everything unarmed related. Its not about just applying the damage from gloves but also martial arts, "gloves" taking damage, unarmed exp/damage calculations, and actual wearable unarmed weapons as an outer layer (which I'm planning to add to existing unarmed weapons if this gets merged).

@CptFail92
Copy link
Contributor

Have you considered how this affects Taekwondo specifically? Ideally, the stats of one's shoes should apply. Barring that, Taekwondo becomes the only unarmed martial art that is--unrealistically--not affected by armor.

@CodeBandit
Copy link
Contributor Author

CodeBandit commented Jun 11, 2020

I am not interested in adding the edge case of using shoes as weapons just to appease Taekwondo. That would be a seldom visited feature and adds unnecessary complexity.

@SirPendrak
Copy link
Contributor

What about one-piece armor suits that have gloves/gauntlets incorporated like rm13, phase immersion suits, power armors etc?

@CodeBandit
Copy link
Contributor Author

If it covers hands, then it can be added to them.

@CodeBandit
Copy link
Contributor Author

Added some unarmed weapons to be worn on hands as the outer layer to give the PR more relevance if merged.

@anothersimulacrum anothersimulacrum added [C++] Changes (can be) made in C++. Previously named `Code` Melee Melee weapons, tactics, techniques, reach attack labels Jun 12, 2020
@Rivet-the-Zombie
Copy link
Member

Added some unarmed weapons to be worn on hands

Great for the cestus, not so good for brass/steel/nail knuckles, which also fill the hand with a grip, preventing you from holding much of anything else along with them.

@CodeBandit
Copy link
Contributor Author

Great for the cestus, not so good for brass/steel/nail knuckles, which also fill the hand with a grip, preventing you from holding much of anything else along with them.

I erroneously thought they just wrapped around your fingers this whole time haha. I have updated it so only the cestus is allowed to be worn.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[C++] Changes (can be) made in C++. Previously named `Code` Melee Melee weapons, tactics, techniques, reach attack
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants