Exemplo n.º 1
0
        private static void ApplyAllHooks()
        {
            Debug.Log("Applying monkland");

            #region Entities
            AbstractPhysicalObjectHK.ApplyHook();
            CreatureHK.ApplyHook();
            PlayerGraphicsHK.ApplyHook();
            PlayerHK.ApplyHook();
            RockHK.ApplyHook();
            RoomHK.ApplyHook();
            SpearHK.ApplyHook();
            WeaponHK.ApplyHook();
            #endregion Entities

            #region Menus
            MainMenuHK.ApplyHook();
            HUDHK.ApplyHook();
            //RainMeterHK.ApplyHook();
            #endregion Menus

            #region OverWorld
            AbstractRoomHK.ApplyHook();
            OverWorldHK.ApplyHook();
            ShortcutHandlerHK.ApplyHook();
            #endregion OverWorld

            #region Others
            ProcessManagerHK.ApplyHook();
            RainWorldGameHK.ApplyHook();
            RainWorldHK.ApplyHook();
            #endregion Others
        }
Exemplo n.º 2
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--;
                    }
                }
            }
        }
Exemplo n.º 3
0
 private static void InGameClear()
 {
     AbstractPhysicalObjectHK.ClearFields();
     AbstractRoomHK.ClearField();
 }