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); } } } } }
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); } } } } } } } } }
// FIXME: change total other functions for compatibiliy with this private void ChangeTile(int x, int y, ushort tileID, bool fg) { BaseTile tile = GetTile(x, y); if (tile != null) { if (!fg) { tile.Background = tileID; } else { tile.Foreground = tileID; } switch (tileID) { case PlaceID.pid_Lava: { if (tile.ForeBase == PlaceID.pid_Tree) { tile.Foreground = PlaceID.pid_DeadTree; GlobalVars.nwrWin.ShowText(GlobalVars.nwrWin, BaseLocale.GetStr(RS.rs_TreeBursts)); } // ALERT: fixme, where resistances?!! NWCreature cr = (NWCreature)FindCreature(x, y); if (cr != null) { if (cr.IsPlayer) { GlobalVars.nwrWin.ShowText(cr, BaseLocale.GetStr(RS.rs_LavaEncasesYou)); cr.Death(BaseLocale.GetStr(RS.rs_EncasedInVolcanicRock), null); } else { cr.Death(BaseLocale.GetStr(RS.rs_XIsConsumedByLava), null); } } break; } } } }
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); } } } }
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!\" } }
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); } } } }
private void DoCommand(string cmd) { try { int tokCount = (int)AuxUtils.GetTokensCount(cmd, " "); string token = AuxUtils.GetToken(cmd, " ", 1).ToLower(); Player player = GlobalVars.nwrGame.Player; if (token.Equals("name_gen")) { for (int i = 1; i <= 10; i++) { AddMessage(GlobalVars.nwrGame.NameLib.GenerateName("ru", Gender.gMale, NamesLib.NameGen_RndSlabs)); } } else { if (token.Equals("test")) { player.Body = new HumanBody(player); } else { if (token.Equals("suicide")) { player.Death("Suicide", null); } else { if (token.Equals("set_fury")) { GlobalVars.Debug_Fury = !GlobalVars.Debug_Fury; string temp = GlobalVars.Debug_Fury ? "yes" : "no"; AddMessage(">> (fury = " + temp + ")"); } else { if (token.Equals("transform")) { if (tokCount == 1) { throw new Exception(BaseLocale.GetStr(RS.rs_NoValue)); } string temp = AuxUtils.GetToken(cmd, " ", 2); DataEntry entry = GlobalVars.nwrDB.FindEntryBySign(temp); if (entry != null) { EffectExt ext = new EffectExt(); ext.SetParam(EffectParams.ep_MonsterID, entry.GUID); player.UseEffect(EffectID.eid_Transformation, null, InvokeMode.im_ItSelf, ext); } } else { if (token.Equals("add_monster")) { if (tokCount == 1) { throw new Exception(BaseLocale.GetStr(RS.rs_NoValue)); } string temp = AuxUtils.GetToken(cmd, " ", 2); int tx; int ty; if (tokCount == 4) { tx = Convert.ToInt32(AuxUtils.GetToken(cmd, " ", 3)); ty = Convert.ToInt32(AuxUtils.GetToken(cmd, " ", 4)); } else { tx = -1; ty = -1; } DataEntry entry = GlobalVars.nwrDB.FindEntryBySign(temp); if (entry != null) { GlobalVars.nwrGame.AddCreatureEx(player.LayerID, player.Field.X, player.Field.Y, tx, ty, entry.GUID); } } else { if (token.Equals("kill_all")) { NWField fld = player.CurrentField; for (int i = fld.Creatures.Count - 1; i >= 0; i--) { NWCreature cr = fld.Creatures.GetItem(i); if (!cr.IsPlayer && !cr.Mercenary) { cr.Death("", null); } } } else { if (token.Equals("show_goals")) { ShowGoals(); } else { if (token.Equals("set_divinity")) { GlobalVars.Debug_Divinity = !GlobalVars.Debug_Divinity; string temp; if (GlobalVars.Debug_Divinity) { temp = "yes"; } else { temp = "no"; } AddMessage(">> (divinity = " + temp + ")"); } else { if (token.Equals("set_freeze")) { GlobalVars.Debug_Freeze = !GlobalVars.Debug_Freeze; string temp; if (GlobalVars.Debug_Freeze) { temp = "yes"; } else { temp = "no"; } AddMessage(">> (freeze = " + temp + ")"); } else { if (token.Equals("set_morality")) { if (tokCount == 1) { throw new Exception(BaseLocale.GetStr(RS.rs_NoValue)); } int dummy = Convert.ToInt32(AuxUtils.GetToken(cmd, " ", 2)); player.Morality = (sbyte)dummy; AddMessage(">> (Player.Morality = " + Convert.ToString(dummy) + ")"); } else { if (token.Equals("takeitem")) { if (tokCount == 1) { throw new Exception(BaseLocale.GetStr(RS.rs_NoName)); } if (tokCount == 2) { throw new Exception(BaseLocale.GetStr(RS.rs_NoCount)); } token = AuxUtils.GetToken(cmd, " ", 2); int dummy = Convert.ToInt32(AuxUtils.GetToken(cmd, " ", 3)); TakePlayerItem(player, token, dummy); } else { AddMessage(BaseLocale.GetStr(RS.rs_CommandUnknown)); } } } } } } } } } } } } } catch (Exception ex) { AddMessage(BaseLocale.GetStr(RS.rs_CommandUnknown)); AddMessage(ex.Message); } }