mirror of
https://gitgud.io/lutepickle/rjw_menstruation.git
synced 2024-08-14 22:46:52 +00:00
57 lines
1.9 KiB
C#
57 lines
1.9 KiB
C#
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using Verse;
|
|
|
|
namespace RJW_Menstruation.Sexperience
|
|
{
|
|
public class GatheredCumMixture : ThingWithComps
|
|
{
|
|
public Color cumColor = Color.white;
|
|
public List<string> ingredients = new List<string>();
|
|
|
|
public override Color DrawColor => cumColor;
|
|
|
|
|
|
public override void ExposeData()
|
|
{
|
|
base.ExposeData();
|
|
Scribe_Values.Look(ref cumColor, "cumColor", Color.white, true);
|
|
Scribe_Collections.Look(ref ingredients, "ingredients");
|
|
}
|
|
|
|
public override bool TryAbsorbStack(Thing other, bool respectStackLimit)
|
|
{
|
|
float amount = stackCount;
|
|
float count = ThingUtility.TryAbsorbStackNumToTake(this, other, respectStackLimit);
|
|
bool res = base.TryAbsorbStack(other, respectStackLimit);
|
|
if (res && other is GatheredCumMixture mixture)
|
|
{
|
|
GatheredCumMixture othercum = mixture;
|
|
cumColor = Colors.CMYKLerp(cumColor, othercum.cumColor, count / (amount + count));
|
|
if (!othercum.ingredients.NullOrEmpty()) for (int i = 0; i < othercum.ingredients.Count; i++)
|
|
{
|
|
if (!ingredients.Contains(othercum.ingredients[i])) ingredients.Add(othercum.ingredients[i]);
|
|
}
|
|
}
|
|
return res;
|
|
}
|
|
|
|
public override string GetInspectString()
|
|
{
|
|
string res = "";
|
|
if (!ingredients.NullOrEmpty()) for (int i = 0; i < ingredients.Count; i++)
|
|
{
|
|
res += ingredients[i];
|
|
if (i != ingredients.Count - 1) res += ", ";
|
|
}
|
|
return res;
|
|
}
|
|
|
|
public void InitwithCum(CumMixture cum)
|
|
{
|
|
ingredients.AddRange(cum.Getingredients);
|
|
cumColor = cum.Color;
|
|
}
|
|
|
|
}
|
|
}
|