Gah - a solution with more questions. – EntropicLqd
xBombFlag is the ball (or bomb) in Bombing Run. It handles seeking a pass target, giving players the ball launcher, and switching them back to another weapon when the ball is launched.
- Defaults to BallLauncher.
- Class of weapon the holder was using when the ball was picked up.
- Speed of the ball when launched.
- How much momentum to retain on a bounce. Zero actually causes the ball to stick.
- Bounce as appropriate using Elasticity value, play the ball hit sound and if the velocity is too slow, consider ourselves Landed.
- Stop any movement and start rotating.
- Increases ball velocity when shot and not held (boost shot), a common BR technique.
- Home in on the pass target. Only enabled during a pass attempt.
Inherited from GameObject
- Put the bomb launcher away.
- Give the holder a bomb launcher.
- Allow players to deflect the ball with the shield gun.
- Ball is sitting at ball spawn and is active. GameReplicationInfo flag states are set as such.
- Ball is sitting at ball spawn and is disabled. This is the state used in the interval between the time a goal is scored and the beginning of the next round.
- Sets up flag states in GameReplicationInfo and swaps the mesh used for the ball skin. This is what turns the ball into the orbiting lines that surround the player when the player picks up the ball.
- Undoes the skin swap that the Held state does, and unsets the flag states in GameReplicationInfo. Also starts the ball reset timer. If the ball is not picked up in a certain amount of time, it goes to the Home state and is returned to the ball spawn.
Uncommon: I just thought I'd throw in a few comments about the implementation of Bombing Spree. There were a few things I was able to take advantage of in this class to get the behavior I wanted. First, having the ball launcher class stored in a variable made it easy to substitute my own version (one that doesn't lock on to other ball carriers). Second, the Elasticity turned out to be fun to play with, so I added a control for that. And then there was the usual overriding of functions to add the reset explosions and keep ball carriers from picking up additional balls. I even fixed a problem with HealthBots picking up balls, which AFAIK remains a problem in regular Bombing Run.