mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-01-11 17:35:05 +00:00
About The Pull Request Converts every single usage of playsound's vary parameter to use the boolean define instead of 1 or 0. I'm tired of people copypasting the incorrect usage. Also changes a couple of places where a list was picked from instead of using get_sfx internal calls This was done via regex: (playsound\(.+,.+,.+, ?)1( ?\)| ?,.+\)) to match 1 (playsound\(.+,.+,.+, ?)0( ?\)| ?,.+\)) to match 0 full sed commands: /(playsound\(.+,.+,.+, ?)1( ?\)| ?,.+\))/\1TRUE\2/ 1 to TRUE /(playsound\(.+,.+,.+, ?)0( ?\)| ?,.+\))/\1FALSE\2/ 0 to FALSE I'm not very good with regex and these could probably be optimized, but they worked. Why It's Good For The Game Code usability
146 lines
5.5 KiB
Plaintext
146 lines
5.5 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 = ITEM_SLOT_BELT
|
|
force = 5
|
|
w_class = WEIGHT_CLASS_TINY
|
|
throwforce = 5
|
|
throw_speed = 3
|
|
throw_range = 5
|
|
materials = list(/datum/material/iron=75)
|
|
attack_verb = list("stabbed")
|
|
hitsound = 'sound/weapons/bladeslice.ogg'
|
|
usesound = list('sound/items/screwdriver.ogg', 'sound/items/screwdriver2.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 != BODY_ZONE_PRECISE_EYES && user.zone_selected != BODY_ZONE_HEAD)
|
|
return ..()
|
|
if(HAS_TRAIT(user, TRAIT_PACIFISM))
|
|
to_chat(user, "<span class='warning'>You don't want to harm [M]!</span>")
|
|
return
|
|
if(HAS_TRAIT(user, 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/abductor/get_belt_overlay()
|
|
return mutable_appearance('icons/obj/clothing/belt_overlays.dmi', "screwdriver_nuke")
|
|
|
|
/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(/datum/material/iron=150,/datum/material/silver=50,/datum/material/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.7
|
|
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,TRUE)
|
|
var/obj/item/wrench/power/b_drill = new /obj/item/wrench/power(drop_location())
|
|
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 = "automated screwdriver"
|
|
desc = "A powerful automated screwdriver, designed to be both precise and quick."
|
|
icon = 'icons/obj/items_cyborg.dmi'
|
|
icon_state = "screwdriver_cyborg"
|
|
hitsound = 'sound/items/drill_hit.ogg'
|
|
usesound = 'sound/items/drill_use.ogg'
|
|
toolspeed = 0.5
|
|
random_color = FALSE
|