First project upload

This commit is contained in:
Rohan
2026-06-26 22:41:39 +05:30
parent 7f6e734b16
commit 604c0c786a
4637 changed files with 4299718 additions and 489307 deletions

View File

@@ -54,13 +54,13 @@ public class CollectBagAction : AIAction
public override void Execute(AIBrain brain, AIBlackboard bb, TeamBlackboard tb)
{
// Find best bag (prefer dropped hot-drops, then closest available)
CashBag bestBag = null;
CashMag bestBag = null;
float bestScore = float.MinValue;
// Check dropped bags first (higher priority)
for (int i = 0; i < bb.nearbyDroppedBags.Count; i++)
{
CashBag bag = bb.nearbyDroppedBags[i];
CashMag bag = bb.nearbyDroppedBags[i];
if (bag == null || bag.IsCarried) continue;
if (tb.IsBagClaimed(bag, brain)) continue;
@@ -76,7 +76,7 @@ public class CollectBagAction : AIAction
{
for (int i = 0; i < bb.nearbyAvailableBags.Count; i++)
{
CashBag bag = bb.nearbyAvailableBags[i];
CashMag bag = bb.nearbyAvailableBags[i];
if (bag == null || bag.IsCarried) continue;
if (tb.IsBagClaimed(bag, brain)) continue;

View File

@@ -15,7 +15,7 @@ public class AIBlackboard
// ─── Current Targets ─────────────────────────────────────
public Transform currentTarget;
public CashBag targetBag;
public CashMag targetBag;
public TeamVault myVault;
public TeamVault enemyVault;
public CashCarrier nearestEnemyCarrier; // Priority target
@@ -33,8 +33,8 @@ public class AIBlackboard
// ─── Perception Results (updated by AIPerceptionSystem) ──
public readonly List<PerceivedEntity> perceivedEnemies = new List<PerceivedEntity>(8);
public readonly List<PerceivedEntity> perceivedAllies = new List<PerceivedEntity>(8);
public readonly List<CashBag> nearbyAvailableBags = new List<CashBag>(8);
public readonly List<CashBag> nearbyDroppedBags = new List<CashBag>(4);
public readonly List<CashMag> nearbyAvailableBags = new List<CashMag>(8);
public readonly List<CashMag> nearbyDroppedBags = new List<CashMag>(4);
public CashCarrier nearestAllyCarrier;
public int nearbyEnemyCount;
public int nearbyAllyCount;
@@ -132,7 +132,7 @@ public class TeamBlackboard : MonoBehaviour
[SerializeField] private string _teamTag;
/// <summary>Which bags are claimed by AI (prevents all AI chasing same bag).</summary>
public readonly Dictionary<CashBag, AIBrain> claimedBags = new Dictionary<CashBag, AIBrain>(8);
public readonly Dictionary<CashMag, AIBrain> claimedBags = new Dictionary<CashMag, AIBrain>(8);
/// <summary>Which enemies are being targeted (limit engagement per enemy).</summary>
public readonly Dictionary<Transform, int> targetedEnemies = new Dictionary<Transform, int>(8);
@@ -149,7 +149,7 @@ public class TeamBlackboard : MonoBehaviour
// ─── Claim System ────────────────────────────────────────
/// <summary>Try to claim a bag for this AI. Returns true if claimed successfully.</summary>
public bool TryClaimBag(CashBag bag, AIBrain claimant)
public bool TryClaimBag(CashMag bag, AIBrain claimant)
{
if (bag == null) return false;
@@ -171,7 +171,7 @@ public class TeamBlackboard : MonoBehaviour
/// <summary>Release claim on a bag.</summary>
public void ReleaseBagClaim(AIBrain claimant)
{
CashBag toRemove = null;
CashMag toRemove = null;
foreach (var kvp in claimedBags)
{
if (kvp.Value == claimant) { toRemove = kvp.Key; break; }
@@ -180,7 +180,7 @@ public class TeamBlackboard : MonoBehaviour
}
/// <summary>Is this bag already claimed by a teammate?</summary>
public bool IsBagClaimed(CashBag bag, AIBrain excludeSelf = null)
public bool IsBagClaimed(CashMag bag, AIBrain excludeSelf = null)
{
if (!claimedBags.TryGetValue(bag, out AIBrain claimant)) return false;
if (claimant == null || !claimant.gameObject.activeInHierarchy)
@@ -236,7 +236,7 @@ public class TeamBlackboard : MonoBehaviour
public void CleanStaleEntries()
{
// Clean bag claims
var staleBags = new List<CashBag>();
var staleBags = new List<CashMag>();
foreach (var kvp in claimedBags)
{
if (kvp.Key == null || kvp.Value == null || !kvp.Value.gameObject.activeInHierarchy)

View File

@@ -87,7 +87,7 @@ public class AIBrain : MonoBehaviour
// Initialize blackboard
_blackboard = new AIBlackboard();
_blackboard.teamTag = gameObject.tag;
_blackboard.team = _teamMember != null ? _teamMember.CurrentTeam : TeamMember.Team.EnemyTeam;
_blackboard.team = _teamMember != null ? _teamMember.CurrentTeam : TeamMember.Team.EnemyTeam1;
// Initialize perception
_perception.Initialize(_blackboard.teamTag);

View File

@@ -157,10 +157,10 @@ public class AIPerceptionSystem : MonoBehaviour
}
// ─── Detect Cash Bags ─────────────────────────────────
var allBags = EntityRegistry<CashBag>.All;
var allBags = EntityRegistry<CashMag>.All;
for (int i = 0; i < allBags.Count; i++)
{
CashBag bag = allBags[i];
CashMag bag = allBags[i];
if (bag == null || bag.IsCarried) continue;
float dist = Vector3.Distance(myPos, bag.transform.position);