summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/ghost.cc
diff options
context:
space:
mode:
authordolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2009-03-26 01:14:00 +0000
committerdolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2009-03-26 01:14:00 +0000
commitbdb33fda79c45d3eb10d552b10d0e7b09c134771 (patch)
treee7200c18982ccfdc1a5b1f7c86ce9b30846fb13a /crawl-ref/source/ghost.cc
parent2a7a9ce4b22a8a0003b0cc422eee5f6dd44310ca (diff)
downloadcrawl-ref-bdb33fda79c45d3eb10d552b10d0e7b09c134771.tar.gz
crawl-ref-bdb33fda79c45d3eb10d552b10d0e7b09c134771.zip
Make player ghosts keep the gods they worshipped in life, if any (except
if they worshipped good gods, since player ghosts are undead and, hence, evil by good gods' reckoning). This gives them the proper title if Invocations was their highest skill in life. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@9550 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/ghost.cc')
-rw-r--r--crawl-ref/source/ghost.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/crawl-ref/source/ghost.cc b/crawl-ref/source/ghost.cc
index 2b8048a426..5322114bc9 100644
--- a/crawl-ref/source/ghost.cc
+++ b/crawl-ref/source/ghost.cc
@@ -22,6 +22,7 @@ REVISION("$Rev$");
#include "mtransit.h"
#include "place.h"
#include "player.h"
+#include "religion.h"
#include <vector>
std::vector<ghost_demon> ghosts;
@@ -118,6 +119,7 @@ void ghost_demon::reset()
name.clear();
species = SP_UNKNOWN;
job = JOB_UNKNOWN;
+ religion = GOD_NO_GOD;
best_skill = SK_FIGHTING;
best_skill_level = 0;
xl = 0;
@@ -346,6 +348,10 @@ void ghost_demon::init_player_ghost()
species = you.species;
job = you.char_class;
+
+ // Ghosts can't worship good gods.
+ religion = is_good_god(you.religion) ? GOD_NO_GOD : you.religion;
+
best_skill = ::best_skill(SK_FIGHTING, (NUM_SKILLS - 1), 99);
best_skill_level = you.skills[best_skill];
xl = you.experience_level;