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

Vulpkanin Rework: Number Changes #713

Merged
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
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
VMSolidus marked this conversation as resolved.
Show resolved Hide resolved
- 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
Loading