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
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
public var Happiness:Int = 50;
@ -95,9 +95,7 @@ class Gel extends FlxSprite
private function checkMood():Void
{
if (_isAsleep)
{
CurrentMood = SLEEPING;
}
else
{
if (Happiness >= 61)
@ -167,15 +165,24 @@ class Gel extends FlxSprite
public function Study():Void
{
// TODO: Add study faliure chance
// TODO: Add Age bonus
if (!_hasStudied)
var _ageBonus:Float = Age/4;
if (FlxG.random.bool(Discipline))
{
Intellect++;
if (!_hasStudied && !_isTired)
{
Intellect += (1 * (1 + Std.int(_ageBonus)));
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;
}