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

splitted conquest

parent 95059435
Loading
Loading
Loading
Loading
+2 −1229

File changed.

Preview size limit exceeded, changes collapsed.

amiga/conquest.h

0 → 100644
+16 −0
Original line number Diff line number Diff line
#include <stdio.h>
#include <ctype.h>
#include <fcntl.h>
#include "defs.h"

extern struct NStar star[STARNO];
extern struct NTask task[PLAYERNO][TASKNO+1];
extern struct NCommData CommData[PLAYERNO];
extern struct NGeneral general;
extern int growth[PLANETNO];
extern struct NShip ship[SHIPNO];

extern int fline;
extern int mode,mode2,mode3;
extern int file;
extern int waittime;
+11 −0
Original line number Diff line number Diff line
#include "conquest.h"

att_task(pla,tas)
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);
  return(0);
  }
+26 −0
Original line number Diff line number Diff line
#include "conquest.h"

clean_task(pla)
int pla;
  {
  int tas,shi;
  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)
      {
      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)
          {
          task[pla][tas].ship_load[shi]--;
          task[pla][tas].ship_free[shi]++;
          break;
          }
    }
  }
+25 −0
Original line number Diff line number Diff line
#include "conquest.h"

comp_cmp(name,str)
char *name;
char *str;
  {
  while(_tolower(*name)==_tolower(*str) && *name!='\0') {name++;str++;}
  if(*name=='\0') return(1);
  return(0);
  }
spread_stars()
  {
  int sta,sta2;
  for(sta=0;sta<STARNO;sta++)
    {
    star[sta].x=RANDOM(XMAX);
    star[sta].y=RANDOM(YMAX);
    for(sta2=0;sta2<sta;sta2++)
      if(star[sta2].x==star[sta].x && star[sta2].y==star[sta].y)
        {
        sta--;
        break;
        }
    }
  }
Loading