diff --git a/planet/Tests.ocf/Moss_Test.ocs/Map.bmp b/planet/Tests.ocf/Moss_Test.ocs/Map.bmp new file mode 100644 index 000000000..5c474ba91 Binary files /dev/null and b/planet/Tests.ocf/Moss_Test.ocs/Map.bmp differ diff --git a/planet/Tests.ocf/Moss_Test.ocs/Moss.ocd/DefCore.txt b/planet/Tests.ocf/Moss_Test.ocs/Moss.ocd/DefCore.txt new file mode 100644 index 000000000..7a64e2b62 --- /dev/null +++ b/planet/Tests.ocf/Moss_Test.ocs/Moss.ocd/DefCore.txt @@ -0,0 +1,21 @@ +[DefCore] +id=Moss +Version=4,10,0,0 +Category=C4D_Object +Width=8 +Height=8 +Offset=-4,-4 +Picture=0,0,8,8 +Vertices=3 +VertexX=0,2,-2 +VertexY=1,-1,-1 +VertexFriction=75,75 +Value=4 +Mass=9 +Components=Wood=2; +Rotate=1 +ContactIncinerate=1 +BlastIncinerate=5 +Rotate=1 +Float=1 +Collectible=1 \ No newline at end of file diff --git a/planet/Tests.ocf/Moss_Test.ocs/Moss.ocd/Graphics.8.png b/planet/Tests.ocf/Moss_Test.ocs/Moss.ocd/Graphics.8.png new file mode 100644 index 000000000..eaf4354d1 Binary files /dev/null and b/planet/Tests.ocf/Moss_Test.ocs/Moss.ocd/Graphics.8.png differ diff --git a/planet/Tests.ocf/Moss_Test.ocs/Moss.ocd/Graphics1.8.png b/planet/Tests.ocf/Moss_Test.ocs/Moss.ocd/Graphics1.8.png new file mode 100644 index 000000000..e954b2bb6 Binary files /dev/null and b/planet/Tests.ocf/Moss_Test.ocs/Moss.ocd/Graphics1.8.png differ diff --git a/planet/Tests.ocf/Moss_Test.ocs/Moss.ocd/Graphics1Dry.8.png b/planet/Tests.ocf/Moss_Test.ocs/Moss.ocd/Graphics1Dry.8.png new file mode 100644 index 000000000..eef4205b9 Binary files /dev/null and b/planet/Tests.ocf/Moss_Test.ocs/Moss.ocd/Graphics1Dry.8.png differ diff --git a/planet/Tests.ocf/Moss_Test.ocs/Moss.ocd/Graphics2.8.png b/planet/Tests.ocf/Moss_Test.ocs/Moss.ocd/Graphics2.8.png new file mode 100644 index 000000000..163f68f52 Binary files /dev/null and b/planet/Tests.ocf/Moss_Test.ocs/Moss.ocd/Graphics2.8.png differ diff --git a/planet/Tests.ocf/Moss_Test.ocs/Moss.ocd/Graphics2Dry.8.png b/planet/Tests.ocf/Moss_Test.ocs/Moss.ocd/Graphics2Dry.8.png new file mode 100644 index 000000000..95531db03 Binary files /dev/null and b/planet/Tests.ocf/Moss_Test.ocs/Moss.ocd/Graphics2Dry.8.png differ diff --git a/planet/Tests.ocf/Moss_Test.ocs/Moss.ocd/GraphicsDry.8.png b/planet/Tests.ocf/Moss_Test.ocs/Moss.ocd/GraphicsDry.8.png new file mode 100644 index 000000000..c85182c72 Binary files /dev/null and b/planet/Tests.ocf/Moss_Test.ocs/Moss.ocd/GraphicsDry.8.png differ diff --git a/planet/Tests.ocf/Moss_Test.ocs/Moss.ocd/Script.c b/planet/Tests.ocf/Moss_Test.ocs/Moss.ocd/Script.c new file mode 100644 index 000000000..a3ff92b65 --- /dev/null +++ b/planet/Tests.ocf/Moss_Test.ocs/Moss.ocd/Script.c @@ -0,0 +1,149 @@ +/*-- Moss --*/ + +static const MOSS_MINDIST = 17; +static const MOSS_MAXDIST = 20; +static const MOSS_WATERMAXDIST = 15; +static const MOSS_MINBURIED = 30; +static const MOSS_MAXWETNESS = 10; +local wetness; +local buriedtime; +local waterpos; +local vine; +local graphic; +func Initialize() +{ + graphic = Random(3); + if(graphic) + SetGraphics(Format("%d",graphic)); + else SetGraphics(); + wetness = MOSS_MAXWETNESS; + buriedtime = 0; + waterpos = [0,0]; + vine = nil; + AddEffect("MossGrow", this, 100, 36, this, this.ID); + AddEffect("MossMoisture",this,100,36,this,this.ID); +} + +public func Entrance() +{ + if(vine) + vine->RemoveObject(); +} + + +protected func Replicate() +{ + var x = RandomX(-MOSS_MAXDIST,MOSS_MAXDIST); + var y = RandomX(-MOSS_MAXDIST,MOSS_MAXDIST); + var i = 0; + var good=false; + while(i<10) + { + if(GetMaterial(x,y)!=Material("Earth")) + { + i++; + continue; + } + if(FindObject(Find_ID(Moss),Find_Distance(MOSS_MINDIST,x,y))) + { + i++; + continue; + } + if(Distance(0,0,x,y)>MOSS_MAXDIST) + { + i++; + continue; + } + good = true; + break; + } + if(!good) return ; + CreateObject(Moss,x,y,-1); + buriedtime = -Random(MOSS_MINBURIED); + +} + + +func SpreadNoReplication() +{ + for(var m in FindObjects(Find_ID(Moss),Find_Distance(MOSS_WATERMAXDIST))) + AddEffect("MossReplicationBlock",m,1,MOSS_MINBURIED*10,this,this.ID); +} + +private func FxMossMoistureTimer(target, effect, time) +{ + if(GetMaterial() == Material("Water")) + { + if(wetness < MOSS_MAXWETNESS) + { + wetness = MOSS_MAXWETNESS; + if(graphic) + SetGraphics(Format("%d",graphic)); + SetGraphics(); + } + + } + + else if(!Contained() && !GBackSolid() && !GBackLiquid()) + if(wetness) + { + wetness--; + if(wetness == 0) + { + if(graphic) + SetGraphics(Format("%dDry",graphic)); + else SetGraphics("Dry"); + } + } + + + +} + +private func FxMossGrowTimer(target, effect, time) +{ + if(!wetness) return 1; + if(GetMaterial() != Material("Earth")) + { + if(buriedtime > (MOSS_MINBURIED/5)) + SpreadNoReplication(); + buriedtime = 0; + + if(vine) + vine->RemoveObject(); + + return 1; + } + if(buriedtime>2 && !vine && Random(3)) + { + vine = CreateObject(Moss_Vine,0,20,-1); + vine.parent=this; + } + if(GetMaterial(waterpos[0],waterpos[1]) != Material("Water")) + { + SearchWater(); + buriedtime = Min(buriedtime+1, MOSS_MINBURIED / 3 * 2); + } + else + { + buriedtime++; + if(buriedtime > MOSS_MINBURIED && !GetEffect("MossReplicationBlock",this)) + Replicate(); + } +} + +func SearchWater() +{ + for(var i = 0; i < 5; i++) + { + waterpos[0] = RandomX(-MOSS_WATERMAXDIST,MOSS_WATERMAXDIST); + waterpos[1] = RandomX(-MOSS_WATERMAXDIST,MOSS_WATERMAXDIST); + if(GetMaterial(waterpos[0],waterpos[1]) == Material("Water")) + break; + } +} + +local Collectible = 1; +local Name = "$Name$"; +local Description = "$Description$"; + diff --git a/planet/Tests.ocf/Moss_Test.ocs/Moss.ocd/StringTblDE.txt b/planet/Tests.ocf/Moss_Test.ocs/Moss.ocd/StringTblDE.txt new file mode 100644 index 000000000..87d17ba87 --- /dev/null +++ b/planet/Tests.ocf/Moss_Test.ocs/Moss.ocd/StringTblDE.txt @@ -0,0 +1,2 @@ +Name=Moos +Description=Moos wächst unterirdisch nahe des Wassers. \ No newline at end of file diff --git a/planet/Tests.ocf/Moss_Test.ocs/Moss.ocd/StringTblUS.txt b/planet/Tests.ocf/Moss_Test.ocs/Moss.ocd/StringTblUS.txt new file mode 100644 index 000000000..dd3777760 --- /dev/null +++ b/planet/Tests.ocf/Moss_Test.ocs/Moss.ocd/StringTblUS.txt @@ -0,0 +1,2 @@ +Name=Moss +Description=Moss grows close to subterraen ponds. \ No newline at end of file diff --git a/planet/Tests.ocf/Moss_Test.ocs/Moss.ocd/Vine.ocd/DefCore.txt b/planet/Tests.ocf/Moss_Test.ocs/Moss.ocd/Vine.ocd/DefCore.txt new file mode 100644 index 000000000..99ff2b824 --- /dev/null +++ b/planet/Tests.ocf/Moss_Test.ocs/Moss.ocd/Vine.ocd/DefCore.txt @@ -0,0 +1,22 @@ +[DefCore] +id=Moss_Vine +Version=4,10,0,0 +Category=C4D_Object | C4D_StaticBack | C4D_MouseIgnore +Width=40 +Height=40 +Offset=-20,-20 +Picture=0,0,40,40 +Vertices=3 +VertexX=0 +VertexY=0 +VertexFriction=75,75 +Value=4 +Mass=9 +Components=Wood=2; +Rotate=1 +ContactIncinerate=1 +BlastIncinerate=5 +Rotate=1 +Float=1 +Oversize=1 +StretchGrowth=1 diff --git a/planet/Tests.ocf/Moss_Test.ocs/Moss.ocd/Vine.ocd/Graphics.2.png b/planet/Tests.ocf/Moss_Test.ocs/Moss.ocd/Vine.ocd/Graphics.2.png new file mode 100644 index 000000000..7571c8b44 Binary files /dev/null and b/planet/Tests.ocf/Moss_Test.ocs/Moss.ocd/Vine.ocd/Graphics.2.png differ diff --git a/planet/Tests.ocf/Moss_Test.ocs/Moss.ocd/Vine.ocd/Graphics1.2.png b/planet/Tests.ocf/Moss_Test.ocs/Moss.ocd/Vine.ocd/Graphics1.2.png new file mode 100644 index 000000000..90b8d97a5 Binary files /dev/null and b/planet/Tests.ocf/Moss_Test.ocs/Moss.ocd/Vine.ocd/Graphics1.2.png differ diff --git a/planet/Tests.ocf/Moss_Test.ocs/Moss.ocd/Vine.ocd/Graphics2.2.png b/planet/Tests.ocf/Moss_Test.ocs/Moss.ocd/Vine.ocd/Graphics2.2.png new file mode 100644 index 000000000..07aac620d Binary files /dev/null and b/planet/Tests.ocf/Moss_Test.ocs/Moss.ocd/Vine.ocd/Graphics2.2.png differ diff --git a/planet/Tests.ocf/Moss_Test.ocs/Moss.ocd/Vine.ocd/Script.c b/planet/Tests.ocf/Moss_Test.ocs/Moss.ocd/Vine.ocd/Script.c new file mode 100644 index 000000000..e9ef04f46 --- /dev/null +++ b/planet/Tests.ocf/Moss_Test.ocs/Moss.ocd/Vine.ocd/Script.c @@ -0,0 +1,32 @@ +/*-- Vine --*/ + +local size; +local parent; +local maxsize; + +func Initialize() +{ + var graphic = Random(3); + if(graphic) + SetGraphics(Format("%d",graphic)); + size = 1; + SetObjDrawTransform(10,0,0,0,10); + maxsize=75+Random(10); + AddEffect("VineGrow", this, 100, 18, this, this.ID); + SetR(Random(360)); +} + +private func FxVineGrowTimer(target, effect, time) +{ + if(Distance(GetX(),GetY(),parent->GetX(),parent->GetY())>2) + RemoveObject(); + + size++; + if(size > maxsize) + return -1; + SetObjDrawTransform(10*size,0,0,0,10*size ); + return 1; + +} + + diff --git a/planet/Tests.ocf/Moss_Test.ocs/Scenario.txt b/planet/Tests.ocf/Moss_Test.ocs/Scenario.txt new file mode 100644 index 000000000..8bffe2e4a Binary files /dev/null and b/planet/Tests.ocf/Moss_Test.ocs/Scenario.txt differ diff --git a/planet/Tests.ocf/Moss_Test.ocs/Script.c b/planet/Tests.ocf/Moss_Test.ocs/Script.c new file mode 100644 index 000000000..e73ceebee --- /dev/null +++ b/planet/Tests.ocf/Moss_Test.ocs/Script.c @@ -0,0 +1,43 @@ +/* MOOSSSSSS */ + +func Initialize() +{ + + + CreateObject(Moss,280,380); + CreateObject(Moss,166,166); + Log("Try /fast 10 for faster growing!"); + +} + + func InitializePlayer(int iPlr, int iX, int iY, object pBase, int iTeam) +{ + SetFoW(0,iPlr); + JoinPlayer(iPlr); + return; +} + + func RelaunchPlayer(int iPlr) +{ + var clonk = CreateObject(Clonk, 0, 0, iPlr); + clonk->MakeCrewMember(iPlr); + SetCursor(iPlr,clonk); + JoinPlayer(iPlr); + return; +} + + func JoinPlayer(int iPlr) +{ + var clonk = GetCrew(iPlr); + clonk->DoEnergy(100000); + clonk->SetPosition(150, 100); +// clonk->CreateContents(Javelin); +// clonk->CreateContents(DynamiteBox); + clonk->CreateContents(Bow); + clonk->Collect(CreateObject(Arrow)); + clonk->CreateContents(Firestone); + clonk->CreateContents(Shovel); + clonk->CreateContents(GrappleBow); + return; + +} \ No newline at end of file diff --git a/planet/Tests.ocf/Moss_Test.ocs/Title.txt b/planet/Tests.ocf/Moss_Test.ocs/Title.txt new file mode 100644 index 000000000..4a84c18f4 --- /dev/null +++ b/planet/Tests.ocf/Moss_Test.ocs/Title.txt @@ -0,0 +1,2 @@ +DE:Moos Test +US:Moss Test \ No newline at end of file