From 710356a1cf467544c0c28ef37be7fbd60c381ab8 Mon Sep 17 00:00:00 2001 From: Angelo Fallaria Date: Sat, 10 Aug 2024 18:24:34 +0800 Subject: [PATCH 1/4] feat(species): rework Vulpkanin species stats --- Content.Client/Flash/FlashSystem.cs | 6 ++++-- .../Atmos/Components/FlammableComponent.cs | 6 ++++++ .../Atmos/EntitySystems/FlammableSystem.cs | 3 +++ Content.Server/Flash/FlashSystem.cs | 2 ++ Content.Shared/Flash/FlashableComponent.cs | 14 +++++++++++++- Content.Shared/Flash/SharedFlashSystem.cs | 2 +- .../Prototypes/DeltaV/Damage/modifier_sets.yml | 3 ++- .../DeltaV/Entities/Mobs/Species/vulpkanin.yml | 8 ++++++++ Resources/Prototypes/Traits/skills.yml | 5 +++++ 9 files changed, 44 insertions(+), 5 deletions(-) diff --git a/Content.Client/Flash/FlashSystem.cs b/Content.Client/Flash/FlashSystem.cs index ad8f8b0b82b..57a91983a96 100644 --- a/Content.Client/Flash/FlashSystem.cs +++ b/Content.Client/Flash/FlashSystem.cs @@ -38,8 +38,10 @@ private void OnFlashableHandleState(EntityUid uid, FlashableComponent component, // Few things here: // 1. If a shorter duration flash is applied then don't do anything // 2. If the client-side time is later than when the flash should've ended don't do anything + var calculatedStateDuration = state.Duration * state.DurationMultiplier; + var currentTime = _gameTiming.CurTime.TotalSeconds; - var newEndTime = state.Time.TotalSeconds + state.Duration; + var newEndTime = state.Time.TotalSeconds + calculatedStateDuration; var currentEndTime = component.LastFlash.TotalSeconds + component.Duration; if (currentEndTime > newEndTime) @@ -53,7 +55,7 @@ private void OnFlashableHandleState(EntityUid uid, FlashableComponent component, } component.LastFlash = state.Time; - component.Duration = state.Duration; + component.Duration = calculatedStateDuration; var overlay = _overlayManager.GetOverlay(); overlay.ReceiveFlash(component.Duration); diff --git a/Content.Server/Atmos/Components/FlammableComponent.cs b/Content.Server/Atmos/Components/FlammableComponent.cs index 679b5510586..1e0ec626235 100644 --- a/Content.Server/Atmos/Components/FlammableComponent.cs +++ b/Content.Server/Atmos/Components/FlammableComponent.cs @@ -61,5 +61,11 @@ public sealed partial class FlammableComponent : Component /// [DataField, ViewVariables(VVAccess.ReadWrite)] public float FirestackFade = -0.1f; + + /// + /// How stronger will firestack increases be? + /// + [DataField, ViewVariables(VVAccess.ReadWrite)] + public float FireStackIncreaseMultiplier = 1f; } } diff --git a/Content.Server/Atmos/EntitySystems/FlammableSystem.cs b/Content.Server/Atmos/EntitySystems/FlammableSystem.cs index 53fcb720766..d34de937a41 100644 --- a/Content.Server/Atmos/EntitySystems/FlammableSystem.cs +++ b/Content.Server/Atmos/EntitySystems/FlammableSystem.cs @@ -274,6 +274,9 @@ public void AdjustFireStacks(EntityUid uid, float relativeFireStacks, FlammableC if (!Resolve(uid, ref flammable)) return; + if (relativeFireStacks > 0) + relativeFireStacks *= flammable.FireStackIncreaseMultiplier; + flammable.FireStacks = MathF.Min(MathF.Max(MinimumFireStacks, flammable.FireStacks + relativeFireStacks), MaximumFireStacks); if (flammable.OnFire && flammable.FireStacks <= 0) diff --git a/Content.Server/Flash/FlashSystem.cs b/Content.Server/Flash/FlashSystem.cs index 013ee37a416..3f1e4e731df 100644 --- a/Content.Server/Flash/FlashSystem.cs +++ b/Content.Server/Flash/FlashSystem.cs @@ -133,6 +133,8 @@ public void Flash(EntityUid target, RaiseLocalEvent(used.Value, ref ev); } + flashDuration *= flashable.DurationMultiplier; + flashable.LastFlash = _timing.CurTime; flashable.Duration = flashDuration / 1000f; // TODO: Make this sane... Dirty(target, flashable); diff --git a/Content.Shared/Flash/FlashableComponent.cs b/Content.Shared/Flash/FlashableComponent.cs index c4f8074ceaf..5f3f214b6bb 100644 --- a/Content.Shared/Flash/FlashableComponent.cs +++ b/Content.Shared/Flash/FlashableComponent.cs @@ -10,6 +10,12 @@ public sealed partial class FlashableComponent : Component public float Duration; public TimeSpan LastFlash; + // + // How much to modify the duration of flashes against this entity. + // + [DataField] + public float DurationMultiplier = 1f; + [DataField] public CollisionGroup CollisionGroup = CollisionGroup.Opaque; @@ -22,10 +28,16 @@ public sealed class FlashableComponentState : ComponentState public float Duration { get; } public TimeSpan Time { get; } - public FlashableComponentState(float duration, TimeSpan time) + // + // How much to modify the duration of flashes against this entity. + // + public float DurationMultiplier { get; } + + public FlashableComponentState(float duration, TimeSpan time, float durationMultiplier) { Duration = duration; Time = time; + DurationMultiplier = durationMultiplier; } } diff --git a/Content.Shared/Flash/SharedFlashSystem.cs b/Content.Shared/Flash/SharedFlashSystem.cs index 16fdbfc2f3e..c4345154892 100644 --- a/Content.Shared/Flash/SharedFlashSystem.cs +++ b/Content.Shared/Flash/SharedFlashSystem.cs @@ -13,7 +13,7 @@ public override void Initialize() private static void OnFlashableGetState(EntityUid uid, FlashableComponent component, ref ComponentGetState args) { - args.State = new FlashableComponentState(component.Duration, component.LastFlash); + args.State = new FlashableComponentState(component.Duration, component.LastFlash, component.DurationMultiplier); } } } diff --git a/Resources/Prototypes/DeltaV/Damage/modifier_sets.yml b/Resources/Prototypes/DeltaV/Damage/modifier_sets.yml index a2b8be8bf6a..b389378eb01 100644 --- a/Resources/Prototypes/DeltaV/Damage/modifier_sets.yml +++ b/Resources/Prototypes/DeltaV/Damage/modifier_sets.yml @@ -1,7 +1,8 @@ - type: damageModifierSet id: Vulpkanin coefficients: - Heat: 1.15 + Heat: 1.30 + Cold: 0.70 - type: damageModifierSet id: Harpy diff --git a/Resources/Prototypes/DeltaV/Entities/Mobs/Species/vulpkanin.yml b/Resources/Prototypes/DeltaV/Entities/Mobs/Species/vulpkanin.yml index 0bcd71fbadb..909aba6632e 100644 --- a/Resources/Prototypes/DeltaV/Entities/Mobs/Species/vulpkanin.yml +++ b/Resources/Prototypes/DeltaV/Entities/Mobs/Species/vulpkanin.yml @@ -8,6 +8,7 @@ - type: HumanoidAppearance species: Vulpkanin - type: Hunger + baseDecayRate: 0.02083333332 # 25% more than default - type: Carriable # Carrying system from nyanotrasen. - type: Inventory # Allows vulps to wear properly shaped helmets speciesId: vulpkanin @@ -105,6 +106,13 @@ understands: - GalacticCommon - Canilunzt + - type: ConsumeDelayModifier + foodDelayMultiplier: 0.5 + drinkDelayMultiplier: 0.5 + - type: Flammable + fireStackIncreaseMultiplier: 1.25 + - type: Flashable + durationMultiplier: 1.5 - type: entity save: false diff --git a/Resources/Prototypes/Traits/skills.yml b/Resources/Prototypes/Traits/skills.yml index 0da622da3c9..09631a653b3 100644 --- a/Resources/Prototypes/Traits/skills.yml +++ b/Resources/Prototypes/Traits/skills.yml @@ -86,6 +86,11 @@ - type: ConsumeDelayModifier foodDelayMultiplier: 0.5 drinkDelayMultiplier: 0.5 + requirements: + - !type:CharacterSpeciesRequirement + inverted: true + species: + - Vulpkanin - type: trait id: ParkourTraining From 5353a6e6c8185a645ab43851023b6b86449833e7 Mon Sep 17 00:00:00 2001 From: Angelo Fallaria Date: Sun, 11 Aug 2024 03:30:46 +0800 Subject: [PATCH 2/4] tweak(species): reduce Vulpkanin increased hunger % to 15% --- Resources/Prototypes/DeltaV/Entities/Mobs/Species/vulpkanin.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Resources/Prototypes/DeltaV/Entities/Mobs/Species/vulpkanin.yml b/Resources/Prototypes/DeltaV/Entities/Mobs/Species/vulpkanin.yml index 909aba6632e..66faa8ac16c 100644 --- a/Resources/Prototypes/DeltaV/Entities/Mobs/Species/vulpkanin.yml +++ b/Resources/Prototypes/DeltaV/Entities/Mobs/Species/vulpkanin.yml @@ -8,7 +8,7 @@ - type: HumanoidAppearance species: Vulpkanin - type: Hunger - baseDecayRate: 0.02083333332 # 25% more than default + baseDecayRate: 0.019166666659 # 15% more than default - type: Carriable # Carrying system from nyanotrasen. - type: Inventory # Allows vulps to wear properly shaped helmets speciesId: vulpkanin From b8c250ff55304d08cc0eeb8a156c3010c78ebac5 Mon Sep 17 00:00:00 2001 From: Angelo Fallaria Date: Sun, 11 Aug 2024 04:51:52 +0800 Subject: [PATCH 3/4] Revert "tweak(species): reduce Vulpkanin increased hunger % to 15%" This reverts commit 5353a6e6c8185a645ab43851023b6b86449833e7. --- Resources/Prototypes/DeltaV/Entities/Mobs/Species/vulpkanin.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Resources/Prototypes/DeltaV/Entities/Mobs/Species/vulpkanin.yml b/Resources/Prototypes/DeltaV/Entities/Mobs/Species/vulpkanin.yml index 66faa8ac16c..909aba6632e 100644 --- a/Resources/Prototypes/DeltaV/Entities/Mobs/Species/vulpkanin.yml +++ b/Resources/Prototypes/DeltaV/Entities/Mobs/Species/vulpkanin.yml @@ -8,7 +8,7 @@ - type: HumanoidAppearance species: Vulpkanin - type: Hunger - baseDecayRate: 0.019166666659 # 15% more than default + baseDecayRate: 0.02083333332 # 25% more than default - type: Carriable # Carrying system from nyanotrasen. - type: Inventory # Allows vulps to wear properly shaped helmets speciesId: vulpkanin From 473b742184f5cb5098edca7735a134c0e7448090 Mon Sep 17 00:00:00 2001 From: VMSolidus Date: Wed, 14 Aug 2024 00:34:15 -0400 Subject: [PATCH 4/4] Update Content.Server/Atmos/Components/FlammableComponent.cs Signed-off-by: VMSolidus --- Content.Server/Atmos/Components/FlammableComponent.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Content.Server/Atmos/Components/FlammableComponent.cs b/Content.Server/Atmos/Components/FlammableComponent.cs index 1e0ec626235..33a163228f1 100644 --- a/Content.Server/Atmos/Components/FlammableComponent.cs +++ b/Content.Server/Atmos/Components/FlammableComponent.cs @@ -65,7 +65,7 @@ public sealed partial class FlammableComponent : Component /// /// How stronger will firestack increases be? /// - [DataField, ViewVariables(VVAccess.ReadWrite)] + [DataField] public float FireStackIncreaseMultiplier = 1f; } }