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

Bloodpack Related Additions #572

Merged
merged 4 commits into from
Feb 24, 2025
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
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 @@ -821,6 +821,7 @@
- SpeedLoaderMagnumEmpty
- MagazineMagnumEmpty #floof
- MagazineMagnum #floof
- SterileBag #floof
- Stunbaton
- TargetClown
- ClothingOuterArmorPlateCarrier
Expand Down Expand Up @@ -1074,6 +1075,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
Loading