Esempio n. 1
0
        public override void TileProc(int aX, int aY, ref bool aContinue)
        {
            NWField fld  = Field;
            NWTile  tile = (NWTile)fld.GetTile(aX, aY);

            Step(aX, aY);

            if (fld.IsBarrier(aX, aY))
            {
                if (tile.ForeBase == PlaceID.pid_Tree)
                {
                    tile.Foreground = PlaceID.pid_Undefined;
                    fld.AddCreature(aX, aY, GlobalVars.nwrDB.FindEntryBySign("Faleryn").GUID);
                }
                aContinue = false;
            }
            else
            {
                NWCreature c = (NWCreature)fld.FindCreature(aX, aY);
                if (c != null)
                {
                    EffectsFactory.e_Transformation(EffectID.eid_Transformation, c, null, ItemState.is_Normal, InvokeMode.im_ItSelf, null);
                }
            }
        }
        public override void TileProc(int aX, int aY, ref bool refContinue)
        {
            NWField f = Field;

            Step(aX, aY);

            if (f.IsBarrier(aX, aY))
            {
                refContinue = false;
            }
            else
            {
                BaseTile   tile = f.GetTile(aX, aY);
                NWCreature c    = (NWCreature)f.FindCreature(aX, aY);
                if (c != null)
                {
                    string cSign = c.Entry.Sign;

                    if (cSign.Equals("Mudman") || cSign.Equals("MudFlow"))
                    {
                        EffectsFactory.Deanimate(f, c, tile, PlaceID.pid_Mud);
                    }
                    else
                    {
                        if (cSign.Equals("LavaFlow"))
                        {
                            EffectsFactory.Deanimate(f, c, tile, PlaceID.pid_Lava);
                        }
                        else
                        {
                            if (cSign.Equals("Jagredin") || cSign.Equals("LiveRock"))
                            {
                                EffectsFactory.Deanimate(f, c, tile, PlaceID.pid_Rubble);
                            }
                            else
                            {
                                if (cSign.Equals("SandForm"))
                                {
                                    EffectsFactory.Deanimate(f, c, tile, PlaceID.pid_Quicksand);
                                }
                                else
                                {
                                    if (cSign.Equals("WateryForm"))
                                    {
                                        EffectsFactory.Deanimate(f, c, tile, PlaceID.pid_Water);
                                    }
                                    else
                                    {
                                        if (c.State == CreatureState.Undead)
                                        {
                                            c.Death("", null);
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
        public override void CheckTile(bool aHere)
        {
            NWField map = (NWField)CurrentMap;

            if (map == null)
            {
                return;
            }

            int num = fSegments.Count;

            for (int i = 0; i < num; i++)
            {
                ArticulateSegment seg  = GetSegment(i);
                NWTile            tile = (NWTile)map.GetTile(seg.X, seg.Y);

                if (tile != null)
                {
                    if (aHere)
                    {
                        tile.CreaturePtr = this;
                    }
                    else
                    {
                        tile.CreaturePtr = null;
                    }
                }
            }
        }
Esempio n. 4
0
        public override void TileProc(int aX, int aY, ref bool refContinue)
        {
            NWField f    = Field;
            NWTile  tile = (NWTile)f.GetTile(aX, aY);

            Step(aX, aY);

            if (f.IsBarrier(aX, aY))
            {
                if (tile.ForeBase == PlaceID.pid_Tree)
                {
                    tile.Foreground = PlaceID.pid_DeadTree;
                    string nm = BaseLocale.GetStr(StaticData.dbPlaces[5].NameRS);
                    GlobalVars.nwrWin.ShowText(Creature, BaseLocale.Format(RS.rs_TheXIsMelted, new object[] { nm }));
                }
                refContinue = false;
            }
            else
            {
                NWCreature c = (NWCreature)f.FindCreature(aX, aY);
                if (c != null && c.HasAffect(EffectID.eid_Flaying))
                {
                    c.ApplyDamage(RandomHelper.GetBoundedRnd(13, 36), DamageKind.dkRadiation, null, BaseLocale.Format(RS.rs_TheXIsMelted, new object[] { c.Name }));
                }
            }
        }
Esempio n. 5
0
        public override bool CanMove(IMap map, int aX, int aY)
        {
            bool result = base.CanMove(map, aX, aY);

            NWField fld = (NWField)map;
            int     bg  = fld.GetTile(aX, aY).BackBase;

            result = result || (bg == PlaceID.pid_Space) || (GlobalVars.Debug_Divinity);

            return(result);
        }
Esempio n. 6
0
        public override void TileProc(int aX, int aY, ref bool aContinue)
        {
            NWField fld  = Field;
            NWTile  tile = (NWTile)fld.GetTile(aX, aY);

            Step(aX, aY);

            if (tile == null)
            {
                aContinue = false;
            }
            else
            {
                int fgp = tile.ForeBase;

                switch (fgp)
                {
                case PlaceID.pid_Undefined:
                    break;

                case PlaceID.pid_Mountain:
                case PlaceID.pid_Vulcan:
                    aContinue = false;
                    break;

                case PlaceID.pid_Vortex:
                case PlaceID.pid_StairsDown:
                case PlaceID.pid_StairsUp:
                case PlaceID.pid_GStairsDown:
                case PlaceID.pid_GStairsUp:
                case PlaceID.pid_HoleDown:
                case PlaceID.pid_HoleUp:
                    break;

                default:
                    tile.Foreground = PlaceID.pid_Rubble;
                    break;
                }

                NWCreature c = (NWCreature)fld.FindCreature(aX, aY);
                if (c != null)
                {
                    RaceID race = c.Entry.Race;
                    if (race == RaceID.crDefault || race == RaceID.crHuman)
                    {
                        c.Death("", null);
                    }
                }
            }
        }
Esempio n. 7
0
        private void PrepareHallucinations()
        {
            NWField field = CurrentField;

            HalMap = new NWField(null, field.Layer, field.Coords.Clone());

            for (int y = 0; y < StaticData.FieldHeight; y++)
            {
                for (int x = 0; x < StaticData.FieldWidth; x++)
                {
                    NWTile tile    = (NWTile)field.GetTile(x, y);
                    NWTile halTile = (NWTile)HalMap.GetTile(x, y);
                    halTile.Assign(tile);

                    halTile.Background = Hallucination.GetPlaceID(tile.BackBase);
                    halTile.Foreground = Hallucination.GetPlaceID(tile.ForeBase);
                }
            }

            HalMap.Normalize();
        }
Esempio n. 8
0
        public override void TileProc(int aX, int aY, ref bool refContinue)
        {
            NWField f    = Field;
            NWTile  tile = (NWTile)f.GetTile(aX, aY);

            Step(aX, aY);

            if (f.IsBarrier(aX, aY))
            {
                if (tile.ForeBase == PlaceID.pid_Tree)
                {
                    tile.Foreground = PlaceID.pid_DeadTree;
                    string tmp = BaseLocale.GetStr(StaticData.dbPlaces[5].NameRS);
                    GlobalVars.nwrWin.ShowText(Creature, BaseLocale.Format(RS.rs_TheXIsFrozen, new object[] { tmp }));
                }
                refContinue = false;
            }
            else
            {
                NWCreature c = (NWCreature)f.FindCreature(aX, aY);
                if (c != null && c.HasAffect(EffectID.eid_Ice))
                {
                    c.AddEffect(EffectID.eid_Ice, ItemState.is_Normal, EffectAction.ea_Persistent, false, BaseLocale.GetStr(RS.rs_YouAreFrozen));
                    Effect e = c.Effects.FindEffectByID(EffectID.eid_Ice);
                    if (e != null && e.Magnitude >= 30)
                    {
                        string tmp;
                        if (c.IsPlayer)
                        {
                            tmp = BaseLocale.GetStr(RS.rs_EncasedInIce);
                        }
                        else
                        {
                            tmp = BaseLocale.Format(RS.rs_TheXIsFrozen, new object[] { c.Name });
                        }
                        c.Death(tmp, null);
                    }
                }
            }
        }
Esempio n. 9
0
        public static void DrawSymTile(NWGameSpace space, NWField field, int px, int py, BaseScreen screen, ExtRect mapRect, ExtRect viewRect, ImageList symImages)
        {
            NWTile place = (NWTile)field.GetTile(px, py);
            int    sx    = viewRect.Left + 8 * (px + 1);
            int    sy    = viewRect.Top + 10 * (py + 1);

            if (place != null && !place.EmptyStates)
            {
                ushort bg = place.Background;
                ushort fg = place.Foreground;

                fg = PtTransDoor(place);
                short op = space.GetTileBrightness(field, place, true);
                symImages.DrawImage(screen, sx, sy, GetSymImageIndex(bg), op);

                int fog = place.FogID;
                if (fog != PlaceID.pid_Undefined)
                {
                    symImages.DrawImage(screen, sx, sy, GetSymImageIndex((ushort)PlaceID.pid_Fog), op);
                }
                else
                {
                    if (fg != PlaceID.pid_Undefined)
                    {
                        bool trap = field.IsTrap(px, py);
                        if (!trap || (trap && (place.Trap_Discovered || GlobalVars.Debug_Divinity)))
                        {
                            symImages.DrawImage(screen, sx, sy, GetSymImageIndex(fg), op);
                        }
                    }
                }

                if (!field.IsBarrier(px, py) && mapRect.IsBorder(px, py))
                {
                    symImages.DrawImage(screen, sx, sy, StaticData.dbSymbols[(int)GetBorderSymbol(px, py)].ImageIndex, op);
                }
            }
        }
Esempio n. 10
0
        public override void TileProc(int aX, int aY, ref bool aContinue)
        {
            NWField fld  = Field;
            NWTile  tile = (NWTile)fld.GetTile(aX, aY);

            Step(aX, aY);
            if (fld.IsBarrier(aX, aY))
            {
                if (tile.ForeBase == PlaceID.pid_Tree)
                {
                    tile.Foreground = PlaceID.pid_Undefined;
                }
                aContinue = false;
            }
            else
            {
                NWCreature c = (NWCreature)fld.FindCreature(aX, aY);
                if (c != null)
                {
                    EffectsFactory.FireHit(EffectID.eid_Fire, Creature, c, RandomHelper.GetBoundedRnd(6, 21));
                }
            }
        }
Esempio n. 11
0
        public static void DrawLocTile(NWGameSpace space, NWField field, int px, int py, BaseScreen screen, Player player, ExtRect mapRect, ExtRect viewRect, ImageList resImages)
        {
            NWTile place = (NWTile)field.GetTile(px, py);
            int    xx    = viewRect.Left + 32 * (px - mapRect.Left);
            int    yy    = viewRect.Top + 30 * (py - mapRect.Top);

            if (place != null && !place.EmptyStates)
            {
                int bg     = (int)place.Background;
                int fg     = (int)place.Foreground;
                int bgExt  = (int)place.BackgroundExt;
                int fgExt  = (int)place.ForegroundExt;
                int fog    = place.FogID;
                int fogExt = place.FogExtID;

                fg = PtTransDoor(place);
                short op = space.GetTileBrightness(field, place, false);
                resImages.DrawImage(screen, xx, yy, GetTileImageIndex((ushort)bg), op);
                if (bgExt != PlaceID.pid_Undefined)
                {
                    resImages.DrawImage(screen, xx, yy, GetTileImageIndex((ushort)bgExt), op);
                }
                if (fog != PlaceID.pid_Undefined)
                {
                    resImages.DrawImage(screen, xx, yy, GetTileImageIndex((ushort)fogExt), op);
                }
                else
                {
                    if (fg != PlaceID.pid_Undefined)
                    {
                        bool trap = field.IsTrap(px, py);
                        if (!trap || (trap && (place.Trap_Discovered || GlobalVars.Debug_Divinity)))
                        {
                            resImages.DrawImage(screen, xx, yy, GetTileImageIndex((ushort)fg), op);
                            if (fgExt != PlaceID.pid_Undefined)
                            {
                                resImages.DrawImage(screen, xx, yy, GetTileImageIndex((ushort)fgExt), op);
                            }
                        }
                    }
                    if (fogExt != PlaceID.pid_Undefined)
                    {
                        resImages.DrawImage(screen, xx, yy, GetTileImageIndex((ushort)fogExt), op);
                    }
                }

                SymbolID sid = GetBorderSymbol(px, py);
                if (sid != SymbolID.sid_None && player.CanMove(field, px, py))
                {
                    switch (sid)
                    {
                    case SymbolID.sid_Left:
                        resImages.DrawImage(screen, xx, yy, StaticData.dbItfElements[(int)ItfElement.id_Left].ImageIndex, op);
                        break;

                    case SymbolID.sid_Up:
                        resImages.DrawImage(screen, xx, yy, StaticData.dbItfElements[(int)ItfElement.id_Up].ImageIndex, op);
                        break;

                    case SymbolID.sid_Right:
                        resImages.DrawImage(screen, xx, yy, StaticData.dbItfElements[(int)ItfElement.id_Right].ImageIndex, op);
                        break;

                    case SymbolID.sid_Down:
                        resImages.DrawImage(screen, xx, yy, StaticData.dbItfElements[(int)ItfElement.id_Down].ImageIndex, op);
                        break;
                    }
                }
            }
        }
        public override void TileProc(int aX, int aY, ref bool refContinue)
        {
            NWField f = Field;

            if (f.IsBarrier(aX, aY))
            {
                refContinue = false;
            }
            else
            {
                NWTile tile = (NWTile)f.GetTile(aX, aY);
                int    bg   = tile.BackBase;
                if (bg == PlaceID.pid_Mud || bg == PlaceID.pid_Rubble)
                {
                    tile.Background = PlaceID.pid_Ground;
                }
                else
                {
                    tile.Background = dbTransmutatedList[RandomHelper.GetRandom(2)];
                }

                NWCreature c = (NWCreature)f.FindCreature(aX, aY);
                if (c != null)
                {
                    string cSign = c.Entry.Sign;

                    if (cSign.Equals("Mudman") || cSign.Equals("MudFlow"))
                    {
                        EffectsFactory.Deanimate(f, c, tile, PlaceID.pid_Mud);
                    }
                    else
                    {
                        if (cSign.Equals("LavaFlow"))
                        {
                            EffectsFactory.Deanimate(f, c, tile, PlaceID.pid_Lava);
                        }
                        else
                        {
                            if (cSign.Equals("Jagredin") || cSign.Equals("LiveRock"))
                            {
                                EffectsFactory.Deanimate(f, c, tile, PlaceID.pid_Rubble);
                            }
                            else
                            {
                                if (cSign.Equals("SandForm"))
                                {
                                    EffectsFactory.Deanimate(f, c, tile, PlaceID.pid_Quicksand);
                                }
                                else
                                {
                                    if (cSign.Equals("WateryForm"))
                                    {
                                        EffectsFactory.Deanimate(f, c, tile, PlaceID.pid_Water);
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }