Skip to content

Commit

Permalink
tests/eoc: use standard NPC
Browse files Browse the repository at this point in the history
  • Loading branch information
andrei8l committed Nov 18, 2024
1 parent 22d45f7 commit 789a3e1
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions tests/eoc_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1457,18 +1457,14 @@ TEST_CASE( "EOC_run_eocs", "[eoc]" )
clear_avatar();
clear_map();
clear_npcs();
shared_ptr_fast<npc> guy = make_shared_fast<npc>();
guy->normalize();
overmap_buffer.insert_npc( guy );
guy->spawn_at_precise( u.get_location() + tripoint_east );
g->load_npcs();
npc &guy = spawn_npc( u.pos_bub().xy() + point_east, "thug" );
tripoint_abs_ms mon_loc = u.get_location() + tripoint_west;
monster *zombie = g->place_critter_at( mon_zombie, get_map().bub_from_abs( mon_loc ) );
REQUIRE( zombie != nullptr );

item hammer( "hammer" );
item_location hammer_loc( map_cursor{ guy->get_location() }, &hammer );
dialogue d2( get_talker_for( *guy ), get_talker_for( hammer_loc ) );
item_location hammer_loc( map_cursor{ guy.get_location() }, &hammer );
dialogue d2( get_talker_for( guy ), get_talker_for( hammer_loc ) );
talker *alpha_talker = d2.actor( false );
talker *beta_talker = d2.actor( true );

Expand All @@ -1485,10 +1481,10 @@ TEST_CASE( "EOC_run_eocs", "[eoc]" )
CHECK( globvars.get_global_value( "beta_name" ) == alpha_talker->get_name() );

d2.set_value( "alpha_var", "avatar" );
d2.set_value( "beta_var", std::to_string( guy->getID().get_value() ) );
d2.set_value( "beta_var", std::to_string( guy.getID().get_value() ) );
CHECK( effect_on_condition_run_eocs_talker_mixes->activate( d2 ) );
CHECK( globvars.get_global_value( "alpha_name" ) == get_avatar().get_name() );
CHECK( globvars.get_global_value( "beta_name" ) == guy->get_name() );
CHECK( globvars.get_global_value( "beta_name" ) == guy.get_name() );

d2.set_value( "alpha_var", std::string{} );
d2.set_value( "beta_var", std::string{} );
Expand Down

0 comments on commit 789a3e1

Please sign in to comment.