Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Hardcode difficulty.

git-svn-id: svn+ssh://jay/var/svn/wolf/trunk@162 32837ae5-38f0-4cfd-8401-3ff76d8497c4
  • Loading branch information...
commit b4a2d4855151200ee46e91f83f67534656d2c05b 1 parent e2a26ae
paul authored
Showing with 49 additions and 42 deletions.
  1. +16 −16 wl_act2.c
  2. +1 −1  wl_agent.c
  3. +5 −0 wl_def.h
  4. +22 −22 wl_game.c
  5. +5 −3 wl_main.c
View
32 wl_act2.c
@@ -340,7 +340,7 @@ void SpawnStand (enemy_t which, myint tilex, myint tiley, myint dir)
}
new->obclass = guardobj+which;
- new->hitpoints = starthitpoints[gamestate.difficulty][which];
+ new->hitpoints = starthitpoints[gamestate_difficulty][which];
new->dir = dir*2;
new->flags |= FL_SHOOTABLE;
}
@@ -425,7 +425,7 @@ void SpawnPatrol (enemy_t which, myint tilex, myint tiley, myint dir)
new->obclass = guardobj+which;
new->dir = dir*2;
- new->hitpoints = starthitpoints[gamestate.difficulty][which];
+ new->hitpoints = starthitpoints[gamestate_difficulty][which];
new->distance = TILEGLOBAL;
new->flags |= FL_SHOOTABLE;
new->active = ac_yes;
@@ -835,7 +835,7 @@ void SpawnTrans (myint tilex, myint tiley)
SpawnNewObj(tilex,tiley,s_transstand);
new->obclass = transobj;
- new->hitpoints = starthitpoints[gamestate.difficulty][en_trans];
+ new->hitpoints = starthitpoints[gamestate_difficulty][en_trans];
new->flags |= FL_SHOOTABLE|FL_AMBUSH;
#ifdef ENABLE_STATS
if (!loadedgame)
@@ -864,7 +864,7 @@ void SpawnUber (myint tilex, myint tiley)
SpawnNewObj (tilex,tiley,s_uberstand);
new->obclass = uberobj;
- new->hitpoints = starthitpoints[gamestate.difficulty][en_uber];
+ new->hitpoints = starthitpoints[gamestate_difficulty][en_uber];
new->flags |= FL_SHOOTABLE|FL_AMBUSH;
#ifdef ENABLE_STATS
if (!loadedgame)
@@ -910,7 +910,7 @@ void SpawnWill(myint tilex, myint tiley)
SpawnNewObj (tilex,tiley,s_willstand);
new->obclass = willobj;
- new->hitpoints = starthitpoints[gamestate.difficulty][en_will];
+ new->hitpoints = starthitpoints[gamestate_difficulty][en_will];
new->flags |= FL_SHOOTABLE|FL_AMBUSH;
#ifdef ENABLE_STATS
if (!loadedgame)
@@ -1030,7 +1030,7 @@ void SpawnDeath(myint tilex, myint tiley)
SpawnNewObj (tilex,tiley,s_deathstand);
new->obclass = deathobj;
- new->hitpoints = starthitpoints[gamestate.difficulty][en_death];
+ new->hitpoints = starthitpoints[gamestate_difficulty][en_death];
new->flags |= FL_SHOOTABLE|FL_AMBUSH;
#ifdef ENABLE_STATS
if (!loadedgame)
@@ -1130,7 +1130,7 @@ void SpawnAngel(myint tilex, myint tiley)
SpawnNewObj (tilex,tiley,s_angelstand);
new->obclass = angelobj;
- new->hitpoints = starthitpoints[gamestate.difficulty][en_angel];
+ new->hitpoints = starthitpoints[gamestate_difficulty][en_angel];
new->flags |= FL_SHOOTABLE|FL_AMBUSH;
#ifdef ENABLE_STATS
if (!loadedgame)
@@ -1199,7 +1199,7 @@ void SpawnSpectre(myint tilex, myint tiley)
{
SpawnNewObj (tilex,tiley,s_spectrewait1);
new->obclass = spectreobj;
- new->hitpoints = starthitpoints[gamestate.difficulty][en_spectre];
+ new->hitpoints = starthitpoints[gamestate_difficulty][en_spectre];
new->flags |= FL_SHOOTABLE|FL_AMBUSH; // |FL_NEVERMARK|FL_NONMARK;
#ifdef ENABLE_STATS
if (!loadedgame)
@@ -1280,7 +1280,7 @@ void SpawnBoss (myint tilex, myint tiley)
new->speed = SPDPATROL;
new->obclass = bossobj;
- new->hitpoints = starthitpoints[gamestate.difficulty][en_boss];
+ new->hitpoints = starthitpoints[gamestate_difficulty][en_boss];
new->dir = south;
new->flags |= FL_SHOOTABLE|FL_AMBUSH;
#ifdef ENABLE_STATS
@@ -1303,7 +1303,7 @@ void SpawnGretel (myint tilex, myint tiley)
new->speed = SPDPATROL;
new->obclass = gretelobj;
- new->hitpoints = starthitpoints[gamestate.difficulty][en_gretel];
+ new->hitpoints = starthitpoints[gamestate_difficulty][en_gretel];
new->dir = north;
new->flags |= FL_SHOOTABLE|FL_AMBUSH;
#ifdef ENABLE_STATS
@@ -1370,7 +1370,7 @@ void SpawnSchabbs(myint tilex, myint tiley)
new->speed = SPDPATROL;
new->obclass = schabbobj;
- new->hitpoints = starthitpoints[gamestate.difficulty][en_schabbs];
+ new->hitpoints = starthitpoints[gamestate_difficulty][en_schabbs];
new->dir = south;
new->flags |= FL_SHOOTABLE|FL_AMBUSH;
#ifdef ENABLE_STATS
@@ -1401,7 +1401,7 @@ void SpawnGift (myint tilex, myint tiley)
new->speed = SPDPATROL;
new->obclass = giftobj;
- new->hitpoints = starthitpoints[gamestate.difficulty][en_gift];
+ new->hitpoints = starthitpoints[gamestate_difficulty][en_gift];
new->dir = north;
new->flags |= FL_SHOOTABLE|FL_AMBUSH;
#ifdef ENABLE_STATS
@@ -1432,7 +1432,7 @@ void SpawnFat (myint tilex, myint tiley)
new->speed = SPDPATROL;
new->obclass = fatobj;
- new->hitpoints = starthitpoints[gamestate.difficulty][en_fat];
+ new->hitpoints = starthitpoints[gamestate_difficulty][en_fat];
new->dir = south;
new->flags |= FL_SHOOTABLE|FL_AMBUSH;
#ifdef ENABLE_STATS
@@ -1820,7 +1820,7 @@ void SpawnFakeHitler(myint tilex, myint tiley)
new->speed = SPDPATROL;
new->obclass = fakeobj;
- new->hitpoints = starthitpoints[gamestate.difficulty][en_fake];
+ new->hitpoints = starthitpoints[gamestate_difficulty][en_fake];
new->dir = north;
new->flags |= FL_SHOOTABLE|FL_AMBUSH;
#ifdef ENABLE_STATS
@@ -1851,7 +1851,7 @@ void SpawnHitler(myint tilex, myint tiley)
new->speed = SPDPATROL;
new->obclass = mechahitlerobj;
- new->hitpoints = starthitpoints[gamestate.difficulty][en_hitler];
+ new->hitpoints = starthitpoints[gamestate_difficulty][en_hitler];
new->dir = south;
new->flags |= FL_SHOOTABLE|FL_AMBUSH;
#ifdef ENABLE_STATS
@@ -1884,7 +1884,7 @@ void A_HitlerMorph (objtype *ob)
new->flags = ob->flags | FL_SHOOTABLE;
new->obclass = realhitlerobj;
- new->hitpoints = hitpoints[gamestate.difficulty];
+ new->hitpoints = hitpoints[gamestate_difficulty];
}
View
2  wl_agent.c
@@ -317,7 +317,7 @@ void TakeDamage(myint points, objtype *attacker)
if (gamestate.victoryflag)
return;
- if (gamestate.difficulty==gd_baby)
+ if (gamestate_difficulty==gd_baby)
points>>=2;
#ifndef EMBEDDED
View
5 wl_def.h
@@ -660,7 +660,12 @@ enum PACKED {
typedef struct
{
+#ifndef EMBEDDED
+#define gamestate_difficulty gamestate.difficulty
myint difficulty;
+#else
+#define gamestate_difficulty gd_medium
+#endif
myint mapon;
long oldscore,score,nextextra;
myint lives;
View
44 wl_game.c
@@ -164,14 +164,14 @@ void ScanInfoPlane()
case 181:
case 182:
case 183:
- if (gamestate.difficulty<gd_hard)
+ if (gamestate_difficulty<gd_hard)
break;
tile -= 36;
case 144:
case 145:
case 146:
case 147:
- if (gamestate.difficulty<gd_medium)
+ if (gamestate_difficulty<gd_medium)
break;
tile -= 36;
case 108:
@@ -186,14 +186,14 @@ void ScanInfoPlane()
case 185:
case 186:
case 187:
- if (gamestate.difficulty<gd_hard)
+ if (gamestate_difficulty<gd_hard)
break;
tile -= 36;
case 148:
case 149:
case 150:
case 151:
- if (gamestate.difficulty<gd_medium)
+ if (gamestate_difficulty<gd_medium)
break;
tile -= 36;
case 112:
@@ -213,14 +213,14 @@ void ScanInfoPlane()
case 189:
case 190:
case 191:
- if (gamestate.difficulty<gd_hard)
+ if (gamestate_difficulty<gd_hard)
break;
tile -= 36;
case 152:
case 153:
case 154:
case 155:
- if (gamestate.difficulty<gd_medium)
+ if (gamestate_difficulty<gd_medium)
break;
tile -= 36;
case 116:
@@ -235,14 +235,14 @@ void ScanInfoPlane()
case 193:
case 194:
case 195:
- if (gamestate.difficulty<gd_hard)
+ if (gamestate_difficulty<gd_hard)
break;
tile -= 36;
case 156:
case 157:
case 158:
case 159:
- if (gamestate.difficulty<gd_medium)
+ if (gamestate_difficulty<gd_medium)
break;
tile -= 36;
case 120:
@@ -260,14 +260,14 @@ void ScanInfoPlane()
case 199:
case 200:
case 201:
- if (gamestate.difficulty<gd_hard)
+ if (gamestate_difficulty<gd_hard)
break;
tile -= 36;
case 162:
case 163:
case 164:
case 165:
- if (gamestate.difficulty<gd_medium)
+ if (gamestate_difficulty<gd_medium)
break;
tile -= 36;
case 126:
@@ -282,14 +282,14 @@ void ScanInfoPlane()
case 203:
case 204:
case 205:
- if (gamestate.difficulty<gd_hard)
+ if (gamestate_difficulty<gd_hard)
break;
tile -= 36;
case 166:
case 167:
case 168:
case 169:
- if (gamestate.difficulty<gd_medium)
+ if (gamestate_difficulty<gd_medium)
break;
tile -= 36;
case 130:
@@ -306,14 +306,14 @@ void ScanInfoPlane()
case 207:
case 208:
case 209:
- if (gamestate.difficulty<gd_hard)
+ if (gamestate_difficulty<gd_hard)
break;
tile -= 36;
case 170:
case 171:
case 172:
case 173:
- if (gamestate.difficulty<gd_medium)
+ if (gamestate_difficulty<gd_medium)
break;
tile -= 36;
case 134:
@@ -328,14 +328,14 @@ void ScanInfoPlane()
case 211:
case 212:
case 213:
- if (gamestate.difficulty<gd_hard)
+ if (gamestate_difficulty<gd_hard)
break;
tile -= 36;
case 174:
case 175:
case 176:
case 177:
- if (gamestate.difficulty<gd_medium)
+ if (gamestate_difficulty<gd_medium)
break;
tile -= 36;
case 138:
@@ -399,14 +399,14 @@ void ScanInfoPlane()
case 253:
case 254:
case 255:
- if (gamestate.difficulty<gd_hard)
+ if (gamestate_difficulty<gd_hard)
break;
tile -= 18;
case 234:
case 235:
case 236:
case 237:
- if (gamestate.difficulty<gd_medium)
+ if (gamestate_difficulty<gd_medium)
break;
tile -= 18;
case 216:
@@ -420,14 +420,14 @@ void ScanInfoPlane()
case 257:
case 258:
case 259:
- if (gamestate.difficulty<gd_hard)
+ if (gamestate_difficulty<gd_hard)
break;
tile -= 18;
case 238:
case 239:
case 240:
case 241:
- if (gamestate.difficulty<gd_medium)
+ if (gamestate_difficulty<gd_medium)
break;
tile -= 18;
case 220:
@@ -881,7 +881,7 @@ void PlayDemo(myint demonumber)
NewGame(1, 0);
gamestate.mapon = demoptr[0];
- gamestate.difficulty = gd_hard;
+ gamestate_difficulty = gd_hard;
length = demoptr[1] | (demoptr[2] << 8);
demoptr += 4;
@@ -928,7 +928,7 @@ myint PlayDemoFromFile(const char *demoname)
NewGame(1,0);
gamestate.mapon = demoptr[0];
- gamestate.difficulty = gd_hard;
+ gamestate_difficulty = gd_hard;
length = demoptr[1] | (demoptr[2] << 8);
demoptr += 4;
lastdemoptr = demoptr-4+length;
View
8 wl_main.c
@@ -418,7 +418,7 @@ myint SaveTheGame(const char *fn, const char *tag, myint dx, myint dy)
DiskFlopAnim(dx, dy);
- WriteInt32(fd, gamestate.difficulty);
+ WriteInt32(fd, gamestate_difficulty);
WriteInt32(fd, gamestate.mapon);
WriteInt32(fd, gamestate.oldscore);
WriteInt32(fd, gamestate.score);
@@ -655,7 +655,7 @@ myint LoadTheGame(const char *fn, myint dx, myint dy)
DiskFlopAnim(dx, dy);
- gamestate.difficulty = ReadInt32(fd);
+ gamestate_difficulty = ReadInt32(fd);
gamestate.mapon = ReadInt32(fd);
gamestate.oldscore = ReadInt32(fd);
gamestate.score = ReadInt32(fd);
@@ -1171,7 +1171,9 @@ void NewGame(myint difficulty, myint episode)
{
memset(&gamestate, 0, sizeof(gamestate));
- gamestate.difficulty = difficulty;
+#ifndef EMBEDDED
+ gamestate_difficulty = difficulty;
+#endif
gamestate.weapon = gamestate.bestweapon
= gamestate.chosenweapon = wp_pistol;
gamestate.health = 100;
Please sign in to comment.
Something went wrong with that request. Please try again.