So i was starting to work on a regenerative shield for certain player classes dedicated to taking enemies more upfront with melee weapons or mean't to gain mobility out of explosion/self damage without over relying on medics and such. So me and a friend tried to get something to work aaaaaaand for some fucking reason it doesn't when we couldn't find anything wrong with the script.
I figured some people here might have better eyes than us so here's the items (the "ShieldWielder" is mean't to be an inventory exclusive to characters with regenerative shields, and characters without it does not get regenerative shields)
Code: Select all
ACTOR Shield : BasicArmorPickup
{
Inventory.Icon "ARM1A0"
Armor.SavePercent 100.0
Armor.SaveAmount 100
States
{
Spawn:
TNT1 A 0
stop
}
}
ACTOR ShieldBit : Shield
{
Inventory.Icon "ARM1A0"
Armor.SavePercent 100.0
Armor.SaveAmount 1
}
Actor ShieldWielder : CustomInventory
{
inventory.maxamount 1
}
Code: Select all
ACTOR ShieldPlayer : DoomPlayer
{
Speed 1
Health 100
Radius 16
Height 56
Mass 100
PainChance 255
Player.StartItem "Shield"
Player.StartItem "ShieldWielder", 1
Player.DisplayName "ShieldMarine"
Player.StartItem "Chainsaw"
Player.ColorRange 112, 127
}
Code: Select all
ACS_NamedExecuteAlways("ShieldRegen", 0);
Code: Select all
script "ShieldRegen" (void)
{
int ArmorChecki = Checkinventory("Armor");
int OldArmor;
delay (1);
if (Checkinventory("ShieldWielder") >= 1)
{
if (OldArmor == ArmorChecki)
{
giveinventory("ShieldBit", 1);
delay (15);
}
else
{
delay (3*35);
OldArmor = ArmorChecki;
}
restart;
}
else
Terminate;
}