From a66ec38da897fa7184879f30c848b8f9060a4e8a Mon Sep 17 00:00:00 2001 From: Jordan Irwin Date: Sun, 8 Oct 2023 00:50:45 -0700 Subject: [PATCH] Move common ghost attributes to base class --- src/games/stendhal/server/entity/npc/GhostNPCBase.java | 7 +++++++ src/games/stendhal/server/maps/athor/cave/GhostNPC.java | 6 ------ src/games/stendhal/server/maps/orril/dungeon/GhostNPC.java | 6 ------ src/games/stendhal/server/maps/wofol/house5/GhostNPC.java | 6 ------ 4 files changed, 7 insertions(+), 18 deletions(-) diff --git a/src/games/stendhal/server/entity/npc/GhostNPCBase.java b/src/games/stendhal/server/entity/npc/GhostNPCBase.java index 9c1c2ffb206..8a4405cc090 100644 --- a/src/games/stendhal/server/entity/npc/GhostNPCBase.java +++ b/src/games/stendhal/server/entity/npc/GhostNPCBase.java @@ -35,6 +35,13 @@ public abstract class GhostNPCBase extends SpeakerNPC { public GhostNPCBase(final String name) { super(name); + + setResistance(0); + setVisibility(50); + // ghosts don't cast shadows + put("no_shadow", ""); + // hide location from website + put("hidezone", ""); } @Override diff --git a/src/games/stendhal/server/maps/athor/cave/GhostNPC.java b/src/games/stendhal/server/maps/athor/cave/GhostNPC.java index 1a740742510..fcbda3537b1 100644 --- a/src/games/stendhal/server/maps/athor/cave/GhostNPC.java +++ b/src/games/stendhal/server/maps/athor/cave/GhostNPC.java @@ -80,17 +80,11 @@ protected void createPath() { }; ghost.setDescription("You see a ghostly figure of a woman."); - ghost.setResistance(0); ghost.setEntityClass("woman_005_npc"); - // she is a ghost so she is see through - ghost.setVisibility(50); ghost.setPosition(65, 74); // she has low HP ghost.initHP(30); ghost.setBaseHP(100); - ghost.put("no_shadow", ""); - // hide location from website - ghost.put("hidezone", ""); zone.add(ghost); } } diff --git a/src/games/stendhal/server/maps/orril/dungeon/GhostNPC.java b/src/games/stendhal/server/maps/orril/dungeon/GhostNPC.java index f5ba9d14daf..43183d4f194 100644 --- a/src/games/stendhal/server/maps/orril/dungeon/GhostNPC.java +++ b/src/games/stendhal/server/maps/orril/dungeon/GhostNPC.java @@ -62,17 +62,11 @@ protected void createPath() { }; ghost.setDescription("You see a ghostly figure of a man. He appears to have died in battle."); - ghost.setResistance(0); ghost.setEntityClass("deadmannpc"); - // he is a ghost so he is see through - ghost.setVisibility(70); ghost.setPosition(216, 127); // he has low HP ghost.initHP(30); ghost.setBaseHP(100); - ghost.put("no_shadow", ""); - // hide location from website - ghost.put("hidezone", ""); zone.add(ghost); } } diff --git a/src/games/stendhal/server/maps/wofol/house5/GhostNPC.java b/src/games/stendhal/server/maps/wofol/house5/GhostNPC.java index c36e4a5aae9..2a691002609 100644 --- a/src/games/stendhal/server/maps/wofol/house5/GhostNPC.java +++ b/src/games/stendhal/server/maps/wofol/house5/GhostNPC.java @@ -62,17 +62,11 @@ protected void createPath() { }; ghost.setDescription("You see a ghostly figure of a man. You have no idea how he died."); - ghost.setResistance(0); ghost.setEntityClass("man_000_npc"); - // he is a ghost so he is see through - ghost.setVisibility(50); ghost.setPosition(3, 4); // he has low HP ghost.initHP(30); ghost.setBaseHP(100); - ghost.put("no_shadow", ""); - // hide location from website - ghost.put("hidezone", ""); zone.add(ghost); } }