Player sits correct direction, and started work on making furniture.
This commit is contained in:
parent
870dd12a6d
commit
87913f22ff
|
@ -0,0 +1,20 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace Revitalize.Framework
|
||||||
|
{
|
||||||
|
public class Enums
|
||||||
|
{
|
||||||
|
public enum Direction
|
||||||
|
{
|
||||||
|
Up,
|
||||||
|
Right,
|
||||||
|
Down,
|
||||||
|
Left
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
|
@ -33,6 +33,8 @@ namespace Revitalize.Framework.Objects
|
||||||
|
|
||||||
public LightManager lightManager;
|
public LightManager lightManager;
|
||||||
|
|
||||||
|
public Enums.Direction facingDirection;
|
||||||
|
|
||||||
public BasicItemInformation()
|
public BasicItemInformation()
|
||||||
{
|
{
|
||||||
this.name = "";
|
this.name = "";
|
||||||
|
@ -50,6 +52,8 @@ namespace Revitalize.Framework.Objects
|
||||||
this.drawColor = Color.White;
|
this.drawColor = Color.White;
|
||||||
this.inventory = new InventoryManager();
|
this.inventory = new InventoryManager();
|
||||||
this.lightManager = new LightManager();
|
this.lightManager = new LightManager();
|
||||||
|
|
||||||
|
this.facingDirection = Enums.Direction.Down;
|
||||||
}
|
}
|
||||||
|
|
||||||
public BasicItemInformation(string name, string description, string categoryName, Color categoryColor, int edibility, int fragility, bool isLamp, int price, Vector2 TileLocation, bool canBeSetOutdoors, bool canBeSetIndoors, string id, string data, Texture2D texture, Color color, int tileIndex, bool bigCraftable, Type type, CraftingData craftingData, AnimationManager animationManager, Color drawColor, bool ignoreBoundingBox, InventoryManager Inventory, LightManager Lights) : base(id, data, texture, color, tileIndex, bigCraftable, type, craftingData)
|
public BasicItemInformation(string name, string description, string categoryName, Color categoryColor, int edibility, int fragility, bool isLamp, int price, Vector2 TileLocation, bool canBeSetOutdoors, bool canBeSetIndoors, string id, string data, Texture2D texture, Color color, int tileIndex, bool bigCraftable, Type type, CraftingData craftingData, AnimationManager animationManager, Color drawColor, bool ignoreBoundingBox, InventoryManager Inventory, LightManager Lights) : base(id, data, texture, color, tileIndex, bigCraftable, type, craftingData)
|
||||||
|
@ -82,6 +86,7 @@ namespace Revitalize.Framework.Objects
|
||||||
this.recreateDataString();
|
this.recreateDataString();
|
||||||
this.inventory = Inventory ?? new InventoryManager();
|
this.inventory = Inventory ?? new InventoryManager();
|
||||||
this.lightManager = Lights ?? new LightManager();
|
this.lightManager = Lights ?? new LightManager();
|
||||||
|
this.facingDirection = Enums.Direction.Down;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void recreateDataString()
|
public void recreateDataString()
|
||||||
|
|
|
@ -70,7 +70,7 @@ namespace Revitalize.Framework.Objects
|
||||||
|
|
||||||
public override bool isPassable()
|
public override bool isPassable()
|
||||||
{
|
{
|
||||||
return this.info.ignoreBoundingBox;
|
return this.info.ignoreBoundingBox || Revitalize.ModCore.playerInfo.sittingInfo.SittingObject==this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override Rectangle getBoundingBox(Vector2 tileLocation)
|
public override Rectangle getBoundingBox(Vector2 tileLocation)
|
||||||
|
|
|
@ -0,0 +1,12 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace Revitalize.Framework.Objects.Furniture
|
||||||
|
{
|
||||||
|
class Chair
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,29 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using Revitalize.Framework.Objects.InformationFiles;
|
||||||
|
using Revitalize.Framework.Objects.InformationFiles.Furniture;
|
||||||
|
|
||||||
|
namespace Revitalize.Framework.Objects.Furniture
|
||||||
|
{
|
||||||
|
public class FurnitureTileComponent:MultiTiledComponent
|
||||||
|
{
|
||||||
|
public FurnitureInformation furnitureInfo;
|
||||||
|
|
||||||
|
|
||||||
|
public FurnitureTileComponent():base()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public FurnitureTileComponent(BasicItemInformation itemInfo,FurnitureInformation furnitureInfo):base(itemInfo)
|
||||||
|
{
|
||||||
|
this.furnitureInfo = furnitureInfo;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,23 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace Revitalize.Framework.Objects.InformationFiles.Furniture
|
||||||
|
{
|
||||||
|
public class ChairInformation:FurnitureInformation
|
||||||
|
{
|
||||||
|
public bool canSitHere;
|
||||||
|
|
||||||
|
public ChairInformation():base()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public ChairInformation(bool CanSitHere) : base()
|
||||||
|
{
|
||||||
|
this.canSitHere = CanSitHere;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,16 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace Revitalize.Framework.Objects.InformationFiles.Furniture
|
||||||
|
{
|
||||||
|
public class FurnitureInformation
|
||||||
|
{
|
||||||
|
public FurnitureInformation()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,4 +1,5 @@
|
||||||
using Microsoft.Xna.Framework;
|
using Microsoft.Xna.Framework;
|
||||||
|
using Revitalize.Framework.Objects;
|
||||||
using StardewValley;
|
using StardewValley;
|
||||||
|
|
||||||
namespace Revitalize.Framework.Player.Managers
|
namespace Revitalize.Framework.Player.Managers
|
||||||
|
@ -24,6 +25,15 @@ namespace Revitalize.Framework.Player.Managers
|
||||||
/// <summary>How long a player has to sit to recover energy/health;</summary>
|
/// <summary>How long a player has to sit to recover energy/health;</summary>
|
||||||
public int SittingSpan { get; }
|
public int SittingSpan { get; }
|
||||||
|
|
||||||
|
StardewValley.Object sittingObject;
|
||||||
|
|
||||||
|
public StardewValley.Object SittingObject
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return this.sittingObject;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>Construct an instance.</summary>
|
/// <summary>Construct an instance.</summary>
|
||||||
public SittingInfo()
|
public SittingInfo()
|
||||||
|
@ -41,6 +51,7 @@ namespace Revitalize.Framework.Player.Managers
|
||||||
{
|
{
|
||||||
this.isSitting = false;
|
this.isSitting = false;
|
||||||
this.elapsedTime = 0;
|
this.elapsedTime = 0;
|
||||||
|
this.sittingObject = null;
|
||||||
}
|
}
|
||||||
if (this.isSitting && Game1.player.CanMove)
|
if (this.isSitting && Game1.player.CanMove)
|
||||||
{
|
{
|
||||||
|
@ -55,12 +66,14 @@ namespace Revitalize.Framework.Player.Managers
|
||||||
Game1.player.health++;
|
Game1.player.health++;
|
||||||
Game1.player.Stamina++;
|
Game1.player.Stamina++;
|
||||||
}
|
}
|
||||||
ModCore.log(this.elapsedTime);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void showSitting()
|
public void showSitting()
|
||||||
{
|
{
|
||||||
|
if (this.sittingObject == null)
|
||||||
|
{
|
||||||
|
Revitalize.ModCore.log("Does THIS HAPPEN AT ALL???");
|
||||||
switch (Game1.player.FacingDirection)
|
switch (Game1.player.FacingDirection)
|
||||||
{
|
{
|
||||||
case 0:
|
case 0:
|
||||||
|
@ -77,12 +90,38 @@ namespace Revitalize.Framework.Player.Managers
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if(this.sittingObject is CustomObject)
|
||||||
|
{
|
||||||
|
Game1.player.faceDirection((int)(this.sittingObject as CustomObject).info.facingDirection);
|
||||||
|
switch ((this.sittingObject as CustomObject).info.facingDirection)
|
||||||
|
{
|
||||||
|
|
||||||
|
case Enums.Direction.Up:
|
||||||
|
|
||||||
|
Game1.player.FarmerSprite.setCurrentSingleFrame(113);
|
||||||
|
break;
|
||||||
|
case Enums.Direction.Right:
|
||||||
|
Game1.player.FarmerSprite.setCurrentSingleFrame(106);
|
||||||
|
break;
|
||||||
|
case Enums.Direction.Down:
|
||||||
|
Game1.player.FarmerSprite.setCurrentSingleFrame(107);
|
||||||
|
break;
|
||||||
|
case Enums.Direction.Left:
|
||||||
|
Game1.player.FarmerSprite.setCurrentSingleFrame(106,32000,false,true);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void sit(StardewValley.Object obj, Vector2 offset)
|
public void sit(StardewValley.Object obj, Vector2 offset)
|
||||||
{
|
{
|
||||||
this.isSitting = true;
|
this.isSitting = true;
|
||||||
Game1.player.Position = (obj.TileLocation * Game1.tileSize + offset);
|
Game1.player.Position = (obj.TileLocation * Game1.tileSize + offset);
|
||||||
Game1.player.position.Y += Game1.tileSize / 2;
|
Game1.player.position.Y += Game1.tileSize / 2;
|
||||||
|
this.sittingObject = obj;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -44,6 +44,12 @@ namespace Revitalize
|
||||||
// -Spell books
|
// -Spell books
|
||||||
// -Potions!
|
// -Potions!
|
||||||
// -Magic Meter
|
// -Magic Meter
|
||||||
|
// -Connected chests much like Project EE2 from MC
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// -Bigger chests
|
||||||
|
//
|
||||||
// Festivals
|
// Festivals
|
||||||
// -Firework festival?
|
// -Firework festival?
|
||||||
// Stargazing???
|
// Stargazing???
|
||||||
|
@ -54,6 +60,7 @@ namespace Revitalize
|
||||||
//
|
//
|
||||||
// Equippables!
|
// Equippables!
|
||||||
// -accessories that provide buffs/regen/friendship
|
// -accessories that provide buffs/regen/friendship
|
||||||
|
// -braclets/rings/broaches....more crafting for these???
|
||||||
//
|
//
|
||||||
// Music???
|
// Music???
|
||||||
// -IDK maybe add in instruments???
|
// -IDK maybe add in instruments???
|
||||||
|
@ -74,6 +81,12 @@ namespace Revitalize
|
||||||
// -Small Island Home?
|
// -Small Island Home?
|
||||||
//
|
//
|
||||||
// More crops
|
// More crops
|
||||||
|
//
|
||||||
|
// More monsters
|
||||||
|
// -boss fights
|
||||||
|
//
|
||||||
|
// More dungeons??
|
||||||
|
|
||||||
|
|
||||||
public class ModCore : Mod
|
public class ModCore : Mod
|
||||||
{
|
{
|
||||||
|
|
|
@ -47,6 +47,7 @@
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Compile Include="Framework\Crafting\Recipe.cs" />
|
<Compile Include="Framework\Crafting\Recipe.cs" />
|
||||||
|
<Compile Include="Framework\Enums\Enums.cs" />
|
||||||
<Compile Include="Framework\Environment\DarkerNight.cs" />
|
<Compile Include="Framework\Environment\DarkerNight.cs" />
|
||||||
<Compile Include="Framework\Environment\DarkerNightConfig.cs" />
|
<Compile Include="Framework\Environment\DarkerNightConfig.cs" />
|
||||||
<Compile Include="Framework\Graphics\Animations\Animation.cs" />
|
<Compile Include="Framework\Graphics\Animations\Animation.cs" />
|
||||||
|
|
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue