Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
  • 0
Valgilton

How do I make my weapon use more ammo during its altfire?

Question

So, I'm making a shotgun-type weapon that has a more powerful altfire, but at the cost of more ammo.

 

What I want to do is during the normal firing animation, it only uses 1 shell per shot,

but when it uses it's altfire, there's kickback and it uses 4 shells per shot.

 

How would I go about doing this?

 

Share this post


Link to post

3 answers to this question

Recommended Posts

  • 0

DECORATE supports alternate firing modes. A rough example below:

ACTOR MyGun : Shotgun 
   Decal BulletChip
   Inventory.PickupMessage "The overpowered, invisible, and silent Shotgun!"
   Weapon.SlotNumber 3
   Weapon.SelectionOrder 2000
   Weapon.AmmoType "Shell"
   Weapon.AmmoType2 "Shell"
   Weapon.AmmoGive 20
   Weapon.AmmoGive2 20
   Weapon.AmmoUse 1
   Weapon.AmmoUse2 4 //deduct 4 shells from ammo counter, if altfire is used
   States
   { 
   Select:
       TNT1 A 1 A_Raise
   Loop
   Deselect:
       TNT1 A 1 A_Lower
   Loop
   Ready:
       TNT1 A 1 A_WeaponReady
   Loop
   Fire:
       TNT1 A 1 A_FireBullets(2, 2, 7, 10)
       TNT1 A 1 A_ReFire
   Goto Ready
//this is the secondary fire, usually activated by right-mouse click.
   AltFire:
       TNT1 A 1 A_FireBullets(4, 4, 14, 20)
       TNT1 A 1 A_ReFire
   Goto Ready
   }
}



Weapon.AmmoUse2 is a weapon property that defines how much ammo should be deducted. In this, case, 4 shells will be removed.

The AltFire state is the alternate firing state. Here the damage produced is even greater and more "shells" are shot (14 to be exact).

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×