Well, the items are assigned from the weapon the player uses (or rather, from the weapon's actor). Those items are a counter for a boost, one for each weapon. For instance, the
. Now, I'll show you the code of the latter. This is a system I used for all the other weapons. You can find
Code: Select all
ACTOR VeloxRifle : WeaponBase replaces Shotgun
{
Weapon.AmmoUse1 1
Weapon.AmmoGive1 8
Weapon.AmmoType1 "Shell"
Weapon.AmmoUse2 1
Weapon.AmmoGive2 0
Weapon.AmmoType2 "Shell"
States
{
WeaponReady:
Ready:
SHTG A 0 A_JumpIfInventory("IsMelee", 1, "Melee")
SHTG A 0 A_JumpIfInventory("IsBoost", 1, "Boost")
SHTG A 1 A_WeaponReady
Loop
Deselect:
SHTG A 0 A_Lower
SHTG A 1 A_Lower
Loop
Select:
SHTG A 0 A_Raise
SHTG A 1 A_Raise
Loop
Fire:
SHTG A 0 A_JumpIfInventory("VeloxBoost", 1, "BoostFire")
SHTG A 6 A_RailAttack(50, 0, 1, "#8ebfd1", "lightblue", RGF_NOPIERCING | RGF_FULLBRIGHT, 0, none, 0, 0, 10000, 12, 0.5, 1.5)
SHTG BC 5
SHTG D 4
SHTG CB 1
SHTG A 0 A_JumpIfInventory("IsBoost", 1, "Boost")
SHTG A 1 A_JumpIfInventory("IsMelee", 1, "Melee")
SHTG A 0 A_JumpIfInventory("IsBoost", 1, "Boost")
SHTG A 1 A_JumpIfInventory("IsMelee", 1, "Melee")
SHTG A 0 A_JumpIfInventory("IsBoost", 1, "Boost")
SHTG A 1 A_JumpIfInventory("IsMelee", 1, "Melee")
SHTG A 0 A_JumpIfInventory("IsBoost", 1, "Boost")
SHTG A 1 A_JumpIfInventory("IsMelee", 1, "Melee")
SHTG A 0 A_JumpIfInventory("IsBoost", 1, "Boost")
SHTG A 1 A_JumpIfInventory("IsMelee", 1, "Melee")
SHTG A 0 A_JumpIfInventory("IsBoost", 1, "Boost")
SHTG A 1 A_JumpIfInventory("IsMelee", 1, "Melee")
SHTG A 0 A_JumpIfInventory("IsBoost", 1, "Boost")
SHTG A 1 A_JumpIfInventory("IsMelee", 1, "Melee")
SHTG A 0 A_JumpIfInventory("IsBoost", 1, "Boost")
SHTG A 1 A_JumpIfInventory("IsMelee", 1, "Melee")
SHTG A 0 A_JumpIfInventory("IsBoost", 1, "Boost")
SHTG A 1 A_JumpIfInventory("IsMelee", 1, "Melee")
SHTG A 0 A_JumpIfInventory("IsBoost", 1, "Boost")
SHTG A 1 A_JumpIfInventory("IsMelee", 1, "Melee")
SHTG A 0 A_JumpIfInventory("IsBoost", 1, "Boost")
SHTG A 1 A_JumpIfInventory("IsMelee", 1, "Melee")
SHTG A 0 A_JumpIfInventory("IsBoost", 1, "Boost")
SHTG A 1 A_JumpIfInventory("IsMelee", 1, "Melee")
SHTG A 0 A_JumpIfInventory("IsBoost", 1, "Boost")
SHTG A 1 A_JumpIfInventory("IsMelee", 1, "Melee")
SHTG A 0 A_ReFire
Goto WeaponReady
BoostFire:
SHTG A 0 A_RailAttack(25, 0, 0, "none", "#ff6600", RGF_FULLBRIGHT, 0, none, 0, 0, 10000, 12, 0.5, 1.5)
SHTG A 6 A_RailAttack(50, 0, 1, "#ff9933", "none", RGF_NOPIERCING | RGF_FULLBRIGHT, 0, none, 0, 0, 10000, 12, 0.5, 1.5)
SHTG BC 5
SHTG D 4
SHTG CB 1
SHTG A 0 A_JumpIfInventory("IsBoost", 1, "Boost")
SHTG A 1 A_JumpIfInventory("IsMelee", 1, "Melee")
SHTG A 0 A_JumpIfInventory("IsBoost", 1, "Boost")
SHTG A 1 A_JumpIfInventory("IsMelee", 1, "Melee")
SHTG A 0 A_JumpIfInventory("IsBoost", 1, "Boost")
SHTG A 1 A_JumpIfInventory("IsMelee", 1, "Melee")
SHTG A 0 A_JumpIfInventory("IsBoost", 1, "Boost")
SHTG A 1 A_JumpIfInventory("IsMelee", 1, "Melee")
SHTG A 0 A_JumpIfInventory("IsBoost", 1, "Boost")
SHTG A 1 A_JumpIfInventory("IsMelee", 1, "Melee")
SHTG A 0 A_JumpIfInventory("IsBoost", 1, "Boost")
SHTG A 1 A_JumpIfInventory("IsMelee", 1, "Melee")
SHTG A 0 A_JumpIfInventory("IsBoost", 1, "Boost")
SHTG A 1 A_JumpIfInventory("IsMelee", 1, "Melee")
SHTG A 0 A_JumpIfInventory("IsBoost", 1, "Boost")
SHTG A 1 A_JumpIfInventory("IsMelee", 1, "Melee")
SHTG A 0 A_JumpIfInventory("IsBoost", 1, "Boost")
SHTG A 1 A_JumpIfInventory("IsMelee", 1, "Melee")
SHTG A 0 A_JumpIfInventory("IsBoost", 1, "Boost")
SHTG A 1 A_JumpIfInventory("IsMelee", 1, "Melee")
SHTG A 0 A_JumpIfInventory("IsBoost", 1, "Boost")
SHTG A 1 A_JumpIfInventory("IsMelee", 1, "Melee")
SHTG A 0 A_JumpIfInventory("IsBoost", 1, "Boost")
SHTG A 1 A_JumpIfInventory("IsMelee", 1, "Melee")
SHTG A 0 A_JumpIfInventory("IsBoost", 1, "Boost")
SHTG A 1 A_JumpIfInventory("IsMelee", 1, "Melee")
SHTG A 0 A_ReFire
Goto WeaponReady
AltFire:
SHTG A 0 A_JumpIfInventory("VeloxBoost", 1, "BoostAltFire")
SHTG A 0 A_FireCustomMissile("VeloxThrustProjectile", 0, 1)
SHTG A 15
SHTG A 0 A_JumpIfInventory("IsBoost", 1, "Boost")
SHTG A 1 A_JumpIfInventory("IsMelee", 1, "Melee")
SHTG A 0 A_JumpIfInventory("IsBoost", 1, "Boost")
SHTG A 1 A_JumpIfInventory("IsMelee", 1, "Melee")
SHTG A 0 A_JumpIfInventory("IsBoost", 1, "Boost")
SHTG A 1 A_JumpIfInventory("IsMelee", 1, "Melee")
SHTG A 0 A_JumpIfInventory("IsBoost", 1, "Boost")
SHTG A 1 A_JumpIfInventory("IsMelee", 1, "Melee")
SHTG A 0 A_JumpIfInventory("IsBoost", 1, "Boost")
SHTG A 1 A_JumpIfInventory("IsMelee", 1, "Melee")
SHTG A 0 A_JumpIfInventory("IsBoost", 1, "Boost")
SHTG A 1 A_JumpIfInventory("IsMelee", 1, "Melee")
SHTG A 0 A_JumpIfInventory("IsBoost", 1, "Boost")
SHTG A 1 A_JumpIfInventory("IsMelee", 1, "Melee")
SHTG A 0 A_JumpIfInventory("IsBoost", 1, "Boost")
SHTG A 1 A_JumpIfInventory("IsMelee", 1, "Melee")
SHTG A 0 A_JumpIfInventory("IsBoost", 1, "Boost")
SHTG A 1 A_JumpIfInventory("IsMelee", 1, "Melee")
SHTG A 0 A_JumpIfInventory("IsBoost", 1, "Boost")
SHTG A 1 A_JumpIfInventory("IsMelee", 1, "Melee")
SHTG A 0 A_JumpIfInventory("IsBoost", 1, "Boost")
SHTG A 1 A_JumpIfInventory("IsMelee", 1, "Melee")
SHTG A 0 A_JumpIfInventory("IsBoost", 1, "Boost")
SHTG A 1 A_JumpIfInventory("IsMelee", 1, "Melee")
SHTG A 0 A_JumpIfInventory("IsBoost", 1, "Boost")
SHTG A 1 A_JumpIfInventory("IsMelee", 1, "Melee")
SHTG A 0 A_ReFire
Goto WeaponReady
BoostAltFire:
SHTG A 0 A_FireCustomMissile("BoostVeloxThrustProjectile", 0, 1)
SHTG A 15
SHTG A 0 A_JumpIfInventory("IsBoost", 1, "Boost")
SHTG A 1 A_JumpIfInventory("IsMelee", 1, "Melee")
SHTG A 0 A_JumpIfInventory("IsBoost", 1, "Boost")
SHTG A 1 A_JumpIfInventory("IsMelee", 1, "Melee")
SHTG A 0 A_JumpIfInventory("IsBoost", 1, "Boost")
SHTG A 1 A_JumpIfInventory("IsMelee", 1, "Melee")
SHTG A 0 A_JumpIfInventory("IsBoost", 1, "Boost")
SHTG A 1 A_JumpIfInventory("IsMelee", 1, "Melee")
SHTG A 0 A_JumpIfInventory("IsBoost", 1, "Boost")
SHTG A 1 A_JumpIfInventory("IsMelee", 1, "Melee")
SHTG A 0 A_JumpIfInventory("IsBoost", 1, "Boost")
SHTG A 1 A_JumpIfInventory("IsMelee", 1, "Melee")
SHTG A 0 A_JumpIfInventory("IsBoost", 1, "Boost")
SHTG A 1 A_JumpIfInventory("IsMelee", 1, "Melee")
SHTG A 0 A_JumpIfInventory("IsBoost", 1, "Boost")
SHTG A 1 A_JumpIfInventory("IsMelee", 1, "Melee")
SHTG A 0 A_JumpIfInventory("IsBoost", 1, "Boost")
SHTG A 1 A_JumpIfInventory("IsMelee", 1, "Melee")
SHTG A 0 A_JumpIfInventory("IsBoost", 1, "Boost")
SHTG A 1 A_JumpIfInventory("IsMelee", 1, "Melee")
SHTG A 0 A_JumpIfInventory("IsBoost", 1, "Boost")
SHTG A 1 A_JumpIfInventory("IsMelee", 1, "Melee")
SHTG A 0 A_JumpIfInventory("IsBoost", 1, "Boost")
SHTG A 1 A_JumpIfInventory("IsMelee", 1, "Melee")
SHTG A 0 A_JumpIfInventory("IsBoost", 1, "Boost")
SHTG A 1 A_JumpIfInventory("IsMelee", 1, "Melee")
SHTG A 0 A_ReFire
Goto WeaponReady
Boost:
SHTG A 1 A_JumpIfInventory("BasicArmor", 30, 1)
Goto WeaponReady
PUNG A 0 A_TakeInventory("BasicArmor", 30)
PUNG B 18 A_PlaySound("DCCHARGE", 1)
PUNG B 0 A_GiveInventory("VeloxBoost", 350)
PUNG C 3 A_PlaySound("weapons/bfgx", 1)
Goto WeaponReady
Melee:
PUNG A 0 A_JumpIfInventory("SuperMeleeCounter", 0, 3)
PUNG A 0 A_JumpIfInventory("BasicArmor", 30, 1)
Goto FireMelee
PUNG A 0 A_GiveInventory("SuperMeleeCounter", 1)
PUNG A 0 A_JumpIfInventory("SuperMeleeCounter", 0, 2)
PUNG A 0 A_JumpIfInventory("SuperMeleeCounter", 1, 5)
PUNG A 0 A_JumpIfInventory("SuperMeleeBeepDone", 1, 4)
PUNG A 0 A_PlaySound("DCCHRGD", 1)
PUNG A 0 A_GiveInventory("SuperMeleeBeepDone", 1)
PUNG A 0 A_TakeInventory("BasicArmor", 30)
PUNG A 0 A_JumpIfInventory("SuperMeleeFirstDone", 1, 3)
PUNG A 0 A_PlaySound("DCCHARGE", 1, 2)
PUNG A 0 A_GiveInventory("SuperMeleeFirstDone", 1)
PUNG A 1
PUNG A 0 A_JumpIfInventory("IsMelee", 1, "Melee")
FireMelee:
PUNG A 0 A_JumpIfInventory("SuperMeleeCounter", 0, "SuperMelee")
PUNG B 0 A_StopSound(1)
PUNG B 1 A_Recoil((-5)*cos(pitch))
PUNG C 1
PUNG D 2 A_CustomPunch(25, true, 0, "BulletPuff", 70)
PUNG C 4
PUNG B 5
PUNG B 0 A_TakeInventory("SuperMeleeCounter", 0)
PUNG B 0 A_TakeInventory("SuperMeleeBeepDone", 0)
PUNG B 0 A_TakeInventory("SuperMeleeFirstDone", 0)
PUNG B 0 A_ReFire
Goto WeaponReady
SuperMelee:
PUNG B 0 A_PlaySound("weapons/bfgx", 1)
PUNG B 0 A_Recoil((-40)*cos(pitch))
PUNG B 0 ThrustThingZ(0, 150*sin(pitch), 1, 0) //https://forum.zdoom.org/viewtopic.php?f=3&t=15222
PUNG BCCDDDD 1 A_Explode(100, 100, XF_NOTMISSILE, true)
PUNG C 4
PUNG B 5
PUNG B 0 A_TakeInventory("SuperMeleeCounter", 0)
PUNG B 0 A_TakeInventory("SuperMeleeBeepDone", 0)
PUNG B 0 A_TakeInventory("SuperMeleeFirstDone", 0)
PUNG B 0 A_ReFire
Goto WeaponReady
Spawn:
SHOT A -1
Stop
}
}