(5c35a640e) Update tutorial-rework with dev
This commit is contained in:
@@ -11,11 +11,11 @@ namespace Barotrauma
|
||||
{
|
||||
private List<CharacterCampaignData> characterData = new List<CharacterCampaignData>();
|
||||
|
||||
public static void StartNewCampaign(string savePath, string subName, string seed)
|
||||
public static void StartNewCampaign(string savePath, string subPath, string seed)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(savePath)) return;
|
||||
|
||||
GameMain.GameSession = new GameSession(new Submarine(subName, ""), savePath,
|
||||
GameMain.GameSession = new GameSession(new Submarine(subPath, ""), savePath,
|
||||
GameModePreset.List.Find(g => g.Identifier == "multiplayercampaign"));
|
||||
var campaign = ((MultiPlayerCampaign)GameMain.GameSession.GameMode);
|
||||
campaign.GenerateMap(seed);
|
||||
@@ -72,6 +72,27 @@ namespace Barotrauma
|
||||
});
|
||||
}
|
||||
|
||||
public bool AllowedToEndRound(Character interactor)
|
||||
{
|
||||
if (interactor == null || Level.Loaded?.StartOutpost == null || Level.Loaded?.EndOutpost == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (interactor.Submarine == Level.Loaded.StartOutpost &&
|
||||
interactor.CanInteractWith(startWatchman))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
if (interactor.Submarine == Level.Loaded.EndOutpost &&
|
||||
interactor.CanInteractWith(endWatchman))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
protected override void WatchmanInteract(Character watchman, Character interactor)
|
||||
{
|
||||
if ((watchman.Submarine == Level.Loaded.StartOutpost && !Submarine.MainSub.AtStartPosition) ||
|
||||
@@ -85,8 +106,7 @@ namespace Barotrauma
|
||||
if (GameMain.Server != null)
|
||||
{
|
||||
var client = GameMain.Server.ConnectedClients.Find(c => c.Character == interactor);
|
||||
hasPermissions = client != null &&
|
||||
(client.HasPermission(ClientPermissions.ManageRound) || client.HasPermission(ClientPermissions.ManageCampaign));
|
||||
hasPermissions = client != null;
|
||||
CreateDialog(new List<Character> { watchman }, hasPermissions ? "WatchmanInteract" : "WatchmanInteractNotAllowed", 1.0f);
|
||||
}
|
||||
}
|
||||
@@ -231,6 +251,7 @@ namespace Barotrauma
|
||||
}
|
||||
|
||||
lastSaveID++;
|
||||
DebugConsole.Log("Campaign saved, save ID " + lastSaveID);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user