Overview Package Class Source Class tree Glossary
previous class      next class frames      no frames

DeusEx.ShipsWheel


00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
//=============================================================================
// ShipsWheel.
//=============================================================================
class ShipsWheel extends DeusExDecoration;

var bool bSpinning;
var float spinTime, spinDuration;
var int spinDir, spinSpeed;

function Tick(float deltaTime)
{
    local Rotator rot;

    Super.Tick(deltaTime);

    if (bSpinning)
    {
        rot = Rotation;
        rot.Roll += spinDir * spinSpeed * deltaTime * (spinDuration - spinTime) / spinDuration;
        SetRotation(rot);
        spinTime += deltaTime;
        if (spinTime >= spinDuration)
            bSpinning = False;
    }
}

function Frob(actor Frobber, Inventory frobWith)
{
    Super.Frob(Frobber, frobWith);

    // spin the wheel in a random direction for a random amount of time at a random speed
    if (FRand() < 0.5)
        spinDir = -1;
    else
        spinDir = 1;
    spinSpeed = Rand(64) * 1024;
    spinDuration = FRand() * 5 + 2;
    spinTime = 0;
    bSpinning = True;
}

defaultproperties
{
     FragType=Class'DeusEx.WoodFragment'
     ItemName="Ship's Wheel"
     bPushable=False
     Physics=PHYS_None
     Mesh=LodMesh'DeusExDeco.ShipsWheel'
     CollisionRadius=21.000000
     CollisionHeight=21.000000
     Mass=50.000000
     Buoyancy=5.000000
}

Overview Package Class Source Class tree Glossary
previous class      next class frames      no frames
Class file time: Mon 8/11/2021 16:22:54.000 - Creation time: Mon 8/11/2021 16:31:32.510 - Created with UnCodeX