Skip to content

Commit

Permalink
Bloodpack Related Additions (#572)
Browse files Browse the repository at this point in the history
* Bloodpack Related Additions

Adds a sterile bag that can be printed from the medical and security techfabs.

Adds recipes for creating bloodpacks from sterile bags and blood, a blood and saline mix, or a perfluorocarbon based blood substitute.

Adds a chemical reaction for the production of blood.

Adds an extra section to the recipe sorter that ensure recipes with greater quantities of reagents are sorted higher than recipes with less. This only gets checked if the recipes use the same amount of solid and unique reagents.

* Fix for duplicate ID error

Made the lathe recipes in the med and sec fabs for sterile bags unique.

* YAML failure fix

Reversed the unique ID change and removed the duplicate recipe from the floof security YAML.

* Added requested comments

Adds the requested comments showing what changes are Floofstation specific.
  • Loading branch information
Cprn-Sprkl authored Feb 24, 2025
1 parent 4cdaa97 commit 6efdee0
Show file tree
Hide file tree
Showing 8 changed files with 198 additions and 2 deletions.
18 changes: 18 additions & 0 deletions Content.Shared/Kitchen/MicrowaveMealRecipePrototype.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,5 +52,23 @@ public FixedPoint2 IngredientCount()
}
return n;
}

//Floofstation specific method - Start
/// <summary>
/// Sums the quantity of reagents in a recipe for sorting the recipe list.
/// A fallback check if the IngredientCount is equal when sorting the
/// recipe list.
/// </summary>
/// <returns></returns>
public FixedPoint2 ReagentQuantity()
{
FixedPoint2 n = 0;
foreach (FixedPoint2 i in _ingsReagents.Values)
{
n += i;
}
return n;
}
//Floofstation specific method - End
}
}
14 changes: 13 additions & 1 deletion Content.Shared/Kitchen/RecipeManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,19 @@ public override int Compare(FoodRecipePrototype? x, FoodRecipePrototype? y)

var nx = x.IngredientCount();
var ny = y.IngredientCount();
return -nx.CompareTo(ny);
//Floofstation - Start
//Added a fallback for recipes with the same results from IngredientCount
//Original: return -nx.CompareTo(ny)
if (-nx.CompareTo(ny) != 0)
{
return -nx.CompareTo(ny);//If total solid ingredients and unique reagents are different, return result.
}

var vx = x.ReagentQuantity();
var vy = y.ReagentQuantity();

return -vx.CompareTo(vy);//Fallback result based on total amount of reagents.
//Floofstation - End
}
}
}
Expand Down
2 changes: 2 additions & 0 deletions Resources/Prototypes/Entities/Structures/Machines/lathe.yml
Original file line number Diff line number Diff line change
Expand Up @@ -823,6 +823,7 @@
- SpeedLoaderMagnumEmpty
- MagazineMagnumEmpty #floof
- MagazineMagnum #floof
- SterileBag #floof
- Stunbaton
- TargetClown
- ClothingOuterArmorPlateCarrier
Expand Down Expand Up @@ -1076,6 +1077,7 @@
- WhiteCane
- HandheldGPSBasic # Floof - port to EE
- HandheldStationMap # Floof - port to EE
- SterileBag # floof
dynamicRecipes:
- ChemicalPayload
- CryostasisBeaker
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
- type: entity
id: Bloodpack1
parent: Bloodpack
suffix: Single
components:
- type: Stack
stackType: Bloodpack
count: 1

- type: entity
id: Bloodpack5
parent: Bloodpack
suffix: 5
components:
- type: Stack
stackType: Bloodpack
count: 5

- type: entity
id: Bloodpack10
parent: Bloodpack
suffix: 10
components:
- type: Stack
stackType: Bloodpack
count: 10
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
- type: entity
name: sterile bag
description: A sterile bag, ready to be filled.
parent: BaseItem
id: SterileBag
components:
- type: Sprite
sprite: Objects/Specific/Medical/medical.rsi
state: bloodpack-empty
- type: StaticPrice
price: 0
105 changes: 105 additions & 0 deletions Resources/Prototypes/Floof/Recipes/Cooking/medical_recipes.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
#Singular blood pack recipe
- type: microwaveMealRecipe
id: RecipeBloodPack1
name: single blood pack recipe
result: Bloodpack1
time: 5
solids:
SterileBag: 1
reagents:
Blood: 30 #Bloodpacks are 30 per use.

#Single hybrid blood pack recipe
- type: microwaveMealRecipe
id: RecipeHybridBloodPack1
name: single hybrid blood pack recipe
result: Bloodpack1
time: 5
solids:
SterileBag: 1
reagents:
Blood: 15
Saline: 15

#Five blood pack recipe
- type: microwaveMealRecipe
id: RecipeBloodPack5
name: five blood pack recipe
result: Bloodpack5
time: 5
solids:
SterileBag: 1
reagents:
Blood: 150 #5 stack of 30 units per use.

#Five hybrid blood pack recipe
- type: microwaveMealRecipe
id: RecipeHybridBloodPack5
name: five hybrid blood pack recipe
result: Bloodpack5
time: 5
solids:
SterileBag: 1
reagents:
Blood: 75
Saline: 75

#Ten blood pack recipe
- type: microwaveMealRecipe
id: RecipeBloodPack10
name: ten blood pack recipe
result: Bloodpack10
time: 5
solids:
SterileBag: 1
reagents:
Blood: 300 #10 stack of 30 units per use.

#Ten hybrid blood pack recipe
- type: microwaveMealRecipe
id: RecipeHybridBloodPack10
name: ten hybrid blood pack recipe
result: Bloodpack10
time: 5
solids:
SterileBag: 1
reagents:
Blood: 150
Saline: 150

#Full blood pack recipe
- type: microwaveMealRecipe
id: RecipeBloodPack
name: full blood pack recipe
result: Bloodpack
time: 5
solids:
SterileBag: 1
reagents:
Blood: 450 #450 = 15 stack of 30 units per use.

#Full hybrid blood pack recipe
- type: microwaveMealRecipe
id: RecipeHybridBloodPack
name: full hybrid blood pack recipe
result: Bloodpack
time: 5
solids:
SterileBag: 1
reagents:
Blood: 225
Saline: 225

#PFC based blood substitute recipe
- type: microwaveMealRecipe
id: RecipePFCSubstitute
name: PFC blood substitute recipe
result: Bloodpack
time: 10
solids:
SterileBag: 1
reagents:
Nutriment: 30
Vitamin: 15
Saline: 50
Bleach: 5
7 changes: 7 additions & 0 deletions Resources/Prototypes/Floof/Recipes/Lathes/medical.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,10 @@
PlasmaGlass: 500
Plasteel: 500
Silver: 500

- type: latheRecipe
id: SterileBag
result: SterileBag
completetime: 2
materials:
Plastic: 50
17 changes: 16 additions & 1 deletion Resources/Prototypes/Floof/Recipes/Reactions/chemicals.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
amount: 1
products:
SalicylicAcid: 3

- type: reaction
id : Formaldehyde
reactants:
Expand All @@ -39,3 +39,18 @@
amount: 1
products:
Formaldehyde: 3

- type: reaction
id : PFCBlood
minTemp: 310
reactants:
Nutriment:
amount: 6
Vitamin:
amount: 3
Saline:
amount: 10
Bleach:
amount: 1
products:
Blood: 20

0 comments on commit 6efdee0

Please sign in to comment.