Spawnpoints for different jobs, spawning crew members with job-specific items, fixed issues with non-matching entity IDs between client and server, Unity-like coroutine system (connecting to server doesn't freeze the game anymore), map drawing improvements

This commit is contained in:
Regalis
2015-07-09 01:40:27 +03:00
parent d56f7f3f77
commit 2254585dac
35 changed files with 831 additions and 312 deletions
+4 -4
View File
@@ -46,7 +46,7 @@ namespace Subsurface
/// <summary>
/// If there is room, puts the item in the inventory and returns true, otherwise returns false
/// </summary>
public override bool TryPutItem(Item item, LimbSlot usedSlots, bool createNetworkEvent = true)
public override bool TryPutItem(Item item, LimbSlot allowedSlots, bool createNetworkEvent = true)
{
for (int i = 0; i < capacity; i++)
{
@@ -54,7 +54,7 @@ namespace Subsurface
if (items[i] == item) return true;
}
if (usedSlots.HasFlag(LimbSlot.Any))
if (allowedSlots.HasFlag(LimbSlot.Any))
{
for (int i = 0; i < capacity; i++)
{
@@ -68,12 +68,12 @@ namespace Subsurface
for (int i = 0; i < capacity; i++)
{
if (usedSlots.HasFlag(limbSlots[i]) && items[i]!=null) return false;
if (allowedSlots.HasFlag(limbSlots[i]) && items[i]!=null) return false;
}
for (int i = 0; i < capacity; i++)
{
if (usedSlots.HasFlag(limbSlots[i]) && items[i] == null)
if (allowedSlots.HasFlag(limbSlots[i]) && items[i] == null)
{
PutItem(item, i, createNetworkEvent);
item.Equip(character);
+1 -1
View File
@@ -190,7 +190,7 @@ namespace Subsurface
guiFrame = new GUIFrame(
new Rectangle((int)rect.X, (int)rect.Y, (int)rect.Z, (int)rect.W),
new Color(color.X, color.Y, color.Z), alignment);
new Color(color.X, color.Y, color.Z, color.W), alignment);
//guiFrame.Alpha = color.W;
break;
+5 -5
View File
@@ -59,7 +59,7 @@ namespace Subsurface
return -1;
}
public virtual int CanBePut(Item item)
public virtual int FindAllowedSlot(Item item)
{
for (int i = 0; i < capacity; i++)
{
@@ -84,9 +84,9 @@ namespace Subsurface
/// <summary>
/// If there is room, puts the item in the inventory and returns true, otherwise returns false
/// </summary>
public virtual bool TryPutItem(Item item, LimbSlot usedSlots = 0, bool createNetworkEvent = true)
public virtual bool TryPutItem(Item item, LimbSlot allowedSlots = 0, bool createNetworkEvent = true)
{
int slot = CanBePut(item);
int slot = FindAllowedSlot(item);
if (slot < 0) return false;
PutItem(item, slot, createNetworkEvent);
@@ -268,8 +268,8 @@ namespace Subsurface
Vector2 pos = new Vector2(rect.X + rect.Width / 2, rect.Y - rect.Height + 20) - GUI.font.MeasureString(item.Name)*0.5f;
pos.X = (int)pos.X;
pos.Y = (int)pos.Y;
spriteBatch.DrawString(GUI.font, item.Name, pos - new Vector2(1.0f,1.0f), Color.Black);
spriteBatch.DrawString(GUI.font, item.Name, pos, Color.White);
spriteBatch.DrawString(GUI.font, item.Name + " - "+item.ID, pos - new Vector2(1.0f,1.0f), Color.Black);
spriteBatch.DrawString(GUI.font, item.Name + " - " + item.ID, pos, Color.White);
}
if (item.Condition < 100.0f)
+1 -1
View File
@@ -13,7 +13,7 @@ namespace Subsurface
this.container = container;
}
public override int CanBePut(Item item)
public override int FindAllowedSlot(Item item)
{
for (int i = 0; i < capacity; i++)
{