Actor Karabine98:Weapon 
{
Weapon.AmmoUse1 0
Weapon.AmmoUse2 0
Weapon.AmmoGive1 3
Weapon.AmmoGive2 0
Weapon.AmmoType1 "MauserClip"
Weapon.AmmoType2 "KarabineAmmo"
Inventory.PickUpMessage "Rifle K98"
Weapon.BobRangeX 0.75
Weapon.BobRangeY 0.5
Weapon.BobSpeed 1.5
Weapon.BobStyle "InverseAlpha" //Denis Belmondo's Bobstyle
Inventory.PickUpSound "MP40_Take"
AttackSound "None"
+WEAPON.NOALERT
+WEAPON.NOAUTOAIM
+WEAPON.NOAUTOFIRE
Tag "Rifle K98"
Inventory.Icon "KARBACK"
States
{
Ready:
TNT1 A 0 A_PlaySound("Deploy/kar98")
ZK9S ABCDEFGHI 1 
Goto RealReady

RealReady:
ZK9G A 1 A_WeaponReady
TNT1 A 0 A_SetCrosshair(0)
TNT1 A 0 A_JumpIfInventory("Kicking",1,"DoKick")
TNT1 A 0 A_JumpIfInventory("Taunting",1,"Taunt")
TNT1 A 0 A_JumpIfInventory("BWgrenade",1,"LaunchGrenade")
TNT1 A 0 A_JumpIfInventory("Meleeattack",1,"KnifeAttack")
TNT1 A 0 A_JumpIfInventory("Reloading",1,"Reload")
Loop

Ready2:
ZK92 A 1 A_WeaponReady
TNT1 A 0 A_SetCrosshair(5)
TNT1 A 0 A_JumpIfInventory("Kicking",1,"DoKick")
TNT1 A 0 A_JumpIfInventory("Taunting",1,"Taunt")
TNT1 A 0 A_JumpIfInventory("BWgrenade",1,"LaunchGrenade")
TNT1 A 0 A_JumpIfInventory("Meleeattack",1,"KnifeAttack")
TNT1 A 0 A_JumpIfInventory("Reloading",1,"Reload")
Loop

Deselect:
TNT1 A 0 A_Takeinventory("Zoomed",1)
TNT1 A 0 A_Takeinventory("ADSmode",1)
TNT1 A 0 A_Takeinventory("Meleeattack",1)
TNT1 A 0 A_Takeinventory("BWgrenade",1)
TNT1 A 0 A_Takeinventory("Reloading",1)
TNT1 A 0 A_ZoomFactor(1.0)
ZK9S IHGFEDCBA 1 
TNT1 A 0 A_Lower
Wait

Select:
TNT1 A 0 A_Raise
Wait

FIRE:
TNT1 A 0 A_Takeinventory("Reloading",1)
TNT1 A 0 A_JumpIfInventory("Zoomed",1,"Fire2")
TNT1 A 0 A_JumpIfInventory("karabineAmmo",1,1)
Goto Reload
TNT1 AAAA 0
TNT1 A 0 A_AlertMonsters
TNT1 A 0 A_PlaySound("weapons/kar98", 1)
TNT1 A 0 A_FireCustomMissile("SmokeSpawner",0,0,0,5)
TNT1 A 0 A_FireCustomMissile("YellowFlareSpawn",0,0,0,0)
TNT1 A 0 A_Takeinventory("karabineAmmo",1)
ZK9G B 1 Bright 
TNT1 A 0 A_FireBullets(2,3,0,40,"RiflePuff")
TNT1 A 0 A_SetPitch(pitch - 8.0)
ZK9G CDEF 1
ZK9G FFF 1
ZK9G FDEC 1 

Reloading:
TNT1 A 0 A_PlaySound("QUAKER", 3)
ZK9R ABCD 2
TNT1 A 0 A_FireCustomMissile("RifleCaseSpawn",5,0,8,-9)
ZK9R EEE 2 
ZK9R DCBA 2 
Goto RealReady

Fire2:
TNT1 A 0 A_Takeinventory("Reloading",1)
TNT1 A 0 A_JumpIfInventory("karabineAmmo",1,1)
Goto Reload
TNT1 AAAA 0
TNT1 A 0 A_AlertMonsters
TNT1 A 0 A_PlaySound("weapons/kar98", 1)
TNT1 A 0 A_FireCustomMissile("SmokeSpawner",0,0,0,5)
TNT1 A 0 A_FireCustomMissile("YellowFlareSpawn",0,0,0,0)
TNT1 A 0 A_Takeinventory("karabineAmmo",1)
ZK92 B 1 Bright 
TNT1 A 0 A_FireBullets(0,0,0,40,"RiflePuff")
TNT1 A 0 A_SetPitch(pitch - 4.0)
ZK92 CDEF 1
ZK92 FFF 1
ZK92 FDEC 1 
Goto Reloading2

AltFire:
TNT1 A 0 A_JumpIfInventory("Zoomed",1,"UnZoom")
TNT1 A 0 A_Giveinventory("Zoomed",1)
TNT1 A 0 A_ZoomFactor(1.8)
TNT1 A 0 A_Giveinventory("ADSmode",1)
ZK9X ABCDEF 1 
Goto Ready2 

UnZoom:
TNT1 A 0 A_Takeinventory("Zoomed",1)
TNT1 A 0 A_ZoomFactor(1.0)
TNT1 A 0 A_Takeinventory("ADSmode",1)
ZK9X FEDCBA 1 
Goto RealReady

Reloading2:
TNT1 A 0 A_ZoomFactor(1.0)
ZK9X FEDCBA 1 
TNT1 A 0 A_PlaySound("QUAKER", 3)
ZK9R ABCD 2
TNT1 A 0 A_FireCustomMissile("RifleCaseSpawn",5,0,8,-9)
ZK9R EEE 2  
ZK9R DCBA 2 
TNT1 A 0 A_ZoomFactor(1.8)
ZK9X ABCDEF 1 
Goto Ready2

Reload:
TNT1 A 0 A_JumpIfInventory("karabineAmmo",1,"Reload2")
TNT1 A 0 A_JumpIfInventory("MauserClip",5,"ContinueReloading")
Goto Reload2

ContinueReloading:
TNT1 A 0 A_ZoomFactor(1.0)
TNT1 A 0 A_Takeinventory("Reloading",1)
TNT1 A 0 A_Takeinventory("ADSmode",1)
TNT1 A 0 A_Takeinventory("Zoomed",1)
TNT1 A 0 A_JumpIfInventory("karabineAmmo",5,"InsertBullets")
TNT1 A 0 A_JumpIfInventory("MauserClip",1,3)
Goto NoAmmo
TNT1 AAA 0
ZK9R AB 2 
TNT1 A 0 A_PlaySound("VINDABAI_2", 3)//Broken german
ZK9R CDEFGHIJ 2 
ZK9R JJ 2 
ZKR2 ABCDEFGHI 2
TNT1 A 0 A_PlaySound("CAILMUNITION", 3)
ZKR2 JKLMNO 2 
//TNT1 A 0 A_FireCustomMissile("K98STRIPEmpty",5,0,8,-9)
TNT1 A 0 A_FireCustomMissile("k98stripEmpty",0,0,4,5)
TNT1 A 0 A_PlaySound("VINDABAI_2", 3)
ZK9R EDCBA 2 

InsertBullets:
TNT1 AAAA 0
TNT1 A 0 A_JumpIfInventory("karabineAmmo",5,"RealReady")
TNT1 A 0 A_JumpIfInventory("MauserClip",1,"AmmoIn")
Goto RealReady

AmmoIn:
TNT1 A 0 A_Giveinventory("karabineAmmo",1)
TNT1 A 0 A_Takeinventory("MauserClip",1)
Goto InsertBullets

NoAmmo:
TNT1 A 0 A_Takeinventory("Zoomed",1)
TNT1 A 0 A_ZoomFactor(1.0)
TNT1 A 0 A_Takeinventory("ADSmode",1)
Goto RealReady

Reload2:
TNT1 A 0 A_ZoomFactor(1.0)
TNT1 A 0 A_Takeinventory("Reloading",1)
TNT1 A 0 A_Takeinventory("ADSmode",1)
TNT1 A 0 A_Takeinventory("Zoomed",1)
TNT1 A 0 A_JumpIfInventory("karabineAmmo",5,"InsertBullets")
TNT1 A 0 A_JumpIfInventory("MauserClip",1,3)
Goto NoAmmo
tnt1 aaa 0
ZK9R AB 2 
TNT1 A 0 A_PlaySound("VINDABAI_2", 3)//Broken german
ZK9R CDEFGHIJ 2 
ZK9R JJ 2
ZK9R KLMNOPQ 2

ReloadLoop:
TNT1 A 0 A_JumpIfInventory("karabineAmmo",5,"FinishReload")
TNT1 A 0 A_JumpIfInventory("MauserClip",1,"ContinueLoop")
Goto FinishReload
ContinueLoop:
ZK9R RS 2 
TNT1 A 0 A_PlaySound("K98AmmoIn")
ZK9R TU 2
ZK9R UTSR 2 

InsertBullets2:
TNT1 AAAA 0
TNT1 A 0 A_JumpIfInventory("karabineAmmo",5,"FinishReload")
TNT1 A 0 A_JumpIfInventory("MauserClip",1,"AmmoIn2")

AmmoIn2:
TNT1 A 0 A_Giveinventory("karabineAmmo",1)
TNT1 A 0 A_Takeinventory("MauserClip",1)
Goto ReloadLoop

FinishReload:
ZK9R QPONMLK 2 
ZK9R JIHGFEDC 2
TNT1 A 0 A_PlaySound("VINDABAI_2", 3)//Broken german
ZK9R BA 2 
Goto RealReady

DoKick:
TNT1 A 0
TNT1 A 0 A_Takeinventory("Zoomed",1)
TNT1 A 0 A_ZoomFactor(1.0)
TNT1 A 0 A_Takeinventory("ADSmode",1)
TNT1 A 0 A_PlaySound("KICK")
TNT1 A 0 SetPlayerProperty(0,1,0)
KICK BCD 1
RIFF A 0 A_FireCustomMissile("KickAttack", 0, 0, 0, -7)
KICK H 4
KICK A 0 A_Takeinventory("Kicking",1)
KICK IGFEDCBA 1
TNT1 A 0 SetPlayerProperty(0,0,0)
Goto RealReady

Taunt:
TNT1 A 0 A_Takeinventory("Zoomed",1)
TNT1 A 0 A_ZoomFactor(1.0)
TNT1 A 5
FUCK A 2
TNT1 A 0 BRIGHT A_FireCustomMissile("Taunter", 0, 0, -1, 0)
TNT1 A 0 BRIGHT A_FireCustomMissile("Taunter", -9, 0, -1, 0)
TNT1 A 0 BRIGHT A_FireCustomMissile("Taunter", 9, 0, -1, 0)
FUCK B 2 A_PlaySound("FUCK", 1)
FUCK C 2 A_AlertMonsters
FUCK D 15 A_Takeinventory("Taunting",1)
FUCK CBA 5
TNT1 A 5
Goto RealReady

LaunchGrenade:	
TNT1 A 0
TNT1 A 0 A_Takeinventory("Zoomed",1)
TNT1 A 0 A_ZoomFactor(1.0)
TNT1 A 0 A_TakeInventory("LaunchGrenade", 1)
TNT1 A 0 A_JumpIfInventory("GrenadeAmmo", 1, 1)
Goto NoGrenade
NGRA ABCD 2
TNT1 A 0 A_playSound("Pick/granate")
NGRA DD 2
TNT1 A 0 A_Jump(90,2)
TNT1 A 0 A_PlaySound("*grenadecall", CHAN_VOICE)
 NGRA DEFG 2
TNT1 A 0 A_PLaySound ("Launch/granate")
TNT1 A 0 A_FireCustomMissile("HandGrenade2", random(-3,3), 1, 0, 0, 0, 0)
GRWF STUVW 2 
TNT1 A 0 A_TakeInventory("GrenadeAmmo", 1)
TNT1 A 1 
TNT1 A 0 A_TakeInventory("LaunchGrenade", 1)
TNT1 A 0 A_Takeinventory("BWgrenade",1)
Goto RealReady

NoGrenade:
TNT1 A 0
TNT1 A 0 A_Takeinventory("Zoomed",1)
TNT1 A 0 A_Takeinventory("ADSmode",1)
TNT1 A 0 A_ZoomFactor(1.0)
TNT1 A 0 A_Print("No Grenades Left!")
TNT1 A 0 A_Takeinventory("BWgrenade",1)
Goto RealReady

Spawn:
KARP A -1
Stop

KnifeAttack:
TNT1 A 0 A_Takeinventory("Zoomed",1)
TNT1 A 0 A_ZoomFactor(1.0)
TNT1 A 0 A_Jump(90,2)
TNT1 A 0 A_PlaySound("*taunt", CHAN_VOICE)
KNIF ABCDE 1
KNIF F 1 A_PlaySound("weapons/wknife")
KNIF F 0 A_Custompunch(16,0,1,"KnifePuff")
KNIF GHI 1 
TNT1 A 0 A_Takeinventory("Meleeattack",1)
GOTO RealREADY
}
}


ACTOR KarabineAmmo : Ammo
{
   Inventory.Amount 0
   Inventory.MaxAmount 5
   Ammo.BackpackAmount 0
   Ammo.BackpackMaxAmount 5
}
