Advertisement
Guest User

Untitled

a guest
Jun 22nd, 2018
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.29 KB | None | 0 0
  1. (function() {
  2. // disable error messages
  3. GameLoadError = function() {};
  4. // infinity loop
  5. setInterval(function(){
  6. // zone selection screen
  7. if ( typeof gGame.m_State.m_LeaveButton !== 'undefined') {
  8. for ( var diffCounter = 3; diffCounter > 0; diffCounter-- ) { // hard, medium, easy
  9. for ( var zoneCounter = 0; zoneCounter < 96; zoneCounter++ ) {
  10. if ( !gGame.m_State.m_PlanetData.zones[zoneCounter].captured &&
  11. gGame.m_State.m_PlanetData.zones[zoneCounter].difficulty === diffCounter ) {
  12. gServer.JoinZone(
  13. zoneCounter,
  14. function ( results ) {
  15. gGame.ChangeState( new CBattleState( gGame.m_State.m_PlanetData, zoneCounter ) );
  16. },
  17. GameLoadError
  18. );
  19. return;
  20. }
  21. }
  22. }
  23. }
  24. // kill enemies
  25. if ( typeof gGame.m_State.m_EnemyManager !== 'undefined' ) {
  26. gGame.m_State.m_EnemyManager.m_rgEnemies.forEach( function( enemy ) {
  27. enemy.Die( true );
  28. });
  29. }
  30. // zone completion screen
  31. if ( typeof gGame.m_State.m_VictoryScreen !== 'undefined' ) {
  32. if ( gGame.m_State.m_VictoryScreen.getChildAt(1).visible ) { // 'Continue' button
  33. gGame.ChangeState( new CBattleSelectionState( gGame.m_State.m_PlanetData.id ) );
  34. gServer.GetPlayerInfo(
  35. function( results ) {
  36. gPlayerInfo = results.response;
  37. console.log('Score: ' + gPlayerInfo.score + '\n' +
  38. 'Level: ' + gPlayerInfo.level);
  39. },
  40. GameLoadError
  41. );
  42. }
  43. }
  44. }, 500);
  45. })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement