Skip to content

Commit

Permalink
Merge branch 'new-frontiers-14:master' into teloscontainerships
Browse files Browse the repository at this point in the history
  • Loading branch information
Temoffy authored Jan 13, 2025
2 parents 8dfc392 + 8b707fd commit 14b8f7c
Show file tree
Hide file tree
Showing 12 changed files with 196 additions and 39 deletions.
39 changes: 30 additions & 9 deletions Content.Server/Medical/HealingSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -115,13 +115,13 @@ entity.Comp.DamageContainerID is not null &&
_audio.PlayPvs(healing.HealingEndSound, entity.Owner, AudioHelpers.WithVariation(0.125f, _random).WithVolume(1f));

// Logic to determine the whether or not to repeat the healing action
args.Repeat = (HasDamage(entity.Comp, healing) && !dontRepeat);
args.Repeat = (HasDamage(entity.Owner, entity.Comp, healing) && !dontRepeat); // Frontier: add entity.Owner
if (!args.Repeat && !dontRepeat)
_popupSystem.PopupEntity(Loc.GetString("medical-item-finished-using", ("item", args.Used)), entity.Owner, args.User);
args.Handled = true;
}

private bool HasDamage(DamageableComponent component, HealingComponent healing)
private bool HasDamage(EntityUid target, DamageableComponent component, HealingComponent healing)
{
var damageableDict = component.Damage.DamageDict;
var healingDict = healing.Damage.DamageDict;
Expand All @@ -133,6 +133,25 @@ private bool HasDamage(DamageableComponent component, HealingComponent healing)
}
}

// Frontier: check if this healing item can restore the target's blood or staunch their bleeding
var hasBloodstream = TryComp<BloodstreamComponent>(target, out var bloodstream);

if (healing.ModifyBloodLevel > 0
&& hasBloodstream
&& _solutionContainerSystem.ResolveSolution(target, bloodstream!.BloodSolutionName, ref bloodstream.BloodSolution, out var bloodSolution)
&& bloodSolution.Volume < bloodSolution.MaxVolume)
{
return true;
}

if (healing.BloodlossModifier < 0
&& hasBloodstream
&& bloodstream!.BleedAmount > 0)
{
return true;
}
// End Frontier

return false;
}

Expand Down Expand Up @@ -172,14 +191,16 @@ targetDamage.DamageContainerID is not null &&
if (TryComp<StackComponent>(uid, out var stack) && stack.Count < 1)
return false;

var anythingToDo =
HasDamage(targetDamage, component) ||
component.ModifyBloodLevel > 0 // Special case if healing item can restore lost blood...
&& TryComp<BloodstreamComponent>(target, out var bloodstream)
&& _solutionContainerSystem.ResolveSolution(target, bloodstream.BloodSolutionName, ref bloodstream.BloodSolution, out var bloodSolution)
&& bloodSolution.Volume < bloodSolution.MaxVolume; // ...and there is lost blood to restore.
// Frontier: extra conditions moved into HasDamage
// var anythingToDo =
// HasDamage(targetDamage, component) ||
// component.ModifyBloodLevel > 0 // Special case if healing item can restore lost blood...
// && TryComp<BloodstreamComponent>(target, out var bloodstream)
// && _solutionContainerSystem.ResolveSolution(target, bloodstream.BloodSolutionName, ref bloodstream.BloodSolution, out var bloodSolution)
// && bloodSolution.Volume < bloodSolution.MaxVolume; // ...and there is lost blood to restore.
// End Frontier

if (!anythingToDo)
if (!HasDamage(target, targetDamage, component)) // Frontier: anythingToDo<!HasDamage
{
_popupSystem.PopupEntity(Loc.GetString("medical-item-cant-use", ("item", uid)), uid, user);
return false;
Expand Down
44 changes: 44 additions & 0 deletions Content.Server/_NF/Construction/Conditions/NFStrapEmpty.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
using Content.Shared.Construction;
using JetBrains.Annotations;
using Content.Shared.Examine;
using Content.Shared.Buckle.Components;

namespace Content.Server.Construction.Conditions;

[UsedImplicitly]
[DataDefinition]
public sealed partial class NFStrapEmpty : IGraphCondition
{
public bool Condition(EntityUid uid, IEntityManager entityManager)
{
if (!entityManager.TryGetComponent(uid, out StrapComponent? strap))
return true; // No strap, nothing can be buckled.

return strap.BuckledEntities.Count == 0;
}

public bool DoExamine(ExaminedEvent args)
{
var entity = args.Examined;

var entMan = IoCManager.Resolve<IEntityManager>();

if (!entMan.TryGetComponent(entity, out StrapComponent? strap)) return false;

if (strap.BuckledEntities.Count > 0)
{
args.PushMarkup(Loc.GetString("construction-examine-condition-nf-strap-empty", ("entityName", entMan.GetComponent<MetaDataComponent>(entity).EntityName)) + "\n");
return true;
}

return false;
}

public IEnumerable<ConstructionGuideEntry> GenerateGuideEntry()
{
yield return new ConstructionGuideEntry()
{
Localization = "construction-step-condition-nf-strap-empty"
};
}
}
32 changes: 32 additions & 0 deletions Resources/Changelog/Frontier.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6350,3 +6350,35 @@ Entries:
message: Paladin NFSD Shuttle locker isn't locked to detective only anymore.
id: 5648
time: '2025-01-11T16:10:51.0000000+00:00'
- author: whatston3
changes:
- type: Add
message: >-
Blood restoring/hemostatic items can be used even if the user isn't
damaged.
id: 5649
time: '2025-01-12T12:28:48.0000000+00:00'
- author: Jakumba
changes:
- type: Tweak
message: Updates NFSD PTech with additional items
id: 5650
time: '2025-01-12T12:44:54.0000000+00:00'
- author: dustylens
changes:
- type: Tweak
message: Condiment dispenser can now be shuttered.
id: 5651
time: '2025-01-12T13:00:48.0000000+00:00'
- author: Lyndomen
changes:
- type: Tweak
message: Speedboots consume more energy, are faster, and are powered by bluespace
id: 5652
time: '2025-01-12T13:01:52.0000000+00:00'
- author: dvir001
changes:
- type: Fix
message: Xenos can now be butchered on meat spikes.
id: 5653
time: '2025-01-12T13:08:35.0000000+00:00'
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# NFBuckled
construction-examine-condition-nf-strap-empty = Unbuckle everything from the {$entityName}.
construction-step-condition-nf-strap-empty = Nothing must be buckled.
8 changes: 4 additions & 4 deletions Resources/Prototypes/Entities/Clothing/Shoes/misc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
parent: [ClothingShoesBase, PowerCellSlotSmallItem, BaseToggleClothing]
id: ClothingShoesBootsSpeed
name: speed boots
description: High-tech boots woven with quantum fibers, able to convert electricity into pure speed!
description: High-tech boots with interwoven bluespace fibers, able to convert electricity into pure speed! # DeltaV illegal ops
components:
- type: Sprite
sprite: Clothing/Shoes/Boots/speedboots.rsi
Expand All @@ -101,8 +101,8 @@
- type: ToggleClothing
action: ActionToggleSpeedBoots
- type: ClothingSpeedModifier
walkModifier: 1.15 # Frontier 1.5<1.15
sprintModifier: 1.15 # Frontier 1.5<1.15
walkModifier: 1.7 # DeltaV
sprintModifier: 1.7 # DeltaV
- type: Appearance
- type: GenericVisualizer
visuals:
Expand All @@ -113,7 +113,7 @@
- type: StaticPrice
price: 500
- type: PowerCellDraw
drawRate: 4
drawRate: 30 # DeltaV 4>30, you have to turn off micro reactor at somepoint
- type: ToggleCellDraw
- type: ItemSlots
slots:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -191,53 +191,62 @@
steps:
- tool: Screwing
doAfter: 1

#Frontier: fancy wooden chairs
# Frontier: fancy wooden chairs
- to: chairWoodFancyBlack
conditions:
- !type:NFStrapEmpty
steps:
- material: FloorCarpetBlack
amount: 1

- to: chairWoodFancyBlue
conditions:
- !type:NFStrapEmpty
steps:
- material: FloorCarpetBlue
amount: 1

- to: chairWoodFancyCyan
conditions:
- !type:NFStrapEmpty
steps:
- material: FloorCarpetCyan
amount: 1

- to: chairWoodFancyGreen
conditions:
- !type:NFStrapEmpty
steps:
- material: FloorCarpetGreen
amount: 1

- to: chairWoodFancyOrange
conditions:
- !type:NFStrapEmpty
steps:
- material: FloorCarpetOrange
amount: 1

- to: chairWoodFancyPurple
steps:
- material: FloorCarpetPurple
amount: 1

- to: chairWoodFancyPink
conditions:
- !type:NFStrapEmpty
steps:
- material: FloorCarpetPink
amount: 1

- to: chairWoodFancyPurple
conditions:
- !type:NFStrapEmpty
steps:
- material: FloorCarpetPurple
amount: 1
- to: chairWoodFancyRed
conditions:
- !type:NFStrapEmpty
steps:
- material: FloorCarpetRed
amount: 1

- to: chairWoodFancyWhite
conditions:
- !type:NFStrapEmpty
steps:
- material: FloorCarpetWhite
amount: 1
#End Frontier
# End Frontier

- node: chairMeat
entity: ChairMeat
Expand Down Expand Up @@ -329,6 +338,8 @@
entity: ChairWoodFancyBlack
edges:
- to: chairWood
conditions:
- !type:NFStrapEmpty
completed:
- !type:SpawnPrototype
prototype: FloorCarpetItemBlack
Expand All @@ -341,6 +352,8 @@
entity: ChairWoodFancyBlue
edges:
- to: chairWood
conditions:
- !type:NFStrapEmpty
completed:
- !type:SpawnPrototype
prototype: FloorCarpetItemBlue
Expand All @@ -353,6 +366,8 @@
entity: ChairWoodFancyCyan
edges:
- to: chairWood
conditions:
- !type:NFStrapEmpty
completed:
- !type:SpawnPrototype
prototype: FloorCarpetItemCyan
Expand All @@ -365,6 +380,8 @@
entity: ChairWoodFancyGreen
edges:
- to: chairWood
conditions:
- !type:NFStrapEmpty
completed:
- !type:SpawnPrototype
prototype: FloorCarpetItemGreen
Expand All @@ -377,6 +394,8 @@
entity: ChairWoodFancyOrange
edges:
- to: chairWood
conditions:
- !type:NFStrapEmpty
completed:
- !type:SpawnPrototype
prototype: FloorCarpetItemOrange
Expand All @@ -385,25 +404,29 @@
- tool: Prying
doAfter: 1

- node: chairWoodFancyPink
entity: ChairWoodFancyPink
- node: chairWoodFancyPurple
entity: ChairWoodFancyPurple
edges:
- to: chairWood
conditions:
- !type:NFStrapEmpty
completed:
- !type:SpawnPrototype
prototype: FloorCarpetItemPink
prototype: FloorCarpetItemPurple
amount: 1
steps:
- tool: Prying
doAfter: 1

- node: chairWoodFancyPurple
entity: ChairWoodFancyPurple
- node: chairWoodFancyPink
entity: ChairWoodFancyPink
edges:
- to: chairWood
conditions:
- !type:NFStrapEmpty
completed:
- !type:SpawnPrototype
prototype: FloorCarpetItemPurple
prototype: FloorCarpetItemPink
amount: 1
steps:
- tool: Prying
Expand All @@ -413,6 +436,8 @@
entity: ChairWoodFancyRed
edges:
- to: chairWood
conditions:
- !type:NFStrapEmpty
completed:
- !type:SpawnPrototype
prototype: FloorCarpetItemRed
Expand All @@ -425,10 +450,13 @@
entity: ChairWoodFancyWhite
edges:
- to: chairWood
conditions:
- !type:NFStrapEmpty
completed:
- !type:SpawnPrototype
prototype: FloorCarpetItemWhite
amount: 1
steps:
- tool: Prying
doAfter: 1
# End Frontier
1 change: 1 addition & 0 deletions Resources/Prototypes/Recipes/Lathes/misc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@
Steel: 1500
Plastic: 1000
Silver: 500
Bluespace: 200 #DeltaV

- type: latheRecipe
id: ModularReceiver
Expand Down
Loading

0 comments on commit 14b8f7c

Please sign in to comment.