clonk can turn while on grappler rope

Richard Gerum 2011-10-09 15:26:52 +02:00
parent 7e56f44bc6
commit a28578e757
2 changed files with 32 additions and 0 deletions

View File

@ -98,6 +98,12 @@ func FxIntTurnTimer(pTarget, effect, iTime)
return;
}
public func UpdateTurnRotation()
{
var iEff = GetEffect("IntTurn", this);
iEff.turn_type = -1;
}
public func GetTurnPhase()
{
var iEff = GetEffect("IntTurn", this);

View File

@ -175,10 +175,30 @@ public func FxIntGrappleControlControl(object target, fxnum, ctrl, x,y,strength,
if(ctrl == CON_Right)
{
fxnum.mv_right = !release;
if(release)
{
if(fxnum.lastkey == CON_Right)
{
target->SetDir(0);
target->UpdateTurnRotation();
}
fxnum.lastkey = CON_Right;
fxnum.keyTimer = 10;
}
}
if(ctrl == CON_Left)
{
fxnum.mv_left = !release;
if(release)
{
if(fxnum.lastkey == CON_Left)
{
target->SetDir(1);
target->UpdateTurnRotation();
}
fxnum.lastkey = CON_Left;
fxnum.keyTimer = 10;
}
}
if(ctrl == CON_Up)
{
@ -209,6 +229,12 @@ public func FxIntGrappleControlTimer(object target, fxnum, int time)
if (target->Contained())
return -1;
if(fxnum.keyTimer)
{
fxnum.keyTimer--;
if(fxnum.keyTimer == 0)
fxnum.lastkey = 0;
}
// Movement.
if (fxnum.mv_up)
if (rope)