RimWorld

RimWorld

Not enough ratings
Brawler-Friendly
   
Award
Favorite
Favorited
Unfavorite
Mod, 1.6
File Size
Posted
49.250 KB
28 Jun @ 7:42am
1 Change Note ( view )

Subscribe to download
Brawler-Friendly

In 1 collection by Zaljerem
Zal's Original Mods
104 items
Description
This mod allows you to add a modExtension to a ranged weapon so brawlers can use it without penalty.

It's really made for modders who were using VEF's (entirely different) implementation that has been removed for 1.6, but it's certainly usable by anyone who wants to add a modExtension to a ThingDef. :)

Feel free to put the assembly directly into your mod rather than using this as a dependency.
MIT License

modExtension:
<modExtensions> <li Class="BrawlerFriendly.DefModExtension_BrawlerFriendly" /> </modExtensions>

Background and technical info:

Vanilla Expanded Framework had this functionality until 1.6. When, at Taranchuk's suggestion, I went to examine the code to hopefully get it working and back into the Framework, I realized that it is overly-convoluted and complex. I fell back to my standard mode: "What's the simplest possible thing that can work?" ... so I rolled my own:

- modExtension for the weapon ThingDef - for detection
- Harmony postfix to Alert_BrawlerHasRangedWeapon.GetReport - addresses the alert message
- Harmony prefix to ThingDef.IsRangedWeapon (getter) - addresses the right-click equip warning
- Harmony prefix to ThoughtWorker_IsCarryingRangedWeapon.CurrentStateInternal - addresses the bad thought

Source code included.
Github:
https://github.com/Zaljerem/BrawlerFriendly
2 Comments
Witch ~ 29 Jun @ 11:17am 
Hey thanks a lot. I have a lot of gun mods with meele attachements so thats nice
Kimo' 28 Jun @ 8:06am 
Thank you Zal, This will definitely be useful!