Fire damage (#2024)

* Moved the uplink creation code to the PresetSuspicion.Start method to ensure uplink created when we give the traitor role
Moved the starting TC balance to cvars

* Added component to handle interaction with Atmospheric system
Added damage from high and cold temperature

* renamed AtmoExposable to AtmosExposed
moved AtmosExposed updates to its own system
refactored TemperatureComponent
renamed fire to heat
added null check for Air
added self-heating and self-cooling to body system

* small refactoring for checking on airless tile in MetabolismComponent

* Added component to handle interaction with Atmospheric system
Added damage from high and cold temperature

* renamed AtmoExposable to AtmosExposed
moved AtmosExposed updates to its own system
refactored TemperatureComponent
renamed fire to heat
added null check for Air
added self-heating and self-cooling to body system

* small refactoring for checking on airless tile in MetabolismComponent

* Removed Pressure property from BarotraumaComponent
Changed CanShiver method to match style of other CanX method in ActionBlockerSystem

* Merged EntityCoordinates and changed components to reflect the change

* Fix typo

* Wrapped string to Loc.GetString
Added CanSweat
Refactored dead state check
This commit is contained in:
creadth
2020-09-09 18:03:27 +03:00
committed by GitHub
parent 5120627ca2
commit 7baa0a4391
16 changed files with 355 additions and 108 deletions

View File

@@ -1,4 +1,5 @@
using Robust.Shared.GameObjects.Systems;
using System.Linq;
using Robust.Shared.GameObjects.Systems;
using Robust.Shared.Interfaces.GameObjects;
namespace Content.Shared.GameObjects.EntitySystems
@@ -24,6 +25,9 @@ namespace Content.Shared.GameObjects.EntitySystems
bool CanUnequip() => true;
bool CanChangeDirection() => true;
bool CanShiver() => true;
bool CanSweat() => true;
}
/// <summary>
@@ -35,10 +39,11 @@ namespace Content.Shared.GameObjects.EntitySystems
public static bool CanMove(IEntity entity)
{
bool canmove = true;
foreach(var actionblockercomponents in entity.GetAllComponents<IActionBlocker>())
foreach (var actionblockercomponents in entity.GetAllComponents<IActionBlocker>())
{
canmove &= actionblockercomponents.CanMove(); // Sets var to false if false
}
return canmove;
}
@@ -49,6 +54,7 @@ namespace Content.Shared.GameObjects.EntitySystems
{
caninteract &= actionblockercomponents.CanInteract();
}
return caninteract;
}
@@ -59,6 +65,7 @@ namespace Content.Shared.GameObjects.EntitySystems
{
canuse &= actionblockercomponents.CanUse();
}
return canuse;
}
@@ -69,6 +76,7 @@ namespace Content.Shared.GameObjects.EntitySystems
{
canthrow &= actionblockercomponents.CanThrow();
}
return canthrow;
}
@@ -79,6 +87,7 @@ namespace Content.Shared.GameObjects.EntitySystems
{
canspeak &= actionblockercomponents.CanSpeak();
}
return canspeak;
}
@@ -89,8 +98,9 @@ namespace Content.Shared.GameObjects.EntitySystems
{
candrop &= actionblockercomponents.CanDrop();
}
return candrop;
}
}
public static bool CanPickup(IEntity entity)
{
@@ -99,6 +109,7 @@ namespace Content.Shared.GameObjects.EntitySystems
{
canpickup &= actionblockercomponents.CanPickup();
}
return canpickup;
}
@@ -161,5 +172,25 @@ namespace Content.Shared.GameObjects.EntitySystems
return canchangedirection;
}
public static bool CanShiver(IEntity entity)
{
var canShiver = true;
foreach (var component in entity.GetAllComponents<IActionBlocker>())
{
canShiver &= component.CanShiver();
}
return canShiver;
}
public static bool CanSweat(IEntity entity)
{
var canSweat = true;
foreach (var component in entity.GetAllComponents<IActionBlocker>())
{
canSweat &= component.CanSweat();
}
return canSweat;
}
}
}