Skip to content

Commit

Permalink
KeenHearing + looting trashbins and crates + spawn on trashbins and c…
Browse files Browse the repository at this point in the history
…rates
  • Loading branch information
Kiiwwwie committed Jan 25, 2025
1 parent 55beadb commit da9d521
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 8 deletions.
8 changes: 4 additions & 4 deletions Content.Server/SS220/StationEvents/Events/RegalRatRule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,7 @@ protected override void Started(EntityUid uid, RegalRatRuleComponent component,
return;
}

var kingRatLocations = EntityQueryEnumerator<RegalRatSpawnLocationComponent, TransformComponent>();
var mouseLocations = EntityQueryEnumerator<VentCritterSpawnLocationComponent, TransformComponent>();

var kingRatValidLocations = new List<EntityCoordinates>();
var mouseVaidLocations = new List<EntityCoordinates>();

while (mouseLocations.MoveNext(out _, out _, out var transform))
Expand All @@ -42,6 +39,9 @@ protected override void Started(EntityUid uid, RegalRatRuleComponent component,
}
}

var kingRatValidLocations = new List<EntityCoordinates>();
var kingRatLocations = EntityQueryEnumerator<RegalRatSpawnLocationComponent, TransformComponent>();

while (kingRatLocations.MoveNext(out _, out _, out var transform))
{
if (CompOrNull<StationMemberComponent>(transform.GridUid)?.Station == station &&
Expand All @@ -53,7 +53,7 @@ protected override void Started(EntityUid uid, RegalRatRuleComponent component,

if (component.SpecialEntries.Count == 0 || kingRatValidLocations.Count == 0)
{
return;
return;
}

// guaranteed spawn
Expand Down
4 changes: 2 additions & 2 deletions Content.Shared/RatKing/SharedRatKingSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,6 @@ private void OnGetVerb(EntityUid uid, RatKingRummageableComponent component, Get
//SS220 RatKing Changes start here
private void OnRummageAction(Entity<RatKingComponent> entity, ref RatKingRummageActionEvent args)
{

if (args.Handled || !TryComp<RatKingRummageableComponent>(args.Target, out var rumComp) || rumComp.Looted)
return;

Expand Down Expand Up @@ -200,9 +199,10 @@ public virtual void DoCommandCallout(EntityUid uid, RatKingComponent component)

}
}

//SS220
[Serializable, NetSerializable]
public sealed partial class RatKingRummageDoAfterEvent : SimpleDoAfterEvent
{

}
//SS220 changes ending
5 changes: 5 additions & 0 deletions Resources/Prototypes/Catalog/Fills/Crates/service.yml
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,11 @@
parent: CrateTrashCart
components:
- type: StorageFill
#SS220 RatKingUpdate
- type: RatKingRummageable
rummageLoot: RatKingLootTrashCans
- type: RegalRatSpawnLocation
#SS220 Ratking update End
contents:
# Creatures
- id: MobCockroach
Expand Down
6 changes: 5 additions & 1 deletion Resources/Prototypes/Entities/Mobs/NPCs/regalrat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,13 @@
baseWalkSpeed : 3.00
baseSprintSpeed : 5.00
- type: InputMover
#SS220 RatKing tail Pull
#SS220 RatKing additions
- type: Puller
needsHands: false
- type: KeenHearing
visionRadius: 14
highSensitiveVisionRadius: 0
state: half
#SS220 changes end here
- type: MobMover
- type: HTN
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -711,6 +711,11 @@
offset: "0.0,0.03125"
map: ["enum.PaperLabelVisuals.Layer"]
- type: Cart #SS220-Cart-system
#SS220 RatKing update
- type: RatKingRummageable
rummageLoot: RatKingLootTrashCans
- type: RegalRatSpawnLocation
#SS220 changes end here

- type: entity
parent: CrateBaseSecure
Expand Down
9 changes: 8 additions & 1 deletion Resources/Prototypes/SS220/Entities/Mobs/NPCs/regalrat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,20 @@
FoodCheeseSlice: 20
FoodCheese: 5

- type: weightedRandomEntity
id: RatKingLootTrashCans
weights:
RandomSpawner100: 50
MobCockroach: 25
FoodTacoRat: 20
FoodCheese: 5

- type: entity
id: ActionRatKingRummage
name: Rummage
description: Rummage trash to find some cheesy-cheese.
components:
- type: EntityTargetAction
useDelay: 3
icon:
sprite: SS220/Interface/Actions/actions_rat_king.rsi
state: rummage
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@
- type: Construction
graph: TrashCan
node: TrashCan
- type: RatKingRummageable
rummageLoot: RatKingLootTrashCans
- type: RegalRatSpawnLocation

- type: entity
parent: TrashCan
Expand Down

0 comments on commit da9d521

Please sign in to comment.