v1.1.18.0 (Treacherous Tides Update)

This commit is contained in:
Regalis11
2023-10-19 19:28:43 +03:00
parent 34ffc520cc
commit df7e8f1625
21 changed files with 196 additions and 89 deletions
@@ -265,7 +265,7 @@ namespace Barotrauma
{
if (!IgnoreAtOutpost) { return false; }
if (!Level.IsLoadedFriendlyOutpost) { return false; }
if (!character.IsOnPlayerTeam) { return false; }
if (!character.IsOnPlayerTeam || character.IsFriendlyNPCTurnedHostile) { return false; }
if (character.Submarine?.Info == null) { return false; }
return character.Submarine.Info.IsOutpost && character.Submarine.TeamID == CharacterTeamType.FriendlyNPC;
}
@@ -339,6 +339,8 @@ namespace Barotrauma
public bool IsOriginallyOnPlayerTeam => originalTeamID == CharacterTeamType.Team1 || originalTeamID == CharacterTeamType.Team2;
public bool IsFriendlyNPCTurnedHostile => originalTeamID == CharacterTeamType.FriendlyNPC && teamID == CharacterTeamType.Team2;
public bool IsInstigator => CombatAction != null && CombatAction.IsInstigator;
public CombatAction CombatAction;
@@ -79,8 +79,11 @@ namespace Barotrauma
{
DebugConsole.ThrowError($"Error in event \"{ParentEvent.Prefab.Identifier}\". {nameof(CheckItemAction)} does't define either tags or identifiers of the item to check.");
}
checkPercentage = element.GetAttribute(nameof(RequiredConditionalMatchPercentage)) is not null;
if (checkPercentage && conditionals.None())
{
DebugConsole.ThrowError($"Error in event \"{ParentEvent.Prefab.Identifier}\". {nameof(CheckItemAction)} requires conditionals to be met on {requiredConditionalMatchPercentage}% of the targets, but there are no conditionals defined.");
}
if (Amount != 1 && checkPercentage)
{
DebugConsole.ThrowError($"Error in event \"{ParentEvent.Prefab.Identifier}\". Cannot define both '{Amount}' and '{RequiredConditionalMatchPercentage}' in {nameof(CheckItemAction)}.");
@@ -134,7 +137,8 @@ namespace Barotrauma
foreach (var target in targets)
{
if (target is not Item item) { continue; }
if (itemTags.Any(item.HasTag) || itemIdentifierSplit.Contains(item.Prefab.Identifier))
if (itemTags.Any(item.HasTag) || itemIdentifierSplit.Contains(item.Prefab.Identifier) ||
(itemTags.None() && itemIdentifierSplit.None() && conditionals.Any()))
{
if (ConditionalsMatch(item, character: null))
{
@@ -28,6 +28,9 @@ namespace Barotrauma
[Serialize(false, IsPropertySaveable.Yes)]
public bool ChooseRandom { get; set; }
[Serialize(false, IsPropertySaveable.Yes, description: "Should the event continue if the TagAction can't find any valid targets?")]
public bool ContinueIfNoTargetsFound { get; set; }
[Serialize(0.0f, IsPropertySaveable.Yes, description: "If larger than 0, the specified percentage of the matching targets are tagged. Between 0-100.")]
public float ChoosePercentage { get; set; }
@@ -279,7 +282,14 @@ namespace Barotrauma
}
}
isFinished = !targetNotFound;
if (ContinueIfNoTargetsFound)
{
isFinished = true;
}
else
{
isFinished = !targetNotFound;
}
}
public override string ToDebugString()
@@ -230,7 +230,7 @@ namespace Barotrauma
Bank = new Wallet(Option<Character>.None(), subElement);
break;
#if SERVER
case nameof(TraitorManager):
case "traitormanager":
GameMain.Server?.TraitorManager?.Load(subElement);
break;
case "savedexperiencepoints":
@@ -443,11 +443,11 @@ namespace Barotrauma.Items.Components
// Set the contained items active if there's an item inserted inside the container. Enables e.g. the rifle flashlight when it's attached to the rifle (put inside of it).
SetContainedActive(true);
}
if (containedItem.FlippedX)
if (containedItem.FlippedX != item.FlippedX)
{
containedItem.FlipX(relativeToSub: false);
}
if (containedItem.FlippedY)
if (containedItem.FlippedY != item.FlippedY)
{
containedItem.FlipY(relativeToSub: false);
}
@@ -1319,17 +1319,20 @@ namespace Barotrauma
}
}
for (int i = 0; i < components.Count && i < clone.components.Count; i++)
if (clonedContainedItems.Any())
{
ItemComponent component = components[i],
cloneComp = clone.components[i];
if (component is not CircuitBox origBox || cloneComp is not CircuitBox cloneBox)
for (int i = 0; i < components.Count && i < clone.components.Count; i++)
{
continue;
}
ItemComponent component = components[i],
cloneComp = clone.components[i];
cloneBox.CloneFrom(origBox, clonedContainedItems);
if (component is not CircuitBox origBox || cloneComp is not CircuitBox cloneBox)
{
continue;
}
cloneBox.CloneFrom(origBox, clonedContainedItems);
}
}
clone.FullyInitialized = true;
@@ -3230,7 +3233,7 @@ namespace Barotrauma
SetDroppedStackItemStates();
droppedStack = null;
#if SERVER
if (GameMain.NetworkMember is { IsServer: true } server)
if (GameMain.NetworkMember is { IsServer: true } server && !Removed)
{
server.CreateEntityEvent(this, new DroppedStackEventData(Enumerable.Empty<Item>()));
}
@@ -1379,7 +1379,7 @@ namespace Barotrauma
if (sub.Info.IsOutpost)
{
#if CLIENT
if (GameMain.GameSession.GameMode is TutorialMode) { continue; }
if (GameMain.GameSession?.GameMode is TutorialMode) { continue; }
#endif
OutpostGenerator.PowerUpOutpost(sub);
}
@@ -2106,7 +2106,7 @@ namespace Barotrauma
DebugConsole.ThrowError("Failed to generate alien ruins. Could not find any RuinGenerationParameters!");
return;
}
DebugConsole.NewMessage($"Creating alien ruins using {selectedRuinGenerationParams.Identifier} (preferred difficulty: {selectedRuinGenerationParams.PreferredDifficulty}, current difficulty {Difficulty})", color: Color.Yellow);
DebugConsole.NewMessage($"Creating alien ruins using {selectedRuinGenerationParams.Identifier} (preferred difficulty: {selectedRuinGenerationParams.PreferredDifficulty}, current difficulty {Difficulty})", color: Color.Yellow, debugOnly: true);
LocationType locationType = StartLocation?.Type;
if (locationType == null)
@@ -4559,7 +4559,7 @@ namespace Barotrauma
{
if (sub?.Info?.OutpostGenerationParams != null)
{
OutpostGenerator.SpawnNPCs((GameMain.GameSession?.GameMode as CampaignMode)?.Map?.CurrentLocation, sub);
OutpostGenerator.SpawnNPCs(StartLocation, sub);
}
}
}
@@ -1281,6 +1281,8 @@ namespace Barotrauma
explosionOnBroken.Attack.Range = explosionRange * gap.Open;
explosionOnBroken.Attack.DamageMultiplier = explosionStrength;
explosionOnBroken.Attack.Stun = MathHelper.Clamp(explosionStrength, 0.5f, 1.0f);
explosionOnBroken.IgnoredCharacters.Clear();
if (attacker?.AIController is EnemyAIController) { explosionOnBroken.IgnoredCharacters.Add(attacker); }
explosionOnBroken?.Explode(gap.WorldPosition, damageSource: null, attacker: attacker);
#if CLIENT
if (linkedHull != null)
@@ -2155,11 +2155,11 @@ namespace Barotrauma
rotation += spread;
if (projectile != null)
{
var sourceEntity = (sourceBody as ISpatialEntity) ?? entity;
var sourceEntity = (sourceBody?.UserData as ISpatialEntity) ?? entity;
Vector2 spawnPos = sourceEntity.SimPosition;
projectile.Shoot(user, spawnPos, spawnPos, rotation,
ignoredBodies: user?.AnimController.Limbs.Where(l => !l.IsSevered).Select(l => l.body.FarseerBody).ToList(), createNetworkEvent: true);
projectile.Item.Submarine = sourceEntity?.Submarine;
projectile.Item.Submarine = projectile.LaunchSub = sourceEntity?.Submarine;
}
else if (newItem.body != null)
{
@@ -218,6 +218,18 @@ namespace Barotrauma
public readonly int DangerLevel;
/// <summary>
/// An event of this danger level (or higher) must have been selected previously for this event to trigger.
/// It does not matter whether the event was completed successfully or not. Defaults to one less than the DangerLevel of this event.
/// </summary>
public readonly int RequiredPreviousDangerLevel;
/// <summary>
/// An event of a lower danger level must have been completed on the previous round for this event to trigger.
/// Defaults to false (no requirements)
/// </summary>
public readonly bool RequirePreviousDangerLevelCompleted;
/// <summary>
/// Minimum number of non-spectating human players on the server for the event to get selected.
/// </summary>
@@ -254,7 +266,10 @@ namespace Barotrauma
public TraitorEventPrefab(ContentXElement element, RandomEventsFile file, Identifier fallbackIdentifier = default)
: base(element, file, fallbackIdentifier)
{
DangerLevel = MathHelper.Clamp(element.GetAttributeInt(nameof(DangerLevel), MinDangerLevel), MinDangerLevel, MaxDangerLevel);
DangerLevel = MathHelper.Clamp(element.GetAttributeInt(nameof(DangerLevel), MinDangerLevel), min: MinDangerLevel, max: MaxDangerLevel);
RequiredPreviousDangerLevel = MathHelper.Clamp(element.GetAttributeInt(nameof(RequiredPreviousDangerLevel), def: DangerLevel - 1), min: 0, max: MaxDangerLevel - 1);
RequirePreviousDangerLevelCompleted = element.GetAttributeBool(nameof(RequirePreviousDangerLevelCompleted), false);
MinPlayerCount = element.GetAttributeInt(nameof(MinPlayerCount), 0);
+36 -1
View File
@@ -1,3 +1,39 @@
-------------------------------------------------------------------------------------------------------------------------------------------------
v1.1.18.0
-------------------------------------------------------------------------------------------------------------------------------------------------
- Updated translations.
- Modding: Added ContinueIfNoTargetsFound property to TagAction. Can be used to allow the event to continue even if the TagAction can't find any valid targets (by default the event wont continue until at least one target is found).
-------------------------------------------------------------------------------------------------------------------------------------------------
v1.1.17.0
-------------------------------------------------------------------------------------------------------------------------------------------------
- Changed traitor event selection logic a bit: most of the more dangerous events can trigger as long as a less dangerous event has been selected previously, even if that event wasn't completed successfully. Previously many of the dangerous events were extremely rare, because they required 1. completing an easier event first 2. a specific mission to be selected on the following round.
- Adjusted traitor event probabilities a bit to make some of the rarer ones more common.
- Fixes to some oddities and inconsistencies in containers: backpacks can't go in crates, duffel bags or outpost cabinets, fixed storage containers going in outpost cabinets.
- Fixed searchlights appearing as turrets in the "operate weapon" order (and the bots would complain about not being able to load ammo into them if you ordered them to operate one).
- Fixed security fleeing from the player during jailbreak missions.
- Fixed security not spawning in jailbreak missions in the mission mode.
- Fixed morphine not being shown as a suitable treatment for the concussion in the medic tutorial.
- Fixed abandoned outpost you're supposed to rescue Jacov Subra from sometimes turning into a normal outpost and cancelling the mission.
- Fixed some scripted events throwing unnecessary "no conditionals defined" console errors.
-------------------------------------------------------------------------------------------------------------------------------------------------
v1.1.16.0
-------------------------------------------------------------------------------------------------------------------------------------------------
- Fixed several issues when editing traitor events in the event editor (console errors, some actions not loading properly, inability to set a new event as a traitor event).
- Backpacks can't be put in cargo scooters.
- Fixed some traitor events being impossible to complete (harbringer of honks, faulty robes, handcuff shortage).
- Fixed latcher's tongue failing to attach to submarines.
- Fixed crashing when deleting a circuit box in the submarine editor. Undoing the deletion still does not work unfortunately, but we are looking into fixing that.
- Fixed errors when modifying any properties of an ItemLabel or Turret component in multiplayer.
- Fixed flashlights in guns (or other contained items) not getting flipped in the same direction as the container when put inside the container.
- Monsters don't get damaged by the hull shrapnel when they break a wall themselves.
- Fixed "can't create an entity event" error when ending a multiplayer round when there's dropped stacks around.
-------------------------------------------------------------------------------------------------------------------------------------------------
v1.1.15.0
-------------------------------------------------------------------------------------------------------------------------------------------------
@@ -122,7 +158,6 @@ Multiplayer:
- Fixed characters getting removed at the end of the round if they've died and then been revived with the "revive" console command.
AI:
- Fixed searchlights not attracting monsters.
- Fixed bots "cleaning up" (or stealing) batteries from portable pumps.
- Fixed bots never cleaning up detached wires.
- Fixed bots sometimes ignoring the leaks right next to doors/hatches.