Browse Source

genericise naming schemes

tags/1.6.1
Alison Watson 3 years ago
parent
commit
96126e79ea
77 changed files with 602 additions and 553 deletions
  1. +1
    -0
      ir/lithium/dummy.txt
  2. +0
    -1
      pk7/fontdefs.txt
  3. +2
    -2
      pk7/lzscript/Headers/lith_pdata.h
  4. +2
    -2
      pk7/lzscript/Headers/lith_scorenums.h
  5. +1
    -1
      pk7/lzscript/Headers/lith_upgradenames.h
  6. +8
    -8
      pk7/lzscript/Headers/lith_wdata.h
  7. +3
    -3
      pk7/lzscript/Headers/lith_weapons.h
  8. +16
    -11
      source/Headers/lith_common.h
  9. +2
    -2
      source/Headers/lith_pdata.h
  10. +2
    -2
      source/Headers/lith_player.h
  11. +2
    -2
      source/Headers/lith_scorenums.h
  12. +1
    -1
      source/Headers/lith_upgradenames.h
  13. +1
    -1
      source/Headers/lith_upgrades.h
  14. +1
    -1
      source/Headers/lith_version.h
  15. +8
    -8
      source/Headers/lith_wdata.h
  16. +3
    -3
      source/Headers/lith_weapons.h
  17. +2
    -2
      source/Headers/lith_world.h
  18. +3
    -3
      source/Main/g_auto.c
  19. +1
    -1
      source/Main/g_textbox.c
  20. +16
    -16
      source/Main/p_bip.c
  21. +21
    -15
      source/Main/p_cbigui.c
  22. +19
    -14
      source/Main/p_data.c
  23. +5
    -5
      source/Main/p_gui_bip.c
  24. +24
    -25
      source/Main/p_gui_cbi.c
  25. +16
    -10
      source/Main/p_gui_upgrades.c
  26. +3
    -3
      source/Main/p_hud.c
  27. +6
    -6
      source/Main/p_log.c
  28. +7
    -7
      source/Main/p_magic.c
  29. +1
    -1
      source/Main/p_misc.c
  30. +8
    -4
      source/Main/p_notes.c
  31. +8
    -8
      source/Main/p_obituary.c
  32. +1
    -1
      source/Main/p_payout.c
  33. +13
    -13
      source/Main/p_pickups.c
  34. +8
    -8
      source/Main/p_player.c
  35. +6
    -6
      source/Main/p_render.c
  36. +2
    -2
      source/Main/p_savedata.c
  37. +67
    -67
      source/Main/p_settings.c
  38. +15
    -13
      source/Main/p_shop.c
  39. +3
    -3
      source/Main/p_shopdef.c
  40. +15
    -15
      source/Main/p_statistics.c
  41. +1
    -1
      source/Main/p_status.c
  42. +10
    -9
      source/Main/p_weaponinfo.c
  43. +40
    -40
      source/Main/p_weapons.c
  44. +8
    -8
      source/Main/u_adrenaline.c
  45. +1
    -1
      source/Main/u_cyberlegs.c
  46. +1
    -1
      source/Main/u_defensenuke.c
  47. +1
    -1
      source/Main/u_goldeneye.c
  48. +2
    -2
      source/Main/u_headsupdis2.c
  49. +1
    -1
      source/Main/u_headsupdis3.c
  50. +2
    -2
      source/Main/u_headsupdisp.c
  51. +1
    -1
      source/Main/u_homingrpg.c
  52. +1
    -1
      source/Main/u_instadeath.c
  53. +1
    -1
      source/Main/u_jetbooster.c
  54. +3
    -3
      source/Main/u_lolsords.c
  55. +21
    -17
      source/Main/u_magic.c
  56. +3
    -3
      source/Main/u_punctcannon.c
  57. +10
    -10
      source/Main/u_reactarmor.c
  58. +1
    -1
      source/Main/u_reflexwetw.c
  59. +2
    -2
      source/Main/u_riflemodes.c
  60. +3
    -3
      source/Main/u_stealthsys.c
  61. +8
    -8
      source/Main/u_subweapons.c
  62. +8
    -8
      source/Main/u_vitalscan.c
  63. +11
    -11
      source/Main/w_boss.c
  64. +1
    -1
      source/Main/w_cbi.c
  65. +2
    -2
      source/Main/w_data.c
  66. +2
    -2
      source/Main/w_dmon.c
  67. +12
    -12
      source/Main/w_monster.c
  68. +5
    -5
      source/Main/w_powerup.c
  69. +3
    -3
      source/Main/w_rain.c
  70. +37
    -37
      source/Main/w_spawn.c
  71. +9
    -7
      source/Main/w_time.c
  72. +5
    -1
      source/Main/w_title.c
  73. +33
    -33
      source/Main/w_world.c
  74. +7
    -7
      source/Weapons.txt
  75. +16
    -6
      tools/decompat.rb
  76. +1
    -1
      tools/upgc.rb
  77. +6
    -5
      tools/wepc.rb

+ 1
- 0
ir/lithium/dummy.txt View File

@@ -0,0 +1 @@
This is just here so Git knows that this folder exists.

+ 0
- 1
pk7/fontdefs.txt View File

@@ -75,4 +75,3 @@ LTRMFONT
}

// EOF


+ 2
- 2
pk7/lzscript/Headers/lith_pdata.h View File

@@ -2,7 +2,7 @@
// Edit only if you aren't going to recompile.

// Copyright © 2016-2017 Alison Sanderson, all rights reserved.
enum Lith_PData
enum PData
{
pdata_weapon,
pdata_upgrade,
@@ -17,7 +17,7 @@ enum Lith_PData
pdata_recoilp,
};

enum Lith_PClass
enum PClass
{
pcl_unknown,



+ 2
- 2
pk7/lzscript/Headers/lith_scorenums.h View File

@@ -2,7 +2,7 @@
// Edit only if you aren't going to recompile.

// Copyright © 2016-2017 Alison Sanderson, all rights reserved.
enum Lith_ScoreNum
enum ScoreNum
{
// Score values
Score_Clip = 1000,
@@ -50,7 +50,7 @@ enum Lith_ScoreNum
Score_DSparil = 10000000, // Energy
};

enum Lith_EXPNum
enum EXPNum
{
// Tier 1
Exp_ZombieMan = 5,


+ 1
- 1
pk7/lzscript/Headers/lith_upgradenames.h View File

@@ -4,7 +4,7 @@
// This file was generated by upgc.
// Edit only if you aren't going to recompile.

enum Lith_UpgradeName
enum UpgradeName
{
UPGR_HeadsUpDisp,
UPGR_HeadsUpDis2,


+ 8
- 8
pk7/lzscript/Headers/lith_wdata.h View File

@@ -3,7 +3,7 @@

// Copyright © 2016-2017 Alison Sanderson, all rights reserved.

enum Lith_WData
enum WData
{
wdata_bossspawned,
wdata_enemycheck,
@@ -14,12 +14,12 @@ enum Lith_WData
wdata_pclass,
};

enum Lith_Fun
enum Fun
{
lfun_ragnarok = 1 << 0,
};

enum Lith_CBIUpgradeM
enum CBIUpgradeM
{
cupg_weapninter,
cupg_hasupgr1,
@@ -30,7 +30,7 @@ enum Lith_CBIUpgradeM
cupg_max
};

enum Lith_CBIUpgradeC
enum CBIUpgradeC
{
cupg_c_slot3spell,
cupg_c_slot4spell,
@@ -40,7 +40,7 @@ enum Lith_CBIUpgradeC
cupg_c_rdistinter,
};

enum Lith_RandomSpawnNum
enum RandomSpawnNum
{
lrsn_garmor,
lrsn_barmor,
@@ -50,7 +50,7 @@ enum Lith_RandomSpawnNum
lrsn_clipbx,
};

enum Lith_ArmorSlot
enum ArmorSlot
{
aslot_lower,
aslot_upper,
@@ -59,7 +59,7 @@ enum Lith_ArmorSlot
aslot_max
};

enum Lith_MsgType
enum MsgType
{
msg_ammo,
msg_huds,
@@ -68,7 +68,7 @@ enum Lith_MsgType
};


enum Lith_DamageType
enum LDamageType
{
ldt_bullets,
ldt_energy,


+ 3
- 3
pk7/lzscript/Headers/lith_weapons.h View File

@@ -4,7 +4,7 @@
// This file was generated by wepc.
// Edit only if you aren't going to recompile.

enum Lith_WeaponNum
enum WeaponNum
{
weapon_min = 1,
weapon_unknown = 0,
@@ -50,7 +50,7 @@ enum Lith_WeaponNum
weapon_max
};

enum Lith_WeaponName
enum WeaponName
{
wepnam_fist,
wepnam_chainsaw,
@@ -65,7 +65,7 @@ enum Lith_WeaponName
wepnam_max,
};

enum Lith_RifleMode
enum RifleMode
{
rifle_firemode_auto,
rifle_firemode_grenade,


+ 16
- 11
source/Headers/lith_common.h View File

@@ -28,7 +28,7 @@
#define CloseEnough(x, y) (IsSmallNumber(x - y))

#define LogDebug(level, ...) \
do if(ACS_GetCVar("__lith_debug_level") & (level)) \
do if(ACS_GetCVar(DCVAR "debug_level") & (level)) \
Log(#level ": " __VA_ARGS__); \
while(0)

@@ -58,19 +58,24 @@
#define GetY ACS_GetActorY
#define GetZ ACS_GetActorZ

#define ServCallI(...) SCallI("Lith_HERMES", __VA_ARGS__)
#define ServCallK(...) SCallK("Lith_HERMES", __VA_ARGS__)
#define ServCallS(...) SCallS("Lith_HERMES", __VA_ARGS__)
#define Lith_IsPaused ServCallI("GetPaused")
#define Lith_PausableTick() do ACS_Delay(1); while(Lith_IsPaused)

#define DrawCallI(...) SCallI("Lith_URANUS", __VA_ARGS__)
#define DrawCallK(...) SCallK("Lith_URANUS", __VA_ARGS__)
#define DrawCallS(...) SCallS("Lith_URANUS", __VA_ARGS__)
#define ServName OBJ "HERMES"
#define DrawName OBJ "URANUS"

#define Lith_IsPaused ServCallI("GetPaused")
#define CVAR "lith_"
#define DCVAR "__lith_"
#define OBJ "Lith_"
#define LANG "LITH_"

#define ServCallI(...) SCallI(ServName, __VA_ARGS__)
#define ServCallK(...) SCallK(ServName, __VA_ARGS__)
#define ServCallS(...) SCallS(ServName, __VA_ARGS__)

#define Lith_PausableTick() \
do ACS_Delay(1); \
while(Lith_IsPaused)
#define DrawCallI(...) SCallI(DrawName, __VA_ARGS__)
#define DrawCallK(...) SCallK(DrawName, __VA_ARGS__)
#define DrawCallS(...) SCallS(DrawName, __VA_ARGS__)

#define DebugStat(...) \
(world.dbgLevel & log_devh ? Lith_DebugStat(__VA_ARGS__) : (void)0)


+ 2
- 2
source/Headers/lith_pdata.h View File

@@ -1,7 +1,7 @@
// zsc output: pk7/lzscript/Headers/lith_pdata.h

// Copyright © 2016-2017 Alison Sanderson, all rights reserved.
enum // Lith_PData
enum // PData
{
pdata_weapon,
pdata_upgrade,
@@ -16,7 +16,7 @@ enum // Lith_PData
pdata_recoilp,
};

enum // Lith_PClass
enum // PClass
{
pcl_unknown,



+ 2
- 2
source/Headers/lith_player.h View File

@@ -168,8 +168,8 @@ struct player
__prop weapontype {get: Lith_PlayerCurWeaponType(this)}
__prop buttonPressed {call: Lith_ButtonPressed(this)}
__prop setVel {call: Lith_SetPlayerVelocity(this)}
__prop mana {get: Lith_CheckActorInventory(->tid, "Lith_MagicAmmo")}
__prop manamax {get: ACS_GetMaxInventory(->tid, "Lith_MagicAmmo")}
__prop mana {get: Lith_CheckActorInventory(->tid, OBJ "MagicAmmo")}
__prop manamax {get: ACS_GetMaxInventory(->tid, OBJ "MagicAmmo")}
__prop validateTID {call: Lith_ValidatePlayerTID(this)}
__prop health {get: GetPropI(->tid, APROP_Health),
set: SetPropI(->tid, APROP_Health)}


+ 2
- 2
source/Headers/lith_scorenums.h View File

@@ -1,7 +1,7 @@
// zsc output: pk7/lzscript/Headers/lith_scorenums.h

// Copyright © 2016-2017 Alison Sanderson, all rights reserved.
enum // Lith_ScoreNum
enum // ScoreNum
{
// Score values
Score_Clip = 1000,
@@ -49,7 +49,7 @@ enum // Lith_ScoreNum
Score_DSparil = 10000000, // Energy
};

enum // Lith_EXPNum
enum // EXPNum
{
// Tier 1
Exp_ZombieMan = 5,


+ 1
- 1
source/Headers/lith_upgradenames.h View File

@@ -3,7 +3,7 @@
// This file was generated by upgc.
// Edit only if you aren't going to recompile.

enum // Lith_UpgradeName
enum // UpgradeName
{
UPGR_HeadsUpDisp,
UPGR_HeadsUpDis2,


+ 1
- 1
source/Headers/lith_upgrades.h View File

@@ -9,7 +9,7 @@
#include "lith_list.h"

#define Lith_UpgrBuy(p, upgr, ...) \
p->buy(&(upgr)->info->shopdef, (upgr), "LITH_UPGRADE_TITLE_%S", __VA_ARGS__)
p->buy(&(upgr)->info->shopdef, (upgr), LANG "UPGRADE_TITLE_%S", __VA_ARGS__)

#define ForUpgrade(name) \
for(int _i = 0; _i < p->upgrmax; _i++) \


+ 1
- 1
source/Headers/lith_version.h View File

@@ -1,5 +1,5 @@
// Copyright © 2016-2018 Alison Sanderson, all rights reserved.
#define Lith_Version "1.6.1 (Hyper-Trilithium)"
#define Lith_Version "Lithium 1.6.1 (Hyper-Trilithium)"
#define Lith_APIVersion Lith_v1_6_1
#define Lith_CheckAPIVersion() \
do { \


+ 8
- 8
source/Headers/lith_wdata.h View File

@@ -2,7 +2,7 @@

// Copyright © 2016-2017 Alison Sanderson, all rights reserved.

enum // Lith_WData
enum // WData
{
wdata_bossspawned,
wdata_enemycheck,
@@ -13,12 +13,12 @@ enum // Lith_WData
wdata_pclass,
};

enum // Lith_Fun
enum // Fun
{
lfun_ragnarok = 1 << 0,
};

enum // Lith_CBIUpgradeM
enum // CBIUpgradeM
{
cupg_weapninter,
cupg_hasupgr1,
@@ -29,7 +29,7 @@ enum // Lith_CBIUpgradeM
cupg_max
};

enum // Lith_CBIUpgradeC
enum // CBIUpgradeC
{
cupg_c_slot3spell,
cupg_c_slot4spell,
@@ -39,7 +39,7 @@ enum // Lith_CBIUpgradeC
cupg_c_rdistinter,
};

enum // Lith_RandomSpawnNum
enum // RandomSpawnNum
{
lrsn_garmor,
lrsn_barmor,
@@ -49,7 +49,7 @@ enum // Lith_RandomSpawnNum
lrsn_clipbx,
};

enum // Lith_ArmorSlot
enum // ArmorSlot
{
aslot_lower,
aslot_upper,
@@ -58,7 +58,7 @@ enum // Lith_ArmorSlot
aslot_max
};

enum // Lith_MsgType
enum // MsgType
{
msg_ammo,
msg_huds,
@@ -67,7 +67,7 @@ enum // Lith_MsgType
};


enum // Lith_DamageType
enum // LDamageType
{
ldt_bullets,
ldt_energy,


+ 3
- 3
source/Headers/lith_weapons.h View File

@@ -3,7 +3,7 @@
// This file was generated by wepc.
// Edit only if you aren't going to recompile.

enum // Lith_WeaponNum
enum // WeaponNum
{
weapon_min = 1,
weapon_unknown = 0,
@@ -49,7 +49,7 @@ enum // Lith_WeaponNum
weapon_max
};

enum // Lith_WeaponName
enum // WeaponName
{
wepnam_fist,
wepnam_chainsaw,
@@ -64,7 +64,7 @@ enum // Lith_WeaponName
wepnam_max,
};

enum // Lith_RifleMode
enum // RifleMode
{
rifle_firemode_auto,
rifle_firemode_grenade,


+ 2
- 2
source/Headers/lith_world.h View File

@@ -72,11 +72,11 @@ typedef struct worldinfo_s
__prop canontime {get: Lith_CanonTime(CANONTIME_FULL)}
__prop canontimeshort {get: Lith_CanonTime(CANONTIME_SHORT)}
__prop canondate {get: Lith_CanonTime(CANONTIME_DATE)}
__prop difficulty {get: ACS_GetCVar("lith_sv_difficulty")}
__prop difficulty {get: ACS_GetCVar(CVAR "sv_difficulty")}
__prop begAngles {call: Lith_BeginAngles()}
__prop addAngles {call: Lith_AddAngle()}
__prop freeze {call: Lith_FreezeTime()}
__prop autosave {get: ACS_GetCVar("lith_sv_autosave")}
__prop autosave {get: ACS_GetCVar(CVAR "sv_autosave")}

bool gsinit;
bool singleplayer;


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

@@ -39,7 +39,7 @@ void Lith_GUI_Init(gui_state_t *g, void *state)
stkcall
void Lith_GUI_UpdateState(gui_state_t *g, struct player *p)
{
bool inverted = p->getCVarI("lith_player_invertmouse");
bool inverted = p->getCVarI(CVAR "player_invertmouse");

// Due to ZDoom being ZDoom, GetUserCVar with invertmouse does nothing.
// This breaks network sync so we can only do it in singleplayer.
@@ -48,8 +48,8 @@ void Lith_GUI_UpdateState(gui_state_t *g, struct player *p)

g->old = g->cur;

fixed xmul = p->getCVarK("lith_gui_xmul");
fixed ymul = p->getCVarK("lith_gui_ymul");
fixed xmul = p->getCVarK(CVAR "gui_xmul");
fixed ymul = p->getCVarK(CVAR "gui_ymul");

g->cx -= p->yawv * (800.0lk * xmul);
if(inverted) g->cy += p->pitchv * (800.0lk * ymul);


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

@@ -45,7 +45,7 @@ gui_txtbox_state_t *Lith_GUI_TextBox_Impl(gui_state_t *g, id_t id, gui_txtbox_ar
if(st->tbptr)
PrintTextFmt("%s%S", Lith_CPS_Print(st->txtbuf, st->tbptr), hot ? Ticker("|", "") : "");
else
PrintTextFmt("\C%c%S", hot ? 'c' : 'm', L("LITH_GUI_TEXTBOX"));
PrintTextFmt("\C%c%S", hot ? 'c' : 'm', L(LANG "GUI_TEXTBOX"));
PrintText("cbifont", CR_WHITE, a->x + g->ox,1, a->y + g->oy,1);
ClearClip();



+ 16
- 16
source/Main/p_bip.c View File

@@ -43,8 +43,8 @@ static void UnlockPage(struct bip *bip, struct page *page, int pclass)
optargs(1)
static void AddToBIP(struct bip *bip, int categ, int pclass, struct page_init const *pinit, bool isfree)
{
__str image = LanguageNull("LITH_INFO_IMAGE_%s", pinit->name);
int height = strtoi_str(Language("LITH_INFO_CSIZE_%s", pinit->name), null, 0);
__str image = LanguageNull(LANG "INFO_IMAGE_%s", pinit->name);
int height = strtoi_str(Language(LANG "INFO_CSIZE_%s", pinit->name), null, 0);

struct page *page = Salloc(struct page);

@@ -174,8 +174,8 @@ void Lith_DeliverMail(struct player *p, __str title, int flags)
{
p->setActivator();

flags |= strtoi_str(Language("LITH_MAIL_FLAG_%S", title), null, 0);
flags |= strtoi_str(Language("LITH_MAIL_FLAG_%S%s", title, p->discrim), null, 0);
flags |= strtoi_str(Language(LANG "MAIL_FLAG_%S", title), null, 0);
flags |= strtoi_str(Language(LANG "MAIL_FLAG_%S%s", title, p->discrim), null, 0);

if(!(flags & MAILF_AllPlayers)) title = StrParam("%S%s", title, p->discrim);

@@ -183,17 +183,17 @@ void Lith_DeliverMail(struct player *p, __str title, int flags)

struct page *page = Salloc(struct page);

__str date = LanguageNull("LITH_MAIL_TIME_%S", title);
__str size = LanguageNull("LITH_MAIL_SIZE_%S", title);
__str send = LanguageNull("LITH_MAIL_SEND_%S", title);
__str name = LanguageNull("LITH_MAIL_NAME_%S", title);
__str body = Language ("LITH_MAIL_BODY_%S", title);
__str date = LanguageNull(LANG "MAIL_TIME_%S", title);
__str size = LanguageNull(LANG "MAIL_SIZE_%S", title);
__str send = LanguageNull(LANG "MAIL_SEND_%S", title);
__str name = LanguageNull(LANG "MAIL_NAME_%S", title);
__str body = Language (LANG "MAIL_BODY_%S", title);

if(!send) send = L("LITH_MAIL_INTERNAL");
if(!send) send = L(LANG "MAIL_INTERNAL");

lstrcpy_str(page->name, date ? date : l_strdup(world.canontimeshort));
page->title = name ? name : L("LITH_MAIL_NOTITLE");
page->body = StrParam(L("LITH_MAIL_TEMPLATE"), send, page->name, body);
page->title = name ? name : L(LANG "MAIL_NOTITLE");
page->body = StrParam(L(LANG "MAIL_TEMPLATE"), send, page->name, body);
page->category = BIPC_MAIL;
page->unlocked = true;

@@ -208,7 +208,7 @@ void Lith_DeliverMail(struct player *p, __str title, int flags)
{
ACS_Delay(20);

p->logB(1, L("LITH_LOG_MailRecv"), send);
p->logB(1, L(LANG "LOG_MailRecv"), send);

if(ACS_Random(1, 10000) == 1)
{
@@ -267,15 +267,15 @@ struct page_info Lith_GetPageInfo(struct page const *page)

pinf.shname = page->category == BIPC_MAIL
? l_strdup(page->name)
: Language("LITH_INFO_SHORT_%s", page->name);
: Language(LANG "INFO_SHORT_%s", page->name);

pinf.body = page->body
? page->body
: Language("LITH_INFO_DESCR_%s", page->name);
: Language(LANG "INFO_DESCR_%s", page->name);

pinf.flname = page->title
? page->title
: Language("LITH_INFO_TITLE_%s", page->name);
: Language(LANG "INFO_TITLE_%s", page->name);

if(page->category == BIPC_EXTRA)
pinf.body = DecryptBody(pinf.body);


+ 21
- 15
source/Main/p_cbigui.c View File

@@ -20,14 +20,16 @@

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

#pragma GDCC STRENT_LITERAL OFF

static void Lith_CBITab_Arsenal(gui_state_t *g, struct player *p)
{
extern void Lith_CBITab_Upgrades(gui_state_t *g, struct player *p);
extern void Lith_CBITab_Shop (gui_state_t *g, struct player *p);

char tn[2][TABCHARS];
LanguageVC(tn[0], c"LITH_TAB_UPGRADES");
LanguageVC(tn[1], c"LITH_TAB_SHOP");
LanguageVC(tn[0], LANG "TAB_UPGRADES");
LanguageVC(tn[1], LANG "TAB_SHOP");
Lith_GUI_Tabs(g, &CBIState(g)->arsetab, tn, 13, 13, 1);

switch(CBIState(g)->arsetab) {
@@ -42,8 +44,8 @@ static void Lith_CBITab_Stat(gui_state_t *g, struct player *p)
extern void Lith_CBITab_Status(gui_state_t *g, struct player *p);

char tn[2][TABCHARS];
LanguageVC(tn[0], c"LITH_TAB_ATTRIBUTES");
LanguageVC(tn[1], c"LITH_TAB_CBI");
LanguageVC(tn[0], LANG "TAB_ATTRIBUTES");
LanguageVC(tn[1], LANG "TAB_CBI");
Lith_GUI_Tabs(g, &CBIState(g)->stattab, tn, 13, 13, 1);

switch(CBIState(g)->stattab) {
@@ -60,10 +62,10 @@ static void Lith_CBITab_Info(gui_state_t *g, struct player *p)
extern void Lith_CBITab_Notes (gui_state_t *g, struct player *p);

char tn[4][TABCHARS];
LanguageVC(tn[0], c"LITH_TAB_BIP");
LanguageVC(tn[1], c"LITH_TAB_LOG");
LanguageVC(tn[2], c"LITH_TAB_STATISTICS");
LanguageVC(tn[3], c"LITH_TAB_NOTES");
LanguageVC(tn[0], LANG "TAB_BIP");
LanguageVC(tn[1], LANG "TAB_LOG");
LanguageVC(tn[2], LANG "TAB_STATISTICS");
LanguageVC(tn[3], LANG "TAB_NOTES");
Lith_GUI_Tabs(g, &CBIState(g)->infotab, tn, 13, 13, 1);

switch(CBIState(g)->infotab) {
@@ -74,6 +76,8 @@ static void Lith_CBITab_Info(gui_state_t *g, struct player *p)
}
}

#pragma GDCC STRENT_LITERAL ON

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

__str Lith_ThemeName(uint num)
@@ -90,7 +94,7 @@ void Lith_PlayerUpdateCBIGUI(struct player *p)
{
gui_state_t *g = &p->cbi.guistate;

p->cbi.theme = p->getCVarI("lith_gui_theme");
p->cbi.theme = p->getCVarI(CVAR "gui_theme");

if(p->cbi.theme != p->cbi.oldtheme)
{
@@ -113,13 +117,15 @@ void Lith_PlayerUpdateCBIGUI(struct player *p)
if(Lith_GUI_Button(g, .x = 296, 13, Pre(btnexit)))
p->useGUI(GUI_CBI);

#pragma GDCC STRENT_LITERAL OFF
char tn[5][TABCHARS];
LanguageCV(tn[0], c"LITH_TAB_ARSENAL_%s", p->discrim);
LanguageVC(tn[1], c"LITH_TAB_STATUS");
LanguageVC(tn[2], c"LITH_TAB_INVENTORY");
LanguageVC(tn[3], c"LITH_TAB_INFO");
LanguageVC(tn[4], c"LITH_TAB_SETTINGS");
LanguageCV(tn[0], LANG "TAB_ARSENAL_%s", p->discrim);
LanguageVC(tn[1], LANG "TAB_STATUS");
LanguageVC(tn[2], LANG "TAB_INVENTORY");
LanguageVC(tn[3], LANG "TAB_INFO");
LanguageVC(tn[4], LANG "TAB_SETTINGS");
Lith_GUI_Tabs(g, &CBIState(g)->maintab, tn, 13, 13, 0);
#pragma GDCC STRENT_LITERAL ON

extern void Lith_CBITab_Items (gui_state_t *g, struct player *p);
extern void Lith_CBITab_Settings(gui_state_t *g, struct player *p);
@@ -132,7 +138,7 @@ void Lith_PlayerUpdateCBIGUI(struct player *p)
case cbi_tab_settings: Lith_CBITab_Settings(g, p); break;
}

Lith_GUI_End(g, p->getCVarI("lith_gui_cursor"));
Lith_GUI_End(g, p->getCVarI(CVAR "gui_cursor"));
}

void Lith_PlayerResetCBIGUI(struct player *p)


+ 19
- 14
source/Main/p_data.c View File

@@ -41,13 +41,18 @@ static void SetupAttributes(struct player *p)
static void SetPClass(struct player *p)
{
__with(__str cl = p->pcstr = ACS_GetActorClass(0);) {
if(cl == "Lith_MarinePlayer" ) p->pclass = pcl_marine;
else if(cl == "Lith_CyberMagePlayer") p->pclass = pcl_cybermage;
else if(cl == "Lith_InformantPlayer") p->pclass = pcl_informant;
else if(cl == "Lith_WandererPlayer" ) p->pclass = pcl_wanderer;
else if(cl == "Lith_AssassinPlayer" ) p->pclass = pcl_assassin;
else if(cl == "Lith_DarkLordPlayer" ) p->pclass = pcl_darklord;
else if(cl == "Lith_ThothPlayer" ) p->pclass = pcl_thoth;
#if LITHIUM
if(cl == OBJ "MarinePlayer" ) p->pclass = pcl_marine;
else if(cl == OBJ "CyberMagePlayer") p->pclass = pcl_cybermage;
else if(cl == OBJ "InformantPlayer") p->pclass = pcl_informant;
else if(cl == OBJ "WandererPlayer" ) p->pclass = pcl_wanderer;
else if(cl == OBJ "AssassinPlayer" ) p->pclass = pcl_assassin;
else if(cl == OBJ "DarkLordPlayer" ) p->pclass = pcl_darklord;
else if(cl == OBJ "ThothPlayer" ) p->pclass = pcl_thoth;
#else
if(cl == OBJ "Player")
p->pclass = pcl_marine;
#endif
else for(;;)
{
Log("Invalid player class detected, everything is going to explode!");
@@ -125,7 +130,7 @@ void Lith_PlayerUpdateData(struct player *p)
p->name = StrParam("%tS", p->num);
p->weaponclass = ACS_GetWeapon();

p->scopetoken = InvNum("Lith_WeaponScopedToken");
p->scopetoken = InvNum(OBJ "WeaponScopedToken");

p->krc = InvNum("RedCard") ||
InvNum("ChexRedCard") ||
@@ -198,7 +203,7 @@ void Lith_GiveEXP(struct player *p, u64 amt)
a->level++;
a->expnext = 500 + (a->level * powlk(1.385, a->level * 0.2) * 340);

__with(int pts = 7;) switch(p->getCVarI("lith_player_lvsys"))
__with(int pts = 7;) switch(p->getCVarI(CVAR "player_lvsys"))
{
case atsys_manual: a->points += 7; break;
case atsys_hybrid:
@@ -261,8 +266,8 @@ void Lith_ResetPlayer(struct player *p)

// This keeps spawning more camera actors when you die, but that should be
// OK as long as you don't die 2 billion times.
ACS_SpawnForced("Lith_CameraHax", 0, 0, 0, p->cameratid = ACS_UniqueTID());
ACS_SpawnForced("Lith_CameraHax", 0, 0, 0, p->weathertid = ACS_UniqueTID());
ACS_SpawnForced(OBJ "CameraHax", 0, 0, 0, p->cameratid = ACS_UniqueTID());
ACS_SpawnForced(OBJ "CameraHax", 0, 0, 0, p->weathertid = ACS_UniqueTID());

if(world.dbgScore)
p->score = 0xFFFFFFFFFFFFFFFFll;
@@ -276,7 +281,7 @@ void Lith_ResetPlayer(struct player *p)
// is bad practice
ACS_SetPlayerProperty(0, false, PROP_INSTANTWEAPONSWITCH);
SetPropK(0, APROP_ViewHeight, p->viewheight);
InvTake("Lith_WeaponScopedToken", 999);
InvTake(OBJ "WeaponScopedToken", 999);

Lith_PlayerResetCBIGUI(p);

@@ -312,14 +317,14 @@ void Lith_ResetPlayer(struct player *p)
// Static data
if(!p->wasinit)
{
p->logB(1, "Lithium " Lith_Version " :: Compiled %S", __DATE__);
p->logB(1, Lith_Version " :: Compiled %S", __DATE__);

if(world.dbgLevel) {
p->logH(1, "player is %u bytes long!", sizeof *p * 4);
p->logH(1, "strnull is \"%S\"", null);
PrintDmonAllocSize(p);
} else {
p->logH(1, L("LITH_LOG_StartGame"), "lith_k_opencbi");
p->logH(1, L(LANG "LOG_StartGame"), CVAR "k_opencbi");
}

p->deliverMail("Intro");


+ 5
- 5
source/Main/p_gui_bip.c View File

@@ -35,8 +35,8 @@ void Lith_CBITab_BIP(gui_state_t *g, struct player *p)
bip->lastcategory = BIPC_MAIN;

__str const lines[] = {
L("LITH_BIP_HELP_Search"),
#define LITH_X(name, capt) L("LITH_BIP_HELP_" capt),
L(LANG "BIP_HELP_Search"),
#define LITH_X(name, capt) L(LANG "BIP_HELP_" capt),
#include "lith_bip.h"
};

@@ -46,12 +46,12 @@ void Lith_CBITab_BIP(gui_state_t *g, struct player *p)
PrintTextA("cbifont", CR_WHITE, 105,1, 85+n + i*10,1, 0.7);
}

if(Lith_GUI_Button(g, LC(c"LITH_BIP_NAME_Search"), 45, 85 + n, Pre(btnbipmain)))
#pragma GDCC STRENT_LITERAL OFF
if(Lith_GUI_Button(g, LC(LANG "BIP_NAME_Search"), 45, 85 + n, Pre(btnbipmain)))
bip->curcategory = BIPC_SEARCH;
n += 10;
#pragma GDCC STRENT_LITERAL OFF
#define LITH_X(name, capt) \
if(Lith_GUI_Button_Id(g, BIPC_##name, LC("LITH_BIP_NAME_" capt), 45, 85 + n, Pre(btnbipmain))) \
if(Lith_GUI_Button_Id(g, BIPC_##name, LC(LANG "BIP_NAME_" capt), 45, 85 + n, Pre(btnbipmain))) \
{ \
bip->curcategory = BIPC_##name; \
bip->curpage = null; \


+ 24
- 25
source/Main/p_gui_cbi.c View File

@@ -28,26 +28,26 @@ static void CBITab_Marine(gui_state_t *g, struct player *p)
int ram;
__str name;

Upgr(hasupgr2) {CPU(1); ram = 150; name = L("LITH_CBI_CPU3");}
else Upgr(hasupgr1) {CPU(2); ram = 100; name = L("LITH_CBI_CPU2");}
else {CPU(3); ram = 50; name = L("LITH_CBI_CPU1");}
Upgr(hasupgr2) {CPU(1); ram = 150; name = L(LANG "CBI_CPU3");}
else Upgr(hasupgr1) {CPU(2); ram = 100; name = L(LANG "CBI_CPU2");}
else {CPU(3); ram = 50; name = L(LANG "CBI_CPU1");}

PrintTextStr(name);
PrintText("cbifont", CR_WHITE, 20,1, 60,1);

InfoStart;

Info(L("LITH_CBI_PERF"), world.cbiperf);
Info(L("LITH_CBI_PUSE"), p->cbi.pruse);
Info(L("LITH_CBI_WRAM"), ram);
Info(L(LANG "CBI_PERF"), world.cbiperf);
Info(L(LANG "CBI_PUSE"), p->cbi.pruse);
Info(L(LANG "CBI_WRAM"), ram);

InfoSep;

Info(L("LITH_CBI_INTERFACES"));
Upgr(armorinter) Info("> %S", L("LITH_CBI_ArmorInter"));
Upgr(weapninter) Info("> %S", L("LITH_CBI_WeapnInter"));
Upgr(weapninte2) Info("> %S", L("LITH_CBI_WeapnInte2"));
Upgr(rdistinter) Info("> %S", L("LITH_CBI_RDistInter"));
Info(L(LANG "CBI_INTERFACES"));
Upgr(armorinter) Info("> %S", L(LANG "CBI_ArmorInter"));
Upgr(weapninter) Info("> %S", L(LANG "CBI_WeapnInter"));
Upgr(weapninte2) Info("> %S", L(LANG "CBI_WeapnInte2"));
Upgr(rdistinter) Info("> %S", L(LANG "CBI_RDistInter"));

Upgr(armorinter) Slot("ArmorInter", 0, 1);
Upgr(weapninter) Slot("WeapnInter", 0, 2);
@@ -58,26 +58,26 @@ static void CBITab_Marine(gui_state_t *g, struct player *p)
static void CBITab_CyberMage(gui_state_t *g, struct player *p)
{
CPU(2);
PrintTextStr(L("LITH_CBI_CPU4"));
PrintTextStr(L(LANG "CBI_CPU4"));
PrintText("cbifont", CR_WHITE, 20,1, 60,1);

InfoStart;

Info(L("LITH_CBI_PERF"), 34);
Info(L("LITH_CBI_PUSE"), p->cbi.pruse);
Info(L("LITH_CBI_WRAM"), 19);
Info(L(LANG "CBI_PERF"), 34);
Info(L(LANG "CBI_PUSE"), p->cbi.pruse);
Info(L(LANG "CBI_WRAM"), 19);

InfoSep;

Info(L("LITH_CBI_INTERFACES"));
Info("> %S", L("LITH_CBI_Slot1Spell"));
Info("> %S", L("LITH_CBI_Slot2Spell"));
Upgr(c_slot3spell) Info("> %S", L("LITH_CBI_Slot3Spell"));
Upgr(c_slot4spell) Info("> %S", L("LITH_CBI_Slot4Spell"));
Upgr(c_slot5spell) Info("> %S", L("LITH_CBI_Slot5Spell"));
Upgr(c_slot6spell) Info("> %S", L("LITH_CBI_Slot6Spell"));
Upgr(c_slot7spell) Info("> %S", L("LITH_CBI_Slot7Spell"));
Upgr(c_rdistinter) Info("> %S", L("LITH_CBI_RDistInter"));
Info(L(LANG "CBI_INTERFACES"));
Info("> %S", L(LANG "CBI_Slot1Spell"));
Info("> %S", L(LANG "CBI_Slot2Spell"));
Upgr(c_slot3spell) Info("> %S", L(LANG "CBI_Slot3Spell"));
Upgr(c_slot4spell) Info("> %S", L(LANG "CBI_Slot4Spell"));
Upgr(c_slot5spell) Info("> %S", L(LANG "CBI_Slot5Spell"));
Upgr(c_slot6spell) Info("> %S", L(LANG "CBI_Slot6Spell"));
Upgr(c_slot7spell) Info("> %S", L(LANG "CBI_Slot7Spell"));
Upgr(c_rdistinter) Info("> %S", L(LANG "CBI_RDistInter"));

Slot("Slot1Spell", 0, 1);
Slot("Slot2Spell", 0, 2);
@@ -100,5 +100,4 @@ void Lith_CBITab_CBI(gui_state_t *g, struct player *p)
}
}


// EOF

+ 16
- 10
source/Main/p_gui_upgrades.c View File

@@ -3,10 +3,10 @@
#include "lith_world.h"

static __str const upgrcateg[UC_MAX] = {
[UC_Body] = "LITH_CAT_BODY",
[UC_Weap] = "LITH_CAT_WEAP",
[UC_Extr] = "LITH_CAT_EXTR",
[UC_Down] = "LITH_CAT_DOWN"
[UC_Body] = LANG "CAT_BODY",
[UC_Weap] = LANG "CAT_WEAP",
[UC_Extr] = LANG "CAT_EXTR",
[UC_Down] = LANG "CAT_DOWN"
};

static void GUIUpgradesList(gui_state_t *g, struct player *p)
@@ -73,7 +73,9 @@ static void GUIUpgradesList(gui_state_t *g, struct player *p)
else if(upgr->owned) preset = &guipre.btnlistactive;
else preset = &guipre.btnlistsel;

char *name = LanguageC(c"LITH_UPGRADE_TITLE_%S", upgr->info->name);
#pragma GDCC STRENT_LITERAL OFF
char *name = LanguageC(LANG "UPGRADE_TITLE_%S", upgr->info->name);
#pragma GDCC STRENT_LITERAL ON

int *upgrsel = &CBIState(g)->upgrsel;
if(Lith_GUI_Button_Id(g, i, name, 0, y, i == *upgrsel, .color = color, .preset = preset))
@@ -154,7 +156,7 @@ static void GUIUpgradeDescription(gui_state_t *g, struct player *p, upgrade_t *u
}

if(upgr->info->cost) cost = StrParam("%S%S", scoresep(p->getCost(&upgr->info->shopdef)), mark);
else cost = L("LITH_FREE");
else cost = L(LANG "FREE");

PrintTextStr(cost);
PrintText("cbifont", CR_WHITE, 111,1, 30,1);
@@ -164,8 +166,8 @@ static void GUIUpgradeDescription(gui_state_t *g, struct player *p, upgrade_t *u
PrintText("cbifont", CR_WHITE, 111,1, 40,1);

// Effect
ifauto(__str, effect, LanguageNull("LITH_UPGRADE_EFFEC_%S", upgr->info->name))
PrintTextFmt("%S %S", L("LITH_EFFECT"), effect);
ifauto(__str, effect, LanguageNull(LANG "UPGRADE_EFFEC_%S", upgr->info->name))
PrintTextFmt("%S %S", L(LANG "EFFECT"), effect);

static int const crs[] = {CR_RED, CR_ORANGE, CR_YELLOW, CR_GREEN, CR_BLUE, CR_PURPLE, CR_DARKRED};
PrintText("cbifont",
@@ -176,11 +178,15 @@ static void GUIUpgradeDescription(gui_state_t *g, struct player *p, upgrade_t *u

static void GUIUpgradeButtons(gui_state_t *g, struct player *p, upgrade_t *upgr)
{
if(Lith_GUI_Button(g, LC(c"LITH_BUY"), 111, 205, !p->canBuy(&upgr->info->shopdef, upgr)))
#pragma GDCC STRENT_LITERAL OFF
if(Lith_GUI_Button(g, LC(LANG "BUY"), 111, 205, !p->canBuy(&upgr->info->shopdef, upgr)))
#pragma GDCC STRENT_LITERAL ON
Lith_UpgrBuy(p, upgr, false);

if(Lith_GUI_Button(g, upgr->active ? LC(c"LITH_DEACTIVATE") : LC(c"LITH_ACTIVATE"), 111 + guipre.btndef.w + 2, 205, !upgr->canUse(p)))
#pragma GDCC STRENT_LITERAL OFF
if(Lith_GUI_Button(g, upgr->active ? LC(LANG "DEACTIVATE") : LC(LANG "ACTIVATE"), 111 + guipre.btndef.w + 2, 205, !upgr->canUse(p)))
upgr->toggle(p);
#pragma GDCC STRENT_LITERAL ON
}

void Lith_CBITab_Upgrades(gui_state_t *g, struct player *p)


+ 3
- 3
source/Main/p_hud.c View File

@@ -7,7 +7,7 @@

void Lith_HUD_WeaponSlots_Impl(struct player *p, struct hud_wsl const *a)
{
if(p->getCVarI("lith_hud_showweapons"))
if(p->getCVarI(CVAR "hud_showweapons"))
for(int i = 1; i < SLOT_MAX; i++)
ifauto(int, slot, p->weapon.slot[i])
{
@@ -30,7 +30,7 @@ void Lith_HUD_WeaponSlots_Impl(struct player *p, struct hud_wsl const *a)

void Lith_HUD_Score(struct player *p, __str fmt, i96 scrn, __str font, __str cr, int x, int xa, int y, int ya)
{
if(p->getCVarI("lith_hud_showscore"))
if(p->getCVarI(CVAR "hud_showscore"))
{
__str scr = StrParam(fmt, scoresep(scrn));

@@ -66,7 +66,7 @@ void Lith_HUD_Score(struct player *p, __str fmt, i96 scrn, __str font, __str cr,
}
}

if(p->getCVarI("lith_hud_showlvl"))
if(p->getCVarI(CVAR "hud_showlvl"))
{
PrintTextFmt("\C%SLv.%u", cr, p->attr.level);
if(p->attr.points) __nprintf_str(" (%u pts)", p->attr.points);


+ 6
- 6
source/Main/p_log.c View File

@@ -105,7 +105,7 @@ void Lith_PlayerLogEntry(struct player *p)

p->log.curmap = lm;

p->logF(L("LITH_ENTER_FMT"), lm->name, world.canontime);
p->logF(L(LANG "ENTER_FMT"), lm->name, world.canontime);
}

script ext("ACS")
@@ -113,11 +113,11 @@ void Lith_LogS(int levl, int type)
{
__str name = ServCallS("GetLogName");

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

withplayer(LocalPlayer) switch(type)
{
case msg_ammo: if(p->getCVarI("lith_player_ammolog"))
case msg_ammo: if(p->getCVarI(CVAR "player_ammolog"))
case msg_huds: p->logH(levl, "%S", name); break;
case msg_full: p->logF( "%S", name); break;
case msg_both: p->logB(levl, "%S", name); break;
@@ -176,11 +176,11 @@ void Lith_CBITab_Log(gui_state_t *g, struct player *p)
script
void Lith_HUD_Log(struct player *p, int cr, int x, int yy)
{
if(p->getCVarI("lith_hud_showlog"))
if(p->getCVarI(CVAR "hud_showlog"))
{
int yo;

if(p->getCVarI("lith_hud_logbig")) {yo = 200; SetSize(320, 240);}
if(p->getCVarI(CVAR "hud_logbig")) {yo = 200; SetSize(320, 240);}
else {yo = 255; SetSize(480, 300);}

int i = 0;
@@ -191,7 +191,7 @@ void Lith_HUD_Log(struct player *p, int cr, int x, int yy)
int y = 10 * i;
int ya;

if(p->getCVarI("lith_hud_logfromtop"))
if(p->getCVarI(CVAR "hud_logfromtop"))
{ya = 1; y = 20 + y;}
else
{ya = 2; y = (yo - y) + yy;}


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

@@ -37,9 +37,9 @@ void Lith_Feuer(bool left, bool fire)
{
withplayer(LocalPlayer)
{
__str actor = fire ? "Lith_FeuerExplosion" : "Lith_FeuerTest";
__str actor = fire ? OBJ "FeuerExplosion" : OBJ "FeuerTest";
int pufftid;
ACS_LineAttack(0, p->yaw, p->pitch, 0, "Lith_Dummy", "Lith_NoDamage", 1024, FHF_NORANDOMPUFFZ|FHF_NOIMPACTDECAL, pufftid = ACS_UniqueTID());
ACS_LineAttack(0, p->yaw, p->pitch, 0, OBJ "Dummy", OBJ "NoDamage", 1024, FHF_NORANDOMPUFFZ|FHF_NOIMPACTDECAL, pufftid = ACS_UniqueTID());

int sx = p->x;
int sy = p->y;
@@ -69,7 +69,7 @@ void Lith_Feuer(bool left, bool fire)

if(fire) {
int tid;
ACS_SpawnForced("Lith_FeuerFinal", ex, ey, ez, tid = ACS_UniqueTID());
ACS_SpawnForced(OBJ "FeuerFinal", ex, ey, ez, tid = ACS_UniqueTID());
Lith_SetPointer(tid, AAPTR_DEFAULT, AAPTR_TARGET, p->tid);
}
}
@@ -84,7 +84,7 @@ void Lith_Cercle(void)

__with(int pufftid;)
{
ACS_LineAttack(0, p->yaw, p->pitch, 0, "Lith_Dummy", "Lith_NoDamage", 1024,
ACS_LineAttack(0, p->yaw, p->pitch, 0, OBJ "Dummy", OBJ "NoDamage", 1024,
FHF_NORANDOMPUFFZ|FHF_NOIMPACTDECAL, pufftid = ACS_UniqueTID());

ax = GetX(pufftid);
@@ -104,7 +104,7 @@ void Lith_Cercle(void)
fixed py = ACS_Sin(i / 100.0) * 77;
int tid;

ACS_SpawnForced("Lith_CircleParticle", ax + px, ay + py, az + 7, tid = ACS_UniqueTID());
ACS_SpawnForced(OBJ "CircleParticle", ax + px, ay + py, az + 7, tid = ACS_UniqueTID());

ACS_SetActorAngle(tid, i / 100.0);
Lith_SetPointer(tid, AAPTR_DEFAULT, AAPTR_TARGET, p->tid);
@@ -136,7 +136,7 @@ void Lith_Cercle(void)
fixed py = ACS_Sin(i / 3.0) * 60;
int tid;

ACS_SpawnForced("Lith_CircleSpearThrower", ax + px, ay + py, az + 24, tid = ACS_UniqueTID());
ACS_SpawnForced(OBJ "CircleSpearThrower", ax + px, ay + py, az + 24, tid = ACS_UniqueTID());

ACS_SetActorAngle(tid, i / 3.0);
Lith_SetPointer(tid, AAPTR_DEFAULT, AAPTR_TARGET, p->tid);
@@ -163,7 +163,7 @@ void Lith_MagicSelect(int num)
{
withplayer(LocalPlayer)
{
if(!p->getCVarI("lith_weapons_magicselanims")) return;
if(!p->getCVarI(CVAR "weapons_magicselanims")) return;

switch(num)
{


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

@@ -52,7 +52,7 @@ void Lith_Glare(void)
ACS_FadeTo(255, 255, 255, 1.0, 0.0);

ACS_LocalAmbientSound("player/glare", 127);
ACS_LineAttack(0, p->yaw, p->pitch, 1, "Lith_Dummy", "None",
ACS_LineAttack(0, p->yaw, p->pitch, 1, OBJ "Dummy", "None",
32767.0, FHF_NORANDOMPUFFZ | FHF_NOIMPACTDECAL);

ACS_Delay(14);


+ 8
- 4
source/Main/p_notes.c View File

@@ -8,12 +8,14 @@ void Lith_CBITab_Notes(gui_state_t *g, struct player *p)
{
gui_txtbox_state_t *st = Lith_GUI_TextBox(g, &CBIState(g)->notebox, 48, 40, p);

PrintTextStr(L("LITH_EDIT"));
PrintTextStr(L(LANG "EDIT"));
PrintText("cbifont", CR_WHITE, 32,2, 40,0);
Lith_GUI_BasicCheckbox(g, &CBIState(g)->noteedit, 39, 40);

if(Lith_GUI_Button(g, LC(c"LITH_CLEAR"), 16, 48, Pre(btnclear)))
#pragma GDCC STRENT_LITERAL OFF
if(Lith_GUI_Button(g, LC(LANG "CLEAR"), 16, 48, Pre(btnclear)))
Lith_GUI_TextBox_Reset(st);
#pragma GDCC STRENT_LITERAL ON

Lith_GUI_ScrollBegin(g, &CBIState(g)->notescr, 15, 63, 280, 160, 30 * countof(p->notes), 240);

@@ -22,11 +24,13 @@ void Lith_CBITab_Notes(gui_state_t *g, struct player *p)
if(Lith_GUI_ScrollOcclude(g, &CBIState(g)->notescr, i * 30, 30))
continue;

PrintTextFmt(L("LITH_NOTE_FMT"), i + 1);
PrintTextFmt(L(LANG "NOTE_FMT"), i + 1);
PrintText("cbifont", CR_WHITE, 32+g->ox,2, i * 30 + g->oy,1);

if(Lith_GUI_Button_Id(g, i, p->notes[i] ? p->notes[i] : LC(c"LITH_EMPTY"),
#pragma GDCC STRENT_LITERAL OFF
if(Lith_GUI_Button_Id(g, i, p->notes[i] ? p->notes[i] : LC(LANG "EMPTY"),
37, i * 30, .disabled = !CBIState(g)->noteedit, Pre(btnnote)))
#pragma GDCC STRENT_LITERAL ON
{
int l = CBIState(g)->notebox.tbptr;
char const *s = Lith_CPS_Print(CBIState(g)->notebox.txtbuf, l);


+ 8
- 8
source/Main/p_obituary.c View File

@@ -19,14 +19,14 @@ void Lith_Obituary(void)

int rn = ACS_Random(1, 5);

if(obit == "(falling)") obit = Language("LITH_OB_Falling_%i", rn);
else if(obit == "(crush)") obit = Language("LITH_OB_Crush_%i", rn);
else if(obit == "(exit)") obit = Language("LITH_OB_Exit_%i", rn);
else if(obit == "(drowning)") obit = Language("LITH_OB_Drowning_%i", rn);
else if(obit == "(slime)") obit = Language("LITH_OB_Slime_%i", rn);
else if(obit == "(fire)") obit = Language("LITH_OB_Fire_%i", rn);
else if(obit == "(suicide)") obit = Language("LITH_OB_Suicide_%i", rn);
else if(obit == "(default)") obit = Language("LITH_OB_Default_%i", rn);
if(obit == "(falling)") obit = Language(LANG "OB_Falling_%i", rn);
else if(obit == "(crush)") obit = Language(LANG "OB_Crush_%i", rn);
else if(obit == "(exit)") obit = Language(LANG "OB_Exit_%i", rn);
else if(obit == "(drowning)") obit = Language(LANG "OB_Drowning_%i", rn);
else if(obit == "(slime)") obit = Language(LANG "OB_Slime_%i", rn);
else if(obit == "(fire)") obit = Language(LANG "OB_Fire_%i", rn);
else if(obit == "(suicide)") obit = Language(LANG "OB_Suicide_%i", rn);
else if(obit == "(default)") obit = Language(LANG "OB_Default_%i", rn);

ACS_BeginPrint();



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

@@ -78,7 +78,7 @@ void Lith_PlayerPayout(struct player *p)
Left("Primary Account"); Right("%STRANSACTION CLOSED", (i % 6) == 0 ? "\Cn" : "");
}

if(p->getCVarI("lith_player_resultssound"))
if(p->getCVarI(CVAR "player_resultssound"))
{
if(counting) {
if(i < 35) ACS_LocalAmbientSound("player/counter", 80);


+ 13
- 13
source/Main/p_pickups.c View File

@@ -2,7 +2,7 @@
#include "lith_common.h"
#include "lith_player.h"

#define name(n) "LITH_PK_" #n
#define name(n) LANG "PK_" #n

#define StupidName(w) \
Language("%S_%.3i", pickupnames[w], \
@@ -34,21 +34,21 @@ static __str const pickupnames[weapon_max] = {

static void Lith_StupidPickup(struct player *p, int weapon)
{
int fmtnum = strtoi_str(L("LITH_PK_GET_NUM"), null, 10);
int uncnum = strtoi_str(L("LITH_PK_UNCERTAIN_NUM"), null, 10);
int fmtnum = strtoi_str(L(LANG "PK_GET_NUM"), null, 10);
int uncnum = strtoi_str(L(LANG "PK_UNCERTAIN_NUM"), null, 10);

int iunc = ACS_Random(0, uncnum);
int ifmt = ACS_Random(0, fmtnum);
int flag = strtoi_str(Language("LITH_PK_GET_%.3i_FLAGS", ifmt), null, 0);
int flag = strtoi_str(Language(LANG "PK_GET_%.3i_FLAGS", ifmt), null, 0);

if(flag & 2) {
ifmt = ACS_Random(0, fmtnum);
flag = strtoi_str(Language("LITH_PK_GET_%.3i_FLAGS", ifmt), null, 0);
flag = strtoi_str(Language(LANG "PK_GET_%.3i_FLAGS", ifmt), null, 0);
}

__str nam = StupidName(weapon);
__str fmt = Language("LITH_PK_GET_%.3i", ifmt);
__str unc = Language("LITH_PK_UNCERTAIN_%.3i", iunc);
__str fmt = Language(LANG "PK_GET_%.3i", ifmt);
__str unc = Language(LANG "PK_UNCERTAIN_%.3i", iunc);

if(flag & 1 && flag & 4) p->logB(1, fmt, nam, nam, unc);
else if(flag & 1 ) p->logB(1, fmt, nam, nam);
@@ -58,10 +58,10 @@ static void Lith_StupidPickup(struct player *p, int weapon)

void Lith_PickupMessage(struct player *p, weaponinfo_t const *info)
{
if(p->getCVarI("lith_player_stupidpickups"))
if(p->getCVarI(CVAR "player_stupidpickups"))
Lith_StupidPickup(p, info->type);
else if(info->name)
p->logB(1, L("LITH_PK_GET_000"), Language("LITH_INFO_SHORT_%S", info->name));
p->logB(1, L(LANG "PK_GET_000"), Language(LANG "INFO_SHORT_%S", info->name));
else
p->logB(1, "Acquired impossible object");
}
@@ -69,16 +69,16 @@ void Lith_PickupMessage(struct player *p, weaponinfo_t const *info)
void Lith_SellMessage(struct player *p, weaponinfo_t const *info, i96 score)
{
int weapon = info->type;
bool ord = strtoi_str(L("LITH_LOG_SellOrder"), null, 10) == 0;
bool ord = strtoi_str(L(LANG "LOG_SellOrder"), null, 10) == 0;

__str nam;

if(p->getCVarI("lith_player_stupidpickups"))
if(p->getCVarI(CVAR "player_stupidpickups"))
nam = StupidName(weapon);
else
nam = Language("LITH_INFO_SHORT_%S", info->name);
nam = Language(LANG "INFO_SHORT_%S", info->name);

__str msg = L("LITH_LOG_Sell");
__str msg = L(LANG "LOG_Sell");

if(ord) p->logB(1, msg, nam, score);
else p->logB(1, msg, score, nam);


+ 8
- 8
source/Main/p_player.c View File

@@ -119,20 +119,20 @@ static void Lith_PlayerDeath(void)

if(world.singleplayer)
{
if(ACS_GetCVar("lith_sv_revenge"))
if(ACS_GetCVar(CVAR "sv_revenge"))
{
ACS_LocalAmbientSound("player/death1", 127);
ACS_Delay(35);
InvGive("Lith_PlayerDeath", 1);
InvGive(OBJ "PlayerDeath", 1);
ACS_Delay(25);
InvGive("Lith_PlayerDeathNuke", 1);
InvGive(OBJ "PlayerDeathNuke", 1);
ACS_Delay(25);
}

while(p->dead)
{
ACS_Delay(35 * 5);
Log("%S", Language("LITH_DEATHMSG_%.2i", ACS_Random(1, 20)));
Log("%S", Language(LANG "DEATHMSG_%.2i", ACS_Random(1, 20)));
}
}
}
@@ -281,7 +281,7 @@ i96 Lith_GiveScore(struct player *p, i96 score, bool nomul)
fixed64 vol = 0.7lk * mul;

// Play a sound when we pick up score
if(vol > 0.001lk && p->getCVarI("lith_player_scoresound"))
if(vol > 0.001lk && p->getCVarI(CVAR "player_scoresound"))
ACS_PlaySound(p->cameratid, "player/score", CHAN_ITEM, vol, false, ATTN_STATIC);

// hue
@@ -292,7 +292,7 @@ i96 Lith_GiveScore(struct player *p, i96 score, bool nomul)

if(p->getUpgrActive(UPGR_TorgueMode) && ACS_Random(0, 10) == 0) {
p->spuriousexplosions++;
ACS_SpawnForced("Lith_EXPLOOOSION", p->x, p->y, p->z);
ACS_SpawnForced(OBJ "EXPLOOOSION", p->x, p->y, p->z);
}

// Add score and set score accumulator
@@ -302,7 +302,7 @@ i96 Lith_GiveScore(struct player *p, i96 score, bool nomul)
p->scoreaccumtime += 20 * (mul * 2.0lk);

// Log score
if(p->getCVarI("lith_player_scorelog"))
if(p->getCVarI(CVAR "player_scorelog"))
p->logH(1, "+\Cj%lli\Cnscr", score);

return score;
@@ -331,7 +331,7 @@ static void Lith_BossWarning(struct player *p)
ACS_Delay(35 * 5);

if(world.bossspawned)
p->logB(1, "%S", Language("LITH_LOG_BossWarn%s", p->discrim));
p->logB(1, "%S", Language(LANG "LOG_BossWarn%s", p->discrim));
}

// Run main loop scripts.


+ 6
- 6
source/Main/p_render.c View File

@@ -61,7 +61,7 @@ void Lith_PlayerFootstep(struct player *p)
if(p->nextstep) {p->nextstep--; return;}

fixed dstmul = absk(p->getVel()) / 24.0;
fixed vol = p->getCVarK("lith_player_footstepvol") * min(dstmul, 1);
fixed vol = p->getCVarK(CVAR "player_footstepvol") * min(dstmul, 1);

__str floor = ACS_GetActorFloorTexture(0);
__str snd = p->stepnoise;
@@ -123,9 +123,9 @@ void Lith_PlayerView(struct player *p)

fixed64 addp = 0, addy = 0;

if(p->getCVarI("lith_player_damagebob"))
if(p->getCVarI(CVAR "player_damagebob"))
{
fixed64 bobmul = p->getCVarK("lith_player_damagebobmul");
fixed64 bobmul = p->getCVarK(CVAR "player_damagebobmul");
addp += p->bobpitch * bobmul;
addy += p->bobyaw * bobmul;
}
@@ -136,7 +136,7 @@ void Lith_PlayerView(struct player *p)
p->addpitch = addp + p->extrpitch;
p->addyaw = addy + p->extryaw;

ifauto(fixed, mul, p->getCVarK("lith_player_viewtilt") * 0.2)
ifauto(fixed, mul, p->getCVarK(CVAR "player_viewtilt") * 0.2)
{
if(p->sidev ) p->addroll = lerplk(p->addroll, -p->sidev * mul, 0.10);
else if(p->addroll) p->addroll = lerplk(p->addroll, 0, 0.14);
@@ -155,10 +155,10 @@ void Lith_PlayerStyle(struct player *p)
{
if(p->scopetoken) {
SetPropI(0, APROP_RenderStyle, STYLE_Subtract);
SetPropK(0, APROP_Alpha, p->getCVarK("lith_weapons_scopealpha") * p->alpha);
SetPropK(0, APROP_Alpha, p->getCVarK(CVAR "weapons_scopealpha") * p->alpha);
} else {
SetPropI(0, APROP_RenderStyle, STYLE_Translucent);
SetPropK(0, APROP_Alpha, p->getCVarK("lith_weapons_alpha") * p->alpha);
SetPropK(0, APROP_Alpha, p->getCVarK(CVAR "weapons_alpha") * p->alpha);
}
}



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

@@ -20,7 +20,7 @@ savefile_t *Lith_SaveBegin(struct player *p)
{
savefile_t *save = Salloc(savefile_t);

if((save->fp = Lith_NFOpen(p->num, "lith_psave", 'w')))
if((save->fp = Lith_NFOpen(p->num, CVAR "psave", 'w')))
{
save->p = p;
Lith_SaveWriteChunk(save, Ident_Lith, SaveV_Lith, 0);
@@ -78,7 +78,7 @@ savefile_t *Lith_LoadBegin(struct player *p)
{
savefile_t *save = Salloc(savefile_t);

if((save->fp = Lith_NFOpen(p->num, "lith_psave", 'r')))
if((save->fp = Lith_NFOpen(p->num, CVAR "psave", 'r')))
{
save->p = p;



+ 67
- 67
source/Main/p_settings.c View File

@@ -1,100 +1,100 @@
// Copyright © 2016-2017 Alison Sanderson, all rights reserved.
#ifdef FromUI
Category("Gameplay");
Enum("Level-up system", "lith_player_lvsys", atsys_auto, atsys_manual, "%S", LvSysName(set));
Enum("Level-up system", CVAR "player_lvsys", atsys_auto, atsys_manual, "%S", LvSysName(set));
if(p->num == 0) {
ServerInt("Difficulty Base", c"%", "lith_sv_difficulty", 1, 100);
ServerFloat("Score multiplier", c"x", "lith_sv_scoremul", 0, 10);
ServerBool("Explode on death", "lith_sv_revenge");
ServerInt("Autosave Interval", c"min", "lith_sv_autosave", 0, 30);
ServerBool("Disable phantoms", "lith_sv_nobosses");
ServerBool("Don't pick up ammo when full", "lith_sv_nofullammo");
ServerBool("Don't give score when picking up ammo", "lith_sv_noscoreammo");
ServerBool("Drop shotguns from zombies", "lith_sv_wepdrop");
ServerBool("Pause while in menu", "lith_sv_pauseinmenus");
ServerInt("Difficulty Base", c"%", CVAR "sv_difficulty", 1, 100);
ServerFloat("Score multiplier", c"x", CVAR "sv_scoremul", 0, 10);
ServerBool("Explode on death", CVAR "sv_revenge");
ServerInt("Autosave Interval", c"min", CVAR "sv_autosave", 0, 30);
ServerBool("Disable phantoms", CVAR "sv_nobosses");
ServerBool("Don't pick up ammo when full", CVAR "sv_nofullammo");
ServerBool("Don't give score when picking up ammo", CVAR "sv_noscoreammo");
ServerBool("Drop shotguns from zombies", CVAR "sv_wepdrop");
ServerBool("Pause while in menu", CVAR "sv_pauseinmenus");
}

Category("GUI");
Float("Horizontal cursor speed", c"x", "lith_gui_xmul", 0.1, 2.0);
Float("Vertical cursor speed", c"x", "lith_gui_ymul", 0.1, 2.0);
Enum("Color theme", "lith_gui_theme", 0, cbi_theme_max-1, "%S", Lith_ThemeName(set));
Enum("Cursor", "lith_gui_cursor", 0, gui_curs_max-1, "%S", CursName(set));
Enum("Japanese font", "lith_gui_jpfont", 0, font_num-1, "%S", FontName(set));
Float("Horizontal cursor speed", c"x", CVAR "gui_xmul", 0.1, 2.0);
Float("Vertical cursor speed", c"x", CVAR "gui_ymul", 0.1, 2.0);
Enum("Color theme", CVAR "gui_theme", 0, cbi_theme_max-1, "%S", Lith_ThemeName(set));
Enum("Cursor", CVAR "gui_cursor", 0, gui_curs_max-1, "%S", CursName(set));
Enum("Japanese font", CVAR "gui_jpfont", 0, font_num-1, "%S", FontName(set));
Text("To use Japanese language, type \"language jp\" into the console.");

Category("Player");
Float("Damage bob multiplier", c"x", "lith_player_damagebobmul", 0.0, 1.0);
Bool("Bob view when damaged", "lith_player_damagebob");
Float("Footstep volume", c"x", "lith_player_footstepvol", 0.0, 1.0);
Float("View tilt", c"x", "lith_player_viewtilt", 0.0, 1.0);
Bool("Log score gained", "lith_player_scorelog");
Bool("Play a sound when score is gained", "lith_player_scoresound");
Bool("Play sounds on the results screen", "lith_player_resultssound");
Bool("Invert mouse in netgames (hack)", "lith_player_invertmouse");
Bool("Enable rain shader", "lith_player_rainshader");
Bool("Alternate invulnerability palette", "lith_player_altinvuln");
Float("Damage bob multiplier", c"x", CVAR "player_damagebobmul", 0.0, 1.0);
Bool("Bob view when damaged", CVAR "player_damagebob");
Float("Footstep volume", c"x", CVAR "player_footstepvol", 0.0, 1.0);
Float("View tilt", c"x", CVAR "player_viewtilt", 0.0, 1.0);
Bool("Log score gained", CVAR "player_scorelog");
Bool("Play a sound when score is gained", CVAR "player_scoresound");
Bool("Play sounds on the results screen", CVAR "player_resultssound");
Bool("Invert mouse in netgames (hack)", CVAR "player_invertmouse");
Bool("Enable rain shader", CVAR "player_rainshader");
Bool("Alternate invulnerability palette", CVAR "player_altinvuln");

Category("Items");
Bool("Teleport in bought items and upgrades", "lith_player_teleshop");
Bool("Stupid pickup messages", "lith_player_stupidpickups");
Bool("Log ammo pickups", "lith_player_ammolog");
Bool("Teleport in bought items and upgrades", CVAR "player_teleshop");
Bool("Stupid pickup messages", CVAR "player_stupidpickups");
Bool("Log ammo pickups", CVAR "player_ammolog");
if(p->num == 0) {
ServerBool("Bright weapon pickups", "lith_player_brightweps");
ServerBool("No item effects", "lith_player_noitemfx");
ServerBool("Bright weapon pickups", CVAR "player_brightweps");
ServerBool("No item effects", CVAR "player_noitemfx");
}

Category("Weapons");
Float("Scope zoom factor", c"x", "lith_weapons_zoomfactor", 1.0, 10.0);
Float("Scope opacity", c"x", "lith_weapons_scopealpha", 0.0, 1.0);
Float("Weapon opacity", c"x", "lith_weapons_alpha", 0.0, 1.0);
Float("Recoil amount", c"x", "lith_weapons_recoil", 0.0, 1.0);
Float("Reload bob", c"x", "lith_weapons_reloadbob", 0.0, 1.0);
Bool("Slot 3 weapons take ammo", "lith_weapons_slot3ammo");
Float("Scope zoom factor", c"x", CVAR "weapons_zoomfactor", 1.0, 10.0);
Float("Scope opacity", c"x", CVAR "weapons_scopealpha", 0.0, 1.0);
Float("Weapon opacity", c"x", CVAR "weapons_alpha", 0.0, 1.0);
Float("Recoil amount", c"x", CVAR "weapons_recoil", 0.0, 1.0);
Float("Reload bob", c"x", CVAR "weapons_reloadbob", 0.0, 1.0);
Bool("Slot 3 weapons take ammo", CVAR "weapons_slot3ammo");
if(p->pclass == pcl_marine) {
Bool("Modal Rifle scope", "lith_weapons_riflescope");
Bool("Clear rifle mode on switch", "lith_weapons_riflemodeclear");
Bool("Modal Rifle scope", CVAR "weapons_riflescope");
Bool("Clear rifle mode on switch", CVAR "weapons_riflemodeclear");
} else if(p->pclass == pcl_cybermage) {
Bool("Magic selection animations", "lith_weapons_magicselanims");
Bool("Magic selection animations", CVAR "weapons_magicselanims");
}
if(p->num == 0) {
ServerBool("Emit casings from weapons", "lith_weapons_casings");
ServerBool("Drop magazines from weapons", "lith_weapons_magdrops");
ServerBool("Casings fade out", "lith_weapons_casingfadeout");
ServerBool("Magazines fade out", "lith_weapons_magfadeout");
ServerBool("Emit casings from weapons", CVAR "weapons_casings");
ServerBool("Drop magazines from weapons", CVAR "weapons_magdrops");
ServerBool("Casings fade out", CVAR "weapons_casingfadeout");
ServerBool("Magazines fade out", CVAR "weapons_magfadeout");
if(p->pclass == pcl_marine) {
ServerBool("Rainbow lasers", "lith_weapons_rainbowlaser");
ServerBool("Rainbow lasers", CVAR "weapons_rainbowlaser");
}
}

Category("Heads Up Display");
Bool("Show score", "lith_hud_showscore");
Bool("Show level", "lith_hud_showlvl");
Bool("Show weapons", "lith_hud_showweapons");
Bool("Show log", "lith_hud_showlog");
Bool("Draw log from top of screen", "lith_hud_logfromtop");
Bool("Large log", "lith_hud_logbig");
Bool("Draw reactive armor indicator", "lith_hud_showarmorind");
Int("Crosshair red", c"/255", "lith_xhair_r", 0, 255);
Int("Crosshair green", c"/255", "lith_xhair_g", 0, 255);
Int("Crosshair blue", c"/255", "lith_xhair_b", 0, 255);
Int("Crosshair alpha", c"/255", "lith_xhair_a", 0, 255);
Enum("Crosshair style", "lith_xhair_style", 1, 10, "%S", XHairName(set));
Bool("Crosshair enabled", "lith_xhair_enable");
Bool("Crosshair juicer enabled", "lith_xhair_enablejuicer");
Bool("Show score", CVAR "hud_showscore");
Bool("Show level", CVAR "hud_showlvl");
Bool("Show weapons", CVAR "hud_showweapons");
Bool("Show log", CVAR "hud_showlog");
Bool("Draw log from top of screen", CVAR "hud_logfromtop");
Bool("Large log", CVAR "hud_logbig");
Bool("Draw reactive armor indicator", CVAR "hud_showarmorind");
Int("Crosshair red", c"/255", CVAR "xhair_r", 0, 255);
Int("Crosshair green", c"/255", CVAR "xhair_g", 0, 255);
Int("Crosshair blue", c"/255", CVAR "xhair_b", 0, 255);
Int("Crosshair alpha", c"/255", CVAR "xhair_a", 0, 255);
Enum("Crosshair style", CVAR "xhair_style", 1, 10, "%S", XHairName(set));
Bool("Crosshair enabled", CVAR "xhair_enable");
Bool("Crosshair juicer enabled", CVAR "xhair_enablejuicer");

Category("Vital Scanner");
Int("X offset", c"px", "lith_scanner_xoffs", -160, 160);
Int("Y offset", c"px", "lith_scanner_yoffs", -180, 20);
Enum("Color", "lith_scanner_color", 'a', 'v', "\C%c%S", set, ColorName(set));
Bool("Slide to target", "lith_scanner_slide");
Bool("Health bar", "lith_scanner_bar");
Bool("Alternate font", "lith_scanner_altfont");
Int("X offset", c"px", CVAR "scanner_xoffs", -160, 160);
Int("Y offset", c"px", CVAR "scanner_yoffs", -180, 20);
Enum("Color", CVAR "scanner_color", 'a', 'v', "\C%c%S", set, ColorName(set));
Bool("Slide to target", CVAR "scanner_slide");
Bool("Health bar", CVAR "scanner_bar");
Bool("Alternate font", CVAR "scanner_altfont");

if(p->num == 0) {
Category("World");
ServerBool("Rain in outside areas", "lith_sv_rain");
ServerBool("Replace skies", "lith_sv_sky");
ServerBool("Rain in outside areas", CVAR "sv_rain");
ServerBool("Replace skies", CVAR "sv_sky");
}

#undef Category


+ 15
- 13
source/Main/p_shop.c View File

@@ -21,15 +21,15 @@ typedef struct shopitem_s

static shopitem_t shopitems[] = {
// {{"Name-----------", "BIP------------", Cost---}, Class, Cnt-, "Class---------------", [Flags]},
{{"RocketAmmo", null, 9000}, gA, 5, "Lith_RocketAmmo"},
{{"PlasmaAmmo", null, 75750}, gA, 1000, "Lith_PlasmaAmmo"},
{{"RocketAmmo", null, 9000}, gA, 5, OBJ "RocketAmmo"},
{{"PlasmaAmmo", null, 75750}, gA, 1000, OBJ "PlasmaAmmo"},

{{"ChargeFist", "ChargeFist", 100000}, pM, 1, "Lith_ChargeFist", sif_weapon},
{{"Revolver", "Revolver", 500000}, pM, 1, "Lith_Revolver", sif_weapon},
{{"LazShotgun", "LazShotgun", 1800000}, pM, 1, "Lith_LazShotgun", sif_weapon},
{{"SniperRifle", "SniperRifle", 1800000}, pM, 1, "Lith_SniperRifle", sif_weapon},
{{"MissileLauncher", "MissileLauncher", 2500000}, gO, 1, "Lith_MissileLauncher", sif_weapon},
{{"PlasmaDiffuser", "PlasmaDiffuser", 2500000}, gO, 1, "Lith_PlasmaDiffuser", sif_weapon},
{{"ChargeFist", "ChargeFist", 100000}, pM, 1, OBJ "ChargeFist", sif_weapon},
{{"Revolver", "Revolver", 500000}, pM, 1, OBJ "Revolver", sif_weapon},
{{"LazShotgun", "LazShotgun", 1800000}, pM, 1, OBJ "LazShotgun", sif_weapon},
{{"SniperRifle", "SniperRifle", 1800000}, pM, 1, OBJ "SniperRifle", sif_weapon},
{{"MissileLauncher", "MissileLauncher", 2500000}, gO, 1, OBJ "MissileLauncher", sif_weapon},
{{"PlasmaDiffuser", "PlasmaDiffuser", 2500000}, gO, 1, OBJ "PlasmaDiffuser", sif_weapon},

{{"Allmap", null, 100000}, gA, 1, "Allmap"},
{{"Infrared", null, 70000}, gA, 1, "Infrared"},
@@ -94,7 +94,7 @@ void Lith_CBITab_Shop(gui_state_t *g, struct player *p)
if(Lith_GUI_ScrollOcclude(g, &CBIState(g)->shopscr, y, guipre.btnlistsel.h) || !(shopitems[i].pclass & p->pclass))
continue;

char *name = LanguageC(name, "LITH_SHOP_TITLE_%S", shopitems[i].name);
char *name = LanguageC(name, LANG "SHOP_TITLE_%S", shopitems[i].name);

int *shopsel = &CBIState(g)->shopsel;
if(Lith_GUI_Button_Id(g, i, name, 0, y, i == *shopsel, Pre(btnlistsel)))
@@ -109,16 +109,18 @@ void Lith_CBITab_Shop(gui_state_t *g, struct player *p)

SetClipW(111, 30, 184, 150, 184);

PrintTextFmt("%LS %S\Cnscr", "LITH_COST", scoresep(p->getCost(&item->shopdef)));
PrintTextFmt("%LS %S\Cnscr", LANG "COST", scoresep(p->getCost(&item->shopdef)));
PrintText("cbifont", CR_WHITE, 111,1, 30,1);

PrintTextStr(Language("LITH_SHOP_DESCR_%S", item->name));
PrintTextStr(Language(LANG "SHOP_DESCR_%S", item->name));
PrintText("cbifont", CR_WHITE, 111,1, 40,1);

ClearClip();

if(Lith_GUI_Button(g, LC(c"LITH_BUY"), 259, 170, !p->canBuy(&item->shopdef, item)))
p->buy(&item->shopdef, item, "LITH_SHOP_TITLE_%S", false);
#pragma GDCC STRENT_LITERAL OFF
if(Lith_GUI_Button(g, LC(LANG "BUY"), 259, 170, !p->canBuy(&item->shopdef, item)))
#pragma GDCC STRENT_LITERAL ON
p->buy(&item->shopdef, item, LANG "SHOP_TITLE_%S", false);
}

// EOF


+ 3
- 3
source/Main/p_shopdef.c View File

@@ -35,18 +35,18 @@ bool Lith_ShopBuy(struct player *p, shopdef_t const *def, void *obj, __str namef

bool delivered = false;

if(!nodelivery && p->getCVarI("lith_player_teleshop"))
if(!nodelivery && p->getCVarI(CVAR "player_teleshop"))
{
int pufftid;
int tid;

ACS_LineAttack(0, p->yaw, p->pitch, 0, "Lith_Dummy", "Lith_NoDamage", 128.0, FHF_NORANDOMPUFFZ | FHF_NOIMPACTDECAL, pufftid = ACS_UniqueTID());
ACS_LineAttack(0, p->yaw, p->pitch, 0, OBJ "Dummy", OBJ "NoDamage", 128.0, FHF_NORANDOMPUFFZ | FHF_NOIMPACTDECAL, pufftid = ACS_UniqueTID());

fixed x = GetX(pufftid);
fixed y = GetY(pufftid);
fixed z = GetZ(pufftid);

if((x || y || z) && ACS_Spawn("Lith_BoughtItem", x, y, z, tid = ACS_UniqueTID()))
if((x || y || z) && ACS_Spawn(OBJ "BoughtItem", x, y, z, tid = ACS_UniqueTID()))
{
if(def->shopGive(p, def, obj, tid))
p->logH(1, "\CjItem delivered.");


+ 15
- 15
source/Main/p_statistics.c View File

@@ -16,21 +16,21 @@ void Lith_CBITab_Statistics(gui_state_t *g, struct player *p)
PrintTextStr(p->name);
PrintText("SMALLFNT", CR_LIGHTBLUE, 20,1, 40,1);

Stat(L("LITH_STAT_ScoreMul"), "%i%%", ceilk(p->scoremul * 100.0));
Stat(L("LITH_STAT_Weapons"), "%i", p->weaponsheld);
Stat(L("LITH_STAT_HealthUsed"), "%u", p->healthused);
Stat(L("LITH_STAT_HealthSum"), "%u", p->healthsum);
Stat(L("LITH_STAT_ScoreUsed"), "%lli", p->scoreused);
Stat(L("LITH_STAT_ScoreSum"), "%lli", p->scoresum);
Stat(L("LITH_STAT_Secrets"), "%i", world.secretsfound);
Stat(L("LITH_STAT_Units"), "%imu", p->unitstravelled);
Stat(L("LITH_STAT_Upgrades"), "%i", p->upgradesowned);
Stat(L("LITH_STAT_Items"), "%i", p->itemsbought);
Stat(L("LITH_STAT_Mail"), "%i", p->bip.mailreceived);
Stat(L("LITH_STAT_Time"), "%li", p->ticks / 35l);
Stat(L("LITH_STAT_Boom"), "%i", p->spuriousexplosions);
Stat(L("LITH_STAT_Brouzouf"), "%i", p->brouzouf);
Stat(L("LITH_STAT_TrueMail"), "%i", p->bip.mailtrulyreceived);
Stat(L(LANG "STAT_ScoreMul"), "%i%%", ceilk(p->scoremul * 100.0));
Stat(L(LANG "STAT_Weapons"), "%i", p->weaponsheld);
Stat(L(LANG "STAT_HealthUsed"), "%u", p->healthused);
Stat(L(LANG "STAT_HealthSum"), "%u", p->healthsum);
Stat(L(LANG "STAT_ScoreUsed"), "%lli", p->scoreused);
Stat(L(LANG "STAT_ScoreSum"), "%lli", p->scoresum);
Stat(L(LANG "STAT_Secrets"), "%i", world.secretsfound);
Stat(L(LANG "STAT_Units"), "%imu", p->unitstravelled);
Stat(L(LANG "STAT_Upgrades"), "%i", p->upgradesowned);
Stat(L(LANG "STAT_Items"), "%i", p->itemsbought);
Stat(L(LANG "STAT_Mail"), "%i", p->bip.mailreceived);
Stat(L(LANG "STAT_Time"), "%li", p->ticks / 35l);
Stat(L(LANG "STAT_Boom"), "%i", p->spuriousexplosions);
Stat(L(LANG "STAT_Brouzouf"), "%i", p->brouzouf);
Stat(L(LANG "STAT_TrueMail"), "%i", p->bip.mailtrulyreceived);

#undef Stat
}


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

@@ -39,7 +39,7 @@ static void DrawAttr(gui_state_t *g, int x, int y, struct player *p, int at)
helptrns += 0.3;
}

PrintTextStr(Language("LITH_ATTR_HELP_%s", name));
PrintTextStr(Language(LANG "ATTR_HELP_%s", name));
PrintTextA("chfont", CR_WHITE, x+1,1, y+1,1, helptrns);

PrintTextFmt("%u/%i", attr, ATTR_VIS_MAX);


+ 10
- 9
source/Main/p_weaponinfo.c View File

@@ -7,9 +7,10 @@

#define Placeholder1 "MMMMHMHMMMHMMM"
#define Placeholder2 "YOUSONOFABITCH"
#define A(a) "Lith_" a "Ammo"
#define A(a) OBJ a "Ammo"
#define O(a) OBJ a
#define P(a) "weapons/" a "/pickup"
#define N(a) .classname = "Lith_" a, .name = a
#define N(a) .classname = OBJ a, .name = a
#define F(...) .flags = __VA_ARGS__
weaponinfo_t const weaponinfo[weapon_max] = {
{0, pcl_any, null, "MMMMHMHMMMHMMM"},
@@ -36,13 +37,13 @@ weaponinfo_t const weaponinfo[weapon_max] = {
{5, pcl_cybermage, N("IonRifle"), P("ionrifle"), AT_AMag, A("Rocket")},
{6, pcl_cybermage, N("CPlasmaRifle"), P("plasma"), AT_Ammo, A("Plasma")},
{7, pcl_cybermage, N("StarDestroyer"), P("shipgun"), AT_Ammo, A("Cannon")},
{0, pcl_cybermage, N("Blade"), Placeholder1, AT_Ammo, "Lith_Mana", F(wf_magic)},
{0, pcl_cybermage, N("Delear"), Placeholder1, AT_AMag, "Lith_Mana", F(wf_magic)},
{0, pcl_cybermage, N("Feuer"), Placeholder1, AT_Ammo, "Lith_Mana", F(wf_magic)},
{0, pcl_cybermage, N("Rend"), Placeholder1, AT_Ammo, "Lith_Mana", F(wf_magic)},
{0, pcl_cybermage, N("Hulgyon"), Placeholder1, AT_Ammo, "Lith_Mana", F(wf_magic)},
{0, pcl_cybermage, N("StarShot"), Placeholder1, AT_AMag, "Lith_Mana", F(wf_magic)},
{0, pcl_cybermage, N("Cercle"), Placeholder1, AT_Ammo, "Lith_Mana", F(wf_magic)},
{0, pcl_cybermage, N("Blade"), Placeholder1, AT_Ammo, O("Mana"), F(wf_magic)},
{0, pcl_cybermage, N("Delear"), Placeholder1, AT_AMag, O("Mana"), F(wf_magic)},
{0, pcl_cybermage, N("Feuer"), Placeholder1, AT_Ammo, O("Mana"), F(wf_magic)},
{0, pcl_cybermage, N("Rend"), Placeholder1, AT_Ammo, O("Mana"), F(wf_magic)},
{0, pcl_cybermage, N("Hulgyon"), Placeholder1, AT_Ammo, O("Mana"), F(wf_magic)},
{0, pcl_cybermage, N("StarShot"), Placeholder1, AT_AMag, O("Mana"), F(wf_magic)},
{0, pcl_cybermage, N("Cercle"), Placeholder1, AT_Ammo, O("Mana"), F(wf_magic)},
{2, pcl_darklord, N("700Express"), Placeholder2, AT_NMag},
{3, pcl_darklord, N("4Bore"), Placeholder2, AT_Ammo, A("Shell")},
{3, pcl_darklord, N("ShrapnelGun"), Placeholder2, AT_Ammo, A("Shell")},


+ 40
- 40
source/Main/p_weapons.c View File

@@ -11,15 +11,15 @@ static void GiveWeaponItem(int parm, int slot)
switch(parm)
{
case weapon_c_fist:
case weapon_fist: InvGive("Lith_Death", 1); break;
case weapon_c_spas: InvGive("Lith_ShellAmmo", 8); break;
case weapon_ssg: InvGive("Lith_ShellAmmo", 4); break;
case weapon_c_sniper: InvGive("Lith_RocketAmmo", 6); break;
case weapon_launcher: InvGive("Lith_RocketAmmo", 2); break;
case weapon_fist: InvGive(OBJ "Death", 1); break;
case weapon_c_spas: InvGive(OBJ "ShellAmmo", 8); break;
case weapon_ssg: InvGive(OBJ "ShellAmmo", 4); break;
case weapon_c_sniper: InvGive(OBJ "RocketAmmo", 6); break;
case weapon_launcher: InvGive(OBJ "RocketAmmo", 2); break;
case weapon_c_plasma:
case weapon_plasma: InvGive("Lith_PlasmaAmmo", 1500); break;
case weapon_c_shipgun: InvGive("Lith_CannonAmmo", 5); break;
case weapon_bfg: InvGive("Lith_CannonAmmo", 4); break;
case weapon_plasma: InvGive(OBJ "PlasmaAmmo", 1500); break;
case weapon_c_shipgun: InvGive(OBJ "CannonAmmo", 5); break;
case weapon_bfg: InvGive(OBJ "CannonAmmo", 4); break;
}
}

@@ -129,8 +129,8 @@ fixed Lith_CircleSpread(fixed mdx, fixed mdy, bool getpitch)
script ext("ACS")
int Lith_ChargeFistDamage()
{
int amount = InvNum("Lith_FistCharge");
InvTake("Lith_FistCharge", 0x7FFFFFFF);
int amount = InvNum(OBJ "FistCharge");
InvTake(OBJ "FistCharge", 0x7FFFFFFF);
return amount * ACS_Random(1, 3);
}

@@ -187,9 +187,9 @@ void Lith_PlayerPreWeapons(struct player *p)
// For slot 3 weapons that don't take ammo, check if they should.
case weapon_shotgun:
case weapon_c_rifle:
if(p->getCVarI("lith_weapons_slot3ammo")) {
if(p->getCVarI(CVAR "weapons_slot3ammo")) {
wep->ammotype |= AT_Ammo;
wep->ammoclass = "Lith_ShellAmmo";
wep->ammoclass = OBJ "ShellAmmo";
}
}

@@ -228,23 +228,23 @@ void Lith_PlayerUpdateWeapons(struct player *p)
{
if(!Lith_IsPaused)
{
int heat = InvNum("Lith_SMGHeat");
if(heat < 100) InvTake("Lith_SMGHeat", 5);
else if(heat < 200) InvTake("Lith_SMGHeat", 4);
else if(heat < 300) InvTake("Lith_SMGHeat", 3);
else if(heat < 400) InvTake("Lith_SMGHeat", 2);
else InvTake("Lith_SMGHeat", 1);
int heat = InvNum(OBJ "SMGHeat");
if(heat < 100) InvTake(OBJ "SMGHeat", 5);
else if(heat < 200) InvTake(OBJ "SMGHeat", 4);
else if(heat < 300) InvTake(OBJ "SMGHeat", 3);
else if(heat < 400) InvTake(OBJ "SMGHeat", 2);
else InvTake(OBJ "SMGHeat", 1);
}

if(p->pclass == pcl_cybermage)
{
InvGive("Lith_Blade", 1);
InvGive("Lith_Delear", 1);
if(world.cbiupgr[cupg_c_slot3spell]) InvGive("Lith_Feuer", 1);
if(world.cbiupgr[cupg_c_slot4spell]) InvGive("Lith_Rend", 1);
if(world.cbiupgr[cupg_c_slot5spell]) InvGive("Lith_Hulgyon", 1);
if(world.cbiupgr[cupg_c_slot6spell]) InvGive("Lith_StarShot", 1);
if(world.cbiupgr[cupg_c_slot7spell]) InvGive("Lith_Cercle", 1);
InvGive(OBJ "Blade", 1);
InvGive(OBJ "Delear", 1);
if(world.cbiupgr[cupg_c_slot3spell]) InvGive(OBJ "Feuer", 1);
if(world.cbiupgr[cupg_c_slot4spell]) InvGive(OBJ "Rend", 1);
if(world.cbiupgr[cupg_c_slot5spell]) InvGive(OBJ "Hulgyon", 1);
if(world.cbiupgr[cupg_c_slot6spell]) InvGive(OBJ "StarShot", 1);
if(world.cbiupgr[cupg_c_slot7spell]) InvGive(OBJ "Cercle", 1);
}

SetSize(320, 240);
@@ -252,16 +252,16 @@ void Lith_PlayerUpdateWeapons(struct player *p)
switch(p->weapontype)
{
case weapon_c_fist:
PrintTextStr(L("LITH_MANA_CHARGE"));
PrintTextStr(L(LANG "MANA_CHARGE"));
PrintTextA("cbifont", CR_BRICK, 160,0, 100,0, 0.5);
break;
case weapon_c_delear:
ServCallI("Lith_DelearSprite");
ServCallI(OBJ "DelearSprite");
break;
case weapon_cfist:
__with(fixed64 charge = 5 + InvNum("Lith_FistCharge") / 10.lk;)
__with(fixed64 charge = 5 + InvNum(OBJ "FistCharge") / 10.lk;)
{
PrintTextFmt(L("LITH_CHARGE_FMT"), charge);
PrintTextFmt(L(LANG "CHARGE_FMT"), charge);
PrintText("cbifont", CR_LIGHTBLUE, 270,2, 200,2);
}
break;
@@ -302,7 +302,7 @@ script ext("ACS")
void Lith_SurgeOfDestiny(void)
{
for(int i = 0; i < (35 * 7) / 2; i++) {
InvGive("Lith_SurgeOfDestiny", 1);
InvGive(OBJ "SurgeOfDestiny", 1);
ACS_Delay(2);
}
}
@@ -347,25 +347,25 @@ void Lith_PoisonFXTicker()
{
Lith_PausableTick();

if(InvNum("Lith_PoisonFXReset"))
if(InvNum(OBJ "PoisonFXReset"))
{
InvTake("Lith_PoisonFXReset", 999);
InvTake("Lith_PoisonFXTimer", 999);
InvGive("Lith_PoisonFXGiverGiver", 1);
InvTake(OBJ "PoisonFXReset", 999);
InvTake(OBJ "PoisonFXTimer", 999);
InvGive(OBJ "PoisonFXGiverGiver", 1);
return;
}
}

if(GetPropI(0, APROP_Health) <= 0)
{
InvTake("Lith_PoisonFXReset", 999);
InvTake("Lith_PoisonFXTimer", 999);
InvTake("Lith_PoisonFXGiverGiver", 999);
InvTake(OBJ "PoisonFXReset", 999);
InvTake(OBJ "PoisonFXTimer", 999);
InvTake(OBJ "PoisonFXGiverGiver", 999);
}
else if(InvNum("Lith_PoisonFXTimer"))
else if(InvNum(OBJ "PoisonFXTimer"))
{
InvGive("Lith_PoisonFXGiver", 1);
InvTake("Lith_PoisonFXTimer", 1);
InvGive(OBJ "PoisonFXGiver", 1);
InvTake(OBJ "PoisonFXTimer", 1);
}
}



+ 8
- 8
source/Main/u_adrenaline.c View File

@@ -9,7 +9,7 @@
stkcall
void Upgr_Adrenaline_Activate(struct player *p, upgrade_t *upgr)
{