Пример #1
0
        // Change slugcat stats
        private static void ArenaGameSession_ctor(On.ArenaGameSession.orig_ctor orig, ArenaGameSession self, RainWorldGame game)
        {
            orig(self, game);

            if (arenaCharacter.TryGet(self.game.manager.arenaSetup, out var ply))
            {
                switch (ply.type)
                {
                case PlayerDescriptor.Type.SlugBase:
                    ply.player.GetStatsInternal(self.characterStats);
                    break;

                case PlayerDescriptor.Type.Vanilla:
                    if (ply.index != 0)
                    {
                        self.characterStats = new SlugcatStats(ply.index, false);
                    }
                    break;
                }
            }
        }
Пример #2
0
 private static void ArenaGameSession_SpawnPlayers(On.ArenaGameSession.orig_SpawnPlayers orig, ArenaGameSession self, Room room, List <int> suggestedDens)
 {
     orig.Invoke(self, room, suggestedDens);
     if (!Downpour.dynamic)
     {
         if (Downpour.intensity == 1)
         {
             rainIntensity    = 0.31f;
             Downpour.dynamic = false;
         }
         if (Downpour.intensity == 2)
         {
             rainIntensity    = 0.6f;
             Downpour.dynamic = false;
         }
         if (Downpour.intensity == 3)
         {
             rainIntensity    = 1f;
             Downpour.dynamic = false;
         }
     }
     else
     {
         Downpour.dynamic = true;
         rainIntensity    = UnityEngine.Random.Range(0.3f, 1f);
     }
     startingIntensity = rainIntensity;
     Debug.Log("Current rain intensity: " + rainIntensity);
     if (self != null && room.roomRain != null)
     {
         for (int r = 0; r < room.TileWidth; r++)
         {
             if (room.Tiles[r, room.TileHeight - 1].Solid)
             {
                 ceilingCount++;
             }
         }
         if (ceilingCount < (room.Width * 0.95) && !noRain)
         {
             room.AddObject(new Preciptator(room, Downpour.snow));
         }
         ceilingCount = 0;
     }
 }