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

Add 'Brawler' trait, disallowing use of ranged weapons #57948

Merged
merged 6 commits into from
Aug 20, 2022

Conversation

tornikeo
Copy link
Contributor

@tornikeo tornikeo commented May 26, 2022

Summary

Content "Add 'Brawler' trait, disallowing ranged weapon use"

Purpose of change

Add a trait that acts as a wayfarer, but for ranged weapons. Characters with 'Brawler' trait can no longer wield any non-bionic ranged weapons (type 'GUN'). Fixes #47337.

Describe the solution

Add Brawler trait below wayfarer, in traits JSON. Add extra condition check in Character::can_wield where if item type is gun and char has the trait, the action is refused.

Describe alternatives you've considered

Allow gun wield, disallow firing. Buuut, I went in the analogy of the wayfarer. Which just disallows controlling vehicles, instead of allowing that and disallowing to move the vehicle.
Edit: I went with this alternative in the end. Wield guns, no pew-pew allowed. Also, no turret use.

Testing

image

image

image

Additional context

None

@github-actions github-actions bot added [C++] Changes (can be) made in C++. Previously named `Code` [JSON] Changes (can be) made in JSON json-styled JSON lint passed, label assigned by github actions astyled astyled PR, label is assigned by github actions labels May 26, 2022
@lbnesquik
Copy link
Contributor

This is an interesting trait. I think it could be added as is, honestly!

Here are some comments :

  • Change 'guns' to 'ranged weapons' as the GUN category includes things like crossbows or longbows. That might catch some people off guard.

  • Maybe allow non-modern weapons, such as bows or slings, perhaps as a second, less rewarding trait.

  • Have you considered it being an extreme mood penalty instead of a strict lock?

@tornikeo
Copy link
Contributor Author

Hey. Thanks. Here's what I think (please correct me as you see fit):

  • Good point. On it.
  • That would require me to create a list of all items that are bows and check for that. Also, crossbows having underbarrel attachments makes that incredibly difficult.
  • I use established things as guides. I see that wayfarer doesn't have that kind of flexibility. That's why I went with this, alongside with the simplicity of implementing this.
    What are your thoughts?

@tornikeo tornikeo changed the title Add 'Brawler' trait, disallowing use of guns Add 'Brawler' trait, disallowing use of ranged weapons May 26, 2022
@Inglonias
Copy link
Contributor

I think a flat inability to wield these weapons works better than a mood penalty. A mood penalty would open the door to minmaxing. Considering this trait is optional, keep it as is. Plus, in combat, your mood really doesn't affect your performance too much.

@TheShadowFerret
Copy link
Contributor

TheShadowFerret commented May 26, 2022

Why "no wielding" rather than "no firing?" I don't always have storage for long weapons(in this issue, long guns) that I want to sell, so I wield them on way to the trader.

@github-actions github-actions bot added the BasicBuildPassed This PR builds correctly, label assigned by github actions label May 26, 2022
@tornikeo
Copy link
Contributor Author

That's a good point. I mean, not wanting to even touch ranged weapons during the cataclysm is as crazy as the wayfarer trait. But what you suggest might be better overall. I'll have to block a few key inputs then.

@github-actions github-actions bot added the Vehicles Vehicles, parts, mechanics & interactions label May 27, 2022
@tornikeo
Copy link
Contributor Author

image
image
image
image

@tornikeo
Copy link
Contributor Author

I need someone to give me the good ol' Torvalds-level criticism about my code here. Especially about removing vs disabling vehicle options.

@anoobindisguise
Copy link
Contributor

What ranged abilities does this leave the player? Throwing rocks/grenades, bows/crossbows (?), bionic shotgun and finger laser (?). Guns are in a class of their own when it comes to ranged weapons but I don't know how comprehensive this is in total.

@snipercup
Copy link
Contributor

What ranged abilities does this leave the player? Throwing rocks/grenades, bows/crossbows (?), bionic shotgun and finger laser (?). Guns are in a class of their own when it comes to ranged weapons but I don't know how comprehensive this is in total.

Also wands, possibly spells. It really depends on your definition of ranged weapon.

@github-actions github-actions bot removed the BasicBuildPassed This PR builds correctly, label assigned by github actions label Jun 2, 2022
@github-actions github-actions bot added Code: Tooling Tooling that is not part of the main game but is part of the repo. Crafting / Construction / Recipes Includes: Uncrafting / Disassembling Items: Armor / Clothing Armor and clothing Items: Containers Things that hold other things Melee Melee weapons, tactics, techniques, reach attack Mods Issues related to mods or modding Mods: MMA Mythical Martial Arts mod labels Jun 2, 2022
@tornikeo
Copy link
Contributor Author

tornikeo commented Jun 2, 2022

Whoa. Well, that's a lot of unnecessary labels (800 lines of code?!). I tried rebasing to 9d0c414 . Since that's the last successful commit (doesn't fail tests). Am I doing this wrong? :D
Update: Just had to rebase the last 3 commits. Instead did every commit since my last commit. I believe that's fixed now.

@anoobindisguise
Copy link
Contributor

FWIW I thought that 4 points for Brawler was a pretty decent trade, I was theorycrafting and honestly couldn't decide if it was worth it or not because ranged weapons (guns especially) are extremely valuable assets but I have managed to make do without them on strong melee characters. However even those would sometimes want to use a gun for a smoker or something. At two points though I couldn't see myself ever taking that trait if I wanted a "strong" character.

@tornikeo
Copy link
Contributor Author

tornikeo commented Jun 2, 2022

@anoobindisguise Hey. My thoughts exactly. Think about it like this: Can a wayfarer ever beat a guy with death APC? No way right? This trait is for people who played with guns too often and want to find other ways of playing the game. Me included - for me, the game is "won" whenever I find an M4. From that I snowball to a scar-h and, finally, Barrett - the ultimate door-buster. With this trait, you won't ever get those - the question is, can you adapt around this crippling restriction?

p.s.: The point gain will be tweaked if a reasonable number of you guys want it - I'll do it myself, even. :)

@github-actions github-actions bot added the BasicBuildPassed This PR builds correctly, label assigned by github actions label Jun 2, 2022
src/ranged.cpp Outdated Show resolved Hide resolved
src/ranged.cpp Outdated Show resolved Hide resolved
Co-authored-by: Anton Burmistrov <[email protected]>
@stale
Copy link

stale bot commented Aug 13, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. Please do not 'bump' or comment on this issue unless you are actively working on it. Stale issues, and stale issues that are closed are still considered.

@stale stale bot added the stale Closed for lack of activity, but still valid. label Aug 13, 2022
@bombasticSlacks bombasticSlacks merged commit 262a6eb into CleverRaven:master Aug 20, 2022
@waveyl
Copy link
Contributor

waveyl commented Aug 20, 2022

Is this on purpose?
image

pjf added a commit to pjf/Cataclysm-DDA that referenced this pull request Aug 21, 2022
* origin/master:
  Add 'Brawler' trait, disallowing use of ranged weapons (CleverRaven#57948)
  initial commit (CleverRaven#60314)
Hirmuolio pushed a commit to Hirmuolio/Cataclysm-DDA that referenced this pull request Aug 27, 2022
…7948)

* Add 'Brawler' trait, disallowing use of guns

* Halve point gain from 'Brawler' trait

* Make Brawler wield weapons but disallow its use (incl. turrets)

* Manually re-order static declarations

* Add info for brawler ranged use refusal

* Update src/ranged.cpp

Co-authored-by: Anton Burmistrov <[email protected]>

Co-authored-by: Anton Burmistrov <[email protected]>
Zlorthishen added a commit to Zlorthishen/Cataclysm-BN that referenced this pull request Mar 23, 2024
chaosvolt added a commit to cataclysmbnteam/Cataclysm-BN that referenced this pull request Mar 30, 2024
* initial commit

port of CleverRaven/Cataclysm-DDA#57948

Co-Authored-By: tornikeo <[email protected]>

* style(autofix.ci): automated formatting

* Update mutations.json

-8 points it is

* update

porting CleverRaven/Cataclysm-DDA#60328

Co-Authored-By: Alexey <[email protected]>

* style(autofix.ci): automated formatting

* Update turret.cpp

* style(autofix.ci): automated formatting

* smolfix

* Update ranged.cpp

* no more double messages

* style(autofix.ci): automated formatting

* smolfix

* You refuse to use this ranged weapon.

* Update handle_action.cpp

* Update handle_action.cpp

* Update handle_action.cpp

* Update handle_action.cpp

* Update handle_action.cpp

* style(autofix.ci): automated formatting

* Update handle_action.cpp

* Update handle_action.cpp

---------

Co-authored-by: tornikeo <[email protected]>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Alexey <[email protected]>
Co-authored-by: Chaosvolt <[email protected]>
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` Code: Tooling Tooling that is not part of the main game but is part of the repo. Crafting / Construction / Recipes Includes: Uncrafting / Disassembling Items: Armor / Clothing Armor and clothing Items: Containers Things that hold other things [JSON] Changes (can be) made in JSON json-styled JSON lint passed, label assigned by github actions Melee Melee weapons, tactics, techniques, reach attack Mods: MMA Mythical Martial Arts mod Mods Issues related to mods or modding stale Closed for lack of activity, but still valid. Vehicles Vehicles, parts, mechanics & interactions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Wayfarer but for ranged weapons
10 participants