2010-09-25 09:20:54 +00:00
|
|
|
/*--
|
|
|
|
Ruins
|
|
|
|
Author: Mimmo_O
|
|
|
|
|
|
|
|
An arena like last man standing round for up to 12 players.
|
|
|
|
--*/
|
2010-07-18 18:32:10 +00:00
|
|
|
|
2010-10-08 16:24:56 +00:00
|
|
|
static const RUINS_RAIN_PERIOD_TIME=3200;
|
|
|
|
|
2010-07-18 18:32:10 +00:00
|
|
|
protected func Initialize()
|
|
|
|
{
|
2010-09-25 09:20:54 +00:00
|
|
|
// Goal.
|
2015-01-10 16:56:54 +00:00
|
|
|
CreateObject(Goal_LastManStanding, 0, 0, NO_OWNER);
|
|
|
|
CreateObject(Rule_KillLogs);
|
|
|
|
CreateObject(Rule_Gravestones);
|
2017-03-30 12:04:29 +00:00
|
|
|
GetRelaunchRule()->SetLastWeaponUse(false);
|
2010-09-25 09:20:54 +00:00
|
|
|
|
|
|
|
// Mood.
|
|
|
|
SetSkyAdjust(RGBa(255, 255, 255, 127), RGB(255, 200, 150));
|
2015-08-31 15:34:01 +00:00
|
|
|
SetGamma(109, 105, 101);
|
2010-09-25 09:20:54 +00:00
|
|
|
|
|
|
|
// Chests with weapons.
|
2015-01-10 09:14:02 +00:00
|
|
|
CreateObjectAbove(Chest, 230, 224, NO_OWNER)->MakeInvincible();
|
|
|
|
CreateObjectAbove(Chest, 500, 64, NO_OWNER)->MakeInvincible();
|
|
|
|
CreateObjectAbove(Chest, 124, 128, NO_OWNER)->MakeInvincible();
|
|
|
|
CreateObjectAbove(Chest, 340, 440, NO_OWNER)->MakeInvincible();
|
2012-04-03 18:21:49 +00:00
|
|
|
AddEffect("IntFillChests", nil, 100, 2 * 36);
|
2010-09-25 09:20:54 +00:00
|
|
|
|
|
|
|
// Ropeladders to get to the upper part.
|
2010-10-08 16:24:56 +00:00
|
|
|
|
2015-01-10 09:14:02 +00:00
|
|
|
CreateObjectAbove(Ropeladder, 380, 112, NO_OWNER)->Unroll(-1,0,19);
|
|
|
|
CreateObjectAbove(Ropeladder, 135, 135, NO_OWNER)->Unroll(1,0,16);
|
2010-09-25 09:20:54 +00:00
|
|
|
|
|
|
|
// Objects fade after 5 seconds.
|
2015-01-10 16:56:54 +00:00
|
|
|
CreateObject(Rule_ObjectFade)->DoFadeTime(5 * 36);
|
2010-07-18 18:32:10 +00:00
|
|
|
|
2012-04-12 09:48:23 +00:00
|
|
|
AddEffect("DryTime",nil,100,2);
|
2011-09-07 14:19:19 +00:00
|
|
|
return;
|
2010-07-18 18:32:10 +00:00
|
|
|
}
|
|
|
|
|
2010-10-08 16:24:56 +00:00
|
|
|
|
2010-12-23 13:35:16 +00:00
|
|
|
global func FxRainTimer(object pTarget, effect, int timer)
|
2010-10-08 16:24:56 +00:00
|
|
|
{
|
|
|
|
if(timer<400)
|
|
|
|
{
|
|
|
|
InsertMaterial(Material("Water"),Random(LandscapeWidth()-60)+30,1,Random(7)-3,100+Random(100));
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
for(var i=0; i<(6+Random(3)); i++)
|
|
|
|
{
|
|
|
|
InsertMaterial(Material("Water"),Random(LandscapeWidth()-60)+30,1,Random(7)-3,100+Random(100));
|
|
|
|
}
|
|
|
|
if(timer>(RUINS_RAIN_PERIOD_TIME+Random(800)))
|
|
|
|
{
|
2012-04-12 09:48:23 +00:00
|
|
|
AddEffect("DryTime",nil,100,2);
|
2010-10-08 16:24:56 +00:00
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
return 1;
|
|
|
|
}
|
2010-12-23 13:35:16 +00:00
|
|
|
global func FxDryTimeTimer(object pTarget, effect, int timer)
|
2010-10-08 16:24:56 +00:00
|
|
|
{
|
|
|
|
if(timer<(380+Random(300))){
|
|
|
|
InsertMaterial(Material("Water"),Random(LandscapeWidth()-60)+30,1,Random(7)-3,100+Random(100));
|
|
|
|
return 1;
|
|
|
|
}
|
2013-05-30 20:11:39 +00:00
|
|
|
ExtractLiquidAmount(310+Random(50),430+Random(10),6+Random(4));
|
|
|
|
|
2010-10-08 16:24:56 +00:00
|
|
|
if(!GBackLiquid(335,430))
|
|
|
|
{
|
2012-04-12 09:48:23 +00:00
|
|
|
AddEffect("Rain",nil,100,2);
|
2010-10-08 16:24:56 +00:00
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-07-18 18:32:10 +00:00
|
|
|
// Refill/fill chests.
|
2010-12-23 13:35:16 +00:00
|
|
|
global func FxIntFillChestsStart(object target, effect, int temporary)
|
2010-07-18 18:32:10 +00:00
|
|
|
{
|
2010-10-08 18:21:34 +00:00
|
|
|
if(temporary) return 1;
|
2010-07-18 18:32:10 +00:00
|
|
|
var chests = FindObjects(Find_ID(Chest));
|
2016-08-22 14:31:05 +00:00
|
|
|
var w_list = [Bow, Blunderbuss, Shield, Sword, Club, GrenadeLauncher, Bow, Blunderbuss, Shield, Sword, Club, GrenadeLauncher, DynamiteBox];
|
2010-07-18 18:32:10 +00:00
|
|
|
|
|
|
|
for(var chest in chests)
|
|
|
|
for(var i=0; i<4; ++i)
|
2010-08-04 15:41:47 +00:00
|
|
|
chest->CreateChestContents(w_list[Random(GetLength(w_list))]);
|
2010-09-25 09:20:54 +00:00
|
|
|
return 1;
|
2010-07-18 18:32:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
global func FxIntFillChestsTimer()
|
|
|
|
{
|
|
|
|
SetTemperature(100);
|
|
|
|
var chest = FindObjects(Find_ID(Chest), Sort_Random())[0];
|
2016-08-22 14:31:05 +00:00
|
|
|
var w_list = [Boompack, IronBomb, IronBomb, Firestone, Bow, Blunderbuss, Sword, Javelin];
|
2010-07-18 18:32:10 +00:00
|
|
|
|
|
|
|
if (chest->ContentsCount() < 5)
|
2010-08-04 15:41:47 +00:00
|
|
|
chest->CreateChestContents(w_list[Random(GetLength(w_list))]);
|
2010-09-25 09:20:54 +00:00
|
|
|
return 1;
|
2010-08-04 15:41:47 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
global func CreateChestContents(id obj_id)
|
|
|
|
{
|
|
|
|
if (!this)
|
|
|
|
return;
|
2015-01-10 09:14:02 +00:00
|
|
|
var obj = CreateObjectAbove(obj_id);
|
2010-08-04 15:41:47 +00:00
|
|
|
if (obj_id == Bow)
|
2010-08-14 11:52:17 +00:00
|
|
|
obj->CreateContents(Arrow);
|
2016-08-22 14:31:05 +00:00
|
|
|
if (obj_id == Blunderbuss)
|
2016-08-16 21:37:17 +00:00
|
|
|
obj->CreateContents(LeadBullet);
|
2010-08-14 11:52:17 +00:00
|
|
|
obj->Enter(this);
|
2010-09-13 15:27:48 +00:00
|
|
|
return;
|
2010-07-18 18:32:10 +00:00
|
|
|
}
|
|
|
|
|
2010-09-25 09:20:54 +00:00
|
|
|
// GameCall from RelaunchContainer.
|
2010-08-14 11:52:17 +00:00
|
|
|
func OnClonkLeftRelaunch(object clonk)
|
2010-07-18 18:32:10 +00:00
|
|
|
{
|
2010-10-08 16:24:56 +00:00
|
|
|
clonk->SetPosition(RandomX(200, LandscapeWidth() - 200), -20);
|
2010-07-18 18:32:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func KillsToRelaunch() { return 0; }
|
2016-08-22 14:31:05 +00:00
|
|
|
func RelaunchWeaponList() { return [Bow, Shield, Sword, Club, Javelin, Blunderbuss]; }
|