Browse Source

remove decompat, improve utilities, improve modals, a lot of other changes

master
Alison Watson 4 months ago
parent
commit
7b011c3a89
97 changed files with 1879 additions and 1527 deletions
  1. +1
    -0
      .gitignore
  2. BIN
      pk7/acs/lithmain.bin
  3. BIN
      pk7/lgfx/Menu/Pause.png
  4. +5
    -5
      pk7/lzscript/6_DarkLord/2_700Express.zsc
  5. +3
    -3
      pk7/lzscript/Constants.zsc
  6. +12
    -25
      pk7/lzscript/Constants/items.zsc
  7. +113
    -32
      pk7/lzscript/Constants/m_drawing.zsc
  8. +0
    -97
      pk7/lzscript/Constants/p_data.zsc
  9. +91
    -0
      pk7/lzscript/Constants/p_player.zsc
  10. +79
    -0
      pk7/lzscript/Constants/p_weaponinfo.zsc
  11. +6
    -27
      pk7/lzscript/Constants/u_names.zsc
  12. +0
    -128
      pk7/lzscript/Constants/w_data.zsc
  13. +10
    -25
      pk7/lzscript/Constants/w_monster.zsc
  14. +49
    -71
      pk7/lzscript/Constants/w_scorenums.zsc
  15. +32
    -33
      pk7/lzscript/Constants/w_world.zsc
  16. +0
    -7
      pk7/lzscript/Player/Base.zsc
  17. +0
    -46
      pk7/lzscript/Player/HUD.zsc
  18. +22
    -0
      pk7/lzscript/Playsim/Player.zsc
  19. +4
    -1
      pk7/lzscript/Utilities.zsc
  20. +2
    -2
      source/d_stmt.c
  21. +26
    -28
      source/d_vm.c
  22. +2
    -7
      source/g_auto.c
  23. +1
    -1
      source/g_textbox.c
  24. +21
    -0
      source/include/common.h
  25. +0
    -3
      source/include/gui.h
  26. +5
    -6
      source/include/items.h
  27. +12
    -9
      source/include/m_drawing.h
  28. +6
    -1
      source/include/m_math.h
  29. +19
    -18
      source/include/m_stab.h
  30. +5
    -1
      source/include/m_types.h
  31. +18
    -11
      source/include/p_cbi.h
  32. +0
    -85
      source/include/p_data.h
  33. +102
    -34
      source/include/p_player.h
  34. +11
    -20
      source/include/p_weaponinfo.h
  35. +0
    -71
      source/include/p_wepinfo.h
  36. +5
    -6
      source/include/w_monster.h
  37. +6
    -6
      source/include/w_scorenums.h
  38. +104
    -3
      source/include/w_world.h
  39. +2
    -2
      source/m_drawing.c
  40. +1
    -1
      source/m_file.c
  41. +14
    -0
      source/m_math.c
  42. +14
    -14
      source/m_memory.c
  43. +19
    -19
      source/p_attrib.c
  44. +5
    -14
      source/p_cbi.c
  45. +31
    -31
      source/p_data.c
  46. +11
    -11
      source/p_gui_bip.c
  47. +7
    -7
      source/p_gui_cbi.c
  48. +13
    -13
      source/p_gui_upgrades.c
  49. +7
    -7
      source/p_hud.c
  50. +14
    -14
      source/p_items.c
  51. +4
    -4
      source/p_log.c
  52. +8
    -22
      source/p_magic.c
  53. +3
    -3
      source/p_notes.c
  54. +19
    -20
      source/p_obituary.c
  55. +6
    -6
      source/p_payout.c
  56. +66
    -54
      source/p_player.c
  57. +5
    -6
      source/p_powerup.c
  58. +1
    -1
      source/p_ren_debug.c
  59. +3
    -3
      source/p_ren_magic.c
  60. +1
    -1
      source/p_ren_scope.c
  61. +1
    -3
      source/p_ren_view.c
  62. +82
    -10
      source/p_render.c
  63. +2
    -2
      source/p_settings.c
  64. +2
    -2
      source/p_shop.c
  65. +2
    -7
      source/p_shopdef.c
  66. +2
    -2
      source/p_statistics.c
  67. +1
    -1
      source/p_upgrades.c
  68. +11
    -17
      source/p_weapons.c
  69. +7
    -10
      source/u_7777777.c
  70. +7
    -7
      source/u_flashlight.c
  71. +10
    -14
      source/u_headsupdisc.c
  72. +5
    -5
      source/u_headsupdisd.c
  73. +8
    -11
      source/u_headsupdisi.c
  74. +6
    -8
      source/u_headsupdism.c
  75. +3
    -2
      source/u_homingrpg.c
  76. +2
    -2
      source/u_jetbooster.c
  77. +1
    -3
      source/u_magic.c
  78. +19
    -31
      source/u_punctcannon.c
  79. +1
    -1
      source/u_reactarmor.c
  80. +4
    -4
      source/u_reflexwetw.c
  81. +5
    -4
      source/u_riflemodes.c
  82. +8
    -8
      source/u_subweapons.c
  83. +21
    -21
      source/u_vitalscan.c
  84. +8
    -7
      source/u_zoom.c
  85. +7
    -0
      source/w_data.c
  86. +6
    -6
      source/w_finale.c
  87. +20
    -20
      source/w_monster.c
  88. +2
    -2
      source/w_rain.c
  89. +4
    -4
      source/w_title.c
  90. +12
    -12
      source/w_world.c
  91. +7
    -9
      text/Weapons.txt
  92. +101
    -15
      tools/checkstab.rb
  93. +0
    -49
      tools/decompat.rb
  94. +462
    -141
      tools/genbuild.rb
  95. +2
    -2
      tools/hashfs.rb
  96. +5
    -3
      tools/upgc.rb
  97. +7
    -17
      tools/wepc.rb

+ 1
- 0
.gitignore View File

@@ -1,6 +1,7 @@
working/*
bin/*
master/*
tools/.build-cfg.rb
*.bat
?.sh
*.kdev4


BIN
pk7/acs/lithmain.bin View File


BIN
pk7/lgfx/Menu/Pause.png View File

Before After
Width: 66  |  Height: 12  |  Size: 220B Width: 63  |  Height: 12  |  Size: 234B

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

@@ -90,7 +90,7 @@ action(Weapon) void lith_fire700e() {

vector3, vector3 lith_getLaserPos(double pit) {
let ply = Lith_Player(owner);
let sz = ply.lith_getViewHeight();
let sz = ply.player.viewz - ply.pos.z - 3;

let ps = sin(ply.pitch - pit - 90);
let cz = cos(ply.pitch - pit - 90);
@@ -101,7 +101,7 @@ vector3, vector3 lith_getLaserPos(double pit) {

let beg = (ply.pos.x + cx * -16,
ply.pos.y + cy * -16,
ply.pos.z + sz + cz * -16 + 1);
ply.pos.z + sz + cz * -16);

ys = sin(ply.angle);
yc = cos(ply.angle);
@@ -137,12 +137,12 @@ void lith_spawnLaserTrace(double pit) {
if(!owner) return;

let ply = Lith_Player(owner);
let sz = ply.lith_getViewHeight();
let sz = ply.player.viewz - ply.pos.z;

let loc = Lith_UTIL.TraceFrom(ply, ply.m_iyaw, 2048, ply.m_ipitch - pit, sz);
let loc = Lith_UTIL.TraceFrom(ply, ply.m_iyaw, ply.m_ipitch - pit, 2048, sz);
Spawn("Lith_700Laser", loc);

loc = Lith_UTIL.TraceFrom(ply, ply.angle, 2048, ply.pitch - pit, sz);
loc = Lith_UTIL.TraceFrom(ply, ply.angle, ply.pitch - pit, 2048, sz);
Spawn("Lith_700Laser2", loc);

}


+ 3
- 3
pk7/lzscript/Constants.zsc View File

@@ -9,12 +9,12 @@

#include "lzscript/Constants/items.zsc"
#include "lzscript/Constants/m_drawing.zsc"
#include "lzscript/Constants/p_data.zsc"
#include "lzscript/Constants/p_weapons.zsc"
#include "lzscript/Constants/p_player.zsc"
#include "lzscript/Constants/p_weaponinfo.zsc"
#include "lzscript/Constants/u_names.zsc"
#include "lzscript/Constants/w_data.zsc"
#include "lzscript/Constants/w_monster.zsc"
#include "lzscript/Constants/w_scorenums.zsc"
#include "lzscript/Constants/w_world.zsc"

enum Lith_ASCII {
Ch_NUL, /* null */


+ 12
- 25
pk7/lzscript/Constants/items.zsc View File

@@ -1,28 +1,10 @@
/* ---------------------------------------------------------------------------|
*
* This file was generated by decompat.
* Edit only if you aren't going to recompile.
*
* ---------------------------------------------------------------------------|
*
* Distributed under the CC0 public domain license.
* By Alison G. Watson. Attribution is encouraged, though not required.
* See licenses/cc0.txt for more information.
*
* ---------------------------------------------------------------------------|
*/
/* ---------------------------------------------------------------------------|
*
* Distributed under the CC0 public domain license.
* By Alison G. Watson. Attribution is encouraged, though not required.
* See licenses/cc0.txt for more information.
*
* ---------------------------------------------------------------------------|
*
* Inventory items.
*
* ---------------------------------------------------------------------------|
*/









enum Lith_Container {
@@ -31,3 +13,8 @@ enum Lith_Container {
_cont_arms_l,
_cont_body,
};






+ 113
- 32
pk7/lzscript/Constants/m_drawing.zsc View File

@@ -1,32 +1,110 @@
/* ---------------------------------------------------------------------------|
*
* This file was generated by decompat.
* Edit only if you aren't going to recompile.
*
* ---------------------------------------------------------------------------|
*
* Distributed under the CC0 public domain license.
* By Alison G. Watson. Attribution is encouraged, though not required.
* See licenses/cc0.txt for more information.
*
* ---------------------------------------------------------------------------|
*/
/* ---------------------------------------------------------------------------|
*
* Distributed under the CC0 public domain license.
* By Alison G. Watson. Attribution is encouraged, though not required.
* See licenses/cc0.txt for more information.
*
* ---------------------------------------------------------------------------|
*
* Drawing functions.
*
* ---------------------------------------------------------------------------|
*/


enum Lith_FontNum
{










































































































enum Lith_FontNum {
font_misaki_gothic,
font_misaki_mincho,
font_k6x8,
@@ -34,8 +112,7 @@ enum Lith_FontNum
font_num,
};

enum Lith_Channel
{
enum Lith_Channel {
lch_auto,

lch_weapon,
@@ -59,4 +136,8 @@ enum Lith_Channel
};


/* EOF */






+ 0
- 97
pk7/lzscript/Constants/p_data.zsc View File

@@ -1,97 +0,0 @@
/* ---------------------------------------------------------------------------|
*
* This file was generated by decompat.
* Edit only if you aren't going to recompile.
*
* ---------------------------------------------------------------------------|
*
* Distributed under the CC0 public domain license.
* By Alison G. Watson. Attribution is encouraged, though not required.
* See licenses/cc0.txt for more information.
*
* ---------------------------------------------------------------------------|
*/
/* ---------------------------------------------------------------------------|
*
* Distributed under the CC0 public domain license.
* By Alison G. Watson. Attribution is encouraged, though not required.
* See licenses/cc0.txt for more information.
*
* ---------------------------------------------------------------------------|
*
* Exposed player data.
*
* ---------------------------------------------------------------------------|
*/

enum Lith_Attrib {
at_acc,
at_def,
at_str,
at_vit,
at_stm,
at_luk,
at_spc,
at_max
};

enum Lith_PData {
pdata_weapon,
pdata_upgrade,
pdata_riflemode,
pdata_hassigil,
pdata_weaponzoom,
pdata_pclass,
pdata_semifrozen,
pdata_slot3ammo,
pdata_addp,
pdata_addy,
pdata_recoilp,
pdata_attr,
};

enum Lith_SubweaponType {
_subw_gun,
_subw_dagger,
_subw_grenade,
_subw_mine,
_subw_axe,
_subw_dart,
_subw_max,
};

enum Lith_DamageNumType {
_dnum_smol,
_dnum_norm,
_dnum_crit,
_dnum_max,
};

enum Lith_PClass {
pcl_unknown,

/* Base Classes */
pcl_marine = 1 << 0,
pcl_cybermage = 1 << 1,
pcl_informant = 1 << 2,
pcl_wanderer = 1 << 3,
pcl_assassin = 1 << 4,
pcl_darklord = 1 << 5,
pcl_thoth = 1 << 6,

/* Groups */
pcl_outcasts = pcl_marine | pcl_cybermage,
pcl_missioners = pcl_informant | pcl_wanderer,
pcl_intruders = pcl_assassin | pcl_darklord | pcl_thoth,

/* Lifeform Type */
pcl_human = pcl_marine | pcl_cybermage | pcl_assassin,
pcl_nonhuman = pcl_wanderer | pcl_darklord | pcl_thoth,
pcl_robot = pcl_informant,

/* Misc. Abilities */
pcl_any = pcl_human | pcl_nonhuman | pcl_robot,
pcl_magicuser = pcl_cybermage | pcl_wanderer | pcl_thoth,
};

/* EOF */

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

@@ -0,0 +1,91 @@





enum Lith_Attrib {
at_acc,
at_def,
at_str,
at_vit,
at_stm,
at_luk,
at_spc,
at_max
};

enum Lith_PData {
pdata_weapon,
pdata_upgrade,
pdata_riflemode,
pdata_hassigil,
pdata_weaponzoom,
pdata_pclass,
pdata_semifrozen,
pdata_slot3ammo,
pdata_addp,
pdata_addy,
pdata_recoilp,
pdata_attr,
};

enum Lith_SubweaponType {
_subw_gun,
_subw_dagger,
_subw_grenade,
_subw_mine,
_subw_axe,
_subw_dart,
_subw_max,
};

enum Lith_DamageNumType {
_dnum_smol,
_dnum_norm,
_dnum_crit,
_dnum_max,
};

enum Lith_PClass {
pcl_unknown,






pcl_marine = 1 << 0,
pcl_cybermage = 1 << 1,
pcl_informant = 1 << 2,
pcl_wanderer = 1 << 3,
pcl_assassin = 1 << 4,
pcl_darklord = 1 << 5,
pcl_thoth = 1 << 6,


pcl_outcasts = pcl_marine | pcl_cybermage,
pcl_missioners = pcl_informant | pcl_wanderer,
pcl_intruders = pcl_assassin | pcl_darklord | pcl_thoth,


pcl_human = pcl_marine | pcl_cybermage | pcl_assassin,
pcl_nonhuman = pcl_wanderer | pcl_darklord | pcl_thoth,
pcl_robot = pcl_informant,


pcl_any = pcl_human | pcl_nonhuman | pcl_robot,
pcl_magicuser = pcl_cybermage | pcl_wanderer | pcl_thoth,


};










+ 79
- 0
pk7/lzscript/Constants/p_weaponinfo.zsc View File

@@ -0,0 +1,79 @@






enum Lith_WeaponNum {
weapon_min = 1,
weapon_unknown = 0,

weapon_cfist,
weapon_missile,
weapon_plasmadiff,
weapon_fist,
weapon_pistol,
weapon_revolver,
weapon_shotgun,
weapon_lazshotgun,
weapon_ssg,
weapon_rifle,
weapon_sniper,
weapon_launcher,
weapon_plasma,
weapon_bfg,
weapon_c_fist,
weapon_c_mateba,
weapon_c_rifle,
weapon_c_spas,
weapon_c_smg,
weapon_c_sniper,
weapon_c_plasma,
weapon_c_shipgun,
weapon_c_blade,
weapon_c_delear,
weapon_c_fire,
weapon_c_rend,
weapon_c_hulgyon,
weapon_c_starshot,
weapon_c_cercle,
weapon_d_700e,
weapon_d_4bore,
weapon_d_launcher,
weapon_d_minigun,
weapon_d_rocket,
weapon_d_fatmac,
weapon_d_railgun,
weapon_i_flintlock,
weapon_a_dualpist,
weapon_a_burstrif,
weapon_t_riotshot,
weapon_t_redrifle,
weapon_wings,

weapon_max
};

enum Lith_WeaponName {
wepnam_fist,
wepnam_chainsaw,
wepnam_pistol,
wepnam_shotgun,
wepnam_supershotgun,
wepnam_chaingun,
wepnam_rocketlauncher,
wepnam_plasmarifle,
wepnam_bfg9000,

wepnam_max,
};

enum Lith_RifleMode {
rifle_firemode_auto,
rifle_firemode_grenade,
rifle_firemode_burst,
rifle_firemode_max
};




+ 6
- 27
pk7/lzscript/Constants/u_names.zsc View File

@@ -1,29 +1,7 @@
/* ---------------------------------------------------------------------------|
*
* This file was generated by decompat.
* Edit only if you aren't going to recompile.
*
* ---------------------------------------------------------------------------|
*
* Distributed under the CC0 public domain license.
* By Alison G. Watson. Attribution is encouraged, though not required.
* See licenses/cc0.txt for more information.
*
* ---------------------------------------------------------------------------|
*/
/* ---------------------------------------------------------------------------|
*
* This file was generated by upgc.
* Edit only if you aren't going to recompile.
*
* ---------------------------------------------------------------------------|
*
* Distributed under the CC0 public domain license.
* By Alison G. Watson. Attribution is encouraged, though not required.
* See licenses/cc0.txt for more information.
*
* ---------------------------------------------------------------------------|
*/






enum Lith_UpgradeName {
@@ -85,4 +63,5 @@ enum Lith_UpgradeName {
UPGR_MAX
};

/* EOF */



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

@@ -1,128 +0,0 @@
/* ---------------------------------------------------------------------------|
*
* This file was generated by decompat.
* Edit only if you aren't going to recompile.
*
* ---------------------------------------------------------------------------|
*
* Distributed under the CC0 public domain license.
* By Alison G. Watson. Attribution is encouraged, though not required.
* See licenses/cc0.txt for more information.
*
* ---------------------------------------------------------------------------|
*/
/* ---------------------------------------------------------------------------|
*
* Distributed under the CC0 public domain license.
* By Alison G. Watson. Attribution is encouraged, though not required.
* See licenses/cc0.txt for more information.
*
* ---------------------------------------------------------------------------|
*
* Exposed world data.
*
* ---------------------------------------------------------------------------|
*/

enum Lith_WData
{
wdata_bossspawned,
wdata_soulsfreed,
wdata_dorain,
wdata_ptid,
wdata_pclass,
};

enum Lith_Fun
{
lfun_ragnarok = 1 << 0,
lfun_bips = 1 << 1,
lfun_final = 1 << 2,
lfun_division = 1 << 3,
};

enum Lith_CBIUpgradeM
{
cupg_weapninter,
cupg_hasupgr1,
cupg_armorinter,
cupg_hasupgr2,
cupg_weapninte2,
cupg_rdistinter,
cupg_max
};

enum Lith_CBIUpgradeC
{
cupg_c_slot3spell,
cupg_c_slot4spell,
cupg_c_slot5spell,
cupg_c_slot6spell,
cupg_c_slot7spell,
cupg_c_rdistinter,
};

enum Lith_RandomSpawnNum
{
lrsn_garmor,
lrsn_barmor,
lrsn_hbonus,
lrsn_abonus,
lrsn_clip,
lrsn_clipbx,
};

enum Lith_MsgType
{
msg_ammo,
msg_huds,
msg_full,
msg_both
};

enum Lith_DamageType
{
ldt_bullets,
ldt_energy,
ldt_fire,
ldt_firemagic,
ldt_magic,
ldt_melee,
ldt_shrapnel,
ldt_ice,
ldt_hazard,
ldt_none
};

enum Lith_ScriptNum
{
lsc_gsinit = 17000,
lsc_getfontmetric,
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,
lsc_monstertype,
lsc_drawdmgnum,
lsc_preinit,
lsc_worldreopen,
};

enum Lith_BossType
{
boss_none,
boss_barons,
boss_cyberdemon,
boss_spiderdemon,
boss_iconofsin,
boss_other,
};

/* EOF */

+ 10
- 25
pk7/lzscript/Constants/w_monster.zsc View File

@@ -1,28 +1,8 @@
/* ---------------------------------------------------------------------------|
*
* This file was generated by decompat.
* Edit only if you aren't going to recompile.
*
* ---------------------------------------------------------------------------|
*
* Distributed under the CC0 public domain license.
* By Alison G. Watson. Attribution is encouraged, though not required.
* See licenses/cc0.txt for more information.
*
* ---------------------------------------------------------------------------|
*/
/* ---------------------------------------------------------------------------|
*
* Distributed under the CC0 public domain license.
* By Alison G. Watson. Attribution is encouraged, though not required.
* See licenses/cc0.txt for more information.
*
* ---------------------------------------------------------------------------|
*
* Monster tracking and information.
*
* ---------------------------------------------------------------------------|
*/






enum Lith_MonsterType {
mtype_unknown,
@@ -47,3 +27,8 @@ enum Lith_MonsterType {
mtype_darkone,
mtype_max
};






+ 49
- 71
pk7/lzscript/Constants/w_scorenums.zsc View File

@@ -1,32 +1,10 @@
/* ---------------------------------------------------------------------------|
*
* This file was generated by decompat.
* Edit only if you aren't going to recompile.
*
* ---------------------------------------------------------------------------|
*
* Distributed under the CC0 public domain license.
* By Alison G. Watson. Attribution is encouraged, though not required.
* See licenses/cc0.txt for more information.
*
* ---------------------------------------------------------------------------|
*/
/* ---------------------------------------------------------------------------|
*
* Distributed under the CC0 public domain license.
* By Alison G. Watson. Attribution is encouraged, though not required.
* See licenses/cc0.txt for more information.
*
* ---------------------------------------------------------------------------|
*
* Score numbers for various items and enemies.
*
* ---------------------------------------------------------------------------|
*/

enum Lith_ScoreNum
{
/* Score values */





enum Lith_ScoreNum {
Score_Clip = 1000,
Score_ClipBox = 4000,
Score_Shell = 2000,
@@ -37,58 +15,57 @@ enum Lith_ScoreNum
Score_CellPack = 7000,
Score_Backpack = 10000,

/* Tier 1 */
Score_ZombieMan = 1000, /* Bullets */
Score_ShotgunGuy = 2000, /* Bullets */
Score_ChaingunGuy = 2000, /* Bullets */
Score_Imp = 2000, /* Fire */
Score_DRLACaptain = 2000, /* Bullets */
/* Tier 2 */
Score_Demon = 5000, /* Melee */
Score_Spectre = 7500, /* Melee */
Score_LostSoul = 500, /* Melee */
Score_Nitrogolem = 4000, /* Melee, FireMagic */
/* Tier 3 */
Score_HellKnight = 7000, /* Melee, Magic */
Score_Revenant = 7000, /* Melee, Shrapnel */
Score_Cacodemon = 7000, /* Melee, Energy */
Score_Arachnotron = 7000, /* Energy */
Score_Mancubus = 7000, /* Fire */
Score_BaronOfHell = 8000, /* Melee, Magic */
Score_Ophidian = Score_Arachnotron, /* Ice, Fire */
/* Tier 4 */
Score_PainElemental = 20000, /* None */
Score_Archvile = 40000, /* FireMagic */
/* Tier 5 */
Score_SpiderDemon = 700000, /* Bullets */
Score_CyberDemon = 1500000, /* Shrapnel */
Score_Maulotaur = Score_SpiderDemon, /* Melee, Fire */
/* Tier 6 */
Score_DSparil = 10000000, /* Energy */
Score_ZombieMan = 1000,
Score_ShotgunGuy = 2000,
Score_ChaingunGuy = 2000,
Score_Imp = 2000,
Score_DRLACaptain = 2000,
Score_Demon = 5000,
Score_Spectre = 7500,
Score_LostSoul = 500,
Score_Nitrogolem = 4000,
Score_HellKnight = 7000,
Score_Revenant = 7000,
Score_Cacodemon = 7000,
Score_Arachnotron = 7000,
Score_Mancubus = 7000,
Score_BaronOfHell = 8000,
Score_Ophidian = Score_Arachnotron,
Score_PainElemental = 20000,
Score_Archvile = 40000,
Score_SpiderDemon = 700000,
Score_CyberDemon = 1500000,
Score_Maulotaur = Score_SpiderDemon,
Score_DSparil = 10000000,
Score_AIMainframe = Score_DSparil,
};

enum Lith_EXPNum
{
/* Tier 1 */
enum Lith_EXPNum {
Exp_ZombieMan = 5,
Exp_ShotgunGuy = 10,
Exp_ChaingunGuy = 15,
Exp_Imp = 5,
Exp_DRLACaptain = 30,

/* Tier 2 */
Exp_Demon = 10,
Exp_Spectre = Exp_Demon,
Exp_LostSoul = 5,
Exp_Nitrogolem = 20,

/* Tier 3 */
Exp_HellKnight = 80,
Exp_Revenant = 80,
Exp_Cacodemon = 50,
@@ -97,18 +74,19 @@ enum Lith_EXPNum
Exp_BaronOfHell = 100,
Exp_Ophidian = 50,

/* Tier 4 */
Exp_PainElemental = 100,
Exp_Archvile = 200,

/* Tier 5 */
Exp_SpiderDemon = 3000,
Exp_CyberDemon = 4000,
Exp_Maulotaur = 1000,

/* Tier 6 */
Exp_DSparil = 9000,
Exp_AIMainframe = Exp_DSparil,
};

/* EOF */



source/include/w_data.h → pk7/lzscript/Constants/w_world.zsc View File

@@ -1,19 +1,13 @@
/* ---------------------------------------------------------------------------|
*
* Distributed under the CC0 public domain license.
* By Alison G. Watson. Attribution is encouraged, though not required.
* See licenses/cc0.txt for more information.
*
* ---------------------------------------------------------------------------|
*
* Exposed world data.
*
* ---------------------------------------------------------------------------|
*/
/* decompat-out pk7/lzscript/Constants/w_data.zsc */

enum /* WData */
{









enum Lith_WData {
wdata_bossspawned,
wdata_soulsfreed,
wdata_dorain,
@@ -21,16 +15,14 @@ enum /* WData */
wdata_pclass,
};

enum /* Fun */
{
enum Lith_Fun {
lfun_ragnarok = 1 << 0,
lfun_bips = 1 << 1,
lfun_final = 1 << 2,
lfun_division = 1 << 3,
};

enum /* CBIUpgradeM */
{
enum Lith_CBIUpgradeM {
cupg_weapninter,
cupg_hasupgr1,
cupg_armorinter,
@@ -40,8 +32,7 @@ enum /* CBIUpgradeM */
cupg_max
};

enum /* CBIUpgradeC */
{
enum Lith_CBIUpgradeC {
cupg_c_slot3spell,
cupg_c_slot4spell,
cupg_c_slot5spell,
@@ -50,8 +41,7 @@ enum /* CBIUpgradeC */
cupg_c_rdistinter,
};

enum /* RandomSpawnNum */
{
enum Lith_RandomSpawnNum {
lrsn_garmor,
lrsn_barmor,
lrsn_hbonus,
@@ -60,16 +50,14 @@ enum /* RandomSpawnNum */
lrsn_clipbx,
};

enum /* MsgType */
{
enum Lith_MsgType {
msg_ammo,
msg_huds,
msg_full,
msg_both
};

enum /* DamageType */
{
enum Lith_DamageType {
ldt_bullets,
ldt_energy,
ldt_fire,
@@ -82,8 +70,7 @@ enum /* DamageType */
ldt_none
};

enum /* ScriptNum */
{
enum Lith_ScriptNum {
lsc_gsinit = 17000,
lsc_getfontmetric,
lsc_metr_xadv,
@@ -101,10 +88,19 @@ enum /* ScriptNum */
lsc_drawdmgnum,
lsc_preinit,
lsc_worldreopen,



lsc_setptri32,
lsc_setptrk32,
lsc_setptrbool,


};

enum /* BossType */
{
enum Lith_BossType {
boss_none,
boss_barons,
boss_cyberdemon,
@@ -113,4 +109,7 @@ enum /* BossType */
boss_other,
};

/* EOF */





+ 0
- 7
pk7/lzscript/Player/Base.zsc View File

@@ -136,10 +136,6 @@ private void Lith_ItemVacuum() {
}
}

double lith_getViewHeight() {
return height / 2 + attackZOffset * player.crouchFactor;
}

int, int, bool Lith_Unproject(vector3 loc) {
/* create (view-adjusted) normalized vector for where we're looking */
vector3 la = pos - loc;
@@ -236,9 +232,6 @@ void Lith_PostTick() {
Lith_ShowDamageNums(i);
}

if(health > 0 && CVar.GetCVar('lith_xhair_enable', player).getBool())
Lith_ShowCrosshair();

if(!deathmatch) for(int i = 0; i < MAXPLAYERS; i++)
if(playeringame[i] && players[i] != player && players[i].mo)
Lith_PlayerIndicator(players[i]);


+ 0
- 46
pk7/lzscript/Player/HUD.zsc View File

@@ -102,52 +102,6 @@ private void Lith_ShowDamageNums(int which) {
}
}

private void Lith_ShowCrosshair() {
if(gamestate == GS_TITLELEVEL) return;

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

/* trace to where the crosshair should be in world space */
double sz = lith_getViewHeight();
let loc = Lith_UTIL.TraceFrom(self, ry, 2048, rp, sz);

/* unproject */
int xhx, xhy; [xhx, xhy] = Lith_Unproject(loc);

/* draw a tracer for targeting system */
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");
}

/* draw the crosshair */
uint r = min(CVar.GetCVar('lith_xhair_r', player).getInt(), 255);
uint g = min(CVar.GetCVar('lith_xhair_g', player).getInt(), 255);
uint b = min(CVar.GetCVar('lith_xhair_b', player).getInt(), 255);
uint a = min(CVar.GetCVar('lith_xhair_a', player).getInt(), 255);

int style = CVar.GetCVar('lith_xhair_style', player).getInt();

let c = String.Format("#%.2X%.2X%.2X", r, g, b);

let gb = String.Format(":XHairs:%ib", style);
let gw = String.Format(":XHairs:%iw", style);

Lith_URANUS.LS(self, gb, xhx, xhy, 0x400 | a);
Lith_URANUS.LS(self, gw, xhx, xhy, 0x400 | a, c);

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

Lith_URANUS.LS(self, ":XHairs:L", xhx - xp, xhy, 0x400 | a, c);
Lith_URANUS.LS(self, ":XHairs:R", xhx + xp, xhy, 0x400 | a, c);
}
}

private void Lith_PlayerIndicator(PlayerInfo p) {
let mo = p.MO;



+ 22
- 0
pk7/lzscript/Playsim/Player.zsc View File

@@ -12,6 +12,28 @@ extend class Lith_HERMES;
private play string m_LogName;
private play string m_BipName;

static double GetViewHeight(Actor mo) {
return Lith_Player(mo).player.viewz - mo.pos.z;
}

static double GetAttackHeight(Actor mo) {
return mo.height / 2 + mo.player.mo.attackZOffset * mo.player.crouchFactor;
}

static void Unproject(Actor mo, double x_, double y_, double z_, int px, int py, int pv) {
int x, y; bool v; [x, y, v] = Lith_Player(mo).Lith_Unproject((x_, y_, z_));
if(px) ACS_ExecuteWithResult(lsc_setptri32, px, x);
if(py) ACS_ExecuteWithResult(lsc_setptri32, py, y);
if(pv) ACS_ExecuteWithResult(lsc_setptrbool, pv, v);
}

static void TraceFrom(Actor mo, double yaw, double pitch, double dist, double offsetz, bool floor, int px, int py, int pz) {
vector3 v = Lith_UTIL.TraceFrom(mo, yaw * 360, pitch * 360, dist, offsetz, floor);
if(px) ACS_ExecuteWithResult(lsc_setptrk32, px, v.x * FIX);
if(py) ACS_ExecuteWithResult(lsc_setptrk32, py, v.y * FIX);
if(pz) ACS_ExecuteWithResult(lsc_setptrk32, pz, v.z * FIX);
}

static void PlayerInit(Actor mo_) {
let mo = Lith_Player(mo_);
/* mo.m_CS = Lith_Cyberspace.create(); */


+ 4
- 1
pk7/lzscript/Utilities.zsc View File

@@ -61,12 +61,15 @@ struct Lith_UTIL
return int(n * 1000) % 1000 < 500 ? int(n) : int(n+0.5);
}

static play vector3 TraceFrom(Actor mo, double yaw, double dist, double pitch, double offsetz) {
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;
let ofz = (mo.pos.xy, mo.pos.z + offsetz);
loc = ofz + level.vec3Diff(ofz, loc);
if(floor) {
loc.z = ltd.hitSector.floorPlane.zAtPoint(loc.xy);
}
return loc;
}



+ 2
- 2
source/d_stmt.c View File

@@ -36,8 +36,8 @@ void Dlg_GetStmt_Cond(struct compiler *d)
Dlg_PushB2(d, VAR_PCLASS);

Dlg_PushB1(d, DCD_CMP_VI);
#define PCL(shr, lng) \
if(faststrcmp(tok->textV, #shr) == 0) {Dlg_PushB1(d, shr); goto ok;}
#define pclass_x(shr, lng, eq) \
if(faststrcmp(tok->textV, #shr) == 0) {Dlg_PushB1(d, lng); goto ok;}
#include "p_player.h"
d->tb.errtk(tok, "invalid playerclass type");
} else {


+ 26
- 28
source/d_vm.c View File

@@ -294,10 +294,10 @@ void TerminalGUI(struct player *p, u32 tact) {
tmidx = tright/2, tmidy = tbottom/2,
};

Str(term_disconnecting, sLANG "TERM_DISCONNECTING");
Str(term_ip, sLANG "TERM_IP");
Str(term_sgxline, sLANG "TERM_SGXLINE");
Str(term_use_to_ack, sLANG "TERM_USE_TO_ACK");
Str(sl_term_disconnecting, sLANG "TERM_DISCONNECTING");
Str(sl_term_ip, sLANG "TERM_IP");
Str(sl_term_sgxline, sLANG "TERM_SGXLINE");
Str(sl_term_use_to_ack, sLANG "TERM_USE_TO_ACK");

G_Begin(&gst, twidth, theigh);
G_UpdateState(&gst, p);
@@ -308,28 +308,28 @@ void TerminalGUI(struct player *p, u32 tact) {
PrintRect(0, tbottom-12, twidth, 12, 0x44000C);

/* Top-left text */
PrintText_str(L(term_sgxline), s_ltrmfont, CR_RED, 0,1, 0,1);
PrintText_str(L(sl_term_sgxline), sf_ltrmfont, CR_RED, 0,1, 0,1);

/* Top-right text */
str tr = GetRemote();
switch(tact) {
default: tr = StrParam(LC(LANG "TERM_REMOTE"), tr); break;
case TACT_LOGON: tr = StrParam(LC(LANG "TERM_OPEN_CONNECT"), tr); break;
case TACT_LOGOFF: tr = L(term_disconnecting); break;
case TACT_LOGOFF: tr = L(sl_term_disconnecting); break;
}
PrintText_str(tr, s_ltrmfont, CR_RED, tright,2, 0,1);
PrintText_str(tr, sf_ltrmfont, CR_RED, tright,2, 0,1);

/* Bottom-left text */
PrintText_str(L(term_ip), s_ltrmfont, CR_RED, 0,1, tbottom,2);
PrintText_str(L(sl_term_ip), sf_ltrmfont, CR_RED, 0,1, tbottom,2);

/* Bottom-right text */
str br;
switch(tact) {
case TACT_LOGON:
case TACT_LOGOFF: br = l_strdup(CanonTime(ct_date, ticks)); break;
default: br = L(term_use_to_ack); break;
default: br = L(sl_term_use_to_ack); break;
}
PrintText_str(br, s_ltrmfont, CR_RED, tright,2, tbottom,2);
PrintText_str(br, sf_ltrmfont, CR_RED, tright,2, tbottom,2);

/* Contents */
char pict[64] = ":Terminal:"; strcat(pict, MemSC_G(MemB2_G(VAR_PICTL)));
@@ -341,7 +341,7 @@ void TerminalGUI(struct player *p, u32 tact) {
str text = GetText(_from_lon);

if(text) {
PrintText_str(text, s_ltrmfont, CR_WHITE, tmidx,0, tmidy + 35,0);
PrintText_str(text, sf_ltrmfont, CR_WHITE, tmidx,0, tmidy + 35,0);
y -= 10;
}

@@ -356,7 +356,7 @@ void TerminalGUI(struct player *p, u32 tact) {
G_Clip(&gst, tleft, ttop, tmidx, ttheigh);

if(text) {
PrintText_str(text, s_ltrmfont, CR_WHITE, tleft,1, ttop,1);
PrintText_str(text, sf_ltrmfont, CR_WHITE, tleft,1, ttop,1);
}

G_ClipRelease(&gst);
@@ -368,7 +368,7 @@ void TerminalGUI(struct player *p, u32 tact) {
G_Clip(&gst, 0, ttop, ttwidth, ttheigh);

if(text) {
PrintText_str(text, s_ltrmfont, CR_WHITE, 2,1, ttop+2,1);
PrintText_str(text, sf_ltrmfont, CR_WHITE, 2,1, ttop+2,1);
}

G_ClipRelease(&gst);
@@ -378,7 +378,8 @@ void TerminalGUI(struct player *p, u32 tact) {

G_End(&gst, gui_curs_outlineinv);

if(p->buttons & BT_USE && !(p->old.buttons & BT_USE) && p->old.dlg.active) {
if(p->buttons & BT_USE && !(p->old.buttons & BT_USE) &&
p->old.modal == _gui_dlg) {
ACS_LocalAmbientSound(ss_player_trmswitch, 127);
MemB1_S(VAR_UACT, UACT_ACKNOWLEDGE);
}
@@ -399,14 +400,14 @@ static void DialogueGUI(struct player *p) {
PrintSpriteA(l_strdup(icon), 0,1, 0,1, 0.7);

PrintTextStr(snam);
PrintText(s_bigupper, CR_GREEN, 30,1, 35,1);
PrintText(sf_bigupper, CR_GREEN, 30,1, 35,1);

G_Clip(&gst, left, top, 257, 150);
PrintTextFmt("\Cd> Remote: %S\n\Cd> Date: %s", srem, CanonTime(ct_full, ticks));
PrintText(s_lmidfont, CR_WHITE, left,1, top,1);
PrintText(sf_lmidfont, CR_WHITE, left,1, top,1);

if(text) {
PrintText_str(text, s_smallfnt, CR_WHITE, left,1, texttop,1);
PrintText_str(text, sf_smallfnt, CR_WHITE, left,1, texttop,1);
}

G_ClipRelease(&gst);
@@ -569,14 +570,12 @@ void ActTRM_WAIT(struct player *p) {
/* Main dialogue VM. */
dynam_aut script
void Dlg_Run(struct player *p, u32 num) {
if(p->dead || p->dlg.active > 1)
if(p->dead || p->modal != _gui_dlg)
return;

/* get the dialogue by number */
register struct dlg_def *def = &dlgdefs[num];

p->dlg.active++;

if(!def->codeV) {
#ifndef NDEBUG
Log("%s ERROR: dialogue %u has no code", __func__, num);
@@ -589,7 +588,6 @@ void Dlg_Run(struct player *p, u32 num) {
gst.cx = 320 / 2;
gst.cy = 200 / 2;
gst.gfxprefix = ":UI_Green:";
G_Init(&gst);

/* VM state */
register u32 ua, ub, ur;
@@ -978,7 +976,7 @@ TRV_NP:
halt:
Dbg_Log(log_dlg, "%s: exited", __func__);

p->dlg.active -= 2;
p->modal = _gui_none;
}

/* Scripts ----------------------------------------------------------------- */
@@ -986,9 +984,9 @@ halt:
script_str ext("ACS") addr(OBJ "RunProgram")
void Sc_RunProgram(i32 num) {
with_player(LocalPlayer) {
if(!p->dlg.active) {
if(p->modal == _gui_none) {
p->dlg.num = DNUM_PRG_BEG + num;
p->dlg.active++;
p->modal = _gui_dlg;
}
}
}
@@ -996,10 +994,10 @@ void Sc_RunProgram(i32 num) {
script_str ext("ACS") addr(OBJ "RunDialogue")
void Sc_RunDialogue(i32 num) {
with_player(LocalPlayer) {
if(!p->dlg.active) {
if(p->modal == _gui_none) {
p->dlg.num = DNUM_DLG_BEG + num;
p->dlg.page = 0;
p->dlg.active++;
p->modal = _gui_dlg;
}
}
}
@@ -1007,7 +1005,7 @@ void Sc_RunDialogue(i32 num) {
script_str ext("ACS") addr(OBJ "RunTerminal")
void Sc_RunTerminal(i32 num) {
with_player(LocalPlayer) {
if(!p->dlg.active) {
if(p->modal == _gui_none) {
switch(mission) {
case _unfinished: p->dlg.page = DPAGE_UNFINISHED; break;
case _finished: p->dlg.page = DPAGE_FINISHED; break;
@@ -1015,7 +1013,7 @@ void Sc_RunTerminal(i32 num) {
}

p->dlg.num = DNUM_TRM_BEG + num;
p->dlg.active++;
p->modal = _gui_dlg;
}
}
}


+ 2
- 7
source/g_auto.c View File

@@ -73,11 +73,6 @@ void G_Auto(struct gui_state *g, u32 id, i32 x, i32 y, i32 w, i32 h,
#endif
}

void G_Init(struct gui_state *g, void *state) {
g->state = state;
g->gfxprefix = ":UI:";
}

void G_UpdateState(struct gui_state *g, struct player *p) {
/* Due to ZDoom being ZDoom, GetUserCVar with invertmouse does
* nothing. This breaks network sync so we can only do it in
@@ -85,8 +80,8 @@ void G_UpdateState(struct gui_state *g, struct player *p) {
*/
bool inverted = p->getCVarI(sc_player_invertmouse);

Str(invertmouse, s"invertmouse");
if(singleplayer) inverted |= ACS_GetCVar(invertmouse);
Str(sc_invertmouse, s"sc_invertmouse");
if(singleplayer) inverted |= ACS_GetCVar(sc_invertmouse);

g->old = g->cur;



+ 1
- 1
source/g_textbox.c View File

@@ -58,7 +58,7 @@ struct gui_txt *G_TxtBox_Imp(struct gui_state *g, u32 id, struct gui_arg_txt con
hot ? Ticker("|", "") : "");
else
PrintTextFmt("\C%c%s", hot ? 'c' : 'm', LC(LANG "GUI_TEXTBOX"));
PrintText(s_smallfnt, g->defcr, a->x + g->ox,1, a->y + g->oy,1);
PrintText(sf_smallfnt, g->defcr, a->x + g->ox,1, a->y + g->oy,1);
ClearClip();

fastmemset(a->p->txtbuf, 0, sizeof a->p->txtbuf);


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

@@ -78,6 +78,27 @@
#define GetY ACS_GetActorY
#define GetZ ACS_GetActorZ

#define GetHealth(tid) GetMembI(tid, sm_Health)
#define GetHeight(tid) GetMembK(tid, sm_Height)
#define GetNameTag(tid) GetPropS(tid, APROP_NameTag)
#define GetRadius(tid) GetMembK(tid, sm_Radius)
#define GetSpecies(tid) GetPropS(tid, APROP_Species)
#define GetViewHeight(tid) ServCallK(sm_GetViewHeight)
#define GetAttackHeight(tid) ServCallK(sm_GetAttackHeight)

#define SetAlpha(tid, x) SetPropK(tid, APROP_Alpha, x)
#define SetDamage(tid, x) SetPropI(tid, APROP_Damage, x)
#define SetDamageMultiplier(tid, x) SetPropK(tid, APROP_DamageMultiplier, x)
#define SetFriction(tid, x) SetPropK(tid, APROP_Friction, x)
#define SetGravity(tid, x) SetPropK(tid, APROP_Gravity, x)
#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)

#define Paused ServCallI(sm_GetPaused)
#define PausableTick() do ACS_Delay(1); while(Paused)
#define WaitPause() while(Paused) ACS_Delay(1)


+ 0
- 3
source/include/gui.h View File

@@ -302,9 +302,6 @@ extern struct gui_presets const gui_p;
optargs(1)
void G_Auto(struct gui_state *g, u32 id, i32 x, i32 y, i32 w, i32 h, bool slide);

optargs(1)
void G_Init(struct gui_state *g, void *state);

void G_UpdateState(struct gui_state *g, struct player *p);

optargs(2)


+ 5
- 6
source/include/items.h View File

@@ -10,14 +10,13 @@
*
* ---------------------------------------------------------------------------|
*/
/* decompat-out pk7/lzscript/Constants/items.zsc */

/* decompat-cut */
#ifndef items_h
#define items_h

#define for_item(cont) for_list(struct item *it, (cont).items) if(it)

#if !ZscOn
enum {
_inv_backpack,
_inv_arm_upper_l,
@@ -31,16 +30,16 @@ enum {
_inv_legs,
_inv_num,
};
/* decompat-end */
#endif

enum /* Container */ {
enum ZscName(Container) {
_cont_store,
_cont_arms_u,
_cont_arms_l,
_cont_body,
};

/* decompat-cut */
#if !ZscOn
struct itemdata {
str name, spr;
u32 w, h;
@@ -99,6 +98,6 @@ script bool P_Inv_PlaceFirst(struct container *cont, struct item *item);
script bool P_Inv_SwapFirst(struct container *cont, struct item *lhs);
bool P_Inv_Swap(struct item *lhs, struct item *rhs);
bool P_Inv_Add(struct player *p, struct item *item);
#endif

#endif
/* decompat-end */

+ 12
- 9
source/include/m_drawing.h View File

@@ -10,9 +10,7 @@
*
* ---------------------------------------------------------------------------|
*/
/* decompat-out pk7/lzscript/Constants/m_drawing.zsc */

/* decompat-cut */
#if defined(GlobalCr)
#if !defined(GlobalCrH)
#define GlobalCrH GlobalCr
@@ -90,6 +88,12 @@ GlobalCrH(wselm1) GlobalCrH(wselm2) GlobalCrH(wselm3) GlobalCrH(wselms)
#define PrintSpriteFP(name, x, xa, y, ya, num) \
DrawCallI(sm_LS, name, PrintSpriteArgs_F(x, xa, y, ya, num, 0x100))

#define PrintSpriteC(name, x, xa, y, ya, c) \
DrawCallI(sm_LS, name, PrintSpriteArgs_N(x, xa, y, ya, 0), c)

#define PrintSpriteAC(name, x, xa, y, ya, alpha, c) \
DrawCallI(sm_LS, name, PrintSpriteArgs_A(x, xa, y, ya, alpha, 0), c)

#define PrintTextFmt(...) StrParamBegin(__VA_ARGS__)
#define PrintTextStr(s) (ACS_BeginPrint(), ACS_PrintString(s))
#define PrintTextChr(s, n) (ACS_BeginPrint(), PrintChars(s, n))
@@ -179,6 +183,7 @@ GlobalCrH(wselm1) GlobalCrH(wselm2) GlobalCrH(wselm3) GlobalCrH(wselms)
#define StartSound(...) \
DrawCallI(sm_StartSound, __VA_ARGS__)

#if !ZscOn
enum {
CHANF_LISTENERZ = 8,
CHANF_MAYBE_LOCAL = 16,
@@ -210,10 +215,9 @@ enum {
};

i32 Draw_GetCr(i32 n);
/* decompat-end */
#endif

enum /* FontNum */
{
enum ZscName(FontNum) {
font_misaki_gothic,
font_misaki_mincho,
font_k6x8,
@@ -221,8 +225,7 @@ enum /* FontNum */
font_num,
};

enum /* Channel */
{
enum ZscName(Channel) {
lch_auto,

lch_weapon,
@@ -245,10 +248,10 @@ enum /* Channel */
lch_weapon3,
};

/* decompat-cut */
#if !ZscOn
void Draw_Init(void);
#endif

#endif
/* decompat-end */

/* EOF */

+ 6
- 1
source/include/m_math.h View File

@@ -11,6 +11,9 @@
* ---------------------------------------------------------------------------|
*/

#ifndef m_math_h
#define m_math_h

#define dst_bit(y) (1 << (y))
#define get_bit(x, y) ((x) & dst_bit(y))
#define set_bit(x, y) ((x) |= dst_bit(y))
@@ -72,5 +75,7 @@ stkcall i32 bzpolyi(i32 a, i32 b, k64 t);
struct i32v2 qbezieri(i32 x1, i32 y1, i32 x2, i32 y2, i32 x3, i32 y3, k64 t);
struct k64v2 qbezierlk(k64 x1, k64 y1, k64 x2, k64 y2, k64 x3, k64 y3, k64 t);
struct polar ctopol(k32 x, k32 y);
optargs(1) struct k32v3 trace_from(k32 yaw, k32 pitch, k32 dist, k32 offsetz, bool floor);
optargs(1) struct i32v2 unproject(k32 x, k32 y, k32 z, bool *visible);

/* EOF */
#endif

+ 19
- 18
source/include/m_stab.h View File

@@ -13,19 +13,15 @@

#if defined(X)

/* Strings */
X(s_LITHCAM1, "LITHCAM1")
X(s_LITHCAM2, "LITHCAM2")
X(s_LITHCAM3, "LITHCAM3")
X(s_NIL, "")
X(s_None, "None")
X(s_alienfont, "alienfont")
X(s_areaname, "areaname")
X(s_bigupper, "bigupper")
X(s_lhudfontsmall, "lhudfontsmall")
X(s_lmidfont, "lmidfont")
X(s_ltrmfont, "ltrmfont")
X(s_smallfnt, "smallfnt")
X(st_nil, "")

/* Font Names */
X(sf_areaname, "areaname")
X(sf_bigupper, "bigupper")
X(sf_lhudfontsmall, "lhudfontsmall")
X(sf_lmidfont, "lmidfont")
X(sf_ltrmfont, "ltrmfont")
X(sf_smallfnt, "smallfnt")

/* Console Variables */
X(sc_fun, DCVAR "fun")
@@ -100,6 +96,7 @@ X(sm_FindFontColor, "FindFontColor")
X(sm_FindLump, "FindLump")
X(sm_ForceDraw, "ForceDraw")
X(sm_FxTID, "m_FxTID")
X(sm_GetAttackHeight, "GetAttackHeight")
X(sm_GetBipName, "GetBipName")
X(sm_GetBossLevel, "GetBossLevel")
X(sm_GetCurMag, "GetCurMag")
@@ -110,12 +107,15 @@ X(sm_GetOutOfDodge, "GetOutOfDodge")
X(sm_GetPaused, "GetPaused")
X(sm_GetRifleGrenade, "GetRifleGrenade")
X(sm_GetSpawnHealth, "GetSpawnHealth")
X(sm_GetViewHeight, "GetViewHeight")
X(sm_GivePoison, "GivePoison")
X(sm_GrabInput, "m_GrabInput")
X(sm_Health, "Health")
X(sm_Height, "Height")
X(sm_InvName, "m_InvName")
X(sm_IonizeFX, OBJ "IonizeFX")
X(sm_IsRampancy, "IsRampancy")
X(sm_JumpZ, "JumpZ")
X(sm_LC, "LC")
X(sm_LE, "LE")
X(sm_LF, "LF")
@@ -139,17 +139,20 @@ X(sm_PlayerDeathNuke, "PlayerDeathNuke")
X(sm_PlayerInit, "PlayerInit")
X(sm_PoisonFX, "PoisonFX")
X(sm_PureSteggleEnergy, "PureSteggleEnergy")
X(sm_Radius, "Radius")
X(sm_ReadLump, "ReadLump")
X(sm_Set, "Set")
X(sm_SetEnding, "SetEnding")
X(sm_SetFrozen, "SetFrozen")
X(sm_SetTeleFogTo, "SetTeleFogTo")
X(sm_SpawnBoss, "SpawnBoss")
X(sm_SpawnRain, "SpawnRain")
X(sm_Speed, "Speed")
X(sm_StartSound, "StartSound")
X(sm_SurgeOfDestiny, "SurgeOfDestiny")
X(sm_TraceFrom, "TraceFrom")
X(sm_Trigger, "m_Trigger")
X(sm_TriggerBoss, "TriggerBoss")
X(sm_Unproject, "Unproject")
X(sm_UpgradeBody, "m_UpgradeBody")
X(sm_UpgradeExtr, "m_UpgradeExtr")
X(sm_UpgradeId, "m_UpgradeId")
@@ -158,6 +161,7 @@ X(sm_UseItem, "UseItem")
X(sm_UserX, "user_X")
X(sm_UserY, "user_Y")
X(sm_UserZ, "user_Z")
X(sm_WaterLevel, "WaterLevel")

/* Objects */
X(so_AssassinPlayer, OBJ "AssassinPlayer")
@@ -205,11 +209,11 @@ X(so_MonsterID, OBJ "MonsterID")
X(so_MonsterInvalid, OBJ "MonsterInvalid")
X(so_MonsterLevelUp, OBJ "MonsterLevelUp")
X(so_MonsterSoul, OBJ "MonsterSoul")
X(so_NoDamage, OBJ "NoDamage")
X(so_PlasmaAmmo, OBJ "PlasmaAmmo")
X(so_Player, OBJ "Player")
X(so_PoisonFXReset, OBJ "PoisonFXReset")
X(so_PoisonFXTimer, OBJ "PoisonFXTimer")
X(so_PowerStrength, OBJ "PowerStrength")
X(so_PunctuatorExplosion, OBJ "PunctuatorExplosion")
X(so_PunctuatorPuff, OBJ "PunctuatorPuff")
X(so_RainDrop, OBJ "RainDrop")
@@ -308,11 +312,8 @@ X(ss_player_cbi_keypress, "player/cbi/keypress")
X(ss_player_cbi_mail, "player/cbi/mail")
X(ss_player_cbi_scroll, "player/cbi/scroll")
X(ss_player_cbi_scrollend, "player/cbi/scrollend")
X(ss_player_counter, "player/counter")
X(ss_player_counterdone, "player/counterdone")
X(ss_player_death1, "player/death1")
X(ss_player_doublejump, "player/doublejump")
X(ss_player_infraredoff, "player/infraredoff")
X(ss_player_levelup, "player/levelup")
X(ss_player_manafull, "player/manafull")
X(ss_player_pickup_item, "player/pickup/item")


+ 5
- 1
source/include/m_types.h View File

@@ -62,8 +62,12 @@ typedef float f32;
typedef double f64;

struct polar {k32 ang, dst;};
struct k64v2 {k64 x, y;};
struct i32v2 {i32 x, y;};
struct k32v2 {k32 x, y;};
struct k64v2 {k64 x, y;};
struct i32v3 {i32 x, y, z;};
struct k32v3 {k32 x, y, z;};
struct k64v3 {k64 x, y, z;};
struct ptr2 {u32 l, h;};

union ik32 {i32 i; k32 k;};


+ 18
- 11
source/include/p_cbi.h View File

@@ -11,7 +11,22 @@
* ---------------------------------------------------------------------------|
*/

#ifndef p_cbi_h
#if defined(cbi_theme_x)

cbi_theme_x(Green)
cbi_theme_x(Rose)
cbi_theme_x(Umi)
cbi_theme_x(Ender)
cbi_theme_x(Orange)
cbi_theme_x(Grey)
cbi_theme_x(Basilissa)
cbi_theme_x(Ghost)
cbi_theme_x(WinXP)
cbi_theme_x(Trans)

#undef cbi_theme_x

#elif !defined(p_cbi_h)
#define p_cbi_h

#include "gui.h"
@@ -46,16 +61,8 @@ enum {
};

enum {
cbi_theme_green,
cbi_theme_rose,
cbi_theme_umi,
cbi_theme_ender,
cbi_theme_orange,
cbi_theme_grey,
cbi_theme_basilissa,
cbi_theme_ghost,
cbi_theme_winxp,
cbi_theme_trans,
#define cbi_theme_x(x) cbi_theme_##x,
#include "p_cbi.h"
cbi_theme_max
};



+ 0
- 85
source/include/p_data.h View File

@@ -1,85 +0,0 @@
/* ---------------------------------------------------------------------------|
*
* Distributed under the CC0 public domain license.
* By Alison G. Watson. Attribution is encouraged, though not required.
* See licenses/cc0.txt for more information.
*
* ---------------------------------------------------------------------------|
*
* Exposed player data.
*
* ---------------------------------------------------------------------------|
*/
/* decompat-out pk7/lzscript/Constants/p_data.zsc */

enum /* Attrib */ {
at_acc,
at_def,
at_str,
at_vit,
at_stm,
at_luk,
at_spc,
at_max
};

enum /* PData */ {
pdata_weapon,
pdata_upgrade,
pdata_riflemode,
pdata_hassigil,
pdata_weaponzoom,
pdata_pclass,
pdata_semifrozen,
pdata_slot3ammo,
pdata_addp,
pdata_addy,
pdata_recoilp,
pdata_attr,
};

enum /* SubweaponType */ {
_subw_gun,
_subw_dagger,
_subw_grenade,
_subw_mine,
_subw_axe,
_subw_dart,
_subw_max,
};

enum /* DamageNumType */ {
_dnum_smol,
_dnum_norm,
_dnum_crit,
_dnum_max,
};

enum /* PClass */ {
pcl_unknown,

/* Base Classes */
pcl_marine = 1 << 0,
pcl_cybermage = 1 << 1,
pcl_informant = 1 << 2,
pcl_wanderer = 1 << 3,
pcl_assassin = 1 << 4,
pcl_darklord = 1 << 5,
pcl_thoth = 1 << 6,

/* Groups */
pcl_outcasts = pcl_marine | pcl_cybermage,
pcl_missioners = pcl_informant | pcl_wanderer,
pcl_intruders = pcl_assassin | pcl_darklord | pcl_thoth,

/* Lifeform Type */
pcl_human = pcl_marine | pcl_cybermage | pcl_assassin,
pcl_nonhuman = pcl_wanderer | pcl_darklord | pcl_thoth,
pcl_robot = pcl_informant,

/* Misc. Abilities */
pcl_any = pcl_human | pcl_nonhuman | pcl_robot,
pcl_magicuser = pcl_cybermage | pcl_wanderer | pcl_thoth,
};

/* EOF */

+ 102
- 34
source/include/p_player.h View File

@@ -11,35 +11,92 @@
* ---------------------------------------------------------------------------|
*/

#if defined(PCL)
#if defined(pclass_x)
/* Shorthand and classes. For parsing and headers. */
PCL(pM, pcl_marine)
PCL(pC, pcl_cybermage)
PCL(pI, pcl_informant)
PCL(pW, pcl_wanderer)
PCL(pA, pcl_assassin)
PCL(pD, pcl_darklord)
PCL(pT, pcl_thoth)

PCL(gO, pcl_outcasts)
PCL(gM, pcl_missioners)
PCL(gI, pcl_intruders)
PCL(gA, pcl_any)
PCL(gH, pcl_human)
PCL(gN, pcl_nonhuman)
PCL(gR, pcl_robot)
#undef PCL
/* Base Classes */
pclass_x(pM, pcl_marine, 1 << 0)
pclass_x(pC, pcl_cybermage, 1 << 1)
pclass_x(pI, pcl_informant, 1 << 2)
pclass_x(pW, pcl_wanderer, 1 << 3)
pclass_x(pA, pcl_assassin, 1 << 4)
pclass_x(pD, pcl_darklord, 1 << 5)
pclass_x(pT, pcl_thoth, 1 << 6)

/* Groups */
pclass_x(gO, pcl_outcasts, pcl_marine | pcl_cybermage)
pclass_x(gM, pcl_missioners, pcl_informant | pcl_wanderer)
pclass_x(gI, pcl_intruders, pcl_assassin | pcl_darklord | pcl_thoth)

/* Lifeform Type */
pclass_x(gH, pcl_human, pcl_marine | pcl_cybermage | pcl_assassin)
pclass_x(gN, pcl_nonhuman, pcl_wanderer | pcl_darklord | pcl_thoth)
pclass_x(gR, pcl_robot, pcl_informant)

/* Misc. Abilities */
pclass_x(gA, pcl_any, pcl_human | pcl_nonhuman | pcl_robot)
pclass_x(gU, pcl_magicuser, pcl_cybermage | pcl_wanderer | pcl_thoth)
#undef pclass_x
#elif !defined(p_player_h)
#define p_player_h

enum ZscName(Attrib) {
at_acc,
at_def,
at_str,
at_vit,
at_stm,
at_luk,
at_spc,
at_max
};

enum ZscName(PData) {
pdata_weapon,
pdata_upgrade,
pdata_riflemode,
pdata_hassigil,
pdata_weaponzoom,
pdata_pclass,
pdata_semifrozen,
pdata_slot3ammo,
pdata_addp,
pdata_addy,
pdata_recoilp,
pdata_attr,
};

enum ZscName(SubweaponType) {
_subw_gun,
_subw_dagger,
_subw_grenade,
_subw_mine,
_subw_axe,
_subw_dart,
_subw_max,
};

enum ZscName(DamageNumType) {
_dnum_smol,
_dnum_norm,
_dnum_crit,
_dnum_max,
};

enum ZscName(PClass) {
pcl_unknown,

#define pclass_x(shr, lng, eq) lng = eq,
#include "p_player.h"
};

#if !ZscOn
#include "common.h"
#include "p_cbi.h"
#include "p_upgrades.h"
#include "p_data.h"
#include "p_bip.h"
#include "p_log.h"
#include "m_list.h"
#include "p_wepinfo.h"
#include "p_weapons.h"
#include "p_shopdef.h"
#include "p_attrib.h"
#include "p_sys.h"
@@ -114,14 +171,12 @@ enum {
_max_players = 8,
};