Skip to content
This repository has been archived by the owner on Oct 23, 2024. It is now read-only.

Commit

Permalink
Conserta sistema de IPCs superaquecerem
Browse files Browse the repository at this point in the history
  • Loading branch information
Day-OS committed Jun 11, 2024
1 parent d2748d6 commit eecfac2
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -178,24 +178,22 @@ private float SiliconHeatEffects(EntityUid silicon, float frameTime)
// If the silicon is hot enough, it has a chance to catch fire.

siliconComp.OverheatAccumulator += frameTime;
if (siliconComp.OverheatAccumulator >= 5)
if (!(siliconComp.OverheatAccumulator >= 5))
return hotTempMulti;

siliconComp.OverheatAccumulator -= 5;

if (!EntityManager.TryGetComponent<FlammableComponent>(silicon, out var flamComp)
|| flamComp is { OnFire: true }
|| !(temperComp.CurrentTemperature > temperComp.HeatDamageThreshold))
return hotTempMulti;

_popup.PopupEntity(Loc.GetString("silicon-overheating"), silicon, silicon, PopupType.MediumCaution);
if (_random.Prob(Math.Clamp(temperComp.CurrentTemperature / (upperThresh * 5), 0.001f, 0.9f)))
{
siliconComp.OverheatAccumulator -= 5;

if (EntityManager.TryGetComponent<FlammableComponent>(silicon, out var flamComp) &&
temperComp.CurrentTemperature > temperComp.HeatDamageThreshold &&
!flamComp.OnFire &&
_random.Prob(Math.Clamp(temperComp.CurrentTemperature / (upperThresh * 5), 0.001f, 0.9f)))
{
_flammable.Ignite(silicon, silicon, flamComp);
}
else if ((flamComp == null || !flamComp.OnFire) &&
_random.Prob(Math.Clamp(temperComp.CurrentTemperature / upperThresh, 0.001f, 0.75f)))
{
_popup.PopupEntity(Loc.GetString("silicon-overheating"), silicon, silicon, PopupType.SmallCaution);
}
_flammable.AdjustFireStacks(silicon, Math.Clamp(siliconComp.FireStackMultiplier, flamComp.MinimumFireStacks, flamComp.MaximumFireStacks), flamComp);
_flammable.Ignite(silicon, silicon, flamComp);
}

return hotTempMulti;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ private bool TryHealBlindness(EntityUid uid, EntityUid user, EntityUid target, f
BreakOnMove = true,
BreakOnWeightlessMove = false,
};
Log.Info("aaa");

_doAfter.TryStartDoAfter(doAfterEventArgs);
return true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,4 +93,7 @@ public sealed partial class SiliconComponent : Component
/// </summary>
[DataField("speedModifierThresholds", required: true)]
public Dictionary<ChargeState, float> SpeedModifierThresholds = default!;

[DataField("fireStackMultiplier"), ViewVariables(VVAccess.ReadWrite)]
public float FireStackMultiplier = 1f;
}
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,22 @@
2: 0.80
1: 0.45
0: 0.00

- type: Temperature
heatDamageThreshold: 325
coldDamageThreshold: 260
currentTemperature: 310.15
specificHeat: 42
coldDamage:
types:
Cold: 0.1 #per second, scales with temperature & other constants
heatDamage:
types:
Heat: 3 #per second, scales with temperature & other constants
atmosTemperatureTransferEfficiency: 0.4
- type: Deathgasp
prototype: SiliconDeathgasp
needsCritical: false
- type: MobState
allowedStates:
- Alive
Expand Down

0 comments on commit eecfac2

Please sign in to comment.