The new ammo type described here is a missile. It requires that a new weapon, a Missile Launcher, is added to the game.
See the section on adding a new weapon about all on including the Missile Launcher, and the use of this and the missiles.
Some screenshots are the same in the add new weapon section and the add new ammo (this) section.
Including the missile as a new ammo type
Saving and loading the number of missiles held
Start by opening Wl_def.h
Scroll down to the gamestate structure, the portion shown below.

In the edited version below line 728 is added.
This gives us a new field in the gametype struct to keep track of the number of missiles held by the player.

Scroll further down in Wl_def.h till you get to this portion.

Two new functions - GiveMissile and DrawMissile - have been added to handle the new ammo.
See further down on writing the two new functions.

Now you have to write the two new functions, GiveMissile and DrawMissile, both in Wl_agent.c
See the two screenshots below.
This is the GiveMissile function.
Line 757 adds to the number of missiles.
Lines 759/760 make you able to carry a total of than 10 missiles.
Line 762 calls the DrawMissile function.
The many blank lines are of course unnecessary.

This is the DrawMissile function.
The numbers 32,16,3, (line 429) decide where on the status bar the number of missiles you have is drawn.
See the example further below.


The original status bar pic.

The status bar pic edited by using FloEdit and a paint program.

And here is the result.
The number of missiles you have are shown where the weapon icons used to be.
(Two extra keys are added too. See the editing bonus items section.)
The DrawWeapon function must be disabled (Wl_agent.c), since we use that space on the status bar for showing the number of missiles.
Lines 619-622 in the the screenshot below are commented out.
PLEASE NOTE! All lines calling the DrawWeapon function in all source code files must be commented out.
Search through all files for DrawWeapon!

This is the GiveWeapon function (Wl_agent.c) which I expanded. You see the Missile Launcher comes with two missiles (line 684).
There is more about this function in the new weapon section.


Then open Wl_game.c
First scroll down to the DrawPlayScreen function, a portion of it is shown below.

In this edited version line 897 is added.
Line 896 is commented out, see above about that.

Then scroll further down in Wl_game.c till you get to this portion of the Died function.

Again DrawMissile (); is added and DrawWeapon (); is commented out.
In addition line 1216 is added to the edited version. This makes you start a new life with 0 missiles.

Then open Wl_main.c and scroll down to the NewGame function.

Line 289 is added to the edited version. This makes you start a new game with 0 missiles.

To include the missile as an item to be picked you must find a bo_* for it.
I used bo_chalice. Shown below is how I edited it in the GetBonus section (Wl_agent.c)
This is fully described in the edit bonus items section.

Since I used a treasure I had to change the number of treasure items (Wl_act1.c), again see the edit bonus items section.
If another type of bo_* is used nothing has to be edited here.

Lines are added to the Wl_menu.c to have the number of missiles held, correctly saved and loaded.
See the 'Change by Po&' parts in the screenshots below.
(See also the section on adding the Missile Launcher.)






