Vanilla Netrek Server Development Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[VANILLA-L:605] Minor puck patches for robots/ directory
*** puck.c.orig Fri May 2 14:07:37 1997
--- puck.c Fri May 2 14:09:38 1997
***************
*** 4,10 ****
/*
Modified for use with guzzler code by Michael Kantner (MK)
Base upon code ftp'd from hobbes.ksu.ksu.edu on 9-9-93
! Please mail all bugs, patches, comments to kantner@hot.caltech.edu
*/
#include "copyright.h"
--- 4,10 ----
/*
Modified for use with guzzler code by Michael Kantner (MK)
Base upon code ftp'd from hobbes.ksu.ksu.edu on 9-9-93
! Please mail all bugs, patches, comments to kantner@alumni.caltech.edu
*/
#include "copyright.h"
***************
*** 110,116 ****
robonameset(me); /* Set the robot@nowhere fields */
robonameset(anncer);
enter(team, 0, pno, class, "Puck"); /* Create the puck */
! enter(team, 0, anno, class, "Annoucner"); /* Create the announcer */
me->p_pos = -1; /* So robot stats don't get saved */
me->p_flags |= PFROBOT; /* Mark as a robot */
--- 110,116 ----
robonameset(me); /* Set the robot@nowhere fields */
robonameset(anncer);
enter(team, 0, pno, class, "Puck"); /* Create the puck */
! enter(team, 0, anno, class, "Announcer"); /* Create the announcer */
me->p_pos = -1; /* So robot stats don't get saved */
me->p_flags |= PFROBOT; /* Mark as a robot */
*** puckdefs.h.orig Wed May 14 09:17:46 1997
--- puckdefs.h Wed May 14 09:19:28 1997
***************
*** 18,23 ****
--- 18,24 ----
Added: 9-20-94 Added HOWOFTEN, and changed PERSEC.
Added: 5-30-95 SHOT_DESC for added shot descriptions.
+ Added: 5-14-97 LIGHT_PLANETS to have planets indicate score
*/
/* puckdefs.h
***************
*** 40,45 ****
--- 41,47 ----
#define WALL_BOUNCE /*define to keep players in the rink*/
#define ALLOW_EJECT
#define SHOT_DESC /*define to have on goal descriptions. */
+ #define LIGHT_PLANETS /*define to have planets show the score*/
#define NUMSKATERS 12
*** puckmove.c.orig Wed May 14 09:07:13 1997
--- puckmove.c Wed May 14 09:32:53 1997
***************
*** 306,316 ****
int timetogo = END_OF_PERIOD - roboclock;
if ( (timetogo % (PERSEC*10)) == 0)
! messAll(me->p_no,roboname," %2i seconds left in the period",(timetogo/PERSEC));
if ( (timetogo < 10*PERSEC) && ((timetogo % PERSEC) == 0) )
! messAll(anncer->p_no,roboname," %i second%s left in the period",(timetogo/PERSEC),
! timetogo==PERSEC ? "":"s");
}
--- 306,318 ----
int timetogo = END_OF_PERIOD - roboclock;
if ( (timetogo % (PERSEC*10)) == 0)
! messAll(me->p_no,roboname," %2i seconds left in the %s",
! (timetogo/PERSEC), period>=PERIODS_PER_GAME ? "game":"period");
if ( (timetogo < 10*PERSEC) && ((timetogo % PERSEC) == 0) )
! messAll(anncer->p_no,roboname," %i second%s left in the %s",
! (timetogo/PERSEC),timetogo==PERSEC ? "":"s",
! period>=PERIODS_PER_GAME ? "game":"period");
}
***************
*** 1096,1101 ****
--- 1098,1106 ----
tempclock = roboclock/PERSEC;
messAll(me->p_no,roboname,"Score is Klis %d, Oris %d. Elapsed time %02d:%02d. Period %d.",
scores[KLI], scores[ORI], tempclock/60, tempclock%60, period);
+ #ifdef LIGHT_PLANETS
+ light_planets();
+ #endif
}
/* ARGSUSED */
***************
*** 1598,1600 ****
--- 1603,1678 ----
freeslot(anncer);
exit(0);
}
+
+ #ifdef LIGHT_PLANETS
+ /*
+ * light_planets changes ownership of planets to indicate the score.
+ * Some people really like this feature, and no one objects to it.
+ */
+
+
+ #define IND 0
+ light_planets()
+ {
+ int pln_light,extra;
+ int i;
+ int kli_light= ROM, ori_light = FED;
+
+ if (scores[KLI] > 0) {
+ pln_light=scores[KLI]%5;
+ switch(pln_light) {
+ case 1:
+ planets[10].pl_owner=kli_light;
+ for (i=11; i<15; i++) {
+ planets[i].pl_owner = IND;}
+ extra = scores[KLI]/5;
+ if (extra > 0) { planets[extra-1].pl_owner = kli_light;}
+ break;
+ case 2:
+ planets[11].pl_owner=kli_light; break;
+ case 3:
+ planets[12].pl_owner=kli_light; break;
+ case 4:
+ planets[13].pl_owner=kli_light; break;
+ case 0:
+ planets[14].pl_owner=kli_light; break;
+ default:
+ break;
+ }
+ }else{
+ for (i=0; i<5; i++) {
+ planets[i].pl_owner = IND;
+ planets[10+i].pl_owner = IND; }
+ }
+
+ if (scores[ORI] > 0) {
+ pln_light=scores[ORI]%5;
+ switch(pln_light) {
+ case 1:
+ planets[9].pl_owner=ori_light;
+ for (i=5; i<9; i++) {
+ planets[i].pl_owner = IND;}
+ extra = scores[ORI]/5;
+ if (extra > 0) {
+ planets[20-extra].pl_owner = ori_light;}
+ break;
+ case 2:
+ planets[8].pl_owner=ori_light; break;
+ case 3:
+ planets[7].pl_owner=ori_light; break;
+ case 4:
+ planets[6].pl_owner=ori_light; break;
+ case 0:
+ planets[5].pl_owner=ori_light; break;
+ default:
+ break;
+ }
+ }else{
+ for (i=0; i<5; i++) {
+ planets[5+i].pl_owner = IND;
+ planets[15+i].pl_owner = IND; }
+ }
+
+ }
+
+ #endif /* LIGHT_PLANETS */