Example #1
0
        public override Dictionary <PrefabProfile, GameObject> Cast(IAbilityCaster source, Interactable target, Interactable originalTarget, AbilityEffectContext abilityEffectInput)
        {
            //Debug.Log(DisplayName + ".InstantEffect.Cast()");
            if (abilityEffectInput == null)
            {
                abilityEffectInput = new AbilityEffectContext();
            }
            Dictionary <PrefabProfile, GameObject> returnObjects = base.Cast(source, target, originalTarget, abilityEffectInput);

            PerformAbilityHit(source, target, abilityEffectInput);
            return(returnObjects);
        }
Example #2
0
 public void CheckInteractionComplete(Interactable interactable)
 {
     //Debug.Log("UseInteractableObjective.CheckInteractableName()");
     CheckInteractableName(interactable.MyName, true);
 }
 public void SetInteractable(Interactable interactable)
 {
     //Debug.Log("MiniMapIndicatorController.SetNamePlateUnit(" + characterUnit.MyDisplayName + ")");
     this.interactable = interactable;
     SetupMiniMap();
 }
Example #4
0
        public override AbilityEffectContext ProcessAbilityEffectContext(IAbilityCaster source, Interactable target, AbilityEffectContext abilityEffectContext)
        {
            if (abilityEffectContext.weaponHitHasCast == true)
            {
                // can't cast weapon hit effects more than once
                return(base.ProcessAbilityEffectContext(source, target, abilityEffectContext));
            }
            // since this is called from any attackeffect (even stuff like fireballs) and sets the weapon cast to true,
            // this will also limit cast time multipliers on future effects.
            // This should be ok because the primary hit of a fireball would be regular damage, and any hit after that is likely
            // on hit, burn effect, etc, which should not be multiplied by cast time
            abilityEffectContext.weaponHitHasCast = true;

            source.AbilityManager.ProcessWeaponHitEffects(this, target, abilityEffectContext);

            return(abilityEffectContext);
        }
 public void SetInteractable(Interactable interactable)
 {
     //Debug.Log(gameObject.name + ".MiniMapIndicatorController.SetInteractable(" + interactable.name + ")");
     this.interactable = interactable;
     SetupMiniMap();
 }
Example #6
0
 public void NotifyOnInteractionCompleted(Interactable interactable)
 {
     OnInteractionCompleted(interactable);
 }
Example #7
0
        public override Dictionary <PrefabProfile, GameObject> Cast(IAbilityCaster source, Interactable target, Interactable originalTarget, AbilityEffectContext abilityEffectContext)
        {
            //Debug.Log(DisplayName + ".ProjectileEffect.Cast(" + source.AbilityManager.Name + ", " + (target == null ? "null" : target.name) + ")");
            Dictionary <PrefabProfile, GameObject> returnObjects = base.Cast(source, target, originalTarget, abilityEffectContext);

            if (returnObjects != null)
            {
                foreach (GameObject go in returnObjects.Values)
                {
                    //Debug.Log(DisplayName + ".ProjectileEffect.Cast(): found gameobject: " + go.name);
                    go.transform.parent = playerManager.EffectPrefabParent.transform;
                    ProjectileScript projectileScript = go.GetComponentInChildren <ProjectileScript>();
                    if (projectileScript != null)
                    {
                        //Debug.Log(DisplayName + ".ProjectileEffect.Cast(): found gameobject: " + go.name + " and it has projectile script");
                        abilityEffectContext = ApplyInputMultiplier(abilityEffectContext);
                        projectileScript.Initialize(projectileSpeed, source, target, new Vector3(0, 1, 0), go, abilityEffectContext);
                        if (flightAudioProfiles != null && flightAudioProfiles.Count > 0)
                        {
                            projectileScript.PlayFlightAudio(flightAudioProfiles, randomFlightAudioProfiles);
                        }
                        projectileScript.OnCollission += HandleCollission;
                    }
                }
            }
            return(returnObjects);
        }
Example #8
0
 public override void CastComplete(IAbilityCaster source, Interactable target, AbilityEffectContext abilityEffectInput)
 {
     //Debug.Log(abilityEffectName + ".DirectEffect.CastComplete()");
     base.CastComplete(source, target, abilityEffectInput);
     PerformAbilityComplete(source, target, abilityEffectInput);
 }
Example #9
0
 public override Dictionary <PrefabProfile, GameObject> Cast(IAbilityCaster source, Interactable target, Interactable originalTarget, AbilityEffectContext abilityEffectInput)
 {
     //Debug.Log(MyName + ".DirectEffect.Cast()");
     return(base.Cast(source, target, originalTarget, abilityEffectInput));
 }
Example #10
0
        protected override List <AOETargetNode> GetValidTargets(IAbilityCaster source, Interactable target, AbilityEffectContext abilityEffectInput, List <AbilityEffect> abilityEffectList)
        {
            //Debug.Log(DisplayName + ".RainEffect.GetValidTargets()");
            // we are intentionally not calling the base class

            // max targets determines how many objects to spawn

            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.AbilityManager.UnitGameObject.transform.position;
            }
            else if (prefabSpawnLocation == PrefabSpawnLocation.GroundTarget)
            {
                //Debug.Log("AOEEffect.Cast(): Setting AOE center to groundTarget at: " + abilityEffectInput.prefabLocation);
                aoeSpawnCenter = abilityEffectInput.groundTargetLocation;
            }
            else
            {
                //Debug.Log("AOEEffect.Cast(): Setting AOE center to vector3.zero!!! was prefab spawn location not set or target despawned?");
            }
            //aoeSpawnCenter += source.AbilityManager.UnitGameObject.transform.TransformDirection(aoeCenter);

            //Debug.Log("AOEEffect.Cast(): Casting OverlapSphere with radius: " + aoeRadius);
            List <AOETargetNode> validTargets = new List <AOETargetNode>();

            // for loop max targets
            for (int i = 0; i < maxTargets; i++)
            {
                AOETargetNode validTargetNode = new AOETargetNode();
                validTargetNode.targetGameObject = null;
                //abilityEffectInput.prefabLocation = new Vector3(aoeSpawnCenter.x + Random.Range(-aoeRadius, aoeRadius), aoeSpawnCenter.y + aoeCenter.y, aoeSpawnCenter.z + Random.Range(-aoeRadius, aoeRadius));
                // testing make copy instead
                //validTargetNode.abilityEffectInput = new AbilityEffectContext();
                validTargetNode.abilityEffectInput = abilityEffectInput.GetCopy();;

                /*
                 * foreach (ResourceInputAmountNode resourceInputAmountNode in abilityEffectInput.resourceAmounts) {
                 *  validTargetNode.abilityEffectInput.AddResourceAmount(resourceInputAmountNode.resourceName, (int)resourceInputAmountNode.amount);
                 * }
                 *
                 * validTargetNode.abilityEffectInput.overrideDuration = abilityEffectInput.overrideDuration;
                 * validTargetNode.abilityEffectInput.savedEffect = abilityEffectInput.savedEffect;
                 * validTargetNode.abilityEffectInput.castTimeMultiplier = abilityEffectInput.castTimeMultiplier;
                 * validTargetNode.abilityEffectInput.spellDamageMultiplier = abilityEffectInput.spellDamageMultiplier;
                 * //validTargetNode.abilityEffectInput.prefabLocation = abilityEffectInput.prefabLocation;
                 * //validTargetNode.abilityEffectInput = abilityEffectInput;
                 * validTargetNode.abilityEffectInput.groundTargetLocation = new Vector3(aoeSpawnCenter.x + Random.Range(-aoeRadius, aoeRadius), aoeSpawnCenter.y + aoeCenter.y, aoeSpawnCenter.z + Random.Range(-aoeRadius, aoeRadius));
                 */
                validTargetNode.abilityEffectInput.groundTargetLocation = new Vector3(aoeSpawnCenter.x + Random.Range(-aoeRadius, aoeRadius), aoeSpawnCenter.y + aoeCenter.y, aoeSpawnCenter.z + Random.Range(-aoeRadius, aoeRadius));

                //Debug.Log(MyName + ".RainEffect.GetValidTargets(). prefabLocation: " + validTargetNode.abilityEffectInput.prefabLocation);
                validTargets.Add(validTargetNode);
            }

            //Debug.Log(MyName + ".RainEffect.GetValidTargets(). Valid targets count: " + validTargets.Count);
            return(validTargets);
        }
 public void SetInteractable(Interactable interactable)
 {
     //Debug.Log(gameObject.name + ".MainMapIndicatorController.SetInteractable(" + interactable.gameObject.name + "): instance: " + instanceNumber);
     this.interactable = interactable;
     SetupMainMap();
 }