forked from Mirrors/openclonk
fine tune weapons and items in aerobatics
parent
255429d3e0
commit
1615284bd1
|
@ -86,6 +86,7 @@ private func InitMaterials(int amount)
|
|||
PlaceObjects(Dynamite, 4 * amount, "Earth");
|
||||
PlaceObjects(Loam, 4 * amount, "Earth");
|
||||
PlaceObjects(Metal, 2 * amount, "Earth");
|
||||
PlaceObjects(Cloth, amount, "Earth");
|
||||
// Additional item spawns.
|
||||
if (SCENPAR_GameMode == 2)
|
||||
{
|
||||
|
@ -98,28 +99,26 @@ private func InitMaterials(int amount)
|
|||
// Place chests on several of the sky islands.
|
||||
for (var count = 0; count < amount / 2; count++)
|
||||
{
|
||||
var pos = FindIslandLocation();
|
||||
var pos = FindIslandLocation(true);
|
||||
if (!pos)
|
||||
continue;
|
||||
var chest = CreateObjectAbove(Chest, pos.x, pos.y);
|
||||
chest->CreateContents(Dynamite, 4);
|
||||
chest->CreateContents(Club);
|
||||
chest->CreateContents(Javelin);
|
||||
chest->CreateContents(Club, 4);
|
||||
chest->CreateContents(Musket)->CreateContents(LeadShot);
|
||||
chest->CreateContents(Bow)->CreateContents(Arrow);
|
||||
chest->CreateContents(Bread, 2);
|
||||
chest->CreateContents(IronBomb);
|
||||
chest->CreateContents(Cloth);
|
||||
chest->CreateContents(Pickaxe);
|
||||
if (!Random(2))
|
||||
chest->CreateContents(GrenadeLauncher)->CreateContents(IronBomb);
|
||||
chest->CreateContents(Musket)->CreateContents(LeadShot);
|
||||
chest->CreateContents(Musket)->CreateContents(LeadShot);
|
||||
chest->CreateContents(IronBomb, 4);
|
||||
chest->CreateContents(GrenadeLauncher)->CreateContents(IronBomb);
|
||||
chest->CreateContents(GrenadeLauncher)->CreateContents(IronBomb);
|
||||
if (!Random(2))
|
||||
chest->CreateContents(Boompack);
|
||||
if (!Random(2))
|
||||
chest->CreateContents(WallKit);
|
||||
if (!Random(2))
|
||||
chest->CreateContents(TeleGlove);
|
||||
}
|
||||
// Load all weapons in the chests.
|
||||
for (var weapon in FindObjects(Find_Or(Find_ID(Musket), Find_ID(GrenadeLauncher))))
|
||||
weapon->SetLoaded();
|
||||
// Place some catapults.
|
||||
for (var count = 0; count < amount / 4; count++)
|
||||
{
|
||||
|
@ -144,16 +143,19 @@ private func InitMaterials(int amount)
|
|||
return;
|
||||
}
|
||||
|
||||
private func FindIslandLocation()
|
||||
private func FindIslandLocation(bool is_chest)
|
||||
{
|
||||
var pos;
|
||||
for (var tries = 0; tries < 100; tries++)
|
||||
var map_zoom = GetScenarioVal("MapZoom", "Landscape");
|
||||
var pos = {x = inventorslab_location[0] * map_zoom, y = inventorslab_location[1] * map_zoom};
|
||||
for (var tries = 0; tries < 200; tries++)
|
||||
{
|
||||
pos = FindLocation(Loc_Sky(), Loc_Wall(CNAT_Bottom));
|
||||
if (!pos)
|
||||
continue;
|
||||
if (FindObject(Find_Category(C4D_Vehicle), Find_Distance(30, pos.x, pos.y)))
|
||||
continue;
|
||||
if (is_chest && FindObject(Find_Or(Find_ID(ParkourCheckpoint), Find_ID(Chest)), Find_Distance(30, pos.x, pos.y)))
|
||||
continue;
|
||||
break;
|
||||
}
|
||||
return pos;
|
||||
|
|
Loading…
Reference in New Issue