header general

Losing ammo when you lose armor

  • Ultimate Freedoomer
  • Ultimate Freedoomer's Avatar Topic Author
  • Wraith
  • Wraith
More
6 years 5 months ago - 6 years 5 months ago #1 by Ultimate Freedoomer
Losing ammo when you lose armor was created by Ultimate Freedoomer
I'm working on recreating the Energy Armor from Quake 2 in a more accurate form than the tech armor currently on the repository, with the following differences:
  • Can be deactivated & activated at will
  • Takes 1 Energy Cell for every armor point lost when damage is taken (instead of taking a set amount of cells when activated from the inventory)
  • When used, gives an amount of armor points equivalent to the player's current amount of cells (backpack withstanding)
Here's the ACS for damage taking in its current form (thanks to the Blood Amulet for the base):
#library "EnergyArmor.acs"
#include "zcommon.acs"

Script "EnergyArmor" (void)
{
int oldhealthEnergyarmor = GetActorProperty(0, APROP_Health);
While(CheckInventory("Cell"))
{
// Calculate damage taken
int sustaineddamageEnergyarmor = oldhealthEnergyarmor - GetActorProperty(0, APROP_Health);
If(sustaineddamageEnergyarmor) // If player sustained damage, take cells...
{
TakeInventory("Cell", sustaineddamageEnergyarmor * GetAmmoCapacity("Cell") / 100);
}
oldhealthEnergyarmor = GetActorProperty(0, APROP_Health);
Delay(1);
}
}
As it is, you don't start losing cells until you take damage. How do I fix this & add the additional features in the above bullet list?
Last edit: 6 years 5 months ago by Ultimate Freedoomer. Reason: Fixed markup error

Please Log in or Create an account to join the conversation.