Advertisement
BlinkingStars

source.js

Jun 6th, 2023
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
JavaScript 34.93 KB | Gaming | 0 0
  1. var CheatModKristof1104 = {};
  2. (function () {
  3.     var new_date = 0;
  4.     var perfectScores = false;
  5.     var noBugsMode = false;
  6.     var fastResearch = false;
  7.     var showAllHints = false;
  8.    
  9.     var oldSetupNewGame = GameManager._setupNewGame;
  10.     var newSetupNewGame = function(){
  11.         oldSetupNewGame();
  12.         GameManager.company.researchCompleted.push(Research.Sequels);
  13.         GameManager.company.researchCompleted.push(Research.CasualGames);
  14.     }
  15.     GameManager._setupNewGame = newSetupNewGame;
  16.  
  17.     function removeNeedForVacationForStaff(){
  18.             for(var i=0;i<GameManager.company.staff.length;i++){
  19.                 var character = GameManager.company.staff[i];
  20.                     character.flags.nextVacation = 2700 * (GameManager.SECONDS_PER_WEEK * 1E3);; // more then 40 years :)
  21.                     character.flags.needsVacation = false;
  22.             }
  23.     }
  24.    
  25.     function addDreamTeam(){
  26.         if(GameManager.company.currentLevel == 4)
  27.             GameManager.company.maxStaff = 7;
  28.    
  29.         for (var i=1;i<GameManager.company.maxStaff;i++){
  30.         var skipCharacter = false;
  31.             for(var j=0;j<GameManager.company.staff.length;j++){
  32.                 if(GameManager.company.staff[j].slot == i){
  33.                     skipCharacter = true;
  34.                     break;
  35.                 }
  36.             }
  37.            
  38.             if(skipCharacter){
  39.                 continue;
  40.             }
  41.            
  42.             var character = new Character({
  43.                     id: GameManager.getGUID(),
  44.                     name: "Cheater"+i,
  45.                     dF: 2,
  46.                     tF: 2,
  47.                     speedF: 2,
  48.                     qualityF: 1,
  49.                     experience: LevelCalculator.getXpForLevel(10),
  50.                     researchF: 2,
  51.                     salary: 1,
  52.                     efficiency: 1,
  53.                     slot: i,
  54.                     sex: ["male", "female"].pickRandom()
  55.                     });
  56.                
  57.                     GameManager.setBodyAndHead(character);
  58.                     character.flags.hiredTimestamp = GameManager.gameTime;
  59.                     character.flags.nextVacation = GameManager.gameTime + 48E3 * GameManager.SECONDS_PER_WEEK;
  60.                     character.flags.workload = 0;
  61.                     character.maxBoostLevel = 3;
  62.                     character.boostLevel = 0;
  63.                     character.boostRechargeProgress = 1;
  64.                     UI._resetBoostUI();
  65.                     GameManager.company.staff.push(character);
  66.                     GameManager.uiSettings.findStaffData = null;
  67.                     VisualsManager.reloadAllCharacters();
  68.                     GameManager.company.staff[GameManager.company.staff.length - 1].startAnimations();
  69.                     VisualsManager.addComputer(character);
  70.                     VisualsManager.refreshHiringButtons();
  71.                     VisualsManager.refreshTrainingOverlays();
  72.         }
  73.        
  74.         2 < GameManager.company.staff.length && GameManager.enableMediumContracts();
  75.         UI.reset();
  76.        
  77.     }  
  78.    
  79.     function addBTeam(){
  80.         if(GameManager.company.currentLevel == 4)
  81.             GameManager.company.maxStaff = 7;
  82.    
  83.         for (var i=1;i<GameManager.company.maxStaff;i++){
  84.         var skipCharacter = false;
  85.             for(var j=0;j<GameManager.company.staff.length;j++){
  86.                 if(GameManager.company.staff[j].slot == i){
  87.                     skipCharacter = true;
  88.                     break;
  89.                 }
  90.             }
  91.            
  92.             if(skipCharacter){
  93.                 continue;
  94.             }
  95.            
  96.             var character = new Character({
  97.                     id: GameManager.getGUID(),
  98.                     name: "B Cheater"+i,
  99.                     dF: 1.4,
  100.                     tF: 1.4,
  101.                     speedF: 1.4,
  102.                     qualityF: 1.4,
  103.                     experience: 700,
  104.                     researchF: 1.4,
  105.                     salary: 1,
  106.                     efficiency: 1,
  107.                     slot: i,
  108.                     sex: ["male", "female"].pickRandom()
  109.                     });
  110.                
  111.                     GameManager.setBodyAndHead(character);
  112.                     character.flags.hiredTimestamp = GameManager.gameTime;
  113.                     character.flags.nextVacation = GameManager.gameTime + 48E3 * GameManager.SECONDS_PER_WEEK;
  114.                     character.flags.workload = 0;
  115.                     GameManager.company.staff.push(character);
  116.                     GameManager.uiSettings.findStaffData = null;
  117.                     VisualsManager.reloadAllCharacters();
  118.                     GameManager.company.staff[GameManager.company.staff.length - 1].startAnimations();
  119.                     VisualsManager.addComputer(character);
  120.                     VisualsManager.refreshHiringButtons();
  121.                     VisualsManager.refreshTrainingOverlays();
  122.         }
  123.        
  124.         2 < GameManager.company.staff.length && GameManager.enableMediumContracts();
  125.         UI.reset();
  126.        
  127.     }
  128.    
  129.     function createProDeveloper(){
  130.         var character = GameManager.company.staff[0];
  131.         character.designFactor= 2;
  132.         character.technologyFactor= 2;
  133.         character.speedFactor= 2;
  134.         character.qualityFactor= 1;
  135.         character.experience= 10000;
  136.         character.researchFactor= 2;
  137.         character.efficiency= 1;
  138.     }
  139.    
  140.     function moveToLevel4(){
  141.    
  142.         if(GameManager.company.gameLog.length == 0){
  143.             GameManager.company.notifications.push(new Notification("CheatMod", "To continue to the final level, you need to have at least created game 1 game"));
  144.             return
  145.         }
  146.  
  147.         if(GameManager.company.currentLevel != 4){
  148.        
  149.             //add at least 1 staff member & at least 1 game
  150.             if(GameManager.company.staff.length<2){
  151.                 GameManager.company.maxStaff = 7;
  152.                
  153.                 var character = new Character({
  154.                     id: GameManager.getGUID(),name: "Cheater1",dF: 2,
  155.                     tF: 2,speedF: 2,qualityF: 1,experience: 10000,
  156.                     researchF: 2,salary: 1,efficiency: 1,
  157.                     slot: 2,sex: 1});
  158.                
  159.                     GameManager.setBodyAndHead(character);
  160.                     character.flags.hiredTimestamp = GameManager.gameTime;
  161.                     character.flags.nextVacation = GameManager.gameTime + 48E3 * GameManager.SECONDS_PER_WEEK;
  162.                     character.flags.workload = 0;
  163.                     GameManager.company.staff.push(character);
  164.                     GameManager.uiSettings.findStaffData = null;
  165.                     VisualsManager.reloadAllCharacters();
  166.                     GameManager.company.staff[GameManager.company.staff.length - 1].startAnimations();
  167.                     VisualsManager.addComputer(character);
  168.                     VisualsManager.refreshHiringButtons();
  169.                     VisualsManager.refreshTrainingOverlays();
  170.             }
  171.             GameManager.company.currentLevel = 4,
  172.             VisualsManager.nextLevel();
  173.             Media.createLevel4Notifications();
  174.             GameManager.save(GameManager.company.slot + "L4");
  175.             GameManager.resume(true);
  176.         }
  177.         unlockRnDLab();
  178.         unlockHwLab();
  179.     }      
  180.    
  181.     function unlockHwLab(){
  182.         if(! GameManager.company.flags.hwLabUnlocked){
  183.             GameManager.company.flags.hwLabUnlocked = !0;
  184.             GameManager.company.flags.hwBudget = 0;
  185.             GameManager.company.flags.fractionalHwLabCosts = 0;
  186.             GameManager.company.notifications.push(new Notification("Hardware lab".localize(), "Our hardware lab is ready.".localize()));
  187.             Tutorial.hwLabReady();
  188.             GameManager.pause(!0);
  189.            
  190.             UI.fadeInTransitionOverlay(function () {
  191.                 VisualsManager.loadStage(!0);
  192.                 VisualsManager.refreshLabCrew();
  193.                 VisualsManager.updateProjectStatusCards();
  194.                 UI.fadeOutTransitionOverlay(function () {
  195.                     GameManager.resume(true)
  196.                 })
  197.             });
  198.             GameManager.resume(true);
  199.         }
  200.     }  
  201.    
  202.     function unlockRnDLab(){
  203.         if(! GameManager.company.flags.rndLabUnlocked){
  204.             GameManager.company.flags.rndLabUnlocked = !0;
  205.             GameManager.company.flags.rndBudget = 0;
  206.             GameManager.company.flags.fractionalRndLabCosts = 0;
  207.             GameManager.company.notifications.push(new Notification("R&D lab".localize(), "Our R&D  lab is ready.".localize()))
  208.             Tutorial.rndLabReady();
  209.             GameManager.pause(!0);
  210.             UI.fadeInTransitionOverlay(function () {
  211.                 VisualsManager.loadStage(!0);
  212.                 VisualsManager.refreshLabCrew();
  213.                 VisualsManager.updateProjectStatusCards();
  214.                 UI.fadeOutTransitionOverlay(function () {
  215.                     GameManager.resume(true)
  216.                 })
  217.             });
  218.             GameManager.resume(true);
  219.         }
  220.     }  
  221.     function addMoney(money){
  222.         GameManager.company.adjustCash(money,"cheat mode " + money / 1000000 + "M");
  223.     }  
  224.    
  225.     function setMoney(){
  226.         var money = $("#moneyField").val();
  227.         money = money.replace(/\./g,"");
  228.        
  229.         if(isNaN(money))
  230.             return;
  231.    
  232.         GameManager.company.cash = parseInt(money);
  233.     }  
  234.    
  235.     function setFans(){
  236.         var fans = $("#fansField").val();
  237.         fans = fans.replace(/\./g,"");
  238.        
  239.         if(isNaN(fans))
  240.             return;
  241.    
  242.         GameManager.company.fans = parseInt(fans);
  243.     }
  244.    
  245.     function addResearchPoints(){
  246.         GameManager.company.researchPoints += 100;
  247.         VisualsManager.researchPoints.updatePoints(GameManager.company.researchPoints);
  248.     }
  249.    
  250.     function addFans(fans){
  251.         GameManager.company.fans += fans;
  252.     }  
  253.    
  254.     function addHype(hype){
  255.         GameManager.company.adjustHype(hype);
  256.     }  
  257.    
  258.     function addAAAResearch(){
  259.         if(GameManager.company.researchCompleted.indexOf(Research.MediumSizeGames) == -1){
  260.             GameManager.company.notifications.push(new Notification("CheatMod", "To Add AAA games, you need to have medium games researched"));
  261.             return;
  262.         }
  263.    
  264.         if(-1 == GameManager.company.researchCompleted.indexOf(Research.AAA)){
  265.             GameManager.company.researchCompleted.push(Research.AAA);
  266.         }
  267.     }      
  268.    
  269.     function addAllTopics(){
  270.         GameManager.company.topics = [];
  271.         GameManager.company.topics = GameManager.company.topics.concat([],Topics.topics);
  272.     }
  273.  
  274.     var div = $("body");
  275.     div.append('<div id="CheatContainer" class="windowBorder tallWindow" style="z-index: 5400;overflow:auto;display:none;"> <div id="cheatmodtop" class="windowTitle smallerWindowTitle">CheatMod</div>');
  276.     div = $("#CheatContainer");
  277.     div.append('<div id="moneylbl" style="margin-left:50px;width: 450px;" >Add Money</div>');
  278.     div.append('<div id="money1M" class="selectorButton whiteButton" onclick="UI.pickCheatClick(this)" style="display:inline-block;position: relative;margin-left:50px;width: 104px;" >Add 1M</div>');
  279.     div.append('<div id="money10M" class="selectorButton whiteButton" onclick="UI.pickCheatClick(this)" style="display:inline-block;position: relative;margin-left:0px;width: 103px;" >Add 10M</div>');
  280.     div.append('<div id="money100M" class="selectorButton whiteButton" onclick="UI.pickCheatClick(this)" style="display:inline-block;position: relative;margin-left:0px;width: 103px;" >Add 100M</div>');
  281.     div.append('<div id="money1B" class="selectorButton whiteButton" onclick="UI.pickCheatClick(this)" style="display:inline-block;position: relative;margin-left:0px;width: 104px;" >Add 1B</div>');
  282.        
  283.     div.append('<div id="fanslbl" style="margin-left:50px;width: 450px;" >Add Fans</div>');
  284.     div.append('<div id="fans1M" class="selectorButton whiteButton" onclick="UI.pickCheatClick(this)" style="display:inline-block;position: relative;margin-left:50px;width: 142px;" >Add 1M</div>');
  285.     div.append('<div id="fans10M" class="selectorButton whiteButton" onclick="UI.pickCheatClick(this)" style="display:inline-block;position: relative;margin-left:0px;width: 142px;" >Add 10M</div>');
  286.     div.append('<div id="fans100M" class="selectorButton whiteButton" onclick="UI.pickCheatClick(this)" style="display:inline-block;position: relative;margin-left:0px;width: 142px;" >Add 100M</div>');
  287.    
  288.     div.append('<div id="hypelbl" style="margin-left:50px;width: 450px;" >Add Hype</div>');
  289.     div.append('<div id="hype10" class="selectorButton whiteButton" onclick="UI.pickCheatClick(this)" style="display:inline-block;position: relative;margin-left:50px;width: 142px;" >Add 10</div>');
  290.     div.append('<div id="hype50" class="selectorButton whiteButton" onclick="UI.pickCheatClick(this)" style="display:inline-block;position: relative;margin-left:0px;width: 142px;" >Add 50</div>');
  291.     div.append('<div id="hype100" class="selectorButton whiteButton" onclick="UI.pickCheatClick(this)" style="display:inline-block;position: relative;margin-left:0px;width: 142px;" >Add 100</div>');
  292.    
  293.     div.append('<div id="research" class="selectorButton whiteButton" onclick="UI.pickCheatClick(this)" style="margin-left:50px;width: 450px;">Add Research Points (100pt)</div>');
  294.     div.append('<div id="dreamteam" class="selectorButton whiteButton" onclick="UI.pickCheatClick(this)" style="margin-left:50px;height: 100px;width: 450px">Fill open Team positions with 1337 Teammembers</div>');
  295.     div.append('<div id="bteam" class="selectorButton whiteButton" onclick="UI.pickCheatClick(this)" style="margin-left:50px;height: 100px;width: 450px">Fill open Team positions with B-Team Teammembers</div>');
  296.     div.append('<div id="proDeveloper" class="selectorButton whiteButton" onclick="UI.pickCheatClick(this)" style="margin-left:50px;width: 450px">Turn your player into a 1337 developer</div>');
  297.     div.append('<div id="generateNewTrend" class="selectorButton whiteButton" onclick="UI.pickCheatClick(this)" style="margin-left:50px;width: 450px">Generate random trend</div>');
  298.     div.append('<div id="moveToLvl4" class="selectorButton whiteButton" onclick="UI.pickCheatClick(this)" style="margin-left:50px;width: 450px">Move To Final level</div>');
  299.     div.append('<div id="AAAResearch" class="selectorButton whiteButton" onclick="UI.pickCheatClick(this)" style="display:inline-block;position: relative;margin-left:50px;width: 219px">Add AAA games</div>');
  300.     div.append('<div id="addAllTopics" class="selectorButton whiteButton" onclick="UI.pickCheatClick(this)" style="margin-left:50px;width: 450px">Add All Topics</div>');
  301.     div.append('<div id="removeNeedForVacationForStaff" class="selectorButton whiteButton" onclick="UI.pickCheatClick(this)" style="margin-left:50px;width: 450px">Remove need for staff vacation</div>');
  302.     div.append('<div id="setPerfectScoreEnabled" class="selectorButton whiteButton" onclick="UI.pickCheatClick(this)" style="margin-left:50px;width: 450px">Activate Always have PerfectScores</div>');
  303.     div.append('<div id="setNoBugsModeEnabled" class="selectorButton whiteButton" onclick="UI.pickCheatClick(this)" style="margin-left:50px;width: 450px">Activate No Bugs Mode</div>');
  304.     div.append('<div id="setFastResearchModeEnabled" class="selectorButton whiteButton" onclick="UI.pickCheatClick(this)" style="margin-left:50px;width: 450px">Activate Fast Research Mode</div>');
  305.     div.append('<div id="showAllHintsEnabled" class="selectorButton whiteButton" onclick="UI.pickCheatClick(this)" style="margin-left:50px;width: 450px">Activate show all hints Mode</div>');
  306.    
  307.     div.append('<div id="cheatmodLbl" class="windowTitle smallerWindowTitle">TechLevels</div>');
  308.     div.append('<div id="cheatmodTechLevels"></div>');
  309.    
  310.     div.append('<div id="cheatmodLbl" class="windowTitle smallerWindowTitle">Modding</div><br>');
  311.     div.append('set cash value to: <input id="moneyField" type="text" maxlength="35" style="width:170px;font-size: 22pt"/> ');
  312.     div.append('<div id="setMoney" class="selectorButton whiteButton" onclick="UI.pickCheatClick(this)" style="display:inline-block;position: relative;margin-left:50px;width: 104px;" >SET</div>');
  313.     div.append('<br>');
  314.     div.append('set fans value to: <input id="fansField" type="text" maxlength="35" style="width:170px;font-size: 22pt"/> ');
  315.     div.append('<div id="setFans" class="selectorButton whiteButton" onclick="UI.pickCheatClick(this)" style="display:inline-block;position: relative;margin-left:50px;width: 104px;" >SET</div>');
  316.     div.append('<br>');
  317.  
  318.     div.append('<div id="cheatmodLbl" class="windowTitle smallerWindowTitle">Experimental!</div><br>');
  319.     div.append('<div style="margin-left:50px;width: 450px">Move through time, only use this for mod development/testing!(Moving back in time can add double platforms, moving in the future should work fine!</div>');
  320.     div.append('<div id="cheatmod_date" style="text-align:center;margin-left:50px;width: 450px"></div>');
  321.     div.append('<div class="volumeSlider"></div>');
  322.     div.append('<div id="moveToDate" class="selectorButton whiteButton" onclick="UI.pickCheatClick(this)" style="margin-left:50px;width: 450px">Move To Date</div>');
  323.    
  324.     UI.pickCheatClick = function (a) {
  325.         Sound.click();
  326.         switch (a.id) {
  327.             case "money1M":
  328.                 addMoney(1000000);
  329.                 break;
  330.             case "money10M":
  331.                 addMoney(10000000);
  332.                 break;
  333.             case "money100M":
  334.                 addMoney(100000000);
  335.                 break;
  336.             case "money1B":
  337.                 addMoney(1000000000);
  338.                 break;
  339.             case "research":
  340.                 addResearchPoints();
  341.                 break;
  342.             case "fans1M":
  343.                 addFans(1000000);
  344.                 break;
  345.             case "fans10M":
  346.                 addFans(10000000);
  347.                 break;
  348.             case "fans100M":
  349.                 addFans(100000000);
  350.                 break;
  351.             case "dreamteam":
  352.                 addDreamTeam();
  353.                 break;         
  354.             case "bteam":
  355.                 addBTeam();
  356.                 break;
  357.             case "proDeveloper":
  358.                 createProDeveloper();
  359.                 break;
  360.             case "moveToLvl4":
  361.                 moveToLevel4();
  362.                 break;
  363.             case "AAAResearch":
  364.                 addAAAResearch();
  365.                 break;         
  366.             case "SequelResearch":
  367.                 addSequelResearch();
  368.                 break;
  369.             case "moveToDate":
  370.                 moveToDate();
  371.                 break;
  372.             case "removeNeedForVacationForStaff":
  373.                 removeNeedForVacationForStaff();
  374.                 break;
  375.             case "hype10":
  376.                 addHype(10);
  377.                 break;
  378.             case "hype50":
  379.                 addHype(50);
  380.                 break;
  381.             case "hype100":
  382.                 addHype(100);
  383.                 break;
  384.             case "setPerfectScoreEnabled":
  385.                 setPerfectScoreEnabled();
  386.                 break;
  387.             case "setNoBugsModeEnabled":
  388.                 setNoBugsModeEnabled();
  389.                 break;
  390.             case "addAllTopics":
  391.                 addAllTopics();
  392.                 break;
  393.             case "setFastResearchModeEnabled":
  394.                 setFastResearchEnabled();
  395.                 break;             
  396.             case "showAllHintsEnabled":
  397.                 setShowAllHintsEnabled();
  398.                 break;         
  399.             case "generateNewTrend":
  400.                 generateNewTrend();
  401.                 break;
  402.             case "setMoney":
  403.                 setMoney();
  404.                 break;
  405.             case "setFans":
  406.                 setFans();
  407.                 break;
  408.             default:
  409.                 return;
  410.             }
  411.     }
  412.    
  413.     function moveToDate(){
  414.         GameManager.gameTime = new_date * (GameManager.SECONDS_PER_WEEK * 1E3);
  415.         //GameManager.company.currentWeek = GameManager.gameTime;
  416.         General.proceedOneWeek(GameManager.company,new_date);
  417.     }  
  418.    
  419.     function setDate(d){
  420.         new_date = d
  421.        
  422.          var a = Math.floor(d) % 4 + 1;
  423.          var c = Math.floor(d) / 4;
  424.          var b = c / 12 + 1;
  425.          var year = Math.floor(b);
  426.          var month = Math.floor(c % 12 + 1);
  427.          var week = Math.floor(a);
  428.        
  429.         var div = $("#CheatContainer");
  430.         div.find("#cheatmod_date").html("Y" + year + " M" + month  + " W" + week);
  431.     }  
  432.    
  433.     var original_showContextMenu = UI._showContextMenu;
  434.     var new_showContextMenu = function(b, c, d, h){
  435.    
  436.         if(b == "competitorMod"){
  437.         }else{
  438.             c.push({
  439.                     label: "CheatMode...",
  440.                     action: function () {
  441.                         Sound.click();
  442.                         GameManager.resume(true);
  443.                        
  444.                         generateTechLevelScreen(); 
  445.                         var div = $("#CheatContainer");
  446.                         div.scrollTop()
  447.                         $("#CheatContainer").css("z-index","5400");
  448.                         div.gdDialog({
  449.                                 popout: !0,
  450.                                 close: !0,
  451.                                 onClose : function () {
  452.                                     var div = $("#cheatmodTechLevels");
  453.                                     div.empty();
  454.                                 }
  455.                         })
  456.                     }
  457.                 })
  458.  
  459.                 div.animate({
  460.                     scrollTop: $("#cheatmodtop").offset().top
  461.                 }, 2000);
  462.                
  463.                 //set current cash & fans textFields
  464.                 div.find("#moneyField").val(UI.getLongNumberString(GameManager.company.cash));
  465.                 div.find("#fansField").val(UI.getLongNumberString(GameManager.company.fans));
  466.                
  467.                 //test slider
  468.                 div.find(".volumeSlider").slider({
  469.                 min: 0,
  470.                 max: 2160,
  471.                 range: "min",
  472.                 value: Math.floor(GameManager.company.currentWeek),
  473.                 animate: !1,
  474.                 slide: function (a, b) {
  475.                     var c = b.value;
  476.                     setDate(c);
  477.                 }
  478.                
  479.                
  480.             });
  481.             setDate(GameManager.company.currentWeek);
  482.         }
  483.         original_showContextMenu(b, c, d, h);
  484.     };
  485.     UI._showContextMenu = new_showContextMenu
  486.    
  487.    
  488.     //always perfect scores easy way
  489.     var getPerfectScoreComment = function(hasPerfectScore){
  490.         if(hasPerfectScore == false){
  491.             return ["A masterpiece.".localize(), "Best of its kind.".localize(), "Truly great.".localize(), "Everyone loves it!".localize(), "Must have!".localize(), "Outstanding achievement.".localize(), "Awesome!".localize(), "My new favorite!".localize()].pickRandom();
  492.         }else{
  493.             return ["11 out of 10. Game of the year, any year!".localize(), "11 out of 10. Nuff said.".localize(), "11 out of 10. A exceptional score for an exceptional game.".localize(), "11 out of 10. Rules don't apply to this outstanding game.".localize()].pickRandom();
  494.         }
  495.     }
  496.    
  497.     var setPerfectScores = function (e) {
  498.         e.reviews[0].score = 10;
  499.         e.reviews[0].message = getPerfectScoreComment(false);
  500.         e.reviews[1].score = 10;
  501.         e.reviews[1].message = getPerfectScoreComment(false);
  502.         e.reviews[2].score = 10;
  503.         e.reviews[2].message = getPerfectScoreComment(false);
  504.        
  505.         var r = GameManager.company.getRandom();
  506.         if (r >= 0.7) {
  507.             e.reviews[3].score = 11;
  508.             e.reviews[3].message = getPerfectScoreComment(true);
  509.         }else{
  510.             e.reviews[3].score = 10;
  511.             e.reviews[3].message = getPerfectScoreComment(false);
  512.         }
  513.  
  514.         e.game.score = 10;
  515.     };
  516.    
  517.     var setPerfectScoreEnabled = function(){
  518.         if(perfectScores){
  519.             GDT.off(GDT.eventKeys.gameplay.afterGameReview, setPerfectScores);
  520.             var div = $("#CheatContainer");
  521.             div.find("#setPerfectScoreEnabled").html("Activate Always have PerfectScores");
  522.             perfectScores = false;
  523.         }else{
  524.             GDT.on(GDT.eventKeys.gameplay.afterGameReview, setPerfectScores);
  525.             var div = $("#CheatContainer");
  526.             div.find("#setPerfectScoreEnabled").html("Deactivate Always have PerfectScores");
  527.             perfectScores = true;
  528.         }
  529.     }
  530.    
  531.     //remove bugs
  532.     var old_updateCharacters = GameManager.updateCharacters;
  533.     var new_updateCharacters = function(){
  534.         if(noBugsMode && typeof GameManager.company.currentGame != 'undefined' && GameManager.company.currentGame != null){
  535.             GameManager.company.currentGame.bugs = 0;
  536.         }
  537.         old_updateCharacters();
  538.         if(noBugsMode && typeof GameManager.company.currentGame != 'undefined' && GameManager.company.currentGame != null){
  539.             GameManager.company.currentGame.bugs = 0;
  540.         }
  541.     }
  542.     GameManager.updateCharacters = new_updateCharacters
  543.    
  544.     var setNoBugsModeEnabled = function(){
  545.         if(noBugsMode){
  546.             var div = $("#CheatContainer");
  547.             div.find("#setNoBugsModeEnabled").html("Activate No Bugs Mode");
  548.             noBugsMode = false;
  549.         }else{
  550.             var div = $("#CheatContainer");
  551.             div.find("#setNoBugsModeEnabled").html("Deactivate No Bugs Mode");
  552.             noBugsMode = true;
  553.         }
  554.     }
  555.    
  556.     //instant research
  557.     var old_increaseResearchProgress = GameManager.increaseResearchProgress;
  558.     var new_increaseResearchProgress = function(researcher, progress){
  559.         if(typeof researcher.currentResearch != 'undefined' && researcher.currentResearch != null && researcher.currentResearch.type == "training"){
  560.             old_increaseResearchProgress(researcher, progress);
  561.         }else{
  562.             if(fastResearch){
  563.                 var researchTemp = GameManager.currentResearches.first(function (c) {
  564.                     return c.staffId === researcher.id
  565.                 });
  566.                 if (GameManager.currentFeature || GameManager.currentEngineDev)
  567.                         GameManager.finishResearch(researcher, researchTemp);
  568.                     else
  569.                         researcher.endWorking();
  570.             }else{
  571.                 old_increaseResearchProgress(researcher, progress);
  572.             }      
  573.         }
  574.     }
  575.     GameManager.increaseResearchProgress = new_increaseResearchProgress
  576.  
  577.     var setFastResearchEnabled = function(){
  578.         if(fastResearch){
  579.             var div = $("#CheatContainer");
  580.             div.find("#setFastResearchModeEnabled").html("Activate Fast Research Mode");
  581.             fastResearch = false;
  582.         }else{
  583.             var div = $("#CheatContainer");
  584.             div.find("#setFastResearchModeEnabled").html("Deactivate Fast Research Mode");
  585.             fastResearch = true;
  586.         }
  587.     }
  588.    
  589.     //generate trend
  590.     var generateNewTrend = function () {
  591.         if (GameManager.company.currentLevel == 1){
  592.             GameManager.company.notifications.push(new Notification("CheatMod", "Can not generate a trend in the first level(garage). Please move to the next level."));
  593.             return;
  594.         }
  595.  
  596.         if(typeof GameManager.company.flags.trends != 'undefined' && GameManager.company.flags.trends != null){
  597.             GameManager.company.flags.trends = {};
  598.         }
  599.         GameManager.company.flags.trends.currentTrend = null;
  600.  
  601.         do
  602.         {
  603.             GameManager.company.flags.trends.expireBy = GameManager.gameTime-1;
  604.             GameTrends.updateTrends(GameManager.company);
  605.         }
  606.         while (GameManager.company.flags.trends.currentTrend == null);
  607.     }
  608.    
  609.     //techlevels
  610.     var xpItems = [];
  611.     var generateTechLevelScreen = function () {
  612.         xpItems = [];
  613.         var game = GameManager.company.gameLog.last();
  614.        
  615.         if(typeof game == 'undefined' || game == null){
  616.             var div = $("#cheatmodTechLevels");
  617.             div.append('Requirement: Need at least 1 released game');
  618.             return;
  619.         }
  620.        
  621.         var selectedGameFeatures = game.features;
  622.         for (var i = 0; i < game.featureLog.length; i++) {
  623.             var mission = game.featureLog[i];
  624.             if (mission.missionType != "mission")
  625.                 continue;
  626.                
  627.             var feature = General.getMission(mission.id);
  628.  
  629.             var gain = 0;
  630.             var item = {
  631.                 originalItem : feature,
  632.                 name : feature.name,
  633.                 level : LevelCalculator.getLevel(feature.experience),
  634.                 progress : LevelCalculator.getProgressToNextLevel(feature.experience),
  635.                 xpGain : gain,
  636.                 progressColor : "orange",
  637.                 progressGainColor : "#FFC456"
  638.             };
  639.             xpItems.push(item);
  640.         }
  641.        
  642.         var allFeatures = GameManager.company.features;
  643.         for (var i = 0; i < allFeatures.length; i++) {
  644.             var feature = allFeatures[i];
  645.             if (!feature.showXPGain)
  646.                 continue;
  647.  
  648.             var gain = 0;
  649.             var item = {
  650.                 originalItem : feature,
  651.                 name : feature.name,
  652.                 level : LevelCalculator.getLevel(feature.experience),
  653.                 progress : LevelCalculator.getProgressToNextLevel(feature.experience),
  654.                 xpGain : gain,
  655.                 progressColor : "orange",
  656.                 progressGainColor : "#FFC456"
  657.             };
  658.             xpItems.push(item);
  659.         }
  660.        
  661.         var div = $("#cheatmodTechLevels");
  662.         div.empty()
  663.         var featureElementTemplate = $(".releaseGameFeatureTemplate");
  664.         for (var i = 0; i < xpItems.length; i++) {
  665.             var element = featureElementTemplate.clone();
  666.            
  667.             div.append(element);
  668.             element.append('<div id="featureTechLvl" class="selectorButton whiteButton" onclick="CheatModKristof1104.addTechLevel({0})" style="display:inline-block;position: relative;margin: 0px;top:3px;line-height: 20px;height:22px;width: 22px;" >+</div>'.format(i));
  669.  
  670.             element.css("font-size", 12 + "pt");
  671.  
  672.             var item = xpItems[i];
  673.             (function (element, item) {
  674.                 element.find(".featureName").text(item.name);
  675.                 element.find(".featureLevel").text("Lvl. ".localize() + item.level);
  676.                 var featureLevelUp = element.find(".featureLevelUp");
  677.                 featureLevelUp.hide();
  678.                 element.find(".featureProgress").css({
  679.                     width : item.progress - 1 + "%"
  680.                 }).css({
  681.                     "background-color" : item.progressColor
  682.                 });
  683.                 var featureGain =
  684.                     element.find(".featureProgressGain").css({
  685.                         "background-color" : item.progressGainColor
  686.                     });
  687.                 featureGain["css_width_percent"] = 0;
  688.                 var featureGainCaption = element.find(".featureGainCaption");
  689.                 featureGainCaption["klug_number_int_text"] = 0;
  690.                
  691.             })(element, item)
  692.         }
  693.     }
  694.    
  695.     CheatModKristof1104.addTechLevel = function(i){
  696.         var feature = xpItems[i];
  697.         var xpNeeded = LevelCalculator.getXpToNextLevel(feature.originalItem.experience);
  698.         var lvl = LevelCalculator.getLevel(feature.originalItem.experience);
  699.         var baseXp = LevelCalculator.getXpForLevel(lvl);
  700.         xpNeeded -= baseXp;
  701.         feature.originalItem.experience += xpNeeded;
  702.         generateTechLevelScreen();
  703.     }
  704.  
  705.     //Add Tech and design points during game dev
  706.     CheatModKristof1104.addTechAndDesignPointsButtons = function(){
  707.         var div = $("#canvasContainer");
  708.         var designButton = $('<div id="cheatModDesignPoints" class="selectorButton " style="background-color: orange;position:absolute;line-height: 25px;height:30px;width: 30px; opacity=0;-webkit-border-radius: 999px;-moz-border-radius: 999px;border-radius: 999px;behavior: url(PIE.htc);">' + "+" + "</div>");
  709.         var techButton = $('<div id="cheatModTechPoints" class="selectorButton " style="background-color: deepskyblue;position:absolute;line-height: 25px;height:30px;width: 30px; opacity=0;-webkit-border-radius: 999px;-moz-border-radius: 999px;border-radius: 999px;behavior: url(PIE.htc);">' + "+" + "</div>");
  710.         var designButton100 = $('<div id="cheatModDesignPoints100" class="selectorButton " style="background-color: orange;position:absolute;line-height: 35px;height:40px;width: 40px; opacity=0;-webkit-border-radius: 999px;-moz-border-radius: 999px;border-radius: 999px;behavior: url(PIE.htc);">' + "+" + "</div>");
  711.         var techButton100 = $('<div id="cheatModTechPoints100" class="selectorButton " style="background-color: deepskyblue;position:absolute;line-height: 35px;height:40px;width: 40px; opacity=0;-webkit-border-radius: 999px;-moz-border-radius: 999px;border-radius: 999px;behavior: url(PIE.htc);">' + "+" + "</div>");
  712.         var research = $('<div id="cheatModAddResearch" class="selectorButton " style="background-color: #006AFF;color:white;position:absolute;line-height: 25px;height:30px;width: 30px; opacity=0;-webkit-border-radius: 999px;-moz-border-radius: 999px;border-radius: 999px;behavior: url(PIE.htc);">' + "+" + "</div>");
  713.         div.append(designButton);
  714.         div.append(techButton);    
  715.         div.append(designButton100);
  716.         div.append(techButton100);
  717.         div.append(research);
  718.         $("#cheatModDesignPoints").css("left",VisualsManager.gameStatusBar.x + VisualsManager.gameStatusBar.designPoints.x -14);
  719.         $("#cheatModDesignPoints").css("top",VisualsManager.gameStatusBar.y + VisualsManager.gameStatusBar.designPoints.y + 82);
  720.         $("#cheatModDesignPoints").click (function () {
  721.                 CheatModKristof1104.addTechAndDesignPoints(true);
  722.                 return false;
  723.         });
  724.         $("#cheatModTechPoints").css("left",VisualsManager.gameStatusBar.x + VisualsManager.gameStatusBar.technologyPoints.x -14);
  725.         $("#cheatModTechPoints").css("top",VisualsManager.gameStatusBar.y + VisualsManager.gameStatusBar.technologyPoints.y + 82);
  726.         $("#cheatModTechPoints").click (function () {
  727.                 CheatModKristof1104.addTechAndDesignPoints(false);
  728.                 return false;
  729.         });    
  730.         $("#cheatModDesignPoints100").css("left",VisualsManager.gameStatusBar.x + VisualsManager.gameStatusBar.designPoints.x +16);
  731.         $("#cheatModDesignPoints100").css("top",VisualsManager.gameStatusBar.y + VisualsManager.gameStatusBar.designPoints.y + 82);
  732.         $("#cheatModDesignPoints100").click (function () {
  733.                 CheatModKristof1104.addTechAndDesignPoints(true,true);
  734.                 return false;
  735.         });
  736.         $("#cheatModTechPoints100").css("left",VisualsManager.gameStatusBar.x + VisualsManager.gameStatusBar.technologyPoints.x + 16);
  737.         $("#cheatModTechPoints100").css("top",VisualsManager.gameStatusBar.y + VisualsManager.gameStatusBar.technologyPoints.y + 82);
  738.         $("#cheatModTechPoints100").click (function () {
  739.                 CheatModKristof1104.addTechAndDesignPoints(false,true);
  740.                 return false;
  741.         });    
  742.         $("#cheatModAddResearch").css("left", VisualsManager.researchPoints.x );
  743.         $("#cheatModAddResearch").css("top", VisualsManager.researchPoints.y + 72);
  744.         $("#cheatModAddResearch").click (function () {
  745.                 addResearchPoints();
  746.                 return false;
  747.         });
  748.     }  
  749.    
  750.     CheatModKristof1104.addTechAndDesignPoints = function(design,addBy100){
  751.         if(!GameManager.company.isCurrentlyDevelopingGame())
  752.             return;
  753.        
  754.         var game = GameManager.company.currentGame;
  755.        
  756.         if(typeof addBy100 != 'undefined' && addBy100 != null){
  757.             if(design){
  758.             game.designPoints += 100;
  759.             }else{
  760.                 game.technologyPoints += 100;
  761.             }
  762.         }else{
  763.             if(design){
  764.             game.designPoints += 10;
  765.             }else{
  766.                 game.technologyPoints += 10;
  767.             }
  768.         }
  769.         VisualsManager.updatePoints();
  770.     }
  771.    
  772.     var designAndTechAdded = false;
  773.     var initTechAndDesignButtons = function(data){
  774.         if(designAndTechAdded == false){
  775.             CheatModKristof1104.addTechAndDesignPointsButtons();   
  776.             designAndTechAdded = true;
  777.         }
  778.     }
  779.     GDT.on(GDT.eventKeys.gameplay.weekProceeded,initTechAndDesignButtons);
  780.    
  781.    
  782.     //knowledge
  783.     var old_hasComboKnowledge = Knowledge.hasComboKnowledge;
  784.     var new_hasComboKnowledge = function(company, game, source){
  785.         if(showAllHints){
  786.             return true;
  787.         }else{
  788.             return old_hasComboKnowledge(company, game, source);
  789.         }      
  790.     }
  791.     Knowledge.hasComboKnowledge = new_hasComboKnowledge;   
  792.    
  793.     var old_hasTrainingKnowledge = Knowledge.hasTrainingKnowledge;
  794.     var new_hasTrainingKnowledge = function(training){
  795.         if(showAllHints){
  796.             return true;
  797.         }else{
  798.             return old_hasTrainingKnowledge(training);
  799.         }      
  800.     }
  801.     Knowledge.hasTrainingKnowledge = new_hasTrainingKnowledge;     
  802.    
  803.     var old_hasMissionWeightingKnowledge = Knowledge.hasMissionWeightingKnowledge;
  804.     var new_hasMissionWeightingKnowledge = function(company, mission, game, ignoreTopic, source){
  805.         if(showAllHints){
  806.             return true;
  807.         }else{
  808.             return old_hasMissionWeightingKnowledge(company, mission, game, ignoreTopic, source);
  809.         }      
  810.     }
  811.     Knowledge.hasMissionWeightingKnowledge = new_hasMissionWeightingKnowledge; 
  812.  
  813.     var old_getPlatformGenreWeightingKnowledge = Knowledge.getPlatformGenreWeightingKnowledge;
  814.     var new_getPlatformGenreWeightingKnowledge = function(company, platform){
  815.         if(showAllHints){
  816.             var match = {id : platform.id};
  817.             match["genreWeightings"] = [0, 0, 0, 0, 0, 0];
  818.             match["genreWeightings"] = platform.genreWeightings
  819.             return match["genreWeightings"];
  820.         }else{
  821.             return old_getPlatformGenreWeightingKnowledge(company, platform);
  822.         }      
  823.     }
  824.     Knowledge.getPlatformGenreWeightingKnowledge = new_getPlatformGenreWeightingKnowledge;
  825.    
  826.     var old_getPlatformAudienceWeightingKnowledge = Knowledge.getPlatformAudienceWeightingKnowledge;
  827.     var new_getPlatformAudienceWeightingKnowledge = function(company, platform){
  828.         if(showAllHints){
  829.             var match = {id : platform.id};
  830.             match["audienceWeightings"] = [0, 0, 0];
  831.             var weighting1 = Platforms.getAudienceWeighting([platform], "young", true);
  832.             var weighting2 = Platforms.getAudienceWeighting([platform], "everyone", true);
  833.             var weighting3 = Platforms.getAudienceWeighting([platform], "mature", true);
  834.  
  835.             match["audienceWeightings"][0] = weighting1;
  836.             match["audienceWeightings"][1] = weighting2;
  837.             match["audienceWeightings"][2] = weighting3;
  838.            
  839.             return match["audienceWeightings"];
  840.         }else{
  841.             return old_getPlatformAudienceWeightingKnowledge(company, platform);
  842.         }      
  843.     }
  844.     Knowledge.getPlatformAudienceWeightingKnowledge = new_getPlatformAudienceWeightingKnowledge;   
  845.  
  846.     var old_getTopicAudienceWeightingKnowledge = Knowledge.getTopicAudienceWeightingKnowledge;
  847.     var new_getTopicAudienceWeightingKnowledge = function(company, topic, audience, target){
  848.         if(showAllHints){
  849.             var match = {id : topic.id};
  850.             match["audienceWeightings"] =[0, 0, 0];
  851.             var weighting1 = General.getAudienceWeighting(topic.audienceWeightings, "young");
  852.             var weighting2 = General.getAudienceWeighting(topic.audienceWeightings, "everyone");
  853.             var weighting3 = General.getAudienceWeighting(topic.audienceWeightings, "mature");
  854.  
  855.             match["audienceWeightings"][0] = weighting1;
  856.             match["audienceWeightings"][1] = weighting2;
  857.             match["audienceWeightings"][2] = weighting3;
  858.            
  859.             return match["audienceWeightings"];
  860.         }else{
  861.             return old_getTopicAudienceWeightingKnowledge(company, topic, audience, target);
  862.         }      
  863.     }
  864.     Knowledge.getTopicAudienceWeightingKnowledge = new_getTopicAudienceWeightingKnowledge;
  865.    
  866.  
  867.     var setShowAllHintsEnabled = function(){
  868.         if(showAllHints){
  869.             var div = $("#CheatContainer");
  870.             div.find("#showAllHintsEnabled").html("Activate show all hints Mode");
  871.             showAllHints = false;
  872.         }else{
  873.             var div = $("#CheatContainer");
  874.             div.find("#showAllHintsEnabled").html("Deactivate show all hints Mode");
  875.             showAllHints = true;
  876.         }
  877.     }
  878.    
  879. })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement