Add property macros
parent
8146ec2d45
commit
0728881821
|
@ -31,9 +31,8 @@ struct player_attributes
|
|||
u32 level;
|
||||
__str names[at_max];
|
||||
|
||||
[[__anonymous]]
|
||||
struct player_attr_theta cur;
|
||||
struct player_attr_theta sup;
|
||||
anonymous struct player_attr_theta cur;
|
||||
struct player_attr_theta sup;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
@ -15,11 +15,11 @@ LITH_X(MAIL, "Mail")
|
|||
|
||||
// Extern Functions ----------------------------------------------------------|
|
||||
|
||||
[[__call("ScriptS")]] void Lith_PlayerInitBIP(struct player *p);
|
||||
script void Lith_PlayerInitBIP(struct player *p);
|
||||
struct bippage_s *Lith_FindBIPPage(struct bip_s *bip, __str name);
|
||||
[[__optional_args(1)]] struct bippage_s *Lith_UnlockBIPPage(struct bip_s *bip, __str name, int pclass);
|
||||
[[__call("ScriptS")]] void Lith_DeallocateBIP(struct bip_s *bip);
|
||||
[[__call("ScriptS"), __optional_args(1)]] void Lith_DeliverMail(struct player *p, __str title, int flags);
|
||||
optargs(1) struct bippage_s *Lith_UnlockBIPPage(struct bip_s *bip, __str name, int pclass);
|
||||
script void Lith_DeallocateBIP(struct bip_s *bip);
|
||||
script optargs(1) void Lith_DeliverMail(struct player *p, __str title, int flags);
|
||||
|
||||
// Types ---------------------------------------------------------------------|
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
#pragma GDCC FIXED_LITERAL ON
|
||||
#pragma GDCC STRENT_LITERAL ON
|
||||
|
||||
#include <ACS_ZDoom.h>
|
||||
#include <ACS_Zandronum.h>
|
||||
#include <stddef.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdarg.h>
|
||||
|
@ -73,15 +73,15 @@ enum {
|
|||
|
||||
void Log(__str fmt, ...);
|
||||
|
||||
[[__call("StkCall")]] void Lith_FadeFlash(int r, int g, int b, fixed amount, fixed seconds);
|
||||
[[__call("ScriptS"), __optional_args(1)]] int Lith_GetTID(int tid, int ptr);
|
||||
[[__call("ScriptS"), __optional_args(1)]] int Lith_GetPlayerNumber(int tid, int ptr);
|
||||
[[__call("ScriptS"), __optional_args(1)]] bool Lith_ValidPointer(int tid, int ptr);
|
||||
[[__call("ScriptS"), __optional_args(2)]] bool Lith_SetPointer(int tid, int ptr, int assign, int tid2, int ptr2, int flags);
|
||||
[[__call("StkCall")]] int Lith_CheckActorInventory(int tid, __str item);
|
||||
[[__call("StkCall")]] void Lith_GiveActorInventory(int tid, __str item, int amount);
|
||||
[[__call("StkCall")]] void Lith_TakeActorInventory(int tid, __str item, int amount);
|
||||
[[__call("StkCall")]] void Lith_SetActorInventory (int tid, __str item, int amount);
|
||||
stkcall void Lith_FadeFlash(int r, int g, int b, fixed amount, fixed seconds);
|
||||
script optargs(1) int Lith_GetTID(int tid, int ptr);
|
||||
script optargs(1) int Lith_GetPlayerNumber(int tid, int ptr);
|
||||
script optargs(1) bool Lith_ValidPointer(int tid, int ptr);
|
||||
script optargs(2) bool Lith_SetPointer(int tid, int ptr, int assign, int tid2, int ptr2, int flags);
|
||||
stkcall int Lith_CheckActorInventory(int tid, __str item);
|
||||
stkcall void Lith_GiveActorInventory(int tid, __str item, int amount);
|
||||
stkcall void Lith_TakeActorInventory(int tid, __str item, int amount);
|
||||
stkcall void Lith_SetActorInventory (int tid, __str item, int amount);
|
||||
void Lith_DebugStat(__str fmt, ...);
|
||||
void Lith_DebugNote(__str fmt, ...);
|
||||
|
||||
|
|
|
@ -39,13 +39,13 @@
|
|||
HudMessageParams(HUDMSG_ALPHA, id, CR_UNTRANSLATED, x, y, hold, alpha) \
|
||||
)
|
||||
|
||||
[[__call("StkCall")]] void DrawSprite(__str name, int flags, int id, fixed x, fixed y, fixed hold);
|
||||
[[__call("StkCall")]] void DrawSpriteX(__str name, int flags, int id, fixed x, fixed y, fixed hold, fixed a1);
|
||||
[[__call("StkCall")]] void DrawSpriteXX(__str name, int flags, int id, fixed x, fixed y, fixed hold, fixed a1, fixed a2);
|
||||
[[__call("StkCall")]] void DrawSpriteXXX(__str name, int flags, int id, fixed x, fixed y, fixed hold, fixed a1, fixed a2, fixed a3);
|
||||
[[__call("StkCall")]] void DrawSpritePlain(__str name, int id, fixed x, fixed y, fixed hold);
|
||||
[[__call("StkCall")]] void DrawSpriteAlpha(__str name, int id, fixed x, fixed y, fixed hold, fixed alpha);
|
||||
[[__call("StkCall")]] void DrawSpriteFade(__str name, int id, fixed x, fixed y, fixed hold, fixed fadetime);
|
||||
stkcall void DrawSprite(__str name, int flags, int id, fixed x, fixed y, fixed hold);
|
||||
stkcall void DrawSpriteX(__str name, int flags, int id, fixed x, fixed y, fixed hold, fixed a1);
|
||||
stkcall void DrawSpriteXX(__str name, int flags, int id, fixed x, fixed y, fixed hold, fixed a1, fixed a2);
|
||||
stkcall void DrawSpriteXXX(__str name, int flags, int id, fixed x, fixed y, fixed hold, fixed a1, fixed a2, fixed a3);
|
||||
stkcall void DrawSpritePlain(__str name, int id, fixed x, fixed y, fixed hold);
|
||||
stkcall void DrawSpriteAlpha(__str name, int id, fixed x, fixed y, fixed hold, fixed alpha);
|
||||
stkcall void DrawSpriteFade(__str name, int id, fixed x, fixed y, fixed hold, fixed fadetime);
|
||||
void HudMessage(__str fmt, ...);
|
||||
|
||||
// EOF
|
||||
|
|
|
@ -98,8 +98,8 @@ typedef struct gui_delta_s
|
|||
|
||||
typedef struct gui_state_s
|
||||
{
|
||||
[[__anonymous]] gui_delta_t cur;
|
||||
gui_delta_t old;
|
||||
anonymous gui_delta_t cur;
|
||||
gui_delta_t old;
|
||||
|
||||
int ox, oy;
|
||||
int w, h;
|
||||
|
@ -265,20 +265,12 @@ struct gui_presets const *Lith_GUIPreExtern(void);
|
|||
|
||||
// Extern Functions ----------------------------------------------------------|
|
||||
|
||||
[[__optional_args(1)]]
|
||||
void Lith_GUI_Auto(gui_state_t *g, id_t id, int x, int y, int w, int h, bool slide);
|
||||
|
||||
[[__optional_args(1)]]
|
||||
void Lith_GUI_Init(gui_state_t *g, void *state);
|
||||
|
||||
optargs(1) void Lith_GUI_Auto(gui_state_t *g, id_t id, int x, int y, int w, int h, bool slide);
|
||||
optargs(1) void Lith_GUI_Init(gui_state_t *g, void *state);
|
||||
void Lith_GUI_UpdateState(gui_state_t *g, struct player *p);
|
||||
|
||||
[[__optional_args(2)]]
|
||||
void Lith_GUI_Begin(gui_state_t *g, int basehid, int w, int h);
|
||||
optargs(2) void Lith_GUI_Begin(gui_state_t *g, int basehid, int w, int h);
|
||||
void Lith_GUI_End(gui_state_t *g, enum cursor curs);
|
||||
|
||||
[[__optional_args(1)]]
|
||||
void Lith_GUI_Clip(gui_state_t *g, int x, int y, int w, int h, int ww);
|
||||
optargs(1) void Lith_GUI_Clip(gui_state_t *g, int x, int y, int w, int h, int ww);
|
||||
void Lith_GUI_ClipRelease(gui_state_t *g);
|
||||
|
||||
__str Lith_RemoveTextColors(__str str, int size);
|
||||
|
@ -287,13 +279,12 @@ void Lith_GUI_TypeOn(gui_state_t *g, gui_typeon_state_t *typeon, __str text);
|
|||
gui_typeon_state_t const *Lith_GUI_TypeOnUpdate(gui_state_t *g, gui_typeon_state_t *typeon);
|
||||
|
||||
void Lith_GUI_ScrollEnd(gui_state_t *g, gui_scroll_state_t *scr);
|
||||
[[__optional_args(1)]]
|
||||
bool Lith_GUI_ScrollOcclude(gui_state_t *g, gui_scroll_state_t const *scr, int y, int h);
|
||||
optargs(1) bool Lith_GUI_ScrollOcclude(gui_state_t *g, gui_scroll_state_t const *scr, int y, int h);
|
||||
|
||||
bool Lith_GUI_Button_Impl (gui_state_t *g, id_t id, gui_button_args_t const *a);
|
||||
bool Lith_GUI_Checkbox_Impl (gui_state_t *g, id_t id, gui_checkb_args_t const *a);
|
||||
void Lith_GUI_ScrollBegin_Impl(gui_state_t *g, id_t id, gui_scroll_args_t const *a);
|
||||
double Lith_GUI_Slider_Impl (gui_state_t *g, id_t id, gui_slider_args_t const *a);
|
||||
bool Lith_GUI_Button_Impl (gui_state_t *g, id_t id, gui_button_args_t const *a);
|
||||
bool Lith_GUI_Checkbox_Impl (gui_state_t *g, id_t id, gui_checkb_args_t const *a);
|
||||
void Lith_GUI_ScrollBegin_Impl(gui_state_t *g, id_t id, gui_scroll_args_t const *a);
|
||||
double Lith_GUI_Slider_Impl (gui_state_t *g, id_t id, gui_slider_args_t const *a);
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
@ -16,11 +16,11 @@
|
|||
|
||||
// Extern Functions ----------------------------------------------------------|
|
||||
|
||||
[[__optional_args(1)]] void Lith_LinkDefault(struct list_s *list, void *object);
|
||||
optargs(1) void Lith_LinkDefault(struct list_s *list, void *object);
|
||||
void Lith_ListLink(struct list_s *head, struct list_s *list);
|
||||
void *Lith_ListUnlink(struct list_s *list);
|
||||
size_t Lith_ListSize(struct list_s *head);
|
||||
[[__optional_args(1)]] void Lith_ListFree(struct list_s *head, bool dofree);
|
||||
optargs(1) void Lith_ListFree(struct list_s *head, bool dofree);
|
||||
|
||||
// Type Definitions ----------------------------------------------------------|
|
||||
|
||||
|
|
|
@ -40,7 +40,7 @@ void Lith_LogH(struct player *p, __str fmt, ...); // log to hud only
|
|||
logdata_t *Lith_LogV(struct player *p, __str fmt, va_list vl); // vararg
|
||||
void Lith_PlayerLogEntry(struct player *p);
|
||||
|
||||
[[__call("ScriptS")]] void Lith_HUD_Log(struct player *p);
|
||||
script void Lith_HUD_Log(struct player *p);
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
@ -13,20 +13,20 @@
|
|||
#define pi4 (pi / 4.0f)
|
||||
#define tau (pi * 2.0f)
|
||||
|
||||
[[__optional_args(1)]] u64 Lith_CRC64(void const *data, size_t len, u64 result);
|
||||
[[__optional_args(1)]] u64 Lith_CRC64_str(void __str_ars const *data, size_t len, u64 result);
|
||||
[[__optional_args(1)]] float RandomFloat(float max, float min);
|
||||
optargs(1) u64 Lith_CRC64(void const *data, size_t len, u64 result);
|
||||
optargs(1) u64 Lith_CRC64_str(void __str_ars const *data, size_t len, u64 result);
|
||||
optargs(1) float RandomFloat(float max, float min);
|
||||
float mag2f(float x, float y);
|
||||
[[__call("StkCall")]] fixed mag2k(fixed x, fixed y);
|
||||
[[__call("StkCall")]] int mag2i(int x, int y);
|
||||
stkcall fixed mag2k(fixed x, fixed y);
|
||||
stkcall int mag2i(int x, int y);
|
||||
fixed lerpk(fixed a, fixed b, fixed t);
|
||||
fixed64 lerplk(fixed64 a, fixed64 b, fixed64 t);
|
||||
float lerpf(float a, float b, float t);
|
||||
double lerp(double a, double b, double t);
|
||||
[[__call("StkCall")]] bool aabb(int x, int y, int z, int w, int x2, int y2);
|
||||
[[__call("StkCall")]] int ceilk(fixed n);
|
||||
[[__call("StkCall")]] float bzpolyf(float a, float b, float t);
|
||||
[[__call("StkCall")]] int bzpolyi(int a, int b, float t);
|
||||
stkcall bool aabb(int x, int y, int z, int w, int x2, int y2);
|
||||
stkcall int ceilk(fixed n);
|
||||
stkcall float bzpolyf(float a, float b, float t);
|
||||
stkcall int bzpolyi(int a, int b, float t);
|
||||
struct vec2i qbezieri(int x1, int y1, int x2, int y2, int x3, int y3, float t);
|
||||
struct vec2f qbezierf(float x1, float y1, float x2, float y2, float x3, float y3, float t);
|
||||
struct polar ctopol(fixed x, fixed y);
|
||||
|
|
|
@ -63,7 +63,7 @@ typedef struct dmon dmonarr dmon_t;
|
|||
extern int dmonarr dmonid;
|
||||
#endif
|
||||
|
||||
[[__call("ScriptS"), __optional_args(2)]] dmon_t *DmonPtr(int tid, int ptr);
|
||||
script optargs(2) dmon_t *DmonPtr(int tid, int ptr);
|
||||
dmon_t *Dmon(int id);
|
||||
dmon_t *AllocDmon(void);
|
||||
|
||||
|
|
|
@ -121,34 +121,34 @@ struct player_delta
|
|||
// Extern Functions ----------------------------------------------------------|
|
||||
|
||||
// state
|
||||
[[__call("ScriptS")]] void Lith_ResetPlayer(struct player *p);
|
||||
[[__call("ScriptS")]] void Lith_PlayerLoadData(struct player *p);
|
||||
[[__call("ScriptS")]] void Lith_PlayerSaveData(struct player *p);
|
||||
[[__call("StkCall")]] int Lith_PlayerCurWeaponType(struct player *p);
|
||||
[[__call("StkCall")]] bool Lith_ButtonPressed(struct player *p, int bt);
|
||||
[[__call("StkCall"), __optional_args(1)]] bool Lith_SetPlayerVelocity(struct player *p, fixed velx, fixed vely, fixed velz, bool add);
|
||||
script void Lith_ResetPlayer(struct player *p);
|
||||
script void Lith_PlayerLoadData(struct player *p);
|
||||
script void Lith_PlayerSaveData(struct player *p);
|
||||
stkcall int Lith_PlayerCurWeaponType(struct player *p);
|
||||
stkcall bool Lith_ButtonPressed(struct player *p, int bt);
|
||||
stkcall optargs(1) bool Lith_SetPlayerVelocity(struct player *p, fixed velx, fixed vely, fixed velz, bool add);
|
||||
void Lith_ValidatePlayerTID(struct player *p);
|
||||
|
||||
// gui
|
||||
[[__call("StkCall")]] void Lith_PlayerCloseGUI(struct player *p);
|
||||
[[__call("StkCall")]] void Lith_PlayerUseGUI(struct player *p, int type);
|
||||
stkcall void Lith_PlayerCloseGUI(struct player *p);
|
||||
stkcall void Lith_PlayerUseGUI(struct player *p, int type);
|
||||
|
||||
// score
|
||||
[[__optional_args(1)]] i96 Lith_GiveScore(struct player *p, i96 score, bool nomul);
|
||||
[[__call("StkCall")]] void Lith_TakeScore(struct player *p, i96 score);
|
||||
optargs(1) i96 Lith_GiveScore(struct player *p, i96 score, bool nomul);
|
||||
stkcall void Lith_TakeScore(struct player *p, i96 score);
|
||||
|
||||
// attributes
|
||||
[[__call("StkCall")]] void Lith_GiveEXP(struct player *p, u64 amt);
|
||||
stkcall void Lith_GiveEXP(struct player *p, u64 amt);
|
||||
|
||||
// misc
|
||||
upgrade_t *Lith_PlayerGetNamedUpgrade(struct player *p, int name);
|
||||
bool Lith_PlayerGetUpgradeActive(struct player *p, int name);
|
||||
[[__call("StkCall")]] void Lith_ClearTextBuf(struct player *p);
|
||||
[[__call("StkCall")]] __str Lith_PlayerDiscriminator(int pclass);
|
||||
stkcall void Lith_ClearTextBuf(struct player *p);
|
||||
stkcall __str Lith_PlayerDiscriminator(int pclass);
|
||||
|
||||
[[__call("ScriptS")]] void Lith_PlayerUpdateData(struct player *p);
|
||||
script void Lith_PlayerUpdateData(struct player *p);
|
||||
|
||||
[[__call("StkCall")]] void Lith_PlayerUpdateStats(struct player *p);
|
||||
stkcall void Lith_PlayerUpdateStats(struct player *p);
|
||||
|
||||
void Lith_HUD_DrawWeaponSlots(struct player *p, int const *ncol, int ncols,
|
||||
char scol, int bx, int by);
|
||||
|
@ -248,9 +248,8 @@ struct player
|
|||
int dlgnum;
|
||||
|
||||
// Deltas
|
||||
[[__anonymous]]
|
||||
struct player_delta cur;
|
||||
struct player_delta old;
|
||||
anonymous struct player_delta cur;
|
||||
struct player_delta old;
|
||||
int oldhealth;
|
||||
|
||||
// BIP
|
||||
|
|
|
@ -45,16 +45,15 @@ typedef struct savefile_s
|
|||
struct player *p;
|
||||
} savefile_t;
|
||||
|
||||
[[__call("ScriptS")]] typedef void (*loadchunker_t)(savefile_t *save, savechunk_t *chunk);
|
||||
script typedef void (*loadchunker_t)(savefile_t *save, savechunk_t *chunk);
|
||||
|
||||
// Extern Functions ----------------------------------------------------------|
|
||||
|
||||
void Lith_SaveWriteChunk(savefile_t *save, ident_t iden, uint32_t vers, size_t size);
|
||||
savefile_t *Lith_SaveBegin(struct player *p);
|
||||
[[__call("ScriptS")]] void Lith_SaveEnd(savefile_t *save);
|
||||
script void Lith_SaveEnd(savefile_t *save);
|
||||
|
||||
[[__optional_args(1)]]
|
||||
int Lith_LoadChunk(savefile_t *save, ident_t iden, uint32_t vers, loadchunker_t chunker);
|
||||
optargs(1) int Lith_LoadChunk(savefile_t *save, ident_t iden, uint32_t vers, loadchunker_t chunker);
|
||||
savefile_t *Lith_LoadBegin(struct player *p);
|
||||
void Lith_LoadEnd(savefile_t *save);
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@ typedef struct shopdef
|
|||
|
||||
i96 Lith_ShopGetCost(struct player *p, shopdef_t const *def);
|
||||
bool Lith_ShopCanBuy(struct player *p, shopdef_t const *def, void *obj);
|
||||
[[__optional_args(1)]] bool Lith_ShopBuy(struct player *p, shopdef_t const *def, void *obj, __str namefmt, bool nodelivery, bool nolog);
|
||||
optargs(1) bool Lith_ShopBuy(struct player *p, shopdef_t const *def, void *obj, __str namefmt, bool nodelivery, bool nolog);
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
// Copyright © 2018 Graham Sanderson, all rights reserved.
|
||||
|
||||
__str StrUpper(__str in);
|
||||
[[__call("StkCall")]] u32 StrHash(char __str_ars const *s);
|
||||
[[__call("StkCall")]] u32 CStrHash(char const *s);
|
||||
stkcall u32 StrHash(char __str_ars const *s);
|
||||
stkcall u32 CStrHash(char const *s);
|
||||
char *Lith_strcpy_str(char *dest, char __str_ars const *src);
|
||||
int Lith_strcmp_str(char const *s1, char __str_ars const *s2);
|
||||
[[__call("StkCall")]] __str Lith_ScoreSep(i96 num);
|
||||
stkcall __str Lith_ScoreSep(i96 num);
|
||||
__str Language(__str fmt, ...);
|
||||
__str LanguageNull(__str fmt, ...);
|
||||
__str StrParam(__str fmt, ...);
|
||||
|
|
|
@ -6,6 +6,19 @@
|
|||
#include <stdbool.h>
|
||||
#include <stdfix.h>
|
||||
|
||||
#define stkcall [[__call("StkCall")]]
|
||||
#define script [[__call("ScriptS")]]
|
||||
#define scriptn [[__call("ScriptI")]]
|
||||
#define optargs(x) [[__optional_args(x)]]
|
||||
#define noinit [[__no_init]]
|
||||
#define anonymous [[__anonymous]]
|
||||
#define address(x) [[__address(x)]]
|
||||
#define acs [[__extern("ACS")]]
|
||||
#define stksize(x) [[__alloc_Aut(x)]]
|
||||
#define type(x) [[__script(x)]]
|
||||
#define net type("net")
|
||||
#define clientside type("clientside")
|
||||
|
||||
typedef int64_t i64;
|
||||
typedef int96_t i96;
|
||||
|
||||
|
|
|
@ -55,7 +55,7 @@ enum
|
|||
typedef bool (*upgr_reinit_cb_t)(struct upgradeinfo *ui);
|
||||
|
||||
typedef void (*upgr_fn_cb_t)(struct player *, struct upgrade *);
|
||||
[[__call("ScriptS")]] typedef void (*upgr_sc_cb_t)(struct player *, struct upgrade *);
|
||||
script typedef void (*upgr_sc_cb_t)(struct player *, struct upgrade *);
|
||||
|
||||
struct upgr_data_Adrenaline {
|
||||
int charge;
|
||||
|
@ -138,7 +138,7 @@ struct upgr_data {
|
|||
};
|
||||
|
||||
typedef struct upgradeinfo {
|
||||
[[__anonymous]] shopdef_t shopdef;
|
||||
anonymous shopdef_t shopdef;
|
||||
|
||||
int pclass;
|
||||
int category;
|
||||
|
|
|
@ -16,11 +16,11 @@
|
|||
|
||||
// These are included here so the compiler may check the function signatures.
|
||||
#define Fn_F(n, cb) void Upgr_##n##_##cb(struct player *p, upgrade_t *upgr);
|
||||
#define Fn_S(n, cb) [[__call("ScriptS")]] Fn_F(n, cb)
|
||||
#define Fn_S(n, cb) script Fn_F(n, cb)
|
||||
#include "lith_upgradefuncs.h"
|
||||
|
||||
|
||||
[[__call("ScriptS")]] void Lith_PlayerInitUpgrades(struct player *p);
|
||||
script void Lith_PlayerInitUpgrades(struct player *p);
|
||||
void Lith_PlayerDeallocUpgrades(struct player *p);
|
||||
void Lith_PlayerDeinitUpgrades(struct player *p);
|
||||
void Lith_PlayerReinitUpgrades(struct player *p);
|
||||
|
|
|
@ -45,10 +45,10 @@ enum game_s
|
|||
};
|
||||
|
||||
__str Lith_CanonTime(int type);
|
||||
[[__optional_args(1)]] int Lith_UniqueID(int tid);
|
||||
[[__call("StkCall")]] void Lith_BeginAngles(int x, int y);
|
||||
[[__call("StkCall")]] fixed Lith_AddAngle(int x, int y);
|
||||
[[__call("StkCall")]] void Lith_FreezeTime(bool on);
|
||||
optargs(1) int Lith_UniqueID(int tid);
|
||||
stkcall void Lith_BeginAngles(int x, int y);
|
||||
stkcall fixed Lith_AddAngle(int x, int y);
|
||||
stkcall void Lith_FreezeTime(bool on);
|
||||
|
||||
typedef struct worldinfo_s
|
||||
{
|
||||
|
|
|
@ -153,8 +153,7 @@ void Lith_GUI_TypeOn(gui_state_t *g, gui_typeon_state_t *typeon, __str text)
|
|||
//
|
||||
__str Lith_RemoveTextColors(__str str, int size)
|
||||
{
|
||||
[[__no_init]]
|
||||
static char buf[8192];
|
||||
noinit static char buf[8192];
|
||||
int j = 0;
|
||||
|
||||
if(size > countof(buf)) return "[programmer error, please report]";
|
||||
|
|
|
@ -16,8 +16,7 @@ int dbgstatnum, dbgnotenum;
|
|||
//
|
||||
// SetInventory
|
||||
//
|
||||
[[__call("StkCall")]]
|
||||
static void SetInventory(__str item, int amount)
|
||||
stkcall static void SetInventory(__str item, int amount)
|
||||
{
|
||||
int s = InvNum(item) - amount;
|
||||
if(s < 0) InvTake(item, -s);
|
||||
|
@ -27,8 +26,7 @@ static void SetInventory(__str item, int amount)
|
|||
//
|
||||
// SetActorInventory
|
||||
//
|
||||
[[__call("StkCall")]]
|
||||
static void SetActorInventory(int tid, __str item, int amount)
|
||||
stkcall static void SetActorInventory(int tid, __str item, int amount)
|
||||
{
|
||||
int s = ACS_CheckActorInventory(tid, item) - amount;
|
||||
if(s < 0) ACS_TakeActorInventory(tid, item, -s);
|
||||
|
@ -40,8 +38,7 @@ static void SetActorInventory(int tid, __str item, int amount)
|
|||
//
|
||||
// Lith_DumpAlloc
|
||||
//
|
||||
[[__call("ScriptS")]]
|
||||
void Lith_DumpAlloc(void)
|
||||
script void Lith_DumpAlloc(void)
|
||||
{
|
||||
__GDCC__alloc_dump();
|
||||
}
|
||||
|
@ -49,8 +46,7 @@ void Lith_DumpAlloc(void)
|
|||
//
|
||||
// Lith_FadeFlash
|
||||
//
|
||||
[[__call("StkCall")]]
|
||||
void Lith_FadeFlash(int r, int g, int b, fixed amount, fixed seconds)
|
||||
stkcall void Lith_FadeFlash(int r, int g, int b, fixed amount, fixed seconds)
|
||||
{
|
||||
ACS_FadeTo(r, g, b, amount, 0.0);
|
||||
ACS_FadeTo(r, g, b, 0.0, seconds);
|
||||
|
@ -59,8 +55,7 @@ void Lith_FadeFlash(int r, int g, int b, fixed amount, fixed seconds)
|
|||
//
|
||||
// Lith_GetTID
|
||||
//
|
||||
[[__call("ScriptS")]]
|
||||
int Lith_GetTID(int tid, int ptr)
|
||||
script int Lith_GetTID(int tid, int ptr)
|
||||
{
|
||||
if(tid || ptr)
|
||||
ACS_SetActivator(tid, ptr);
|
||||
|
@ -70,8 +65,7 @@ int Lith_GetTID(int tid, int ptr)
|
|||
//
|
||||
// Lith_GetPlayerNumber
|
||||
//
|
||||
[[__call("ScriptS")]]
|
||||
int Lith_GetPlayerNumber(int tid, int ptr)
|
||||
script int Lith_GetPlayerNumber(int tid, int ptr)
|
||||
{
|
||||
if(tid || ptr)
|
||||
ACS_SetActivator(tid, ptr);
|
||||
|
@ -81,8 +75,7 @@ int Lith_GetPlayerNumber(int tid, int ptr)
|
|||
//
|
||||
// Lith_ValidPointer
|
||||
//
|
||||
[[__call("ScriptS")]]
|
||||
bool Lith_ValidPointer(int tid, int ptr)
|
||||
script bool Lith_ValidPointer(int tid, int ptr)
|
||||
{
|
||||
if(tid || ptr)
|
||||
return ACS_SetActivator(tid, ptr);
|
||||
|
@ -93,8 +86,7 @@ bool Lith_ValidPointer(int tid, int ptr)
|
|||
//
|
||||
// Lith_SetPointer
|
||||
//
|
||||
[[__call("ScriptS")]]
|
||||
bool Lith_SetPointer(int tid, int ptr, int assign, int tid2, int ptr2, int flags)
|
||||
script bool Lith_SetPointer(int tid, int ptr, int assign, int tid2, int ptr2, int flags)
|
||||
{
|
||||
if(tid || ptr)
|
||||
ACS_SetActivator(tid, ptr);
|
||||
|
@ -104,8 +96,7 @@ bool Lith_SetPointer(int tid, int ptr, int assign, int tid2, int ptr2, int flags
|
|||
//
|
||||
// Lith_CheckActorInventory
|
||||
//
|
||||
[[__call("StkCall")]]
|
||||
int Lith_CheckActorInventory(int tid, __str item)
|
||||
stkcall int Lith_CheckActorInventory(int tid, __str item)
|
||||
{
|
||||
if(tid == 0) return InvNum(item);
|
||||
else return ACS_CheckActorInventory(tid, item);
|
||||
|
@ -114,8 +105,7 @@ int Lith_CheckActorInventory(int tid, __str item)
|
|||
//
|
||||
// Lith_GiveActorInventory
|
||||
//
|
||||
[[__call("StkCall")]]
|
||||
void Lith_GiveActorInventory(int tid, __str item, int amount)
|
||||
stkcall void Lith_GiveActorInventory(int tid, __str item, int amount)
|
||||
{
|
||||
if(tid == 0) InvGive(item, amount);
|
||||
else ACS_GiveActorInventory(tid, item, amount);
|
||||
|
@ -124,8 +114,7 @@ void Lith_GiveActorInventory(int tid, __str item, int amount)
|
|||
//
|
||||
// Lith_TakeActorInventory
|
||||
//
|
||||
[[__call("StkCall")]]
|
||||
void Lith_TakeActorInventory(int tid, __str item, int amount)
|
||||
stkcall void Lith_TakeActorInventory(int tid, __str item, int amount)
|
||||
{
|
||||
if(tid == 0) InvTake(item, amount);
|
||||
else ACS_TakeActorInventory(tid, item, amount);
|
||||
|
@ -134,8 +123,7 @@ void Lith_TakeActorInventory(int tid, __str item, int amount)
|
|||
//
|
||||
// Lith_SetActorInventory
|
||||
//
|
||||
[[__call("StkCall")]]
|
||||
void Lith_SetActorInventory(int tid, __str item, int amount)
|
||||
stkcall void Lith_SetActorInventory(int tid, __str item, int amount)
|
||||
{
|
||||
if(tid == 0) SetInventory(item, amount);
|
||||
else SetActorInventory(tid, item, amount);
|
||||
|
|
|
@ -28,10 +28,9 @@ typedef struct memfile_t
|
|||
//
|
||||
typedef struct netfile_s
|
||||
{
|
||||
[[__anonymous]]
|
||||
memfile_t memfile;
|
||||
__str pcvar;
|
||||
int pnum;
|
||||
anonymous memfile_t memfile;
|
||||
__str pcvar;
|
||||
int pnum;
|
||||
} netfile_t;
|
||||
|
||||
// Static Functions ----------------------------------------------------------|
|
||||
|
|
|
@ -90,8 +90,7 @@ float mag2f(float x, float y)
|
|||
//
|
||||
// mag2k
|
||||
//
|
||||
[[__call("StkCall")]]
|
||||
fixed mag2k(fixed x, fixed y)
|
||||
stkcall fixed mag2k(fixed x, fixed y)
|
||||
{
|
||||
return ACS_FixedSqrt(x * x + y * y);
|
||||
}
|
||||
|
@ -99,8 +98,7 @@ fixed mag2k(fixed x, fixed y)
|
|||
//
|
||||
// mag2i
|
||||
//
|
||||
[[__call("StkCall")]]
|
||||
int mag2i(int x, int y)
|
||||
stkcall int mag2i(int x, int y)
|
||||
{
|
||||
return ACS_Sqrt(x * x + y * y);
|
||||
}
|
||||
|
@ -161,8 +159,7 @@ double lerp(double a, double b, double t)
|
|||
//
|
||||
// aabb
|
||||
//
|
||||
[[__call("StkCall")]]
|
||||
bool aabb(int x, int y, int z, int w, int x2, int y2)
|
||||
stkcall bool aabb(int x, int y, int z, int w, int x2, int y2)
|
||||
{
|
||||
return x2 >= x && y2 >= y && x2 < z && y2 < w;
|
||||
}
|
||||
|
@ -170,8 +167,7 @@ bool aabb(int x, int y, int z, int w, int x2, int y2)
|
|||
//
|
||||
// ceilk
|
||||
//
|
||||
[[__call("StkCall")]]
|
||||
int ceilk(fixed n)
|
||||
stkcall int ceilk(fixed n)
|
||||
{
|
||||
union {int_k_t i; fixed a;} u = {.a = n};
|
||||
if(u.i & 0xFFF1) return u.i &= 0xFFFF0000, u.a + 1;
|
||||
|
@ -181,8 +177,7 @@ int ceilk(fixed n)
|
|||
//
|
||||
// bzpolyf
|
||||
//
|
||||
[[__call("StkCall")]]
|
||||
float bzpolyf(float a, float b, float t)
|
||||
stkcall float bzpolyf(float a, float b, float t)
|
||||
{
|
||||
return a + ((b - a) * t);
|
||||
}
|
||||
|
@ -190,8 +185,7 @@ float bzpolyf(float a, float b, float t)
|
|||
//
|
||||
// bzpolyi
|
||||
//
|
||||
[[__call("StkCall")]]
|
||||
int bzpolyi(int a, int b, float t)
|
||||
stkcall int bzpolyi(int a, int b, float t)
|
||||
{
|
||||
return a + ((b - a) * t);
|
||||
}
|
||||
|
|
|
@ -24,8 +24,7 @@
|
|||
//
|
||||
// DrawSprite
|
||||
//
|
||||
[[__call("StkCall")]]
|
||||
void DrawSprite(__str name, int flags, int id, fixed x, fixed y, fixed hold)
|
||||
stkcall void DrawSprite(__str name, int flags, int id, fixed x, fixed y, fixed hold)
|
||||
{
|
||||
DrawSpriteBegin(name);
|
||||
ACS_OptHudMessage(flags|HUDMSG_NOTWITHFULLMAP, id, CR_UNTRANSLATED, x, y, hold);
|
||||
|
@ -35,8 +34,7 @@ void DrawSprite(__str name, int flags, int id, fixed x, fixed y, fixed hold)
|
|||
//
|
||||
// DrawSpriteX
|
||||
//
|
||||
[[__call("StkCall")]]
|
||||
void DrawSpriteX(__str name, int flags, int id, fixed x, fixed y, fixed hold, fixed a1)
|
||||
stkcall void DrawSpriteX(__str name, int flags, int id, fixed x, fixed y, fixed hold, fixed a1)
|
||||
{
|
||||
DrawSpriteBegin(name);
|
||||
ACS_OptHudMessage(flags|HUDMSG_NOTWITHFULLMAP, id, CR_UNTRANSLATED, x, y, hold);
|
||||
|
@ -46,8 +44,7 @@ void DrawSpriteX(__str name, int flags, int id, fixed x, fixed y, fixed hold, fi
|
|||
//
|
||||
// DrawSpriteXX
|
||||
//
|
||||
[[__call("StkCall")]]
|
||||
void DrawSpriteXX(__str name, int flags, int id, fixed x, fixed y, fixed hold, fixed a1, fixed a2)
|
||||
stkcall void DrawSpriteXX(__str name, int flags, int id, fixed x, fixed y, fixed hold, fixed a1, fixed a2)
|
||||
{
|
||||
DrawSpriteBegin(name);
|
||||
ACS_OptHudMessage(flags|HUDMSG_NOTWITHFULLMAP, id, CR_UNTRANSLATED, x, y, hold);
|
||||
|
@ -57,8 +54,7 @@ void DrawSpriteXX(__str name, int flags, int id, fixed x, fixed y, fixed hold, f
|
|||
//
|
||||
// DrawSpriteXXX
|
||||
//
|
||||
[[__call("StkCall")]]
|
||||
void DrawSpriteXXX(__str name, int flags, int id, fixed x, fixed y, fixed hold, fixed a1, fixed a2, fixed a3)
|
||||
stkcall void DrawSpriteXXX(__str name, int flags, int id, fixed x, fixed y, fixed hold, fixed a1, fixed a2, fixed a3)
|
||||
{
|
||||
DrawSpriteBegin(name);
|
||||
ACS_OptHudMessage(flags|HUDMSG_NOTWITHFULLMAP, id, CR_UNTRANSLATED, x, y, hold);
|
||||
|
@ -68,8 +64,7 @@ void DrawSpriteXXX(__str name, int flags, int id, fixed x, fixed y, fixed hold,
|
|||
//
|
||||
// DrawSpritePlain
|
||||
//
|
||||
[[__call("StkCall")]]
|
||||
void DrawSpritePlain(__str name, int id, fixed x, fixed y, fixed hold)
|
||||
stkcall void DrawSpritePlain(__str name, int id, fixed x, fixed y, fixed hold)
|
||||
{
|
||||
DrawSpriteBegin(name);
|
||||
ACS_OptHudMessage(HUDMSG_NOTWITHFULLMAP, id, CR_UNTRANSLATED, x, y, hold);
|
||||
|
@ -79,8 +74,7 @@ void DrawSpritePlain(__str name, int id, fixed x, fixed y, fixed hold)
|
|||
//
|
||||
// DrawSpriteAlpha
|
||||
//
|
||||
[[__call("StkCall")]]
|
||||
void DrawSpriteAlpha(__str name, int id, fixed x, fixed y, fixed hold, fixed alpha)
|
||||
stkcall void DrawSpriteAlpha(__str name, int id, fixed x, fixed y, fixed hold, fixed alpha)
|
||||
{
|
||||
DrawSpriteBegin(name);
|
||||
ACS_OptHudMessage(HUDMSG_ALPHA|HUDMSG_NOTWITHFULLMAP, id, CR_UNTRANSLATED, x, y, hold);
|
||||
|
@ -90,8 +84,7 @@ void DrawSpriteAlpha(__str name, int id, fixed x, fixed y, fixed hold, fixed alp
|
|||
//
|
||||
// DrawSpriteFade
|
||||
//
|
||||
[[__call("StkCall")]]
|
||||
void DrawSpriteFade(__str name, int id, fixed x, fixed y, fixed hold, fixed fadetime)
|
||||
stkcall void DrawSpriteFade(__str name, int id, fixed x, fixed y, fixed hold, fixed fadetime)
|
||||
{
|
||||
DrawSpriteBegin(name);
|
||||
ACS_OptHudMessage(HUDMSG_FADEOUT|HUDMSG_NOTWITHFULLMAP, id, CR_UNTRANSLATED, x, y, hold);
|
||||
|
|
|
@ -26,8 +26,7 @@ __str StrUpper(__str in)
|
|||
//
|
||||
// StrHash
|
||||
//
|
||||
[[__call("StkCall")]]
|
||||
u32 StrHash(char __str_ars const *s)
|
||||
stkcall u32 StrHash(char __str_ars const *s)
|
||||
{
|
||||
StrHashImpl();
|
||||
}
|
||||
|
@ -35,8 +34,7 @@ u32 StrHash(char __str_ars const *s)
|
|||
//
|
||||
// CStrHash
|
||||
//
|
||||
[[__call("StkCall")]]
|
||||
u32 CStrHash(char const *s)
|
||||
stkcall u32 CStrHash(char const *s)
|
||||
{
|
||||
StrHashImpl();
|
||||
}
|
||||
|
@ -65,8 +63,7 @@ int Lith_strcmp_str(char const *s1, char __str_ars const *s2)
|
|||
//
|
||||
// Lith_ScoreSep
|
||||
//
|
||||
[[__call("StkCall")]]
|
||||
__str Lith_ScoreSep(i96 num)
|
||||
stkcall __str Lith_ScoreSep(i96 num)
|
||||
{
|
||||
static char out[48];
|
||||
|
||||
|
|
|
@ -81,8 +81,7 @@ static void UnlockPage(bip_t *bip, bippage_t *page, int pclass)
|
|||
//
|
||||
// AddToBIP
|
||||
//
|
||||
[[__optional_args(1)]]
|
||||
static void AddToBIP(bip_t *bip, int categ, int pclass, struct page_init const *pinit, bool isfree)
|
||||
optargs(1) static void AddToBIP(bip_t *bip, int categ, int pclass, struct page_init const *pinit, bool isfree)
|
||||
{
|
||||
__str image = LanguageNull("LITH_TXT_INFO_IMAGE_%S", pinit->name);
|
||||
int height = strtoi_str(Language("LITH_TXT_INFO_CSIZE_%S", pinit->name), null, 0);
|
||||
|
@ -106,8 +105,7 @@ static void AddToBIP(bip_t *bip, int categ, int pclass, struct page_init const *
|
|||
//
|
||||
// CatFromStr
|
||||
//
|
||||
[[__call("StkCall")]]
|
||||
static int CatFromStr(__str name)
|
||||
stkcall static int CatFromStr(__str name)
|
||||
{
|
||||
#define LITH_X(n, _) if(name == #n) return BIPC_##n;
|
||||
#include "lith_bip.h"
|
||||
|
@ -117,8 +115,7 @@ static int CatFromStr(__str name)
|
|||
//
|
||||
// PClFromStr
|
||||
//
|
||||
[[__call("StkCall")]]
|
||||
static int PClFromStr(__str name)
|
||||
stkcall static int PClFromStr(__str name)
|
||||
{
|
||||
#define LITH_X(n, pc) if(name == #n || name == #pc) return pc;
|
||||
#include "lith_player.h"
|
||||
|
@ -195,8 +192,7 @@ static int LoadBIPInfo(__str fname, bip_t *bip, int pclass)
|
|||
//
|
||||
// Lith_PlayerInitBIP
|
||||
//
|
||||
[[__call("ScriptS")]]
|
||||
void Lith_PlayerInitBIP(struct player *p)
|
||||
script void Lith_PlayerInitBIP(struct player *p)
|
||||
{
|
||||
bip_t *bip = &p->bip;
|
||||
|
||||
|
@ -223,8 +219,7 @@ void Lith_PlayerInitBIP(struct player *p)
|
|||
//
|
||||
// Lith_DeliverMail
|
||||
//
|
||||
[[__call("ScriptS")]]
|
||||
void Lith_DeliverMail(struct player *p, __str title, int flags)
|
||||
script void Lith_DeliverMail(struct player *p, __str title, int flags)
|
||||
{
|
||||
if(p->pclass & pcl_mods) return;
|
||||
|
||||
|
@ -316,8 +311,7 @@ bippage_t *Lith_UnlockBIPPage(bip_t *bip, __str name, int pclass)
|
|||
//
|
||||
// Lith_DeallocateBIP
|
||||
//
|
||||
[[__call("ScriptS")]]
|
||||
void Lith_DeallocateBIP(bip_t *bip)
|
||||
script void Lith_DeallocateBIP(bip_t *bip)
|
||||
{
|
||||
ForCategory()
|
||||
bip->infogr[categ].free(true);
|
||||
|
@ -327,8 +321,7 @@ void Lith_DeallocateBIP(bip_t *bip)
|
|||
//
|
||||
// CheckMatch
|
||||
//
|
||||
[[__call("ScriptS")]]
|
||||
static bool CheckMatch(struct page_info *pinf, __str query)
|
||||
script static bool CheckMatch(struct page_info *pinf, __str query)
|
||||
{
|
||||
return strcasestr_str(pinf->shname, query) ||
|
||||
strcasestr_str(pinf->flname, query) ||
|
||||
|
|
|
@ -64,8 +64,7 @@ static void Lith_CBITab_Info(gui_state_t *g, struct player *p)
|
|||
//
|
||||
// Lith_PlayerUpdateCBIGUI
|
||||
//
|
||||
[[__call("ScriptS")]]
|
||||
void Lith_PlayerUpdateCBIGUI(struct player *p)
|
||||
script void Lith_PlayerUpdateCBIGUI(struct player *p)
|
||||
{
|
||||
gui_state_t *g = &p->cbi.guistate;
|
||||
|
||||
|
@ -135,8 +134,7 @@ void Lith_PlayerResetCBIGUI(struct player *p)
|
|||
//
|
||||
// Lith_KeyOpenCBI
|
||||
//
|
||||
[[__call("ScriptS"), __extern("ACS"), __script("net")]]
|
||||
void Lith_KeyOpenCBI(void)
|
||||
script acs net void Lith_KeyOpenCBI(void)
|
||||
{
|
||||
if(ACS_Timer() < 10) return;
|
||||
|
||||
|
|
|
@ -68,8 +68,7 @@ static void SetPClass(struct player *p)
|
|||
//
|
||||
// Lith_PlayerCurWeaponType
|
||||
//
|
||||
[[__call("StkCall")]]
|
||||
int Lith_PlayerCurWeaponType(struct player *p)
|
||||
stkcall int Lith_PlayerCurWeaponType(struct player *p)
|
||||
{
|
||||
return p->weapon.cur->info->type;
|
||||
}
|
||||
|
@ -77,8 +76,7 @@ int Lith_PlayerCurWeaponType(struct player *p)
|
|||
//
|
||||
// Lith_ButtonPressed
|
||||
//
|
||||
[[__call("StkCall")]]
|
||||
bool Lith_ButtonPressed(struct player *p, int bt)
|
||||
stkcall bool Lith_ButtonPressed(struct player *p, int bt)
|
||||
{
|
||||
return p->buttons & bt && !(p->old.buttons & bt);
|
||||
}
|
||||
|
@ -86,8 +84,7 @@ bool Lith_ButtonPressed(struct player *p, int bt)
|
|||
//
|
||||
// Lith_SetPlayerVelocity
|
||||
//
|
||||
[[__call("StkCall")]]
|
||||
bool Lith_SetPlayerVelocity(struct player *p, fixed velx, fixed vely, fixed velz, bool add)
|
||||
stkcall bool Lith_SetPlayerVelocity(struct player *p, fixed velx, fixed vely, fixed velz, bool add)
|
||||
{
|
||||
if(add)
|
||||
p->velx += velx, p->vely += vely, p->velz += velz;
|
||||
|
@ -116,8 +113,7 @@ void Lith_ValidatePlayerTID(struct player *p)
|
|||
//
|
||||
// Update all of the player's data.
|
||||
//
|
||||
[[__call("ScriptS")]]
|
||||
void Lith_PlayerUpdateData(struct player *p)
|
||||
script void Lith_PlayerUpdateData(struct player *p)
|
||||
{
|
||||
static int const warpflags = WARPF_NOCHECKPOSITION | WARPF_MOVEPTR |
|
||||
WARPF_WARPINTERPOLATION | WARPF_COPYINTERPOLATION | WARPF_COPYPITCH;
|
||||
|
@ -175,8 +171,7 @@ void Lith_PlayerUpdateData(struct player *p)
|
|||
//
|
||||
// Lith_GiveMail
|
||||
//
|
||||
[[__call("ScriptS"), __extern("ACS")]]
|
||||
void Lith_GiveMail(int num)
|
||||
script acs void Lith_GiveMail(int num)
|
||||
{
|
||||
static __str const names[] = {
|
||||
"Intro",
|
||||
|
@ -198,8 +193,7 @@ void Lith_GiveMail(int num)
|
|||
//
|
||||
// Lith_ClearTextBuf
|
||||
//
|
||||
[[__call("StkCall")]]
|
||||
void Lith_ClearTextBuf(struct player *p)
|
||||
stkcall void Lith_ClearTextBuf(struct player *p)
|
||||
{
|
||||
memset(p->txtbuf, 0, sizeof(p->txtbuf));
|
||||
p->tbptr = 0;
|
||||
|
@ -208,8 +202,7 @@ void Lith_ClearTextBuf(struct player *p)
|
|||
//
|
||||
// Lith_KeyDown
|
||||
//
|
||||
[[__call("ScriptS"), __extern("ACS")]]
|
||||
void Lith_KeyDown(int pnum, int ch)
|
||||
script acs void Lith_KeyDown(int pnum, int ch)
|
||||
{
|
||||
withplayer(&players[pnum])
|
||||
if(p->tbptr + 1 < countof(p->txtbuf))
|
||||
|
@ -219,8 +212,7 @@ void Lith_KeyDown(int pnum, int ch)
|
|||
//
|
||||
// Lith_GiveEXP
|
||||
//
|
||||
[[__call("StkCall")]]
|
||||
void Lith_GiveEXP(struct player *p, u64 amt)
|
||||
stkcall void Lith_GiveEXP(struct player *p, u64 amt)
|
||||
{
|
||||
#pragma GDCC FIXED_LITERAL OFF
|
||||
struct player_attributes *a = &p->attr;
|
||||
|
@ -240,8 +232,7 @@ void Lith_GiveEXP(struct player *p, u64 amt)
|
|||
//
|
||||
// Reset some things on the player when they spawn.
|
||||
//
|
||||
[[__call("ScriptS")]]
|
||||
void Lith_ResetPlayer(struct player *p)
|
||||
script void Lith_ResetPlayer(struct player *p)
|
||||
{
|
||||
//
|
||||
// Zero-init
|
||||
|
@ -381,8 +372,7 @@ void Lith_ResetPlayer(struct player *p)
|
|||
//
|
||||
// Lith_PlayerUpdateStats
|
||||
//
|
||||
[[__call("StkCall")]]
|
||||
void Lith_PlayerUpdateStats(struct player *p)
|
||||
stkcall void Lith_PlayerUpdateStats(struct player *p)
|
||||
{
|
||||
fixed boost = 1 + p->jumpboost;
|
||||
|
||||
|
|
|
@ -65,9 +65,8 @@ typedef struct dlgvmstate_s
|
|||
int optSel;
|
||||
int concat;
|
||||
|
||||
[[__anonymous]]
|
||||
dlgcurstate_t cur;
|
||||
dlgcurstate_t next;
|
||||
anonymous dlgcurstate_t cur;
|
||||
dlgcurstate_t next;
|
||||
} dlgvmstate_t;
|
||||
|
||||
// Extern Objects ------------------------------------------------------------|
|
||||
|
@ -79,8 +78,7 @@ struct dlgdef *lmvar dlgdefs;
|
|||
//
|
||||
// Lith_TerminalGUI
|
||||
//
|
||||
[[__call("ScriptS")]]
|
||||
static void Lith_TerminalGUI(gui_state_t *g, struct player *p, dlgvmstate_t *vmstate)
|
||||
script static void Lith_TerminalGUI(gui_state_t *g, struct player *p, dlgvmstate_t *vmstate)
|
||||
{
|
||||
enum {
|
||||
// background
|
||||
|
@ -185,8 +183,7 @@ static void Lith_TerminalGUI(gui_state_t *g, struct player *p, dlgvmstate_t *vms
|
|||
//
|
||||
// Lith_DialogueGUI
|
||||
//
|
||||
[[__call("ScriptS")]]
|
||||
static void Lith_DialogueGUI(gui_state_t *g, struct player *p, dlgvmstate_t *vmstate)
|
||||
script static void Lith_DialogueGUI(gui_state_t *g, struct player *p, dlgvmstate_t *vmstate)
|
||||
{
|
||||
enum {left = 37, top = 75};
|
||||
__str icon = StrParam(":Dialogue:Icon%S", vmstate->sreg[DSTR_ICON]);
|
||||
|
@ -243,8 +240,7 @@ static __str AddText(dlgvmstate_t *vmstate, __str s, bool local)
|
|||
//
|
||||
// Lith_TeleportOutEffect
|
||||
//
|
||||
[[__call("ScriptS"), __extern("ACS")]]
|
||||
void Lith_TeleportOutEffect(struct player *p)
|
||||
script acs void Lith_TeleportOutEffect(struct player *p)
|
||||
{
|
||||
if(!p) p = LocalPlayer;
|
||||
|
||||
|
@ -270,8 +266,7 @@ void Lith_TeleportOutEffect(struct player *p)
|
|||
//
|
||||
// Main dialogue VM.
|
||||
//
|
||||
[[__call("ScriptS")]]
|
||||
void Lith_DialogueVM(struct player *p, int num)
|
||||
script void Lith_DialogueVM(struct player *p, int num)
|
||||
{
|
||||
if(p->dead || p->indialogue > 1)
|
||||
return;
|
||||
|
@ -507,8 +502,7 @@ done:
|
|||
//
|
||||
// Lith_RunDialogue
|
||||
//
|
||||
[[__call("ScriptS"), __extern("ACS")]]
|
||||
void Lith_RunDialogue(int num)
|
||||
script acs void Lith_RunDialogue(int num)
|
||||
{
|
||||
withplayer(LocalPlayer) if(!p->indialogue)
|
||||
{
|
||||
|
@ -522,8 +516,7 @@ void Lith_RunDialogue(int num)
|
|||
//
|
||||
// Runs a numbered terminal.
|
||||
//
|
||||
[[__call("ScriptS"), __extern("ACS")]]
|
||||
void Lith_RunTerminal(int num)
|
||||
script acs void Lith_RunTerminal(int num)
|
||||
{
|
||||
Lith_RunDialogue(-num);
|
||||
}
|
||||
|
@ -531,8 +524,7 @@ void Lith_RunTerminal(int num)
|
|||
//
|
||||
// Lith_RunDialogueInt
|
||||
//
|
||||
[[__call("ScriptI"), __address(24244), __extern("ACS")]]
|
||||
void Lith_RunDialogueInt(int num)
|
||||
scriptn address(24244) acs void Lith_RunDialogueInt(int num)
|
||||
{
|
||||
Lith_RunDialogue(num);
|
||||
}
|
||||
|
|
|
@ -13,8 +13,7 @@
|
|||
//
|
||||
// Lith_LogName
|
||||
//
|
||||
[[__call("ScriptS"), __extern("ACS")]]
|
||||
void Lith_LogName(int name)
|
||||
script acs void Lith_LogName(int name)
|
||||
{
|
||||
withplayer(LocalPlayer)
|
||||
switch(name)
|
||||
|
@ -135,8 +134,7 @@ logdata_t *Lith_LogV(struct player *p, __str fmt, va_list vl)
|
|||
//
|
||||
// Lith_PlayerUpdateLog
|
||||
//
|
||||
[[__call("ScriptS")]]
|
||||
void Lith_PlayerUpdateLog(struct player *p)
|
||||
script void Lith_PlayerUpdateLog(struct player *p)
|
||||
{
|
||||
forlist(logdata_t *logdata, p->loginfo.hud)
|
||||
{
|
||||
|
@ -155,8 +153,7 @@ void Lith_PlayerUpdateLog(struct player *p)
|
|||
//
|
||||
// Lith_HUD_Log
|
||||
//
|
||||
[[__call("ScriptS")]]
|
||||
void Lith_HUD_Log(struct player *p)
|
||||
script void Lith_HUD_Log(struct player *p)
|
||||
{
|
||||
if(p->getCVarI("lith_hud_showlog"))
|
||||
{
|
||||
|
|
|
@ -9,8 +9,7 @@
|
|||
//
|
||||
// Lith_Blade
|
||||
//
|
||||
[[__call("ScriptS"), __extern("ACS")]]
|
||||
void Lith_Blade(bool hit)
|
||||
script acs void Lith_Blade(bool hit)
|
||||
{
|
||||
ACS_SetHudSize(800, 600);
|
||||
DrawSpriteX(hit ? ":Weapon:BladeHit" : ":Weapon:Blade", HUDMSG_FADEOUT|HUDMSG_ADDBLEND, hid_blade, 0.1, 0.1, TS * 3, 0.15);
|
||||
|
@ -23,8 +22,7 @@ void Lith_Blade(bool hit)
|
|||
//
|
||||
// Lith_Rend
|
||||
//
|
||||
[[__call("ScriptS"), __extern("ACS")]]
|
||||
void Lith_Rend(bool hit, int set)
|
||||
script acs void Lith_Rend(bool hit, int set)
|
||||
{
|
||||
static int num;
|
||||
|
||||
|
@ -44,8 +42,7 @@ void Lith_Rend(bool hit, int set)
|
|||
//
|
||||
// Lith_Feuer
|
||||
//
|
||||
[[__call("ScriptS"), __extern("ACS")]]
|
||||
void Lith_Feuer(bool left, bool fire)
|
||||
script acs void Lith_Feuer(bool left, bool fire)
|
||||
{
|
||||
withplayer(LocalPlayer)
|
||||
{
|
||||
|
@ -90,8 +87,7 @@ void Lith_Feuer(bool left, bool fire)
|
|||
//
|
||||
// Lith_Cercle
|
||||
//
|
||||
[[__call("ScriptS"), __extern("ACS")]]
|
||||
void Lith_Cercle(void)
|
||||
script acs void Lith_Cercle(void)
|
||||
{
|
||||
withplayer(LocalPlayer)
|
||||
{
|
||||
|
@ -176,8 +172,7 @@ void Lith_Cercle(void)
|
|||
//
|
||||
// Lith_MagicSelect
|
||||
//
|
||||
[[__call("ScriptS"), __extern("ACS")]]
|
||||
void Lith_MagicSelect(int num)
|
||||
script acs void Lith_MagicSelect(int num)
|
||||
{
|
||||
withplayer(LocalPlayer)
|
||||
{
|
||||
|
|
|
@ -13,8 +13,7 @@ extern payoutinfo_t payout;
|
|||
//
|
||||
// Lith_PlayerPayout
|
||||
//
|
||||
[[__call("ScriptS")]]
|
||||
void Lith_PlayerPayout(struct player *p)
|
||||
script void Lith_PlayerPayout(struct player *p)
|
||||
{
|
||||
#define Left(...) \
|
||||
( \
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
|
||||
// Extern Objects ------------------------------------------------------------|
|
||||
|
||||
[[__no_init]] struct player players[MAX_PLAYERS];
|
||||
noinit struct player players[MAX_PLAYERS];
|
||||
|
||||
// Static Objects ------------------------------------------------------------|
|
||||
|
||||
|
@ -21,15 +21,14 @@ static struct {__str on, off;} Lith_GUISounds[GUI_MAX] = {
|
|||
// Static Functions ----------------------------------------------------------|
|
||||
|
||||
static void Lith_PlayerRunScripts(struct player *p);
|
||||
[[__call("ScriptS")]] static void Lith_BossWarning(struct player *p);
|
||||
script static void Lith_BossWarning(struct player *p);
|
||||
|
||||
// Scripts -------------------------------------------------------------------|
|
||||
|
||||
//
|
||||
// Lith_PlayerEntry
|
||||
//
|
||||
[[__call("ScriptS"), __script("enter")]]
|
||||
static void Lith_PlayerEntry(void)
|
||||
script type("enter") static void Lith_PlayerEntry(void)
|
||||
{
|
||||
if(ACS_GameType() == GAME_TITLE_MAP)
|
||||
return;
|
||||
|
@ -74,7 +73,7 @@ reinit:
|
|||
|
||||
if(p->dlgnum)
|
||||
{
|
||||
[[__call("ScriptS")]] extern void Lith_DialogueVM(struct player *p, int dlgnum);
|
||||
script extern void Lith_DialogueVM(struct player *p, int dlgnum);
|
||||
|
||||
Lith_DialogueVM(p, p->dlgnum);
|
||||
p->dlgnum = 0;
|
||||
|
@ -99,8 +98,7 @@ reinit:
|
|||
//
|
||||
// Lith_PlayerDeath
|
||||
//
|
||||
[[__call("ScriptS"), __script("death")]]
|
||||
static void Lith_PlayerDeath(void)
|
||||
script type("death") static void Lith_PlayerDeath(void)
|
||||
{
|
||||
struct player *p = LocalPlayer;
|
||||
|
||||
|
@ -138,8 +136,7 @@ static void Lith_PlayerDeath(void)
|
|||
//
|
||||
// Lith_PlayerRespawn
|
||||
//
|
||||
[[__call("ScriptS"), __script("respawn")]]
|
||||
static void Lith_PlayerRespawn(void)
|
||||
script type("respawn") static void Lith_PlayerRespawn(void)
|
||||
{
|
||||
LocalPlayer->reinit = true;
|
||||
}
|
||||
|
@ -147,8 +144,7 @@ static void Lith_PlayerRespawn(void)
|
|||
//
|
||||
// Lith_PlayerReturn
|
||||
//
|
||||
[[__call("ScriptS"), __script("return")]]
|
||||
static void Lith_PlayerReturn(void)
|
||||
script type("return") static void Lith_PlayerReturn(void)
|
||||
{
|
||||
LocalPlayer->reinit = true;
|
||||
}
|
||||
|
@ -156,8 +152,7 @@ static void Lith_PlayerReturn(void)
|
|||
//
|
||||
// Lith_PlayerDisconnect
|
||||
//
|
||||
[[__call("ScriptS"), __script("disconnect")]]
|
||||
static void Lith_PlayerDisconnect(void)
|
||||
script type("disconnect") static void Lith_PlayerDisconnect(void)
|
||||
{
|
||||
struct player *p = LocalPlayer;
|
||||
|
||||
|
@ -178,8 +173,7 @@ static void Lith_PlayerDisconnect(void)
|
|||
//
|
||||
// Lith_RecoilUp
|
||||
//
|
||||
[[__call("ScriptS"), __extern("ACS")]]
|
||||
void Lith_RecoilUp(fixed amount)
|
||||
script acs void Lith_RecoilUp(fixed amount)
|
||||
{
|
||||
withplayer(LocalPlayer) p->extrpitch += amount / 180;
|
||||
}
|
||||
|
@ -222,8 +216,7 @@ struct player (*Lith_GetPlayersExtern(void))[MAX_PLAYERS]
|
|||
//
|
||||
// Lith_PlayerDiscriminator
|
||||
//
|
||||
[[__call("StkCall")]]
|
||||
__str Lith_PlayerDiscriminator(int pclass)
|
||||
stkcall __str Lith_PlayerDiscriminator(int pclass)
|
||||
{
|
||||
switch(pclass) {
|
||||
case pcl_marine: return "Stan";
|
||||
|
@ -240,8 +233,7 @@ __str Lith_PlayerDiscriminator(int pclass)
|
|||
//
|
||||
// Lith_StepSpeed
|
||||
//
|
||||
[[__call("ScriptS"), __extern("ACS")]]
|
||||
int Lith_StepSpeed()
|
||||
script acs int Lith_StepSpeed()
|
||||
{
|
||||
struct player *p = LocalPlayer;
|
||||
|
||||
|
@ -265,8 +257,7 @@ struct player *Lith_GetPlayer(int tid, int ptr)
|
|||
//
|
||||
// Lith_PlayerCloseGUI
|
||||
//
|
||||
[[__call("StkCall")]]
|
||||
void Lith_PlayerCloseGUI(struct player *p)
|
||||
stkcall void Lith_PlayerCloseGUI(struct player *p)
|
||||
{
|
||||
if(p->activegui != GUI_NONE)
|
||||
{
|
||||
|
@ -279,8 +270,7 @@ void Lith_PlayerCloseGUI(struct player *p)
|
|||
//
|
||||
// Lith_PlayerUseGUI
|
||||
//
|
||||
[[__call("StkCall")]]
|
||||
void Lith_PlayerUseGUI(struct player *p, int type)
|
||||
stkcall void Lith_PlayerUseGUI(struct player *p, int type)
|
||||
{
|
||||
if(p->dead) return;
|
||||
if(p->activegui == GUI_NONE)
|
||||
|
@ -351,8 +341,7 @@ i96 Lith_GiveScore(struct player *p, i96 score, bool nomul)
|
|||
//
|
||||
// Lith_TakeScore
|
||||
//
|
||||
[[__call("StkCall")]]
|
||||
void Lith_TakeScore(struct player *p, i96 score)
|
||||
stkcall void Lith_TakeScore(struct player *p, i96 score)
|
||||
{
|
||||
if(p->score - score >= 0) {
|
||||
p->scoreused += score;
|
||||
|
@ -369,8 +358,7 @@ void Lith_TakeScore(struct player *p, i96 score)
|
|||
//
|
||||
// Lith_GiveMeAllOfTheScore
|
||||
//
|
||||
[[__call("ScriptS"), __extern("ACS")]]
|
||||
void Lith_GiveMeAllOfTheScore(void)
|
||||
script acs void Lith_GiveMeAllOfTheScore(void)
|
||||
{
|
||||
withplayer(LocalPlayer) p->giveScore(0x7FFFFFFFFFFFFFFFFFFFFFFFLL, true);
|
||||
}
|
||||
|
@ -378,8 +366,7 @@ void Lith_GiveMeAllOfTheScore(void)
|
|||
//
|
||||
// Lith_GiveHealthBonus
|
||||
//
|
||||
[[__call("ScriptS"), __extern("ACS")]]
|
||||
void Lith_GiveHealthBonus(int amount)
|
||||
script acs void Lith_GiveHealthBonus(int amount)
|
||||
{
|
||||
withplayer(LocalPlayer)
|
||||
{
|
||||
|
@ -392,8 +379,7 @@ void Lith_GiveHealthBonus(int amount)
|
|||
//
|
||||
// Lith_GiveHealth
|
||||
//
|
||||
[[__call("ScriptS"), __extern("ACS")]]
|
||||
void Lith_GiveHealth(int amount)
|
||||
script acs void Lith_GiveHealth(int amount)
|
||||
{
|
||||
withplayer(LocalPlayer)
|
||||
{
|
||||
|
@ -407,8 +393,7 @@ void Lith_GiveHealth(int amount)
|
|||
//
|
||||
// Lith_CheckHealth
|
||||
//
|
||||
[[__call("ScriptS"), __extern("ACS")]]
|
||||
bool Lith_CheckHealth()
|
||||
script acs bool Lith_CheckHealth()
|
||||
{
|
||||
withplayer(LocalPlayer) return p->health < p->maxhealth;
|
||||
return 0;
|
||||
|
@ -417,8 +402,7 @@ bool Lith_CheckHealth()
|
|||
//
|
||||
// Lith_Discount
|
||||
//
|
||||
[[__call("ScriptS"), __extern("ACS")]]
|
||||
void Lith_Discount()
|
||||
script acs void Lith_Discount()
|
||||
{
|
||||
withplayer(LocalPlayer) p->discount = 0.9;
|
||||
}
|
||||
|
@ -428,8 +412,7 @@ void Lith_Discount()
|
|||
//
|
||||
// Lith_BossWarning
|
||||
//
|
||||
[[__call("ScriptS")]]
|
||||
static void Lith_BossWarning(struct player *p)
|
||||
script static void Lith_BossWarning(struct player *p)
|
||||
{
|
||||
ACS_Delay(35 * 5);
|
||||
|
||||
|
@ -440,29 +423,29 @@ static void Lith_BossWarning(struct player *p)
|
|||
//
|
||||
// Lith_PlayerRunScripts
|
||||
//
|
||||
// Run main loop scripts.
|
||||
// Run main loop script.
|
||||
//
|
||||
static void Lith_PlayerRunScripts(struct player *p)
|
||||
{
|
||||
[[__call("ScriptS")]] extern void Lith_PlayerPreWeapons(struct player *p);
|
||||
[[__call("ScriptS")]] static void Lith_PlayerPreScore(struct player *p);
|
||||
[[__call("ScriptS")]] static void Lith_PlayerPreStats(struct player *p);
|
||||
script extern void Lith_PlayerPreWeapons(struct player *p);
|
||||
script static void Lith_PlayerPreScore(struct player *p);
|
||||
script static void Lith_PlayerPreStats(struct player *p);
|
||||
|
||||
[[__call("ScriptS")]] extern void Lith_PlayerUpdateCBIGUI(struct player *p);
|
||||
[[__call("ScriptS")]] static void Lith_PlayerUpdateAttributes(struct player *p);
|
||||
[[__call("ScriptS")]] extern void Lith_PlayerUpdateUpgrades(struct player *p);
|
||||
[[__call("ScriptS")]] extern void Lith_PlayerUpdateWeapons(struct player *p);
|
||||
[[__call("ScriptS")]] extern void Lith_PlayerUpdateLog(struct player *p);
|
||||
script extern void Lith_PlayerUpdateCBIGUI(struct player *p);
|
||||
script static void Lith_PlayerUpdateAttributes(struct player *p);
|
||||
script extern void Lith_PlayerUpdateUpgrades(struct player *p);
|
||||
script extern void Lith_PlayerUpdateWeapons(struct player *p);
|
||||
script extern void Lith_PlayerUpdateLog(struct player *p);
|
||||
|
||||
[[__call("ScriptS")]] extern void Lith_PlayerFootstep(struct player *p);
|
||||
[[__call("ScriptS")]] extern void Lith_PlayerItemFx(struct player *p);
|
||||
[[__call("ScriptS")]] extern void Lith_PlayerDamageBob(struct player *p);
|
||||
[[__call("ScriptS")]] extern void Lith_PlayerView(struct player *p);
|
||||
[[__call("ScriptS")]] extern void Lith_PlayerRenderUpgrades(struct player *p);
|
||||
[[__call("ScriptS")]] extern void Lith_PlayerHUD(struct player *p);
|
||||
[[__call("ScriptS")]] extern void Lith_PlayerStyle(struct player *p);
|
||||
[[__call("ScriptS")]] extern void Lith_PlayerLevelup(struct player *p);
|
||||
[[__call("ScriptS")]] extern void Lith_PlayerDebugStats(struct player *p);
|
||||
script extern void Lith_PlayerFootstep(struct player *p);
|
||||
script extern void Lith_PlayerItemFx(struct player *p);
|
||||
script extern void Lith_PlayerDamageBob(struct player *p);
|
||||
script extern void Lith_PlayerView(struct player *p);
|
||||
script extern void Lith_PlayerRenderUpgrades(struct player *p);
|
||||
script extern void Lith_PlayerHUD(struct player *p);
|
||||
script extern void Lith_PlayerStyle(struct player *p);
|
||||
script extern void Lith_PlayerLevelup(struct player *p);
|
||||
script extern void Lith_PlayerDebugStats(struct player *p);
|
||||
|
||||
// Pre-logic: Update data from the engine.
|
||||
Lith_PlayerPreWeapons(p); // Update weapon info
|
||||
|
@ -504,8 +487,7 @@ static void Lith_PlayerRunScripts(struct player *p)
|
|||
//
|
||||
// Lith_PlayerUpdateAttributes
|
||||
//
|
||||
[[__call("ScriptS")]]
|
||||
static void Lith_PlayerUpdateAttributes(struct player *p)
|
||||
script static void Lith_PlayerUpdateAttributes(struct player *p)
|
||||
{
|
||||
fixed acc = p->attr.attrs[at_acc] / 210.0;
|
||||
fixed def = p->attr.attrs[at_def] / 290.0;
|
||||
|
@ -531,8 +513,7 @@ static void Lith_PlayerUpdateAttributes(struct player *p)
|
|||
//
|
||||
// Lith_PlayerPreScore
|
||||
//
|
||||
[[__call("ScriptS")]]
|
||||
static void Lith_PlayerPreScore(struct player *p)
|
||||
script static void Lith_PlayerPreScore(struct player *p)
|
||||
{
|
||||
if(!p->scoreaccumtime || p->score < p->old.score)
|
||||
{
|
||||
|
@ -549,8 +530,7 @@ static void Lith_PlayerPreScore(struct player *p)
|
|||
//
|
||||
// Lith_PlayerPreStats
|
||||
//
|
||||
[[__call("ScriptS")]]
|
||||
static void Lith_PlayerPreStats(struct player *p)
|
||||
script static void Lith_PlayerPreStats(struct player *p)
|
||||
{
|
||||
if(p->health < p->oldhealth)
|
||||
p->healthused += p->oldhealth - p->health;
|
||||
|
|
|
@ -18,8 +18,7 @@ static void HUD_Waves(struct player *p);
|
|||
//
|
||||
// Lith_PlayerDebugStats
|
||||
//
|
||||
[[__call("ScriptS")]]
|
||||
void Lith_PlayerDebugStats(struct player *p)
|
||||
script void Lith_PlayerDebugStats(struct player *p)
|
||||
{
|
||||
if(!(world.dbgLevel & log_devh)) return;
|
||||
|
||||
|
@ -38,8 +37,7 @@ void Lith_PlayerDebugStats(struct player *p)
|
|||
//
|
||||
// Lith_PlayerFootstep
|
||||
//
|
||||
[[__call("ScriptS")]]
|
||||
void Lith_PlayerFootstep(struct player *p)
|
||||
script void Lith_PlayerFootstep(struct player *p)
|
||||
{
|
||||
fixed vol = p->getCVarK("lith_player_footstepvol");
|
||||
if(!vol || ACS_Timer() % 10 != 0 || p->z - p->floorz > 16) return;
|
||||
|
@ -78,8 +76,7 @@ void Lith_HUD_DrawWeaponSlots(struct player *p, int const *ncol, int ncols, char
|
|||
//
|
||||
// Lith_PlayerItemFx
|
||||
//
|
||||
[[__call("ScriptS")]]
|
||||
void Lith_PlayerItemFx(struct player *p)
|
||||
script void Lith_PlayerItemFx(struct player *p)
|
||||
{
|
||||
bool hasir = InvNum("PowerLightAmp");
|
||||
|
||||
|
@ -94,8 +91,7 @@ void Lith_PlayerItemFx(struct player *p)
|
|||
//
|
||||
// Update view bobbing when you get damaged.
|
||||
//
|
||||
[[__call("ScriptS")]]
|
||||
void Lith_PlayerDamageBob(struct player *p)
|
||||
script void Lith_PlayerDamageBob(struct player *p)
|
||||
{
|
||||
if(!InvNum("PowerStrength") && p->health < p->oldhealth)
|
||||
{
|
||||
|
@ -124,8 +120,7 @@ void Lith_PlayerDamageBob(struct player *p)
|
|||
//
|
||||
// Update additive view.
|
||||
//
|
||||
[[__call("ScriptS")]]
|
||||
void Lith_PlayerView(struct player *p)
|
||||
script void Lith_PlayerView(struct player *p)
|
||||
{
|
||||
float addp = 0, addy = 0;
|
||||
|
||||
|
@ -151,8 +146,7 @@ void Lith_PlayerView(struct player *p)
|
|||
//
|
||||
// Lith_PlayerStyle
|
||||
//
|
||||
[[__call("ScriptS")]]
|
||||
void Lith_PlayerStyle(struct player *p)
|
||||
script void Lith_PlayerStyle(struct player *p)
|
||||
{
|
||||
if(p->scopetoken) {
|
||||
ACS_SetActorProperty(0, APROP_RenderStyle, STYLE_Subtract);
|
||||
|
@ -166,8 +160,7 @@ void Lith_PlayerStyle(struct player *p)
|
|||
//
|
||||
// Lith_PlayerHUD
|
||||
//
|
||||
[[__call("ScriptS")]]
|
||||
void Lith_PlayerHUD(struct player *p)
|
||||
script void Lith_PlayerHUD(struct player *p)
|
||||
{
|
||||
ACS_SetHudSize(320, 200);
|
||||
|
||||
|
@ -212,8 +205,7 @@ void Lith_PlayerHUD(struct player *p)
|
|||
//
|
||||
// Lith_PlayerLevelup
|
||||
//
|
||||
[[__call("ScriptS")]]
|
||||
void Lith_PlayerLevelup(struct player *p)
|
||||
script void Lith_PlayerLevelup(struct player *p)
|
||||
{
|
||||
if(p->old.attr.level && p->old.attr.level < p->attr.level) {
|
||||
ACS_LocalAmbientSound("player/levelup", 127);
|
||||
|
|
|
@ -9,8 +9,7 @@
|
|||
//
|
||||
// Lith_PlayerSaveData
|
||||
//
|
||||
[[__call("ScriptS")]]
|
||||
void Lith_PlayerSaveData(struct player *p)
|
||||
script void Lith_PlayerSaveData(struct player *p)
|
||||
{
|
||||
savefile_t *save;
|
||||
|
||||
|
@ -21,8 +20,7 @@ void Lith_PlayerSaveData(struct player *p)
|
|||
//
|
||||
// Lith_PlayerLoadData
|
||||
//
|
||||
[[__call("ScriptS")]]
|
||||
void Lith_PlayerLoadData(struct player *p)
|
||||
script void Lith_PlayerLoadData(struct player *p)
|
||||
{
|
||||
savefile_t *save;
|
||||
|
||||
|
|
|
@ -38,8 +38,7 @@ savefile_t *Lith_SaveBegin(struct player *p)
|
|||
//
|
||||
// Lith_SaveEnd
|
||||
//
|
||||
[[__call("ScriptS")]]
|
||||
void Lith_SaveEnd(savefile_t *save)
|
||||
script void Lith_SaveEnd(savefile_t *save)
|
||||
{
|
||||
Lith_SaveWriteChunk(save, Ident_Lend, SaveV_Lend, 0);
|
||||
fclose(save->fp);
|
||||
|
|
|
@ -11,7 +11,7 @@ enum {
|
|||
|
||||
typedef struct shopitem_s
|
||||
{
|
||||
[[__anonymous]] shopdef_t shopdef;
|
||||
anonymous shopdef_t shopdef;
|
||||
int pclass;
|
||||
int count;
|
||||
__str classname;
|
||||
|
|
|
@ -222,8 +222,7 @@ void Lith_UpgrSetOwned(struct player *p, upgrade_t *upgr)
|
|||
//
|
||||
// Lith_PlayerInitUpgrades
|
||||
//
|
||||
[[__call("ScriptS")]]
|
||||
void Lith_PlayerInitUpgrades(struct player *p)
|
||||
script void Lith_PlayerInitUpgrades(struct player *p)
|
||||
{
|
||||
#define CheckPClass() (UpgrInfo[i].pclass & p->pclass)
|
||||
for(int i = 0; i < UpgrMax; i++)
|
||||
|
@ -292,8 +291,7 @@ void Lith_PlayerReinitUpgrades(struct player *p)
|
|||
//
|
||||
// Lith_PlayerUpdateUpgrades
|
||||
//
|
||||
[[__call("ScriptS")]]
|
||||
void Lith_PlayerUpdateUpgrades(struct player *p)
|
||||
script void Lith_PlayerUpdateUpgrades(struct player *p)
|
||||
{
|
||||
ForUpgrade(upgr)
|
||||
if(upgr->active && upgr->info->Update)
|
||||
|
@ -303,8 +301,7 @@ void Lith_PlayerUpdateUpgrades(struct player *p)
|
|||
//
|
||||
// Lith_PlayerRenderUpgrades
|
||||
//
|
||||
[[__call("ScriptS")]]
|
||||
void Lith_PlayerRenderUpgrades(struct player *p)
|
||||
script void Lith_PlayerRenderUpgrades(struct player *p)
|
||||
{
|
||||
ForUpgrade(upgr) if(upgr->active && upgr->info->Render)
|
||||
{
|
||||
|
|
|
@ -84,8 +84,7 @@ static void Lith_PickupScore(struct player *p, int parm)
|
|||
//
|
||||
// Lith_WeaponPickup
|
||||
//
|
||||
[[__call("ScriptS"), __extern("ACS")]]
|
||||
bool Lith_WeaponPickup(int name)
|
||||
script acs bool Lith_WeaponPickup(int name)
|
||||
{
|
||||
extern void Lith_PickupMessage(struct player *p, weaponinfo_t const *info);
|
||||
extern int Lith_WeaponFromName(struct player *p, int name);
|
||||
|
@ -132,8 +131,7 @@ bool Lith_WeaponPickup(int name)
|
|||
//
|
||||
// Lith_CircleSpread
|
||||
//
|
||||
[[__call("ScriptS"), __extern("ACS")]]
|
||||
fixed Lith_CircleSpread(fixed mdx, fixed mdy, bool getpitch)
|
||||
script acs fixed Lith_CircleSpread(fixed mdx, fixed mdy, bool getpitch)
|
||||
{
|
||||
static fixed A;
|
||||
static fixed P;
|
||||
|
@ -156,8 +154,7 @@ fixed Lith_CircleSpread(fixed mdx, fixed mdy, bool getpitch)
|
|||
//
|
||||
// Lith_ChargeFistDamage
|
||||
//
|
||||
[[__call("ScriptS"), __extern("ACS")]]
|
||||
int Lith_ChargeFistDamage()
|
||||
script acs int Lith_ChargeFistDamage()
|
||||
{
|
||||
int amount = InvNum("Lith_FistCharge");
|
||||
InvTake("Lith_FistCharge", 0x7FFFFFFF);
|
||||
|
@ -181,8 +178,7 @@ void Lith_GSInit_Weapon(void)
|
|||
//
|
||||
// Update information on what weapons we have.
|
||||
//
|
||||
[[__call("ScriptS")]]
|
||||
void Lith_PlayerPreWeapons(struct player *p)
|
||||
script void Lith_PlayerPreWeapons(struct player *p)
|
||||
{
|
||||
weapondata_t *w = &p->weapon;
|
||||
|
||||
|
@ -264,8 +260,7 @@ void Lith_PlayerPreWeapons(struct player *p)
|
|||
//
|
||||
// Lith_PlayerUpdateWeapons
|
||||
//
|
||||
[[__call("ScriptS")]]
|
||||
void Lith_PlayerUpdateWeapons(struct player *p)
|
||||
script void Lith_PlayerUpdateWeapons(struct player *p)
|
||||
{
|
||||
__with(int heat = ACS_CheckInventory("Lith_SMGHeat");) {
|
||||
if(heat < 100) ACS_TakeInventory("Lith_SMGHeat", 5);
|
||||
|
@ -282,8 +277,7 @@ void Lith_PlayerUpdateWeapons(struct player *p)
|
|||
//
|
||||
// Lith_AmmoRunOut
|
||||
//
|
||||
[[__call("ScriptS"), __extern("ACS")]]
|
||||
fixed Lith_AmmoRunOut(bool ro, fixed mul)
|
||||
script acs fixed Lith_AmmoRunOut(bool ro, fixed mul)
|
||||
{
|
||||
withplayer(LocalPlayer)
|
||||
{
|
||||
|
@ -301,8 +295,7 @@ fixed Lith_AmmoRunOut(bool ro, fixed mul)
|
|||
//
|
||||
// Lith_GetFinalizerMaxHealth
|
||||
//
|
||||
[[__call("ScriptS"), __extern("ACS")]]
|
||||
int Lith_GetFinalizerMaxHealth(void)
|
||||
script acs int Lith_GetFinalizerMaxHealth(void)
|
||||
{
|
||||
int sh = ACS_GetActorProperty(0, APROP_SpawnHealth);
|
||||
|
||||
|
@ -315,8 +308,7 @@ int Lith_GetFinalizerMaxHealth(void)
|
|||
//
|
||||
// Lith_SwitchRifleMode
|
||||
//
|
||||
[[__call("ScriptS"), __extern("ACS")]]
|
||||
void Lith_SwitchRifleFiremode(void)
|
||||
script acs void Lith_SwitchRifleFiremode(void)
|
||||
{
|
||||
withplayer(LocalPlayer)
|
||||
{
|
||||
|
@ -333,8 +325,7 @@ void Lith_SwitchRifleFiremode(void)
|
|||
//
|
||||
// Lith_ResetRifleMode
|
||||
//
|
||||
[[__call("ScriptS"), __extern("ACS")]]
|
||||
void Lith_ResetRifleMode()
|
||||
script acs void Lith_ResetRifleMode()
|
||||
{
|
||||
withplayer(LocalPlayer)
|
||||
if(p->getCVarI("lith_weapons_riflemodeclear"))
|
||||
|
@ -344,8 +335,7 @@ void Lith_ResetRifleMode()
|
|||
//
|
||||
// Lith_SurgeOfDestiny
|
||||
//
|
||||
[[__call("ScriptS"), __extern("ACS")]]
|
||||
void Lith_SurgeOfDestiny(void)
|
||||
script acs void Lith_SurgeOfDestiny(void)
|
||||
{
|
||||
for(int i = 0; i < (35 * 7) / 2; i++) {
|
||||
InvGive("Lith_SurgeOfDestiny", 1);
|
||||
|
@ -356,8 +346,7 @@ void Lith_SurgeOfDestiny(void)
|
|||
//
|
||||
// Lith_GetWRF
|
||||
//
|
||||
[[__call("ScriptS"), __extern("ACS")]]
|
||||
int Lith_GetWRF(void)
|
||||
script acs int Lith_GetWRF(void)
|
||||
{
|
||||
enum
|
||||
{
|
||||
|
|
|
@ -22,8 +22,7 @@ void Upgr_7777777_Deactivate(struct player *p, upgrade_t *upgr)
|
|||
//
|
||||
// Update
|
||||
//
|
||||
[[__call("ScriptS")]]
|
||||
void Upgr_7777777_Update(struct player *p, upgrade_t *upgr)
|
||||
script void Upgr_7777777_Update(struct player *p, upgrade_t *upgr)
|
||||
{
|
||||
fixed vel = -2;
|
||||
if(p->velz > 0) vel = p->velz;
|
||||
|
|
|
@ -17,8 +17,7 @@ void Upgr_Adrenaline_Activate(struct player *p, upgrade_t *upgr)
|
|||
//
|
||||
// Update
|
||||
//
|
||||
[[__call("ScriptS")]]
|
||||
void Upgr_Adrenaline_Update(struct player *p, upgrade_t *upgr)
|
||||
script void Upgr_Adrenaline_Update(struct player *p, upgrade_t *upgr)
|
||||
{
|
||||
// Charge
|
||||
if(UData.charge < CHARGE_MAX)
|
||||
|
|
|
@ -24,8 +24,7 @@ void Upgr_CyberLegs_Deactivate(struct player *p, upgrade_t *upgr)
|
|||
//
|
||||
// Update
|
||||
//
|
||||
[[__call("ScriptS")]]
|
||||
void Upgr_CyberLegs_Update(struct player *p, upgrade_t *upgr)
|
||||
script void Upgr_CyberLegs_Update(struct player *p, upgrade_t *upgr)
|
||||
{
|
||||
fixed absvel = absk(p->old.velz) * 10.0k;
|
||||
|
||||
|
|
|
@ -6,8 +6,7 @@
|
|||
//
|
||||
// Update
|
||||
//
|
||||
[[__call("ScriptS")]]
|
||||
void Upgr_Goldeneye_Update(struct player *p, upgrade_t *upgr)
|
||||
script void Upgr_Goldeneye_Update(struct player *p, upgrade_t *upgr)
|
||||
{
|
||||
if(ACS_Random(0, 0x7F) < 0x50)
|
||||
{
|
||||
|
|
|
@ -9,8 +9,7 @@
|
|||
//
|
||||
// CheckTarget
|
||||
//
|
||||
[[__call("ScriptS")]]
|
||||
static int CheckTarget(struct player *p)
|
||||
script static int CheckTarget(struct player *p)
|
||||
{
|
||||
if(ACS_SetActivator(0, AAPTR_PLAYER_GETTARGET))
|
||||
return Lith_UniqueID(0);
|
||||
|
@ -23,8 +22,7 @@ static int CheckTarget(struct player *p)
|
|||
//
|
||||
// Lith_HomingMissile
|
||||
//
|
||||
[[__call("ScriptS"), __extern("ACS")]]
|
||||
void Lith_HomingMissile()
|
||||
script acs void Lith_HomingMissile()
|
||||
{
|
||||
struct player *p = Lith_GetPlayer(0, AAPTR_TARGET);
|
||||
ACS_SetPointer(AAPTR_TRACER, p->tid, AAPTR_TRACER);
|
||||
|
@ -33,8 +31,7 @@ void Lith_HomingMissile()
|
|||
//
|
||||
// Update
|
||||
//
|
||||
[[__call("ScriptS")]]
|
||||
void Upgr_HomingRPG_Update(struct player *p, upgrade_t *upgr)
|
||||
script void Upgr_HomingRPG_Update(struct player *p, upgrade_t *upgr)
|
||||
{
|
||||
if(p->weapontype == weapon_launcher)
|
||||
{
|
||||
|
|
|
@ -8,8 +8,7 @@
|
|||
//
|
||||
// Update
|
||||
//
|
||||
[[__call("ScriptS")]]
|
||||
void Upgr_Implying_Update(struct player *p, upgrade_t *upgr)
|
||||
script void Upgr_Implying_Update(struct player *p, upgrade_t *upgr)
|
||||
{
|
||||
static __str strings[] = {
|
||||
"\Cd>implying",
|
||||
|
|
|
@ -6,8 +6,7 @@
|
|||
//
|
||||
// Update
|
||||
//
|
||||
[[__call("ScriptS")]]
|
||||
void Upgr_InstaDeath_Update(struct player *p, upgrade_t *upgr)
|
||||
script void Upgr_InstaDeath_Update(struct player *p, upgrade_t *upgr)
|
||||
{
|
||||
if(p->health < p->oldhealth)
|
||||
InvGive("Lith_Die", 1);
|
||||
|
|
|
@ -18,8 +18,7 @@ void Upgr_JetBooster_Activate(struct player *p, upgrade_t *upgr)
|
|||
//
|
||||
// Update
|
||||
//
|
||||
[[__call("ScriptS")]]
|
||||
void Upgr_JetBooster_Update(struct player *p, upgrade_t *upgr)
|
||||
script void Upgr_JetBooster_Update(struct player *p, upgrade_t *upgr)
|
||||
{
|
||||
UData.discharged = UData.charge > 60 && UData.charge < CHARGE_MAX;
|
||||
|
||||
|
|
|
@ -26,8 +26,7 @@ void Upgr_lolsords_Deactivate(struct player *p, upgrade_t *upgr)
|
|||
//
|
||||
// Update
|
||||
//
|
||||
[[__call("ScriptS")]]
|
||||
void Upgr_lolsords_Update(struct player *p, upgrade_t *upgr)
|
||||
script void Upgr_lolsords_Update(struct player *p, upgrade_t *upgr)
|
||||
{
|
||||
ACS_SetWeapon("Lith_Sword");
|
||||
}
|
||||
|
|
|
@ -31,8 +31,7 @@ static struct magic_info const minf[] = {
|
|||
//
|
||||
// GiveMagic
|
||||
//
|
||||
[[__call("ScriptS")]]
|
||||
static void GiveMagic(struct magic_info const *m)
|
||||
script static void GiveMagic(struct magic_info const *m)
|
||||
{
|
||||
InvGive(m->classname, 1);
|
||||
ACS_SetWeapon(m->classname);
|
||||
|
@ -41,8 +40,7 @@ static void GiveMagic(struct magic_info const *m)
|
|||
//
|
||||
// UpdateMagicUI
|
||||
//
|
||||
[[__call("ScriptS")]]
|
||||
static void UpdateMagicUI(struct player *p, upgrade_t *upgr)
|
||||
script static void UpdateMagicUI(struct player *p, upgrade_t *upgr)
|
||||
{
|
||||
gui_state_t *g = &UData.gst;
|
||||
|
||||
|
@ -86,8 +84,7 @@ static void UpdateMagicUI(struct player *p, upgrade_t *upgr)
|
|||
//
|
||||
// GivePlayerZ
|
||||
//
|
||||
[[__call("ScriptS")]]
|
||||
static void GivePlayerZ(int tid, struct player *p, __str name)
|
||||
script static void GivePlayerZ(int tid, struct player *p, __str name)
|
||||
{
|
||||
while(ACS_ThingCount(T_NONE, tid)) {
|
||||
ACS_SetUserVariable(tid, name, p->z);
|
||||
|
@ -100,8 +97,7 @@ static void GivePlayerZ(int tid, struct player *p, __str name)
|
|||
//
|
||||
// Lith_SetMagicUI
|
||||
//
|
||||
[[__call("ScriptS"), __extern("ACS")]]
|
||||
void Lith_SetMagicUI(bool on)
|
||||
script acs void Lith_SetMagicUI(bool on)
|
||||
{
|
||||
withplayer(LocalPlayer)
|
||||
{
|
||||
|
@ -135,8 +131,7 @@ void Lith_SetMagicUI(bool on)
|
|||
//
|
||||
// Update
|
||||
//
|
||||
[[__call("ScriptS")]]
|
||||
void Upgr_Magic_Update(struct player *p, upgrade_t *upgr)
|
||||
script void Upgr_Magic_Update(struct player *p, upgrade_t *upgr)
|
||||
{
|
||||
fixed manaperc = p->mana / (fixed)p->manamax;
|
||||
|
||||
|
|
|
@ -8,8 +8,7 @@
|
|||
//
|
||||
// Lith_PunctuatorFire
|
||||
//
|
||||
[[__call("ScriptS"), __extern("ACS")]]
|
||||
void Lith_PunctuatorFire(void)
|
||||
script acs void Lith_PunctuatorFire(void)
|
||||
{
|
||||
withplayer(LocalPlayer)
|
||||
{
|
||||
|
|
|
@ -46,8 +46,7 @@ static void RA_Give(__str name, int n)
|
|||
//
|
||||
// Lith_RA_Give
|
||||
//
|
||||
[[__call("ScriptS"), __extern("ACS")]]
|
||||
void Lith_RA_Give(int num)
|
||||
script acs void Lith_RA_Give(int num)
|
||||
{
|
||||
withplayer(LocalPlayer)
|
||||
{
|
||||
|
|
|
@ -10,8 +10,7 @@
|
|||
//
|
||||
// Lith_DodgeView
|
||||
//
|
||||
[[__call("ScriptS"), __extern("ACS")]]
|
||||
void Lith_DodgeView()
|
||||
script acs void Lith_DodgeView()
|
||||
{
|
||||
withplayer(LocalPlayer)
|
||||
{
|
||||
|
@ -49,8 +48,7 @@ void Upgr_ReflexWetw_Deactivate(struct player *p, upgrade_t *upgr)
|
|||
//
|
||||
// Update
|
||||
//
|
||||
[[__call("ScriptS")]]
|
||||
void Upgr_ReflexWetw_Update(struct player *p, upgrade_t *upgr)
|
||||
script void Upgr_ReflexWetw_Update(struct player *p, upgrade_t *upgr)
|
||||
{
|
||||
if(UData.charge < CHARGE_MAX)
|
||||
UData.charge++;
|
||||
|
|
|
@ -17,8 +17,7 @@ void Upgr_StealthSys_Deactivate(struct player *p, upgrade_t *upgr)
|
|||
//
|
||||
// Update
|
||||
//
|
||||
[[__call("ScriptS")]]
|
||||
void Upgr_StealthSys_Update(struct player *p, upgrade_t *upgr)
|
||||
script void Upgr_StealthSys_Update(struct player *p, upgrade_t *upgr)
|
||||
{
|
||||
fixed vel = absk(p->getVel()) / 10.0;
|
||||
p->alpha = UData.mulvel = lerpk(UData.mulvel, vel, 0.02);
|
||||
|
|
|
@ -23,8 +23,7 @@ void Upgr_UNCEUNCE_Deactivate(struct player *p, upgrade_t *upgr)
|
|||
//
|
||||
// Update
|
||||
//
|
||||
[[__call("ScriptS")]]
|
||||
void Upgr_UNCEUNCE_Update(struct player *p, upgrade_t *upgr)
|
||||
script void Upgr_UNCEUNCE_Update(struct player *p, upgrade_t *upgr)
|
||||
{
|
||||
fixed reeeed = ACS_Sin(p->ticks / 35.0) + 1.0 / 2.0;
|
||||
fixed greeen = ACS_Cos(p->ticks / 24.0) + 1.0 / 2.0;
|
||||
|
|
|
@ -12,8 +12,7 @@
|
|||
//
|
||||
// Update
|
||||
//
|
||||
[[__call("ScriptS")]]
|
||||
void Upgr_VitalScan_Update(struct player *p, upgrade_t *upgr)
|
||||
script void Upgr_VitalScan_Update(struct player *p, upgrade_t *upgr)
|
||||
{
|
||||
ACS_SetActivator(0, AAPTR_PLAYER_GETTARGET);
|
||||
|
||||
|
|
|
@ -13,8 +13,7 @@
|
|||
//
|
||||
// Lith_KeyZoom
|
||||
//
|
||||
[[__call("ScriptS"), __extern("ACS"), __script("net")]]
|
||||
void Lith_KeyZoom(int amt)
|
||||
script acs net void Lith_KeyZoom(int amt)
|
||||
{
|
||||
if(ACS_Timer() < 10) return;
|
||||
|
||||
|
@ -42,8 +41,7 @@ void Upgr_Zoom_Deactivate(struct player *p, upgrade_t *upgr)
|
|||
//
|
||||
// Update
|
||||
//
|
||||
[[__call("ScriptS")]]
|
||||
void Upgr_Zoom_Update(struct player *p, upgrade_t *upgr)
|
||||
script void Upgr_Zoom_Update(struct player *p, upgrade_t *upgr)
|
||||
{
|
||||
if(UData.vzoom < UData.zoom)
|
||||
UData.vzoom = lerpf(UData.vzoom, UData.zoom, 0.099);
|
||||
|
|
|
@ -122,8 +122,7 @@ static bool CheckDead(struct boss *b, int num)
|
|||
//
|
||||
// Lith_PhantomSound
|
||||
//
|
||||
[[__call("ScriptS"), __extern("ACS")]]
|
||||
void Lith_PhantomSound(void)
|
||||
script acs void Lith_PhantomSound(void)
|
||||
{
|
||||
ACS_AmbientSound("enemies/phantom/spawned", 127);
|
||||
}
|
||||
|
@ -131,8 +130,7 @@ void Lith_PhantomSound(void)
|
|||
//
|
||||
// Lith_PhantomTeleport
|
||||
//
|
||||
[[__call("ScriptS"), __extern("ACS")]]
|
||||
void Lith_PhantomTeleport(void)
|
||||
script acs void Lith_PhantomTeleport(void)
|
||||
{
|
||||
fixed ang = ACS_GetActorAngle(0);
|
||||
|
||||
|
@ -147,8 +145,7 @@ void Lith_PhantomTeleport(void)
|
|||
//
|
||||
// Lith_PhantomDeath
|
||||
//
|
||||
[[__call("ScriptS"), __extern("ACS")]]
|
||||
void Lith_PhantomDeath(void)
|
||||
script acs void Lith_PhantomDeath(void)
|
||||
{
|
||||
ACS_StopSound(0, 7);
|
||||
|
||||
|
@ -192,8 +189,7 @@ void Lith_PhantomDeath(void)
|
|||
//
|
||||
// Lith_SpawnBoss
|
||||
//
|
||||
[[__call("ScriptS"), __extern("ACS")]]
|
||||
void Lith_SpawnBoss(void)
|
||||
script acs void Lith_SpawnBoss(void)
|
||||
{
|
||||
if(!boss) return;
|
||||
|
||||
|
@ -211,8 +207,7 @@ void Lith_SpawnBoss(void)
|
|||
//
|
||||
// Lith_TriggerBoss_Script
|
||||
//
|
||||
[[__call("ScriptS"), __extern("ACS"), __address("Lith_TriggerBoss"), __optional_args(1)]]
|
||||
void Lith_TriggerBoss_Script(int diff, int num, int phase)
|
||||
script acs address("Lith_TriggerBoss") optargs(1) void Lith_TriggerBoss_Script(int diff, int num, int phase)
|
||||
{
|
||||
switch(diff)
|
||||
{
|
||||
|
@ -230,8 +225,7 @@ void Lith_TriggerBoss_Script(int diff, int num, int phase)
|
|||
//
|
||||
// Lith_SpawnBosses
|
||||
//
|
||||
[[__call("ScriptS"), __extern("ACS")]]
|
||||
void Lith_SpawnBosses(i96 sum, bool force)
|
||||
script acs void Lith_SpawnBosses(i96 sum, bool force)
|
||||
{
|
||||
if(!force && sum < scorethreshold) return;
|
||||
|
||||
|
|
|
@ -76,8 +76,7 @@ void Lith_InstallSpawnedCBIItems(void)
|
|||
//
|
||||
// Lith_CBIItemWasSpawned
|
||||
//
|
||||
[[__call("ScriptS"), __extern("ACS")]]
|
||||
void Lith_CBIItemWasSpawned(int num)
|
||||
script acs void Lith_CBIItemWasSpawned(int num)
|
||||
{
|
||||
cbispawn[cbispawniter++] = num;
|
||||
}
|
||||
|
@ -85,8 +84,7 @@ void Lith_CBIItemWasSpawned(int num)
|
|||
//
|
||||
// Lith_PickupCBIItem
|
||||
//
|
||||
[[__call("ScriptS"), __extern("ACS")]]
|
||||
void Lith_PickupCBIItem(int num)
|
||||
script acs void Lith_PickupCBIItem(int num)
|
||||
{
|
||||
withplayer(LocalPlayer)
|
||||
Lith_FadeFlash(0, 255, 0, 0.7, 0.5);
|
||||
|
|
|
@ -10,8 +10,7 @@
|
|||
// How to make DECORATE into a decent VM: Registers!
|
||||
|
||||
#define PVarFunc(fn, expr) \
|
||||
[[__call("ScriptS"), __extern("ACS")]] \
|
||||
int fn \
|
||||
script acs int fn \
|
||||
{ \
|
||||
withplayer(LocalPlayer) { \
|
||||
int *val = &p->decvars[var - 1]; \
|
||||
|
@ -21,8 +20,7 @@
|
|||
}
|
||||
|
||||
#define WVarFunc(fn, expr) \
|
||||
[[__call("ScriptS"), __extern("ACS")]] \
|
||||
int fn {int *val = &world.decvars[var - 1]; return expr;}
|
||||
script acs int fn {int *val = &world.decvars[var - 1]; return expr;}
|
||||
|
||||
#define RegisterMachine(reg, name) \
|
||||
reg(L##name##Get(int var ), (*val) ) \
|
||||
|
@ -43,8 +41,7 @@ RegisterMachine(WVarFunc, WVar)
|
|||
//
|
||||
// Lith_UniqueTID
|
||||
//
|
||||
[[__call("ScriptS"), __extern("ACS")]]
|
||||
int Lith_UniqueTID(void)
|
||||
script acs int Lith_UniqueTID(void)
|
||||
{
|
||||
return ACS_UniqueTID();
|
||||
}
|
||||
|
@ -52,8 +49,7 @@ int Lith_UniqueTID(void)
|
|||
//
|
||||
// Lith_Timer
|
||||
//
|
||||
[[__call("ScriptS"), __extern("ACS")]]
|
||||
int Lith_Timer(void)
|
||||
script acs int Lith_Timer(void)
|
||||
{
|
||||
return ACS_Timer();
|
||||
}
|
||||
|
@ -61,8 +57,7 @@ int Lith_Timer(void)
|
|||
//
|
||||
// Lith_UpdateScore
|
||||
//
|
||||
[[__call("ScriptS"), __extern("ACS")]]
|
||||
void Lith_UpdateScore(void)
|
||||
script acs void Lith_UpdateScore(void)
|
||||
{
|
||||
i96 score = ACS_CheckInventory("Lith_ScoreCount") * (double)RandomFloat(0.7f, 1.2f);
|
||||
Lith_GiveAllScore(score, false);
|
||||
|
@ -72,8 +67,7 @@ void Lith_UpdateScore(void)
|
|||
//
|
||||
// Lith_Velocity
|
||||
//
|
||||
[[__call("ScriptS"), __extern("ACS")]]
|
||||
fixed Lith_Velocity(fixed velx, fixed vely)
|
||||
script acs fixed Lith_Velocity(fixed velx, fixed vely)
|
||||
{
|
||||
fixed x = ACS_GetActorX(0);
|
||||
fixed y = ACS_GetActorY(0);
|
||||
|
@ -83,8 +77,7 @@ fixed Lith_Velocity(fixed velx, fixed vely)
|
|||
//
|
||||
// Lith_VelHax
|
||||
//
|
||||
[[__call("ScriptS"), __extern("ACS")]]
|
||||
int Lith_VelHax(int fuck)
|
||||
script acs int Lith_VelHax(int fuck)
|
||||
{
|
||||
ACS_SetActivator(0, AAPTR_MASTER);
|
||||
|
||||
|
@ -101,8 +94,7 @@ int Lith_VelHax(int fuck)
|
|||
//
|
||||
// Lith_Barrier
|
||||
//
|
||||
[[__call("ScriptS"), __extern("ACS")]]
|
||||
void Lith_Barrier()
|
||||
script acs void Lith_Barrier()
|
||||
{
|
||||
withplayer(LocalPlayer)
|
||||
for(int i = 0; p->active && i < 35 * 30; i++)
|
||||
|
@ -115,8 +107,7 @@ void Lith_Barrier()
|
|||
//
|
||||
// Lith_BarrierBullets
|
||||
//
|
||||
[[__call("ScriptS"), __extern("ACS")]]
|
||||
void Lith_BarrierBullets()
|
||||
script acs void Lith_BarrierBullets()
|
||||
{
|
||||
struct player *p = Lith_GetPlayer(0, AAPTR_TARGET);
|
||||
|
||||
|
@ -134,8 +125,7 @@ void Lith_BarrierBullets()
|
|||
//
|
||||
// Lith_BarrierCheck
|
||||
//
|
||||
[[__call("ScriptS"), __extern("ACS")]]
|
||||
bool Lith_BarrierCheck()
|
||||
script acs bool Lith_BarrierCheck()
|
||||
{
|
||||
ACS_SetActivatorToTarget(0);
|
||||
return ACS_CheckFlag(0, "COUNTKILL");
|
||||
|
@ -144,8 +134,7 @@ bool Lith_BarrierCheck()
|
|||
//
|
||||
// Lith_PoisonFXTicker
|
||||
//
|
||||
[[__call("ScriptS"), __extern("ACS")]]
|
||||
void Lith_PoisonFXTicker()
|
||||
script acs void Lith_PoisonFXTicker()
|
||||
{
|
||||
for(int i = 0; i < 17; i++)
|
||||
{
|
||||
|
|
|
@ -19,8 +19,7 @@ extern struct dlgdef *lmvar dlgdefs;
|
|||
|
||||
// Static Functions ----------------------------------------------------------|
|
||||
|
||||
[[__optional_args(1)]]
|
||||
static int *NextCode(struct pstate *d);
|
||||
optargs(1) static int *NextCode(struct pstate *d);
|
||||
static void GetStatement(struct pstate *d);
|
||||
|
||||
// Types ---------------------------------------------------------------------|
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
// Static Objects ------------------------------------------------------------|
|
||||
|
||||
// This is lazy-allocated. Don't touch or GDCC will break your computer's face.
|
||||
[[__no_init]] static dmon_t dmonalloc[DMON_MAX];
|
||||
noinit static dmon_t dmonalloc[DMON_MAX];
|
||||
|
||||
// Extern Objects ------------------------------------------------------------|
|
||||
|
||||
|
@ -60,8 +60,7 @@ void DmonDebugInfo(void)
|
|||
//
|
||||
// DmonPtr
|
||||
//
|
||||
[[__call("ScriptS")]]
|
||||
dmon_t *DmonPtr(int tid, int ptr)
|
||||
script dmon_t *DmonPtr(int tid, int ptr)
|
||||
{
|
||||
if(tid || ptr)
|
||||
ACS_SetActivator(tid, ptr);
|
||||
|
|
|
@ -240,8 +240,7 @@ static void ApplyLevels(dmon_t *m, int prev)
|
|||
//
|
||||
// ShowBarrier
|
||||
//
|
||||
[[__call("StkCall")]]
|
||||
static void ShowBarrier(dmon_t const *m, fixed alpha)
|
||||
stkcall static void ShowBarrier(dmon_t const *m, fixed alpha)
|
||||
{
|
||||
bool anyplayer = false;
|
||||
|
||||
|
@ -329,8 +328,7 @@ static void ApplyPainResist(dmon_t *m)
|
|||
// Spawn a Monster Soul and temporarily set the species of it until the
|
||||
// actor is no longer solid, so it won't explode immediately.
|
||||
//
|
||||
[[__call("ScriptS")]]
|
||||
static void SoulCleave(dmon_t *m, struct player *p)
|
||||
script static void SoulCleave(dmon_t *m, struct player *p)
|
||||
{
|
||||
int tid = ACS_UniqueTID();
|
||||
ACS_SpawnForced("Lith_MonsterSoul", m->ms->x, m->ms->y, m->ms->z + 16, tid);
|
||||
|
@ -420,8 +418,7 @@ static void OnDeath(dmon_t *m)
|
|||
//
|
||||
// Lith_MonsterMain
|
||||
//
|
||||
[[__call("ScriptS"), __alloc_Aut(0x7F)]]
|
||||
void Lith_MonsterMain(dmon_t *m)
|
||||
script stksize(0x7f) void Lith_MonsterMain(dmon_t *m)
|
||||
{
|
||||
struct dmon_stat ms = {};
|
||||
|
||||
|
@ -464,8 +461,7 @@ void Lith_MonsterMain(dmon_t *m)
|
|||
//
|
||||
// Lith_MonsterInfo
|
||||
//
|
||||
[[__call("ScriptS"), __extern("ACS")]]
|
||||
void Lith_MonsterInfo(int tid)
|
||||
script acs void Lith_MonsterInfo(int tid)
|
||||
{
|
||||
if(tid) ACS_SetActivator(tid);
|
||||
while(!world.gsinit) ACS_Delay(1);
|
||||
|
@ -501,8 +497,7 @@ void Lith_MonsterInfo(int tid)
|
|||
//
|
||||
// Lith_MonsterFinalized
|
||||
//
|
||||
[[__call("ScriptS"), __extern("ACS")]]
|
||||
void Lith_MonsterFinalized()
|
||||
script acs void Lith_MonsterFinalized()
|
||||
{
|
||||
ifauto(dmon_t *, m, DmonPtr())
|
||||
OnFinalize(m);
|
||||
|
|
|
@ -15,8 +15,7 @@ enum
|
|||
//
|
||||
// Blinker
|
||||
//
|
||||
[[__call("ScriptS")]]
|
||||
void Blinker(void)
|
||||
script void Blinker(void)
|
||||
{
|
||||
static int const time = 20;
|
||||
|
||||
|
@ -47,8 +46,7 @@ void Blinker(void)
|
|||
//
|
||||
// Lith_Title
|
||||
//
|
||||
[[__call("ScriptS")]]
|
||||
void Lith_Title(void)
|
||||
script void Lith_Title(void)
|
||||
{
|
||||
ACS_Delay(35*5);
|
||||
|
||||
|
|
|
@ -39,8 +39,7 @@ static bool dorain;
|
|||
|
||||
// Extern Functions ----------------------------------------------------------|
|
||||
|
||||
[[__call("ScriptS"), __extern("ACS")]]
|
||||
void Lith_SpawnBosses(i96 sum, bool force);
|
||||
script acs void Lith_SpawnBosses(i96 sum, bool force);
|
||||
|
||||
//
|
||||
// Lith_GetWorldExtern
|
||||
|
@ -53,8 +52,7 @@ worldinfo_t *Lith_GetWorldExtern(void)
|
|||
//
|
||||
// Lith_FreezeTime
|
||||
//
|
||||
[[__call("StkCall")]]
|
||||
void Lith_FreezeTime(bool on)
|
||||
stkcall void Lith_FreezeTime(bool on)
|
||||
{
|
||||
static int lmvar frozen;
|
||||
|
||||
|
@ -95,8 +93,7 @@ void Lith_FreezeTime(bool on)
|
|||
//
|
||||
// Lith_BeginAngles
|
||||
//
|
||||
[[__call("StkCall")]]
|
||||
void Lith_BeginAngles(int x, int y)
|
||||
stkcall void Lith_BeginAngles(int x, int y)
|
||||
{
|
||||
world.a_cur = 0;
|
||||
for(int i = 0; i < countof(world.a_angles); i++)
|
||||
|
@ -111,8 +108,7 @@ void Lith_BeginAngles(int x, int y)
|
|||
//
|
||||
// Lith_AddAngle
|
||||
//
|
||||
[[__call("StkCall")]]
|
||||
fixed Lith_AddAngle(int x, int y)
|
||||
stkcall fixed Lith_AddAngle(int x, int y)
|
||||
{
|
||||
if(world.a_cur >= countof(world.a_angles))
|
||||
return 0;
|
||||
|
@ -125,8 +121,7 @@ fixed Lith_AddAngle(int x, int y)
|
|||
//
|
||||
// Lith_AddAngleScript
|
||||
//
|
||||
[[__call("ScriptS"), __extern("ACS"), __address("Lith_AddAngle")]]
|
||||
void Lith_AddAngleScript(int x, int y)
|
||||
script acs address("Lith_AddAngle") void Lith_AddAngleScript(int x, int y)
|
||||
{
|
||||
Lith_AddAngle(x, y);
|
||||
}
|
||||
|
@ -178,8 +173,7 @@ int Lith_UniqueID(int tid)
|
|||
//
|
||||
// Lith_EmitScore
|
||||
//
|
||||
[[__call("ScriptS"), __extern("ACS")]]
|
||||
void Lith_EmitScore(int amount)
|
||||
script acs void Lith_EmitScore(int amount)
|
||||
{
|
||||
Lith_GiveAllScore(amount, false);
|
||||
}
|
||||
|
@ -187,8 +181,7 @@ void Lith_EmitScore(int amount)
|
|||
//
|
||||
// Lith_EmitEXP
|
||||
//
|
||||
[[__call("ScriptS"), __extern("ACS")]]
|
||||
void Lith_EmitEXP(int amount)
|
||||
script acs void Lith_EmitEXP(int amount)
|
||||
{
|
||||
Lith_GiveAllEXP(amount);
|
||||
}
|
||||
|
@ -196,8 +189,7 @@ void Lith_EmitEXP(int amount)
|
|||
//
|
||||
// Lith_MakeSerious
|
||||
//
|
||||
[[__call("ScriptS"), __extern("ACS")]]
|
||||
void Lith_MakeSerious()
|
||||
script acs void Lith_MakeSerious()
|
||||
{
|
||||
ACS_SetActorProperty(0, APROP_RenderStyle, STYLE_None);
|
||||
ACS_SetActorPropertyString(0, APROP_ActiveSound, "silence");
|
||||
|
@ -208,8 +200,7 @@ void Lith_MakeSerious()
|
|||
//
|
||||
// LPData
|
||||
//
|
||||
[[__call("ScriptS"), __extern("ACS")]]
|
||||
int LPData(int info, int permutation, bool target)
|
||||
script acs int LPData(int info, int permutation, bool target)
|
||||
{
|
||||
if(target) ACS_SetActivatorToTarget(0);
|
||||
|
||||
|
@ -230,8 +221,7 @@ int LPData(int info, int permutation, bool target)
|
|||
//
|
||||
// LWData
|
||||
//
|
||||
[[__call("ScriptS"), __extern("ACS")]]
|
||||
int LWData(int info)
|
||||
script acs int LWData(int info)
|
||||
{
|
||||
switch(info)
|
||||
{
|
||||
|
@ -249,8 +239,7 @@ int LWData(int info)
|
|||
//
|
||||
// Lith_RainDropSpawn
|
||||
//
|
||||
[[__call("ScriptS"), __extern("ACS")]]
|
||||
void Lith_RainDropSpawn()
|
||||
script acs void Lith_RainDropSpawn()
|
||||
{
|
||||
if(rain_chk)
|
||||
{
|
||||
|
@ -266,8 +255,7 @@ void Lith_RainDropSpawn()
|
|||
//
|
||||
// DoRain
|
||||
//
|
||||
[[__call("ScriptS")]]
|
||||
static void DoRain()
|
||||
script static void DoRain()
|
||||
{
|
||||
// Doesn't work in multiplayer, sorry!
|
||||
if(ACS_PlayerCount() > 1)
|
||||
|
@ -338,8 +326,7 @@ static void DoPayout(void)
|
|||
|
||||
Lith_ForPlayer()
|
||||
{
|
||||
[[__call("ScriptS")]]
|
||||
extern void Lith_PlayerPayout(struct player *p);
|
||||
script extern void Lith_PlayerPayout(struct player *p);
|
||||
|
||||
Lith_PlayerPayout(p);
|
||||
}
|
||||
|
@ -350,8 +337,7 @@ static void DoPayout(void)
|
|||
//
|
||||
// CheckEnemyCompat
|
||||
//
|
||||
[[__call("ScriptS")]]
|
||||
static void CheckEnemyCompat(void)
|
||||
script static void CheckEnemyCompat(void)
|
||||
{
|
||||
if(ACS_GetCVar("sv_nomonsters") || world.enemycheck)
|
||||
return;
|
||||
|
@ -380,8 +366,7 @@ static void CheckEnemyCompat(void)
|
|||
//
|
||||
// SpawnBoss
|
||||
//
|
||||
[[__call("ScriptS")]]
|
||||
static void SpawnBoss()
|
||||
script static void SpawnBoss()
|
||||
{
|
||||
ACS_Delay(1); // Delay another tic for monster spawners.
|
||||
|
||||
|
@ -607,13 +592,11 @@ static void WInit(void)
|
|||
//
|
||||
// Lith_World
|
||||
//
|
||||
[[__call("ScriptS"), __script("open")]]
|
||||
static void Lith_World(void)
|
||||
script type("open") static void Lith_World(void)
|
||||
{
|
||||
begin:
|
||||
if(ACS_GameType() == GAME_TITLE_MAP) {
|
||||
[[__call("ScriptS")]]
|
||||
extern void Lith_Title(void);
|
||||
script extern void Lith_Title(void);
|
||||
Lith_Title();
|
||||
return;
|
||||
}
|
||||
|
@ -719,8 +702,7 @@ begin:
|
|||
//
|
||||
// Lith_WorldReopen
|
||||
//
|
||||
[[__call("ScriptS"), __extern("ACS")]]
|
||||
void Lith_WorldReopen(void)
|
||||
script acs void Lith_WorldReopen(void)
|
||||
{
|
||||
reopen = true;
|
||||
}
|
||||
|
@ -728,8 +710,7 @@ void Lith_WorldReopen(void)
|
|||
//
|
||||
// Lith_WorldUnload
|
||||
//
|
||||
[[__call("ScriptS"), __script("unloading")]]
|
||||
static void Lith_WorldUnload(void)
|
||||
script type("unloading") static void Lith_WorldUnload(void)
|
||||
{
|
||||
extern void Lith_InstallSpawnedCBIItems(void);
|
||||
world.unloaded = true;
|
||||
|
|
Reference in New Issue