Skip to content

Commit

Permalink
Implemented Golden Marshmallow medal and leaderboard
Browse files Browse the repository at this point in the history
  • Loading branch information
EliteMasterEric committed Dec 3, 2024
1 parent 0cf8eea commit 3a9bcf5
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 0 deletions.
8 changes: 8 additions & 0 deletions assets/data/config/ng/medals/medals.json
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,14 @@
{
"name": "day-32",
"id": 81786
},
{
"name": "the-little-candles",
"id": 81787
},
{
"name": "golden-marshmallow",
"id": 81788
}
]
}
4 changes: 4 additions & 0 deletions source/activities/bonfire/BonfireArea.hx
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ class BonfireArea extends ActivityAreaInstance
var marshmallow = stick.marshmallow;
if (marshmallow != null)
{
if (marshmallow.current_level == Marshmallow.GOLDEN_MARSHMALLOW_LEVEL) {
Marshmallow.on_cooked_perfect();
}

OnlineLoop.post_marshmallow_discard(Main.current_room_id, marshmallow.current_level);
}
stick.shake_off();
Expand Down
11 changes: 11 additions & 0 deletions source/activities/bonfire/Marshmallow.hx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ class Marshmallow extends FlxSprite

var heat_levels = [30.0, 60.0, 80.0, 90.0, 98.0, 100.0];

public static final GOLDEN_MARSHMALLOW_LEVEL:Int = 5;

var level_up_sounds = [
AssetPaths.grill_1__wav,
AssetPaths.grill_2__wav,
Expand Down Expand Up @@ -119,6 +121,15 @@ class Marshmallow extends FlxSprite
set_level(current_level + 1);
}

public static function on_cooked_perfect():Void {
// Earn a medal, if applicable.
Main.ng_api.medal_popup(Main.ng_api.medals.get("golden-marshmallow"));

final GOLDEN_MARSHMALLOWS_SCOREBOARD:Int = 14324;

Main.ng_api.post_score(1, GOLDEN_MARSHMALLOWS_SCOREBOARD);
}

override function update(elapsed:Float)
{
super.update(elapsed);
Expand Down

0 comments on commit 3a9bcf5

Please sign in to comment.