RimWorld

RimWorld

Not enough ratings
iflyBayonet
   
Award
Favorite
Favorited
Unfavorite
Mod, 1.3, 1.4, 1.5
File Size
Posted
Updated
14.062 MB
14 Aug, 2021 @ 7:47pm
25 Oct, 2024 @ 6:28pm
13 Change Notes ( view )

Subscribe to download
iflyBayonet

Description
v0.5.2. This is a public beta. It is probably not bug free. Please report any bugs at https://github.com/ifly6/iflyBayonet.

Adds a belt-equippable bayonet which attaches to bayonet-compatible weapons automatically without needing to create a whole new gun. Those bayonets can then be used in melee combat (if also equipping a compatible bayonet-luggable ranged weapon). Bayonets cannot be used alone; an invisible force holds them to the belt.

For the technically minded, the mod specifically changes the bayonet-compatible weapon's "poke" melee attacks. It leaves other weapon types, like bashing with a stock, in, replacing any time a bayonet-compatible weapon pokes with a bayonet stab.

This mod also patches the average melee damage calculation and battle log to report use of the bayonet. It also creates an alert if a pawn equips a bayonet belt without also having a compatible weapon. If your pawns are equipping the belt willy-nilly and you don't like this, change your Apparel rules in Assign.

Bayonets are created at the smithing table and have most of their statistics taken from a combination of knives and spears. The cost is a bit more expensive than a knife (the model of the bayonet is that of a 1907 SMLE bayonet with quillion) and the damage is a bit less than a spear, being a bit more clunky.

This is most probably incompatible with Combat Extended, though I have never checked it myself.
9 Comments
kifly6  [author] 14 Dec, 2022 @ 5:26pm 
Addendum. One easter egg I did include is that you can mount a bayonet on a revolver: https://collections.royalarmouries.org/first-world-war/type/rac-narrative-138.html .
kifly6  [author] 14 Dec, 2022 @ 5:23pm 
I'm not sure why I marked sniper rifles are un-mountable (the exclusion is actually explicit in the code https://github.com/ifly6/iflyBayonet/blob/master/Source/Utilities.cs#L90) . Ex post, I guess it could have been because I felt that snipers should inherently not be getting into melee combat (Soviet snipers during WW2, apparently, excepted).
Nox 13 Dec, 2022 @ 9:17pm 
Lovely mod, love it. Out of curiosity, why are sniper rifles not mountable? Are you going with things that you would expect had lugs already?
kifly6  [author] 1 Mar, 2022 @ 11:23am 
@Camalie Sorry for the late response!

But yea, there's a weapon tag set up to identify which guns are bayonet compatible. In the code, it identifies whether a tag is compatible, or in the sarcastic way I wrote the code itself, "__IsNotCrapWeapon(ThingDef weapon)", on number of conditions.

If the weapon has weaponTags == null, then no. If the weapon does not use projectiles, then no. If the weapon has any tags IndustrialGunAdvanced, SpacerGun, or BayonetGun, then yes. Actually, the BayonetGun tag is marked "tag for other modders? idk if it works", which I will update.

If the weapon defName is empty (which I don't remember why it's there), then yes. Then there are a few weapons which are hard-coded to be compatible: Gun_BoltActionRifle, Gun_PumpShotgun, and Gun_Revolver (next to a comment "pritchard bayonet reacts only"). If no condition is met, then it returns false.
Camalie 10 Feb, 2022 @ 8:47pm 
nevermind, I found out after some experimenting. For those who were curious, use your xml editor to open the file the gun is in and find the <weaponTags> section for the gun of your choice, then you add <li>BayonetGun</li> there. So for my example, I just placed it beneath <li>NeolithicRangedChief</li> for the musket for Vanilla Weapons Expanded
Camalie 10 Feb, 2022 @ 8:31pm 
So to answer PremierVader, this mod does affect modded weapons, it seems to affect all of the industrial level guns added by Vanilla Weapons Expanded.

With that said, I'm running into an issue and I'm curious about the author being able to help me with it. I'm currently trying to get this mod compatible with the musket added by that some mod and I think I sort of understand why it's not working. It's because it's tagged as a medieval ranged weapon instead of industrial or spacer. The thing is, I don't know how to patch it to make the musket count as a valid weapon. Could you offer some insight on that?
kifly6  [author] 27 Aug, 2021 @ 4:23pm 
I have no idea, I haven't used those. It should if the charge weapon is tagged properly
PremierVader 22 Aug, 2021 @ 2:05pm 
Nice would be nice to know everyones experience with this mod. Does it also affect mod weapons like the Charge Lee Enfield mod?
random roadblock 16 Aug, 2021 @ 3:50pm 
cool