Ejemplo n.º 1
0
        public NWField(NWGameSpace space, NWLayer layer, ExtPoint coords)
            : base(StaticData.FieldWidth, StaticData.FieldHeight)
        {
            fSpace  = space;
            fLayer  = layer;
            fCoords = coords;

            fCreatures     = new CreaturesList(this, true);
            fItems         = new ItemsList(this, true);
            fEffects       = new EffectsList(this, true);
            fEmitters      = new EmitterList();
            ValidCreatures = new List <int>();

            if (Layer != null)
            {
                LayerEntry layerEntry = (LayerEntry)GlobalVars.nwrDB.GetEntry(Layer.EntryID);
                fEntry = layerEntry.GetFieldEntry(fCoords.X, fCoords.Y);

                EntryID = fEntry.GUID;

                fLandEntry = (LandEntry)GlobalVars.nwrDB.FindEntryBySign(fEntry.LandSign);
                LandID     = fLandEntry.GUID;

                PrepareCreatures();
            }
            else
            {
                fEntry     = null;
                EntryID    = -1;
                fLandEntry = null;
                LandID     = -1;
            }
        }
Ejemplo n.º 2
0
        private void ApplyLightEffect()
        {
            int rad = (int)LightRadius;

            if (rad > 0)
            {
                CreaturesList crList = CurrentField.Creatures;
                int           num    = crList.Count;
                for (int i = 0; i < num; i++)
                {
                    NWCreature cr = crList.GetItem(i);
                    if (MathHelper.Distance(Location, cr.Location) <= rad && cr.Entry.Sign.Equals("Phausq"))
                    {
                        cr.Death(BaseLocale.GetStr(RS.rs_MonsterDestroyedByLight), null);
                    }
                }

                // TODO: message for player: \"The light burns you!\"
            }
        }