Browse Source

various weapons refactoring

master
Alison Watson 2 months ago
parent
commit
26bc680dea
63 changed files with 457 additions and 315 deletions
  1. BIN
      pk7/acs/lithmain.bin
  2. +2
    -2
      pk7/lzscript/1_Marine/1_Fist.zsc
  3. +7
    -7
      pk7/lzscript/1_Marine/2_Pistol.zsc
  4. +2
    -2
      pk7/lzscript/1_Marine/2_Revolver.zsc
  5. +2
    -2
      pk7/lzscript/1_Marine/3_2_SuperShotgun.zsc
  6. +2
    -2
      pk7/lzscript/1_Marine/3_LazShotgun.zsc
  7. +6
    -6
      pk7/lzscript/1_Marine/3_Shotgun.zsc
  8. +11
    -11
      pk7/lzscript/1_Marine/4_CombatRifle.zsc
  9. +2
    -2
      pk7/lzscript/1_Marine/4_SniperRifle.zsc
  10. +7
    -7
      pk7/lzscript/1_Marine/5_RocketLauncher.zsc
  11. +7
    -7
      pk7/lzscript/1_Marine/6_PlasmaRifle.zsc
  12. +11
    -11
      pk7/lzscript/1_Marine/7_OmegaCannon.zsc
  13. +2
    -2
      pk7/lzscript/2_CyberMage/1_CFist.zsc
  14. +3
    -3
      pk7/lzscript/2_CyberMage/2_Mateba.zsc
  15. +6
    -6
      pk7/lzscript/2_CyberMage/3_2_SPAS.zsc
  16. +5
    -5
      pk7/lzscript/2_CyberMage/3_ShockRifle.zsc
  17. +8
    -8
      pk7/lzscript/2_CyberMage/4_SMG.zsc
  18. +4
    -4
      pk7/lzscript/2_CyberMage/5_IonRifle.zsc
  19. +3
    -3
      pk7/lzscript/2_CyberMage/6_CPlasmaRifle.zsc
  20. +4
    -4
      pk7/lzscript/2_CyberMage/7_StarDestroyer.zsc
  21. +2
    -2
      pk7/lzscript/2_CyberMage/Magic/1_Blade.zsc
  22. +2
    -2
      pk7/lzscript/2_CyberMage/Magic/2_Delear.zsc
  23. +2
    -2
      pk7/lzscript/2_CyberMage/Magic/3_Feuer.zsc
  24. +2
    -2
      pk7/lzscript/2_CyberMage/Magic/4_Rend.zsc
  25. +2
    -2
      pk7/lzscript/2_CyberMage/Magic/5_Hulgyon.zsc
  26. +2
    -2
      pk7/lzscript/2_CyberMage/Magic/6_StarShot.zsc
  27. +2
    -2
      pk7/lzscript/2_CyberMage/Magic/7_Cercle.zsc
  28. +2
    -2
      pk7/lzscript/3_Informant/2_Flintlock.zsc
  29. +2
    -2
      pk7/lzscript/5_Assassin/0_Weapon.zsc
  30. +2
    -2
      pk7/lzscript/5_Assassin/2_DualPistols.zsc
  31. +2
    -2
      pk7/lzscript/5_Assassin/4_BurstRifle.zsc
  32. +2
    -2
      pk7/lzscript/6_DarkLord/0_Weapon.zsc
  33. +2
    -2
      pk7/lzscript/6_DarkLord/2_700Express.zsc
  34. +2
    -2
      pk7/lzscript/6_DarkLord/3_4Bore.zsc
  35. +2
    -2
      pk7/lzscript/6_DarkLord/3_ShrapnelGun.zsc
  36. +5
    -2
      pk7/lzscript/6_DarkLord/4_Minigun.zsc
  37. +2
    -2
      pk7/lzscript/6_DarkLord/5_DualRocket.zsc
  38. +2
    -2
      pk7/lzscript/6_DarkLord/6_FatMac.zsc
  39. +2
    -2
      pk7/lzscript/6_DarkLord/7_FortuneGun.zsc
  40. +2
    -2
      pk7/lzscript/7_Thoth/3_RiotShotgun.zsc
  41. +2
    -2
      pk7/lzscript/7_Thoth/5_RedRifle.zsc
  42. +1
    -0
      pk7/lzscript/Constants/p_player.zsc
  43. +1
    -1
      pk7/lzscript/Effects/BulletPuff.zsc
  44. +1
    -1
      pk7/lzscript/Items/DivisionSigil.zsc
  45. +3
    -5
      pk7/lzscript/Player/Base.zsc
  46. +2
    -2
      pk7/lzscript/Player/Bobbing.zsc
  47. +1
    -1
      pk7/lzscript/Playsim/Weapons.zsc
  48. +2
    -2
      pk7/lzscript/Projectiles/Explosive.zsc
  49. +3
    -3
      pk7/lzscript/Projectiles/RifleBullet.zsc
  50. +14
    -11
      pk7/lzscript/Utilities.zsc
  51. +5
    -5
      pk7/lzscript/Weapons/1_ChargeFist.zsc
  52. +2
    -2
      pk7/lzscript/Weapons/5_MissileLauncher.zsc
  53. +2
    -2
      pk7/lzscript/Weapons/6_PlasmaDiffuser.zsc
  54. +127
    -15
      pk7/lzscript/Weapons/Base.zsc
  55. +2
    -2
      pk7/lzscript/Weapons/OutcastsWeapon.zsc
  56. +2
    -2
      pk7/lzscript/Weapons/Sword.zsc
  57. +2
    -2
      pk7/lzscript/Weapons/Wings.zsc
  58. +0
    -1
      source/include/common.h
  59. +0
    -2
      source/include/m_stab.h
  60. +1
    -0
      source/include/p_player.h
  61. +145
    -106
      source/p_items.c
  62. +0
    -11
      source/p_render.c
  63. +2
    -3
      source/w_data.c

BIN
pk7/acs/lithmain.bin View File


+ 2
- 2
pk7/lzscript/1_Marine/1_Fist.zsc View File

@@ -71,11 +71,11 @@ Ready:
loop;

Deselect:
TNT1 A 0 A_Lower;
TNT1 A 0 Lith_A_Lower(_raise_instant);
loop;

Select:
TNT1 A 0 A_Raise;
TNT1 A 0 Lith_A_Raise(_raise_instant);
loop;

Fire: goto _KnifeStart;


+ 7
- 7
pk7/lzscript/1_Marine/2_Pistol.zsc View File

@@ -129,19 +129,19 @@ override double, double GetFirePattern()

action(Weapon) void Lith_A_FirePistol()
{
if(ACS_ExecuteWithResult(lsc_pdata, pdata_upgrade, UPGR_PlasPistol))
if(Lith_UTIL.pData(self, pdata_upgrade, UPGR_PlasPistol))
{
A_StartSound("weapons/pistol/plasma/fire", lch_weapon);
A_FireProjectile("Lith_PlasmaPistolShot");
return;
}

if(ACS_ExecuteWithResult(lsc_pdata, pdata_upgrade, UPGR_AutoPistol))
if(Lith_UTIL.pData(self, pdata_upgrade, UPGR_AutoPistol))
Lith_FixedBullets(1, 24);
else
Lith_FireBullets(0, 0, -1, 24, FBF_NORANDOM);

if(ACS_ExecuteWithResult(lsc_pdata, pdata_upgrade, UPGR_AutoPistol))
if(Lith_UTIL.pData(self, pdata_upgrade, UPGR_AutoPistol))
A_StartSound("weapons/pistol/fireauto", lch_weapon);
else
A_StartSound("weapons/pistol/fire", lch_weapon);
@@ -162,12 +162,12 @@ Ready:
Deselect:
MARP A 0 Lith_A_ScopeOut;
DeselectLoop:
MARP A 1 A_Lower(18);
MARP A 1 Lith_A_Lower(_raise_fast);
loop;

Select:
MARP A 0 Lith_A_ScopeOut;
MARP A 1 A_Raise(18);
MARP A 1 Lith_A_Raise(_raise_fast);
wait;

Fire:
@@ -182,7 +182,7 @@ FireFinish_Unscoped:
MARP E 1 bright offset(0, 45);
MARP E 1 bright offset(0, 40);
MARP C 1 offset(0, 36);
MARP A 0 A_JumpIf(ACS_ExecuteWithResult(lsc_pdata, pdata_upgrade, UPGR_AutoPistol), "FireFinish_Auto_Unscoped");
MARP A 0 A_JumpIf(Lith_UTIL.pData(self, pdata_upgrade, UPGR_AutoPistol), "FireFinish_Auto_Unscoped");
MARP B 2 offset(0, 32) A_WeaponReady(WRF_ALLOWRELOAD);
MARP AAAAA 1 A_WeaponReady(WRF_ALLOWRELOAD);
goto ReadySelector;
@@ -192,7 +192,7 @@ FireFinish_Auto_Unscoped:
goto FireFinish_Auto_Scoped;
FireFinish_Scoped:
SCOP B 5 bright;
SCOP B 0 A_JumpIf(ACS_ExecuteWithResult(lsc_pdata, pdata_upgrade, UPGR_AutoPistol), "FireFinish_Auto_Scoped");
SCOP B 0 A_JumpIf(Lith_UTIL.pData(self, pdata_upgrade, UPGR_AutoPistol), "FireFinish_Auto_Scoped");
SCOP BBBBB 1 A_WeaponReady(WRF_ALLOWRELOAD | WRF_NOBOB);
goto ReadySelector;
FireFinish_Auto_Scoped:


+ 2
- 2
pk7/lzscript/1_Marine/2_Revolver.zsc View File

@@ -41,10 +41,10 @@ Ready:
loop;

Deselect:
REVO A 1 A_Lower(18);
REVO A 1 Lith_A_Lower(_raise_fast);
loop;
Select:
REVO A 1 A_Raise(18);
REVO A 1 Lith_A_Raise(_raise_fast);
loop;

Fire:


+ 2
- 2
pk7/lzscript/1_Marine/3_2_SuperShotgun.zsc View File

@@ -65,11 +65,11 @@ Ready:
loop;

Deselect:
SSGG A 1 A_Lower(12);
SSGG A 1 Lith_A_Lower(_raise_normal);
loop;

Select:
SSGG A 1 A_Raise(12);
SSGG A 1 Lith_A_Raise(_raise_normal);
loop;

FireEmpty:


+ 2
- 2
pk7/lzscript/1_Marine/3_LazShotgun.zsc View File

@@ -80,11 +80,11 @@ Ready:
loop;

Deselect:
LSHT A 1 A_Lower(18);
LSHT A 1 Lith_A_Lower(_raise_fast);
loop;

Select:
LSHT A 1 A_Raise(18);
LSHT A 1 Lith_A_Raise(_raise_fast);
loop;

Fire:


+ 6
- 6
pk7/lzscript/1_Marine/3_Shotgun.zsc View File

@@ -111,7 +111,7 @@ action(Weapon) void Lith_A_FireShotgun()
Lith_A_GunSmoke();
A_FireProjectile("Lith_LightProjectileRedLong", 0);

if(ACS_ExecuteWithResult(lsc_pdata, pdata_upgrade, UPGR_PoisonShot))
if(Lith_UTIL.pData(self, pdata_upgrade, UPGR_PoisonShot))
{
Lith_FixedBullets(8, 10, pufftype: "Lith_PoisonBullet");
A_StartSound("weapons/shotgun/poison/fire", lch_weapon);
@@ -148,7 +148,7 @@ AltReady:
loop;
Ready:
SHTG A 0 {if(invoker.m_Just) invoker.m_Just--;}
SHTG A 0 A_JumpIf(ACS_ExecuteWithResult(lsc_pdata, pdata_upgrade, UPGR_GaussShotty), "ReadyGauss");
SHTG A 0 A_JumpIf(Lith_UTIL.pData(self, pdata_upgrade, UPGR_GaussShotty), "ReadyGauss");
SHTG A 1 Lith_A_Ready(WRF_ALLOWRELOAD);
loop;
ReadyGauss:
@@ -158,18 +158,18 @@ ReadyGauss:
Deselect:
SHTG A 0 Lith_A_ScopeOut;
DeselectLoop:
SHTG A 1 A_Lower(18);
SHTG A 1 Lith_A_Lower(_raise_fast);
loop;

Select:
SHTG A 0 Lith_A_ScopeOut;
SHTG A 0 {invoker.m_Just = 3;}
SHTG A 1 A_Raise(18);
SHTG A 1 Lith_A_Raise(_raise_fast);
wait;

Fire:
#### # 0 Lith_A_JumpIfNoSlot3OptAmmo;
#### # 0 A_JumpIf(ACS_ExecuteWithResult(lsc_pdata, pdata_upgrade, UPGR_GaussShotty), "FireGauss");
#### # 0 A_JumpIf(Lith_UTIL.pData(self, pdata_upgrade, UPGR_GaussShotty), "FireGauss");
#### # 0 Lith_A_FireShotgun;
#### # 0 A_JumpIfInventory("Lith_WeaponScopedToken", 1, "FireFinish_Rail_Scoped");
FireFinish_Rail_Unscoped:
@@ -239,7 +239,7 @@ AltFire:
goto ReadySelector;

Reload:
#### # 0 A_JumpIf(!ACS_ExecuteWithResult(lsc_pdata, pdata_upgrade, UPGR_GaussShotty), "ReadySelector");
#### # 0 A_JumpIf(!Lith_UTIL.pData(self, pdata_upgrade, UPGR_GaussShotty), "ReadySelector");
#### # 0 Lith_A_JumpIfMagFull;
SHTG N 2 Lith_A_ScopeOut;
SHTG F 0 Lith_A_ReloadBobUp(0.2);


+ 11
- 11
pk7/lzscript/1_Marine/4_CombatRifle.zsc View File

@@ -140,9 +140,9 @@ action(Weapon) void Lith_A_FireRifle()
A_GunFlash("DummyFlash");
Lith_A_RecoilUp(0.4);
A_FireProjectile("Lith_LightProjectileRedShort", 0);
if(!ACS_ExecuteWithResult(lsc_pdata, pdata_upgrade, UPGR_LaserRCW))
if(!Lith_UTIL.pData(self, pdata_upgrade, UPGR_LaserRCW))
{
if(ACS_ExecuteWithResult(lsc_pdata, pdata_upgrade, UPGR_7777777))
if(Lith_UTIL.pData(self, pdata_upgrade, UPGR_7777777))
A_StartSound("marathon/rifle/fire", lch_weapon);
else
{
@@ -175,7 +175,7 @@ action(Weapon) void Lith_A_FireRifleBurst()
A_GunFlash("DummyFlash");
for(int i = 0; i < 2; i++)
{
if(!ACS_ExecuteWithResult(lsc_pdata, pdata_upgrade, UPGR_LaserRCW))
if(!Lith_UTIL.pData(self, pdata_upgrade, UPGR_LaserRCW))
{
A_StartSound("weapons/rifle/firesnipe", lch_weapon);
Lith_FireBullets(0, 0, -3, 1, FBF_NORANDOM, "Lith_RifleBullet");
@@ -191,7 +191,7 @@ action(Weapon) void Lith_A_FireRifleBurst()
action(Weapon) void Lith_A_FireRifleGrenade()
{
invoker.m_GrenFire = true;
if(ACS_ExecuteWithResult(lsc_pdata, pdata_upgrade, UPGR_7777777))
if(Lith_UTIL.pData(self, pdata_upgrade, UPGR_7777777))
A_StartSound("marathon/rifle/grenade", lch_weapon);
else
A_StartSound("weapons/rifle/grenade", lch_weapon);
@@ -206,18 +206,18 @@ Ready:
loop;

Deselect:
CRFG A 1 A_Lower(18);
CRFG A 1 Lith_A_Lower(_raise_fast);
loop;

Select:
CRFG A 0 ACS_ScriptCall("Lith_ResetRifleMode");
SelectLoop:
CRFG A 1 A_Raise(18);
CRFG A 1 Lith_A_Raise(_raise_fast);
loop;

Fire:
CRFG A 0 A_JumpIf(ACS_ExecuteWithResult(lsc_pdata, pdata_riflemode) == rifle_firemode_burst, "FireBurstStart");
CRFG A 0 A_JumpIf(ACS_ExecuteWithResult(lsc_pdata, pdata_riflemode) == rifle_firemode_grenade, "FireGrenade");
CRFG A 0 A_JumpIf(Lith_UTIL.pData(self, pdata_riflemode) == rifle_firemode_burst, "FireBurstStart");
CRFG A 0 A_JumpIf(Lith_UTIL.pData(self, pdata_riflemode) == rifle_firemode_grenade, "FireGrenade");
CRFG A 0 Lith_A_JumpIfMagEmpty;
CRFG B 1 bright Lith_A_FireRifle;
CRFG C 1 bright Lith_A_RecoilDn(0.35);
@@ -236,7 +236,7 @@ FireBurst:
loop;
FireBurstDone:
CRFG A 4;
CRFG A 2 A_JumpIf(!ACS_ExecuteWithResult(lsc_pdata, pdata_upgrade, UPGR_LaserRCW), 2);
CRFG A 2 A_JumpIf(!Lith_UTIL.pData(self, pdata_upgrade, UPGR_LaserRCW), 2);
CRFG AAAAAA 1 A_Refire;
goto ReadySelector;
FireGrenade:
@@ -249,7 +249,7 @@ FireGrenade:
goto ReadySelector;
GrenadeReload:
CRFG A 1 offset(1, 32) {
if(ACS_ExecuteWithResult(lsc_pdata, pdata_upgrade, UPGR_7777777))
if(Lith_UTIL.pData(self, pdata_upgrade, UPGR_7777777))
A_StartSound("marathon/rifle/reload", lch_reload);
else
A_StartSound("weapons/rifle/rldmount", lch_reload);
@@ -299,7 +299,7 @@ FireEmpty:
goto ReadySelector;

AltFire:
#### # 0 A_JumpIf(ACS_ExecuteWithResult(lsc_pdata, pdata_upgrade, UPGR_RifleModes), "SwitchMode");
#### # 0 A_JumpIf(Lith_UTIL.pData(self, pdata_upgrade, UPGR_RifleModes), "SwitchMode");
goto FireGrenade;
SwitchMode:
CRFG A 0 ACS_ScriptCall("Lith_SwitchRifleFiremode", 0);


+ 2
- 2
pk7/lzscript/1_Marine/4_SniperRifle.zsc View File

@@ -87,13 +87,13 @@ Ready:

Deselect:
SNPG A 0 Lith_A_ScopeOut;
SNPG A 1 A_Lower(18);
SNPG A 1 Lith_A_Lower(_raise_fast);
wait;

Select:
SNPG A 0 Lith_A_ScopeOut;
SelectLoop:
SNPG A 1 A_Raise(18);
SNPG A 1 Lith_A_Raise(_raise_fast);
loop;

Fire:


+ 7
- 7
pk7/lzscript/1_Marine/5_RocketLauncher.zsc View File

@@ -127,10 +127,10 @@ Ready:
loop;

Deselect:
GRLG A 1 A_Lower(18);
GRLG A 1 Lith_A_Lower(_raise_fast);
loop;
Select:
GRLG A 1 A_Raise(18);
GRLG A 1 Lith_A_Raise(_raise_fast);
loop;

Fire:
@@ -139,8 +139,8 @@ Fire:
GRLG A 0 {
invoker.m_Loaded = invoker.m_Iter = invoker.m_Mode = 0;
}
GRLG A 0 A_JumpIf(ACS_ExecuteWithResult(lsc_pdata, pdata_upgrade, UPGR_ChargeRPG), "FireUnreal");
GRLG A 0 A_JumpIf(ACS_ExecuteWithResult(lsc_pdata, pdata_upgrade, UPGR_HomingRPG), "FireHoming");
GRLG A 0 A_JumpIf(Lith_UTIL.pData(self, pdata_upgrade, UPGR_ChargeRPG), "FireUnreal");
GRLG A 0 A_JumpIf(Lith_UTIL.pData(self, pdata_upgrade, UPGR_HomingRPG), "FireHoming");
GRLG A 0 Lith_A_FireRocket;
FireAnim:
GRLG B 1 bright A_GunFlash;
@@ -178,11 +178,11 @@ Flash:

AltFire:
GRLG A 1;
GRLG A 0 A_JumpIf(ACS_ExecuteWithResult(lsc_pdata, pdata_upgrade, UPGR_HomingRPG), "Ready");
GRLG A 0 A_JumpIf(Lith_UTIL.pData(self, pdata_upgrade, UPGR_HomingRPG), "Ready");
GRLG A 0 A_JumpIf(CountInv("Lith_RocketAmmo") == 0, "FireEmpty");
GRLG A 0 {
if(ACS_ExecuteWithResult(lsc_pdata, pdata_upgrade, UPGR_ChargeRPG)) Lith_A_FireRocket();
else Lith_A_FireGrenade();
if(Lith_UTIL.pData(self, pdata_upgrade, UPGR_ChargeRPG)) Lith_A_FireRocket();
else Lith_A_FireGrenade();
}
goto FireAnim;
FireHoming:


+ 7
- 7
pk7/lzscript/1_Marine/6_PlasmaRifle.zsc View File

@@ -72,7 +72,7 @@ action(Weapon) void Lith_A_FireLaser()
self.TakeInventory("Lith_PlasmaAmmo", 10, notakeinfinite: true);
A_AlertMonsters();
A_FireBullets(0, 0, 1, 0, "Lith_PlasmaHit", FBF_NORANDOMPUFFZ);
A_RailAttack(ACS_ExecuteWithResult(lsc_pdata, pdata_upgrade, UPGR_TorgueMode) ? 1 : 12, 0, false, "", "Red", RGF_SILENT|RGF_FULLBRIGHT|RGF_NOPIERCING, 0, "Lith_Dummy", 0, 0, 0, 1, 3, 0, "Lith_PlasmaLaze");
A_RailAttack(Lith_UTIL.pData(self, pdata_upgrade, UPGR_TorgueMode) ? 1 : 12, 0, false, "", "Red", RGF_SILENT|RGF_FULLBRIGHT|RGF_NOPIERCING, 0, "Lith_Dummy", 0, 0, 0, 1, 3, 0, "Lith_PlasmaLaze");
A_FireProjectile("Lith_LightProjectileRedShort", 0);
}

@@ -111,16 +111,16 @@ Ready:
Deselect:
PLSG A 0 {A_StopSound(lch_weapon2); A_StopSound(lch_weapon3);}
DeselectLoop:
PLSG A 1 A_Lower(18);
PLSG A 1 Lith_A_Lower(_raise_fast);
loop;

Select:
PLSG A 1 A_Raise(18);
PLSG A 1 Lith_A_Raise(_raise_fast);
loop;

Fire:
PLSG A 0 A_JumpIf(ACS_ExecuteWithResult(lsc_pdata, pdata_upgrade, UPGR_PlasLaser), "FireLaser");
PLSG A 0 A_JumpIf(ACS_ExecuteWithResult(lsc_pdata, pdata_upgrade, UPGR_PartBeam), "FireParticleBeam");
PLSG A 0 A_JumpIf(Lith_UTIL.pData(self, pdata_upgrade, UPGR_PlasLaser), "FireLaser");
PLSG A 0 A_JumpIf(Lith_UTIL.pData(self, pdata_upgrade, UPGR_PartBeam), "FireParticleBeam");
FireReal:
PLSG A 0 A_JumpIf(CountInv("Lith_PlasmaAmmo") == 0, "FireEmpty");
PLSJ A 1 offset(0, 37) bright Lith_A_FirePlasma;
@@ -194,8 +194,8 @@ FireEmpty:
goto ReadySelector;

AltFire:
PLSG A 0 A_JumpIf(ACS_ExecuteWithResult(lsc_pdata, pdata_upgrade, UPGR_PlasLaser), "FireReal");
PLSG A 0 A_JumpIf(ACS_ExecuteWithResult(lsc_pdata, pdata_upgrade, UPGR_PartBeam), "FireReal");
PLSG A 0 A_JumpIf(Lith_UTIL.pData(self, pdata_upgrade, UPGR_PlasLaser), "FireReal");
PLSG A 0 A_JumpIf(Lith_UTIL.pData(self, pdata_upgrade, UPGR_PartBeam), "FireReal");
#### # 0 A_JumpIf(CountInv("Lith_PlasmaAmmo") == 0, "FireEmpty");
PLSK A 1 offset(0, 37) bright Lith_A_FireAltPlasma;
PLSK C 1 offset(0, 36) bright;


+ 11
- 11
pk7/lzscript/1_Marine/7_OmegaCannon.zsc View File

@@ -90,30 +90,30 @@ AltReady:
loop;
Ready:
CNNG A 0 {self.TakeInventory("Lith_GTFO", 999);}
DCNG A 0 A_JumpIf(ACS_ExecuteWithResult(lsc_pdata, pdata_upgrade, UPGR_DarkCannon), 2);
DCNG A 0 A_JumpIf(Lith_UTIL.pData(self, pdata_upgrade, UPGR_DarkCannon), 2);
CNNG A 0;
#### A 1 Lith_A_Ready;
loop;

Deselect:
DCNG A 0 A_JumpIf(ACS_ExecuteWithResult(lsc_pdata, pdata_upgrade, UPGR_DarkCannon), 2);
DCNG A 0 A_JumpIf(Lith_UTIL.pData(self, pdata_upgrade, UPGR_DarkCannon), 2);
CNNG A 0;
#### A 0 Lith_A_ScopeOut;
DeselectLoop:
#### A 1 A_Lower(18);
#### A 1 Lith_A_Lower(_raise_slow);
loop;

Select:
DCNG A 0 A_JumpIf(ACS_ExecuteWithResult(lsc_pdata, pdata_upgrade, UPGR_DarkCannon), 2);
DCNG A 0 A_JumpIf(Lith_UTIL.pData(self, pdata_upgrade, UPGR_DarkCannon), 2);
CNNG A 0;
#### A 0 Lith_A_ScopeOut;
#### A 1 A_Raise(12);
#### A 1 Lith_A_Raise(_raise_slow);
wait;

Fire:
#### A 0 A_JumpIf(ACS_ExecuteWithResult(lsc_pdata, pdata_upgrade, UPGR_OmegaRail), "FireRail");
#### A 0 A_JumpIf(ACS_ExecuteWithResult(lsc_pdata, pdata_upgrade, UPGR_PunctCannon), "FirePunct");
#### A 0 A_JumpIf(ACS_ExecuteWithResult(lsc_pdata, pdata_upgrade, UPGR_DarkCannon), "FireDark");
#### A 0 A_JumpIf(Lith_UTIL.pData(self, pdata_upgrade, UPGR_OmegaRail), "FireRail");
#### A 0 A_JumpIf(Lith_UTIL.pData(self, pdata_upgrade, UPGR_PunctCannon), "FirePunct");
#### A 0 A_JumpIf(Lith_UTIL.pData(self, pdata_upgrade, UPGR_DarkCannon), "FireDark");
#### A 0 A_JumpIf(CountInv("Lith_CannonAmmo") < 1, "FireEmpty");
CNNG C 1 bright offset(0, 48);
CNNG C 1 bright offset(0, 57) Lith_A_FireCannonSmall;
@@ -232,9 +232,9 @@ LoadAnim:
goto ReadySelector;

AltFire:
#### A 0 A_JumpIf(ACS_ExecuteWithResult(lsc_pdata, pdata_upgrade, UPGR_OmegaRail), "Ready");
#### A 0 A_JumpIf(ACS_ExecuteWithResult(lsc_pdata, pdata_upgrade, UPGR_DarkCannon), "Ready");
#### A 0 A_JumpIf(ACS_ExecuteWithResult(lsc_pdata, pdata_upgrade, UPGR_PunctCannon), "ScopeToggle");
#### A 0 A_JumpIf(Lith_UTIL.pData(self, pdata_upgrade, UPGR_OmegaRail), "Ready");
#### A 0 A_JumpIf(Lith_UTIL.pData(self, pdata_upgrade, UPGR_DarkCannon), "Ready");
#### A 0 A_JumpIf(Lith_UTIL.pData(self, pdata_upgrade, UPGR_PunctCannon), "ScopeToggle");
#### A 0 A_JumpIf(CountInv("Lith_CannonAmmo") < 2, "FireEmpty");
CNNG A 10 A_StartSound("weapons/cannon/prepare", lch_weapon2);
CNNG A 1 bright;


+ 2
- 2
pk7/lzscript/2_CyberMage/1_CFist.zsc View File

@@ -30,12 +30,12 @@ Ready:

Deselect:
TNT1 A 20 A_StartSound("weapons/delear/close", lch_weapon);
TNT1 A 0 A_Lower;
TNT1 A 0 Lith_A_Lower(_raise_instant);
wait;

Select:
TNT1 A 20 A_StartSound("weapons/delear/open", lch_weapon);
TNT1 A 0 A_Raise;
TNT1 A 0 Lith_A_Raise(_raise_instant);
wait;

Fire:


+ 3
- 3
pk7/lzscript/2_CyberMage/2_Mateba.zsc View File

@@ -150,7 +150,7 @@ action(Weapon) State Lith_A_FireMateba()
A_GunFlash("DummyFlash");
if(invoker.m_Fired & 1)
Lith_A_Casing("Lith_CasSmallHot", 14, 2, 32, frandom(1,2), frandom(3,5), frandom(2,3));
if(ACS_ExecuteWithResult(lsc_pdata, pdata_upgrade, UPGR_Mateba_A) && invoker.Lith_MagEmpty())
if(Lith_UTIL.pData(self, pdata_upgrade, UPGR_Mateba_A) && invoker.Lith_MagEmpty())
return ResolveState("Finalize");
Lith_A_RecoilDn(0.2);
Lith_FireBullets(2, 2, -1, 30, FBF_NORANDOM);
@@ -177,10 +177,10 @@ Ready:
loop;

Deselect:
MTBG A 1 A_Lower(18);
MTBG A 1 Lith_A_Lower(_raise_fast);
loop;
Select:
MTBG A 1 A_Raise(18);
MTBG A 1 Lith_A_Raise(_raise_fast);
loop;

Fire:


+ 6
- 6
pk7/lzscript/2_CyberMage/3_2_SPAS.zsc View File

@@ -110,7 +110,7 @@ action(Weapon) State Lith_A_FireSPAS()
{
self.TakeInventory("Lith_ShellAmmo", 1, notakeinfinite: true);
Lith_A_Casing("Lith_CasShellHot", 30, 6, 20, FRandom(3,4), FRandom(7,8), FRandom(7,9));
if(!ACS_ExecuteWithResult(lsc_pdata, pdata_upgrade, UPGR_SPAS_B))
if(!Lith_UTIL.pData(self, pdata_upgrade, UPGR_SPAS_B))
Lith_A_MagIncr();
/* don't ask */
if(Pos.Z - FloorZ >= 24) {
@@ -121,12 +121,12 @@ action(Weapon) State Lith_A_FireSPAS()
A_Recoil(0.7);
Lith_A_RecoilUp(0.4);
A_Light(1);
if(ACS_ExecuteWithResult(lsc_pdata, pdata_upgrade, UPGR_SPAS_A))
if(Lith_UTIL.pData(self, pdata_upgrade, UPGR_SPAS_A))
return ResolveState("FireVoid");
Lith_FireBullets(10.5, 3.5, 12, 6);
Lith_A_GunSmoke();
A_FireProjectile("Lith_LightProjectileRedLong", 0);
if(ACS_ExecuteWithResult(lsc_pdata, pdata_upgrade, UPGR_SPAS_B))
if(Lith_UTIL.pData(self, pdata_upgrade, UPGR_SPAS_B))
return ResolveState("FireAuto");
A_StartSound("weapons/cshotgun/fire", lch_weapon);
return null;
@@ -153,11 +153,11 @@ Ready:
loop;

Deselect:
CSHG A 1 A_Lower(18);
CSHG A 1 Lith_A_Lower(_raise_fast);
loop;

Select:
CSHG A 1 A_Raise(18);
CSHG A 1 Lith_A_Raise(_raise_fast);
loop;

Fire:
@@ -205,7 +205,7 @@ FireEmpty:
goto ReadySelector;

Reload:
CSHG A 0 A_JumpIf(ACS_ExecuteWithResult(lsc_pdata, pdata_upgrade, UPGR_SPAS_B), "Ready");
CSHG A 0 A_JumpIf(Lith_UTIL.pData(self, pdata_upgrade, UPGR_SPAS_B), "Ready");
CSHG A 0 Lith_A_JumpIfMagFull;
CSHR ABCDE 1;
CSHR FG 2;


+ 5
- 5
pk7/lzscript/2_CyberMage/3_ShockRifle.zsc View File

@@ -167,7 +167,7 @@ class Lith_ShockPuff : Lith_BulletPuff
A_StartSound("weapons/erifle/zap", lch_body);
A_SpawnItemEx("Lith_ShockEffect");
}
TNT1 A 0 A_JumpIf(ACS_ExecuteWithResult(lsc_pdata, pdata_upgrade, UPGR_ShockRif_A, true), "Charged");
TNT1 A 0 A_JumpIf(Lith_UTIL.pData(target, pdata_upgrade, UPGR_ShockRif_A), "Charged");
goto Super::Spawn;
Melee:
Spawn:
@@ -176,9 +176,9 @@ class Lith_ShockPuff : Lith_BulletPuff
A_StartSound("weapons/erifle/zap", lch_body);
A_SpawnItemEx("Lith_ShockEffect");
}
TNT1 A 0 A_JumpIf(ACS_ExecuteWithResult(lsc_pdata, pdata_upgrade, UPGR_ShockRif_B, true), "Binding");
TNT1 A 0 A_JumpIf(Lith_UTIL.pData(target, pdata_upgrade, UPGR_ShockRif_B), "Binding");
TNT1 A 0 Lith_A_Shock;
TNT1 A 0 A_JumpIf(ACS_ExecuteWithResult(lsc_pdata, pdata_upgrade, UPGR_ShockRif_A, true), "Charged");
TNT1 A 0 A_JumpIf(Lith_UTIL.pData(target, pdata_upgrade, UPGR_ShockRif_A), "Charged");
stop;
Charged:
TNT1 A 0 A_SpawnItemEx("Lith_ShockEffect2", flags: SXF_TRANSFERPOINTERS|SXF_NOCHECKPOSITION);
@@ -243,11 +243,11 @@ Ready:
loop;

Deselect:
CSRG A 1 A_Lower(18);
CSRG A 1 Lith_A_Lower(_raise_fast);
loop;

Select:
CSRG A 1 A_Raise(18);
CSRG A 1 Lith_A_Raise(_raise_fast);
loop;

Fire:


+ 8
- 8
pk7/lzscript/2_CyberMage/4_SMG.zsc View File

@@ -180,7 +180,7 @@ action(Weapon) void Lith_A_FireSMG()
double spx = invoker.m_Recoil * FRandom(-5, 5);
double spy = invoker.m_Recoil * FRandom(-1, 1);

if(ACS_ExecuteWithResult(lsc_pdata, pdata_upgrade, UPGR_SMG_B))
if(Lith_UTIL.pData(self, pdata_upgrade, UPGR_SMG_B))
A_FireProjectile("Lith_SMGTracer3", spx, pitch: spy);
else
Lith_FireBullets(spx, spy, -1, 8, FBF_NORANDOM|FBF_EXPLICITANGLE);
@@ -194,8 +194,8 @@ states(Weapon)
{
Ready:
CSMG A 0 {
if(ACS_ExecuteWithResult(lsc_pdata, pdata_upgrade, UPGR_SMG_A)) invoker.m_Max = 150;
else invoker.m_Max = 50;
if(Lith_UTIL.pData(self, pdata_upgrade, UPGR_SMG_A)) invoker.m_Max = 150;
else invoker.m_Max = 50;
}
CSMG A 1 Lith_A_Ready(WRF_ALLOWRELOAD|WRF_ALLOWUSER1);
loop;
@@ -203,22 +203,22 @@ Ready:
Deselect:
CSMG A 0 A_StopSound(lch_weapon);
DeselectLoop:
CSMG A 1 A_Lower(18);
CSMG A 1 Lith_A_Lower(_raise_fast);
loop;

Select:
CSMG A 1 A_Raise(18);
CSMG A 1 Lith_A_Raise(_raise_fast);
loop;

Fire:
CSMG A 0 A_JumpIfInventory("Lith_SMGHeat", 0, "ReloadHeat");
CSMG A 0 {invoker.m_Recoil = 0.1;}
CSMG A 0 Lith_A_JumpIfMagEmpty;
CSMG A 0 A_JumpIf(!ACS_ExecuteWithResult(lsc_pdata, pdata_upgrade, UPGR_SMG_C), 2);
CSMG A 0 A_JumpIf(!Lith_UTIL.pData(self, pdata_upgrade, UPGR_SMG_C), 2);
CSMG A 0 A_JumpIfInventory("Lith_SMGHeat", 450, "Ready");
CSMG A 0 A_StartSound("weapons/smg/fire", lch_weapon, CHANF_LOOP);
Fire1:
CSMG A 0 A_JumpIf(!ACS_ExecuteWithResult(lsc_pdata, pdata_upgrade, UPGR_SMG_C), 2);
CSMG A 0 A_JumpIf(!Lith_UTIL.pData(self, pdata_upgrade, UPGR_SMG_C), 2);
CSMG A 0 A_JumpIfInventory("Lith_SMGHeat", 450, "FireAnim1");
CSMG A 0 {self.GiveInventory("Lith_SMGHeat", Random(14,27));}
CSMG A 0 A_JumpIfInventory("Lith_SMGHeat", 0, "ReloadHeatFromFiring");
@@ -310,7 +310,7 @@ ReloadFromFiring:
CSMG A 0 A_StartSound("weapons/smg/firedone", lch_weapon);
Reload:
CSMG A 0 Lith_A_JumpIfMagFull;
CSMG A 0 A_JumpIf(ACS_ExecuteWithResult(lsc_pdata, pdata_upgrade, UPGR_SMG_A), "ReloadLong");
CSMG A 0 A_JumpIf(Lith_UTIL.pData(self, pdata_upgrade, UPGR_SMG_A), "ReloadLong");
CSMG A 1 A_StartSound("weapons/smg/lift", lch_reload);
CSMG D 1 offset(-2, 34);
CSMG E 1 offset(-4, 37);


+ 4
- 4
pk7/lzscript/2_CyberMage/5_IonRifle.zsc View File

@@ -114,7 +114,7 @@ class Lith_IonRifleExplosion : Actor
TNT1 A 0;
TNT1 A 1 A_Explode(96, 256, 0);
TNT1 A 0 {
if(ACS_ExecuteWithResult(lsc_pdata, pdata_upgrade, UPGR_IonRifle_A, true))
if(Lith_UTIL.pData(target, pdata_upgrade, UPGR_IonRifle_A))
A_RadiusGive("Lith_Ionized", 192, RGF_MONSTERS, 1);
for(int i = 0; i < 26; i++)
{
@@ -231,19 +231,19 @@ Ready:
Deselect:
IONG A 0 Lith_A_ScopeOut;
DeselectLoop:
IONG A 1 A_Lower(18);
IONG A 1 Lith_A_Lower(_raise_fast);
loop;

Select:
IONG A 0 Lith_A_ScopeOut;
IONG A 1 A_Raise(18);
IONG A 1 Lith_A_Raise(_raise_fast);
wait;

Fire:
#### # 0 A_JumpIf(CountInv("Lith_RocketAmmo") == 0, "FireEmpty");
#### # 0 Lith_A_JumpIfMagEmpty;
#### # 0 {invoker.m_Charge = 1;}
#### # 0 A_JumpIf(ACS_ExecuteWithResult(lsc_pdata, pdata_upgrade, UPGR_IonRifle_B), 1);
#### # 0 A_JumpIf(Lith_UTIL.pData(self, pdata_upgrade, UPGR_IonRifle_B), 1);
goto DoFire;
#### # 2;
#### # 1 A_ReFire(1);


+ 3
- 3
pk7/lzscript/2_CyberMage/6_CPlasmaRifle.zsc View File

@@ -99,16 +99,16 @@ Ready:
loop;

Deselect:
CPLG A 1 A_Lower(18);
CPLG A 1 Lith_A_Lower(_raise_fast);
loop;

Select:
CPLG A 1 A_Raise(18);
CPLG A 1 Lith_A_Raise(_raise_fast);
loop;

Fire:
CPLG A 0 A_JumpIf(CountInv("Lith_PlasmaAmmo") == 0, "FireEmpty");
CPLG A 0 A_JumpIf(ACS_ExecuteWithResult(lsc_pdata, pdata_upgrade, UPGR_CPlasma_A), "FirePulse");
CPLG A 0 A_JumpIf(Lith_UTIL.pData(self, pdata_upgrade, UPGR_CPlasma_A), "FirePulse");
CPLG B 2 offset(0, 36) bright Lith_A_FireCPlasma;
CPLG C 1 offset(0, 35) bright;
CPLG D 1 offset(0, 32);


+ 4
- 4
pk7/lzscript/2_CyberMage/7_StarDestroyer.zsc View File

@@ -320,12 +320,12 @@ default
action(Weapon) void Lith_A_FireStar()
{
A_GunFlash("DummyFlash");
if(ACS_ExecuteWithResult(lsc_pdata, pdata_upgrade, UPGR_ShipGun_A))
if(Lith_UTIL.pData(self, pdata_upgrade, UPGR_ShipGun_A))
{
A_StartSound("weapons/shipgun/firesol", lch_weapon);
A_FireProjectile("Lith_Solspear");
}
else if(ACS_ExecuteWithResult(lsc_pdata, pdata_upgrade, UPGR_ShipGun_B))
else if(Lith_UTIL.pData(self, pdata_upgrade, UPGR_ShipGun_B))
{
A_StartSound("weapons/shipgun/firesurge", lch_weapon);
CallACS("Lith_SurgeOfDestiny");
@@ -349,12 +349,12 @@ Ready:
Deselect:
SDSG A 0 A_StopSound(lch_idleweapon);
DeselectLoop:
SDSG A 1 A_Lower(18);
SDSG A 1 Lith_A_Lower(_raise_slow);
loop;

Select:
SDSG A 0 A_StartSound("weapons/shipgun/idle", lch_idleweapon, CHANF_LOOP);
SDSG A 1 A_Raise(12);
SDSG A 1 Lith_A_Raise(_raise_slow);
wait;

Fire:


+ 2
- 2
pk7/lzscript/2_CyberMage/Magic/1_Blade.zsc View File

@@ -56,12 +56,12 @@ Ready:
loop;

Deselect:
TNT1 A 0 A_Lower;
TNT1 A 0 Lith_A_Lower(_raise_instant);
loop;
Select:
TNT1 A 0 ACS_ScriptCall("Lith_MagicSelect", 1);
SelectLoop:
TNT1 A 0 A_Raise;
TNT1 A 0 Lith_A_Raise(_raise_instant);
loop;

Fire:


+ 2
- 2
pk7/lzscript/2_CyberMage/Magic/2_Delear.zsc View File

@@ -112,12 +112,12 @@ Ready:
loop;

Deselect:
TNT1 A 0 A_Lower;
TNT1 A 0 Lith_A_Lower(_raise_instant);
loop;
Select:
TNT1 A 0 ACS_ScriptCall("Lith_MagicSelect", 2);
SelectLoop:
TNT1 A 0 A_Raise;
TNT1 A 0 Lith_A_Raise(_raise_instant);
loop;

Fire:


+ 2
- 2
pk7/lzscript/2_CyberMage/Magic/3_Feuer.zsc View File

@@ -139,13 +139,13 @@ Ready:
loop;

Deselect:
TNT1 A 0 A_Lower;
TNT1 A 0 Lith_A_Lower(_raise_instant);
loop;

Select:
TNT1 A 0 ACS_ScriptCall("Lith_MagicSelect", 3);
SelectLoop:
TNT1 A 0 A_Raise;
TNT1 A 0 Lith_A_Raise(_raise_instant);
loop;

Fire:


+ 2
- 2
pk7/lzscript/2_CyberMage/Magic/4_Rend.zsc View File

@@ -56,13 +56,13 @@ Ready:
loop;

Deselect:
TNT1 A 0 A_Lower;
TNT1 A 0 Lith_A_Lower(_raise_instant);
loop;

Select:
TNT1 A 0 ACS_ScriptCall("Lith_MagicSelect", 4);
SelectLoop:
TNT1 A 0 A_Raise;
TNT1 A 0 Lith_A_Raise(_raise_instant);
loop;

Fire:


+ 2
- 2
pk7/lzscript/2_CyberMage/Magic/5_Hulgyon.zsc View File

@@ -88,13 +88,13 @@ Ready:
loop;

Deselect:
TNT1 A 0 A_Lower;
TNT1 A 0 Lith_A_Lower(_raise_instant);
loop;

Select:
TNT1 A 0 ACS_ScriptCall("Lith_MagicSelect", 5);
SelectLoop:
TNT1 A 0 A_Raise;
TNT1 A 0 Lith_A_Raise(_raise_instant);
loop;

Fire:


+ 2
- 2
pk7/lzscript/2_CyberMage/Magic/6_StarShot.zsc View File

@@ -65,13 +65,13 @@ Ready:
loop;

Deselect:
TNT1 A 0 A_Lower;
TNT1 A 0 Lith_A_Lower(_raise_instant);
loop;

Select:
TNT1 A 0 ACS_ScriptCall("Lith_MagicSelect", 6);
SelectLoop:
TNT1 A 0 A_Raise;
TNT1 A 0 Lith_A_Raise(_raise_instant);
loop;

Fire:


+ 2
- 2
pk7/lzscript/2_CyberMage/Magic/7_Cercle.zsc View File

@@ -269,13 +269,13 @@ Ready:
loop;

Deselect:
TNT1 A 0 A_Lower;
TNT1 A 0 Lith_A_Lower(_raise_instant);
loop;

Select:
TNT1 A 0 ACS_ScriptCall("Lith_MagicSelect", 7);
SelectLoop:
TNT1 A 0 A_Raise;
TNT1 A 0 Lith_A_Raise(_raise_instant);
loop;

Fire:


+ 2
- 2
pk7/lzscript/3_Informant/2_Flintlock.zsc View File

@@ -30,11 +30,11 @@ Ready:
loop;

Deselect:
PISG A 1 A_Lower(12);
PISG A 1 Lith_A_Lower(_raise_fast);
loop;

Select:
PISG A 1 A_Raise(12);
PISG A 1 Lith_A_Raise(_raise_fast);
loop;

Fire:


+ 2
- 2
pk7/lzscript/5_Assassin/0_Weapon.zsc View File

@@ -8,7 +8,7 @@ override state Lith_Ready(int flags) {
if(Lith_AssassinPlayer(owner).m_isSprinting) {
return resolveState("_Sprint");
} else {
return null;
return super.lith_ready(flags);
}
}

@@ -18,7 +18,7 @@ action(Weapon) void Lith_Sprint() {

action(Weapon) state Lith_JumpIfSprint() {
if(vel.xy.length() < 8)
player.getPSprite(PSP_WEAPON).frame = 99;
player.getPSprite(_psp_weapon).frame = 99;

if(getPlayerInput(INPUT_BUTTONS) & BT_SPEED == 0)
return resolveState("_SprintDone");


+ 2
- 2
pk7/lzscript/5_Assassin/2_DualPistols.zsc View File

@@ -33,12 +33,12 @@ ReadyLH: DPIS B 1 Lith_A_DoubleReady; wait;
ReadyRH: DPIS A 1 Lith_A_DoubleReady; wait;

Deselect:
TNT1 A 1 A_Lower(12);
TNT1 A 1 Lith_A_Lower(_raise_fast);
loop;

Select:
TNT1 A 0 Lith_A_DoubleRaise;
TNT1 A 1 A_Raise(12);
TNT1 A 1 Lith_A_Raise(_raise_fast);
wait;

Fire:


+ 2
- 2
pk7/lzscript/5_Assassin/4_BurstRifle.zsc View File

@@ -39,11 +39,11 @@ Ready:
loop;

Deselect:
KM64 A 1 A_Lower(12);
KM64 A 1 Lith_A_Lower(_raise_fast);
loop;

Select:
KM64 A 1 A_Raise(12);
KM64 A 1 Lith_A_Raise(_raise_fast);
loop;

Flash:


+ 2
- 2
pk7/lzscript/6_DarkLord/0_Weapon.zsc View File

@@ -98,7 +98,7 @@ override state Lith_Ready(int flags) {
if(owner.getPlayerInput(INPUT_BUTTONS) & BT_SPEED != 0)
return resolveState("_Sprint");
else
return null;
return super.lith_ready(flags);
}

action(Weapon) void Lith_SubGunPreFire() {
@@ -138,7 +138,7 @@ action(Weapon) void Lith_Sprint() {

action(Weapon) state Lith_JumpIfSprint() {
if(vel.xy.length() < 8)
player.getPSprite(PSP_WEAPON).frame = 99;
player.getPSprite(_psp_weapon).frame = 99;

if(getPlayerInput(INPUT_BUTTONS) & BT_SPEED == 0)
return resolveState("_SprintDone");


+ 2
- 2
pk7/lzscript/6_DarkLord/2_700Express.zsc View File

@@ -159,10 +159,10 @@ Ready:
loop;

Deselect:
700E A 1 A_Lower(18);
700E A 1 Lith_A_Lower(_raise_fast);
wait;
Select:
700E A 1 A_Raise(18);
700E A 1 Lith_A_Raise(_raise_fast);
wait;

Fire:


+ 2
- 2
pk7/lzscript/6_DarkLord/3_4Bore.zsc View File

@@ -37,10 +37,10 @@ Ready:
loop;

Deselect:
SHTG A 1 A_Lower(12);
SHTG A 1 Lith_A_Lower(_raise_normal);
loop;
Select:
SHTG A 1 A_Raise(12);
SHTG A 1 Lith_A_Raise(_raise_normal);
loop;

Fire:


+ 2
- 2
pk7/lzscript/6_DarkLord/3_ShrapnelGun.zsc View File

@@ -50,11 +50,11 @@ Ready:
loop;

Deselect:
PISG A 1 A_Lower(12);
PISG A 1 Lith_A_Lower(_raise_fast);
loop;

Select:
PISG A 1 A_Raise(12);
PISG A 1 Lith_A_Raise(_raise_fast);
loop;

Fire:


+ 5
- 2
pk7/lzscript/6_DarkLord/4_Minigun.zsc View File

@@ -118,6 +118,9 @@ action(Weapon) void Lith_A_MinigunFire()
A_AlertMonsters();
A_StartSound("weapons/minigun/fire", lch_weapon);
A_WeaponOffset(FRandom(3, 8), FRandom(34, 39), WOF_INTERPOLATE);
A_GunFlash("DummyFlash");
A_FireProjectile("Lith_LightProjectileRedShort", 0);
Lith_A_GunSmokeSmall(1.9);
Lith_FireBullets(7, 1.7, 2, 7, tracerX: 1);
Lith_A_RecoilUp(0.15);
A_Recoil(0.07);
@@ -148,11 +151,11 @@ Ready3:

Deselect:
#### # 0 {A_StopSound(lch_weapon2); invoker.m_reloading = false;}
#### # 1 A_Lower(24);
#### # 1 Lith_A_Lower(_raise_fast);
loop;

Select:
MNGG A 1 A_Raise(24);
MNGG A 1 Lith_A_Raise(_raise_fast);
loop;

Fire:


+ 2
- 2
pk7/lzscript/6_DarkLord/5_DualRocket.zsc View File

@@ -51,12 +51,12 @@ ReadyLH: FRAN A 1 Lith_A_DoubleReady; wait;
ReadyRH: SOPH A 1 Lith_A_DoubleReady; wait;

Deselect:
TNT1 A 1 A_Lower(18);
TNT1 A 1 Lith_A_Lower(_raise_normal);
loop;

Select:
TNT1 A 0 Lith_A_DoubleRaise;
TNT1 A 1 A_Raise(12);
TNT1 A 1 Lith_A_Raise(_raise_normal);
wait;

Fire:


+ 2
- 2
pk7/lzscript/6_DarkLord/6_FatMac.zsc View File

@@ -92,11 +92,11 @@ Ready:
loop;

Deselect:
PISG A 1 A_Lower(18);
PISG A 1 Lith_A_Lower(_raise_normal);
loop;

Select:
PISG A 1 A_Raise(18);
PISG A 1 Lith_A_Raise(_raise_normal);
loop;

FireEmpty:


+ 2
- 2
pk7/lzscript/6_DarkLord/7_FortuneGun.zsc View File

@@ -142,11 +142,11 @@ Ready:
loop;

Deselect:
PISG A 1 A_Lower(12);
PISG A 1 Lith_A_Lower(_raise_slow);
loop;

Select:
PISG A 1 A_Raise(12);
PISG A 1 Lith_A_Raise(_raise_slow);
loop;

Fire:


+ 2
- 2
pk7/lzscript/7_Thoth/3_RiotShotgun.zsc View File

@@ -39,11 +39,11 @@ Ready:
loop;

Deselect:
PISG A 1 A_Lower(12);
PISG A 1 Lith_A_Lower(_raise_fast);
loop;

Select:
PISG A 1 A_Raise(12);
PISG A 1 Lith_A_Raise(_raise_fast);
loop;

Fire:


+ 2
- 2
pk7/lzscript/7_Thoth/5_RedRifle.zsc View File

@@ -36,11 +36,11 @@ Ready:
loop;

Deselect:
PISG A 1 A_Lower(12);
PISG A 1 Lith_A_Lower(_raise_fast);
loop;

Select:
PISG A 1 A_Raise(12);
PISG A 1 Lith_A_Raise(_raise_fast);
loop;

Fire:


+ 1
- 0
pk7/lzscript/Constants/p_player.zsc View File

@@ -27,6 +27,7 @@ enum Lith_PData {
pdata_addy,
pdata_recoilp,
pdata_attr,
pdata_alpha,
};

enum Lith_SubweaponType {


+ 1
- 1
pk7/lzscript/Effects/BulletPuff.zsc View File

@@ -237,7 +237,7 @@ override void postBeginPlay()
super.postBeginPlay();
Lith_A_SmokeFX();
Lith_A_RicochetFX();
if(ACS_ExecuteWithResult(lsc_pdata, pdata_upgrade, UPGR_TorgueMode, true))
if(Lith_UTIL.pData(target, pdata_upgrade, UPGR_TorgueMode))
A_SpawnItemEx("Lith_EXPLOOOSION", flags: SXF_TRANSFERPOINTERS|SXF_NOCHECKPOSITION);
}



+ 1
- 1
pk7/lzscript/Items/DivisionSigil.zsc View File

@@ -35,7 +35,7 @@ class Lith_DivisionSigil : Lith_ItemPickup {

override bool canPickup(Actor mo) {
if(super.canPickup(mo)) {
return !ACS_ExecuteWithResult(lsc_pdata, pdata_hassigil);
return !Lith_UTIL.pData(mo, pdata_hassigil);
} else {
return false;
}


+ 3
- 5
pk7/lzscript/Player/Base.zsc View File

@@ -81,7 +81,7 @@ void Lith_GiveDefWeapon(class<Weapon> type) {
override void PlayerThink() {
if(level.levelnum == 1911777) return;

if(ACS_ExecuteWithResult(lsc_pdata, pdata_semifrozen)) {
if(Lith_UTIL.pData(self, pdata_semifrozen)) {
UserCmd cmd = player.cmd;
cmd.pitch = cmd.yaw = cmd.roll = 0;
player.turnticks = 0;
@@ -204,7 +204,7 @@ void Lith_PreTick() {
m_QY = Lith_Quaternion.Create(- angle, 0, 0, 1);

/* stupid hack to keep the view from moving around */
if(ACS_ExecuteWithResult(lsc_pdata, pdata_semifrozen)) {
if(Lith_UTIL.pData(self, pdata_semifrozen)) {
angle -= 1;
pitch -= 1;
A_SetAngle(angle + 1, SPF_INTERPOLATE);
@@ -222,9 +222,7 @@ void Lith_PreTick() {
}

void Lith_PostTick() {
if(!player) return;

if(CVar.GetCVar('lith_player_rainshader', player).getBool())
if(CVar.getCVar('lith_player_rainshader', player).getBool())
Lith_RainEffect();
else
Shader.SetEnabled(player, "Lith_Rain", false);


+ 2
- 2
pk7/lzscript/Player/Bobbing.zsc View File

@@ -50,7 +50,7 @@ void Lith_BobWeapon() {
m_LastVZVel = m_VZVel;
m_VZVel = Lith_UTIL.Lerp(m_VZVel, m_ZVel, 0.42);

if(ACS_ExecuteWithResult(lsc_pdata, pdata_upgrade, UPGR_7777777)) {
if(Lith_UTIL.pData(self, pdata_upgrade, UPGR_7777777)) {
m_mbobprv = m_mbobpos;
if(!(vel.length() < 4 ||
!player.readyweapon ||
@@ -70,7 +70,7 @@ override vector2 BobWeapon(double ticfrac) {
let wep = Player.ReadyWeapon;
if(!wep) return (0, 0);

if(ACS_ExecuteWithResult(lsc_pdata, pdata_upgrade, UPGR_7777777)) {
if(Lith_UTIL.pData(self, pdata_upgrade, UPGR_7777777)) {
return (0, (m_mbobpos - m_mbobprv) * ticfrac + m_mbobpos + 5 + clamp(20 - 20 * (pitch + 90) / 180.0, 5, 15));
}



+ 1
- 1
pk7/lzscript/Playsim/Weapons.zsc View File

@@ -78,7 +78,7 @@ static void PoisonFX(Actor mo)
{
/* removed weird ass bullshit... */
let trg = Lith_Player(mo.Target);
int dmg = trg ? Lith_UTIL.Exec(trg, lsc_pdata, pdata_attr, at_acc) / 4 : 0;
int dmg = trg ? Lith_UTIL.pData(trg, pdata_attr, at_acc) / 4 : 0;
mo.A_DamageSelf(10 + dmg, "Poison");
mo.A_StartSound("weapons/shotgun/poison/acid", lch_body3, attenuation: 0.5);
mo.A_SpawnItemEx("Lith_PoisonFX", 0,0,8, flags: SXF_NOCHECKPOSITION|SXF_TRANSFERSPRITEFRAME|SXF_TRANSFERSCALE);


+ 2
- 2
pk7/lzscript/Projectiles/Explosive.zsc View File

@@ -15,8 +15,8 @@ class Lith_ExplosionAfterSmoke : Lith_BulletAfterSmoke {

class Lith_Explosive : Actor;

bool CheckMarathon(bool target = true) {
return ACS_ExecuteWithResult(lsc_pdata, pdata_upgrade, UPGR_7777777, target);
bool CheckMarathon(bool isTarget = true) {
return Lith_UTIL.pData(isTarget ? target : Actor(self), pdata_upgrade, UPGR_7777777);
}

void Lith_A_ExplodeSound(int chan = lch_body2, bool target = true) {


+ 3
- 3
pk7/lzscript/Projectiles/RifleBullet.zsc View File

@@ -29,16 +29,16 @@ states
Crash:
TNT1 A 0;
TNT1 A 0 A_Explode(7, 32, 0);
TNT1 A 0 A_JumpIf(ACS_ExecuteWithResult(lsc_pdata, pdata_upgrade, UPGR_7777777, true), "CrashMarathon");
TNT1 A 0 A_JumpIf(Lith_UTIL.pData(target, pdata_upgrade, UPGR_7777777), "CrashMarathon");
goto Super::Spawn;
Spawn:
TNT1 A 0;
TNT1 A 0 A_Explode(7, 32, 0);
TNT1 A 0 A_JumpIf(ACS_ExecuteWithResult(lsc_pdata, pdata_upgrade, UPGR_7777777, true), "SpawnMarathon");
TNT1 A 0 A_JumpIf(Lith_UTIL.pData(target, pdata_upgrade, UPGR_7777777), "SpawnMarathon");
goto Super::Spawn;
XDeath:
TNT1 A 0;
TNT1 A 0 A_JumpIf(!ACS_ExecuteWithResult(lsc_pdata, pdata_upgrade, UPGR_7777777, true), 2);
TNT1 A 0 A_JumpIf(!Lith_UTIL.pData(target, pdata_upgrade, UPGR_7777777), 2);
TNT1 A 0 A_StartSound("marathon/hit", lch_body);
TNT1 A 0 A_Explode(7, 32, 0);
stop;


+ 14
- 11
pk7/lzscript/Utilities.zsc View File

@@ -12,21 +12,21 @@
struct Lith_UTIL
{
/* fucking degrees system... */
static double ConstDeg(double x)
static double constDeg(double x)
{
x %= 360;
if(x < 0) x += 360;
return x;
}

static double DiffDeg(double a, double b)
static double diffDeg(double a, double b)
{
double d = (b - a) % 360;
if(d < 0) d += 360;
return d;
}

static double SDiffDeg(double a, double b)
static double sDiffDeg(double a, double b)
{
double d = b - a;
if(d ~== 0) return 0;
@@ -34,34 +34,34 @@ struct Lith_UTIL
return 2 * d % 360 - d;
}

static double AngleLerp(double a, double b, double t)
static double angleLerp(double a, double b, double t)
{
return a + SDiffDeg(a, b) * t;
}

static double Lerp(double a, double b, double t)
static double lerp(double a, double b, double t)
{
return (1 - t) * a + t * b;
}

static vector2 Vec2Lerp(vector2 a, vector2 b, double t)
static vector2 vec2Lerp(vector2 a, vector2 b, double t)
{
let vec = (Lerp(a.x, b.x, t), Lerp(a.y, b.y, t));
return vec;
}

static vector3 Vec3Lerp(vector3 a, vector3 b, double t)
static vector3 vec3Lerp(vector3 a, vector3 b, double t)
{
let vec = (Lerp(a.x, b.x, t), Lerp(a.y, b.y, t), Lerp(a.z, b.z, t));
return vec;
}

static int Round(double n)
static int round(double n)
{
return int(n * 1000) % 1000 < 500 ? int(n) : int(n+0.5);
}

static play vector3 TraceFrom(Actor mo, double yaw, double pitch, double dist, double offsetz, bool floor = false) {
static play vector3 traceFrom(Actor mo, double yaw, double pitch, double dist, double offsetz, bool floor = false) {
FLineTraceData ltd;
mo.lineTrace(yaw, dist, pitch, 0, offsetz, 0, 0, ltd);
let loc = ltd.hitlocation;
@@ -73,10 +73,13 @@ struct Lith_UTIL
return loc;
}

static play int Exec(Actor mo, int scr, int arg0 = 0, int arg1 = 0, int arg2 = 0, int arg3 = 0)
{
static play int exec(Actor mo, int scr, int arg0 = 0, int arg1 = 0, int arg2 = 0, int arg3 = 0) {
return Level.ExecuteSpecial(84, mo, null, false, scr, arg0, arg1, arg2, arg3);
}

static play int pData(Actor ply, int info, int permutation = 0) {
return Level.ExecuteSpecial(84, ply, null, false, lsc_pdata, info, permutation);
}
}

class Lith_EAngle


+ 5
- 5
pk7/lzscript/Weapons/1_ChargeFist.zsc View File

@@ -93,11 +93,11 @@ Ready:

Deselect:
TNT1 A 0 A_StopSound(lch_weapon);
TNT1 A 0 A_Lower;
TNT1 A 0 Lith_A_Lower(_raise_instant);
wait;

Select:
TNT1 A 0 A_Raise;
TNT1 A 0 Lith_A_Raise(_raise_instant);
loop;

Fire:
@@ -106,7 +106,7 @@ Fire:
goto Release1;
Fire1:
CFIS A 0 {self.GiveInventory("Lith_FistCharge", 35);}
CFIS A 0 A_JumpIf(ACS_ExecuteWithResult(lsc_pdata, pdata_pclass) == pcl_marine, 2);
CFIS A 0 A_JumpIf(Lith_UTIL.pData(self, pdata_pclass) == pcl_marine, 2);
CCFS A 0;
#### A 1 A_StartSound("weapons/cfist/ready", lch_weapon2);
#### B 1 A_StartSound("weapons/cfist/charge", lch_weapon, CHANF_LOOP);
@@ -123,7 +123,7 @@ Release:
TNT1 A 0 A_StartSound("weapons/cfist/chargeend", lch_weapon);
TNT1 A 0 A_GunFlash("SekritHax", GFF_NOEXTCHANGE); /* OH NO NOT yholehax */
Release1:
CFI2 A 0 A_JumpIf(ACS_ExecuteWithResult(lsc_pdata, pdata_pclass) == pcl_marine, "Release2");
CFI2 A 0 A_JumpIf(Lith_UTIL.pData(self, pdata_pclass) == pcl_marine, "Release2");
CCF2 A 0;
/* GOTTA RELEASE FAST */
Release2:
@@ -159,7 +159,7 @@ HitRecoil:
goto ReadySelector;
/* the crimera has struck again */
SekritHax:
CFIS A 0 A_JumpIf(ACS_ExecuteWithResult(lsc_pdata, pdata_pclass) == pcl_marine, 2);
CFIS A 0 A_JumpIf(Lith_UTIL.pData(self, pdata_pclass) == pcl_marine, 2);
CCFS A 0;
#### HI 1;
stop;


+ 2
- 2
pk7/lzscript/Weapons/5_MissileLauncher.zsc View File

@@ -52,10 +52,10 @@ Ready:
loop;

Deselect:
MISG A 1 A_Lower(18);
MISG A 1 Lith_A_Lower(_raise_fast);
loop;
Select:
MISG A 1 A_Raise(18);
MISG A 1 Lith_A_Raise(_raise_fast);
loop;

Reload:


+ 2
- 2
pk7/lzscript/Weapons/6_PlasmaDiffuser.zsc View File

@@ -71,11 +71,11 @@ Ready:
loop;

Deselect:
PDFG A 1 A_Lower(18);
PDFG A 1 Lith_A_Lower(_raise_fast);
loop;

Select:
PDFG A 1 A_Raise(18);
PDFG A 1 Lith_A_Raise(_raise_fast);
loop;

Fire:


+ 127
- 15
pk7/lzscript/Weapons/Base.zsc View File

@@ -12,13 +12,14 @@ class Lith_WeaponScopedToken : Inventory {default {Inventory.MaxAmount 1;}}
class Lith_Weapon : Weapon;

enum Lith_PSprite {
_psp_weapon = PSP_WEAPON,
_psp_weapon = psp_weapon,
_psp_double_lg,
_psp_double_lf,
_psp_double_rg,
_psp_wep_max,
_psp_flash = psp_flash,
_psp_double_lf,
_psp_double_rf,
_psp_d_subweapon,
_psp_flash = PSP_FLASH,
}

enum Lith_Hand {
@@ -37,6 +38,13 @@ enum Lith_TracerType {
_tr_none
}

enum Lith_RaiseSpeed {
_raise_slow,
_raise_normal,
_raise_fast,
_raise_instant
}

default {
Inventory.PickupMessage "";
Inventory.PickupSound "";
@@ -81,6 +89,108 @@ virtual state Lith_Ready(int flags) {
return null;
}

int lith_getRaiseSpeed(Lith_RaiseSpeed speed) {
switch(speed) {
case _raise_slow: return 10;
case _raise_normal: return 12;
case _raise_fast: return 18;
case _raise_instant: return 60;
default: throwAbortException("invalid raise speed");
}
return 0;
}

action(Weapon) void lith_a_setupOverlays() {
float a;
int style;

if(countInv("Lith_WeaponScopedToken")) {
a = CVar.getCVar('lith_weapons_scopealpha', player).getFloat();
style = style_subtract;
} else {
a = CVar.getCVar('lith_weapons_alpha', player).getFloat();
style = style_translucent;
}

a *= Lith_UTIL.pData(self, pdata_alpha) / FIX;

for(int psp = _psp_weapon; psp < _psp_wep_max; ++psp) {
a_overlayFlags(psp, pspf_alpha|pspf_renderstyle, true);
a_overlayRenderStyle(psp, style);
a_overlayAlpha(psp, a);
}
}

action(Weapon) void Lith_A_Lower(Lith_RaiseSpeed speed) {
if(!player) {
return;
}

if(!player.readyWeapon) {
player.mo.bringUpWeapon();
return;
}

int lowerSpeed = invoker.lith_getRaiseSpeed(speed);
let psp = player.getPSprite(_psp_weapon);
if(psp) {
lith_a_setupOverlays();

if(player.morphTics || player.cheats & cf_instantweapswitch) {
psp.y = weaponBottom;
} else {
psp.y += lowerSpeed;
}

if(psp.y < weaponBottom) {
return;
}

resetPSprite(psp);
if(player.playerState == pst_dead) {
player.setPSprite(_psp_flash, null);
psp.setState(findState('DeadLowered'));
return;
}

player.setPSprite(_psp_flash, null);
player.mo.bringUpWeapon();
}
}

action(Weapon) void Lith_A_Raise(Lith_RaiseSpeed speed) {
if(!player) {
return;
}

if(player.pendingWeapon != WP_NOCHANGE) {
player.mo.dropWeapon();
return;
}

if(!player.readyWeapon) {
return;
}

int raiseSpeed = invoker.lith_getRaiseSpeed(speed);
let psp = player.getPSprite(_psp_weapon);
if(psp) {
lith_a_setupOverlays();

if(psp.y <= weaponBottom) {
resetPSprite(psp);
}

psp.y -= raiseSpeed;
if(psp.y > weaponTop) {
return;
}
psp.y = weaponTop;

psp.setState(invoker.getReadyState());
}
}

action(Weapon) state Lith_A_DoubleReady() {
if(health < 1) return resolveState("Null");
else return null;
@@ -111,16 +221,18 @@ action(Weapon) void Lith_A_DoubleOffset(bool left, int x, int y) {
}
}

action state Lith_A_Ready(int flags = 0) {
if(!CountInv("Lith_WeaponScopedToken")) {
A_ZoomFactor(1.0, ZOOM_INSTANT);
action(Weapon) state Lith_A_Ready(int flags = 0) {
lith_a_setupOverlays();

if(!countInv("Lith_WeaponScopedToken")) {
a_zoomFactor(1.0, ZOOM_INSTANT);
}

let st = invoker.Lith_Ready(flags);
let st = invoker.lith_ready(flags);
if(st) {
return st;
} else {
A_WeaponReady(flags | CallACS("Lith_GetWRF"));
a_weaponReady(flags | callACS("Lith_GetWRF"));
return null;
}
}
@@ -152,7 +264,7 @@ action(Weapon) state Lith_A_JumpIfMagFull(statelabel sn = "ReadySelector") {
}

action(Weapon) void Lith_A_MagIncr(int amt = 1) {
if(!ACS_ExecuteWithResult(lsc_pdata, pdata_upgrade, UPGR_OneShot))
if(!Lith_UTIL.pData(self, pdata_upgrade, UPGR_OneShot))
invoker.m_fired = min(invoker.m_fired + amt, invoker.m_max);
else
invoker.m_fired = invoker.m_max;
@@ -163,13 +275,13 @@ action(Weapon) void Lith_A_ReloadFinish() {
}

action(Weapon) void Lith_A_TakeSlot3OptAmmo(int amt = 1) {
if(ACS_ExecuteWithResult(lsc_pdata, pdata_slot3ammo)) {
if(Lith_UTIL.pData(self, pdata_slot3ammo)) {
self.TakeInventory("Lith_ShellAmmo", amt, notakeinfinite: true);
}
}

action(Weapon) state Lith_A_JumpIfNoSlot3OptAmmo(statelabel sn = "FireEmpty", int req = 1) {
if(!ACS_ExecuteWithResult(lsc_pdata, pdata_slot3ammo) || CountInv("Lith_ShellAmmo") >= req) {
if(!Lith_UTIL.pData(self, pdata_slot3ammo) || CountInv("Lith_ShellAmmo") >= req) {
return null;
} else {
return ResolveState(sn);
@@ -199,7 +311,7 @@ action(Weapon) void Lith_A_ReloadBobDn(double amt) {
action(Weapon) void Lith_A_ScopeIn() {
if(!CountInv("Lith_WeaponScopedToken")) {
self.GiveInventory("Lith_WeaponScopedToken", 1);
A_ZoomFactor((1+ACS_ExecuteWithResult(lsc_pdata, pdata_weaponzoom)/FIX)*invoker.m_scopeZoom);
A_ZoomFactor((1+Lith_UTIL.pData(self, pdata_weaponzoom)/FIX)*invoker.m_scopeZoom);
A_StartSound(invoker.m_scopeInSnd, lch_scope);
}
}
@@ -218,7 +330,7 @@ action(Weapon) void Lith_A_ScopeToggle() {
}

action(Weapon) void Lith_A_ZoomFactorScoped(double amount) {
A_ZoomFactor((1+ACS_ExecuteWithResult(lsc_pdata, pdata_weaponzoom)/FIX) * amount * invoker.m_scopeZoom);
A_ZoomFactor((1+Lith_UTIL.pData(self, pdata_weaponzoom)/FIX) * amount * invoker.m_scopeZoom);
}

action(Weapon) void Lith_GunSmoke(class<Actor> type, double x, double y, bool ignoreCrouch) {
@@ -234,14 +346,14 @@ action(Weapon) void Lith_A_GunSmokeSmall(double x = 0, double y = 6, bool ignore
Lith_GunSmoke("Lith_GunSmokeSpawnerSmall", x, y, ignoreCrouch);
}

action void Lith_A_DropMag(class<Lith_DroppedMagazine> mag1, class<Lith_DroppedMagazine> mag2, double px, double py, double pz, double vx, double vy, double vz) {
action(Weapon) void Lith_A_DropMag(class<Lith_DroppedMagazine> mag1, class<Lith_DroppedMagazine> mag2, double px, double py, double pz, double vx, double vy, double vz) {
double vh = Player.ViewZ - Player.MO.ViewHeight - Pos.Z;
px += FRandom(-1, 1); py += FRandom(-1, 1); pz += FRandom(-1, 1);
vx += FRandom(-1, 1); vy += FRandom(-1, 1); vz += FRandom(-1, 1);
A_SpawnItemEx(invoker.Lith_MagEmpty() || !mag2 ? mag1 : mag2, px,py,pz+vh, vx,vy,vz);
}

action void Lith_A_Casing(class<Lith_CasingBase> cas, double px, double py, double pz, double vx, double vy, double vz) {
action(Weapon) void Lith_A_Casing(class<Lith_CasingBase> cas, double px, double py, double pz, double vx, double vy, double vz) {
double vh = Player.ViewZ - Player.MO.ViewHeight - Pos.Z;
px += FRandom(-1, 1); py += FRandom(-1, 1); pz += FRandom(-1, 1);
vx += FRandom(-1, 1); vy += FRandom(-1, 1); vz += FRandom(-1, 1);


+ 2
- 2
pk7/lzscript/Weapons/OutcastsWeapon.zsc View File

@@ -24,7 +24,7 @@ bool m_KnifeReFire;
states(Weapon)
{
User4:
#### # 0 {return ACS_ExecuteWithResult(lsc_pdata, pdata_pclass) == pcl_marine ? null : ResolveState("ReadySelector");}
#### # 0 {return Lith_UTIL.pData(self, pdata_pclass) == pcl_marine ? null : ResolveState("ReadySelector");}
_UseKnife:
#### # 0 A_JumpIfInventory("Lith_WeaponScopedToken", 1, "ReadySelector");
#### # 0 A_JumpIf(invoker.m_KnifeReFire, "_KnifeStart");
@@ -77,7 +77,7 @@ _KnifeDone_2:
stop;
_KnifeFinish:
TNT1 A 0 {invoker.m_KnifeReFire = false;}
TNT1 A 1 A_Lower(54);
TNT1 A 1 A_Lower(60);
TNT1 A 0 ResolveState("Select");
stop;
}


+ 2
- 2
pk7/lzscript/Weapons/Sword.zsc View File

@@ -45,11 +45,11 @@ Ready:
Deselect:
/* this check required for death sequences */
TNT1 A 0 A_JumpIf(health >= 1, "ReadySelector");
TNT1 A 0 A_Lower;
TNT1 A 0 Lith_A_Lower(_raise_instant);
wait;

Select:
SORD A 1 A_Raise(24);
TNT1 A 0 Lith_A_Raise(_raise_instant);
loop;

Fire:


+ 2
- 2
pk7/lzscript/Weapons/Wings.zsc View File

@@ -68,10 +68,10 @@ Flap:

Deselect:
TNT1 A 0 {self.TakeInventory("PowerFlight", 1);}
TNT1 A 0 A_Lower;
TNT1 A 0 Lith_A_Lower(_raise_instant);
wait;
Select:
TNT1 A 0 A_Raise;
TNT1 A 0 Lith_A_Raise(_raise_instant);
wait;

Fire:


+ 0
- 1
source/include/common.h View File

@@ -94,7 +94,6 @@
#define SetHealth(tid, x) SetPropI(tid, APROP_Health, x)
#define SetMasterTID(tid, x) SetPropK(tid, APROP_MasterTID, x)
#define SetNameTag(tid, x) SetPropS(tid, APROP_NameTag, x)
#define SetRenderStyle(tid, x) SetPropI(tid, APROP_RenderStyle, x)
#define SetSpawnHealth(tid, x) SetPropI(tid, APROP_SpawnHealth, x)
#define SetSpecies(tid, x) SetPropS(tid, APROP_Species, x)
#define SetViewHeight(tid, x) SetPropK(tid, APROP_ViewHeight, x)


+ 0
- 2
source/include/m_stab.h View File

@@ -74,11 +74,9 @@ X(sc_sv_scoremul, CVAR "sv_scoremul")
X(sc_sv_sky, CVAR "sv_sky")
X(sc_sv_wepdrop, CVAR "sv_wepdrop")
X(sc_version, DCVAR "version")
X(sc_weapons_alpha, CVAR "weapons_alpha")
X(sc_weapons_magicselanims, CVAR "weapons_magicselanims")
X(sc_weapons_riflemodeclear, CVAR "weapons_riflemodeclear")
X(sc_weapons_riflescope, CVAR "weapons_riflescope")
X(sc_weapons_scopealpha, CVAR "weapons_scopealpha")
X(sc_weapons_slot3ammo, CVAR "weapons_slot3ammo")
X(sc_weapons_zoomfactor, CVAR "weapons_zoomfactor")
X(sc_xhair_style, CVAR "xhair_style")


+ 1
- 0
source/include/p_player.h View File

@@ -63,6 +63,7 @@ enum ZscName(PData) {
pdata_addy,
pdata_recoilp,
pdata_attr,
pdata_alpha,
};

enum ZscName(SubweaponType) {


+ 145
- 106
source/p_items.c View File

@@ -17,46 +17,49 @@

/* Static Functions -------------------------------------------------------- */

script
static void BagItem_Tick(struct item *_item)
{
script static
void BagItem_Tick(struct item *_item) {
struct bagitem *item = (struct bagitem *)_item;

for_item(item->content)
for_item(item->content) {
if(it->Tick) it->Tick(it);
}
}

script
static void BagItem_Place(struct item *_item, struct container *cont)
{
script static
void BagItem_Place(struct item *_item, struct container *cont) {
struct bagitem *item = (struct bagitem *)_item;

P_Item_Place(&item->item, cont);

item->content.user = item->user;

for_item(item->content)
if(it->Place) it->Place(it, &item->content);
for_item(item->content) {
if(it->Place) {
it->Place(it, &item->content);
}
}
}

script
static void BagItem_Destroy(struct item *_item)
{
script static
void BagItem_Destroy(struct item *_item) {
struct bagitem *item = (struct bagitem *)_item;

for_item(item->content)
if(it->Destroy) it->Destroy(it);
for_item(item->content) {
if(it->Destroy) {
it->Destroy(it);
}
}

P_Item_Destroy(&item->item);
}

static bool ItemCanPlace(struct container *cont, struct item *item, i32 x, i32 y)
{
if(x < 0 || y < 0)
return false;

if(x + item->w > cont->w || y + item->h > cont->h)
static
bool ItemCanPlace(struct container *cont, struct item *item, i32 x, i32 y) {
if(x < 0 || y < 0 ||
x + item->w > cont->w || y + item->h > cont->h) {
return false;
}

for_item(*cont) if(it != item) {
i32 const ox = it->x;
@@ -64,26 +67,32 @@ static bool ItemCanPlace(struct container *cont, struct item *item, i32 x, i32 y
i32 const oxw = ox + it->w;
i32 const oxh = oy + it->h;

if(aabb_aabb(it->x, it->y, it->w, it->h, x, y, item->w, item->h))
if(aabb_aabb(it->x, it->y, it->w, it->h, x, y, item->w, item->h)) {
return false;
}
}

return true;
}

static bool ItemCanPlaceAny(struct container *cont, struct item *item)
{
static
bool ItemCanPlaceAny(struct container *cont, struct item *item) {
i32 xn = cont->w / item->w;
i32 yn = cont->h / item->h;

for(i32 y = 0; y < yn; y++) for(i32 x = 0; x < xn; x++)
if(ItemCanPlace(cont, item, x * item->w, y * item->h))
return true;
for(i32 y = 0; y < yn; y++) {
for(i32 x = 0; x < xn; x++) {
if(ItemCanPlace(cont, item, x * item->w, y * item->h)) {
return true;
}
}
}

return false;
}

static void EquipItem(struct player *p, struct item *sel) {
static
void EquipItem(struct player *p, struct item *sel) {
bool ok = false;

for(i32 i = 0; i < _inv_num; i++) {
@@ -96,12 +105,12 @@ static void EquipItem(struct player *p, struct item *sel) {
}
}

if(ok) ACS_LocalAmbientSound(ss_player_cbi_invmov, 127);
else ACS_LocalAmbientSound(ss_player_cbi_auto_invalid, 127);
ACS_LocalAmbientSound(ok ? ss_player_cbi_invmov :
ss_player_cbi_auto_invalid, 127);
}

static void Container(struct gui_state *g, struct container *cont, i32 sx, i32 sy)
{
static
void Container(struct gui_state *g, struct container *cont, i32 sx, i32 sy) {
Str(sp_BackStore, s":UI:InvBackStore");
Str(sp_BackArmsU, s":UI:InvBackUpperArms");
Str(sp_BackArmsL, s":UI:InvBackLowerArms");
@@ -125,8 +134,11 @@ static void Container(struct gui_state *g, struct container *cont, i32 sx, i32 s

PrintText_str(Language(LANG "CONTAINER_%s", cont->name), sf_smallfnt, g->defcr, sx,1, sy,2);

for(i32 y = 0; y < h; y += 8) for(i32 x = 0; x < w; x += 8)
PrintSpriteA(bg, sx+x,1, sy+y,1, 0.8);
for(i32 y = 0; y < h; y += 8) {
for(i32 x = 0; x < w; x += 8) {
PrintSpriteA(bg, sx+x,1, sy+y,1, 0.8);
}
}

if(p && p->movitem && g->clicklft &&
aabb_point(sx, sy, w, h, g->cx, g->cy) &&
@@ -144,7 +156,9 @@ static void Container(struct gui_state *g, struct container *cont, i32 sx, i32 s

PrintSprite(it->spr, x,1, y,1);

if(!p || p->movitem) continue;
if(!p || p->movitem) {
continue;
}

if(p->selitem != it && g->clicklft && aabb_point(x, y, ex, ey, g->cx, g->cy)) {
p->selitem = it;
@@ -165,8 +179,7 @@ static void Container(struct gui_state *g, struct container *cont, i32 sx, i32 s

/* Extern Functions -------------------------------------------------------- */

void P_Inv_PInit(struct player *p)
{
void P_Inv_PInit(struct player *p) {
static struct container const baseinv[] = {
[_inv_backpack] = {11, 7, "Backpack", _cont_store},
[_inv_arm_upper_l] = {1, 3, "ArmUpL", _cont_arms_u},
@@ -190,8 +203,7 @@ void P_Inv_PInit(struct player *p)