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

monsters: allow pets to wear armor #28646

Merged
merged 5 commits into from Mar 18, 2019

Conversation

Projects
None yet
5 participants
@mlangsdorf
Copy link
Contributor

commented Mar 11, 2019

Summary

SUMMARY: Features "monsters: allow pets to wear armor"

Purpose of change

Fixes #28627
Allow pets to wear armor.

Describe the solution

Move pet_menu into monexamine.cpp and refactor it.

Create a new bodytype field for monsters that describes the general layout of the monster's body and assign suitable values for most mammals, zombies, fish, insects, and spiders.

Create a new islot_pet_armor which is similar to islot_armor but describes something that can be worn by a pet.

Add a new menu option that allows you to put armor on pets or remove armor from pets wearing armor.

In monster::get_armor_cut(), monster::get_armor_bash(), and monster::get_armor_type(), check for worn armor on the monster and add the armor's protection values.

Alternatives

I considered using item properties, but an islot is more robust.

Notes

zlaves have bodytype human, and should wear non-pet armor, but that's an issue to pursue at a later date.

Someone else should probably go through and add a bunch of recipes and items for various pet armors.

Show resolved Hide resolved src/monexamine.cpp Outdated
Show resolved Hide resolved src/monexamine.cpp Outdated
Show resolved Hide resolved src/monexamine.cpp Outdated
Show resolved Hide resolved src/monexamine.cpp Outdated
@Fris0uman

This comment has been minimized.

Copy link
Contributor

commented Mar 11, 2019

Is that a potential begining for monster wearing stuff instead of spawning them on death or not at all ?

@kevingranade

This comment has been minimized.

Copy link
Member

commented Mar 12, 2019

This pull request has been mentioned on Cataclysm: Dark Days Ahead. There might be relevant details there:

https://discourse.cataclysmdda.org/t/what-are-some-things-that-should-be-in-the-cataclysm/18792/103

@mlangsdorf mlangsdorf force-pushed the mlangsdorf:pet_armor branch from bddbd6b to 1e55c9d Mar 12, 2019

@mlangsdorf mlangsdorf changed the title [WIP] monsters: allow pets to wear armor monsters: allow pets to wear armor Mar 12, 2019

@mlangsdorf

This comment has been minimized.

Copy link
Contributor Author

commented Mar 12, 2019

At this time, this is really only intended for pets like tame dogs. As a general solution for monster armor, there are a lot of complications that this does not address.

@ZhilkinSerg ZhilkinSerg self-assigned this Mar 13, 2019

Show resolved Hide resolved doc/MONSTERS.md Outdated

mlangsdorf added some commits Mar 11, 2019

monexamine: move pet_menu out of game.cpp
A very basic refactoring of game.cpp and monexamine.cpp: move pet_meu
out of game.cpp in preparation for cleaning it up some.
monexamine: refactor pet_menu to add function calls, general cleanup
split the various pet_menu items off into their own functions,
remove redundant c_str() calls, and generally clean up the code.

harden milk_source for creatures with more than 1 starting ammo.
monsters: add bodytype classification
add a new parameter bodytype which roughly sorts monsters into bodytypes.
The immediate use will be for pet armors but it may have other uses in
the future.
items: add a new islot_pet_armor
Add the definition of islot_pet_armor and turn the kevlar dog harness
into an instance of pet_armor that can be worn by medium sized dogs.
monsters: allow pets to wear pet_armor
add options to the pet_menu to let pets wear armor that is suitable for
their body type and body volume.  Pet armor can add storage just like a
bag but is not removed when a bag is dumped.  Pet armor can also be
removed.  Pet armor provides 100% coverage protection according to its
material properties.

@mlangsdorf mlangsdorf force-pushed the mlangsdorf:pet_armor branch from 1e55c9d to 948f2f5 Mar 16, 2019

@ZhilkinSerg ZhilkinSerg merged commit 8041bab into CleverRaven:master Mar 18, 2019

3 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
gorgon-ghprb Build finished.
Details

@ZhilkinSerg ZhilkinSerg removed their assignment Mar 18, 2019

@mlangsdorf mlangsdorf deleted the mlangsdorf:pet_armor branch Mar 18, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.