Skip to content

Commit

Permalink
Merge pull request #2498 from agrrr3/ShortRangeCombatTargetsAlsoPlane…
Browse files Browse the repository at this point in the history
…tsWithInfrastructure

Target infrastructure by ShortRange weapons and ensure combat
  • Loading branch information
geoffthemedio committed Jul 14, 2019
2 parents 6f4b089 + 785ccff commit 0ab06aa
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
5 changes: 5 additions & 0 deletions combat/CombatSystem.cpp
Expand Up @@ -341,6 +341,11 @@ namespace {
boost::make_unique<Condition::MeterValue>(
METER_SHIELD,
nullptr,
boost::make_unique<ValueRef::Constant<double>>(0.0))),
boost::make_unique<Condition::Not>(
boost::make_unique<Condition::MeterValue>(
METER_CONSTRUCTION,
nullptr,
boost::make_unique<ValueRef::Constant<double>>(0.0)))))));

const std::unique_ptr<Condition::ConditionBase> if_source_is_planet_then_ships_else_all =
Expand Down
7 changes: 7 additions & 0 deletions default/scripting/species/common/general.macros
Expand Up @@ -47,6 +47,13 @@ STANDARD_CONSTRUCTION
]
priority = [[AFTER_ALL_TARGET_MAX_METERS_PRIORITY]]
effects = SetConstruction value = Value + min(max(Value(Target.TargetConstruction) - Value, -1), 1)

EffectsGroup // always ensure minimum value of one, as this is necessary for being attacked
scope = Source
activation = Planet
// has to happen after e.g. FORCE_ENERGY_STRC effects which also happens at AFTER_ALL_TARGET_MAX_METERS_PRIORITY
priority = [[METER_OVERRIDE_PRIORITY]]
effects = SetConstruction value = max(Value, 1)
'''

FOCUS_CHANGE_PENALTY
Expand Down

0 comments on commit 0ab06aa

Please sign in to comment.