class NeoXInvisibility expands UT_Invisibility;

#exec MESH IMPORT MESH=NeoXInvisibility ANIVFILE=MODELS\NeoXInvisibility_a.3d DATAFILE=MODELS\NeoXInvisibility_d.3d X=0 Y=0 Z=0
#exec MESH LODPARAMS MESH=NeoXInvisibility STRENGTH=0
#exec MESH ORIGIN MESH=NeoXInvisibility X=0 Y=0 Z=0 YAW=64

#exec MESH SEQUENCE MESH=NeoXInvisibility SEQ=All STARTFRAME=0 NUMFRAMES=1
#exec MESH SEQUENCE MESH=NeoXInvisibility SEQ=Still STARTFRAME=0 NUMFRAMES=1

#exec MESHMAP NEW MESHMAP=NeoXInvisibility MESH=NeoXInvisibility
#exec MESHMAP SCALE MESHMAP=NeoXInvisibility X=0.035 Y=0.035 Z=0.07

#exec AUDIO IMPORT NAME="NeoXInvisible" FILE=SOUNDS\NeoXInvisible.wav GROUP="NeoXPickups"

simulated function PostBeginPlay()
{
	Super.PostBeginPlay();
	SpawnOv();
	LODBias = Class'NWMutator'.default.PickupsDistDetail * 8/255;
}

simulated function SpawnOv()
{
	Spawn(Class'NeoXInvisCenter', Self);
	Spawn(Class'NeoXInvisCorona', Self);
}

state Activated
{
    function endstate()
    {
        local Inventory S;

        bActive = false;        
        PlaySound(DeActivateSound);

        Owner.SetDefaultDisplayProperties();
        S = Pawn(Owner).FindInventoryType(class'UT_ShieldBelt');
        if ( (S != None) && (UT_Shieldbelt(S).MyEffect != None) )
            UT_Shieldbelt(S).MyEffect.bHidden = false;
    }

	function ChangedWeapon()
    {
        if ( !bActive )
            return;
        if( Inventory != None )
            Inventory.ChangedWeapon();

        // Make new weapon invisible.
        if ( Pawn(Owner).Weapon != None && !Pawn(Owner).Weapon.IsA('NaliWeapons'))
            Pawn(Owner).Weapon.SetDisplayProperties(ERenderStyle.STY_Translucent, 
                                     FireTexture'Unrealshare.Belt_fx.Invis',
                                     true,
                                     true);
    }


    function BeginState()
    {
        local Inventory S;

        bActive = true;
        PlaySound(ActivateSound,,4.0);

        Owner.SetDisplayProperties(ERenderStyle.STY_Translucent, 
                                   FireTexture'unrealshare.Belt_fx.Invis',
                                   false,
                                   true);
        SetTimer(0.5,True);
        S = Pawn(Owner).FindInventoryType(class'UT_ShieldBelt');
        if ( (S != None) && (UT_Shieldbelt(S).MyEffect != None) )
            UT_Shieldbelt(S).MyEffect.bHidden = true;
    }
}



defaultproperties
{
	PickupMessage="You have NeoX Invisibility."
	DrawType=DT_Mesh
	Mesh=NeoXInvisibility
	bMeshEnviroMap=True
	Texture=Sk_Vulcan_02
	ActivateSound=NeoXInvisible
	PickupViewMesh=NeoXInvisibility
	bRotatingPickup=True
}
