summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/player.cc
diff options
context:
space:
mode:
authordshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2007-03-15 20:10:20 +0000
committerdshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2007-03-15 20:10:20 +0000
commit621bd9ce58cc45ce9cfcc3cf1f576882b40a426d (patch)
treeadc2b3b4faed06c535b2bec690cf362af40c7fa5 /crawl-ref/source/player.cc
parent83559fff8232481cbc68731b7527dd2154c0bd88 (diff)
downloadcrawl-ref-621bd9ce58cc45ce9cfcc3cf1f576882b40a426d.tar.gz
crawl-ref-621bd9ce58cc45ce9cfcc3cf1f576882b40a426d.zip
Cleaned up ghost and Pandemonium demon handling.
Can now have multiple ghosts or Pandemonium demons on a level. Ghosts and Pan demons can coexist. (D:9 and later are eligible for >1 ghost.) Enabled loading ghosts in Pandemonium. Pandemonium demons can now be created outside Pan. Not that you'd want to do it, but you can. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1043 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/player.cc')
-rw-r--r--crawl-ref/source/player.cc27
1 files changed, 22 insertions, 5 deletions
diff --git a/crawl-ref/source/player.cc b/crawl-ref/source/player.cc
index 7cccd7b502..611ca70bc5 100644
--- a/crawl-ref/source/player.cc
+++ b/crawl-ref/source/player.cc
@@ -1331,6 +1331,28 @@ int player_prot_life(bool calc_unid)
return (pl);
}
+// Returns the movement speed for a player ghost. Note that this is a real
+// speed, not a movement cost, so higher is better.
+int player_ghost_base_movement_speed()
+{
+ int speed = you.species == SP_NAGA? 8 : 10;
+
+ if (you.mutation[MUT_FAST])
+ speed += you.mutation[MUT_FAST] + 1;
+
+ if (player_equip_ego_type( EQ_BOOTS, SPARM_RUNNING ))
+ speed += 2;
+
+ // Cap speeds.
+ if (speed < 6)
+ speed = 6;
+
+ if (speed > 13)
+ speed = 13;
+
+ return (speed);
+}
+
// New player movement speed system... allows for a bit more that
// "player runs fast" and "player walks slow" in that the speed is
// actually calculated (allowing for centaurs to get a bonus from
@@ -4553,11 +4575,6 @@ void player::init()
num_gifts[i] = 0;
}
- ghost.name[0] = 0;
-
- for (int i = 0; i < NUM_GHOST_VALUES; i++)
- ghost.values[i] = 0;
-
for (int i = EQ_WEAPON; i < NUM_EQUIP; i++)
equip[i] = -1;