Skip to content

Commit

Permalink
actually place pearl in front of scar when regurgitating
Browse files Browse the repository at this point in the history
  • Loading branch information
woutkolkman committed Mar 17, 2023
1 parent 6a76aae commit 7005fdc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions SpearmasterPearlStorage/Hooks.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,19 @@ static void PlayerRegurgitateHook(On.Player.orig_Regurgitate orig, Player self)

orig(self);

//TODO offset pearl downwards
if (!isSpearmaster)
return;

//place pearl in front of scar
if (!self.Stunned && temp.realizedObject?.firstChunk != null && self.bodyChunks?.Length >= 2)
temp.realizedObject.firstChunk.HardSetPosition(Vector2.Lerp(self.bodyChunks[0].pos, self.bodyChunks[1].pos, 0.5f));

//restore objectInStomach if pearl is extracted by Pebbles
if (isSpearmaster && self.Stunned)
if (self.Stunned)
self.objectInStomach = temp;

//reset to Spearmaster
if (isSpearmaster)
self.SlugCatClass = MoreSlugcats.MoreSlugcatsEnums.SlugcatStatsName.Spear;
self.SlugCatClass = MoreSlugcats.MoreSlugcatsEnums.SlugcatStatsName.Spear;
}


Expand Down
Binary file not shown.

0 comments on commit 7005fdc

Please sign in to comment.