Пример #1
0
 private static void JellyFish_BitByPlayer(On.JellyFish.orig_BitByPlayer orig, JellyFish self, Creature.Grasp grasp, bool eu)
 {
     orig.Invoke(self, grasp, eu);
     for (int i = 0; i < 2; i++)
     {
         self.room.AddObject(new BloodParticle(self.bodyChunks[0].pos, new Vector2(UnityEngine.Random.Range(-3f, 3f), UnityEngine.Random.Range(1f, 5f)), BloodMod.creatureColors["JellyFish"], "JellyFish", null, 1.3f));
     }
 }
Пример #2
0
 private void JellyFishBiteHook(On.JellyFish.orig_BitByPlayer orig, JellyFish self, Creature.Grasp grasp, bool eu)
 {
     if (grasp.grabber is Player && (grasp.grabber as Player).playerState.slugcatCharacter == PlayerManager.GetCustomPlayer("Electric").SlugcatIndex)
     {
         self.bites--;
         self.room.PlaySound((self.bites != 0) ? SoundID.Slugcat_Bite_Jelly_Fish : SoundID.Slugcat_Eat_Jelly_Fish, self.firstChunk.pos);
         self.firstChunk.MoveFromOutsideMyUpdate(eu, grasp.grabber.mainBodyChunk.pos);
         if (!self.AbstrConsumable.isConsumed)
         {
             self.AbstrConsumable.Consume();
         }
         for (int i = 0; i < self.tentacles.Length; i++)
         {
             for (int j = 0; j < self.tentacles[i].GetLength(0); j++)
             {
                 self.tentacles[i][j, 0] = Vector2.Lerp(self.tentacles[i][j, 0], self.firstChunk.pos, 0.2f);
             }
         }
         if (self.bites < 1)
         {
             for (int i = 0; i < EVars.Count; i++)
             {
                 if (EVars[i].ply == (grasp.grabber as Player))
                 {
                     EVars[i].EnterChargedModeNoToll();
                 }
             }
             //(grasp.grabber as Player).ObjectEaten(self);
             grasp.Release();
             self.Destroy();
         }
     }
     else
     {
         orig.Invoke(self, grasp, eu);
     }
 }