Skip to content

Comments

Allow rifle slot to be single-handed#70

Open
Y3sMan wants to merge 3 commits intothemrdemonized:all-in-one-vs2022-wpofrom
Y3sMan:all-in-one-single-handed-wpns-fix
Open

Allow rifle slot to be single-handed#70
Y3sMan wants to merge 3 commits intothemrdemonized:all-in-one-vs2022-wpofrom
Y3sMan:all-in-one-single-handed-wpns-fix

Conversation

@Y3sMan
Copy link

@Y3sMan Y3sMan commented Sep 13, 2024

No description provided.

@Y3sMan Y3sMan closed this Sep 13, 2024
@Y3sMan
Copy link
Author

Y3sMan commented Sep 13, 2024

Simple change to allow the rifle weapon slot (slot 2) to also allow single_handed-ness. Additionally, add a check after the weapon type casting.

@Y3sMan Y3sMan reopened this Sep 13, 2024
@themrdemonized
Copy link
Owner

Hi, what's the purpose of this change. Is it to make possible to use detectors with rifles?

@Y3sMan
Copy link
Author

Y3sMan commented Sep 14, 2024

Hi, what's the purpose of this change. Is it to make possible to use detectors with rifles?

Sorry about that, yes it is. Now the weapon does not need to be in the pistol slot, it can simply be in the main rifle slot and still allow the detector to be pulled out.

@themrdemonized
Copy link
Owner

Please make it so it can be toggleable via console, with disabled as default

@Y3sMan
Copy link
Author

Y3sMan commented Sep 14, 2024

"toggleable via console"
Each weapon still needs to have the line single_handed = 1 under their ltx config, the feature is disabled by default. That's what the IsSingleHanded() check is for.
Or do you want something else to be toggeable?

@themrdemonized
Copy link
Owner

alright, i thought it just enables it for any weapon in the rifle slot

@themrdemonized
Copy link
Owner

themrdemonized commented Sep 14, 2024

aren't iitm.IsSingleHanded() is commented in your code?, it comes after //
Also i think a bolt item in configs has single_handed=0, might break that. Can you test it?

@Y3sMan
Copy link
Author

Y3sMan commented Sep 14, 2024

The bolt does break it, I'll fix that. But the check happens at W->IsSinglehanded(), after casting to the Weapon type.

@Y3sMan
Copy link
Author

Y3sMan commented Sep 14, 2024

Alright, I added a dltx config setting single_handed = 1 on the bolt.

@themrdemonized
Copy link
Owner

I'll check it out later, thanks

@SevenChalices

This comment was marked as off-topic.

@Y3sMan
Copy link
Author

Y3sMan commented May 4, 2025

Looking back, I very obviously did not explain this PR very well, that's my bad. I'll reply here then addendum my PR.
The short of it is Anomaly will not allow you to define weapons solely as "single_handed;" weapons can only be single-handedly if they are slot = 2 weapons or they are in lower slot.
So, this means, if I want to build a mod that, say, allows the detector to be pulled out with every weapon, I'd allow every weapon to be single_handed, but in the main branch as is this means every gun would also the fit into the pistol/knife slot as well! Not good. The PR would allow slot = 3 rifles, shotguns, other general "not-small-guns" to be single_handed without letting players now have 4 sniper rifles equipped at all times.
Hope this helps :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants