mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-26 13:37:58 +01:00
Merge pull request #2068 from Markolie/lawstate
Welding tool refactor, in-hand updates
This commit is contained in:
@@ -183,6 +183,13 @@ obj/item/device/flashlight/lamp/bananalamp
|
||||
update_brightness(U)
|
||||
else
|
||||
update_brightness(null)
|
||||
|
||||
/obj/item/device/flashlight/flare/update_brightness(var/mob/user = null)
|
||||
..()
|
||||
if(on)
|
||||
item_state = "[initial(item_state)]-on"
|
||||
else
|
||||
item_state = "[initial(item_state)]"
|
||||
|
||||
/obj/item/device/flashlight/flare/attack_self(mob/user)
|
||||
|
||||
@@ -200,6 +207,15 @@ obj/item/device/flashlight/lamp/bananalamp
|
||||
src.force = on_damage
|
||||
src.damtype = "fire"
|
||||
processing_objects += src
|
||||
|
||||
/obj/item/device/flashlight/flare/torch
|
||||
name = "torch"
|
||||
desc = "A torch fashioned from some leaves and a log."
|
||||
w_class = 4
|
||||
brightness_on = 7
|
||||
icon_state = "torch"
|
||||
item_state = "torch"
|
||||
on_damage = 10
|
||||
|
||||
/obj/item/device/flashlight/slime
|
||||
gender = PLURAL
|
||||
|
||||
@@ -12,13 +12,8 @@
|
||||
singular_name = "light floor tile"
|
||||
desc = "A floor tile, made out off glass. Use a multitool on it to change its color."
|
||||
icon_state = "tile_light blue"
|
||||
w_class = 3.0
|
||||
force = 3.0
|
||||
throwforce = 5.0
|
||||
throw_speed = 5
|
||||
throw_range = 20
|
||||
flags = CONDUCT
|
||||
max_amount = 60
|
||||
force = 3
|
||||
throwforce = 5
|
||||
attack_verb = list("bashed", "battered", "bludgeoned", "thrashed", "smashed")
|
||||
var/on = 1
|
||||
var/state = LIGHTFLOOR_ON
|
||||
@@ -49,4 +44,5 @@
|
||||
icon_state="tile_"+color_desc()
|
||||
user << "[src] is now "+color_desc()
|
||||
|
||||
return ..()
|
||||
return ..()
|
||||
|
||||
@@ -4,14 +4,11 @@
|
||||
singular_name = "floor tile"
|
||||
desc = "Those could work as a pretty decent throwing weapon"
|
||||
icon_state = "tile"
|
||||
w_class = 3.0
|
||||
force = 6.0
|
||||
force = 6
|
||||
materials = list(MAT_METAL=500)
|
||||
throwforce = 10.0
|
||||
throwforce = 10
|
||||
throw_speed = 3
|
||||
throw_range = 7
|
||||
flags = CONDUCT
|
||||
max_amount = 60
|
||||
|
||||
/obj/item/stack/tile/plasteel/New(var/loc, var/amount=null)
|
||||
..()
|
||||
@@ -19,28 +16,10 @@
|
||||
src.pixel_y = rand(1, 14)
|
||||
return
|
||||
|
||||
/*
|
||||
/obj/item/stack/tile/plasteel/attack_self(mob/user as mob)
|
||||
if (usr.stat)
|
||||
return
|
||||
var/T = user.loc
|
||||
if (!( istype(T, /turf) ))
|
||||
user << "\red You must be on the ground!"
|
||||
return
|
||||
if (!( istype(T, /turf/space) ))
|
||||
user << "\red You cannot build on or repair this turf!"
|
||||
return
|
||||
src.build(T)
|
||||
src.add_fingerprint(user)
|
||||
use(1)
|
||||
return
|
||||
*/
|
||||
|
||||
/obj/item/stack/tile/plasteel/proc/build(turf/S as turf)
|
||||
if (istype(S,/turf/space))
|
||||
S.ChangeTurf(/turf/simulated/floor/plating/airless)
|
||||
else
|
||||
S.ChangeTurf(/turf/simulated/floor/plating)
|
||||
// var/turf/simulated/floor/W = S.ReplaceWithFloor()
|
||||
// W.make_plating()
|
||||
return
|
||||
return
|
||||
|
||||
@@ -1,9 +1,23 @@
|
||||
/* Diffrent misc types of tiles
|
||||
/* Different misc types of tiles
|
||||
* Contains:
|
||||
* Grass
|
||||
* Wood
|
||||
* Carpet
|
||||
*/
|
||||
/obj/item/stack/tile
|
||||
name = "broken tile"
|
||||
singular_name = "broken tile"
|
||||
desc = "A broken tile. This should not exist."
|
||||
icon = 'icons/obj/items.dmi'
|
||||
icon_state = "tile"
|
||||
item_state = "tile"
|
||||
w_class = 3
|
||||
force = 1
|
||||
throwforce = 1
|
||||
throw_speed = 5
|
||||
throw_range = 20
|
||||
max_amount = 60
|
||||
flags = CONDUCT
|
||||
|
||||
/*
|
||||
* Grass
|
||||
@@ -14,13 +28,6 @@
|
||||
singular_name = "grass floor tile"
|
||||
desc = "A patch of grass like they often use on golf courses"
|
||||
icon_state = "tile_grass"
|
||||
w_class = 3.0
|
||||
force = 1.0
|
||||
throwforce = 1.0
|
||||
throw_speed = 5
|
||||
throw_range = 20
|
||||
flags = CONDUCT
|
||||
max_amount = 60
|
||||
origin_tech = "biotech=1"
|
||||
|
||||
/*
|
||||
@@ -32,13 +39,6 @@
|
||||
singular_name = "wood floor tile"
|
||||
desc = "an easy to fit wood floor tile"
|
||||
icon_state = "tile-wood"
|
||||
w_class = 3.0
|
||||
force = 1.0
|
||||
throwforce = 1.0
|
||||
throw_speed = 5
|
||||
throw_range = 20
|
||||
flags = CONDUCT
|
||||
max_amount = 60
|
||||
|
||||
/*
|
||||
* Carpets
|
||||
@@ -48,10 +48,3 @@
|
||||
singular_name = "carpet"
|
||||
desc = "A piece of carpet. It is the same size as a floor tile"
|
||||
icon_state = "tile-carpet"
|
||||
w_class = 3.0
|
||||
force = 1.0
|
||||
throwforce = 1.0
|
||||
throw_speed = 5
|
||||
throw_range = 20
|
||||
flags = CONDUCT
|
||||
max_amount = 60
|
||||
@@ -732,8 +732,12 @@ obj/item/toy/cards/deck/MouseDrop(atom/over_object)
|
||||
else if(istype(over_object, /obj/screen))
|
||||
switch(over_object.name)
|
||||
if("l_hand")
|
||||
if(!remove_item_from_storage(M))
|
||||
M.unEquip(src)
|
||||
M.put_in_l_hand(src)
|
||||
else if("r_hand")
|
||||
if(!remove_item_from_storage(M))
|
||||
M.unEquip(src)
|
||||
M.put_in_r_hand(src)
|
||||
usr << "<span class='notice'>You pick up the deck.</span>"
|
||||
else
|
||||
|
||||
@@ -96,7 +96,8 @@
|
||||
var/obj/item/stack/rods/R = I
|
||||
if (R.use(1))
|
||||
var/obj/item/weapon/wirerod/W = new /obj/item/weapon/wirerod
|
||||
user.unEquip(src)
|
||||
if(!remove_item_from_storage(user))
|
||||
user.unEquip(src)
|
||||
user.put_in_hands(W)
|
||||
user << "<span class='notice'>You wrap the cable restraint around the top of the rod.</span>"
|
||||
qdel(src)
|
||||
|
||||
@@ -8,6 +8,8 @@
|
||||
desc = "You wear this on your back and put items into it."
|
||||
icon_state = "backpack"
|
||||
item_state = "backpack"
|
||||
lefthand_file = 'icons/mob/inhands/clothing_lefthand.dmi'
|
||||
righthand_file = 'icons/mob/inhands/clothing_righthand.dmi'
|
||||
w_class = 4.0
|
||||
slot_flags = SLOT_BACK //ERROOOOO
|
||||
max_w_class = 3
|
||||
|
||||
@@ -30,7 +30,6 @@
|
||||
name = "large box"
|
||||
desc = "You could build a fort with this."
|
||||
icon_state = "largebox"
|
||||
item_state = "largebox"
|
||||
w_class = 42 // Big, bulky.
|
||||
foldable = /obj/item/stack/sheet/cardboard //BubbleWrap
|
||||
storage_slots = 21
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
New()
|
||||
..()
|
||||
new /obj/item/weapon/crowbar/red(src)
|
||||
new /obj/item/weapon/weldingtool/mini(src)
|
||||
new /obj/item/weapon/extinguisher/mini(src)
|
||||
if(prob(50))
|
||||
new /obj/item/device/flashlight(src)
|
||||
@@ -83,10 +84,10 @@
|
||||
|
||||
New()
|
||||
..()
|
||||
new /obj/item/weapon/screwdriver(src)
|
||||
new /obj/item/weapon/screwdriver(src, "red")
|
||||
new /obj/item/weapon/wrench(src)
|
||||
new /obj/item/weapon/weldingtool(src)
|
||||
new /obj/item/weapon/crowbar(src)
|
||||
new /obj/item/weapon/wirecutters(src)
|
||||
new /obj/item/weapon/weldingtool/largetank(src)
|
||||
new /obj/item/weapon/crowbar/red(src)
|
||||
new /obj/item/weapon/wirecutters(src, "red")
|
||||
new /obj/item/device/multitool(src)
|
||||
new /obj/item/clothing/gloves/combat(src)
|
||||
@@ -112,8 +112,9 @@
|
||||
sharp = 1
|
||||
edge = 1
|
||||
|
||||
/obj/item/weapon/wirecutters/New()
|
||||
if(prob(50))
|
||||
/obj/item/weapon/wirecutters/New(loc, var/param_color = null)
|
||||
..()
|
||||
if((!param_color && prob(50)) || param_color == "yellow")
|
||||
icon_state = "cutters-y"
|
||||
item_state = "cutters_yellow"
|
||||
|
||||
@@ -136,15 +137,16 @@
|
||||
name = "welding tool"
|
||||
icon = 'icons/obj/items.dmi'
|
||||
icon_state = "welder"
|
||||
item_state = "welder"
|
||||
flags = CONDUCT
|
||||
slot_flags = SLOT_BELT
|
||||
|
||||
//Amount of OUCH when it's thrown
|
||||
force = 3.0
|
||||
throwforce = 5.0
|
||||
force = 3
|
||||
throwforce = 5
|
||||
throw_speed = 3
|
||||
throw_range = 5
|
||||
w_class = 2.0
|
||||
w_class = 2
|
||||
|
||||
//Cost to make in the autolathe
|
||||
materials = list(MAT_METAL=70, MAT_GLASS=30)
|
||||
@@ -156,132 +158,137 @@
|
||||
var/welding = 0 //Whether or not the welding tool is off(0), on(1) or currently welding(2)
|
||||
var/status = 1 //Whether the welder is secured or unsecured (able to attach rods to it to make a flamethrower)
|
||||
var/max_fuel = 20 //The max amount of fuel the welder can hold
|
||||
var/change_icons = 1
|
||||
var/can_off_process = 0
|
||||
var/light_intensity = 2 //how powerful the emitted light is when used.
|
||||
|
||||
/obj/item/weapon/weldingtool/New()
|
||||
// var/random_fuel = min(rand(10,20),max_fuel)
|
||||
var/datum/reagents/R = new/datum/reagents(max_fuel)
|
||||
reagents = R
|
||||
R.my_atom = src
|
||||
R.add_reagent("fuel", max_fuel)
|
||||
..()
|
||||
create_reagents(max_fuel)
|
||||
reagents.add_reagent("fuel", max_fuel)
|
||||
update_icon()
|
||||
return
|
||||
|
||||
|
||||
|
||||
/obj/item/weapon/weldingtool/examine(mob/user)
|
||||
if(!..(user, 0))
|
||||
user << text("\icon[] [] contains []/[] units of fuel!", src, src.name, get_fuel(),src.max_fuel )
|
||||
user << "It contains [get_fuel()] unit\s of fuel out of [max_fuel]."
|
||||
|
||||
/obj/item/weapon/weldingtool/suicide_act(mob/user)
|
||||
user.visible_message("<span class='suicide'>[user] welds \his every orifice closed! It looks like \he's trying to commit suicide..</span>")
|
||||
return (FIRELOSS)
|
||||
|
||||
/obj/item/weapon/weldingtool/proc/update_torch()
|
||||
overlays.Cut()
|
||||
if(welding)
|
||||
overlays += "[initial(icon_state)]-on"
|
||||
item_state = "[initial(item_state)]1"
|
||||
else
|
||||
item_state = "[initial(item_state)]"
|
||||
|
||||
|
||||
|
||||
/obj/item/weapon/weldingtool/attackby(obj/item/W as obj, mob/user as mob, params)
|
||||
if(istype(W,/obj/item/weapon/screwdriver))
|
||||
if(welding)
|
||||
user << "\red Stop welding first!"
|
||||
return
|
||||
status = !status
|
||||
if(status)
|
||||
user << "\blue You resecure the welder."
|
||||
/obj/item/weapon/weldingtool/update_icon()
|
||||
if(change_icons)
|
||||
var/ratio = get_fuel() / max_fuel
|
||||
ratio = Ceiling(ratio*4) * 25
|
||||
if(ratio == 100)
|
||||
icon_state = initial(icon_state)
|
||||
else
|
||||
user << "\blue The welder can now be attached and modified."
|
||||
src.add_fingerprint(user)
|
||||
return
|
||||
|
||||
if((!status) && (istype(W,/obj/item/stack/rods)))
|
||||
var/obj/item/stack/rods/R = W
|
||||
R.use(1)
|
||||
var/obj/item/weapon/flamethrower/F = new/obj/item/weapon/flamethrower(user.loc)
|
||||
src.loc = F
|
||||
F.weldtool = src
|
||||
if (user.client)
|
||||
user.client.screen -= src
|
||||
if (user.r_hand == src)
|
||||
user.unEquip(src)
|
||||
else
|
||||
user.unEquip(src)
|
||||
src.master = F
|
||||
src.layer = initial(src.layer)
|
||||
user.unEquip(src)
|
||||
if (user.client)
|
||||
user.client.screen -= src
|
||||
src.loc = F
|
||||
src.add_fingerprint(user)
|
||||
return
|
||||
|
||||
..()
|
||||
icon_state = "[initial(icon_state)][ratio]"
|
||||
update_torch()
|
||||
return
|
||||
|
||||
/obj/item/weapon/weldingtool/attackby(obj/item/I as obj, mob/user as mob, params)
|
||||
if(istype(I, /obj/item/weapon/screwdriver))
|
||||
flamethrower_screwdriver(I, user)
|
||||
if(istype(I, /obj/item/stack/rods))
|
||||
flamethrower_rods(I, user)
|
||||
..()
|
||||
|
||||
/obj/item/weapon/weldingtool/process()
|
||||
switch(welding)
|
||||
//If off
|
||||
if(0)
|
||||
if(src.icon_state != "welder") //Check that the sprite is correct, if it isnt, it means toggle() was not called
|
||||
src.force = 3
|
||||
src.damtype = "brute"
|
||||
src.icon_state = "welder"
|
||||
src.welding = 0
|
||||
processing_objects.Remove(src)
|
||||
force = 3
|
||||
damtype = "brute"
|
||||
update_icon()
|
||||
if(!can_off_process)
|
||||
processing_objects.Remove(src)
|
||||
return
|
||||
//Welders left on now use up fuel, but lets not have them run out quite that fast
|
||||
//Welders left on now use up fuel, but lets not have them run out quite that fast
|
||||
if(1)
|
||||
if(src.icon_state != "welder1") //Check that the sprite is correct, if it isnt, it means toggle() was not called
|
||||
src.force = 15
|
||||
src.damtype = "fire"
|
||||
src.icon_state = "welder1"
|
||||
force = 15
|
||||
damtype = "fire"
|
||||
if(prob(5))
|
||||
remove_fuel(1)
|
||||
update_icon()
|
||||
|
||||
//If you're actually actively welding, use fuel faster.
|
||||
//Is this actually used or set anywhere? - Nodrak
|
||||
if(2)
|
||||
if(prob(75))
|
||||
remove_fuel(1)
|
||||
|
||||
|
||||
//I'm not sure what this does. I assume it has to do with starting fires...
|
||||
//...but it doesnt check to see if the welder is on or not.
|
||||
var/turf/location = src.loc
|
||||
if(istype(location, /mob/))
|
||||
//This is to start fires. process() is only called if the welder is on.
|
||||
var/turf/location = loc
|
||||
if(ismob(location))
|
||||
var/mob/M = location
|
||||
if(M.l_hand == src || M.r_hand == src)
|
||||
location = get_turf(M)
|
||||
if (istype(location, /turf))
|
||||
if(isturf(location))
|
||||
location.hotspot_expose(700, 5)
|
||||
|
||||
/obj/item/weapon/weldingtool/attack(mob/M as mob, mob/user as mob)
|
||||
if(ishuman(M))
|
||||
var/mob/living/carbon/human/H = M
|
||||
var/obj/item/organ/external/S = H.organs_by_name[user.zone_sel.selecting]
|
||||
if (!S)
|
||||
return
|
||||
|
||||
if(!(S.status & ORGAN_ROBOT) || user.a_intent != I_HELP || S.open == 2)
|
||||
return ..()
|
||||
|
||||
if(S.brute_dam)
|
||||
if(S.brute_dam < ROBOLIMB_SELF_REPAIR_CAP)
|
||||
if (remove_fuel(0,null))
|
||||
playsound(src.loc, 'sound/items/Welder2.ogg', 50, 1)
|
||||
S.heal_damage(15,0,0,1)
|
||||
user.visible_message("<span class='alert'>\The [user] patches some dents on \the [M]'s [S.name] with \the [src].</span>")
|
||||
else if(S.open != 2)
|
||||
user << "<span class='warning'>Need more welding fuel!</span>"
|
||||
return 1
|
||||
else
|
||||
user << "<span class='danger'>The damage is far too severe to patch over externally.</span>"
|
||||
return 1
|
||||
else if(S.open != 2)
|
||||
user << "<span class='notice'>Nothing to fix!</span>"
|
||||
else
|
||||
return ..()
|
||||
|
||||
/obj/item/weapon/weldingtool/afterattack(obj/O as obj, mob/user as mob, proximity)
|
||||
if(!proximity) return
|
||||
if (istype(O, /obj/structure/reagent_dispensers/fueltank) && get_dist(src,O) <= 1 && !src.welding)
|
||||
O.reagents.trans_to(src, max_fuel)
|
||||
user << "\blue Welder refueled"
|
||||
playsound(src.loc, 'sound/effects/refill.ogg', 50, 1, -6)
|
||||
return
|
||||
else if (istype(O, /obj/structure/reagent_dispensers/fueltank) && get_dist(src,O) <= 1 && src.welding)
|
||||
msg_admin_attack("[key_name_admin(user)] triggered a fueltank explosion.")
|
||||
log_game("[key_name(user)] triggered a fueltank explosion.")
|
||||
user << "\red That was stupid of you."
|
||||
var/obj/structure/reagent_dispensers/fueltank/tank = O
|
||||
tank.explode()
|
||||
return
|
||||
if (src.welding)
|
||||
if(istype(O, /obj/structure/reagent_dispensers/fueltank) && in_range(src, O))
|
||||
if(!welding)
|
||||
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.")
|
||||
log_game("[key_name(user)] triggered a fueltank explosion.")
|
||||
user << "<span class='warning'>That was stupid of you.</span>"
|
||||
O.ex_act()
|
||||
return
|
||||
|
||||
if(welding)
|
||||
remove_fuel(1)
|
||||
var/turf/location = get_turf(user)
|
||||
if (istype(location, /turf))
|
||||
location.hotspot_expose(700, 50, 1)
|
||||
location.hotspot_expose(700, 50, 1)
|
||||
|
||||
if(isliving(O))
|
||||
var/mob/living/L = O
|
||||
L.IgniteMob()
|
||||
return
|
||||
|
||||
|
||||
/obj/item/weapon/weldingtool/attack_self(mob/user as mob)
|
||||
toggle()
|
||||
return
|
||||
/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()
|
||||
return reagents.get_reagent_amount("fuel")
|
||||
|
||||
|
||||
//Removes fuel from the welding tool. If a mob is passed, it will perform an eyecheck on the mob. This should probably be renamed to use()
|
||||
/obj/item/weapon/weldingtool/proc/remove_fuel(var/amount = 1, var/mob/M = null)
|
||||
if(!welding || !check_fuel())
|
||||
@@ -299,67 +306,48 @@
|
||||
|
||||
//Returns whether or not the welding tool is currently on.
|
||||
/obj/item/weapon/weldingtool/proc/isOn()
|
||||
return src.welding
|
||||
|
||||
//Sets the welding state of the welding tool. If you see W.welding = 1 anywhere, please change it to W.setWelding(1)
|
||||
//so that the welding tool updates accordingly
|
||||
/obj/item/weapon/weldingtool/proc/setWelding(var/temp_welding)
|
||||
//If we're turning it on
|
||||
if(temp_welding > 0)
|
||||
if (get_fuel() > 0)
|
||||
usr << "\blue The [src] switches on."
|
||||
src.force = 15
|
||||
src.damtype = "fire"
|
||||
src.icon_state = "welder1"
|
||||
processing_objects.Add(src)
|
||||
else
|
||||
usr << "\blue Need more fuel!"
|
||||
src.welding = 0
|
||||
return
|
||||
//Otherwise
|
||||
else
|
||||
usr << "\blue The [src] switches off."
|
||||
src.force = 3
|
||||
src.damtype = "brute"
|
||||
src.icon_state = "welder"
|
||||
src.welding = 0
|
||||
return welding
|
||||
|
||||
//Turns off the welder if there is no more fuel (does this really need to be its own proc?)
|
||||
/obj/item/weapon/weldingtool/proc/check_fuel()
|
||||
if((get_fuel() <= 0) && welding)
|
||||
toggle(1)
|
||||
/obj/item/weapon/weldingtool/proc/check_fuel(mob/user)
|
||||
if(get_fuel() <= 0 && welding)
|
||||
toggle(user, 1)
|
||||
update_icon()
|
||||
//mob icon update
|
||||
if(ismob(loc))
|
||||
var/mob/M = loc
|
||||
M.update_inv_r_hand(0)
|
||||
M.update_inv_l_hand(0)
|
||||
|
||||
return 0
|
||||
return 1
|
||||
|
||||
|
||||
//Toggles the welder off and on
|
||||
/obj/item/weapon/weldingtool/proc/toggle(var/message = 0)
|
||||
if(!status) return
|
||||
src.welding = !( src.welding )
|
||||
if (src.welding)
|
||||
if (remove_fuel(1))
|
||||
usr << "\blue You switch the [src] on."
|
||||
src.w_class = 4
|
||||
src.force = 15
|
||||
src.damtype = "fire"
|
||||
hitsound = "sound/items/welder.ogg"
|
||||
src.icon_state = "welder1"
|
||||
processing_objects.Add(src)
|
||||
/obj/item/weapon/weldingtool/proc/toggle(mob/user, message = 0)
|
||||
if(!status)
|
||||
user << "<span class='warning'>[src] can't be turned on while unsecured!</span>"
|
||||
return
|
||||
welding = !welding
|
||||
if(welding)
|
||||
if(get_fuel() >= 1)
|
||||
user << "<span class='notice'>You switch [src] on.</span>"
|
||||
force = 15
|
||||
damtype = "fire"
|
||||
hitsound = 'sound/items/welder.ogg'
|
||||
update_icon()
|
||||
processing_objects |= src
|
||||
else
|
||||
usr << "\blue Need more fuel!"
|
||||
src.welding = 0
|
||||
return
|
||||
user << "<span class='warning'>You need more fuel!</span>"
|
||||
welding = 0
|
||||
else
|
||||
if(!message)
|
||||
usr << "\blue You switch the [src] off."
|
||||
user << "<span class='notice'>You switch [src] off.</span>"
|
||||
else
|
||||
usr << "\blue The [src] shuts off!"
|
||||
src.w_class = 2
|
||||
src.force = 3
|
||||
src.damtype = "brute"
|
||||
user << "<span class='warning'>[src] shuts off!</span>"
|
||||
force = 3
|
||||
damtype = "brute"
|
||||
hitsound = "swing_hit"
|
||||
src.icon_state = "welder"
|
||||
src.welding = 0
|
||||
update_icon()
|
||||
|
||||
//Decides whether or not to damage a player's eyes based on what they're wearing as protection
|
||||
//Note: This should probably be moved to mob
|
||||
@@ -387,10 +375,8 @@
|
||||
user.eye_blurry += rand(12,20)
|
||||
E.damage += rand(12, 16)
|
||||
if(safety<2)
|
||||
|
||||
if(E.damage > 10)
|
||||
user << "<span class='danger'>Your eyes are really starting to hurt. This can't be good for you!</span>"
|
||||
|
||||
if (E.damage >= E.min_broken_damage)
|
||||
user << "<span class='danger'>You go blind!</span>"
|
||||
user.sdisabilities |= BLIND
|
||||
@@ -402,16 +388,64 @@
|
||||
spawn(100)
|
||||
user.disabilities &= ~NEARSIGHTED
|
||||
return
|
||||
|
||||
/obj/item/weapon/weldingtool/proc/flamethrower_screwdriver(obj/item/I, mob/user)
|
||||
if(welding)
|
||||
user << "<span class='warning'>Turn it off first!</span>"
|
||||
return
|
||||
status = !status
|
||||
if(status)
|
||||
user << "<span class='notice'>You resecure [src].</span>"
|
||||
else
|
||||
user << "<span class='notice'>[src] can now be attached and modified.</span>"
|
||||
add_fingerprint(user)
|
||||
|
||||
/obj/item/weapon/weldingtool/proc/flamethrower_rods(obj/item/I, mob/user)
|
||||
if(!status)
|
||||
var/obj/item/stack/rods/R = I
|
||||
if (R.use(1))
|
||||
var/obj/item/weapon/flamethrower/F = new /obj/item/weapon/flamethrower(user.loc)
|
||||
if(!remove_item_from_storage(F))
|
||||
user.unEquip(src)
|
||||
loc = F
|
||||
F.weldtool = src
|
||||
add_fingerprint(user)
|
||||
user << "<span class='notice'>You add a rod to a welder, starting to build a flamethrower.</span>"
|
||||
user.put_in_hands(F)
|
||||
else
|
||||
user << "<span class='warning'>You need one rod to start building a flamethrower!</span>"
|
||||
return
|
||||
|
||||
/obj/item/weapon/weldingtool/largetank
|
||||
name = "Industrial Welding Tool"
|
||||
desc = "A slightly larger welder with a larger tank."
|
||||
icon_state = "indwelder"
|
||||
max_fuel = 40
|
||||
materials = list(MAT_METAL=70, MAT_GLASS=60)
|
||||
origin_tech = "engineering=2"
|
||||
|
||||
/obj/item/weapon/weldingtool/largetank/cyborg
|
||||
|
||||
/obj/item/weapon/weldingtool/largetank/flamethrower_screwdriver()
|
||||
return
|
||||
|
||||
/obj/item/weapon/weldingtool/mini
|
||||
name = "emergency welding tool"
|
||||
desc = "A miniature welder used during emergencies."
|
||||
icon_state = "miniwelder"
|
||||
max_fuel = 10
|
||||
w_class = 1
|
||||
materials = list(MAT_METAL=30, MAT_GLASS=10)
|
||||
change_icons = 0
|
||||
|
||||
/obj/item/weapon/weldingtool/mini/flamethrower_screwdriver()
|
||||
return
|
||||
|
||||
/obj/item/weapon/weldingtool/hugetank
|
||||
name = "Upgraded Welding Tool"
|
||||
desc = "An upgraded welder based of the industrial welder."
|
||||
icon_state = "upindwelder"
|
||||
item_state = "upindwelder"
|
||||
max_fuel = 80
|
||||
w_class = 3.0
|
||||
materials = list(MAT_METAL=70, MAT_GLASS=120)
|
||||
@@ -419,20 +453,29 @@
|
||||
|
||||
/obj/item/weapon/weldingtool/experimental
|
||||
name = "Experimental Welding Tool"
|
||||
desc = "An experimental welder capable of self-fuel generation and less harmful to the eyes."
|
||||
icon_state = "exwelder"
|
||||
item_state = "exwelder"
|
||||
max_fuel = 40
|
||||
w_class = 3.0
|
||||
materials = list(MAT_METAL=70, MAT_GLASS=120)
|
||||
origin_tech = "engineering=4;plasma=3"
|
||||
icon_state = "ewelder"
|
||||
var/last_gen = 0
|
||||
change_icons = 0
|
||||
can_off_process = 1
|
||||
light_intensity = 1
|
||||
|
||||
/obj/item/weapon/weldingtool/experimental/proc/fuel_gen()
|
||||
if(!welding && !last_gen)
|
||||
last_gen = 1
|
||||
reagents.add_reagent("fuel",1)
|
||||
spawn(10)
|
||||
last_gen = 0
|
||||
|
||||
|
||||
/obj/item/weapon/weldingtool/experimental/proc/fuel_gen()//Proc to make the experimental welder generate fuel, optimized as fuck -Sieve
|
||||
var/gen_amount = ((world.time-last_gen)/25)
|
||||
reagents += (gen_amount)
|
||||
if(reagents > max_fuel)
|
||||
reagents = max_fuel
|
||||
/obj/item/weapon/weldingtool/experimental/process()
|
||||
..()
|
||||
if(reagents.total_volume < max_fuel)
|
||||
fuel_gen()
|
||||
|
||||
/*
|
||||
* Crowbar
|
||||
@@ -468,35 +511,6 @@
|
||||
materials = list(MAT_METAL=70)
|
||||
icon_state = "crowbar_large"
|
||||
|
||||
/obj/item/weapon/weldingtool/attack(mob/M as mob, mob/user as mob)
|
||||
if(ishuman(M))
|
||||
var/mob/living/carbon/human/H = M
|
||||
var/obj/item/organ/external/S = H.organs_by_name[user.zone_sel.selecting]
|
||||
|
||||
if (!S)
|
||||
return
|
||||
if(!(S.status & ORGAN_ROBOT) || user.a_intent != I_HELP || S.open == 2)
|
||||
return ..()
|
||||
|
||||
if(S.brute_dam)
|
||||
if(S.brute_dam < ROBOLIMB_SELF_REPAIR_CAP)
|
||||
if (remove_fuel(0,null))
|
||||
playsound(src.loc, 'sound/items/Welder2.ogg', 50, 1)
|
||||
S.heal_damage(15,0,0,1)
|
||||
user.visible_message("<span class='alert'>\The [user] patches some dents on \the [M]'s [S.name] with \the [src].</span>")
|
||||
else if(S.open != 2)
|
||||
user << "<span class='warning'>Need more welding fuel!</span>"
|
||||
return 1
|
||||
else
|
||||
user << "<span class='danger'>The damage is far too severe to patch over externally.</span>"
|
||||
return 1
|
||||
else if(S.open != 2)
|
||||
user << "<span class='notice'>Nothing to fix!</span>"
|
||||
|
||||
else
|
||||
return ..()
|
||||
|
||||
|
||||
/obj/item/weapon/conversion_kit
|
||||
name = "\improper Revolver Conversion Kit"
|
||||
desc = "A professional conversion kit used to convert any knock off revolver into the real deal capable of shooting lethal .357 rounds without the possibility of catastrophic failure"
|
||||
|
||||
@@ -159,9 +159,10 @@ obj/item/weapon/wirerod/attackby(var/obj/item/I, mob/user as mob, params)
|
||||
..()
|
||||
if(istype(I, /obj/item/weapon/shard))
|
||||
var/obj/item/weapon/twohanded/spear/S = new /obj/item/weapon/twohanded/spear
|
||||
|
||||
|
||||
if(!remove_item_from_storage(user))
|
||||
user.unEquip(src)
|
||||
user.unEquip(I)
|
||||
user.unEquip(src)
|
||||
|
||||
user.put_in_hands(S)
|
||||
user << "<span class='notice'>You fasten the glass shard to the top of the rod with the cable.</span>"
|
||||
@@ -171,8 +172,9 @@ obj/item/weapon/wirerod/attackby(var/obj/item/I, mob/user as mob, params)
|
||||
else if(istype(I, /obj/item/weapon/wirecutters))
|
||||
var/obj/item/weapon/melee/baton/cattleprod/P = new /obj/item/weapon/melee/baton/cattleprod
|
||||
|
||||
if(!remove_item_from_storage(user))
|
||||
user.unEquip(src)
|
||||
user.unEquip(I)
|
||||
user.unEquip(src)
|
||||
|
||||
user.put_in_hands(P)
|
||||
user << "<span class='notice'>You fasten the wirecutters to the top of the rod with the cable, prongs outward.</span>"
|
||||
|
||||
Reference in New Issue
Block a user