Пример #1
0
 public void Activate(SpellCastInfo castInfo)
 {
     foreach (SpellAspect aspect in aspects)
     {
         aspect.Activate(castInfo);
     }
 }
Пример #2
0
 public void Activate(SpellCastInfo castInfo)
 {
     foreach (IAffectable target in Targeter.GetTargets(castInfo))
     {
         foreach (EffectInstance effect in Effects)
         {
             target.ApplyEffect(castInfo.Caster, effect); //effect.ActivateOnObject(target);
         }
     }
 }
Пример #3
0
    public override HashSet <IAffectable> GetTargets(SpellCastInfo castInfo)
    {
        Container2D <GridSpace> level = BigBoss.Levels.Level.Array;
        var targetSpaces = new HashSet <GridSpace>();

        foreach (GridSpace point in castInfo.TargetSpaces)
        {
            level.DrawCircle(point.X, point.Y, Radius, Draw.AddTo(targetSpaces));
        }
        castInfo.TargetSpaces = targetSpaces.ToArray();
        return(base.GetTargets(castInfo));
    }
Пример #4
0
    public virtual HashSet <IAffectable> GetTargets(SpellCastInfo castInfo)
    {
        var ret = new HashSet <IAffectable>();

        foreach (GridSpace space in castInfo.TargetSpaces)
        {
            foreach (WorldObject obj in space.GetContained())
            {
                var item = obj as IAffectable;
                if (item != null)
                {
                    ret.Add(item);
                }
            }
        }
        return(ret);
    }
Пример #5
0
        public SpellMenuItem(SpellCastInfo info, DrawableImage icon) : base(new DrawableImage("UIObjects/spellBox"),
                                                                            new DrawableImage("UIObjects/spellBox"),
                                                                            new DrawableImage("UIObjects/spellBox"))
        {
            Clickable = false;
            //StateClicking.Position = new Vector2(2, 2);
            AddChild(new DrawableImage("UIObjects/spellBoxDropShadow")
            {
                Position = new Vector2(2, 2)
            }, 0);

            //ClickAction = () => Cast();

            Info = info;

            CoolDown = new DrawableRectangle(new Rectangle((int)NORMAL_WIDTH / 2, (int)NORMAL_WIDTH, (int)NORMAL_WIDTH, (int)NORMAL_WIDTH), Color.Aqua);
            CoolDown.RelativeOrigin = new Vector2(0.5f, 1f);
            CoolDown.Alpha          = 0.3f;
            AddChild(CoolDown, 3);

            Icon = icon;
            AddChild(Icon, 2);
        }
Пример #6
0
 private void CombatHud_SpellCast(object sender, SpellCastEventArgs e)
 {
     try
     {
         switch(SpellIndex[e.SpellId].spellschool.ToLower())
         {
             case "item enchantment":
                 if(gtSettings.bCombatHudTrackItemDebuffs)
                 {
                     if(SpellIndex[e.SpellId].isdebuff)
                     {
                         SpellCastInfo scinfo = new SpellCastInfo();
                         scinfo.SpellTargetId = e.TargetId;
                         scinfo.SpellCastId = e.SpellId;
                         scinfo.CastTime = DateTime.Now;
                         scinfo.SpellAnimation = SpellIndex[e.SpellId].animation;
                         MyCastList.Add(scinfo);
                     }
                 }
                 return;
             case "creature enchantment":
                 if(gtSettings.bCombatHudTrackCreatureDebuffs)
                 {
                     if(SpellIndex[e.SpellId].isdebuff)
                     {
                         SpellCastInfo scinfo = new SpellCastInfo();
                         scinfo.SpellTargetId = e.TargetId;
                         scinfo.SpellCastId = e.SpellId;
                         scinfo.CastTime = DateTime.Now;
                         scinfo.SpellAnimation = SpellIndex[e.SpellId].animation;
                         MyCastList.Add(scinfo);
                     }
                 }
                 return;
             case "life magic":
                 if(gtSettings.bCombatHudTrackLifeDebuffs)
                 {
                     if(SpellIndex[e.SpellId].isdebuff)
                     {
                         SpellCastInfo scinfo = new SpellCastInfo();
                         scinfo.SpellTargetId = e.TargetId;
                         scinfo.SpellCastId = e.SpellId;
                         scinfo.CastTime = DateTime.Now;
                         scinfo.SpellAnimation = SpellIndex[e.SpellId].animation;
                         MyCastList.Add(scinfo);
                     }
                 }
                 return;
             case "void magic":
                 if(gtSettings.bCombatHudTrackVoidDebuffs)
                 {
                     if(SpellIndex[e.SpellId].duration > 0)
                     {
                         SpellCastInfo scinfo = new SpellCastInfo();
                         scinfo.SpellTargetId = e.TargetId;
                         scinfo.SpellCastId = e.SpellId;
                         scinfo.CastTime = DateTime.Now;
                         scinfo.SpellAnimation = SpellIndex[e.SpellId].animation;
                         MyCastList.Add(scinfo);
                     }
                 }
                 return;
             default:
                 return;
         }
     }catch(Exception ex){LogError(ex);}
 }
Пример #7
0
 public HashSet <IAffectable> GetTargets(SpellCastInfo castInfo)
 {
     return(new HashSet <IAffectable>(castInfo.TargetObjects));
 }
Пример #8
0
 public HashSet <IAffectable> GetTargets(SpellCastInfo castInfo)
 {
     return(new HashSet <IAffectable> {
         castInfo.Caster
     });
 }
Пример #9
0
 public override HashSet <IAffectable> GetTargets(SpellCastInfo castInfo)
 {
     // Force spaces to be derived and then call AOE location's code
     castInfo.TargetSpaces = null;
     return(base.GetTargets(castInfo));
 }
Пример #10
0
 public override HashSet <IAffectable> GetTargets(SpellCastInfo castInfo)
 {
     // Confirm target is caster
     castInfo.TargetObject = castInfo.Caster;
     return(base.GetTargets(castInfo));
 }
Пример #11
0
 public override HashSet <IAffectable> GetTargets(SpellCastInfo castInfo)
 {
     // Logic to draw line in any direction
     return(base.GetTargets(castInfo));
 }
Пример #12
0
 public SpellCastInfo(IAffectable caster, SpellCastInfo rhs)
 {
     Caster         = caster;
     _targetSpaces  = new GridSpace[rhs.TargetSpaces.Length];
     _targetObjects = new IAffectable[rhs.TargetObjects.Length];
 }