Exemplo n.º 1
0
        public void OnSelect(int?target)
        {
            if (target == null || target == _warriorArmor.CurUser.pos)
            {
                return;
            }

            target = Ballistica.Cast(_warriorArmor.CurUser.pos, target.Value, false, true);
            if (Actor.FindChar(target.Value) != null && target != _warriorArmor.CurUser.pos)
            {
                target = Ballistica.Trace[Ballistica.Distance - 2];
            }

            _warriorArmor.CurUser.HP -= (_warriorArmor.CurUser.HP / 3);
            if (_warriorArmor.CurUser.subClass == HeroSubClass.BERSERKER && _warriorArmor.CurUser.HP <= _warriorArmor.CurUser.HT * Fury.Level)
            {
                Buff.Affect <Fury>(_warriorArmor.CurUser);
            }

            Invisibility.Dispel();

            _dest = target.Value;
            _warriorArmor.CurUser.Busy();
            ((HeroSprite)_warriorArmor.CurUser.Sprite).Jump(_warriorArmor.CurUser.pos, target.Value, this);
        }
Exemplo n.º 2
0
        public virtual void Cast(Hero user, int dst)
        {
            var cell = Ballistica.Cast(user.pos, dst, false, true);

            user.Sprite.DoZap(cell);
            user.Busy();

            var enemy = Actor.FindChar(cell);

            QuickSlot.Target(this, enemy);

            var delay = TimeToThrow;

            if (this is MissileWeapon)
            {
                // FIXME
                delay *= ((MissileWeapon)this).SpeedFactor(user);
                if (enemy != null && enemy.Buff <SnipersMark>() != null)
                {
                    delay *= 0.5f;
                }
            }

            float finalDelay = delay;

            //((MissileSprite)user.sprite.parent.Recycle(typeof(MissileSprite))).Reset(user.pos, cell, this, new ICallback() { public void call() { Item.detach(user.belongings.backpack).onThrow(cell); user.spendAndNext(finalDelay); } });
        }
Exemplo n.º 3
0
        private void Blink(int target)
        {
            var cell = Ballistica.Cast(pos, target, true, true);

            if (FindChar(cell) != null && Ballistica.Distance > 1)
            {
                cell = Ballistica.Trace[Ballistica.Distance - 2];
            }

            WandOfBlink.Appear(this, cell);

            _delay = BlinkDelay;
        }
Exemplo n.º 4
0
        protected internal override bool CanAttack(Character enemy)
        {
            hitCell = Ballistica.Cast(pos, enemy.pos, true, false);

            for (var i = 1; i < Ballistica.Distance; i++)
            {
                if (Ballistica.Trace[i] == enemy.pos)
                {
                    return(true);
                }
            }

            return(false);
        }
Exemplo n.º 5
0
        public void OnSelect(int?target)
        {
            if (target == null)
            {
                return;
            }

            if (target == _wand.CurUser.pos)
            {
                GLog.Information(Wand.TxtSelfTarget);
                return;
            }

            _wand.SetKnown();

            _cell = Ballistica.Cast(_wand.CurUser.pos, target.Value, true, _wand.HitChars);
            _wand.CurUser.Sprite.DoZap(_cell);

            QuickSlot.Target(_wand, Actor.FindChar(_cell));

            if (_wand.CurrrentCharges > 0)
            {
                _wand.CurUser.Busy();

                _wand.Fx(_cell, this);

                Invisibility.Dispel();
            }
            else
            {
                _wand.CurUser.SpendAndNext(Wand.TimeToZap);
                GLog.Warning(Wand.TxtFizzles);
                _wand.levelKnown = true;

                _wand.UpdateQuickslot();
            }
        }
Exemplo n.º 6
0
 protected internal override bool CanAttack(Character enemy)
 {
     return(Ballistica.Cast(pos, enemy.pos, false, true) == enemy.pos);
 }