Skip to content

Commit

Permalink
Dungeons Mobs Fixup (#1152)
Browse files Browse the repository at this point in the history
* Fixing

* Update implanters.yml
  • Loading branch information
dvir001 authored Mar 26, 2024
1 parent 8d123c8 commit 813dae8
Show file tree
Hide file tree
Showing 9 changed files with 95 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,11 @@ public sealed partial class GibOnTriggerComponent : Component
[ViewVariables(VVAccess.ReadWrite)]
[DataField("deleteItems")]
public bool DeleteItems = false;

/// <summary>
/// Frontier - Should gibbing also delete the owners organs?
/// </summary>
[ViewVariables(VVAccess.ReadWrite)]
[DataField("deleteOrgans")]
public bool DeleteOrgans = false;
}
14 changes: 14 additions & 0 deletions Content.Server/Explosion/EntitySystems/TriggerSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
using Robust.Shared.Random;
using Robust.Shared.Player;
using Content.Shared.Coordinates;
using Content.Shared.Body.Components; // Frontier - Gib organs

namespace Content.Server.Explosion.EntitySystems
{
Expand Down Expand Up @@ -175,6 +176,19 @@ private void HandleGibTrigger(EntityUid uid, GibOnTriggerComponent component, Tr
Del(item);
}
}

if (component.DeleteOrgans) // Frontier - Gib organs
{
if (TryComp<BodyComponent>(xform.ParentUid, out var body))
{
var organs = _body.GetBodyOrganComponents<TransformComponent>(xform.ParentUid, body);
foreach (var (_, organ) in organs)
{
Del(organ.Owner);
}
}
} // Frontier

_body.GibBody(xform.ParentUid, true);
args.Handled = true;
}
Expand Down
13 changes: 13 additions & 0 deletions Content.Shared/Bed/Sleep/AutoWakeUpComponent.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
using Content.Shared.FixedPoint;
using Robust.Shared.GameStates;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;

namespace Content.Shared.Bed.Sleep;

/// <summary>
/// Frontier - Added to AI to allow auto waking up after 5 secs.
/// </summary>
[NetworkedComponent, RegisterComponent]
public sealed partial class AutoWakeUpComponent : Component
{
}
11 changes: 11 additions & 0 deletions Content.Shared/Bed/Sleep/SharedSleepingSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
using Robust.Shared.Network;
using Robust.Shared.Prototypes;
using Robust.Shared.Timing;
using System.Threading.Tasks; // Frontier

namespace Content.Server.Bed.Sleep
{
Expand Down Expand Up @@ -38,6 +39,16 @@ private void OnMapInit(EntityUid uid, SleepingComponent component, MapInitEvent

// TODO remove hardcoded time.
_actionsSystem.SetCooldown(component.WakeAction, _gameTiming.CurTime, _gameTiming.CurTime + TimeSpan.FromSeconds(15));

if (TryComp<AutoWakeUpComponent>(uid, out var autoWakeUp)) // Frontier
{
Task.Run(async () =>
{
await Task.Delay(TimeSpan.FromSeconds(5));
ev = new SleepStateChangedEvent(false);
RaiseLocalEvent(uid, ev);
});
} // Frontier
}

private void OnShutdown(EntityUid uid, SleepingComponent component, ComponentShutdown args)
Expand Down
7 changes: 7 additions & 0 deletions Content.Shared/Buckle/Components/BuckleComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,13 @@ public sealed partial class BuckleComponent : Component
/// Used for client rendering
/// </summary>
[ViewVariables] public int? OriginalDrawDepth;

/// <summary>
/// Frontier - True if the entity is blocked from buckling.
/// </summary>
[DataField]
[ViewVariables(VVAccess.ReadWrite)]
public bool Disable;
}

[ByRefEvent]
Expand Down
3 changes: 3 additions & 0 deletions Content.Shared/Buckle/SharedBuckleSystem.Buckle.cs
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,9 @@ private bool CanBuckle(
if (attemptEvent.Cancelled)
return false;

if (buckleComp.Disable) // Frontier
return false; // Frontier

return true;
}

Expand Down
11 changes: 5 additions & 6 deletions Resources/Prototypes/_NF/Entities/Mobs/NPCs/syndicatemob.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@
minimumWait: 120 # 1 * 2
maximumWait: 240 # 2 * 60
NextAdvertisementTime: 0
- type: Buckle
disable: true
- type: AutoWakeUp

# Humans
- type: entity
Expand Down Expand Up @@ -164,7 +167,7 @@
- SyndicateNavalGrenadierGear
- type: AutoImplant
implants:
- DeathAcidifierImplant
- DeathAcidifierImplantNF
- type: RechargeBasicEntityAmmo
rechargeCooldown: 5
rechargeSound:
Expand Down Expand Up @@ -236,16 +239,12 @@
- type: Loadout
prototypes:
- SyndicateNavalCommanderGear
- type: MobThresholds
thresholds:
0: Alive
140: Dead # No crit state to ensure that mob explodes ASAP
- type: Stamina
critThreshold: 500 # Extra hard to incapacitate and loot
- type: AutoImplant
implants:
- DeathRattleImplant
- DeathAcidifierImplant
- DeathAcidifierImplantNF
- type: RechargeBasicEntityAmmo
rechargeCooldown: 0.5
rechargeSound:
Expand Down
9 changes: 9 additions & 0 deletions Resources/Prototypes/_NF/Entities/Objects/Misc/implanters.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,12 @@
components:
- type: Implanter
implant: MedicalTrackingImplant

- type: entity
id: DeathAcidifierImplanterNF
name: death acidifier implanter
suffix: All
parent: BaseImplantOnlyImplanterSyndi
components:
- type: Implanter
implant: DeathAcidifierImplantNF
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,29 @@
- Dead
- type: Rattle
radioChannel: "Medical"

- type: entity
parent: BaseSubdermalImplant
id: DeathAcidifierImplantNF
name: death-acidifier implant
description: This implant melts the user and their equipment upon death.
noSpawn: true
components:
- type: SubdermalImplant
permanent: true
# implantAction: ActionActivateDeathAcidifier
- type: TriggerOnMobstateChange
mobState:
- Dead
- Critical
# - type: TriggerImplantAction
- type: GibOnTrigger
deleteItems: true
deleteOrgans: true
- type: SpawnOnTrigger
proto: Acidifier
- type: Tag
tags:
- SubdermalImplant
- HideContextMenu
- DeathAcidifier

0 comments on commit 813dae8

Please sign in to comment.