Reflected Visibility
Ships are now more visible in lit areas (depending on cross section stat in Reflector behavior) Refactored all behaviors to remove context & entity references (can get them from equipped item reference if needed) Fixed crash when enemy dies of heatstroke while targeted Exponential decay for visibility now uses correct time-independent formula Refactored item inspection in properties panel (now consistent between equipped items vs. inventory and store items, shows effect of heat on stats) Reordered item properties and added spacing between groups
This commit is contained in:
parent
b0b2717294
commit
a51c402fc5
59 changed files with 557 additions and 1405 deletions
|
|
@ -16,9 +16,9 @@ public class EnergyDrawData : BehaviorData
|
|||
[Inspectable, JsonProperty("perSecond"), Key(2)]
|
||||
public bool PerSecond;
|
||||
|
||||
public override IBehavior CreateInstance(ItemManager context, Entity entity, EquippedItem item)
|
||||
public override IBehavior CreateInstance(EquippedItem item)
|
||||
{
|
||||
return new EnergyDraw(context, this, entity, item);
|
||||
return new EnergyDraw(this, item);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -26,22 +26,18 @@ public class EnergyDraw : IBehavior
|
|||
{
|
||||
private EnergyDrawData _data;
|
||||
|
||||
private Entity Entity { get; }
|
||||
private EquippedItem Item { get; }
|
||||
private ItemManager Context { get; }
|
||||
|
||||
public BehaviorData Data => _data;
|
||||
|
||||
public EnergyDraw(ItemManager context, EnergyDrawData data, Entity entity, EquippedItem item)
|
||||
public EnergyDraw(EnergyDrawData data, EquippedItem item)
|
||||
{
|
||||
_data = data;
|
||||
Entity = entity;
|
||||
Item = item;
|
||||
Context = context;
|
||||
}
|
||||
|
||||
public bool Execute(float delta)
|
||||
{
|
||||
return Entity.TryConsumeEnergy(Item.Evaluate(_data.EnergyDraw) * (_data.PerSecond ? delta : 1));
|
||||
return Item.Entity.TryConsumeEnergy(Item.Evaluate(_data.EnergyDraw) * (_data.PerSecond ? delta : 1));
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue