Browse Source

refactoring, add flashlight, fix sprite conflicts

tags/1.6.3
Alison Watson 1 year ago
parent
commit
0fd2e0eb5f
60 changed files with 1401 additions and 1292 deletions
  1. BIN
      pk7/acs/lithmain.bin
  2. +7
    -0
      pk7/cvarinfo.txt
  3. +5
    -2
      pk7/keyconf.txt
  4. +2
    -0
      pk7/language.gfx.txt
  5. +11
    -1
      pk7/language.txt
  6. BIN
      pk7/lgfx/HUD/Battery.png
  7. BIN
      pk7/lgfx/HUD/BatteryOutline.png
  8. BIN
      pk7/lsounds/Player/LightOff
  9. BIN
      pk7/lsounds/Player/LightOn
  10. +33
    -33
      pk7/lzscript/1_Marine/2_Pistol.zsc
  11. +70
    -341
      pk7/lzscript/Player.zsc
  12. +102
    -0
      pk7/lzscript/Player/Bobbing.zsc
  13. +77
    -0
      pk7/lzscript/Player/Damage.zsc
  14. +67
    -0
      pk7/lzscript/Player/Flashlight.zsc
  15. +69
    -0
      pk7/lzscript/Player/HUD.zsc
  16. +39
    -0
      pk7/lzscript/Player/Markers.zsc
  17. +2
    -0
      pk7/sndinfo.txt
  18. +0
    -0
      pk7/sprites/WeaponsM/Pistol/MARPA0.png
  19. +0
    -0
      pk7/sprites/WeaponsM/Pistol/MARPB0.png
  20. +0
    -0
      pk7/sprites/WeaponsM/Pistol/MARPC0.png
  21. +0
    -0
      pk7/sprites/WeaponsM/Pistol/MARPD0.png
  22. +0
    -0
      pk7/sprites/WeaponsM/Pistol/MARPE0.png
  23. +20
    -175
      source/Headers/m_stab.h
  24. +25
    -15
      source/Headers/p_player.h
  25. +3
    -6
      source/Headers/w_world.h
  26. +2
    -2
      source/Main/debug.c
  27. +5
    -3
      source/Main/g_auto.c
  28. +154
    -157
      source/Main/m_namegen.c
  29. +1
    -1
      source/Main/p_cbi.c
  30. +39
    -24
      source/Main/p_data.c
  31. +14
    -7
      source/Main/p_gui_bip.c
  32. +2
    -2
      source/Main/p_gui_cbi.c
  33. +2
    -2
      source/Main/p_gui_upgrades.c
  34. +3
    -2
      source/Main/p_items.c
  35. +17
    -8
      source/Main/p_obituary.c
  36. +2
    -2
      source/Main/p_pickups.c
  37. +18
    -8
      source/Main/p_player.c
  38. +35
    -0
      source/Main/p_ren_debug.c
  39. +25
    -0
      source/Main/p_ren_item.c
  40. +36
    -0
      source/Main/p_ren_magic.c
  41. +114
    -0
      source/Main/p_ren_scope.c
  42. +61
    -0
      source/Main/p_ren_step.c
  43. +68
    -0
      source/Main/p_ren_view.c
  44. +76
    -293
      source/Main/p_render.c
  45. +49
    -80
      source/Main/p_settings.c
  46. +2
    -1
      source/Main/p_weapons.c
  47. +2
    -3
      source/Main/u_headsupdisd.c
  48. +5
    -4
      source/Main/u_headsupdism.c
  49. +2
    -2
      source/Main/u_implying.c
  50. +2
    -1
      source/Main/u_reflexwetw.c
  51. +1
    -3
      source/Main/u_riflemodes.c
  52. +2
    -1
      source/Main/u_unceunce.c
  53. +43
    -48
      source/Main/u_vitalscan.c
  54. +19
    -13
      source/Main/w_monster.c
  55. +6
    -6
      source/Main/w_rain.c
  56. +16
    -26
      source/Main/w_time.c
  57. +31
    -19
      source/Main/w_world.c
  58. +2
    -1
      text/en/Misc.txt
  59. +11
    -0
      text/en/Misc/Settings.txt
  60. +2
    -0
      text/sound/player.txt

BIN
pk7/acs/lithmain.bin View File


+ 7
- 0
pk7/cvarinfo.txt View File

@@ -82,6 +82,13 @@ user int lith_scanner_yoffs = 0;
user int lith_scanner_color = 106; /* 'j' */
user bool lith_scanner_altfont = false;

user int lith_light_battery = 7;
user int lith_light_regen = 2;
user int lith_light_r = 255;
user int lith_light_g = 217;
user int lith_light_b = 186;
user int lith_light_radius = 400;

user float lith_player_damagebobmul = 0.6;
user bool lith_player_damagebob = true;
user bool lith_player_scoresound = true;


+ 5
- 2
pk7/keyconf.txt View File

@@ -9,18 +9,21 @@
// Key Sections --------------------------------------------------------------|
addkeysection "$LITH_CTRL_ACTIONS" Lithium
addmenukey "$LITH_CTRL_OPENCBI" lith_k_opencbi
addmenukey "$CNTRLMNU_USER4" +lith_k_qact
addmenukey "$LITH_CTRL_LIGHT" lith_k_light
addmenukey "$LITH_CTRL_ZOOMIN" lith_k_zoomin
addmenukey "$LITH_CTRL_ZOOMOUT" lith_k_zoomout
addmenukey "$LITH_CTRL_GLARE" lith_k_glare
addmenukey "$CNTRLMNU_USER4" +lith_k_qact

// Aliases -------------------------------------------------------------------|
alias lith_k_opencbi "pukename Lith_KeyOpenCBI"

alias lith_k_light "pukename Lith_KeyLight"

alias lith_k_zoomin "pukename Lith_KeyZoom 30"
alias lith_k_zoomout "pukename Lith_KeyZoom -60"

alias lith_k_glare "pukename Lith_Glare"
alias lith_k_glare "pukename Lith_KeyGlare"

alias +lith_k_qact "+user4"
alias -lith_k_qact "-user4"


+ 2
- 0
pk7/language.gfx.txt View File

@@ -20,6 +20,8 @@ identifier,default
:HUD:ARM,lgfx/HUD/ARM.png
:HUD:Bar,lgfx/HUD/Bar.png
:HUD:BarBig,lgfx/HUD/BarBig.png
:HUD:Battery,lgfx/HUD/Battery.png
:HUD:BatteryOutline,lgfx/HUD/BatteryOutline.png
:HUD:H_A1,lgfx/HUD/H_A1.png
:HUD:H_A2,lgfx/HUD/H_A2.png
:HUD:H_B1,lgfx/HUD/H_B1.png


+ 11
- 1
pk7/language.txt View File

@@ -1267,6 +1267,8 @@
"LITH_ST_PFX_Minutes" = "min";
"LITH_ST_PFX_Of255" = "/255";
"LITH_ST_PFX_Pixels" = "px";
"LITH_ST_PFX_Seconds" = "s";
"LITH_ST_PFX_Units" = "mu";
"LITH_ST_NAME_Unknown" = "Unknown";
"LITH_ST_NAME_LvSys_0" = "Auto";
"LITH_ST_NAME_LvSys_1" = "Hybrid";
@@ -1369,6 +1371,13 @@
"LITH_stx_boss_1" = "If you are sensitive to suggestion or otherwise";
"LITH_stx_boss_2" = "made uncomfortable by threats, please disable";
"LITH_stx_boss_3" = "boss dialogues!";
"LITH_stx_light" = "Flashlight";
"LITH_light_battery" = "Battery";
"LITH_light_regen" = "Battery regeneration";
"LITH_light_r" = "Red intensity";
"LITH_light_g" = "Green intensity";
"LITH_light_b" = "Blue intensity";
"LITH_light_radius" = "Radius";
"LITH_stx_items" = "Items";
"LITH_player_teleshop" = "Teleport in bought items and upgrades";
"LITH_player_stupidpickups" = "Silly pickup messages";
@@ -1753,10 +1762,11 @@
"TXT_YES" = "[Yes]";
"TXT_NO" = "[No]";
"LITH_CTRL_ACTIONS" = "Lithium Actions";
"LITH_CTRL_GLARE" = "Glare";
"LITH_CTRL_LIGHT" = "Toggle Flashlight";
"LITH_CTRL_OPENCBI" = "Open CBI";
"LITH_CTRL_ZOOMIN" = "Zoom In";
"LITH_CTRL_ZOOMOUT" = "Zoom Out";
"LITH_CTRL_GLARE" = "Glare";
"LITH_CLASS_MARINE" = "Marine";
"LITH_CLASS_MARINE_Nam" = "Stan Blazkowicz";
"LITH_CLASS_MARINE_Col" = "\c[Lith_Green]";


BIN
pk7/lgfx/HUD/Battery.png View File

Before After
Width: 2  |  Height: 8  |  Size: 80B

BIN
pk7/lgfx/HUD/BatteryOutline.png View File

Before After
Width: 6  |  Height: 12  |  Size: 108B

BIN
pk7/lsounds/Player/LightOff View File


BIN
pk7/lsounds/Player/LightOn View File


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

@@ -162,21 +162,21 @@ AltReady:
SCOP B 1 Lith_A_Ready(WRF_ALLOWRELOAD | WRF_NOBOB);
loop;
Ready:
PISG A 1 Lith_A_Ready(WRF_ALLOWRELOAD);
MARP A 1 Lith_A_Ready(WRF_ALLOWRELOAD);
loop;

Deselect:
PISG A 0 Lith_A_ScopeOut;
MARP A 0 Lith_A_ScopeOut;
DeselectLoop:
PISG AA 0 A_Lower;
PISG A 1 A_Lower;
MARP AA 0 A_Lower;
MARP A 1 A_Lower;
loop;

Select:
PISG A 0 Lith_A_ScopeOut;
MARP A 0 Lith_A_ScopeOut;
SelectLoop:
PISG AA 0 A_Raise;
PISG A 1 A_Raise;
MARP AA 0 A_Raise;
MARP A 1 A_Raise;
loop;

Fire:
@@ -186,18 +186,18 @@ Fire:
#### # 0 Lith_A_FirePistol;
#### # 0 A_JumpIfInventory("Lith_WeaponScopedToken", 1, "FireFinish_Scoped");
FireFinish_Unscoped:
PISG A 1;
PISF A 1 bright;
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(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);
MARP A 1;
MARP D 1 bright;
MARP E 1 bright offset(0, 45);
MARP E 1 bright offset(0, 40);
MARP C 1 offset(0, 36);
MARP A 0 A_JumpIf(ACS_ExecuteWithResult(lsc_pdata, pdata_upgrade, UPGR_AutoPistol), "FireFinish_Auto_Unscoped");
MARP B 2 offset(0, 32) A_WeaponReady(WRF_ALLOWRELOAD);
MARP AAAAA 1 A_WeaponReady(WRF_ALLOWRELOAD);
goto ReadySelector;
FireFinish_Auto_Unscoped:
PISG BB 1 A_ReFire;
PISG A 0;
MARP BB 1 A_ReFire;
MARP A 0;
goto FireFinish_Auto_Scoped;
FireFinish_Scoped:
SCOP B 5 bright;
@@ -227,22 +227,22 @@ AltFire:

Reload:
#### # 0 Lith_A_JumpIfMagFull;
PISG A 0 Lith_A_ScopeOut;
PISG A 0 A_StartSound("weapons/pistol/reload", lch_reload);
PISG A 1 offset(0, 34);
PISG A 1 offset(0, 36);
PISG B 1 offset(0, 50);
PISG A 0 Lith_A_ReloadBobUp(0.2);
PISG B 1 offset(-1, 51);
PISG B 1;
PISG B 4 offset(-2, 53) Lith_A_DropMag("Lith_PistolMagazine", "Lith_PistolMagazine2", 5,0,20, FRandom(1,3),0,0);
PISG C 5;
PISG A 0 Lith_A_ReloadBobDn(0.2);
PISG B 1 offset(-1, 50);
PISG B 1 offset(0, 45);
PISG B 1 offset(0, 36);
PISG B 2;
PISG A 0 Lith_A_ReloadFinish;
MARP A 0 Lith_A_ScopeOut;
MARP A 0 A_StartSound("weapons/pistol/reload", lch_reload);
MARP A 1 offset(0, 34);
MARP A 1 offset(0, 36);
MARP B 1 offset(0, 50);
MARP A 0 Lith_A_ReloadBobUp(0.2);
MARP B 1 offset(-1, 51);
MARP B 1;
MARP B 4 offset(-2, 53) Lith_A_DropMag("Lith_PistolMagazine", "Lith_PistolMagazine2", 5,0,20, FRandom(1,3),0,0);
MARP C 5;
MARP A 0 Lith_A_ReloadBobDn(0.2);
MARP B 1 offset(-1, 50);
MARP B 1 offset(0, 45);
MARP B 1 offset(0, 36);
MARP B 2;
MARP A 0 Lith_A_ReloadFinish;
goto ReadySelector;
}



+ 70
- 341
pk7/lzscript/Player.zsc View File

@@ -15,10 +15,14 @@
#include "lzscript/6_DarkLord/DarkLord.zsc"
#include "lzscript/7_Thoth/Thoth.zsc"

class Lith_EXPLOOOSION : Lith_Explosive
{
default
{
#include "lzscript/Player/Bobbing.zsc"
#include "lzscript/Player/Damage.zsc"
#include "lzscript/Player/Flashlight.zsc"
#include "lzscript/Player/HUD.zsc"
#include "lzscript/Player/Markers.zsc"

class Lith_EXPLOOOSION : Lith_Explosive {
default {
Species "Lith_Player";
DamageType "Shrapnel";

@@ -27,8 +31,7 @@ class Lith_EXPLOOOSION : Lith_Explosive
+NOGRAVITY
}

states
{
states {
Spawn:
TNT1 A 0;
TNT1 A 0 A_Explode;
@@ -37,16 +40,13 @@ class Lith_EXPLOOOSION : Lith_Explosive
}
}

class Lith_GEExplosion : Lith_Explosive
{
default
{
class Lith_GEExplosion : Lith_Explosive {
default {
+NOTIMEFREEZE
+NOGRAVITY
}

states
{
states {
Spawn:
TNT1 A 0;
TNT1 A 0 A_StartSound("effects/geexplosion", lch_body);
@@ -55,18 +55,15 @@ class Lith_GEExplosion : Lith_Explosive
}
}

class Lith_BlindingLight1 : Lith_CustomFunction
{
class Lith_BlindingLight1 : Lith_CustomFunction {
states {Pickup: TNT1 A 0 A_SetBlend("White", 0.1, 35*2); stop;}
}

class Lith_BlindingLight2 : Lith_CustomFunction
{
class Lith_BlindingLight2 : Lith_CustomFunction {
states {Pickup: TNT1 A 0 A_SetBlend("White", 0.4, 35*2); stop;}
}

class Lith_BlindingLight3 : Lith_CustomFunction
{
class Lith_BlindingLight3 : Lith_CustomFunction {
states {Pickup: TNT1 A 0 A_SetBlend("White", 0.7, 35*2); stop;}
}

@@ -74,8 +71,7 @@ class Lith_MegaProtection : Inventory {default {Inventory.MaxAmount 200;}}

class Lith_Player : DoomPlayer;

default
{
default {
Player.SideMove 2, 1;
Player.ForwardMove 2, 1;
Player.AirCapacity 0;
@@ -91,6 +87,8 @@ meta double m_VBob;
private double m_RainLerp;
private Lith_Quaternion m_QP, m_QY;

Lith_Flashlight m_light;

Lith_Cyberspace m_CS;

bool m_GrabInput;
@@ -112,34 +110,30 @@ Lith_AdviceMarker m_curAdvice;

property ViewBob: m_VBob;

override void BeginPlay()
{
override void BeginPlay() {
Super.BeginPlay();
viewbob = m_VBob;
}

override void PostBeginPlay()
{
override void PostBeginPlay() {
Super.PostBeginPlay();

/* m_CS = Lith_Cyberspace.Create(); */
/* m_CS = Lith_Cyberspace.Create(); */
m_light = Lith_Flashlight.create(self);
}

override void GiveDefaultInventory()
{
override void GiveDefaultInventory() {
GiveInventoryType("Lith_IDOL");
}

void Lith_GiveDefItem(class<Inventory> type, int amount)
{
void Lith_GiveDefItem(class<Inventory> type, int amount) {
let item = Inventory(Spawn(type));
item.bIGNORESKILL = true;
item.Amount = amount;
item.CallTryPickup(self);
}

void Lith_GiveDefWeapon(class<Weapon> type)
{
void Lith_GiveDefWeapon(class<Weapon> type) {
let wep = Weapon(Spawn(type));
wep.bIGNORESKILL = true;
wep.Amount = 1;
@@ -147,12 +141,10 @@ void Lith_GiveDefWeapon(class<Weapon> type)
Player.ReadyWeapon = Player.PendingWeapon = wep;
}

override void PlayerThink()
{
override void PlayerThink() {
if(level.levelnum == 1911777) return;

if(ACS_ExecuteWithResult(lsc_pdata, pdata_semifrozen))
{
if(ACS_ExecuteWithResult(lsc_pdata, pdata_semifrozen)) {
UserCmd cmd = player.cmd;
cmd.pitch = cmd.yaw = cmd.roll = 0;
player.turnticks = 0;
@@ -163,61 +155,51 @@ override void PlayerThink()
Super.PlayerThink();
}

private void Lith_RainEffect()
{
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 && ACS_ExecuteWithResult(lsc_wdata, wdata_dorain) &&
ceilingpic == skyflatnum && pitch < -5)
{
ceilingpic == skyflatnum && pitch < -5) {
float m = -pitch - 5;
m_RainLerp = Lith_UTIL.Lerp(m_RainLerp, m / 85., 0.1);
Shader.SetEnabled(player, "Lith_Rain", true);
}
else if(m_RainLerp > 0.01)
} else if(m_RainLerp > 0.01) {
m_RainLerp = Lith_UTIL.Lerp(m_RainLerp, 0, 0.1);
else
{
} else {
m_RainLerp = 0;
Shader.SetEnabled(player, "Lith_Rain", false);
}
}

private void Lith_ItemVacuum()
{
if(ACS_ExecuteWithResult(lsc_wdata, wdata_fun) & 2)
for(let it = BlockThingsIterator.Create(self, 70); it.next();)
{
if(Inventory(it.thing))
{
let mo = Spawn("Lith_Bip", it.thing.pos);
mo.vel = (frandom(-0.1, 0.1), frandom(-0.1, 0.1), 4);
mo.A_StartSound("misc/pop", lch_body);
it.thing.destroy();
private void Lith_ItemVacuum() {
if(ACS_ExecuteWithResult(lsc_wdata, wdata_fun) & 2) {
for(let it = BlockThingsIterator.Create(self, 70); it.next();) {
if(Inventory(it.thing)) {
let mo = Spawn("Lith_Bip", it.thing.pos);
mo.vel = (frandom(-0.1, 0.1), frandom(-0.1, 0.1), 4);
mo.A_StartSound("misc/pop", lch_body);
it.thing.destroy();
}
}
}
else
for(let it = BlockThingsIterator.Create(self, 70); it.next();)
{
let inv = Lith_BasicPickup(it.thing);

if(inv && inv.bVACUUM && inv.bSPECIAL && inv.checkSight(self))
{
let dst = distance2D(inv);
let t = clamp((140 - dst) / 1000., 0., 1.);

if(t)
{
let newp = inv.pos * (1 - t) + pos * t;
inv.tryMove(newp.xy, 20);
} else {
for(let it = BlockThingsIterator.Create(self, 70); it.next();) {
let inv = Lith_BasicPickup(it.thing);

if(inv && inv.bVACUUM && inv.bSPECIAL && inv.checkSight(self)) {
let dst = distance2D(inv);
let t = clamp((140 - dst) / 1000., 0., 1.);

if(t) {
let newp = inv.pos * (1 - t) + pos * t;
inv.tryMove(newp.xy, 20);
}
}
}
}
}

int, int, bool Lith_Unproject(vector3 loc)
{
int, int, bool Lith_Unproject(vector3 loc) {
/* create (view-adjusted) normalized vector for where we're looking */
vector3 la = pos - loc;
la.z = (player.viewz - loc.z) * level.pixelstretch;
@@ -243,8 +225,7 @@ int, int, bool Lith_Unproject(vector3 loc)
la /= la.length();

/* get screenspace position */
if(la.x > 0)
{
if(la.x > 0) {
/* adjust for FOV */
float fovmod = 1 / tan(player.fov / 2);

@@ -255,72 +236,13 @@ int, int, bool Lith_Unproject(vector3 loc)
/* convert to screenspace */
return Lith_UTIL.Round(ph * 160 + 160),
Lith_UTIL.Round(pv * 1.333333 * 120 + 120), true;
}

/* not looking at it, return invalid position */
else
} else {
/* not looking at it, return invalid position */
return -1000, -1000, false;
}

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

/* get the "actual" view angles */
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;

FLineTraceData ltd;
LineTrace(ry, 2048, rp, 0, sz, 0, 0, ltd);

/* unproject */
int xhx, xhy; [xhx, xhy] = Lith_Unproject(ltd.hitlocation);

/* 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;

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

void Lith_PreTick()
{
void Lith_PreTick() {
/* create pitch and yaw quaternions for unprojection */
vector2 pvec = (cos(pitch), sin(pitch) * level.pixelstretch);
pvec /= pvec.length();
@@ -348,37 +270,7 @@ void Lith_PreTick()
}
}

void Lith_ShowMapMarker()
{
Lith_MapMarker th;

for(let it = ThinkerIterator.create("Lith_MapMarker", _stat_mapmark);
(th = (Lith_MapMarker(it.next())));) {
if(th.cursector == cursector && th != m_curMark &&
(!m_curMark || th.getTag() != m_curMark.getTag())) {
m_curMark = th;
CallACS("Lith_Markiplier", m_curMark.tid);
break;
}
}
}

void Lith_ShowAdviceMarker()
{
Lith_AdviceMarker th;

for(let it = ThinkerIterator.create("Lith_AdviceMarker", _stat_advicemark);
(th = (Lith_AdviceMarker(it.next())));) {
if(th.cursector == cursector && th != m_curAdvice) {
m_curAdvice = th;
CallACS("Lith_SetAdviceMarker", m_curAdvice.tid);
break;
}
}
}

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

if(CVar.GetCVar('lith_player_rainshader', player).getBool())
@@ -399,31 +291,7 @@ void Lith_PostTick()

Lith_ShowMapMarker();
Lith_ShowAdviceMarker();

m_LastIPitch = m_IPitch;
m_LastVPitch = m_VPitch;
m_IPitch = Lith_UTIL.Lerp(m_IPitch, Pitch, 0.377);
m_VPitch = Min(m_IPitch - m_LastIPitch, 0.4);

m_LastIYaw = m_IYaw;
m_LastVYaw = m_VYaw;
m_IYaw = Lith_UTIL.AngleLerp(m_IYaw, Angle, 0.377);
if(m_IYaw - m_LastIYaw ~== 0)
m_VYaw = 0;
else
m_VYaw = m_IYaw - m_LastIYaw;

if(Vel.Z - m_LastZVel > double.Epsilon)
{
if(m_LastZVel >= 0) m_ZVel += Vel.Z;
else m_ZVel += 5 - m_LastZVel * 2;
}

m_ZVel = Lith_UTIL.Lerp(m_ZVel, 0, 0.277);
m_LastZVel = Vel.Z;

m_LastVZVel = m_VZVel;
m_VZVel = Lith_UTIL.Lerp(m_VZVel, m_ZVel, 0.42);
Lith_BobWeapon();
}

override void Tick()
@@ -437,93 +305,25 @@ override void Tick()
if(player && player.mo == self) Lith_PostTick();
}

override int DamageMobj(Actor inflictor, Actor source, int damage, name mod, int flags, double angle)
{
/* ÜBER KLUDGE (override behaviour for DONTHARMSPECIES) */
if(inflictor && inflictor.species == species && inflictor.bDONTHARMSPECIES && (!source || !source.bISMONSTER))
return 0;

/* set global damage info (ouch) */
let sv = Lith_HERMES.Instance();

sv.m_DmgWorld = !(inflictor || source);
sv.m_DmgType = mod;

/* hack: remove the damage type for world stuff so obituaries are easier to override */
if(sv.m_DmgWorld || source == self) mod = 'None';

/* special protection */
CallACS("Lith_RA_Give", Lith_HERMES.nameToDT(mod));

if(damage > 1)
{
if(CountInv("Lith_MegaProtection"))
{
TakeInventory("Lith_MegaProtection", damage / 2);
damage /= 2;
}

if(m_DmgFac > 0) damage = max(1, damage * (100 - m_DmgFac) / 100);
}

return Super.DamageMobj(inflictor, source, damage, mod, flags, angle);
}

override void Die(Actor source, Actor inflictor, int dmgflags)
{
target = source;
Super.Die(null, inflictor, dmgflags);

let sv = Lith_HERMES.Instance();
string ob;

if(source == self) switch(sv.m_DmgType)
{
case 'FatMacRecoil': ob = "$LITH_OB_S_FatMac"; break;
case 'Shrapnel': ob = "$LITH_OB_S_Explosion"; break;
default: ob = "(suicide)"; break;
}
else if(source)
ob = sv.m_DmgType == 'Melee' ? source.hitobituary : source.obituary;
else switch(sv.m_DmgType)
{
case 'Falling': ob = "(falling)"; break;
case 'Crush': ob = "(crush)"; break;
case 'Exit': ob = "(exit)"; break;
case 'Drowning': ob = "(drowning)"; break;
case 'Slime': ob = "(slime)"; break;
case 'Fire': ob = "(fire)"; break;
default: ob = "(default)"; break;
}

sv.m_Obituary = StringTable.Localize(ob);

CallACS("Lith_Obituary");
}

override void CheckPitch()
{
if(!Level.IsFreelookAllowed())
override void CheckPitch() {
if(!Level.IsFreelookAllowed()) {
Pitch = 0;
else
{
} else {
int clook = Player.Cmd.Pitch;

if(clook != 0)
{
if(clook == int16.min)
if(clook != 0) {
if(clook == int16.min) {
Player.Centering = true;
else if(!Player.Centering)
} else if(!Player.Centering) {
Pitch = Clamp(Pitch - clook * (360 / FIX), Player.MinPitch, Player.MaxPitch);
}
}
}

if(Player.Centering)
{
if(Abs(Pitch) > 2)
if(Player.Centering) {
if(Abs(Pitch) > 2) {
A_SetPitch(Pitch * (3 / 4.0), SPF_INTERPOLATE);
else
{
} else {
Pitch = 0;
Player.Centering = false;
if(PlayerNumber() == ConsolePlayer)
@@ -532,78 +332,7 @@ override void CheckPitch()
}
}

override vector2 BobWeapon(double ticfrac)
{
if(!Player) return (0, 0);

let wep = Player.ReadyWeapon;
if(!wep) return (0, 0);

vector2 p[2];
p[0] = (0, 0);
p[1] = (0, 0);

if(!wep.bDONTBOB) for(int i = 0; i < 2; i++)
{
double ang = wep.BobSpeed * 128 * Player.GetWBobSpeed() * (Level.Time - 1 + i) * 0.044;
double bobtarget = Player.Bob;

if(CVar.GetCVar('lith_weapons_nofirebob', Player).GetBool() && !(Player.WeaponState & WF_WEAPONBOBBING))
bobtarget = 0;

if(Abs(bobtarget - CurBob) <= 1)
CurBob = bobtarget;
else
{
double zoom = Max(1.0, Abs(CurBob - bobtarget) / 40);
if(CurBob > bobtarget) CurBob -= zoom;
else CurBob += zoom;
}

double bobx = 0, boby = 0;

if(CurBob != 0)
{
bobx = Player.Bob * wep.BobRangeX * ViewBob;
boby = Player.Bob * wep.BobRangeY * ViewBob;

switch(wep.BobStyle)
{
case Bob_Smooth:
case Bob_Normal:
bobx *= Cos(ang) + Sin(ang / 5) / 7;
boby *= 0.5 * (1 + Sin(ang * 2));
break;
case Bob_InverseSmooth:
case Bob_Inverse:
bobx *= Cos(ang) + Sin(ang / 5) / 7;
boby *= 0.5 * (1 - Sin(ang * 2));
break;
case Bob_Alpha:
bobx *= Sin(ang);
boby *= Abs(Sin(ang));
break;
case Bob_InverseAlpha:
bobx *= Sin(ang);
boby *= 1 - Abs(Sin(ang));
break;
}
}

p[i] = (bobx, boby);
}

vector2 interp = p[0] * (1 - ticfrac) + p[1] * ticfrac;

interp.x -= Lith_UTIL.Lerp(m_LastVYaw, m_VYaw, ticfrac) / 2;
interp.y -= Lith_UTIL.Lerp(m_LastVPitch, m_VPitch, ticfrac) * 3;
interp.y += Lith_UTIL.Lerp(m_LastVZVel, m_VZVel, ticfrac);

return interp;
}

override void CheckAirSupply()
{
override void CheckAirSupply() {
/* No. */
}



+ 102
- 0
pk7/lzscript/Player/Bobbing.zsc View File

@@ -0,0 +1,102 @@
/* ---------------------------------------------------------------------------|
*
* Distributed under the CC0 public domain license.
* By Alison Sanderson & InsanityBringer. Attribution is encouraged, though not required.
* See licenses/cc0.txt for more information.
*
* ---------------------------------------------------------------------------|
*/

extend class Lith_Player;

void Lith_BobWeapon() {
m_LastIPitch = m_IPitch;
m_LastVPitch = m_VPitch;
m_IPitch = Lith_UTIL.Lerp(m_IPitch, Pitch, 0.377);
m_VPitch = Min(m_IPitch - m_LastIPitch, 0.4);

m_LastIYaw = m_IYaw;
m_LastVYaw = m_VYaw;
m_IYaw = Lith_UTIL.AngleLerp(m_IYaw, Angle, 0.377);
if(m_IYaw - m_LastIYaw ~== 0) {m_VYaw = 0;}
else {m_VYaw = m_IYaw - m_LastIYaw;}

if(Vel.Z - m_LastZVel > double.Epsilon) {
if(m_LastZVel >= 0) {m_ZVel += Vel.Z;}
else {m_ZVel += 5 - m_LastZVel * 2;}
}

m_ZVel = Lith_UTIL.Lerp(m_ZVel, 0, 0.277);
m_LastZVel = Vel.Z;

m_LastVZVel = m_VZVel;
m_VZVel = Lith_UTIL.Lerp(m_VZVel, m_ZVel, 0.42);
}

override vector2 BobWeapon(double ticfrac) {
if(!Player) return (0, 0);

let wep = Player.ReadyWeapon;
if(!wep) return (0, 0);

vector2 p[2];
p[0] = (0, 0);
p[1] = (0, 0);

if(!wep.bDONTBOB) for(int i = 0; i < 2; i++) {
double ang = wep.BobSpeed * 128 * Player.GetWBobSpeed() * (Level.Time - 1 + i) * 0.044;
double bobtarget = Player.Bob;

if(CVar.GetCVar('lith_weapons_nofirebob', Player).GetBool() && !(Player.WeaponState & WF_WEAPONBOBBING)) {
bobtarget = 0;
}

if(Abs(bobtarget - CurBob) <= 1) {
CurBob = bobtarget;
} else {
double zoom = Max(1.0, Abs(CurBob - bobtarget) / 40);
if(CurBob > bobtarget) CurBob -= zoom;
else CurBob += zoom;
}

double bobx = 0, boby = 0;

if(CurBob != 0) {
bobx = Player.Bob * wep.BobRangeX * ViewBob;
boby = Player.Bob * wep.BobRangeY * ViewBob;

switch(wep.BobStyle) {
case Bob_Smooth:
case Bob_Normal:
bobx *= Cos(ang) + Sin(ang / 5) / 7;
boby *= 0.5 * (1 + Sin(ang * 2));
break;
case Bob_InverseSmooth:
case Bob_Inverse:
bobx *= Cos(ang) + Sin(ang / 5) / 7;
boby *= 0.5 * (1 - Sin(ang * 2));
break;
case Bob_Alpha:
bobx *= Sin(ang);
boby *= Abs(Sin(ang));
break;
case Bob_InverseAlpha:
bobx *= Sin(ang);
boby *= 1 - Abs(Sin(ang));
break;
}
}

p[i] = (bobx, boby);
}

vector2 interp = p[0] * (1 - ticfrac) + p[1] * ticfrac;

interp.x -= Lith_UTIL.Lerp(m_LastVYaw, m_VYaw, ticfrac) / 2;
interp.y -= Lith_UTIL.Lerp(m_LastVPitch, m_VPitch, ticfrac) * 3;
interp.y += Lith_UTIL.Lerp(m_LastVZVel, m_VZVel, ticfrac);

return interp;
}

/* EOF */

+ 77
- 0
pk7/lzscript/Player/Damage.zsc View File

@@ -0,0 +1,77 @@
/* ---------------------------------------------------------------------------|
*
* Distributed under the CC0 public domain license.
* By Alison Sanderson & InsanityBringer. Attribution is encouraged, though not required.
* See licenses/cc0.txt for more information.
*
* ---------------------------------------------------------------------------|
*/

extend class Lith_Player;

override int DamageMobj(Actor inflictor, Actor source, int damage, name mod, int flags, double angle) {
/* ÜBER KLUDGE (override behaviour for DONTHARMSPECIES) */
if(inflictor && inflictor.species == species && inflictor.bDONTHARMSPECIES && (!source || !source.bISMONSTER))
return 0;

/* set global damage info (ouch) */
let sv = Lith_HERMES.Instance();

sv.m_DmgWorld = !(inflictor || source);
sv.m_DmgType = mod;

/* hack: remove the damage type for world stuff so obituaries are
* easier to override
*/
if(sv.m_DmgWorld || source == self) mod = 'None';

/* special protection */
CallACS("Lith_RA_Give", Lith_HERMES.nameToDT(mod));

if(damage > 1)
{
if(CountInv("Lith_MegaProtection"))
{
TakeInventory("Lith_MegaProtection", damage / 2);
damage /= 2;
}

if(m_DmgFac > 0) damage = max(1, damage * (100 - m_DmgFac) / 100);
}

return Super.DamageMobj(inflictor, source, damage, mod, flags, angle);
}

override void Die(Actor source, Actor inflictor, int dmgflags) {
target = source;
Super.Die(null, inflictor, dmgflags);

let sv = Lith_HERMES.Instance();
string ob;

if(source == self) {
switch(sv.m_DmgType) {
case 'FatMacRecoil': ob = "$LITH_OB_S_FatMac"; break;
case 'Shrapnel': ob = "$LITH_OB_S_Explosion"; break;
default: ob = "(suicide)"; break;
}
} else if(source) {
ob = sv.m_DmgType == 'Melee' ? source.hitobituary : source.obituary;
} else {
switch(sv.m_DmgType) {
case 'Falling': ob = "(falling)"; break;
case 'Crush': ob = "(crush)"; break;
case 'Exit': ob = "(exit)"; break;
case 'Drowning': ob = "(drowning)"; break;
case 'Slime': ob = "(slime)"; break;
case 'Fire': ob = "(fire)"; break;
default: ob = "(default)"; break;
}
}

sv.m_Obituary = StringTable.Localize(ob);

CallACS("Lith_Obituary");
}

/* EOF */

+ 67
- 0
pk7/lzscript/Player/Flashlight.zsc View File

@@ -0,0 +1,67 @@
/* ---------------------------------------------------------------------------|
*
* Distributed under the CC0 public domain license.
* By Alison Sanderson & InsanityBringer. Attribution is encouraged, though not required.
* See licenses/cc0.txt for more information.
*
* ---------------------------------------------------------------------------|
*/

class Lith_SpotLight : DynamicLight {
default {
DynamicLight.Type "Point";
+DYNAMICLIGHT.ATTENUATE
+DYNAMICLIGHT.SPOT
}
}

class Lith_Flashlight : Thinker;

Lith_Player m_p;

Lith_SpotLight[2] m_light;

static Lith_Flashlight create(Lith_Player pl) {
let light = new("Lith_Flashlight");

light.m_p = pl;
light.m_light[0] = Lith_SpotLight(Actor.Spawn("Lith_SpotLight", pl.pos));
light.m_light[1] = Lith_SpotLight(Actor.Spawn("Lith_SpotLight", pl.pos));

return light;
}

override void tick() {
super.tick();

double intn = m_p.acs_scriptCall("Lith_GetFlashlightIntensity") / FIX;

int r = clamp(CVar.getCVar('lith_light_r', m_p.player).getInt(), 0, 255);
int g = clamp(CVar.getCVar('lith_light_g', m_p.player).getInt(), 0, 255);
int b = clamp(CVar.getCVar('lith_light_b', m_p.player).getInt(), 0, 255);

int ri = int(CVar.getCVar('lith_light_radius', m_p.player).getInt() * intn);
int ro = ri / 2;

m_light[0].args[DynamicLight.LIGHT_RED] = r;
m_light[0].args[DynamicLight.LIGHT_GREEN] = g;
m_light[0].args[DynamicLight.LIGHT_BLUE] = b;
m_light[0].args[DynamicLight.LIGHT_INTENSITY] = ri;
m_light[0].spotInnerAngle = 0;
m_light[0].spotOuterAngle = 20;

m_light[1].args[DynamicLight.LIGHT_RED] = int(r * 0.77);
m_light[1].args[DynamicLight.LIGHT_GREEN] = int(g * 0.77);
m_light[1].args[DynamicLight.LIGHT_BLUE] = int(b * 0.77);
m_light[1].args[DynamicLight.LIGHT_INTENSITY] = ro;
m_light[1].spotInnerAngle = 15;
m_light[1].spotOuterAngle = 45;

for(int i = 0; i < 2; i++) {
m_light[i].A_SetAngle(m_p.angle, true);
m_light[i].A_SetPitch(m_p.pitch, true);
m_light[i].setOrigin((m_p.pos.xy, m_p.player.viewz), true);
}
}

/* EOF */

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

@@ -0,0 +1,69 @@
/* ---------------------------------------------------------------------------|
*
* Distributed under the CC0 public domain license.
* By Alison Sanderson & InsanityBringer. Attribution is encouraged, though not required.
* See licenses/cc0.txt for more information.
*
* ---------------------------------------------------------------------------|
*/

extend class Lith_Player;

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

/* get the "actual" view angles */
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;

FLineTraceData ltd;
LineTrace(ry, 2048, rp, 0, sz, 0, 0, ltd);

/* unproject */
int xhx, xhy; [xhx, xhy] = Lith_Unproject(ltd.hitlocation);

/* 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;

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

/* EOF */

+ 39
- 0
pk7/lzscript/Player/Markers.zsc View File

@@ -0,0 +1,39 @@
/* ---------------------------------------------------------------------------|
*
* Distributed under the CC0 public domain license.
* By Alison Sanderson & InsanityBringer. Attribution is encouraged, though not required.
* See licenses/cc0.txt for more information.
*
* ---------------------------------------------------------------------------|
*/

extend class Lith_Player;

void Lith_ShowMapMarker() {
Lith_MapMarker th;

for(let it = ThinkerIterator.create("Lith_MapMarker", _stat_mapmark);
(th = (Lith_MapMarker(it.next())));) {
if(th.cursector == cursector && th != m_curMark &&
(!m_curMark || th.getTag() != m_curMark.getTag())) {
m_curMark = th;
CallACS("Lith_Markiplier", m_curMark.tid);
break;
}
}
}

void Lith_ShowAdviceMarker() {
Lith_AdviceMarker th;

for(let it = ThinkerIterator.create("Lith_AdviceMarker", _stat_advicemark);
(th = (Lith_AdviceMarker(it.next())));) {
if(th.cursector == cursector && th != m_curAdvice) {
m_curAdvice = th;
CallACS("Lith_SetAdviceMarker", m_curAdvice.tid);
break;
}
}
}

/* EOF */

+ 2
- 0
pk7/sndinfo.txt View File

@@ -285,6 +285,8 @@ player/hitground lsounds/Player/HitGround
player/infraredoff lsounds/Player/InfraredOff
player/levelup lsounds/Player/LevelUp
player/glare lsounds/Player/Glare
player/lighton lsounds/Player/LightOn
player/lightoff lsounds/Player/LightOff
$volume player/death2 0.7
$volume player/nuke 0.7
$volume player/doublejump 0.7


pk7/sprites/WeaponsM/Pistol/PISGA0.png → pk7/sprites/WeaponsM/Pistol/MARPA0.png View File


pk7/sprites/WeaponsM/Pistol/PISGB0.png → pk7/sprites/WeaponsM/Pistol/MARPB0.png View File


pk7/sprites/WeaponsM/Pistol/PISGC0.png → pk7/sprites/WeaponsM/Pistol/MARPC0.png View File


pk7/sprites/WeaponsM/Pistol/PISFA0.png → pk7/sprites/WeaponsM/Pistol/MARPD0.png View File


pk7/sprites/WeaponsM/Pistol/PISFB0.png → pk7/sprites/WeaponsM/Pistol/MARPE0.png View File


+ 20
- 175
source/Headers/m_stab.h View File

@@ -13,29 +13,12 @@

#if defined(X)

/* TODO: go through these and make the ones that don't need to be here statics,
* and remove the ones that are obsolete
*/
/* Strings */
X(s_BOSS, "BOSS")
X(s_COUNTKILL, "COUNTKILL")
X(s_DROPPED, "DROPPED")
X(s_F_SKY1, "F_SKY1")
X(s_INVULNERABLE, "INVULNERABLE")
X(s_LITHCAM1, "LITHCAM1")
X(s_LITHCAM2, "LITHCAM2")
X(s_LITHCAM3, "LITHCAM3")
X(s_LITHEND, "LITHEND")
X(s_LITHSKDE, "LITHSKDE")
X(s_LITHSKRD, "LITHSKRD")
X(s_LITHSKS1, "LITHSKS1")
X(s_NIL, "")
X(s_NODAMAGE, "NODAMAGE")
X(s_None, "None")
X(s_OBJ, OBJ)
X(s_RLFormer, "RLFormer")
X(s_SHADOW, "SHADOW")
X(s_SOLID, "SOLID")
X(s_alienfont, "alienfont")
X(s_areaname, "areaname")
X(s_bigupper, "bigupper")
@@ -43,14 +26,6 @@ X(s_lhudfont, "lhudfont")
X(s_lhudfontsmall, "lhudfontsmall")
X(s_lmidfont, "lmidfont")
X(s_ltrmfont, "ltrmfont")
X(s_ob_crush, "(crush)")
X(s_ob_default, "(default)")
X(s_ob_drowning, "(drowning)")
X(s_ob_exit, "(exit)")
X(s_ob_falling, "(falling)")
X(s_ob_fire, "(fire)")
X(s_ob_slime, "(slime)")
X(s_ob_suicide, "(suicide)")
X(s_smallfnt, "smallfnt")

/* Console Variables */
@@ -62,7 +37,6 @@ X(sc_debug_nomonsters, DCVAR "debug_nomonsters")
X(sc_debug_save, DCVAR "debug_save")
X(sc_debug_score, DCVAR "debug_score")
X(sc_debug_upgrades, DCVAR "debug_upgrades")
X(sc_drla_is_using_monsters, "DRLA_is_using_monsters")
X(sc_game, DCVAR "game")
X(sc_gui_cursor, CVAR "gui_cursor")
X(sc_gui_jpfont, CVAR "gui_jpfont")
@@ -76,8 +50,13 @@ X(sc_hud_showlog, CVAR "hud_showlog")
X(sc_hud_showlvl, CVAR "hud_showlvl")
X(sc_hud_showscore, CVAR "hud_showscore")
X(sc_hud_showweapons, CVAR "hud_showweapons")
X(sc_invertmouse, "invertmouse")
X(sc_k_opencbi, CVAR "k_opencbi")
X(sc_light_b, CVAR "light_b")
X(sc_light_battery, CVAR "light_battery")
X(sc_light_g, CVAR "light_g")
X(sc_light_r, CVAR "light_r")
X(sc_light_radius, CVAR "light_radius")
X(sc_light_regen, CVAR "light_regen")
X(sc_player_altinvuln, CVAR "player_altinvuln")
X(sc_player_ammolog, CVAR "player_ammolog")
X(sc_player_bosstexts, CVAR "player_bosstexts")
@@ -104,20 +83,17 @@ X(sc_scanner_slide, CVAR "scanner_slide")
X(sc_scanner_xoffs, CVAR "scanner_xoffs")
X(sc_scanner_yoffs, CVAR "scanner_yoffs")
X(sc_sv_autosave, CVAR "sv_autosave")
X(sc_sv_cooploseinventory, "sv_cooploseinventory")
X(sc_sv_difficulty, CVAR "sv_difficulty")
X(sc_sv_failtime, CVAR "sv_failtime")
X(sc_sv_nobossdrop, CVAR "sv_nobossdrop")
X(sc_sv_nobosses, CVAR "sv_nobosses")
X(sc_sv_nofullammo, CVAR "sv_nofullammo")
X(sc_sv_nomonsters, "sv_nomonsters")
X(sc_sv_noscoreammo, CVAR "sv_noscoreammo")
X(sc_sv_pauseinmenus, CVAR "sv_pauseinmenus")
X(sc_sv_rain, CVAR "sv_rain")
X(sc_sv_revenge, CVAR "sv_revenge")
X(sc_sv_scoremul, CVAR "sv_scoremul")
X(sc_sv_sky, CVAR "sv_sky")
X(sc_sv_weaponstay, "sv_weaponstay")
X(sc_sv_wepdrop, CVAR "sv_wepdrop")
X(sc_version, DCVAR "version")
X(sc_weapons_alpha, CVAR "weapons_alpha")
@@ -146,10 +122,6 @@ X(sc_xhair_g, CVAR "xhair_g")
X(sc_xhair_r, CVAR "xhair_r")
X(sc_xhair_style, CVAR "xhair_style")

/* Inventory Types */
X(si_Armor, "Armor")
X(si_SlottedItem, "SlottedItem")

/* Methods / Members */
X(sm_AdrenalineCheck, "AdrenalineCheck")
X(sm_AlertMonsters, "AlertMonsters")
@@ -230,8 +202,6 @@ X(so_AssassinPlayer, OBJ "AssassinPlayer")
X(so_BarrierFX, OBJ "BarrierFX")
X(so_Blade, OBJ "Blade")
X(so_BloodRainDrop, OBJ "BloodRainDrop")
X(so_BlueCard, "BlueCard")
X(so_BlueSkull, "BlueSkull")
X(so_BossReward1, OBJ "BossReward1")
X(so_BossReward2, OBJ "BossReward2")
X(so_BossReward3, OBJ "BossReward3")
@@ -242,16 +212,11 @@ X(so_BoughtItem, OBJ "BoughtItem")
X(so_CameraHax, OBJ "CameraHax")
X(so_CannonAmmo, OBJ "CannonAmmo")
X(so_Cercle, OBJ "Cercle")
X(so_Chaingun, "Chaingun")
X(so_ChexBlueCard, "ChexBlueCard")
X(so_ChexRedCard, "ChexRedCard")
X(so_ChexYellowCard, "ChexYellowCard")
X(so_CircleParticle, OBJ "CircleParticle")
X(so_CircleSpearThrower, OBJ "CircleSpearThrower")
X(so_ClawOfImp, OBJ "ClawOfImp")
X(so_CyberMagePlayer, OBJ "CyberMagePlayer")
X(so_DarkLordPlayer, OBJ "DarkLordPlayer")
X(so_DeVileSix, "RLDeVileSix")
X(so_Delear, OBJ "Delear")
X(so_Dummy, OBJ "Dummy")
X(so_EXPLOOOSION, OBJ "EXPLOOOSION")
@@ -267,12 +232,6 @@ X(so_Hulgyon, OBJ "Hulgyon")
X(so_InformantPlayer, OBJ "InformantPlayer")
X(so_Ionized, OBJ "Ionized")
X(so_IsPhantom, OBJ "IsPhantom")
X(so_KeyBlue, "KeyBlue")
X(so_KeyGreen, "KeyGreen")
X(so_KeyYellow, "KeyYellow")
X(so_LegendaryMonsterMarker, "LDLegendaryMonsterMarker")
X(so_LegendaryMonsterToken, "LDLegendaryMonsterToken")
X(so_LegendaryMonsterTransformed, "LDLegendaryMonsterTransformed")
X(so_Mana, OBJ "Mana")
X(so_ManaLeak, OBJ "ManaLeak")
X(so_ManaPickup, OBJ "ManaPickup")
@@ -289,23 +248,15 @@ X(so_PlasmaAmmo, OBJ "PlasmaAmmo")
X(so_Player, OBJ "Player")
X(so_PoisonFXReset, OBJ "PoisonFXReset")
X(so_PoisonFXTimer, OBJ "PoisonFXTimer")
X(so_PowerFlight, "PowerFlight")
X(so_PowerLightAmp, "PowerLightAmp")
X(so_PowerStrength, "PowerStrength")
X(so_PowerTimeFreezer, "PowerTimeFreezer")
X(so_PunctuatorExplosion, OBJ "PunctuatorExplosion")
X(so_PunctuatorPuff, OBJ "PunctuatorPuff")
X(so_RLAdaptive, "RLAdaptive")
X(so_RainDrop, OBJ "RainDrop")
X(so_RandomSpawn, OBJ "RandomSpawn")
X(so_RedCard, "RedCard")
X(so_RedSkull, "RedSkull")
X(so_Rend, OBJ "Rend")
X(so_RocketAmmo, OBJ "RocketAmmo")
X(so_RocketBooster, OBJ "RocketBooster")
X(so_SMGHeat, OBJ "SMGHeat")
X(so_ShellAmmo, OBJ "ShellAmmo")
X(so_Shotgun, "Shotgun")
X(so_StarShot, OBJ "StarShot")
X(so_StealthSystem, OBJ "StealthSystem")
X(so_Steggles, OBJ "Steggles")
@@ -320,13 +271,8 @@ X(so_TimeHax2, OBJ "TimeHax2")
X(so_UniqueID, OBJ "UniqueID")
X(so_WandererPlayer, OBJ "WandererPlayer")
X(so_WeaponScopedToken, OBJ "WeaponScopedToken")
X(so_YellowCard, "YellowCard")
X(so_YellowSkull, "YellowSkull")
X(so_ZombieMan, "ZombieMan")

/* Paths */
X(sp_Any, "*")
X(sp_Background, "Background")
X(sp_Dialogue_Back, ":Dialogue:Back")
X(sp_HUD_AMMO, ":HUD:AMMO")
X(sp_HUD_Bar, ":HUD:Bar")
@@ -440,7 +386,6 @@ 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_glare, "player/glare")
X(ss_player_infraredoff, "player/infraredoff")
X(ss_player_levelup, "player/levelup")
X(ss_player_manafull, "player/manafull")
@@ -464,40 +409,22 @@ X(ss_weapons_subweapon_charge, "weapons/subweapon/charge")
X(ss_xx_pain25, "*pain25")

/* Text */
X(st_0, "0")
X(st_barons, "Barons")
X(st_begin, "\Cd[Press any key to begin]")
X(st_bip_header, "BIOTIC INFORMATION PANEL ver2.5")
X(st_begin, "\Cd[Press any key to begin]") /* TODO */
X(st_bip_header, "BIOTIC INFORMATION PANEL ver2.5") /* TODO */
X(st_cbi_armorinter, LANG "CBI_ArmorInter")
X(st_cbi_rdistinter, LANG "CBI_RDistInter")
X(st_cbi_reactarmor, LANG "CBI_ReactArmor")
X(st_cbi_weapninte2, LANG "CBI_WeapnInte2")
X(st_cbi_weapninter, LANG "CBI_WeapnInter")
X(st_cyberdemon, "CyberDemon")
X(st_disabling, "Disabling")
X(st_div_get, LANG "DIV_SIGIL_GET")
X(st_div_warning, LANG "DIV_SIGIL_WARNING")
X(st_edit, LANG "EDIT")
X(st_enabling, "Enabling")
X(st_exp, "EXP")
X(st_filter_all, "Filter: \CjAll")
X(st_filter_all, "Filter: \CjAll") /* TODO */
X(st_free, LANG "FREE")
X(st_gui_cursor, LANG "gui_cursor")
X(st_gui_jpfont, LANG "gui_jpfont")
X(st_gui_theme, LANG "gui_theme")
X(st_gui_xmul, LANG "gui_xmul")
X(st_gui_ymul, LANG "gui_ymul")
X(st_hp, "HP")
X(st_hud_logbig, LANG "hud_logbig")
X(st_hud_logfromtop, LANG "hud_logfromtop")
X(st_hud_showarmorind, LANG "hud_showarmorind")
X(st_hud_showlog, LANG "hud_showlog")
X(st_hud_showlvl, LANG "hud_showlvl")
X(st_hud_showscore, LANG "hud_showscore")
X(st_hud_showweapons, LANG "hud_showweapons")
X(st_iconofsin, "IconOfSin")
X(st_info_categories, "INFO CATEGORIES")
X(st_jet, "Jet")
X(st_info_categories, "INFO CATEGORIES") /* TODO */
X(st_jet, "Jet") /* TODO */
X(st_lv, "Lv.")
X(st_mail_cluster1, "Cluster1")
X(st_mail_cluster2, "Cluster2")
@@ -510,104 +437,19 @@ X(st_mail_secret1, "Secret1")
X(st_mail_secret2, "Secret2")
X(st_mana_charge, LANG "MANA_CHARGE")
X(st_mp, "MP")
X(st_next, "Next")
X(st_nl_bar, "\n|")
X(st_no_results, "No results")
X(st_normal, "Normal")
X(st_next, "Next") /* TODO */
X(st_no_results, "No results") /* TODO */
X(st_out_blue, CrBlue "OUT")
X(st_out_green, CrGreen "OUT")
X(st_out_purple, CrPurple "Out")
X(st_out_red, CrRed "OUT")
X(st_player_altinvuln, LANG "player_altinvuln")
X(st_player_ammolog, LANG "player_ammolog")
X(st_player_bosstexts, LANG "player_bosstexts")
X(st_player_brightweps, LANG "player_brightweps")
X(st_player_damagebob, LANG "player_damagebob")
X(st_player_damagebobmul, LANG "player_damagebobmul")
X(st_player_footstepvol, LANG "player_footstepvol")
X(st_player_invertmouse, LANG "player_invertmouse")
X(st_player_lvsys, LANG "player_lvsys")
X(st_player_noitemfx, LANG "player_noitemfx")
X(st_player_rainshader, LANG "player_rainshader")
X(st_player_resultssound, LANG "player_resultssound")
X(st_player_scorelog, LANG "player_scorelog")
X(st_player_scoresound, LANG "player_scoresound")
X(st_player_stupidpickups, LANG "player_stupidpickups")
X(st_player_teleshop, LANG "player_teleshop")
X(st_player_viewtilt, LANG "player_viewtilt")
X(st_red_six, "\Cg6")
X(st_scanner_altfont, LANG "scanner_altfont")
X(st_scanner_bar, LANG "scanner_bar")
X(st_scanner_color, LANG "scanner_color")
X(st_scanner_slide, LANG "scanner_slide")
X(st_scanner_xoffs, LANG "scanner_xoffs")
X(st_scanner_yoffs, LANG "scanner_yoffs")
X(st_spiderdemon, "SpiderDemon")
X(st_st_name_unknown, LANG "ST_NAME_Unknown")
X(st_stx_boss_0, LANG "stx_boss_0")
X(st_stx_boss_1, LANG "stx_boss_1")
X(st_stx_boss_2, LANG "stx_boss_2")
X(st_stx_boss_3, LANG "stx_boss_3")
X(st_stx_gameplay, LANG "stx_gameplay")
X(st_stx_gui, LANG "stx_gui")
X(st_stx_hud, LANG "stx_hud")
X(st_stx_items, LANG "stx_items")
X(st_stx_jp_0, LANG "stx_jp_0")
X(st_stx_jp_1, LANG "stx_jp_1")
X(st_stx_jp_2, LANG "stx_jp_2")
X(st_stx_jp_3, LANG "stx_jp_3")
X(st_stx_player, LANG "stx_player")
X(st_stx_vscan, LANG "stx_vscan")
X(st_stx_weapons, LANG "stx_weapons")
X(st_stx_world, LANG "stx_world")
X(st_sv_autosave, LANG "sv_autosave")
X(st_sv_difficulty, LANG "sv_difficulty")
X(st_sv_nobossdrop, LANG "sv_nobossdrop")
X(st_sv_nobosses, LANG "sv_nobosses")
X(st_sv_nofullammo, LANG "sv_nofullammo")
X(st_sv_noscoreammo, LANG "sv_noscoreammo")
X(st_sv_pauseinmenus, LANG "sv_pauseinmenus")
X(st_sv_rain, LANG "sv_rain")
X(st_sv_revenge, LANG "sv_revenge")
X(st_sv_scoremul, LANG "sv_scoremul")
X(st_sv_sky, LANG "sv_sky")
X(st_sv_wepdrop, LANG "sv_wepdrop")
X(st_term_disconnecting, "Disconnecting...")
X(st_term_ip, "<55.883.115.7>")
X(st_term_sgxline, "SGXLine r4205")
X(st_term_use_to_ack, "Use To Acknowledge")
X(st_timeout, "TimeOut")
X(st_weapons_alpha, LANG "weapons_alpha")
X(st_weapons_casingfadeout, LANG "weapons_casingfadeout")
X(st_weapons_casings, LANG "weapons_casings")
X(st_weapons_fastlazshot, LANG "weapons_fastlazshot")
X(st_weapons_magdrops, LANG "weapons_magdrops")
X(st_weapons_magfadeout, LANG "weapons_magfadeout")
X(st_weapons_magicselanims, LANG "weapons_magicselanims")
X(st_weapons_nofirebob, LANG "weapons_nofirebob")
X(st_weapons_rainbowlaser, LANG "weapons_rainbowlaser")
X(st_weapons_recoil, LANG "weapons_recoil")
X(st_weapons_reloadbob, LANG "weapons_reloadbob")
X(st_weapons_reloadempty, LANG "weapons_reloadempty")
X(st_weapons_ricochetvol, LANG "weapons_ricochetvol")
X(st_weapons_riflemodeclear, LANG "weapons_riflemodeclear")
X(st_weapons_riflescope, LANG "weapons_riflescope")
X(st_weapons_scopealpha, LANG "weapons_scopealpha")
X(st_weapons_slot3ammo, LANG "weapons_slot3ammo")
X(st_weapons_zoomfactor, LANG "weapons_zoomfactor")
X(st_xhair_a, LANG "xhair_a")
X(st_xhair_b, LANG "xhair_b")
X(st_xhair_enable, LANG "xhair_enable")
X(st_xhair_enablejuicer, LANG "xhair_enablejuicer")
X(st_xhair_g, LANG "xhair_g")
X(st_xhair_r, LANG "xhair_r")
X(st_xhair_style, LANG "xhair_style")
X(st_term_disconnecting, "Disconnecting...") /* TODO */
X(st_term_ip, "<55.883.115.7>") /* TODO */
X(st_term_sgxline, "SGXLine r4205") /* TODO */
X(st_term_use_to_ack, "Use To Acknowledge") /* TODO */

/* Generated */
X(st_bip_help_search, LANG "BIP_HELP_Search")
#define LITH_X(name, capt) X(st_bip_help_##name, LANG "BIP_HELP_" capt)
#include "p_bip.h"

X(st_bipc_EXTRA, "EXTRA")
#define LITH_X(n, _) X(st_bipc_##n, #n)
#include "p_bip.h"
@@ -625,4 +467,7 @@ X(sm_Serv, OBJ "HERMES")
#define X(n, s) extern str const n;
#include "m_stab.h"

#define Str(n, s) static str const n = s
#define StrAry(n, ...) static str const n[] = {__VA_ARGS__}

#endif

+ 25
- 15
source/Headers/p_player.h View File

@@ -48,10 +48,8 @@ LITH_X(gR, pcl_robot)

#include <GDCC/HashMap.h>

#define MAX_PLAYERS 8

#define for_player() \
for(i32 _piter = 0; _piter < MAX_PLAYERS; _piter++) \
for(i32 _piter = 0; _piter < _max_players; _piter++) \
__with(struct player *p = &players[_piter];) \
if(p->active)

@@ -94,6 +92,10 @@ script void P_TeleportOutAsync(struct player *p);

GDCC_HashMap_Decl(upgrademap_t, i32, struct upgrade)

enum {
_max_players = 8,
};

enum
{
#define LITH_X(l, r) l = r,
@@ -145,19 +147,23 @@ struct player_delta

/* Attributes */
struct player_attributes attr;

/* Flashlight */
bool lt_on;
};

/* 7/4/2016: That's a lot of data! */
/* edit 9/4/2016: Holy shit, that's really a lot of data! */
/* edit 7/5/2016: JESUS TAKE THE WHEEL */
/* edit 3/1/2017: help */
/* edit 6/1/2017: there's so much data that I had to split it */
/* edit 23/1/2017: D E S T R O Y */
/* edit 26/2/2017: There is yet again so much data that I had to split it. */
/* edit 11/3/2017: NOW WITH PROPERTY HELL */
/* edit 11/7/2017: and now it's over 5000 bytes. */
/* edit 14/7/2017: lol nevermind it's only 2kb now */
/* edit 31/8/2017: m e r g e */
/* 7/4/2016: That's a lot of data!
* edit 9/4/2016: Holy shit, that's really a lot of data!
* edit 7/5/2016: JESUS TAKE THE WHEEL
* edit 3/1/2017: help
* edit 6/1/2017: there's so much data that I had to split it
* edit 23/1/2017: D E S T R O Y
* edit 26/2/2017: There is yet again so much data that I had to split it.
* edit 11/3/2017: NOW WITH PROPERTY HELL
* edit 11/7/2017: and now it's over 5000 bytes.
* edit 14/7/2017: lol nevermind it's only 2kb now
* edit 31/8/2017: m e r g e
*/
struct player
{
/* data */
@@ -323,12 +329,16 @@ struct player
bool krc, kyc, kbc;
bool krs, kys, kbs;

/* Flashlight */
i32 lt_battery;
k64 lt_intensity, lt_target, lt_speed;

/* 🌌 「÷」 0 */
bool sgacquired;
};

/* Extern Objects ---------------------------------------------------------- */

extern struct player players[MAX_PLAYERS];
extern struct player players[_max_players];

#endif

+ 3
- 6
source/Headers/w_world.h View File

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

#include "w_data.h"

#define InSecret \
(game == Game_Doom2 && (Cluster == 9 || Cluster == 10))
#define InHell \
(game == Game_Doom2 && Cluster >= 8)
#define OnEarth \
(game == Game_Doom2 && Cluster == 7)
#define InSecret (game == Game_Doom2 && (Cluster == 9 || Cluster == 10))
#define InHell (game == Game_Doom2 && Cluster >= 8)
#define OnEarth (game == Game_Doom2 && Cluster == 7)

#define MapNum ACS_GetLevelInfo(LEVELINFO_LEVELNUM)
#define Cluster ACS_GetLevelInfo(LEVELINFO_CLUSTERNUM)


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

@@ -127,7 +127,7 @@ void Sc_GiveEXPToMonster(i32 amt)
script_str ext("ACS") addr("Lith_GiveMail")
void Sc_DbgGiveMail(i32 num)
{
static str const names[] = {
StrAry(names,
s"Intro",
s"Cluster1",
s"Cluster2",
@@ -138,7 +138,7 @@ void Sc_DbgGiveMail(i32 num)
s"JamesDefeated",
s"MakarovDefeated",
s"IsaacDefeated"
};
);

num %= countof(names);



+ 5
- 3
source/Main/g_auto.c View File

@@ -57,9 +57,11 @@ void G_UpdateState(struct gui_state *g, struct player *p)
{
bool inverted = p->getCVarI(sc_player_invertmouse);

/* Due to ZDoom being ZDoom, GetUserCVar with invertmouse does nothing. */
/* This breaks network sync so we can only do it in singleplayer. */
if(singleplayer) inverted |= ACS_GetCVar(sc_invertmouse);
/* Due to ZDoom being ZDoom, GetUserCVar with invertmouse does nothing.
* This breaks network sync so we can only do it in single-player.
*/
Str(invertmouse, s"invertmouse");
if(singleplayer) inverted |= ACS_GetCVar(invertmouse);

g->old = g->cur;



+ 154
- 157
source/Main/m_namegen.c View File

@@ -37,176 +37,174 @@ static cstr syll[] = {
};

static cstr lulz[] = {
"ohgodwhat",
"kdizd",
"explod",
"fuck",
"help",
"kdizd",
"ohgodwhat",
"ohno",
"explod",
"why",
"fuck"
};

static str name[] = {
s"Gorgoth",
s"Merdiklo",
s"Starface",
s"Mar'khi",
s"Veritt",
s"Modoch",
s"Vup",
s"Helliox",
s"Warrdeth",
s"Killzor",
s"Ikhon",
s"Manslayer",
s"Fismit",
s"Killinger",
s"Eradicus",
s"Mortarr",
s"Pox",
s"Murdercles",
s"Jerkules",
s"Haddrox",
s"Persecon",
s"Errexioth",
s"Satan Jr.",
s"Makob",
s"Vorbenix",
s"Norvenica",
s"Mek'tethel",
s"Vex'genn",
s"Horoxoloth",
s"Chaotica",
s"Hex'vorr",
s"Legetto",
s"Fauror",
s"Kormat",
s"Mogaltu",
s"Shel",
s"Vameth",
s"Dethul",
s"Ginavak",
s"Kantul",
s"Korthaet",
s"Laniaro",
s"Lortuc",
s"Morcatu",
s"Ndur",
s"Saugur",
s"Vathan",
s"Caethind",
s"Hirthe",
s"Inchindr",
s"Kaelarmaul",
s"Koritu",
s"Nakor",
s"Ngugobal",
s"Obair",
s"Rorgia",
s"Falau",
s"Hethaeg",
s"Melulind",
s"Morchaur",
s"Nilrin",
s"Shabakauth",
s"Ulkal",
s"Valdo",
s"Wendun",
s"Atund",
s"Bagurar",
s"Shuldu",
s"Be'elzebubba",
s"K'banian",
s"Faellat",
s"G'ldethi",
s"Kazgoroth",
s"Mathanat",
s"Ngot",
s"S'goth",
s"Sot-ilh",
s"Ubote",
s"Yar'udab",
s"Ulyaoth",
s"Xel'lotath",
s"Chattur'gha",
s"Mantorok",
s"Gowron",
s"Dak'shira",
s"Keghas",
s"Pha'otho",
s"N'hogura",
s"Alevot",
s"Arafonad",
s"Axurador",
s"Erelak",
s"Eroam",
s"Kazidax",
s"Nudob",
s"Tarvo",
s"Araxidak",
s"Duri",
s"Kafondam",
s"Rilor",
s"Ukam",
s"Kofarutul",
s"Edorir",
s"Sofolos",
s"Tarivror",
s"Xibavel",
s"M'Rub",
s"P'Noon Ikl",
s"Olok",
static cstr name[] = {
"Alevot",
"Arafonad",
"Araxidak",
"Atund",
"Axurador",
"Bagurar",
"Be'elzebubba",
"Caethind",
"Chaotica",
"Chattur'gha",
"Dak'shira",
"Dethul",
"Duri",
"Edorir",
"Eradicus",
"Erelak",
"Eroam",
"Errexioth",
"Faellat",
"Falau",
"Fauror",
"Fismit",
"G'ldethi",
"Ginavak",
"Gorgoth",
"Gowron",
"Haddrox",
"Helliox",
"Hethaeg",
"Hex'vorr",
"Hirthe",
"Horoxoloth",
"Ikhon",
"Inchindr",
"Jerkules",
"K'banian",
"Kaelarmaul",
"Kafondam",
"Kantul",
"Kazgoroth",
"Kazidax",
"Keghas",
"Killinger",
"Killzor",
"Kofarutul",
"Koritu",
"Kormat",
"Korthaet",
"Laniaro",
"Legetto",
"Lortuc",
"M'Rub",
"Makob",
"Manslayer",
"Mantorok",
"Mar'khi",
"Mathanat",
"Mek'tethel",
"Melulind",
"Merdiklo",
"Modoch",
"Mogaltu",
"Morcatu",
"Morchaur",
"Mortarr",
"Murdercles",
"N'hogura",
"Nakor",
"Ndur",
"Ngot",
"Ngugobal",
"Nilrin",
"Norvenica",
"Nudob",
"Obair",
"Olok",
"P'Noon Ikl",
"Persecon",
"Pha'otho",
"Pox",
"Rilor",
"Rorgia",
"S'goth",
"Satan Jr.",
"Saugur",
"Shabakauth",
"Shel",
"Shuldu",
"Sofolos",
"Sot-ilh",
"Starface",
"Tarivror",
"Tarvo",
"Ubote",
"Ukam",
"Ulkal",
"Ulyaoth",
"Valdo",
"Vameth",
"Vathan",
"Veritt",
"Vex'genn",
"Vorbenix",
"Vup",
"Warrdeth",
"Wendun",
"Xel'lotath",
"Xibavel",
"Yar'udab",
};

static str suff[] = {
s"Supreme",
s"Lord of Brimstone",
s"Eater of Souls",
s"Betrayer of All",
s"Executioner",
s"Seeker of Bloodshed",
s"Agent of Damnation",
s"Image of Darkness",
s"Bringer of Famine",
s"Engine of Ruin",
s"Ender of Days",
s"Lord of Chaos",
s"Lord of Darkness",
s"Lord of Betrayal",
s"Slayer of Worlds",
s"Shadow of the Night",
s"Dark One",
s"Chosen of Sin",
s"Cold-eyed Slayer",
s"Juggernaut",
s"Walking Apocalypse",
s"Invincible",
s"Final Judgement",
s"One Who Seeks Battle",
s"Overlord of Pandemonium",
s"Lord of Hatred",
s"Incarnation of Death",
s"Hideous Destructor",
s"Horrendeous Tyrant",
s"Destroyer",
s"Sinful",
s"Dogma of Evil",
s"Alpha and Omega",
static cstr suff[] = {
"Agent of Damnation",
"Alpha and Omega",
"Betrayer of All",
"Bringer of Famine",
"Chosen of Sin",
"Cold-eyed Slayer",
"Dark One",
"Destroyer",
"Dogma of Evil",
"Eater of Souls",
"Ender of Days",
"Engine of Ruin",
"Executioner",
"Final Judgement",
"Hideous Destructor",
"Horrendeous Tyrant",
"Image of Darkness",
"Incarnation of Death",
"Invincible",
"Juggernaut",
"Lord of Betrayal",
"Lord of Brimstone",
"Lord of Chaos",
"Lord of Darkness",
"Lord of Hatred",
"One Who Seeks Battle",
"Overlord of Pandemonium",
"Seeker of Bloodshed",
"Shadow of the Night",
"Sinful",
"Slayer of Worlds",
"Supreme",
"Walking Apocalypse",
};

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

str RandomName(i32 id)
{
str RandomName(i32 id) {
srand(id ? mapseed + id : ACS_Random(0, INT32_MAX));

ACS_BeginPrint();
PrintChars("\Cg", 2);

if(id && (rand() % 10) == 0)
ACS_PrintString(name[rand() % countof(name)]);
else for(i32 i = 0, n = 3 + (rand() % 6); i < n; i++)
{
if(id && (rand() % 10) == 0) {
PrintChrSt(name[rand() % countof(name)]);
} else for(i32 i = 0, n = 3 + (rand() % 6); i < n; i++) {
cstr s = rand() % 101 == 0 ?
lulz[rand() % countof(lulz)] :
syll[rand() % countof(syll)];
@@ -216,10 +214,9 @@ str RandomName(i32 id)
PrintChrSt(s);
}

if(id)
{
if(id) {
PrintChars(", the ", 6);
ACS_PrintString(suff[rand() % countof(suff)]);
PrintChrSt(suff[rand() % countof(suff)]);
}