Skip to content

Commit

Permalink
Add Washing kit for squaddie-washing yourself
Browse files Browse the repository at this point in the history
Gives a morale bonus for ~5 hours for being clean.

Spawns in most places you'd find a shaving kit. Also a
survivor/makeshift variant with similar recipe to the shaving
kit but without the razor and a toothbrush.
  • Loading branch information
LambdaSix authored and Nicola Somerville committed May 6, 2020
1 parent e52a5a6 commit 8ee7ada
Show file tree
Hide file tree
Showing 19 changed files with 111 additions and 2 deletions.
5 changes: 5 additions & 0 deletions data/json/item_actions.json
Original file line number Diff line number Diff line change
Expand Up @@ -854,6 +854,11 @@
"id": "SHAVEKIT",
"name": { "str": "Shave" }
},
{
"type": "item_action",
"id": "WASHKIT",
"name": { "str": "Wash yourself" }
},
{
"type": "item_action",
"id": "SHOCKTONFA_OFF",
Expand Down
1 change: 1 addition & 0 deletions data/json/itemgroups/Clothing_Gear/gear_civilian.json
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,7 @@
[ "motorbike_pants", 10 ],
[ "motorbike_boots", 10 ],
[ "shavingkit", 30 ],
[ "washingkit", 30 ],
[ "elec_hairtrimmer", 15 ],
[ "razor_blade", 5 ],
[ "razor_shaving", 5 ],
Expand Down
1 change: 1 addition & 0 deletions data/json/itemgroups/Drugs_Tobacco_Alcohol/drugs.json
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@
[ "smoxygen_tank", 5 ],
[ "eyedrops", 35 ],
[ "shavingkit", 5 ],
[ "washingkit", 5 ],
[ "elec_hairtrimmer", 2 ],
[ "nic_gum", 25 ],
[ "weak_antibiotic", 30 ]
Expand Down
1 change: 1 addition & 0 deletions data/json/itemgroups/Locations_MapExtras/locations.json
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,7 @@
[ "fancy_sunglasses", 5 ],
[ "glasses_reading", 30 ],
[ "shavingkit", 20 ],
[ "washingkit", 20 ],
[ "elec_hairtrimmer", 10 ],
[ "glasses_bifocal", 30 ],
[ "tailor_portfolio", 3 ],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,7 @@
[ "soap", 45 ],
[ "tailors_kit", 25 ],
[ "shavingkit", 20 ],
[ "washingkit", 20 ],
[ "elec_hairtrimmer", 20 ],
[ "razor_shaving", 20 ],
[ "curler_hair", 30 ],
Expand Down
2 changes: 1 addition & 1 deletion data/json/itemgroups/SUS/domestic.json
Original file line number Diff line number Diff line change
Expand Up @@ -689,7 +689,7 @@
"entries": [
{ "item": "soap", "count": [ 1, 4 ], "prob": 70 },
{
"distribution": [ { "item": "razor_shaving", "count": [ 1, 2 ], "prob": 50 }, { "item": "shavingkit", "prob": 50 } ],
"distribution": [ { "item": "razor_shaving", "count": [ 1, 2 ], "prob": 50 }, { "item": "shavingkit", "prob": 50 }, { "item": "washingkit", "prob": 50 } ],
"prob": 75
},
{
Expand Down
40 changes: 40 additions & 0 deletions data/json/items/tool/toileteries.json
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,26 @@
"charges_per_use": 1,
"use_action": "SHAVEKIT"
},
{
"id": "washingkit",
"type": "TOOL",
"name": { "str": "toiletry bag" },
"looks_like": "shavingkit",
"description": "This is a compact and lightweight washing kit made for travelers. You can use it to freshen up if it's supplied with soap. It requires 1 unit of soap per use.",
"weight": "200 g",
"volume": "250 ml",
"price": 1000,
"price_postapoc": 250,
"to_hit": -1,
"material": "plastic",
"symbol": ";",
"color": "white",
"ammo": "soap",
"initial_charges": 5,
"max_charges": 10,
"charges_per_use": 1,
"use_action": "WASHKIT"
},
{
"id": "sponge",
"type": "TOOL",
Expand Down Expand Up @@ -166,6 +186,26 @@
"charges_per_use": 1,
"use_action": "SHAVEKIT"
},
{
"id": "survivor_washkit",
"type": "TOOL",
"name": { "str": "makeshift toiletry bag" },
"looks_like": "survivor_shavingkit",
"description": "This is a makeshift washing kit. You can use it to freshen up if it's supplied with soap. It requires 1 unit of soap per use.",
"weight": "540 g",
"volume": "750 ml",
"price": 1000,
"price_postapoc": 100,
"to_hit": -1,
"bashing": 1,
"material": [ "leather", "glass" ],
"symbol": ";",
"color": "brown",
"ammo": "soap",
"max_charges": 10,
"charges_per_use": 1,
"use_action": "WASHKIT"
},
{
"id": "washboard",
"type": "TOOL",
Expand Down
5 changes: 5 additions & 0 deletions data/json/morale_types.json
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,11 @@
"type": "morale_type",
"text": "Freshly Shaven"
},
{
"id": "morale_washself",
"type": "morale_type",
"text": "Freshly Washed"
},
{
"id": "morale_vomited",
"type": "morale_type",
Expand Down
1 change: 1 addition & 0 deletions data/json/npcs/items_generic.json
Original file line number Diff line number Diff line change
Expand Up @@ -1047,6 +1047,7 @@
[ "sword_bayonet", 1 ],
[ "syringe", 3 ],
[ "shavingkit", 3 ],
[ "washingkit", 3 ],
[ "survivor_shavingkit", 5 ],
[ "elec_hairtrimmer", 2 ],
[ "survivor_hairtrimmer", 3 ],
Expand Down
8 changes: 8 additions & 0 deletions data/json/player_activities.json
Original file line number Diff line number Diff line change
Expand Up @@ -711,6 +711,14 @@
"rooted": true,
"based_on": "speed"
},
{
"id": "ACT_WASHSELF",
"type": "activity_type",
"activity_level": "NO_EXERCISE",
"verb": "washing yourself",
"rooted": true,
"based_on": "speed"
},
{
"id": "ACT_HAIRCUT",
"type": "activity_type",
Expand Down
19 changes: 19 additions & 0 deletions data/json/recipes/recipe_others.json
Original file line number Diff line number Diff line change
Expand Up @@ -4092,6 +4092,25 @@
[ [ "plastic_chunk", 1 ], [ "skewer_bone", 4 ], [ "splinter", 4 ] ]
]
},
{
"type": "recipe",
"result": "survivor_washkit",
"category": "CC_OTHER",
"subcategory": "CSC_OTHER_TOOLS",
"skill_used": "fabrication",
"difficulty": 1,
"time": "1 m",
"reversible": true,
"autolearn": true,
"using": [ [ "cordage_short", 2 ] ],
"components": [
[ [ "leather", 2 ], [ "fur", 2 ] ],
[ [ "rag", 2 ] ],
[ [ "toothbrush_plain", 1 ] ],
[ [ "mirror", 1 ] ],
[ [ "plastic_chunk", 1 ], [ "skewer_bone", 4 ], [ "splinter", 4 ] ]
]
},
{
"type": "recipe",
"result": "survivor_hairtrimmer",
Expand Down
1 change: 1 addition & 0 deletions data/mods/more_classes_scenarios/cs_classes.json
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@
"roadmap",
"restaurantmap",
"shavingkit",
"washingkit",
"aluminum_foil",
"can_chowder",
"apple_cider",
Expand Down
9 changes: 9 additions & 0 deletions src/activity_handlers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@ static const activity_id ACT_WAIT_NPC( "ACT_WAIT_NPC" );
static const activity_id ACT_WAIT_STAMINA( "ACT_WAIT_STAMINA" );
static const activity_id ACT_WAIT_WEATHER( "ACT_WAIT_WEATHER" );
static const activity_id ACT_WASH( "ACT_WASH" );
static const activity_id ACT_WASHSELF( "ACT_WASHSELF" );
static const activity_id ACT_WEAR( "ACT_WEAR" );

static const efftype_id effect_blind( "blind" );
Expand Down Expand Up @@ -407,6 +408,7 @@ activity_handlers::finish_functions = {
{ ACT_FILL_PIT, fill_pit_finish },
{ ACT_PLAY_WITH_PET, play_with_pet_finish },
{ ACT_SHAVE, shaving_finish },
{ ACT_WASHSELF, washingself_finish },
{ ACT_HAIRCUT, haircut_finish },
{ ACT_UNLOAD_MAG, unload_mag_finish },
{ ACT_ROBOT_CONTROL, robot_control_finish },
Expand Down Expand Up @@ -4260,6 +4262,13 @@ void activity_handlers::haircut_finish( player_activity *act, player *p )
act->set_to_null();
}

void activity_handlers::washingself_finish( player_activity *act, player *p )
{
p->add_msg_if_player( _("You wash yourself and give your teeth a scrub." ) );
p->add_morale( MORALE_WASHSELF, 4, 4, 360_minutes, 5_minutes );
act->set_to_null();
}

void activity_handlers::unload_mag_finish( player_activity *act, player *p )
{
int qty = 0;
Expand Down
3 changes: 2 additions & 1 deletion src/activity_handlers.h
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,8 @@ void hand_crank_finish( player_activity *act, player *p );
void atm_finish( player_activity *act, player *p );
void aim_finish( player_activity *act, player *p );
void eat_menu_finish( player_activity *act, player *p );
void washing_finish( player_activity *act, player *p );
void washingself_finish( player_activity *act, player *p );
void washing_finish(player_activity *act, player* p);
void hacksaw_finish( player_activity *act, player *p );
void pry_nails_finish( player_activity *act, player *p );
void chop_tree_finish( player_activity *act, player *p );
Expand Down
1 change: 1 addition & 0 deletions src/item_factory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -878,6 +878,7 @@ void Item_factory::init()
add_iuse( "SEED", &iuse::seed );
add_iuse( "SEWAGE", &iuse::sewage );
add_iuse( "SHAVEKIT", &iuse::shavekit );
add_iuse( "WASHKIT", &iuse::washkit );
add_iuse( "SHOCKTONFA_OFF", &iuse::shocktonfa_off );
add_iuse( "SHOCKTONFA_ON", &iuse::shocktonfa_on );
add_iuse( "SIPHON", &iuse::siphon );
Expand Down
12 changes: 12 additions & 0 deletions src/iuse.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ static const activity_id ACT_ROBOT_CONTROL( "ACT_ROBOT_CONTROL" );
static const activity_id ACT_SHAVE( "ACT_SHAVE" );
static const activity_id ACT_VIBE( "ACT_VIBE" );
static const activity_id ACT_WASH( "ACT_WASH" );
static const activity_id ACT_WASHSELF( "ACT_WASHSELF" );

static const efftype_id effect_adrenaline( "adrenaline" );
static const efftype_id effect_antibiotic( "antibiotic" );
Expand Down Expand Up @@ -9276,6 +9277,17 @@ int iuse::hairkit( player *p, item *it, bool, const tripoint & )
return it->type->charges_to_use();
}

int iuse::washkit( player *p, item *it, bool, const tripoint & )
{
if( p->is_mounted() ) {
p->add_msg_if_player( m_info, _( "You cannot do that while mounted." ) );
return 0;
}
const int moves = to_moves<int>( 5_minutes );
p->assign_activity( ACT_WASHSELF, moves );
return it->type->charges_to_use();
}

int iuse::weather_tool( player *p, item *it, bool, const tripoint & )
{
const w_point weatherPoint = *g->weather.weather_precise;
Expand Down
1 change: 1 addition & 0 deletions src/iuse.h
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@ class iuse
int tow_attach( player *, item *, bool, const tripoint & );
int cable_attach( player *, item *, bool, const tripoint & );
int shavekit( player *, item *, bool, const tripoint & );
int washkit( player *, item *, bool, const tripoint & );
int hairkit( player *, item *, bool, const tripoint & );
int weather_tool( player *, item *, bool, const tripoint & );
int ladder( player *, item *, bool, const tripoint & );
Expand Down
1 change: 1 addition & 0 deletions src/morale_types.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@ const morale_type MORALE_PERM_NOMAD( "morale_perm_nomad" );
const morale_type MORALE_GAME_FOUND_KITTEN( "morale_game_found_kitten" );
const morale_type MORALE_HAIRCUT( "morale_haircut" );
const morale_type MORALE_SHAVE( "morale_shave" );
const morale_type MORALE_WASHSELF( "morale_washself" );
const morale_type MORALE_CHAT( "morale_chat" );
const morale_type MORALE_VOMITED( "morale_vomited" );
const morale_type MORALE_PLAY_WITH_PET( "morale_play_with_pet" );
Expand Down
1 change: 1 addition & 0 deletions src/morale_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ extern const morale_type MORALE_PERM_CONSTRAINED;
extern const morale_type MORALE_PERM_NOMAD;
extern const morale_type MORALE_GAME_FOUND_KITTEN;
extern const morale_type MORALE_HAIRCUT;
extern const morale_type MORALE_WASHSELF;
extern const morale_type MORALE_SHAVE;
extern const morale_type MORALE_CHAT;
extern const morale_type MORALE_VOMITED;
Expand Down

0 comments on commit 8ee7ada

Please sign in to comment.