1
0
mirror of https://github.com/Melon-Bread/Pet.GB synced 2024-11-24 20:58:19 -05:00

Added initial Studying action 📚

Sleep action does not work in current state 💔
This commit is contained in:
Rain Clark 2016-10-05 23:36:42 -04:00
parent 2a5cf8baf6
commit b0bc0f62ab
2 changed files with 41 additions and 3 deletions

View File

@ -27,6 +27,9 @@ class Gel extends FlxSprite
public var _isTired:Bool = false;
public var _isAsleep:Bool = false;
// Menu Locks
private var _hasStudied:Bool = false;
// Mood/Needs
public var CurrentMood:Mood = NEUTRAL;
public var CurrentNeed:Need = NONE;
@ -56,6 +59,8 @@ class Gel extends FlxSprite
FlxG.watch.add(this, "CurrentMood");
FlxG.watch.add(this, "CurrentNeed");
FlxG.watch.add(this, "Wait");
FlxG.watch.add(this, "Intellect");
FlxG.watch.add(this, "_hasStudied");
FlxG.watch.add(this, "Happiness");
FlxG.watch.add(this, "Discipline");
FlxG.watch.add(this, "Fullness");
@ -143,6 +148,23 @@ class Gel extends FlxSprite
}
}
public function Study():Void
{
// TODO: Add study faliure chance
if (!_hasStudied)
{
Intellect++;
Happiness -= 5;
Sleepiness += 15;
}
_hasStudied = true;
}
public function Sleep():Void
{
}
public function Praise():Void
{
Wait = true;
@ -227,8 +249,9 @@ class Gel extends FlxSprite
Discipline -=10;
}
// Unlock menu options
_hasStudied = false;
// TODO: Unlock Wipe
_clock.HourPassed = false;
}

View File

@ -162,6 +162,7 @@ class HUD extends FlxTypedGroup<FlxSprite>
// TODO: Add WASD support?
// TODO: Add vertical menu movent
// TODO: Start + Select gives prompt to delete save file
if (FlxG.keys.justPressed.RIGHT || FlxG.gamepads.anyJustPressed(DPAD_RIGHT))
nextOption(true);
else if (FlxG.keys.justPressed.LEFT || FlxG.gamepads.anyJustPressed(DPAD_LEFT))
@ -249,11 +250,11 @@ class HUD extends FlxTypedGroup<FlxSprite>
// TRAIN
case 2:
//
studyGel();
// REST
case 3:
//
sleepGel();
// CHEER
case 4:
@ -283,6 +284,20 @@ class HUD extends FlxTypedGroup<FlxSprite>
_sprInteraction.fadeOut(2, itemLeave);
}
private function studyGel():Void
{
itemJoin("T");
_gel.Study();
_sprInteraction.fadeOut(2, itemLeave);
}
private function sleepGel():Void
{
itemJoin("S");
_gel.Sleep();
_sprInteraction.fadeOut(2, itemLeave);
}
private function praiseGel():Void
{
itemJoin("P");