Code: Select all
ACTOR M1911 : Weapon 17001
{
//$Category DOV - WEAPONS
Weapon.SlotNumber 2
Weapon.SelectionOrder 1
Weapon.Kickback 50
Weapon.BobRangeX 0.3
Weapon.BobRangeY 0.5
Weapon.BobStyle InverseSmooth
Weapon.BobSpeed 2.4
Obituary "%o was executed by %k's customized 1911."
Scale 0.4
Radius 15
Height 15
Decal "MagnumHole"
AttackSound "1911FIR2"
Inventory.Pickupmessage "Obtained customized 1911!"
Inventory.PickupSound "1911UP"
Weapon.Ammotype1 "1911Loaded"
Weapon.Ammotype2 "1911Ammo"
Weapon.Ammouse 1
Weapon.Ammouse2 0
Weapon.Ammogive1 0
Weapon.Ammogive2 5
+Weapon.Ammo_Optional
+NOAUTOFIRE
+NOEXTREMEDEATH
+COUNTITEM
+CASTSPRITESHADOW
+WEAPON.NOALERT
States
{
Spawn:
1911 A -1
loop
Pickup:
1911 A 0 A_GiveInventory("QuickKick", 1)
Stop
Ready:
1911 B 1 A_WeaponReady(WRF_ALLOWRELOAD)
loop
Select:
1911 B 0 A_PlaySound("DRAW",CHAN_AUTO)
1911 B 1 Offset (90,69)
1911 B 1 Offset (70,60)
1911 B 1 Offset (55,52)
1911 B 1 Offset (35,45)
1911 B 1 Offset (15,39)
1911 B 1 Offset (1,35)
SelectRaise:
1911 B 1 A_RAISE
Loop
Deselect:
1911 B 0 A_PlaySound("AWAY", CHAN_WEAPON)
1911 B 1 Offset (1,35)
1911 B 1 Offset (15,39)
1911 B 1 Offset (35,45)
1911 B 1 Offset (55,52)
1911 B 1 Offset (70,60)
1911 B 1 Offset (90,69)
1911 B 1 Offset (105,89)
1911 B 1 Offset (125,102)
1911 B 1 Offset (155,108)
1911 B 1 Offset (155,150)
DeselectRaise:
1911 B 0 Offset (-1,0)
1911 B 1 A_Lower
Loop
Fire:
TNT1 A 0 A_JumpIfInventory("PistolSupressor", 1 "FireSupressed") // go to special supressed fire state if needed
TNT1 A 0 A_AlertMonsters // this is where we'll end up if not supressed, this will wake up all monsters
1911 C 0 A_JumpIfNoAmmo("Reload")
1911 C 0 A_StartSound("1911FIR2",CHAN_AUTO)
1911 C 2 Bright A_FireProjectile("PistolTracer", FRandom(-0.6, 0.6), true, 0, 0, 0, FRandom(-2.0, 2.0))
1911 C 0 A_spawnitemex ("Casing", 34, 1, 27, random(1,6), random(1,8), random(1,9), 0)
1911 C 0 A_FireCustomMissile("GunSmokeSpawner",0,0,0,5)
1911 D 2 Bright A_SetPitch(pitch-0.3)
1911 E 1 A_SetPitch(pitch-0.3)
1911 F 1 A_SetPitch(pitch-0.8)
1911 G 1 A_SetPitch(pitch+0.8)
1911 B 0 A_SetPitch(pitch+0.3)
1911 B 0 A_SetPitch(pitch+0.3)
Goto Ready
FireSupressed: // you can change the first line to say 1 instead of "FireSupressed", if you don't care for a unique sequence. That'll just skip alerting monsters.
TNT1 A 0 A_JumpIfNoAmmo("Reload")
TNT1 A 0 A_StartSound("SUPPFIRE",CHAN_AUTO)
Goto Fire+4 // skips the suppresion check so we don't come back forever, skips alerting monsters, skips checking for reload (we do it here) and plays a different sound. If you want a unique firing sequence just remove this line and program it however you like.
Reload:
1911 B 0 A_JumpIfInventory("1911Loaded", 7, 2) // If the gun's full, jump 2 states.
1911 B 0 A_JumpIfInventory("1911Ammo", 1, "ReloadWork") // If there's extra ammo, reload.
1911 B 1 // Here's where that first line ends up - the gun does nothing and returns to Ready.
Goto Ready
ReloadWork:
1911 B 1 Offset(0,35)
1911 B 1 Offset(-2,38)
1911 B 0 A_PlaySound("1911MAG1",CHAN_AUTO)
1911 B 1 Offset(-4,44)
1911 B 1 Offset(-6,52)
1911 B 1 Offset(-1,54)
1911 B 6 Offset(-2,56)
1911 B 0 A_FireCustomMissile("PistolMagDrop",-5,0,8,-4)
1911 B 1 Offset(-1,54)
1911 B 1 Offset(-6,52)
1911 B 1 Offset(-4,44)
1911 B 0 A_PlaySound("1911MAG2",CHAN_AUTO)
1911 B 1 Offset(-2,38)
1911 B 1 Offset(0,35)
1911 B 1 Offset(0,35)
1911 B 1 Offset(-3,56)
1911 B 1 Offset(-3,56)
1911 B 1 Offset(-3,51)
1911 B 1 Offset(-3,53)
1911 B 1 Offset(0,35)
1911 B 1 Offset(0,35)
ReloadLoop:
1911 B 0 A_TakeInventory("1911Ammo", 1)
1911 B 0 A_GiveInventory("1911Loaded", 1)
1911 B 0 A_JumpIfInventory("1911Loaded", 7, "ReloadFinish")
1911 B 0 A_JumpIfInventory("1911Ammo", 1, "ReloadLoop")
Goto ReloadFinish
ReloadFinish:
1911 B 1 Offset(-3,57)
1911 B 1 Offset(-3,59)
1911 B 1 Offset(-3,63)
1911 B 1 Offset(-3,67)
1911 B 1 Offset(-3,65)
1911 B 0 A_PlaySound("1911UP",CHAN_AUTO)
1911 B 1 Offset(-3,62)
1911 B 1 Offset(-3,58)
1911 B 1 Offset(-3,55)
1911 B 1 Offset(-2,53)
1911 B 1 Offset(-2,49)
1911 B 1 Offset(-2,46)
1911 B 1 Offset(-2,45)
1911 B 1 Offset(-1,44)
1911 B 1 Offset(-1,46)
1911 B 1 Offset(-1,47)
1911 B 1 Offset(0,49) A_WeaponReady(WRF_NOBOB)
1911 B 1 Offset(0,44) A_WeaponReady(WRF_NOBOB)
1911 B 1 Offset(0,38) A_WeaponReady(WRF_NOBOB)
1911 B 1 Offset(0,35) A_WeaponReady(WRF_NOBOB)
1911 B 1 Offset(0,32) A_WeaponReady(WRF_NOBOB)
Goto Ready
Goto ready
AltFire:
TNT1 A 0 A_JumpIfInventory("PistolSupressor", 1 "UnSupress")
1911 B 1 A_GiveInventory("PistolSupressor")
TNT1 A 0 A_Print("Hey, add some cool animation here")
Goto Ready
UnSupress:
1911 B 1 A_TakeInventory("PistolSupressor")
TNT1 A 0 A_Print("Hey, add some cool animation here")
Goto Ready
}
}
ACTOR PistolSuppressor : Inventory { Inventory.MaxAmount 1 }
ACTOR 1911Loaded : Ammo
{
Inventory.MaxAmount 7
+IGNORESKILL
}