Пример #1
0
 /// <summary>
 /// The main entry point for the application.
 /// </summary>
 static void Main(string[] args)
 {
     using (Hearthstone game = new Hearthstone())
     {
         game.Run();
     }
 }
Пример #2
0
        private void Update()
        {
            Player __instance = Player.m_localPlayer;

            if (Player.m_localPlayer is null)
            {
                return;
            }

            if (__instance.m_hovering)
            {
                Interactable componentInParent = __instance.m_hovering.GetComponentInParent <Interactable>();
                if (componentInParent != null)
                {
                    if (componentInParent is Bed)
                    {
                        Bed bed = (Bed)componentInParent;

                        if (bed.IsMine())
                        {
                            if (Input.GetKeyDown(KeyCode.P))
                            {
                                Hearthstone.SetHearthStonePosition();
                                Player.m_localPlayer.Message(MessageHud.MessageType.Center, "Here is your new Hearthstone spawn", 0, null);
                            }
                        }
                    }
                }
            }
        }
Пример #3
0
            private static bool Prefix(ItemDrop.ItemData item)
            {
                if (item.m_shared.m_name == "Hearthstone")
                {
                    if (!Player.m_localPlayer.IsTeleportable() && !Hearthstone.allowTeleportWithoutRestriction.Value)
                    {
                        Player.m_localPlayer.Message(MessageHud.MessageType.Center, "You can't teleport carrying those items");
                        return(false);
                    }

                    Vector3 teleportPosition = Hearthstone.GetHearthStonePosition();

                    if (teleportPosition == Vector3.zero)
                    {
                        Player.m_localPlayer.Message(MessageHud.MessageType.Center, "You need to set hearthstone spawn point");
                        return(false);
                    }

                    Player.m_localPlayer.TeleportTo(teleportPosition, Player.m_localPlayer.transform.rotation, true);
                }

                return(true);
            }