From 158c380ba3c9644a0fa7b0daf169c4558d62a98c Mon Sep 17 00:00:00 2001 From: Kevin Granade Date: Sun, 19 Jan 2020 02:38:50 +0000 Subject: [PATCH] Add crossbow effective range tests and tweak them to pass. --- data/json/items/crossbows.json | 8 ++++---- data/mods/More_Survival_Tools/items.json | 2 +- tests/ranged_balance_test.cpp | 15 +++++++++++++++ 3 files changed, 20 insertions(+), 5 deletions(-) diff --git a/data/json/items/crossbows.json b/data/json/items/crossbows.json index 06ce4388ebe0f..0609110d9fe60 100644 --- a/data/json/items/crossbows.json +++ b/data/json/items/crossbows.json @@ -282,7 +282,7 @@ "bashing": 4, "ranged_damage": 7, "range": 6, - "dispersion": 180, + "dispersion": 375, "durability": 6, "clip_size": 1, "valid_mod_locations": [ @@ -317,7 +317,7 @@ "loudness": 10, "ranged_damage": 17, "range": 9, - "dispersion": 150, + "dispersion": 350, "durability": 6, "clip_size": 1, "reload": 500, @@ -354,7 +354,7 @@ "ranged_damage": 20, "range": 16, "loudness": 8, - "dispersion": 220, + "dispersion": 300, "durability": 6, "clip_size": 1, "reload": 600, @@ -391,7 +391,7 @@ "ranged_damage": 28, "range": 22, "loudness": 12, - "dispersion": 200, + "dispersion": 275, "durability": 6, "clip_size": 1, "reload": 300, diff --git a/data/mods/More_Survival_Tools/items.json b/data/mods/More_Survival_Tools/items.json index faabd7d538807..c061458334309 100644 --- a/data/mods/More_Survival_Tools/items.json +++ b/data/mods/More_Survival_Tools/items.json @@ -211,7 +211,7 @@ "skill": "rifle", "range": 6, "ranged_damage": 7, - "dispersion": 250, + "dispersion": 500, "durability": 6, "clip_size": 1, "reload": 300, diff --git a/tests/ranged_balance_test.cpp b/tests/ranged_balance_test.cpp index 9e3dc6adec4ee..b37de905c02ff 100644 --- a/tests/ranged_balance_test.cpp +++ b/tests/ranged_balance_test.cpp @@ -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 ); @@ -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 ); @@ -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 );