mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-07-19 12:05:59 +01:00
welding tool updates
This commit is contained in:
@@ -131,6 +131,7 @@
|
||||
name = "welding tool"
|
||||
icon = 'icons/obj/items.dmi'
|
||||
icon_state = "welder"
|
||||
item_state = "welder"
|
||||
flags = CONDUCT
|
||||
slot_flags = SLOT_BELT
|
||||
force = 3
|
||||
@@ -147,9 +148,27 @@
|
||||
var/max_fuel = 20 //The max amount of fuel the welder can hold
|
||||
|
||||
/obj/item/weapon/weldingtool/New()
|
||||
..()
|
||||
create_reagents(max_fuel)
|
||||
reagents.add_reagent("fuel", max_fuel)
|
||||
update_icon()
|
||||
return
|
||||
|
||||
/obj/item/weapon/weldingtool/proc/update_torch()
|
||||
if(welding)
|
||||
src.overlays = 0
|
||||
overlays += "["-won"]"
|
||||
item_state = "welder1"
|
||||
else
|
||||
item_state = "welder"
|
||||
|
||||
/obj/item/weapon/weldingtool/update_icon()
|
||||
src.overlays = 0
|
||||
var/ratio = get_fuel() / max_fuel
|
||||
ratio = Ceiling(ratio*4) * 25
|
||||
icon_state = "[initial(icon_state)][ratio]"
|
||||
update_torch()
|
||||
return
|
||||
|
||||
/obj/item/weapon/weldingtool/examine(mob/user)
|
||||
..()
|
||||
@@ -182,19 +201,16 @@
|
||||
/obj/item/weapon/weldingtool/process()
|
||||
switch(welding)
|
||||
if(0)
|
||||
if(icon_state != "welder") //Check that the sprite is correct, if it isnt, it means toggle() was not called
|
||||
force = 3
|
||||
damtype = "brute"
|
||||
icon_state = "welder"
|
||||
welding = 0
|
||||
force = 3
|
||||
damtype = "brute"
|
||||
update_icon()
|
||||
processing_objects.Remove(src)
|
||||
return
|
||||
//Welders left on now use up fuel, but lets not have them run out quite that fast
|
||||
if(1)
|
||||
if(icon_state != "welder1") //Check that the sprite is correct, if it isnt, it means toggle() was not called
|
||||
force = 15
|
||||
damtype = "fire"
|
||||
icon_state = "welder1"
|
||||
force = 15
|
||||
damtype = "fire"
|
||||
update_icon()
|
||||
if(prob(5))
|
||||
remove_fuel(1)
|
||||
|
||||
@@ -215,6 +231,7 @@
|
||||
O.reagents.trans_to(src, max_fuel)
|
||||
user << "<span class='notice'>[src] refueled.</span>"
|
||||
playsound(src.loc, 'sound/effects/refill.ogg', 50, 1, -6)
|
||||
update_icon()
|
||||
return
|
||||
else
|
||||
message_admins("[key_name_admin(user)] triggered a fueltank explosion.")
|
||||
@@ -234,7 +251,7 @@
|
||||
|
||||
/obj/item/weapon/weldingtool/attack_self(mob/user)
|
||||
toggle(user)
|
||||
|
||||
update_icon()
|
||||
|
||||
//Returns the amount of fuel in the welder
|
||||
/obj/item/weapon/weldingtool/proc/get_fuel()
|
||||
@@ -444,4 +461,4 @@
|
||||
throw_speed = 3
|
||||
throw_range = 3
|
||||
m_amt = 66
|
||||
icon_state = "crowbar_large"
|
||||
icon_state = "crowbar_large"
|
||||
|
||||
Reference in New Issue
Block a user