Dynamite from szen.c4s (completely rescripted though) and spark from Hazard

stable-5.2
Tobias Zwick 2009-07-15 02:00:26 +02:00
parent fe1fa8e729
commit 7375aa4f2e
10 changed files with 152 additions and 1 deletions

View File

@ -0,0 +1,10 @@
[Action]
Name=Fuse
Procedure=FLOAT
NextAction=Fuse
Length=1
Delay=1
FacetBase=1
Sound=Fusing
StartCall=Fusing

View File

@ -0,0 +1,20 @@
[DefCore]
id=DYNA
Version=4,9,8,8
Name=Dynamite
Category=16
Width=3
Height=12
Offset=-2,-6
Mass=8
Value=10
Picture=4,0,64,64
Vertices=3
VertexX=-2,0,+2
VertexY=6,-6,6
VertexFriction=90,90,90
Collectible=1
Rotate=1
ContactIncinerate=1
BlastIncinerate=1
Rebuy=1

View File

@ -0,0 +1 @@
Vielfältig einsetzbarer Sprengstoff.

View File

@ -0,0 +1 @@
Explosive applicable for various tasks.

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

View File

@ -0,0 +1,2 @@
DE:Dynamit
US:Dynamite

View File

@ -0,0 +1,101 @@
#strict 2
// The dynamite is not a weapon but a mining tool
protected func Activate(object clonk)
{
return Use(clonk);
}
public func Use(object clonk)
{
// if already activated, nothing (so, throw)
if(GetAction() == "Fuse")
{
return false;
}
var x = 0, y = 0;
// hangling
if(WildcardMatch(clonk->GetAction(),"Hangle*"))
{
y = -GetDefHeight(clonk->GetID())/2;
}
// climbing
else if(WildcardMatch(clonk->GetAction(), "Climb*"))
{
x = GetDefWidth(clonk->GetID())/2;
if(clonk->GetDir() == DIR_Left) x = -x;
}
// something else
else
{
// no wall -> put into ground
if(!getWall(x, y, clonk))
{
// contact to ground
if(GetContact(clonk, -1) & CNAT_Bottom)
{
y = GetDefHeight(clonk->GetID())/2;
}
// probably flying or swimming
else
{
// nothing
return false;
}
}
}
// Fuse
Fuse();
// put into ...
Sound("Connect");
Exit(0, x*6/10, y + GetDefHeight(GetID())/2, Angle(x,y,0,0) + RandomX(-25,25));
return true;
}
public func Fuse()
{
Sound("Fuse");
SetAction("Fuse");
}
// returns true if there is a wall in direction in which "clonk" looks
// and puts the offset to the wall into "xo, yo" - looking from the clonk
private func getWall(&xo, &yo, object clonk)
{
var wdt = GetDefWidth(clonk->GetID());
var dir = clonk->GetDir()*2-1;
var x = (wdt/2)*dir;
var s = false;
if(GBackSolid(x, 0)) { xo = x; yo = 0; return true; }
if(GBackSolid(x, -5)) { xo = x; yo = -5; return true; }
if(GBackSolid(x, +5)) { xo = x; yo = +5; return true; }
return false;
}
protected func Hit() { Sound("WoodHit*"); }
protected func Incineration() { Fuse(); }
protected func RejectEntrance()
{
return GetAction() == "Fuse";
}
private func Fusing() {
// Effekt
if(GetActTime() < 120)
{
var h = GetDefHeight(GetID())/2;
CastParticles("Spark",1,20,Sin(GetR(),h),-Cos(GetR(),h),15,25,RGB(255,200,0),RGB(255,255,150));
}
// Explosion
else if(GetActTime() > 140)
Explode(18);
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

@ -0,0 +1,16 @@
[Particle]
Name=Spark
MaxCount=1000
InitFn=StdInit
ExecFn=StdExec
CollisionFn=Die
DrawFn=Std
Face=0,0,16,16,-8,-8
Delay=0
Repeats=1
GravityAcc=100
VertexCount=1
VertexY=50
AlphaFade=8
Additive=1
RByV=1

View File

@ -59,7 +59,7 @@ Magic=MWND=0;MWP2=0;MGWP=0;MVLC=0;RVLT=0;RMMG=0;MMTR=0;MLGT=0;MGHL=0;MGUP=0;MGDW
[Landscape]
Vegetation=TRE1=1;TRE2=2;TRE3=1;TRE4=1
VegetationLevel=100,0,0,100
InEarth=ROCK=1;GOLD=1;FLNT=1;LOAM=1
InEarth=ROCK=1;GOLD=1;DYNA=10;LOAM=1
InEarthLevel=65,0,0,100
Sky=Clouds2
MapWidth=80,0,64,250