v0.5.1.2: spawnitem console command, "spawn inside" always spawns characters in the main sub, a new music clip, modified the topwindow sprite a bit
This commit is contained in:
@@ -1281,6 +1281,9 @@
|
|||||||
<None Include="Content\Sounds\Music\Enter the Maze.ogg">
|
<None Include="Content\Sounds\Music\Enter the Maze.ogg">
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
</None>
|
</None>
|
||||||
|
<None Include="Content\Sounds\Music\Phantom From Space.ogg">
|
||||||
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
|
</None>
|
||||||
<None Include="Content\Sounds\Music\Road to Hell.ogg">
|
<None Include="Content\Sounds\Music\Road to Hell.ogg">
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
</None>
|
</None>
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 1.2 MiB After Width: | Height: | Size: 1.2 MiB |
Binary file not shown.
@@ -43,6 +43,7 @@
|
|||||||
|
|
||||||
<music file="Content/Sounds/Music/Enter the Maze.ogg" type="repair" priorityrange="30,60"/>
|
<music file="Content/Sounds/Music/Enter the Maze.ogg" type="repair" priorityrange="30,60"/>
|
||||||
<music file="Content/Sounds/Music/Static Motion.ogg" type="repair" priorityrange="50,80"/>
|
<music file="Content/Sounds/Music/Static Motion.ogg" type="repair" priorityrange="50,80"/>
|
||||||
|
<music file="Content/Sounds/Music/Phantom From Space.ogg" type="monster" priorityrange="25,60"/>
|
||||||
<music file="Content/Sounds/Music/Unseen Horrors.ogg" type="monster" priorityrange="40,100"/>
|
<music file="Content/Sounds/Music/Unseen Horrors.ogg" type="monster" priorityrange="40,100"/>
|
||||||
|
|
||||||
<music file="Content/Sounds/Music/amb_JD_drone_clattering_machine.ogg" type="deep"/>
|
<music file="Content/Sounds/Music/amb_JD_drone_clattering_machine.ogg" type="deep"/>
|
||||||
|
|||||||
@@ -31,5 +31,5 @@ using System.Runtime.InteropServices;
|
|||||||
// You can specify all the values or you can default the Build and Revision Numbers
|
// You can specify all the values or you can default the Build and Revision Numbers
|
||||||
// by using the '*' as shown below:
|
// by using the '*' as shown below:
|
||||||
// [assembly: AssemblyVersion("1.0.*")]
|
// [assembly: AssemblyVersion("1.0.*")]
|
||||||
[assembly: AssemblyVersion("0.5.1.1")]
|
[assembly: AssemblyVersion("0.5.1.2")]
|
||||||
[assembly: AssemblyFileVersion("0.5.1.1")]
|
[assembly: AssemblyFileVersion("0.5.1.2")]
|
||||||
|
|||||||
@@ -181,6 +181,7 @@ namespace Barotrauma
|
|||||||
NewMessage(" ", Color.Cyan);
|
NewMessage(" ", Color.Cyan);
|
||||||
|
|
||||||
NewMessage("spawn [creaturename] [near/inside/outside]: spawn a creature at a random spawnpoint (use the second parameter to only select spawnpoints near/inside/outside the submarine)", Color.Cyan);
|
NewMessage("spawn [creaturename] [near/inside/outside]: spawn a creature at a random spawnpoint (use the second parameter to only select spawnpoints near/inside/outside the submarine)", Color.Cyan);
|
||||||
|
NewMessage("spawnitem [itemname] [cursor/inventory]: spawn an item at the position of the cursor, in the inventory of the controlled character or at a random spawnpoint if the last parameter is omitted", Color.Cyan);
|
||||||
|
|
||||||
NewMessage(" ", Color.Cyan);
|
NewMessage(" ", Color.Cyan);
|
||||||
|
|
||||||
@@ -200,7 +201,7 @@ namespace Barotrauma
|
|||||||
NewMessage("revive: bring the controlled character back from the dead", Color.Cyan);
|
NewMessage("revive: bring the controlled character back from the dead", Color.Cyan);
|
||||||
|
|
||||||
NewMessage(" ", Color.Cyan);
|
NewMessage(" ", Color.Cyan);
|
||||||
|
|
||||||
NewMessage("fixwalls: fixes all the walls", Color.Cyan);
|
NewMessage("fixwalls: fixes all the walls", Color.Cyan);
|
||||||
NewMessage("fixitems: fixes every item/device in the sub", Color.Cyan);
|
NewMessage("fixitems: fixes every item/device in the sub", Color.Cyan);
|
||||||
NewMessage("oxygen: replenishes the oxygen in every room to 100%", Color.Cyan);
|
NewMessage("oxygen: replenishes the oxygen in every room to 100%", Color.Cyan);
|
||||||
@@ -219,6 +220,7 @@ namespace Barotrauma
|
|||||||
UpdaterUtil.SaveFileList("filelist.xml");
|
UpdaterUtil.SaveFileList("filelist.xml");
|
||||||
break;
|
break;
|
||||||
case "spawn":
|
case "spawn":
|
||||||
|
case "spawncharacter":
|
||||||
if (commands.Length == 1) return;
|
if (commands.Length == 1) return;
|
||||||
|
|
||||||
Character spawnedCharacter = null;
|
Character spawnedCharacter = null;
|
||||||
@@ -231,7 +233,7 @@ namespace Barotrauma
|
|||||||
switch (commands[2].ToLowerInvariant())
|
switch (commands[2].ToLowerInvariant())
|
||||||
{
|
{
|
||||||
case "inside":
|
case "inside":
|
||||||
spawnPoint = WayPoint.GetRandom(SpawnType.Human);
|
spawnPoint = WayPoint.GetRandom(SpawnType.Human, null, Submarine.MainSub);
|
||||||
break;
|
break;
|
||||||
case "outside":
|
case "outside":
|
||||||
spawnPoint = WayPoint.GetRandom(SpawnType.Enemy);
|
spawnPoint = WayPoint.GetRandom(SpawnType.Enemy);
|
||||||
@@ -294,6 +296,54 @@ namespace Barotrauma
|
|||||||
GameMain.Server.SendCharacterSpawnMessage(spawnedCharacter);
|
GameMain.Server.SendCharacterSpawnMessage(spawnedCharacter);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
|
case "spawnitem":
|
||||||
|
if (commands.Length < 2) return;
|
||||||
|
|
||||||
|
Vector2? spawnPos = null;
|
||||||
|
Inventory spawnInventory = null;
|
||||||
|
|
||||||
|
int extraParams = 0;
|
||||||
|
switch (commands.Last())
|
||||||
|
{
|
||||||
|
case "cursor":
|
||||||
|
extraParams = 1;
|
||||||
|
spawnPos = GameMain.GameScreen.Cam.ScreenToWorld(PlayerInput.MousePosition);
|
||||||
|
break;
|
||||||
|
case "inventory":
|
||||||
|
extraParams = 1;
|
||||||
|
spawnInventory = Character.Controlled == null ? null : Character.Controlled.Inventory;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
extraParams = 0;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
string itemName = string.Join(" ", commands.Skip(1).Take(commands.Length - extraParams - 1)).ToLowerInvariant();
|
||||||
|
|
||||||
|
var itemPrefab = MapEntityPrefab.list.Find(ip => ip.Name.ToLowerInvariant() == itemName) as ItemPrefab;
|
||||||
|
if (itemPrefab == null)
|
||||||
|
{
|
||||||
|
ThrowError("Item \""+itemName+"\" not found!");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (spawnPos == null && spawnInventory == null)
|
||||||
|
{
|
||||||
|
var wp = WayPoint.GetRandom(SpawnType.Human, null, Submarine.MainSub);
|
||||||
|
spawnPos = wp == null ? Vector2.Zero : wp.WorldPosition;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (spawnPos != null)
|
||||||
|
{
|
||||||
|
Item.Spawner.QueueItem(itemPrefab, (Vector2)spawnPos, false);
|
||||||
|
|
||||||
|
}
|
||||||
|
else if (spawnInventory != null)
|
||||||
|
{
|
||||||
|
Item.Spawner.QueueItem(itemPrefab, (Inventory)spawnInventory, false);
|
||||||
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case "disablecrewai":
|
case "disablecrewai":
|
||||||
HumanAIController.DisableCrewAI = !HumanAIController.DisableCrewAI;
|
HumanAIController.DisableCrewAI = !HumanAIController.DisableCrewAI;
|
||||||
|
|||||||
@@ -17,20 +17,20 @@ namespace Barotrauma
|
|||||||
spawnQueue = new Queue<Pair<ItemPrefab, object>>();
|
spawnQueue = new Queue<Pair<ItemPrefab, object>>();
|
||||||
}
|
}
|
||||||
|
|
||||||
//public void QueueItem(ItemPrefab itemPrefab, Vector2 position, bool isNetworkMessage = false)
|
public void QueueItem(ItemPrefab itemPrefab, Vector2 worldPosition, bool isNetworkMessage = false)
|
||||||
//{
|
{
|
||||||
// if (!isNetworkMessage && GameMain.Client!=null)
|
if (!isNetworkMessage && GameMain.Client != null)
|
||||||
// {
|
{
|
||||||
// //clients aren't allowed to spawn new items unless the server says so
|
//clients aren't allowed to spawn new items unless the server says so
|
||||||
// return;
|
return;
|
||||||
// }
|
}
|
||||||
|
|
||||||
// var itemInfo = new Pair<ItemPrefab, object>();
|
var itemInfo = new Pair<ItemPrefab, object>();
|
||||||
// itemInfo.First = itemPrefab;
|
itemInfo.First = itemPrefab;
|
||||||
// itemInfo.Second = position;
|
itemInfo.Second = worldPosition;
|
||||||
|
|
||||||
// spawnQueue.Enqueue(itemInfo);
|
spawnQueue.Enqueue(itemInfo);
|
||||||
//}
|
}
|
||||||
|
|
||||||
public void QueueItem(ItemPrefab itemPrefab, Inventory inventory, bool isNetworkMessage = false)
|
public void QueueItem(ItemPrefab itemPrefab, Inventory inventory, bool isNetworkMessage = false)
|
||||||
{
|
{
|
||||||
@@ -58,26 +58,22 @@ namespace Barotrauma
|
|||||||
{
|
{
|
||||||
var itemInfo = spawnQueue.Dequeue();
|
var itemInfo = spawnQueue.Dequeue();
|
||||||
|
|
||||||
//if (itemInfo.Second is Vector2)
|
if (itemInfo.Second is Vector2)
|
||||||
//{
|
{
|
||||||
// //todo: take multiple subs into account
|
var item = new Item(itemInfo.First, (Vector2)itemInfo.Second, null);
|
||||||
// Vector2 position = (Vector2)itemInfo.Second - Submarine.MainSub.HiddenSubPosition;
|
AddToSpawnedList(item);
|
||||||
|
|
||||||
// items.Add(new Item(itemInfo.First, position, null));
|
items.Add(item);
|
||||||
// inventories.Add(null);
|
}
|
||||||
|
else if (itemInfo.Second is Inventory)
|
||||||
//}
|
|
||||||
//else
|
|
||||||
if (itemInfo.Second is Inventory)
|
|
||||||
{
|
{
|
||||||
var item = new Item(itemInfo.First, Vector2.Zero, null);
|
var item = new Item(itemInfo.First, Vector2.Zero, null);
|
||||||
AddToSpawnedList(item);
|
AddToSpawnedList(item);
|
||||||
|
|
||||||
var inventory = (Inventory)itemInfo.Second;
|
var inventory = (Inventory)itemInfo.Second;
|
||||||
inventory.TryPutItem(item, null, false);
|
inventory.TryPutItem(item, item.AllowedSlots, false);
|
||||||
|
|
||||||
items.Add(item);
|
items.Add(item);
|
||||||
//inventories.Add(inventory);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -131,8 +127,6 @@ namespace Barotrauma
|
|||||||
Vector2 pos = Vector2.Zero;
|
Vector2 pos = Vector2.Zero;
|
||||||
ushort inventoryId = message.ReadUInt16();
|
ushort inventoryId = message.ReadUInt16();
|
||||||
|
|
||||||
Submarine sub = null;
|
|
||||||
|
|
||||||
int inventorySlotIndex = -1;
|
int inventorySlotIndex = -1;
|
||||||
|
|
||||||
if (inventoryId > 0)
|
if (inventoryId > 0)
|
||||||
|
|||||||
@@ -1,3 +1,13 @@
|
|||||||
|
---------------------------------------------------------------------------------------------------------
|
||||||
|
v0.5.1.2
|
||||||
|
---------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
- hacked clients can't join a full server or change the name of their character anymore
|
||||||
|
- option to choose which character to control using the "control" command when there are multiple
|
||||||
|
characters/creatures with the same name
|
||||||
|
- a console command for spawning items
|
||||||
|
- the server logs show who sent each chat message
|
||||||
|
|
||||||
---------------------------------------------------------------------------------------------------------
|
---------------------------------------------------------------------------------------------------------
|
||||||
v0.5.1.1
|
v0.5.1.1
|
||||||
---------------------------------------------------------------------------------------------------------
|
---------------------------------------------------------------------------------------------------------
|
||||||
|
|||||||
Reference in New Issue
Block a user