added throw animation, and fixed StdMesh.cpp to compile

stable-5.2
Richard Gerum 2009-12-31 01:56:17 +01:00
parent e66de9ba49
commit 42ffa51ac9
2 changed files with 8769 additions and 3 deletions

File diff suppressed because it is too large Load Diff

View File

@ -256,8 +256,39 @@ protected func ControlThrow()
SetAction("RideThrow");
return 1;
}
if(!GetEffect("IntDoThrow", this))
{
AddEffect("IntDoThrow", this, 1, 1);
AnimationPlay("ThrowArms", 0);
}
// Keine <20>berladene Steuerung
return 0;
return 1;
}
global func FxIntDoThrowTimer(object target, int number, int time)
{
var walk_pos = (time % 50) * 2400 / 50; // Walk animation ranges to 2400
// Animation lasts 20 frames
if(time <= 15*2)
{
var off = time;
var weight = 2000*off;
var jump_pos = off * 1500 / (15*2); // Throw animation ranges to 1500
target->AnimationSetState("ThrowArms", jump_pos, weight);
if(time == 9*2)
target->Throwing();
}
else
{
var weight = 2000-2000*(time-15*2)/5;
target->AnimationSetState("ThrowArms", 1500, weight);
// Hold until 50 frames
if(time > 35)
{
target->AnimationStop("ThrowArms");
return -1;
}
}
}
protected func ControlUpdate(object self, int comdir, bool dig, bool throw)
@ -436,7 +467,7 @@ private func Throwing()
// Wurfparameter berechnen
var iX, iY, iR, iXDir, iYDir, iRDir;
iX = 0; if (!GetDir()) iX = -iX;
iY = -10;
iY = -2;
iR = Random(360);
iXDir = GetPhysical("Throw") / 25000; if(!GetDir()) iXDir = -iXDir;
iYDir = -GetPhysical("Throw") / 25000;