Ejemplo n.º 1
0
        /// <summary>
        /// Entity Live Updates HERE
        /// </summary>
        private static void UpdateHK(On.Room.orig_Update orig, Room self)
        {
            orig(self);
            if (MonklandSteamManager.isInGame)
            {
                /*
                 * if (MonklandSteamManager.gameMode == MonklandSteamManager.GameMode.BattleRoyale && MonklandSteamManager.WorldManager.sessionTotalCycles >= 0)
                 * {
                 *
                 *  if (AbstractRoomHK.GetField(self.abstractRoom).battleRain == null)
                 *  {
                 *      AbstractRoomHK.GetField(self.abstractRoom).battleRain = new BattleRoomRain(self);
                 *      self.AddObject(AbstractRoomHK.GetField(self.abstractRoom).battleRain);
                 *  }
                 *
                 * }
                 */

                if (MonklandSteamManager.WorldManager.commonRooms.ContainsKey(self.abstractRoom.index) && self.game.Players[0].realizedObject != null && self.game.Players[0].Room.name == self.abstractRoom.name)
                {
                    AbsRoomFields field = AbstractRoomHK.GetField(self.abstractRoom);
                    MonklandSteamManager.EntityManager.Send(self.game.Players[0].realizedObject, MonklandSteamManager.WorldManager.commonRooms[self.abstractRoom.index]);
                    for (int i = 0; i < self.physicalObjects.Length; i++)
                    {
                        for (int j = 0; j < self.physicalObjects[i].Count; j++)
                        {
                            if (self.physicalObjects[i][j] != null && self.physicalObjects[i][j].abstractPhysicalObject != null && AbstractPhysicalObjectHK.GetField(self.physicalObjects[i][j].abstractPhysicalObject).owner == NetworkGameManager.playerID)
                            {
                                if (self.physicalObjects[i][j] is Rock)
                                {
                                    if (field.syncDelay == 0)
                                    {
                                        MonklandSteamManager.EntityManager.Send(self.physicalObjects[i][j] as Rock, MonklandSteamManager.WorldManager.commonRooms[self.abstractRoom.index], true);
                                    }
                                }
                                else if (self.physicalObjects[i][j] is Spear)
                                {
                                    if (field.syncDelay == 0)
                                    {
                                        MonklandSteamManager.EntityManager.Send(self.physicalObjects[i][j] as Spear, MonklandSteamManager.WorldManager.commonRooms[self.abstractRoom.index], true);
                                    }
                                }
                            }
                        }
                    }
                    if (field.syncDelay <= 0)
                    {
                        field.syncDelay = 20;
                    }
                    else
                    {
                        field.syncDelay--;
                    }
                }
            }
        }
Ejemplo n.º 2
0
    private static void Room_Update(On.Room.orig_Update orig, Room self)
    {
        //Track creatures which have been grabbed by vultures, remove them from the list if no longer grabbed
        orig.Invoke(self);
        if (BloodMod.chunkTracker != null && BloodMod.chunkTracker.Count > 0)
        {
            for (int i = 0; i < BloodMod.chunkTracker.Count; i++)
            {
                if (BloodMod.chunkTracker[i].owner is Creature)
                {
                    if ((BloodMod.chunkTracker[i].owner as Creature).grabbedBy == null)
                    {
                        BloodMod.chunkTracker.RemoveAt(i);
                    }
                }
            }
        }
        Player player = (self.game.Players.Count <= 0) ? null : (self.game.Players[0].realizedCreature as Player);

        if (player != null && !player.dead)
        {
            BloodMod.impaled = false;
        }
    }
Ejemplo n.º 3
0
 private static void Room_Update(On.Room.orig_Update orig, Room self)
 {
     orig(self);
 }
Ejemplo n.º 4
0
 private static void Room_Update(On.Room.orig_Update orig, Room self)
 {
     orig.Invoke(self);
     if (Downpour.snow && Downpour.blizzard && self.world.rainCycle.RainDarkPalette > 0f)
     {
         //Update exposure
         if (Downpour.exposureControllers != null & Downpour.exposureControllers.Count > 0)
         {
             for (int i = 0; i < Downpour.exposureControllers.Count; i++)
             {
                 Downpour.exposureControllers[i].Update();
             }
         }
     }
     if (Downpour.debug)
     {
         //Decrease Intensity
         if (Input.GetKey(KeyCode.Alpha1))
         {
             rainIntensity -= 0.005f;
             if (rainIntensity < 0f)
             {
                 rainIntensity = 0f;
             }
             Debug.Log("Rain Intensity = " + rainIntensity);
         }
         //Increase Intensity
         if (Input.GetKey(KeyCode.Alpha2))
         {
             rainIntensity += 0.005f;
             if (rainIntensity > 1f)
             {
                 rainIntensity = 1f;
             }
             Debug.Log("Rain Intensity = " + rainIntensity);
         }
         //Show Room X and Y pos
         if (Input.GetKey(KeyCode.Alpha3))
         {
             if (self.BeingViewed)
             {
                 Debug.Log("---ROOM POSITION---");
                 Debug.Log("X POS: " + self.abstractRoom.mapPos.x.ToString());
                 Debug.Log("Y POS: " + self.abstractRoom.mapPos.y.ToString());
             }
         }
         if (Input.GetKeyDown(KeyCode.Alpha4))
         {
             if (self.BeingViewed)
             {
                 Downpour.direction++;
                 if (Downpour.direction > 3)
                 {
                     Downpour.direction = 1;
                 }
                 Debug.Log("Direction: " + Downpour.direction);
             }
         }
         //Fast Forward Cycle Timer
         if (Input.GetKey(KeyCode.Alpha5))
         {
             self.world.rainCycle.timer += 25;
         }
     }
     //Rain intensity increases with cycle duration if in dynamic mode
     if (Downpour.dynamic && !noRainThisCycle && self.BeingViewed)
     {
         if (self.world.rainCycle.RainDarkPalette <= 0)
         {
             rainIntensity = Mathf.Lerp(startingIntensity, 1f, self.world.rainCycle.CycleProgression);
         }
         else
         {
             rainIntensity = Mathf.Lerp(0.95f, 0f, self.world.rainCycle.RainDarkPalette);
         }
     }
 }