diff --git a/Actor.js b/Actor.js index 480509c9ed..0ca67cef89 100644 --- a/Actor.js +++ b/Actor.js @@ -50,6 +50,10 @@ function ActorChangeAttitude(LoveAttitude, SubAttitude) { if (CurrentActor == Actor[L][ActorName]) { Actor[L][ActorLove] = Actor[L][ActorLove] + parseInt(LoveAttitude); Actor[L][ActorSubmission] = Actor[L][ActorSubmission] + parseInt(SubAttitude); + if (Actor[L][ActorLove] > 99) Actor[L][ActorLove] = 99; + if (Actor[L][ActorLove] < -99) Actor[L][ActorLove] = -99; + if (Actor[L][ActorSubmission] > 99) Actor[L][ActorSubmission] = 99; + if (Actor[L][ActorSubmission] < -99) Actor[L][ActorSubmission] = -99; } } diff --git a/C000_Intro/ChapterSelect/GameCredits.csv b/C000_Intro/ChapterSelect/GameCredits.csv index 5ce8592267..9c4dd8d57a 100644 --- a/C000_Intro/ChapterSelect/GameCredits.csv +++ b/C000_Intro/ChapterSelect/GameCredits.csv @@ -15,6 +15,7 @@ bryce m.|Xepherio Designated|Ilsyra Jyeoh|Winterisbest Michal P.|David +James L.|golden_silver_shot LuckyBonin|Bahamut101 Fey|Mechio Dethfox52|Evangelina T. @@ -39,15 +40,17 @@ Barbehenn|Stargat53 Lovebdg1|Jörn P. Stefano|Rafael R. Destroyerksb|Ryner L. -BinaryNerd|MrSteak -Triassik|Arboraxx -Charlulu's D.|Raven-rj -Zongus763|Simon W. -plicoc|Jack S. -Joshua H.|Gary C. -jukehero461|天河 -lemonda|DJZ -Littleshiro-kun|Christopher W. +Ray B.|roulio12 +Afituz I.|BinaryNerd +MrSteak|Triassik +Arboraxx|Charlulu's D. +Raven-rj|Zongus763 +Simon W.|plicoc +Jack S.|Joshua H. +Gary C.|jukehero461 +天河|lemonda +DJZ|Littleshiro-kun +Christopher W.| CreditTypeFans diff --git a/C000_Intro/ChapterSelect/ThankYou/Ilsyra.jpg b/C000_Intro/ChapterSelect/ThankYou/Ilsyra.jpg index 012972c21a..f3e3987c5c 100644 Binary files a/C000_Intro/ChapterSelect/ThankYou/Ilsyra.jpg and b/C000_Intro/ChapterSelect/ThankYou/Ilsyra.jpg differ diff --git a/Cheat.js b/Cheat.js new file mode 100644 index 0000000000..04b1e71888 --- /dev/null +++ b/Cheat.js @@ -0,0 +1,54 @@ +var CheatAllow = false; + +// Receives cheat keys +function CheatKey() { + + // No cheats until the player has a name + if (Common_PlayerName != "") { + + // In a fight or a race, the user can press * to win automatically + if (!FightEnded && (FightTimer > 0)) { if (KeyPress == 42) FightEnd(true); return; } + if (!DoubleFightEnded && (DoubleFightTimer > 0)) { if (KeyPress == 42) DoubleFightEnd(true); return; } + if (!RaceEnded && (RaceTimer > 0)) { if (KeyPress == 42) RaceEnd(true); return; } + + // Actors and inventory cheat + if (CurrentActor != "") CheatActor(); + CheatSkill(); + CheatInventory(); + + } + +} + +// Cheats to change actor love or submission (from 1 to 4) +function CheatActor() { + if (KeyPress == 49) ActorChangeAttitude(1, 0); + if (KeyPress == 50) ActorChangeAttitude(-1, 0); + if (KeyPress == 51) ActorChangeAttitude(0, 1); + if (KeyPress == 52) ActorChangeAttitude(0, -1); +} + +// Cheats to gain a skill (from 5 to 9) +function CheatSkill() { + if (KeyPress == 53) PlayerAddSkill("Arts", 1); + if (KeyPress == 54) PlayerAddSkill("Fighting", 1); + if (KeyPress == 55) PlayerAddSkill("RopeMastery", 1); + if (KeyPress == 56) PlayerAddSkill("Seduction", 1); + if (KeyPress == 57) PlayerAddSkill("Sports", 1); +} + +// Cheats to add inventory (each letter represent an item) +function CheatInventory() { + if ((KeyPress == 65) || (KeyPress == 97)) PlayerAddInventory("Armbinder", 1); + if ((KeyPress == 66) || (KeyPress == 98)) PlayerAddInventory("BallGag", 1); + if ((KeyPress == 67) || (KeyPress == 99)) PlayerAddInventory("Cuffs", 1); + if ((KeyPress == 70) || (KeyPress == 102)) PlayerAddInventory("ChastityBelt", 1); + if ((KeyPress == 71) || (KeyPress == 103)) PlayerAddInventory("ClothGag", 1); + if ((KeyPress == 75) || (KeyPress == 107)) PlayerAddInventory("CuffsKey", 1); + if ((KeyPress == 76) || (KeyPress == 108)) PlayerAddInventory("Collar", 1); + if ((KeyPress == 80) || (KeyPress == 112)) PlayerAddInventory("Crop", 1); + if ((KeyPress == 82) || (KeyPress == 114)) PlayerAddInventory("Rope", 1); + if ((KeyPress == 83) || (KeyPress == 115)) PlayerAddInventory("SleepingPill", 1); + if ((KeyPress == 84) || (KeyPress == 116)) PlayerAddInventory("TapeGag", 1); + if ((KeyPress == 86) || (KeyPress == 118)) PlayerAddInventory("VibratingEgg", 1); +} \ No newline at end of file diff --git a/Common.js b/Common.js index 31d91cae71..ceeaaacfca 100644 --- a/Common.js +++ b/Common.js @@ -18,6 +18,7 @@ var TextPhase = 0; var CSVCache = {}; var MaxFightSequence = 500; var MaxRaceSequence = 1000; +var AllowCheats = false; // Array variables var IntroStage = 0; diff --git a/Drawing.js b/Drawing.js index 5acd9fbbd7..9c558910a6 100644 --- a/Drawing.js +++ b/Drawing.js @@ -261,28 +261,95 @@ function DrawInventory() { // Scroll in the full inventory to draw the icons and quantity, draw a padlock over the item if it's locked var Pos = 1; for (var I = 0; I < PlayerInventory.length; I++) { - var ImgState = "Inactive"; - if (((MouseX >= 1 + Pos * 75) && (MouseX <= 74 + Pos * 75) && (MouseY >= 601) && (MouseY <= 674)) || (IsMobile)) ImgState = "Active"; - DrawImage("Icons/" + PlayerInventory[I][PlayerInventoryName] + "_" + ImgState + ".png", 1 + Pos * 75, 601); - DrawText(PlayerInventory[I][PlayerInventoryQuantity].toString(), Pos * 75 + 64, 661, "#000000"); - if (PlayerHasLockedInventory(PlayerInventory[I][PlayerInventoryName])) - DrawImage("Icons/Lock_" + ImgState + ".png", Pos * 75, 600) + + // First inventory tab + if (PlayerInventoryTab == 0) { + + // 11 positions for the items + if (Pos <= 11) { + var ImgState = "Inactive"; + if (((MouseX >= 1 + Pos * 75) && (MouseX <= 74 + Pos * 75) && (MouseY >= 601) && (MouseY <= 674)) || (IsMobile)) ImgState = "Active"; + DrawImage("Icons/" + PlayerInventory[I][PlayerInventoryName] + "_" + ImgState + ".png", 1 + Pos * 75, 601); + DrawText(PlayerInventory[I][PlayerInventoryQuantity].toString(), Pos * 75 + 64, 661, "#000000"); + if (PlayerHasLockedInventory(PlayerInventory[I][PlayerInventoryName])) + DrawImage("Icons/Lock_" + ImgState + ".png", Pos * 75, 600) + } + + // the last position is for the next tab + if (Pos == 12) { + var ImgState = "Inactive"; + if (((MouseX >= 1 + Pos * 75) && (MouseX <= 74 + Pos * 75) && (MouseY >= 601) && (MouseY <= 674)) || (IsMobile)) ImgState = "Active"; + DrawImage("Icons/SecondInventoryTab_" + ImgState + ".png", 1 + Pos * 75, 601); + } + + }; + + // Second inventory tab + if ((Pos >= 12) && (PlayerInventoryTab == 1)) { + var ImgState = "Inactive"; + if (((MouseX >= 1 + (Pos - 11) * 75) && (MouseX <= 74 + (Pos - 11) * 75) && (MouseY >= 601) && (MouseY <= 674)) || (IsMobile)) ImgState = "Active"; + DrawImage("Icons/" + PlayerInventory[I][PlayerInventoryName] + "_" + ImgState + ".png", 1 + (Pos - 11) * 75, 601); + DrawText(PlayerInventory[I][PlayerInventoryQuantity].toString(), (Pos - 11) * 75 + 64, 661, "#000000"); + if (PlayerHasLockedInventory(PlayerInventory[I][PlayerInventoryName])) + DrawImage("Icons/Lock_" + ImgState + ".png", (Pos - 11) * 75, 600) + }; + + // Jumps to the next position Pos = Pos + 1; - }; + + } // Scroll in the locked inventory also to find items that were not loaded for (var I = 0; I < PlayerLockedInventory.length; I++) if (!PlayerHasInventory(PlayerLockedInventory[I])) { - if (((MouseX >= 1 + Pos * 75) && (MouseX <= 74 + Pos * 75) && (MouseY >= 601) && (MouseY <= 674)) || (IsMobile)) { - DrawImage("Icons/" + PlayerLockedInventory[I] + "_Active.png", 1 + Pos * 75, 601); - DrawImage("Icons/Lock_Active.png", Pos * 75, 600); - } - else { - DrawImage("Icons/" + PlayerLockedInventory[I] + "_Inactive.png", 1 + Pos * 75, 601); - DrawImage("Icons/Lock_Inactive.png", Pos * 75, 600); + + // First inventory tab + if (PlayerInventoryTab == 0) { + + // 11 positions for the items + if (Pos <= 11) { + if (((MouseX >= 1 + Pos * 75) && (MouseX <= 74 + Pos * 75) && (MouseY >= 601) && (MouseY <= 674)) || (IsMobile)) { + DrawImage("Icons/" + PlayerLockedInventory[I] + "_Active.png", 1 + Pos * 75, 601); + DrawImage("Icons/Lock_Active.png", Pos * 75, 600); + } + else { + DrawImage("Icons/" + PlayerLockedInventory[I] + "_Inactive.png", 1 + Pos * 75, 601); + DrawImage("Icons/Lock_Inactive.png", Pos * 75, 600); + } + } + + // the last position is for the next tab + if (Pos == 12) { + var ImgState = "Inactive"; + if (((MouseX >= 1 + Pos * 75) && (MouseX <= 74 + Pos * 75) && (MouseY >= 601) && (MouseY <= 674)) || (IsMobile)) ImgState = "Active"; + DrawImage("Icons/SecondInventoryTab_" + ImgState + ".png", 1 + Pos * 75, 601); + } + } + + // Second inventory tab + if ((Pos >= 12) && (PlayerInventoryTab == 1)) { + if (((MouseX >= 1 + (Pos - 11) * 75) && (MouseX <= 74 + (Pos - 11) * 75) && (MouseY >= 601) && (MouseY <= 674)) || (IsMobile)) { + DrawImage("Icons/" + PlayerLockedInventory[I] + "_Active.png", 1 + (Pos - 11) * 75, 601); + DrawImage("Icons/Lock_Active.png", (Pos - 11) * 75, 600); + } + else { + DrawImage("Icons/" + PlayerLockedInventory[I] + "_Inactive.png", 1 + (Pos - 11) * 75, 601); + DrawImage("Icons/Lock_Inactive.png", (Pos - 11) * 75, 600); + } + }; + + // Jumps to the next position Pos = Pos + 1; + }; + + // On the second tab, we put an arrow to go back to the first tab + if ((Pos >= 12) && (PlayerInventoryTab == 1)) { + var ImgState = "Inactive"; + if (((MouseX >= 1 + (Pos - 11) * 75) && (MouseX <= 74 + (Pos - 11) * 75) && (MouseY >= 601) && (MouseY <= 674)) || (IsMobile)) ImgState = "Active"; + DrawImage("Icons/FirstInventoryTab_" + ImgState + ".png", 1 + (Pos - 11) * 75, 601); + } } diff --git a/Icons/FirstInventoryTab_Active.png b/Icons/FirstInventoryTab_Active.png new file mode 100644 index 0000000000..b8fbc7294a Binary files /dev/null and b/Icons/FirstInventoryTab_Active.png differ diff --git a/Icons/FirstInventoryTab_Inactive.png b/Icons/FirstInventoryTab_Inactive.png new file mode 100644 index 0000000000..5de9499995 Binary files /dev/null and b/Icons/FirstInventoryTab_Inactive.png differ diff --git a/Icons/SecondInventoryTab_Active.png b/Icons/SecondInventoryTab_Active.png new file mode 100644 index 0000000000..bb2c59e2e7 Binary files /dev/null and b/Icons/SecondInventoryTab_Active.png differ diff --git a/Icons/SecondInventoryTab_Inactive.png b/Icons/SecondInventoryTab_Inactive.png new file mode 100644 index 0000000000..03ce2b8378 Binary files /dev/null and b/Icons/SecondInventoryTab_Inactive.png differ diff --git a/Inventory.js b/Inventory.js index be288361a4..7e211f5734 100644 --- a/Inventory.js +++ b/Inventory.js @@ -3,6 +3,7 @@ var PlayerInventoryName = 0; var PlayerInventoryQuantity = 1; var PlayerLockedInventory = []; var PlayerSavedInventory = []; +var PlayerInventoryTab = 0; // Set up the player clothes or costume function PlayerClothes(NewCloth) { @@ -91,10 +92,12 @@ function PlayerAddInventory(NewInventory, NewQuantity) { for (var I = 0; I < PlayerInventory.length; I++) if (NewInventory == PlayerInventory[I][PlayerInventoryName]) { PlayerInventory[I][PlayerInventoryQuantity] = PlayerInventory[I][PlayerInventoryQuantity] + NewQuantity; + if (PlayerInventory[I][PlayerInventoryQuantity] > 99) PlayerInventory[I][PlayerInventoryQuantity] = 99; return; } // If not, we create the new inventory data + if (NewQuantity > 99) NewQuantity = 99; PlayerInventory[PlayerInventory.length] = [NewInventory, NewQuantity]; } @@ -216,19 +219,28 @@ function GetClickedInventory() { // Check in the regular inventory var I; if (Inv == "") - for (I = 0; I < PlayerInventory.length; I++) - if ((MouseX >= 1 + (I + 1) * 75) && (MouseX <= 74 + (I + 1) * 75)) - Inv = PlayerInventory[I][PlayerInventoryName]; + for (I = 0; I < PlayerInventory.length; I++) + if ((MouseX >= 1 + (I + 1 - (PlayerInventoryTab * 11)) * 75) && (MouseX <= 74 + (I + 1 - (PlayerInventoryTab * 11)) * 75)) { + if (MouseX < 900) Inv = PlayerInventory[I][PlayerInventoryName]; + else PlayerInventoryTab = 1; + } // Check in the locked inventory if (Inv == "") for (var L = 0; L < PlayerLockedInventory.length; L++) if (!PlayerHasInventory(PlayerLockedInventory[L])) { - if ((MouseX >= 1 + (I + 1) * 75) && (MouseX <= 74 + (I + 1) * 75)) - Inv = "Locked_" + PlayerLockedInventory[L]; + if ((MouseX >= 1 + (I + 1 - (PlayerInventoryTab * 11)) * 75) && (MouseX <= 74 + (I + 1 - (PlayerInventoryTab * 11)) * 75)) { + if (MouseX < 900) Inv = "Locked_" + PlayerLockedInventory[L]; + else PlayerInventoryTab = 1; + } I++; } + // If we must go back to the first tab (on the second, after the first item) + if ((Inv == "") && (PlayerInventoryTab > 0)) + if ((MouseX >= 1 + (I + 1 - (PlayerInventoryTab * 11)) * 75) && (MouseX <= 74 + (I + 1 - (PlayerInventoryTab * 11)) * 75)) + PlayerInventoryTab = 0; + } // Returns the inventory found diff --git a/Skill.js b/Skill.js index d9cf8d1e7b..0fd49d088a 100644 --- a/Skill.js +++ b/Skill.js @@ -13,12 +13,14 @@ function PlayerAddSkill(SkillToAdd, LevelToAdd) { for (var I = 0; I < PlayerSkill.length; I++) if (SkillToAdd == PlayerSkill[I][PlayerSkillName]) { PlayerSkill[I][PlayerSkillLevel] = PlayerSkill[I][PlayerSkillLevel] + LevelToAdd; + if (PlayerSkill[I][PlayerSkillLevel] > 10) PlayerSkill[I][PlayerSkillLevel] = 10; return; } // If the skill isn't known, we add it to the player skill list + if (LevelToAdd > 10) LevelToAdd = 10; PlayerSkill[PlayerSkill.length] = [SkillToAdd, LevelToAdd]; - + } // Returns the current level of a specific skill (0 if the skill isn't known) diff --git a/index.html b/index.html index 848ca9497b..269c47cf54 100644 --- a/index.html +++ b/index.html @@ -22,6 +22,7 @@ <script src="Time.js"></script> <script src="Struggle.js"></script> <script src="GameLog.js"></script> +<script src="Cheat.js"></script> <script src="C000_Intro/Intro/Script.js"></script> <script src="C000_Intro/ChapterSelect/Script.js"></script> <script src="C000_Intro/CreatePlayer/Script.js"></script> @@ -151,6 +152,7 @@ // When the code is loaded, start on "Chapter 0" to select a chapter and loads the default language window.onload = function() { + CheatAllow = true; // Set cheat mode MainCanvas = document.getElementById("MainCanvas").getContext("2d"); if (localStorage.getItem("CurrentLanguageTag")) CurrentLanguageTag = localStorage.getItem("CurrentLanguageTag"); IsMobile = DetectMobile(); @@ -171,6 +173,7 @@ function MainRun() { // When the user presses a key, we send the KeyDown event to the other screens function KeyDown(event) { KeyPress = event.keyCode || event.which; + if (CheatAllow) CheatKey(); DynamicFunction(CurrentChapter + "_" + CurrentScreen + "_KeyDown()"); }