Synchronet now requires the libarchive development package (e.g. libarchive-dev on Debian-based Linux distros, libarchive.org for more info) to build successfully.

Commit b9820dd0 authored by deuce's avatar deuce

Chug chug chug...

Status display is working now.
parent cd17d84a
......@@ -41,7 +41,7 @@ C translation Copyright 2009 Stephen Hurd
static const char *name="Alchemist Store";
static const char *expert_prompt="(B,S,T,R,?)";
static void Failed_Quest(uint8_t level)
static void Failed_Quest(int level)
{
char *str;
......@@ -63,7 +63,7 @@ static void Failed_Quest(uint8_t level)
/*
* Returns a string with info on how strong the current poison is
*/
static const char *Alchemist_Poison(const struct player *rec)
const char *Alchemist_Poison(const struct player *rec)
{
if(rec->poison > 80)
return "Deadly";
......@@ -340,7 +340,7 @@ static bool Chamber_Menu(void)
break;
case 'S':
clr();
status(player);
Status(player);
break;
case 'C':
Create_Poison();
......@@ -492,7 +492,7 @@ static bool Menu(bool * refresh)
break;
case 'S': // Status
clr();
status(player);
Status(player);
break;
case 'T': // The Secret Order
nl();
......
#ifndef _ALCHEMISTY_H_
#define _ALCHEMISTY_H_
struct player;
void Alchemisty(void);
const char *Alchemist_Poison(const struct player *rec);
#endif
#include "Bash.h"
const char *UCBashName[BASH_COUNT] = {
"Tackle",
"Drop-Kick",
"Uppercut",
"Bite",
"Leg-Sweep",
"JointBreak",
"Knifehand",
"Nerve Punch",
"Chokehold",
"Headbash",
"Pull Hair",
"Kick",
"Straight Punch",
"Ram"
};
const char *BashRank[RANK_COUNT] = {
"Rotten",
"Awful",
"Lousy",
"Pathetic",
"Bad",
"Poor",
"Incompetent",
"Below average",
"Average",
"Above Average",
"Pretty good",
"Competent",
"Good",
"Very good",
"Extraordinary",
"Excellent",
"Superb",
"*COMPLETE*",
};
#ifndef _BASH_H_
#define _BASH_H_
enum bash {
Tackle,
DropKick,
Uppercut,
Bite,
LegSweep,
JointBreak,
Knifehand,
NervePunch,
Chokehold,
Headbash,
PullHair,
Kick,
StraightPunch,
Ram,
BASH_COUNT
};
extern const char *UCBashName[BASH_COUNT];
enum bash_rank {
Rotten,
Awful,
Lousy,
Pathetic,
Bad,
Poor,
Incompetent,
BelowAverage,
Average,
AboveAverage,
PrettyGood,
Competent,
Good,
VeryGood,
Extraordinary,
Excellent,
Superb,
COMPLETE,
RANK_COUNT
};
extern const char *BashRank[RANK_COUNT];
#endif
......@@ -398,7 +398,7 @@ static void Shakedown(void)
post(MailSend, player->name2, player->ai, false, mailrequest_nothing(),
"",
Asprintf("%sLast breath%s", umailheadc, config.textcol1),
mkstring(11,'_'),
mkstring(11,196),
Asprintf("You were killed by a band of thieves outside %s.", config.bobsplace),
Asprintf("They took all your %s.", config.moneytype),
"You ended up with a dagger in the back...",
......@@ -1154,7 +1154,7 @@ void Bobs_Inn(void)
end;
'S':begin
clearscreen;
status(player);
Status(player);
end;
'D':begin
crlf; crlf;
......
#include "Classes.h"
const char *UCClassNames[MAXCLASSES] = {
"Alchemist",
"Assassin",
"Barbarian",
"Bard",
"Cleric",
"Jester",
"Magician",
"Paladin",
"Ranger",
"Sage",
"Warrior"
};
const char *LCClassNames[MAXCLASSES] = {
"alchemist",
"assassin",
"barbarian",
"bard",
"cleric",
"jester",
"magician",
"paladin",
"ranger",
"sage",
"warrior"
};
const char *PluralClassNames[MAXCLASSES] = {
"alchemists",
"assassins",
"barbariana",
"bards",
"clerics",
"jesters",
"magicians",
"paladins",
"rangera",
"sages",
"warriors"
};
#ifndef _CLASSES_H_
#define _CLASSES_H_
enum class {
Alchemist,
Assassin,
Barbarian,
Bard,
Cleric,
Jester,
Magician,
Paladin,
Ranger,
Sage,
Warrior,
MAXCLASSES
};
extern const char *UCClassNames[MAXCLASSES];
extern const char *LCClassNames[MAXCLASSES];
extern const char *PluralClassNames[MAXCLASSES];
#endif
......@@ -24,6 +24,9 @@ void DefaultConfig()
config.eventcolor=lgreen; // Events
config.moneycolor=yellow;
config.bracketcolor=green; // Use by menu()
config.teamcolor=cyan;
config.bashcolor=cyan;
config.itemcolor=lcyan;
// String colours
strcpy(config.textcol1, config.textcolor);
......@@ -36,8 +39,13 @@ void DefaultConfig()
strcpy(config.reese_name, "Reese");
strcpy(config.groggo_name, "Groggo");
strcpy(config.bobsplace, "Bob's Place");
strcpy(config.returnenter, "Return");
// Allow/disallow
config.allow_drugs=true;
config.allow_steroids=true;
memset(config.allowitem, 0xff, sizeof(config.allowitem));
// Gameplay
config.classic=false;
}
......@@ -3,6 +3,25 @@
#include <stdbool.h>
enum allow_items {
ALLOW_Hand,
ALLOW_Head,
ALLOW_Body,
ALLOW_Arm,
ALLOW_LeftFinger,
ALLOW_RightFinger,
ALLOW_Leg,
ALLOW_Feet,
ALLOW_Waist,
ALLOW_Neck1,
ALLOW_Neck2,
ALLOW_Face,
ALLOW_Shield,
ALLOW_AroundBody,
ALLOW_SecondaryWeapon,
ALLOW_TOTAL
};
struct config {
// Integer colours
const char *textcolor; // Normal text colour for display (same as textcol1)
......@@ -23,6 +42,9 @@ struct config {
const char *eventcolor; // Events
const char *moneycolor;
const char *bracketcolor;
const char *teamcolor;
const char *bashcolor;
const char *itemcolor;
// String colours
char textcol1[4];
......@@ -35,10 +57,15 @@ struct config {
char reese_name[23]; // Name of "Reese" from Armor shoppe
char groggo_name[23];// Name of "Groggo" from shady shoppe
char bobsplace[23]; // Name of Bobs Place
char returnenter[23];// Name of return/enter key
// Allow/disallow
bool allow_drugs;
bool allow_steroids;
bool allowitem[ALLOW_TOTAL];
// Gameplay
bool classic;
};
extern struct config config;
......
......@@ -5,23 +5,23 @@
#include <stdint.h>
#include <stdbool.h>
extern const char *black;
extern const char *blue;
extern const char *green;
extern const char *cyan;
extern const char *red;
extern const char *magenta;
extern const char *brown;
extern const char *lgray;
extern const char *dgray;
extern const char *lblue;
extern const char *lgreen;
extern const char *lcyan;
extern const char *lred;
extern const char *lmagenta;
extern const char *yellow;
extern const char *white;
extern const char *blread;
extern const char *black; // 0
extern const char *blue; // 1
extern const char *green; // 2
extern const char *cyan; // 3
extern const char *red; // 4
extern const char *magenta; // 5
extern const char *brown; // 6
extern const char *lgray; // 7
extern const char *dgray; // 8
extern const char *lblue; // 9
extern const char *lgreen; // 10
extern const char *lcyan; // 11
extern const char *lred; // 12
extern const char *lmagenta;// 13
extern const char *yellow; // 14
extern const char *white; // 15
extern const char *blread; // 99
extern int lines;
extern int cols;
......@@ -43,7 +43,7 @@ long get_a_number(long min, long max, long dflt);
long get_number(long min, long max);
#define D(...) d(__VA_ARGS__, NULL)
#define DL(...) d(__VA_ARGS__, NULL); nl()
#define DL(...) ({ d(__VA_ARGS__, NULL); nl(); })
#define F(...) f(__VA_ARGS__, NULL)
#endif
......@@ -2,9 +2,7 @@ CFLAGS += -g -std=c99 -Wall -pedantic
CFLAGS += -I../../conio
LDFLAGS += -lcurses -lm -pthread
all: Alchemisty.o ArmorShop.o ShadyShops.o IO.o Config.o files.o various.o test
testmain: Alchemisty.o ShadyShops.o IO.o Config.o files.o testmain.o various.o ../../conio/gcc.freebsd.lib.ace.hurd.local/libciolib_mt.a ../../xpdev/gcc.freebsd.lib.ace.hurd.local/libxpdev_mt.a
testmain: Alchemisty.o Status.o ShadyShops.o IO.o Config.o Bash.o Races.o Classes.o files.o testmain.o various.o ../../conio/gcc.freebsd.lib.ace.hurd.local/libciolib_mt.a ../../xpdev/gcc.freebsd.lib.ace.hurd.local/libxpdev_mt.a
clean:
rm -rf *.o
#include "Races.h"
const char *UCRaceName[RACE_COUNT] = {
"Human",
"Hobbit",
"Elf",
"Half-Elf",
"Dwarf",
"Troll",
"Orc",
"Gnome",
"Mutant"
};
const char *LCRaceName[RACE_COUNT] = {
"human",
"hobbit",
"elf",
"half-elf",
"dwarf",
"troll",
"orc",
"gnome",
"mutant"
};
const char *PluralRaceName[RACE_COUNT] = {
"humans",
"hobbits",
"elves",
"half-elves",
"dwarves",
"trolls",
"orcs",
"gnomes",
"mutants"
};
#ifndef _RACES_H_
#define _RACES_H_
enum race {
Human,
Hobbit,
Elf,
HalfElf,
Dwarf,
Troll,
Orc,
Gnome,
Gnoll,
Mutant,
RACE_COUNT
};
extern const char *UCRaceName[RACE_COUNT];
extern const char *LCRaceName[RACE_COUNT];
extern const char *PluralRaceName[RACE_COUNT];
#endif
This diff is collapsed.
#ifndef _DOORIO_H_
#define _DOORIO_H_
#include <stdbool.h>
/*
* Sets the current DOS text attribute to attr
*/
......@@ -19,7 +24,20 @@ void door_nl(void);
int door_readch(void);
/*
* Clears the screen (either to black OR to corrent attr... doesn't matter
* Clears the screen (either to black OR to corrent attr... doesn't matter)
* and moves to position 1;1
*/
void door_clearscreen(void);
struct dropfile_info {
bool ansi;
};
struct door_info {
int time_left; // Minutes
};
extern struct dropfile_info dropfile;
extern struct door_info door;
#endif
......@@ -84,6 +84,9 @@ struct weapon *weapon;
struct map_file monster_map;
struct monster *monster;
struct map_file level_map;
struct level *levels;
static size_t align(size_t val)
{
int pagesize=getpagesize();
......@@ -188,4 +191,7 @@ void open_files(void)
map_file("weapons.dat", &weapons_map, SIZE_T_MAX);
weapons=weapons_map.data;
map_file("level.dat", &level_map, SIZE_T_MAX);
levels=level_map.data;
}
......@@ -2,46 +2,20 @@
#define _FILES_H_
#include <stdbool.h>
#include <inttypes.h>
#include <time.h>
#include <unistd.h>
#include "Races.h"
#include "Classes.h"
#define MAX_POISON 21
struct poison {
uint32_t cost;
uint16_t strength;
int cost;
int strength;
char name[71];
};
enum race {
Human,
Hobbit,
Elf,
HalfElf,
Dwarf,
Troll,
Orc,
Gnome,
Gnoll,
Mutant
};
enum class {
Alchemist,
Assassin,
Barbarian,
Bard,
Cleric,
Jester,
Magician,
Paladin,
Ranger,
Sage,
Warrior,
MAXCLASSES
};
enum sex {
Male,
Female,
......@@ -146,6 +120,13 @@ enum onlinetype {
#define MAXNOD 5
#define MAX_ONLINERS 1000
enum ear {
ear_all,
ear_personal,
ear_quiet
};
struct onliner {
bool online;
char name[31]; // Player Alias
......@@ -166,7 +147,7 @@ struct onliner {
char chatsend[MAXNOD][91];
char info[MAXNOD][91];
char infosend[MAXNOD][31];
uint8_t ear; // how much info does the player want to get when online, see cms.pas and ear constants
enum ear ear; // how much info does the player want to get when online, see cms.pas and ear constants
char bname[31]; // online opponents name
char comfile[91]; // name of file in which online comm will take place
char com; // used in player<=>player online routines
......@@ -190,7 +171,8 @@ enum objtype {
Food,
Drink,
Weapon,
ABody
ABody,
TOTAL_OBJTYPES
};
enum cures {
......@@ -264,15 +246,15 @@ struct king {
enum aitype ai;
enum sex sexy;
long daysinpower;
uint8_t tax;
char tax; // Percentage
enum alignment taxalignment;
long treasury;
uint8_t prisonsleft; // # of people king can imprison today. new every day
uint8_t executeleft; // # of death sentences left today. new every day
uint16_t questsleft; // # of new quests the king can issue today
uint16_t marryactions; // # of marriages the king can interfer in today
uint8_t wolffeed; // # kids have can be tossed to the wolves/day, set to config.allowfeedingthewolves at maint
uint8_t royaladoptions; // # kids can be placed in the Royal Orphanage/day, set to config.allowRoyalAdoption at maint
int prisonsleft; // # of people king can imprison today. new every day
int executeleft; // # of death sentences left today. new every day
int questsleft; // # of new quests the king can issue today
int marryactions; // # of marriages the king can interfer in today
int wolffeed; // # kids have can be tossed to the wolves/day, set to config.allowfeedingthewolves at maint
int royaladoptions; // # kids can be placed in the Royal Orphanage/day, set to config.allowRoyalAdoption at maint
char moatid[16]; // unique moat creature ID
int moatnr; // how many crocodiles (or whatever) in the moat?
char guard[KINGGUARDS][31]; // king body guards, name
......@@ -302,9 +284,9 @@ struct monster {
bool grabweap; // Can weapon be taken
bool grabarm; // Car armour be taken
char phrase[71]; // Intro phrase from monster
int magicres; // Magic resistance
int strength;
int defence;
int magicres; // Magic resistance
int strength;
int defence;
bool wuser; // Weapon User
bool auser; // Armour User
long hps;
......@@ -314,10 +296,10 @@ struct monster {
long weappow; // Weapon Power
long armpow; // Armour power
int iq;
uint8_t evil; // Evilne4ss (0-100%)
uint8_t magiclevel; // The higher this is, the better the magic is
int mana; // Manna remaining
int maxmana;
int evil; // Evilne4ss (0-100%)
int magiclevel; // The higher this is, the better the magic is
int mana; // Manna remaining
int maxmana;
bool spell[MAXMSPELLS]; // Monster Spells
long punch; // Temporary battle var(!)
......@@ -325,6 +307,10 @@ struct monster {
int target; // Temp. battle var
};
struct level {
int xpneed;
};
struct map_file {
int fd;
off_t len;
......@@ -398,6 +384,8 @@ extern struct weapon *weapon;
extern struct map_file monster_map;
extern struct monster *monster;
extern struct map_file level_map;
extern struct level *levels;
void open_files(void);
......
......@@ -3,5 +3,4 @@
#include <inttypes.h>
#endif
<