Exemplo n.º 1
0
 private static void Player_AddFood(On.Player.orig_AddFood orig, Player self, int add)
 {
     orig.Invoke(self, add);
     CheckPipsOverMax(self);
     KarmaAppetite.FoodToStats(self.slugcatStats, self.playerState.foodInStomach, self.Karma >= 9);
     KarmaAppetite.RefreshLight(self);
 }
 private static void PlayerProgression_SaveToDisk(On.PlayerProgression.orig_SaveToDisk orig, PlayerProgression self, bool saveCurrentState, bool saveMaps, bool saveMiscProg)
 {
     if (saveCurrentState && self.currentSaveState != null)
     {
         self.currentSaveState.theGlow = KarmaAppetite.GetGlow(self.currentSaveState.food, self.currentSaveState.deathPersistentSaveData.karma);
     }
     orig.Invoke(self, saveCurrentState, saveMaps, saveMiscProg);
 }
Exemplo n.º 3
0
    //PULL-OUT PRICE

    private static void Weapon_Grabbed(On.Weapon.orig_Grabbed orig, Weapon self, Creature.Grasp grasp)
    {
        if (self.mode == Weapon.Mode.StuckInWall && grasp.grabber is Player)
        {
            if (((Player)grasp.grabber).Karma < KarmaAppetite.STARTING_MAX_KARMA)
            {
                KarmaAppetite.RemoveQuarterFood((Player)grasp.grabber);
            }
        }
        orig.Invoke(self, grasp);
    }
Exemplo n.º 4
0
 private static void SpearOnBack_SpearToBack(On.Player.SpearOnBack.orig_SpearToBack orig, Player.SpearOnBack self, Spear spr)
 {
     if (spr.mode == Weapon.Mode.StuckInWall)
     {
         if (self.owner.Karma < KarmaAppetite.STARTING_MAX_KARMA)
         {
             KarmaAppetite.RemoveQuarterFood(self.owner);
         }
     }
     orig.Invoke(self, spr);
 }
 //APPETITE
 private static void FoodMeter_ctor(On.HUD.FoodMeter.orig_ctor orig, HUD.FoodMeter self, HUD.HUD hud, int maxFood, int survivalLimit)
 {
     if (hud.owner is SlugcatSelectMenu.SlugcatPageContinue)
     {
         maxFood       = KarmaAppetite.GetFoodFromKarma(((SlugcatSelectMenu.SlugcatPageContinue)hud.owner).saveGameData.karma).x;
         survivalLimit = KarmaAppetite.GetFoodFromKarma(((SlugcatSelectMenu.SlugcatPageContinue)hud.owner).saveGameData.karma).y;
     }
     orig.Invoke(self, hud, maxFood, survivalLimit);
     if (hud.owner is Player && (hud.owner as Player).slugcatStats.name != SlugcatStats.Name.Red)
     {
         self.quarterPipShower = new FoodMeter.QuarterPipShower(self);
     }
 }
 public static void RefreshAllPlayers(StoryGameSession session)
 {
     foreach (AbstractCreature ac in session.Players)
     {
         if (ac.realizedCreature != null && ac.realizedCreature is Player)
         {
             Player player = ac.realizedCreature as Player;
             KarmaToFood(player.slugcatStats, player.Karma); //does not refresh the FoodMeter
             FoodToStats(player.slugcatStats, player.CurrentFood, player.Karma >= 9);
             KarmaAppetite.RefreshLight(player);
         }
     }
 }
    private static void StoryGameSession_ctor(On.StoryGameSession.orig_ctor orig, StoryGameSession self, int saveStateNumber, RainWorldGame game)
    {
        orig.Invoke(self, saveStateNumber, game);

        string saveFilePath = string.Concat(new object[]
        {
            Custom.RootFolderDirectory(),
            "UserData",
            Path.DirectorySeparatorChar,
            self.game.rainWorld.options.SaveFileName,
            ".txt"
        });

        if (!File.Exists(saveFilePath) || !game.manager.menuSetup.LoadInitCondition || self.saveState.cycleNumber == 0)         //New game
        {
            self.saveState.deathPersistentSaveData.theMark = true;
            if (self.saveState.deathPersistentSaveData.karmaCap < KarmaAppetite.STARTING_MAX_KARMA)
            {
                self.saveState.deathPersistentSaveData.karmaCap = KarmaAppetite.STARTING_MAX_KARMA;
            }
            if (self.saveStateNumber != 2)
            {
                self.saveState.denPosition = "SB_S07";
                if (self.saveState.miscWorldSaveData.privSlOracleState == null)
                {
                    self.saveState.miscWorldSaveData.privSlOracleState = new SLOrcacleState(false, saveStateNumber);
                }
                self.saveState.miscWorldSaveData.privSlOracleState.miscPearlCounter              = 6;
                self.saveState.miscWorldSaveData.privSlOracleState.totalPearlsBrought            = 6;
                self.saveState.miscWorldSaveData.privSlOracleState.neuronsLeft                   = 6;
                self.saveState.miscWorldSaveData.privSlOracleState.totNeuronsGiven               = 1;
                self.saveState.miscWorldSaveData.privSlOracleState.neuronGiveConversationCounter = 1;
                self.saveState.miscWorldSaveData.privSlOracleState.totalItemsBrought             = 7;
                self.saveState.miscWorldSaveData.privSlOracleState.playerEncountersWithMark      = 6;
                self.saveState.miscWorldSaveData.privSlOracleState.playerEncounters              = 7;
                self.saveState.miscWorldSaveData.privSlOracleState.likesPlayer                   = 1f;
                KarmaAppetite_MoonFix.FixInfluenceCap(self.saveState.miscWorldSaveData.privSlOracleState);
            }
        }
        int neuronTresh = (self.saveState.saveStateNumber != 2) ? 6 : 5;
        int encTresh    = (self.saveState.saveStateNumber != 2) ? 7 : 0;

        KarmaAppetite_MoonFix.SetTreshholds(encTresh, neuronTresh);
        self.lastEverMetMoon = self.saveState.miscWorldSaveData.privSlOracleState != null && self.saveState.miscWorldSaveData.privSlOracleState.playerEncounters > encTresh;
        KarmaAppetite.KarmaToFood(self.characterStats, self.saveState.deathPersistentSaveData.karma);
        KarmaAppetite.FoodToStats(self.characterStats, self.saveState.food, self.saveState.deathPersistentSaveData.karma >= 9);
    }
 private static void SB_A14KarmaIncrease_Update(On.RoomSpecificScript.SB_A14KarmaIncrease.orig_Update orig, RoomSpecificScript.SB_A14KarmaIncrease self, bool eu)
 {
     orig.Invoke(self, eu);
     if (self.room.game.session is StoryGameSession)
     {
         KarmaAppetite.RefreshAllPlayers(self.room.game.session as StoryGameSession);
         foreach (AbstractCreature ac in (self.room.game.session as StoryGameSession).Players)
         {
             if (ac.realizedCreature != null && ac.realizedCreature is Player)
             {
                 Player     plr  = ac.realizedCreature as Player;
                 RoomCamera rCam = self.room.game.cameras[0];
                 foreach (RoomCamera.SpriteLeaser sLeaser in rCam.spriteLeasers)
                 {
                     if (sLeaser.drawableObject == plr.graphicsModule)
                     {
                         plr.graphicsModule.ApplyPalette(sLeaser, rCam, rCam.currentPalette);
                     }
                 }
             }
         }
     }
 }
Exemplo n.º 9
0
    //NO LIGHT FROM NEURONS

    private static void OracleSwarmer_BitByPlayer(On.OracleSwarmer.orig_BitByPlayer orig, OracleSwarmer self, Creature.Grasp grasp, bool eu)
    {
        orig.Invoke(self, grasp, eu);
        KarmaAppetite.RefreshLight(grasp.grabber as Player);
    }
Exemplo n.º 10
0
 private static void Player_SetMalnourished(On.Player.orig_SetMalnourished orig, Player self, bool m)
 {
     orig.Invoke(self, m);
     KarmaAppetite.KarmaToFood(self.slugcatStats, self.Karma);
     KarmaAppetite.FoodToStats(self.slugcatStats, self.playerState.foodInStomach, self.Karma >= 9);
 }