actor DiveSonarWep_NormalBar : NormalBar { args 4, 198 }

actor DiveSonarWep : BaseMM8BDMWep
{
Weapon.AmmoUse 1
Weapon.AmmoGive 28
Weapon.SlotNumber 6
Inventory.Pickupmessage "$PU_DIVESONAR"
Obituary "$OB_DIVESONAR"
Tag "$TAG_DIVESONAR"
weapon.ammotype "DiveSonarAmmo"
inventory.icon "XTR0WI_J"
States
{
SpawnLoop:
XWI0 J -1
loop

Deselect:
XH0J A 0
goto DeselectSwap
Select:
XH0J A 0
goto SelectSwap

Ready:
XH0J A 0 ACS_NamedExecuteWithResult("core_weaponcolor",DYE_DIVESONAR)
XH0J A 1 A_WeaponReady
wait

Fire:
XH0J A 0 A_JumpIfNoAmmo("NoAmmo")
XH0J B 6 A_FireCustomMissile("DiveSonar",0,1,8,0)
XH0J C 6
XH0J A 34
XH0J A 0 A_Refire
Goto Ready+1
NoAmmo:
XH0J A 1 ACS_NamedExecuteAlways("core_noammo",0)
Goto Ready+1
}
}

actor DiveSonarAmmo : Ammo
{
inventory.amount 1
inventory.maxamount 28
+INVENTORY.IGNORESKILL
}

actor PowerDiveSonarLockon : Powerup
{
powerup.duration -7
+INVENTORY.ALWAYSPICKUP
}


actor DiveSonarProtect : PowerProtection
{
Powerup.Duration 11
DamageFactor "DiveSonar", 0.0
}

actor DiveSonar : ProjSpawnFuncActor
{
var int user_TranslateWhiteColors;
PROJECTILE
damagetype "DiveSonar"
Obituary "$OB_DIVESONAR"
+NOINTERACTION
+THRUACTORS
+DONTBLAST
+DONTREFLECT
+FORCEXYBILLBOARD
+BRIGHT
renderstyle none
reactiontime 10
Damage (0)
radius 2
height 2
Speed 50
xscale 0.6
yscale 0.6
states
{
Spawn:
TNT1 A 0
TNT1 A 0 A_PlaySoundEx("weapon/divesonar","Voice",1)
Air:
XH0J S 0 A_CountDown
XH0J S 0 A_Explode(160+CallACS("core_checkrune",RUNE_SPREAD,2)*160,32*scalex,0,0,12*scalex)
XH0J S 0 ACS_NamedExecuteAlways("cbm_divesonardetect",0,(32 * scalex) + 20)
XH0J S 0 A_SpawnITemEx("DiveSonarFX",0,0,0,0,0,0,0,1+SXF_TRANSFERSCALE)//16384
XH0J SS 1 A_SetScale(scalex+0.3, scaley+0.3)
loop
}
}

actor DiveSonarFX : BasicGraphicEffect
{
var int user_TranslateWhiteColors;
+FORCEXYBILLBOARD
+BRIGHT
states
{
SpawnFrame:
XH0J T 1 A_FadeOut(0.02)
loop
}
}

