Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import BigWorld
- import GUI
- from constants import ARENA_PERIOD
- from debug_utils import *
- from PlayerEvents import g_playerEvents
- from Account import PlayerAccount
- from gui import SystemMessages
- from messenger import MessengerEntry
- from gui.shared.utils.sound import Sound
- from gui.WindowsManager import g_windowsManager
- g_text = None
- g_other_team = 0
- g_onetime = 0
- g_my_team = 0
- def PeriodChange(period, *args):
- global g_onetime
- arena = BigWorld.player().arena
- if arena is not None:
- if arena.period == ARENA_PERIOD.AFTERBATTLE and g_onetime != 1:
- g_onetime = 1
- nst_logs(' -> TIME OUT', '#4CFF47')
- nst_text('TIME OUT', 8.0, (76, 255, 71, 255))
- Sound('/ingame_voice/notifications_VO/target_unlocked').play()
- def nst_logs(message, color='#FF0000'):
- MessengerEntry.g_instance.gui.addClientMessage('<font color="'+color+'">' + message + '</font>')
- LOG_NOTE(message)
- def nst_text(message, time, color):
- global g_text
- if g_text is not None:
- GUI.delRoot(g_text)
- g_text = None
- g_text = GUI.Text(message)
- g_text.horizontalAnchor = 'CENTER'
- g_text.verticalAnchor = 'CENTER'
- g_text.colour = color
- GUI.addRoot(g_text)
- BigWorld.callback(time, nst_del_text)
- def Setup():
- global g_other_team, g_onetime, g_my_team
- g_other_team = 0
- g_onetime = 0
- g_my_team = 0
- g_windowsManager.onInitBattleGUI += Setup
- def nst_del_text():
- global g_text
- if g_text is not None:
- GUI.delRoot(g_text)
- g_text = None
- def TeamBasePointsUpdate(team, baseID, points, capturingStopped):
- global g_onetime
- if g_onetime != 1:
- if points == 50:
- nst_logs(' -> BASE CAPTURING '+str(points)+'%', '#FFFF47')
- Sound('/GUI/dynamic_platoon/starting_dynamic_platoon').play()
- nst_text('BASE CAPTURING 50%', 3.0, (255, 255, 71, 255))
- if points == 70:
- nst_logs(' -> BASE CAPTURING '+str(points)+'%', '#FF9F34')
- Sound('/GUI/dynamic_platoon/starting_dynamic_platoon').play()
- nst_text('BASE CAPTURING 70%', 3.0, (255, 149, 34, 255))
- if points == 90:
- nst_logs(' -> BASE CAPTURING '+str(points)+'%', '#FF0000')
- Sound('/GUI/dynamic_platoon/starting_dynamic_platoon').play()
- nst_text('BASE CAPTURING 90%', 3.0, (255, 0, 0, 255))
- def TeamBaseCaptured(team, baseID):
- global g_onetime
- if g_onetime != 1:
- g_onetime = 1
- nst_logs(' -> BASE CAPTURED 100%', '#CC0006')
- nst_text('BASE CAPTURED', 8.0, (255, 0, 0, 255))
- Sound('/ingame_voice/notifications_VO/target_unlocked').play()
- def VehicleKilled(victimID, killerID, reason):
- global g_other_team, g_onetime, g_my_team
- arena = BigWorld.player().arena
- if arena is not None:
- total_other_team_players = len(BigWorld.player().arena.vehicles) / 2
- if total_other_team_players != 0:
- if BigWorld.player().team == BigWorld.player().arena.vehicles[victimID]['team']:
- g_my_team = g_my_team + 1
- c = '#FF0000'
- if g_my_team > g_other_team:
- c = '#FF0000'
- if g_my_team < g_other_team:
- c = '#83FF79'
- if g_my_team == g_other_team:
- c = '#FFFF93'
- nst_logs(' -> (My Team) '+str(total_other_team_players - g_my_team)+' vs '+str(total_other_team_players - g_other_team)+' (Enemy team)', c)
- if total_other_team_players == g_my_team and g_onetime != 1:
- g_onetime = 1
- nst_logs(' -> OUR TEAM DEAD', '#FF0000')
- nst_text('OUR TEAM DEAD', 8.0, (255, 71, 76, 255))
- Sound('/ingame_voice/notifications_VO/target_unlocked').play()
- if BigWorld.player().team != BigWorld.player().arena.vehicles[victimID]['team']:
- g_other_team = g_other_team + 1
- c = '#FF0000'
- if g_my_team > g_other_team:
- c = '#FF0000'
- if g_my_team < g_other_team:
- c = '#83FF79'
- if g_my_team == g_other_team:
- c = '#FFFF93'
- nst_logs(' -> (My Team) '+str(total_other_team_players - g_my_team)+' vs '+str(total_other_team_players - g_other_team)+' (Enemy team)', c)
- if total_other_team_players == g_other_team and g_onetime != 1:
- g_onetime = 1
- nst_logs(' -> ENEMY TEAM DEAD', '#4CFF47')
- nst_text('ENEMY TEAM DEAD', 8.0, (76, 255, 71, 255))
- Sound('/ingame_voice/notifications_VO/target_unlocked').play()
- def avatarReady():
- arena = BigWorld.player().arena
- if arena is not None:
- arena.onTeamBasePointsUpdate += TeamBasePointsUpdate
- arena.onTeamBaseCaptured += TeamBaseCaptured
- arena.onVehicleKilled += VehicleKilled
- arena.onPeriodChange += PeriodChange
- g_playerEvents.onAvatarReady += avatarReady
- # pokazivat nadpis pri zaxode v angar, pri pervom zapuske klienta
- already_shown = False
- def new_onBecomePlayer(self):
- global already_shown
- pre_onBecomePlayer(self)
- if not already_shown:
- already_shown = True
- SystemMessages.pushMessage('<font color="#FF0000">GameOver Notify v5.1</font><br>Greets to <font color="#FFFF47">333_skorpion_333</font><br>Coder: <font color="#FFFF47">waza123x</font><br>Contacts: waza123@inbox.lv', type=SystemMessages.SM_TYPE.Warning)
- pre_onBecomePlayer = PlayerAccount.onBecomePlayer
- PlayerAccount.onBecomePlayer = new_onBecomePlayer
- nst_logs('Plugin executed !')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement