mirror of
https://gitgud.io/lutepickle/rjw_menstruation.git
synced 2024-08-14 22:46:52 +00:00
Refactor DamagePants
This commit is contained in:
parent
9a495ad32b
commit
2516ed1439
1 changed files with 4 additions and 15 deletions
|
@ -441,21 +441,10 @@ namespace RJW_Menstruation
|
||||||
public static float DamagePants(this Pawn pawn, float fluidAmount)
|
public static float DamagePants(this Pawn pawn, float fluidAmount)
|
||||||
{
|
{
|
||||||
if (pawn.apparel == null) return 0;
|
if (pawn.apparel == null) return 0;
|
||||||
Apparel pants = null;
|
if (!pawn.apparel.WornApparel.
|
||||||
foreach(Apparel apparel in pawn.apparel.WornApparel.Where(app => app.def.apparel.bodyPartGroups.Contains(BodyPartGroupDefOf.Legs)))
|
Where(apparel => apparel.def.apparel.bodyPartGroups.Contains(BodyPartGroupDefOf.Legs)).
|
||||||
{
|
TryMinBy(apparel => apparel.def.apparel.LastLayer.drawOrder, out Apparel pants))
|
||||||
if (apparel.def.apparel.LastLayer == ApparelLayerDefOf.OnSkin)
|
return 0;
|
||||||
{
|
|
||||||
pants = apparel;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
else if (pants == null || apparel.def.apparel.LastLayer == ApparelLayerDefOf.Middle)
|
|
||||||
// Either grab whatever's available or reassign the pants from shell to a middle
|
|
||||||
pants = apparel;
|
|
||||||
// Pants are middle and this is a shell
|
|
||||||
else continue;
|
|
||||||
}
|
|
||||||
if (pants == null) return 0;
|
|
||||||
|
|
||||||
const float HPPerMl = 0.5f;
|
const float HPPerMl = 0.5f;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue