コード例 #1
0
ファイル: RevealsInvisible.cs プロジェクト: Mixi59/Stump
        protected override bool InternalApply()
        {
            var containedTraps = Fight.GetTriggers().OfType <Trap>().Where(entry => entry.VisibleState == GameActionFightInvisibilityStateEnum.INVISIBLE &&
                                                                           Caster.IsEnnemyWith(entry.Caster) &&
                                                                           AffectedCells.Contains(entry.Shape.Cell));

            foreach (var trap in containedTraps)
            {
                trap.VisibleState = GameActionFightInvisibilityStateEnum.VISIBLE;
                ContextHandler.SendGameActionFightMarkCellsMessage(Fight.Clients, trap);
            }

            foreach (var target in GetAffectedActors().Where(target => target.VisibleState == GameActionFightInvisibilityStateEnum.INVISIBLE && target.IsEnnemyWith(Caster)))
            {
                target.SetInvisibilityState(GameActionFightInvisibilityStateEnum.VISIBLE);
            }

            return(true);
        }
コード例 #2
0
        public override bool Apply()
        {
            Cell[] arg_06_0 = base.AffectedCells;
            System.Collections.Generic.IEnumerable <Trap> enumerable =
                from entry in base.Fight.GetTriggers().OfType <Trap>()
                where entry.VisibleState == GameActionFightInvisibilityStateEnum.INVISIBLE && base.Caster.IsEnnemyWith(entry.Caster) && entry.Shapes.Any((MarkShape subentry) => base.AffectedCells.Contains(subentry.Cell))
                select entry;

            foreach (Trap current in enumerable)
            {
                current.VisibleState = GameActionFightInvisibilityStateEnum.DETECTED;
                ContextHandler.SendGameActionFightMarkCellsMessage(base.Fight.Clients, current, true);
            }
            foreach (FightActor current2 in
                     from target in base.GetAffectedActors()
                     where target.VisibleState == GameActionFightInvisibilityStateEnum.INVISIBLE && target.IsEnnemyWith(base.Caster)
                     select target)
            {
                current2.SetInvisibilityState(GameActionFightInvisibilityStateEnum.DETECTED);
            }
            return(true);
        }