Unstable v0.1300.0.1
This commit is contained in:
@@ -242,6 +242,21 @@ namespace Barotrauma
|
||||
conversationTimer = IsSinglePlayer ? Rand.Range(5.0f, 10.0f) : Rand.Range(45.0f, 60.0f);
|
||||
}
|
||||
|
||||
public void RenameCharacter(CharacterInfo characterInfo, string newName)
|
||||
{
|
||||
int identifier = characterInfo.GetIdentifierUsingOriginalName();
|
||||
var match = characterInfos.FirstOrDefault(ci => ci.GetIdentifierUsingOriginalName() == identifier);
|
||||
if (match == null)
|
||||
{
|
||||
DebugConsole.ThrowError($"Tried to rename an invalid crew member ({identifier})");
|
||||
return;
|
||||
}
|
||||
match.Rename(newName);
|
||||
RenameCharacterProjSpecific(match);
|
||||
}
|
||||
|
||||
partial void RenameCharacterProjSpecific(CharacterInfo characterInfo);
|
||||
|
||||
public void FireCharacter(CharacterInfo characterInfo)
|
||||
{
|
||||
RemoveCharacterInfo(characterInfo);
|
||||
@@ -277,6 +292,7 @@ namespace Barotrauma
|
||||
|
||||
private void UpdateConversations(float deltaTime)
|
||||
{
|
||||
if (GameMain.GameSession?.GameMode?.Preset == GameModePreset.TestMode) { return; }
|
||||
if (GameMain.NetworkMember != null && GameMain.NetworkMember.ServerSettings.DisableBotConversations) { return; }
|
||||
|
||||
conversationTimer -= deltaTime;
|
||||
@@ -305,19 +321,33 @@ namespace Barotrauma
|
||||
{
|
||||
List<Character> availableSpeakers = new List<Character>() { npc, player };
|
||||
List<string> dialogFlags = new List<string>() { "OutpostNPC", "EnterOutpost" };
|
||||
if (GameMain.GameSession?.GameMode is CampaignMode campaignMode && campaignMode.Map?.CurrentLocation?.Reputation != null)
|
||||
if (GameMain.GameSession?.GameMode is CampaignMode campaignMode)
|
||||
{
|
||||
float normalizedReputation = MathUtils.InverseLerp(
|
||||
campaignMode.Map.CurrentLocation.Reputation.MinReputation,
|
||||
campaignMode.Map.CurrentLocation.Reputation.MaxReputation,
|
||||
campaignMode.Map.CurrentLocation.Reputation.Value);
|
||||
if (normalizedReputation < 0.2f)
|
||||
if (campaignMode.Map?.CurrentLocation?.Type?.Identifier.Equals("abandoned", StringComparison.OrdinalIgnoreCase) ?? false)
|
||||
{
|
||||
dialogFlags.Add("LowReputation");
|
||||
if (npc.TeamID == CharacterTeamType.None)
|
||||
{
|
||||
dialogFlags.Add("Bandit");
|
||||
}
|
||||
else if (npc.TeamID == CharacterTeamType.FriendlyNPC)
|
||||
{
|
||||
dialogFlags.Add("Hostage");
|
||||
}
|
||||
}
|
||||
else if (normalizedReputation > 0.8f)
|
||||
else if (campaignMode.Map?.CurrentLocation?.Reputation != null)
|
||||
{
|
||||
dialogFlags.Add("HighReputation");
|
||||
float normalizedReputation = MathUtils.InverseLerp(
|
||||
campaignMode.Map.CurrentLocation.Reputation.MinReputation,
|
||||
campaignMode.Map.CurrentLocation.Reputation.MaxReputation,
|
||||
campaignMode.Map.CurrentLocation.Reputation.Value);
|
||||
if (normalizedReputation < 0.2f)
|
||||
{
|
||||
dialogFlags.Add("LowReputation");
|
||||
}
|
||||
else if (normalizedReputation > 0.8f)
|
||||
{
|
||||
dialogFlags.Add("HighReputation");
|
||||
}
|
||||
}
|
||||
}
|
||||
pendingConversationLines.AddRange(NPCConversation.CreateRandom(availableSpeakers, dialogFlags));
|
||||
|
||||
Reference in New Issue
Block a user