Exemplo n.º 1
0
        public void CreateInnerCircle()
        {
            List <Point> nextCircle = new List <Point>();

            nextCircle = Functions.GetCircleLocations(StartingLocation, NextSize);
            for (int i = 0; i < nextCircle.Count; i++)
            {
                if (CurrentMap.ValidPoint(nextCircle[i]))
                {
                    SpellObject spell = new SpellObject
                    {
                        Spell      = Spell.DigOutZombie,
                        Value      = 0,
                        ExpireTime = ShrinkTime,
                        //ExpireTime = Envir.Time + ( 10 + value / 2 ) * 1000,
                        TickSpeed       = 1000,
                        CurrentLocation = nextCircle[i],
                        CurrentMap      = CurrentMap,
                        LMS_Circle      = true
                    };
                    CurrentMap.Cells[nextCircle[i].X, nextCircle[i].Y].Add(spell);

                    spell.Spawned();
                }
            }
        }
Exemplo n.º 2
0
        public void CreateCircle(ushort circleSize)
        {
            CircleLocations = Functions.GetCircleLocations(StartingLocation, circleSize);

            for (int i = 0; i < CircleLocations.Count; i++)
            {
                if (CurrentMap.ValidPoint(CircleLocations[i]))
                {
                    SpellObject ob = new SpellObject
                    {
                        Spell      = Spell.FireWall,
                        Value      = 0,
                        ExpireTime = ShrinkTime,
                        //ExpireTime = Envir.Time + ( 10 + value / 2 ) * 1000,
                        TickSpeed       = 1000,
                        CurrentLocation = CircleLocations[i],
                        CurrentMap      = CurrentMap,
                        LMS_Circle      = true
                    };

                    CurrentMap.Cells[CircleLocations[i].X, CircleLocations[i].Y].Add(ob);

                    ob.Spawned();
                }
            }
        }
Exemplo n.º 3
0
        protected override void ProcessAI()
        {
            if (!Dead && Envir.Time > VisibleTime)
            {
                VisibleTime = Envir.Time + 2000;

                bool visible = FindNearby(4);

                if (!Visible && visible)
                {
                    Visible  = true;
                    CellTime = Envir.Time + 500;
                    Broadcast(GetInfo());
                    Broadcast(new S.ObjectShow {
                        ObjectID = ObjectID
                    });
                    ActionTime      = Envir.Time + 2000;
                    DigOutTime      = Envir.Time;
                    DigOutLocation  = CurrentLocation;
                    DigOutDirection = Direction;
                }
            }

            if (Visible && Envir.Time > DigOutTime + 800 && !DoneDigOut)
            {
                SpellObject ob = new SpellObject
                {
                    Spell           = Spell.Armadilo,
                    Value           = 1,
                    ExpireTime      = Envir.Time + (5 * 60 * 1000),
                    TickSpeed       = 2000,
                    Caster          = null,
                    CurrentLocation = DigOutLocation,
                    CurrentMap      = this.CurrentMap,
                    Direction       = DigOutDirection
                };
                CurrentMap.AddObject(ob);
                ob.Spawned();
                DoneDigOut = true;
            }

            base.ProcessAI();
        }
Exemplo n.º 4
0
 protected virtual void SpawnDigOutEffect()
 {
     if (Visible && Envir.Time > DigOutTime + 1000 && !DoneDigOut)
     {
         SpellObject ob = new SpellObject
         {
             Spell           = Spell.DigOutZombie,
             Value           = 1,
             ExpireTime      = Envir.Time + (5 * 60 * 1000),
             TickSpeed       = 2000,
             Caster          = null,
             CurrentLocation = DigOutLocation,
             CurrentMap      = this.CurrentMap,
             Direction       = DigOutDirection
         };
         CurrentMap.AddObject(ob);
         ob.Spawned();
         DoneDigOut = true;
     }
 }
Exemplo n.º 5
0
        protected override void ProcessAI()
        {
            if (!Dead && Envir.Time > VisibleTime)
            {
                VisibleTime = Envir.Time + 2000;

                bool visible = FindNearby(3);

                if (!Visible && visible)
                {
                    Visible = true;
                    CellTime = Envir.Time + 500;
                    Broadcast(GetInfo());
                    Broadcast(new S.ObjectShow { ObjectID = ObjectID });
                    ActionTime = Envir.Time + 2000;
                    DigOutTime = Envir.Time;
                    DigOutLocation = CurrentLocation;
                    DigOutDirection = Direction;
                }
            }

            if (Visible && Envir.Time > DigOutTime + 1000 && !DoneDigOut)
            {
                SpellObject ob = new SpellObject
                    {
                        Spell = Spell.DigOutZombie,
                        Value = 1,
                        ExpireTime = Envir.Time + (5 * 60 * 1000),
                        TickSpeed = 2000,
                        Caster = null,
                        CurrentLocation = DigOutLocation,
                        CurrentMap = this.CurrentMap,
                        Direction = DigOutDirection
                    };
                CurrentMap.AddObject(ob);
                ob.Spawned();
                DoneDigOut = true;                    
            }

            base.ProcessAI();
        }
Exemplo n.º 6
0
        public void ActivateEvent()
        {
            Point randomLocation = Locations[Envir.Random.Next(Locations.Count)];

            CurrentLocation = randomLocation;
            SMain.EnqueueDebugging(string.Format("{0} Activating Event:{1}", Map.Info.FileName, Info.EventName));
            switch (Info.EventType)
            {
            case EventType.Invasion:
                Stage = 1;
                SpawnInvasionMonsters(1);
                break;

            default:
                SpawnMonsters();
                break;
            }

            MapEventClientSide eventNotification = new MapEventClientSide()
            {
                EventName = Info.EventName,
                EventType = Info.EventType,
                Index     = Info.Index,
                IsActive  = true,
                Size      = Info.EventSize,
                Location  = CurrentLocation
            };

            foreach (var player in Map.Players)
            {
                player.Enqueue(new S.ActivateEvent()
                {
                    Event = eventNotification
                });
            }

            #region Boundaries
            for (int y = CurrentLocation.Y - Info.EventSize; y <= CurrentLocation.Y + Info.EventSize; y++)
            {
                if (y < 0)
                {
                    continue;
                }
                if (y >= Map.Height)
                {
                    break;
                }
                for (int x = CurrentLocation.X - Info.EventSize; x <= CurrentLocation.X + Info.EventSize; x += Math.Abs(y - CurrentLocation.Y) == Info.EventSize ? 1 : Info.EventSize * 2)
                {
                    if (x < 0)
                    {
                        continue;
                    }
                    if (x >= Map.Width)
                    {
                        break;
                    }
                    if (!Map.Cells[x, y].Valid)
                    {
                        continue;
                    }

                    SpellObject spell = new SpellObject
                    {
                        ExpireTime      = long.MaxValue,
                        Spell           = this.Info.IsSafezone ? Spell.TrapHexagon : Spell.FireWall,
                        TickSpeed       = int.MaxValue,
                        CurrentLocation = new Point(x, y),
                        CurrentMap      = Map,
                        Decoration      = true
                    };

                    Map.Cells[x, y].Add(spell);
                    Zone.Add(spell);
                    spell.Spawned();
                }
            }
            #endregion
        }