spnati pam /*Instructions: To use this, simply open up the dev console (in Chrome and Firefox, this is done with CTRL+SHIFT+I) Select all in this file, then literally copy-paste it into the console that comes up, and hit enter. Call the function by writing it's name, and subbing out the parameter names for the values you want to use, for example: stripAllToLevel(2) */ /* Suits: * 0: Spades * 1: Hearts * 2: Clubs spnati pam How to get it? spnati pam * 3: Diamonds */ var spnati_cheat_suits_list = [0, 1, 2, 3] function validSuitOrDefault(suit, def){ /* Takes a suit as input. If the suit isn't a valid SPNATI suit name, then the specified default value is returned instead. suit - The suit string to test. def - The default value to return in the invalid case. */ return (spnati_cheat_suits_list.indexOf(suit) !== -1) ? suit : def; spnati pam How to get it? spnati pam } function stripAllNaked(){ /*Strip everyone (except the PC) naked such that one round is left before they lose.*/ stripAllToLevel(1); } function stripNaked(player){ /*Strip all layers off of a given player (0 is the PC, 1-4 are NPCs). Params: player - Integer (0 is the PC, 1-4 are NPCs) spnati pam PasteShr spnati pam */ stripToLevel(player, 1); } function autoWin(){ /*Automatically win.*/ stripAllToLevel(0); } function stripAllToLevel(level){ spnati pam How to get it for free? spnati pam /*Strip all players (except the PC) down so that they have at most _level_ number of layers left. Params: level - Integer (The number of layers to leave left on a player.) */ for(var i = 1; i < players.length; i++){ stripToLevel(i, level); } } function stripToLevel(player, level){ /*Strip a player down such that they only have (at most) a certain number of layers left. spnati pam How to get it for free? spnati pam Params: player - Integer (0 is the PC, 1-4 are NPCs) level - Integer (The number of layers to leave left on a player.) */ for (var c = countClothing(player); c >= level; c--){stripChoice(player);} } function countClothing(player){ /* Count the clothing the player has remaining. Params: Player - integer (0 is the PC, 1-4 are NPCs) */ spnati pam How to get it for free? spnati pam var clothes = 0; for (var i = 0; i < players[player].clothing.length; i++) { if (players[player] && players[player].clothing[i]) { clothes++; } } return clothes; } function multiStripChoice(player, times){ spnati pam How to dowload it? spnati pam /* Strip the indicated player of multiple layer. Params: Player - integer (0 is the PC, 1-4 are NPCs) times - integer (The number of layers to try to strip.) */ for(var i = 0; (i < times) && (countClothing(player) != -1); i++){ stripChoice(player); } } function stripChoice(player){ spnati pam PasteShr spnati pam /* Strip the indicated player of a single layer. Params: Player - integer (0 is the PC, 1-4 are NPCs) */ stripPlayer(player); updateAllGameVisuals(); } function randomBackground(){ /* Choose a random background from those available. spnati pam PasteShr spnati pam */ //Note this randint helper function could either be inlined or broken out into an actual function. var randint = function(a,b){ return (function(n,x){ return Math.floor(Math.random()*(x-n)+n); })(Math.min(a,b), Math.max(a,b)); }; setBackground(function(){var a = randint(0,23); console.log(a); return a;}()); } spnati pam How to get it for free? spnati pam function unlockAllEndings(){ /* Unlocks all the endings in the gallery mode. NOTE: You can access the gallery by using the command "loadGalleryScreen()" from the main menu. */ for(var i = 0; i < galleryEndings.length; i++) { galleryEndings[i].unlocked = true; } spnati pam How to get it for free? spnati pam } function givePlayerRoyalStraightFlush(player_number, suit){ /* Gives the target player a royal straight flush of any desired suit. player_number - An integer representing the player index getting the cards (0 -> player, 1-4 -> npcs) suit - An integer representing the suit (options are shown in the suits array) */ var chosen_suit = validSuitOrDefault(suit, spnati_cheat_suits_list[0]); players[player_number].hand.cards = [new Card(chosen_suit,10), new Card(chosen_suit,11), new Card(chosen_suit,12), new Card(chosen_suit,13), new Card(chosen_suit,14)] spnati pam How to get it for free? spnati pam } function giveSelfRoyalStraightFlush(suit){ /* Gives the player a royal straight flush of the target suit. suit - suit - An integer representing the suit */ givePlayerRoyalStraightFlush(0, suit); } spnati pam How to get it for free? spnati pam function makeLose(player_number){ players[player_number].hand.cards = [new Card(2,2), new Card(2,3), new Card(2,4), new Card(2,5), new Card(3,7)] } //not updated var givePlayerRoyalStraightFlushFunctorMap = function(){ //This auto-gens a lookup table for the enableAutoRoyalStraightFlush functions. var map = {}; for(var i = 0; i < players.length; i++){ map[i] = {} spnati pam How to dowload it? spnati pam for(var j = 0; j < spnati_cheat_suits_list.length; j++){ map[i][spnati_cheat_suits_list[j]] = function(i, j){return function(){givePlayerRoyalStraightFlush(i, spnati_cheat_suits_list[j])};}(i,j); //This double annon function is because closures in javascript are weird. } } return map; }(); //not updated function enableAutoRoyalStraightFlush(player_number, suit){ spnati pam How to dowload it? spnati pam /* Constantly gives the player a royal straight flush of the chosen suit, every single turn. Note if this is done multiple times for different suits on the same player, only one of the suits will be shown depending on order of application. player_number - An integer representing the player index getting the cards (0 -> player, 1-4 -> npcs) suit - A string representing the suit (either "heart", "clubs", "spade" or "diamo") */ suit = validSuitOrDefault(suit, spnati_cheat_suits_list[0]); document.getElementById("main-game-button").addEventListener("click", givePlayerRoyalStraightFlushFunctorMap[player_number][suit]); } spnati pam How to get it? spnati pam //not updated function disableAutoRoyalStraightFlush(player_number, suit){ /* Disables a previously set "enableAutoRoyalStraightFlush" for a particular player and suit. player_number - An integer representing the player index getting the cards (0 -> player, 1-4 -> npcs) suit - A string representing the suit (either "heart", "clubs", "spade" or "diamo") */ suit = validSuitOrDefault(suit, spnati_cheat_suits_list[0]); document.getElementById("main-game-button").removeEventListener("click", givePlayerRoyalStraightFlushFunctorMap[player_number][suit]); spnati pam How to get it for free? spnati pam } //not updated function disableAllAutoRoyalStraightFlush(player_number){ for(var i = 0; i < spnati_cheat_suits_list.length; i++){ document.getElementById("main-game-button").removeEventListener("click", givePlayerRoyalStraightFlushFunctorMap[player_number][spnati_cheat_suits_list[i]]); } } //not updated spnati pam How to get it? spnati pam function enableSelfRoyalStraightFlush(){ enableAutoRoyalStraightFlush(0, "heart"); } //not updated function disableSelfRoyalStraightFlush(){ disableAutoRoyalStraightFlush(0, "heart"); } spnati pam