class Splasher expands MHPickups;

#exec MESH IMPORT MESH=Splasher ANIVFILE=MODELS\Splasher_a.3d DATAFILE=MODELS\Splasher_d.3d X=0 Y=0 Z=0
//#exec MESH LODPARAMS MESH=Splasher STRENGTH=0
#exec MESH ORIGIN MESH=Splasher X=0 Y=0 Z=0

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

#exec MESHMAP NEW MESHMAP=Splasher MESH=Splasher
#exec MESHMAP SCALE MESHMAP=Splasher X=0.015 Y=0.015 Z=0.03

#exec TEXTURE IMPORT NAME=Splasher_EnvMap FILE=Skins\Splasher_EnvMap.bmp GROUP=Skins FLAGS=2
#exec MESHMAP SETTEXTURE MESHMAP=Splasher NUM=1 TEXTURE=Splasher_EnvMap


auto state Pickup
{   
    function Touch( actor Other )
    {
        local Pawn P;
	local float N, M;
	local int i;
            
        if ( ValidTouch(Other) ) 
        {   
		P = Pawn(Other);

		if (Level.Game.LocalLog != None)
			Level.Game.LocalLog.LogPickup(Self, P);
		if (Level.Game.WorldLog != None)
			Level.Game.WorldLog.LogPickup(Self, P);

		
		if( P.Weapon.IsA('NaliWeapons') && !NaliWeapons(P.Weapon).bMegaWeapon)
		{
			if (!NaliWeapons(P.Weapon).bTheOne)
			{
				//Reset/cancel other properties
				NaliWeapons(P.Weapon).bInfinity = False;
				NaliWeapons(P.Weapon).KickBack = 0;
				NaliWeapons(P.Weapon).HealthGiver = False;
				NaliWeapons(P.Weapon).FireRateChange = 1;
				NaliWeapons(P.Weapon).MoreDamage = 0;
				NaliWeapons(P.Weapon).OV.Destroy();
				NaliWeapons(P.Weapon).OV = None;
				
				//Activate new modified weapon
				N = Rand(1) + 2;
				M = Rand(10);
				NaliWeapons(P.Weapon).Splasher = N + (M/10);
				NaliWeapons(P.Weapon).Overlayer = NaliWeapons(P.Weapon).StockOverlayers[4];
				NaliWeapons(P.Weapon).SpecialHUD[0] = Texture'Splasher_HUD';
				NaliWeapons(P.Weapon).SpecialInfo[0] = "Splasher " $ Int(N) $ "." $ Int(M) $ "X";
				NaliWeapons(P.Weapon).CurrentModFX = NaliWeapons(P.Weapon).FXYellow;
				NaliWeapons(P.Weapon).SetTranslucentWeapon();
			}
			else if (!NaliWeapons(P.Weapon).bMegaWeapon)
			{
				For (i=0; i<3; i++)
				{
					if (NaliWeapons(P.Weapon).SpecialHUD[i] == Texture'Splasher_HUD')
						break;
					else if (NaliWeapons(P.Weapon).SpecialHUD[i] == None)
					{
						N = Rand(1) + 2;
						M = Rand(10);
						NaliWeapons(P.Weapon).Splasher = N + (M/10);
						NaliWeapons(P.Weapon).SpecialHUD[0] = Texture'Splasher_HUD';
						NaliWeapons(P.Weapon).SpecialInfo[0] = "Splasher " $ Int(N) $ "." $ Int(M) $ "X";
						break;
					}
				}
						
			}
		}

                PlayPickupMessage(P);
                PlaySound (PickupSound,,2.5);
                Other.MakeNoise(0.2);       
                SetRespawn();
        }
    }
}


defaultproperties
{
	DrawType=DT_Mesh
	Mesh=Splasher
	PickupViewMesh=Splasher
	ItemName="Splasher Modifier"
	PickupMessage="You picked up Splasher Modifier."
	Texture=Splasher_EnvMap
	Bloom(0)=Class'N_Bloom_Splasher'
	Bloom(1)=Class'N_FX_Splasher'
	LightBrightness=100
	LightHue=42
	LightSaturation=128
	LightRadius=4
	LightType=LT_Steady
}
