Skip to content

Commit

Permalink
Move common ghost attributes to base class
Browse files Browse the repository at this point in the history
  • Loading branch information
AntumDeluge committed Oct 8, 2023
1 parent 3d8def1 commit a66ec38
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 18 deletions.
7 changes: 7 additions & 0 deletions src/games/stendhal/server/entity/npc/GhostNPCBase.java
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 0 additions & 6 deletions src/games/stendhal/server/maps/athor/cave/GhostNPC.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
6 changes: 0 additions & 6 deletions src/games/stendhal/server/maps/orril/dungeon/GhostNPC.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
6 changes: 0 additions & 6 deletions src/games/stendhal/server/maps/wofol/house5/GhostNPC.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

0 comments on commit a66ec38

Please sign in to comment.