public EffectSet GetEffectSet(Constants.SpecialAbilityEffectType effectType) { switch (effectType) { case Constants.SpecialAbilityEffectType.AttackEffect: List <Effect> attackBundle = new List <Effect>(); for (int i = 0; i < attacks.Count; i++) { EffectAttack clonedAttack = new EffectAttack(attacks[i]); attackBundle.Add(clonedAttack); } EffectSet attackEffect = new EffectSet(effectType, attackBundle); return(attackEffect); case Constants.SpecialAbilityEffectType.StatusEffect: List <Effect> statusBundle = new List <Effect>(); for (int i = 0; i < statusEffects.Count; i++) { EffectStatus clonedStatus = new EffectStatus(statusEffects[i]); statusBundle.Add(clonedStatus); } EffectSet statusAttacks = new EffectSet(effectType, statusBundle); return(statusAttacks); default: return(null); } }
public virtual void Initialize(Effect parentEffect, LayerMask mask, float life = 0f, float damage = 0f) { this.parentEffect = parentEffect; LayerMask = mask; stats = new StatCollection(); stats.Initialize(statTemplate); ParentFacing = parentEffect.Source.Facing; if (this.parentEffect is EffectAttack) { EffectAttack attackEffect = this.parentEffect as EffectAttack; penetrating = attackEffect.penetrate; numPen = attackEffect.numPenetrations; impactEffect = attackEffect.impactEffectName; } this.life = life + stats.GetStatModifiedValue(Constants.BaseStatType.Lifetime); this.damage = damage + stats.GetStatModifiedValue(Constants.BaseStatType.BaseDamage); if (this.life > 0f) { Invoke("CleanUp", this.life); } }
protected virtual List <Effect> CloneRiders() { List <Effect> clones = new List <Effect>(); for (int i = 0; i < riders.Count; i++) { if (riders[i] is EffectAttack) { EffectAttack clone = new EffectAttack((EffectAttack)riders[i]); clones.Add(clone); } //clones.Add(riders[i]); } return(clones); }
public EffectAttack(EffectAttack attackEffect) { effectName = attackEffect.effectName; riderTarget = attackEffect.riderTarget; effectType = attackEffect.effectType; deliveryMethod = attackEffect.deliveryMethod; animationTrigger = attackEffect.animationTrigger; applyToSpecificTarget = attackEffect.applyToSpecificTarget; targetIndex = attackEffect.targetIndex; //parentAbility = attackEffect.parentAbility; riders = attackEffect.CloneRiders(); effectDamage = attackEffect.effectDamage; scaleFromBaseDamage = attackEffect.scaleFromBaseDamage; percentOfBaseDamage = attackEffect.percentOfBaseDamage; burstAttack = attackEffect.burstAttack; burstNumber = attackEffect.burstNumber; burstInterval = attackEffect.burstInterval; impactEffectName = attackEffect.impactEffectName; fireEffectName = attackEffect.fireEffectName; penetrate = attackEffect.penetrate; numPenetrations = attackEffect.numPenetrations; switch (deliveryMethod) { case Constants.EffectDeliveryMethod.Melee: meleeDelivery.prefabName = attackEffect.meleeDelivery.prefabName; meleeDelivery.layerMask = attackEffect.meleeDelivery.layerMask; break; case Constants.EffectDeliveryMethod.Projectile: projectileDelivery.prefabName = attackEffect.projectileDelivery.prefabName; projectileDelivery.layerMask = attackEffect.projectileDelivery.layerMask; break; case Constants.EffectDeliveryMethod.Raycast: rayCastDelivery.layerMask = attackEffect.rayCastDelivery.layerMask; break; } }
public virtual void Initialize(SpecialAbility parentAbility, EffectAttack parentEffect) { this.parentAbility = parentAbility; this.parentEffect = parentEffect; }
public override void Initialize(SpecialAbility parentAbility, EffectAttack parentEffect) { base.Initialize(parentAbility, parentEffect); EventGrid.EventManager.RegisterListener(Constants.GameEvent.AnimationEvent, OnAnimationEvent); }
private Effect DrawEffect(Effect entry) { entry.eventOptions = EditorHelper.DrawExtendedList("Event Options", entry.eventOptions, "Option", DrawEventOptions); EditorGUILayout.Separator(); entry.deliveryMethod = EditorHelper.EnumPopup("Delivery method", entry.deliveryMethod); DrawDeliveryMethod(entry); entry.applyToSpecificTarget = EditorGUILayout.Toggle("Apply to Xth hit Target?", entry.applyToSpecificTarget); if (entry.applyToSpecificTarget) { entry.targetIndex = EditorGUILayout.IntField("Which Hit?", entry.targetIndex); } //entry.requireMultipleHits = EditorGUILayout.Toggle("Require Multiple Triggers?", entry.requireMultipleHits); //if (entry.requireMultipleHits) { // entry.requiredHits = EditorGUILayout.IntField("Number of Triggers", entry.requiredHits); //} //Attacks if (entry is EffectAttack) { EffectAttack attackEffect = entry as EffectAttack; attackEffect.effectType = Constants.SpecialAbilityEffectType.AttackEffect; attackEffect.effectDamage = EditorGUILayout.IntField("Efect Base Damage", attackEffect.effectDamage) * -1; attackEffect.scaleFromBaseDamage = EditorGUILayout.Toggle("Scale From Entity base damage?", attackEffect.scaleFromBaseDamage); if (attackEffect.scaleFromBaseDamage) { attackEffect.percentOfBaseDamage = EditorHelper.PercentFloatField("Percent of base damage", attackEffect.percentOfBaseDamage); } EditorGUILayout.Separator(); attackEffect.burstAttack = EditorGUILayout.Toggle("Burst?", attackEffect.burstAttack); if (attackEffect.burstAttack) { attackEffect.burstInterval = EditorGUILayout.FloatField("Delay between shots", attackEffect.burstInterval); attackEffect.burstNumber = EditorGUILayout.IntField("Number of shots", attackEffect.burstNumber); EditorGUILayout.Separator(); } attackEffect.penetrate = EditorGUILayout.Toggle("Penetrating?", attackEffect.penetrate); if (attackEffect.penetrate) { attackEffect.numPenetrations = EditorGUILayout.IntField("Number of Penetrations (0 = INF)", attackEffect.numPenetrations); } EditorGUILayout.Separator(); attackEffect.fireEffectName = EditorGUILayout.TextField("Fire Effect Name", attackEffect.fireEffectName); attackEffect.impactEffectName = EditorGUILayout.TextField("Impact Effect Name", attackEffect.impactEffectName); } //Status Effects if (entry is EffectStatus) { EffectStatus statusAttack = entry as EffectStatus; statusAttack.effectType = Constants.SpecialAbilityEffectType.StatusEffect; statusAttack.stackMethod = EditorHelper.EnumPopup("Stack Method", statusAttack.stackMethod); statusAttack.onCompleteEffectName = EditorGUILayout.TextField("On Complete Effect Name", statusAttack.onCompleteEffectName); switch (statusAttack.stackMethod) { case Constants.StatusStackingMethod.LimitedStacks: statusAttack.maxStack = EditorGUILayout.IntField("Max Stacks?", statusAttack.maxStack); break; } statusAttack.statusType = EditorHelper.EnumPopup("Status Type", statusAttack.statusType); statusAttack.duration = EditorGUILayout.FloatField("Duration (0 = INF)", statusAttack.duration); statusAttack.interval = EditorGUILayout.FloatField("Interval Time", statusAttack.interval); switch (statusAttack.statusType) { case Constants.StatusEffectType.AffectMovement: statusAttack.affectMoveType = EditorHelper.EnumPopup("Movement Affect Type", statusAttack.affectMoveType); if (statusAttack.affectMoveType != AffectMovement.AffectMovementType.Halt) { statusAttack.affectMoveValue = EditorHelper.FloatField("Value", statusAttack.affectMoveValue); } if (statusAttack.affectMoveType == AffectMovement.AffectMovementType.Knockback) { statusAttack.knocbackAngle = EditorHelper.FloatField("Angle", statusAttack.knocbackAngle); } break; case Constants.StatusEffectType.DamageOverTime: statusAttack.damagePerInterval = EditorGUILayout.FloatField("Damage Per Interval", statusAttack.damagePerInterval) * -1; statusAttack.scaleFromBaseDamage = EditorGUILayout.Toggle("Scale from Base Damage?", statusAttack.scaleFromBaseDamage); if (statusAttack.scaleFromBaseDamage) { statusAttack.percentOfBaseDamage = EditorHelper.PercentFloatField("Percentage of Base Damage", statusAttack.percentOfBaseDamage); } break; case Constants.StatusEffectType.StaticStatAdjustment: case Constants.StatusEffectType.DurationalStatAdjustment: statusAttack.statType = EditorHelper.EnumPopup("Stat Type", statusAttack.statType); switch (statusAttack.statType) { case Constants.BaseStatType.BaseDamage: statusAttack.statAdjustmentValue = EditorGUILayout.FloatField("Value", statusAttack.statAdjustmentValue) * -1; break; default: statusAttack.statAdjustmentValue = EditorHelper.FloatField("Value", statusAttack.statAdjustmentValue); break; } statusAttack.modType = EditorHelper.EnumPopup("Mod Type", statusAttack.modType); break; } } return(entry); }