add liquid test which causes an error on material change

ipv6
Maikel de Vries 2017-01-01 11:02:32 +01:00
parent c11ca2f3c6
commit c5590d851a
1 changed files with 46 additions and 3 deletions

View File

@ -281,8 +281,44 @@ global func Test3_OnFinished()
return;
}
global func Test4_OnStart(int plr)
{
DrawMatBasin("DuroLava", 20, 120);
var foundry = CreateObjectAbove(Foundry, 110, 160, plr);
foundry->CreateContents(Earth, 10);
foundry->AddToQueue(Loam, 2);
var pump = CreateObjectAbove(Pump, 84, 160, plr);
var source = CreateObject(Pipe, 168, 292, plr);
source->ConnectPipeTo(pump, PIPE_STATE_Source);
var drain = CreateObjectAbove(Pipe, 240, 100, plr);
drain->ConnectPipeTo(pump, PIPE_STATE_Drain);
drain->ConnectPipeTo(foundry, PIPE_STATE_Drain);
ScheduleCall(source, "SetPosition", 100, 0, 20, 120);
ScheduleCall(foundry, "DoCutPipe", 200, 0, drain);
// Log what the test is about.
Log("Test air switching pumping materials after connection changes.");
return true;
}
global func Test4_Completed()
{
return false;
}
global func Test4_OnFinished()
{
RemoveAll(Find_Or(Find_ID(Foundry), Find_ID(Pump), Find_ID(Loam)));
RestoreWaterLevels();
return;
}
global func Test5_OnStart(int plr)
{
RemoveAll(Find_ID(Rule_NoPowerNeed));
@ -300,14 +336,14 @@ global func Test4_OnStart(int plr)
return true;
}
global func Test4_Completed()
global func Test5_Completed()
{
if (ObjectCount(Find_ID(DivingHelmet), Find_NoContainer()) >= 1)
return true;
return false;
}
global func Test4_OnFinished()
global func Test5_OnFinished()
{
RemoveAll(Find_Or(Find_ID(DivingHelmet), Find_ID(Pump), Find_ID(Pipe), Find_ID(SteamEngine)));
RestoreWaterLevels();
@ -329,6 +365,13 @@ global func RestoreWaterLevels()
return;
}
global func DrawMatBasin(string mat, int x, int y)
{
DrawMaterialQuad("Brick", x - 10, y - 10, x - 10, y + 10, x + 10, y + 10, x + 10, y - 10);
DrawMaterialQuad(mat, x - 6, y - 6, x - 6, y + 6, x + 6, y + 6, x + 6, y - 6);
return;
}
global func RemoveWater()
{
for (var x = 144; x <= 208 + 1; x++)