From 2d2cab8227406cc186d3639b26efb11ec4e4553e Mon Sep 17 00:00:00 2001 From: Felix Wagner Date: Wed, 5 Oct 2011 04:55:40 +0100 Subject: [PATCH] Rework of the plants, to work with the new lib --- .../Vegetation.ocd/Fern.ocd/DefCore.txt | 5 ++-- .../Vegetation.ocd/Fern.ocd/Script.c | 7 ++---- .../Vegetation.ocd/Mushroom.ocd/DefCore.txt | 9 ++++---- .../Vegetation.ocd/Mushroom.ocd/Script.c | 23 ++++++++++++------- .../Trees.ocd/Coniferous.ocd/DefCore.txt | 5 ++-- .../Trees.ocd/Coniferous.ocd/Script.c | 6 ++--- .../Vegetation.ocd/Trunk.ocd/DefCore.txt | 6 ++--- .../Vegetation.ocd/Trunk.ocd/Script.c | 2 +- 8 files changed, 32 insertions(+), 31 deletions(-) diff --git a/planet/Objects.ocd/Environment.ocd/Vegetation.ocd/Fern.ocd/DefCore.txt b/planet/Objects.ocd/Environment.ocd/Vegetation.ocd/Fern.ocd/DefCore.txt index 6b893d4b5..e14c65bb0 100644 --- a/planet/Objects.ocd/Environment.ocd/Vegetation.ocd/Fern.ocd/DefCore.txt +++ b/planet/Objects.ocd/Environment.ocd/Vegetation.ocd/Fern.ocd/DefCore.txt @@ -10,11 +10,10 @@ Offset=-14,-5 Vertices=2 VertexX=0,0 VertexY=0,3 -VertexCNAT=3,4 +VertexCNAT=16,8 Mass=1 StretchGrowth=1 Oversize=1 ContactIncinerate=3 BlastIncinerate=1 -Float=1 - +Float=1 \ No newline at end of file diff --git a/planet/Objects.ocd/Environment.ocd/Vegetation.ocd/Fern.ocd/Script.c b/planet/Objects.ocd/Environment.ocd/Vegetation.ocd/Fern.ocd/Script.c index 14c05d7ae..ba182e0b2 100644 --- a/planet/Objects.ocd/Environment.ocd/Vegetation.ocd/Fern.ocd/Script.c +++ b/planet/Objects.ocd/Environment.ocd/Vegetation.ocd/Fern.ocd/Script.c @@ -2,13 +2,10 @@ #include Library_Plant -private func SeedChance() { return 400; } -private func SeedAreaSize() { return 200; } -private func SeedAmount() { return 6; } - func Construction() { StartGrowth(1); + inherited(...); } private func Initialize() @@ -22,4 +19,4 @@ public func Incineration() RemoveObject(); } -local Name = "$Name$"; +local Name = "$Name$"; \ No newline at end of file diff --git a/planet/Objects.ocd/Environment.ocd/Vegetation.ocd/Mushroom.ocd/DefCore.txt b/planet/Objects.ocd/Environment.ocd/Vegetation.ocd/Mushroom.ocd/DefCore.txt index 2fbbb7f93..402ab2fe4 100644 --- a/planet/Objects.ocd/Environment.ocd/Vegetation.ocd/Mushroom.ocd/DefCore.txt +++ b/planet/Objects.ocd/Environment.ocd/Vegetation.ocd/Mushroom.ocd/DefCore.txt @@ -5,13 +5,14 @@ Category=C4D_Object Timer=350 TimerCall=Seed Width=12 -Height=12 -Offset=-6,-6 +Height=20 +Offset=-6,-10 Vertices=2 VertexX=0,0 -VertexY=0,3 -VertexCNAT=4,3 +VertexY=1,4 +VertexCNAT=16,8 VertexFriction=10,100 Mass=6 StretchGrowth=4 Oversize=1 +Placement=4 \ No newline at end of file diff --git a/planet/Objects.ocd/Environment.ocd/Vegetation.ocd/Mushroom.ocd/Script.c b/planet/Objects.ocd/Environment.ocd/Vegetation.ocd/Mushroom.ocd/Script.c index fe1c2cec7..a1cc5a8bd 100644 --- a/planet/Objects.ocd/Environment.ocd/Vegetation.ocd/Mushroom.ocd/Script.c +++ b/planet/Objects.ocd/Environment.ocd/Vegetation.ocd/Mushroom.ocd/Script.c @@ -3,12 +3,15 @@ #include Library_Plant private func SeedChance() { return 250; } -private func SeedAreaSize() { return 100; } -private func SeedAmount() { return 6; } +private func SeedAreaSize() { return 150; } +private func SeedAmount() { return 5; } + +/* Initialisation */ func Construction() { StartGrowth(3); + _inherited(...); } private func Initialize() @@ -16,18 +19,20 @@ private func Initialize() SetProperty("MeshTransformation", Trans_Rotate(RandomX(0,359),0,1,0)); } -public func Interact(object clonk) +/* Harvesting */ + +private func CanBeHarvested() { return true; } + +public func Harvest(object clonk) { - //Pick mushroom this.Collectible = 1; - if(clonk->ContentsCount() < clonk->MaxContentsCount()) - Enter(clonk); + clonk->Collect(this); return true; } public func IsInteractable(object clonk) { - return clonk->GetProcedure() == "WALK" && GetProperty("Collectible") != 1; + return GetProperty("Collectible") != 1 && inherited(clonk); } public func GetInteractionMetaInfo(object clonk) @@ -35,6 +40,8 @@ public func GetInteractionMetaInfo(object clonk) return { Description = "$PickMushroom$" }; } +/* Eating */ + protected func ControlUse(object clonk, int iX, int iY) { clonk->DoEnergy(10); @@ -42,4 +49,4 @@ protected func ControlUse(object clonk, int iX, int iY) } local Name = "$Name$"; -local Collectible = 0; +local Collectible = 0; \ No newline at end of file diff --git a/planet/Objects.ocd/Environment.ocd/Vegetation.ocd/Trees.ocd/Coniferous.ocd/DefCore.txt b/planet/Objects.ocd/Environment.ocd/Vegetation.ocd/Trees.ocd/Coniferous.ocd/DefCore.txt index 2b759ee93..b73c8fd38 100644 --- a/planet/Objects.ocd/Environment.ocd/Vegetation.ocd/Trees.ocd/Coniferous.ocd/DefCore.txt +++ b/planet/Objects.ocd/Environment.ocd/Vegetation.ocd/Trees.ocd/Coniferous.ocd/DefCore.txt @@ -10,11 +10,10 @@ Offset=-30,-55 Vertices=9 VertexX=0,0,0,0,0,0,0,0,0 VertexY=45,30,20,10,0,-10,-20,-30,-45 -VertexCNAT=3,4,4,4,4,4,4,4,2 +VertexCNAT=8,16,16,16,16,16,16,16,4 Mass=150 StretchGrowth=1 Oversize=1 ContactIncinerate=3 BlastIncinerate=1 -Float=1 - +Float=1 \ No newline at end of file diff --git a/planet/Objects.ocd/Environment.ocd/Vegetation.ocd/Trees.ocd/Coniferous.ocd/Script.c b/planet/Objects.ocd/Environment.ocd/Vegetation.ocd/Trees.ocd/Coniferous.ocd/Script.c index ae38f3eb4..e616a7fd0 100644 --- a/planet/Objects.ocd/Environment.ocd/Vegetation.ocd/Trees.ocd/Coniferous.ocd/Script.c +++ b/planet/Objects.ocd/Environment.ocd/Vegetation.ocd/Trees.ocd/Coniferous.ocd/Script.c @@ -2,12 +2,12 @@ #include Library_Plant -private func SeedAreaSize() { return 500; } -private func SeedAmount() { return 10; } +private func SeedAreaSize() { return 400; } func Construction() { StartGrowth(1); + inherited(...); } private func Initialize() @@ -15,4 +15,4 @@ private func Initialize() SetProperty("MeshTransformation", Trans_Rotate(RandomX(0,359),0,1,0)); } -local Name = "$Name$"; +local Name = "$Name$"; \ No newline at end of file diff --git a/planet/Objects.ocd/Environment.ocd/Vegetation.ocd/Trunk.ocd/DefCore.txt b/planet/Objects.ocd/Environment.ocd/Vegetation.ocd/Trunk.ocd/DefCore.txt index 41bbaed15..34d3bd44e 100644 --- a/planet/Objects.ocd/Environment.ocd/Vegetation.ocd/Trunk.ocd/DefCore.txt +++ b/planet/Objects.ocd/Environment.ocd/Vegetation.ocd/Trunk.ocd/DefCore.txt @@ -8,13 +8,11 @@ Offset=-10,-30 Vertices=2 VertexX=0,0 VertexY=-25,25 -VertexCNAT=3,4 +VertexCNAT=4,8 Mass=40 StretchGrowth=1 Oversize=1 ContactIncinerate=3 BlastIncinerate=1 Float=1 -Rotate=1 - - +Rotate=1 \ No newline at end of file diff --git a/planet/Objects.ocd/Environment.ocd/Vegetation.ocd/Trunk.ocd/Script.c b/planet/Objects.ocd/Environment.ocd/Vegetation.ocd/Trunk.ocd/Script.c index 707fe6359..ea9b1d94f 100644 --- a/planet/Objects.ocd/Environment.ocd/Vegetation.ocd/Trunk.ocd/Script.c +++ b/planet/Objects.ocd/Environment.ocd/Vegetation.ocd/Trunk.ocd/Script.c @@ -5,4 +5,4 @@ private func Initialize() SetProperty("MeshTransformation", Trans_Rotate(RandomX(0,359),0,1,0)); } -local Name = "$Name$"; +local Name = "$Name$"; \ No newline at end of file