mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-12 03:02:54 +00:00
Chainsaw fix and cleanup (#4538)
* Fixes/Cleans up chainsaws. * Further Chainsaw Updoots
This commit is contained in:
@@ -1,19 +1,29 @@
|
|||||||
obj/item/weapon/chainsaw
|
obj/item/weapon/chainsaw
|
||||||
name = "Chainsaw"
|
name = "chainsaw"
|
||||||
desc = "Vroom vroom."
|
desc = "Vroom vroom."
|
||||||
icon_state = "chainsaw0"
|
icon_state = "chainsaw0"
|
||||||
|
item_state = "chainsaw0"
|
||||||
var/on = 0
|
var/on = 0
|
||||||
var/max_fuel = 20
|
var/max_fuel = 20
|
||||||
w_class = ITEMSIZE_LARGE
|
w_class = ITEMSIZE_LARGE
|
||||||
slot_flags = SLOT_BACK
|
slot_flags = SLOT_BACK
|
||||||
w_class = ITEMSIZE_LARGE
|
w_class = ITEMSIZE_LARGE
|
||||||
slot_flags = SLOT_BACK
|
slot_flags = SLOT_BACK
|
||||||
|
var/active_force = 55
|
||||||
|
var/inactive_force = 10
|
||||||
|
|
||||||
obj/item/weapon/chainsaw/New()
|
obj/item/weapon/chainsaw/New()
|
||||||
var/datum/reagents/R = new/datum/reagents(max_fuel)
|
var/datum/reagents/R = new/datum/reagents(max_fuel)
|
||||||
reagents = R
|
reagents = R
|
||||||
R.my_atom = src
|
R.my_atom = src
|
||||||
R.add_reagent("fuel", max_fuel)
|
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()
|
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!")
|
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")
|
attack_verb = list("shreds", "rips", "tears")
|
||||||
playsound(src, 'sound/weapons/chainsaw_startup.ogg',40,1)
|
playsound(src, 'sound/weapons/chainsaw_startup.ogg',40,1)
|
||||||
force = 55
|
force = active_force
|
||||||
edge = 1
|
edge = 1
|
||||||
sharp = 1
|
sharp = 1
|
||||||
on = 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.")
|
to_chat(usr, "You switch the gas nozzle on the chainsaw, turning it off.")
|
||||||
attack_verb = list("bluntly hit", "beat", "knocked")
|
attack_verb = list("bluntly hit", "beat", "knocked")
|
||||||
playsound(src, 'sound/weapons/chainsaw_turnoff.ogg',40,1)
|
playsound(src, 'sound/weapons/chainsaw_turnoff.ogg',40,1)
|
||||||
force = 10
|
force = inactive_force
|
||||||
edge = 0
|
edge = 0
|
||||||
sharp = 0
|
sharp = 0
|
||||||
on = 0
|
on = 0
|
||||||
@@ -87,12 +97,13 @@ obj/item/weapon/chainsaw/process()
|
|||||||
if(on)
|
if(on)
|
||||||
if(get_fuel() > 0)
|
if(get_fuel() > 0)
|
||||||
reagents.remove_reagent("fuel", 1)
|
reagents.remove_reagent("fuel", 1)
|
||||||
|
playsound(src, 'sound/weapons/chainsaw_turnoff.ogg',15,1)
|
||||||
if(get_fuel() <= 0)
|
if(get_fuel() <= 0)
|
||||||
to_chat(usr, "\The [src] sputters to a stop!")
|
to_chat(usr, "\The [src] sputters to a stop!")
|
||||||
on = !on
|
turnOff()
|
||||||
|
|
||||||
obj/item/weapon/chainsaw/proc/get_fuel()
|
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)
|
obj/item/weapon/chainsaw/examine(mob/user)
|
||||||
if(..(user,0))
|
if(..(user,0))
|
||||||
@@ -109,4 +120,4 @@ obj/item/weapon/chainsaw/update_icon()
|
|||||||
item_state = "chainsaw1"
|
item_state = "chainsaw1"
|
||||||
else
|
else
|
||||||
icon_state = "chainsaw0"
|
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 |
Reference in New Issue
Block a user