public override bool WasImmuneToDamageType(PowerResource powerResource, IAbilityCaster sourceCharacter, AbilityEffectContext abilityEffectContext)
        {
            bool returnValue = base.WasImmuneToDamageType(powerResource, sourceCharacter, abilityEffectContext);

            if (returnValue == true)
            {
                CombatTextManager.MyInstance.SpawnCombatText(baseCharacter.CharacterUnit.gameObject, 0, CombatTextType.immune, CombatMagnitude.normal, abilityEffectContext);
            }
            return(false);
        }
Exemple #2
0
        /*
         *  public override void ClearAggro(GameObject target) {
         *      base.ClearAggro(target);
         *      aiController.ClearTarget();
         *  }
         */

        public override bool TakeDamage(AbilityEffectContext abilityEffectContext, PowerResource powerResource, int damage, IAbilityCaster source, CombatMagnitude combatMagnitude, AbilityEffect abilityEffect)
        {
            //Debug.Log("AICombat.TakeDamage(" + damage + ", " + sourcePosition + ", " + source + ")");
            if (!((baseCharacter.CharacterController as AIController).MyCurrentState is EvadeState) && !((baseCharacter.CharacterController as AIController).MyCurrentState is DeathState))
            {
                // order is important here.  we want to set target before taking damage because taking damage could kill us, and we don't want to re-trigger and agro on someone after we are dead

                // this should happen automatically inside the update loop of idle state
                //baseCharacter.MyCharacterController.SetTarget(source);
                return(base.TakeDamage(abilityEffectContext, powerResource, damage, source, combatMagnitude, abilityEffect));
            }
            return(false);
        }
        public override bool TakeDamage(AbilityEffectContext abilityEffectContext, PowerResource powerResource, int damage, IAbilityCaster source, CombatMagnitude combatMagnitude, AbilityEffect abilityEffect, bool reflectDamage = false)
        {
            //Debug.Log("PlayerCombat.TakeDamage(" + damage + ", " + source.name + ")");
            // enter combat first because if we die from this hit, we don't want to enter combat when dead
            EnterCombat(source);
            // added damageTaken bool to prevent blood effects from showing if you ran out of range of the attack while it was in progress

            /*
             * bool damageTaken = base.TakeDamage(damage, sourcePosition, source, combatMagnitude, abilityEffect, reflectDamage = false);
             * return damageTaken;
             */
            return(base.TakeDamage(abilityEffectContext, powerResource, damage, source, combatMagnitude, abilityEffect, reflectDamage = false));
        }
Exemple #4
0
        public override void SetupScriptableObjects()
        {
            base.SetupScriptableObjects();

            if (powerResourceName != null && powerResourceName != string.Empty)
            {
                PowerResource tmpPowerResource = SystemPowerResourceManager.MyInstance.GetResource(powerResourceName);
                if (tmpPowerResource != null)
                {
                    powerResource = tmpPowerResource;
                }
                else
                {
                    Debug.LogError("SystemAbilityManager.SetupScriptableObjects(): Could not find power resource : " + powerResourceName + " while inititalizing " + DisplayName + ".  CHECK INSPECTOR");
                }
            }
        }
        public override void SetupScriptableObjects(SystemGameManager systemGameManager)
        {
            base.SetupScriptableObjects(systemGameManager);

            if (powerResourceName != null && powerResourceName != string.Empty)
            {
                PowerResource tmpPowerResource = systemDataFactory.GetResource <PowerResource>(powerResourceName);
                if (tmpPowerResource != null)
                {
                    powerResource = tmpPowerResource;
                }
                else
                {
                    Debug.LogError("PowerResourcePotion.SetupScriptableObjects(): Could not find power resource : " + powerResourceName + " while inititalizing " + DisplayName + ".  CHECK INSPECTOR");
                }
            }
        }
        public override bool ProcessAbilityHit(Interactable target, int finalAmount, IAbilityCaster source, CombatMagnitude combatMagnitude, AbilityEffect abilityEffect, AbilityEffectContext abilityEffectContext, PowerResource powerResource)
        {
            //Debug.Log(DisplayName + ".HealEffect.ProcessAbilityHit(" + (target == null ? "null" : target.gameObject.name) + ", " + finalAmount + ", " + source.AbilityManager.UnitGameObject.name + ")");

            abilityEffectContext.powerResource = powerResource;
            bool returnValue = CharacterUnit.GetCharacterUnit(target).BaseCharacter.CharacterStats.RecoverResource(abilityEffectContext, powerResource, finalAmount, source, true, combatMagnitude);

            if (returnValue == false)
            {
                return(false);
            }

            return(base.ProcessAbilityHit(target, finalAmount, source, combatMagnitude, abilityEffect, abilityEffectContext, powerResource));
        }
Exemple #7
0
        public override bool ProcessAbilityHit(GameObject target, int finalAmount, IAbilityCaster source, CombatMagnitude combatMagnitude, AbilityEffect abilityEffect, AbilityEffectContext abilityEffectContext, PowerResource powerResource)
        {
            bool returnValue = target.GetComponent <CharacterUnit>().MyCharacter.CharacterCombat.TakeDamage(abilityEffectContext, powerResource, finalAmount, source, combatMagnitude, this);

            if (returnValue == false)
            {
                return(false);
            }

            return(base.ProcessAbilityHit(target, finalAmount, source, combatMagnitude, abilityEffect, abilityEffectContext, powerResource));
        }
 public override void RecoverResource(AbilityEffectContext abilityEffectContext, PowerResource powerResource, int amount, IAbilityCaster source, bool showCombatText = true, CombatMagnitude combatMagnitude = CombatMagnitude.normal)
 {
     base.RecoverResource(abilityEffectContext, powerResource, amount, source, showCombatText, combatMagnitude);
     CombatLogUI.MyInstance.WriteSystemMessage("You gain " + amount + " " + powerResource.DisplayName);
 }
Exemple #9
0
        public override void ProcessAbilityHit(GameObject target, int finalAmount, IAbilityCaster source, CombatMagnitude combatMagnitude, AbilityEffect abilityEffect, AbilityEffectContext abilityEffectInput, PowerResource powerResource)
        {
            abilityEffectInput.powerResource = powerResource;
            target.GetComponent <CharacterUnit>().MyCharacter.CharacterStats.RecoverResource(abilityEffectInput, powerResource, finalAmount, source, true, combatMagnitude);

            base.ProcessAbilityHit(target, finalAmount, source, combatMagnitude, abilityEffect, abilityEffectInput, powerResource);
        }
Exemple #10
0
        public override bool ProcessAbilityHit(Interactable target, int finalAmount, IAbilityCaster source, CombatMagnitude combatMagnitude, AbilityEffect abilityEffect, AbilityEffectContext abilityEffectInput, PowerResource powerResource)
        {
            abilityEffectInput.powerResource = powerResource;
            bool returnValue = CharacterUnit.GetCharacterUnit(target).BaseCharacter.CharacterStats.RecoverResource(abilityEffectInput, powerResource, finalAmount, source, true, combatMagnitude);

            if (returnValue == false)
            {
                return(false);
            }

            return(base.ProcessAbilityHit(target, finalAmount, source, combatMagnitude, abilityEffect, abilityEffectInput, powerResource));
        }
Exemple #11
0
        public override void ProcessAbilityHit(GameObject target, int finalAmount, IAbilityCaster source, CombatMagnitude combatMagnitude, AbilityEffect abilityEffect, AbilityEffectContext abilityEffectInput, PowerResource powerResource)
        {
            target.GetComponent <CharacterUnit>().MyCharacter.CharacterCombat.TakeDamage(abilityEffectInput, powerResource, finalAmount, source, combatMagnitude, this, abilityEffectInput.reflectDamage);

            base.ProcessAbilityHit(target, finalAmount, source, combatMagnitude, abilityEffect, abilityEffectInput, powerResource);
        }