Browse Source

la grande stringening finale: integer scripts

tags/1.6.1
Alison Watson 2 years ago
parent
commit
9c41cf7d95
65 changed files with 807 additions and 669 deletions
  1. BIN
      pk7/acs/lithmain.bin
  2. +1
    -1
      pk7/lscripts/Effects/Rain.dec
  3. +1
    -1
      pk7/lscripts/Items/DivisionSigil.dec
  4. +5
    -5
      pk7/lzscript/1_Marine/2_Pistol.zsc
  5. +4
    -4
      pk7/lzscript/1_Marine/3_Shotgun.zsc
  6. +9
    -9
      pk7/lzscript/1_Marine/4_CombatRifle.zsc
  7. +4
    -4
      pk7/lzscript/1_Marine/5_RocketLauncher.zsc
  8. +5
    -5
      pk7/lzscript/1_Marine/6_PlasmaRifle.zsc
  9. +9
    -9
      pk7/lzscript/1_Marine/7_OmegaCannon.zsc
  10. +1
    -1
      pk7/lzscript/2_CyberMage/2_Mateba.zsc
  11. +4
    -4
      pk7/lzscript/2_CyberMage/3_2_SPAS.zsc
  12. +3
    -3
      pk7/lzscript/2_CyberMage/3_ShockRifle.zsc
  13. +5
    -5
      pk7/lzscript/2_CyberMage/4_SMG.zsc
  14. +2
    -2
      pk7/lzscript/2_CyberMage/5_IonRifle.zsc
  15. +1
    -1
      pk7/lzscript/2_CyberMage/6_CPlasmaRifle.zsc
  16. +2
    -2
      pk7/lzscript/2_CyberMage/7_StarDestroyer.zsc
  17. +6
    -6
      pk7/lzscript/Client/Draw.zsc
  18. +1
    -1
      pk7/lzscript/Client/StatScreen.zsc
  19. +16
    -0
      pk7/lzscript/Constants/w_data.zsc
  20. +1
    -1
      pk7/lzscript/Effects/BulletPuff.zsc
  21. +1
    -1
      pk7/lzscript/Items/Pickup.zsc
  22. +9
    -9
      pk7/lzscript/Player.zsc
  23. +2
    -2
      pk7/lzscript/Playsim/Events.zsc
  24. +3
    -3
      pk7/lzscript/Playsim/Monsters.zsc
  25. +1
    -1
      pk7/lzscript/Projectiles/Explosive.zsc
  26. +3
    -3
      pk7/lzscript/Projectiles/RifleBullet.zsc
  27. +4
    -4
      pk7/lzscript/Weapons.zsc
  28. +3
    -3
      pk7/lzscript/Weapons/1_ChargeFist.zsc
  29. +1
    -1
      pk7/lzscript/Weapons/OutcastsWeapon.zsc
  30. +1
    -1
      pk7/lzscript/Weapons/Wings.zsc
  31. +16
    -0
      pk7_dt/dtzsc/wdata.zsc
  32. +16
    -0
      source/Headers/w_data.h
  33. +45
    -12
      source/Main/debug.c
  34. +22
    -12
      source/Main/dialogue_vm.c
  35. +1
    -1
      source/Main/m_math.c
  36. +9
    -27
      source/Main/p_bip.c
  37. +2
    -2
      source/Main/p_cbi.c
  38. +10
    -8
      source/Main/p_data.c
  39. +80
    -78
      source/Main/p_items.c
  40. +17
    -15
      source/Main/p_log.c
  41. +11
    -11
      source/Main/p_magic.c
  42. +4
    -2
      source/Main/p_obituary.c
  43. +42
    -40
      source/Main/p_player.c
  44. +20
    -18
      source/Main/p_powerup.c
  45. +19
    -10
      source/Main/p_save.c
  46. +87
    -85
      source/Main/p_weapons.c
  47. +9
    -7
      source/Main/u_homingrpg.c
  48. +30
    -26
      source/Main/u_magic.c
  49. +10
    -8
      source/Main/u_punctcannon.c
  50. +25
    -23
      source/Main/u_reactarmor.c
  51. +22
    -15
      source/Main/u_reflexwetw.c
  52. +20
    -18
      source/Main/u_riflemodes.c
  53. +18
    -18
      source/Main/u_zoom.c
  54. +43
    -41
      source/Main/w_boss.c
  55. +6
    -4
      source/Main/w_cbi.c
  56. +4
    -2
      source/Main/w_cyberspace.c
  57. +8
    -4
      source/Main/w_data.c
  58. +1
    -1
      source/Main/w_dmon.c
  59. +14
    -13
      source/Main/w_font.c
  60. +13
    -7
      source/Main/w_misc.c
  61. +45
    -44
      source/Main/w_monster.c
  62. +5
    -3
      source/Main/w_rain.c
  63. +3
    -3
      source/Main/w_spawn.c
  64. +9
    -5
      source/Main/w_time.c
  65. +13
    -14
      source/Main/w_world.c

BIN
pk7/acs/lithmain.bin View File


+ 1
- 1
pk7/lscripts/Effects/Rain.dec View File

@@ -24,7 +24,7 @@ actor Lith_RainDrop
{
Spawn:
TNT1 A 0
TNT1 A 0 ACS_NamedExecuteWithResult("Lith_RainDropSpawn")
TNT1 A 0 ACS_ExecuteWithResult(lsc_raindropspawn)
TNT1 A 0 A_ChangeVelocity(0, 0, frandom(-12, -16), CVF_REPLACE)
TNT1 A 0 A_SetScale(0.5, frandom(1.5, 3.5))
Looping:


+ 1
- 1
pk7/lscripts/Items/DivisionSigil.dec View File

@@ -41,7 +41,7 @@ actor Lith_DivisionSigil : Lith_ItemPickup
DIVI A 0 A_SpawnItemEx("Lith_DivisionSigilSprite", 0,0,0, 0,0,0, 0, Lith_ISF)
goto SpawnLoop
Pickup:
TNT1 A 0 A_JumpIf(CallACS("LPData", pdata_hassigil), "PickupNope")
TNT1 A 0 A_JumpIf(ACS_ExecuteWithResult(lsc_pdata, pdata_hassigil), "PickupNope")
TNT1 A 0 A_PlaySound("player/getsigil", CHAN_AUTO, 1.0, false, ATTN_NONE)
TNT1 A 0 ACS_NamedExecuteWithResult("Lith_GetSigil")
TNT1 A 0 A_RailWait


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

@@ -112,18 +112,18 @@ default

action(Weapon) void Lith_A_FirePistol()
{
if(CallACS("LPData", pdata_upgrade, UPGR_PlasPistol))
if(ACS_ExecuteWithResult(lsc_pdata, pdata_upgrade, UPGR_PlasPistol))
{
A_PlaySound("weapons/pistol/plasma/fire", CHAN_WEAPON);
A_FireProjectile("Lith_PlasmaPistolShot");
return;
}

if(CallACS("LPData", pdata_upgrade, UPGR_AutoPistol))
if(ACS_ExecuteWithResult(lsc_pdata, pdata_upgrade, UPGR_AutoPistol))
Lith_FireBullets(5, 3, 1, 10);
else
Lith_FireBullets(0, 0, -1, 9);
if(CallACS("LPData", pdata_upgrade, UPGR_AutoPistol))
if(ACS_ExecuteWithResult(lsc_pdata, pdata_upgrade, UPGR_AutoPistol))
A_PlaySound("weapons/pistol/fireauto", CHAN_WEAPON);
else
A_PlaySound("weapons/pistol/fire", CHAN_WEAPON);
@@ -172,7 +172,7 @@ FireFinish_Unscoped:
PISF B 1 bright offset(0, 45);
PISF B 1 bright offset(0, 40);
PISG C 1 offset(0, 36);
PISG A 0 A_JumpIf(CallACS("LPData", pdata_upgrade, UPGR_AutoPistol), "FireFinish_Auto_Unscoped");
PISG A 0 A_JumpIf(ACS_ExecuteWithResult(lsc_pdata, pdata_upgrade, UPGR_AutoPistol), "FireFinish_Auto_Unscoped");
PISG B 2 offset(0, 32) A_WeaponReady(WRF_ALLOWRELOAD);
PISG AAAAA 1 A_WeaponReady(WRF_ALLOWRELOAD);
goto ReadySelector;
@@ -182,7 +182,7 @@ FireFinish_Auto_Unscoped:
goto FireFinish_Auto_Scoped;
FireFinish_Scoped:
SCOP B 5 bright;
SCOP B 0 A_JumpIf(CallACS("LPData", pdata_upgrade, UPGR_AutoPistol), "FireFinish_Auto_Scoped");
SCOP B 0 A_JumpIf(ACS_ExecuteWithResult(lsc_pdata, pdata_upgrade, UPGR_AutoPistol), "FireFinish_Auto_Scoped");
SCOP BBBBB 1 A_WeaponReady(WRF_ALLOWRELOAD | WRF_NOBOB);
goto ReadySelector;
FireFinish_Auto_Scoped:


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

@@ -89,7 +89,7 @@ action(Weapon) void Lith_A_FireShotgun()
A_Recoil(0.4);
Lith_A_GunSmoke();

if(CallACS("LPData", pdata_upgrade, UPGR_PoisonShot))
if(ACS_ExecuteWithResult(lsc_pdata, pdata_upgrade, UPGR_PoisonShot))
{
Lith_FireBullets(5.3, 2.3, 7, 5, pufftype: "Lith_PoisonBullet");
A_PlaySound("weapons/shotgun/poison/fire", CHAN_WEAPON);
@@ -129,7 +129,7 @@ AltReady:
loop;
Ready:
SHTG A 0 {if(invoker.m_Just) invoker.m_Just--;}
SHTG A 0 A_JumpIf(CallACS("LPData", pdata_upgrade, UPGR_GaussShotty), "ReadyGauss");
SHTG A 0 A_JumpIf(ACS_ExecuteWithResult(lsc_pdata, pdata_upgrade, UPGR_GaussShotty), "ReadyGauss");
SHTG A 1 Lith_A_Ready(WRF_ALLOWRELOAD);
loop;
ReadyGauss:
@@ -153,7 +153,7 @@ SelectLoop:

Fire:
#### # 0 Lith_A_JumpIfNoSlot3OptAmmo;
#### # 0 A_JumpIf(CallACS("LPData", pdata_upgrade, UPGR_GaussShotty), "FireGauss");
#### # 0 A_JumpIf(ACS_ExecuteWithResult(lsc_pdata, pdata_upgrade, UPGR_GaussShotty), "FireGauss");
#### # 0 Lith_A_FireShotgun;
#### # 0 A_JumpIfInventory("Lith_WeaponScopedToken", 1, "FireFinish_Rail_Scoped");
FireFinish_Rail_Unscoped:
@@ -223,7 +223,7 @@ AltFire:
goto ReadySelector;

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


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

@@ -97,9 +97,9 @@ action(Weapon) void Lith_A_FireRifle()
Lith_A_MagIncr();
A_GunFlash("DummyFlash");
Lith_A_RecoilUp(0.4);
if(!CallACS("LPData", pdata_upgrade, UPGR_LaserRCW))
if(!ACS_ExecuteWithResult(lsc_pdata, pdata_upgrade, UPGR_LaserRCW))
{
if(CallACS("LPData", pdata_upgrade, UPGR_7777777))
if(ACS_ExecuteWithResult(lsc_pdata, pdata_upgrade, UPGR_7777777))
A_PlaySound("marathon/rifle/fire", CHAN_WEAPON);
else
{
@@ -130,7 +130,7 @@ action(Weapon) void Lith_A_FireRifleBurst()
A_GunFlash("DummyFlash");
for(int i = 0; i < 2; i++)
{
if(!CallACS("LPData", pdata_upgrade, UPGR_LaserRCW))
if(!ACS_ExecuteWithResult(lsc_pdata, pdata_upgrade, UPGR_LaserRCW))
{
A_PlaySound("weapons/rifle/firesnipe", CHAN_WEAPON);
Lith_FireBullets(1, 1, -3, 1, FBF_NORANDOM, "Lith_RifleBullet");
@@ -146,7 +146,7 @@ action(Weapon) void Lith_A_FireRifleBurst()
action(Weapon) void Lith_A_FireRifleGrenade()
{
invoker.m_GrenFire = true;
if(CallACS("LPData", pdata_upgrade, UPGR_7777777))
if(ACS_ExecuteWithResult(lsc_pdata, pdata_upgrade, UPGR_7777777))
A_PlaySound("marathon/rifle/grenade", CHAN_WEAPON);
else
A_PlaySound("weapons/rifle/grenade", CHAN_WEAPON);
@@ -180,8 +180,8 @@ SelectLoop:
loop;

Fire:
CRFG A 0 A_JumpIf(CallACS("LPData", pdata_riflemode) == rifle_firemode_burst, "FireBurstStart");
CRFG A 0 A_JumpIf(CallACS("LPData", pdata_riflemode) == rifle_firemode_grenade, "FireGrenade");
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 Lith_A_JumpIfMagEmpty;
CRFG B 1 bright Lith_A_FireRifle;
CRFG C 1 bright Lith_A_RecoilDn(0.35);
@@ -200,7 +200,7 @@ FireBurst:
loop;
FireBurstDone:
CRFG A 4;
CRFG A 2 A_JumpIf(!CallACS("LPData", pdata_upgrade, UPGR_LaserRCW), 2);
CRFG A 2 A_JumpIf(!ACS_ExecuteWithResult(lsc_pdata, pdata_upgrade, UPGR_LaserRCW), 2);
CRFG AAAAAA 1 A_Refire;
goto ReadySelector;
FireGrenade:
@@ -213,7 +213,7 @@ FireGrenade:
goto ReadySelector;
GrenadeReload:
CRFG A 1 offset(1, 32) {
if(CallACS("LPData", pdata_upgrade, UPGR_7777777))
if(ACS_ExecuteWithResult(lsc_pdata, pdata_upgrade, UPGR_7777777))
A_PlaySound("marathon/rifle/reload", CHAN_6);
else
A_PlaySound("weapons/rifle/rldmount", CHAN_6);
@@ -263,7 +263,7 @@ FireEmpty:
goto ReadySelector;

AltFire:
#### # 0 A_JumpIf(CallACS("LPData", pdata_upgrade, UPGR_RifleModes), "SwitchMode");
#### # 0 A_JumpIf(ACS_ExecuteWithResult(lsc_pdata, pdata_upgrade, UPGR_RifleModes), "SwitchMode");
goto FireGrenade;
SwitchMode:
CRFG A 0 ACS_ScriptCall("Lith_SwitchRifleFiremode", 0);


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

@@ -140,8 +140,8 @@ Fire:
GRLG A 0 {
invoker.m_Loaded = invoker.m_Iter = invoker.m_Mode = 0;
}
GRLG A 0 A_JumpIf(CallACS("LPData", pdata_upgrade, UPGR_ChargeRPG), "FireUnreal");
GRLG A 0 A_JumpIf(CallACS("LPData", pdata_upgrade, UPGR_HomingRPG), "FireHoming");
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 Lith_A_FireRocket;
FireAnim:
GRLG B 1 bright A_GunFlash;
@@ -179,10 +179,10 @@ Flash:

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


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

@@ -65,7 +65,7 @@ action(Weapon) void Lith_A_FireLaser()
A_TakeInventory("Lith_PlasmaAmmo", 10, TIF_NOTAKEINFINITE);
A_AlertMonsters();
A_FireBullets(0, 0, 1, 0, "Lith_PlasmaHit", FBF_NORANDOMPUFFZ);
A_RailAttack(CallACS("LPData", 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(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");
}

action(Weapon) void Lith_A_FireRail()
@@ -118,8 +118,8 @@ Select:
loop;

Fire:
PLSG A 0 A_JumpIf(CallACS("LPData", pdata_upgrade, UPGR_PlasLaser), "FireLaser");
PLSG A 0 A_JumpIf(CallACS("LPData", pdata_upgrade, UPGR_PartBeam), "FireParticleBeam");
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");
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(CallACS("LPData", pdata_upgrade, UPGR_PlasLaser), "FireReal");
PLSG A 0 A_JumpIf(CallACS("LPData", pdata_upgrade, UPGR_PartBeam), "FireReal");
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");
#### # 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;


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

@@ -88,13 +88,13 @@ AltReady:
loop;
Ready:
CNNG A 0 A_TakeInventory("Lith_GTFO", 999);
DCNG A 0 A_JumpIf(CallACS("LPData", pdata_upgrade, UPGR_DarkCannon), 2);
DCNG A 0 A_JumpIf(ACS_ExecuteWithResult(lsc_pdata, pdata_upgrade, UPGR_DarkCannon), 2);
CNNG A 0;
#### A 1 Lith_A_Ready;
loop;

Deselect:
DCNG A 0 A_JumpIf(CallACS("LPData", pdata_upgrade, UPGR_DarkCannon), 2);
DCNG A 0 A_JumpIf(ACS_ExecuteWithResult(lsc_pdata, pdata_upgrade, UPGR_DarkCannon), 2);
CNNG A 0;
#### A 0 Lith_A_ScopeOut;
DeselectLoop:
@@ -103,7 +103,7 @@ DeselectLoop:
loop;

Select:
DCNG A 0 A_JumpIf(CallACS("LPData", pdata_upgrade, UPGR_DarkCannon), 2);
DCNG A 0 A_JumpIf(ACS_ExecuteWithResult(lsc_pdata, pdata_upgrade, UPGR_DarkCannon), 2);
CNNG A 0;
#### A 0 Lith_A_ScopeOut;
SelectLoop:
@@ -112,9 +112,9 @@ SelectLoop:
loop;

Fire:
#### A 0 A_JumpIf(CallACS("LPData", pdata_upgrade, UPGR_OmegaRail), "FireRail");
#### A 0 A_JumpIf(CallACS("LPData", pdata_upgrade, UPGR_PunctCannon), "FirePunct");
#### A 0 A_JumpIf(CallACS("LPData", pdata_upgrade, UPGR_DarkCannon), "FireDark");
#### 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(CountInv("Lith_CannonAmmo") < 1, "FireEmpty");
CNNG C 1 bright offset(0, 48);
CNNG C 1 bright offset(0, 57) Lith_A_FireCannonSmall;
@@ -233,9 +233,9 @@ LoadAnim:
goto ReadySelector;

AltFire:
#### A 0 A_JumpIf(CallACS("LPData", pdata_upgrade, UPGR_OmegaRail), "Ready");
#### A 0 A_JumpIf(CallACS("LPData", pdata_upgrade, UPGR_DarkCannon), "Ready");
#### A 0 A_JumpIf(CallACS("LPData", pdata_upgrade, UPGR_PunctCannon), "ScopeToggle");
#### 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(CountInv("Lith_CannonAmmo") < 2, "FireEmpty");
CNNG A 10 A_PlaySound("weapons/cannon/prepare", CHAN_WEAPON);
CNNG A 1 bright;


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

@@ -153,7 +153,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(CallACS("LPData", pdata_upgrade, UPGR_Mateba_A) && invoker.Lith_MagEmpty())
if(ACS_ExecuteWithResult(lsc_pdata, pdata_upgrade, UPGR_Mateba_A) && invoker.Lith_MagEmpty())
return ResolveState("Finalize");
Lith_A_RecoilDn(0.2);
Lith_FireBullets(2, 2, -1, 30, FBF_NORANDOM);


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

@@ -129,7 +129,7 @@ Fire:
CSHG A 0 {
A_TakeInventory("Lith_ShellAmmo", 1, TIF_NOTAKEINFINITE);
Lith_A_Casing("Lith_CasShellHot", 30, 6, 20, FRandom(3,4), FRandom(7,8), FRandom(7,9));
if(!CallACS("LPData", pdata_upgrade, UPGR_SPAS_B))
if(!ACS_ExecuteWithResult(lsc_pdata, pdata_upgrade, UPGR_SPAS_B))
Lith_A_MagIncr();
// don't ask
if(Pos.Z - FloorZ >= 24)
@@ -141,12 +141,12 @@ Fire:
A_Recoil(0.7);
Lith_A_RecoilUp(0.4);
}
CSHG A 0 A_JumpIf(CallACS("LPData", pdata_upgrade, UPGR_SPAS_A), "FireVoid");
CSHG A 0 A_JumpIf(ACS_ExecuteWithResult(lsc_pdata, pdata_upgrade, UPGR_SPAS_A), "FireVoid");
CSHG A 0 {
Lith_FireBullets(10.5, 3.5, 12, 6);
Lith_A_GunSmoke();
}
CSHG A 0 A_JumpIf(CallACS("LPData", pdata_upgrade, UPGR_SPAS_B), "FireAuto");
CSHG A 0 A_JumpIf(ACS_ExecuteWithResult(lsc_pdata, pdata_upgrade, UPGR_SPAS_B), "FireAuto");
CSHG B 1 bright offset(0, 35) {A_Light(1); A_PlaySound("weapons/cshotgun/fire", CHAN_WEAPON);}
CSHG B 1 bright offset(0, 35);
CSHG C 1 bright offset(0, 34) {A_Light(2); Lith_A_RecoilDn(0.2);}
@@ -202,7 +202,7 @@ FireEmpty:
goto ReadySelector;

Reload:
CSHG A 0 A_JumpIf(CallACS("LPData", pdata_upgrade, UPGR_SPAS_B), "Ready");
CSHG A 0 A_JumpIf(ACS_ExecuteWithResult(lsc_pdata, pdata_upgrade, UPGR_SPAS_B), "Ready");
CSHG A 0 Lith_A_JumpIfMagFull;
CSHR ABCDE 1;
CSHR FG 2;


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

@@ -176,7 +176,7 @@ class Lith_ShockPuff : Lith_BulletPuff
A_PlaySound("weapons/erifle/zap");
A_SpawnItemEx("Lith_ShockEffect");
}
TNT1 A 0 A_JumpIf(CallACS("LPData", pdata_upgrade, UPGR_ShockRif_A, true), "Charged");
TNT1 A 0 A_JumpIf(ACS_ExecuteWithResult(lsc_pdata, pdata_upgrade, UPGR_ShockRif_A, true), "Charged");
goto Super::Spawn;
Melee:
Spawn:
@@ -185,9 +185,9 @@ class Lith_ShockPuff : Lith_BulletPuff
A_PlaySound("weapons/erifle/zap");
A_SpawnItemEx("Lith_ShockEffect");
}
TNT1 A 0 A_JumpIf(CallACS("LPData", pdata_upgrade, UPGR_ShockRif_B, true), "Binding");
TNT1 A 0 A_JumpIf(ACS_ExecuteWithResult(lsc_pdata, pdata_upgrade, UPGR_ShockRif_B, true), "Binding");
TNT1 A 0 A_GiveInventory("Lith_ShockEnemyGiver", 1, AAPTR_TRACER);
TNT1 A 0 A_JumpIf(CallACS("LPData", pdata_upgrade, UPGR_ShockRif_A, true), "Charged");
TNT1 A 0 A_JumpIf(ACS_ExecuteWithResult(lsc_pdata, pdata_upgrade, UPGR_ShockRif_A, true), "Charged");
stop;
Charged:
TNT1 A 0 A_SpawnItemEx("Lith_ShockEffect2", flags: SXF_TRANSFERPOINTERS|SXF_NOCHECKPOSITION);


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

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

if(CallACS("LPData", pdata_upgrade, UPGR_SMG_B))
if(ACS_ExecuteWithResult(lsc_pdata, pdata_upgrade, UPGR_SMG_B))
A_FireProjectile("Lith_SMGTracer3", spx, pitch: spy);
else
Lith_FireBullets(spx, spy, -1, 8, FBF_NORANDOM|FBF_EXPLICITANGLE);
@@ -194,7 +194,7 @@ states(Weapon)
{
Ready:
CSMG A 0 {
if(CallACS("LPData", pdata_upgrade, UPGR_SMG_A)) invoker.m_Max = 150;
if(ACS_ExecuteWithResult(lsc_pdata, pdata_upgrade, UPGR_SMG_A)) invoker.m_Max = 150;
else invoker.m_Max = 50;
}
CSMG A 1 Lith_A_Ready(WRF_ALLOWRELOAD|WRF_ALLOWUSER1);
@@ -216,11 +216,11 @@ 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(!CallACS("LPData", pdata_upgrade, UPGR_SMG_C), 2);
CSMG A 0 A_JumpIf(!ACS_ExecuteWithResult(lsc_pdata, pdata_upgrade, UPGR_SMG_C), 2);
CSMG A 0 A_JumpIfInventory("Lith_SMGHeat", 450, "Ready");
CSMG A 0 A_PlaySound("weapons/smg/fire", CHAN_WEAPON, 1, true);
Fire1:
CSMG A 0 A_JumpIf(!CallACS("LPData", pdata_upgrade, UPGR_SMG_C), 2);
CSMG A 0 A_JumpIf(!ACS_ExecuteWithResult(lsc_pdata, pdata_upgrade, UPGR_SMG_C), 2);
CSMG A 0 A_JumpIfInventory("Lith_SMGHeat", 450, "FireAnim1");
CSMG A 0 A_GiveInventory("Lith_SMGHeat", Random(14,27));
CSMG A 0 A_JumpIfInventory("Lith_SMGHeat", 0, "ReloadHeatFromFiring");
@@ -322,7 +322,7 @@ ReloadFromFiring:
}
Reload:
CSMG A 0 Lith_A_JumpIfMagFull;
CSMG A 0 A_JumpIf(CallACS("LPData", pdata_upgrade, UPGR_SMG_A), "ReloadLong");
CSMG A 0 A_JumpIf(ACS_ExecuteWithResult(lsc_pdata, pdata_upgrade, UPGR_SMG_A), "ReloadLong");
CSMG A 1 A_PlaySound("weapons/smg/lift", CHAN_7);
CSMG D 1 offset(-2, 34);
CSMG E 1 offset(-4, 37);


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

@@ -109,7 +109,7 @@ class Lith_IonRifleExplosion : Actor
TNT1 A 0;
TNT1 A 1 A_Explode(96, 256, 0);
TNT1 A 0 {
if(CallACS("LPData", pdata_upgrade, UPGR_IonRifle_A, true))
if(ACS_ExecuteWithResult(lsc_pdata, pdata_upgrade, UPGR_IonRifle_A, true))
A_RadiusGive("Lith_Ionized", 192, RGF_MONSTERS, 1);
for(int i = 0; i < 26; i++)
{
@@ -245,7 +245,7 @@ Fire:
#### # 0 A_JumpIf(CountInv("Lith_RocketAmmo") == 0, "FireEmpty");
#### # 0 Lith_A_JumpIfMagEmpty;
#### # 0 {invoker.m_Charge = 1;}
#### # 0 A_JumpIf(CallACS("LPData", pdata_upgrade, UPGR_IonRifle_B), 1);
#### # 0 A_JumpIf(ACS_ExecuteWithResult(lsc_pdata, pdata_upgrade, UPGR_IonRifle_B), 1);
goto DoFire;
#### # 2;
#### # 1 A_ReFire(1);


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

@@ -109,7 +109,7 @@ Select:

Fire:
CPLG A 0 A_JumpIf(CountInv("Lith_PlasmaAmmo") == 0, "FireEmpty");
CPLG A 0 A_JumpIf(CallACS("LPData", pdata_upgrade, UPGR_CPlasma_A), "FirePulse");
CPLG A 0 A_JumpIf(ACS_ExecuteWithResult(lsc_pdata, 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);


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

@@ -315,12 +315,12 @@ default
action(Weapon) void Lith_A_FireStar()
{
A_GunFlash("DummyFlash");
if(CallACS("LPData", pdata_upgrade, UPGR_ShipGun_A))
if(ACS_ExecuteWithResult(lsc_pdata, pdata_upgrade, UPGR_ShipGun_A))
{
A_PlaySound("weapons/shipgun/firesol", CHAN_5);
A_FireProjectile("Lith_Solspear");
}
else if(CallACS("LPData", pdata_upgrade, UPGR_ShipGun_B))
else if(ACS_ExecuteWithResult(lsc_pdata, pdata_upgrade, UPGR_ShipGun_B))
{
A_PlaySound("weapons/shipgun/firesurge", CHAN_5);
CallACS("Lith_SurgeOfDestiny");


+ 6
- 6
pk7/lzscript/Client/Draw.zsc View File

@@ -331,8 +331,8 @@ static void LT(Actor mo, string txt, string fnt, int arg0, int arg1, int arg2)
ww = FONT_SPACE;
else
{
let metr = CallACS("Lith_GetFontMetric", ucp);
let xadv = CallACS("Lith_Metr_Xadv", metr);
let metr = ACS_ExecuteWithResult(lsc_getfontmetric, ucp);
let xadv = ACS_ExecuteWithResult(lsc_metr_xadv, metr);
ww = xadv;
}

@@ -632,10 +632,10 @@ private ui void DrawTextUnicode(int scw, int sch, int i)
x += FONT_SPACE;
else
{
int metr = CallACS("Lith_GetFontMetric", ucp);
int gfx_ = CallACS("Lith_Metr_Tex", metr);
let xadv = CallACS("Lith_Metr_Xadv", metr);
let yofs = CallACS("Lith_Metr_Yofs", metr);
int metr = ACS_ExecuteWithResult(lsc_getfontmetric, ucp);
int gfx_ = ACS_ExecuteWithResult(lsc_metr_tex, metr);
let xadv = ACS_ExecuteWithResult(lsc_metr_xadv, metr);
let yofs = ACS_ExecuteWithResult(lsc_metr_yofs, metr);
if(gfx_ < 0) continue;

textureid gfx; gfx.SetNull(); gfx += gfx_;


+ 1
- 1
pk7/lzscript/Client/StatScreen.zsc View File

@@ -129,7 +129,7 @@ override void DrawStats()
Lith_DrawPrct(1, "* (SETQ ITEMS", cnt_items [0], wbs.maxitems );
Lith_DrawPrct(2, "* (SETQ SCRTS", cnt_secret[0], wbs.maxsecret);

int souls = CallACS("LWData", wdata_soulsfreed);
int souls = ACS_ExecuteWithResult(lsc_wdata, wdata_soulsfreed);
if(souls) Lith_DrawCent(160, 120, (souls * m_Souls) .. " SOULS FREED");

Lith_DrawCent(160, 0, "(LEAVE-AREA)");


+ 16
- 0
pk7/lzscript/Constants/w_data.zsc View File

@@ -85,4 +85,20 @@ enum LDamageType
ldt_none
};

enum LScriptNum
{
lsc_getfontmetric = 17100,
lsc_metr_xadv,
lsc_metr_yofs,
lsc_metr_tex,
lsc_metr_w,
lsc_metr_h,
lsc_drawplayericon,
lsc_pdata,
lsc_wdata,
lsc_addangle,
lsc_monsterinfo,
lsc_raindropspawn,
};

// EOF

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

@@ -226,7 +226,7 @@ override void PostBeginPlay()
Super.PostBeginPlay();
Lith_A_SmokeFX();
Lith_A_RicochetFX();
if(CallACS("LPData", pdata_upgrade, UPGR_TorgueMode, true))
if(ACS_ExecuteWithResult(lsc_pdata, pdata_upgrade, UPGR_TorgueMode, true))
A_SpawnItemEx("Lith_EXPLOOOSION", flags: SXF_TRANSFERPOINTERS|SXF_NOCHECKPOSITION);
}



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

@@ -19,7 +19,7 @@ class Lith_ItemGlow : Actor
{
sprite = Actor.GetSpriteIndex("PBAL");

switch(CallACS("LWData", wdata_pclass))
switch(ACS_ExecuteWithResult(lsc_wdata, wdata_pclass))
{
case pcl_marine: frame = Ch_A - Ch_A; break;
case pcl_cybermage: frame = Ch_C - Ch_A; break;


+ 9
- 9
pk7/lzscript/Player.zsc View File

@@ -89,7 +89,7 @@ override void PlayerThink()
{
if(level.levelnum == 1911777) return;

if(CallACS("LPData", pdata_semifrozen))
if(ACS_ExecuteWithResult(lsc_pdata, pdata_semifrozen))
{
UserCmd cmd = player.cmd;
cmd.pitch = cmd.yaw = cmd.roll = 0;
@@ -106,7 +106,7 @@ private void Lith_RainEffect()
Shader.SetUniform1f(player, "Lith_Rain", "lith_t", level.totaltime / 15.);
Shader.SetUniform1f(player, "Lith_Rain", "lith_m", m_RainLerp);

if(player && CallACS("LWData", wdata_dorain) &&
if(player && ACS_ExecuteWithResult(lsc_wdata, wdata_dorain) &&
ceilingpic == skyflatnum && pitch < -5)
{
float m = -pitch - 5;
@@ -124,7 +124,7 @@ private void Lith_RainEffect()

private void Lith_ItemVacuum()
{
if(CallACS("LWData", wdata_fun) & 2)
if(ACS_ExecuteWithResult(lsc_wdata, wdata_fun) & 2)
for(let it = BlockThingsIterator.Create(self, 70); it.next();)
{
if(Inventory(it.thing))
@@ -205,8 +205,8 @@ private void Lith_Crosshair()
if(gamestate == GS_TITLELEVEL) return;

// get the "actual" view angles
float rp = pitch + CallACS("LPData", pdata_addp)/FIX * 180;
float ry = angle + CallACS("LPData", pdata_addy)/FIX * 360;
float rp = pitch + ACS_ExecuteWithResult(lsc_pdata, pdata_addp)/FIX * 180;
float ry = angle + ACS_ExecuteWithResult(lsc_pdata, pdata_addy)/FIX * 360;

// trace to where the crosshair should be in world space
float sz = height / 2 + attackzoffset * player.crouchfactor;
@@ -218,7 +218,7 @@ private void Lith_Crosshair()
int xhx, xhy; [xhx, xhy] = Lith_Unproject(ltd.hitlocation);

// draw a tracer for targeting system
if(tracer && tracer.health > 0 && CallACS("LPData", pdata_weapon) == weapon_launcher)
if(tracer && tracer.health > 0 && ACS_ExecuteWithResult(lsc_pdata, pdata_weapon) == weapon_launcher)
{
int thx, thy; bool ok; [thx, thy, ok] = Lith_Unproject(tracer.pos + (0, 0, tracer.height / 2));
if(ok) Lith_URANUS.LL(self, xhx, xhy, thx, thy, "red");
@@ -242,7 +242,7 @@ private void Lith_Crosshair()

if(CVar.GetCVar('lith_xhair_enablejuicer', player).getBool())
{
int xp = ceil(CallACS("LPData", pdata_recoilp)/FIX * 500) + 10;
int xp = ceil(ACS_ExecuteWithResult(lsc_pdata, pdata_recoilp)/FIX * 500) + 10;

Lith_URANUS.LS(self, ":XHairs:L", xhx - xp, xhy, 0, 0, a/255., c);
Lith_URANUS.LS(self, ":XHairs:R", xhx + xp, xhy, 0, 0, a/255., c);
@@ -254,7 +254,7 @@ private void Lith_PlayerIndicator(PlayerInfo p)
let mo = p.MO;

int x, y; bool seen; [x, y, seen] = Lith_Unproject(mo.pos + (0, 0, mo.height));
if(seen) CallACS("Lith_DrawPlayerIcon", mo.PlayerNumber(), x, y);
if(seen) ACS_ExecuteWithResult(lsc_drawplayericon, mo.PlayerNumber(), x, y);
}

void Lith_PreTick()
@@ -269,7 +269,7 @@ void Lith_PreTick()
m_QY = Lith_Quaternion.Create(- angle, 0, 0, 1);

// stupid hack to keep the view from moving around
if(CallACS("LPData", pdata_semifrozen))
if(ACS_ExecuteWithResult(lsc_pdata, pdata_semifrozen))
{
angle -= 1;
pitch -= 1;


+ 2
- 2
pk7/lzscript/Playsim/Events.zsc View File

@@ -96,9 +96,9 @@ override void WorldThingSpawned(WorldEvent ev)

if(th.bISMONSTER)
{
th.ACS_NamedExecuteAlways("Lith_MonsterInfo");
Level.ExecuteSpecial(84, th, null, false, lsc_monsterinfo);

if(CallACS("LWData", wdata_fun) & lfun_ragnarok)
if(ACS_ExecuteWithResult(lsc_wdata, wdata_fun) & lfun_ragnarok)
Lith_HERMES.PrepareForRagnarok(th);

if(m_BossLevel && th.bBOSS)


+ 3
- 3
pk7/lzscript/Playsim/Monsters.zsc View File

@@ -29,7 +29,7 @@ static void PrepareForRagnarok(Actor mo)
static void MonsterBarrierLook(Actor mo)
{
for(let it = BlockThingsIterator.Create(mo, 192*2); it.Next();)
if(it.Thing.Player) CallACS("Lith_AddAngle", it.Thing.Pos.X, it.Thing.Pos.Y);
if(it.Thing.Player) ACS_ExecuteWithResult(lsc_addangle, it.Thing.Pos.X, it.Thing.Pos.Y);
}

static void SpawnBoss(Actor a, string name, int phase)
@@ -104,13 +104,13 @@ static void SpawnBoss(Actor a, string name, int phase)

static void TriggerBoss()
{
if(CallACS("LWData", wdata_bossspawned)) return;
if(ACS_ExecuteWithResult(lsc_wdata, wdata_bossspawned)) return;

Actor mo;
for(let it = ThinkerIterator.Create(); (mo = Actor(it.Next()));)
{
if(mo.bISMONSTER && mo.Health >= 500) {
mo.ACS_NamedExecuteAlways("Lith_SpawnBoss", 0);
mo.ACS_ScriptCall("Lith_SpawnBoss", 0);
break;
}
}


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

@@ -5,7 +5,7 @@
class Lith_Explosive : Actor;

bool CheckMarathon(bool target = true)
{return CallACS("LPData", pdata_upgrade, UPGR_7777777, target);}
{return ACS_ExecuteWithResult(lsc_pdata, pdata_upgrade, UPGR_7777777, target);}

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


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

@@ -24,16 +24,16 @@ states
Crash:
TNT1 A 0;
TNT1 A 0 A_Explode(7, 32, 0);
TNT1 A 0 A_JumpIf(CallACS("LPData", pdata_upgrade, UPGR_7777777, true), "CrashMarathon");
TNT1 A 0 A_JumpIf(ACS_ExecuteWithResult(lsc_pdata, pdata_upgrade, UPGR_7777777, true), "CrashMarathon");
goto Super::Spawn;
Spawn:
TNT1 A 0;
TNT1 A 0 A_Explode(7, 32, 0);
TNT1 A 0 A_JumpIf(CallACS("LPData", pdata_upgrade, UPGR_7777777, true), "SpawnMarathon");
TNT1 A 0 A_JumpIf(ACS_ExecuteWithResult(lsc_pdata, pdata_upgrade, UPGR_7777777, true), "SpawnMarathon");
goto Super::Spawn;
XDeath:
TNT1 A 0;
TNT1 A 0 A_JumpIf(!CallACS("LPData", pdata_upgrade, UPGR_7777777, true), 2);
TNT1 A 0 A_JumpIf(!ACS_ExecuteWithResult(lsc_pdata, pdata_upgrade, UPGR_7777777, true), 2);
TNT1 A 0 A_PlaySound("marathon/hit", CHAN_6);
TNT1 A 0 A_Explode(7, 32, 0);
stop;


+ 4
- 4
pk7/lzscript/Weapons.zsc View File

@@ -97,13 +97,13 @@ action(Weapon) void Lith_A_ReloadFinish()

action(Weapon) void Lith_A_TakeSlot3OptAmmo(int amt = 1)
{
if(CallACS("LPData", pdata_slot3ammo))
if(ACS_ExecuteWithResult(lsc_pdata, pdata_slot3ammo))
self.A_TakeInventory("Lith_ShellAmmo", amt, TIF_NOTAKEINFINITE);
}

action(Weapon) state Lith_A_JumpIfNoSlot3OptAmmo(statelabel sn = "FireEmpty", int req = 1)
{
if(!CallACS("LPData", pdata_slot3ammo) || self.CountInv("Lith_ShellAmmo") >= req)
if(!ACS_ExecuteWithResult(lsc_pdata, pdata_slot3ammo) || self.CountInv("Lith_ShellAmmo") >= req)
return null;
else
return ResolveState(sn);
@@ -126,7 +126,7 @@ action(Weapon) void Lith_A_ScopeIn()
if(!CountInv("Lith_WeaponScopedToken"))
{
A_GiveInventory("Lith_WeaponScopedToken", 1);
A_ZoomFactor((1+CallACS("LPData", pdata_weaponzoom)/FIX)*invoker.m_ScopeZoom);
A_ZoomFactor((1+ACS_ExecuteWithResult(lsc_pdata, pdata_weaponzoom)/FIX)*invoker.m_ScopeZoom);
A_PlaySound(invoker.m_ScopeInSnd, CHAN_6);
}
}
@@ -148,7 +148,7 @@ action(Weapon) void Lith_A_ScopeToggle()
}

action(Weapon) void Lith_A_ZoomFactorScoped(float amount)
{A_ZoomFactor((1+CallACS("LPData", pdata_weaponzoom))/FIX * amount * invoker.m_ScopeZoom);}
{A_ZoomFactor((1+ACS_ExecuteWithResult(lsc_pdata, pdata_weaponzoom))/FIX * amount * invoker.m_ScopeZoom);}

action(Weapon) void Lith_GunSmoke(class<Actor> type, float x, float y)
{A_FireProjectile(type, 0, 0, x, y, FPF_NOAUTOAIM);}


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

@@ -107,7 +107,7 @@ Fire:
goto Release1;
Fire1:
CFIS A 0 A_GiveInventory("Lith_FistCharge", 35);
CFIS A 0 A_JumpIf(CallACS("LPData", pdata_pclass) == pcl_marine, 2);
CFIS A 0 A_JumpIf(ACS_ExecuteWithResult(lsc_pdata, pdata_pclass) == pcl_marine, 2);
CCFS A 0;
#### A 1 A_PlaySound("weapons/cfist/ready", CHAN_6);
#### B 1 A_PlaySound("weapons/cfist/charge", CHAN_5, 1, true);
@@ -124,7 +124,7 @@ Release:
TNT1 A 0 A_PlaySound("weapons/cfist/chargeend", CHAN_5);
TNT1 A 0 A_GunFlash("SekritHax", GFF_NOEXTCHANGE); // OH NO NOT yholehax
Release1:
CFI2 A 0 A_JumpIf(CallACS("LPData", pdata_pclass) == pcl_marine, "Release2");
CFI2 A 0 A_JumpIf(ACS_ExecuteWithResult(lsc_pdata, pdata_pclass) == pcl_marine, "Release2");
CCF2 A 0;
// GOTTA RELEASE FAST
Release2:
@@ -160,7 +160,7 @@ HitRecoil:
goto ReadySelector;
// the crimera has struck again
SekritHax:
CFIS A 0 A_JumpIf(CallACS("LPData", pdata_pclass) == pcl_marine, 2);
CFIS A 0 A_JumpIf(ACS_ExecuteWithResult(lsc_pdata, pdata_pclass) == pcl_marine, 2);
CCFS A 0;
#### HI 1;
stop;


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

@@ -19,7 +19,7 @@ bool m_KnifeReFire;
states(Weapon)
{
User4:
#### # 0 {return CallACS("LPData", pdata_pclass) == pcl_marine ? null : ResolveState("ReadySelector");}
#### # 0 {return ACS_ExecuteWithResult(lsc_pdata, pdata_pclass) == pcl_marine ? null : ResolveState("ReadySelector");}
_UseKnife:
#### # 0 A_JumpIfInventory("Lith_WeaponScopedToken", 1, "ReadySelector");
#### # 0 A_JumpIf(invoker.m_KnifeReFire, "_KnifeStart");


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

@@ -28,7 +28,7 @@ class Lith_IReallyHateTheseNoisyWings : Lith_CustomFunction
{
Pickup:
TNT1 A 0 {
Thing_Hate(0, CallACS("LWData", wdata_ptid), 0);
Thing_Hate(0, ACS_ExecuteWithResult(lsc_wdata, wdata_ptid), 0);
A_Die();
}
stop;


+ 16
- 0
pk7_dt/dtzsc/wdata.zsc View File

@@ -85,4 +85,20 @@ enum LDamageType
ldt_none
};

enum LScriptNum
{
lsc_getfontmetric = 17100,
lsc_metr_xadv,
lsc_metr_yofs,
lsc_metr_tex,
lsc_metr_w,
lsc_metr_h,
lsc_drawplayericon,
lsc_pdata,
lsc_wdata,
lsc_addangle,
lsc_monsterinfo,
lsc_raindropspawn,
};

// EOF

+ 16
- 0
source/Headers/w_data.h View File

@@ -85,4 +85,20 @@ enum // LDamageType
ldt_none
};

enum // LScriptNum
{
lsc_getfontmetric = 17100,
lsc_metr_xadv,
lsc_metr_yofs,
lsc_metr_tex,
lsc_metr_w,
lsc_metr_h,
lsc_drawplayericon,
lsc_pdata,
lsc_wdata,
lsc_addangle,
lsc_monsterinfo,
lsc_raindropspawn,
};

// EOF

source/Main/m_debug.c → source/Main/debug.c View File

@@ -2,7 +2,7 @@
// By Alison Sanderson. Attribution is encouraged, though not required.
// See licenses/cc0.txt for more information.

// m_debug.c: Debugging functions.
// debug.c: Debugging functions.

#include "common.h"
#include "p_player.h"
@@ -10,20 +10,12 @@
#include <stdio.h>
#include <GDCC.h>

// Extern Objects ------------------------------------------------------------|

str dbgstat[64], dbgnote[64];
i32 dbgstatnum, dbgnotenum;

script_str ext("ACS")
void Lith_GiveMeAllOfTheScore(void)
{
withplayer(LocalPlayer) p->giveScore(0x7FFFFFFFFFFFFFFFFFFFFFFFLL, true);
}

script_str ext("ACS")
void Lith_DumpAlloc(void)
{
__GDCC__alloc_dump();
}
// Extern Functions ----------------------------------------------------------|

void Lith_DebugStat(char const *fmt, ...)
{
@@ -90,4 +82,45 @@ void Lith_PrintMem(void const *data, size_t size)
puts("\nEOF\n\n");
}

// Scripts -------------------------------------------------------------------|

script_str ext("ACS") addr("Lith_GiveMail")
void Sc_DbgGiveMail(i32 num)
{
static str const names[] = {
s"Intro",
s"Cluster1",
s"Cluster2",
s"Cluster3",
s"Phantom",
s"JamesDefeated",
s"MakarovDefeated",
s"IsaacDefeated"
};

num %= countof(names);

withplayer(LocalPlayer)
p->deliverMail(names[num]);
}

script_str ext("ACS") addr("Lith_GiveMeAllOfTheScore")
void Sc_DbgGiveScore(void)
{
withplayer(LocalPlayer) p->giveScore(0x7FFFFFFFFFFFFFFFFFFFFFFFLL, true);
}

script_str ext("ACS") addr("Lith_DumpAlloc")
void Sc_DbgDumpAlloc(void)
{
__GDCC__alloc_dump();
}

script_str ext("ACS") addr("Lith_PrintMonsterInfo")
void Sc_PrintMonsterInfo(void)
{
extern void PrintMonsterInfo(void);
PrintMonsterInfo();
}

// EOF

+ 22
- 12
source/Main/dialogue_vm.c View File

@@ -285,13 +285,9 @@ static void ResetText(struct vm *vm)
vm->textV[0] = '\0';
}

// Extern Functions ----------------------------------------------------------|

script_str ext("ACS")
void Lith_TeleportOutEffect(struct player *p)
script
static void TeleportOutEffect(struct player *p)
{
if(!p) p = LocalPlayer;

ACS_AmbientSound(ss_misc_teleout, 127);

ACS_SetHudSize(320, 200);
@@ -308,6 +304,8 @@ void Lith_TeleportOutEffect(struct player *p)
}
}

// Extern Functions ----------------------------------------------------------|

// Main dialogue VM.
script
void Lith_DialogueVM(struct player *p, i32 num)
@@ -406,7 +404,7 @@ opDCD_TELEPORT_INTRALEVEL:
HLT;
opDCD_TELEPORT_INTERLEVEL:
ACS_Delay(5);
Lith_TeleportOutEffect(p);
TeleportOutEffect(p);
ACS_Delay(34);
ACS_Teleport_NewMap(IMM, 0, 0);
HLT;
@@ -522,8 +520,16 @@ done:
p->indialogue -= 2;
}

script_str ext("ACS")
void Lith_RunDialogue(i32 num)
// Scripts -------------------------------------------------------------------|

script_str ext("ACS") addr("Lith_TeleportOutEffect")
void Sc_TeleportOutEffect(struct player *p)
{
withplayer(LocalPlayer) TeleportOutEffect(p);
}

script_str ext("ACS") addr("Lith_RunDialogue")
void Sc_RunDialogue(i32 num)
{
withplayer(LocalPlayer) if(!p->indialogue)
{
@@ -532,10 +538,14 @@ void Lith_RunDialogue(i32 num)
}
}

script_str ext("ACS")
void Lith_RunTerminal(i32 num)
script_str ext("ACS") addr("Lith_RunTerminal")
void Sc_RunTerminal(i32 num)
{
Lith_RunDialogue(-num);
withplayer(LocalPlayer) if(!p->indialogue)
{
p->dlgnum = -num;
p->indialogue++;
}
}
#endif



+ 1
- 1
source/Main/m_math.c View File

@@ -18,7 +18,7 @@
static u64 lmvar crctable[256]; // NB: Don't try to hash >8bit data.
static bool lmvar crcinit;

static void InitCRC64()
static void InitCRC64(void)
{
u64 const polynomial = 0xC96C5795D7870F42; // ECMA 182



+ 9
- 27
source/Main/p_bip.c View File

@@ -259,16 +259,6 @@ struct page *Lith_UnlockBIPPage(struct bip *bip, char const *name, i32 pclass)
return page;
}

script_str ext("ACS")
void Lith_BIPUnlock(i32 pnum)
{
withplayer(&players[pnum])
{
bip_name_t tag; lstrcpy_str(tag, GetMembS(0, sm_InfoPage));
p->bipUnlock(tag);
}
}

script
void Lith_DeallocateBIP(struct bip *bip)
{
@@ -314,24 +304,16 @@ struct page_info Lith_GetPageInfo(struct page const *page)
return pinf;
}

script_str ext("ACS")
void Lith_GiveMail(i32 num)
{
static str const names[] = {
s"Intro",
s"Cluster1",
s"Cluster2",
s"Cluster3",
s"Phantom",
s"JamesDefeated",
s"MakarovDefeated",
s"IsaacDefeated"
};

num %= countof(names);
// Scripts -------------------------------------------------------------------|

withplayer(LocalPlayer)
p->deliverMail(names[num]);
script_str ext("ACS") addr("Lith_BIPUnlock")
void Sc_UnlockPage(i32 pnum)
{
withplayer(&players[pnum])
{
bip_name_t tag; lstrcpy_str(tag, GetMembS(0, sm_InfoPage));
p->bipUnlock(tag);
}
}

// EOF

+ 2
- 2
source/Main/p_cbi.c View File

@@ -158,8 +158,8 @@ void Lith_PlayerResetCBIGUI(struct player *p)

// Scripts -------------------------------------------------------------------|

script_str ext("ACS") type("net")
void Lith_KeyOpenCBI(void)
script_str ext("ACS") type("net") addr("Lith_KeyOpenCBI")
void Sc_OpenCBI(void)
{
if(ACS_Timer() < 10) return;



+ 10
- 8
source/Main/p_data.c View File

@@ -149,14 +149,6 @@ void Lith_PlayerUpdateData(struct player *p)
p->kbs = InvNum(so_BlueSkull);
}

script_str ext("ACS")
void Lith_KeyDown(i32 pnum, i32 ch)
{
withplayer(&players[pnum])
if(p->tbptr + 1 < countof(p->txtbuf))
p->txtbuf[p->tbptr++] = ch;
}

script
static void LevelUp(struct player *p, u32 attr[at_max])
{
@@ -358,4 +350,14 @@ void Lith_PlayerUpdateStats(struct player *p)
SetPropK(0, APROP_JumpZ, p->jumpheight * boost);
}

// Scripts -------------------------------------------------------------------|

script_str ext("ACS") addr("Lith_KeyDown")
void Sc_KeyDown(i32 pnum, i32 ch)
{
withplayer(&players[pnum])
if(p->tbptr + 1 < countof(p->txtbuf))
p->txtbuf[p->tbptr++] = ch;
}

// EOF

+ 80
- 78
source/Main/p_items.c View File

@@ -303,84 +303,6 @@ void Lith_PlayerUpdateInventory(struct player *p)
if(it->Tick) it->Tick(it);
}

script_str ext("ACS")
void *Lith_ItemCreate(i32 w, i32 h)
{
str type = GetMembS(0, sm_InvType);
str tag = GetMembS(0, sm_InvName);
u32 scr = GetMembI(0, sm_InvSell);
str spr = StrParam(":ItemSpr:%S", tag);
str name = GetPropS(0, APROP_NameTag);

LogDebug(log_dev, "Lith_ItemCreate: creating %S (%S) %S", type, tag, spr);

#define Type(t, ...) \
if(type == t) \
return Lith_Item_New(&(struct itemdata const){name, spr, tag, w, h, scr, __VA_ARGS__})

Type(si_SlottedItem, .Use = Lith_Item_Use);
Type(si_Armor, .Use = Lith_Item_Use);

return nil;
}

script_str ext("ACS")
bool Lith_ItemAttach(void *_item)
{
struct item *item = _item;

LogDebug(log_dev, "Lith_ItemAttach: attaching item %p", item);

withplayer(LocalPlayer)
{
bip_name_t tag; lstrcpy_str(tag, item->tag);
p->bipUnlock(tag);
return p->addItem(item);
}

return false;
}

script_str ext("ACS")
void Lith_ItemDetach(void *_item)
{
struct item *item = _item;

LogDebug(log_dev, "Lith_ItemDetach: detaching item %p", item);

item->Destroy(item);
}

script_str ext("ACS")
void Lith_ItemUnlink(void *_item)
{
struct item *item = _item;

LogDebug(log_dev, "Lith_ItemUnlink: unlinking item %p", item);

withplayer(LocalPlayer)
{
item->Place(item, &p->misc);
item->x = item->y = 0;

p->selitem = nil;
p->movitem = false;
}
}

script_str ext("ACS")
bool Lith_ItemCanPlace(void *_item)
{
struct item *item = _item;

withplayer(LocalPlayer)
for(i32 i = 0; i < countof(p->inv); i++)
if(ItemCanPlaceAny(&p->inv[i], item))
return true;

return false;
}

void Lith_CBITab_Items(struct gui_state *g, struct player *p)
{
static i32 const x[] = {
@@ -456,6 +378,86 @@ void Lith_CBITab_Items(struct gui_state *g, struct player *p)
ifw(str name = ServCallS(sm_GetArmorSlot, i), name != s_NIL)
PrintText_str(name, s_cbifont, CR_WHITE, 40,1, 45+7*i,1);
}

// Scripts -------------------------------------------------------------------|

script_str ext("ACS") addr("Lith_ItemCreate")
void *Sc_ItemCreate(i32 w, i32 h)
{
str type = GetMembS(0, sm_InvType);
str tag = GetMembS(0, sm_InvName);
u32 scr = GetMembI(0, sm_InvSell);
str spr = StrParam(":ItemSpr:%S", tag);
str name = GetPropS(0, APROP_NameTag);

LogDebug(log_dev, "Lith_ItemCreate: creating %S (%S) %S", type, tag, spr);

#define Type(t, ...) \
if(type == t) \
return Lith_Item_New(&(struct itemdata const){name, spr, tag, w, h, scr, __VA_ARGS__})

Type(si_SlottedItem, .Use = Lith_Item_Use);
Type(si_Armor, .Use = Lith_Item_Use);

return nil;
}

script_str ext("ACS") addr("Lith_ItemAttach")
bool Sc_ItemAttach(void *_item)
{
struct item *item = _item;

LogDebug(log_dev, "Lith_ItemAttach: attaching item %p", item);

withplayer(LocalPlayer)
{
bip_name_t tag; lstrcpy_str(tag, item->tag);
p->bipUnlock(tag);
return p->addItem(item);
}

return false;
}

script_str ext("ACS") addr("Lith_ItemDetach")
void Sc_ItemDetach(void *_item)
{
struct item *item = _item;

LogDebug(log_dev, "Lith_ItemDetach: detaching item %p", item);

item->Destroy(item);
}

script_str ext("ACS") addr("Lith_ItemUnlink")
void Sc_ItemUnlink(void *_item)
{
struct item *item = _item;

LogDebug(log_dev, "Lith_ItemUnlink: unlinking item %p", item);

withplayer(LocalPlayer)
{
item->Place(item, &p->misc);
item->x = item->y = 0;

p->selitem = nil;
p->movitem = false;
}
}

script_str ext("ACS") addr("Lith_ItemCanPlace")
bool Sc_ItemCanPlace(void *_item)
{
struct item *item = _item;

withplayer(LocalPlayer)
for(i32 i = 0; i < countof(p->inv); i++)
if(ItemCanPlaceAny(&p->inv[i], item))
return true;

return false;
}
#endif

// EOF

+ 17
- 15
source/Main/p_log.c View File

@@ -118,21 +118,6 @@ void Lith_PlayerLogEntry(struct player *p)
p->logF(LC(LANG "ENTER_FMT"), lm->name, time);
}

script_str ext("ACS")
void Lith_LogS(i32 levl, i32 type)
{
str name = ServCallS(sm_GetLogName);

if(name[0] == '_') name = Language(LANG "LOG%S", name);

withplayer(LocalPlayer) switch(type) {
case msg_ammo: if(p->getCVarI(sc_player_ammolog))
case msg_huds: p->logH(levl, "%S", name); break;
case msg_full: p->logF( "%S", name); break;
case msg_both: p->logB(levl, "%S", name); break;
}
}

script
void Lith_PlayerUpdateLog(struct player *p)
{
@@ -217,4 +202,21 @@ void Lith_HUD_Log(struct player *p, i32 cr, i32 x, i32 yy)
}
}

// Scripts -------------------------------------------------------------------|

script_str ext("ACS") addr("Lith_LogS")
void Sc_Log(i32 levl, i32 type)
{
str name = ServCallS(sm_GetLogName);

if(name[0] == '_') name = Language(LANG "LOG%S", name);

withplayer(LocalPlayer) switch(type) {
case msg_ammo: if(p->getCVarI(sc_player_ammolog))
case msg_huds: p->logH(levl, "%S", name); break;
case msg_full: p->logF( "%S", name); break;
case msg_both: p->logB(levl, "%S", name); break;
}
}

// EOF

+ 11
- 11
source/Main/p_magic.c View File

@@ -9,10 +9,10 @@
#include "p_hudid.h"
#include "w_world.h"

// Extern Functions ----------------------------------------------------------|
// Scripts -------------------------------------------------------------------|

script_str ext("ACS")
void Lith_Blade(bool hit)
script_str ext("ACS") addr("Lith_Blade")
void Sc_Blade(bool hit)
{
ACS_SetHudSize(800, 600);
DrawSpriteX(hit ? sp_Weapon_BladeHit : sp_Weapon_Blade, HUDMSG_FADEOUT|HUDMSG_ADDBLEND, hid_blade, 0.1, 0.1, TS * 3, 0.15);
@@ -21,8 +21,8 @@ void Lith_Blade(bool hit)
if(!p->onground) p->setVel(p->velx / 2, p->vely / 2, 0);
}

script_str ext("ACS")
void Lith_Rend(bool hit, i32 set)
script_str ext("ACS") addr("Lith_Rend")
void Sc_Rend(bool hit, i32 set)
{
static i32 num;

@@ -38,8 +38,8 @@ void Lith_Rend(bool hit, i32 set)
if(!p->onground) p->setVel(p->velx / 2, p->vely / 2, 0);
}

script_str ext("ACS")
void Lith_Feuer(bool left, bool fire)
script_str ext("ACS") addr("Lith_Feuer")
void Sc_Feuer(bool left, bool fire)
{
withplayer(LocalPlayer)
{
@@ -81,8 +81,8 @@ void Lith_Feuer(bool left, bool fire)
}
}

script_str ext("ACS")
void Lith_Cercle(void)
script_str ext("ACS") addr("Lith_Cercle")
void Sc_Cercle(void)
{
withplayer(LocalPlayer)
{
@@ -164,8 +164,8 @@ void Lith_Cercle(void)
}
}

script_str ext("ACS")
void Lith_MagicSelect(i32 num)
script_str ext("ACS") addr("Lith_MagicSelect")
void Sc_MagicSelect(i32 num)
{
withplayer(LocalPlayer)
{


+ 4
- 2
source/Main/p_obituary.c View File

@@ -8,8 +8,10 @@
#include "common.h"
#include "p_player.h"

script_str ext("ACS")
void Lith_Obituary(void)
// Scripts -------------------------------------------------------------------|

script_str ext("ACS") addr("Lith_Obituary")
void Sc_Obituary(void)
{
static char const *pronoun[pro_max][5] = {
{"they", "them", "their", "theirs", "they're"},


+ 42
- 40
source/Main/p_player.c View File

@@ -32,7 +32,7 @@ script static void Lith_BossWarning(struct player *p);
// Scripts -------------------------------------------------------------------|

script type("enter")
static void Lith_PlayerEntry(void)
static void Sc_PlayerEntry(void)
{
if(ACS_GameType() == GAME_TITLE_MAP) return;

@@ -111,7 +111,7 @@ reinit:
}

script type("death")
static void Lith_PlayerDeath(void)
static void Sc_PlayerDeath(void)
{
struct player *p = LocalPlayer;

@@ -154,19 +154,19 @@ static void Lith_PlayerDeath(void)
}

script type("respawn")
static void Lith_PlayerRespawn(void)
static void Sc_PlayerRespawn(void)
{
LocalPlayer->reinit = true;
}

script type("return")
static void Lith_PlayerReturn(void)
static void Sc_PlayerReturn(void)
{
LocalPlayer->reinit = true;
}

script type("disconnect")
static void Lith_PlayerDisconnect(void)
static void Sc_PlayerDisconnect(void)
{
struct player *p = LocalPlayer;

@@ -189,22 +189,6 @@ static void Lith_PlayerDisconnect(void)
#define upgrademap_t_KeyCmp(l, r) ((l) - (r))
GDCC_HashMap_Defn(upgrademap_t, i32, struct upgrade)

script_str ext("ACS")
void Lith_DrawPlayerIcon(i32 num, i32 x, i32 y)
{
withplayer(&players[num])
{
k32 a = absk((x - 160) / 90.0);
if(a < 0.2) a = 0.2;
else if(a > 1.0) a = 1.0;

PrintTextFmt("%S <%i>\n", p->name, p->num);
__nprintf(p->health <= 0 ? "Dead\n" : "%iHP\n", p->health);
if(p->pclass & pcl_magicuser) __nprintf("%iMP\n", p->mana);
PrintTextA(s_cbifont, CR_WHITE, x-9,1, y-2,1, a);
}
}

stkcall
struct upgrade *Lith_PlayerGetNamedUpgrade(struct player *p, i32 name)
{
@@ -355,25 +339,6 @@ void Lith_TakeScore(struct player *p, i96 score)
p->scoreaccumtime = 0;
}

script_str type("net") ext("ACS")
void Lith_Glare(void)
{
withplayer(LocalPlayer)
{
ACS_FadeTo(255, 255, 255, 1.0, 0.0);

ACS_LocalAmbientSound(ss_player_glare, 127);
ACS_LineAttack(0, p->yaw, p->pitch, 1, so_Dummy, s_None,
32767.0, FHF_NORANDOMPUFFZ | FHF_NOIMPACTDECAL);

ACS_Delay(14);

ACS_FadeTo(255, 255, 255, 0.0, 0.2);

ACS_Delay(19);
}
}

// Static Functions ----------------------------------------------------------|

#if LITHIUM
@@ -533,4 +498,41 @@ static void Lith_PlayerPreStats(struct player *p)
if(p->z != p->old.z) p->unitstravelled += abs(p->z - p->old.z);
}

// Scripts -------------------------------------------------------------------|

script ext("ACS") addr(lsc_drawplayericon)
void Sc_DrawPlayerIcon(i32 num, i32 x, i32 y)
{
withplayer(&players[num])
{
k32 a = absk((x - 160) / 90.0);
if(a < 0.2) a = 0.2;
else if(a > 1.0) a = 1.0;

PrintTextFmt("%S <%i>\n", p->name, p->num);
__nprintf(p->health <= 0 ? "Dead\n" : "%iHP\n", p->health);
if(p->pclass & pcl_magicuser) __nprintf("%iMP\n", p->mana);
PrintTextA(s_cbifont, CR_WHITE, x-9,1, y-2,1, a);
}
}

script_str type("net") ext("ACS") addr("Lith_Glare")
void Sc_Glare(void)
{
withplayer(LocalPlayer)
{
ACS_FadeTo(255, 255, 255, 1.0, 0.0);

ACS_LocalAmbientSound(ss_player_glare, 127);
ACS_LineAttack(0, p->yaw, p->pitch, 1, so_Dummy, s_None,
32767.0, FHF_NORANDOMPUFFZ | FHF_NOIMPACTDECAL);

ACS_Delay(14);

ACS_FadeTo(255, 255, 255, 0.0, 0.2);

ACS_Delay(19);
}
}

// EOF

+ 20
- 18
source/Main/p_powerup.c View File

@@ -10,9 +10,11 @@
#include "p_hudid.h"
#include "w_world.h"

// Scripts -------------------------------------------------------------------|

#if LITHIUM
script_str ext("ACS")
void Lith_DOGS()
script_str ext("ACS") addr("Lith_DOGS")
void Sc_DOGS(void)
{
withplayer(LocalPlayer)
{
@@ -38,8 +40,8 @@ void Lith_DOGS()
}
}

script_str ext("ACS")
void Lith_SteggleEnergy()
script_str ext("ACS") addr("Lith_SteggleEnergy")
void Sc_SteggleEnergy(void)
{
withplayer(Lith_GetPlayer(0, AAPTR_FRIENDPLAYER))
{
@@ -63,8 +65,8 @@ void Lith_SteggleEnergy()
}
}

script_str ext("ACS")
void Lith_BarrierBullets()
script_str ext("ACS") addr("Lith_BarrierBullets")
void Sc_BarrierBullets(void)
{
withplayer(Lith_GetPlayer(0, AAPTR_TARGET))
{
@@ -80,15 +82,15 @@ void Lith_BarrierBullets()
}
}

script_str ext("ACS")
bool Lith_BarrierCheck()
script_str ext("ACS") addr("Lith_BarrierCheck")
bool Sc_BarrierCheck(void)
{
ACS_SetActivatorToTarget(0);
return ACS_CheckFlag(0, s_COUNTKILL);
}

script_str ext("ACS")
void Lith_GetSigil()
script_str ext("ACS") addr("Lith_GetSigil")
void Sc_GetSigil(void)
{
withplayer(LocalPlayer)
{
@@ -129,8 +131,8 @@ void Lith_GetSigil()
}
#endif

script_str ext("ACS")
void Lith_GiveHealthBonus(i32 amount)
script_str ext("ACS") addr("Lith_GiveHealthBonus")
void Sc_GiveHealthBonus(i32 amount)
{
withplayer(LocalPlayer)
{
@@ -140,8 +142,8 @@ void Lith_GiveHealthBonus(i32 amount)
}
}

script_str ext("ACS")
void Lith_GiveHealth(i32 amount)
script_str ext("ACS") addr("Lith_GiveHealth")
void Sc_GiveHealth(i32 amount)
{
withplayer(LocalPlayer)
{
@@ -152,15 +154,15 @@ void Lith_GiveHealth(i32 amount)
}
}

script_str ext("ACS")
bool Lith_CheckHealth()
script_str ext("ACS") addr("Lith_CheckHealth")
bool Sc_CheckHealth(void)
{
withplayer(LocalPlayer) return p->health < p->maxhealth;
return 0;
}

script_str ext("ACS")
void Lith_Discount()
script_str ext("ACS") addr("Lith_Discount")
void Sc_Discount(void)
{
withplayer(LocalPlayer) p->discount = 0.9;
}


+ 19
- 10
source/Main/p_save.c View File

@@ -64,16 +64,6 @@ static void Lith_Load_fun0(struct savefile *save, struct savechunk *chunk)

// Extern Functions ----------------------------------------------------------|

script_str ext("ACS")
void Lith_SetFun(i32 fun)
{
withplayer(LocalPlayer)
{
p->fun = fun;
p->saveData();
}
}

script
void Lith_PlayerSaveData(struct player *p)
{
@@ -101,4 +91,23 @@ void Lith_PlayerLoadData(struct player *p)
}
#endif

// Scripts -------------------------------------------------------------------|

script_str ext("ACS") addr("Lith_SetFun")
void Sc_SetFun(i32 fun)
{
withplayer(LocalPlayer)
{
p->fun = fun;
p->saveData();
}
}

script_str ext("ACS") addr("Lith_GetFun")
i32 Sc_GetFun(void)
{
withplayer(LocalPlayer) return p->fun;
return 0;
}

// EOF

+ 87
- 85
source/Main/p_weapons.c View File

@@ -65,79 +65,6 @@ i32 Lith_PlayerCurWeaponType(struct player *p)
return p->weapon.cur->info->type;
}

script_str ext("ACS")
bool Lith_WeaponPickup(i32 name)
{
extern void Lith_PickupMessage(struct player *p, struct weaponinfo const *info);
extern i32 Lith_WeaponFromName(struct player *p, i32 name);

struct player *p = LocalPlayer;
if(NoPlayer(p)) return false;

bool weaponstay = ACS_GetCVar(sc_sv_weaponstay);
i32 parm = weapon_unknown;

parm = Lith_WeaponFromName(p, name);

if(parm >= weapon_max || parm < weapon_min)
return true;

struct weaponinfo const *info = &weaponinfo[parm];

if(HasWeapon(p, parm))
{
if(!weaponstay) {
WeaponGrab(p, info);
Lith_PickupScore(p, parm);
}

return !weaponstay;
}
else
{
WeaponGrab(p, info);

p->weaponsheld++;
bip_name_t tag; lstrcpy_str(tag, info->name);
p->bipUnlock(tag);

GiveWeaponItem(parm, info->slot);
Lith_PickupMessage(p, info);
InvGive(info->classname, 1);

return !weaponstay;
}
}

script_str ext("ACS")
k32 Lith_CircleSpread(k32 mdx, k32 mdy, bool getpitch)
{
static k32 A;
static k32 P;

if(!getpitch)
{
k32 dx = ACS_RandomFixed(mdx, 0.0);
k32 dy = ACS_RandomFixed(mdy, 0.0);
k32 a = ACS_RandomFixed(1.0, -1.0);

A = ACS_Sin(a) * dx;
P = ACS_Cos(a) * dy;

return A;
}
else
return P;
}

script_str ext("ACS")
i32 Lith_ChargeFistDamage()
{
i32 amount = InvNum(so_FistCharge);
InvTake(so_FistCharge, 0x7FFFFFFF);
return amount * ACS_Random(1, 3);
}

void Lith_GInit_Weapon(void)
{
for(i32 i = 0; i < weapon_max; i++)
@@ -270,8 +197,83 @@ void Lith_PlayerUpdateWeapons(struct player *p)
}
}

script_str ext("ACS")
k32 Lith_AmmoRunOut(bool ro, k32 mul)
// Scripts -------------------------------------------------------------------|

script_str ext("ACS") addr("Lith_WeaponPickup")
bool Sc_WeaponPickup(i32 name)
{
extern void Lith_PickupMessage(struct player *p, struct weaponinfo const *info);
extern i32 Lith_WeaponFromName(struct player *p, i32 name);

struct player *p = LocalPlayer;
if(NoPlayer(p)) return false;

bool weaponstay = ACS_GetCVar(sc_sv_weaponstay);
i32 parm = weapon_unknown;

parm = Lith_WeaponFromName(p, name);

if(parm >= weapon_max || parm < weapon_min)
return true;

struct weaponinfo const *info = &weaponinfo[parm];

if(HasWeapon(p, parm))
{
if(!weaponstay) {
WeaponGrab(p, info);
Lith_PickupScore(p, parm);
}

return !weaponstay;
}
else
{
WeaponGrab(p, info);

p->weaponsheld++;
bip_name_t tag; lstrcpy_str(tag, info->name);
p->bipUnlock(tag);

GiveWeaponItem(parm, info->slot);
Lith_PickupMessage(p, info);
InvGive(info->classname, 1);

return !weaponstay;
}
}

script_str ext("ACS") addr("Lith_CircleSpread")
k32 Sc_CircleSpread(k32 mdx, k32 mdy, bool getpitch)
{
static k32 A;
static k32 P;

if(!getpitch)
{
k32 dx = ACS_RandomFixed(mdx, 0.0);
k32 dy = ACS_RandomFixed(mdy, 0.0);
k32 a = ACS_RandomFixed(1.0, -1.0);

A = ACS_Sin(a) * dx;
P = ACS_Cos(a) * dy;

return A;
}
else
return P;
}

script_str ext("ACS") addr("Lith_ChargeFistDamage")
i32 Sc_ChargeFistDamage(void)
{
i32 amount = InvNum(so_FistCharge);
InvTake(so_FistCharge, 0x7FFFFFFF);
return amount * ACS_Random(1, 3);
}

script_str ext("ACS") addr("Lith_AmmoRunOut")
k32 Sc_AmmoRunOut(bool ro, k32 mul)
{
withplayer(LocalPlayer)
{
@@ -292,8 +294,8 @@ k32 Lith_AmmoRunOut(bool ro, k32 mul)
return 0;
}

script_str ext("ACS")
i32 Lith_GetFinalizerMaxHealth(void)
script_str ext("ACS") addr("Lith_GetFinalizerMaxHealth")
i32 Sc_GetFinalizerMaxHealth(void)
{
i32 sh = GetPropI(0, APROP_SpawnHealth);

@@ -303,8 +305,8 @@ i32 Lith_GetFinalizerMaxHealth(void)
return sh;
}

script_str ext("ACS")
void Lith_SurgeOfDestiny(void)
script_str ext("ACS") addr("Lith_SurgeOfDestiny")
void Sc_SurgeOfDestiny(void)
{
for(i32 i = 0; i < (35 * 7) / 2; i++) {
InvGive(so_SurgeOfDestiny, 1);
@@ -312,8 +314,8 @@ void Lith_SurgeOfDestiny(void)
}
}

script_str ext("ACS")
i32 Lith_GetWRF(void)
script_str ext("ACS") addr("Lith_GetWRF")
i32 Sc_GetWRF(void)
{
enum
{
@@ -345,8 +347,8 @@ i32 Lith_GetWRF(void)
return flags;
}

script_str ext("ACS")
void Lith_PoisonFXTicker()
script_str ext("ACS") addr("Lith_PoisonFXTicker")
void Sc_PoisonFXTicker(void)
{
for(i32 i = 0; i < 17; i++)
{
@@ -374,8 +376,8 @@ void Lith_PoisonFXTicker()
}
}

script_str ext("ACS")
void Lith_RecoilUp(k32 amount)
script_str ext("ACS") addr("Lith_RecoilUp")
void Sc_RecoilUp(k32 amount)
{
withplayer(LocalPlayer) p->extrpitch += amount / 180.lk;
}


+ 9
- 7
source/Main/u_homingrpg.c View File

@@ -22,13 +22,6 @@ static i32 CheckTarget(struct player *p)