home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 030.lha / Ogre / InitRound.c < prev    next >
C/C++ Source or Header  |  1986-11-10  |  1KB  |  78 lines

  1. #include "ext.h"
  2.  
  3. init_round()
  4. {
  5.    int i;
  6.  
  7.    for (i = 0; i < n_units; ++i)
  8.    {
  9.       unit[i].moves_left = unit[i].movement;
  10.       if (unit[i].status == DISABLED)
  11.       {
  12.          unit[i].status = OK;
  13.          update_hex(unit[i].l_hex, unit[i].r_hex);
  14.       }
  15.       unit[i].range_to_ogre =
  16.          range(ogre.l_hex, ogre.r_hex, unit[i].l_hex, unit[i].r_hex);
  17.    }
  18. }
  19.  
  20. init_move_ogre()
  21. {
  22.    int i;
  23.  
  24.    for (i = 0; i < n_units; ++i)
  25.    {
  26.       unit[i].range_to_ogre =
  27.          range(ogre.l_hex, ogre.r_hex, unit[i].l_hex, unit[i].r_hex);
  28.    }
  29. }
  30.  
  31. init_def_attack()
  32. {
  33.    int i;
  34.  
  35.    for (i = 0; i < n_units; ++i)
  36.    {
  37.       if (unit[i].status == OK)
  38.       {
  39.          unit[i].fired = FALSE;
  40.          unit[i].range_to_ogre =
  41.             range(ogre.l_hex, ogre.r_hex, unit[i].l_hex, unit[i].r_hex);
  42.       }
  43.    }
  44. }
  45.  
  46. init_ogre_attack()
  47. {
  48.    int i;
  49.  
  50.    for (i = 0; i < n_units; ++i)
  51.    {
  52.       unit[i].fired = 0;
  53.       unit[i].range_to_ogre =
  54.          range(ogre.l_hex, ogre.r_hex, unit[i].l_hex, unit[i].r_hex);
  55.    }
  56. }
  57.  
  58. init_gev2()
  59. {
  60.    int i;
  61.  
  62.    for (i = 0; i < n_units; ++i)
  63.       if (unit[i].status == OK && unit[i].type == GEV)
  64.          unit[i].moves_left = 3;
  65. }
  66.  
  67. display_range(i)
  68. int i;
  69. {
  70.    char c[80];
  71.  
  72.    movecur(18,0);
  73.    eeol(18);
  74.    sprintf(c,"range from unit %d to Ogre %d.",i,unit[i].range_to_ogre);
  75.    Amiga_puts(c);
  76.    cycle();
  77. }
  78.