Example #1
0
 /**
  * Create a random skin color using two parents
  */
 public static int SkinColor(Character parent1, Character parent2)
 {
     if (Blender.AreAdopters(parent1, parent2))
     {
         return(Blender.NaturalSkinColor());
     }
     return(0);
 }
Example #2
0
        /**
         * Get the skin color of a farmer or NPC
         */
        public static int GetSkinColor(Character character)
        {
            // If character is a Farmer, return their skin color
            if (character is Farmer farmer)
            {
                return(farmer.skinColor);
            }

            // If character is an NPC, return their skin color
            if (character is NPC npc && Blender.NPC_SKIN.TryGetValue(npc.Name, out int color))
            {
                return(color);
            }

            // Create a new random skin color (Fallback)
            return(Blender.NaturalSkinColor());
        }