コード例 #1
0
        //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//
        //          SMAPI Events       //
        //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//

        #region
        /// <summary>
        /// What happens when the player warps maps.
        /// </summary>
        /// <param name="o"></param>
        /// <param name="playerWarped"></param>
        public void OnPlayerLocationChanged(object o, EventArgs playerWarped)
        {
            this.spawnOreInMine();
            if (LocationUtilities.IsPlayerInMine() == false && LocationUtilities.IsPlayerInSkullCave() == false && LocationUtilities.IsPlayerInMineEnterance() == false)
            {
                this.visitedFloors.Clear();
            }
        }
コード例 #2
0
 /// <summary>
 /// Checks to see if the resource can spawn at the given game location.
 /// </summary>
 /// <param name="Location"></param>
 /// <returns></returns>
 public override bool canSpawnAtLocation(GameLocation Location)
 {
     if (this.spawnsOnFarm && Location is StardewValley.Farm)
     {
         return(true);
     }
     if (this.spawnsInQuarry && Location is StardewValley.Locations.Mountain)
     {
         return(true);
     }
     if (this.spawnInRegularMine && LocationUtilities.IsPlayerInMine())
     {
         return(true);
     }
     if (this.spawnInSkullCavern && LocationUtilities.IsPlayerInSkullCave())
     {
         return(true);
     }
     return(false);
 }