Skip to content

Commit 47f6a71

Browse files
committed
Some stuff
1 parent 51fba1b commit 47f6a71

10 files changed

Lines changed: 39 additions & 21 deletions

File tree

Content.Goobstation.Shared/Terror/Components/BerserkerRageComponent.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@ namespace Content.Goobstation.Shared.Terror.Components;
99
[RegisterComponent, NetworkedComponent]
1010
public sealed partial class BerserkerRageComponent : Component
1111
{
12+
[DataField]
1213
public float MinMultiplier = 1f;
1314

14-
public float MaxMultiplier = 3f;
15-
15+
[DataField]
16+
public float MaxMultiplier = 2.5f;
1617
}

Content.Goobstation.Shared/Terror/Components/TerrorWrapComponent.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ public sealed partial class TerrorWrapComponent : Component
1313
public TimeSpan DoAfter = TimeSpan.FromSeconds(5);
1414

1515
/// <summary>
16-
/// DoAfter timer for cocooning someone.
16+
/// The prototype of the cocoon.
1717
/// </summary>
1818
[DataField]
1919
public EntProtoId CocoonProto = "TerrorCocoon";

Content.Goobstation.Shared/Terror/Systems/BerserkerRageSystem.cs

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
using Content.Goobstation.Shared.Terror.Components;
22
using Content.Shared.Damage;
3+
using Content.Shared.Damage.Prototypes;
4+
using Content.Shared.Mobs;
5+
using Content.Shared.Mobs.Components;
36
using Content.Shared.Weapons.Melee.Events;
7+
using Robust.Shared.Prototypes;
48
using System.Linq;
59

610
namespace Content.Goobstation.Shared.Terror.Systems;
@@ -10,6 +14,7 @@ namespace Content.Goobstation.Shared.Terror.Systems;
1014
/// </summary>
1115
public sealed class BerserkerRageSystem : EntitySystem
1216
{
17+
[Dependency] private readonly IPrototypeManager _proto = default!;
1318
public override void Initialize()
1419
{
1520
SubscribeLocalEvent<BerserkerRageComponent, GetUserMeleeDamageEvent>(OnGetUserDamage);
@@ -20,10 +25,26 @@ private float GetHealth(EntityUid ent)
2025
if (!TryComp<DamageableComponent>(ent, out var damageable))
2126
return 1f;
2227

23-
var damage = (float) damageable.TotalDamage;
24-
const float maxDamage = 100f;
28+
if (!TryComp<MobThresholdsComponent>(ent, out var thresholds))
29+
return 1f;
30+
31+
// Find the damage value that corresponds to dead state which is basically max health
32+
float maxDamage = 0f;
33+
34+
foreach (var (damage, state) in thresholds.Thresholds)
35+
{
36+
if (state == MobState.Dead)
37+
{
38+
maxDamage = (float) damage;
39+
break;
40+
}
41+
}
42+
43+
if (maxDamage <= 0f)
44+
return 1f;
2545

26-
return Math.Clamp(1f - (damage / maxDamage), 0f, 1f);
46+
var totalDamage = (float) damageable.TotalDamage;
47+
return Math.Clamp(1f - (totalDamage / maxDamage), 0f, 1f);
2748
}
2849

2950
private void OnGetUserDamage(Entity<BerserkerRageComponent> ent, ref GetUserMeleeDamageEvent args)

Content.Goobstation.Shared/Terror/Systems/TerrorSpiderSystem.cs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,8 @@ namespace Content.Goobstation.Shared.Terror.Systems;
1515
/// </summary>
1616
public sealed class TerrorSpiderSystem : EntitySystem
1717
{
18-
[Dependency] private readonly DamageableSystem _damage = default!;
1918
[Dependency] private readonly SharedAudioSystem _audio = default!;
2019
[Dependency] private readonly SharedPopupSystem _popup = default!;
21-
[Dependency] private readonly INetManager _net = default!;
22-
2320

2421
public override void Initialize()
2522
{
@@ -47,7 +44,7 @@ private void BroadcastSpiderDeath(Entity<TerrorSpiderComponent> deadSpider)
4744

4845
while (query.MoveNext(out var spiderPlayerUid, out var comp, out _))
4946
{
50-
_popup.PopupPredicted($"A member of the hive has fallen… ({ToPrettyString(deadSpider.Owner)})", spiderPlayerUid, spiderPlayerUid, PopupType.Medium); // LocString broke this, deal with it Russians
47+
_popup.PopupPredicted(Loc.GetString("terror-spider-hive-death", ("spider", deadSpider.Owner)), spiderPlayerUid, spiderPlayerUid, PopupType.Medium);
5148

5249
_audio.PlayPredicted(comp.DeathSound, spiderPlayerUid, spiderPlayerUid);
5350
}

Content.Goobstation.Shared/Terror/Systems/TerrorWrapSystem.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
using Content.Goobstation.Common.Changeling;
21
using Content.Goobstation.Shared.Terror.Components;
32
using Content.Goobstation.Shared.Terror.Events;
43
using Content.Shared.Administration.Logs;
@@ -20,8 +19,6 @@ public sealed class TerrorWrapSystem : EntitySystem
2019
[Dependency] private readonly ISharedAdminLogManager _admin = default!;
2120
[Dependency] private readonly MobStateSystem _mobState = default!;
2221
[Dependency] private readonly SharedEntityStorageSystem _storage = default!;
23-
24-
2522
public override void Initialize()
2623
{
2724
base.Initialize();

Resources/Locale/en-US/_Goobstation/Terror/terror.ftl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
terror-far-from-queen = You feel your life slipping away… the queen is too far away!
22
3-
hive-member-fallen = A member of the hive has fallen… ({name})
4-
53
sticky-web-generic = The sticky web ensnares you!
64
sticky-web-infested = The sticky web ensnares you! Spiderlings begin to crawl all over you!
75
sticky-web-poison = The sticky web ensnares you! You don't feel too good...
@@ -20,3 +18,5 @@ queen-sense-entry = {name} — {location}
2018
2119
queen-death-gib = A blood-chilling psychic scream echoes through the hive as the Terror Queen is slain! Your body is torn apart by the psychic feedback!
2220
queen-death-rage = A blood-chilling psychic scream echoes through the hive as the Terror Queen is slain! You are filled with rage, your attacks dealing more damage the lower your health. Avenge her!
21+
22+
terror-spider-hive-death = A member of the hive has fallen… { $spider }

Resources/Prototypes/_Goobstation/Terror/Actions/actions.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@
150150
components:
151151
- Cocoon
152152
canTargetSelf: false
153-
event: !type:TentacleHookEvent
153+
event: !type:TerrorLayEvent
154154

155155
- type: entity
156156
id: ActionTerrorWrap

Resources/Prototypes/_Goobstation/Terror/Gamerules/events_roundstart.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,4 @@
2525
briefing:
2626
text: terror-queen-briefing
2727
sound: /Audio/_Goobstation/Terror/terrorspider.ogg
28-
color: "#8b0000"
28+
color: Purple

Resources/Prototypes/_Goobstation/Terror/Gamerules/terrorspider.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
- MindRoleGhostRoleTeamAntagonist
1414
briefing:
1515
text: terror-queen-briefing
16-
color: "#8b0000"
16+
color: Purple
1717
sound: /Audio/_Goobstation/Terror/terrorspider.ogg
1818
- type: AntagRandomSpawn
1919
- type: AntagSpawner
@@ -53,5 +53,5 @@
5353
- MindRoleGhostRoleTeamAntagonist
5454
briefing:
5555
text: terror-queen-briefing
56-
color: "#8b0000"
56+
color: Purple
5757
sound: /Audio/_Goobstation/Terror/terrorspider.ogg

Resources/Prototypes/_White/GameRules/events.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,5 +33,7 @@
3333
max: 4
3434
pickPlayer: false
3535
briefing:
36-
text: terror-queen-briefing
37-
color: "#8b0000"
36+
text: xenomorph-role-greeting
37+
color: "#8c3986"
38+
mindRoles:
39+
- MindRoleXenomorph

0 commit comments

Comments
 (0)