2022-07-12 22:49:55 +00:00
|
|
|
|
using System.Collections.Generic;
|
2022-09-10 04:55:56 +00:00
|
|
|
|
using System.Text;
|
2021-08-13 15:29:43 +00:00
|
|
|
|
using UnityEngine;
|
2022-07-12 22:49:55 +00:00
|
|
|
|
using Verse;
|
2021-08-13 15:29:43 +00:00
|
|
|
|
|
|
|
|
|
namespace RJW_Menstruation.Sexperience
|
|
|
|
|
{
|
|
|
|
|
public class GatheredCumMixture : ThingWithComps
|
|
|
|
|
{
|
2021-08-21 16:01:54 +00:00
|
|
|
|
public Color cumColor = Color.white;
|
2021-08-13 15:29:43 +00:00
|
|
|
|
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);
|
2022-03-18 14:31:17 +00:00
|
|
|
|
if (res && other is GatheredCumMixture mixture)
|
2021-08-13 15:29:43 +00:00
|
|
|
|
{
|
2022-03-18 14:31:17 +00:00
|
|
|
|
GatheredCumMixture othercum = mixture;
|
2022-07-12 22:49:55 +00:00
|
|
|
|
cumColor = Colors.CMYKLerp(cumColor, othercum.cumColor, count / (amount + count));
|
|
|
|
|
if (!othercum.ingredients.NullOrEmpty()) for (int i = 0; i < othercum.ingredients.Count; i++)
|
2021-08-13 15:29:43 +00:00
|
|
|
|
{
|
|
|
|
|
if (!ingredients.Contains(othercum.ingredients[i])) ingredients.Add(othercum.ingredients[i]);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return res;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override string GetInspectString()
|
|
|
|
|
{
|
2022-09-10 04:55:56 +00:00
|
|
|
|
StringBuilder res = new StringBuilder();
|
2022-07-12 22:49:55 +00:00
|
|
|
|
if (!ingredients.NullOrEmpty()) for (int i = 0; i < ingredients.Count; i++)
|
2021-08-13 15:29:43 +00:00
|
|
|
|
{
|
2022-09-10 04:55:56 +00:00
|
|
|
|
res.Append(ingredients[i]);
|
|
|
|
|
if (i != ingredients.Count - 1) res.Append(", ");
|
2021-08-13 15:29:43 +00:00
|
|
|
|
}
|
2022-09-10 04:55:56 +00:00
|
|
|
|
return res.ToString();
|
2021-08-13 15:29:43 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void InitwithCum(CumMixture cum)
|
|
|
|
|
{
|
|
|
|
|
ingredients.AddRange(cum.Getingredients);
|
2022-03-18 14:31:17 +00:00
|
|
|
|
cumColor = cum.Color;
|
2021-08-13 15:29:43 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|