Nearby Effecter - AndroidQuazar/VanillaExpandedFramework GitHub Wiki

CompNearbyEffecter is a comp class that makes an animal turn nearvy things, taken from a list, into other things, also specified in a list that must have the same indexing (so thing number 3 in the first list turns into thing number 3 in the second one). This activity can also passively feed the animal if wanted

    //This comp class makes the animal convert things into other things

    public List<string> thingsToAffect = null;
    public List<string> thingsToConvertTo = null;

    public int ticksConversionRate = 1000;

    public int radius = 2;

    public bool feedCauser = false;
    public float nutritionGained = 0;

How do I use this code?

It is a comp class, so you just add it in XML in the <comps> tag. For example, this allows Basilisks in Magical Menagerie to rot vegetation and feed on that

<comps>
	<li Class="AnimalBehaviours.CompProperties_NearbyEffecter">
		<thingsToAffect>
			<li>Plant_Grass</li>
			<li>Plant_TallGrass</li>
			<li>Plant_Brambles</li>
			<li>Plant_HealrootWild</li>
			<li>Plant_PincushionCactus</li>
			<li>AB_TinkleGrass</li>
			<li>AB_GlowingGrass</li>
			<li>AB_HardyGrass</li>
			<li>AB_TallSlimyGrass</li>
			<li>AB_AlienGrass</li>
			<li>Plant_Agave</li>
			<li>Plant_Bush</li>
			<li>Plant_Berry</li>
			<li>Plant_Alocasia</li>
			<li>Plant_Clivia</li>
			<li>Plant_Rafflesia</li>
			<li>AB_GreenRockFern</li>			
		</thingsToAffect>
		<thingsToConvertTo>
			<li>MM_BurnedGrass</li>
			<li>MM_BurnedGrass</li>
			<li>MM_BurnedGrass</li>
			<li>MM_BurnedGrass</li>
			<li>MM_BurnedGrass</li>
			<li>MM_BurnedGrass</li>
			<li>MM_BurnedGrass</li>
			<li>MM_BurnedGrass</li>
			<li>MM_BurnedGrass</li>
			<li>MM_BurnedGrass</li>
			<li>MM_BurnedBush</li>
			<li>MM_BurnedBush</li>
			<li>MM_BurnedBush</li>
			<li>MM_BurnedBush</li>
			<li>MM_BurnedBush</li>
			<li>MM_BurnedBush</li>
			<li>MM_BurnedBush</li>
		</thingsToConvertTo>
		<ticksConversionRate>300</ticksConversionRate>
		<radius>3</radius>
		<feedCauser>true</feedCauser>
		<nutritionGained>0.3</nutritionGained>		
	</li>
</comps>
⚠️ **GitHub.com Fallback** ⚠️