|
|
DataMuseum.dkPresents historical artifacts from the history of: DKUUG/EUUG Conference tapes |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about DKUUG/EUUG Conference tapes Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - downloadIndex: T d
Length: 1876 (0x754)
Types: TextFile
Names: »declare.c«
└─⟦b20c6495f⟧ Bits:30007238 EUUGD18: Wien-båndet, efterår 1987
└─⟦this⟧ »EUUGD18/General/Gb/declare.c«
/*
** Galactic Bloodshed (Robert Chansky, smq@b)
** declare.c -- declare alliance, neutrality, war, the basic thing.
*/
#include "vars.h"
#include "races.h"
#include <signal.h>
#include <ctype.h>
#include <setjmp.h>
extern jmp_buf main_jenv;
declare(APcount, argn,args)
int APcount;
int argn;
char args[MAXARGS][COMMANDSIZE];
{
void declare_handler();
char str[RNAMESIZE];
racetype *alien;
int n;
signal(SIGINT, declare_handler);
/* look in sdata for APs first */
if (Sdata.AP[Playernum] >= APcount) /* enufAPs would print something */
deductAPs(APcount, 0, 1);
/* otherwise use current star */
else if (Dir.level==LEVEL_STAR && Dir.level==LEVEL_PLAN) {
if (enufAP(Stars[Dir.snum]->AP, APcount) )
deductAPs(APcount, Dir.snum, 0);
} else {
printf("You don't have enough AP's (%d)\n",APcount);
declare_handler();
}
printf("declare with which player? ");
scanf("%25[^\n]", str);
getchr();
GetPlayer(str, &n, &alien);
if (n == -1) {
printf("No such player.\n");
return;
}
printf("declare alliance, neutrality, or war on %s (%d)? ", alien->name, n);
scanf("%25s",str);
switch (*str) {
case 'a':
setbit(Race->allied, n);
clrbit(Race->atwar, n);
if (int_rand(0,100) >= 96)
printf("But would you want your sister to marry one?\n");
else
printf("Good for you.\n");
break;
case 'n':
clrbit(Race->allied, n);
clrbit(Race->atwar, n);
printf("Done.\n");
break;
case 'w':
setbit(Race->atwar, n);
clrbit(Race->allied, n);
if (int_rand(0,100) >= 96)
printf("Your enemies flaunt their secondary male reproductive glands in your\ngeneral direction.\n");
else
printf("Give 'em hell!\n");
break;
default:
declare_handler();
break;
}
putrace(Race);
}
void declare_handler(sig, code, scp)
int sig,code;
struct sigcontext *scp;
{
longjmp(main_jenv,1);
}