Skip to content

Commit 235c7a9

Browse files
committed
Remove bad explosive addittions
1 parent 489b317 commit 235c7a9

File tree

2 files changed

+0
-68
lines changed

2 files changed

+0
-68
lines changed

data/json/recipes/weapon/explosive.json

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
],
2121
"qualities": [ { "id": "CHEM", "level": 2 } ],
2222
"tools": [ [ [ "surface_heat", 25, "LIST" ] ] ],
23-
"flags": [ "EXPLOSIVE" ],
2423
"components": [
2524
[ [ "paper", 5 ], [ "rolling_paper", 32 ] ],
2625
[ [ "chem_sulphuric_acid", 2 ] ],
@@ -65,7 +64,6 @@
6564
"autolearn": true,
6665
"proficiencies": [ { "proficiency": "prof_handloading" } ],
6766
"qualities": [ { "id": "CUT", "level": 2 } ],
68-
"flags": [ "EXPLOSIVE" ],
6967
"components": [
7068
[ [ "thread", 10 ] ],
7169
[ [ "paper", 1 ], [ "rolling_paper", 6 ] ],
@@ -80,7 +78,6 @@
8078
"subcategory": "CSC_WEAPON_EXPLOSIVE",
8179
"skill_used": "fabrication",
8280
"time": "3 m",
83-
"flags": [ "EXPLOSIVE" ],
8481
"reversible": true,
8582
"autolearn": true,
8683
"qualities": [ { "id": "CUT", "level": 2 } ],
@@ -180,7 +177,6 @@
180177
"time": "12 m",
181178
"reversible": true,
182179
"autolearn": true,
183-
"flags": [ "EXPLOSIVE" ],
184180
"proficiencies": [ { "proficiency": "prof_handloading" } ],
185181
"qualities": [ { "id": "SAW_M", "level": 1 }, { "id": "GLARE", "level": 1 } ],
186182
"tools": [
@@ -216,7 +212,6 @@
216212
[ "adv_chemistry", 3 ],
217213
[ "textbook_anarch", 3 ]
218214
],
219-
"flags": [ "EXPLOSIVE" ],
220215
"proficiencies": [ { "proficiency": "prof_intro_chemistry" }, { "proficiency": "prof_inorganic_chemistry" } ],
221216
"time": "7 m 30 s",
222217
"qualities": [ { "id": "SCREW", "level": 1 } ],
@@ -241,7 +236,6 @@
241236
"book_learn": [ [ "textbook_gaswarfare", 2 ], [ "textbook_chemistry", 3 ], [ "adv_chemistry", 3 ], [ "textbook_anarch", 3 ] ],
242237
"proficiencies": [ { "proficiency": "prof_intro_chemistry" }, { "proficiency": "prof_inorganic_chemistry" } ],
243238
"time": "7 m 30 s",
244-
"flags": [ "EXPLOSIVE" ],
245239
"qualities": [ { "id": "SCREW", "level": 1 } ],
246240
"using": [ [ "small_gas_canister_case", 1 ] ],
247241
"components": [
@@ -286,7 +280,6 @@
286280
"proficiencies": [ { "proficiency": "prof_handloading" } ],
287281
"qualities": [ { "id": "SAW_M", "level": 1 } ],
288282
"using": [ [ "military_explosive", 92 ], [ "explosives_casting_standard", 1 ] ],
289-
"flags": [ "EXPLOSIVE" ],
290283
"components": [
291284
[ [ "delay_fuze", 1 ] ],
292285
[ [ "glue_strong", 4 ], [ "duct_tape", 10 ], [ "cordage", 1, "LIST" ] ],
@@ -308,7 +301,6 @@
308301
"book_learn": [ [ "manual_launcher", 4 ], [ "textbook_anarch", 5 ] ],
309302
"proficiencies": [ { "proficiency": "prof_handloading" } ],
310303
"using": [ [ "military_explosive", 92 ], [ "explosives_casting_standard", 1 ] ],
311-
"flags": [ "EXPLOSIVE" ],
312304
"qualities": [ { "id": "SAW_M", "level": 1 } ],
313305
"components": [ [ [ "pipe", 1 ] ], [ [ "delay_fuze", 1 ] ] ]
314306
},
@@ -326,7 +318,6 @@
326318
"proficiencies": [ { "proficiency": "prof_handloading" } ],
327319
"using": [ [ "military_explosive", 697 ], [ "explosives_casting_standard", 1 ] ],
328320
"qualities": [ { "id": "SAW_M", "level": 1 } ],
329-
"flags": [ "EXPLOSIVE" ],
330321
"components": [
331322
[ [ "delay_fuze", 1 ] ],
332323
[ [ "glue_strong", 4 ], [ "duct_tape", 10 ], [ "cordage", 1, "LIST" ] ],
@@ -347,7 +338,6 @@
347338
"book_learn": [ [ "manual_launcher", 7 ], [ "textbook_anarch", 8 ] ],
348339
"proficiencies": [ { "proficiency": "prof_handloading" } ],
349340
"using": [ [ "explosives_casting_standard", 5 ], [ "military_explosive", 10000 ] ],
350-
"flags": [ "EXPLOSIVE" ],
351341
"components": [
352342
[ [ "delay_fuze", 1 ] ],
353343
[ [ "glue_strong", 4 ], [ "duct_tape", 10 ], [ "cordage", 1, "LIST" ] ],
@@ -367,7 +357,6 @@
367357
"book_learn": [ [ "manual_launcher", 7 ], [ "textbook_anarch", 8 ] ],
368358
"proficiencies": [ { "proficiency": "prof_handloading" } ],
369359
"using": [ [ "explosives_casting_standard", 10 ], [ "military_explosive", 20000 ] ],
370-
"flags": [ "EXPLOSIVE" ],
371360
"components": [
372361
[ [ "delay_fuze", 1 ] ],
373362
[ [ "glue_strong", 4 ], [ "duct_tape", 10 ], [ "cordage", 1, "LIST" ] ],
@@ -429,7 +418,6 @@
429418
"autolearn": true,
430419
"proficiencies": [ { "proficiency": "prof_handloading" } ],
431420
"qualities": [ { "id": "SAW_M", "level": 1 } ],
432-
"flags": [ "EXPLOSIVE" ],
433421
"using": [ [ "stable_explosive", 29 ], [ "volatile_explosive", 1 ] ],
434422
"components": [ [ [ "pipe", 1 ] ], [ [ "fuse", 1 ] ] ]
435423
},
@@ -459,7 +447,6 @@
459447
"allowing it on smaller explosives, but not on the largest like ",
460448
"the barrel bombs."
461449
],
462-
"flags": [ "EXPLOSIVE" ],
463450
"components": [ [ [ "pipe", 1 ] ], [ [ "fuse", 1 ] ] ]
464451
},
465452
{
@@ -477,7 +464,6 @@
477464
"proficiencies": [ { "proficiency": "prof_handloading" } ],
478465
"using": [ [ "stable_explosive", 226 ], [ "volatile_explosive", 6 ] ],
479466
"qualities": [ { "id": "SAW_M", "level": 1 } ],
480-
"flags": [ "EXPLOSIVE" ],
481467
"components": [
482468
[ [ "fuse", 1 ] ],
483469
[ [ "glue_strong", 4 ], [ "duct_tape", 10 ], [ "cordage", 1, "LIST" ] ],
@@ -499,7 +485,6 @@
499485
"book_learn": [ [ "manual_launcher", 4 ], [ "textbook_anarch", 5 ] ],
500486
"proficiencies": [ { "proficiency": "prof_handloading" } ],
501487
"using": [ [ "stable_explosive", 253 ], [ "volatile_explosive", 6 ] ],
502-
"flags": [ "EXPLOSIVE" ],
503488
"qualities": [ { "id": "SAW_M", "level": 1 } ],
504489
"components": [ [ [ "fuse", 1 ] ], [ [ "glue_strong", 4 ], [ "duct_tape", 10 ], [ "cordage", 1, "LIST" ] ], [ [ "jug_plastic", 1 ] ] ]
505490
},
@@ -513,7 +498,6 @@
513498
"difficulty": 3,
514499
"time": "30 m",
515500
"reversible": true,
516-
"flags": [ "EXPLOSIVE" ],
517501
"book_learn": [ [ "manual_launcher", 7 ], [ "textbook_anarch", 8 ] ],
518502
"proficiencies": [ { "proficiency": "prof_handloading" } ],
519503
"using": [ [ "volatile_explosive", 86 ], [ "stable_explosive", 3354 ] ],
@@ -531,7 +515,6 @@
531515
"reversible": true,
532516
"book_learn": [ [ "manual_launcher", 7 ], [ "textbook_anarch", 8 ] ],
533517
"proficiencies": [ { "proficiency": "prof_handloading" } ],
534-
"flags": [ "EXPLOSIVE" ],
535518
"using": [ [ "volatile_explosive", 173 ], [ "stable_explosive", 6747 ] ],
536519
"components": [ [ [ "fuse", 1 ] ], [ [ "glue_strong", 4 ], [ "duct_tape", 10 ], [ "cordage", 1, "LIST" ] ], [ [ "30gal_drum", 1 ] ] ]
537520
}

src/crafting.cpp

Lines changed: 0 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@
3434
#include "effect_on_condition.h"
3535
#include "enum_traits.h"
3636
#include "enums.h"
37-
#include "explosion.h"
3837
#include "faction.h"
3938
#include "flag.h"
4039
#include "game.h"
@@ -120,7 +119,6 @@ static const trait_id trait_INT_ALPHA( "INT_ALPHA" );
120119
static const std::string flag_AFFECTED_BY_PAIN( "AFFECTED_BY_PAIN" );
121120
static const std::string flag_BLIND_EASY( "BLIND_EASY" );
122121
static const std::string flag_BLIND_HARD( "BLIND_HARD" );
123-
static const std::string flag_EXPLOSIVE( "EXPLOSIVE" );
124122
static const std::string flag_FULL_MAGAZINE( "FULL_MAGAZINE" );
125123
static const std::string flag_NO_BENCH( "NO_BENCH" );
126124
static const std::string flag_NO_ENCHANTMENT( "NO_ENCHANTMENT" );
@@ -1363,55 +1361,6 @@ static void destroy_random_component( item &craft, const Character &crafter )
13631361
crafter.add_msg_player_or_npc( game_message_params( game_message_type::m_bad ),
13641362
_( "You mess up and destroy the %s." ),
13651363
_( "<npcname> messes up and destroys the %s" ), destroyed.tname() );
1366-
1367-
// Explosive failure chance reduced by proficiency ratio
1368-
if( craft.has_flag( flag_EXPLOSIVE ) ) {
1369-
const recipe &rec = craft.get_making();
1370-
const std::vector<recipe_proficiency> &profs = rec.proficiencies;
1371-
int num_required = 0;
1372-
int num_known = 0;
1373-
1374-
for( const recipe_proficiency &prof : profs ) {
1375-
if( prof.required ) {
1376-
num_required++;
1377-
if( crafter.has_proficiency( prof.id ) ) {
1378-
num_known++;
1379-
}
1380-
}
1381-
}
1382-
double reduction = ( num_required > 0 ) ? ( static_cast<double>( num_known ) / num_required ) : 0.0;
1383-
const double base_explosion_chance = 0.4; // 40%
1384-
double explosion_chance = base_explosion_chance * ( 1.0 - reduction );
1385-
1386-
int missing = num_required - num_known;
1387-
if( missing <= 0 ) {
1388-
missing = 1;
1389-
}
1390-
1391-
int batch_size = craft.get_making_batch_size();
1392-
if( batch_size <= 0 ) {
1393-
batch_size = 1;
1394-
}
1395-
1396-
if( x_in_y( explosion_chance * 100, 100 ) ) {
1397-
const int weight_grams = units::to_gram(craft.weight());
1398-
const int explosion_power = 2 * weight_grams * missing * batch_size;
1399-
const double casing_mass = static_cast<double>(weight_grams * missing * batch_size);
1400-
const double fragment_mass = 0.1;
1401-
1402-
explosion_data exp;
1403-
exp.power = explosion_power;
1404-
exp.shrapnel = cata::make_value<explosion_shrapnel_data>();
1405-
exp.shrapnel->casing_mass = casing_mass;
1406-
exp.shrapnel->fragment_mass = fragment_mass;
1407-
1408-
crafter.add_msg_player_or_npc( m_bad,
1409-
_( "The explosive craft explodes violently!" ),
1410-
_( "The explosive craft explodes violently near <npcname>!" )
1411-
);
1412-
explosion( crafter.pos(), exp );
1413-
}
1414-
}
14151364
}
14161365

14171366
bool item::handle_craft_failure( Character &crafter )

0 commit comments

Comments
 (0)