diff --git a/source/Gel.hx b/source/Gel.hx index 212090e..eabbaef 100644 --- a/source/Gel.hx +++ b/source/Gel.hx @@ -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; } diff --git a/source/HUD.hx b/source/HUD.hx index cf582f4..1916c45 100644 --- a/source/HUD.hx +++ b/source/HUD.hx @@ -162,6 +162,7 @@ class HUD extends FlxTypedGroup // 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 // TRAIN case 2: - // + studyGel(); // REST case 3: - // + sleepGel(); // CHEER case 4: @@ -283,6 +284,20 @@ class HUD extends FlxTypedGroup _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");