Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- actor AutoShotgun : Weapon
- {
- obituary "%o got blasted away by %k's Auto-shotgun."
- radius 20
- height 16
- +WEAPON.NOAUTOFIRE //this flag makes sure that the gun won't repeatedly click when you hold down the trigger on an empty gun
- +WEAPON.NOALERT //this flag makes sure that an empty gun clicking or an ejecting casing will not alert monsters
- +WEAPON.AMMO_OPTIONAL //this flag makes sure that there's an empty state for the gun
- +WEAPON.ALT_AMMO_OPTIONAL //this as well
- Inventory.Pickupmessage "You got the Automatic shotgun!"
- weapon.selectionorder 700
- Weapon.AmmoType1 "ASGClip"
- Weapon.AmmoType2 "Shell"
- Weapon.AmmoGive1 0
- Weapon.AmmoUse1 1
- Weapon.AmmoGive2 12
- Weapon.AmmoUse2 0
- AttackSound "weapons/HS_FIRE1"
- states
- {
- Spawn:
- WASG A -1
- stop
- Ready:
- ASGG A 1 A_WeaponReady
- NULL A 0 A_JumpIfInventory("IsReloading",1,"Reload")
- loop
- Deselect:
- ASGG A 1 A_Lower
- loop
- Select:
- ASGG A 1 A_Raise
- loop
- Reload:
- NULL A 0 A_JumpIfInventory("ASGClip",12,2) //this jumps to the 3rd NULL (which goes to Ready) if you don't need to reload
- NULL A 0 A_JumpIfInventory("Shell",1,2) //this jumps to KALL A 2 if you have bullets to reload with
- NULL A 0
- Goto Ready
- ASGG A 2
- ASGG B 2
- ASGG C 2
- ASGG D 4
- ASGG E 2 A_PlaySound("weapons/HS_COUT") //this refers to the soundfile labeled under weapons/akout in SNDINFO, change as needed
- ASGG F 4
- ASGG Q 12
- NULL A 0 //this is the frame the gun will jump to after a round has been taken from your inventory and inserted into the mag
- NULL A 0 A_JumpIfInventory("ASGClip",12,2)
- NULL A 0 A_JumpIfInventory("Shell",1,2)
- NULL A 0 //if the mag is full, or there are no more bullets, it will jump to the end of the reload state
- Goto Reload+18
- NULL A 0 A_JumpIfInventory("ASGClip",12,5)
- NULL A 0 A_TakeInventory("Shell",1) //remove one round from your stockpile
- NULL A 0 A_GiveInventory("ASGClip",1) //create a new round in your magazine
- NULL A 0 A_JumpIfInventory("ASGClip",12,2)
- Goto Reload+10
- NULL A 0 //from here on, the end of the reload animation plays (inserting the magazine and pulling the charging handle)
- ASGG G 4 //needless to say, you can alter these numbers and frames to your liking
- ASGG H 2 A_PlaySound("weapons/HS_CIN") //but remember that when you change these things, state jumps would need to be recalculated
- ASGG I 4 //as in, if I add an extra frame here now, I would have to add one each to Goto Reload+18 and Goto Reload+10
- ASGG J 3
- ASGG K 2 //so they would now be Goto Reload+19 and Goto Reload+11
- Goto Ready
- Fire:
- NULL A 0 A_JumpIfInventory("ASGClip", 1, 3)
- ASGG A 0
- ASGG A 1
- Goto Reload
- ASGG L 0 A_GunFlash
- ASGG A 0 A_FireCustomMissile("CheapAlert",0,0,0,0)
- ASGG L 0 Bright A_FireBullets(5,3,7,5,"BulletPuff")
- ASGG L 2 Bright
- ASGG M 2 Bright
- ASGG N 2 Bright
- ASGG A 5
- ASGG A 0
- Goto Ready
- Flash:
- NULL A 4 bright A_Light1
- NULL A 3 bright A_Light2
- NULL A 0 bright A_Light0
- stop
- }
- }
- ACTOR ASGClip: Ammo
- {
- Inventory.MaxAmount 12
- Ammo.BackpackAmount 0
- Ammo.BackpackMaxAmount 12
- }
- ACTOR CheapAlert
- {
- Health 1000
- Radius 1
- Height 1
- Speed 0
- Damage 0
- Mass 1
- PROJECTILE
- +NOCLIP
- States
- {
- Spawn:
- NULL A 0
- NULL A 1 A_AlertMonsters
- Stop //this would spawn with every gunshot, and alert any monster that would be able to hear the gun fire
- } //needless to say, if you're making a silenced weapon or a melee weapon, you can make the weapon just not spawn this actor
- }
- ACTOR IsReloading : Inventory
- {
- Inventory.MaxAmount 1
- -COUNTITEM
- }
- ACTOR Action_Reload : CustomInventory
- {
- Inventory.Amount 1
- Inventory.MaxAmount 1
- -INVBAR
- -COUNTITEM
- States
- {
- Use:
- TNT1 A 0 A_GiveInventory("IsReloading",1)
- Fail
- }
- }
- ACTOR Action_ReloadCancel : CustomInventory
- {
- Inventory.Amount 1
- Inventory.MaxAmount 1
- -INVBAR
- -COUNTITEM
- States
- {
- Use:
- TNT1 A 0 A_TakeInventory("IsReloading",1)
- Fail
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement