//TODO: Make this driven by data public static void RegisterSubstanceProperties() { UrbSubstanceProperties.Set(UrbSubstanceTag.Stem, new UrbSubstanceProperty { Scent = new UrbScentTag[] { UrbScentTag.Plant } }); UrbSubstanceProperties.Set(UrbSubstanceTag.Leaf, new UrbSubstanceProperty { Scent = new UrbScentTag[] { UrbScentTag.Plant } }); UrbSubstanceProperties.Set(UrbSubstanceTag.Flower, new UrbSubstanceProperty { Scent = new UrbScentTag[] { UrbScentTag.Plant, UrbScentTag.Sweet } }); UrbSubstanceProperties.Set(UrbSubstanceTag.Muscle, new UrbSubstanceProperty { Scent = new UrbScentTag[] { UrbScentTag.Meat } }); UrbSubstanceProperties.Set(UrbSubstanceTag.Nerves, new UrbSubstanceProperty { Scent = new UrbScentTag[] { UrbScentTag.Meat } }); UrbSubstanceProperties.Set(UrbSubstanceTag.Fat, new UrbSubstanceProperty { Scent = new UrbScentTag[] { UrbScentTag.Meat } }); UrbSubstanceProperties.Set(UrbSubstanceTag.Fluff, new UrbSubstanceProperty { Scent = new UrbScentTag[] { UrbScentTag.Fluff } }); UrbSubstanceProperties.Set(UrbSubstanceTag.Male, new UrbSubstanceProperty { Scent = new UrbScentTag[] { UrbScentTag.Male } }); UrbSubstanceProperties.Set(UrbSubstanceTag.Female, new UrbSubstanceProperty { Scent = new UrbScentTag[] { UrbScentTag.Female } }); }
public float PenetrationCheck(UrbSubstanceTag Penetrator, float Amount, float Force) { if (Layers == null || Layers.Length == 0) { return(Amount); } float Result = 0; float Depth = Force; float PenHardness = UrbSubstanceProperties.Get(Penetrator).Hardness; for (int i = 0; i < Layers.Length; i++) { float LayerThickness = Thickness(Layers[i]); float LayerHardness = UrbSubstanceProperties.Get(Layers[i]).Hardness; float LayerFlexibility = UrbSubstanceProperties.Get(Layers[i]).Flexibility; Depth *= PenHardness / LayerHardness; if (Depth > LayerThickness) { float Damage = LayerFlexibility > 0 ? (Amount * LayerThickness) / LayerFlexibility : Amount * LayerThickness; LayerDamage[i] += Damage; Result += Damage; Depth -= LayerThickness; } else { float Damage = LayerFlexibility > 0 ? (Amount * Depth) / LayerFlexibility : Amount * Depth; LayerDamage[i] += Damage; Result += Damage; break; } } return(Result); }
public static bool SubstanceSmellsLike(UrbSubstanceTag Substance, UrbScentTag Scent) { return(UrbSubstanceProperties.CheckScent(Substance, Scent)); }
public static UrbScentTag[] Scent(UrbSubstanceTag input) { return(UrbSubstanceProperties.Get(input).Scent); }