Vanilla Netrek Server Development Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[VANILLA-L:1372] Re: [VANILLA-L:1359] Re: Notes on INL Robot



> 1) "* Reset all player stats at game start"
> 
> Which means that the player statistics visible in the player window
> should be zero, and all the ranks should be Ensign.

I made an attempt at this, but for some reason the session stats you
get when you send ? are screwed up.  I don't have time to fix this
now, I will tonight if somebody doesn't get to it.

Anyways, here's what I tried.

-Jeff

*** ../../vanilla_ori/robots/inl.c	Sun Feb  7 19:56:04 1999
--- inl.c	Mon Feb  8 10:24:51 1999
***************
*** 104,109 ****
--- 104,110 ----
  void inlmove();
  int end_tourney();
  int start_tourney();
+ void reset_stats();
  
  extern char *addr_mess();
  
***************
*** 872,877 ****
--- 873,879 ----
    inl_stat.flags &= ~(S_PREGAME | S_COUNTDOWN | S_CONFINE);
  
    obliterate(1,TOURNSTART);
+   reset_stats();
  
  #ifdef nodef
    inl_stat.time = inl_teams[0].time * PERMIN;
***************
*** 1050,1053 ****
--- 1052,1088 ----
  	  planets[i].pl_armies = inl_stat.start_armies;
  	}
      }
+ }
+ 
+ void reset_stats()
+ {
+   int i;
+   struct player *j;
+ 
+   /* Reset global stats. */
+   /* Taken from main() in daemonII.c */
+   status->time = 10;
+   status->timeprod = 10;
+   status->planets = 10;
+   status->armsbomb = 10;
+   status->kills = 10;
+   status->losses = 10;
+ 
+   /* Reset player stats. */
+   for (i = 0; i < MAXPLAYER; i++) {
+     j = &players[i];
+ 
+     /* initial player state as given in getname */
+     MZERO(&(j->p_stats), sizeof(struct stats));
+     j->p_stats.st_tticks = 1;
+     j->p_stats.st_flags=ST_INITIAL;
+ 
+     /* reset stats which are not in stats */
+     j->p_kills = 0;
+     j->p_armies = 0;
+     j->p_genoplanets = 0;
+     j->p_genoarmsbomb = 0;
+     j->p_planets = 0;
+     j->p_armsbomb = 0;
+   }
  }

+
++ Vanilla-l Mailing List ++
To unsubscribe: send "unsubscribe vanilla-l" to majordomo@real-time.com
For more information: http://archives.real-time.com