// PB: Steam Ships -->
if(SteamShip(rCharacter))
{
if(!IsMainCharacter(rCharacter))
{
switch(sti(rCharacter.LastSailState))
{
case 0:
rCharacter.Ship.Power = 0;
break;
case 1:
rCharacter.Ship.Power = 50;
break;
case 2:
rCharacter.Ship.Power = 100;
break;
}
}
if(GetCargoGoods(rCharacter, GOOD_PLANKS) > 0 || !IsMainCharacter(rCharacter))
{
ref MyShipType = GetShipByType(GetCharacterShipType(rCharacter));
aref arship; makearef(arship, rCharacter.ship);
float PowerScalar = stf(GetAttribute(rCharacter,"Ship.Power"))/100;
float SpeedRateScalar = stf(GetLocalShipAttrib(arship, MyShipType, "SpeedRate"))/10
float DamageScalar = makefloat(GetCurrentShipHP(rCharacter)) / makefloat(GetCharacterShipHP(rCharacter));
// THIS LINE MAKES THE "ENGINE" WORK FOR REAL; everything after the = sign is the calculation of the power output
rCharacter.Ship.Impulse.Rotate.z = 0.2 * PowerScalar * SpeedRateScalar * DamageScalar;
fX = 0; fY = 0; fZ = 0;
if(CheckAttribute(rCharacter,"Ship.pos.x")) fX=stf(rCharacter.Ship.pos.x);
if(CheckAttribute(rCharacter,"Ship.pos.y")) fY=stf(rCharacter.Ship.pos.y);
if(CheckAttribute(rCharacter,"Ship.pos.z")) fZ=stf(rCharacter.Ship.pos.z);
if(fX != 0 && fY != 0 && fZ != 0) StackSteam(rCharacter, makeint(abs(stf(GetAttribute(rCharacter,"Ship.Power")))/12.5));
}
}
// PB: Steam Ships <--