[Xpilot-hacks] XPilot 5 XPilot++ "TAG/IT"
Ross Venable
rvenable at bcbsal.org
Mon Dec 22 16:36:54 AST 2003
>KPS wrote:
>If you can give me a working patch for version 4.5.4, I can probably make
>it work in the X2 version.
>--
>kps
Thank You!!!
I took the patch directly from Kimiko's message in the 2002-February Archives. I had to enter each file name manually but it did work on 4.5.4 and 4.5.5 alpha...
*---------------------------------------------------------------------------------------------------------------------------------------
Index: cmdline.c
===================================================================
RCS file: /cvsroot/xpilotgame/xpilot/src/server/cmdline.c,v
retrieving revision 5.49
diff -C2 -d -r5.49 cmdline.c
*** cmdline.c 27 Jan 2002 22:58:55 -0000 5.49
--- cmdline.c 11 Feb 2002 23:54:06 -0000
***************
*** 134,137 ****
--- 134,138 ----
int cannonDeadTime; /* How long do cannons stay dead? */
bool keepShots; /* Keep shots when player leaves? */
+ bool tagGame; /* Is this a game of tag? */
bool timing; /* Is this a race? */
bool ballrace; /* Do we race with balls? */
***************
*** 1536,1539 ****
--- 1537,1553 ----
"Ignore client maxFPS request if it is 20 (the default setting).\n",
OPT_COMMAND | OPT_DEFAULTS | OPT_VISIBLE
+ },
+ {
+ "tagGame",
+ "tag",
+ "no",
+ &tagGame,
+ valBool,
+ tuner_none,
+ "Are we going to play a game of tag?\n"
+ "One player is 'it' (is worth more points when killed than the\n"
+ "others). After this player is killed, the one who killed them\n"
+ "becomes 'it', and so on.\n",
+ OPT_ORIGIN_ANY | OPT_VISIBLE
},
{
Index: collision.c
===================================================================
RCS file: /cvsroot/xpilotgame/xpilot/src/server/collision.c,v
retrieving revision 5.54
diff -C2 -d -r5.54 collision.c
*** collision.c 27 Jan 2002 22:58:55 -0000 5.54
--- collision.c 11 Feb 2002 23:54:13 -0000
***************
*** 382,385 ****
--- 382,393 ----
Players[j]->score)
* tankKillScoreMult;
+ if (tagGame) {
+ if (tag == Players[j]->id) {
+ sc *= 10;
+ Transfer_tag(j, i_tank_owner);
+ } else if (tag == Players[i_tank_owner]->id) {
+ sc *= 2;
+ }
+ }
Score_players(i_tank_owner, sc, Players[j]->name,
j, -sc, pl->name);
***************
*** 389,392 ****
--- 397,408 ----
pl->score)
* tankKillScoreMult;
+ if (tagGame) {
+ if (tag == Players[j_tank_owner]->id) {
+ sc *= 2;
+ } else if (tag == pl->id) {
+ sc *= 10;
+ Transfer_tag(i, j_tank_owner);
+ }
+ }
Score_players(j_tank_owner, sc, pl->name,
i, -sc, Players[j]->name);
***************
*** 415,418 ****
--- 431,442 ----
* runoverKillScoreMult;
}
+ if (tagGame) {
+ if (tag == Players[i_tank_owner]->id) {
+ sc *= 2;
+ } else if (tag == Players[j]->id) {
+ sc *= 10;
+ Transfer_tag(j, i_tank_owner);
+ }
+ }
Score_players(i_tank_owner, sc, Players[j]->name,
j, -sc, pl->name);
***************
*** 434,439 ****
PLAYER_RAN_OVER_PLAYER_SOUND);
Players[j]->kills++;
! sc = Rate(Players[j]->score, pl->score)
* runoverKillScoreMult;
Score_players(j_tank_owner, sc, pl->name,
i, -sc, Players[j]->name);
--- 458,476 ----
PLAYER_RAN_OVER_PLAYER_SOUND);
Players[j]->kills++;
! if (IS_TANK_IND(j)) {
! sc = Rate(Players[j_tank_owner]->score, pl->score)
! * tankKillScoreMult;
! } else {
! sc = Rate(Players[j]->score, pl->score)
* runoverKillScoreMult;
+ }
+ if (tagGame) {
+ if (tag == Players[j_tank_owner]->id) {
+ sc *= 2;
+ } else if (tag == pl->id) {
+ sc *= 10;
+ Transfer_tag(i, j_tank_owner);
+ }
+ }
Score_players(j_tank_owner, sc, pl->name,
i, -sc, Players[j]->name);
***************
*** 808,811 ****
--- 845,856 ----
sc = Rate(Players[killer]->score, pl->score)
* ballKillScoreMult;
+ if (tagGame) {
+ if (tag == Players[killer]->id) {
+ sc *= 2;
+ } else if (tag == pl->id) {
+ sc *= 10;
+ Transfer_tag(ind, killer);
+ }
+ }
Score_players(killer, sc, pl->name,
ind, -sc, Players[killer]->name);
***************
*** 1107,1110 ****
--- 1152,1163 ----
sc = Rate(Players[killer]->score, pl->score)
* explosionKillScoreMult;
+ if (tagGame) {
+ if (tag == Players[killer]->id) {
+ sc *= 2;
+ } else if (tag == pl->id) {
+ sc *= 10;
+ Transfer_tag(ind, killer);
+ }
+ }
Score_players(killer, sc, pl->name,
ind, -sc, Players[killer]->name);
***************
*** 1338,1341 ****
--- 1391,1402 ----
sc = Rate(Players[killer]->score, pl->score)
* factor;
+ if (tagGame) {
+ if (tag == Players[killer]->id) {
+ sc *= 2;
+ } else if (tag == pl->id) {
+ sc *= 10;
+ Transfer_tag(ind, killer);
+ }
+ }
Score_players(killer, sc, pl->name,
ind, -sc, Players[killer]->name);
Index: global.h
===================================================================
RCS file: /cvsroot/xpilotgame/xpilot/src/server/global.h,v
retrieving revision 5.29
diff -C2 -d -r5.29 global.h
*** global.h 27 Jan 2002 22:58:55 -0000 5.29
--- global.h 11 Feb 2002 23:54:14 -0000
***************
*** 159,162 ****
--- 159,164 ----
extern bool teamImmunity;
extern bool teamShareScore;
+ extern bool tagGame;
+ extern int tag;
extern bool timing;
extern bool ballrace;
Index: laser.c
===================================================================
RCS file: /cvsroot/xpilotgame/xpilot/src/server/laser.c,v
retrieving revision 5.10
diff -C2 -d -r5.10 laser.c
*** laser.c 21 Jan 2002 22:04:03 -0000 5.10
--- laser.c 11 Feb 2002 23:54:16 -0000
***************
*** 273,276 ****
--- 273,284 ----
vicpl->score)
* laserKillScoreMult;
+ if (tagGame) {
+ if (tag == pl->id) {
+ sc *= 2;
+ } else if (tag == vicpl->id) {
+ sc *= 10;
+ Transfer_tag(victim->ind, ind);
+ }
+ }
Score_players(ind, sc, vicpl->name,
victim->ind, -sc,
Index: play.c
===================================================================
RCS file: /cvsroot/xpilotgame/xpilot/src/server/play.c,v
retrieving revision 5.10
diff -C2 -d -r5.10 play.c
*** play.c 11 Dec 2001 12:45:13 -0000 5.10
--- play.c 11 Feb 2002 23:54:20 -0000
***************
*** 46,49 ****
--- 46,66 ----
+ int tag = NO_ID; /* player who is 'it' */
+
+ void Transfer_tag(int oldtag, int newtag)
+ {
+ char msg[MSG_LEN];
+
+ if (tag != Players[oldtag]->id
+ || oldtag == newtag)
+ return;
+
+ tag = Players[newtag]->id;
+
+ sprintf(msg, " < %s killed %s and gets to be 'it' now > ",
+ Players[newtag]->name, Players[oldtag]->name);
+ Set_message(msg);
+ }
+
int Punish_team(int ind, int t_destroyed, int t_target)
{
Index: player.c
===================================================================
RCS file: /cvsroot/xpilotgame/xpilot/src/server/player.c,v
retrieving revision 5.23
diff -C2 -d -r5.23 player.c
*** player.c 7 Dec 2001 11:47:47 -0000 5.23
--- player.c 11 Feb 2002 23:54:27 -0000
***************
*** 1637,1640 ****
--- 1637,1645 ----
Leave_alliance(ind);
+ if (tagGame
+ && tag == pl->id) {
+ tag = NO_ID;
+ }
+
if (IS_ROBOT_PTR(pl)) {
Robot_destroy(ind);
Index: proto.h
===================================================================
RCS file: /cvsroot/xpilotgame/xpilot/src/server/proto.h,v
retrieving revision 5.44
diff -C2 -d -r5.44 proto.h
*** proto.h 27 Jan 2002 22:58:55 -0000 5.44
--- proto.h 11 Feb 2002 23:54:28 -0000
***************
*** 163,166 ****
--- 163,167 ----
void Fire_right_rshot(int ind, int type, int dir, int gun);
void Make_treasure_ball(int treasure);
+ void Transfer_tag(int oldtag, int newtag);
int Punish_team(int ind, int t_destroyed, int t_target);
void Delete_shot(int ind);
Index: update.c
===================================================================
RCS file: /cvsroot/xpilotgame/xpilot/src/server/update.c,v
retrieving revision 5.22
diff -C2 -d -r5.22 update.c
*** update.c 27 Jan 2002 23:26:56 -0000 5.22
--- update.c 11 Feb 2002 23:54:34 -0000
***************
*** 1233,1236 ****
--- 1233,1251 ----
/*
+ * In tag games, check if anyone is tagged. otherwise, tag someone
+ */
+ if (tagGame
+ && NumPlayers >= 1
+ && tag == NO_ID) {
+ if (NumPlayers == 1) {
+ tag = Players[0]->id;
+ } else if (NumPlayers > 1) {
+ tag = Players[(int)(rfrac() * NumPlayers)]->id;
+ }
+ sprintf(msg, " < %s is 'it' now > ", Players[GetInd[tag]]->name);
+ Set_message(msg);
+ }
+
+ /*
* Compute general game status, do we have a winner?
* (not called after Game_Over() )
Index: walls.c
===================================================================
RCS file: /cvsroot/xpilotgame/xpilot/src/server/walls.c,v
retrieving revision 5.26
diff -C2 -d -r5.26 walls.c
*** walls.c 27 Jan 2002 22:58:55 -0000 5.26
--- walls.c 11 Feb 2002 23:54:44 -0000
***************
*** 2154,2157 ****
--- 2154,2159 ----
int average_pusher_score = total_pusher_score
/ total_pusher_count;
+ bool was_tagged = (tag == pl->id),
+ pusher_is_tagged = 0;
for (i = 0; i < num_pushers; i++) {
***************
*** 2173,2176 ****
--- 2175,2187 ----
sc = cnt[i] * Rate(pusher->score, pl->score)
* shoveKillScoreMult / total_pusher_count;
+ if (tagGame) {
+ if (tag == pusher->id) {
+ sc *= 2;
+ pusher_is_tagged = 1;
+ } else if (was_tagged && num_pushers == 1) {
+ sc *= 10;
+ Transfer_tag(ind, GetInd[pusher->id]);
+ }
+ }
SCORE(GetInd[pusher->id], sc,
OBJ_X_IN_BLOCKS(pl),
***************
*** 2184,2187 ****
--- 2195,2205 ----
sc = Rate(average_pusher_score, pl->score)
* shoveKillScoreMult;
+ if (tagGame && num_pushers == 1) {
+ if (was_tagged) {
+ sc *= 10;
+ } else if (pusher_is_tagged) {
+ sc *= 2;
+ }
+ }
SCORE(ind, -sc,
OBJ_X_IN_BLOCKS(pl),
*-------------------------------------------------------------------------------------------------------------------------------
==============================================================================
CONFIDENTIALITY NOTICE
This e-mail is intended for the sole use of the individual(s) to whom it is addressed, and may contain information that is privileged, confidential and exempt from disclosure under applicable law. You are hereby notified that any dissemination, duplication, or distribution of this transmission by someone other than the intended addressee or its designated agent is strictly prohibited. If you receive this e-mail in error, please notify me immediately by replying to this e-mail.
==============================================================================
-------------- next part --------------
A non-text attachment was scrubbed...
Name: tag.diff
Type: application/octet-stream
Size: 10057 bytes
Desc: not available
Url : http://nslug.ns.ca/cgi-bin/mailman/private/xpilot-hacks/attachments/20031222/7a355349/tag.obj
More information about the Xpilot-hacks
mailing list