feat: trigger fighter behavior from lobby action button

This commit is contained in:
ud18010
2026-07-30 17:00:31 +08:00
parent 03cee1036d
commit e9efa8a567
9 changed files with 674 additions and 0 deletions
@@ -30,6 +30,22 @@ namespace XWorld.Framework.Tests.ActorBehavior
Assert.Contains(world.DrainEvents(), e => e.Kind == BehaviorEventKind.BehaviorStopped);
}
[Fact]
public void RemoveActor_ClearsActorStateAndActiveEffects()
{
BehaviorWorld world = TestWorld.CreateServerWorld();
world.TryStartBehavior(1, "slash", BehaviorInput.FromDirection(1, 0));
Assert.True(world.ApplyBuff(1, "fighter", "slow_01", 1));
Assert.True(world.ApplyBuff(2, "fighter", "slow_01", 1));
Assert.True(world.RemoveActor(1));
Assert.False(world.HasActiveBehavior(1));
Assert.Equal(0, world.ActiveBuffCount(1));
Assert.Equal(0, world.ActiveBuffCount(2));
Assert.False(world.TryStartBehavior(1, "slash", BehaviorInput.FromDirection(1, 0)).Success);
}
[Fact]
public void Tick_TriggersTimelineEventsAtConfiguredTimes()
{