2014-09-24 21:08:40 +00:00
|
|
|
static num_to_collect;
|
|
|
|
|
2014-09-23 21:02:03 +00:00
|
|
|
func Initialize()
|
|
|
|
{
|
|
|
|
Log("Difficulty = %d", SCENPAR_Difficulty);
|
2014-09-24 21:08:40 +00:00
|
|
|
num_to_collect = SCENPAR_Difficulty;
|
|
|
|
for (var i=0; i<num_to_collect; ++i)
|
|
|
|
{
|
2015-01-10 09:14:02 +00:00
|
|
|
var ng = CreateObjectAbove(Nugget, Random(LandscapeWidth()-100) + 50, LandscapeHeight()/2 + Random(LandscapeHeight()/2-40));
|
2014-09-24 21:08:40 +00:00
|
|
|
ng.Entrance = Scenario.GotNugget;
|
|
|
|
}
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2014-09-26 20:10:59 +00:00
|
|
|
func InitializePlayer(plr)
|
|
|
|
{
|
|
|
|
GetCrew(plr)->CreateContents(Shovel);
|
|
|
|
}
|
|
|
|
|
2014-09-24 21:08:40 +00:00
|
|
|
func GotNugget()
|
|
|
|
{
|
|
|
|
--num_to_collect;
|
|
|
|
if (num_to_collect == 0) GameCall("Finished");
|
2015-12-13 21:14:55 +00:00
|
|
|
Sound("UI::Cash");
|
2014-09-26 20:10:59 +00:00
|
|
|
RemoveObject();
|
2014-09-24 21:08:40 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func Finished()
|
|
|
|
{
|
|
|
|
Log("All nuggets collected!");
|
|
|
|
GainScenarioAchievement("Done", BoundBy(SCENPAR_Difficulty, 1, 3));
|
|
|
|
GameOver();
|
2014-09-23 21:02:03 +00:00
|
|
|
}
|