Skip to content

Commit

Permalink
fd_sleepines in tests
Browse files Browse the repository at this point in the history
I really thought I got these already gr.
  • Loading branch information
I-am-Erk committed Apr 3, 2024
1 parent 15a65ee commit 2e5421d
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions tests/magic_spell_effect_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ TEST_CASE( "line_attack", "[magic]" )
}
}

TEST_CASE( "remove_field_fd_sleepiness", "[magic]" )
TEST_CASE( "remove_field_fd_reality_tear", "[magic]" )
{
// Test relies on lighting conditions, so ensure we control the level of
// daylight.
Expand All @@ -93,15 +93,15 @@ TEST_CASE( "remove_field_fd_sleepiness", "[magic]" )
CAPTURE( with_light );
CHECK( dummy.get_location() == player_initial_pos );

// create fd_sleepiness of each intensity near player
// create fd_reality_tear of each intensity near player
tripoint_abs_ms p1 = player_initial_pos + tripoint_east * 10;
tripoint_abs_ms p2 = player_initial_pos + tripoint_east * 11;
tripoint_abs_ms p3 = player_initial_pos + tripoint_east * 12;
tripoint_abs_ms p4 = player_initial_pos + tripoint_east * 13;
m.add_field( m.getlocal( p1 ), fd_sleepiness, 1, 1_hours );
m.add_field( m.getlocal( p2 ), fd_sleepiness, 2, 1_hours );
m.add_field( m.getlocal( p3 ), fd_sleepiness, 3, 1_hours );
m.add_field( m.getlocal( p4 ), fd_sleepiness, 3, 1_hours );
m.add_field( m.getlocal( p1 ), fd_reality_tear, 1, 1_hours );
m.add_field( m.getlocal( p2 ), fd_reality_tear, 2, 1_hours );
m.add_field( m.getlocal( p3 ), fd_reality_tear, 3, 1_hours );
m.add_field( m.getlocal( p4 ), fd_reality_tear, 3, 1_hours );

if( with_light ) {
player_add_headlamp();
Expand All @@ -114,7 +114,7 @@ TEST_CASE( "remove_field_fd_sleepiness", "[magic]" )
dummy.recalc_sight_limits();

CHECK( m.getglobal( dummy.pos() ) == player_initial_pos );
CHECK( count_fields_near( p1, fd_sleepiness ) == std::set<tripoint_abs_ms> { p1, p2, p3, p4 } );
CHECK( count_fields_near( p1, fd_reality_tear ) == std::set<tripoint_abs_ms> { p1, p2, p3, p4 } );

spell_effect::remove_field( sp, dummy, m.getlocal( player_initial_pos ) );
calendar::turn += 1_turns;
Expand All @@ -123,7 +123,7 @@ TEST_CASE( "remove_field_fd_sleepiness", "[magic]" )
m.process_fields();

CHECK( m.getglobal( dummy.pos() ) == player_initial_pos );
CHECK( count_fields_near( p1, fd_sleepiness ) == std::set<tripoint_abs_ms> { p2, p3, p4 } );
CHECK( count_fields_near( p1, fd_reality_tear ) == std::set<tripoint_abs_ms> { p2, p3, p4 } );

spell_effect::remove_field( sp, dummy, m.getlocal( player_initial_pos ) );
calendar::turn += 1_turns;
Expand All @@ -132,15 +132,15 @@ TEST_CASE( "remove_field_fd_sleepiness", "[magic]" )
m.process_fields();

CHECK( m.getglobal( dummy.pos() ) == player_initial_pos );
CHECK( count_fields_near( p1, fd_sleepiness ) == std::set<tripoint_abs_ms> { p3, p4 } );
CHECK( count_fields_near( p1, fd_reality_tear ) == std::set<tripoint_abs_ms> { p3, p4 } );

spell_effect::remove_field( sp, dummy, m.getlocal( player_initial_pos ) );
calendar::turn += 1_turns;
m.process_fields();
calendar::turn += 1_turns;
m.process_fields();

CHECK( count_fields_near( p1, fd_sleepiness ) == std::set<tripoint_abs_ms> { p4 } );
CHECK( count_fields_near( p1, fd_reality_tear ) == std::set<tripoint_abs_ms> { p4 } );
};

setup_and_remove_fields( true );
Expand Down

0 comments on commit 2e5421d

Please sign in to comment.