Update double input issues, pigman is no longer unbound, limit his weapon access too

This commit is contained in:
Michal Pikulski
2025-12-16 18:58:50 +01:00
parent 0055efaee2
commit a2eb27f8f3
9 changed files with 362 additions and 78 deletions

View File

@@ -250,9 +250,17 @@ namespace Minigames.FortFight.AI
// Get AI player index
int playerIndex = _turnManager.CurrentPlayer.PlayerIndex;
// Get available projectiles (check cooldowns via ammo manager)
// Get allowed projectiles for AI from settings
var allowedTypes = _cachedSettings?.AIAllowedProjectiles;
if (allowedTypes == null || allowedTypes.Count == 0)
{
Logging.Warning("[FortFightAIController] No allowed projectiles configured! Using all types as fallback.");
allowedTypes = new List<ProjectileType>((ProjectileType[])System.Enum.GetValues(typeof(ProjectileType)));
}
// Filter by cooldown availability
var availableTypes = new List<ProjectileType>();
foreach (ProjectileType type in System.Enum.GetValues(typeof(ProjectileType)))
foreach (ProjectileType type in allowedTypes)
{
// Check if ammo is available (not on cooldown)
if (_ammoManager.IsAmmoAvailable(type, playerIndex))
@@ -269,7 +277,7 @@ namespace Minigames.FortFight.AI
float enemyHpPercent = _fortManager.PlayerFort.HpPercentage;
// Strategic selection based on fort HP
// Strategic selection based on fort HP (only from allowed projectiles)
if (enemyHpPercent > 70f && availableTypes.Contains(ProjectileType.TrashBag))
{
return ProjectileType.TrashBag; // Spread damage early game
@@ -280,7 +288,7 @@ namespace Minigames.FortFight.AI
}
else if (_targetBlock != null && _targetBlock.IsWeakPoint && availableTypes.Contains(ProjectileType.CeilingFan))
{
return ProjectileType.CeilingFan; // Drop on weak points
return ProjectileType.CeilingFan; // Drop on weak points (if allowed)
}
// Default to first available