inform Attack by Victor Gijsbers

ok, I downloaded and installed the extension: “Inform-Attack” by Victor Gijsbers. A excellent extension for me as it gives detailed control over many different combat aspects.

I wrote a small combat test game to try out code without having to compile my larger main project over and over.

I’m having a problem with coding the reloading of a weapon. The 77 pg help text doesn’t seem to suggest how to code what types/calibur of ammunition fit into what calibur weapon. Or how to prevent a player from reloading a weapon when the player is not carrying extra ammunition. Obviously I wouldn’t want to allow a player to put shotgun shells into a .22 pistol or want them to pull ammunition out of the air to load into the weapon.

any suggestions on how to write this? Even locations of any examples online would help.

Here is what I have so far for the test room code:

[spoiler]“Combat Test room” by Dodo

Include the Plurality by Emily Short

Include Inform Attack by Victor Gijsbers.

The Square room is a room.

The description of the Square room is
“A bland square room. The walls, floor, and ceiling are made of concrete. There is a single light screwed in a socket which dangles from the ceiling. There is a table against one wall”

The player has a number called permanent health. The player has a number called current health. The player has a number called defense.

The permanent health of the player is 100.
The melee of the player is 5.
The defense of the player is 2.

A table is in the square room. The table is a supporter. The table is scenery.

A box is on the table. The box is a container. The box is scenery. The box is opaque. The box is closed and openable.

The description of the box is
“A Highly poilshed, black box made of wood.”

The description of the table is
“A sturdy looking oak table. The varnish has been stripped away leaving bare wood. On the table is a box.”.

A Firearm is a kind of Weapon.

A Pistol is a kind of Firearm.

A Colt M1911A1 is a pistol.
Maximum shots of the Colt M1911A1 is 8.
Current shots of the Colt M1911A1 is 0.
Damage die of the Colt M1911A1 is 8.
Dodgability of the Colt M1911A1 is 2.
Active parry max of the Colt M1911A1 is 0.
Passive parry max of the Colt M1911A1 is 0.
Weapon attack bonus of the Colt M1911A1 is 2.
Maximum load time of the Colt M1911A1 is 1.
Current load time of the Colt M1911A1 is 0.

A Colt M1911A1 is in the box.

The description of the Colt M1911A1 is
“A handgun similar to the ones carried by soldiers in WWII. It can hold 8 rounds of .45 calibur ACP.”

South of the Square room is the Oval room.

A person has a number called permanent health. A person has a number called current health. A person has a number called defense.

Jack is a person.
The permanent health of Jack is 20.
The melee of Jack is 2.
The defense of Jack is 1.
Jack is hostile.

Jack is in the Oval room.[/spoiler]

Create a relation between firearms and their respective ammunition.
Then create a reloading action, applying to two carried items (the gun and the related bullets).

Then upon running out of bullets, if you like, you can have the player automatically try to reload.

For simplicity, you might have a number tied to the ammo and assume the player reloads appropriately like many video games do, and when bullets are gone they’re gone.

I’ll give it a shot. Might take a while to get back to it because of work, but thank you for the tip :slight_smile:

Ammunition is not implemented in standard ATTACK, but is definitely a plug-in I’m willing to write in the future. Tell me if you still need it.