Merge branch 'dev' of https://github.com/Regalis11/Barotrauma.git into unstable-tests

This commit is contained in:
Evil Factory
2022-04-11 15:58:36 -03:00
38 changed files with 361 additions and 184 deletions
@@ -566,9 +566,13 @@ namespace Barotrauma
#elif SERVER
if (value is { IsDead: true, Wallet: { Balance: var balance } grabbedWallet } && balance > 0)
{
Wallet.Give(balance);
if (GameMain.GameSession.Campaign is MultiPlayerCampaign mpCampaign)
{
mpCampaign.Bank.Give(balance);
}
grabbedWallet.Deduct(balance);
GameServer.Log($"{Name} grabbed {value.Name}'s body and received {grabbedWallet.Balance} mk.", ServerLog.MessageType.Money);
GameServer.Log($"{GameServer.CharacterLogName(this)} grabbed {value.Name}'s body and received {grabbedWallet.Balance} mk.", ServerLog.MessageType.Money);
}
#endif
}
@@ -40,6 +40,12 @@ namespace Barotrauma
[Serialize(Level.PositionType.Wreck, IsPropertySaveable.No)]
public Level.PositionType SpawnPosition { get; private set; }
[Serialize(0, IsPropertySaveable.No)]
public int MinMoney { get; private set; }
[Serialize(0, IsPropertySaveable.No)]
public int MaxMoney { get; private set; }
public CorpsePrefab(ContentXElement element, CorpsesFile file) : base(element, file) { }
public static CorpsePrefab Random(Rand.RandSync sync = Rand.RandSync.Unsynced) => Prefabs.GetRandom(sync);