Fixed ore vein spawning code to spawn ores in the correct spot now.
This commit is contained in:
parent
ce904efef3
commit
9b8c469eb6
|
@ -87,6 +87,7 @@ namespace Revitalize.Framework.Objects
|
|||
|
||||
if (this.location == null) this.location = Game1.player.currentLocation;
|
||||
this.TileLocation = new Vector2((int)(x / Game1.tileSize), (int)(y / Game1.tileSize));
|
||||
//ModCore.log("TileLocation: " + this.TileLocation);
|
||||
/*
|
||||
return base.placementAction(location, x, y, who);
|
||||
*/
|
||||
|
|
|
@ -63,7 +63,8 @@ namespace Revitalize.Framework.Objects
|
|||
bool spawnable = this.canResourceBeSpawnedHere(spawn, Location, TilePosition);
|
||||
if (spawnable)
|
||||
{
|
||||
spawn.placementAction(Location, (int)TilePosition.X, (int)TilePosition.Y);
|
||||
//ModCore.log("Location is: " + Location.Name);
|
||||
spawn.placementAction(Location, (int)TilePosition.X*Game1.tileSize, (int)TilePosition.Y*Game1.tileSize,Game1.player);
|
||||
ModCore.log("This works!");
|
||||
}
|
||||
else
|
||||
|
@ -98,7 +99,7 @@ namespace Revitalize.Framework.Objects
|
|||
/// <param name="Location"></param>
|
||||
/// <param name="TilePosition"></param>
|
||||
/// <returns></returns>
|
||||
public bool canResourceBeSpawnedHere(StardewValley.Object OBJ,GameLocation Location, Vector2 TilePosition)
|
||||
public bool canResourceBeSpawnedHere(MultiTiledObject OBJ,GameLocation Location, Vector2 TilePosition)
|
||||
{
|
||||
return OBJ.canBePlacedHere(Location, TilePosition);
|
||||
}
|
||||
|
|
|
@ -81,12 +81,12 @@ namespace Revitalize.Framework.Objects.Resources.OreVeins
|
|||
|
||||
if(t is StardewValley.Tools.Pickaxe)
|
||||
{
|
||||
ModCore.log("Hit the ore vein with a pickaxe!");
|
||||
//ModCore.log("Hit the ore vein with a pickaxe!");
|
||||
this.damage((t as StardewValley.Tools.Pickaxe).UpgradeLevel+1);
|
||||
if (this.location != null)
|
||||
{
|
||||
this.location.playSound("hammer");
|
||||
ModCore.log("Ore has this much health left: "+this.health);
|
||||
//ModCore.log("Ore has this much health left: "+this.health);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
@ -105,6 +105,10 @@ namespace Revitalize.Framework.Objects.Resources.OreVeins
|
|||
//return base.onExplosion(who, location);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Applies damage to the ore vein.
|
||||
/// </summary>
|
||||
/// <param name="amount"></param>
|
||||
public void damage(int amount)
|
||||
{
|
||||
if (amount <= 0) return;
|
||||
|
@ -118,6 +122,9 @@ namespace Revitalize.Framework.Objects.Resources.OreVeins
|
|||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Destroys this tile for the ore vein.
|
||||
/// </summary>
|
||||
public void destoryVein()
|
||||
{
|
||||
int amount = Game1.random.Next(this.resourceInfo.minDropAmount, this.resourceInfo.maxDropAmount);
|
||||
|
|
|
@ -385,7 +385,7 @@ namespace Revitalize
|
|||
*/
|
||||
//Game1.player.addItemToInventory(ObjectManager.resources.ores["Test"].getOne());
|
||||
|
||||
ObjectManager.resources.spawnOreVein("Test", new Vector2(4, 4));
|
||||
ObjectManager.resources.spawnOreVein("Test", new Vector2(8, 7));
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
Loading…
Reference in New Issue