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

feat(balance): allow pulping zombify_into corpses #4228

Merged
merged 3 commits into from
Feb 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/activity_handlers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1926,7 +1926,8 @@ void activity_handlers::pulp_do_turn( player_activity *act, player *p )
map_stack corpse_pile = here.i_at( pos );
for( item *&corpse : corpse_pile ) {
const mtype *corpse_mtype = corpse->get_mtype();
if( !corpse->is_corpse() || !corpse_mtype->has_flag( MF_REVIVES ) ||
if( !corpse->is_corpse() || ( !corpse_mtype->has_flag( MF_REVIVES ) &&
!corpse_mtype->zombify_into ) ||
( std::find( act->str_values.begin(), act->str_values.end(), "auto_pulp_no_acid" ) !=
act->str_values.end() && corpse_mtype->bloodType().obj().has_acid ) ) {
// Don't smash non-rezing corpses //don't smash acid zombies when auto pulping
Expand Down
9 changes: 6 additions & 3 deletions src/cata_tiles.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
#include "debug.h"
#include "field.h"
#include "field_type.h"
#include "flag.h"
#include "fstream_utils.h"
#include "game.h"
#include "game_constants.h"
Expand Down Expand Up @@ -3180,9 +3181,11 @@ bool cata_tiles::draw_zombie_revival_indicators( const tripoint &pos, const lit_
if( tileset_ptr->find_tile_type( ZOMBIE_REVIVAL_INDICATOR ) && !invisible[0] &&
item_override.find( pos ) == item_override.end() && here.could_see_items( pos, g->u ) ) {
for( auto &i : here.i_at( pos ) ) {
if( i->can_revive() ) {
return draw_from_id_string( ZOMBIE_REVIVAL_INDICATOR, C_NONE, empty_string, pos, 0, 0,
lit_level::LIT, false, z_drop );
if( i->is_corpse() ) {
if( i->can_revive() || ( i->get_mtype()->zombify_into && !i->has_flag( flag_PULPED ) ) ) {
return draw_from_id_string( ZOMBIE_REVIVAL_INDICATOR, C_NONE, empty_string, pos, 0, 0,
lit_level::LIT, false, z_drop );
}
}
}
}
Expand Down
3 changes: 2 additions & 1 deletion src/handle_action.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -756,7 +756,8 @@ static void smash()

bool should_pulp = false;
for( const item * const &it : here.i_at( smashp ) ) {
if( it->is_corpse() && it->damage() < it->max_damage() && it->can_revive() ) {
if( it->is_corpse() && it->damage() < it->max_damage() && ( it->can_revive() ||
it->get_mtype()->zombify_into ) ) {
if( it->get_mtype()->bloodType()->has_acid ) {
if( query_yn( _( "Are you sure you want to pulp an acid filled corpse?" ) ) ) {
should_pulp = true;
Expand Down
4 changes: 2 additions & 2 deletions src/item.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4104,7 +4104,7 @@ nc_color item::color_in_inventory( const player &p ) const
} else if( active && !is_food() && !is_food_container() && !is_corpse() ) {
// Active items show up as yellow
ret = c_yellow;
} else if( is_corpse() && can_revive() ) {
} else if( is_corpse() && ( can_revive() || corpse->zombify_into ) && !has_flag( flag_PULPED ) ) {
// Only reviving corpses are yellow
ret = c_yellow;
} else if( const item *food = get_food() ) {
Expand Down Expand Up @@ -9146,7 +9146,7 @@ detached_ptr<item> item::process_corpse( detached_ptr<item> &&self, player *carr
if( self->corpse == nullptr || self->damage() >= self->max_damage() ) {
return std::move( self );
}
if( self->corpse->zombify_into && self->rotten() ) {
if( self->corpse->zombify_into && self->rotten() && !self->has_flag( flag_PULPED ) ) {
self->rot -= self->get_shelf_life();
self->corpse = &*self->corpse->zombify_into;
return std::move( self );
Expand Down
3 changes: 2 additions & 1 deletion src/map.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3093,7 +3093,8 @@ void map::smash_items( const tripoint &p, const int power, const std::string &ca
if( will_explode_on_impact( power ) && it->will_explode_in_fire() ) {
return item::detonate( std::move( it ), p, contents );
}
if( ( power < min_destroy_threshold || !do_destroy ) && !it->can_revive() ) {
if( ( power < min_destroy_threshold || !do_destroy ) && !it->can_revive() &&
!it->get_mtype()->zombify_into ) {
return std::move( it );
}
bool is_active_explosive = it->active && it->type->get_use( "explosion" ) != nullptr;
Expand Down
Loading