Compare commits

...

18 Commits

Author SHA1 Message Date
Maleclypse 328eb165b6 Fix 2025-10-19 18:57:58 -05:00
Maleclypse d4f3e649a5 Update data/mods/Xedra_Evolved/xe_graveyard.json
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-10-19 18:57:58 -05:00
Maleclypse 694730a0c5 Vampire Death Screen 2025-10-19 18:57:57 -05:00
Maleclypse c8b2a22a6e Update data/mods/Xedra_Evolved/xe_end_screen.json
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-10-19 18:57:57 -05:00
Maleclypse 6c22167934 Update data/mods/Xedra_Evolved/xe_end_screen.json
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-10-19 18:57:57 -05:00
Maleclypse d496287033 Boann Quest Ending Screen 2025-10-19 18:57:57 -05:00
Maleclypse 94f7f3c56e Merge branch 'master' of https://github.com/CleverRaven/Cataclysm-DDA 2025-10-19 18:57:37 -05:00
Maleclypse a4dd5e88bb Merge branch 'master' of https://github.com/CleverRaven/Cataclysm-DDA 2025-10-19 01:15:41 -05:00
Maleclypse 46c095aff0 Merge branch 'master' of https://github.com/CleverRaven/Cataclysm-DDA 2025-09-02 22:41:14 -05:00
Maleclypse 80c50be988 Merge branch 'master' of https://github.com/CleverRaven/Cataclysm-DDA 2025-07-19 16:49:37 -05:00
Maleclypse 1d8df852bf Update crafting.cpp 2025-06-07 15:36:07 -05:00
Maleclypse d21c70380a Quick and dirty craft failure explosions
code changes
2025-06-07 14:37:39 -05:00
Maleclypse 89eeb5988d Merge branch 'master' of https://github.com/CleverRaven/Cataclysm-DDA 2025-05-15 20:22:13 -05:00
Maleclypse fae339bf54 Merge branch 'master' of https://github.com/CleverRaven/Cataclysm-DDA 2025-03-20 21:39:53 -05:00
Maleclypse d581f04737 Merge branch 'master' of https://github.com/CleverRaven/Cataclysm-DDA 2025-02-05 17:23:52 -06:00
Maleclypse 6aebb2015f Merge branch 'master' of https://github.com/CleverRaven/Cataclysm-DDA 2025-02-01 02:11:42 -06:00
Maleclypse 3caee0fa1b Merge branch 'master' of https://github.com/Maleclypse/Cataclysm-DDA 2025-01-17 19:50:41 -06:00
Maleclypse fcc0290236 Update monster_drops.json 2025-01-15 00:32:06 -06:00
5 changed files with 134 additions and 0 deletions
+17
View File
@@ -20,6 +20,7 @@
],
"qualities": [ { "id": "CHEM", "level": 2 } ],
"tools": [ [ [ "surface_heat", 25, "LIST" ] ] ],
"flags": [ "EXPLOSIVE" ],
"components": [
[ [ "paper", 5 ], [ "rolling_paper", 32 ] ],
[ [ "chem_sulphuric_acid", 2 ] ],
@@ -64,6 +65,7 @@
"autolearn": true,
"proficiencies": [ { "proficiency": "prof_handloading" } ],
"qualities": [ { "id": "CUT", "level": 2 } ],
"flags": [ "EXPLOSIVE" ],
"components": [
[ [ "thread", 10 ] ],
[ [ "paper", 1 ], [ "rolling_paper", 6 ] ],
@@ -78,6 +80,7 @@
"subcategory": "CSC_WEAPON_EXPLOSIVE",
"skill_used": "fabrication",
"time": "3 m",
"flags": [ "EXPLOSIVE" ],
"reversible": true,
"autolearn": true,
"qualities": [ { "id": "CUT", "level": 2 } ],
@@ -177,6 +180,7 @@
"time": "12 m",
"reversible": true,
"autolearn": true,
"flags": [ "EXPLOSIVE" ],
"proficiencies": [ { "proficiency": "prof_handloading" } ],
"qualities": [ { "id": "SAW_M", "level": 1 }, { "id": "GLARE", "level": 1 } ],
"tools": [
@@ -212,6 +216,7 @@
[ "adv_chemistry", 3 ],
[ "textbook_anarch", 3 ]
],
"flags": [ "EXPLOSIVE" ],
"proficiencies": [ { "proficiency": "prof_intro_chemistry" }, { "proficiency": "prof_inorganic_chemistry" } ],
"time": "7 m 30 s",
"qualities": [ { "id": "SCREW", "level": 1 } ],
@@ -236,6 +241,7 @@
"book_learn": [ [ "textbook_gaswarfare", 2 ], [ "textbook_chemistry", 3 ], [ "adv_chemistry", 3 ], [ "textbook_anarch", 3 ] ],
"proficiencies": [ { "proficiency": "prof_intro_chemistry" }, { "proficiency": "prof_inorganic_chemistry" } ],
"time": "7 m 30 s",
"flags": [ "EXPLOSIVE" ],
"qualities": [ { "id": "SCREW", "level": 1 } ],
"using": [ [ "small_gas_canister_case", 1 ] ],
"components": [
@@ -280,6 +286,7 @@
"proficiencies": [ { "proficiency": "prof_handloading" } ],
"qualities": [ { "id": "SAW_M", "level": 1 } ],
"using": [ [ "military_explosive", 92 ], [ "explosives_casting_standard", 1 ] ],
"flags": [ "EXPLOSIVE" ],
"components": [
[ [ "delay_fuze", 1 ] ],
[ [ "glue_strong", 4 ], [ "duct_tape", 10 ], [ "cordage", 1, "LIST" ] ],
@@ -301,6 +308,7 @@
"book_learn": [ [ "manual_launcher", 4 ], [ "textbook_anarch", 5 ] ],
"proficiencies": [ { "proficiency": "prof_handloading" } ],
"using": [ [ "military_explosive", 92 ], [ "explosives_casting_standard", 1 ] ],
"flags": [ "EXPLOSIVE" ],
"qualities": [ { "id": "SAW_M", "level": 1 } ],
"components": [ [ [ "pipe", 1 ] ], [ [ "delay_fuze", 1 ] ] ]
},
@@ -318,6 +326,7 @@
"proficiencies": [ { "proficiency": "prof_handloading" } ],
"using": [ [ "military_explosive", 697 ], [ "explosives_casting_standard", 1 ] ],
"qualities": [ { "id": "SAW_M", "level": 1 } ],
"flags": [ "EXPLOSIVE" ],
"components": [
[ [ "delay_fuze", 1 ] ],
[ [ "glue_strong", 4 ], [ "duct_tape", 10 ], [ "cordage", 1, "LIST" ] ],
@@ -338,6 +347,7 @@
"book_learn": [ [ "manual_launcher", 7 ], [ "textbook_anarch", 8 ] ],
"proficiencies": [ { "proficiency": "prof_handloading" } ],
"using": [ [ "explosives_casting_standard", 5 ], [ "military_explosive", 10000 ] ],
"flags": [ "EXPLOSIVE" ],
"components": [
[ [ "delay_fuze", 1 ] ],
[ [ "glue_strong", 4 ], [ "duct_tape", 10 ], [ "cordage", 1, "LIST" ] ],
@@ -357,6 +367,7 @@
"book_learn": [ [ "manual_launcher", 7 ], [ "textbook_anarch", 8 ] ],
"proficiencies": [ { "proficiency": "prof_handloading" } ],
"using": [ [ "explosives_casting_standard", 10 ], [ "military_explosive", 20000 ] ],
"flags": [ "EXPLOSIVE" ],
"components": [
[ [ "delay_fuze", 1 ] ],
[ [ "glue_strong", 4 ], [ "duct_tape", 10 ], [ "cordage", 1, "LIST" ] ],
@@ -418,6 +429,7 @@
"autolearn": true,
"proficiencies": [ { "proficiency": "prof_handloading" } ],
"qualities": [ { "id": "SAW_M", "level": 1 } ],
"flags": [ "EXPLOSIVE" ],
"using": [ [ "stable_explosive", 29 ], [ "volatile_explosive", 1 ] ],
"components": [ [ [ "pipe", 1 ] ], [ [ "fuse", 1 ] ] ]
},
@@ -447,6 +459,7 @@
"allowing it on smaller explosives, but not on the largest like ",
"the barrel bombs."
],
"flags": [ "EXPLOSIVE" ],
"components": [ [ [ "pipe", 1 ] ], [ [ "fuse", 1 ] ] ]
},
{
@@ -464,6 +477,7 @@
"proficiencies": [ { "proficiency": "prof_handloading" } ],
"using": [ [ "stable_explosive", 226 ], [ "volatile_explosive", 6 ] ],
"qualities": [ { "id": "SAW_M", "level": 1 } ],
"flags": [ "EXPLOSIVE" ],
"components": [
[ [ "fuse", 1 ] ],
[ [ "glue_strong", 4 ], [ "duct_tape", 10 ], [ "cordage", 1, "LIST" ] ],
@@ -485,6 +499,7 @@
"book_learn": [ [ "manual_launcher", 4 ], [ "textbook_anarch", 5 ] ],
"proficiencies": [ { "proficiency": "prof_handloading" } ],
"using": [ [ "stable_explosive", 253 ], [ "volatile_explosive", 6 ] ],
"flags": [ "EXPLOSIVE" ],
"qualities": [ { "id": "SAW_M", "level": 1 } ],
"components": [ [ [ "fuse", 1 ] ], [ [ "glue_strong", 4 ], [ "duct_tape", 10 ], [ "cordage", 1, "LIST" ] ], [ [ "jug_plastic", 1 ] ] ]
},
@@ -498,6 +513,7 @@
"difficulty": 3,
"time": "30 m",
"reversible": true,
"flags": [ "EXPLOSIVE" ],
"book_learn": [ [ "manual_launcher", 7 ], [ "textbook_anarch", 8 ] ],
"proficiencies": [ { "proficiency": "prof_handloading" } ],
"using": [ [ "volatile_explosive", 86 ], [ "stable_explosive", 3354 ] ],
@@ -515,6 +531,7 @@
"reversible": true,
"book_learn": [ [ "manual_launcher", 7 ], [ "textbook_anarch", 8 ] ],
"proficiencies": [ { "proficiency": "prof_handloading" } ],
"flags": [ "EXPLOSIVE" ],
"using": [ [ "volatile_explosive", 173 ], [ "stable_explosive", 6747 ] ],
"components": [ [ [ "fuse", 1 ] ], [ [ "glue_strong", 4 ], [ "duct_tape", 10 ], [ "cordage", 1, "LIST" ] ], [ [ "30gal_drum", 1 ] ] ]
}
@@ -4155,5 +4155,11 @@
"id": "effect_xe_werewolf_summon_shadow_pack_limiter",
"name": [ "Summoned the Shadow Pack" ],
"desc": [ "You called on the aid of ancestral werewolves and must wait before seeking their aid again." ]
},
{
"type": "effect_type",
"id": "march_baron",
"name": [ "March Baron" ],
"//": "Used to target a slightly different winning screen upon exiting the mortal realms as a Lord in Boann's court."
}
]
@@ -0,0 +1,30 @@
[
{
"type": "end_screen",
"id": "boann_court_win",
"priority": 200,
"picture_id": "ascii_portal_storm_win",
"condition": { "and": [ { "not": "u_is_alive" }, { "u_has_effect": "a_winner_is_u" }, { "u_has_effect": "march_baron" } ] },
"added_info": [
[ [ 6, 6 ], "You <color_light_green>escaped</color>" ],
[ [ 8, 7 ], "<u_name> has trod the path to Arcadia." ],
[ [ 4, 10 ], "...<u_name>, were they ever heard from again?" ],
[ [ 15, 11 ], "A story for another day." ],
[ [ 9, 15 ], "<color_blue>Stories</color> are all thats <color_orange>left</color>." ],
[ [ 4, 21 ], "Mortal striving lasted for: <time_survived>" ]
]
},
{
"type": "end_screen",
"id": "vampire_death",
"priority": 100,
"picture_id": "ascii_rip_vampire",
"condition": { "and": [ { "not": "u_is_alive" }, { "u_has_trait": "VAMPIRE" } ] },
"added_info": [
[ [ 25, 14 ], "The night is over for you: <color_light_red><u_name></color>" ],
[ [ 26, 15 ], "Survived: <time_survived>" ],
[ [ 27, 16 ], "Kills: <total_kills>" ]
],
"last_words_label": "Last Words:"
}
]
+30
View File
@@ -0,0 +1,30 @@
[
{
"type": "ascii_art",
"id": "ascii_rip_vampire",
"picture": [
"________ __ ",
"\\_____ \\ __ ___/ |_",
" / | \\| | \\ __\\",
"/ | \\ | /| | ",
"\\_______ /____/ |__| ",
" \/ ",
"________ ",
"\\______ \\ _____ _____ ____ ",
" | | \\\\__ \\ / \\ / \\ ",
" | ` \\/ __ \\| Y Y \\ | \\",
"/_______ (____ /__|_| /___| /",
" \\/ \\/ \\/ \\/ ",
" _________ __ ",
"/ _____/_____ _____/ |_ ",
"\\_____ \\\\____ \\ / _ \\ __\\|",
" / \\ |_> > <_> ) | ",
"/_______ / __/ \\____/|__| ",
" \\/|__| ",
" ",
" ",
" ",
" "
]
}
]
+51
View File
@@ -34,6 +34,7 @@
#include "effect_on_condition.h"
#include "enum_traits.h"
#include "enums.h"
#include "explosion.h"
#include "faction.h"
#include "flag.h"
#include "game.h"
@@ -119,6 +120,7 @@ static const trait_id trait_INT_ALPHA( "INT_ALPHA" );
static const std::string flag_AFFECTED_BY_PAIN( "AFFECTED_BY_PAIN" );
static const std::string flag_BLIND_EASY( "BLIND_EASY" );
static const std::string flag_BLIND_HARD( "BLIND_HARD" );
static const std::string flag_EXPLOSIVE( "EXPLOSIVE" );
static const std::string flag_FULL_MAGAZINE( "FULL_MAGAZINE" );
static const std::string flag_NO_BENCH( "NO_BENCH" );
static const std::string flag_NO_ENCHANTMENT( "NO_ENCHANTMENT" );
@@ -1361,6 +1363,55 @@ static void destroy_random_component( item &craft, const Character &crafter )
crafter.add_msg_player_or_npc( game_message_params( game_message_type::m_bad ),
_( "You mess up and destroy the %s." ),
_( "<npcname> messes up and destroys the %s" ), destroyed.tname() );
// Explosive failure chance reduced by proficiency ratio
if( craft.has_flag( flag_EXPLOSIVE ) ) {
const recipe &rec = craft.get_making();
const std::vector<recipe_proficiency> &profs = rec.proficiencies;
int num_required = 0;
int num_known = 0;
for( const recipe_proficiency &prof : profs ) {
if( prof.required ) {
num_required++;
if( crafter.has_proficiency( prof.id ) ) {
num_known++;
}
}
}
double reduction = ( num_required > 0 ) ? ( static_cast<double>( num_known ) / num_required ) : 0.0;
const double base_explosion_chance = 0.4; // 40%
double explosion_chance = base_explosion_chance * ( 1.0 - reduction );
int missing = num_required - num_known;
if( missing <= 0 ) {
missing = 1;
}
int batch_size = craft.get_making_batch_size();
if( batch_size <= 0 ) {
batch_size = 1;
}
if( x_in_y( explosion_chance * 100, 100 ) ) {
const int weight_grams = units::to_gram(craft.weight());
const int explosion_power = 2 * weight_grams * missing * batch_size;
const double casing_mass = static_cast<double>(weight_grams * missing * batch_size);
const double fragment_mass = 0.1;
explosion_data exp;
exp.power = explosion_power;
exp.shrapnel = cata::make_value<explosion_shrapnel_data>();
exp.shrapnel->casing_mass = casing_mass;
exp.shrapnel->fragment_mass = fragment_mass;
crafter.add_msg_player_or_npc( m_bad,
_( "The explosive craft explodes violently!" ),
_( "The explosive craft explodes violently near <npcname>!" )
);
explosion( crafter.pos(), exp );
}
}
}
bool item::handle_craft_failure( Character &crafter )