forked from Mirrors/openclonk
Actions default to COMD_Stop, Decel for float and swim procedures
With this change everything should behave as normal, still not a fan of these numerous float hacks.
parent
d550f7c7da
commit
e2db1bc85a
|
@ -10,6 +10,7 @@ protected func Initialize()
|
|||
ry=40;
|
||||
rx=0;
|
||||
SetAction("Moving");
|
||||
SetComDir(COMD_None);
|
||||
SetPosition(ox,oy);
|
||||
size=4;
|
||||
AddEffect("MovingAround",this,100,1,this,this->GetID());
|
||||
|
|
|
@ -10,6 +10,7 @@ protected func Initialize()
|
|||
ry=40;
|
||||
rx=0;
|
||||
SetAction("Moving");
|
||||
SetComDir(COMD_None);
|
||||
SetPosition(ox,oy);
|
||||
size=4;
|
||||
AddEffect("MovingAround",this,100,1,this,this->GetID());
|
||||
|
|
|
@ -10,6 +10,7 @@ protected func Initialize()
|
|||
ry=40;
|
||||
rx=0;
|
||||
SetAction("Moving");
|
||||
SetComDir(COMD_None);
|
||||
SetPosition(ox,oy);
|
||||
size=4;
|
||||
AddEffect("MovingAround",this,100,1,this,this->GetID());
|
||||
|
|
|
@ -11,6 +11,7 @@ protected func Initialize()
|
|||
{
|
||||
ysin = 0;
|
||||
SetAction("Float");
|
||||
SetComDir(COMD_None);
|
||||
AddEffect("Float",this,1,1,this);
|
||||
}
|
||||
|
||||
|
|
|
@ -47,7 +47,10 @@ protected func FxFlightTimer(object pTarget, effect, int iEffectTime)
|
|||
}
|
||||
|
||||
if(GetAction() != "Fly")
|
||||
{
|
||||
SetAction("Fly");
|
||||
SetComDir(COMD_None);
|
||||
}
|
||||
|
||||
fuel--;
|
||||
}
|
||||
|
|
|
@ -44,7 +44,10 @@ protected func FxFlightTimer(object pTarget, effect, int iEffectTime)
|
|||
}
|
||||
|
||||
if(GetAction() != "Fly")
|
||||
{
|
||||
SetAction("Fly");
|
||||
SetComDir(COMD_None);
|
||||
}
|
||||
|
||||
fuel--;
|
||||
}
|
||||
|
@ -90,6 +93,7 @@ func Launch(int angle)
|
|||
SetProperty("Collectible",0);
|
||||
SetCategory(C4D_Vehicle);
|
||||
SetAction("Fly");
|
||||
SetComDir(COMD_None);
|
||||
|
||||
Exit();
|
||||
AddEffect("Flight",this,150,1,this,this);
|
||||
|
|
|
@ -19,6 +19,7 @@ protected func Initialize()
|
|||
rotanim = PlayAnimation("Rotate", 5, Anim_Const(1), Anim_Const(1000));
|
||||
AddEffect("ButterflyTurn", this, 1, 1, this);
|
||||
SetAction("Fly");
|
||||
SetComDir(COMD_None);
|
||||
MoveToTarget();
|
||||
return 1;
|
||||
}
|
||||
|
@ -53,13 +54,21 @@ func TurnButterfly()
|
|||
private func FlyingStart()
|
||||
{
|
||||
TurnButterfly();
|
||||
if (!Random(3)) SetAction("Flutter");
|
||||
if (!Random(3))
|
||||
{
|
||||
SetAction("Flutter");
|
||||
SetComDir(COMD_None);
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
private func Fluttering()
|
||||
{
|
||||
if (!Random(7)) SetAction("Fly");
|
||||
if (!Random(7))
|
||||
{
|
||||
SetAction("Fly");
|
||||
SetComDir(COMD_None);
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
@ -112,6 +121,7 @@ Fly = {
|
|||
Procedure = DFA_FLOAT,
|
||||
Speed = 200,
|
||||
Accel = 16,
|
||||
Decel = 16,
|
||||
Directions = 2,
|
||||
FlipDir = 1,
|
||||
Length = 1,
|
||||
|
@ -129,6 +139,7 @@ Flutter = {
|
|||
Procedure = DFA_FLOAT,
|
||||
Speed = 200,
|
||||
Accel = 16,
|
||||
Decel = 16,
|
||||
Directions = 2,
|
||||
FlipDir = 1,
|
||||
Length = 11,
|
||||
|
|
|
@ -2155,6 +2155,7 @@ Swim = {
|
|||
Procedure = DFA_SWIM,
|
||||
Speed = 96,
|
||||
Accel = 7,
|
||||
Decel = 9,
|
||||
Directions = 2,
|
||||
Length = 1,
|
||||
Delay = 0,
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
func Initialize()
|
||||
{
|
||||
SetAction("Fly");
|
||||
SetComDir(COMD_None);
|
||||
}
|
||||
|
||||
func Show(int clr, int layer, int size,bool diffuse)
|
||||
|
@ -45,6 +46,7 @@ Fly = {
|
|||
Procedure = DFA_FLOAT,
|
||||
Speed = 1000,
|
||||
Accel = 16,
|
||||
Decel = 16,
|
||||
NextAction = "Hold"
|
||||
},
|
||||
};
|
||||
|
|
|
@ -20,6 +20,7 @@ protected func Initialize()
|
|||
DoCon(Random(75));
|
||||
|
||||
SetAction("Fly");
|
||||
SetComDir(COMD_None);
|
||||
SetPhase(RandomX(1,16));
|
||||
|
||||
//Push low flying clouds up to proper height
|
||||
|
@ -159,6 +160,7 @@ Fly = {
|
|||
Procedure = DFA_FLOAT,
|
||||
Speed = 20,
|
||||
Accel = 16,
|
||||
Decel = 16,
|
||||
X = 0,
|
||||
Y = 0,
|
||||
Wdt = 512,
|
||||
|
|
|
@ -66,6 +66,7 @@ func Update()
|
|||
public func Initialize()
|
||||
{
|
||||
SetAction("Float");
|
||||
SetComDir(COMD_None);
|
||||
SetSpeed(0, -20);
|
||||
alpha=255;
|
||||
return true;
|
||||
|
|
|
@ -9,6 +9,7 @@ protected func Initialize()
|
|||
idir = 0;
|
||||
dir = 0;
|
||||
SetAction("Inflate");
|
||||
SetComDir(COMD_None);
|
||||
AddEffect("Float",this,1,1,this);
|
||||
|
||||
//Special Effects
|
||||
|
@ -22,7 +23,11 @@ protected func Initialize()
|
|||
|
||||
private func Deflate()
|
||||
{
|
||||
if(GetAction() != "Deflate") SetAction("Deflate");
|
||||
if(GetAction() != "Deflate")
|
||||
{
|
||||
SetAction("Deflate");
|
||||
SetComDir(COMD_None);
|
||||
}
|
||||
Schedule("Pack()",20); //EndCall doesn't work. >:(
|
||||
}
|
||||
|
||||
|
|
|
@ -121,6 +121,7 @@ Travel = {
|
|||
Procedure = DFA_FLOAT,
|
||||
Speed = 100000,
|
||||
Accel = 16,
|
||||
Decel = 16,
|
||||
NextAction = "Travel",
|
||||
Length = 1,
|
||||
Delay = 1,
|
||||
|
|
|
@ -23,6 +23,7 @@ public func Initialize()
|
|||
color = GetPlayerColor(GetOwner());
|
||||
SetClrModulation(color|RGBa(0,0,0,fade));
|
||||
SetAction("Fly");
|
||||
SetComDir(COMD_None);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -32,6 +32,7 @@ public func EngageRail(object pRailpoint)
|
|||
SetSpeed(0,0);
|
||||
SetR(0);
|
||||
SetAction("OnRail");
|
||||
SetComDir(COMD_None);
|
||||
pRailTarget = pRailpoint;
|
||||
rail_direction = 0;
|
||||
}
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
protected func Initialize()
|
||||
{
|
||||
SetAction("Door");
|
||||
SetComDir(COMD_None);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -29,6 +29,7 @@ local turnanim;
|
|||
protected func Initialize()
|
||||
{
|
||||
SetAction("Fly");
|
||||
SetComDir(COMD_None);
|
||||
throttle = 0;
|
||||
xtarget = 0;
|
||||
ytarget = 0;
|
||||
|
|
|
@ -8,6 +8,7 @@ protected func Initialize()
|
|||
{
|
||||
SetRDir(-2+Random(4));
|
||||
SetAction("Fall");
|
||||
SetComDir(COMD_None);
|
||||
AddEffect("Fade",this,1,1,this);
|
||||
}
|
||||
|
||||
|
|
|
@ -10,6 +10,7 @@ protected func Initialize()
|
|||
{
|
||||
ysin = 0;
|
||||
SetAction("Float");
|
||||
SetComDir(COMD_None);
|
||||
AddEffect("Float",this,1,1,this);
|
||||
}
|
||||
|
||||
|
|
|
@ -37,7 +37,7 @@ void C4Action::Default()
|
|||
//pActionDef = 0;
|
||||
Dir=DIR_None;
|
||||
DrawDir=Dir;
|
||||
ComDir=COMD_None;
|
||||
ComDir=COMD_Stop;
|
||||
Time=0;
|
||||
Data=0;
|
||||
Target=Target2=NULL;
|
||||
|
@ -53,7 +53,7 @@ void C4Action::CompileFunc(StdCompiler *pComp)
|
|||
// Note: Compiled directly into "Object"-categories, so beware of name clashes (see C4Object::CompileFunc)
|
||||
// FIXME pComp->Value(mkNamingAdapt( toC4CStr(Name), "Action", "" ));
|
||||
pComp->Value(mkNamingAdapt( Dir, "Dir", DIR_None ));
|
||||
pComp->Value(mkNamingAdapt( ComDir, "ComDir", COMD_None ));
|
||||
pComp->Value(mkNamingAdapt( ComDir, "ComDir", COMD_Stop ));
|
||||
pComp->Value(mkNamingAdapt( Time, "ActionTime", 0 ));
|
||||
pComp->Value(mkNamingAdapt( Data, "ActionData", 0 ));
|
||||
pComp->Value(mkNamingAdapt( Phase, "Phase", 0 ));
|
||||
|
|
|
@ -3680,12 +3680,12 @@ void C4Object::ExecAction()
|
|||
case COMD_Left: xdir-=accel; break;
|
||||
case COMD_UpLeft: ydir-=accel; xdir-=accel; break;
|
||||
case COMD_Stop:
|
||||
if (xdir<0) xdir+=accel;
|
||||
if (xdir>0) xdir-=accel;
|
||||
if ((xdir>-accel) && (xdir<+accel)) xdir=0;
|
||||
if (ydir<0) ydir+=accel;
|
||||
if (ydir>0) ydir-=accel;
|
||||
if ((ydir>-accel) && (ydir<+accel)) ydir=0;
|
||||
if (xdir<0) xdir+=decel;
|
||||
if (xdir>0) xdir-=decel;
|
||||
if ((xdir>-decel) && (xdir<+decel)) xdir=0;
|
||||
if (ydir<0) ydir+=decel;
|
||||
if (ydir>0) ydir-=decel;
|
||||
if ((ydir>-decel) && (ydir<+decel)) ydir=0;
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -3698,9 +3698,12 @@ void C4Object::ExecAction()
|
|||
else { ObjectActionWalk(this); return; }
|
||||
}
|
||||
|
||||
// xdir/ydir bounds
|
||||
if (ydir<-limit) ydir=-limit; if (ydir>+limit) ydir=+limit;
|
||||
if (xdir>+limit) xdir=+limit; if (xdir<-limit) xdir=-limit;
|
||||
// xdir/ydir bounds, don't apply if COMD_None
|
||||
if (Action.ComDir != COMD_None)
|
||||
{
|
||||
if (ydir<-limit) ydir=-limit; if (ydir>+limit) ydir=+limit;
|
||||
if (xdir>+limit) xdir=+limit; if (xdir<-limit) xdir=-limit;
|
||||
}
|
||||
// Surface dir bound
|
||||
if (!GBackLiquid(GetX(),GetY()-1+Def->Float*Con/FullCon-1)) if (ydir<0) ydir=0;
|
||||
// Dir, Phase, Attach
|
||||
|
@ -3902,12 +3905,12 @@ void C4Object::ExecAction()
|
|||
case COMD_Left: xdir-=accel; break;
|
||||
case COMD_UpLeft: ydir-=accel; xdir-=accel; break;
|
||||
case COMD_Stop:
|
||||
if (xdir<0) xdir+=accel;
|
||||
if (xdir>0) xdir-=accel;
|
||||
if ((xdir>-accel) && (xdir<+accel)) xdir=0;
|
||||
if (ydir<0) ydir+=accel;
|
||||
if (ydir>0) ydir-=accel;
|
||||
if ((ydir>-accel) && (ydir<+accel)) ydir=0;
|
||||
if (xdir<0) xdir+=decel;
|
||||
if (xdir>0) xdir-=decel;
|
||||
if ((xdir>-decel) && (xdir<+decel)) xdir=0;
|
||||
if (ydir<0) ydir+=decel;
|
||||
if (ydir>0) ydir-=decel;
|
||||
if ((ydir>-decel) && (ydir<+decel)) ydir=0;
|
||||
break;
|
||||
}
|
||||
// xdir/ydir bounds, don't apply if COMD_None
|
||||
|
|
Loading…
Reference in New Issue