Skip to content

Commit

Permalink
Merge branch 'master' into Vulpkanin-Update
Browse files Browse the repository at this point in the history
Signed-off-by: FoxxoTrystan <[email protected]>
  • Loading branch information
FoxxoTrystan authored Aug 14, 2024
2 parents d3eba80 + a9280bb commit ee20123
Show file tree
Hide file tree
Showing 9 changed files with 39 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 @@ -137,6 +137,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
9 changes: 8 additions & 1 deletion Content.Shared/Flash/FlashableComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ public sealed partial class FlashableComponent : Component
// </summary>
[DataField]
public int EyeDamage;

// 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 @@ -35,13 +40,15 @@ public sealed class FlashableComponentState : ComponentState
public TimeSpan Time { get; }
public float EyeDamageChance { get; }
public int EyeDamage { get; }
public float DurationMultiplier { get; }

public FlashableComponentState(float duration, TimeSpan time, float eyeDamageChance, int eyeDamage)
public FlashableComponentState(float duration, TimeSpan time, float eyeDamageChance, int eyeDamage, float durationMultiplier)
{
Duration = duration;
Time = time;
EyeDamageChance = eyeDamageChance;
EyeDamage = eyeDamage;
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, component.EyeDamageChance, component.EyeDamage);
args.State = new FlashableComponentState(component.Duration, component.LastFlash, component.EyeDamageChance, component.EyeDamage, 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 @@ -109,6 +110,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 ee20123

Please sign in to comment.