-
Notifications
You must be signed in to change notification settings - Fork 151
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
50 changed files
with
645 additions
and
564 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
using Content.Shared.Backmen.Blob; | ||
|
||
namespace Content.Client.Backmen.Blob; | ||
|
||
public sealed class BlobCarrierSystem : SharedBlobCarrierSystem | ||
{ | ||
protected override void TransformToBlob(Entity<BlobCarrierComponent> ent) | ||
{ | ||
// do nothing | ||
} | ||
} |
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,8 @@ | ||
using Content.Shared.Backmen.Blob; | ||
|
||
namespace Content.Client.Backmen.Blob; | ||
|
||
public sealed class BlobCoreSystem : SharedBlobCoreSystem | ||
{ | ||
|
||
} |
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,38 +1,53 @@ | ||
using Content.Client.DamageState; | ||
using Content.Shared.Backmen.Blob; | ||
using Content.Shared.Backmen.Blob.Components; | ||
using Robust.Client.GameObjects; | ||
using Robust.Shared.GameStates; | ||
|
||
namespace Content.Client.Backmen.Blob; | ||
|
||
public sealed class BlobTileSystem : EntitySystem | ||
public sealed class BlobTileSystem : SharedBlobTileSystem | ||
{ | ||
public override void Initialize() | ||
protected override void TryRemove(EntityUid target, EntityUid coreUid, BlobTileComponent tile, BlobCoreComponent core) | ||
{ | ||
base.Initialize(); | ||
SubscribeLocalEvent<BlobTileComponent, ComponentHandleState>(OnBlobTileHandleState); | ||
// do nothing on client | ||
} | ||
|
||
private void OnBlobTileHandleState(EntityUid uid, BlobTileComponent component, ref ComponentHandleState args) | ||
protected override void TryUpgrade(EntityUid target, EntityUid user, EntityUid coreUid, BlobTileComponent tile, BlobCoreComponent core) | ||
{ | ||
if (args.Current is not BlobTileComponentState state) | ||
return; | ||
|
||
if (component.Color == state.Color) | ||
return; | ||
// do nothing on client | ||
} | ||
} | ||
|
||
component.Color = state.Color; | ||
TryComp<SpriteComponent>(uid, out var sprite); | ||
public sealed class BlobTileVisualizerSystem : VisualizerSystem<BlobTileComponent> | ||
{ | ||
public override void Initialize() | ||
{ | ||
base.Initialize(); | ||
SubscribeLocalEvent<BlobTileComponent, AfterAutoHandleStateEvent>(OnBlobTileHandleState); | ||
} | ||
|
||
if (sprite == null) | ||
private void UpdateAppearance(EntityUid id, BlobTileComponent tile, AppearanceComponent? appearance = null, SpriteComponent? sprite = null) | ||
{ | ||
if (!Resolve(id, ref appearance, ref sprite)) | ||
return; | ||
|
||
foreach (var key in new []{ DamageStateVisualLayers.Base, DamageStateVisualLayers.BaseUnshaded }) | ||
{ | ||
if (!sprite.LayerMapTryGet(key, out _)) | ||
continue; | ||
|
||
sprite.LayerSetColor(key, component.Color); | ||
sprite.LayerSetColor(key, tile.Color); | ||
} | ||
} | ||
|
||
protected override void OnAppearanceChange(EntityUid uid, BlobTileComponent component, ref AppearanceChangeEvent args) | ||
{ | ||
UpdateAppearance(uid, component, args.Component, args.Sprite); | ||
} | ||
|
||
private void OnBlobTileHandleState(EntityUid uid, BlobTileComponent component, ref AfterAutoHandleStateEvent args) | ||
{ | ||
UpdateAppearance(uid, component); | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,39 +1,53 @@ | ||
using System.Linq; | ||
using Content.Client.DamageState; | ||
using Content.Shared.Backmen.Blob; | ||
using Content.Shared.Backmen.Blob.Components; | ||
using Content.Shared.Damage; | ||
using Content.Shared.Popups; | ||
using Robust.Client.GameObjects; | ||
using Robust.Shared.GameStates; | ||
|
||
namespace Content.Client.Backmen.Blob; | ||
|
||
public sealed class BlobbernautSystem : EntitySystem | ||
public sealed class BlobbernautSystem : SharedBlobbernautSystem | ||
{ | ||
[Dependency] private readonly SharedPopupSystem _popup = default!; | ||
protected override DamageSpecifier? TryChangeDamage(string msg, EntityUid ent, DamageSpecifier dmg) | ||
{ | ||
_popup.PopupClient(Loc.GetString(msg), ent, ent, PopupType.LargeCaution); | ||
return null; | ||
} | ||
} | ||
|
||
public sealed class BlobbernautVisualizerSystem : VisualizerSystem<BlobbernautComponent> | ||
{ | ||
public override void Initialize() | ||
{ | ||
base.Initialize(); | ||
SubscribeLocalEvent<BlobbernautComponent, ComponentHandleState>(OnBlobTileHandleState); | ||
SubscribeLocalEvent<BlobbernautComponent, AfterAutoHandleStateEvent>(OnBlobTileHandleState); | ||
} | ||
|
||
private void OnBlobTileHandleState(EntityUid uid, BlobbernautComponent component, ref ComponentHandleState args) | ||
private void UpdateAppearance(EntityUid id, BlobbernautComponent blobbernaut, AppearanceComponent? appearance = null, SpriteComponent? sprite = null) | ||
{ | ||
if (args.Current is not BlobbernautComponentState state) | ||
return; | ||
|
||
if (component.Color == state.Color) | ||
return; | ||
|
||
component.Color = state.Color; | ||
TryComp<SpriteComponent>(uid, out var sprite); | ||
|
||
if (sprite == null) | ||
if (!Resolve(id, ref appearance, ref sprite)) | ||
return; | ||
|
||
foreach (var key in new []{ DamageStateVisualLayers.Base }) | ||
foreach (var key in new []{ DamageStateVisualLayers.Base, DamageStateVisualLayers.BaseUnshaded }) | ||
{ | ||
if (!sprite.LayerMapTryGet(key, out _)) | ||
continue; | ||
|
||
sprite.LayerSetColor(key, component.Color); | ||
sprite.LayerSetColor(key, blobbernaut.Color); | ||
} | ||
} | ||
|
||
protected override void OnAppearanceChange(EntityUid uid, BlobbernautComponent component, ref AppearanceChangeEvent args) | ||
{ | ||
UpdateAppearance(uid, component, args.Component, args.Sprite); | ||
} | ||
|
||
private void OnBlobTileHandleState(EntityUid uid, BlobbernautComponent component, ref AfterAutoHandleStateEvent args) | ||
{ | ||
UpdateAppearance(uid, component); | ||
} | ||
} |
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.