Cheats and Second Inventory Tab

Cheats and Second Inventory Tab
This commit is contained in:
Ben987 2018-04-27 17:22:59 -04:00
parent 4ca675984d
commit 5a0a789d81
13 changed files with 175 additions and 29 deletions

View file

@ -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;
}
}

View file

@ -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

1 CreditTypeDevelopers
15 Dethfox52|Evangelina T. Fey|Mechio
16 PizzaRush|qiyufei Dethfox52|Evangelina T.
17 Richard M.|Laioken PizzaRush|qiyufei
18 Richard M.|Laioken
19 oymany|Brad H.
20 Traynfreek|Yagami Y.
21 Nelis|nick m.
40 Charlulu's D.|Raven-rj MrSteak|Triassik
41 Zongus763|Simon W. Arboraxx|Charlulu's D.
42 plicoc|Jack S. Raven-rj|Zongus763
43 Joshua H.|Gary C. Simon W.|plicoc
44 jukehero461|天河 Jack S.|Joshua H.
45 lemonda|DJZ Gary C.|jukehero461
46 Littleshiro-kun|Christopher W. 天河|lemonda
47 CreditTypeFans DJZ|Littleshiro-kun
48 CreditTypeRepeat Christopher W.|
49 CreditTypeFans
50 CreditTypeRepeat
51
52
53
54
55
56

Binary file not shown.

Before

(image error) Size: 57 KiB

After

(image error) Size: 82 KiB

54
Cheat.js Normal file
View file

@ -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);
}

View file

@ -18,6 +18,7 @@ var TextPhase = 0;
var CSVCache = {};
var MaxFightSequence = 500;
var MaxRaceSequence = 1000;
var AllowCheats = false;
// Array variables
var IntroStage = 0;

View file

@ -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);
}
}

Binary file not shown.

After

(image error) Size: 5.2 KiB

Binary file not shown.

After

(image error) Size: 4.1 KiB

Binary file not shown.

After

(image error) Size: 6.4 KiB

Binary file not shown.

After

(image error) Size: 4.8 KiB

View file

@ -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

View file

@ -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)

View file

@ -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()");
}