At Centropolis Effects we have added two new super
flags that we really enjoy. We would like to see them
added to the main distribution.
The first is a good super flag called WinGs (WG). It
will allow your tank to turn in mid air. It does not
allow you two change your velocity in mid-air, only
turn. This flag only really makes since when the
server allows jumping. An enhancement we have not
tried is changing the rate of turn based on your
forward velocity.
The second is a bad super flag called ReVersed (RV).
All your driving crontols will be reversed. You can
try to flip your mouse or joystick over... but you may
get killed in the process.
Of course adding flags changes the server protocol ever
so slightly, so this version will not work with other
versions. I have bumped the server version too
BZFS108e. I hope that does not conflict with anyone
else.
Centropolis Effects extra flags
Logged In: YES
user_id=48712
I have tried this patch but never saw this two new flags. So
i tried a "+f WG" and "+f RV" to force them to occur in the
game. But bzfs does not accept these parameters!?
Logged In: YES
user_id=66596
Hey Robert, Tried out your flags... work good! except,
message for WG was screwed up with CL... Anyway there were
some merge problems, so here's a fixed up diff file
<PRE>
[code]
-----------------------------------------
Index: bzflag/include/Protocol.h
========
RCS file: /cvsroot/bzflag/bzflag/include/Protocol.h,v
retrieving revision 1.10
diff -u -r1.10 Protocol.h
--- bzflag/include/Protocol.h 2001/12/06 10:26:25
1.10
+++ bzflag/include/Protocol.h 2002/01/06 00:52:39
@@ -32,7 +32,7 @@
// minor release number changes. adding new graphics
effects normally
// only require incrementing the revision number.
-const char* const ServerVersion = "BZFS107e";
+const char* const ServerVersion = "BZFS108e";
// well known service port number for bzflag server
const int ServerPort = 5155;
Index: bzflag/include/global.h
===========================================================
========
RCS file: /cvsroot/bzflag/bzflag/include/global.h,v
retrieving revision 1.5
diff -u -r1.5 global.h
--- bzflag/include/global.h 2001/11/15 09:37:06 1.5
+++ bzflag/include/global.h 2002/01/06 00:52:41
@@ -190,6 +190,7 @@
GenocideFlag, // kill
one kills whole team
JumpingFlag, // lets
your tank jump
IdentifyFlag, // lets
you identify other flags
+ WingsFlag, // lets
you turn in mid-air
CloakingFlag, // make
you invisible out window
// the bad super flags
@@ -200,6 +201,7 @@
MomentumFlag, // gives
you lots of momentum
BlindnessFlag, // can't
see out window
JammingFlag, // radar
doesn't work
+ ReverseFlag, // reverse
controls
WideAngleFlag, // fish
eye view (sounds good
// but
isn't)
Index: bzflag/man/bzflag.6s
========
RCS file: /cvsroot/bzflag/bzflag/man/bzflag.6s,v
retrieving revision 1.7
diff -u -r1.7 bzflag.6s
--- bzflag/man/bzflag.6s 2001/11/15 09:37:06 1.7
+++ bzflag/man/bzflag.6s 2002/01/06 00:52:47
@@ -491,6 +491,10 @@
.TP
.B Identify (ID)
Displays the identity of the closest flag in the vicinity.
+.TP
+.B Wings (WG)
+Allows tank to turn in mid-air. The tank can not change
velocity,
+only turn.
.RE
.PP
A brief description of each bad superflag with the flag's
code
@@ -521,6 +525,9 @@
.TP
.B Jamming (JM)
Disables the radar but you can still see.
+.TP
+.B Reverse (RV)
+Movement controls are reversed.
.TP
.B Wide Angle (WA)
Gives the tank a fish eye lens that's rather disorienting.
Index: bzflag/src/bzflag/HUDRenderer.cxx
===========================================================
========
RCS
file: /cvsroot/bzflag/bzflag/src/bzflag/HUDRenderer.cxx,v
retrieving revision 1.17
diff -u -r1.17 HUDRenderer.cxx
--- bzflag/src/bzflag/HUDRenderer.cxx 2001/11/15 09:37:07
1.17
+++ bzflag/src/bzflag/HUDRenderer.cxx 2002/01/06 00:53:01
@@ -131,6 +131,7 @@
"Genocide (+G): Killing one tank kills that tank's whole
team.",
"JumPing (+JP): Tank can jump. Use Tab key. Can't
steer in the air.",
"IDentify (+ID): Identifies type of nearest flag.",
+"WinGs (+WG): Tank can turn in mid-air.",
"CLoaking (+CL): Makes your tank invisible out-the-
window. "
"Still visible on radar.",
"ColorBlindness (-CB): Can't tell team colors. Don't
shoot teammates!",
@@ -140,6 +141,7 @@
"Momentum (-M): Tank has inertia. Acceleration is
limited.",
"Blindness (-B): Can't see out window. Radar still
works.",
"JaMming (-JM): Radar doesn't work. Can still see.",
+"ReVerse (-RV): Controls are reversed.",
"Wide Angle (-WA): Fish-eye lens distorts view."
};
Index: bzflag/src/bzflag/LocalPlayer.cxx
========
RCS
file: /cvsroot/bzflag/bzflag/src/bzflag/LocalPlayer.cxx,v
retrieving revision 1.11
diff -u -r1.11 LocalPlayer.cxx
--- bzflag/src/bzflag/LocalPlayer.cxx 2001/11/30 04:36:56
1.11
+++ bzflag/src/bzflag/LocalPlayer.cxx 2002/01/06 00:53:14
@@ -271,15 +271,26 @@
// compute velocity so far
if (location == OnGround || location == OnBuilding
||
(location == InBuilding && oldPosition[2]
== 0.0f)) {
- newVelocity[0] = speed * cosf(oldAzimuth + 0.5f *
dt * newAngVel);
- newVelocity[1] = speed * sinf(oldAzimuth + 0.5f *
dt * newAngVel);
- newVelocity[2] = 0.0f;
+ const float angle = oldAzimuth + 0.5f * dt *
newAngVel;
+ newVelocity[0] = speed * cosf(angle);
+ newVelocity[1] = speed * sinf(angle);
+ newVelocity[2] = 0.0f;
if (oldPosition[2] != 0.0f) newVelocity[2] +=
Gravity * dt;
}
else {
- // can't control motion in air
- newVelocity[2] += Gravity * dt;
- newAngVel = oldAngVel;
+ // Gravity is pulling me always pulling me down
+ newVelocity[2] += Gravity * dt;
+
+ if (getFlag() == WingsFlag) {
+ const float angle = oldAzimuth + 0.5f * dt *
newAngVel;
+ speed = lastSpeed;
+ newVelocity[0] = speed * cosf(angle);
+ newVelocity[1] = speed * sinf(angle);
+ }
+ else {
+ // can't control motion in air
+ newAngVel = oldAngVel;
+ }
}
// now apply outside forces
Index: bzflag/src/bzflag/ShotPath.cxx
===========================================================
========
RCS file: /cvsroot/bzflag/bzflag/src/bzflag/ShotPath.cxx,v
retrieving revision 1.4
diff -u -r1.4 ShotPath.cxx
--- bzflag/src/bzflag/ShotPath.cxx 2001/02/02 09:14:09
1.4
+++ bzflag/src/bzflag/ShotPath.cxx 2002/01/06 00:53:16
@@ -126,6 +126,7 @@
case CloakingFlag:
case PhantomZoneFlag:
case JumpingFlag:
+ case WingsFlag:
case GenocideFlag:
case ColorblindnessFlag:
case ObesityFlag:
@@ -134,6 +135,7 @@
case MomentumFlag:
case BlindnessFlag:
case JammingFlag:
+ case ReverseFlag:
case WideAngleFlag:
strategy = new NormalShotStrategy(this);
break;
Index: bzflag/src/bzflag/menus.cxx
===========================================================
========
RCS file: /cvsroot/bzflag/bzflag/src/bzflag/menus.cxx,v
retrieving revision 1.21
diff -u -r1.21 menus.cxx
--- bzflag/src/bzflag/menus.cxx 2001/11/30 04:36:56
1.21
+++ bzflag/src/bzflag/menus.cxx 2002/01/06 00:53:40
@@ -1714,6 +1714,8 @@
list.append(createLabel(
"tank invisible on enemy radar", "Stealth (ST)"));
list.append(createLabel(
+ "tank can turn in mid-air", "Wings (WG)"));
+ list.append(createLabel(
"tank invisible out the window", "Cloaking (CL)"));
list.append(createLabel(
"shots invisible on radar", "Invisible Bullet
(IB)"));
@@ -1722,11 +1724,13 @@
list.append(createLabel(
"tank becomes paper thin", "Narrow (N)"));
list.append(createLabel(
- "getting hit just drops the flag", "Shield(SH)"));
+ "getting hit just drops the flag", "Shield (SH)"));
list.append(createLabel(
"destroy tanks by touching them", "Steamroller
(SR)"));
list.append(createLabel(
"expanding spherical shell of destruction", "Shock
Wave (SW)"));
+ list.append(createLabel(
+ "tank turns in mid-air", "Wings (WG)"));
}
float Help5Menu::getLeftSide(int width,
int)
@@ -1777,6 +1781,8 @@
"can't see out the window", "Blindness (B)"));
list.append(createLabel(
"can't see anything on radar", "Jamming (JM)"));
+ list.append(createLabel(
+ "controls reversed", "Reversed (RV)"));
list.append(createLabel(
"fish eye view out the window", "Wide Angle
(WA)"));
}
Index: bzflag/src/bzflag/playing.cxx
===========================================================
========
RCS file: /cvsroot/bzflag/bzflag/src/bzflag/playing.cxx,v
retrieving revision 1.59
diff -u -r1.59 playing.cxx
--- bzflag/src/bzflag/playing.cxx 2001/12/06 10:26:25
1.59
+++ bzflag/src/bzflag/playing.cxx 2002/01/06 00:54:09
@@ -925,6 +925,12 @@
} else
mainWindow->getMousePosition(mx, my);
+ // See if controls are reversed
+ if (myTank->getFlag() == ReverseFlag) {
+ mx = -mx;
+ my = -my;
+ }
+
// calculate desired rotation
const int noMotionSize = hud->getNoMotionSize();
const int maxMotionSize = hud->getMaxMotionSize();
Index: bzflag/src/bzfrelay/bzfrelay.c
===========================================================
========
RCS file: /cvsroot/bzflag/bzflag/src/bzfrelay/bzfrelay.c,v
retrieving revision 1.11
diff -u -r1.11 bzfrelay.c
--- bzflag/src/bzfrelay/bzfrelay.c 2001/11/30 04:36:56
1.11
+++ bzflag/src/bzfrelay/bzfrelay.c 2002/01/06 00:54:18
@@ -580,7 +580,7 @@
/* send client a rejection if requested */
if (sendReject)
- send(relay->fdSrc, (SendType)"BZFS107e\000\000", 10,
0);
+ send(relay->fdSrc, (SendType)"BZFS108e\000\000", 10,
0);
}
static void createRelay(struct sockaddr_in*
serverAddr,
Index: bzflag/src/bzfs/bzfs.cxx
===========================================================
========
RCS file: /cvsroot/bzflag/bzflag/src/bzfs/bzfs.cxx,v
retrieving revision 1.77
diff -u -r1.77 bzfs.cxx
--- bzflag/src/bzfs/bzfs.cxx 2001/12/06 10:26:25
1.77
+++ bzflag/src/bzfs/bzfs.cxx 2002/01/06 00:54:57
@@ -4717,6 +4717,7 @@
flagCount[JumpingFlag]++;
flagCount[IdentifyFlag]++;
flagCount[CloakingFlag]++;
+ flagCount[WingsFlag]++;
}
else {
if ((f = lookupFlag(argv[i])) == int(NoFlag)) {
@@ -4793,6 +4794,7 @@
flagDisallowed[MomentumFlag] = True;
flagDisallowed[BlindnessFlag] = True;
flagDisallowed[JammingFlag] = True;
+ flagDisallowed[ReverseFlag] = True;
flagDisallowed[WideAngleFlag] = True;
}
else {
@@ -5082,8 +5084,12 @@
// first disallow flags inconsistent with game style
if (gameStyle & InertiaGameStyle)
flagDisallowed[int(MomentumFlag)] = True;
- if (gameStyle & JumpingGameStyle)
+ if (gameStyle & JumpingGameStyle) {
flagDisallowed[int(JumpingFlag)] = True;
+ }
+ else {
+ flagDisallowed[int(WingsFlag)] = True;
+ }
if (gameStyle & RicochetGameStyle)
flagDisallowed[int(RicochetFlag)] = True;
if (!useTeleporters)
@@ -5203,6 +5209,8 @@
if (setRequiredFlag(flag[f], IdentifyFlag))
f++;
if (setRequiredFlag(flag[f], CloakingFlag))
+ f++;
+ if (setRequiredFlag(flag[f], WingsFlag))
f++;
}
else {
Index: bzflag/src/common/Flag.cxx
===========================================================
========
RCS file: /cvsroot/bzflag/bzflag/src/common/Flag.cxx,v
retrieving revision 1.3
diff -u -r1.3 Flag.cxx
--- bzflag/src/common/Flag.cxx 2001/02/02 09:14:09 1.3
+++ bzflag/src/common/Flag.cxx 2002/01/06 00:54:58
@@ -40,6 +40,7 @@
"Genocide",
"Jumping",
"Identify",
+ "Wings",
"Cloaking",
"Colorblindness",
"Obesity",
@@ -48,6 +49,7 @@
"Momentum",
"Blindness",
"Jamming",
+ "Reverse",
"Wide Angle"
};
@@ -77,6 +79,7 @@
"G", //
genocide
"JP", //
jumping
"ID", //
identify
+ "WG", //
wings
"CL", //
cloaking
"CB", //
colorblindness
"O", //
obesity
@@ -85,6 +88,7 @@
"M", //
momentum
"B", //
blindness
"JM", //
jamming
+ "RV", //
reverse
"WA" //
wide angle
};
@@ -157,6 +161,7 @@
case MomentumFlag:
case BlindnessFlag:
case JammingFlag:
+ case ReverseFlag:
case WideAngleFlag:
return FlagSticky;
default:
--------------------------------------------------
[/code]
</PRE>
Logged In: YES
user_id=785737
Unless this gets veto'd from upon high quickly, I'll go ahead and commit
this embarrasingly old patch. They sound like benign flags that could be
interesting. We'll see.
Logged In: YES
user_id=785737
This is now finally added. There are already interesting compliments on
the Wings idea -- it's been well received. Nice work. dbrosius beat me
to the heavy lifting to get wings added, so this patch commital is
attributed to him as it is closed out.
Besides the changes that were necessary to apply this to a version of the
sources just shy of 3 years later, some other minor modifications were
made. Reversed was instead called ReversedControls (RC) for now, so
as not to confuse with the ReverseOnly flag. In addition, changes where
needed to make it work with keyboard and joystick users.
This is probably a record for oldest accepted patch for bz.. ;)
Logged In: YES
user_id=785737
Applied to CVS, Thanx!