Пример #1
0
 public override void OnKillConfirmed(BaseCharacter sourceCharacter, float creditPercent)
 {
     //Debug.Log("PlayerCombat.OnKillConfirmed()");
     base.OnKillConfirmed(sourceCharacter, creditPercent);
 }
Пример #2
0
        public override StatusEffectNode ApplyStatusEffect(StatusEffect statusEffect, BaseCharacter source, CharacterUnit target, AbilityEffectOutput abilityEffectInput)
        {
            //Debug.Log("Playerstats.ApplyStatusEffect()");
            if (statusEffect == null)
            {
                //Debug.Log("Playerstats.ApplyStatusEffect(): statusEffect is null!");
            }
            StatusEffectNode _statusEffectNode = base.ApplyStatusEffect(statusEffect, source, target, abilityEffectInput);

            if (statusEffect.MyClassTrait == false)
            {
                if (_statusEffectNode != null)
                {
                    UIManager.MyInstance.MyStatusEffectPanelController.SpawnStatusNode(_statusEffectNode, target);
                    if (abilityEffectInput.savedEffect == false)
                    {
                        if (target != null)
                        {
                            CombatTextManager.MyInstance.SpawnCombatText(target.gameObject, statusEffect, true);
                        }
                    }
                }
            }
            return(_statusEffectNode);
        }
Пример #3
0
 void OnCastStop(BaseCharacter source)
 {
     //Debug.Log(gameObject.name + ".CastBarController.OnCastStop();");
     DisableCastBar();
 }
Пример #4
0
 public override void StartCasting(BaseCharacter source)
 {
     //Debug.Log("DirectAbilty.OnCastStart()");
     base.StartCasting(source);
 }
Пример #5
0
 public override void OnCastTimeChanged(float currentCastTime, BaseCharacter source, GameObject target)
 {
     //Debug.Log("DirectAbility.OnCastTimeChanged()");
     base.OnCastTimeChanged(currentCastTime, source, target);
 }
Пример #6
0
        private List <GameObject> GetValidTargets(BaseCharacter source, GameObject target, AbilityEffectOutput abilityEffectInput, List <AbilityEffect> abilityEffectList)
        {
            //Debug.Log(MyName + ".AOEEffect.GetValidTargets()");

            Vector3 aoeSpawnCenter = Vector3.zero;

            if (prefabSpawnLocation == PrefabSpawnLocation.Target && target != null)
            {
                //Debug.Log("AOEEffect.Cast(): Setting AOE center to target");
                aoeSpawnCenter = target.transform.position;
            }
            else if (prefabSpawnLocation == PrefabSpawnLocation.Caster)
            {
                //Debug.Log("AOEEffect.Cast(): Setting AOE center to caster");
                aoeSpawnCenter = source.MyCharacterUnit.transform.position;
            }
            else if (prefabSpawnLocation == PrefabSpawnLocation.Point)
            {
                //Debug.Log("AOEEffect.Cast(): Setting AOE center to groundTarget at: " + abilityEffectInput.prefabLocation);
                aoeSpawnCenter = abilityEffectInput.prefabLocation;
            }
            else
            {
                //Debug.Log("AOEEffect.Cast(): Setting AOE center to vector3.zero!!! was prefab spawn location not set or target despawned?");
            }
            aoeSpawnCenter += source.MyCharacterUnit.transform.TransformDirection(aoeCenter);
            Collider[] colliders     = new Collider[0];
            int        playerMask    = 1 << LayerMask.NameToLayer("Player");
            int        characterMask = 1 << LayerMask.NameToLayer("CharacterUnit");
            int        validMask     = (playerMask | characterMask);

            if (useRadius)
            {
                colliders = Physics.OverlapSphere(aoeSpawnCenter, aoeRadius, validMask);
            }
            if (useExtents)
            {
                colliders = Physics.OverlapBox(aoeSpawnCenter, aoeExtents / 2f, source.MyCharacterUnit.transform.rotation, validMask);
            }
            //Debug.Log("AOEEffect.Cast(): Casting OverlapSphere with radius: " + aoeRadius);
            List <GameObject> validTargets = new List <GameObject>();

            foreach (Collider collider in colliders)
            {
                //Debug.Log("AOEEffect.Cast() hit: " + collider.gameObject.name + "; " + collider.gameObject.layer);
                bool canAdd = true;
                foreach (AbilityEffect abilityEffect in abilityEffectList)
                {
                    if (abilityEffect.CanUseOn(collider.gameObject, source) == false)
                    {
                        canAdd = false;
                    }
                }
                //if (CanUseOn(collider.gameObject, source)) {
                // next line was preventing aoe from hitting current target
                //if (collider.gameObject != target && CanUseOn(collider.gameObject, source)) {
                //Debug.Log("performing AOE ability: " + MyAbilityEffectName + " on " + collider.gameObject);
                if (canAdd)
                {
                    validTargets.Add(collider.gameObject);
                }
                if (maxTargets > 0)
                {
                    //Debug.Log("AOEEffect.GetValidTargets(). maxTargets: " + maxTargets + "; validTargets.Count: " + validTargets.Count);
                    while (validTargets.Count > maxTargets)
                    {
                        int randomNumber = Random.Range(0, validTargets.Count);
                        //Debug.Log("AOEEffect.GetValidTargets(). maxTargets: " + maxTargets + "; validTargets.Count: " + validTargets.Count + "; randomNumber: " + randomNumber);
                        validTargets.RemoveAt(randomNumber);
                    }
                }
                //}
            }
            //Debug.Log(abilityEffectName + ".AOEEffect.Cast(). Valid targets count: " + validTargets.Count);
            return(validTargets);
        }
Пример #7
0
 public override bool Cast(BaseCharacter source, GameObject target, Vector3 groundTarget)
 {
     //Debug.Log("DirectAbility.Cast(" + (target ? target.name : "null") + ")");
     return(base.Cast(source, target, groundTarget));
 }
Пример #8
0
 public float GetPrimaryStatModifier(string statName, int currentLevel, BaseCharacter baseCharacter)
 {
     return(GetPrimaryStatModifier(statName, currentLevel, baseCharacter, realItemQuality));
 }
Пример #9
0
 public virtual float GetPrimaryStatModifier(string statName, int currentLevel, BaseCharacter baseCharacter, ItemQuality usedItemQuality)
 {
     foreach (ItemPrimaryStatNode itemPrimaryStatNode in primaryStats)
     {
         if (statName == itemPrimaryStatNode.StatName)
         {
             if (itemPrimaryStatNode.UseManualValue)
             {
                 return(itemPrimaryStatNode.ManualModifierValue);
             }
             return((int)Mathf.Ceil(Mathf.Clamp(
                                        (float)GetItemLevel(currentLevel) * (LevelEquations.GetPrimaryStatForLevel(statName, currentLevel, baseCharacter, systemConfigurationManager) * (GetItemQualityNumber(usedItemQuality) - 1f)) * ((EquipmentSlotType.StatWeight * EquipmentSlotType.GetCompatibleSlotProfiles()[0].StatWeight) / GetTotalSlotWeights()),
                                        0f,
                                        Mathf.Infinity
                                        )));
         }
     }
     return(0f);
 }
Пример #10
0
 protected override void CheckDestroyObjects(Dictionary <PrefabProfile, GameObject> abilityEffectObjects, BaseCharacter source, GameObject target, AbilityEffectOutput abilityEffectInput)
 {
     // intentionally not calling base to avoid getting our pet destroyed
 }
 protected void Awake()
 {
     //Debug.Log(gameObject.name + ".PlayerFactionManager.Awake()");
     baseCharacter = GetComponent <BaseCharacter>();
 }
Пример #12
0
 public void NotifyOnTakeDamage(BaseCharacter source, CharacterUnit target, int damage, string abilityName)
 {
     OnTakeDamage(source, target, damage, abilityName);
 }
 public CharacterFactionManager(BaseCharacter baseCharacter)
 {
     this.baseCharacter = baseCharacter;
 }
Пример #14
0
 public override void CastTick(BaseCharacter source, GameObject target, AbilityEffectOutput abilityEffectInput)
 {
     //Debug.Log(MyName + ".PetEffect.CastTick()");
     base.CastTick(source, target, abilityEffectInput);
     CheckPetSpawn(source, target, abilityEffectInput);
 }
 public virtual bool IsMet(BaseCharacter baseCharacter)
 {
     //Debug.Log("LevelPrerequisite.IsMet()");
     return(prerequisiteMet);
 }
 public virtual bool IsMet(BaseCharacter baseCharacter)
 {
     return(prerequisiteMet);
 }
Пример #17
0
 public override bool CanUseOn(GameObject target, BaseCharacter source)
 {
     //Debug.Log("AttackEffect.CanUseOn(" + (target == null ? " null" : target.name) + ", " + source.gameObject.name + ")");
     return(base.CanUseOn(target, source));
 }
Пример #18
0
 public override void CastComplete(BaseCharacter source, GameObject target, AbilityEffectOutput abilityAffectInput)
 {
     //Debug.Log(resourceName + ".AOEEffect.CastComplete(" + (source == null ? "null" : source.name) + ", " + (target == null ? "null" : target.name) + ")");
     TargetAOEComplete(source, target, abilityAffectInput);
 }