forked from Mirrors/openclonk
updated javeling animation
parent
0d936c41f5
commit
b9cdab2769
File diff suppressed because it is too large
Load Diff
|
@ -470,6 +470,15 @@ func DoUpdateAttach(bool sec)
|
|||
else
|
||||
; // Don't display
|
||||
}
|
||||
else if(iAttachMode == CARRY_Spear)
|
||||
{
|
||||
if(HasHandAction(sec))
|
||||
{
|
||||
PlayAnimation("CarrySpear", 6, Anim_Const(0), Anim_Const(1000));
|
||||
}
|
||||
else
|
||||
iHandMesh[sec] = AttachMesh(obj, pos_back, bone, trans);
|
||||
}
|
||||
}//AttachMesh(DYNB, "pos_tool1", "main", Trans_Translate(0,0,0));
|
||||
|
||||
public func GetHandMesh(object obj)
|
||||
|
@ -486,6 +495,7 @@ static const CARRY_HandBack = 2;
|
|||
static const CARRY_HandAlways = 3;
|
||||
static const CARRY_Back = 4;
|
||||
static const CARRY_BothHands = 5;
|
||||
static const CARRY_Spear = 6;
|
||||
|
||||
func HasHandAction(sec)
|
||||
{
|
||||
|
@ -1212,13 +1222,22 @@ func StartDead()
|
|||
|
||||
func StartTumble()
|
||||
{
|
||||
if(GetEffect("IntTumble", this)) return;
|
||||
PlayAnimation("Tumble", 5, Anim_Linear(0, 0, GetAnimationLength("Tumble"), 20, ANIM_Loop), Anim_Linear(0, 0, 1000, 5, ANIM_Remove));
|
||||
// Update carried items
|
||||
UpdateAttach();
|
||||
// Set proper turn type
|
||||
SetTurnType(0);
|
||||
AddEffect("IntTumble", this, 1, 0);
|
||||
}
|
||||
|
||||
func StopTumble()
|
||||
{
|
||||
if(GetAction() != "Tumble")
|
||||
RemoveEffect("IntTumble", this);
|
||||
}
|
||||
|
||||
|
||||
/* Act Map */
|
||||
|
||||
func Definition(def) {
|
||||
|
@ -1286,6 +1305,7 @@ Tumble = {
|
|||
ObjectDisabled = 1,
|
||||
InLiquidAction = "Swim",
|
||||
StartCall = "StartTumble",
|
||||
AbortCall = "StopTumble",
|
||||
EndCall = "CheckStuck",
|
||||
},
|
||||
Dig = {
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
--*/
|
||||
|
||||
#include L_ST
|
||||
public func MaxStackCount() { return 3; }
|
||||
public func MaxStackCount() { return 999; }
|
||||
|
||||
local fAiming;
|
||||
local power;
|
||||
|
@ -14,10 +14,10 @@ local power;
|
|||
local iAim;
|
||||
local fWait;
|
||||
|
||||
public func GetCarryMode(clonk) { return CARRY_Back; }
|
||||
public func GetCarryMode(clonk) { if(fAiming >= 0) return CARRY_HandBack; }
|
||||
public func GetCarryBone() { return "Javelin"; }
|
||||
public func GetCarrySpecial(clonk) { if(fAiming) return "pos_hand2"; }
|
||||
public func GetCarryTransform() { if(fAiming) return Trans_Rotate(180, 1, 0, 0); }
|
||||
public func GetCarrySpecial(clonk) { if(fAiming >= 0) return "pos_hand2"; }
|
||||
public func GetCarryTransform() { if(fAiming == 1) return Trans_Rotate(180, 1, 0, 0); }
|
||||
|
||||
public func ControlUseStart(object pClonk, int x, int y)
|
||||
{
|
||||
|
@ -76,6 +76,8 @@ protected func ControlUseHolding(object pClonk, int ix, int iy)
|
|||
return 1;
|
||||
}
|
||||
|
||||
static const JAVE_ThrowTime = 16;
|
||||
|
||||
protected func ControlUseStop(object pClonk, int ix, int iy)
|
||||
{
|
||||
if(fWait) return;
|
||||
|
@ -90,7 +92,7 @@ protected func ControlUseStop(object pClonk, int ix, int iy)
|
|||
var angle = pClonk->GetAnimationPosition(iAim)*180/(pClonk->GetAnimationLength("SpearAimArms"));
|
||||
if(!pClonk->GetDir()) angle = -angle;
|
||||
|
||||
var iThrowtime = 10;
|
||||
var iThrowtime = JAVE_ThrowTime;
|
||||
if(Abs(angle) < 90)
|
||||
{
|
||||
iAim = pClonk->PlayAnimation("SpearThrow2Arms", 10, Anim_Linear(0, 0, pClonk->GetAnimationLength("SpearThrow2Arms" ), iThrowtime), Anim_Const(1000));
|
||||
|
@ -104,7 +106,7 @@ protected func ControlUseStop(object pClonk, int ix, int iy)
|
|||
pClonk->SetAnimationWeight(iAim+1, Anim_Const(1000*(Abs(angle)-90)/90));
|
||||
}
|
||||
|
||||
ScheduleCall(this, "DoThrow", iThrowtime, 1, pClonk, angle);
|
||||
ScheduleCall(this, "DoThrow", iThrowtime/2, 1, pClonk, angle);
|
||||
}
|
||||
|
||||
protected func ControlUseCancel(object clonk, int x, int y)
|
||||
|
@ -122,14 +124,16 @@ public func DoThrow(object pClonk, int angle)
|
|||
|
||||
power=0;
|
||||
|
||||
fAiming=false;
|
||||
ResetClonk(pClonk);
|
||||
fAiming = -1;
|
||||
pClonk->UpdateAttach();
|
||||
ScheduleCall(this, "ResetClonk", JAVE_ThrowTime/2, 1, pClonk);
|
||||
}
|
||||
|
||||
public func ResetClonk(clonk)
|
||||
{
|
||||
// Already aiming angain? Don't remove Actions
|
||||
if(fAiming) return;
|
||||
if(fAiming == 1) return;
|
||||
fAiming = 0;
|
||||
|
||||
clonk->SetHandAction(0);
|
||||
|
||||
|
|
Loading…
Reference in New Issue