1.Sitting guard than in Western Wall 1 with 8 direction
2.Dark making weapon than in Batman No Man‘s Land
3.Ambient sound than in Batman VS Bane or Project:Eisenritter
4.Drugs than in The Lost Relic (54-100%:damage,1-53%:health giving)
A friendly Wolfenstein 3D community, about Wolfenstein 3D, the game that gave birth to first person shooters...
namespace Drug
{
statetype s_idle = {false,SPR_DEMO,0,NULL,NULL,&s_idle};
statetype s_effect = {false,SPR_DEMO,30,NULL,(statefunc)A_Effect,&s_effect};
void A_Effect(objtype *ob)
{
TakeDamage(10 + (US_RndT() % 10));
}
void Spawn(void)
{
SpawnNewObj(0, 0, &s_idle);
newobj->active = ac_yes;
newobj->flags |= FL_NEVERMARK;
}
void A_Start(objtype *ob)
{
NewState(ob, &s_effect);
}
void A_Stop(objtype *ob)
{
NewState(ob, &s_idle);
}
}
namespace Ambient
{
statetype s_delay = {false,SPR_DEMO,240,NULL,(statefunc)A_Play,&s_delay};
void A_Play(objtype *ob)
{
if (US_RndT() < 32)
{
SD_PlaySound (AMBIENTSND);
}
}
void Spawn(void)
{
SpawnNewObj(0, 0, &s_delay);
newobj->active = ac_yes;
newobj->flags |= FL_NEVERMARK;
}
}
namespace Ambient
{
statetype s_delay = {false,SPR_DEMO,240,NULL,(statefunc)A_Play,&s_delay};
void A_Play(objtype *ob)
{
if (US_RndT() < 32)
{
SD_PlaySound (AMBIENTSND);
}
}
void Spawn(void)
{
SpawnNewObj(0, 0, &s_delay);
newobj->active = ac_yes;
newobj->flags |= FL_NEVERMARK;
}
bool CheckLevel(void)
{
return gamestate.mapon == 1;
}
}
void InitActorList (void)
{
int i;
//
// init the actor lists
//
memset(objlist, 0, sizeof(objlist));
objcount = 0;
lastobjindex = 0;
//
// give the player the first free spots
//
GetNewActor ();
player = newobj;
if (Ambient::CheckLevel())
{
Ambient::Spawn();
}
Drug::Spawn();
}
extern statetype s_grdsit;
extern statetype s_grdpath1;
extern statetype s_grdpath1s;
extern statetype s_grdpath2;
extern statetype s_grdpath3;
extern statetype s_grdpath3s;
extern statetype s_grdpath4;
extern statetype s_grdpain;
extern statetype s_grdpain1;
extern statetype s_grdgiveup;
extern statetype s_grdshoot1;
extern statetype s_grdshoot2;
extern statetype s_grdshoot3;
extern statetype s_grdshoot4;
extern statetype s_grdchase1;
extern statetype s_grdchase1s;
extern statetype s_grdchase2;
extern statetype s_grdchase3;
extern statetype s_grdchase3s;
extern statetype s_grdchase4;
extern statetype s_grddie1;
extern statetype s_grddie1d;
extern statetype s_grddie2;
extern statetype s_grddie3;
extern statetype s_grddie4;
statetype s_grdsit = {false,SPR_GRD_SIT_1,0,(statefunc)T_Stand,NULL,&s_grdsit};
statetype s_grdpath1 = {true,SPR_GRD_W1_1,20,(statefunc)T_Path,NULL,&s_grdpath1s};
statetype s_grdpath1s = {true,SPR_GRD_W1_1,5,NULL,NULL,&s_grdpath2};
statetype s_grdpath2 = {true,SPR_GRD_W2_1,15,(statefunc)T_Path,NULL,&s_grdpath3};
statetype s_grdpath3 = {true,SPR_GRD_W3_1,20,(statefunc)T_Path,NULL,&s_grdpath3s};
statetype s_grdpath3s = {true,SPR_GRD_W3_1,5,NULL,NULL,&s_grdpath4};
statetype s_grdpath4 = {true,SPR_GRD_W4_1,15,(statefunc)T_Path,NULL,&s_grdpath1};
statetype s_grdpain = {2,SPR_GRD_PAIN_1,10,NULL,NULL,&s_grdchase1};
statetype s_grdpain1 = {2,SPR_GRD_PAIN_2,10,NULL,NULL,&s_grdchase1};
statetype s_grdshoot1 = {false,SPR_GRD_SHOOT1,20,NULL,NULL,&s_grdshoot2};
statetype s_grdshoot2 = {false,SPR_GRD_SHOOT2,20,NULL,(statefunc)T_Shoot,&s_grdshoot3};
statetype s_grdshoot3 = {false,SPR_GRD_SHOOT3,20,NULL,NULL,&s_grdchase1};
statetype s_grdchase1 = {true,SPR_GRD_W1_1,10,(statefunc)T_Chase,NULL,&s_grdchase1s};
statetype s_grdchase1s = {true,SPR_GRD_W1_1,3,NULL,NULL,&s_grdchase2};
statetype s_grdchase2 = {true,SPR_GRD_W2_1,8,(statefunc)T_Chase,NULL,&s_grdchase3};
statetype s_grdchase3 = {true,SPR_GRD_W3_1,10,(statefunc)T_Chase,NULL,&s_grdchase3s};
statetype s_grdchase3s = {true,SPR_GRD_W3_1,3,NULL,NULL,&s_grdchase4};
statetype s_grdchase4 = {true,SPR_GRD_W4_1,8,(statefunc)T_Chase,NULL,&s_grdchase1};
statetype s_grddie1 = {false,SPR_GRD_DIE_1,15,NULL,(statefunc)A_DeathScream,&s_grddie2};
statetype s_grddie2 = {false,SPR_GRD_DIE_2,15,NULL,NULL,&s_grddie3};
statetype s_grddie3 = {false,SPR_GRD_DIE_3,15,NULL,NULL,&s_grddie4};
statetype s_grddie4 = {false,SPR_GRD_DEAD,0,NULL,NULL,&s_grddie4};
void SpawnStand (enemy_t which, int tilex, int tiley, int dir)
{
word *map;
word tile;
switch (which)
{
case en_guard:
SpawnNewObj (tilex,tiley,&s_grdsit);
newobj->speed = SPDPATROL;
if (!loadedgame)
gamestate.killtotal++;
break;
extern statetype s_grdstand;
extern statetype s_grdsit;
statetype s_grdstand = {true,SPR_GRD_S_1,0,(statefunc)T_Stand,NULL,&s_grdstand};
statetype s_grdsit = {true,SPR_GRD_SIT_1,0,(statefunc)T_Stand,NULL,&s_grdsit};
void SpawnStand (enemy_t which, int tilex, int tiley, int dir)
{
const bool isSitting = ((tilex + tiley) & 1) != 0;
switch (which)
{
case en_guard:
SpawnNewObj (tilex,tiley,
isSitting ? &s_grdsit : &s_grdstand);
newobj->speed = SPDPATROL;
if (!loadedgame)
gamestate.killtotal++;
break;
}
// ...
}
void T_Stand (objtype *ob)
{
if (SightPlayer (ob))
{
const bool isSitting = ((ob->tilex + ob->tiley) & 1) != 0;
if (isSitting)
{
PlaceItemType(bo_chair, ob->tilex, ob->tiley);
}
}
}
void TakeDamage (int points,objtype *attacker)
{
int hpoints;
LastAttacker = attacker;
if (gamestate.victoryflag) return;
if (gamestate.difficulty==gd_baby) points>>=2;
if (!godmode)
{
if (gamestate.armor >=1)
{
hpoints = (gamestate.armor * points) / 100;
points -= hpoints;
gamestate.armor -=hpoints;
if (gamestate.armor < 0 ) gamestate.armor = 0;
DrawWeapon (); // Your routine to update armors value on status bar
}
gamestate.health -= points;
StartDamageFlash (points);
}
if (gamestate.health<=0)
{
gamestate.health = 0;
playstate = ex_died;
killerobj = attacker;
}
if (godmode != 2)
StartDamageFlash (points);
DrawHealth ();
DrawFace ();
//
// MAKE BJ'S EYES BUG IF MAJOR DAMAGE!
//
#ifdef SPEAR
if (points > 30 && gamestate.health!=0 && !godmode && viewsize != 21)
{
StatusDrawFace(BJOUCHPIC);
facecount = 0;
}
#endif
}
void TakeDamage (int points,objtype *attacker)
{
int damage;
LastAttacker = attacker;
if (gamestate.victoryflag)
return;
if (gamestate.difficulty==gd_baby)
{
if (points != 0)
{
points = (points >= 4 ? points >> 2 : 1);
}
}
if (!godmode)
{
if (gamestate.armor > 0)
{
const int ARMOR_PROTECTION = 65;
if (points >= gamestate.armor)
{
gamestate.health -= (gamestate.armor * (100 - ARMOR_PROTECTION)) / 100;
points -= gamestate.armor;
gamestate.armor = 0;
}
else // points < gamestate.armor
{
damage = (points * (100 - ARMOR_PROTECTION)) / 100;
damage = (damage > 0 ? damage : 1);
gamestate.health -= damage;
gamestate.armor -= points;
points = 0;
}
DrawScore (); // draws armor
gamestate.health -= points;
}
else
{
gamestate.health -= points;
}
}
if (gamestate.health<=0)
{
gamestate.health = 0;
playstate = ex_died;
killerobj = attacker;
}
if (godmode != 2)
{
StartDamageFlash (points);
}
DrawHealth ();
DrawFace ();
//
// MAKE BJ'S EYES BUG IF MAJOR DAMAGE!
//
#ifdef SPEAR
if (points > 30 && gamestate.health!=0 && !godmode && viewsize < 21)
{
StatusDrawFace(BJOUCHPIC);
facecount = 0;
}
#endif
}
/*
===================
=
= PlayLoop
=
===================
*/
int32_t funnyticount;
void PlayLoop (void)
{
#if defined(USE_FEATUREFLAGS) && defined(USE_CLOUDSKY)
if(GetFeatureFlags() & FF_CLOUDSKY)
InitSky();
#endif
#ifdef USE_SHADING
InitLevelShadeTable();
#endif
playstate = ex_stillplaying;
lasttimecount = GetTimeCount();
frameon = 0;
anglefrac = 0;
facecount = 0;
funnyticount = 0;
memset (buttonstate, 0, sizeof (buttonstate));
ClearPaletteShifts ();
if (MousePresent && IN_IsInputGrabbed())
IN_CenterMouse(); // Clear accumulated mouse movement
if (demoplayback)
IN_StartAck ();
do
{
PollControls ();
//
// actor thinking
//
madenoise = false;
MoveDoors ();
MovePWalls ();
for (obj = player; obj; obj = obj->next)
DoActor (obj);
UpdatePaletteShifts ();
ThreeDRefresh ();
//
// MAKE FUNNY FACE IF BJ DOESN'T MOVE FOR AWHILE
//
#ifdef SPEAR
funnyticount += tics;
if (funnyticount > 30l * 70)
{
funnyticount = 0;
if(viewsize != 21)
StatusDrawFace(BJWAITING1PIC + (US_RndT () & 1));
facecount = 0;
}
#endif
gamestate.TimeCount += tics;
UpdateSoundLoc (); // JAB
if (screenfaded)
VW_FadeIn ();
CheckKeys ();
//
// debug aids
//
if (singlestep)
{
VW_WaitVBL (singlestep);
lasttimecount = GetTimeCount();
}
if (extravbls)
VW_WaitVBL (extravbls);
if (demoplayback)
{
if (IN_CheckAck ())
{
IN_ClearKeysDown ();
playstate = ex_abort;
}
}
}
while (!playstate && !startgame);
if (playstate != ex_died)
FinishPaletteShifts ();
}
//
// ambient sound
//
namespace Ambient
{
statetype s_delay = {false,SPR_DEMO,240,NULL,(statefunc)A_Play,&s_delay};
void A_Play(objtype *ob)
{
if (US_RndT() < 32)
{
SD_PlaySound (DEATHSCREAM4SND);
}
}
void Spawn(void)
{
SpawnNewObj(0, 0, &s_delay);
newobj->active = ac_yes;
newobj->flags |= FL_NEVERMARK;
}
bool CheckLevel(void)
{
return gamestate.episode == 0 && mapon == 0;
}
}
void InitActorList (void)
{
int i;
//
// init the actor lists
//
memset(objlist, 0, sizeof(objlist));
objcount = 0;
lastobjindex = 0;
//
// give the player the first free spots
//
GetNewActor ();
player = newobj;
if (Ambient::CheckLevel())
{
Ambient::Spawn();
}
}
namespace Ambient
{
void A_Play(objtype *ob);
statetype s_delay = {false,SPR_DEMO,240,NULL,(statefunc)A_Play,&s_delay};
void A_Play(objtype *ob)
{
if (US_RndT() < 32)
{
SD_PlaySound (AMBIENTSND);
}
}
void Spawn(void)
{
SpawnNewObj(0, 0, &s_delay);
newobj->active = ac_yes;
newobj->flags |= FL_NEVERMARK;
}
bool CheckLevel(void)
{
return gamestate.mapon == 1;
}
}
void InitActorList (void)
{
int i;
//
// init the actor lists
//
memset(objlist, 0, sizeof(objlist));
objcount = 0;
//
// give the player the first free spots
//
GetNewActor ();
player = newobj;
if (Ambient::CheckLevel())
{
Ambient::Spawn();
}
Drug::Spawn();
}
if (Ambient::CheckLevel())
{
Ambient::Spawn();
}
Drug::Spawn();
namespace Ambient
{
void Spawn(void);
bool CheckLevel(void);
}
/*
===================
=
= PlayLoop
=
===================
*/
int32_t funnyticount;
int32_t ambientcount;
void PlayLoop (void)
{
#if defined(USE_FEATUREFLAGS) && defined(USE_CLOUDSKY)
if(GetFeatureFlags() & FF_CLOUDSKY)
InitSky();
#endif
#ifdef USE_SHADING
InitLevelShadeTable();
#endif
playstate = ex_stillplaying;
lasttimecount = GetTimeCount();
frameon = 0;
anglefrac = 0;
facecount = 0;
funnyticount = 0;
memset (buttonstate, 0, sizeof (buttonstate));
ClearPaletteShifts ();
if (MousePresent && IN_IsInputGrabbed())
IN_CenterMouse(); // Clear accumulated mouse movement
if (demoplayback)
IN_StartAck ();
do
{
PollControls ();
//
// actor thinking
//
madenoise = false;
MoveDoors ();
MovePWalls ();
for (obj = player; obj; obj = obj->next)
DoActor (obj);
UpdatePaletteShifts ();
ThreeDRefresh ();
//
// MAKE FUNNY FACE IF BJ DOESN'T MOVE FOR AWHILE
//
#ifdef SPEAR
funnyticount += tics;
if (funnyticount > 30l * 70)
{
funnyticount = 0;
if(viewsize != 21)
StatusDrawFace(BJWAITING1PIC + (US_RndT () & 1));
facecount = 0;
}
#endif
//
// PLAY AMBIENT SOUNDS DURING PARTICULAR LEVELS
//
if (gamestate.episode == 0 && mapon == 0)
ambientcount += tics;
if(ambientcount >= 30l*70) // every second
{
ambientcount = 0;
{
int sounds[3]=
{
AIRPLANESND,
WOLFHOWLSND,
};
if (!SD_SoundPlaying())
PlaySoundLocGlobal ((sounds[US_RndT()%2]),player->tilex,player->tiley);
}
break;
if (gamestate.episode == 0 && mapon == 6)
ambientcount += tics;
if(ambientcount >= 30l*70) // every second
{
ambientcount = 0;
if (!SD_SoundPlaying())
SD_PlaySound(SEWERSND);
}
break;
if (gamestate.episode == 0 && mapon == 9)
ambientcount += tics;
if(ambientcount >= 15l*70) // every second
{
ambientcount = 0;
if (!SD_SoundPlaying())
SD_PlaySound(SCHABBSHASND);
}
}
gamestate.TimeCount += tics;
UpdateSoundLoc (); // JAB
if (screenfaded)
VW_FadeIn ();
CheckKeys ();
//
// debug aids
//
if (singlestep)
{
VW_WaitVBL (singlestep);
lasttimecount = GetTimeCount();
}
if (extravbls)
VW_WaitVBL (extravbls);
if (demoplayback)
{
if (IN_CheckAck ())
{
IN_ClearKeysDown ();
playstate = ex_abort;
}
}
}
while (!playstate && !startgame);
if (playstate != ex_died)
FinishPaletteShifts ();
}