Skip to content

Commit

Permalink
New feature: All units will be set to run and kneel at the beginning …
Browse files Browse the repository at this point in the history
…of combat (disabled by default) (#399)

With this feature enabled you don't need to click through every unit and
set them to run and kneel.
  • Loading branch information
Jarskih authored and FilmBoy84 committed Oct 13, 2018
1 parent 8cd7a0d commit 31d9300
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
2 changes: 2 additions & 0 deletions framework/framework.cpp
Expand Up @@ -244,6 +244,8 @@ ConfigOptionBool optionFuelCrashingVehicles("OpenApoc.NewFeature", "CrashingOutO
"Vehicles crash when out of fuel", true);
ConfigOptionBool optionSkipTurbo("OpenApoc.NewFeature", "SkipTurboMovement",
"Skip turbo movement calculations", false);
ConfigOptionBool optionRunAndKneel("OpenApoc.NewFeature", "RunAndKneel",
"All units run and kneel by default", false);

ConfigOptionBool optionStunHostileAction("OpenApoc.Mod", "StunHostileAction",
"Stunning hurts relationships", false);
Expand Down
16 changes: 12 additions & 4 deletions game/state/battle/battle.cpp
Expand Up @@ -1099,14 +1099,22 @@ void Battle::initialUnitSpawn(GameState &state)
}
// Stance
u->setBodyState(state, u->agent->type->bodyType->getFirstAllowedState());
if (u->current_body_state == BodyState::Kneeling ||
u->current_body_state == BodyState::Prone)
if (config().getBool("OpenApoc.NewFeature.RunAndKneel"))
{
u->setMovementMode(MovementMode::Prone);
u->setKneelingMode(KneelingMode::Kneeling);
u->setMovementMode(MovementMode::Running);
}
else
{
u->setMovementMode(MovementMode::Walking);
if (u->current_body_state == BodyState::Kneeling ||
u->current_body_state == BodyState::Prone)
{
u->setMovementMode(MovementMode::Prone);
}
else
{
u->setMovementMode(MovementMode::Walking);
}
}
// Miscellaneous
u->beginTurn(state);
Expand Down
1 change: 1 addition & 0 deletions game/ui/general/ingameoptions.cpp
Expand Up @@ -104,6 +104,7 @@ std::list<std::pair<UString, UString>> openApocList = {
{"OpenApoc.NewFeature.CrashingDimensionGate", "Uncapable vehicles crash when entering gates"},
{"OpenApoc.NewFeature.SkipTurboMovement", "Skip turbo movement calculations"},
{"OpenApoc.NewFeature.CrashingOutOfFuel", "Vehicles crash when out of fuel"},
{"OpenApoc.NewFeature.RunAndKneel", " All units run and kneel by default"},

{"OpenApoc.Mod.StunHostileAction", "(M) Stunning hurts relationships"},
{"OpenApoc.Mod.RaidHostileAction", "(M) Initiating raid hurts relationships"},
Expand Down

0 comments on commit 31d9300

Please sign in to comment.