The great event move

This commit is contained in:
Evil Factory
2026-02-20 18:45:41 -03:00
parent c28a08a713
commit f52617deab
22 changed files with 508 additions and 112 deletions
@@ -1,13 +1,15 @@
using Barotrauma.Extensions;
using Barotrauma.Items.Components;
using Barotrauma.LuaCs.Events;
using Barotrauma.Networking;
using FarseerPhysics;
using FarseerPhysics.Dynamics;
using Microsoft.Xna.Framework;
using MoonSharp.Interpreter;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Xml.Linq;
using MoonSharp.Interpreter;
namespace Barotrauma
{
@@ -883,8 +885,8 @@ namespace Barotrauma
if (Math.Max(hull1.WorldSurface + hull1.WaveY[hull1.WaveY.Length - 1], hull2.WorldSurface + hull2.WaveY[0]) > WorldRect.Y) { return; }
}
var should = GameMain.LuaCs.Hook.Call<bool?>("gapOxygenUpdate", this, hull1, hull2);
bool? should = null;
GameMain.LuaCs.EventService.PublishEvent<IEventGapOxygenUpdate>(x => should = x.OnGapOxygenUpdate(this, hull1, hull2) ?? should);
if (should != null && should.Value) return;
float totalOxygen = hull1.Oxygen + hull2.Oxygen;