Skip to content

Commit

Permalink
Add crossbow effective range tests and tweak them to pass.
Browse files Browse the repository at this point in the history
  • Loading branch information
kevingranade committed Jan 19, 2020
1 parent bfc715d commit 158c380
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 5 deletions.
8 changes: 4 additions & 4 deletions data/json/items/crossbows.json
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@
"bashing": 4,
"ranged_damage": 7,
"range": 6,
"dispersion": 180,
"dispersion": 375,
"durability": 6,
"clip_size": 1,
"valid_mod_locations": [
Expand Down Expand Up @@ -317,7 +317,7 @@
"loudness": 10,
"ranged_damage": 17,
"range": 9,
"dispersion": 150,
"dispersion": 350,
"durability": 6,
"clip_size": 1,
"reload": 500,
Expand Down Expand Up @@ -354,7 +354,7 @@
"ranged_damage": 20,
"range": 16,
"loudness": 8,
"dispersion": 220,
"dispersion": 300,
"durability": 6,
"clip_size": 1,
"reload": 600,
Expand Down Expand Up @@ -391,7 +391,7 @@
"ranged_damage": 28,
"range": 22,
"loudness": 12,
"dispersion": 200,
"dispersion": 275,
"durability": 6,
"clip_size": 1,
"reload": 300,
Expand Down
2 changes: 1 addition & 1 deletion data/mods/More_Survival_Tools/items.json
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@
"skill": "rifle",
"range": 6,
"ranged_damage": 7,
"dispersion": 250,
"dispersion": 500,
"durability": 6,
"clip_size": 1,
"reload": 300,
Expand Down
15 changes: 15 additions & 0 deletions tests/ranged_balance_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,11 @@ TEST_CASE( "unskilled_shooter_accuracy", "[ranged] [balance]" )
test_shooting_scenario( shooter, 3, 3, 12 );
test_fast_shooting( shooter, 50, 0.2 );
}
SECTION( "an unskilled archer with an inaccurate crossbow" ) {
arm_shooter( shooter, "crossbow" );
test_shooting_scenario( shooter, 4, 6, 17 );
test_fast_shooting( shooter, 50, 0.2 );
}
SECTION( "an unskilled shooter with an inaccurate shotgun" ) {
arm_shooter( shooter, "winchester_1897" );
test_shooting_scenario( shooter, 4, 6, 17 );
Expand Down Expand Up @@ -297,6 +302,11 @@ TEST_CASE( "competent_shooter_accuracy", "[ranged] [balance]" )
test_shooting_scenario( shooter, 8, 10, 32 );
test_fast_shooting( shooter, 50, 0.4 );
}
SECTION( "a skilled archer with an accurate crossbow" ) {
arm_shooter( shooter, "compositecrossbow", { "tele_sight" } );
test_shooting_scenario( shooter, 9, 13, 33 );
test_fast_shooting( shooter, 50, 0.4 );
}
SECTION( "a skilled shooter with an accurate shotgun" ) {
arm_shooter( shooter, "ksg", { "red_dot_sight" } );
test_shooting_scenario( shooter, 9, 15, 33 );
Expand Down Expand Up @@ -331,6 +341,11 @@ TEST_CASE( "expert_shooter_accuracy", "[ranged] [balance]" )
test_shooting_scenario( shooter, 12, 20, 80 );
test_fast_shooting( shooter, 30, 0.6 );
}
SECTION( "an expert archer with an excellent crossbow" ) {
arm_shooter( shooter, "compcrossbow", { "holo_sight" } );
test_shooting_scenario( shooter, 12, 20, 100 );
test_fast_shooting( shooter, 50, 0.4 );
}
SECTION( "an expert shooter with an excellent shotgun" ) {
arm_shooter( shooter, "m1014", { "holo_sight" } );
test_shooting_scenario( shooter, 18, 24, 124 );
Expand Down

0 comments on commit 158c380

Please sign in to comment.