Script:Files:script/vehicles/hog.script

From Mod Wiki
Revision as of 09:59, 5 November 2007 by Wizz (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
object vehicle_hog : vehicle_base {
    void            init();

    void            OnCollision( object traceObject, float velocity, vector mins, vector maxs );

    void            OnWeaponSelected( entity p, float index );

    float            nextCollisionEffectTime;
}

void vehicle_hog::init() {
    setLightsEnabled( 0, false );
}

void vehicle_hog::OnCollision( object traceObject, float velocity, vector mins, vector maxs ) {
    OnCollision_Base( traceObject, velocity, mins, maxs );
}

void vehicle_hog::OnWeaponSelected( entity p, float index ) {
    if ( index == 0 ) {
        FireDecoy( p );
    } else if ( index == 1 ) {
        selectVehicleWeapon( p, "hyperblaster" );
    }
}

void vehicle_hog::vOnDeploy() {
    vector origin = getWorldOrigin();
    setWorldOrigin( origin + '0 0 32' );
    setLinearVelocity( vec3_origin );
}