Dockingport power wire is connected to a free wire slot instead of the last slot, submarines above the top of the level (i.e. respawn shuttle) aren't shown on sonar, underwater scooter for each respawned player

This commit is contained in:
Regalis
2016-08-13 21:35:52 +03:00
parent fbe6c91d67
commit 0602bb6154
9 changed files with 34 additions and 15 deletions

View File

@@ -168,7 +168,7 @@ namespace Launcher2
displayModeDD.SelectItem(settings.WindowMode);
displayModeDD.OnSelected = (guiComponent) => { settings.WindowMode = (WindowMode)guiComponent.UserData; return true; };
displayModeDD.OnSelected = (guiComponent, userData) => { settings.WindowMode = (WindowMode)guiComponent.UserData; return true; };
//var fullScreenTick = new GUITickBox(new Rectangle(x,y+150,20,20), "Fullscreen", Alignment.TopLeft, guiRoot);
//fullScreenTick.OnSelected = ToggleFullScreen;

View File

@@ -252,9 +252,10 @@ namespace Barotrauma.Items.Components
wire.RemoveConnection(item);
wire.RemoveConnection(dockingTarget.item);
powerConnection.AddLink(4, wire);
powerConnection.TryAddLink(wire);
wire.Connect(powerConnection, false);
recipient.AddLink(4, wire);
recipient.TryAddLink(wire);
wire.Connect(recipient, false);
}

View File

@@ -282,7 +282,8 @@ namespace Barotrauma.Items.Components
foreach (Submarine sub in Submarine.Loaded)
{
if (item.Submarine == sub || sub.DockedTo.Contains(item.Submarine)) continue;
if (sub.WorldPosition.Y > Level.Loaded.Size.Y) continue;
DrawMarker(spriteBatch, sub.Name, sub.WorldPosition - item.WorldPosition, displayScale, center, (rect.Width * 0.45f));
}

View File

@@ -140,10 +140,21 @@ namespace Barotrauma.Items.Components
return -1;
}
public void TryAddLink(Wire wire)
{
for (int i = 0; i < MaxLinked; i++)
{
if (Wires[i] == null)
{
Wires[i] = wire;
UpdateRecipients();
return;
}
}
}
public void AddLink(int index, Wire wire)
{
//linked[index] = connectedItem;
//recipient[index] = otherConnection;
Wires[index] = wire;
UpdateRecipients();
}
@@ -459,6 +470,7 @@ namespace Barotrauma.Items.Components
{
if (wireId == null) return;
for (int i = 0; i < MaxLinked; i++)
{
if (wireId[i] == 0) continue;

View File

@@ -186,7 +186,9 @@ namespace Barotrauma
Vector2.Zero,
SpriteEffects.None, 0.0f);
GUI.DrawRectangle(spriteBatch, new Rectangle((int)(MathUtils.Round(pos.X, 512.0f)), (int)-GameMain.GameScreen.Cam.WorldView.Y, width, (int)(GameMain.GameScreen.Cam.WorldView.Y - level.Size.Y)), Color.Black, true );
GUI.DrawRectangle(spriteBatch,
new Rectangle((int)(MathUtils.Round(pos.X, 512.0f)), (int)-GameMain.GameScreen.Cam.WorldView.Y, width, (int)(GameMain.GameScreen.Cam.WorldView.Y - level.Size.Y)+10),
Color.Black, true );
//background.DrawTiled(spriteBatch,
// (backgroundPos.Y < 0) ? new Vector2(0.0f, -backgroundPos.Y) : Vector2.Zero,

View File

@@ -182,7 +182,7 @@ namespace Barotrauma.Networking
private void UpdateTransporting(float deltaTime)
{
//shuttleTransportTimer -= deltaTime;
shuttleTransportTimer -= deltaTime;
if (shuttleReturnTimer + deltaTime > 15.0f && shuttleReturnTimer <= 15.0f &&
networkMember.Character != null &&
@@ -401,7 +401,8 @@ namespace Barotrauma.Networking
var waypoints = WayPoint.SelectCrewSpawnPoints(characterInfos, respawnShuttle);
ItemPrefab divingSuitPrefab = ItemPrefab.list.Find(ip => ip.Name == "Diving Suit") as ItemPrefab;
ItemPrefab oxyPrefab = ItemPrefab.list.Find(ip => ip.Name == "Oxygen Tank") as ItemPrefab;
ItemPrefab oxyPrefab = ItemPrefab.list.Find(ip => ip.Name == "Oxygen Tank") as ItemPrefab;
ItemPrefab scooterPrefab = ItemPrefab.list.Find(ip => ip.Name == "Underwater Scooter") as ItemPrefab;
var cargoSp = WayPoint.WayPointList.Find(wp => wp.Submarine == respawnShuttle && wp.SpawnType == SpawnType.Cargo);
@@ -428,25 +429,25 @@ namespace Barotrauma.Networking
{
Vector2 pos = cargoSp == null ? character.Position : cargoSp.Position;
var divingSuit = new Item(divingSuitPrefab, pos, respawnShuttle);
var oxyTank = new Item(oxyPrefab, pos, respawnShuttle);
var divingSuit = new Item(divingSuitPrefab, pos, respawnShuttle);
var oxyTank = new Item(oxyPrefab, pos, respawnShuttle);
var scooter = new Item(scooterPrefab, pos, respawnShuttle);
divingSuit.Combine(oxyTank);
spawnedItems.Add(divingSuit);
spawnedItems.Add(oxyTank);
spawnedItems.Add(scooter);
Item.Spawner.AddToSpawnedList(divingSuit);
Item.Spawner.AddToSpawnedList(oxyTank);
Item.Spawner.AddToSpawnedList(scooter);
}
character.GiveJobItems(waypoints[i]);
GameMain.GameSession.CrewManager.characters.Add(character);
}
server.SendRespawnManagerMsg(spawnedCharacters, spawnedItems);
}

View File

@@ -465,6 +465,7 @@ namespace Barotrauma
{
var shuttleText = new GUITextBlock(new Rectangle(0, 0, 0, 25), "Shuttle", GUI.Style, Alignment.Left, Alignment.CenterY | Alignment.Right, textBlock, false, GUI.SmallFont);
shuttleText.TextColor = textBlock.TextColor * 0.8f;
shuttleText.ToolTip = textBlock.ToolTip;
}
}

View File

@@ -112,6 +112,7 @@ namespace Barotrauma
var shuttleText = new GUITextBlock(new Rectangle(0, 0, 0, 25), "Shuttle", GUI.Style, Alignment.Left, Alignment.CenterY | Alignment.Right, textBlock, false, GUI.SmallFont);
shuttleText.TextColor = textBlock.TextColor * 0.8f;
shuttleText.ToolTip = textBlock.ToolTip;
}
}
if (Submarine.SavedSubmarines.Count > 0) subList.Select(Submarine.SavedSubmarines[0]);

View File

@@ -687,11 +687,11 @@ namespace Barotrauma
}
}
if (sub.HasTag(SubmarineTag.Shuttle))
{
var shuttleText = new GUITextBlock(new Rectangle(0, 0, 0, 25), "Shuttle", GUI.Style, Alignment.Left, Alignment.CenterY | Alignment.Right, subTextBlock, false, GUI.SmallFont);
shuttleText.TextColor = subTextBlock.TextColor * 0.8f;
shuttleText.ToolTip = subTextBlock.ToolTip;
}
}