New skill system

New skill system
This commit is contained in:
Ben987 2018-02-28 19:11:28 -05:00
parent a5d8d6c549
commit f1e6fec1ce
22 changed files with 122 additions and 27 deletions
C001_BeforeClass/Fight
C005_GymClass
C007_LunchBreak/JenniferTennis
C010_Revenge
AmandaSarah
SidneyJennifer
C101_KinbakuClub/Fight
C999_Common
SaveState.jsSkill.jsindex.html

View file

@ -1,6 +1,6 @@
// Chapter 5 - Before Class Fight Load
function C001_BeforeClass_Fight_Load() {
LoadFight("FightOutro", "Hard", Icons.Fight.Punch);
LoadFight("FightOutro", "Hard", Icons.Fight.Punch, PlayerGetSkillLevel("Fighting"));
}
// Chapter 5 - Before Class Fight Run

View file

@ -1,7 +1,7 @@
// Chapter 5 - Gym Fight Load
function C005_GymClass_GymFight_Load() {
if (C005_GymClass_Jennifer_PracticeMode) LoadFight("Jennifer", "Easy", Icons.Fight.Punch);
else LoadFight("Jennifer", "Normal", Icons.Fight.Punch);
if (C005_GymClass_Jennifer_PracticeMode) LoadFight("Jennifer", "Easy", Icons.Fight.Punch, PlayerGetSkillLevel("Fighting"));
else LoadFight("Jennifer", "Normal", Icons.Fight.Punch, PlayerGetSkillLevel("Fighting"));
}
// Chapter 5 - Gym Fight Run

View file

@ -18,6 +18,7 @@ var C005_GymClass_Jennifer_CuddleDone = false;
var C005_GymClass_Jennifer_PlayerHasBallGag = false;
var C005_GymClass_Jennifer_PlayerHasTapeGag = false;
var C005_GymClass_Jennifer_Turnabout = false;
var C005_GymClass_Jennifer_TrainingReady = true;
// Chapter 5 - Jennifer Load
function C005_GymClass_Jennifer_Load() {
@ -309,4 +310,14 @@ function C005_GymClass_Jennifer_Cuddle() {
// Chapter 5 - Jennifer Orgasm
function C005_GymClass_Jennifer_Orgasm() {
ActorAddOrgasm();
}
}
// Chapter 5 - Jennifer fighting skill training, the player can learn the figthing skill if there's 30 or more left
function C005_GymClass_Jennifer_TrainFighting() {
if (CurrentTime <= 11 * 60 * 60 * 1000) {
OverridenIntroText = GetText("TrainFighting");
PlayerAddSkill("Fighting", 1);
CurrentTime = CurrentTime + 0.5 * 60 * 60 * 1000;
C005_GymClass_Jennifer_TrainingReady = false;
} else OverridenIntroText = GetText("TrainFightingNoTime");
}

View file

@ -100,4 +100,5 @@
570,2,0,,(依偎在她的|怀抱里。1分钟,想待可以一直待着。|记得告诉我你感觉如何。,570,0,0,Cuddle()
570,0,0,,(恐慌地|摇头。) 1分钟,可怜的小家伙。来,让我帮你。|(她小心地给你松了绑并让你重新着装。),600,0,-1,ReleasePlayer()
600,0,0,,好吧,再练习一次。|(开始练习。),,600,0,0,StartPractice()
600,0,0,TrainingReady,"(Train in fighting.)|(30 minutes)",,600,0,0,TrainFighting()
600,0,0,,已经够了,|去吃饭吧。 (离开体育馆。),,600,0,0,EndChapter()

1 Stage LoveReq SubReq VarReq Interaction Result NextStage LoveMod SubMod Function
100 570 2 0 (依偎在她的|怀抱里。)(1分钟) 想待可以一直待着。|记得告诉我你感觉如何。 570 0 0 Cuddle()
101 570 0 0 (恐慌地|摇头。) (1分钟) 可怜的小家伙。来,让我帮你。|(她小心地给你松了绑并让你重新着装。) 600 0 -1 ReleasePlayer()
102 600 0 0 好吧,再练习一次。|(开始练习。) 600 0 0 StartPractice()
103 600 0 0 TrainingReady (Train in fighting.)|(30 minutes) 600 0 0 TrainFighting()
104 600 0 0 已经够了,|去吃饭吧。 (离开体育馆。) 600 0 0 EndChapter()

View file

@ -100,4 +100,5 @@ Stage,LoveReq,SubReq,VarReq,Interaction,Result,NextStage,LoveMod,SubMod,Function
570,2,0,,(Cuddle in her|arms.) (1 minute),Stay here for as long as you need.|Just let me know when you're ok.,570,0,0,Cuddle()
570,0,0,,(Shake your head in|panic.) (1 minute),"Poor little thing. Here, let me help you.|(She carefully unties you and let you dress back.)",600,0,-1,ReleasePlayer()
600,0,0,,"Ok, another practice.|(Start a practice.)",,600,0,0,StartPractice()
600,0,0,TrainingReady,"(Train in fighting.)|(30 minutes)",,600,0,0,TrainFighting()
600,0,0,,"That's enough, let's|go eat. (Leave gym.)",,600,0,0,EndChapter()

1 Stage LoveReq SubReq VarReq Interaction Result NextStage LoveMod SubMod Function
100 570 2 0 (Cuddle in her|arms.) (1 minute) Stay here for as long as you need.|Just let me know when you're ok. 570 0 0 Cuddle()
101 570 0 0 (Shake your head in|panic.) (1 minute) Poor little thing. Here, let me help you.|(She carefully unties you and let you dress back.) 600 0 -1 ReleasePlayer()
102 600 0 0 Ok, another practice.|(Start a practice.) 600 0 0 StartPractice()
103 600 0 0 TrainingReady (Train in fighting.)|(30 minutes) 600 0 0 TrainFighting()
104 600 0 0 That's enough, let's|go eat. (Leave gym.) 600 0 0 EndChapter()

View file

@ -11,3 +11,5 @@ ReleasePlayer,当然。让我来帮你。|(她给你松了绑,你穿上了
GagPlayer,不!事实上正好相反。你|的话太多了。 (她堵上了你的嘴。),No! In fact I will do the opposite. You|talk too much. (She straps a gag on you.)
PlayerOrgasmGagged,(她用力拉扯,使得你不断颤抖,迎来了无声的高潮。)|你为什么在发抖?如果没事就点点头。,"(She tugs, making you tremble in a silent orgasm.)|Why are you trembling? Nod if you're ok."
PlayerOrgasm,(她用力拉扯,使得你不断颤抖,迎来了无声的高潮。)|你还好吗?你为什么抖成那样?,"(She tugs, making you tremble in a silent orgasm.)|Are you ok? Why are you trembling like that?"
TrainFighting,"(You train pretty hard with Jennifer.|You gained 1 skill level in fighting.)"
TrainFightingNoTime,"(You don't have enough time left|to improve your fighting skills.)"

Can't render this file because it has a wrong number of fields in line 14.

View file

@ -11,3 +11,5 @@ ReleasePlayer,Of course. Let me help you.|(She unties you and you dress back.)
GagPlayer,No! In fact I will do the opposite. You|talk too much. (She straps a gag on you.)
PlayerOrgasmGagged,"(She tugs, making you tremble in a silent orgasm.)|Why are you trembling? Nod if you're ok."
PlayerOrgasm,"(She tugs, making you tremble in a silent orgasm.)|Are you ok? Why are you trembling like that?"
TrainFighting,"(You train pretty hard with Jennifer.|You gained 1 skill level in fighting.)"
TrainFightingNoTime,"(You don't have enough time left|to improve your fighting skills.)"

1 Tag Content
11 GagPlayer No! In fact I will do the opposite. You|talk too much. (She straps a gag on you.)
12 PlayerOrgasmGagged (She tugs, making you tremble in a silent orgasm.)|Why are you trembling? Nod if you're ok.
13 PlayerOrgasm (She tugs, making you tremble in a silent orgasm.)|Are you ok? Why are you trembling like that?
14 TrainFighting (You train pretty hard with Jennifer.|You gained 1 skill level in fighting.)
15 TrainFightingNoTime (You don't have enough time left|to improve your fighting skills.)

View file

@ -1,7 +1,7 @@
// Chapter 5 - Lose Fight Load
function C005_GymClass_LoseFight_Load() {
if (C005_GymClass_Jennifer_EasyMode) LoadFight("Jennifer", "Easy", Icons.Fight.Rope);
else LoadFight("Jennifer", "Normal", Icons.Fight.Rope);
if (C005_GymClass_Jennifer_EasyMode) LoadFight("Jennifer", "Easy", Icons.Fight.Rope, PlayerGetSkillLevel("Fighting"));
else LoadFight("Jennifer", "Normal", Icons.Fight.Rope, PlayerGetSkillLevel("Fighting"));
}
// Chapter 5 - Lose Fight Run

View file

@ -1,7 +1,7 @@
// Chapter 5 - Win Fight Load
function C005_GymClass_WinFight_Load() {
if (C005_GymClass_Jennifer_EasyMode) LoadFight("Jennifer", "Normal", Icons.Fight.Rope);
else LoadFight("Jennifer", "Hard", Icons.Fight.Rope);
if (C005_GymClass_Jennifer_EasyMode) LoadFight("Jennifer", "Normal", Icons.Fight.Rope, PlayerGetSkillLevel("Fighting"));
else LoadFight("Jennifer", "Hard", Icons.Fight.Rope, PlayerGetSkillLevel("Fighting"));
}
// Chapter 5 - Win Fight Run

View file

@ -1,6 +1,6 @@
// Chapter 7 - Jennifer Tennis Fight Load
function C007_LunchBreak_JenniferTennis_Load() {
LoadFight("Jennifer", C007_LunchBreak_Jennifer_TennisDifficulty, Icons.Fight.TennisBall);
LoadFight("Jennifer", C007_LunchBreak_Jennifer_TennisDifficulty, Icons.Fight.TennisBall, PlayerGetSkillLevel("Sports"));
}
// Chapter 7 - Jennifer Tennis Fight Run
@ -22,6 +22,7 @@ function C007_LunchBreak_JenniferTennis_KeyDown() {
function C007_LunchBreak_JenniferTennis_FightEnd(Victory) {
CurrentTime = CurrentTime + 300000;
C007_LunchBreak_Jennifer_TennisVictory = Victory;
if (Victory) PlayerAddSkill("Sports", 1);
if (Victory && (C007_LunchBreak_Jennifer_TennisDifficulty == "Normal")) C007_LunchBreak_Jennifer_MatchCount++;
if (Victory && (C007_LunchBreak_Jennifer_TennisDifficulty == "Hard")) C007_LunchBreak_Jennifer_MatchCount = C007_LunchBreak_Jennifer_MatchCount + 2;
}

View file

@ -203,7 +203,7 @@ function C010_Revenge_AmandaSarah_StartFight() {
// Launch the double fight
C010_Revenge_AmandaSarah_IntroText = "";
DoubleFightLoad("Amanda", AmandaDifficulty, Icons.Fight.Punch, "Sarah", SarahDifficulty, Icons.Fight.Punch, "Lockers", "C010_Revenge_AmandaSarah_EndFight");
DoubleFightLoad("Amanda", AmandaDifficulty, Icons.Fight.Punch, "Sarah", SarahDifficulty, Icons.Fight.Punch, "Lockers", "C010_Revenge_AmandaSarah_EndFight", PlayerGetSkillLevel("Fighting"));
}

View file

@ -218,7 +218,7 @@ function C010_Revenge_SidneyJennifer_StartFight() {
// Launch the double fight
C010_Revenge_SidneyJennifer_IntroText = "";
DoubleFightLoad("Sidney", SidneyDifficulty, Icons.Fight.Punch, "Jennifer", JenniferDifficulty, Icons.Fight.Punch, (C010_Revenge_SidneyJennifer_CurrentStage < 100)?"Hallway":"RunningTrack", "C010_Revenge_SidneyJennifer_EndFight");
DoubleFightLoad("Sidney", SidneyDifficulty, Icons.Fight.Punch, "Jennifer", JenniferDifficulty, Icons.Fight.Punch, (C010_Revenge_SidneyJennifer_CurrentStage < 100)?"Hallway":"RunningTrack", "C010_Revenge_SidneyJennifer_EndFight", PlayerGetSkillLevel("Fighting"));
}

View file

@ -1,6 +1,6 @@
// Chapter 101 - Erica Fight Load
function C101_KinbakuClub_Fight_Load() {
LoadFight("Erica", "Hard", Icons.Fight.Punch);
LoadFight("Erica", "Hard", Icons.Fight.Punch, PlayerGetSkillLevel("Fighting"));
}
// Chapter 101 - Erica Fight Run

View file

@ -10,6 +10,7 @@ var DoubleFightOpponent2 = {};
var DoubleFightText;
var DoubleFightBackupChapter = "";
var DoubleFightBackupScreen = "";
var DoubleFightSkillBonus = 0;
// Generates a full fight sequence
function DoubleFightGenerateMoves(StartTime, DifficultyText) {
@ -38,7 +39,7 @@ function DoubleFightGenerateMoves(StartTime, DifficultyText) {
}
// Load the fight animations and full sequence
function DoubleFightLoad(Opp1ActorName, Opp1Difficulty, Opp1Icon, Opp2ActorName, Opp2Difficulty, Opp2Icon, BackgroundImage, EndFunction) {
function DoubleFightLoad(Opp1ActorName, Opp1Difficulty, Opp1Icon, Opp2ActorName, Opp2Difficulty, Opp2Icon, BackgroundImage, EndFunction, SkillBonus) {
// Creates a brand new fight
LeaveIcon = "";
@ -47,6 +48,7 @@ function DoubleFightLoad(Opp1ActorName, Opp1Difficulty, Opp1Icon, Opp2ActorName,
DoubleFightPerfect = true;
DoubleFightEndFunction = EndFunction;
DoubleFightBackgroundImage = BackgroundImage;
DoubleFightSkillBonus = SkillBonus;
if (DoubleFightText == null) ReadCSV("DoubleFightText", "C999_Common/Fights/Text_" + CurrentLanguageTag + ".csv");
// Setup the 2 opponents
@ -177,7 +179,7 @@ function DoubleFightEnd(Victory) {
// When the player hits
function DoubleFightHit(Opponent) {
Opponent.FightProgress = Opponent.FightProgress + 2;
Opponent.FightProgress = Opponent.FightProgress + 2 + DoubleFightSkillBonus;
if (Opponent.FightProgress >= 100) Opponent.NextImageTime = -1;
if ((DoubleFightOpponent1.FightProgress >= 100) && (DoubleFightOpponent2.FightProgress >= 100)) DoubleFightEnd(true);
}

View file

@ -13,6 +13,7 @@ var FightIcon;
var FightDifficultyRatio = 1;
var FightDifficultyText = "";
var FightPerfect = true;
var FightSkillBonus = 0;
// Fighting is done using the A, S, K, L keys
var FightMoveTypeKeyUpper = [65, 83, 75, 76];
@ -37,7 +38,7 @@ function GenerateFightSequence(FightStartTime) {
}
// Load the fight animations and full sequence
function LoadFight(EndScreen, DifficultyText, IconImage) {
function LoadFight(EndScreen, DifficultyText, IconImage, SkillBonus) {
// Creates a brand new fight with the current screen animations
LeaveIcon = "";
@ -48,6 +49,7 @@ function LoadFight(EndScreen, DifficultyText, IconImage) {
FightAnim = null;
FightEndScreen = EndScreen;
FightIcon = IconImage;
FightSkillBonus = SkillBonus;
FightPerfect = true;
ReadCSV("FightAnim", CurrentChapter + "/" + CurrentScreen + "/Fight.csv");
LoadText();
@ -182,7 +184,7 @@ function FightEnd(Victory) {
// When the player hits
function FightHit() {
FightProgress = FightProgress + 2;
FightProgress = FightProgress + 2 + FightSkillBonus;
if (FightProgress >= 100)
FightEnd(true);
}

View file

@ -1,5 +1,8 @@
C999_Common_Player_ActiveTab = "";
// Chapter Common - Player Load
function C999_Common_Player_Load() {
C999_Common_Player_ActiveTab = "Profile";
LeaveIcon = "Leave";
LoadText();
}
@ -58,17 +61,40 @@ function C999_Common_Player_Run() {
// Draw the player records, show every actors encountered
var ctx = document.getElementById("MainCanvas").getContext("2d");
// Draw the main frame
DrawRect(ctx, 599, 0, 1, 600, "Black");
DrawRect(ctx, 0, 0, 599, 600, "White");
DrawRect(ctx, 30, 114, 539, 1, "Black");
DrawText(ctx, GetText("Name") + " " + Common_PlayerName, 300, 25, "black");
DrawText(ctx, GetText("Title") + " " + C999_Common_Player_GetTitle(), 300, 60, "black");
DrawText(ctx, GetText("Records"), 300, 95, "black");
for (var A = 0; A < Actor.length; A++) {
CurrentActor = Actor[A][ActorName];
DrawActorStats(ctx, 300, A * 50 + 130);
// Draw the profile tab (show the player name, title and skills)
if (C999_Common_Player_ActiveTab == "Profile") {
DrawRect(ctx, 300, 0, 300, 50, "black");
DrawRect(ctx, 301, 0, 298, 49, "silver");
DrawText(ctx, GetText("Profile"), 150, 25, "black");
DrawText(ctx, GetText("Relationships"), 450, 25, "white");
DrawText(ctx, GetText("Name") + " " + Common_PlayerName, 300, 90, "black");
DrawText(ctx, GetText("Title") + " " + C999_Common_Player_GetTitle(), 300, 130, "black");
DrawText(ctx, GetText("Skills"), 200, 180, "black");
DrawText(ctx, GetText("Level"), 500, 180, "black");
DrawRect(ctx, 30, 200, 539, 1, "Black");
for (var S = 0; S < PlayerSkill.length; S++) {
DrawText(ctx, PlayerSkill[S][PlayerSkillName], 200, 230 + S * 40, "black");
DrawText(ctx, PlayerSkill[S][PlayerSkillLevel].toString(), 500, 230 + S * 40, "black");
}
}
// Draw the relationships tab (show all known actors and their relationship with the player)
if (C999_Common_Player_ActiveTab == "Relationships") {
DrawRect(ctx, 0, 0, 300, 50, "black");
DrawRect(ctx, 0, 0, 299, 49, "silver");
DrawText(ctx, GetText("Profile"), 150, 25, "white");
DrawText(ctx, GetText("Relationships"), 450, 25, "black");
for (var A = 0; A < Actor.length; A++) {
CurrentActor = Actor[A][ActorName];
DrawActorStats(ctx, 300, A * 50 + 80);
}
CurrentActor = "";
}
CurrentActor = "";
}
@ -77,5 +103,9 @@ function C999_Common_Player_Click() {
// Can allow to click on inventory from the player screen
InventoryClick(GetClickedInventory(), LeaveChapter, LeaveScreen);
// Tab navigation
if ((MouseX >= 1) && (MouseX <= 299) && (MouseY >= 1) && (MouseY <= 49)) C999_Common_Player_ActiveTab = "Profile";
if ((MouseX >= 301) && (MouseX <= 599) && (MouseY >= 1) && (MouseY <= 49)) C999_Common_Player_ActiveTab = "Relationships";
}

View file

@ -26,4 +26,7 @@ HateSub2,众矢之的
HateSub3,过街老鼠
Name,名称:
Title,标题:
Records,个人记录
Skills,Skills
Level,Level
Profile,Profile
Relationships,Relationships
1 Tag Content
26 HateSub3 过街老鼠
27 Name 名称:
28 Title 标题:
29 Records Skills 个人记录 Skills
30 Level Level
31 Profile Profile
32 Relationships Relationships

View file

@ -26,4 +26,7 @@ HateSub2,Black sheep
HateSub3,Reject
Name,Name:
Title,Title:
Records,Personal records
Skills,Skills
Level,Level
Profile,Profile
Relationships,Relationships

1 Tag Content
26 HateSub3 Reject
27 Name Name:
28 Title Title:
29 Records Skills Personal records Skills
30 Level Level
31 Profile Profile
32 Relationships Relationships

View file

@ -26,4 +26,7 @@ HateSub2,Mouton noir
HateSub3,Rejetée
Name,Nom :
Title,Titre :
Records,Scores personnels
Skills,Talents
Level,Niveau
Profile,Profile
Relationships,Relations
1 Tag Content
26 HateSub3 Rejetée
27 Name Nom :
28 Title Titre :
29 Records Skills Scores personnels Talents
30 Level Niveau
31 Profile Profile
32 Relationships Relations

View file

@ -61,6 +61,7 @@ function SaveState(SlotNumber) {
localStorage.setItem("Common_PlayerName" + SN, Common_PlayerName);
localStorage.setItem("PlayerInventory" + SN, JSON.stringify(PlayerInventory));
localStorage.setItem("PlayerLockedInventory" + SN, JSON.stringify(PlayerLockedInventory));
localStorage.setItem("PlayerSkill" + SN, JSON.stringify(PlayerSkill));
localStorage.setItem("Actor" + SN, JSON.stringify(Actor));
localStorage.setItem("Common_PlayerCrime" + SN, Common_PlayerCrime);
localStorage.setItem("Common_ClubStatus" + SN, Common_ClubStatus);
@ -95,6 +96,12 @@ function LoadState(SlotNumber) {
for (var A = 0; A < Actor.length; A++)
if (Actor[A].length == 8)
Actor[A] = [Actor[A][0], Actor[A][1], Actor[A][2], Actor[A][3], Actor[A][4], Actor[A][5], Actor[A][6], Actor[A][7], ""];
// Loads the skill, since the skills were introduced in chapter 9, we make sure the previous save games are compatible
if (Array.isArray(JSON.parse(localStorage.getItem("PlayerSkill" + SN))))
PlayerSkill = JSON.parse(localStorage.getItem("PlayerSkill" + SN));
else
PlayerSkill = [];
}

26
Skill.js Normal file
View file

@ -0,0 +1,26 @@
var PlayerSkill = [];
var PlayerSkillName = 0;
var PlayerSkillLevel = 1;
// Add a new skill or raise the skill level if the skill is already known
function PlayerAddSkill(SkillToAdd, LevelToAdd) {
// If the skill is already known, we raise the level
for (var I = 0; I < PlayerSkill.length; I++)
if (SkillToAdd == PlayerSkill[I][PlayerSkillName]) {
PlayerSkill[I][PlayerSkillLevel] = PlayerSkill[I][PlayerSkillLevel] + LevelToAdd;
return;
}
// If the skill isn't known, we add it to the player skill list
PlayerSkill[PlayerSkill.length] = [SkillToAdd, LevelToAdd];
}
// Returns the current level of a specific skill (0 if the skill isn't known)
function PlayerGetSkillLevel(SkillToQuery) {
for (var I = 0; I < PlayerSkill.length; I++)
if (SkillToQuery == PlayerSkill[I][PlayerSkillName])
return PlayerSkill[I][PlayerSkillLevel];
return 0;
}

View file

@ -18,6 +18,7 @@
<script src="Drawing.js"></script>
<script src="Actor.js"></script>
<script src="Inventory.js"></script>
<script src="Skill.js"></script>
<script src="Time.js"></script>
<script src="Struggle.js"></script>
<script src="C000_Intro/Intro/Script.js"></script>