Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // If the game mode is CTF
- if (teamManager.gameType == GameType.CTF) {
- // Search for all flags
- foreach (EventReactor reactor in FindObjectsOfType<EventReactor>()) {
- // Is this flag a different colour than us?
- if (reactor.factionManager.color != manager.color) {
- // Is this flag captured?
- if (reactor.flagCaptured) {
- // Did we capture this flag?
- if (reactor.currentPlayer == this) {
- // Set out target to this flags enemy flag. Which is our flag.
- target = reactor.opposingFlag.transform;
- } else {
- // The flag has been captured, escort the person who captured it.
- target = reactor.currentPlayer.FactionManager.transform;
- }
- } else {
- // Lets capture the flag!
- target = reactor.transform;
- }
- }
- // Is this flag ours?
- if (reactor.factionManager.color == manager.color) {
- // Is this flag captured?
- if (reactor.flagCaptured) {
- // The flag has been captured, stop whoever stole it!
- target = reactor.currentPlayer.FactionManager.transform;
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment