Chainsaw fix and cleanup (#4538)

* Fixes/Cleans up chainsaws.

* Further Chainsaw Updoots
This commit is contained in:
Mechoid
2018-01-14 23:31:04 -08:00
committed by Anewbe
parent cb22407e7c
commit d8d769ac33
3 changed files with 17 additions and 6 deletions

View File

@@ -1,19 +1,29 @@
obj/item/weapon/chainsaw
name = "Chainsaw"
name = "chainsaw"
desc = "Vroom vroom."
icon_state = "chainsaw0"
item_state = "chainsaw0"
var/on = 0
var/max_fuel = 20
w_class = ITEMSIZE_LARGE
slot_flags = SLOT_BACK
w_class = ITEMSIZE_LARGE
slot_flags = SLOT_BACK
var/active_force = 55
var/inactive_force = 10
obj/item/weapon/chainsaw/New()
var/datum/reagents/R = new/datum/reagents(max_fuel)
reagents = R
R.my_atom = src
R.add_reagent("fuel", max_fuel)
processing_objects |= src
..()
obj/item/weapon/chainsaw/Destroy()
processing_objects -= src
if(reagents)
qdel(reagents)
..()
obj/item/weapon/chainsaw/proc/turnOn()
@@ -31,7 +41,7 @@ obj/item/weapon/chainsaw/proc/turnOn()
visible_message("You start \the [src] up with a loud grinding!", "[usr] starts \the [src] up with a loud grinding!")
attack_verb = list("shreds", "rips", "tears")
playsound(src, 'sound/weapons/chainsaw_startup.ogg',40,1)
force = 55
force = active_force
edge = 1
sharp = 1
on = 1
@@ -44,7 +54,7 @@ obj/item/weapon/chainsaw/proc/turnOff()
to_chat(usr, "You switch the gas nozzle on the chainsaw, turning it off.")
attack_verb = list("bluntly hit", "beat", "knocked")
playsound(src, 'sound/weapons/chainsaw_turnoff.ogg',40,1)
force = 10
force = inactive_force
edge = 0
sharp = 0
on = 0
@@ -87,12 +97,13 @@ obj/item/weapon/chainsaw/process()
if(on)
if(get_fuel() > 0)
reagents.remove_reagent("fuel", 1)
playsound(src, 'sound/weapons/chainsaw_turnoff.ogg',15,1)
if(get_fuel() <= 0)
to_chat(usr, "\The [src] sputters to a stop!")
on = !on
turnOff()
obj/item/weapon/chainsaw/proc/get_fuel()
reagents.get_reagent_amount("fuel")
return reagents.get_reagent_amount("fuel")
obj/item/weapon/chainsaw/examine(mob/user)
if(..(user,0))
@@ -109,4 +120,4 @@ obj/item/weapon/chainsaw/update_icon()
item_state = "chainsaw1"
else
icon_state = "chainsaw0"
icon_state = "chainsaw0"
item_state = "chainsaw0"

Binary file not shown.

Before

Width:  |  Height:  |  Size: 66 KiB

After

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 66 KiB

After

Width:  |  Height:  |  Size: 64 KiB