Commit 68000d17 authored by Boris Mühmer's avatar Boris Mühmer
Browse files

used "indent -linux" for formatting C files

parent 6c847297
Loading
Loading
Loading
Loading
+14 −12
Original line number Diff line number Diff line
@@ -6,7 +6,9 @@ void berserker(int pla)
	int i;
	c.com = DECLARE;
	c.par[1] = WAR;
  for(c.par[0]=0;c.par[0]<PLAYERNO;c.par[0]++) if(general.relation[pla][c.par[0]]!=WAR && pla!=c.par[0]) do_command(pla,&c);
	for (c.par[0] = 0; c.par[0] < PLAYERNO; c.par[0]++)
		if (general.relation[pla][c.par[0]] != WAR && pla != c.par[0])
			do_command(pla, &c);
	/* Only mini routine programmed */
	/* Fully implemented in the rest of the code and only waiting to be programmed */
	/* with any interesting strategical idea */
+53 −50
Original line number Diff line number Diff line
@@ -5,39 +5,41 @@ void conquest(void)
	int pla, sta, x, y;
	char *year = "Year 0000";
	init();
  do
    {
	do {
		general.time++;
		qstr(general.time, year + 5);
    cprint(PLAYERNO,"COSMIC CONQUEST",year,"Please wait","while fighting","");
    for(sta=0;sta<STARNO;sta++)
      {
		cprint(PLAYERNO, "COSMIC CONQUEST", year, "Please wait",
		       "while fighting", "");
		for (sta = 0; sta < STARNO; sta++) {
			update(sta);
			if (fight(sta))
        cprint(PLAYERNO,"COSMIC CONQUEST",year,"Please wait","while fighting","");
				cprint(PLAYERNO, "COSMIC CONQUEST", year,
				       "Please wait", "while fighting", "");
		}
    for(pla=0;pla<PLAYERNO;pla++)
      {
      cprint(PLAYERNO,"COSMIC CONQUEST",year,"It is the turn of",general.pname[pla],"");
		for (pla = 0; pla < PLAYERNO; pla++) {
			cprint(PLAYERNO, "COSMIC CONQUEST", year,
			       "It is the turn of", general.pname[pla], "");
			wait_space(pla);
      if(comp_cmp("klingon",general.pname[pla])) klingon(pla);
      else 
      if(comp_cmp("romulan",general.pname[pla])) romulan(pla);
      else 
      if(comp_cmp("alien",general.pname[pla])) alien(pla);
      else 
      if(comp_cmp("berserker",general.pname[pla])) berserker(pla);
      else if(!comp_cmp("dead",general.pname[pla])) human(pla);
      if (mode3)
        {
        x=mode2;mode2=0;y=mode3;mode3=0;
        if (!display_check(pla) && exists(pla))
          {
          mode2=x;mode3=y;
			if (comp_cmp("klingon", general.pname[pla]))
				klingon(pla);
			else if (comp_cmp("romulan", general.pname[pla]))
				romulan(pla);
			else if (comp_cmp("alien", general.pname[pla]))
				alien(pla);
			else if (comp_cmp("berserker", general.pname[pla]))
				berserker(pla);
			else if (!comp_cmp("dead", general.pname[pla]))
				human(pla);
          }
        else
          {
			if (mode3) {
				x = mode2;
				mode2 = 0;
				y = mode3;
				mode3 = 0;
				if (!display_check(pla) && exists(pla)) {
					mode2 = x;
					mode3 = y;
					human(pla);
				} else {
					mode2 = x;
					mode3 = y;
				}
@@ -45,7 +47,8 @@ void conquest(void)
			clean_task(pla);
			clearall(pla);
		}
    cprint(PLAYERNO,"COSMIC CONQUEST",year,"Please wait","while processing turn","");
		cprint(PLAYERNO, "COSMIC CONQUEST", year, "Please wait",
		       "while processing turn", "");
		process_turn();
	}
	while (playon());
+9 −6
Original line number Diff line number Diff line
@@ -3,7 +3,10 @@
int att_task(int pla, int tas)
{
	int shi;
  if(task[pla][tas].headed==-1) return(0);
  for(shi=0;shi<SHIPNO-2;shi++) if(INTASK(pla,tas,shi) && ship[shi].attackno) return(1);
	if (task[pla][tas].headed == -1)
		return (0);
	for (shi = 0; shi < SHIPNO - 2; shi++)
		if (INTASK(pla, tas, shi) && ship[shi].attackno)
			return (1);
	return (0);
}
+22 −22
Original line number Diff line number Diff line
@@ -3,20 +3,20 @@
void clean_task(int pla)
{
	int tas, shi;
  for(tas=0;tas<TASKNO;tas++)
    {
    if (task[pla][tas].headed==-1) continue;
	for (tas = 0; tas < TASKNO; tas++) {
		if (task[pla][tas].headed == -1)
			continue;
		for (shi = 0; shi < SHIPNO; shi++)
      if(task[pla][tas].ship_free[shi] || task[pla][tas].ship_load[shi]) break;
    if(shi==SHIPNO)
      {
			if (task[pla][tas].ship_free[shi]
			    || task[pla][tas].ship_load[shi])
				break;
		if (shi == SHIPNO) {
			task[pla][tas].headed = -1;
			continue;
		}
		while (task_free(pla, tas) < 0)
			for (shi = 0; shi < SHIPNO; shi++)
        if(task[pla][tas].ship_load[shi]>0)
          {
				if (task[pla][tas].ship_load[shi] > 0) {
					task[pla][tas].ship_load[shi]--;
					task[pla][tas].ship_free[shi]++;
					break;
+10 −6
Original line number Diff line number Diff line
@@ -2,7 +2,11 @@

int comp_cmp(char *name, char *str)
{
  while(_tolower(*name)==_tolower(*str) && *name!='\0') {name++;str++;}
  if(*name=='\0') return(1);
	while (_tolower(*name) == _tolower(*str) && *name != '\0') {
		name++;
		str++;
	}
	if (*name == '\0')
		return (1);
	return (0);
}
Loading