本文整理汇总了C++中npc::aim_per_move方法的典型用法代码示例。如果您正苦于以下问题:C++ npc::aim_per_move方法的具体用法?C++ npc::aim_per_move怎么用?C++ npc::aim_per_move使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类npc
的用法示例。
在下文中一共展示了npc::aim_per_move方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: test_fast_shooting
static void test_fast_shooting( npc &shooter, int moves, float hit_rate )
{
const int fast_shooting_range = 3;
const float hit_rate_cap = hit_rate + 0.3;
dispersion_sources dispersion = get_dispersion( shooter, moves );
std::array<statistics, 5> fast_stats = firing_test( dispersion, fast_shooting_range, {{ -1, hit_rate, -1, -1, -1 }} );
std::array<statistics, 5> fast_stats_upper = firing_test( dispersion, fast_shooting_range, {{ -1, hit_rate_cap, -1, -1, -1 }} );
INFO( dispersion );
INFO( "Range: " << fast_shooting_range );
INFO( "Max aim speed: " << shooter.aim_per_move( shooter.weapon, MAX_RECOIL ) );
INFO( "Min aim speed: " << shooter.aim_per_move( shooter.weapon, shooter.recoil ) );
CAPTURE( shooter.weapon.gun_skill().str() );
CAPTURE( shooter.get_skill_level( shooter.weapon.gun_skill() ) );
CAPTURE( shooter.get_dex() );
CAPTURE( to_milliliter( shooter.weapon.volume() ) );
CAPTURE( fast_stats[1].n() );
CAPTURE( fast_stats[1].adj_wald_error() );
CHECK( fast_stats[1].avg() > hit_rate );
CAPTURE( fast_stats_upper[1].n() );
CAPTURE( fast_stats_upper[1].adj_wald_error() );
CHECK( fast_stats_upper[1].avg() < hit_rate_cap );
}
示例2: test_shooting_scenario
static void test_shooting_scenario( npc &shooter, int min_quickdraw_range,
int min_good_range, int max_good_range )
{
{
dispersion_sources dispersion = get_dispersion( shooter, 0 );
std::array<statistics, 5> minimum_stats = firing_test( dispersion, min_quickdraw_range, {{ 0.2, 0.1, -1, -1, -1 }} );
INFO( dispersion );
INFO( "Range: " << min_quickdraw_range );
INFO( "Max aim speed: " << shooter.aim_per_move( shooter.weapon, MAX_RECOIL ) );
INFO( "Min aim speed: " << shooter.aim_per_move( shooter.weapon, shooter.recoil ) );
CAPTURE( minimum_stats[0].n() );
CAPTURE( minimum_stats[0].adj_wald_error() );
CAPTURE( minimum_stats[1].n() );
CAPTURE( minimum_stats[1].adj_wald_error() );
CHECK( minimum_stats[0].avg() < 0.2 );
CHECK( minimum_stats[1].avg() < 0.1 );
}
{
dispersion_sources dispersion = get_dispersion( shooter, 300 );
std::array<statistics, 5> good_stats = firing_test( dispersion, min_good_range, {{ -1, -1, 0.5, -1, -1 }} );
INFO( dispersion );
INFO( "Range: " << min_good_range );
INFO( "Max aim speed: " << shooter.aim_per_move( shooter.weapon, MAX_RECOIL ) );
INFO( "Min aim speed: " << shooter.aim_per_move( shooter.weapon, shooter.recoil ) );
CAPTURE( good_stats[2].n() );
CAPTURE( good_stats[2].adj_wald_error() );
CHECK( good_stats[2].avg() > 0.5 );
}
{
dispersion_sources dispersion = get_dispersion( shooter, 500 );
std::array<statistics, 5> good_stats = firing_test( dispersion, max_good_range, {{ -1, -1, 0.1, -1, -1 }} );
INFO( dispersion );
INFO( "Range: " << max_good_range );
INFO( "Max aim speed: " << shooter.aim_per_move( shooter.weapon, MAX_RECOIL ) );
INFO( "Min aim speed: " << shooter.aim_per_move( shooter.weapon, shooter.recoil ) );
CAPTURE( good_stats[2].n() );
CAPTURE( good_stats[2].adj_wald_error() );
CHECK( good_stats[2].avg() < 0.1 );
}
}