Code Editing Tutorials
Giving Infinite Ammo when in God Mode

 

By: Bob Clift

 

this will give infinite ammo when in god mode:

 

in WL_AGENT.C look for this section:

 

case 1:

if (!gamestate.ammo)

{ // can only happen with chain gun

gamestate.attackframe++;

break;

}

GunAttack (ob);

gamestate.ammo--;

DrawAmmo ();

break;

 

comment it out (/*.......*/) and insert this:

 

case 1:

if (!gamestate.ammo)

{ // can only happen with chain gun

gamestate.attackframe++;

break;

}

else

 

if (godmode)

{

GunAttack (ob);

DrawAmmo ();

}

else

{

GunAttack (ob);

gamestate.ammo--;

DrawAmmo ();

};

break;

 

 

this will give infinite ammo in god mode....the ammo will not decrement when shooting but will increment if a clip is picked up. I searched the 'net for the infinite ammo tip and couldn't find anything so I wrote that myself.

 

Also, consider giving god both keys:

 

In WL_DEBUG.C add gamestate.keys ^= 3 to the section:

 

if (Keyboard[sc_G]) // G = god mode

{

CenterWindow (12,2);

if (godmode)

US_PrintCentered ("God mode OFF");

else

US_PrintCentered ("God mode ON");

VW_UpdateScreen();

IN_Ack();

godmode ^= 1;

gamestate.keys ^= 3;

DrawKeys ();

return 1;

}

 

Also, this is a good place to add the Noclip cheat, and it's really easy:

 

if (Keyboard[sc_G]) // G = god mode

{

CenterWindow (12,2);

if (godmode)

US_PrintCentered ("God mode OFF");

else

US_PrintCentered ("God mode ON");

VW_UpdateScreen();

IN_Ack();

godmode ^= 1;

noclip ^= 1;

gamestate.keys ^= 3;

DrawKeys ();

return 1;


 

Get back to the Dome tutorials
Jump to the top