ACTOR Karasawa : AOWWeapon 
{
    Weapon.BobSpeed 1.75
    Weapon.BobRangeX 0.2
    Weapon.BobRangeY 0.4
    Weapon.BobStyle Alpha
	+ALT_AMMO_OPTIONAL
    Inventory.PickupMessage "You got the 'Karasawa' High-Density Plasma Rifle!"
    Obituary "$OB_KARASAWA"
    Weapon.AmmoType "KarasawaAmmo"
    Weapon.AmmoType2 "KarasawaBurst"
    Weapon.AmmoGive 4
    Weapon.AmmoUse 1
    Weapon.AmmoUse2 1
    Weapon.KickBack 1000
    Weapon.SelectionOrder 5
    Weapon.UpSound "weapons/up/plasmagun"	
	Weapon.PreferredSkin "MarineKarasawa"
	States  
    {
    Spawn:
        KSWP A -1
        loop
    Select:
		TNT1 A 0 A_JumpIfInventory("IsBlue",1,"Select.Blue")
		KSWR A 1 offset (90,100)
		KSWR A 1 offset (80,89)
		KSWR A 1 offset (70,79)
		KSWR A 1 offset (60,70)
		KSWR A 1 offset (50,62)
		KSWR A 1 offset (40,55)
		KSWR A 1 offset (30,49)
		KSWR A 1 offset (20,44)
		KSWR A 1 offset (15,40)
		KSWR A 1 offset (10,37)
		KSWR A 1 offset (5,34)
		KSWR A 1 offset (0,0)
		TNT1 A 0 A_TakeInventory("SelectAnimation",1)
		goto ready
    Select.Blue:  
		KSWB A 1 offset (90,100)
		KSWB A 1 offset (80,89)
		KSWB A 1 offset (70,79)
		KSWB A 1 offset (60,70)
		KSWB A 1 offset (50,62)
		KSWB A 1 offset (40,55)
		KSWB A 1 offset (30,49)
		KSWB A 1 offset (20,44)
		KSWB A 1 offset (15,40)
		KSWB A 1 offset (10,37)
		KSWB A 1 offset (5,34)
		KSWB A 1 offset (0,0)
		TNT1 A 0 A_TakeInventory("SelectAnimation",1)
		goto ready
	Deselect:
		TNT1 A 0 A_TakeInventory("ActionFragGrenade",1)	
        TNT1 A 0 A_TakeInventory("ActionFlashbang",1)
        TNT1 A 0 A_TakeInventory("ActionRemoteC4",1)	
        TNT1 A 0 A_TakeInventory("ActionMeleeAttack",1)
		TNT1 A 0 A_TakeInventory("ActionReload",1)	
		TNT1 A 0 A_JumpIfInventory("IsBlue",1,"DeselectBlue")
		KSWR A 1 offset (-4,34)
		KSWR A 1 offset (-8,40)
		KSWR A 1 offset (-16,49)
		KSWR A 1 offset (-24,62)
		KSWR A 1 offset (-32,79)
		KSWR A 1 offset (-40,100)
		TNT1 A 0 offset (-1, 33)
		TNT1 A 0 A_Lower
		wait
	DeselectBlue:
		KSWB A 1 offset (-4,34)
		KSWB A 1 offset (-8,40)
		KSWB A 1 offset (-16,49)
		KSWB A 1 offset (-24,62)
		KSWB A 1 offset (-32,79)
		KSWB A 1 offset (-40,100)
		TNT1 A 0 offset (-1, 33)
		TNT1 A 0 A_Lower
		wait
	Ready:
	    TNT1 A 0 A_JumpIfInventory("SelectAnimation",1,"Select")
	    TNT1 A 0 A_JumpIfInventory("IsBlue",1,"Ready.Blue")
  	    TNT1 A 0 A_JumpIfInventory("KarasawaBurst",5,2)
        TNT1 A 0 A_JumpIfInventory("KarasawaAmmo",1,"AltReload")
		TNT1 A 0 A_JumpIfInventory("KarasawaMode1",1,"Ready2")
        KSAW A 0 A_PlaySound("Weapons/KsawIdle",0,1.0,0)
		TNT1 A 0 A_JumpIfInventory("ActionFragGrenade",1,"UseFragGrenade")
		TNT1 A 0 A_JumpIfInventory("ActionFlashbang",1,"UseFlashbang")
		TNT1 A 0 A_JumpIfInventory("ActionRemoteC4",1,"UseRemoteC4")
		TNT1 A 0 A_JumpIfInventory("ActionMeleeAttack",1,"UseMeleeAttack")
		TNT1 A 0 A_JumpIfInventory("ActionReload",1,"Reload")
        KSWR A 4 A_WeaponReady
		TNT1 A 0 A_JumpIfInventory("ActionFragGrenade",1,"UseFragGrenade")
		TNT1 A 0 A_JumpIfInventory("ActionFlashbang",1,"UseFlashbang")
		TNT1 A 0 A_JumpIfInventory("ActionRemoteC4",1,"UseRemoteC4")
		TNT1 A 0 A_JumpIfInventory("ActionMeleeAttack",1,"UseMeleeAttack")
		TNT1 A 0 A_JumpIfInventory("ActionReload",1,"Reload")
		KSWR B 4 A_WeaponReady
		TNT1 A 0 A_JumpIfInventory("ActionFragGrenade",1,"UseFragGrenade")
		TNT1 A 0 A_JumpIfInventory("ActionFlashbang",1,"UseFlashbang")
		TNT1 A 0 A_JumpIfInventory("ActionRemoteC4",1,"UseRemoteC4")
		TNT1 A 0 A_JumpIfInventory("ActionMeleeAttack",1,"UseMeleeAttack")
		TNT1 A 0 A_JumpIfInventory("ActionReload",1,"Reload")
		KSWR C 4 A_WeaponReady
		TNT1 A 0 A_JumpIfInventory("ActionFragGrenade",1,"UseFragGrenade")
		TNT1 A 0 A_JumpIfInventory("ActionFlashbang",1,"UseFlashbang")
		TNT1 A 0 A_JumpIfInventory("ActionRemoteC4",1,"UseRemoteC4")
		TNT1 A 0 A_JumpIfInventory("ActionMeleeAttack",1,"UseMeleeAttack")
		TNT1 A 0 A_JumpIfInventory("ActionReload",1,"Reload")
		KSWR B 4 A_WeaponReady
		Loop
	Ready.Blue:
  	    TNT1 A 0 A_JumpIfInventory("KarasawaBurst",5,2)
        TNT1 A 0 A_JumpIfInventory("KarasawaAmmo",1,"AltReloadBlue")
	    TNT1 A 0 A_JumpIfInventory("KarasawaMode1",1,"Ready2.Blue")
        TNT1 A 0 A_PlaySound("Weapons/KsawIdle",0,1.0,0)
		TNT1 A 0 A_JumpIfInventory("ActionFragGrenade",1,"UseFragGrenade")
		TNT1 A 0 A_JumpIfInventory("ActionFlashbang",1,"UseFlashbang")
		TNT1 A 0 A_JumpIfInventory("ActionRemoteC4",1,"UseRemoteC4")
		TNT1 A 0 A_JumpIfInventory("ActionMeleeAttack",1,"UseMeleeAttack")
		TNT1 A 0 A_JumpIfInventory("ActionReload",1,"Reload")
        KSWB A 4 A_WeaponReady
		TNT1 A 0 A_JumpIfInventory("ActionFragGrenade",1,"UseFragGrenade")
		TNT1 A 0 A_JumpIfInventory("ActionFlashbang",1,"UseFlashbang")
		TNT1 A 0 A_JumpIfInventory("ActionRemoteC4",1,"UseRemoteC4")
		TNT1 A 0 A_JumpIfInventory("ActionMeleeAttack",1,"UseMeleeAttack")
		TNT1 A 0 A_JumpIfInventory("ActionReload",1,"Reload")
		KSWB B 4 A_WeaponReady
		TNT1 A 0 A_JumpIfInventory("ActionFragGrenade",1,"UseFragGrenade")
		TNT1 A 0 A_JumpIfInventory("ActionFlashbang",1,"UseFlashbang")
		TNT1 A 0 A_JumpIfInventory("ActionRemoteC4",1,"UseRemoteC4")
		TNT1 A 0 A_JumpIfInventory("ActionMeleeAttack",1,"UseMeleeAttack")
		TNT1 A 0 A_JumpIfInventory("ActionReload",1,"Reload")
		KSWB C 4 A_WeaponReady
		TNT1 A 0 A_JumpIfInventory("ActionFragGrenade",1,"UseFragGrenade")
		TNT1 A 0 A_JumpIfInventory("ActionFlashbang",1,"UseFlashbang")
		TNT1 A 0 A_JumpIfInventory("ActionRemoteC4",1,"UseRemoteC4")
		TNT1 A 0 A_JumpIfInventory("ActionMeleeAttack",1,"UseMeleeAttack")
		TNT1 A 0 A_JumpIfInventory("ActionReload",1,"Reload")
		KSWB B 4 A_WeaponReady
		Loop
	Ready2:
		TNT1 A 0 A_JumpIfInventory("IsBlue",1,"Ready2.Blue")
	    KSAW A 0 A_PlaySound("Weapons/KsawIdle",0,1.0,0)
		TNT1 A 0 A_JumpIfInventory("ActionFragGrenade",1,"UseFragGrenade")
		TNT1 A 0 A_JumpIfInventory("ActionFlashbang",1,"UseFlashbang")
		TNT1 A 0 A_JumpIfInventory("ActionRemoteC4",1,"UseRemoteC4")
		TNT1 A 0 A_JumpIfInventory("ActionMeleeAttack",1,"UseMeleeAttack")
		TNT1 A 0 A_JumpIfInventory("ActionReload",1,"Reload")
        KSWR A 4 A_WeaponReady
		TNT1 A 0 A_JumpIfInventory("ActionFragGrenade",1,"UseFragGrenade")
		TNT1 A 0 A_JumpIfInventory("ActionFlashbang",1,"UseFlashbang")
		TNT1 A 0 A_JumpIfInventory("ActionRemoteC4",1,"UseRemoteC4")
		TNT1 A 0 A_JumpIfInventory("ActionMeleeAttack",1,"UseMeleeAttack")
		TNT1 A 0 A_JumpIfInventory("ActionReload",1,"Reload")
		KSWR BC 2 A_WeaponReady
		TNT1 A 0 A_JumpIfInventory("ActionFragGrenade",1,"UseFragGrenade")
		TNT1 A 0 A_JumpIfInventory("ActionFlashbang",1,"UseFlashbang")
		TNT1 A 0 A_JumpIfInventory("ActionRemoteC4",1,"UseRemoteC4")
		TNT1 A 0 A_JumpIfInventory("ActionMeleeAttack",1,"UseMeleeAttack")
		TNT1 A 0 A_JumpIfInventory("ActionReload",1,"Reload")
		KSWR AB 2 A_WeaponReady
		TNT1 A 0 A_JumpIfInventory("ActionFragGrenade",1,"UseFragGrenade")
		TNT1 A 0 A_JumpIfInventory("ActionFlashbang",1,"UseFlashbang")
		TNT1 A 0 A_JumpIfInventory("ActionRemoteC4",1,"UseRemoteC4")
		TNT1 A 0 A_JumpIfInventory("ActionMeleeAttack",1,"UseMeleeAttack")
		TNT1 A 0 A_JumpIfInventory("ActionReload",1,"Reload")
		KSWR CB 2 A_WeaponReady
		TNT1 A 0 A_JumpIfInventory("ActionFragGrenade",1,"UseFragGrenade")
		TNT1 A 0 A_JumpIfInventory("ActionFlashbang",1,"UseFlashbang")
		TNT1 A 0 A_JumpIfInventory("ActionRemoteC4",1,"UseRemoteC4")
		TNT1 A 0 A_JumpIfInventory("ActionMeleeAttack",1,"UseMeleeAttack")
		TNT1 A 0 A_JumpIfInventory("ActionReload",1,"Reload")
		KSWR A 4 A_WeaponReady
		Loop
	Ready2.Blue:
        TNT1 A 0 A_PlaySound("Weapons/KsawIdle",0,1.0,0)
		TNT1 A 0 A_JumpIfInventory("ActionFragGrenade",1,"UseFragGrenade")
		TNT1 A 0 A_JumpIfInventory("ActionFlashbang",1,"UseFlashbang")
		TNT1 A 0 A_JumpIfInventory("ActionRemoteC4",1,"UseRemoteC4")
		TNT1 A 0 A_JumpIfInventory("ActionMeleeAttack",1,"UseMeleeAttack")
		TNT1 A 0 A_JumpIfInventory("ActionReload",1,"Reload")
        KSWB A 4 A_WeaponReady
		TNT1 A 0 A_JumpIfInventory("ActionFragGrenade",1,"UseFragGrenade")
		TNT1 A 0 A_JumpIfInventory("ActionFlashbang",1,"UseFlashbang")
		TNT1 A 0 A_JumpIfInventory("ActionRemoteC4",1,"UseRemoteC4")
		TNT1 A 0 A_JumpIfInventory("ActionMeleeAttack",1,"UseMeleeAttack")
		TNT1 A 0 A_JumpIfInventory("ActionReload",1,"Reload")
		KSWB BC 2 A_WeaponReady
		TNT1 A 0 A_JumpIfInventory("ActionFragGrenade",1,"UseFragGrenade")
		TNT1 A 0 A_JumpIfInventory("ActionFlashbang",1,"UseFlashbang")
		TNT1 A 0 A_JumpIfInventory("ActionRemoteC4",1,"UseRemoteC4")
		TNT1 A 0 A_JumpIfInventory("ActionMeleeAttack",1,"UseMeleeAttack")
		TNT1 A 0 A_JumpIfInventory("ActionReload",1,"Reload")
		KSWB AB 2 A_WeaponReady
		TNT1 A 0 A_JumpIfInventory("ActionFragGrenade",1,"UseFragGrenade")
		TNT1 A 0 A_JumpIfInventory("ActionFlashbang",1,"UseFlashbang")
		TNT1 A 0 A_JumpIfInventory("ActionRemoteC4",1,"UseRemoteC4")
		TNT1 A 0 A_JumpIfInventory("ActionMeleeAttack",1,"UseMeleeAttack")
		TNT1 A 0 A_JumpIfInventory("ActionReload",1,"Reload")
		KSWB CB 2 A_WeaponReady
		TNT1 A 0 A_JumpIfInventory("ActionFragGrenade",1,"UseFragGrenade")
		TNT1 A 0 A_JumpIfInventory("ActionFlashbang",1,"UseFlashbang")
		TNT1 A 0 A_JumpIfInventory("ActionRemoteC4",1,"UseRemoteC4")
		TNT1 A 0 A_JumpIfInventory("ActionMeleeAttack",1,"UseMeleeAttack")
		TNT1 A 0 A_JumpIfInventory("ActionReload",1,"Reload")
		KSWB A 4 A_WeaponReady
		Loop
    Fire:
 	    TNT1 A 0 A_JumpIfInventory ("IsInSpawnRoom", 1, "Ready")
	    TNT1 A 0 A_JumpIfInventory ("InMenu", 1, "Ready")	
        TNT1 A 0 A_JumpIfInventory("IsBlue",1,"Fire.Blue")
		TNT1 A 0 A_JumpIfInventory("IsKarasawaSoldier",1,"FireClass")
        KSWR A 0 A_PlaySound("Weapons/KsawFire",5)
	    KSWR A 0 Radius_Quake(3,random(8,12),0,1,0)
	    KSWR D 1 Bright A_FireCustomMissile("KsawBoltWeak", 0, 1, 0, 0)
        KSWR E 1 Bright A_ZoomFactor(0.990)
		KSWR F 1 Bright A_ZoomFactor(0.980) 
		KSWR F 1 Bright A_ZoomFactor(0.975)  
		KSWR G 1 Bright A_ZoomFactor(0.980) 
		KSWR G 1 Bright A_ZoomFactor(0.985) 
		KSWR H 1 Bright A_ZoomFactor(0.990) 
		KSWR H 1 Bright A_ZoomFactor(1)
        KSWR I 0 Bright A_Light2
        KSWR I 0 A_PlaySoundEx("Weapons/KsawCharge", "SoundSlot7", 0)
        KSWR IA 4 A_Light1
        KSWR JKLMN 4
        KSWR A 0 A_Light0
        KSWR N 6
        goto Ready
    Fire.Blue: 
	    TNT1 A 0 A_JumpIfInventory("IsKarasawaSoldier",1,"FireClass.Blue")
        KSWB A 0 A_PlaySound("Weapons/KsawFire",5)
	    KSWB A 0 Radius_Quake(3,random(8,12),0,1,0)
	    KSWB D 1 Bright A_FireCustomMissile("KsawBoltBlueWeak", 0, 1, 0, 0)
        KSWB E 1 Bright A_ZoomFactor(0.990)
		KSWB F 1 Bright A_ZoomFactor(0.980) 
		KSWB F 1 Bright A_ZoomFactor(0.975)  
		KSWB G 1 Bright A_ZoomFactor(0.980) 
		KSWB G 1 Bright A_ZoomFactor(0.985) 
		KSWB H 1 Bright A_ZoomFactor(0.990) 
		KSWB H 1 Bright A_ZoomFactor(1)
        KSWB I 0 Bright A_Light2
        KSWB I 0 A_PlaySoundEx("Weapons/KsawCharge", "SoundSlot7", 0)
        KSWB IA 4 A_Light1
        KSWB JKLMN 4
        KSWB A 0 A_Light0
        KSWB N 6
        goto Ready
    FireClass:
        KSWR A 0 A_PlaySound("Weapons/KsawFire",5)
	    KSWR A 0 Radius_Quake(3,random(8,12),0,1,0)
	    KSWR D 1 Bright A_FireCustomMissile("KsawBolt", 0, 1, 0, 0)
        KSWR E 1 Bright A_ZoomFactor(0.990)
		KSWR F 1 Bright A_ZoomFactor(0.980) 
		KSWR F 1 Bright A_ZoomFactor(0.975)  
		KSWR G 1 Bright A_ZoomFactor(0.980) 
		KSWR G 1 Bright A_ZoomFactor(0.985) 
		KSWR H 1 Bright A_ZoomFactor(0.990) 
		KSWR H 1 Bright A_ZoomFactor(1)
        KSWR I 0 Bright A_Light2
        KSWR I 0 A_PlaySoundEx("Weapons/KsawCharge", "SoundSlot7", 0)
        KSWR IA 4 A_Light1
        KSWR JKLMN 4
        KSWR A 0 A_Light0
        KSWR N 6
        goto Ready
    FireClass.Blue: 
	    KSWB A 0 A_PlaySound("Weapons/KsawFire",5)
	    KSWB A 0 Radius_Quake(3,random(8,12),0,1,0)
	    KSWB D 1 Bright A_FireCustomMissile("KsawBoltBlue", 0, 1, 0, 0)
        KSWB E 1 Bright A_ZoomFactor(0.990)
		KSWB F 1 Bright A_ZoomFactor(0.980) 
		KSWB F 1 Bright A_ZoomFactor(0.975)  
		KSWB G 1 Bright A_ZoomFactor(0.980) 
		KSWB G 1 Bright A_ZoomFactor(0.985) 
		KSWB H 1 Bright A_ZoomFactor(0.990) 
		KSWB H 1 Bright A_ZoomFactor(1)
        KSWB I 0 Bright A_Light2
        KSWB I 0 A_PlaySoundEx("Weapons/KsawCharge", "SoundSlot7", 0)
        KSWB IA 4 A_Light1
        KSWB JKLMN 4
        KSWB A 0 A_Light0
        KSWB N 6
        goto Ready
    AltFire:
	    TNT1 A 0 A_JumpIfInventory ("IsInSpawnRoom", 1, "Ready")
	    TNT1 A 0 A_JumpIfInventory ("InMenu", 1, "Ready")   	
        TNT1 A 0 A_JumpIfInventory("IsBlue",1,"AltFire.Blue")
		TNT1 A 0 A_JumpIfInventory("KarasawaBurst",5,1)
	    Goto Empty
		TNT1 A 0 A_JumpIfInventory("KarasawaMode1",1,"AltfireClass")
	    KSWR A 0 A_PlaySound("Weapons/KsawFire",5)
	    KSWR A 0 Radius_Quake(2,random(4,6),0,1,0)
	    KSWR D 1 Bright A_FireCustomMissile("KsawBolt2", 0, 1, 0, 0)
        KSWR E 1 Bright A_ZoomFactor(0.995)
		KSWR F 1 Bright A_ZoomFactor(0.990) 
		KSWR G 1 Bright A_ZoomFactor(0.995)  
		KSWR H 1 Bright A_ZoomFactor(1) 
        KSWR H 0 A_Light2
		KSWR A 0 A_PlaySound("Weapons/KsawFire",5)
	    KSWR A 0 Radius_Quake(2,random(4,6),0,1,0)
	    KSWR D 1 Bright A_FireCustomMissile("KsawBolt2", 0, 1, 0, 0)
        KSWR E 1 Bright A_ZoomFactor(0.995)
		KSWR F 1 Bright A_ZoomFactor(0.990) 
		KSWR G 1 Bright A_ZoomFactor(0.995)  
		KSWR H 1 Bright A_ZoomFactor(1) 
        KSWR H 0 A_Light2
		KSWR A 0 A_PlaySound("Weapons/KsawFire",5)
	    KSWR A 0 Radius_Quake(2,random(4,6),0,1,0)
	    KSWR D 1 Bright A_FireCustomMissile("KsawBolt2", 0, 1, 0, 0)
        KSWR E 1 Bright A_ZoomFactor(0.995)
		KSWR F 1 Bright A_ZoomFactor(0.990) 
		KSWR G 1 Bright A_ZoomFactor(0.995)  
		KSWR H 1 Bright A_ZoomFactor(1) 
        KSWR H 0 A_Light2		
		KSWR A 0 A_PlaySound("Weapons/KsawFire",5)
	    KSWR A 0 Radius_Quake(2,random(4,6),0,1,0)
	    KSWR D 1 Bright A_FireCustomMissile("KsawBolt2", 0, 1, 0, 0)
        KSWR E 1 Bright A_ZoomFactor(0.995)
		KSWR F 1 Bright A_ZoomFactor(0.990) 
		KSWR G 1 Bright A_ZoomFactor(0.995)  
		KSWR H 1 Bright A_ZoomFactor(1) 
        KSWR H 0 A_Light2
	    KSWR A 0 A_PlaySound("Weapons/KsawFire",5)
	    KSWR A 0 Radius_Quake(2,random(4,6),0,1,0)
	    KSWR D 1 Bright A_FireCustomMissile("KsawBolt2", 0, 1, 0, 0)
        KSWR E 1 Bright A_ZoomFactor(0.995)
		KSWR F 1 Bright A_ZoomFactor(0.990) 
		KSWR G 1 Bright A_ZoomFactor(0.995)  
		KSWR H 1 Bright A_ZoomFactor(1)
		KSWR H 0 A_Light2
        KSWR I 0 A_PlaySoundEx("Weapons/KsawCharge", "SoundSlot7", 0)
        KSWR IA 8 A_Light1
        goto AltReload
    AltFire.Blue:
		TNT1 A 0 A_JumpIfInventory("KarasawaBurst",5,1)
	    Goto Empty.Blue
	    TNT1 A 0 A_JumpIfInventory("KarasawaMode1",1,"AltfireClass.Blue")
	    KSWB A 0 A_PlaySound("Weapons/KsawFire",5)
	    KSWB A 0 Radius_Quake(2,random(4,6),0,1,0)
	    KSWB D 1 Bright A_FireCustomMissile("KsawBolt2Blue", 0, 1, 0, 0)
        KSWB E 1 Bright A_ZoomFactor(0.995)
		KSWB F 1 Bright A_ZoomFactor(0.990) 
		KSWB G 1 Bright A_ZoomFactor(0.995)  
		KSWB H 1 Bright A_ZoomFactor(1) 
        KSWB H 0 Bright A_Light2
		KSWB A 0 A_PlaySound("Weapons/KsawFire",5)
	    KSWB A 0 Radius_Quake(2,random(4,6),0,1,0)
	    KSWB D 1 Bright A_FireCustomMissile("KsawBolt2Blue", 0, 1, 0, 0)
        KSWB E 1 Bright A_ZoomFactor(0.995)
		KSWB F 1 Bright A_ZoomFactor(0.990) 
		KSWB G 1 Bright A_ZoomFactor(0.995)  
		KSWB H 1 Bright A_ZoomFactor(1) 
        KSWB H 0 Bright A_Light2
		KSWB A 0 A_PlaySound("Weapons/KsawFire",5)
	    KSWB A 0 Radius_Quake(2,random(4,6),0,1,0)
	    KSWB D 1 Bright A_FireCustomMissile("KsawBolt2Blue", 0, 1, 0, 0)
        KSWB E 1 Bright A_ZoomFactor(0.995)
		KSWB F 1 Bright A_ZoomFactor(0.990) 
		KSWB G 1 Bright A_ZoomFactor(0.995)  
		KSWB H 1 Bright A_ZoomFactor(1) 
        KSWB H 0 Bright A_Light2
		KSWB A 0 A_PlaySound("Weapons/KsawFire",5)
	    KSWB A 0 Radius_Quake(2,random(4,6),0,1,0)
	    KSWB D 1 Bright A_FireCustomMissile("KsawBolt2Blue", 0, 1, 0, 0)
        KSWB E 1 Bright A_ZoomFactor(0.995)
		KSWB F 1 Bright A_ZoomFactor(0.990) 
		KSWB G 1 Bright A_ZoomFactor(0.995)  
		KSWB H 1 Bright A_ZoomFactor(1) 
        KSWB H 0 Bright A_Light2
		KSWB A 0 A_PlaySound("Weapons/KsawFire",5)
	    KSWB A 0 Radius_Quake(2,random(4,6),0,1,0)
	    KSWB D 1 Bright A_FireCustomMissile("KsawBolt2Blue", 0, 1, 0, 0)
        KSWB E 1 Bright A_ZoomFactor(0.995)
		KSWB F 1 Bright A_ZoomFactor(0.990) 
		KSWB G 1 Bright A_ZoomFactor(0.995)  
		KSWB H 1 Bright A_ZoomFactor(1) 
        KSWB H 0 Bright A_Light2
        KSWB I 0 A_PlaySoundEx("Weapons/KsawCharge", "SoundSlot7", 0)
        KSWB IA 8
        goto AltReloadBlue
    Empty:
        KSWR A 10 A_PlaySound ("Plasma/FailFire", 6)
		Goto Ready
    Empty.Blue:
        KSWB A 10 A_PlaySound ("Plasma/FailFire", 6)
		Goto Ready
    Reload:
        TNT1 A 0
	    TNT1 A 0 A_TakeInventory("ActionReload",1)
	    TNT1 A 0 A_JumpIfInventory("IsKarasawaSoldier",1,2)
	    Goto Ready
    ChangeMode:
        TNT1 A 0
		TNT1 A 0 A_JumpIfInventory("IsBlue",1,"ChangeMode.Blue") 
	    TNT1 A 0 A_JumpIfInventory("KarasawaMode1",1,"ChangeMode2")
	    TNT1 A 0 A_Print("Spread",1)
	    TNT1 A 0 A_GiveInventory("KarasawaMode1",1)
	    KSWR A 4 A_PlayWeaponSound("PlasmaCaster/Reload")
	    KSWR A 2 Offset(0,34)
	    KSWR A 2 Offset(0,37)
	    KSWR A 2 Offset(0,40)
        KSWR A 2 Offset(0,37)
	    KSWR A 2 Offset(0,34)
	    KSWR A 1
	    Goto Ready
    ChangeMode2:
	    TNT1 A 0 A_Print("Burst",1)
	    TNT1 A 0 A_TakeInventory("KarasawaMode1",1)
	    KSWR A 4 A_PlayWeaponSound("PlasmaCaster/Reload")
	    KSWR A 2 Offset(0,34)
	    KSWR A 2 Offset(0,37)
	    KSWR A 2 Offset(0,34)
        KSWR A 1
	    Goto Ready
    ChangeMode.Blue:
        TNT1 A 0
	    TNT1 A 0 A_JumpIfInventory("KarasawaMode1",1,"ChangeMode2.Blue")
	    TNT1 A 0 A_Print("Spread",1)
	    TNT1 A 0 A_GiveInventory("KarasawaMode1",1)
	    KSWB A 4 A_PlayWeaponSound("PlasmaCaster/Reload")
	    KSWB A 2 Offset(0,34)
	    KSWB A 2 Offset(0,37)
	    KSWB A 2 Offset(0,40)
        KSWB A 2 Offset(0,37)
	    KSWB A 2 Offset(0,34)
	    KSWB A 1
	    Goto Ready
    ChangeMode2.Blue:
	    TNT1 A 0 A_Print("Burst",1)
	    TNT1 A 0 A_TakeInventory("KarasawaMode1",1)
	    KSWB A 4 A_PlayWeaponSound("PlasmaCaster/Reload")
	    KSWB A 2 Offset(0,34)
	    KSWB A 2 Offset(0,37)
	    KSWB A 2 Offset(0,34)
        KSWB A 1
	    Goto Ready
    AltfireClass:
        TNT1 A 0 A_PlaySound("PlasmaCaster/Full")
	    TNT1 A 0 A_PlaySound("Weapons/KsawCharge",5)
        KSWR DE 3 Bright A_Light1
        KSWR F 3 Bright A_Light2
	    TNT1 A 0 A_PlayWeaponSound("Weapons/KsawFire")
	    TNT1 A 0 A_FireCustomMissile("KsawBolt2",-8 ,0, -1, 0, 0, 0)
	    TNT1 A 0 A_FireCustomMissile("KsawBolt2",-2, 0, -1, 0, 0, -2)
		TNT1 A 0 A_FireCustomMissile("KsawBolt2",-2, 0, -1, 0, 0, +2)
	    TNT1 A 0 A_FireCustomMissile("KsawBolt2",+8, 0, -1, 0, 0, 0)
		TNT1 A 0 A_FireCustomMissile("KsawBolt2",+2, 0, -1, 0, 0, -2)
	    TNT1 A 0 A_FireCustomMissile("KsawBolt2",+2, 0, -1, 0, 0, +2)
	    TNT1 A 0 A_Takeinventory("KarasawaBurst",5)
        KSWR GH 3 Bright A_Light2
	    TNT1 A 0 A_PlaySound("PlasmaCaster/Reload",5)
        KSWR IA 8 A_Light1
        goto AltReload
    AltfireClass.Blue:
        TNT1 A 0 A_PlaySound("PlasmaCaster/Full")
	    TNT1 A 0 A_PlaySound("Weapons/KsawCharge",5)
        KSWB DE 3 Bright A_Light1
        KSWB F 3 Bright A_Light2
	    TNT1 A 0 A_PlayWeaponSound("Weapons/KsawFire")
	    TNT1 A 0 A_FireCustomMissile("KsawBolt2Blue",-8 ,0, -1, 0, 0, 0)
	    TNT1 A 0 A_FireCustomMissile("KsawBolt2Blue",-2, 0, -1, 0, 0, -2)
		TNT1 A 0 A_FireCustomMissile("KsawBolt2Blue",-2, 0, -1, 0, 0, +2)
	    TNT1 A 0 A_FireCustomMissile("KsawBolt2Blue",+8, 0, -1, 0, 0, 0)
		TNT1 A 0 A_FireCustomMissile("KsawBolt2Blue",+2, 0, -1, 0, 0, -2)
	    TNT1 A 0 A_FireCustomMissile("KsawBolt2Blue",+2, 0, -1, 0, 0, +2)
	    TNT1 A 0 A_Takeinventory("KarasawaBurst",5)
        KSWB GH 3 Bright A_Light2
		TNT1 A 0 A_PlaySound("PlasmaCaster/Reload",5)
        KSWB IA 8 A_Light1
		goto AltReloadBlue
	AltReload:
        TNT1 A 0 A_JumpIfInventory("KarasawaBurst",4,"AltReload5")
		TNT1 A 0 A_JumpIfInventory("KarasawaBurst",3,"AltReload4")
		TNT1 A 0 A_JumpIfInventory("KarasawaBurst",2,"AltReload3")
		TNT1 A 0 A_JumpIfInventory("KarasawaBurst",1,"AltReload2")
		TNT1 A 0 A_JumpIfInventory("ActionFragGrenade",1,"UseFragGrenade")
		TNT1 A 0 A_JumpIfInventory("ActionFlashbang",1,"UseFlashbang")
		TNT1 A 0 A_JumpIfInventory("ActionRemoteC4",1,"UseRemoteC4")
		TNT1 A 0 A_JumpIfInventory("ActionMeleeAttack",1,"UseMeleeAttack")
		TNT1 A 0 A_JumpIfInventory("ActionReload",1,"Reload")		
	    KSWR J 8 A_WeaponReady		
		TNT1 A 0 A_JumpIfInventory("KarasawaAmmo",1,2)
		TNT1 A 0
		goto Ready
		TNT1 A 0 A_TakeInventory("KarasawaAmmo",1)
		TNT1 A 0 A_GiveInventory("KarasawaBurst",1)
		goto AltReload2
	AltReload2:
		TNT1 A 0 A_JumpIfInventory("ActionFragGrenade",1,"UseFragGrenade")
		TNT1 A 0 A_JumpIfInventory("ActionFlashbang",1,"UseFlashbang")
		TNT1 A 0 A_JumpIfInventory("ActionRemoteC4",1,"UseRemoteC4")
		TNT1 A 0 A_JumpIfInventory("ActionMeleeAttack",1,"UseMeleeAttack")
		TNT1 A 0 A_JumpIfInventory("ActionReload",1,"Reload")
	    KSWR K 8 A_WeaponReady		
		TNT1 A 0 A_JumpIfInventory("KarasawaAmmo",1,2)
		TNT1 A 0
		goto Ready
		TNT1 A 0 A_TakeInventory("KarasawaAmmo",1)
		TNT1 A 0 A_GiveInventory("KarasawaBurst",1)
		goto AltReload3
	AltReload3:
		TNT1 A 0 A_JumpIfInventory("ActionFragGrenade",1,"UseFragGrenade")
		TNT1 A 0 A_JumpIfInventory("ActionFlashbang",1,"UseFlashbang")
		TNT1 A 0 A_JumpIfInventory("ActionRemoteC4",1,"UseRemoteC4")
		TNT1 A 0 A_JumpIfInventory("ActionMeleeAttack",1,"UseMeleeAttack")
		TNT1 A 0 A_JumpIfInventory("ActionReload",1,"Reload")
	    KSWR L 8 A_WeaponReady		
		TNT1 A 0 A_JumpIfInventory("KarasawaAmmo",1,2)
		TNT1 A 0
		goto Ready
		TNT1 A 0 A_TakeInventory("KarasawaAmmo",1)
		TNT1 A 0 A_GiveInventory("KarasawaBurst",1)
		goto AltReload4
	AltReload4:
		TNT1 A 0 A_JumpIfInventory("ActionFragGrenade",1,"UseFragGrenade")
		TNT1 A 0 A_JumpIfInventory("ActionFlashbang",1,"UseFlashbang")
		TNT1 A 0 A_JumpIfInventory("ActionRemoteC4",1,"UseRemoteC4")
		TNT1 A 0 A_JumpIfInventory("ActionMeleeAttack",1,"UseMeleeAttack")
		TNT1 A 0 A_JumpIfInventory("ActionReload",1,"Reload")
	    KSWR M 8 A_WeaponReady		
		TNT1 A 0 A_JumpIfInventory("KarasawaAmmo",1,2)
		TNT1 A 0
		goto Ready
		TNT1 A 0 A_TakeInventory("KarasawaAmmo",1)
		TNT1 A 0 A_GiveInventory("KarasawaBurst",1)
		goto AltReload5
	AltReload5:
		TNT1 A 0 A_JumpIfInventory("ActionFragGrenade",1,"UseFragGrenade")
		TNT1 A 0 A_JumpIfInventory("ActionFlashbang",1,"UseFlashbang")
		TNT1 A 0 A_JumpIfInventory("ActionRemoteC4",1,"UseRemoteC4")
		TNT1 A 0 A_JumpIfInventory("ActionMeleeAttack",1,"UseMeleeAttack")
		TNT1 A 0 A_JumpIfInventory("ActionReload",1,"Reload")
	    KSWR N 8 A_WeaponReady		
		TNT1 A 0 A_JumpIfInventory("KarasawaAmmo",1,2)
		TNT1 A 0
		goto Ready
		TNT1 A 0 A_TakeInventory("KarasawaAmmo",1)
		TNT1 A 0 A_GiveInventory("KarasawaBurst",1)
		KSWR N 12
		goto Ready
	AltReloadBlue:
        TNT1 A 0 A_JumpIfInventory("KarasawaBurst",4,"AltReload5Blue")
		TNT1 A 0 A_JumpIfInventory("KarasawaBurst",3,"AltReload4Blue")
		TNT1 A 0 A_JumpIfInventory("KarasawaBurst",2,"AltReload3Blue")
		TNT1 A 0 A_JumpIfInventory("KarasawaBurst",1,"AltReload2Blue")
		TNT1 A 0 A_JumpIfInventory("ActionFragGrenade",1,"UseFragGrenade")
		TNT1 A 0 A_JumpIfInventory("ActionFlashbang",1,"UseFlashbang")
		TNT1 A 0 A_JumpIfInventory("ActionRemoteC4",1,"UseRemoteC4")
		TNT1 A 0 A_JumpIfInventory("ActionMeleeAttack",1,"UseMeleeAttack")
		TNT1 A 0 A_JumpIfInventory("ActionReload",1,"Reload")		
	    KSWB J 8 A_WeaponReady		
		TNT1 A 0 A_JumpIfInventory("KarasawaAmmo",1,2)
		TNT1 A 0
		goto Ready
		TNT1 A 0 A_TakeInventory("KarasawaAmmo",1)
		TNT1 A 0 A_GiveInventory("KarasawaBurst",1)
		goto AltReload2Blue
	AltReload2Blue:
		TNT1 A 0 A_JumpIfInventory("ActionFragGrenade",1,"UseFragGrenade")
		TNT1 A 0 A_JumpIfInventory("ActionFlashbang",1,"UseFlashbang")
		TNT1 A 0 A_JumpIfInventory("ActionRemoteC4",1,"UseRemoteC4")
		TNT1 A 0 A_JumpIfInventory("ActionMeleeAttack",1,"UseMeleeAttack")
		TNT1 A 0 A_JumpIfInventory("ActionReload",1,"Reload")
	    KSWB K 8 A_WeaponReady		
		TNT1 A 0 A_JumpIfInventory("KarasawaAmmo",1,2)
		TNT1 A 0
		goto Ready
		TNT1 A 0 A_TakeInventory("KarasawaAmmo",1)
		TNT1 A 0 A_GiveInventory("KarasawaBurst",1)
		goto AltReload3Blue
	AltReload3Blue:
		TNT1 A 0 A_JumpIfInventory("ActionFragGrenade",1,"UseFragGrenade")
		TNT1 A 0 A_JumpIfInventory("ActionFlashbang",1,"UseFlashbang")
		TNT1 A 0 A_JumpIfInventory("ActionRemoteC4",1,"UseRemoteC4")
		TNT1 A 0 A_JumpIfInventory("ActionMeleeAttack",1,"UseMeleeAttack")
		TNT1 A 0 A_JumpIfInventory("ActionReload",1,"Reload")
	    KSWB L 8 A_WeaponReady		
		TNT1 A 0 A_JumpIfInventory("KarasawaAmmo",1,2)
		TNT1 A 0
		goto Ready
		TNT1 A 0 A_TakeInventory("KarasawaAmmo",1)
		TNT1 A 0 A_GiveInventory("KarasawaBurst",1)
		goto AltReload4Blue
	AltReload4Blue:
		TNT1 A 0 A_JumpIfInventory("ActionFragGrenade",1,"UseFragGrenade")
		TNT1 A 0 A_JumpIfInventory("ActionFlashbang",1,"UseFlashbang")
		TNT1 A 0 A_JumpIfInventory("ActionRemoteC4",1,"UseRemoteC4")
		TNT1 A 0 A_JumpIfInventory("ActionMeleeAttack",1,"UseMeleeAttack")
		TNT1 A 0 A_JumpIfInventory("ActionReload",1,"Reload")
	    KSWB M 8 A_WeaponReady		
		TNT1 A 0 A_JumpIfInventory("KarasawaAmmo",1,2)
		TNT1 A 0
		goto Ready
		TNT1 A 0 A_TakeInventory("KarasawaAmmo",1)
		TNT1 A 0 A_GiveInventory("KarasawaBurst",1)
		goto AltReload5Blue
	AltReload5Blue:
		TNT1 A 0 A_JumpIfInventory("ActionFragGrenade",1,"UseFragGrenade")
		TNT1 A 0 A_JumpIfInventory("ActionFlashbang",1,"UseFlashbang")
		TNT1 A 0 A_JumpIfInventory("ActionRemoteC4",1,"UseRemoteC4")
		TNT1 A 0 A_JumpIfInventory("ActionMeleeAttack",1,"UseMeleeAttack")
		TNT1 A 0 A_JumpIfInventory("ActionReload",1,"Reload")
	    KSWB N 8 A_WeaponReady		
		TNT1 A 0 A_JumpIfInventory("KarasawaAmmo",1,2)
		TNT1 A 0
		goto Ready
		TNT1 A 0 A_TakeInventory("KarasawaAmmo",1)
		TNT1 A 0 A_GiveInventory("KarasawaBurst",1)
		KSWB N 12
		goto Ready
  }
}

//==============================================================================

Actor KsawBolt
{
    Projectile
    +Ripper
    +BloodSplatter
    +StrifeDamage
    +HexenBounce
    +CanBounceWater
    +SkyExplode
    DamageType "Energy"
    BounceFactor 1.2
    Radius 6
    Height 4
    Speed 80
    Damage (40)
	ReactionTime 25
    bouncecount 5
    Alpha 1.0
    XScale 1.5
    YScale 0.4
    RenderStyle Add
    SeeSound "Weapons/KsawShock"
    DeathSound "Weapons/KsawHit"
	States
	{
	Spawn:
      KSPR ABCD 1 Bright A_SpawnItemEx("BoltBlur", 0, 0, 0, 1, 0, 0, 180, 128)
	  TNT1 A 0 A_Countdown
	  loop
	Death:
      TNT1 A 0
	  TNT1 A 0 A_SpawnItemEx("KsawBoltFX")
	  KSDR ABCDEF 2 Bright
	  Stop
	}
}

Actor KsawBoltBlue : KsawBolt
{
	States
	{
	Spawn:
      KSPB ABCD 1 Bright A_SpawnItemEx("BoltBlurBlue", 0, 0, 0, 1, 0, 0, 180, 128)
	  TNT1 A 0 A_Countdown
	  loop
	Death:
      TNT1 A 0
	  TNT1 A 0 A_SpawnItemEx("KsawBoltFXBlue")
	  KSDB ABCDEF 2 Bright
	  Stop
	}
}

Actor KsawBoltWeak : KsawBolt {bouncecount 3}
Actor KsawBoltBlueWeak : KsawBoltBlue {bouncecount 3}

Actor KsawBolt2
{
   Projectile
   +Ripper
   +BloodSplatter
   +StrifeDamage
   +SkyExplode
   DamageType "Energy"
   Radius 6
   Height 4
   Speed 80
   Damage (25)
   ReactionTime 25
   Alpha 1.0
   XScale 1.5
   YScale 0.4
   RenderStyle Add
   SeeSound ""
   DeathSound "Weapons/KsawHit"
   States {
   Spawn:
      KSPR ABCD 1 Bright A_SpawnItemEx("BoltBlur", 0, 0, 0, 1, 0, 0, 180, 128)
	  TNT1 A 0 A_Countdown
	  loop
   Death:
      TNT1 A 0
	  TNT1 A 0 A_SpawnItemEx("KsawBoltFX")
	  KSDR ABCDEF 2 Bright
	  Stop
  }
}

Actor KsawBolt2Blue : KsawBolt2
{
   States {
   Spawn:
      KSPB ABCD 1 Bright A_SpawnItemEx("BoltBlurBlue", 0, 0, 0, 1, 0, 0, 180, 128)
	  TNT1 A 0 A_Countdown
	  loop
   Death:
      TNT1 A 0
	  TNT1 A 0 A_SpawnItemEx("KsawBoltFXBlue")
	  KSDB ABCDEF 2 Bright
	  Stop
  }
}

Actor KsawBoltFX
{
	+CLIENTSIDEONLY
	+NOINTERACTION
	+NOBLOCKMAP
	+NOCLIP
	
	States
	{
		Spawn:
			TNT1 A 0
			TNT1 A 0 A_SpawnItemEx("KsawFlare")
			TNT1 AAAAAAAAAAAAAAAA 0 A_CustomMissile("KsawParticle", 0, 0, Random(-360, 360), 2, Random(16, 88))
			Stop
	}
}

Actor KsawBoltFXBlue : KsawBoltFX
{
	States
	{
		Spawn:
			TNT1 A 0
			TNT1 A 0 A_SpawnItemEx("KsawFlareBlue")
			TNT1 AAAAAAAAAAAAAAAA 0 A_CustomMissile("KsawParticleBlue", 0, 0, Random(-360, 360), 2, Random(16, 88))
			Stop
	}
}

Actor KsawFlare
{
	+CLIENTSIDEONLY
	+NOINTERACTION
	+NOBLOCKMAP
	+NOCLIP
	+FORCEXYBILLBOARD
	RenderStyle Add
	Alpha 1.0
	Scale 0.1
	States
	{
		Spawn:
			TNT1 A 0
			FLAR A 1 Bright A_FadeOut(0.05)
			Wait
	}
}

Actor KsawFlareBlue : KsawFlare
{
	States
	{
		Spawn:
			TNT1 A 0
			FBLU A 1 Bright A_FadeOut(0.05)
			Wait
	}
}

Actor BoltBlur
{
	+NOINTERACTION
	+NOBLOCKMAP
	+CLIENTSIDEONLY
	+FORCEXYBILLBOARD
	RenderStyle Add
	Alpha 0.9
	XScale 1.3
	YScale 0.3
	states
	{
		Spawn:
			KSBR AB 1 Bright A_FadeOut(0.05)
			Loop
	}
}

Actor BoltBlurBlue : BoltBlur
{
	states
	{
		Spawn:
			KSBB AB 1 Bright A_FadeOut(0.05)
			Loop
	}
}

Actor KsawParticle
{
	+MISSILE
	+CLIENTSIDEONLY
	+NOBLOCKMAP
	+FORCEXYBILLBOARD
	+CANBOUNCEWATER
	+DONTSPLASH
	+BOUNCEONACTORS
	+DOOMBOUNCE
	+THRUACTORS
	+THRUGHOST
	
	Speed 8
	Radius 0
	Height 0
	Renderstyle Add
	Alpha 1.0
	Gravity 0.6
	Scale 0.1
	BounceFactor 0.25
	
	States
	{
		Spawn:
			LR_E A 1 Bright A_FadeOut(0.01)
			Loop
	}
}

Actor KsawParticleBlue : KsawParticle
{
	States
	{
		Spawn:
			LC_E A 1 Bright A_FadeOut(0.01)
			Loop
	}
}

actor KarasawaBurst : Ammo {
	+IGNORESKILL
	inventory.amount 5
	inventory.maxamount 5
	ammo.backpackamount 5
	ammo.backpackmaxamount 5
}

ACTOR KarasawaMode1 : Inventory {Inventory.MaxAmount 1}