Install Steam
login
|
language
简体中文 (Simplified Chinese)
繁體中文 (Traditional Chinese)
日本語 (Japanese)
한국어 (Korean)
ไทย (Thai)
Български (Bulgarian)
Čeština (Czech)
Dansk (Danish)
Deutsch (German)
Español - España (Spanish - Spain)
Español - Latinoamérica (Spanish - Latin America)
Ελληνικά (Greek)
Français (French)
Italiano (Italian)
Bahasa Indonesia (Indonesian)
Magyar (Hungarian)
Nederlands (Dutch)
Norsk (Norwegian)
Polski (Polish)
Português (Portuguese - Portugal)
Português - Brasil (Portuguese - Brazil)
Română (Romanian)
Русский (Russian)
Suomi (Finnish)
Svenska (Swedish)
Türkçe (Turkish)
Tiếng Việt (Vietnamese)
Українська (Ukrainian)
Report a translation problem
between the curly brackets of the OnEnable() method of the
private AbstractPhysicalObject.AbstractObjectType CustomCraftingResults(On.Player.orig_CraftingResults orig, Player self)
{
if (self.SlugCatClass.value == "YOUR SLUGCAT'S ID" && self.FoodInStomach > 0)
{
Creature.Grasp[] grasps = self.grasps;
for (int i = 0; i < self.grasps.Length; i++)
{
if (grasps != null && grasps is IPlayerEdible && (grasps as IPlayerEdible).Edible)
{
return null;
}
}
if (grasps[0] != null && grasps[0].grabbed is Spear && !(grasps[0].grabbed as Spear).abstractSpear.explosive && !(grasps[0].grabbed as Spear).abstractSpear.electric)
{
return AbstractPhysicalObject.AbstractObjectType.Spear;
}
if (grasps[0] == null && grasps[1] != null && grasps[1].grabbed is Spear && !(grasps[1].grabbed as Spear).abstractSpear.explosive && !(grasps[1].grabbed as Spear).abstractSpear.electric)
{
return AbstractPhysicalObject.AbstractObjectType.Spear;
}
}
return orig(self);
}
private bool CraftCheck(On.Player.orig_GraspsCanBeCrafted orig, Player self)
{
if (self.SlugCatClass.value == "YOUR SLUGCAT'S ID")
{
return self.CraftingResults() != null;
}
return orig(self);
}
private void MakeElectricSpear(On.Player.orig_SpitUpCraftedObject orig, Player self)
{
orig(self);
if (self.SlugCatClass.value == "YOUR SLUGCAT'S ID")
{
for (int j = 0; j < self.grasps.Length; j++)
{
AbstractPhysicalObject obj = self.grasps[j].grabbed.abstractPhysicalObject;
if (self.grasps[j] != null && obj.type == AbstractPhysicalObject.AbstractObjectType.Spear && !(obj as AbstractSpear).electric && !(obj as AbstractSpear).explosive)
{
self.room.PlaySound(SoundID.Zapper_Zap, self.firstChunk.pos, 0.8f, 1.5f + UnityEngine.Random.value * 1.5f);
self.ReleaseGrasp(j);
self.SubtractFood(1);
obj.realizedObject.RemoveFromRoom();
self.room.abstractRoom.RemoveEntity(obj);
AbstractSpear eSpear = new AbstractSpear(self.room.world, null, self.abstractCreature.pos, self.room.game.GetNewID(), false, true);
self.room.abstractRoom.AddEntity(eSpear);
eSpear.RealizeInRoom();
if (self.FreeHand() != -1)
{
self.SlugcatGrab(eSpear.realizedObject, self.FreeHand());
}
return;
}
}
}
}
Then, you can replace "YOUR SLUGCAT'S ID" with whatever your slugcat's ID is. I probably didn't need to hook into all three methods, to be honest, but this is how the game does it, and it keeps it from getting too clunky with long if() statements. This is almost exactly copying Artificer's ability code to make sure that it functions the way you want it to.