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);
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
Exemplo n.º 2
0
        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
            {
                NWCreature c = (NWCreature)f.FindCreature(aX, aY);
                if (c != null && c.HasAffect(EffectID.eid_Death))
                {
                    RaceID race = c.Entry.Race;
                    if (race == RaceID.crDefault || race == RaceID.crHuman)
                    {
                        if (c.IsPlayer)
                        {
                            c.Death(BaseLocale.GetStr(RS.rs_KilledByDeathRay), null);
                        }
                        else
                        {
                            c.Death(BaseLocale.Format(RS.rs_TheXIsDestroyed, new object[] { c.Name }), null);
                        }
                    }
                }
            }
        }
Exemplo n.º 3
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 }));
                }
            }
        }
Exemplo n.º 4
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);
                }
            }
        }
Exemplo n.º 5
0
        public override void TileProc(int aX, int aY, ref bool refContinue)
        {
            NWField f = Field;

            if (f.IsBarrier(aX, aY))
            {
                refContinue = false;
            }
            else
            {
                Step(aX, aY);

                NWCreature c = (NWCreature)f.FindCreature(aX, aY);
                if (c != null)
                {
                    int val = RandomHelper.GetBoundedRnd(25, 40);
                    if (c.HPCur - val < 0)
                    {
                        val = c.HPCur;
                    }
                    c.ApplyDamage(val, DamageKind.dkPhysical, null, "");
                    if (Creature.Items.FindByCLSID(GlobalVars.iid_SoulTrapping_Ring) == null)
                    {
                        Creature.HPCur = Creature.HPCur + val;
                    }
                    // TODO: messages!!!
                }
                refContinue = (c == null);
            }
        }
Exemplo 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);
                    }
                }
            }
        }
Exemplo n.º 7
0
        public void LineProc(int x, int y, ref bool isContinue)
        {
            NWField f = ACreature.CurrentField;

            if (f.IsBarrier(x, y))
            {
                isContinue = false;
            }
            else
            {
                NWCreature cr = (NWCreature)f.FindCreature(x, y);
                isContinue = (cr == null) || (cr.Equals(AEnemy) || cr.Equals(ACreature));
            }
        }
        public override void TileProc(int aX, int aY, ref bool aContinue)
        {
            NWField f = Field;

            if (f.IsBarrier(aX, aY))
            {
                aContinue = false;
            }
            else
            {
                NWCreature c = (NWCreature)f.FindCreature(aX, aY);
                if (c != null)
                {
                    EffectsFactory.FireHit(EffectID.eid_FireVision, Creature, c, RandomHelper.GetBoundedRnd(2, 40));
                }
                aContinue = (c == null);
            }
        }
Exemplo n.º 9
0
        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
            {
                NWCreature c = (NWCreature)f.FindCreature(aX, aY);
                if (c != null && c.HasAffect(EffectID.eid_Stoning))
                {
                    c.AddEffect(EffectID.eid_Stoning, ItemState.is_Normal, EffectAction.ea_Persistent, true, "");
                }
            }
        }
        public override void TileProc(int aX, int aY, ref bool aContinue)
        {
            NWField fld = Field;

            Step(aX, aY);

            if (fld.IsBarrier(aX, aY))
            {
                aContinue = false;
            }
            else
            {
                NWCreature c = (NWCreature)fld.FindCreature(aX, aY);
                aContinue = true;
                if (c != null)
                {
                    if (c.HasAffect(EffID))
                    {
                        MNXRange dmg = EffectsData.dbEffects[(int)EffID].Damage;
                        c.ApplyDamage(RandomHelper.GetBoundedRnd(dmg.Min, dmg.Max), DmgKind, null, "");
                    }
                    if (EffID == EffectID.eid_Slinn_Gout)
                    {
                        c.Luck--;
                    }
                    else
                    {
                        if (EffID == EffectID.eid_Ellegiant_Throw)
                        {
                            aContinue = false;
                            Item item = new Item(GameSpace.Instance, fld);
                            item.CLSID = GlobalVars.nwrDB.FindEntryBySign("Boulder").GUID;
                            item.Count = 1;
                            item.SetPos(aX, aY);
                            item.Owner = fld;
                            fld.Items.Add(item, false);
                        }
                    }
                }
            }
        }
Exemplo n.º 11
0
        public void LineProc(int aX, int aY, ref bool aContinue)
        {
            NWField f = (NWField)ACreature.CurrentMap;

            if (f.IsBarrier(aX, aY))
            {
                aContinue = false;
            }
            else
            {
                NWCreature cr = (NWCreature)f.FindCreature(aX, aY);
                if (cr == null)
                {
                    aContinue = true;
                }
                else
                {
                    aContinue = (cr.Equals(AEnemy) || cr.Equals(ACreature));
                }
            }
        }
Exemplo n.º 12
0
        public override void TileProc(int aX, int aY, ref bool aContinue)
        {
            NWCreature self = Creature;
            NWField    f    = Field;

            if (f.IsBarrier(aX, aY))
            {
                aContinue = false;
            }
            else
            {
                NWCreature c = (NWCreature)f.FindCreature(aX, aY);
                if (c != null)
                {
                    c.ApplyDamage(RandomHelper.GetBoundedRnd(9, 17), DamageKind.dkPhysical, null, "");
                }
                else
                {
                    self.CheckTile(false);
                    self.SetPos(aX, aY);
                    self.CheckTile(true);

                    Effect ef = self.Effects.FindEffectByID(EffectID.eid_PitTrap);
                    if (ef != null)
                    {
                        self.Effects.Remove(ef);
                    }
                    else
                    {
                        ef = self.Effects.FindEffectByID(EffectID.eid_Quicksand);
                        if (ef != null)
                        {
                            self.Effects.Remove(ef);
                        }
                    }
                    GlobalVars.nwrWin.ShowText(self, BaseLocale.GetStr(RS.rs_YouPullForward));
                }
                aContinue = false;
            }
        }
Exemplo n.º 13
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);
                    }
                }
            }
        }
Exemplo n.º 14
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));
                }
            }
        }
Exemplo n.º 15
0
        public override void TileProc(int aX, int aY, ref bool aContinue)
        {
            NWField f = Field;

            Step(aX, aY);
            if (f.IsBarrier(aX, aY))
            {
                aContinue = false;
            }
            else
            {
                NWCreature c = (NWCreature)f.FindCreature(aX, aY);
                if (c != null)
                {
                    RaceID race = c.Entry.Race;
                    if (race == RaceID.crDefault || race == RaceID.crHuman)
                    {
                        c.ClearAbilities();
                        c.ClearSkills();
                    }
                }
            }
        }
Exemplo n.º 16
0
        private void LineProc(int x, int y, ref bool refContinue)
        {
            Steps++;
            NWGameSpace space = Creature.Space;

            if (!Map.IsValid(x, y))
            {
                bool gpChanged = false;

                int fx = Map.Coords.X;
                int fy = Map.Coords.Y;
                int px = x;
                int py = y;

                GlobalPosition gpi = new GlobalPosition(fx, fy, px, py, gpChanged);
                gpi.CheckPos();
                fx        = gpi.Fx;
                fy        = gpi.Fy;
                px        = gpi.Px;
                py        = gpi.Py;
                gpChanged = gpi.GlobalChanged;

                NWLayer layer = Map.Layer;
                if (fx >= 0 && fx != layer.W && fy >= 0 && fy != layer.H && gpChanged)
                {
                    Map.Items.Extract(ProjectileItem);
                    Map = space.GetField(Creature.LayerID, fx, fy);
                    Map.Items.Add(ProjectileItem, false);
                    ProjectileItem.SetPos(px, py);
                }

                refContinue = false;
            }
            else
            {
                if (Map.IsBarrier(x, y))
                {
                    Hit         = HIT_BARRIER;
                    refContinue = false;
                }
                else if (Steps > Range)
                {
                    Hit         = HIT_NONE;
                    refContinue = false;
                }
                else
                {
                    NWCreature target = (NWCreature)Map.FindCreature(x, y);

                    if (target != null && !target.Equals(Creature))
                    {
                        Creature.AttackTo(Kind, target, Weapon, ProjectileItem);
                        ProjectileItem.SetPos(x, y);
                        Hit = HIT_BODY;

                        ProjectileItem.ApplyEffects(target, InvokeMode.im_Use, null);

                        refContinue = false;
                    }

                    if (refContinue)
                    {
                        ProjectileItem.SetPos(x, y);
                    }
                }
            }

            if (space.Player.IsSeen(x, y, false))
            {
                space.RepaintView(25);
            }
        }
        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);
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }