Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 33 additions & 26 deletions code/ship/ship.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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);
Expand All @@ -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);
Expand Down Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions code/ship/ship.h
Original file line number Diff line number Diff line change
Expand Up @@ -1221,6 +1221,7 @@ class ship_info
int death_fx_count;
int shockwave_count; // the # of total shockwaves
SCP_vector<int> explosion_bitmap_anims;
bool disable_main_fireball;
float skip_deathroll_chance;

particle::ParticleEffectHandle impact_spew;
Expand Down