Пример #1
0
    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);
            }
        }
    }
Пример #2
0
    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);
    }
Пример #3
0
    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));
    }
Пример #4
0
    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;
        }
    }
Пример #5
0
 public virtual void DamageAI(int damageAmount, CombatTypeBase receivedDamageType)
 {
     // IHealth
 }
Пример #6
0
 public virtual void InitialiseAI(object[] data, CombatTypeBase assignedCombatType)
 {
     _aiCombatType = assignedCombatType;
 }
Пример #7
0
 public static void CreateCombatType()
 {
     CombatTypeBase trait = CreateGenericAsset <CombatTypeBase>(ability_Asset_Directory + @"CombatTypes/", "NewCombatType.asset");
 }
Пример #8
0
 public override void InitialiseAI(object[] data, CombatTypeBase assignedCombatType)
 {
     base.InitialiseAI(data, _forcedBossCombatType);
     _aiCombatType = _forcedBossCombatType;
 }
Пример #9
0
 public WavePredictionAI(AIType ai, CombatTypeBase combatType)
 {
     _aitype     = ai;
     _combatType = combatType;
 }