Skip to content

Commit

Permalink
New transparent plastics, material adjustments (CleverRaven#67147)
Browse files Browse the repository at this point in the history
* New transparent plastics, material adjustments.

* Update iteminfo test in accordance with changes

* Update coverage test in accordance with new changes

* Fix stuff

* Fix
  • Loading branch information
randomtyper authored Aug 6, 2023
1 parent c6f8dc3 commit 9e021bf
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 9 deletions.
29 changes: 24 additions & 5 deletions data/json/materials.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"dmg_adj": [ "scratched", "cut", "cracked", "shattered" ],
"bash_dmg_verb": "dented",
"cut_dmg_verb": "gouged",
"resist": { "bash": 4, "cut": 6, "acid": 10, "heat": 6, "bullet": 6 }
"resist": { "bash": 4, "cut": 5, "acid": 10, "heat": 6, "bullet": 3 }
},
{
"type": "material",
Expand Down Expand Up @@ -885,7 +885,7 @@
{ "fuel": 0, "smoke": 0, "burn": 1000, "volume_per_turn": "5000 ml", "//": "More like shattering than melting" }
],
"burn_products": [ [ "glass_shard", 0.5 ] ],
"resist": { "bash": 3, "cut": 4, "acid": 10, "heat": 3, "bullet": 3 },
"resist": { "bash": 3, "cut": 4, "acid": 10, "heat": 3, "bullet": 1 },
"repair_difficulty": 7
},
{
Expand All @@ -907,7 +907,7 @@
{ "fuel": 0, "smoke": 0, "burn": 1000, "volume_per_turn": "5000 ml", "//": "More like shattering than melting" }
],
"burn_products": [ [ "glass_shard", 0.5 ] ],
"resist": { "bash": 3, "cut": 4, "acid": 10, "heat": 3, "bullet": 3 }
"resist": { "bash": 3, "cut": 4, "acid": 10, "heat": 3, "bullet": 1 }
},
{
"type": "material",
Expand Down Expand Up @@ -1509,6 +1509,7 @@
"id": "plastic",
"name": "Plastic",
"//": "Most common plastics are around 1",
"//2": "This one represents various non-resistant household plastics, found in your pen, keyboard, charger etc.",
"density": 1.0,
"specific_heat_liquid": 1.6,
"specific_heat_solid": 1.6,
Expand All @@ -1526,9 +1527,27 @@
{ "fuel": 0.4, "smoke": 3, "burn": 0.003 },
{ "fuel": 1, "smoke": 5, "burn": 0.008 }
],
"resist": { "bash": 2, "cut": 2, "acid": 9, "heat": 1, "bullet": 2 },
"resist": { "bash": 2, "cut": 2, "acid": 9, "heat": 1, "bullet": 1 },
"repair_difficulty": 3
},
{
"type": "material",
"id": "hard_plastic_transp",
"copy-from": "plastic",
"name": "Transparent Impact Resistant Plastic",
"//2": "This one represents various transparent impact-resistant plastics, like polycarbonate. Prime material for visors and safety goggles.",
"resist": { "bash": 4, "cut": 3, "acid": 9, "heat": 1, "bullet": 1.5 },
"repair_difficulty": 4
},
{
"type": "material",
"id": "composite_transp",
"copy-from": "plastic",
"name": "Transparent Bullet Resistant Composite",
"//2": "This one represents specialised transparent bulletproof composites, mostly employed on military vehicles and in high-value construction (banks).",
"resist": { "bash": 5, "cut": 4, "acid": 9, "heat": 1, "bullet": 2 },
"repair_difficulty": 5
},
{
"type": "material",
"id": "plastic_pad",
Expand All @@ -1548,7 +1567,7 @@
{ "fuel": 0.4, "smoke": 3, "burn": 0.003 },
{ "fuel": 1, "smoke": 5, "burn": 0.008 }
],
"resist": { "bash": 0.75, "cut": 0.5, "acid": 9, "heat": 1, "bullet": 0.5 },
"resist": { "bash": 1, "cut": 0.5, "acid": 9, "heat": 1, "bullet": 0.5 },
"repair_difficulty": 5
},
{
Expand Down
2 changes: 1 addition & 1 deletion tests/coverage_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ TEST_CASE( "Ranged_coverage_vs_bullet", "[coverage] [ranged]" )
{
SECTION( "Full melee and ranged coverage vs. ranged attack" ) {
const float dmg = get_avg_bullet_dmg( "test_hazmat_suit" );
check_near( "Average damage", dmg, 13.6f, 0.2f );
check_near( "Average damage", dmg, 15.4f, 0.2f );
}

SECTION( "No ranged coverage vs. ranged attack" ) {
Expand Down
6 changes: 3 additions & 3 deletions tests/iteminfo_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1279,11 +1279,11 @@ TEST_CASE( "armor_protection", "[iteminfo][armor][protection]" )

SECTION( "moderate protection from physical and environmental damage" ) {
// Hazmat suit, material:plastic, thickness:2
// 2/2/2 bash/cut/bullet x 2 thickness
// 2/2/1 bash/cut/bullet x 2 thickness
// 9/1/20 acid/fire/env
item hazmat( "test_hazmat_suit" );
REQUIRE( hazmat.get_covered_body_parts().any() );
expected_armor_values( hazmat, 4, 4, 3.2, 4, 9, 1, 20 );
expected_armor_values( hazmat, 4, 4, 3.2, 2, 9, 1, 20 );

// Protection info displayed on two lines
CHECK( item_info_str( hazmat, protection ) ==
Expand All @@ -1294,7 +1294,7 @@ TEST_CASE( "armor_protection", "[iteminfo][armor][protection]" )
"<color_c_white>Protection</color>:\n"
" Bash: <color_c_yellow>4.00</color>\n"
" Cut: <color_c_yellow>4.00</color>\n"
" Ballistic: <color_c_yellow>4.00</color>\n"
" Ballistic: <color_c_yellow>2.00</color>\n"
" Pierce: <color_c_yellow>3.20</color>\n"
" Acid: <color_c_yellow>9.00</color>\n"
" Fire: <color_c_yellow>1.00</color>\n"
Expand Down

0 comments on commit 9e021bf

Please sign in to comment.