Basic achievement system ()

This commit is contained in:
adokilume 2018-11-08 02:52:52 +01:00 committed by Ben987
parent 77a1a4de65
commit 72fbf915d9
16 changed files with 136 additions and 0 deletions
C000_Intro/ChapterSelect
C001_BeforeClass
C004_ArtClass/HiddenEgg
C006_Isolation
Cross
Pillory
C999_Common
index.html

View file

@ -110,6 +110,11 @@ function C000_Intro_ChapterSelect_LoadScreen() {
SetScene("C999_Common", "GameLoad");
}
// Go to achievement screen
function C000_Intro_ChapterSelect_Achievements() {
SetScene("C999_Common", "Achievements");
}
// When the game credit should roll or stop
function C000_Intro_ChapterSelect_RollCredits() {
C000_Intro_ChapterSelect_CreditMode = !C000_Intro_ChapterSelect_CreditMode;

View file

@ -2,6 +2,7 @@ Stage,LoveReq,SubReq,VarReq,Interaction,Result,NextStage,LoveMod,SubMod,Function
0,0,0,,New Game,,0,0,0,"LoadChapter(""C001_BeforeClass"")"
0,0,0,,Load Game,,0,0,0,LoadScreen()
0,0,0,,Select Chapter,"Select the chapter you want to play.|If you never tried the game, start on chapter 1.",10,0,0,
0,0,0,,Achievements,,0,0,0,Achievements()
0,0,0,,Change Language,,30,0,0,
0,0,0,,Game Credits,A huge THANK YOU to everyone|that contributed to the game.,0,0,0,RollCredits()
10,0,0,,Chapter 1|Before Class,,10,0,0,"LoadChapter(""C001_BeforeClass"")"

1 Stage LoveReq SubReq VarReq Interaction Result NextStage LoveMod SubMod Function
2 0 0 0 New Game 0 0 0 LoadChapter("C001_BeforeClass")
3 0 0 0 Load Game 0 0 0 LoadScreen()
4 0 0 0 Select Chapter Select the chapter you want to play.|If you never tried the game, start on chapter 1. 10 0 0
5 0 0 0 Achievements 0 0 0 Achievements()
6 0 0 0 Change Language 30 0 0
7 0 0 0 Game Credits A huge THANK YOU to everyone|that contributed to the game. 0 0 0 RollCredits()
8 10 0 0 Chapter 1|Before Class 10 0 0 LoadChapter("C001_BeforeClass")

View file

@ -89,6 +89,7 @@ function C001_BeforeClass_Amanda_ForceKiss() {
ActorChangeAttitude(-1, 0);
OverridenIntroText = GetText("KissSidney");
GameLogAdd("KissSidney");
AchievementUnlock("MatchMadeInHell");
}
}

View file

@ -21,6 +21,7 @@ function C001_BeforeClass_Bag_Click() {
function C001_BeforeClass_Bag_GetRope() {
PlayerAddInventory("Rope", 2);
GameLogSpecificAdd(CurrentChapter, "Sidney", "StealRopes");
AchievementUnlock("LearningTheRopes");
}
// If the player annoys Sidney by pulling on her back

View file

@ -103,4 +103,5 @@ function C001_BeforeClass_Sidney_PantiesRemark() {
// Chapter 1 - Force Sidney to kiss Amanda
function C001_BeforeClass_Sidney_KissAmanda() {
GameLogAdd("KissAmanda");
AchievementUnlock("MatchMadeInHell");
}

View file

@ -20,4 +20,5 @@ function C004_ArtClass_HiddenEgg_Click() {
// Chapter 4 - Bag Take Egg
function C004_ArtClass_HiddenEgg_TakeEgg() {
PlayerAddInventory("VibratingEgg", 1);
AchievementUnlock("HappyEaster");
}

View file

@ -21,4 +21,5 @@ function C006_Isolation_Cross_Click() {
function C006_Isolation_Cross_Trap() {
LeaveIcon = "Wait";
C006_Isolation_Outro_StuckCross = true;
AchievementUnlock("BeggarsChoosers");
}

View file

@ -21,4 +21,5 @@ function C006_Isolation_Pillory_Click() {
function C006_Isolation_Pillory_Trap() {
LeaveIcon = "Wait";
C006_Isolation_Outro_StuckPillory = true;
AchievementUnlock("BeggarsChoosers");
}

View file

@ -0,0 +1,4 @@
Stage,LoveReq,SubReq,VarReq,IntroText,Image
0,0,0,,Click any achievement to view its description.|Page 1 / 3,Locked.jpg
10,0,0,,Click any achievement to view its description.|Page 2 / 3,Locked.jpg
20,0,0,,Click any achievement to view its description.|Page 3 / 3,Locked.jpg
1 Stage LoveReq SubReq VarReq IntroText Image
2 0 0 0 Click any achievement to view its description.|Page 1 / 3 Locked.jpg
3 10 0 0 Click any achievement to view its description.|Page 2 / 3 Locked.jpg
4 20 0 0 Click any achievement to view its description.|Page 3 / 3 Locked.jpg

Binary file not shown.

After

(image error) Size: 33 KiB

View file

@ -0,0 +1,75 @@
var C999_Common_Achievements_CurrentStage = 0;
var C999_Common_Achievements_Image = "";
var C999_Common_Achievements_Unlocked = [];
// Proper variables are created at runtime, this allows for easier lookup if an achievement with a given name exists
var C999_Common_Achievements_List = [
"LearningTheRopes",
"MatchMadeInHell",
"HappyEaster",
"BeggarsChoosers",
"SpeedrunningBitch"
];
// Chapter Common - Achievements Load
function C999_Common_Achievements_Load() {
LeaveIcon = "";
LeaveScreen = "";
C999_Common_Achievements_PrepareAchievements();
LoadInteractions();
StopTimer(7.6666667 * 60 * 60 * 1000);
}
// Chapter Common - Achievements Run
function C999_Common_Achievements_Run() {
BuildInteraction(C999_Common_Achievements_CurrentStage);
if ((C999_Common_Achievements_Image !== undefined) && (C999_Common_Achievements_Image.trim() != "")) {
DrawImage(C999_Common_Achievements_Image, 600, 0);
}
}
// Chapter Common - Achievements Click
function C999_Common_Achievements_Click() {
C999_Common_Achievements_ResetImage();
ClickInteraction(C999_Common_Achievements_CurrentStage);
StopTimer(7.6666667 * 60 * 60 * 1000);
}
// Chapter Common - Achievements, load achievements that are already unlocked and initialize variables
function C999_Common_Achievements_PrepareAchievements() {
C999_Common_Achievements_Unlocked = [];
if (localStorage.getItem("Achievements"))
C999_Common_Achievements_Unlocked = JSON.parse(localStorage.getItem("Achievements"));
for (var A = 0; A < C999_Common_Achievements_List.length; A++) {
var AchievementName = C999_Common_Achievements_List[A];
window["C999_Common_Achievements_" + AchievementName] = (C999_Common_Achievements_Unlocked.indexOf(AchievementName) > -1);
}
}
// Chapter Common - Achievements, overrides the image display with any image from any chapter (related to the selected achievement)
function C999_Common_Achievements_ShowImage(ImagePath) {
C999_Common_Achievements_Image = ImagePath;
}
// Chapter Common - Achievements, stops the image being overridden
function C999_Common_Achievements_ResetImage() {
C999_Common_Achievements_Image = "";
}
// Chapter Common - Achievements, go back to the main menu
function C999_Common_Achievements_MainMenu() {
C999_Common_Achievements_ResetImage();
SetScene("C000_Intro", "ChapterSelect");
}
// Unlocks the Achievement of the given name, to be called globally
function AchievementUnlock(AchievementName) {
if (C999_Common_Achievements_List.indexOf(AchievementName) < 0) return;
if (!C999_Common_Achievements_Unlocked.length) C999_Common_Achievements_PrepareAchievements(); // If the list of unlocked achievements is empty, it might just not be loaded yet (it's only loaded when the achievement menu is visited before playing), which would lead to the player's progress being overwritten
if (C999_Common_Achievements_Unlocked.indexOf(AchievementName) < 0) {
window["C999_Common_Achievements_" + AchievementName] = true;
C999_Common_Achievements_Unlocked.push(AchievementName);
localStorage.setItem("Achievements", JSON.stringify(C999_Common_Achievements_Unlocked));
}
}

View file

@ -0,0 +1,17 @@
Stage,LoveReq,SubReq,VarReq,Interaction,Result,NextStage,LoveMod,SubMod,Function
0,0,0,,[Main Menu],,0,0,0,MainMenu()
0,0,0,,[Next Page],,10,0,0,
0,0,0,!LearningTheRopes,???,Get some rope before class.,0,0,0,
0,0,0,LearningTheRopes,Learning the ropes,Stole some rope from Sidney's bag.,0,0,0,ShowImage('C001_BeforeClass/Bag/BagOpen.jpg')
0,0,0,!MatchMadeInHell,???,Force two people who don't like|each other to kiss before class.,0,0,0,
0,0,0,MatchMadeInHell,Match made in hell,Forced Amanda and Sidney to kiss before class.,0,0,0,ShowImage('C001_BeforeClass/Amanda/AmandaBondageKiss.jpg')
0,0,0,!HappyEaster,???,Find a hidden egg.,0,0,0,
0,0,0,HappyEaster,Happy Easter!,Found a hidden egg in art class.,0,0,0,ShowImage('C004_ArtClass/HiddenEgg/HiddenEgg.jpg')
0,0,0,!BeggarsChoosers,???,Break out of your cell only to|lock yourself in a different device.,0,0,0,
0,0,0,BeggarsChoosers,Beggars can be choosers,Broken out of your cell only to|lock yourself in a different device.,0,0,0,ShowImage('C006_Isolation/Horse/HorseRide.jpg')
0,0,0,!SpeedrunningBitch,???,Finish Sidney's and Jennifer's race|in 1 minute or less.,0,0,0,
0,0,0,SpeedrunningBitch,Speedrunning Bitch,Finished Sidney's and Jennifer's race|in 1 minute or less.,0,0,0,ShowImage('C999_Common/Races/Actors/Player/ChastityBelt_Rope_Collar_TapeGag_Dog_Move_2.png')
10,0,0,,[Previous Page],,0,0,0,
10,0,0,,[Next Page],,20,0,0,
20,0,0,,[Previous Page],,10,0,0,
20,0,0,,[Main Menu],,0,0,0,MainMenu()
1 Stage LoveReq SubReq VarReq Interaction Result NextStage LoveMod SubMod Function
2 0 0 0 [Main Menu] 0 0 0 MainMenu()
3 0 0 0 [Next Page] 10 0 0
4 0 0 0 !LearningTheRopes ??? Get some rope before class. 0 0 0
5 0 0 0 LearningTheRopes Learning the ropes Stole some rope from Sidney's bag. 0 0 0 ShowImage('C001_BeforeClass/Bag/BagOpen.jpg')
6 0 0 0 !MatchMadeInHell ??? Force two people who don't like|each other to kiss before class. 0 0 0
7 0 0 0 MatchMadeInHell Match made in hell Forced Amanda and Sidney to kiss before class. 0 0 0 ShowImage('C001_BeforeClass/Amanda/AmandaBondageKiss.jpg')
8 0 0 0 !HappyEaster ??? Find a hidden egg. 0 0 0
9 0 0 0 HappyEaster Happy Easter! Found a hidden egg in art class. 0 0 0 ShowImage('C004_ArtClass/HiddenEgg/HiddenEgg.jpg')
10 0 0 0 !BeggarsChoosers ??? Break out of your cell only to|lock yourself in a different device. 0 0 0
11 0 0 0 BeggarsChoosers Beggars can be choosers Broken out of your cell only to|lock yourself in a different device. 0 0 0 ShowImage('C006_Isolation/Horse/HorseRide.jpg')
12 0 0 0 !SpeedrunningBitch ??? Finish Sidney's and Jennifer's race|in 1 minute or less. 0 0 0
13 0 0 0 SpeedrunningBitch Speedrunning Bitch Finished Sidney's and Jennifer's race|in 1 minute or less. 0 0 0 ShowImage('C999_Common/Races/Actors/Player/ChastityBelt_Rope_Collar_TapeGag_Dog_Move_2.png')
14 10 0 0 [Previous Page] 0 0 0
15 10 0 0 [Next Page] 20 0 0
16 20 0 0 [Previous Page] 10 0 0
17 20 0 0 [Main Menu] 0 0 0 MainMenu()

View file

@ -0,0 +1 @@
Tag,Content
1 Tag Content

View file

@ -0,0 +1,25 @@
Chapter,Title,Hint,Notes
1,Learning the ropes,Get some rope before class.,
4,Happy Easter!,Find a hidden Egg.,
4,Solo piece,Demonstrate the art of Self Shibari to the art class,
6,Beggars can be choosers,Break out of your cell only to lock yourself in a different device.,
6,,Make a deal with Yuki to escape isolation.,
7,Hunger slave,Spend your lunch break in isolation.,
9,A secret to everybody,Enter the forbidden room in the library.,
10,Stored away,Spend some time trapped in a locker.,
10,Increased storage capacity,Trap two people in lockers.,
10,Speedrunning bitch,Finish Sarah's and Jennifer's Race in 1:30 minutes or less.,
11,Surpassing the master,Beat Mildred at her own game.,
12,True love,Witness Amanda's and Sarah's confession.,
12,Proud to be a cuck,Let Sarah and Amanda use your bed while wearing a chastity belt.,
12,Harem route,Have X slaves in your dorm at the same time.,
12,True switch,Be someone's slave and someone's mistress at the same time.,
12,Go to your room!,Get grounded by your mistress.,
13,Sold into slavery,Meet with an uncertain fate.,(When the player is taken out of the Kinbaku Club to be sold for real)
13,The winner is eye,Emerge victorious from playing Blind Man's Buff.,
999,On the loose,Get to the credits without ever getting restrrained.,
999,Self test,Test every type of bondage item on yourself.,(Might be tricky to implement unless the progress of this is saved)
999,Sidney's walking purse,Be Sidney's financial sub on X separate occasions in one playthrough.,
999,Knowing yourself,Finish the game with a title identical to your name.,
999,Pacifist run,Finish the game without putting anyone in bondage.,
999,Which life is real?,Start a new game at 7:40 AM and finish it at midnight (both real time) without loading a save.,"(Meant as a joke, could easily be cheated by changing system time - should allow for an error margin of about 5 minutes)"
1 Chapter Title Hint Notes
2 1 Learning the ropes Get some rope before class.
3 4 Happy Easter! Find a hidden Egg.
4 4 Solo piece Demonstrate the art of Self Shibari to the art class
5 6 Beggars can be choosers Break out of your cell only to lock yourself in a different device.
6 6 Make a deal with Yuki to escape isolation.
7 7 Hunger slave Spend your lunch break in isolation.
8 9 A secret to everybody Enter the forbidden room in the library.
9 10 Stored away Spend some time trapped in a locker.
10 10 Increased storage capacity Trap two people in lockers.
11 10 Speedrunning bitch Finish Sarah's and Jennifer's Race in 1:30 minutes or less.
12 11 Surpassing the master Beat Mildred at her own game.
13 12 True love Witness Amanda's and Sarah's confession.
14 12 Proud to be a cuck Let Sarah and Amanda use your bed while wearing a chastity belt.
15 12 Harem route Have X slaves in your dorm at the same time.
16 12 True switch Be someone's slave and someone's mistress at the same time.
17 12 Go to your room! Get grounded by your mistress.
18 13 Sold into slavery Meet with an uncertain fate. (When the player is taken out of the Kinbaku Club to be sold for real)
19 13 The winner is eye Emerge victorious from playing Blind Man's Buff.
20 999 On the loose Get to the credits without ever getting restrrained.
21 999 Self test Test every type of bondage item on yourself. (Might be tricky to implement unless the progress of this is saved)
22 999 Sidney's walking purse Be Sidney's financial sub on X separate occasions in one playthrough.
23 999 Knowing yourself Finish the game with a title identical to your name.
24 999 Pacifist run Finish the game without putting anyone in bondage.
25 999 Which life is real? Start a new game at 7:40 AM and finish it at midnight (both real time) without loading a save. (Meant as a joke, could easily be cheated by changing system time - should allow for an error margin of about 5 minutes)

View file

@ -184,6 +184,7 @@ function RaceEnd(Victory) {
RaceActorImageFrameTime = -1;
RaceEnded = true;
RaceVictory = Victory;
if (RaceTimer <= 65000) AchievementUnlock("SpeedrunningBitch"); // If more races get added to the game, this needs to be done differently
if (RaceTimer >= RaceEndTimer) RaceTimer = RaceEndTimer;
}

View file

@ -176,6 +176,7 @@
<script src="C999_Common/Fights/DoubleFight.js"></script>
<script src="C999_Common/Races/Race.js"></script>
<script src="C999_Common/Quiz/Quiz.js"></script>
<script src="C999_Common/Achievements/Script.js"></script>
<script>
// When the code is loaded, start on "Chapter 0" to select a chapter and loads the default language