[A17] Animal Armour Mod v1.1 (19/07/2017)

Started by XeoNovaDan, July 17, 2017, 08:04:03 PM

Previous topic - Next topic

XeoNovaDan



Overview
As the title very much states, this mod adds armour for animals to RimWorld!

Disclaimers: the armour works through Hediffs, and it has to be installed via surgery since that's the only XML-friendly way of actually making this mod happen - but there is an absence of the requirement for medicine, and the surgery success chance multiplier is 'Infinity', meaning that it's impossible to fail installing armour on an animal. Similarly, animals will still be anaesthetised since that's hardcoded in the surgery code, and I'm not a C# wizard so I can't write custom stuff. Also, the installation of animal armour will completely reset the animal's health for the rest of the body; this is most likely to do with the fact that the body is the main body part, so every sub-part gets reset. Since I've not got the skills yet to rectify some of the outstanding issues, consider this project deprecated.

Animal Armour adds three 'tiers' of animal armour to the game: makeshift, standard, and heavy. Similarly, these armour types are all split into five size categories: tiny, small, medium, large, and huge.

The only means of obtaining standard and heavy animal armour of any size is through trade, but makeshift armour however may be crafted. The further up the sizes you go, the more expensive the items are to purchase - or manufacture in the case of makeshift armour. All size categories are functionally identical, however, other than the animals that they be installed on. Furthermore, what size category an animal fits into depends on its body size as an adult since again, I'm no C# wizard.

Naturally, the ability to be able to handle animals plays a role as to the maximum size category that you can install armour on to; it won't take much to armour up on a small critter, but it'll take quite a lot more skill to armour up a lumbering beast. Fine craftsmanship is also necessary to make small animal armour, but also to make large animal armour that won't simply fall apart.

To remove armour from an animal, you need to make an 'animal armour remover' at a crafting spot - this being because the hediff remover class is hardcoded to require medicine. Armour can also be removed by installing another type of armour.

Armour Types
Makeshift: 20% sharp protection, 8% blunt protection, -5% movement.
Standard: 27.5% sharp protection, 11% blunt protection, no movement penalty.
Heavy: 60% sharp protection, 20% blunt protection, -20% movement.

Size Category Info
Tiny: fits on animals with a mature body size of less than 0.3. Examples: cats, iguanas, and squirrels.
Small: fits on animals with a mature body size of 0.3 or greater, but less than 0.8. Examples: tortoises, monkeys, and foxes.
Medium: fits on animals with a mature body size of 0.8 or greater, but less than 1.3. Examples: wolves, huskies, and boars.
Large: fits on animals with a mature body size of 1.3 or greater, up to 2.4. Examples: muffalo, boomalopes, and bears.
Huge: fits on animals with a mature body size of greater than 2.4. Animals: Rhinoceroses, Elephants, Megatheria, and Thrumbos.

I'd much appreciate some feedback on the market value balance too, since I'm currently a little uncertain about how everything's balanced in regards to that. It was a bit of a headache producing a formula which got sensible results for market values at various size points, and I even ended up slightly deriving from what the formula provided.

Compatibility
This mod will work fine with spoonshortage's A Dog Said. While this mod will also work with Combat Extended; it's not balanced around Combat Extended's changes to the armour system and protection values of certain armour types.

Animal mods currently made compatible with Animal Armour:
Dinosauria by spincrus
Megafauna by Spino

As for compatibility with other animal mods, I'm not going to be taking responsibility for making patches; it'll be up to other animal mods' authors to make a patch for their mods with this.

Credits
Marnador for the RimWorld style font
Canute and rambo for the ideas around armour removal

Downloads
GitHub
Steam

License
You may include this mod in any mod pack, and you may derive from this mod too. I only ask that you inform me, and that you also provide a link to this forum post, with my name.

Thank you :)

XeoNovaDan


RazorHed

Cool I was thinking about doing something similar a while back , and the surgery was the only way I could see it working. Didn't get it working though . Well done.

moonra


XeoNovaDan

Yeah, it did involve a bit of XML sorcery to hack this one together. I'm curious to see if this will end up as the base of something executed in a more elegant way.

Soupy Delicious


Katarumi

Strangely, I can't seem to find this mod via the Steam search functions; I could only see it via direct link or going directly to your workshop. Is that intentional?

This looks amazingly useful, by the way! Can't wait to try it out on my wargs.

XeoNovaDan

@Katarumi
Yeah, it has to be 'Armour' in the search query; not 'Armor'. It's hard being British in a community that's mostly not British to my knowledge :P

rambo

cool mod but still needs some work (like remove armor and stuff)

XeoNovaDan

#9
@rambo
Yes, that would be nice if armour really was removable. However, I don't believe it's possible to remove hediffs from the main body since you'd technically be removing the body itself... However, now that you mention it and I've just thought on it a little, it may be possible to actually do something... but then the pawn would probably die since you're technically removing the torso.

I can't write custom stuff as my programming knowledge in C# is basically null and void, so that's off the table unless somebody else was to do so.

Edit: Hmm, it doesn't look like it will be possible with just XML. I've looked at the def for the 'Excise Carcinoma' recipe, it looks like it only removes the hediff, so I don't think it will actually give any items back.


Canute

about remove armor.
Why not create a no armor armor, no material, low work ?

XeoNovaDan

@Canute
I could do that. It'll be an extremely hacky way of doing so, but it's worth a shot. I'm currently working on something else, but I'll come back to this soon.

Katarumi

Quote from: XeoNovaDan on July 18, 2017, 07:16:12 AM
@Katarumi
Yeah, it has to be 'Armour' in the search query; not 'Armor'. It's hard being British in a community that's mostly not British to my knowledge :P

Whoops! I can't read, apparently, haha. Sorry for the confusion!

rambo

the armour surgery thing doesnt work for my huskies and i tried every type of "Armour"