/// <summary> /// Generates a roaming Gordo Slime for this slime (use this if you want the slime to have a Gordo counter part) /// <para>Roaming gordos are normal slimes scaled as a gordo and contains almost no behaviours, also it doesnt eat. Use PrefabFunctions to give it /// behaviours</para> /// </summary> /// <param name="gordoID">The ID for the gordo</param> /// <returns>The slime template for the Roaming Gordo (YOU NEED TO CLASS .Create TO FINISH THE PROCESS)</returns> public SlimeTemplate MakeRoamingGordo(Identifiable.Id gordoID) { if (isGordo) { return(null); } SlimeDefinition gordoDef = ScriptableObject.CreateInstance <SlimeDefinition>(); gordoDef.AppearancesDefault = definition.AppearancesDefault; gordoDef.AppearancesDynamic = definition.AppearancesDynamic; gordoDef.BaseModule = definition.BaseModule; gordoDef.BaseSlimes = definition.BaseSlimes; gordoDef.CanLargofy = false; gordoDef.Diet = definition.Diet; gordoDef.FavoriteToys = new Identifiable.Id[0]; gordoDef.IdentifiableId = gordoID; gordoDef.IsLargo = true; gordoDef.PrefabScale = 4f; gordoDef.SlimeModules = definition.SlimeModules; gordoDef.Sounds = definition.Sounds; gordoDef.Name = "roamGordo." + definition.Name; FearProfile prof = ScriptableObject.CreateInstance <FearProfile>(); prof.threats = new List <FearProfile.ThreatEntry>(); prof.GetType().GetMethod("OnEnable", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance).Invoke(prof, new object[0]); SlimeTemplate gordo = new SlimeTemplate("gordo" + mainObject.Name.Replace("slime", ""), gordoDef).SetVacSize(Vacuumable.Size.GIANT) .SetHealth(60).SetFeralState(false).SetGlitchState(false).SetFearProfile(prof).SetTranslation(definition.Name + " Gordo"); gordo.isGordo = true; return(gordo); }
public static bool Prefix(FearProfile __instance) { if (__instance.threats == null) { return(false); } return(true); }
/// <summary> /// Sets the fear profile /// </summary> /// <param name="profile">The fear profile to set</param> public SlimeTemplate SetFearProfile(FearProfile profile) { fearProfile = profile; return(this); }