forked from Mirrors/openclonk
Experimental pluto's OCTier: Not quite working yet.
parent
96d2639688
commit
d3aa2c60ec
|
@ -0,0 +1,13 @@
|
|||
[DefCore]
|
||||
id=OCTier
|
||||
Version=5,3,0,0
|
||||
Category=C4D_Living
|
||||
Width=32
|
||||
Height=32
|
||||
Offset=-16,-16
|
||||
Vertices=2
|
||||
VertexX=-12,12
|
||||
VertexY=12,12
|
||||
VertexFriction=100,100
|
||||
VertexCNAT=8,8
|
||||
CrewMember=1
|
Binary file not shown.
Binary file not shown.
|
@ -0,0 +1,71 @@
|
|||
/* OCTier */
|
||||
|
||||
func Initialize()
|
||||
{
|
||||
SetObjDrawTransform(5000,0,0,0,5000); // scale separately by DrawTransform, because scaling in mesh transform screws up Z clipping
|
||||
SetAction("Walk");
|
||||
//SetDir(Random(2));
|
||||
}
|
||||
|
||||
func StartWalk()
|
||||
{
|
||||
if(!GetEffect("IntWalk", this))
|
||||
AddEffect("IntWalk", this, 1, 1, this);
|
||||
}
|
||||
|
||||
func StopWalk()
|
||||
{
|
||||
if(GetAction() != "Walk") RemoveEffect("IntWalk", this);
|
||||
}
|
||||
|
||||
func Footstep()
|
||||
{
|
||||
if (GetMaterialVal("DigFree", "Material", GetMaterial(0,10)) == 0)
|
||||
Sound("StepHard?");
|
||||
else
|
||||
{
|
||||
var dir = Sign(GetXDir());
|
||||
var clr = GetAverageTextureColor(GetTexture(0,10));
|
||||
CreateParticle("Dust2", dir*-4, 8, dir*-2, -2, 25+Random(5), DoRGBaValue(clr,-150,0));
|
||||
CreateParticle("Dust2", dir*-4, 8, dir*-3, -3, 25+Random(5), DoRGBaValue(clr,-150,0));
|
||||
Sound("StepSoft?");
|
||||
}
|
||||
}
|
||||
|
||||
func TestAnimation(anim) // run dig poke walk
|
||||
{
|
||||
if (this.test_anim) StopAnimation(this.test_anim);
|
||||
this.test_anim = PlayAnimation(anim, 1, Anim_Linear(0, 0, GetAnimationLength(anim), 40, ANIM_Loop), Anim_Const(1000));
|
||||
Message("@%s", anim);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
local ActMap = {
|
||||
Walk = {
|
||||
Prototype = Action,
|
||||
Name = "Walk",
|
||||
Procedure = DFA_WALK,
|
||||
Accel = 16,
|
||||
Decel = 22,
|
||||
Speed = 200,
|
||||
Directions = 2,
|
||||
FlipDir = 1,
|
||||
Length = 1,
|
||||
Delay = 0,
|
||||
X = 0,
|
||||
Y = 0,
|
||||
Wdt = 8,
|
||||
Hgt = 20,
|
||||
StartCall = "StartWalk",
|
||||
AbortCall = "StopWalk",
|
||||
// InLiquidAction = "Swim",
|
||||
},
|
||||
};
|
||||
|
||||
func Definition(def) {
|
||||
SetProperty("MeshTransformation", Trans_Mul(Trans_Rotate(90,0,1,0), Trans_Translate(0,-2500)), def);
|
||||
|
||||
}
|
|
@ -0,0 +1,14 @@
|
|||
material textur
|
||||
{
|
||||
receive_shadows on
|
||||
technique
|
||||
{
|
||||
pass
|
||||
{
|
||||
ambient 0.500000 0.500000 0.500000 1.000000
|
||||
diffuse 0.800000 0.800000 0.800000 1.000000
|
||||
specular 0.000000 0.000000 0.000000 1.000000 0.250000
|
||||
emissive 0.000000 0.000000 0.000000 1.000000
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
[Head]
|
||||
Icon=26
|
||||
Title=pluto's OC Tier!
|
||||
|
||||
[Definitions]
|
||||
LocalOnly=1
|
|
@ -0,0 +1,13 @@
|
|||
func Initialize()
|
||||
{
|
||||
CreateObject(OCTier, 48, 100, -1)->TestAnimation("Run");
|
||||
CreateObject(OCTier, 88, 100, -1)->TestAnimation("Dig");
|
||||
CreateObject(OCTier, 128, 100, -1)->TestAnimation("Poke");
|
||||
CreateObject(OCTier, 168, 100, -1)->TestAnimation("Walk");
|
||||
}
|
||||
|
||||
func InitializePlayer(plr)
|
||||
{
|
||||
var oct = CreateObject(OCTier, 48, 52, -1);
|
||||
oct->MakeCrewMember(plr);
|
||||
}
|
Loading…
Reference in New Issue