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 07780dcb authored by deuce's avatar deuce

Finished Bobs Beer and fixed up Status.

Started Drinking.
parent 6efd374c
......@@ -46,7 +46,7 @@ static void Failed_Quest(int level)
{
char *str;
if(asprintf(&str, " %s%s%s failed the %s test for the Secret Order.", config.plycolor, player->name2, config.textcol1, commastr(level))<0)
if(asprintf(&str, " %s%s%s failed the %s test for the Secret Order.", config.plycolor, player->name2, config.textcolor, commastr(level))<0)
CRASH;
newsy(true, "Failed Challenge!", str, NULL);
......@@ -230,7 +230,7 @@ static void Join_Order(void)
GOOD("*****************");
nl();
if(asprintf(&str, " %s%s%s has been accepted as a member of the secret order.", config.plycolor, player->name2, config.textcol1)<0)
if(asprintf(&str, " %s%s%s has been accepted as a member of the secret order.", config.plycolor, player->name2, config.textcolor)<0)
CRASH;
newsy(true, "** SECRET ORDER OF ALCHEMY EXPANDS **", str, NULL);
free(str);
......@@ -460,7 +460,7 @@ static void Buy_Poison(void)
TEXT("You receive the ingredients for the poison.");
TEXT("After a few hours in the laboratory your poison is ready to be tested in the real world!");
nl();
if(asprintf(&str, " %s%s%s, the alchemist, bought poison!", config.plycolor, player->name2, config.textcol1)<0)
if(asprintf(&str, " %s%s%s, the alchemist, bought poison!", config.plycolor, player->name2, config.textcolor)<0)
CRASH;
newsy(true, "Beware!", str, NULL);
free(str);
......
This diff is collapsed.
......@@ -27,10 +27,7 @@ void DefaultConfig()
config.teamcolor=cyan;
config.bashcolor=cyan;
config.itemcolor=lcyan;
// String colours
strcpy(config.textcol1, config.textcolor);
strcpy(config.textcol2, config.highlightcolor);
config.umailheadcolor=cyan;
// Strings
strcpy(config.moneytype, "gold"); // Name of money (ie: Gold)
......
......@@ -45,10 +45,7 @@ struct config {
const char *teamcolor;
const char *bashcolor;
const char *itemcolor;
// String colours
char textcol1[4];
char textcol2[4];
const char *umailheadcolor;
// Strings
char moneytype[23]; // Name of money (ie: Gold)
......
This diff is collapsed.
......@@ -83,6 +83,11 @@ void halt(void)
exit(1);
}
void normal_exit(void)
{
exit(0);
}
void nl(void)
{
door_nl();
......
......@@ -29,6 +29,7 @@ extern int cols;
void colorcode(const char *color);
void outstr(const char *str);
void halt(void);
void normal_exit(void);
void nl(void);
void d(const char *str, ...);
void f(const char *color, const char *fmt, ...);
......
......@@ -2,7 +2,7 @@ CFLAGS += -g -std=c99 -Wall -pedantic
CFLAGS += -I../../conio
LDFLAGS += -lcurses -lm -pthread
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
testmain: Alchemisty.o BobsBeer.o Status.o ShadyShops.o IO.o Config.o Bash.o Races.o Classes.o files.o str.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
......@@ -56,7 +56,7 @@ static void Meny(void *cbdata)
menu("(S)teroid Shop");
menu2(ljust("(O)rbs Health Club", offset));
menu(Asprintf("(G) %s%s%s Magic Services", config.plycolor, config.groggo_name, config.textcol1));
menu(Asprintf("(G) %s%s%s Magic Services", config.plycolor, config.groggo_name, config.textcolor));
menu2(ljust("(B)eer Hut", offset));
menu("(A)lchemists Heaven");
......
......@@ -56,21 +56,21 @@ static void Meny(void *cbdata)
ALLOW_Shield,
};
char *aitext[ALLOW_TOTAL] = {
"Left Hand : ",
"Head : ",
"Face : ",
"Neck : ",
"Neck : ",
"Arms : ",
"Body : ",
"Right Finger : ",
"Left Hand : ",
"Head : ",
"Face : ",
"Neck : ",
"Neck : ",
"Arms : ",
"Body : ",
"Right Finger: ",
"Left Finger : ",
"Around Body : ",
"Legs : ",
"Feet : ",
"Hands : ",
"Waist : ",
"Shield : ",
"Legs : ",
"Feet : ",
"Hands : ",
"Waist : ",
"Shield : ",
};
int current[ALLOW_TOTAL] = {
pl->lhand,
......@@ -90,7 +90,7 @@ static void Meny(void *cbdata)
pl->shield,
};
struct object *arrays[ALLOW_TOTAL] = {
hands,
weapons,
head,
face,
neck,
......@@ -150,7 +150,7 @@ static void Meny(void *cbdata)
// NEW mode displayen starts here
x=0;
memset(itemstr, 0, sizeof(itemstr));
itemstr[x][0]="Weapon : ";
itemstr[x][0]="Weapon : ";
itemstr[x][1]=pl->rhand==-1?nada:weapons[pl->rhand].name;
x++;
for(i=0; i<ALLOW_TOTAL; i++) {
......@@ -240,7 +240,7 @@ static void Meny(void *cbdata)
DL(config.textcolor, itemstr[14][0], itemstr[14][1]);
else
nl();
D(config.textcolor, (pl->class==Cleric || pl->class==Sage || pl->class==Magician)?Asprintf("Mana : %s", Asprintf("%s/%s", commastr(pl->mana), commastr(pl->maxmana))):" ");
D(config.textcolor, (pl->class==Cleric || pl->class==Sage || pl->class==Magician)?Asprintf("Mana : %s", Asprintf("%s/%s", commastr(pl->mana), commastr(pl->maxmana))):" ");
if(itemstr[15][0])
DL(config.textcolor, itemstr[15][0], itemstr[15][1]);
else
......@@ -645,7 +645,7 @@ static bool Inventory_Menu(struct player *pl)
if(pl->item[i]>0) {
if(!items(pl->itemtype[i])[pl->item[i]].cursed) {
DL(config.textcolor, "You drop ", config.itemcolor, items(pl->itemtype[i])[pl->item[i]].name);
pl->item[i]=0;
pl->item[i]=-1;
}
else {
DL(config.textcolor, "You can't drop the ", config.itemcolor, items(pl->itemtype[i])[pl->item[i]].name, config.textcolor, "! It seems to be cursed!");
......
#ifndef _STATUS_H_
#define _STATUS_H_
struct player;
void Status(struct player *pl);
#endif
#include "files.h"
#include "todo.h"
int main(int argc, char **argv)
{
open_files();
player=players;
player->healing=90;
return(0);
}
......@@ -65,6 +65,12 @@
#define kingstring(sex) (sex==Male?"King":"Queen")
#define MANY_MONEY(x) ((x)==1?config.moneytype2:config.moneytype3)
#define SLEEP(x) ({ int sleep_msecs=x; struct timeval tv; \
tv.tv_sec=(sleep_msecs/1000); tv.tv_usec=((sleep_msecs%1000)*1000); \
select(0,NULL,NULL,NULL,&tv); })
#define PART(...) d(config.textcolor, __VA_ARGS__, NULL) // GREEN
#define PLAYER(...) d(config.plycolor, __VA_ARGS__, NULL) // BRIGHT_GREEN
......
const char *sex[2] = {
"him",
"her"
};
const char *sex2[2] = {
"he",
"she"
};
const char *sex3[2] = {
"his",
"her"
};
const char *sex4[2] = {
"himself",
"herself"
};
const char *sex5[2] = {
"husband",
"wife"
};
const char *sex6[2] = {
"boy",
"girl"
};
const char *sex7[2] = {
"son",
"daughter"
};
const char *sex8[2] = {
"father",
"mother"
};
#ifndef _STR_H_
#define _STR_H_
extern const char *sex[2];
extern const char *sex2[2];
extern const char *sex3[2];
extern const char *sex4[2];
extern const char *sex5[2];
extern const char *sex6[2];
extern const char *sex7[2];
extern const char *sex8[2];
#endif
......@@ -46,7 +46,8 @@ void newsy(bool trailing_line, ...)
int rand_num(int limit)
{
return(limit-1);
D(lred, Asprintf("RANDOM(%d):", limit));
return(get_number(0, limit-1));
}
void objekt_affect(int i, uint16_t index, enum objtype type, struct player *pl, bool loud)
......@@ -137,9 +138,19 @@ struct onliner *onliner=&onliner_str;
bool global_begged=false;
bool global_nobeg=false;
void Bobs_Inn(void)
void Drinking_Competition(void)
{
BAD("Bob's Inn not implemented!");
BAD("DRINKING COMPETITION not implemented!");
}
void Brawl(void)
{
BAD("BRAWL not implemented!");
}
void Post(enum mailaction action, const char *to, enum aitype toai, bool togod, enum mailspecial special, const char *from, ...)
{
BAD("POST not implemented!");
}
void Groggos_Magic(void)
......@@ -178,6 +189,21 @@ int CIOLIB_main(int argc, char **argv)
player->class=Alchemist;
onliner=onliners;
DefaultConfig();
// Open the shops...
king->shop_weapon=true;
king->shop_armor=true;
king->shop_magic=true;
king->shop_alabat=true;
king->shop_plmarket=true;
king->shop_healing=true;
king->shop_drugs=true;
king->shop_steroids=true;
king->shop_orbs=true;
king->shop_evilmagic=true;
king->shop_bobs=true;
king->shop_gigolos=true;
Shady_Shops();
return(0);
}
......@@ -71,6 +71,7 @@ enum places {
};
#define MAXITEM 15 // Most items you can carry at a time...
#define MAXSPELLS 12 // Max spells available
struct player {
char name1[71]; // BBS Name
char name2[71]; // Game name (used in news messages)
......@@ -162,6 +163,12 @@ struct player {
int p_kills;
int p_defeats;
int resurrections;
bool spell[MAXSPELLS][2];
enum aitype ai;
int darknr; // Dark Deeds remaining
int thiefs;
int brawls;
int chivnr; // Good deeds left
};
#define MAX_PLAYERS 1024
......@@ -179,4 +186,47 @@ extern struct config config;
extern bool global_begged;
extern bool global_nobeg;
enum mailaction {
MailRead,
MailSend
};
enum mailspecial {
MAILREQUEST_Nothing,
MAILREQUEST_BeMyGuard,
MAILREQUEST_IWantGuard,
MAILREQUEST_DrinkOffer,
// Immortal
MAILREQUEST_ImmortalOffer = 40,
MAILREQUEST_RoyalAngel = 50,
MAILREQUEST_RoyalAvenger,
MAILREQUEST_QuestOffer = 60,
MAILREQUEST_Birthday,
// Relationship
MAILREQUEST_HoldHands = 70,
MAILREQUEST_Roses,
MAILREQUEST_Poison,
MAILREQUEST_Dinner,
MAILREQUEST_Scorpions,
MAILREQUEST_Chocolate,
MAILREQUEST_Kiss,
MAILREQUEST_HaveSex,
MAILREQUEST_HaveDiscreteSex,
MAILREQUEST_ScanForBabies,
MAILREQUEST_ChildRaisingExp,
MAILREQUEST_ChildPoisonedExp,
MAILREQUEST_ChildFightExp,
MAILREQUEST_SilentExp,
MAILREQUEST_ChildCursedExp,
MAILREQUEST_ChildDepressedExp,
MAILREQUEST_GymMembership = 89,
MAILREQUEST_JoinTeam
};
void Post(enum mailaction, const char *to, enum aitype toai, bool togod, enum mailspecial special, const char *from, ...);
void Brawl(void);
void Drinking_Competition(void);
#endif
......@@ -2,6 +2,8 @@
* Various functions
*/
#include <sys/limits.h>
#include "IO.h"
#include "Config.h"
#include "files.h"
......@@ -129,6 +131,13 @@ void decplayermoney(struct player *pl, long coins)
pl->gold=0;
}
void incplayermoney(struct player *pl, long coins)
{
pl->gold += coins;
if(pl->gold < 0)
pl->gold=INT_MAX;
}
void Quick_Healing(struct player *pl)
{
int quaff;
......@@ -201,3 +210,34 @@ void Healing(struct player *pl)
}
}
}
int HitChance(int skill)
{
switch(skill) {
case 0:
return 7;
case 1:
case 2:
case 3:
return 6;
case 4:
case 5:
case 6:
return 5;
case 7:
case 8:
case 9:
case 10:
return 4;
case 11:
case 12:
case 13:
case 14:
return 3;
case 15:
case 16:
case 17:
return 2;
}
return(8);
}
#ifndef _VARIOUS_H_
#define _VARIOUS_H_
#include "files.h"
extern const char *color[11];
struct player;
void Display_Menu(bool force, bool terse, bool *refresh, const char *name, const char *expert_prompt, void (*Meny)(void *), void *cbdata);
long level_raise(int level, long exp);
struct object *items(enum objtype type);
const char *immunity(int val);
void Reduce_Player_Resurrections(struct player *pl, bool typeinfo);
void decplayermoney(struct player *pl, long coins);
void incplayermoney(struct player *pl, long coins);
void Quick_Healing(struct player *pl);
void Healing(struct player *pl);
int HitChance(int skill);
#endif
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment