mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 10:12:45 +00:00
Fixes gun mode switching.
This commit is contained in:
@@ -15,7 +15,7 @@
|
||||
|
||||
for(var/propname in properties)
|
||||
var/propvalue = properties[propname]
|
||||
|
||||
|
||||
if(propname == "mode_name")
|
||||
name = propvalue
|
||||
if(isnull(propvalue))
|
||||
@@ -63,6 +63,7 @@
|
||||
var/scoped_accuracy = null
|
||||
var/list/burst_accuracy = list(0) //allows for different accuracies for each shot in a burst. Applied on top of accuracy
|
||||
var/list/dispersion = list(0)
|
||||
var/mode_name = null
|
||||
|
||||
var/next_fire_time = 0
|
||||
|
||||
@@ -154,10 +155,10 @@
|
||||
if (world.time % 3) //to prevent spam
|
||||
user << "<span class='warning'>[src] is not ready to fire again!</span>"
|
||||
return
|
||||
|
||||
|
||||
var/shoot_time = (burst - 1)* burst_delay
|
||||
user.setClickCooldown(shoot_time) //no clicking on things while shooting
|
||||
user.setMoveCooldown(shoot_time) //no moving while shooting either
|
||||
user.setMoveCooldown(shoot_time) //no moving while shooting either
|
||||
next_fire_time = world.time + shoot_time
|
||||
|
||||
//actually attempt to shoot
|
||||
@@ -191,7 +192,7 @@
|
||||
//update timing
|
||||
user.setClickCooldown(4)
|
||||
user.setMoveCooldown(move_delay)
|
||||
next_fire_time = world.time + fire_delay
|
||||
next_fire_time = world.time + fire_delay
|
||||
|
||||
if(muzzle_flash)
|
||||
set_light(0)
|
||||
@@ -384,7 +385,7 @@
|
||||
return new_mode
|
||||
|
||||
/obj/item/weapon/gun/attack_self(mob/user)
|
||||
var/datum/firemode/new_mode = switch_firemodes(user)
|
||||
if(new_mode)
|
||||
user << "<span class='notice'>\The [src] is now set to [new_mode.name].</span>"
|
||||
switch_firemodes(user)
|
||||
if(firemodes.len > 1)
|
||||
user << "<span class='notice'>\The [src] is now set to [mode_name].</span>"
|
||||
|
||||
|
||||
@@ -34,10 +34,10 @@
|
||||
modifystate = "fm-2tstun"
|
||||
|
||||
firemodes = list(
|
||||
list(name="stun", projectile_type=/obj/item/projectile/beam/stun/weak, modifystate="fm-2tstun", fire_sound='sound/weapons/Taser.ogg'),
|
||||
list(name="stun 3-round bursts", burst=3, fire_delay=null, move_delay=4, burst_accuracy=list(0,-1,-1), dispersion=list(0.0, 0.6, 1.0), projectile_type=/obj/item/projectile/beam/stun, modifystate="fm-2tstun", fire_sound='sound/weapons/Taser.ogg'),
|
||||
list(name="lethal", projectile_type=/obj/item/projectile/beam/weaklaser, modifystate="fm-2tkill", fire_sound='sound/weapons/Laser.ogg'),
|
||||
list(name="lethal 3-round bursts", burst=3, fire_delay=null, move_delay=4, burst_accuracy=list(0,-1,-1), dispersion=list(0.0, 0.6, 1.0), projectile_type=/obj/item/projectile/beam, modifystate="fm-2tkill", fire_sound='sound/weapons/Laser.ogg'),
|
||||
list(mode_name="stun", projectile_type=/obj/item/projectile/beam/stun/weak, modifystate="fm-2tstun", fire_sound='sound/weapons/Taser.ogg'),
|
||||
list(mode_name="stun 3-round bursts", burst=3, fire_delay=null, move_delay=4, burst_accuracy=list(0,-1,-1), dispersion=list(0.0, 0.6, 1.0), projectile_type=/obj/item/projectile/beam/stun, modifystate="fm-2tstun", fire_sound='sound/weapons/Taser.ogg'),
|
||||
list(mode_name="lethal", projectile_type=/obj/item/projectile/beam/weaklaser, modifystate="fm-2tkill", fire_sound='sound/weapons/Laser.ogg'),
|
||||
list(mode_name="lethal 3-round bursts", burst=3, fire_delay=null, move_delay=4, burst_accuracy=list(0,-1,-1), dispersion=list(0.0, 0.6, 1.0), projectile_type=/obj/item/projectile/beam, modifystate="fm-2tkill", fire_sound='sound/weapons/Laser.ogg'),
|
||||
)
|
||||
|
||||
/obj/item/weapon/gun/energy/gun/nuclear
|
||||
|
||||
Reference in New Issue
Block a user