Skip to content

Commit

Permalink
typified creature.h and monster.h (#78565)
Browse files Browse the repository at this point in the history
* typified creature.h and monster.h

* Update src/monmove.cpp

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* Update src/monster.h

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
  • Loading branch information
PatrikLundell and github-actions[bot] authored Dec 17, 2024
1 parent 49d18ea commit c380147
Show file tree
Hide file tree
Showing 71 changed files with 587 additions and 563 deletions.
6 changes: 3 additions & 3 deletions src/activity_actor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1721,9 +1721,9 @@ void glide_activity_actor::do_turn( player_activity &act, Character &you )
moved_tiles = 0;
}
you.mod_moves( -you.get_speed() * 0.5 );
get_map().update_visibility_cache( you.pos_bub().z() );
get_map().update_visibility_cache( you.pos_bub().x() );
get_map().update_visibility_cache( you.pos_bub().y() );
get_map().update_visibility_cache( you.posz() );
get_map().update_visibility_cache( you.posx() );
get_map().update_visibility_cache( you.posy() );
if( you.is_avatar() ) {
g->update_map( you );
}
Expand Down
4 changes: 2 additions & 2 deletions src/activity_handlers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3032,7 +3032,7 @@ void activity_handlers::find_mount_do_turn( player_activity *act, Character *you
guy.revert_after_activity();
return;
}
if( rl_dist( guy.pos(), mon->pos() ) <= 1 ) {
if( rl_dist( guy.pos_bub(), mon->pos_bub() ) <= 1 ) {
if( mon->has_effect( effect_controlled ) ) {
mon->remove_effect( effect_controlled );
}
Expand Down Expand Up @@ -3835,7 +3835,7 @@ void activity_handlers::spellcasting_finish( player_activity *act, Character *yo
}

if( spell_being_cast.has_flag( spell_flag::VERBAL ) && !you->has_flag( json_flag_SILENT_SPELL ) ) {
sounds::sound( you->pos(), you->get_shout_volume() / 2, sounds::sound_t::speech,
sounds::sound( you->pos_bub(), you->get_shout_volume() / 2, sounds::sound_t::speech,
_( "cast a spell" ),
false );
}
Expand Down
4 changes: 2 additions & 2 deletions src/advanced_inv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -752,7 +752,7 @@ void advanced_inventory::recalc_pane( side p )

// If container is no longer adjacent or on the player's z-level, nullify it.
if( std::abs( offset.x() ) > 1 || std::abs( offset.y() ) > 1 ||
player_character.pos_bub().z() != pane.container.pos_bub().z() ) {
player_character.posz() != pane.container.pos_bub().z() ) {

pane.container = item_location::nowhere;
pane.container_base_loc = NUM_AIM_LOCATIONS;
Expand Down Expand Up @@ -2364,7 +2364,7 @@ void advanced_inventory::draw_minimap()
}

if( !invert_left || !invert_right ) {
player_character.draw( minimap, player_character.pos(), invert_left || invert_right );
player_character.draw( minimap, player_character.pos_bub(), invert_left || invert_right );
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/armor_layers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -938,7 +938,7 @@ void outfit::sort_armor( Character &guy )
}
} else {
// Player is sorting NPC's armor here
if( rl_dist( player_character.pos(), guy.pos() ) > 1 ) {
if( rl_dist( player_character.pos_bub(), guy.pos_bub() ) > 1 ) {
guy.add_msg_if_npc( m_bad, _( "%s is too far to sort armor." ), guy.get_name() );
return;
}
Expand Down
4 changes: 2 additions & 2 deletions src/avatar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1276,7 +1276,7 @@ void avatar::rebuild_aim_cache() const
}

// some basic angle inclusion math, but also everything with 15 is still seen
if( rl_dist( tripoint_bub_ms( smx, smy, pos_bub().z() ), pos_bub() ) < 15 ) {
if( rl_dist( tripoint_bub_ms( smx, smy, posz() ), pos_bub() ) < 15 ) {
aim_cache[smx][smy] = false;
} else if( lower_bound > upper_bound ) {
aim_cache[smx][smy] = !( current_angle >= lower_bound ||
Expand Down Expand Up @@ -1304,7 +1304,7 @@ void avatar::set_movement_mode( const move_mode_id &new_mode )
// crouching affects visibility
//TODO: Replace with dirtying vision_transparency_cache
get_map().set_transparency_cache_dirty( pos_bub() );
get_map().set_seen_cache_dirty( pos_bub().z() );
get_map().set_seen_cache_dirty( posz() );
recoil = MAX_RECOIL;
} else {
add_msg( new_mode->change_message( false, get_steed_type() ) );
Expand Down
2 changes: 1 addition & 1 deletion src/avatar_action.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -911,7 +911,7 @@ bool avatar_action::eat_here( avatar &you )
}
}
if( you.has_active_mutation( trait_GRAZER ) ) {
const ter_id &ter_underfoot = here.ter( you.pos() );
const ter_id &ter_underfoot = here.ter( you.pos_bub() );
if( ter_underfoot == ter_t_grass_golf || ter_underfoot == ter_t_grass ) {
add_msg( _( "This grass is too short to graze." ) );
return true;
Expand Down
2 changes: 1 addition & 1 deletion src/ballistics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -554,7 +554,7 @@ dealt_projectile_attack projectile_attack( const projectile &proj_arg,
z.add_effect( effect_bounced, 1_turns );
projectile_attack( proj, tp, z.pos_bub(), dispersion, origin, in_veh );
sfx::play_variant_sound( "fire_gun", "bio_lightning_tail",
sfx::get_heard_volume( z.pos() ), sfx::get_heard_angle( z.pos() ) );
sfx::get_heard_volume( z.pos_bub() ), sfx::get_heard_angle( z.pos() ) );
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/bionics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -897,7 +897,7 @@ bool Character::activate_bionic( bionic &bio, bool eff_only, bool *close_bionics
} else if( bio.id == bio_resonator ) {
add_msg_activate();
//~Sound of a bionic sonic-resonator shaking the area
sounds::sound( pos(), 30, sounds::sound_t::combat, _( "VRRRRMP!" ), false, "bionic",
sounds::sound( pos_bub(), 30, sounds::sound_t::combat, _( "VRRRRMP!" ), false, "bionic",
static_cast<std::string>( bio_resonator ) );
for( const tripoint_bub_ms &bashpoint : here.points_in_radius( pos_bub(), 1 ) ) {
here.bash( bashpoint, 110 );
Expand Down
4 changes: 2 additions & 2 deletions src/cata_tiles.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4195,7 +4195,7 @@ bool cata_tiles::draw_critter_above( const tripoint &p, lit_level ll, int &heigh
// Search for a creature above
while( pcritter == nullptr && scan_p.z() <= OVERMAP_HEIGHT &&
!here.dont_draw_lower_floor( scan_p ) &&
scan_p.z() - you.pos_bub().z() <= fov_3d_z_range ) {
scan_p.z() - you.posz() <= fov_3d_z_range ) {
pcritter = get_creature_tracker().creature_at( scan_p, true );
scan_p.z()++;
}
Expand All @@ -4208,7 +4208,7 @@ bool cata_tiles::draw_critter_above( const tripoint &p, lit_level ll, int &heigh

// Draw shadow
if( draw_from_id_string( "shadow", TILE_CATEGORY::NONE, empty_string, p,
0, 0, ll, false, height_3d ) && scan_p.z() - 1 > you.pos_bub().z() && you.sees( critter ) ) {
0, 0, ll, false, height_3d ) && scan_p.z() - 1 > you.posz() && you.sees( critter ) ) {

bool is_player = false;
bool sees_player = false;
Expand Down
Loading

0 comments on commit c380147

Please sign in to comment.