spnati net /*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) */ var spnati_cheat_suits_list = ["heart", "clubs", "diamo", "spade"] 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. spnati net PasteShr spnati net 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; } function stripAllNaked(){ /*Strip everyone (except the PC) naked such that one round is left before they lose.*/ stripAllToLevel(1); } spnati net How to get it for free? spnati net 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) */ stripToLevel(player, 1); } function autoWin(){ /*Automatically win.*/ spnati net How to get it for free? spnati net stripAllToLevel(0); } function stripAllToLevel(level){ /*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); } spnati net How to use it? spnati net } function stripToLevel(player, level){ /*Strip a player down such that they only have (at most) a certain number of layers left. 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);} } spnati net How to dowload it? spnati net function countClothing(player){ /* Count the clothing the player has remaining. Params: Player - integer (0 is the PC, 1-4 are NPCs) */ var clothes = 0; for (var i = 0; i < players[player].clothing.length; i++) { if (players[player] && players[player].clothing[i]) { clothes++; } } spnati net How to use it? spnati net return clothes; } function multiStripChoice(player, times){ /* 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); spnati net How to use it? spnati net } } function stripChoice(player){ /* Strip the indicated player of a single layer. Params: Player - integer (0 is the PC, 1-4 are NPCs) */ stripPlayer(player); updateAllGameVisuals(); } spnati net PasteShr spnati net function randomBackground(){ /* Choose a random background from those available. */ //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)); spnati net How to use it? spnati net }; setBackground(function(){var a = randint(0,23); console.log(a); return a;}()); } 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. */ spnati net PasteShr spnati net for(var i = 0; i < galleryEndings.length; i++) { galleryEndings[i].unlocked = true; } } 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) spnati net PasteShr spnati net suit - A string representing the suit (options are shown in the suits array below) */ var chosen_suit = validSuitOrDefault(suit, spnati_cheat_suits_list[0]); hands[player_number].cards = [chosen_suit+"1", chosen_suit+"13", chosen_suit+"12", chosen_suit+"11", chosen_suit+"10"] } function giveSelfRoyalStraightFlush(suit){ /* Gives the player a royal straight flush of the target suit. suit - suit - A string representing the suit (either "heart", "clubs", "spade" or "diamo") spnati net How to use it? spnati net */ givePlayerRoyalStraightFlush(0, suit); } 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] = {} for(var j = 0; j < spnati_cheat_suits_list.length; j++){ spnati net PasteShr spnati net 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; }(); function enableAutoRoyalStraightFlush(player_number, suit){ /* Constantly gives the player a royal straight flush of the chosen suit, every single turn. spnati net How to dowload it? spnati net 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]); } function disableAutoRoyalStraightFlush(player_number, suit){ spnati net How to get it for free? spnati net /* 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]); } function disableAllAutoRoyalStraightFlush(player_number){ spnati net How to get it for free? spnati net 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]]); } } function enableSelfRoyalStraightFlush(){ enableAutoRoyalStraightFlush(0, "heart"); } function disableSelfRoyalStraightFlush(){ spnati net How to get it for free? spnati net disableAutoRoyalStraightFlush(0, "heart"); } spnati net