Exemple #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);
                    }
                }
            }
Exemple #2
0
            public void RecursiveCheck(Item item, Item last)
            {
                Item next = null;

                for (int i = 0; i < _Offsets.Length; i += 2)
                {
                    Point3D p = new Point3D(item.X + _Offsets[i], item.Y + _Offsets[i + 1], item.Z);
                    next = FindItem(p);

                    if (next != null && next != last)
                    {
                        if (Connects(item, next))
                        {
                            if (next is ShadowguardDrain)
                            {
                                _Drain = (ShadowguardDrain)next;
                                return;
                            }
                            else if (next is ShadowguardCanal)
                            {
                                if (_Checked == null)
                                {
                                    _Checked = new List <ShadowguardCanal>();
                                }

                                _Checked.Add((ShadowguardCanal)next);

                                RecursiveCheck(next, item);
                            }
                        }
                    }
                }
            }
Exemple #3
0
        private void SpawnDrain(Rectangle2D rec)
        {
            int x = Utility.RandomMinMax(rec.X, rec.X + rec.Width);
            int y = Utility.RandomMinMax(rec.Y, rec.Y + rec.Height);
            int z = Map.TerMur.GetAverageZ(x, y);

            ShadowguardDrain drain = new ShadowguardDrain();

            drain.MoveToWorld(new Point3D(x, y, z), Map.TerMur);
            AddShadowguardCanal(drain);
        }