PropertyConditionals match if any of the targets match, junction boxes only take damage underwater when therey're powered up (because trying to fix all boxes in a flooded sub before they break again is pain in the ass)

This commit is contained in:
Joonas Rikkonen
2018-04-23 14:47:36 +03:00
parent f2842c265c
commit 1d98df11a3
2 changed files with 5 additions and 3 deletions
@@ -18,7 +18,9 @@
</fixrequirement> </fixrequirement>
<PowerTransfer canbeselected = "true"> <PowerTransfer canbeselected = "true">
<StatusEffect type="InWater" target="This" condition="-0.5"/> <StatusEffect type="InWater" target="This" condition="-0.5">
<Conditional currPowerConsumption="lt -10"/>
</StatusEffect>
<GuiFrame rect="0,0,350,160" alignment="Center" style="ItemUI"/> <GuiFrame rect="0,0,350,160" alignment="Center" style="ItemUI"/>
</PowerTransfer> </PowerTransfer>
@@ -272,10 +272,10 @@ namespace Barotrauma
if (target == null || target.SerializableProperties == null) continue; if (target == null || target.SerializableProperties == null) continue;
foreach (PropertyConditional pc in propertyConditionals) foreach (PropertyConditional pc in propertyConditionals)
{ {
if (!pc.Matches(target)) return false; if (pc.Matches(target)) return true;
} }
} }
return true; return false;
} }
public virtual void Apply(ActionType type, float deltaTime, Entity entity, ISerializableEntity target) public virtual void Apply(ActionType type, float deltaTime, Entity entity, ISerializableEntity target)