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

Added Fail Chance & Age Bonus to study 📖

- Fail Chance based on Discipline
- Age Bonus give +1 Int per 4 days alive
This commit is contained in:
Rain Clark 2016-10-07 01:19:45 -04:00
parent 25ce591e22
commit bef19795ca

View File

@ -11,7 +11,7 @@ class Gel extends FlxSprite
// Usless Stats that have no pupose yet // Usless Stats that have no pupose yet
public var Intellect:Int = 1; // had to be somewhat smart to get out of the egg public var Intellect:Int = 1; // had to be somewhat smart to get out of the egg
public var Age:Int = 0; public var Age:Int = 1;
// Mood Modifiers // Mood Modifiers
public var Happiness:Int = 50; public var Happiness:Int = 50;
@ -95,9 +95,7 @@ class Gel extends FlxSprite
private function checkMood():Void private function checkMood():Void
{ {
if (_isAsleep) if (_isAsleep)
{
CurrentMood = SLEEPING; CurrentMood = SLEEPING;
}
else else
{ {
if (Happiness >= 61) if (Happiness >= 61)
@ -167,15 +165,24 @@ class Gel extends FlxSprite
public function Study():Void public function Study():Void
{ {
// TODO: Add study faliure chance var _ageBonus:Float = Age/4;
// TODO: Add Age bonus
if (!_hasStudied) if (FlxG.random.bool(Discipline))
{ {
Intellect++; if (!_hasStudied && !_isTired)
Happiness -= 5; {
Fullness -= 5; Intellect += (1 * (1 + Std.int(_ageBonus)));
Sleepiness += 15; Happiness -= 5;
Fullness -= 5;
Sleepiness += 15;
// TODO: play ashamed animation
}
} }
else
{
// TODO: Play ashamed animation
}
// Can only study once per hour, even if check failed
_hasStudied = true; _hasStudied = true;
} }