Expose full gameplay rules, difficulty, HUD, and control options
This commit is contained in:
1 parent
6c24f715a0
commit
cd63921ea4
15 files changed
+564
-164
No files matched your search
+23
-13
@@ -167,7 +167,7 @@ void step_combat_and_world(
|
||||
}
|
||||
|
||||
// Trigger repair if fuel completely depleted and stopped
|
||||
if (c.fuel <= 0.05f && c.speed_horizontal() < 0.8f) {
|
||||
if (setup.fuel_enabled && c.fuel <= 0.05f && c.speed_horizontal() < 0.8f) {
|
||||
c.recovery_state = RecoveryState::CallingRepair;
|
||||
c.recovery_timer = 3.0f;
|
||||
if (c.is_human) {
|
||||
@@ -176,6 +176,12 @@ void step_combat_and_world(
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!setup.weapons_enabled) {
|
||||
c.lock_target_id = -1;
|
||||
c.lock_progress = 0.0f;
|
||||
continue;
|
||||
}
|
||||
|
||||
// Update missile lock-on cone
|
||||
Vec3 fwd = c.forward_dir();
|
||||
int best_tgt = -1;
|
||||
@@ -304,8 +310,6 @@ void step_combat_and_world(
|
||||
Vec3 d = victim.curr_pose.pos - pr.pos;
|
||||
if (d.len_sq() < hit_r * hit_r) {
|
||||
pr.active = false;
|
||||
victim.shield -= pr.damage;
|
||||
victim.armour_used += pr.damage;
|
||||
if (pr.owner_id >= 0 && pr.owner_id < static_cast<int>(crafts.size())) {
|
||||
crafts[pr.owner_id].shots_hit += 1;
|
||||
}
|
||||
@@ -319,17 +323,21 @@ void step_combat_and_world(
|
||||
victim.is_human ? victim.player_index : -1, "", 0.20f});
|
||||
}
|
||||
|
||||
if (victim.shield <= 0.0f) {
|
||||
if (pr.owner_id >= 0 && pr.owner_id < static_cast<int>(crafts.size())) {
|
||||
crafts[pr.owner_id].kills += 1;
|
||||
if (setup.mode == GameMode::DeathMatch &&
|
||||
crafts[pr.owner_id].kills >= setup.deathmatch_kill_limit) {
|
||||
out_race_over = true;
|
||||
out_winner_id = crafts[pr.owner_id].id;
|
||||
if (setup.damage_enabled) {
|
||||
victim.shield -= pr.damage;
|
||||
victim.armour_used += pr.damage;
|
||||
if (victim.shield <= 0.0f) {
|
||||
if (pr.owner_id >= 0 && pr.owner_id < static_cast<int>(crafts.size())) {
|
||||
crafts[pr.owner_id].kills += 1;
|
||||
if (setup.mode == GameMode::DeathMatch &&
|
||||
crafts[pr.owner_id].kills >= setup.deathmatch_kill_limit) {
|
||||
out_race_over = true;
|
||||
out_winner_id = crafts[pr.owner_id].id;
|
||||
}
|
||||
}
|
||||
apply_damage(victim, pr.owner_id, crafts, setup, particles, events,
|
||||
out_race_over, out_winner_id);
|
||||
}
|
||||
apply_damage(victim, pr.owner_id, crafts, setup, particles, events,
|
||||
out_race_over, out_winner_id);
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -397,7 +405,9 @@ void step_combat_and_world(
|
||||
prop.alive = false;
|
||||
prop.respawn_timer = 25.0f;
|
||||
if (prop.model_key.rfind("BAREL", 0) == 0) {
|
||||
c.shield = std::max(5.0f, c.shield - 12.0f);
|
||||
if (setup.damage_enabled) {
|
||||
c.shield = std::max(5.0f, c.shield - 12.0f);
|
||||
}
|
||||
spawn_explosion(particles, prop.pos, 0.9f);
|
||||
events.push_back({SimSoundCue::Explosion, prop.pos,
|
||||
c.is_human ? c.player_index : -1, "", 0.45f});
|
||||
|
||||
Reference in new issue
Block a user