Fix lawgivers by Ezuo/Toaster (#3423)

PLAGIARIZED AND REBASE VERSION OF #3409 BECAUSE FUCK GIT

The old Lawgiver code didn't work as intended, with different modes using different charge values and having different recoil. This PR fixes that code, so the lawgiver is now somewhat balanced (No more HE spam yay). Current ammo amounts, from full charge, are:

Stun and Singleshot = 40
Burst = 13ish, just shoots 3 Singleshot in a row
AP = 15
Hotshot and Pellets = 8
Highex = 5 (Original charge cost placed it at 6.6 recurring, brought it down to 5)
This commit is contained in:
Erki
2017-09-09 19:01:49 +03:00
committed by GitHub
parent ac2ed66cef
commit 320c0154f7
2 changed files with 92 additions and 51 deletions

View File

@@ -3,9 +3,8 @@
icon_state = "lawgiver"
item_state = "gun"
origin_tech = list(TECH_COMBAT = 6, TECH_MAGNET = 5)
projectile_type=/obj/item/projectile/bullet/pistol
fire_sound='sound/weapons/Gunshot_smg.ogg'
sel_mode = 1
var/mode_check = 1
desc = "A highly advanced firearm for the modern police force. It has multiple voice-activated firing modes."
var/dna = null//dna-locking the firearm
var/emagged = 0 //if the gun is emagged or not
@@ -21,7 +20,13 @@
mode_name = "singleshot",
charge_cost = 50,
fire_delay = 3,
recoil=1
recoil = 1,
burst = null,
move_delay = null,
accuracy = null,
dispersion = null,
projectile_type = /obj/item/projectile/bullet/pistol,
fire_sound = 'sound/weapons/Gunshot_smg.ogg'
),
list(
mode_name = "rapidfire",
@@ -31,43 +36,78 @@
burst = 3,
move_delay = 4,
accuracy = list(0,-1,-1,-2,-2),
dispersion = list(0.0, 0.6, 1.0)
dispersion = list(0.0, 0.6, 1.0),
projectile_type = /obj/item/projectile/bullet/pistol,
fire_sound = 'sound/weapons/Gunshot_smg.ogg'
),
list(
mode_name = "highex",
charge_cost=300,
charge_cost = 400,
fire_delay = 6,
recoil=3
recoil = 3,
burst = null,
move_delay = null,
accuracy = null,
dispersion = null,
projectile_type = /obj/item/projectile/bullet/gyro/law,
fire_sound = 'sound/effects/Explosion1.ogg'
),
list(
mode_name = "stun",
charge_cost = 50,
fire_delay = 4,
recoil=0
recoil = 0,
burst = null,
move_delay = null,
accuracy = null,
dispersion = null,
projectile_type = /obj/item/projectile/beam/stun,
fire_sound = 'sound/weapons/Taser.ogg'
),
list(
mode_name = "hotshot",
charge_cost=200,
charge_cost = 250,
fire_delay = 4,
recoil=3
recoil = 3,
burst = null,
move_delay = null,
accuracy = null,
dispersion = null,
projectile_type = /obj/item/projectile/bullet/shotgun/incendiary,
fire_sound = 'sound/weapons/Gunshot.ogg'
),
list(
mode_name = "armorpiercing",
charge_cost=300,
charge_cost = 130,
fire_delay = 6,
recoil=3
recoil = 3,
burst = null,
move_delay = null,
accuracy = null,
dispersion = null,
projectile_type = /obj/item/projectile/bullet/rifle/a556,
fire_sound = 'sound/weapons/Gunshot.ogg'
),
list(
mode_name = "pellets",
charge_cost=300,
charge_cost = 250,
fire_delay = 6,
recoil=3
recoil = 3,
burst = null,
move_delay = null,
accuracy = null,
dispersion = null,
projectile_type = /obj/item/projectile/bullet/pellet/shotgun,
fire_sound = 'sound/weapons/Gunshot.ogg'
)
)
/obj/item/weapon/gun/energy/lawgiver/New()
..()
/obj/item/weapon/gun/energy/lawgiver/Initialize()
. = ..()
listening_objects += src
power_supply = new /obj/item/weapon/cell/device/variable(src, 2000)
var/datum/firemode/new_mode = firemodes[sel_mode]
new_mode.apply_to(src)
/obj/item/weapon/gun/energy/lawgiver/Destroy()
listening_objects -= src
@@ -138,38 +178,24 @@
/* Firing Modes*/
if(findtext(msg,"single"))
sel_mode = 1
projectile_type=/obj/item/projectile/bullet/pistol
fire_sound='sound/weapons/Gunshot_smg.ogg'
usr << "<span class='warning'>[src.name] is now set to single shot mode.</span>"
else if(findtext(msg,"rapidfire"))
sel_mode = 2
projectile_type=/obj/item/projectile/bullet/pistol
fire_sound='sound/weapons/Gunshot_smg.ogg'
usr << "<span class='warning'>[src.name] is now set to rapid fire mode.</span>"
else if(findtext(msg,"highex") || findtext(msg,"grenade"))
sel_mode = 3
projectile_type=/obj/item/projectile/bullet/gyro/law
fire_sound='sound/effects/Explosion1.ogg'
usr << "<span class='warning'>[src.name] is now set to high explosive mode.</span>"
else if(findtext(msg,"stun"))
sel_mode = 4
projectile_type=/obj/item/projectile/beam/stun
fire_sound='sound/weapons/Taser.ogg'
usr << "<span class='warning'>[src.name] is now set to stun mode.</span>"
else if(findtext(msg,"hotshot") || findtext(msg,"incendiary"))
sel_mode = 5
projectile_type=/obj/item/projectile/bullet/shotgun/incendiary
fire_sound='sound/weapons/Gunshot.ogg'
usr << "<span class='warning'>[src.name] is now set to incendiary mode.</span>"
else if(findtext(msg,"armorpiercing") || findtext(msg,"execution"))
sel_mode = 6
projectile_type=/obj/item/projectile/bullet/rifle/a556
fire_sound='sound/weapons/Gunshot.ogg'
usr << "<span class='warning'>[src.name] is now set to armorpiercing mode.</span>"
else if(findtext(msg,"pellets"))
sel_mode = 7
projectile_type=/obj/item/projectile/bullet/pellet/shotgun
fire_sound='sound/weapons/Gunshot.ogg'
usr << "<span class='warning'>[src.name] is now set to pellet mode.</span>"
/* Other Stuff */
else if(findtext(msg,"reset") && (findtext(msg,"user") || findtext(msg,"dna")))
@@ -188,5 +214,8 @@
message_enabled = 1
message_disable = 0
play_message()
else
return
if(mode_check != sel_mode)
var/datum/firemode/new_mode = firemodes[sel_mode]
new_mode.apply_to(src)
mode_check = sel_mode

View File

@@ -0,0 +1,12 @@
author: Ezuo
# Optional: Remove this file after generating master changelog. Useful for PR changelogs that won't get used again.
delete-after: True
# Any changes you've made. See valid prefix list above.
# INDENT WITH TWO SPACES. NOT TABS. SPACES.
# SCREW THIS UP AND IT WON'T WORK.
# Also, all entries are changed into a single [] after a master changelog generation. Just remove the brackets when you add new entries.
# Please surround your changes in double quotes ("), as certain characters otherwise screws up compiling. The quotes will not show up in the changelog.
changes:
- bugfix: "Fixed the long broken Lawgiver code. It will now function as intended, with different firemodes using different charge values."