Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (function() {
- // disable error messages
- GameLoadError = function() {};
- // infinity loop
- setInterval(function(){
- // zone selection screen
- if ( typeof gGame.m_State.m_LeaveButton !== 'undefined') {
- for ( var diffCounter = 3; diffCounter > 0; diffCounter-- ) { // hard, medium, easy
- for ( var zoneCounter = 0; zoneCounter < 96; zoneCounter++ ) {
- if ( !gGame.m_State.m_PlanetData.zones[zoneCounter].captured &&
- gGame.m_State.m_PlanetData.zones[zoneCounter].difficulty === diffCounter ) {
- gServer.JoinZone(
- zoneCounter,
- function ( results ) {
- gGame.ChangeState( new CBattleState( gGame.m_State.m_PlanetData, zoneCounter ) );
- },
- GameLoadError
- );
- return;
- }
- }
- }
- }
- // kill enemies
- if ( typeof gGame.m_State.m_EnemyManager !== 'undefined' ) {
- gGame.m_State.m_EnemyManager.m_rgEnemies.forEach( function( enemy ) {
- enemy.Die( true );
- });
- }
- // zone completion screen
- if ( typeof gGame.m_State.m_VictoryScreen !== 'undefined' ) {
- if ( gGame.m_State.m_VictoryScreen.getChildAt(1).visible ) { // 'Continue' button
- gGame.ChangeState( new CBattleSelectionState( gGame.m_State.m_PlanetData.id ) );
- gServer.GetPlayerInfo(
- function( results ) {
- gPlayerInfo = results.response;
- console.log('Score: ' + gPlayerInfo.score + '\n' +
- 'Level: ' + gPlayerInfo.level);
- },
- GameLoadError
- );
- }
- }
- }, 500);
- })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement