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); } }); }
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(); } }