예제 #1
0
        private static bool CheckLocationChange(Farmer player, NetString currentLocation, NetLong playerId)
        {
            if (currentLocation != LastActions[playerId].LocationName)
            {
                LastActions[playerId] = new PlayerLastActivity
                {
                    Activity     = "warped",
                    LocationName = currentLocation,
                    When         = Game1.timeOfDay,
                    Hidden       = false
                };
                return(true);
            }

            return(false);
        }
예제 #2
0
        private bool CheckCutscene(Farmer player, NetLong playerId, NetString currentLocation)
        {
            if (player.hidden != LastActions[playerId].Hidden && currentLocation == LastActions[playerId].LocationName && !(player.isRidingHorse()))
            {
                LastActions[playerId] = new PlayerLastActivity
                {
                    Activity     = player.hidden ? "startevent" : "endevent",
                    When         = Game1.timeOfDay,
                    LocationName = currentLocation,
                    Hidden       = player.hidden?.Value ?? false
                };

                return(true);
            }
            return(false);
        }
예제 #3
0
        private static bool CheckUsingTool(Farmer player, NetLong playerId, NetString currentLocation)
        {
            if (player.UsingTool)
            {
                LastActions[playerId] = new PlayerLastActivity
                {
                    Activity     = player.CurrentTool?.Name.ToLower() ?? "N/A",
                    When         = Game1.timeOfDay,
                    LocationName = currentLocation,
                    Hidden       = player.hidden.Value
                };
                return(true);
            }

            return(false);
        }
예제 #4
0
        private bool CheckCutscene(Farmer player, NetLong playerId, NetString currentLocation)
        {
            if (player.hidden != LastActions[playerId].Hidden && !(player.isRidingHorse()))
            {
                if (ConfigHelper.GetOptions().ShowCutsceneInfoInChatBox)
                {
                    var verbed = player.hidden ? "entered a" : "finished the";
                    _helper.SelfInfoMessage($"{player.Name} has {verbed} cutscene.");
                }

                LastActions[playerId] = new PlayerLastActivity
                {
                    Activity     = "event",
                    When         = Game1.timeOfDay,
                    LocationName = currentLocation,
                    Hidden       = player.hidden?.Value ?? false
                };

                return(true);
            }

            return(false);
        }