Skip to content

Commit 62c8260

Browse files
authored
add flag (#6815)
1 parent 82dfdbc commit 62c8260

3 files changed

Lines changed: 6 additions & 2 deletions

File tree

code/ai/aiturret.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1559,7 +1559,9 @@ void turret_set_next_fire_timestamp(int weapon_num, const weapon_info *wip, ship
15591559
float burst_shots_mult = wip->weapon_launch_curves.get_output(weapon_info::WeaponLaunchCurveOutputs::BURST_SHOTS_MULT, launch_curve_data);
15601560
int burst_shots = MAX(fl2i(i2fl(base_burst_shots) * burst_shots_mult) - 1, 0);
15611561

1562-
if (burst_shots > turret->weapons.burst_counter[weapon_num]) {
1562+
bool burst = burst_shots > turret->weapons.burst_counter[weapon_num];
1563+
1564+
if (burst) {
15631565
wait *= wip->burst_delay;
15641566
wait *= wip->weapon_launch_curves.get_output(weapon_info::WeaponLaunchCurveOutputs::BURST_DELAY_MULT, launch_curve_data);
15651567
turret->weapons.burst_counter[weapon_num]++;
@@ -1659,7 +1661,7 @@ void turret_set_next_fire_timestamp(int weapon_num, const weapon_info *wip, ship
16591661
wait *= frand_range(0.9f, 1.1f);
16601662
}
16611663

1662-
if(turret->rof_scaler != 1.0f)
1664+
if(turret->rof_scaler != 1.0f && !(burst && turret->system_info->flags[Model::Subsystem_Flags::Burst_ignores_RoF_Mult]))
16631665
wait /= get_adjusted_turret_rof(turret);
16641666

16651667
(*fs_dest) = timestamp((int)wait);

code/model/model_flags.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ namespace Model {
7272
Hide_turret_from_loadout_stats, // Turret is not accounted for in auto-generated "Turrets" line in the ship loadout window --wookieejedi
7373
Turret_distant_firepoint, //Turret barrel is very long and should be taken into account when aiming -- Kiloku
7474
Override_submodel_impact, // if a weapon impacted a submodel, but this subsystem is within range, the subsystem takes priority -- Goober5000
75+
Burst_ignores_RoF_Mult, // The turret's fire rate multiplier won't affect burst delay.
7576

7677
NUM_VALUES
7778
};

code/ship/ship.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -357,6 +357,7 @@ flag_def_list_new<Model::Subsystem_Flags> Subsystem_flags[] = {
357357
{ "hide turret from loadout stats", Model::Subsystem_Flags::Hide_turret_from_loadout_stats, true, false },
358358
{ "turret has distant firepoint", Model::Subsystem_Flags::Turret_distant_firepoint, true, false },
359359
{ "override submodel impact", Model::Subsystem_Flags::Override_submodel_impact, true, false },
360+
{ "burst ignores rof mult", Model::Subsystem_Flags::Burst_ignores_RoF_Mult, true, false },
360361
};
361362

362363
const size_t Num_subsystem_flags = sizeof(Subsystem_flags)/sizeof(flag_def_list_new<Model::Subsystem_Flags>);

0 commit comments

Comments
 (0)