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

Harpy Rebalance & Content Update 2 #499

Merged
merged 6 commits into from
Dec 6, 2023
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
25 changes: 25 additions & 0 deletions Content.Server/DeltaV/Harpy/HarpySingerSystem.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
using Content.Server.Instruments;
using Content.Server.Speech.Components;
using Content.Server.UserInterface;
using Content.Shared.Instruments;
using Content.Shared.Instruments.UI;
using Content.Shared.ActionBlocker;
using Content.Shared.Damage;
using Content.Shared.Damage.ForceSay;
Expand All @@ -17,6 +19,7 @@
using Robust.Server.GameObjects;
using Robust.Shared.Player;
using Robust.Shared.Prototypes;
using Content.Shared.DeltaV.Harpy.Components;

namespace Content.Server.DeltaV.Harpy
{
Expand All @@ -27,6 +30,7 @@ public sealed class HarpySingerSystem : EntitySystem
[Dependency] private readonly InventorySystem _inventorySystem = default!;
[Dependency] private readonly ActionBlockerSystem _blocker = default!;
[Dependency] private readonly IPrototypeManager _prototype = default!;
[Dependency] private readonly SharedAppearanceSystem _appearance = default!;

public override void Initialize()
{
Expand All @@ -40,6 +44,8 @@ public override void Initialize()
SubscribeLocalEvent<InstrumentComponent, SleepStateChangedEvent>(OnSleep);
SubscribeLocalEvent<InstrumentComponent, StatusEffectAddedEvent>(OnStatusEffect);
SubscribeLocalEvent<InstrumentComponent, DamageChangedEvent>(OnDamageChanged);
SubscribeLocalEvent<HarpySingerComponent, BoundUIClosedEvent>(OnBoundUIClosed);
SubscribeLocalEvent<HarpySingerComponent, BoundUIOpenedEvent>(OnBoundUIOpened);

// This is intended to intercept the UI event and stop the MIDI UI from opening if the
// singer is unable to sing. Thus it needs to run before the ActivatableUISystem.
Expand Down Expand Up @@ -153,5 +159,24 @@ private void OnInstrumentOpen(EntityUid uid, HarpySingerComponent component, Ope
if (args.Handled)
_popupSystem.PopupEntity(Loc.GetString("no-sing-while-no-speak"), uid, uid, PopupType.Medium);
}

private void OnBoundUIClosed(EntityUid uid, HarpySingerComponent component, BoundUIClosedEvent args)
{
if (args.UiKey is not InstrumentUiKey)
return;

TryComp(uid, out AppearanceComponent? appearance);
_appearance.SetData(uid, HarpyVisualLayers.Singing, SingingVisualLayer.False, appearance);
}

private void OnBoundUIOpened(EntityUid uid, HarpySingerComponent component, BoundUIOpenedEvent args)
{
if (args.UiKey is not InstrumentUiKey)
return;

TryComp(uid, out AppearanceComponent? appearance);
_appearance.SetData(uid, HarpyVisualLayers.Singing, SingingVisualLayer.True, appearance);

}
}
}
17 changes: 17 additions & 0 deletions Content.Shared/DeltaV/Harpy/Components/HarpyVisualSystem.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
using Robust.Shared.Serialization;

namespace Content.Shared.DeltaV.Harpy.Components
{
[Serializable, NetSerializable]
public enum HarpyVisualLayers
{
Singing,
}

[Serializable, NetSerializable]
public enum SingingVisualLayer
{
True,
False,
}
}
34 changes: 34 additions & 0 deletions Resources/Prototypes/DeltaV/Body/Organs/harpy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
- type: entity
id: OrganHarpyLungs
parent: BaseHumanOrgan
name: lungs
description: "An advanced pair of avian lungs. Filters oxygen by way of moving air constantly through air sacs."
components:
- type: Sprite
layers:
- state: lung-l
- state: lung-r
- type: Lung
- type: Metabolizer
updateFrequency: 2.0
removeEmpty: true
solutionOnBody: false
solution: "Lung"
metabolizerTypes: [ Human ]
groups:
- id: Gas
rateModifier: 100.0
- type: SolutionContainerManager
solutions:
organ:
reagents:
- ReagentId: Nutriment
Quantity: 10
Lung:
maxVol: 100.0
canReact: false
food:
maxVol: 5
reagents:
- ReagentId: UncookedAnimalProteins
Quantity: 5
2 changes: 1 addition & 1 deletion Resources/Prototypes/DeltaV/Body/Prototypes/harpy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
- right leg
organs:
heart: OrganHumanHeart
lungs: OrganHumanLungs
lungs: OrganHarpyLungs
stomach: OrganHumanStomach
liver: OrganHumanLiver
kidneys: OrganHumanKidneys
Expand Down
6 changes: 0 additions & 6 deletions Resources/Prototypes/DeltaV/Entities/Mobs/Player/harpy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,6 @@
- type: MobMover
- type: InputMover
- type: Respirator
damage:
types:
Asphyxiation: 1.15
damageRecovery:
types:
Asphyxiation: -1.15
- type: Alerts
- type: Actions
- type: Eye
Expand Down
25 changes: 18 additions & 7 deletions Resources/Prototypes/DeltaV/Entities/Mobs/Species/harpy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,16 +76,19 @@
- map: [ "enum.HumanoidVisualLayers.HeadTop" ]
- map: [ "mask" ]
- map: [ "head" ]

- map: [ "singingLayer" ]
sprite: DeltaV/Effects/harpysinger.rsi
state: singing_music_notes
visible: false
- type: HumanoidAppearance
species: Harpy
- type: Fixtures
fixtures: # TODO: This needs a second fixture just for mob collisions.
fix1:
shape:
!type:PhysShapeCircle
radius: 0.28
density: 140
radius: 0.32
density: 90
restitution: 0.0
mask:
- MobMask
Expand All @@ -97,20 +100,28 @@
damageModifierSet: Harpy
- type: MeleeWeapon
soundHit:
collection: Punch
collection: AlienClaw
animation: WeaponArcClaw
damage:
types:
Blunt: 1
Slash: 5
Piercing: 5
VMSolidus marked this conversation as resolved.
Show resolved Hide resolved
- type: Speech
speechSounds: Alto
- type: Vocal
sounds:
Male: SoundsHarpy
Female: SoundsHarpy
Unsexed: SoundsHarpy

- type: GenericVisualizer
visuals:
enum.HarpyVisualLayers.Singing:
singingLayer:
False: {visible: false}
True: {visible: true}
- type: MovementSpeedModifier
baseWalkSpeed: 2.5
baseSprintSpeed: 5.0

- type: entity
save: false
name: Urist McHands
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@
animation: WeaponArcClaw
damage:
types:
Blunt: 1
Slash: 5
Slash: 4
Piercing: 1
# - type: DiseaseCarrier
# naturalImmunities:
# - OwOnavirus
Expand Down
22 changes: 22 additions & 0 deletions Resources/Textures/DeltaV/Effects/harpysinger.rsi/meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"version": 1,
"copyright": "Made by @ps3moira",
"license": "CC-BY-SA-3.0",
"size": {
"x": 32,
"y": 32
},
"states": [
{
"name": "singing_music_notes",
"directions": 1,
"delays": [
[
0.3,
0.3,
0.3
]
]
}
]
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading