Ejemplo n.º 1
0
		/// <summary>
		/// Adds a SpellEffect that will be applied to an Aura to be casted on the given type of target
		/// </summary>
		public SpellEffect AddAuraEffect(AuraEffectHandlerCreator creator, ImplicitTargetType targetType)
		{
			var effect = AddEffect(SpellEffectType.ApplyAura);
			effect.AuraType = AuraType.Dummy;
			effect.AuraEffectHandlerCreator = creator;
			effect.ImplicitTargetA = targetType;
			return effect;
		}
Ejemplo n.º 2
0
		/// <summary>
		/// Adds a SpellEffect that will trigger the given Spell on the given type of target
		/// </summary>
		public SpellEffect AddPeriodicTriggerSpellEffect(SpellId triggerSpell, ImplicitTargetType targetType)
		{
			var effect = AddAuraEffect(AuraType.PeriodicTriggerSpell);
			effect.TriggerSpellId = triggerSpell;
			effect.ImplicitTargetA = targetType;
			return effect;
		}
Ejemplo n.º 3
0
		/// <summary>
		/// Adds a SpellEffect that will be applied to an Aura to be casted on the given type of target
		/// </summary>
		public SpellEffect AddAuraEffect(AuraType type, ImplicitTargetType targetType)
		{
			var effect = AddEffect(SpellEffectType.ApplyAura);
			effect.AuraType = type;
			effect.ImplicitTargetA = targetType;
			return effect;
		}
Ejemplo n.º 4
0
		/// <summary>
		/// Adds a SpellEffect that will trigger the given Spell on the given type of target
		/// </summary>
		public SpellEffect AddTriggerSpellEffect(SpellId triggerSpell, ImplicitTargetType targetType)
		{
			var effect = AddEffect(SpellEffectType.TriggerSpell);
			effect.TriggerSpellId = triggerSpell;
			effect.ImplicitTargetA = targetType;
			return effect;
		}
Ejemplo n.º 5
0
		/// <summary>
		/// Adds a new Effect to this Spell
		/// </summary>
		/// <param name="type"></param>
		/// <returns></returns>
		public SpellEffect AddEffect(SpellEffectType type, ImplicitTargetType target)
		{
			var effect = new SpellEffect(this, Effects.Length > 0 ? Effects[Effects.Length - 1].EffectIndex : 0) { EffectType = type };
			var effects = new SpellEffect[Effects.Length + 1];
			Array.Copy(Effects, effects, Effects.Length);
			Effects = effects;
			Effects[effects.Length - 1] = effect;

			effect.ImplicitTargetA = target;
			return effect;
		}
Ejemplo n.º 6
0
			public TargetPair(ImplicitTargetType targetA, ImplicitTargetType targetB)
			{
				TargetA = targetA;
				TargetB = targetB;
			}
Ejemplo n.º 7
0
		public bool HasTarget(ImplicitTargetType target)
		{
			return ImplicitTargetA == target || ImplicitTargetB == target;
		}
Ejemplo n.º 8
0
		///// <summary>
		///// Removes the first Effect of the given Type and replace it with a new one which will be returned.
		///// Appends a new one if none of the given type was found.
		///// </summary>
		///// <param name="type"></param>
		///// <returns></returns>
		//public SpellEffect ReplaceEffect(SpellEffectType type, SpellEffectType newType, ImplicitTargetType target)
		//{
		//    for (var i = 0; i < Effects.Length; i++)
		//    {
		//        var effect = Effects[i];
		//        if (effect.EffectType == type)
		//        {
		//            return Effects[i] = new SpellEffect();
		//        }
		//    }
		//    return AddEffect(type, target);
		//}

		/// <summary>
		/// Adds a new Effect to this Spell
		/// </summary>
		/// <param name="type"></param>
		/// <returns></returns>
		public SpellEffect AddEffect(SpellEffectHandlerCreator creator, ImplicitTargetType target)
		{
			var effect = AddEffect(SpellEffectType.Dummy, target);
			effect.SpellEffectHandlerCreator = creator;
			return effect;
		}