From bb7afe5850943a6f19db3907a6c545969106f354 Mon Sep 17 00:00:00 2001 From: Sven Eberhardt Date: Sun, 21 Jan 2018 21:53:01 -0800 Subject: [PATCH] Missions/Raid+TreasureHunt: Oil barrels are actually filled with oil and don't empty. --- planet/Missions.ocf/Raid.ocs/Objects.c | 4 ++++ .../Raid.ocs/System.ocg/OilBarrel.c | 10 ++++++++- .../TreasureHunt.ocs/System.ocg/DlgDagobert.c | 1 + .../TreasureHunt.ocs/System.ocg/OilBarrel.c | 21 ++++++++++++++++++- 4 files changed, 34 insertions(+), 2 deletions(-) diff --git a/planet/Missions.ocf/Raid.ocs/Objects.c b/planet/Missions.ocf/Raid.ocs/Objects.c index 027ea7071..976a7742c 100644 --- a/planet/Missions.ocf/Raid.ocs/Objects.c +++ b/planet/Missions.ocf/Raid.ocs/Objects.c @@ -418,13 +418,17 @@ func InitializeObjects() var MetalBarrel001 = CreateObjectAbove(MetalBarrel, 395, 1271); MetalBarrel001->SetColor(0xff000000); + MetalBarrel001->PutLiquid("Oil"); var MetalBarrel002 = CreateObject(MetalBarrel, 421, 1268); MetalBarrel002->SetR(-104); MetalBarrel002->SetColor(0xff000000); + MetalBarrel002->PutLiquid("Oil"); var MetalBarrel003 = CreateObjectAbove(MetalBarrel, 411, 1271); MetalBarrel003->SetColor(0xff000000); + MetalBarrel003->PutLiquid("Oil"); var MetalBarrel004 = CreateObjectAbove(MetalBarrel, 385, 1271); MetalBarrel004->SetColor(0xff000000); + MetalBarrel004->PutLiquid("Oil"); var PowderKeg001 = CreateObject(PowderKeg, 378, 1268); PowderKeg001->SetR(99); diff --git a/planet/Missions.ocf/Raid.ocs/System.ocg/OilBarrel.c b/planet/Missions.ocf/Raid.ocs/System.ocg/OilBarrel.c index 80f307805..297215c82 100644 --- a/planet/Missions.ocf/Raid.ocs/System.ocg/OilBarrel.c +++ b/planet/Missions.ocf/Raid.ocs/System.ocg/OilBarrel.c @@ -30,8 +30,16 @@ private func AcceptMaterial(int material) return false; } -// ..and can also not be emptied. +// ...and can also not be emptied. public func RejectUse() { return true; } + +// ...not even when it hits the ground +public func Hit() +{ + this->PlayBarrelHitSound(); +} +// (okay, you could still put it into a building and attach a pump) + diff --git a/planet/Missions.ocf/TreasureHunt.ocs/System.ocg/DlgDagobert.c b/planet/Missions.ocf/TreasureHunt.ocs/System.ocg/DlgDagobert.c index f8252e824..9e6906004 100644 --- a/planet/Missions.ocf/TreasureHunt.ocs/System.ocg/DlgDagobert.c +++ b/planet/Missions.ocf/TreasureHunt.ocs/System.ocg/DlgDagobert.c @@ -166,6 +166,7 @@ func Dlg_Dagobert_Gem2(object clonk) { barrel->SetXDir(-15); barrel->SetYDir(-20); + barrel->PutLiquid("Oil"); } g_got_oil = true; if (g_goal) g_goal->OnTreasureSold(); diff --git a/planet/Missions.ocf/TreasureHunt.ocs/System.ocg/OilBarrel.c b/planet/Missions.ocf/TreasureHunt.ocs/System.ocg/OilBarrel.c index 25b0e773d..df53fd141 100644 --- a/planet/Missions.ocf/TreasureHunt.ocs/System.ocg/OilBarrel.c +++ b/planet/Missions.ocf/TreasureHunt.ocs/System.ocg/OilBarrel.c @@ -1,5 +1,5 @@ // Goal timer: Barrel has to be brought to the plane -// Doesn't matter if container or not. +// Doesn't matter if contained or not. #appendto MetalBarrel @@ -19,3 +19,22 @@ private func CheckForPlane() } } +// The barrel is always full with oil and does not accept anything else. +private func AcceptMaterial(int material) +{ + return false; +} + +// ...and can also not be emptied. +public func RejectUse() +{ + return true; +} + +// ...not even when it hits the ground +public func Hit() +{ + this->PlayBarrelHitSound(); +} +// (okay, you could still put it into a building and attach a pump) +