-
-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'refs/remotes/sunrise_public/master'
- Loading branch information
Showing
106 changed files
with
39,045 additions
and
21,464 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
|
||
using Content.Shared.FixedPoint; | ||
|
||
namespace Content.Server.FaceCast; | ||
|
||
[RegisterComponent] | ||
public sealed partial class FaceCastComponent : Component | ||
{ | ||
public TimeSpan? StartCastingTime = null; | ||
|
||
public EntityUid? Equiper = null; | ||
|
||
public Double TimeToCast = 5; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
using Content.Shared.Inventory.Events; | ||
using Robust.Shared.Timing; | ||
using Content.Shared.IdentityManagement.Components; | ||
using Content.Shared.Clothing.Components; | ||
using Content.Shared.Inventory; | ||
using Content.Shared.Nutrition.AnimalHusbandry; | ||
|
||
namespace Content.Server.FaceCast; | ||
|
||
public sealed class FaceCastSystem : EntitySystem | ||
{ | ||
[Dependency] private readonly IGameTiming _timing = default!; | ||
[Dependency] private readonly MetaDataSystem _metaData = default!; | ||
[Dependency] private readonly InventorySystem _inventory = default!; | ||
public override void Initialize() | ||
{ | ||
SubscribeLocalEvent<FaceCastComponent, GotEquippedEvent>(OnEquip); | ||
SubscribeLocalEvent<FaceCastComponent, GotUnequippedEvent>(OnUnequip); | ||
} | ||
|
||
private void OnEquip(EntityUid ent, FaceCastComponent faceCast, ref GotEquippedEvent args) | ||
{ | ||
if (!HasComp<IdentityComponent>(args.Equipee)) | ||
return; | ||
faceCast.Equiper = args.Equipee; | ||
if (HasComp<InfantComponent>(args.Equipee)) | ||
return; | ||
faceCast.StartCastingTime = _timing.CurTime; | ||
} | ||
|
||
private void OnUnequip(EntityUid ent, FaceCastComponent faceCast, ref GotUnequippedEvent args) | ||
{ | ||
faceCast.StartCastingTime = null; | ||
faceCast.Equiper = null; | ||
} | ||
|
||
public override void Update(float frameTime) | ||
{ | ||
base.Update(frameTime); | ||
|
||
var query = EntityQueryEnumerator<FaceCastComponent>(); | ||
while (query.MoveNext(out var uid, out var faceCast)) | ||
{ | ||
if (!TryComp<ClothingComponent>(uid, out var cloth)) | ||
continue; | ||
|
||
if (faceCast.Equiper == null) | ||
continue; | ||
|
||
if (!HasComp<InfantComponent>(faceCast.Equiper) && faceCast.StartCastingTime == null) | ||
{ | ||
if (Name(uid) != Loc.GetEntityData("ClothingMaskFaceCast").Name) | ||
_metaData.SetEntityName((EntityUid) faceCast.Equiper, Name(uid)); | ||
faceCast.StartCastingTime = _timing.CurTime; | ||
continue; | ||
} | ||
|
||
if (faceCast.StartCastingTime == null) | ||
continue; | ||
|
||
if ((_timing.CurTime - faceCast.StartCastingTime) >= TimeSpan.FromSeconds(faceCast.TimeToCast)) | ||
{ | ||
_metaData.SetEntityName(uid, Name((EntityUid)faceCast.Equiper)); | ||
faceCast.StartCastingTime = _timing.CurTime; | ||
} | ||
|
||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.