aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2018-10-13 11:21:16 -0700
committerH. Peter Anvin <hpa@zytor.com>2018-10-13 11:21:16 -0700
commit5fee94675a716e35b556bec7acc39ed5f601320d (patch)
tree5a77a9ff8ffd1072981470d0463687902bf30704
parent07ebce53997ff1f317b533ffd91e15f1b831c3e3 (diff)
downloadgrv-5fee94675a716e35b556bec7acc39ed5f601320d.tar.gz
grv-5fee94675a716e35b556bec7acc39ed5f601320d.tar.xz
grv-5fee94675a716e35b556bec7acc39ed5f601320d.zip
New mystery: Slow ghosts
Suggested-by: Erik Anvin
-rw-r--r--action.c1
-rw-r--r--grv.c1
-rw-r--r--mystery.c13
-rw-r--r--play.c4
4 files changed, 17 insertions, 2 deletions
diff --git a/action.c b/action.c
index 19f875c..746eaab 100644
--- a/action.c
+++ b/action.c
@@ -333,6 +333,7 @@ void handle_action(void)
case act_ghost_normal:
gp.FS = 1; /* Normal ghosts */
+ gp.FScnt = gp.FSdiv = 1; /* Full speed */
break;
}
}
diff --git a/grv.c b/grv.c
index b4fd7ee..718f202 100644
--- a/grv.c
+++ b/grv.c
@@ -53,6 +53,7 @@ void newlevel(void)
gp.Bar = 0;
gp.ChBd = gp.GkCh;
gp.FS = 1; /* Ghosts are not frozen or reversed */
+ gp.FScnt = gp.FSdiv = 1; /* Ghosts are at full speed */
/* 150 ms/step is the speed for level 0 */
gp.Speed = (150*ELev)/(gp.Level+ELev);
gp.Tid = 0.0;
diff --git a/mystery.c b/mystery.c
index 71b07dd..9b303db 100644
--- a/mystery.c
+++ b/mystery.c
@@ -21,7 +21,7 @@ void mystery(void)
again:
tlife = (6-gp.Life)*20;
- myst = irnd(1230+tlife) - tlife;
+ myst = irnd(1400+tlife) - tlife;
if ( myst < 0 ) {
/* Extra life */
@@ -100,7 +100,7 @@ void mystery(void)
message(0,"Treasure: *** SMASH ***");
addaction(0, 0, gp.Tid+5.0, act_smash);
- } else {
+ } else if ( myst < 1230 ) {
/* Scared ghosts */
if ( gp.FS != 1 )
goto again;
@@ -109,5 +109,14 @@ void mystery(void)
gp.FS = -1; /* Reverse direction */
addaction(0, 0, gp.Tid+80.0, act_ghost_normal);
+ } else {
+ /* Slow ghosts */
+ if ( gp.FS != 1 || gp.FSdiv != 1 )
+ goto again;
+
+ message(0, "Treasure: Slow ghosts");
+
+ gp.FScnt = gp.FSdiv = 2;
+ addaction(0, 0, gp.Tid+60.0, act_ghost_normal);
}
}
diff --git a/play.c b/play.c
index 612e150..9202750 100644
--- a/play.c
+++ b/play.c
@@ -565,6 +565,10 @@ static void move_ghosts(void)
if ( !gp.FS )
return; /* Don't change color on frozen ghosts */
+ if ( --gp.FScnt ) /* Slow ghosts? */
+ return;
+ gp.FScnt = gp.FSdiv;
+
/* ghost[e].dead can be 0 (live), 1 (dead), or -1 (nonexistent) */
for ( e = 0 ; e < MAXGHOST ; e++ ) {