コード例 #1
0
ファイル: Script.c プロジェクト: sarah-russell12/openclonk
protected func Initialize()
{
	// Show wealth in HUD.
	GUI_Controller->ShowWealth();
	
	// Rules: team account and buying at flagpole.
	CreateObject(Rule_TeamAccount);
	CreateObject(Rule_BuyAtFlagpole);
	
	// Goal: Sell Gems, amount depends on difficulty and initial availability.
	var gems = (4 * GetMaterialCount(Material("Ruby"))) / (5 * GetMaterialVal("Blast2ObjectRatio", "Material", Material("Ruby")));
	gems += (4 * GetMaterialCount(Material("Amethyst"))) / (5 * GetMaterialVal("Blast2ObjectRatio", "Material", Material("Amethyst")));
	var percentage = 55 + 15 * SCENPAR_Difficulty;
	var goal = CreateObject(Goal_SellGems);
	goal->SetTargetAmount((gems * percentage) / 100);
	
	// Initialize different parts of the scenario.
	InitEnvironment(SCENPAR_Difficulty);
	InitVegetation();
	InitAnimals();
	InitResources(SCENPAR_Difficulty);
	InitMainIsland(4 - SCENPAR_Difficulty);
	InitIslands(4 - SCENPAR_Difficulty);
		
	return;
}
コード例 #2
0
ファイル: Script.c プロジェクト: gitMarky/openclonk
protected func Initialize()
{
	// Show wealth in HUD.
	GUI_Controller->ShowWealth();
	
	// Rules: team account and buying at flagpole.
	CreateObject(Rule_TeamAccount);
	CreateObject(Rule_BuyAtFlagpole);
	
	// Goal: gain wealth dependent on difficulty.
	var goal = CreateObject(Goal_Wealth);
	goal->SetWealthGoal(100 + 150 * SCENPAR_Difficulty);

	// Initialize different parts of the scenario.
	InitEnvironment(SCENPAR_Difficulty);
	InitVegetation(SCENPAR_MapSize);
	InitAnimals(SCENPAR_MapSize);
	InitMaterial(4 - SCENPAR_Difficulty);
	return;
}