Added test scenario for Moss

MimmoO 2011-05-24 17:55:43 +02:00
parent 1334a494eb
commit 53cf29ce5e
19 changed files with 273 additions and 0 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

View File

@ -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

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.5 KiB

View File

@ -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$";

View File

@ -0,0 +1,2 @@
Name=Moos
Description=Moos wächst unterirdisch nahe des Wassers.

View File

@ -0,0 +1,2 @@
Name=Moss
Description=Moss grows close to subterraen ponds.

View File

@ -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

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

View File

@ -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;
}

Binary file not shown.

View File

@ -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;
}

View File

@ -0,0 +1,2 @@
DE:Moos Test
US:Moss Test