protected override ValuedSlimeTrait <SlimeEat.FoodGroup[]> CombineTraits(ValuedSlimeTrait <SlimeEat.FoodGroup[]> original, ValuedSlimeTrait <SlimeEat.FoodGroup[]> other, SpliceSettings settings) { var trait = CreateDefaultTrait() as ValuedSlimeTrait <SlimeEat.FoodGroup[]>; trait.Value = original.Value.Concat(other.Value).Distinct().ToArray(); return(trait); }
protected override void MaybeTransformSlimeTrait(ValuedSlimeTrait <SlimeEat.FoodGroup[]> trait, GameObject obj) { var temp = trait.Value; ConfigureSlimeTrait(trait, obj); trait.Value = temp.Concat(trait.Value).Distinct().ToArray(); }
protected override Color GetTraitDisplayColor(ValuedSlimeTrait <SlimeEat.FoodGroup[]> trait) { if (trait.Value.Contains(SlimeEat.FoodGroup.GINGER)) { return(Color.yellow); } return(Color.black); }
protected override string GetTraitDescription(ValuedSlimeTrait <SlimeEat.FoodGroup[]> trait) { if (trait.Value.Contains(SlimeEat.FoodGroup.GINGER)) { return("Only eats gilded gingers"); } return("The foods this slime will eat"); }
protected override string GetTraitDisplayName(ValuedSlimeTrait <SlimeEat.FoodGroup[]> trait) { if (trait.Value.Contains(SlimeEat.FoodGroup.GINGER)) { return("Royal Diet"); } return($"Diet: {GameContext.Instance.MessageDirector.GetBundle("ui").Xlate(GameContext.Instance.SlimeDefinitions.Slimes.First().Diet.GetGroupsMsg(trait.Value))}"); }
protected override ValuedSlimeTrait <int> CombineTraits(ValuedSlimeTrait <int> original, ValuedSlimeTrait <int> other, SpliceSettings settings) { var trait = settings.PickBetween(original, other); return(settings.MaybeMutate(trait, (x) => { x.Value += (int)Mathf.Sign(UnityEngine.Random.value * 2 - 1); return x; })); }
protected override Color GetTraitDisplayColor(ValuedSlimeTrait <float> trait) { if (trait.Value > 0) { return(new Color(0, Mathf.Clamp01(trait.Value / 2f), 0)); } if (trait.Value < 0) { return(new Color(Mathf.Clamp01(Mathf.Abs(trait.Value / 2f)), 0, 0)); } return(Color.black); }
protected override string GetTraitDescription(ValuedSlimeTrait <int> trait) { throw new NotImplementedException(); }
protected override void ConfigureSlimeTrait(ValuedSlimeTrait <SlimeEat.FoodGroup[]> trait, GameObject obj) { trait.Value = obj.GetComponent <SlimeEat>()?.slimeDefinition.Diet.MajorFoodGroups ?? trait.Value; }
protected override string GetTraitDescription(ValuedSlimeTrait <float> trait) => "How quickly this slime gets agitated";
public override void ApplyToGameObject(ValuedSlimeTrait <SlimeEat.FoodGroup[]> trait, GameObject obj) { }
protected override void MaybeTransformSlimeTrait(ValuedSlimeTrait <int> trait, GameObject obj) { }
protected override string GetTraitDisplayName(ValuedSlimeTrait <int> trait) { }
protected override void ConfigureSlimeTrait(ValuedSlimeTrait <float> trait, GameObject obj) { trait.Value = GetSlimeTemperament(Identifiable.GetId(obj)); }
protected override void ConfigureSlimeTrait(ValuedSlimeTrait <int> trait, GameObject obj) { }
public override void ApplyToGameObject(ValuedSlimeTrait <int> trait, GameObject obj) { }
protected override void MaybeTransformSlimeTrait(ValuedSlimeTrait <float> trait, GameObject obj) { ConfigureSlimeTrait(trait, obj); }
protected override string GetTraitDisplayName(ValuedSlimeTrait <float> trait) { return("Temperament: " + GetTemperamentName((int)trait.Value)); }
protected override Color GetTraitDisplayColor(ValuedSlimeTrait <int> trait) { throw new NotImplementedException(); }
protected override ValuedSlimeTrait <float> CombineTraits(ValuedSlimeTrait <float> original, ValuedSlimeTrait <float> other, SpliceSettings settings) { return(UnityEngine.Random.value > .5 ? original : other); }