From 9d6235af98013eb1caeabc1ffc6cb8214c399171 Mon Sep 17 00:00:00 2001 From: Kestrellius <902X@comcast.net> Date: Fri, 2 Jan 2026 14:45:23 -0800 Subject: [PATCH 1/5] add toggle --- code/ship/ship.cpp | 59 ++++++++++++++++++++++++++-------------------- code/ship/ship.h | 1 + 2 files changed, 34 insertions(+), 26 deletions(-) diff --git a/code/ship/ship.cpp b/code/ship/ship.cpp index 1747a59eaea..664cd93df9b 100644 --- a/code/ship/ship.cpp +++ b/code/ship/ship.cpp @@ -1071,6 +1071,7 @@ void ship_info::clone(const ship_info& other) death_fx_count = other.death_fx_count; shockwave_count = other.shockwave_count; explosion_bitmap_anims = other.explosion_bitmap_anims; + disable_main_fireball = other.disable_main_fireball; skip_deathroll_chance = other.skip_deathroll_chance; impact_spew = other.impact_spew; @@ -1443,6 +1444,7 @@ void ship_info::move(ship_info&& other) death_fx_count = other.death_fx_count; shockwave_count = other.shockwave_count; std::swap(explosion_bitmap_anims, other.explosion_bitmap_anims); + disable_main_fireball = other.disable_main_fireball; skip_deathroll_chance = other.skip_deathroll_chance; std::swap(impact_spew, other.impact_spew); @@ -1812,6 +1814,7 @@ ship_info::ship_info() death_fx_count = 6; shockwave_count = 1; explosion_bitmap_anims.clear(); + disable_main_fireball = false; skip_deathroll_chance = 0.0f; // default values from shipfx.cpp @@ -3949,7 +3952,7 @@ static void parse_ship_values(ship_info* sip, const bool is_template, const bool { sip->regular_end_particles = parse_ship_legacy_particle_effect(LegacyShipParticleType::OTHER, sip, "normal death spew", 1.f, particle::Anim_bitmap_id_smoke2, 1.f); } - + if(optional_string("$Alternate Death Effect:")) { sip->knossos_end_particles = particle::util::parseEffect(sip->name); @@ -3958,7 +3961,11 @@ static void parse_ship_values(ship_info* sip, const bool is_template, const bool { sip->knossos_end_particles = parse_ship_legacy_particle_effect(LegacyShipParticleType::OTHER, sip, "knossos death spew", 50.f, particle::Anim_bitmap_id_smoke2, 1.f, true); } - + if (optional_string("$Disable Main Fireball:")) + { + stuff_boolean(&sip->disable_main_fireball); + } + if(optional_string("$Debris Flame Effect:")) { sip->debris_flame_particles = particle::util::parseEffect(sip->name); @@ -9785,30 +9792,30 @@ static void ship_dying_frame(object *objp, int ship_num) polymodel *pm = model_get(sip->model_num); shipp->end_death_time = timestamp((int) pm->core_radius); } else { - // else, just a single big fireball - float big_rad; - int fireball_objnum, fireball_type, default_fireball_type; - float explosion_life; - big_rad = objp->radius*1.75f; - - default_fireball_type = FIREBALL_EXPLOSION_LARGE1 + Random::next(FIREBALL_NUM_LARGE_EXPLOSIONS); - if (knossos_ship) { - big_rad = objp->radius * 1.2f; - default_fireball_type = FIREBALL_EXPLOSION_LARGE1; - } - //SUSHI: Option to override radius of big fireball - if (Ship_info[shipp->ship_info_index].big_exp_visual_rad >= 0) - big_rad = Ship_info[shipp->ship_info_index].big_exp_visual_rad; - - fireball_type = fireball_ship_explosion_type(sip); - if(fireball_type < 0) { - fireball_type = default_fireball_type; - } - fireball_objnum = fireball_create( &objp->pos, fireball_type, FIREBALL_LARGE_EXPLOSION, OBJ_INDEX(objp), big_rad, false, &objp->phys_info.vel ); - if ( fireball_objnum >= 0 ) { - explosion_life = fireball_lifeleft(&Objects[fireball_objnum]); - } else { - explosion_life = 0.0f; + float explosion_life = 0.0f; + if (!sip->disable_main_fireball) { + // else, just a single big fireball + float big_rad; + int fireball_objnum, fireball_type, default_fireball_type; + big_rad = objp->radius*1.75f; + + default_fireball_type = FIREBALL_EXPLOSION_LARGE1 + Random::next(FIREBALL_NUM_LARGE_EXPLOSIONS); + if (knossos_ship) { + big_rad = objp->radius * 1.2f; + default_fireball_type = FIREBALL_EXPLOSION_LARGE1; + } + //SUSHI: Option to override radius of big fireball + if (Ship_info[shipp->ship_info_index].big_exp_visual_rad >= 0) + big_rad = Ship_info[shipp->ship_info_index].big_exp_visual_rad; + + fireball_type = fireball_ship_explosion_type(sip); + if(fireball_type < 0) { + fireball_type = default_fireball_type; + } + fireball_objnum = fireball_create( &objp->pos, fireball_type, FIREBALL_LARGE_EXPLOSION, OBJ_INDEX(objp), big_rad, false, &objp->phys_info.vel ); + if ( fireball_objnum >= 0 ) { + explosion_life = fireball_lifeleft(&Objects[fireball_objnum]); + } } // JAS: I put in all this code because of an item on my todo list that diff --git a/code/ship/ship.h b/code/ship/ship.h index c4e616027ff..c11a996b3d3 100644 --- a/code/ship/ship.h +++ b/code/ship/ship.h @@ -1221,6 +1221,7 @@ class ship_info int death_fx_count; int shockwave_count; // the # of total shockwaves SCP_vector explosion_bitmap_anims; + bool disable_main_fireball; float skip_deathroll_chance; particle::ParticleEffectHandle impact_spew; From b1bf31278322e33b484abc7cd5cdea0f25613676 Mon Sep 17 00:00:00 2001 From: Kestrellius <902X@comcast.net> Date: Fri, 11 Sep 2026 00:49:26 -0700 Subject: [PATCH 2/5] minimize diff --- code/ship/ship.cpp | 46 +++++++++++++++++++++++----------------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/code/ship/ship.cpp b/code/ship/ship.cpp index 664cd93df9b..8c82c056df0 100644 --- a/code/ship/ship.cpp +++ b/code/ship/ship.cpp @@ -9791,31 +9791,31 @@ static void ship_dying_frame(object *objp, int ship_num) shipp->really_final_death_time = timestamp(0); polymodel *pm = model_get(sip->model_num); shipp->end_death_time = timestamp((int) pm->core_radius); + } else if (sip->disable_main_fireball) { + shipp->end_death_time = shipp->really_final_death_time = timestamp( 0 ); } else { float explosion_life = 0.0f; - if (!sip->disable_main_fireball) { - // else, just a single big fireball - float big_rad; - int fireball_objnum, fireball_type, default_fireball_type; - big_rad = objp->radius*1.75f; - - default_fireball_type = FIREBALL_EXPLOSION_LARGE1 + Random::next(FIREBALL_NUM_LARGE_EXPLOSIONS); - if (knossos_ship) { - big_rad = objp->radius * 1.2f; - default_fireball_type = FIREBALL_EXPLOSION_LARGE1; - } - //SUSHI: Option to override radius of big fireball - if (Ship_info[shipp->ship_info_index].big_exp_visual_rad >= 0) - big_rad = Ship_info[shipp->ship_info_index].big_exp_visual_rad; - - fireball_type = fireball_ship_explosion_type(sip); - if(fireball_type < 0) { - fireball_type = default_fireball_type; - } - fireball_objnum = fireball_create( &objp->pos, fireball_type, FIREBALL_LARGE_EXPLOSION, OBJ_INDEX(objp), big_rad, false, &objp->phys_info.vel ); - if ( fireball_objnum >= 0 ) { - explosion_life = fireball_lifeleft(&Objects[fireball_objnum]); - } + // else, just a single big fireball + float big_rad; + int fireball_objnum, fireball_type, default_fireball_type; + big_rad = objp->radius*1.75f; + + default_fireball_type = FIREBALL_EXPLOSION_LARGE1 + Random::next(FIREBALL_NUM_LARGE_EXPLOSIONS); + if (knossos_ship) { + big_rad = objp->radius * 1.2f; + default_fireball_type = FIREBALL_EXPLOSION_LARGE1; + } + //SUSHI: Option to override radius of big fireball + if (Ship_info[shipp->ship_info_index].big_exp_visual_rad >= 0) + big_rad = Ship_info[shipp->ship_info_index].big_exp_visual_rad; + + fireball_type = fireball_ship_explosion_type(sip); + if(fireball_type < 0) { + fireball_type = default_fireball_type; + } + fireball_objnum = fireball_create( &objp->pos, fireball_type, FIREBALL_LARGE_EXPLOSION, OBJ_INDEX(objp), big_rad, false, &objp->phys_info.vel ); + if ( fireball_objnum >= 0 ) { + explosion_life = fireball_lifeleft(&Objects[fireball_objnum]); } // JAS: I put in all this code because of an item on my todo list that From e40ce6c4bd94ceaaba91e243f96e2a09a293489e Mon Sep 17 00:00:00 2001 From: Kestrellius <902X@comcast.net> Date: Fri, 11 Sep 2026 03:22:09 -0700 Subject: [PATCH 3/5] rebase gore --- code/ship/ship.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/code/ship/ship.cpp b/code/ship/ship.cpp index d7cc86ab4fd..422b268cd6f 100644 --- a/code/ship/ship.cpp +++ b/code/ship/ship.cpp @@ -9631,10 +9631,8 @@ static void ship_dying_frame(object *objp, int ship_num) shipfx_large_blowup_init(shipp); // need to timeout immediately to keep physics in sync shipp->really_final_death_time = timestamp(0); - polymodel *pm = model_get(sip->model_num); - shipp->end_death_time = timestamp((int) pm->core_radius); } else if (sip->disable_main_fireball) { - shipp->end_death_time = shipp->really_final_death_time = timestamp( 0 ); + shipp->really_final_death_time = timestamp( 0 ); } else { float explosion_life = 0.0f; // else, just a single big fireball From 7aac9d823077b125858936527336d89c6d91ba7b Mon Sep 17 00:00:00 2001 From: Kestrellius <902X@comcast.net> Date: Fri, 11 Sep 2026 20:17:11 -0700 Subject: [PATCH 4/5] whitespace --- code/ship/ship.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/ship/ship.cpp b/code/ship/ship.cpp index 422b268cd6f..a63fb618ddc 100644 --- a/code/ship/ship.cpp +++ b/code/ship/ship.cpp @@ -3661,7 +3661,7 @@ static void parse_ship_values(ship_info* sip, const bool is_template, const bool { sip->regular_end_particles = parse_ship_legacy_particle_effect(LegacyShipParticleType::OTHER, sip, "normal death spew", 1.f, particle::Anim_bitmap_id_smoke2, 1.f); } - + if(optional_string("$Alternate Death Effect:")) { sip->knossos_end_particles = particle::util::parseEffect(sip->name); From a4b8f0c80ce02d98aff678b43b1aab23e8fd241a Mon Sep 17 00:00:00 2001 From: Kestrellius <902X@comcast.net> Date: Fri, 11 Sep 2026 22:34:45 -0700 Subject: [PATCH 5/5] move line --- code/ship/ship.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/ship/ship.cpp b/code/ship/ship.cpp index a63fb618ddc..3e8d2713178 100644 --- a/code/ship/ship.cpp +++ b/code/ship/ship.cpp @@ -9634,10 +9634,10 @@ static void ship_dying_frame(object *objp, int ship_num) } else if (sip->disable_main_fireball) { shipp->really_final_death_time = timestamp( 0 ); } else { - float explosion_life = 0.0f; // else, just a single big fireball float big_rad; int fireball_objnum, fireball_type, default_fireball_type; + float explosion_life = 0.0f; big_rad = objp->radius*1.75f; default_fireball_type = FIREBALL_EXPLOSION_LARGE1 + Random::next(FIREBALL_NUM_LARGE_EXPLOSIONS);