Skip to content

Commit

Permalink
Vulpkanin Rework: Number Changes (Simple-Station#713)
Browse files Browse the repository at this point in the history
# Description

Per Simple-Station#711, this PR adds new stat changes to Vulpkanins to make them more
mechanically interesting and distinct from Humans.

- Receive the Voracious trait by default, giving them 2x eating/drinking
speed.
- Takes 30% less Cold damage
- Takes 30% more Heat damage, up from 15%.
- Hunger rate increased by 25%.
- Receive 25% more fire stacks, increasing the Heat damage and duration
of being on fire.
- Flash duration has been increased by 50%.
  - The duration of flashes, 5 seconds, will become 7.5 seconds.

**Only merge** alongside Simple-Station#715.

## Media

<details><summary>Expand</summary>

**New flash duration**


https://github.com/user-attachments/assets/afafd890-d40b-4c63-9259-53ae6a355e53

</details>

## Changelog

:cl: Skubman
- add: Vulpkanins receive the Voracious trait for free, giving them 2x
eating/drinking speed, but Vulpkanins get hungrier 25% faster.
- tweak: Vulpkanins gain a 30% Cold resistance, but their Heat
vulnerability has increased from 15% to 30%. Vulpkanins also receive 25%
more Fire stacks, amplifying the damage and duration of being on fire.
- tweak: Flash duration against Vulpkanins has been increased by 50%.

---------

Signed-off-by: VMSolidus <[email protected]>
Co-authored-by: VMSolidus <[email protected]>
  • Loading branch information
2 people authored and tim-mcqueen-ttec committed Aug 18, 2024
1 parent cc378b8 commit f956042
Show file tree
Hide file tree
Showing 9 changed files with 44 additions and 5 deletions.
6 changes: 4 additions & 2 deletions Content.Client/Flash/FlashSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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<FlashOverlay>();
overlay.ReceiveFlash(component.Duration);
Expand Down
6 changes: 6 additions & 0 deletions Content.Server/Atmos/Components/FlammableComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -61,5 +61,11 @@ public sealed partial class FlammableComponent : Component
/// </summary>
[DataField, ViewVariables(VVAccess.ReadWrite)]
public float FirestackFade = -0.1f;

/// <summary>
/// How stronger will firestack increases be?
/// </summary>
[DataField]
public float FireStackIncreaseMultiplier = 1f;
}
}
3 changes: 3 additions & 0 deletions Content.Server/Atmos/EntitySystems/FlammableSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 2 additions & 0 deletions Content.Server/Flash/FlashSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
14 changes: 13 additions & 1 deletion Content.Shared/Flash/FlashableComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ public sealed partial class FlashableComponent : Component
public float Duration;
public TimeSpan LastFlash;

// <summary>
// How much to modify the duration of flashes against this entity.
// </summary>
[DataField]
public float DurationMultiplier = 1f;

[DataField]
public CollisionGroup CollisionGroup = CollisionGroup.Opaque;

Expand All @@ -22,10 +28,16 @@ public sealed class FlashableComponentState : ComponentState
public float Duration { get; }
public TimeSpan Time { get; }

public FlashableComponentState(float duration, TimeSpan time)
// <summary>
// How much to modify the duration of flashes against this entity.
// </summary>
public float DurationMultiplier { get; }

public FlashableComponentState(float duration, TimeSpan time, float durationMultiplier)
{
Duration = duration;
Time = time;
DurationMultiplier = durationMultiplier;
}
}

Expand Down
2 changes: 1 addition & 1 deletion Content.Shared/Flash/SharedFlashSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
}
3 changes: 2 additions & 1 deletion Resources/Prototypes/DeltaV/Damage/modifier_sets.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
- type: damageModifierSet
id: Vulpkanin
coefficients:
Heat: 1.15
Heat: 1.30
Cold: 0.70

- type: damageModifierSet
id: Harpy
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
5 changes: 5 additions & 0 deletions Resources/Prototypes/Traits/skills.yml
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,11 @@
- type: ConsumeDelayModifier
foodDelayMultiplier: 0.5
drinkDelayMultiplier: 0.5
requirements:
- !type:CharacterSpeciesRequirement
inverted: true
species:
- Vulpkanin

- type: trait
id: ParkourTraining
Expand Down

0 comments on commit f956042

Please sign in to comment.