World changes

This commit is contained in:
dingo
2026-02-17 11:18:55 -05:00
parent cae32f6157
commit 14d74fa9ce
23 changed files with 3029 additions and 157 deletions
+40
View File
@@ -0,0 +1,40 @@
using System.Collections.Concurrent;
using GameServer.Dungeon;
namespace GameServer.Shared;
/// <summary>
/// Abstraction over the spatial/entity environment that MobAI and combat systems need.
/// Implemented by both DungeonSimulation (dungeons) and WorldZoneSimulation (overworld).
/// </summary>
public interface ICombatEnvironment
{
// ---- Spatial ----
/// <summary>Check if an actor-sized entity can move to the given world-pixel position.</summary>
bool CanActorMoveTo(float x, float y);
// ---- Entity lookups ----
/// <summary>All alive players in this environment.</summary>
IEnumerable<IPlayerTarget> GetAlivePlayers();
/// <summary>All alive mobs in this environment.</summary>
ConcurrentDictionary<int, MobInstance> Mobs { get; }
/// <summary>Get a specific player by character ID.</summary>
IPlayerTarget? GetPlayer(ulong characterId);
// ---- Mob summoning ----
/// <summary>Request spawning a new mob (summoner ability).</summary>
void RequestMobSummon(int mobDefinitionId, float x, float y, int tier);
// ---- Context ----
/// <summary>The tier/difficulty level of this environment (dungeon tier or world zone level).</summary>
int Tier { get; }
/// <summary>Current simulation tick.</summary>
long CurrentTick { get; }
}
+43
View File
@@ -0,0 +1,43 @@
using GameServer.Dungeon;
namespace GameServer.Shared;
/// <summary>
/// Interface for player combat state, implemented by both dungeon PlayerInstance
/// and world WorldPlayerCombatState. Provides the combat-relevant surface that
/// MobAI and CombatCalculator need.
/// </summary>
public interface IPlayerTarget
{
ulong CharacterId { get; }
string CharacterName { get; }
// Position
float X { get; }
float Y { get; }
// Vitals
float Health { get; set; }
float MaxHealth { get; }
bool IsAlive { get; set; }
bool IsInvulnerable { get; }
// Combat stats
int Strength { get; }
int Intelligence { get; }
int Endurance { get; }
int Dexterity { get; }
int Armor { get; }
string WeaponDamageTypeKey { get; }
Dictionary<string, float> Resistances { get; }
// Status effects
List<PlayerStatusEffect> StatusEffects { get; }
bool IsStunned { get; }
bool IsRooted { get; }
bool IsFeared { get; }
// Combat tracking
bool IsInCombat { get; set; }
long LastCombatTick { get; set; }
}