Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Merge] RatKing Tweaks and Changes #2500

Open
wants to merge 45 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 43 commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
6b842af
Добавление экшна на полутать +ребаланс +лутаем кучи мусора
Kiiwwwie Jan 18, 2025
415d759
Добавлен плейсхолдер текстуры для иконки экшна
Kiiwwwie Jan 19, 2025
4fff63e
Kemran Sprites +Weight changes
Kiiwwwie Jan 19, 2025
7b47ef5
RatKing Crown resprite
Kiiwwwie Jan 19, 2025
4e45105
Equipped crown tweaks
Kiiwwwie Jan 19, 2025
a62f631
Destructable foodboxes + pulling with tail
Kiiwwwie Jan 20, 2025
77d58de
RegalRat personal gamerule
Kiiwwwie Jan 21, 2025
d637a83
Merge branch 'master' into RatKingChangesBranch
Kiiwwwie Jan 21, 2025
ea8f155
Update events.yml
Kiiwwwie Jan 21, 2025
c80d026
Merge branch 'SerbiaStrong-220:master' into RatKingChangesBranch
Kiiwwwie Jan 22, 2025
f973a13
Fixed some stupid stuff
Kiiwwwie Jan 22, 2025
545c53c
Cleaning
Kiiwwwie Jan 22, 2025
4ebdea3
Cleaning
Kiiwwwie Jan 22, 2025
101435c
TrashbinFix
Kiiwwwie Jan 22, 2025
1255c6b
aaaee
Kiiwwwie Jan 24, 2025
cb212f1
Merge branch 'RatKingChangesBranch' of https://github.com/Kiiwwwie/sp…
Kiiwwwie Jan 24, 2025
55beadb
RatKingGameRuleFix
Kiiwwwie Jan 24, 2025
da9d521
KeenHearing + looting trashbins and crates + spawn on trashbins and c…
Kiiwwwie Jan 25, 2025
f0f41cb
Merge branch 'SerbiaStrong-220:master' into RatKingChangesBranch
Kiiwwwie Jan 25, 2025
bef8d26
rummage pop-ups + cursorChange on action
Kiiwwwie Jan 25, 2025
9cfb879
event duplication fix
Kiiwwwie Jan 25, 2025
a6364ca
Update Content.Shared/RatKing/RatKingComponent.cs
Kiiwwwie Jan 25, 2025
155df69
SS220 curse deletion + action moving
Kiiwwwie Jan 25, 2025
a0eeaba
cleaning
Kiiwwwie Jan 25, 2025
14556d6
Update SharedRatKingSystem.cs
Kiiwwwie Jan 25, 2025
19cb78a
Update RatKingSystem.cs
Kiiwwwie Jan 25, 2025
8ac1459
Update RatKingSystem.cs
Kiiwwwie Jan 25, 2025
0416621
crateYAMLFix
Kiiwwwie Jan 26, 2025
d16a0ee
Merge branch 'RatKingChangesBranch' of https://github.com/Kiiwwwie/sp…
Kiiwwwie Jan 26, 2025
26a4551
Update service.yml
Kiiwwwie Jan 26, 2025
453f865
Update regalrat.yml
Kiiwwwie Jan 26, 2025
009ab45
Update regalrat.yml
Kiiwwwie Jan 26, 2025
0dc2b0a
Update crates.yml
Kiiwwwie Jan 26, 2025
84ed9bc
Update pests.yml
Kiiwwwie Jan 26, 2025
fe11545
Renaming fitting meta
Kiiwwwie Jan 27, 2025
75d8c45
Insulated RRat
Kiiwwwie Jan 27, 2025
398e2bd
Commetary addition
Kiiwwwie Jan 27, 2025
8b1cff6
UpPrice Insulated
Kiiwwwie Jan 27, 2025
38e9dc1
YAMLFix
Kiiwwwie Jan 27, 2025
a6e3288
YAMLFix
Kiiwwwie Jan 27, 2025
f497289
Cleanup
stalengd Jan 27, 2025
5b21fa3
Copyright notice
stalengd Jan 27, 2025
d41a773
Usings cleanup
stalengd Jan 27, 2025
5824dfa
Merge branch 'master' into RatKingChangesBranch
Kiiwwwie Jan 28, 2025
cc9d24d
Структурный урон Крысиному Королю
Kiiwwwie Jan 31, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// © SS220, An EULA/CLA with a hosting restriction, full text: https://raw.githubusercontent.com/SerbiaStrong-220/space-station-14/master/CLA.txt
Kiiwwwie marked this conversation as resolved.
Show resolved Hide resolved
using Content.Server.SS220.StationEvents.Events;
using Content.Shared.Storage;

namespace Content.Server.SS220.StationEvents.Components;

[RegisterComponent, Access(typeof(RegalRatRule))]
public sealed partial class RegalRatRuleComponent : Component
{
[DataField("entries")]
public List<EntitySpawnEntry> Entries = new();

[DataField("specialEntries")]
public List<EntitySpawnEntry> SpecialEntries = new();
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// © SS220, An EULA/CLA with a hosting restriction, full text: https://raw.githubusercontent.com/SerbiaStrong-220/space-station-14/master/CLA.txt
namespace Content.Server.SS220.StationEvents.Components;

[RegisterComponent]
public sealed partial class RegalRatSpawnLocationComponent : Component
{

}
71 changes: 71 additions & 0 deletions Content.Server/SS220/StationEvents/Events/RegalRatRule.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
// © SS220, An EULA/CLA with a hosting restriction, full text: https://raw.githubusercontent.com/SerbiaStrong-220/space-station-14/master/CLA.txt
using Content.Server.Station.Components;
using Content.Server.SS220.StationEvents.Components;
using Content.Server.StationEvents.Components;
using Content.Server.StationEvents.Events;
using Content.Shared.GameTicking.Components;
using Content.Shared.Station.Components;
using Content.Shared.Storage;
using Robust.Shared.Map;
using Robust.Shared.Random;

namespace Content.Server.SS220.StationEvents.Events;

public sealed class RegalRatRule : StationEventSystem<RegalRatRuleComponent>
{
protected override void Started(EntityUid uid, RegalRatRuleComponent component, GameRuleComponent gameRule, GameRuleStartedEvent args)
{
base.Started(uid, component, gameRule, args);

if (!TryGetRandomStation(out var station))
{
return;
}

var mouseLocations = EntityQueryEnumerator<VentCritterSpawnLocationComponent, TransformComponent>();
var mouseVaidLocations = new List<EntityCoordinates>();

while (mouseLocations.MoveNext(out _, out _, out var transform))
{
if (CompOrNull<StationMemberComponent>(transform.GridUid)?.Station == station &&
HasComp<BecomesStationComponent>(transform.GridUid))
{
mouseVaidLocations.Add(transform.Coordinates);
foreach (var spawn in EntitySpawnCollection.GetSpawns(component.Entries, RobustRandom))
{
Spawn(spawn, transform.Coordinates);
}
}
}

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 &&
HasComp<BecomesStationComponent>(transform.GridUid))
{
kingRatValidLocations.Add(transform.Coordinates);
}
}

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

// guaranteed spawn
var specialEntry = RobustRandom.Pick(component.SpecialEntries);
var specialSpawn = RobustRandom.Pick(kingRatValidLocations);
Spawn(specialEntry.PrototypeId, specialSpawn);

foreach (var location in kingRatValidLocations)
{
foreach (var spawn in EntitySpawnCollection.GetSpawns(component.SpecialEntries, RobustRandom))
{
Spawn(spawn, location);
}
}
}
}
8 changes: 8 additions & 0 deletions Content.Shared/RatKing/RatKingComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,14 @@ public sealed partial class RatKingComponent : Component
{ RatKingOrderType.CheeseEm, "RatKingCommandCheeseEm" },
{ RatKingOrderType.Loose, "RatKingCommandLoose" }
};

// SS220 RatKing Tweaks and Changes begin
[ViewVariables]
public EntityUid? ActionRummageEntity;

[DataField("actionRummage")]
public EntProtoId ActionRummage = "ActionRatKingRummage";
// SS220 RatKing Tweaks and Changes end
}

[Serializable, NetSerializable]
Expand Down
37 changes: 37 additions & 0 deletions Content.Shared/RatKing/SharedRatKingSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@
using Robust.Shared.Prototypes;
using Robust.Shared.Random;
using Robust.Shared.Serialization;
//SS220 RatKing Tweaks and Changes start
using Content.Shared.Popups;
using Content.Shared.SS220.RatKing;
//SS220 RatKing Tweaks and Changes end

namespace Content.Shared.RatKing;

Expand All @@ -24,6 +28,7 @@ public abstract class SharedRatKingSystem : EntitySystem
[Dependency] private readonly SharedAudioSystem _audio = default!;
[Dependency] private readonly SharedDoAfterSystem _doAfter = default!;
[Dependency] private readonly TagSystem _tagSystem = default!;
[Dependency] private readonly SharedPopupSystem _popup = default!; //SS220 RatKing tweaks and changes

/// <inheritdoc/>
public override void Initialize()
Expand All @@ -37,6 +42,7 @@ public override void Initialize()

SubscribeLocalEvent<RatKingRummageableComponent, GetVerbsEvent<AlternativeVerb>>(OnGetVerb);
SubscribeLocalEvent<RatKingRummageableComponent, RatKingRummageDoAfterEvent>(OnDoAfterComplete);
SubscribeLocalEvent<RatKingComponent, RatKingRummageActionEvent>(OnRummageAction); //SS220 RatKing Tweaks and Changes
}

private void OnStartup(EntityUid uid, RatKingComponent component, ComponentStartup args)
Expand All @@ -50,6 +56,7 @@ private void OnStartup(EntityUid uid, RatKingComponent component, ComponentStart
_action.AddAction(uid, ref component.ActionOrderFollowEntity, component.ActionOrderFollow, component: comp);
_action.AddAction(uid, ref component.ActionOrderCheeseEmEntity, component.ActionOrderCheeseEm, component: comp);
_action.AddAction(uid, ref component.ActionOrderLooseEntity, component.ActionOrderLoose, component: comp);
_action.AddAction(uid, ref component.ActionRummageEntity, component.ActionRummage, component: comp); //SS220 RatKing Tweaks and Changes

UpdateActions(uid, component);
}
Expand All @@ -71,6 +78,7 @@ private void OnShutdown(EntityUid uid, RatKingComponent component, ComponentShut
_action.RemoveAction(uid, component.ActionOrderFollowEntity, comp);
_action.RemoveAction(uid, component.ActionOrderCheeseEmEntity, comp);
_action.RemoveAction(uid, component.ActionOrderLooseEntity, comp);
_action.RemoveAction(uid, component.ActionRummageEntity, comp); //SS220 RatKing Tweaks and Changes
}

private void OnOrderAction(EntityUid uid, RatKingComponent component, RatKingOrderActionEvent args)
Expand Down Expand Up @@ -143,6 +151,35 @@ private void OnGetVerb(EntityUid uid, RatKingRummageableComponent component, Get
});
}

//SS220 RatKing Tweaks and Changes start
private void OnRummageAction(Entity<RatKingComponent> entity, ref RatKingRummageActionEvent args)
{
if (args.Handled || !TryComp<RatKingRummageableComponent>(args.Target, out var rumComp))
{
_popup.PopupPredicted(Loc.GetString("ratking-rummage-failure"), args.Target, entity, PopupType.Small);
return;
}

if (rumComp.Looted)
{
_popup.PopupPredicted(Loc.GetString("ratking-rummage-looted-failure"), args.Target, entity, PopupType.Small);
return;
}

var doAfter = new DoAfterArgs(EntityManager, entity, rumComp.RummageDuration,
new RatKingRummageDoAfterEvent(), args.Target, args.Target)
{
BlockDuplicate = true,
BreakOnDamage = true,
BreakOnMove = true,
DistanceThreshold = 2f
};
_popup.PopupPredicted(Loc.GetString("ratking-rummage-success"), args.Target, entity, PopupType.Small);
_doAfter.TryStartDoAfter(doAfter);
args.Handled = true;
}
//SS220 RatKing Tweaks and Changes end

private void OnDoAfterComplete(EntityUid uid, RatKingRummageableComponent component, RatKingRummageDoAfterEvent args)
{
if (args.Cancelled || component.Looted)
Expand Down
7 changes: 7 additions & 0 deletions Content.Shared/SS220/RatKing/RatKingActions.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// © SS220, An EULA/CLA with a hosting restriction, full text: https://raw.githubusercontent.com/SerbiaStrong-220/space-station-14/master/CLA.txt
using Content.Shared.Actions;

namespace Content.Shared.SS220.RatKing;
public sealed partial class RatKingRummageActionEvent : EntityTargetActionEvent
{
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
ent-ActionRatKingRummage = Перерыть мусор
.desc = Покопайтесь в мусоре. Вдруг найдёте сыр!

ratking-rummage-failure = Здесь нет мусора!

ratking-rummage-looted-failure = Вы уже пробовали искать здесь!

ratking-rummage-success = Вы копаетесь в мусоре!
19 changes: 19 additions & 0 deletions Resources/Prototypes/Catalog/Fills/Boxes/general.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,25 @@
- type: Tag
tags:
- BoxCardboard
#SS220 RatKing damageable foodboxes tweaks and Changes start
- type: Damageable
damageContainer: StructuralInorganic
- type: Destructible
thresholds:
- trigger:
!type:DamageTrigger
damage: 50
behaviors:
- !type:DoActsBehavior
acts: [ "Destruction" ]
- trigger:
!type:DamageTrigger
damage: 15
behaviors:
- !type:EmptyAllContainersBehaviour
- !type:DoActsBehavior
acts: [ "Destruction" ]
#SS220 RatKing damageable foodboxes tweaks and Changes end

- type: entity
name: mousetrap box
Expand Down
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 @@ -279,6 +279,11 @@
suffix: Filled
parent: CrateTrashCart
components:
#SS220 RatKing tweaks and changes start here
- type: RatKingRummageable
rummageLoot: RatKingLootTrashCans
- type: RegalRatSpawnLocation
#SS220 Ratking tweaks and changes end here
- type: StorageFill
contents:
# Creatures
Expand Down
4 changes: 2 additions & 2 deletions Resources/Prototypes/Entities/Clothing/Head/misc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -165,9 +165,9 @@
description: It smells like dead rat. Lets you speak like one!
components:
- type: Sprite
sprite: Clothing/Head/Misc/fancycrown.rsi
sprite: SS220/Clothing/Head/Misc/fancycrown.rsi #SS220 resprited
- type: Clothing
sprite: Clothing/Head/Misc/fancycrown.rsi
sprite: SS220/Clothing/Head/Misc/fancycrown.rsi #SS220 resprited
- type: MobPrice
price: 3000
- type: AddAccentClothing
Expand Down
29 changes: 24 additions & 5 deletions Resources/Prototypes/Entities/Mobs/NPCs/regalrat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,17 @@
baseWalkSpeed : 3.00
baseSprintSpeed : 5.00
- type: InputMover
#SS220 RatKing tweaks and changes update start
- type: Puller
needsHands: false
- type: KeenHearing
visionRadius: 14
highSensitiveVisionRadius: 0
state: half
- type: RandomInsulation
list:
- 0.5
#SS220 RatKing tweaks and changes update end
- type: MobMover
- type: HTN
rootTask:
Expand Down Expand Up @@ -208,6 +219,7 @@
shader: unshaded
- type: Bloodstream
bloodMaxVolume: 40 #SS220 RatBlood fix
- type: Insulated #SS220 RatKing Tweaks and changes

- type: SpriteMovement
movementLayers:
Expand Down Expand Up @@ -305,9 +317,16 @@
- type: weightedRandomEntity
id: RatKingLoot
weights:
RandomSpawner100: 66 #garbage
FoodCheese: 28 #food
IngotGold1: 5 #loot
# SS220 RatKing tweaks and changes rummage weight changes start
RandomSpawner100: 40
FoodCheeseSlice: 40
FoodCheese: 15
FoodCakeCheese: 5
# Official weights
#RandomSpawner100: 66 #garbage
#FoodCheese: 28 #food
#IngotGold1: 5 #loot
# SS220 RatKing tweaks and changes rummage weight changes end

- type: entity
id: ActionRatKingRaiseArmy
Expand All @@ -317,7 +336,7 @@
- type: InstantAction
useDelay: 4
icon:
sprite: Interface/Actions/actions_rat_king.rsi
sprite: SS220/Interface/Actions/actions_rat_king.rsi #SS220 resprited
state: ratKingArmy
event: !type:RatKingRaiseArmyActionEvent

Expand All @@ -329,7 +348,7 @@
- type: InstantAction
useDelay: 6
icon:
sprite: Interface/Actions/actions_rat_king.rsi
sprite: SS220/Interface/Actions/actions_rat_king.rsi #SS220 resprited
state: ratKingDomain
event: !type:RatKingDomainActionEvent

Expand Down
Loading
Loading