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

Minor fixes wave 2 #515

Merged
merged 7 commits into from
Jan 31, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 2 additions & 1 deletion Content.Server/Carrying/CarryingSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,8 @@ private void OnDoAfter(EntityUid uid, CarriableComponent component, CarryDoAfter
Carry(args.Args.User, uid);
args.Handled = true;
}
private void StartCarryDoAfter(EntityUid carrier, EntityUid carried, CarriableComponent component)

public void StartCarryDoAfter(EntityUid carrier, EntityUid carried, CarriableComponent component)
{
if (!TryComp<PhysicsComponent>(carrier, out var carrierPhysics)
|| !TryComp<PhysicsComponent>(carried, out var carriedPhysics)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,13 @@ private void AddInsertAltVerb(EntityUid uid, PseudoItemComponent component, GetV

protected override void OnGettingPickedUpAttempt(EntityUid uid, PseudoItemComponent component, GettingPickedUpAttemptEvent args)
{
// Floof - changed this a bit to actually start a do-after
// Try to pick the entity up instead first
if (args.User != args.Item && _carrying.TryCarry(args.User, uid))
if (args.User != args.Item
&& TryComp<CarriableComponent>(uid, out var carrible)
&& _carrying.CanCarry(args.User, uid, carrible))
{
_carrying.StartCarryDoAfter(args.User, uid, carrible);
args.Cancel();
return;
}
Expand Down
14 changes: 13 additions & 1 deletion Content.Server/VendingMachines/VendingMachineSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
using Content.Shared.Emag.Systems;
using Content.Shared.Emp;
using Content.Shared.Popups;
using Content.Shared.Repairable;
using Content.Shared.Throwing;
using Content.Shared.UserInterface;
using Content.Shared.VendingMachines;
Expand Down Expand Up @@ -46,6 +47,7 @@ public override void Initialize()
SubscribeLocalEvent<VendingMachineComponent, MapInitEvent>(OnComponentMapInit);
SubscribeLocalEvent<VendingMachineComponent, PowerChangedEvent>(OnPowerChanged);
SubscribeLocalEvent<VendingMachineComponent, BreakageEventArgs>(OnBreak);
SubscribeLocalEvent<VendingMachineComponent, SharedRepairableSystem.RepairFinishedEvent>(OnRepaired); // Floofstation
SubscribeLocalEvent<VendingMachineComponent, GotEmaggedEvent>(OnEmagged);
SubscribeLocalEvent<VendingMachineComponent, DamageChangedEvent>(OnDamage);
SubscribeLocalEvent<VendingMachineComponent, PriceCalculationEvent>(OnVendingPrice);
Expand Down Expand Up @@ -88,7 +90,6 @@ private void OnVendingPrice(EntityUid uid, VendingMachineComponent component, re

args.Price += price;
}

protected override void OnComponentInit(EntityUid uid, VendingMachineComponent component, ComponentInit args)
{
base.OnComponentInit(uid, component, args);
Expand Down Expand Up @@ -139,6 +140,17 @@ private void OnBreak(EntityUid uid, VendingMachineComponent vendComponent, Break
TryUpdateVisualState(uid, vendComponent);
}

// Floofstation
private void OnRepaired(EntityUid uid, VendingMachineComponent component, SharedRepairableSystem.RepairFinishedEvent args)
{
if (args.Cancelled)
return;

// TODO it is not actually safe to assume that the repair repaired enough damage
component.Broken = false;
TryUpdateVisualState(uid, component);
}

private void OnEmagged(EntityUid uid, VendingMachineComponent component, ref GotEmaggedEvent args)
{
// only emag if there are emag-only items
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using Content.Shared.Bed.Sleep;
using Content.Shared.DoAfter;
using Content.Shared.Hands;
using Content.Shared.Hands.EntitySystems;
using Content.Shared.IdentityManagement;
using Content.Shared.Interaction.Events;
using Content.Shared.Item;
Expand All @@ -24,6 +25,8 @@ public abstract partial class SharedPseudoItemSystem : EntitySystem
[Dependency] private readonly TagSystem _tag = default!;
[Dependency] private readonly SharedPopupSystem _popupSystem = default!;
[Dependency] private readonly SharedActionsSystem _actions = default!;
[Dependency] private readonly SharedContainerSystem _container = default!;
[Dependency] private readonly SharedHandsSystem _hands = default!;

[ValidatePrototypeId<TagPrototype>]
private const string PreventTag = "PreventLabel";
Expand Down Expand Up @@ -117,17 +120,35 @@ private void OnEntRemoved(EntityUid uid, PseudoItemComponent component, EntGotRe
protected virtual void OnGettingPickedUpAttempt(EntityUid uid, PseudoItemComponent component,
GettingPickedUpAttemptEvent args)
{
if (args.User == args.Item)
return;

Transform(uid).AttachToGridOrMap();
args.Cancel();
// Floof - this is a terrible idea. This triggers every time ANY system checks if a pseudo-item can be picked up.
// WHY DID YOU DO THAT, NYANOTRASEN???

// if (args.User == args.Item)
// return;
//
// Transform(uid).AttachToGridOrMap();
// args.Cancel();
}

private void OnDropAttempt(EntityUid uid, PseudoItemComponent component, DropAttemptEvent args)
{
if (component.Active)
args.Cancel();
if (!component.Active)
return;

// Floof - we try to get the containing container and try to drop it into it
// If possible, we do it, since a bagged cat probably can put things back into the bag just like they can pick them up.
string? failReason = null;
if (_hands.GetActiveItem(uid) is { Valid: true, } droppedItem
&& _container.TryGetContainingContainer(Transform(uid).ParentUid, uid, out var pseudoItemContainer)
&& TryComp<StorageComponent>(pseudoItemContainer.Owner, out var targetStorage)
&& _storage.CanInsert(pseudoItemContainer.Owner, droppedItem, out failReason, targetStorage, ignoreStacks: true)
)
_storage.Insert(pseudoItemContainer.Owner, droppedItem, out _, uid, targetStorage, stackAutomatically: false);

if (failReason != null)
_popupSystem.PopupEntity(Loc.GetString(failReason), uid, uid);

args.Cancel();
}

private void OnInsertAttempt(EntityUid uid, PseudoItemComponent component,
Expand All @@ -137,13 +158,15 @@ private void OnInsertAttempt(EntityUid uid, PseudoItemComponent component,
return;
// This hopefully shouldn't trigger, but this is a failsafe just in case so we dont bluespace them cats
args.Cancel();
Transform(uid).AttachToGridOrMap(); // We do it here instead, so the item is only re-parented AFTER someone tries to insert it somewhere, e.g. a hand.
}

// Prevents moving within the bag :)
private void OnInteractAttempt(EntityUid uid, PseudoItemComponent component, InteractionAttemptEvent args)
{
if (args.Uid == args.Target && component.Active)
args.Cancel();
// Floof - why the fuck.
// if (args.Uid == args.Target && component.Active)
// args.Cancel();
}

private void OnDoAfter(EntityUid uid, PseudoItemComponent component, DoAfterEvent args)
Expand Down
3 changes: 2 additions & 1 deletion Content.Shared/Repairable/SharedRepairableSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ namespace Content.Shared.Repairable;

public abstract partial class SharedRepairableSystem : EntitySystem
{
// Floof - made public because WHY THE FUCK WAS THIS PRIVATE?!
[Serializable, NetSerializable]
protected sealed partial class RepairFinishedEvent : SimpleDoAfterEvent
public sealed partial class RepairFinishedEvent : SimpleDoAfterEvent
{
}
}
Expand Down
1 change: 1 addition & 0 deletions Resources/Prototypes/Actions/types.yml
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,7 @@
itemIconStyle: NoItem
useDelay: 1 # emote spam
event: !type:ToggleActionEvent
checkCanInteract: false # obviously you can wag while cuffed, duh.

- type: entity
id: ActionFabricateLollipop
Expand Down
60 changes: 30 additions & 30 deletions Resources/Prototypes/DeltaV/GameRules/events.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,39 +26,39 @@
prob: 0.002
- id: MobXenoRavager
prob: 0.002
- id: MobXenochargercrusher
- id: MobXenoChargerCrusher
prob: 0.002
- id: MobXenodancerpraetorian
- id: MobXenoDancerPraetorian
prob: 0.002
- id: MobXenodefender
- id: MobXenoDefender
prob: 0.002
- id: MobXenosentinel
- id: MobXenoSentinel
prob: 0.002
- id: MobXenohivelord
- id: MobXenoHivelord
prob: 0.001
- id: MobXenoCarrier
prob: 0.002
- id: MobXenobloodylarva
- id: MobXenoBloodyLarva
prob: 0.003
- id: MobXenoparasite
- id: MobXenoParasite
prob: 0.003
- id: MobXenolurker
- id: MobXenoLurker
prob: 0.002
- id: MobXenowarrior
- id: MobXenoWarrior
prob: 0.002
- id: MobXenoacidrunner
- id: MobXenoAcidRunner
prob: 0.002
- id: MobXenoacidrunnerprimed
- id: MobXenoAcidRunnerPrimed
prob: 0.002
- id: MobXenolarva
- id: MobXenoLarva
prob: 0.003
- id: MobXenoboiler
- id: MobXenoBoiler
prob: 0.002
- id: MobXenoboxerwarrior
- id: MobXenoBoxerWarrior
prob: 0.002
- id: MobXenoCarrier
prob: 0.002
- id: MobXenocrusher
- id: MobXenoCrusher
prob: 0.002
- id: MobXenoQueen
prob: 0.001
Expand Down Expand Up @@ -94,39 +94,39 @@
prob: 0.001
- id: MobXenoRavager
prob: 0.001
- id: MobXenochargercrusher
- id: MobXenoChargerCrusher
prob: 0.001
- id: MobXenodancerpraetorian
- id: MobXenoDancerPraetorian
prob: 0.001
- id: MobXenodefender
- id: MobXenoDefender
prob: 0.001
- id: MobXenosentinel
- id: MobXenoSentinel
prob: 0.001
- id: MobXenohivelord
- id: MobXenoHivelord
prob: 0.001
- id: MobXenoCarrier
prob: 0.001
- id: MobXenobloodylarva
- id: MobXenoBloodyLarva
prob: 0.002
- id: MobXenoparasite
- id: MobXenoParasite
prob: 0.002
- id: MobXenolurker
- id: MobXenoLurker
prob: 0.001
- id: MobXenowarrior
- id: MobXenoWarrior
prob: 0.001
- id: MobXenoacidrunner
- id: MobXenoAcidRunner
prob: 0.001
- id: MobXenoacidrunnerprimed
- id: MobXenoAcidRunnerPrimed
prob: 0.001
- id: MobXenolarva
- id: MobXenoLarva
prob: 0.002
- id: MobXenoboiler
- id: MobXenoBoiler
prob: 0.001
- id: MobXenoboxerwarrior
- id: MobXenoBoxerWarrior
prob: 0.001
- id: MobXenoCarrier
prob: 0.001
- id: MobXenocrusher
- id: MobXenoCrusher
prob: 0.001
- id: MobXenoQueen
prob: 0.001
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,12 @@
- type: Item
sprite: Objects/Weapons/Guns/Basic/kinetic_accelerator.rsi
size: Normal
- type: GunWieldBonus
minAngle: -43
maxAngle: -43
- type: Wieldable
- type: Gun
fireRate: 0.5
selectedMode: SemiAuto
angleDecay: 45
minAngle: 44
maxAngle: 45
angleDecay: 3 # If you wait ~7 seconds between shots, you can actually land more or less accurate shots (with a 10 degree innacuracy)
minAngle: 10
maxAngle: 30
availableModes:
- SemiAuto
soundGunshot:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,6 @@
node: start #Frontier
deconstructionTarget: null #Frontier
- type: Wieldable # Frontier
- type: GunWieldBonus
minAngle: -9
maxAngle: -28 # 1..2 degrees when wielded
Loading
Loading