Friday, July 27, 2007

Shoot While Sealed with Oscillation Overthruster

By: Lord Jesus

Imagine that you have Oscillation Overthruster (OO) and you're chasing another player with OO. The other player dodges you by hiding in a building or some other structure (for example, while playing Hide-N-Seek Hills). You can go after the player to maintain your chase; however, what if the player stops while you're both sealed? You can't shoot if you're both sealed. Moreover, you can almost imagine the other player saying something like, "Haha! You can't shoot me here!"

Now, you can have the last laugh as the other tank goes Kaboom! Thrills and laughs abound now that buildings are no longer safe havens for other players with OO. But, why stop there? Snipe other players from the safety of buildings...

To do that, we're going to visit LocalPlayer.cxx (in /src/bzflag/ of the extracted source).

Use the search feature of your favorite text editor and look for "case Exploding". You will come to a section like this:

case Exploding:
firingStatus = Deceased;
break;
case InBuilding:
firingStatus = (getFlag() == Flags::PhantomZone) ? Zoned : Sealed;
break;
default:
if (isPhantomZoned())

Let's do away with the "case InBuilding" section so that the modified file now looks like this:

case Exploding:
firingStatus = Deceased;
break;
default:
if (isPhantomZoned())

Next, search for "make sure we're allowed to shoot". You will come to a section that looks like this:

// make sure we're allowed to shoot
if (!isAlive() || isPaused() ||
((location == InBuilding) && !isPhantomZoned())) {
return false;
}

Let's do a quick edit so that it now looks like this:

// make sure we're allowed to shoot
if (!isAlive() || isPaused()) {
return false;
}

Note that the above edit will only allow you to be able to shoot while sealed in a building; it will not affect your shooting while Phantom Zoned.

Save your new file, and you're done. In case you haven't already checked, take a look at the previous HOWTO posts for more tips. When you're finished, compile your client and...

Have fun!

No comments: