private void PopulateWavePredictionList() { // Maintain the same Combat TYpe for X rounds (see difficulty later on?) CombatTypeBase _chosenType = _wavePredictionList.Count > 0 ? _wavePredictionList[_wavePredictionList.Count - 1]._combatType : null; while (_wavePredictionList.Count < _totalWavePredictionSize) { _currentWavePrediction++; if (_chosenType == null || (_currentWavePrediction - 1) % _currentCombatTypePersistance == 0) { if (_chosenType != null) { _currentCombatTypePersistance = _currentCombatTypePersistance <= 1 ? 1 : _currentCombatTypePersistance - 1; } _chosenType = AIManager.Instance.AvailableCombatTypes[Random.Range(0, AIManager.Instance.AvailableCombatTypes.Count)]; } AIType ai = AIManager.GetRandomAIType(); WavePredictionAI newAI = new WavePredictionAI(ai, _chosenType); _wavePredictionList.Add(newAI); if (_currentWavePrediction % _bossFrequency == 0) { _currentBossesDefeatedPrediction++; AIManager.BossDefeatPredicted(_currentBossesDefeatedPrediction); } } }
public override void DamageAI(int damageAmount, CombatTypeBase weaponType) { if (_healthComponent == null) { Debug.LogError("No Health Component Found on Object", this); return; } damageAmount = weaponType.GetModifiedDamage(damageAmount, _aiCombatType); _healthComponent.ChangeHealth(damageAmount); }
public int GetModifiedDamage(int baseDamage, CombatTypeBase targetCombatType) { if (targetCombatType == null) { Debug.LogErrorFormat("Target Combat Type is null! Has the AI been correctly assigned a combat type on spawn?"); return(baseDamage); } float damageModifier = 1f; damageModifier = _strengthAffinity.Where(x => { return(x.name == targetCombatType.name); }).FirstOrDefault() != null ? 1.25f : _weaknessAffinity.Where(x => { return(x.name == targetCombatType.name); }).FirstOrDefault() != null ? 0.75f : 1f; return(Mathf.FloorToInt(baseDamage * damageModifier)); }
public virtual void Initialise(Vector3 startPos, AI target, CombatTypeBase weaponType) { if (weaponType == null) { Debug.LogErrorFormat(this, "Weapon type passed in is NULL!"); return; } _pSystem.Clear(); _pSystem.Play(); _hasDetonated = false; transform.position = startPos + _positionOffset; _currentTarget = target; _weaponType = weaponType; _currentTarget.RegisterForceDetonateAction(ForceDetonateWeapon); gameObject.SetActive(true); for (int i = 0; i < _renderers.Length; i++) { _renderers[i].enabled = true; } }
public virtual void DamageAI(int damageAmount, CombatTypeBase receivedDamageType) { // IHealth }
public virtual void InitialiseAI(object[] data, CombatTypeBase assignedCombatType) { _aiCombatType = assignedCombatType; }
public static void CreateCombatType() { CombatTypeBase trait = CreateGenericAsset <CombatTypeBase>(ability_Asset_Directory + @"CombatTypes/", "NewCombatType.asset"); }
public override void InitialiseAI(object[] data, CombatTypeBase assignedCombatType) { base.InitialiseAI(data, _forcedBossCombatType); _aiCombatType = _forcedBossCombatType; }
public WavePredictionAI(AIType ai, CombatTypeBase combatType) { _aitype = ai; _combatType = combatType; }