Files
Bubberstation/code/game/objects/items/tools/screwdriver.dm
XDTM 5a08a3aad0 Extends the disability refactor to include more traits, removing some snowflake code (#34664)
This way you can add/remove traits without fear of other sources overriding them. Now you can add TRAIT_STUNIMMUNE to somebody without what if hulk

Notable changes:

    Fakedeath now updates instantly, instead of waiting for the next life tick.
    Fakedeath now sets time of death when acquired.
    Removed extremely snowflake code in reagents that checked if you had morphine to remove slow immunity and so on.
    Hulk no longer overrides status_flag changes, in case there are any.
2018-01-25 09:12:44 +13:00

135 lines
5.0 KiB
Plaintext

/obj/item/screwdriver
name = "screwdriver"
desc = "You can be totally screwy with this."
icon = 'icons/obj/tools.dmi'
icon_state = "screwdriver_map"
item_state = "screwdriver"
lefthand_file = 'icons/mob/inhands/equipment/tools_lefthand.dmi'
righthand_file = 'icons/mob/inhands/equipment/tools_righthand.dmi'
flags_1 = CONDUCT_1
slot_flags = SLOT_BELT
force = 5
w_class = WEIGHT_CLASS_TINY
throwforce = 5
throw_speed = 3
throw_range = 5
materials = list(MAT_METAL=75)
attack_verb = list("stabbed")
hitsound = 'sound/weapons/bladeslice.ogg'
usesound = 'sound/items/screwdriver.ogg'
tool_behaviour = TOOL_SCREWDRIVER
toolspeed = 1
armor = list(melee = 0, bullet = 0, laser = 0, energy = 0, bomb = 0, bio = 0, rad = 0, fire = 50, acid = 30)
var/random_color = TRUE //if the screwdriver uses random coloring
var/static/list/screwdriver_colors = list(
"blue" = rgb(24, 97, 213),
"red" = rgb(255, 0, 0),
"pink" = rgb(213, 24, 141),
"brown" = rgb(160, 82, 18),
"green" = rgb(14, 127, 27),
"cyan" = rgb(24, 162, 213),
"yellow" = rgb(255, 165, 0)
)
/obj/item/screwdriver/suicide_act(mob/user)
user.visible_message("<span class='suicide'>[user] is stabbing [src] into [user.p_their()] [pick("temple", "heart")]! It looks like [user.p_theyre()] trying to commit suicide!</span>")
return(BRUTELOSS)
/obj/item/screwdriver/Initialize()
. = ..()
if(random_color) //random colors!
icon_state = "screwdriver"
var/our_color = pick(screwdriver_colors)
add_atom_colour(screwdriver_colors[our_color], FIXED_COLOUR_PRIORITY)
update_icon()
if(prob(75))
pixel_y = rand(0, 16)
/obj/item/screwdriver/update_icon()
if(!random_color) //icon override
return
cut_overlays()
var/mutable_appearance/base_overlay = mutable_appearance(icon, "screwdriver_screwybits")
base_overlay.appearance_flags = RESET_COLOR
add_overlay(base_overlay)
/obj/item/screwdriver/worn_overlays(isinhands = FALSE, icon_file)
. = list()
if(isinhands && random_color)
var/mutable_appearance/M = mutable_appearance(icon_file, "screwdriver_head")
M.appearance_flags = RESET_COLOR
. += M
/obj/item/screwdriver/get_belt_overlay()
if(random_color)
var/mutable_appearance/body = mutable_appearance('icons/obj/clothing/belt_overlays.dmi', "screwdriver")
var/mutable_appearance/head = mutable_appearance('icons/obj/clothing/belt_overlays.dmi', "screwdriver_head")
body.color = color
head.add_overlay(body)
return head
else
return mutable_appearance('icons/obj/clothing/belt_overlays.dmi', icon_state)
/obj/item/screwdriver/attack(mob/living/carbon/M, mob/living/carbon/user)
if(!istype(M))
return ..()
if(user.zone_selected != "eyes" && user.zone_selected != "head")
return ..()
if(user.has_trait(TRAIT_CLUMSY) && prob(50))
M = user
return eyestab(M,user)
/obj/item/screwdriver/brass
name = "brass screwdriver"
desc = "A screwdriver made of brass. The handle feels freezing cold."
resistance_flags = FIRE_PROOF | ACID_PROOF
icon_state = "screwdriver_brass"
item_state = "screwdriver_brass"
toolspeed = 0.5
random_color = FALSE
/obj/item/screwdriver/abductor
name = "alien screwdriver"
desc = "An ultrasonic screwdriver."
icon = 'icons/obj/abductor.dmi'
icon_state = "screwdriver_a"
item_state = "screwdriver_nuke"
usesound = 'sound/items/pshoom.ogg'
toolspeed = 0.1
random_color = FALSE
/obj/item/screwdriver/power
name = "hand drill"
desc = "A simple powered hand drill. It's fitted with a screw bit."
icon_state = "drill_screw"
item_state = "drill"
lefthand_file = 'icons/mob/inhands/equipment/tools_lefthand.dmi'
righthand_file = 'icons/mob/inhands/equipment/tools_righthand.dmi'
materials = list(MAT_METAL=150,MAT_SILVER=50,MAT_TITANIUM=25) //done for balance reasons, making them high value for research, but harder to get
force = 8 //might or might not be too high, subject to change
w_class = WEIGHT_CLASS_SMALL
throwforce = 8
throw_speed = 2
throw_range = 3//it's heavier than a screw driver/wrench, so it does more damage, but can't be thrown as far
attack_verb = list("drilled", "screwed", "jabbed","whacked")
hitsound = 'sound/items/drill_hit.ogg'
usesound = 'sound/items/drill_use.ogg'
toolspeed = 0.25
random_color = FALSE
/obj/item/screwdriver/power/suicide_act(mob/user)
user.visible_message("<span class='suicide'>[user] is putting [src] to [user.p_their()] temple. It looks like [user.p_theyre()] trying to commit suicide!</span>")
return(BRUTELOSS)
/obj/item/screwdriver/power/attack_self(mob/user)
playsound(get_turf(user),'sound/items/change_drill.ogg',50,1)
var/obj/item/wrench/power/b_drill = new /obj/item/wrench/power
to_chat(user, "<span class='notice'>You attach the bolt driver bit to [src].</span>")
qdel(src)
user.put_in_active_hand(b_drill)
/obj/item/screwdriver/cyborg
name = "powered screwdriver"
desc = "An electrical screwdriver, designed to be both precise and quick."
usesound = 'sound/items/drill_use.ogg'
toolspeed = 0.5