示例#1
0
        void ReviveActor(FightActor actor, int heal)
        {
            var cell = TargetedCell;

            if (!Fight.IsCellFree(cell))
            {
                cell = Map.GetRandomAdjacentFreeCell(TargetedPoint, true);
            }

            actor.Revive(heal, Caster);
            actor.SummoningEffect = this;
            actor.Position.Cell   = cell;
            actor.BuffRemoved    += OnBuffRemoved;

            if (Spell.Id == (int)SpellIdEnum.LAISSE_SPIRITUELLE_420)
            {
                var actorBuffId = actor.PopNextBuffId();

                var addStateHandler = new AddState(new EffectDice(EffectsEnum.Effect_AddState, (short)SpellStatesEnum.ZOMBI_74, 0, 0), actor, null, actor.Cell, false);
                var actorBuff       = new StateBuff(actorBuffId, actor, Caster, addStateHandler,
                                                    Spell, FightDispellableEnum.DISPELLABLE_BY_DEATH, SpellManager.Instance.GetSpellState((uint)SpellStatesEnum.ZOMBI_74))
                {
                    Duration = -1000
                };

                actor.AddBuff(actorBuff, true);
            }

            ActionsHandler.SendGameActionFightReviveMessage(Fight.Clients, Caster, actor);
            ContextHandler.SendGameFightTurnListMessage(Fight.Clients, Fight);
        }
        public StateBuff AddStateBuff(FightActor target, bool dispelable, SpellState state)
        {
            int       id        = target.PopNextBuffId();
            StateBuff stateBuff = new StateBuff(id, target, this.Caster, this.Dice, this.Spell, dispelable, state);

            target.AddAndApplyBuff(stateBuff, true);
            return(stateBuff);
        }
        public TriggerBuff AddTriggerBuff(FightActor target, bool dispelable, BuffTriggerType trigger, TriggerBuffApplyHandler applyTrigger, TriggerBuffRemoveHandler removeTrigger)
        {
            int         id          = target.PopNextBuffId();
            TriggerBuff triggerBuff = new TriggerBuff(id, target, this.Caster, this.Dice, this.Spell, this.Critical, dispelable, trigger, applyTrigger, removeTrigger);

            target.AddAndApplyBuff(triggerBuff, true);
            return(triggerBuff);
        }
        public StatBuff AddStatBuff(FightActor target, short value, PlayerFields caracteritic, bool dispelable, CustomActionsEnum customAction)
        {
            int      id       = target.PopNextBuffId();
            StatBuff statBuff = new StatBuff(id, target, this.Caster, this.Effect, this.Spell, value, caracteritic, this.Critical, dispelable, (short)customAction);

            target.AddAndApplyBuff(statBuff, true);
            return(statBuff);
        }
示例#5
0
        protected Buff AddStateBuffDirectly(FightActor target, bool bypassMaxStack, SpellState state, FightActor triggerer = null)
        {
            var id   = target.PopNextBuffId();
            var buff = new StateBuff(id, target, Caster, this, Spell, DefaultDispellableStatus, state, triggerer: triggerer);

            target.AddBuff(buff, bypassMaxStack);

            return(buff);
        }
示例#6
0
        public TriggerBuff AddTriggerBuff(FightActor target, TriggerBuffApplyHandler applyTrigger, TriggerBuffRemoveHandler removeTrigger)
        {
            var id   = target.PopNextBuffId();
            var buff = new TriggerBuff(id, target, Caster, this, Spell, Spell, Critical, DefaultDispellableStatus, Priority, applyTrigger, removeTrigger);

            target.AddBuff(buff);

            return(buff);
        }
示例#7
0
        protected Buff AddStatBuffDirectly(FightActor target, short value, PlayerFields caracteritic, short?customActionId = null, bool noDelay = false, FightActor triggerrer = null)
        {
            var id   = target.PopNextBuffId();
            var buff = new StatBuff(id, target, Caster, this, Spell, value, caracteritic, Critical, DefaultDispellableStatus, triggerrer);

            if (customActionId != null)
            {
                buff.CustomActionId = customActionId;
            }

            if (noDelay)
            {
                buff.Delay = 0;
            }

            target.AddBuff(buff);

            return(buff);
        }
示例#8
0
 public override void Execute()
 {
     if (!this.m_initialized)
     {
         this.Initialize();
     }
     if (base.Handlers.Length == 1)
     {
         this.m_affectedActors = base.Handlers[0].GetAffectedActors().ToArray <FightActor>();
         FightActor[] affectedActors = this.m_affectedActors;
         for (int i = 0; i < affectedActors.Length; i++)
         {
             FightActor fightActor = affectedActors[i];
             int        id         = fightActor.PopNextBuffId();
             fightActor.AddAndApplyBuff(new TriggerBuff(id, fightActor, base.Caster, base.Handlers[0].Dice, base.Spell, false, false, BuffTriggerType.BEFORE_ATTACKED, new TriggerBuffApplyHandler(this.ChakraConcentrationBuffTrigger))
             {
                 Duration = 1
             }, true);
         }
     }
 }