Пример #1
0
            public FlowChecker(GenericReader reader, FountainEncounter encounter)
            {
                int version = reader.ReadInt();

                _Encounter = encounter;

                _Spigot = reader.ReadItem() as ShadowguardSpigot;
                _Drain  = reader.ReadItem() as ShadowguardDrain;

                int count = reader.ReadInt();

                for (int i = 0; i < count; i++)
                {
                    if (_Checked == null)
                    {
                        _Checked = new List <ShadowguardCanal>();
                    }

                    ShadowguardCanal c = reader.ReadItem() as ShadowguardCanal;

                    if (c != null)
                    {
                        _Checked.Add(c);
                    }
                }
            }
Пример #2
0
        public override bool OnBeforeDeath()
        {
            if (ShadowguardController.GetEncounter(Location, Map) is FountainEncounter encounter)
            {
                ShadowguardCanal canal = new ShadowguardCanal();

                canal.MoveToWorld(Location, Map);
                encounter.AddShadowguardCanal(canal);
            }

            return(base.OnBeforeDeath());
        }
Пример #3
0
        public override bool OnBeforeDeath()
        {
            FountainEncounter encounter = ShadowguardController.GetEncounter(this.Location, this.Map) as FountainEncounter;

            if (encounter != null)
            {
                var canal = new ShadowguardCanal();
                canal.MoveToWorld(this.Location, this.Map);
                encounter.AddShadowguardCanal(canal);
            }

            return(base.OnBeforeDeath());
        }
Пример #4
0
            public void Check(Mobile m)
            {
                Point3D p;
                Map     map         = Map.TerMur;
                bool    southFacing = _Spigot.ItemID == 39922;

                if (_Checked != null)
                {
                    _Checked.Clear();
                }

                if (southFacing)
                {
                    p = new Point3D(_Spigot.X, _Spigot.Y + 1, -20);
                }
                else
                {
                    p = new Point3D(_Spigot.X + 1, _Spigot.Y, -20);
                }

                Item item = FindItem(p);

                if (item is ShadowguardCanal)
                {
                    ShadowguardCanal canal = item as ShadowguardCanal;

                    if ((southFacing && (canal.Flow == Flow.NorthSouth || canal.Flow == Flow.SouthEastCorner || canal.Flow == Flow.SouthWestCorner)) ||
                        (!southFacing && (canal.Flow == Flow.EastWest || canal.Flow == Flow.SouthEastCorner || canal.Flow == Flow.NorthEastCorner)))
                    {
                        if (_Checked == null)
                        {
                            _Checked = new List <ShadowguardCanal>();
                        }

                        _Checked.Add(canal);

                        RecursiveCheck(item, null);
                    }
                }

                if (Complete)
                {
                    Fill();
                    Timer.DelayCall(TimeSpan.FromSeconds(2), () => _Encounter.CheckEncounter());
                }
                else
                {
                    _Encounter.SpawnBaddie(m);
                }
            }
Пример #5
0
        public bool Connects(ShadowguardCanal next)
        {
            Direction d = Utility.GetDirection(this, next);
            Flow      f = next.Flow;

            switch (d)
            {
            case Direction.North:
                switch (_Flow)
                {
                case Flow.EastWest: return(false);                                                                                 //

                case Flow.NorthSouth: return(f == Flow.NorthSouth || f == Flow.NorthEastCorner || f == Flow.NorthWestCorner);      //

                case Flow.NorthWestCorner: return(false);                                                                          //

                case Flow.NorthEastCorner: return(false);                                                                          //

                case Flow.SouthWestCorner: return(f == Flow.NorthSouth || f == Flow.NorthEastCorner || f == Flow.NorthWestCorner); //

                case Flow.SouthEastCorner: return(f == Flow.NorthSouth || f == Flow.NorthEastCorner || f == Flow.NorthWestCorner); //
                }
                break;

            case Direction.South:
                switch (_Flow)
                {
                case Flow.EastWest: return(false);                                                                                 //

                case Flow.NorthSouth: return(f == Flow.NorthSouth || f == Flow.SouthEastCorner || f == Flow.SouthWestCorner);      //

                case Flow.NorthWestCorner: return(f == Flow.NorthSouth || f == Flow.SouthEastCorner || f == Flow.SouthWestCorner); //

                case Flow.NorthEastCorner: return(f == Flow.NorthSouth || f == Flow.SouthEastCorner || f == Flow.SouthWestCorner); //

                case Flow.SouthWestCorner: return(false);                                                                          //

                case Flow.SouthEastCorner: return(false);                                                                          //
                }
                break;

            case Direction.East:
                switch (_Flow)
                {
                case Flow.EastWest: return(f == Flow.EastWest || f == Flow.NorthEastCorner || f == Flow.SouthEastCorner);        //

                case Flow.NorthSouth: return(false);                                                                             //

                case Flow.NorthWestCorner: return(f == Flow.EastWest || f == Flow.NorthEastCorner || f == Flow.SouthEastCorner); //

                case Flow.NorthEastCorner: return(false);                                                                        //

                case Flow.SouthWestCorner: return(f == Flow.EastWest || f == Flow.NorthEastCorner || f == Flow.SouthEastCorner); //

                case Flow.SouthEastCorner: return(false);                                                                        //
                }
                break;

            case Direction.West:
                switch (_Flow)
                {
                case Flow.EastWest: return(f == Flow.EastWest || f == Flow.NorthWestCorner || f == Flow.SouthWestCorner);        //

                case Flow.NorthSouth: return(false);                                                                             //

                case Flow.NorthWestCorner: return(false);                                                                        //

                case Flow.NorthEastCorner: return(f == Flow.EastWest || f == Flow.NorthWestCorner || f == Flow.SouthWestCorner); //

                case Flow.SouthWestCorner: return(false);                                                                        //

                case Flow.SouthEastCorner: return(f == Flow.EastWest || f == Flow.NorthWestCorner || f == Flow.SouthWestCorner); //
                }
                break;
            }

            return(false);
        }