Add some animals basic mechanics (#5132)
Co-authored-by: metalgearsloth <comedian_vs_clown@hotmail.com>
This commit is contained in:
@@ -79,7 +79,10 @@ namespace Content.Server.Climbing.Components
|
||||
|
||||
if (velocity <= 0.0f) return;
|
||||
|
||||
Body.ApplyLinearImpulse((to - from).Normalized * velocity * 400);
|
||||
// Since there are bodies with different masses:
|
||||
// mass * 5 seems enough to move entity
|
||||
// instead of launching cats like rockets against the walls with constant impulse value.
|
||||
Body.ApplyLinearImpulse((to - from).Normalized * velocity * Body.Mass * 5);
|
||||
OwnerIsTransitioning = true;
|
||||
|
||||
Owner.SpawnTimer((int) (BufferTime * 1000), () =>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using Content.Server.Clothing.Components;
|
||||
using Content.Server.Clothing.Components;
|
||||
using Content.Server.Inventory.Components;
|
||||
using Content.Shared.Inventory;
|
||||
using Robust.Shared.GameObjects;
|
||||
@@ -12,7 +12,15 @@ namespace Content.Server.Temperature.Components
|
||||
|
||||
public int GetHeatResistance()
|
||||
{
|
||||
if (Owner.GetComponent<InventoryComponent>().TryGetSlotItem(EquipmentSlotDefines.Slots.GLOVES, out ClothingComponent? gloves))
|
||||
// TODO: When making into system: Any animal that touches bulb that has no
|
||||
// InventoryComponent but still would have default heat resistance in the future (maybe)
|
||||
if (!Owner.TryGetComponent<InventoryComponent>(out var inventoryComp))
|
||||
{
|
||||
// Magical number just copied from below
|
||||
return int.MinValue;
|
||||
}
|
||||
|
||||
if (inventoryComp.TryGetSlotItem(EquipmentSlotDefines.Slots.GLOVES, out ClothingComponent? gloves))
|
||||
{
|
||||
return gloves?.HeatResistance ?? int.MinValue;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user