marrub
/
Lithia
Archived
1
0
Fork 0
This repository has been archived on 2023-06-17. You can view files and clone it, but cannot push or open issues/pull-requests.
Lithia/source/Headers/lith_bip.h

86 lines
1.9 KiB
C

// Copyright © 2016-2017 Graham Sanderson, all rights reserved.
#if defined(LITH_X)
LITH_X(WEAPONS, "Weapons")
LITH_X(ENEMIES, "Adversaries")
LITH_X(YOURSELF, "Yourself")
LITH_X(UPGRADES, "Upgrades")
LITH_X(PLACES, "Locations")
LITH_X(CORPORATIONS, "Companies")
LITH_X(MAIL, "Mail")
#undef LITH_X
#elif !defined(LITH_BIP_H)
#define LITH_BIP_H
#include "lith_list.h"
// Extern Functions ----------------------------------------------------------|
script void Lith_PlayerInitBIP(struct player *p);
struct bippage_s *Lith_FindBIPPage(struct bip_s *bip, __str name);
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 ---------------------------------------------------------------------|
enum
{
BIPC_NONE,
#define LITH_X(name, capt) BIPC_##name,
#include "lith_bip.h"
BIPC_MAX,
BIPC_MAIN,
};
enum
{
MAILF_NoPrint = 1 << 0,
MAILF_AllPlayers = 1 << 1,
};
typedef __str bip_unlocks_t[5];
typedef struct bippage_s
{
__str name;
__str image;
__str body;
__str title;
int height;
int category;
bool unlocked;
list_t link;
bip_unlocks_t unlocks;
} bippage_t;
typedef struct bip_s
{
__prop find {call: Lith_FindBIPPage (this)}
__prop unlock {call: Lith_UnlockBIPPage(this)}
__prop deallocate {call: Lith_DeallocateBIP(this)}
// Stats
int categoryavail[BIPC_MAX];
int categorymax[BIPC_MAX];
int pageavail;
int pagemax;
int mailreceived;
int mailtrulyreceived;
// State
bool init;
bippage_t *curpage;
int curpagenum;
int curcategory;
int lastcategory;
int scroll;
bippage_t *result[8];
int resnum;
int rescur;
// Info
list_t infogr[BIPC_MAX];
} bip_t;
#endif