Exemplo n.º 1
0
    public void InitializeCharacter()
    {
        // Cache components
        _attributes   = GetComponent <Attributes>();
        _statsOffense = GetComponent <StatsOffense>();
        _statsDefense = GetComponent <StatsDefense>();
        _statsGeneral = GetComponent <StatsGeneral>();

        characterController = GetComponent <CharacterController>();

        LoadCharacterData();

        characterData.specialization.SetTotalSpecPoints(characterData.level);

        // Initialize Attributes
        _attributes.GenerateAugmentedCharacterAttributes(characterData.specialization, characterData.inventory);

        // Initialize statistics
        _statsOffense.GenerateAugmentedCharacterStatistics();
        _statsDefense.GenerateAugmentedCharacterStatistics();
        _statsGeneral.GenerateAugmentedCharacterStatistics();

        // Initialize Abilities

        // Set Abilities
        characterController.SetAbilities(basicAbilityPrefab, abilityQPrefab, abilityWPrefab, abilityEPrefab, abilityRPrefab);
    }
    public virtual void SetTargetObject(GameObject targetobject)
    {
        targetObject = targetobject;

        _statsGeneralTarget = targetObject.GetComponent <StatsGeneral>();
        _statsOffenseTarget = targetObject.GetComponent <StatsOffense>();
        _statsDefenseTarget = targetObject.GetComponent <StatsDefense>();
    }
Exemplo n.º 3
0
    void Awake()
    {
        thisTransform = transform;

        _statsOffense = GetComponent <StatsOffense>();
        _statsDefense = GetComponent <StatsDefense>();
        _statsGeneral = GetComponent <StatsGeneral>();
    }
Exemplo n.º 4
0
    public void ReceiveHeal(StatsOffense statsOffense, StatsDefense statsDefense)
    {
        // Generate the heal
        float physicalHeal = statsOffense.GeneratePhysicalDamage();
        float magicalHeal  = statsOffense.GenerateMagicalDamage();

        // Receiving the Heal
        _combatLife += (physicalHeal + magicalHeal);
    }
    public virtual void Awake()
    {
        Debug.Log("Ability Controller awake");
        thisTransform = transform;

        _statsOffense = GetComponent <StatsOffense>();
        _statsDefense = GetComponent <StatsDefense>();
        _statsGeneral = GetComponent <StatsGeneral>();
    }
Exemplo n.º 6
0
    public virtual void Awake()
    {
        thisTransform = transform;
        targetPoint   = thisTransform.position;

        _attributes   = GetComponent <Attributes>();
        _statsOffense = GetComponent <StatsOffense>();
        _statsDefense = GetComponent <StatsDefense>();
        _statsGeneral = GetComponent <StatsGeneral>();
    }
Exemplo n.º 7
0
    void Awake()
    {
        thisTransform = transform;
        _attributes   = GetComponent <Attributes>();
        _statsOffense = GetComponent <StatsOffense>();
        _statsDefense = GetComponent <StatsDefense>();
        _statsGeneral = GetComponent <StatsGeneral>();

        _inCombat = false;
    }
Exemplo n.º 8
0
 /// <summary>
 /// Receives an ability hit, affecting statistics
 /// </summary>
 /// <param name="statsGeneral"></param>
 public void ReceiveHit(StatsOffense statsOffense)
 {
     // Debuffing
     //_tempPhysicalDamage -= statsOffense._tempPhysicalDamage;
     //_tempMagicDamage -= statsOffense._tempMagicDamage;
     //_tempCriticalDamage -= statsOffense._tempCriticalDamage;
     //_tempCriticalChance -= statsOffense._tempCriticalChance;
     //_tempAttackSpeed -= statsOffense._tempAttackSpeed;
     //_tempCoolDownReduction -= statsOffense._tempCoolDownReduction;
     //_tempRange -= statsOffense._tempRange;
 }
Exemplo n.º 9
0
    void Awake()
    {
        thisTransform = transform;
        level         = 1;
        _attributes   = GetComponent <Attributes>();
        _statsOffense = GetComponent <StatsOffense>();
        _statsDefense = GetComponent <StatsDefense>();
        _statsGeneral = GetComponent <StatsGeneral>();

        _attributes.InitializeEnemyAttributes(1);
        _statsOffense.GenerateAugmentedCharacterStatistics();
        _statsDefense.GenerateAugmentedCharacterStatistics();
        _statsGeneral.GenerateAugmentedCharacterStatistics();
    }
Exemplo n.º 10
0
    /// <summary>
    /// Generates an Ability's current statistics based on the stats
    /// </summary>
    /// <param name="statsOffense">Ability caster's offensive statistics</param>
    //public void GenerateCurrentAbilityStatistics(StatsOffense statsOffense)
    //{
    //	// Factor the caster's statistics into the ability's statistics
    //	_currentPhysicalDamage += statsOffense._currentPhysicalDamage;
    //	_currentMagicDamage += statsOffense._currentMagicDamage;
    //	_currentCriticalDamage += statsOffense._currentCriticalDamage;
    //	_currentCriticalChance += statsOffense._currentCriticalChance;
    //	_currentAttackSpeed += statsOffense._currentAttackSpeed;
    //	_currentCoolDownReduction += statsOffense._currentCoolDownReduction;
    //	_currentRange += statsOffense._currentRange;

    //	// Set the combat stats to the base combat stats
    //	_tempPhysicalDamage = _currentPhysicalDamage;
    //	_tempMagicDamage = _currentMagicDamage;
    //	_tempCriticalDamage = _currentCriticalDamage;
    //	_tempCriticalChance = _currentCriticalChance;
    //	_tempAttackSpeed = _currentAttackSpeed;
    //	_tempCoolDownReduction = _currentCoolDownReduction;
    //	_tempRange = _currentRange;
    //}


    /// <summary>
    /// Generates an Ability's temporary statistics
    /// </summary>
    /// <param name="statsOffense"></param>
    public void GenerateCombatAbilityStatistics(StatsOffense statsOffense)
    {
        // Set the combat stats to the base combat stats of the ability
        _combatPhysicalDamage = _augmentedPhysicalDamage;
        _combatMagicDamage    = _augmentedMagicDamage;
        _combatCriticalDamage = _augmentedCriticalDamage;
        _combatCriticalChance = _augmentedCriticalChance;
        _combatAttackSpeed    = _augmentedAttackSpeed;
        _combatRange          = _augmentedRange;

        // Factor in the temporary statistics of the caster
        _combatPhysicalDamage += statsOffense._combatPhysicalDamage;
        _combatMagicDamage    += statsOffense._combatMagicDamage;
        _combatCriticalDamage += statsOffense._combatCriticalDamage;
        _combatCriticalChance += statsOffense._combatCriticalChance;
        _combatAttackSpeed    += statsOffense._combatAttackSpeed;
        _combatRange          += statsOffense._combatRange;
    }
Exemplo n.º 11
0
    /// <summary>
    /// Receives an ability hit, affecting statistics
    /// </summary>
    /// <param name="statsGeneral"></param>
    public void ReceiveHit(StatsOffense statsOffense, StatsDefense statsDefense)
    {
        // Debuffing
        //_tempLife -= statsDefense._tempLife;
        //_tempArmor -= statsDefense._tempArmor;
        //_tempMagicResist -= statsDefense._tempMagicResist;

        // Generate the Damage
        float physicalDamage = statsOffense.GeneratePhysicalDamage();
        float magicalDamage  = statsOffense.GenerateMagicalDamage();

        // Factor defensive statistics
        physicalDamage = physicalDamage / _combatArmor;
        magicalDamage  = magicalDamage / _combatMagicResist;

        MenuManager.menuManager.DamageText(physicalDamage + magicalDamage, name);

        // Receiving the damage
        _combatLife -= (physicalDamage + magicalDamage);
    }
 /// <summary>
 /// Generates the combat statistics for the ability
 /// </summary>
 /// <param name="statsGeneral"></param>
 /// <param name="statsOffense"></param>
 /// <param name="statsDefense"></param>
 public override void GenerateCombatStatistics(StatsGeneral statsGeneral, StatsOffense statsOffense, StatsDefense statsDefense)
 {
     _statsGeneral.GenerateCombatAbilityStatistics(statsGeneral);
     _statsOffense.GenerateCombatAbilityStatistics(statsOffense);
     _statsDefense.GenerateCombatAbilityStatistics(statsDefense);
 }