Updated most core objects to have a color attached to them for coloring purposes. Also finally finished GiftPackage to have contents in name, and Adjustable lights to do that dynamic recoloring thing I wanted.

This commit is contained in:
Joshua Navarro 2017-02-28 02:53:12 -08:00
parent b09f0aedfe
commit c7b93c66df
18 changed files with 156 additions and 409 deletions

View File

@ -299,7 +299,7 @@ namespace Revitalize
// objShopList.Add(new Spawner(3, Vector2.Zero, 9));
objShopList.Add(new Light(0, Vector2.Zero, LightColors.Aquamarine));
objShopList.Add(new Light(0, Vector2.Zero, LightColors.Aquamarine,LightColors.Aquamarine,false));
objShopList.Add(new Quarry(3, Vector2.Zero,9,"copper"));
objShopList.Add(new Quarry(3, Vector2.Zero, 9, "iron"));
objShopList.Add(new Decoration(3, Vector2.Zero));
@ -316,7 +316,7 @@ namespace Revitalize
newInventory.Add(v);
// Log.AsyncG("GRRR");
}
objShopList.Add(new GiftPackage(1120, Vector2.Zero,newInventory));
objShopList.Add(new GiftPackage(1,"Generic Gift Package",Vector2.Zero,newInventory,1000,Util.invertColor(LightColors.Orange)));
// my_shop_list.Add((new Decoration(1120, Vector2.Zero)));
objShopList.Add(new ExtraSeeds(1, Vector2.Zero));

View File

@ -97,6 +97,8 @@ namespace Revitalize
public string locationsName;
public Color drawColor;
public override string Name
{
get

View File

@ -26,7 +26,6 @@ namespace Revitalize.Objects
public int spellCostModifierInt;
public float spellCostModifierPercent;
public Color bookColor;
public int spellIndex;
public override string Name
{
@ -58,11 +57,12 @@ namespace Revitalize.Objects
}
public Spell(int which,Vector2 Tile, SpellFunctionDataNode spellFunction, Color tomeColor,int textureIndex=0, int InventoryMaxSize = 0, bool isRemovable = true)
public Spell(int which,Vector2 Tile, SpellFunctionDataNode spellFunction,Color drawColor,int textureIndex=0, int InventoryMaxSize = 0, bool isRemovable = true)
{
InitializeBasics(InventoryMaxSize, Tile);
this.drawColor = drawColor;
spellIndex = which;
bookColor = tomeColor;
magicToCast.Add(spellFunction);
removable = isRemovable;
this.lightColor = Color.Black;
@ -134,7 +134,7 @@ namespace Revitalize.Objects
public Spell(int which, Vector2 Tile, List<SpellFunctionDataNode> spellFunctions,Color tomeColor,int textureIndex=0, int InventoryMaxSize = 0, bool isRemovable = true)
{
bookColor = tomeColor;
drawColor = tomeColor;
spellIndex = which;
InitializeBasics(InventoryMaxSize, Tile);
@ -888,7 +888,7 @@ namespace Revitalize.Objects
public override void drawWhenHeld(SpriteBatch spriteBatch, Vector2 objectPosition, Farmer f)
{
spriteBatch.Draw(this.TextureSheet, objectPosition, new Microsoft.Xna.Framework.Rectangle?(Game1.currentLocation.getSourceRectForObject(f.ActiveObject.ParentSheetIndex)), this.bookColor, 0f, Vector2.Zero, (float)Game1.pixelZoom, SpriteEffects.None, Math.Max(0f, (float)(f.getStandingY() + 2) / 10000f));
spriteBatch.Draw(this.TextureSheet, objectPosition, new Microsoft.Xna.Framework.Rectangle?(Game1.currentLocation.getSourceRectForObject(f.ActiveObject.ParentSheetIndex)), this.drawColor, 0f, Vector2.Zero, (float)Game1.pixelZoom, SpriteEffects.None, Math.Max(0f, (float)(f.getStandingY() + 2) / 10000f));
if (f.ActiveObject != null && f.ActiveObject.Name.Contains("="))
{
spriteBatch.Draw(Game1.objectSpriteSheet, objectPosition + new Vector2((float)(Game1.tileSize / 2), (float)(Game1.tileSize / 2)), new Microsoft.Xna.Framework.Rectangle?(Game1.currentLocation.getSourceRectForObject(f.ActiveObject.ParentSheetIndex)), Color.White, 0f, new Vector2((float)(Game1.tileSize / 2), (float)(Game1.tileSize / 2)), (float)Game1.pixelZoom + Math.Abs(Game1.starCropShimmerPause) / 8f, SpriteEffects.None, Math.Max(0f, (float)(f.getStandingY() + 2) / 10000f));
@ -907,18 +907,18 @@ namespace Revitalize.Objects
public override void drawInMenu(SpriteBatch spriteBatch, Vector2 location, float scaleSize, float transparency, float layerDepth, bool drawStackNumber)
{
spriteBatch.Draw(TextureSheet, location + new Vector2((float)(Game1.tileSize / 2), (float)(Game1.tileSize / 2)), new Rectangle?(this.defaultSourceRect),this.bookColor, 0f, new Vector2((float)(this.defaultSourceRect.Width / 2), (float)(this.defaultSourceRect.Height / 2)), 1f * this.getScaleSize() * scaleSize, SpriteEffects.None, layerDepth);
spriteBatch.Draw(TextureSheet, location + new Vector2((float)(Game1.tileSize / 2), (float)(Game1.tileSize / 2)), new Rectangle?(this.defaultSourceRect),this.drawColor, 0f, new Vector2((float)(this.defaultSourceRect.Width / 2), (float)(this.defaultSourceRect.Height / 2)), 1f * this.getScaleSize() * scaleSize, SpriteEffects.None, layerDepth);
}
public override void draw(SpriteBatch spriteBatch, int x, int y, float alpha = 1f)
{
if (x == -1)
{
spriteBatch.Draw(TextureSheet, Game1.GlobalToLocal(Game1.viewport, this.drawPosition), new Rectangle?(this.sourceRect), this.bookColor * alpha, 0f, Vector2.Zero, (float)Game1.pixelZoom, this.flipped ? SpriteEffects.FlipHorizontally : SpriteEffects.None, (this.Decoration_type == 12) ? 0f : ((float)(this.boundingBox.Bottom - 8) / 10000f));
spriteBatch.Draw(TextureSheet, Game1.GlobalToLocal(Game1.viewport, this.drawPosition), new Rectangle?(this.sourceRect), this.drawColor * alpha, 0f, Vector2.Zero, (float)Game1.pixelZoom, this.flipped ? SpriteEffects.FlipHorizontally : SpriteEffects.None, (this.Decoration_type == 12) ? 0f : ((float)(this.boundingBox.Bottom - 8) / 10000f));
}
else
{
spriteBatch.Draw(TextureSheet, Game1.GlobalToLocal(Game1.viewport, new Vector2((float)(x * Game1.tileSize), (float)(y * Game1.tileSize - (this.sourceRect.Height * Game1.pixelZoom - this.boundingBox.Height)))), new Rectangle?(this.sourceRect), this.bookColor * alpha, 0f, Vector2.Zero, (float)Game1.pixelZoom, this.flipped ? SpriteEffects.FlipHorizontally : SpriteEffects.None, (this.Decoration_type == 12) ? 0f : ((float)(this.boundingBox.Bottom - 8) / 10000f));
spriteBatch.Draw(TextureSheet, Game1.GlobalToLocal(Game1.viewport, new Vector2((float)(x * Game1.tileSize), (float)(y * Game1.tileSize - (this.sourceRect.Height * Game1.pixelZoom - this.boundingBox.Height)))), new Rectangle?(this.sourceRect), this.drawColor * alpha, 0f, Vector2.Zero, (float)Game1.pixelZoom, this.flipped ? SpriteEffects.FlipHorizontally : SpriteEffects.None, (this.Decoration_type == 12) ? 0f : ((float)(this.boundingBox.Bottom - 8) / 10000f));
}
if (this.heldObject != null)
{
@ -927,20 +927,19 @@ namespace Revitalize.Objects
(this.heldObject as Spell).drawAtNonTileSpot(spriteBatch, Game1.GlobalToLocal(Game1.viewport, new Vector2((float)(this.boundingBox.Center.X - Game1.tileSize / 2), (float)(this.boundingBox.Center.Y - (this.heldObject as Spell).sourceRect.Height * Game1.pixelZoom - Game1.tileSize / 4))), (float)(this.boundingBox.Bottom - 7) / 10000f, alpha);
return;
}
spriteBatch.Draw(Game1.shadowTexture, Game1.GlobalToLocal(Game1.viewport, new Vector2((float)(this.boundingBox.Center.X - Game1.tileSize / 2), (float)(this.boundingBox.Center.Y - Game1.tileSize * 4 / 3))) + new Vector2((float)(Game1.tileSize / 2), (float)(Game1.tileSize * 5 / 6)), new Rectangle?(Game1.shadowTexture.Bounds), this.bookColor * alpha, 0f, new Vector2((float)Game1.shadowTexture.Bounds.Center.X, (float)Game1.shadowTexture.Bounds.Center.Y), 4f, SpriteEffects.None, (float)this.boundingBox.Bottom / 10000f);
spriteBatch.Draw(Game1.objectSpriteSheet, Game1.GlobalToLocal(Game1.viewport, new Vector2((float)(this.boundingBox.Center.X - Game1.tileSize / 2), (float)(this.boundingBox.Center.Y - Game1.tileSize * 4 / 3))), new Rectangle?(Game1.currentLocation.getSourceRectForObject(this.heldObject.ParentSheetIndex)), this.bookColor * alpha, 0f, Vector2.Zero, (float)Game1.pixelZoom, SpriteEffects.None, (float)(this.boundingBox.Bottom + 1) / 10000f);
spriteBatch.Draw(Game1.shadowTexture, Game1.GlobalToLocal(Game1.viewport, new Vector2((float)(this.boundingBox.Center.X - Game1.tileSize / 2), (float)(this.boundingBox.Center.Y - Game1.tileSize * 4 / 3))) + new Vector2((float)(Game1.tileSize / 2), (float)(Game1.tileSize * 5 / 6)), new Rectangle?(Game1.shadowTexture.Bounds), this.drawColor * alpha, 0f, new Vector2((float)Game1.shadowTexture.Bounds.Center.X, (float)Game1.shadowTexture.Bounds.Center.Y), 4f, SpriteEffects.None, (float)this.boundingBox.Bottom / 10000f);
spriteBatch.Draw(Game1.objectSpriteSheet, Game1.GlobalToLocal(Game1.viewport, new Vector2((float)(this.boundingBox.Center.X - Game1.tileSize / 2), (float)(this.boundingBox.Center.Y - Game1.tileSize * 4 / 3))), new Rectangle?(Game1.currentLocation.getSourceRectForObject(this.heldObject.ParentSheetIndex)), this.drawColor * alpha, 0f, Vector2.Zero, (float)Game1.pixelZoom, SpriteEffects.None, (float)(this.boundingBox.Bottom + 1) / 10000f);
}
}
public override void drawAtNonTileSpot(SpriteBatch spriteBatch, Vector2 location, float layerDepth, float alpha = 1f)
{
spriteBatch.Draw(TextureSheet, location, new Rectangle?(this.sourceRect), this.bookColor * alpha, 0f, Vector2.Zero, (float)Game1.pixelZoom, this.flipped ? SpriteEffects.FlipHorizontally : SpriteEffects.None, layerDepth);
spriteBatch.Draw(TextureSheet, location, new Rectangle?(this.sourceRect), this.drawColor * alpha, 0f, Vector2.Zero, (float)Game1.pixelZoom, this.flipped ? SpriteEffects.FlipHorizontally : SpriteEffects.None, layerDepth);
}
public override Item getOne()
{
Spell Spell = new Spell(this.spellIndex, this.tileLocation, magicToCast ,this.bookColor, this.parentSheetIndex);
Log.AsyncG(this.bookColor);
Spell Spell = new Spell(this.spellIndex, this.tileLocation, magicToCast ,this.drawColor, this.parentSheetIndex);
/*
drawPosition = this.drawPosition;
defaultBoundingBox = this.defaultBoundingBox;

View File

@ -49,6 +49,8 @@ namespace Revitalize.Menus
{
this.tabs.Add(new ClickableComponent(new Rectangle(this.xPositionOnScreen + Game1.tileSize, this.yPositionOnScreen + IClickableMenu.tabYPositionRelativeToMenuY + Game1.tileSize, Game1.tileSize, Game1.tileSize), "inventory", Game1.content.LoadString("Strings\\UI:GameMenu_Inventory", new object[0])));
this.pages.Add(new Revitalize.Menus.InventoryPage(this.xPositionOnScreen, this.yPositionOnScreen, this.width, this.height));
this.tabs.Add(new ClickableComponent(new Rectangle(this.xPositionOnScreen + Game1.tileSize * 2, this.yPositionOnScreen + IClickableMenu.tabYPositionRelativeToMenuY + Game1.tileSize, Game1.tileSize, Game1.tileSize), "skills", Game1.content.LoadString("Strings\\UI:GameMenu_Skills", new object[0])));
this.pages.Add(new SkillsPage(this.xPositionOnScreen, this.yPositionOnScreen, this.width, this.height));
this.tabs.Add(new ClickableComponent(new Rectangle(this.xPositionOnScreen + Game1.tileSize * 3, this.yPositionOnScreen + IClickableMenu.tabYPositionRelativeToMenuY + Game1.tileSize, Game1.tileSize, Game1.tileSize), "social", Game1.content.LoadString("Strings\\UI:GameMenu_Social", new object[0])));
@ -63,6 +65,7 @@ namespace Revitalize.Menus
this.pages.Add(new OptionsPage(this.xPositionOnScreen, this.yPositionOnScreen, this.width - Game1.tileSize - Game1.tileSize / 4, this.height));
this.tabs.Add(new ClickableComponent(new Rectangle(this.xPositionOnScreen + Game1.tileSize * 8, this.yPositionOnScreen + IClickableMenu.tabYPositionRelativeToMenuY + Game1.tileSize, Game1.tileSize, Game1.tileSize), "exit", Game1.content.LoadString("Strings\\UI:GameMenu_Exit", new object[0])));
this.pages.Add(new ExitPage(this.xPositionOnScreen, this.yPositionOnScreen, this.width - Game1.tileSize - Game1.tileSize / 4, this.height));
if (Game1.activeClickableMenu == null)
{
Game1.playSound("bigSelect");

View File

@ -626,14 +626,14 @@ namespace Revitalize.Menus
Utility.drawTextWithShadow(b, text3, Game1.dialogueFont, new Vector2((float)(this.xPositionOnScreen + Game1.tileSize * 8 + Game1.tileSize / 2) - Game1.dialogueFont.MeasureString(text3).X / 2f, (float)(this.yPositionOnScreen + IClickableMenu.borderWidth + IClickableMenu.spaceToClearTopBorder + 6 * Game1.tileSize - Game1.pixelZoom)), Game1.textColor, 1f, -1f, -1, -1, 1f, 3);
if (Game1.player != null)
{
/*
if (Game1.player.hasPet())
{
string petName = Game1.player.getPetName();
Utility.drawTextWithShadow(b, petName, Game1.dialogueFont, new Vector2((float)(this.xPositionOnScreen + Game1.tileSize * 5) + Math.Max((float)Game1.tileSize, Game1.dialogueFont.MeasureString(Game1.player.name).X / 2f), (float)(this.yPositionOnScreen + IClickableMenu.borderWidth + IClickableMenu.spaceToClearTopBorder + 7 * Game1.tileSize + Game1.pixelZoom * 2)), Game1.textColor, 1f, -1f, -1, -1, 1f, 3);
Utility.drawWithShadow(b, Game1.mouseCursors, new Vector2((float)(this.xPositionOnScreen + Game1.tileSize * 4) + Math.Max((float)Game1.tileSize, Game1.dialogueFont.MeasureString(Game1.player.name).X / 2f), (float)(this.yPositionOnScreen + IClickableMenu.borderWidth + IClickableMenu.spaceToClearTopBorder + 7 * Game1.tileSize - Game1.pixelZoom)), new Rectangle(160 + (Game1.player.catPerson ? 0 : 16), 192, 16, 16), Color.White, 0f, Vector2.Zero, (float)Game1.pixelZoom, false, -1f, -1, -1, 0.35f);
}
*/
}
if (this.horseName.Length > 0)
{

View File

@ -7,6 +7,7 @@ using StardewValley.Locations;
using StardewValley.Menus;
using System;
using System.Collections.Generic;
using System.IO;
using System.Xml.Serialization;
namespace Revitalize.Objects
@ -39,6 +40,7 @@ namespace Revitalize.Objects
lightsOn = false;
lightColor = Color.Black;
thisType = this.GetType();
// this.drawColor = Color.White;
}
public GiftPackage()
@ -51,68 +53,41 @@ namespace Revitalize.Objects
//does nothng
}
public GiftPackage(int which, Vector2 Tile, List<Item> Inventory, int InventoryMaxSize = 0, bool isRemovable = true)
public GiftPackage(int which, string ItemName, Vector2 Tile, List<Item> Inventory,int cost, Color DrawColor, int InventoryMaxSize = 0, bool isRemovable = true)
{
InitializeBasics(InventoryMaxSize, Tile);
drawColor = DrawColor;
// Log.AsyncC(this.drawColor);
inventory = Inventory;
removable = isRemovable;
this.lightColor = Color.Black;
if (TextureSheet == null)
{
TextureSheet = Game1.content.Load<Texture2D>("TileSheets\\furniture");
texturePath = "TileSheets\\furniture";
TextureSheet = Game1.content.Load<Texture2D>(Path.Combine("Revitalize","LooseSprites","GiftPackage"));
texturePath = Path.Combine("Revitalize", "LooseSprites", "GiftPackage");
}
Dictionary<int, string> dictionary = Game1.content.Load<Dictionary<int, string>>("Data\\Furniture");
string[] array = dictionary[which].Split(new char[]
this.name = ItemName;
this.Decoration_type = 0;
this.description = "A bundle of objects that contains,\n";
int j = 0;
for(j=0; j<this.inventory.Count-1;j++)
{
'/'
});
this.name = array[0];
this.Decoration_type = this.getTypeNumberFromName(array[1]);
this.description = "Can be placed inside your house.";
Item d = this.inventory[j];
description += d.Name + ",\n";
}
Item v = this.inventory[j];
description += v.Name + "\n";
this.defaultSourceRect = new Rectangle(which * 16 % TextureSheet.Width, which * 16 / TextureSheet.Width * 16, 1, 1);
if (array[2].Equals("-1"))
{
this.sourceRect = this.getDefaultSourceRectForType(which, this.Decoration_type);
this.defaultSourceRect = this.sourceRect;
}
else
{
this.defaultSourceRect.Width = Convert.ToInt32(array[2].Split(new char[]
{
' '
})[0]);
this.defaultSourceRect.Height = Convert.ToInt32(array[2].Split(new char[]
{
' '
})[1]);
this.defaultSourceRect.Width = 1;
this.defaultSourceRect.Height = 1;
this.sourceRect = new Rectangle(which * 16 % TextureSheet.Width, which * 16 / TextureSheet.Width * 16, this.defaultSourceRect.Width * 16, this.defaultSourceRect.Height * 16);
this.defaultSourceRect = this.sourceRect;
}
this.defaultBoundingBox = new Rectangle((int)this.tileLocation.X, (int)this.tileLocation.Y, 1, 1);
if (array[3].Equals("-1"))
{
this.boundingBox = this.getDefaultBoundingBoxForType(this.Decoration_type);
this.defaultBoundingBox = this.boundingBox;
}
else
{
this.defaultBoundingBox.Width = Convert.ToInt32(array[3].Split(new char[]
{
' '
})[0]);
this.defaultBoundingBox.Height = Convert.ToInt32(array[3].Split(new char[]
{
' '
})[1]);
this.boundingBox = new Rectangle((int)this.tileLocation.X * Game1.tileSize, (int)this.tileLocation.Y * Game1.tileSize, this.defaultBoundingBox.Width * Game1.tileSize, this.defaultBoundingBox.Height * Game1.tileSize);
this.defaultBoundingBox = this.boundingBox;
}
this.updateDrawPosition();
this.rotations = Convert.ToInt32(array[4]);
this.price = Convert.ToInt32(array[5]);
this.price = Convert.ToInt32(cost);
this.parentSheetIndex = which;
}
@ -238,55 +213,6 @@ namespace Revitalize.Objects
{
// Game1.showRedMessage("THIS IS CLICKED!!!");
//var mState = Microsoft.Xna.Framework.Input.Mouse.GetState();
/*
Game1.haltAfterCheck = false;
if (this.Decoration_type == 11 && who.ActiveObject != null && who.ActiveObject != null && this.heldObject == null)
{
// Game1.showRedMessage("Why1?");
return false;
}
if (this.heldObject == null && (who.ActiveObject == null || !(who.ActiveObject is GiftPackage)))
{
if (Game1.player.currentLocation is FarmHouse)
{
//
Game1.player.addItemByMenuIfNecessary(this);
removeLights(this.thisLocation);
this.lightsOn = false;
Game1.playSound("coin");
// this.flaggedForPickUp = true;
return true;
}
else
{
// return true;
// this.heldObject = new GiftPackage(parentSheetIndex, Vector2.Zero, this.lightColor, this.inventoryMaxSize);
Game1.player.addItemByMenuIfNecessary(this);
removeLights(this.thisLocation);
this.lightsOn = false;
Game1.playSound("coin");
return true;
}
}
if (this.heldObject != null && who.addItemToInventoryBool(this.heldObject, false))
{
// Game1.showRedMessage("Why3?");
// if(this.heldObject!=null) Game1.player.addItemByMenuIfNecessary((Item)this.heldObject);
Util.addItemToInventoryElseDrop(this);
this.heldObject.performRemoveAction(this.tileLocation, who.currentLocation);
this.heldObject = null;
Game1.playSound("coin");
removeLights(this.thisLocation);
this.lightsOn = false;
return true;
}
*/
return false;
}
@ -369,109 +295,6 @@ namespace Revitalize.Objects
base.performRemoveAction(tileLocation, environment);
}
public override void rotate()
{
if (this.rotations < 2)
{
return;
}
int num = (this.rotations == 4) ? 1 : 2;
this.currentRotation += num;
this.currentRotation %= 4;
this.flipped = false;
Point point = default(Point);
int num2 = this.Decoration_type;
switch (num2)
{
case 2:
point.Y = 1;
point.X = -1;
break;
case 3:
point.X = -1;
point.Y = 1;
break;
case 4:
break;
case 5:
point.Y = 0;
point.X = -1;
break;
default:
if (num2 == 12)
{
point.X = 0;
point.Y = 0;
}
break;
}
bool flag = this.Decoration_type == 5 || this.Decoration_type == 12 || this.parentSheetIndex == 724 || this.parentSheetIndex == 727;
bool flag2 = this.defaultBoundingBox.Width != this.defaultBoundingBox.Height;
if (flag && this.currentRotation == 2)
{
this.currentRotation = 1;
}
if (flag2)
{
int height = this.boundingBox.Height;
switch (this.currentRotation)
{
case 0:
case 2:
this.boundingBox.Height = this.defaultBoundingBox.Height;
this.boundingBox.Width = this.defaultBoundingBox.Width;
break;
case 1:
case 3:
this.boundingBox.Height = this.boundingBox.Width + point.X * Game1.tileSize;
this.boundingBox.Width = height + point.Y * Game1.tileSize;
break;
}
}
Point point2 = default(Point);
int num3 = this.Decoration_type;
if (num3 == 12)
{
point2.X = 1;
point2.Y = -1;
}
if (flag2)
{
switch (this.currentRotation)
{
case 0:
this.sourceRect = this.defaultSourceRect;
break;
case 1:
this.sourceRect = new Rectangle(this.defaultSourceRect.X + this.defaultSourceRect.Width, this.defaultSourceRect.Y, this.defaultSourceRect.Height - 16 + point.Y * 16 + point2.X * 16, this.defaultSourceRect.Width + 16 + point.X * 16 + point2.Y * 16);
break;
case 2:
this.sourceRect = new Rectangle(this.defaultSourceRect.X + this.defaultSourceRect.Width + this.defaultSourceRect.Height - 16 + point.Y * 16 + point2.X * 16, this.defaultSourceRect.Y, this.defaultSourceRect.Width, this.defaultSourceRect.Height);
break;
case 3:
this.sourceRect = new Rectangle(this.defaultSourceRect.X + this.defaultSourceRect.Width, this.defaultSourceRect.Y, this.defaultSourceRect.Height - 16 + point.Y * 16 + point2.X * 16, this.defaultSourceRect.Width + 16 + point.X * 16 + point2.Y * 16);
this.flipped = true;
break;
}
}
else
{
this.flipped = (this.currentRotation == 3);
if (this.rotations == 2)
{
this.sourceRect = new Rectangle(this.defaultSourceRect.X + ((this.currentRotation == 2) ? 1 : 0) * this.defaultSourceRect.Width, this.defaultSourceRect.Y, this.defaultSourceRect.Width, this.defaultSourceRect.Height);
}
else
{
this.sourceRect = new Rectangle(this.defaultSourceRect.X + ((this.currentRotation == 3) ? 1 : this.currentRotation) * this.defaultSourceRect.Width, this.defaultSourceRect.Y, this.defaultSourceRect.Width, this.defaultSourceRect.Height);
}
}
if (flag && this.currentRotation == 1)
{
this.currentRotation = 2;
}
this.updateDrawPosition();
}
public override bool isGroundFurniture()
{
@ -878,40 +701,6 @@ namespace Revitalize.Objects
return new Rectangle((int)this.tileLocation.X * Game1.tileSize, (int)this.tileLocation.Y * Game1.tileSize, num * Game1.tileSize, num2 * Game1.tileSize);
}
private int getTypeNumberFromName(string typeName)
{
string key;
switch (key = typeName.ToLower())
{
case "chair":
return 0;
case "bench":
return 1;
case "couch":
return 2;
case "armchair":
return 3;
case "dresser":
return 4;
case "long table":
return 5;
case "painting":
return 6;
case "lamp":
return 7;
case "decor":
return 8;
case "bookcase":
return 10;
case "table":
return 11;
case "rug":
return 12;
case "window":
return 13;
}
return 9;
}
public override int salePrice()
{
@ -955,23 +744,37 @@ namespace Revitalize.Objects
public override void drawWhenHeld(SpriteBatch spriteBatch, Vector2 objectPosition, Farmer f)
{
base.drawWhenHeld(spriteBatch, objectPosition, f);
spriteBatch.Draw(this.TextureSheet, objectPosition, new Microsoft.Xna.Framework.Rectangle?(Game1.currentLocation.getSourceRectForObject(f.ActiveObject.ParentSheetIndex)), this.drawColor, 0f, Vector2.Zero, (float)Game1.pixelZoom, SpriteEffects.None, Math.Max(0f, (float)(f.getStandingY() + 2) / 10000f));
if (f.ActiveObject != null && f.ActiveObject.Name.Contains("="))
{
spriteBatch.Draw(Game1.objectSpriteSheet, objectPosition + new Vector2((float)(Game1.tileSize / 2), (float)(Game1.tileSize / 2)), new Microsoft.Xna.Framework.Rectangle?(Game1.currentLocation.getSourceRectForObject(f.ActiveObject.ParentSheetIndex)), Color.White, 0f, new Vector2((float)(Game1.tileSize / 2), (float)(Game1.tileSize / 2)), (float)Game1.pixelZoom + Math.Abs(Game1.starCropShimmerPause) / 8f, SpriteEffects.None, Math.Max(0f, (float)(f.getStandingY() + 2) / 10000f));
if (Math.Abs(Game1.starCropShimmerPause) <= 0.05f && Game1.random.NextDouble() < 0.97)
{
return;
}
Game1.starCropShimmerPause += 0.04f;
if (Game1.starCropShimmerPause >= 0.8f)
{
Game1.starCropShimmerPause = -0.8f;
}
}
}
public override void drawInMenu(SpriteBatch spriteBatch, Vector2 location, float scaleSize, float transparency, float layerDepth, bool drawStackNumber)
{
spriteBatch.Draw(TextureSheet, location + new Vector2((float)(Game1.tileSize / 2), (float)(Game1.tileSize / 2)), new Rectangle?(this.defaultSourceRect), Color.White * transparency, 0f, new Vector2((float)(this.defaultSourceRect.Width / 2), (float)(this.defaultSourceRect.Height / 2)), 1f * this.getScaleSize() * scaleSize, SpriteEffects.None, layerDepth);
spriteBatch.Draw(this.TextureSheet, location + new Vector2((float)(Game1.tileSize / 2), (float)(Game1.tileSize / 2)), new Rectangle?(this.defaultSourceRect), this.drawColor, 0f, new Vector2((float)(this.defaultSourceRect.Width / 2), (float)(this.defaultSourceRect.Height / 2)), 1f * this.getScaleSize() * scaleSize, SpriteEffects.None, layerDepth);
}
public override void draw(SpriteBatch spriteBatch, int x, int y, float alpha = 1f)
{
if (x == -1)
{
spriteBatch.Draw(TextureSheet, Game1.GlobalToLocal(Game1.viewport, this.drawPosition), new Rectangle?(this.sourceRect), Color.White * alpha, 0f, Vector2.Zero, (float)Game1.pixelZoom, this.flipped ? SpriteEffects.FlipHorizontally : SpriteEffects.None, (this.Decoration_type == 12) ? 0f : ((float)(this.boundingBox.Bottom - 8) / 10000f));
spriteBatch.Draw(TextureSheet, Game1.GlobalToLocal(Game1.viewport, this.drawPosition), new Rectangle?(this.sourceRect), this.drawColor, 0f, Vector2.Zero, (float)Game1.pixelZoom, this.flipped ? SpriteEffects.FlipHorizontally : SpriteEffects.None, (this.Decoration_type == 12) ? 0f : ((float)(this.boundingBox.Bottom - 8) / 10000f));
}
else
{
spriteBatch.Draw(TextureSheet, Game1.GlobalToLocal(Game1.viewport, new Vector2((float)(x * Game1.tileSize), (float)(y * Game1.tileSize - (this.sourceRect.Height * Game1.pixelZoom - this.boundingBox.Height)))), new Rectangle?(this.sourceRect), Color.White * alpha, 0f, Vector2.Zero, (float)Game1.pixelZoom, this.flipped ? SpriteEffects.FlipHorizontally : SpriteEffects.None, (this.Decoration_type == 12) ? 0f : ((float)(this.boundingBox.Bottom - 8) / 10000f));
spriteBatch.Draw(TextureSheet, Game1.GlobalToLocal(Game1.viewport, new Vector2((float)(x * Game1.tileSize), (float)(y * Game1.tileSize - (this.sourceRect.Height * Game1.pixelZoom - this.boundingBox.Height)))), new Rectangle?(this.sourceRect), this.drawColor, 0f, Vector2.Zero, (float)Game1.pixelZoom, this.flipped ? SpriteEffects.FlipHorizontally : SpriteEffects.None, (this.Decoration_type == 12) ? 0f : ((float)(this.boundingBox.Bottom - 8) / 10000f));
}
if (this.heldObject != null)
{
@ -980,19 +783,20 @@ namespace Revitalize.Objects
(this.heldObject as GiftPackage).drawAtNonTileSpot(spriteBatch, Game1.GlobalToLocal(Game1.viewport, new Vector2((float)(this.boundingBox.Center.X - Game1.tileSize / 2), (float)(this.boundingBox.Center.Y - (this.heldObject as GiftPackage).sourceRect.Height * Game1.pixelZoom - Game1.tileSize / 4))), (float)(this.boundingBox.Bottom - 7) / 10000f, alpha);
return;
}
spriteBatch.Draw(Game1.shadowTexture, Game1.GlobalToLocal(Game1.viewport, new Vector2((float)(this.boundingBox.Center.X - Game1.tileSize / 2), (float)(this.boundingBox.Center.Y - Game1.tileSize * 4 / 3))) + new Vector2((float)(Game1.tileSize / 2), (float)(Game1.tileSize * 5 / 6)), new Rectangle?(Game1.shadowTexture.Bounds), Color.White * alpha, 0f, new Vector2((float)Game1.shadowTexture.Bounds.Center.X, (float)Game1.shadowTexture.Bounds.Center.Y), 4f, SpriteEffects.None, (float)this.boundingBox.Bottom / 10000f);
spriteBatch.Draw(Game1.objectSpriteSheet, Game1.GlobalToLocal(Game1.viewport, new Vector2((float)(this.boundingBox.Center.X - Game1.tileSize / 2), (float)(this.boundingBox.Center.Y - Game1.tileSize * 4 / 3))), new Rectangle?(Game1.currentLocation.getSourceRectForObject(this.heldObject.ParentSheetIndex)), Color.White * alpha, 0f, Vector2.Zero, (float)Game1.pixelZoom, SpriteEffects.None, (float)(this.boundingBox.Bottom + 1) / 10000f);
spriteBatch.Draw(Game1.shadowTexture, Game1.GlobalToLocal(Game1.viewport, new Vector2((float)(this.boundingBox.Center.X - Game1.tileSize / 2), (float)(this.boundingBox.Center.Y - Game1.tileSize * 4 / 3))) + new Vector2((float)(Game1.tileSize / 2), (float)(Game1.tileSize * 5 / 6)), new Rectangle?(Game1.shadowTexture.Bounds), this.drawColor , 0f, new Vector2((float)Game1.shadowTexture.Bounds.Center.X, (float)Game1.shadowTexture.Bounds.Center.Y), 4f, SpriteEffects.None, (float)this.boundingBox.Bottom / 10000f);
spriteBatch.Draw(Game1.objectSpriteSheet, Game1.GlobalToLocal(Game1.viewport, new Vector2((float)(this.boundingBox.Center.X - Game1.tileSize / 2), (float)(this.boundingBox.Center.Y - Game1.tileSize * 4 / 3))), new Rectangle?(Game1.currentLocation.getSourceRectForObject(this.heldObject.ParentSheetIndex)), this.drawColor , 0f, Vector2.Zero, (float)Game1.pixelZoom, SpriteEffects.None, (float)(this.boundingBox.Bottom + 1) / 10000f);
}
}
public override void drawAtNonTileSpot(SpriteBatch spriteBatch, Vector2 location, float layerDepth, float alpha = 1f)
{
spriteBatch.Draw(TextureSheet, location, new Rectangle?(this.sourceRect), Color.White * alpha, 0f, Vector2.Zero, (float)Game1.pixelZoom, this.flipped ? SpriteEffects.FlipHorizontally : SpriteEffects.None, layerDepth);
spriteBatch.Draw(TextureSheet, location, new Rectangle?(this.sourceRect), this.drawColor, 0f, Vector2.Zero, (float)Game1.pixelZoom, this.flipped ? SpriteEffects.FlipHorizontally : SpriteEffects.None, layerDepth);
}
public override Item getOne()
{
GiftPackage GiftPackage = new GiftPackage(this.parentSheetIndex, this.tileLocation, this.inventory, this.inventoryMaxSize);
GiftPackage GiftPackage = new GiftPackage(this.parentSheetIndex, this.name,this.tileLocation, this.inventory,this.price,this.drawColor, this.inventoryMaxSize);
// Log.AsyncM("BOO " + drawColor);
/*
drawPosition = this.drawPosition;
defaultBoundingBox = this.defaultBoundingBox;

View File

@ -19,7 +19,7 @@ namespace Revitalize.Objects
public class Light : Revitalize.CoreObject
{
public bool areLightAndDrawColorsDifferent;
public override string Name
{
get
@ -52,11 +52,13 @@ namespace Revitalize.Objects
//does nothng
}
public Light(int which, Vector2 Tile, Color C, int InventoryMaxSize =0, bool isRemovable=true)
public Light(int which, Vector2 Tile, Color LightColor,Color DrawColor, bool differentColors=true, int InventoryMaxSize =0, bool isRemovable=true)
{
removable = isRemovable;
InitializeBasics(InventoryMaxSize, Tile);
this.lightColor = C;
this.lightColor = LightColor;
this.drawColor = DrawColor;
areLightAndDrawColorsDifferent = differentColors;
if (TextureSheet == null)
{
TextureSheet = Game1.content.Load<Texture2D>(Path.Combine("Revitalize","Lights","AdjustableLights","Graphics","AdjustableLights"));
@ -68,7 +70,7 @@ namespace Revitalize.Objects
'/'
});
this.name = array[0];
this.Decoration_type = this.getTypeNumberFromName(array[1]);
this.Decoration_type = 1;
try
{
@ -252,55 +254,6 @@ namespace Revitalize.Objects
{
Game1.activeClickableMenu = new Revitalize.Menus.LightCustomizer(this);
// Game1.showRedMessage("THIS IS CLICKED!!!");
//var mState = Microsoft.Xna.Framework.Input.Mouse.GetState();
/*
Game1.haltAfterCheck = false;
if (this.Decoration_type == 11 && who.ActiveObject != null && who.ActiveObject != null && this.heldObject == null)
{
// Game1.showRedMessage("Why1?");
return false;
}
if (this.heldObject == null && (who.ActiveObject == null || !(who.ActiveObject is Light)))
{
if (Game1.player.currentLocation is FarmHouse)
{
//
Game1.player.addItemByMenuIfNecessary(this);
removeLights(this.thisLocation);
this.lightsOn = false;
Game1.playSound("coin");
// this.flaggedForPickUp = true;
return true;
}
else
{
// return true;
// this.heldObject = new Light(parentSheetIndex, Vector2.Zero, this.lightColor, this.inventoryMaxSize);
Game1.player.addItemByMenuIfNecessary(this);
removeLights(this.thisLocation);
this.lightsOn = false;
Game1.playSound("coin");
return true;
}
}
if (this.heldObject != null && who.addItemToInventoryBool(this.heldObject, false))
{
// Game1.showRedMessage("Why3?");
// if(this.heldObject!=null) Game1.player.addItemByMenuIfNecessary((Item)this.heldObject);
Util.addItemToInventoryElseDrop(this);
this.heldObject.performRemoveAction(this.tileLocation, who.currentLocation);
this.heldObject = null;
Game1.playSound("coin");
removeLights(this.thisLocation);
this.lightsOn = false;
return true;
}
*/
return false;
}
@ -345,9 +298,7 @@ namespace Revitalize.Objects
public override bool minutesElapsed(int minutes, GameLocation environment)
{
// Log.Info("minutes passed in"+minutes);
// Log.Info("minues remaining" + this.minutesUntilReady);
// Log.Info(this.lightColor);
this.minutesUntilReady = (this.minutesUntilReady - minutes);
if (Game1.isDarkOut() || Game1.timeOfDay <= 500)
@ -357,11 +308,6 @@ namespace Revitalize.Objects
if (minutesUntilReady == 0)
{
// Log.AsyncC(this.name + "Is ready!");
// Log.AsyncC(Game1.player.getStandingPosition());
// Vector2 v2 = new Vector2(this.tileLocation.X * Game1.tileSize, this.tileLocation.Y * Game1.tileSize);
//Game1.createItemDebris((Item)this.heldObject, v2, Game1.player.getDirection());
// minutesUntilReady = 30;
}
return false;
@ -433,21 +379,7 @@ namespace Revitalize.Objects
Vector2 vector = tile * (float)Game1.tileSize + new Vector2((float)i, (float)j) * (float)Game1.tileSize;
vector.X += (float)(Game1.tileSize / 2);
vector.Y += (float)(Game1.tileSize / 2);
/*
foreach (Light current in (l as FarmHouse).Light)
{
if (current.Decoration_type == 11 && current.getBoundingBox(current.tileLocation).Contains((int)vector.X, (int)vector.Y) && current.heldObject == null && this.getTilesWide() == 1)
{
bool result = true;
return result;
}
if ((current.Decoration_type != 12 || this.Decoration_type == 12) && current.getBoundingBox(current.tileLocation).Contains((int)vector.X, (int)vector.Y))
{
bool result = false;
return result;
}
}
*/
}
}
return Util.canBePlacedHere(this,l, tile);
@ -565,16 +497,6 @@ namespace Revitalize.Objects
{
int num = (this.parentSheetIndex == 1293) ? 3 : 0;
bool flag2 = false;
/*
foreach (Rectangle current in walls)
{
if ((this.Decoration_type == 6 || this.Decoration_type == 13 || num != 0) && current.Y + num == point.Y && current.Contains(point.X, point.Y - num))
{
flag2 = true;
break;
}
}
*/
if (!flag2)
{
Game1.showRedMessage("Must be placed on wall");
@ -605,17 +527,7 @@ namespace Revitalize.Objects
}
}
this.boundingBox = new Rectangle(x / Game1.tileSize * Game1.tileSize, y / Game1.tileSize * Game1.tileSize, this.boundingBox.Width, this.boundingBox.Height);
/*
foreach (Furniture current2 in (location as FarmHouse).furniture)
{
if (current2.furniture_type == 11 && current2.heldObject == null && current2.getBoundingBox(current2.tileLocation).Intersects(this.boundingBox))
{
current2.performObjectDropInAction(this, false, (who == null) ? Game1.player : who);
bool result = true;
return result;
}
}
*/
foreach (Farmer current3 in location.getFarmers())
{
if (current3.GetBoundingBox().Intersects(this.boundingBox))
@ -627,9 +539,6 @@ namespace Revitalize.Objects
}
this.updateDrawPosition();
this.thisLocation = Game1.player.currentLocation;
// Log.AsyncC(x);
// Log.AsyncY(y);
// Log.AsyncY(this.drawPosition);
return Util.placementAction(this,location, x , y, who);
}
@ -775,40 +684,6 @@ namespace Revitalize.Objects
return new Rectangle((int)this.tileLocation.X * Game1.tileSize, (int)this.tileLocation.Y * Game1.tileSize, num * Game1.tileSize, num2 * Game1.tileSize);
}
private int getTypeNumberFromName(string typeName)
{
string key;
switch (key = typeName.ToLower())
{
case "chair":
return 0;
case "bench":
return 1;
case "couch":
return 2;
case "armchair":
return 3;
case "dresser":
return 4;
case "long table":
return 5;
case "painting":
return 6;
case "lamp":
return 7;
case "decor":
return 8;
case "bookcase":
return 10;
case "table":
return 11;
case "rug":
return 12;
case "window":
return 13;
}
return 9;
}
public override int salePrice()
{
@ -855,7 +730,13 @@ namespace Revitalize.Objects
public override void drawWhenHeld(SpriteBatch spriteBatch, Vector2 objectPosition, Farmer f)
{
spriteBatch.Draw(this.TextureSheet, objectPosition, new Microsoft.Xna.Framework.Rectangle?(Game1.currentLocation.getSourceRectForObject(f.ActiveObject.ParentSheetIndex)),Util.invertColor(this.lightColor), 0f, Vector2.Zero, (float)Game1.pixelZoom, SpriteEffects.None, Math.Max(0f, (float)(f.getStandingY() + 2) / 10000f));
if(areLightAndDrawColorsDifferent==false) spriteBatch.Draw(this.TextureSheet, objectPosition, new Microsoft.Xna.Framework.Rectangle?(Game1.currentLocation.getSourceRectForObject(f.ActiveObject.ParentSheetIndex)),Util.invertColor(this.lightColor), 0f, Vector2.Zero, (float)Game1.pixelZoom, SpriteEffects.None, Math.Max(0f, (float)(f.getStandingY() + 2) / 10000f));
else
{
spriteBatch.Draw(this.TextureSheet, objectPosition, new Microsoft.Xna.Framework.Rectangle?(Game1.currentLocation.getSourceRectForObject(f.ActiveObject.ParentSheetIndex)), Util.invertColor(this.drawColor), 0f, Vector2.Zero, (float)Game1.pixelZoom, SpriteEffects.None, Math.Max(0f, (float)(f.getStandingY() + 2) / 10000f));
}
/*
if (f.ActiveObject != null && f.ActiveObject.Name.Contains("="))
{
spriteBatch.Draw(Game1.objectSpriteSheet, objectPosition + new Vector2((float)(Game1.tileSize / 2), (float)(Game1.tileSize / 2)), new Microsoft.Xna.Framework.Rectangle?(Game1.currentLocation.getSourceRectForObject(f.ActiveObject.ParentSheetIndex)), Color.White, 0f, new Vector2((float)(Game1.tileSize / 2), (float)(Game1.tileSize / 2)), (float)Game1.pixelZoom + Math.Abs(Game1.starCropShimmerPause) / 8f, SpriteEffects.None, Math.Max(0f, (float)(f.getStandingY() + 2) / 10000f));
@ -869,44 +750,60 @@ namespace Revitalize.Objects
Game1.starCropShimmerPause = -0.8f;
}
}
*/
}
public override void drawInMenu(SpriteBatch spriteBatch, Vector2 location, float scaleSize, float transparency, float layerDepth, bool drawStackNumber)
{
spriteBatch.Draw(TextureSheet, location + new Vector2((float)(Game1.tileSize / 2), (float)(Game1.tileSize / 2)), new Rectangle?(this.defaultSourceRect), Util.invertColor(this.lightColor), 0f, new Vector2((float)(this.defaultSourceRect.Width / 2), (float)(this.defaultSourceRect.Height / 2)), 1f * this.getScaleSize() * scaleSize, SpriteEffects.None, layerDepth);
if (areLightAndDrawColorsDifferent == false) spriteBatch.Draw(TextureSheet, location + new Vector2((float)(Game1.tileSize / 2), (float)(Game1.tileSize / 2)), new Rectangle?(this.defaultSourceRect), Util.invertColor(this.lightColor), 0f, new Vector2((float)(this.defaultSourceRect.Width / 2), (float)(this.defaultSourceRect.Height / 2)), 1f * this.getScaleSize() * scaleSize, SpriteEffects.None, layerDepth);
else
{
spriteBatch.Draw(TextureSheet, location + new Vector2((float)(Game1.tileSize / 2), (float)(Game1.tileSize / 2)), new Rectangle?(this.defaultSourceRect), Util.invertColor(this.drawColor), 0f, new Vector2((float)(this.defaultSourceRect.Width / 2), (float)(this.defaultSourceRect.Height / 2)), 1f * this.getScaleSize() * scaleSize, SpriteEffects.None, layerDepth);
}
}
public override void draw(SpriteBatch spriteBatch, int x, int y, float alpha = 1f)
{
if (x == -1)
{
spriteBatch.Draw(TextureSheet, Game1.GlobalToLocal(Game1.viewport, this.drawPosition), new Rectangle?(this.sourceRect), Util.invertColor(this.lightColor) * alpha, 0f, Vector2.Zero, (float)Game1.pixelZoom, this.flipped ? SpriteEffects.FlipHorizontally : SpriteEffects.None, (this.Decoration_type == 12) ? 0f : ((float)(this.boundingBox.Bottom - 8) / 10000f));
if (areLightAndDrawColorsDifferent == false) spriteBatch.Draw(TextureSheet, Game1.GlobalToLocal(Game1.viewport, this.drawPosition), new Rectangle?(this.sourceRect), Util.invertColor(this.lightColor) * alpha, 0f, Vector2.Zero, (float)Game1.pixelZoom, this.flipped ? SpriteEffects.FlipHorizontally : SpriteEffects.None, (this.Decoration_type == 12) ? 0f : ((float)(this.boundingBox.Bottom - 8) / 10000f));
else spriteBatch.Draw(TextureSheet, Game1.GlobalToLocal(Game1.viewport, this.drawPosition), new Rectangle?(this.sourceRect), Util.invertColor(this.drawColor) * alpha, 0f, Vector2.Zero, (float)Game1.pixelZoom, this.flipped ? SpriteEffects.FlipHorizontally : SpriteEffects.None, (this.Decoration_type == 12) ? 0f : ((float)(this.boundingBox.Bottom - 8) / 10000f));
}
else
{
spriteBatch.Draw(TextureSheet, Game1.GlobalToLocal(Game1.viewport, new Vector2((float)(x * Game1.tileSize), (float)(y * Game1.tileSize - (this.sourceRect.Height * Game1.pixelZoom - this.boundingBox.Height)))), new Rectangle?(this.sourceRect), Util.invertColor(this.lightColor) * alpha, 0f, Vector2.Zero, (float)Game1.pixelZoom, this.flipped ? SpriteEffects.FlipHorizontally : SpriteEffects.None, (this.Decoration_type == 12) ? 0f : ((float)(this.boundingBox.Bottom - 8) / 10000f));
if (areLightAndDrawColorsDifferent == false) spriteBatch.Draw(TextureSheet, Game1.GlobalToLocal(Game1.viewport, new Vector2((float)(x * Game1.tileSize), (float)(y * Game1.tileSize - (this.sourceRect.Height * Game1.pixelZoom - this.boundingBox.Height)))), new Rectangle?(this.sourceRect), Util.invertColor(this.lightColor) * alpha, 0f, Vector2.Zero, (float)Game1.pixelZoom, this.flipped ? SpriteEffects.FlipHorizontally : SpriteEffects.None, (this.Decoration_type == 12) ? 0f : ((float)(this.boundingBox.Bottom - 8) / 10000f));
else spriteBatch.Draw(TextureSheet, Game1.GlobalToLocal(Game1.viewport, new Vector2((float)(x * Game1.tileSize), (float)(y * Game1.tileSize - (this.sourceRect.Height * Game1.pixelZoom - this.boundingBox.Height)))), new Rectangle?(this.sourceRect), Util.invertColor(this.drawColor) * alpha, 0f, Vector2.Zero, (float)Game1.pixelZoom, this.flipped ? SpriteEffects.FlipHorizontally : SpriteEffects.None, (this.Decoration_type == 12) ? 0f : ((float)(this.boundingBox.Bottom - 8) / 10000f));
}
if (this.heldObject != null)
{
if (this.heldObject is Spell)
if (this.heldObject is Light)
{
(this.heldObject as Spell).drawAtNonTileSpot(spriteBatch, Game1.GlobalToLocal(Game1.viewport, new Vector2((float)(this.boundingBox.Center.X - Game1.tileSize / 2), (float)(this.boundingBox.Center.Y - (this.heldObject as Spell).sourceRect.Height * Game1.pixelZoom - Game1.tileSize / 4))), (float)(this.boundingBox.Bottom - 7) / 10000f, alpha);
(this.heldObject as Light).drawAtNonTileSpot(spriteBatch, Game1.GlobalToLocal(Game1.viewport, new Vector2((float)(this.boundingBox.Center.X - Game1.tileSize / 2), (float)(this.boundingBox.Center.Y - (this.heldObject as Spell).sourceRect.Height * Game1.pixelZoom - Game1.tileSize / 4))), (float)(this.boundingBox.Bottom - 7) / 10000f, alpha);
return;
}
if (areLightAndDrawColorsDifferent == false)
{
spriteBatch.Draw(Game1.shadowTexture, Game1.GlobalToLocal(Game1.viewport, new Vector2((float)(this.boundingBox.Center.X - Game1.tileSize / 2), (float)(this.boundingBox.Center.Y - Game1.tileSize * 4 / 3))) + new Vector2((float)(Game1.tileSize / 2), (float)(Game1.tileSize * 5 / 6)), new Rectangle?(Game1.shadowTexture.Bounds), Util.invertColor(this.lightColor) * alpha, 0f, new Vector2((float)Game1.shadowTexture.Bounds.Center.X, (float)Game1.shadowTexture.Bounds.Center.Y), 4f, SpriteEffects.None, (float)this.boundingBox.Bottom / 10000f);
spriteBatch.Draw(Game1.objectSpriteSheet, Game1.GlobalToLocal(Game1.viewport, new Vector2((float)(this.boundingBox.Center.X - Game1.tileSize / 2), (float)(this.boundingBox.Center.Y - Game1.tileSize * 4 / 3))), new Rectangle?(Game1.currentLocation.getSourceRectForObject(this.heldObject.ParentSheetIndex)), Util.invertColor(this.lightColor) * alpha, 0f, Vector2.Zero, (float)Game1.pixelZoom, SpriteEffects.None, (float)(this.boundingBox.Bottom + 1) / 10000f);
}
else
{
spriteBatch.Draw(Game1.shadowTexture, Game1.GlobalToLocal(Game1.viewport, new Vector2((float)(this.boundingBox.Center.X - Game1.tileSize / 2), (float)(this.boundingBox.Center.Y - Game1.tileSize * 4 / 3))) + new Vector2((float)(Game1.tileSize / 2), (float)(Game1.tileSize * 5 / 6)), new Rectangle?(Game1.shadowTexture.Bounds), Util.invertColor(this.drawColor) * alpha, 0f, new Vector2((float)Game1.shadowTexture.Bounds.Center.X, (float)Game1.shadowTexture.Bounds.Center.Y), 4f, SpriteEffects.None, (float)this.boundingBox.Bottom / 10000f);
spriteBatch.Draw(Game1.objectSpriteSheet, Game1.GlobalToLocal(Game1.viewport, new Vector2((float)(this.boundingBox.Center.X - Game1.tileSize / 2), (float)(this.boundingBox.Center.Y - Game1.tileSize * 4 / 3))), new Rectangle?(Game1.currentLocation.getSourceRectForObject(this.heldObject.ParentSheetIndex)), Util.invertColor(this.drawColor) * alpha, 0f, Vector2.Zero, (float)Game1.pixelZoom, SpriteEffects.None, (float)(this.boundingBox.Bottom + 1) / 10000f);
}
}
}
public override void drawAtNonTileSpot(SpriteBatch spriteBatch, Vector2 location, float layerDepth, float alpha = 1f)
{
spriteBatch.Draw(TextureSheet, location, new Rectangle?(this.sourceRect), Util.invertColor(this.lightColor) * alpha, 0f, Vector2.Zero, (float)Game1.pixelZoom, this.flipped ? SpriteEffects.FlipHorizontally : SpriteEffects.None, layerDepth);
spriteBatch.Draw(TextureSheet, location, new Rectangle?(this.sourceRect), Util.invertColor(this.drawColor) * alpha, 0f, Vector2.Zero, (float)Game1.pixelZoom, this.flipped ? SpriteEffects.FlipHorizontally : SpriteEffects.None, layerDepth);
}
public override Item getOne()
{
Light Light = new Light(this.parentSheetIndex, this.tileLocation, this.lightColor, this.inventoryMaxSize);
Light Light = new Light(this.parentSheetIndex, this.tileLocation, this.lightColor,this.drawColor,this.areLightAndDrawColorsDifferent);
/*
drawPosition = this.drawPosition;
defaultBoundingBox = this.defaultBoundingBox;

View File

@ -54,8 +54,8 @@
<Compile Include="Aesthetics\WeatherDebris\WeatherDebrisSystem.cs" />
<Compile Include="Class1.cs" />
<Compile Include="CoreObject.cs" />
<Compile Include="Draw\ThingsToDraw.cs" />
<Compile Include="GameLoc.cs" />
<Compile Include="Aesthetics\Draw\ThingsToDraw.cs" />
<Compile Include="Locations\GameLoc.cs" />
<Compile Include="Locations\ModTown.cs" />
<Compile Include="Magic\MagicFunctions.cs" />
<Compile Include="Magic\MagicMonitor.cs" />

Binary file not shown.

After

Width:  |  Height:  |  Size: 449 B

View File

@ -0,0 +1,21 @@
xnbData:
target: "w"
compressed: true
hiDef: true
readerData:
-
type: "Microsoft.Xna.Framework.Content.Texture2DReader, Microsoft.Xna.Framework.Graphics, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553"
version: 0
numSharedResources: 0
content: #!Texture2D
format: 0
extractedImages:
-
path: ""

Binary file not shown.

After

Width:  |  Height:  |  Size: 272 B

View File

@ -0,0 +1,21 @@
xnbData:
target: "w"
compressed: true
hiDef: true
readerData:
-
type: "Microsoft.Xna.Framework.Content.Texture2DReader, Microsoft.Xna.Framework.Graphics, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553"
version: 0
numSharedResources: 0
content: #!Texture2D
format: 0
extractedImages:
-
path: ""