This commit is contained in:
Putnam
2020-01-14 03:27:03 -08:00
1098 changed files with 194826 additions and 196589 deletions
+37 -37
View File
@@ -1,37 +1,37 @@
/obj/effect/bump_teleporter
name = "bump-teleporter"
icon = 'icons/mob/screen_gen.dmi'
icon_state = "x2"
var/id = null //id of this bump_teleporter.
var/id_target = null //id of bump_teleporter which this moves you to.
invisibility = INVISIBILITY_ABSTRACT //nope, can't see this
anchored = TRUE
density = TRUE
opacity = 0
var/static/list/AllTeleporters
/obj/effect/bump_teleporter/Initialize()
. = ..()
LAZYADD(AllTeleporters, src)
/obj/effect/bump_teleporter/Destroy()
LAZYREMOVE(AllTeleporters, src)
return ..()
/obj/effect/bump_teleporter/singularity_act()
return
/obj/effect/bump_teleporter/singularity_pull()
return
/obj/effect/bump_teleporter/Bumped(atom/movable/AM)
if(!ismob(AM))
return
if(!id_target)
return
for(var/obj/effect/bump_teleporter/BT in AllTeleporters)
if(BT.id == src.id_target)
AM.forceMove(BT.loc) //Teleport to location with correct id.
/obj/effect/bump_teleporter
name = "bump-teleporter"
icon = 'icons/mob/screen_gen.dmi'
icon_state = "x2"
var/id = null //id of this bump_teleporter.
var/id_target = null //id of bump_teleporter which this moves you to.
invisibility = INVISIBILITY_ABSTRACT //nope, can't see this
anchored = TRUE
density = TRUE
opacity = 0
var/static/list/AllTeleporters
/obj/effect/bump_teleporter/Initialize()
. = ..()
LAZYADD(AllTeleporters, src)
/obj/effect/bump_teleporter/Destroy()
LAZYREMOVE(AllTeleporters, src)
return ..()
/obj/effect/bump_teleporter/singularity_act()
return
/obj/effect/bump_teleporter/singularity_pull()
return
/obj/effect/bump_teleporter/Bumped(atom/movable/AM)
if(!ismob(AM))
return
if(!id_target)
return
for(var/obj/effect/bump_teleporter/BT in AllTeleporters)
if(BT.id == src.id_target)
AM.forceMove(BT.loc) //Teleport to location with correct id.
+96 -96
View File
@@ -1,96 +1,96 @@
/obj/effect/decal/cleanable
gender = PLURAL
layer = ABOVE_NORMAL_TURF_LAYER
var/list/random_icon_states = null
var/blood_state = "" //I'm sorry but cleanable/blood code is ass, and so is blood_DNA
var/bloodiness = 0 //0-100, amount of blood in this decal, used for making footprints and affecting the alpha of bloody footprints
var/mergeable_decal = TRUE //when two of these are on a same tile or do we need to merge them into just one?
/obj/effect/decal/cleanable/Initialize(mapload, list/datum/disease/diseases)
. = ..()
LAZYINITLIST(blood_DNA) //Kinda needed
if (random_icon_states && (icon_state == initial(icon_state)) && length(random_icon_states) > 0)
icon_state = pick(random_icon_states)
create_reagents(300)
if(loc && isturf(loc))
for(var/obj/effect/decal/cleanable/C in loc)
if(C != src && C.type == type && !QDELETED(C))
if (replace_decal(C))
return INITIALIZE_HINT_QDEL
if(LAZYLEN(diseases))
var/list/datum/disease/diseases_to_add = list()
for(var/datum/disease/D in diseases)
if(D.spread_flags & DISEASE_SPREAD_CONTACT_FLUIDS)
diseases_to_add += D
if(LAZYLEN(diseases_to_add))
AddComponent(/datum/component/infective, diseases_to_add)
/obj/effect/decal/cleanable/proc/replace_decal(obj/effect/decal/cleanable/C) // Returns true if we should give up in favor of the pre-existing decal
if(mergeable_decal)
qdel(C)
/obj/effect/decal/cleanable/attackby(obj/item/W, mob/user, params)
if(istype(W, /obj/item/reagent_containers/glass) || istype(W, /obj/item/reagent_containers/food/drinks))
if(src.reagents && W.reagents)
. = 1 //so the containers don't splash their content on the src while scooping.
if(!src.reagents.total_volume)
to_chat(user, "<span class='notice'>[src] isn't thick enough to scoop up!</span>")
return
if(W.reagents.total_volume >= W.reagents.maximum_volume)
to_chat(user, "<span class='notice'>[W] is full!</span>")
return
to_chat(user, "<span class='notice'>You scoop up [src] into [W]!</span>")
reagents.trans_to(W, reagents.total_volume)
if(!reagents.total_volume) //scooped up all of it
qdel(src)
return
if(W.get_temperature()) //todo: make heating a reagent holder proc
if(istype(W, /obj/item/clothing/mask/cigarette))
return
else
var/hotness = W.get_temperature()
reagents.expose_temperature(hotness)
to_chat(user, "<span class='notice'>You heat [name] with [W]!</span>")
else
return ..()
/obj/effect/decal/cleanable/ex_act()
if(reagents)
for(var/datum/reagent/R in reagents.reagent_list)
R.on_ex_act()
..()
/obj/effect/decal/cleanable/fire_act(exposed_temperature, exposed_volume)
if(reagents)
reagents.expose_temperature(exposed_temperature)
..()
//Add "bloodiness" of this blood's type, to the human's shoes
//This is on /cleanable because fuck this ancient mess
/obj/effect/decal/cleanable/Crossed(atom/movable/O)
..()
if(ishuman(O))
var/mob/living/carbon/human/H = O
if(H.shoes && blood_state && bloodiness && !HAS_TRAIT(H, TRAIT_LIGHT_STEP))
var/obj/item/clothing/shoes/S = H.shoes
var/add_blood = 0
if(bloodiness >= BLOOD_GAIN_PER_STEP)
add_blood = BLOOD_GAIN_PER_STEP
else
add_blood = bloodiness
bloodiness -= add_blood
S.bloody_shoes[blood_state] = min(MAX_SHOE_BLOODINESS,S.bloody_shoes[blood_state]+add_blood)
if(blood_DNA && blood_DNA.len)
S.add_blood_DNA(blood_DNA)
S.add_blood_overlay()
S.blood_state = blood_state
update_icon()
H.update_inv_shoes()
/obj/effect/decal/cleanable/proc/can_bloodcrawl_in()
if((blood_state != BLOOD_STATE_OIL) && (blood_state != BLOOD_STATE_NOT_BLOODY))
return bloodiness
else
return FALSE
/obj/effect/decal/cleanable
gender = PLURAL
layer = ABOVE_NORMAL_TURF_LAYER
var/list/random_icon_states = null
var/blood_state = "" //I'm sorry but cleanable/blood code is ass, and so is blood_DNA
var/bloodiness = 0 //0-100, amount of blood in this decal, used for making footprints and affecting the alpha of bloody footprints
var/mergeable_decal = TRUE //when two of these are on a same tile or do we need to merge them into just one?
/obj/effect/decal/cleanable/Initialize(mapload, list/datum/disease/diseases)
. = ..()
LAZYINITLIST(blood_DNA) //Kinda needed
if (random_icon_states && (icon_state == initial(icon_state)) && length(random_icon_states) > 0)
icon_state = pick(random_icon_states)
create_reagents(300)
if(loc && isturf(loc))
for(var/obj/effect/decal/cleanable/C in loc)
if(C != src && C.type == type && !QDELETED(C))
if (replace_decal(C))
return INITIALIZE_HINT_QDEL
if(LAZYLEN(diseases))
var/list/datum/disease/diseases_to_add = list()
for(var/datum/disease/D in diseases)
if(D.spread_flags & DISEASE_SPREAD_CONTACT_FLUIDS)
diseases_to_add += D
if(LAZYLEN(diseases_to_add))
AddComponent(/datum/component/infective, diseases_to_add)
/obj/effect/decal/cleanable/proc/replace_decal(obj/effect/decal/cleanable/C) // Returns true if we should give up in favor of the pre-existing decal
if(mergeable_decal)
qdel(C)
/obj/effect/decal/cleanable/attackby(obj/item/W, mob/user, params)
if(istype(W, /obj/item/reagent_containers/glass) || istype(W, /obj/item/reagent_containers/food/drinks))
if(src.reagents && W.reagents)
. = 1 //so the containers don't splash their content on the src while scooping.
if(!src.reagents.total_volume)
to_chat(user, "<span class='notice'>[src] isn't thick enough to scoop up!</span>")
return
if(W.reagents.total_volume >= W.reagents.maximum_volume)
to_chat(user, "<span class='notice'>[W] is full!</span>")
return
to_chat(user, "<span class='notice'>You scoop up [src] into [W]!</span>")
reagents.trans_to(W, reagents.total_volume)
if(!reagents.total_volume) //scooped up all of it
qdel(src)
return
if(W.get_temperature()) //todo: make heating a reagent holder proc
if(istype(W, /obj/item/clothing/mask/cigarette))
return
else
var/hotness = W.get_temperature()
reagents.expose_temperature(hotness)
to_chat(user, "<span class='notice'>You heat [name] with [W]!</span>")
else
return ..()
/obj/effect/decal/cleanable/ex_act()
if(reagents)
for(var/datum/reagent/R in reagents.reagent_list)
R.on_ex_act()
..()
/obj/effect/decal/cleanable/fire_act(exposed_temperature, exposed_volume)
if(reagents)
reagents.expose_temperature(exposed_temperature)
..()
//Add "bloodiness" of this blood's type, to the human's shoes
//This is on /cleanable because fuck this ancient mess
/obj/effect/decal/cleanable/Crossed(atom/movable/O)
..()
if(ishuman(O))
var/mob/living/carbon/human/H = O
if(H.shoes && blood_state && bloodiness && !HAS_TRAIT(H, TRAIT_LIGHT_STEP))
var/obj/item/clothing/shoes/S = H.shoes
var/add_blood = 0
if(bloodiness >= BLOOD_GAIN_PER_STEP)
add_blood = BLOOD_GAIN_PER_STEP
else
add_blood = bloodiness
bloodiness -= add_blood
S.bloody_shoes[blood_state] = min(MAX_SHOE_BLOODINESS,S.bloody_shoes[blood_state]+add_blood)
if(blood_DNA && blood_DNA.len)
S.add_blood_DNA(blood_DNA)
S.add_blood_overlay()
S.blood_state = blood_state
update_icon()
H.update_inv_shoes()
/obj/effect/decal/cleanable/proc/can_bloodcrawl_in()
if((blood_state != BLOOD_STATE_OIL) && (blood_state != BLOOD_STATE_NOT_BLOODY))
return bloodiness
else
return FALSE
@@ -1,70 +1,70 @@
/obj/effect/decal/cleanable/blood/xeno
name = "xeno blood"
desc = "It's green and acidic. It looks like... <i>blood?</i>"
color = BLOOD_COLOR_XENO
/obj/effect/decal/cleanable/blood/splatter/xeno
color = BLOOD_COLOR_XENO
/obj/effect/decal/cleanable/blood/gibs/xeno
color = BLOOD_COLOR_XENO
gibs_reagent_id = /datum/reagent/liquidgibs/xeno
gibs_bloodtype = "X*"
/obj/effect/decal/cleanable/blood/gibs/xeno/Initialize(mapload, list/datum/disease/diseases)
. = ..()
update_icon()
/obj/effect/decal/cleanable/blood/gibs/xeno/update_icon()
add_atom_colour(blood_DNA_to_color(), FIXED_COLOUR_PRIORITY)
cut_overlays()
var/mutable_appearance/flesh = mutable_appearance(icon, "[icon_state]x_flesh")
flesh.appearance_flags = RESET_COLOR
flesh.color = body_colors
add_overlay(flesh)
/obj/effect/decal/cleanable/blood/gibs/xeno/streak(list/directions)
set waitfor = FALSE
var/list/diseases = list()
SEND_SIGNAL(src, COMSIG_GIBS_STREAK, directions, diseases)
var/direction = pick(directions)
for(var/i in 0 to pick(0, 200; 1, 150; 2, 50))
sleep(2)
if(i > 0)
var/obj/effect/decal/cleanable/blood/splatter/xeno/splat = new /obj/effect/decal/cleanable/blood/splatter/xeno(loc, diseases)
splat.transfer_blood_dna(blood_DNA, diseases)
if(!step_to(src, get_step(src, direction), 0))
break
/obj/effect/decal/cleanable/blood/gibs/xeno/up
random_icon_states = list("gib1", "gib2", "gib3", "gib4", "gib5", "gib6","gibup1","gibup1","gibup1")
/obj/effect/decal/cleanable/blood/gibs/xeno/down
random_icon_states = list("gib1", "gib2", "gib3", "gib4", "gib5", "gib6","gibdown1","gibdown1","gibdown1")
/obj/effect/decal/cleanable/blood/gibs/xeno/body
random_icon_states = list("gibhead", "gibtorso")
/obj/effect/decal/cleanable/blood/gibs/xeno/torso
random_icon_states = list("gibtorso")
/obj/effect/decal/cleanable/blood/gibs/xeno/limb
random_icon_states = list("gibleg", "gibarm")
/obj/effect/decal/cleanable/blood/gibs/xeno/core
random_icon_states = list("gibmid1", "gibmid2", "gibmid3")
/obj/effect/decal/cleanable/blood/gibs/xeno/larva
random_icon_states = list("xgiblarva1", "xgiblarva2")
/obj/effect/decal/cleanable/blood/gibs/xeno/larva/body
random_icon_states = list("xgiblarvahead", "xgiblarvatorso")
/obj/effect/decal/cleanable/blood/xtracks
icon_state = "tracks"
random_icon_states = null
/obj/effect/decal/cleanable/blood/xtracks/Initialize()
add_blood_DNA(list("UNKNOWN DNA" = "X*"))
/obj/effect/decal/cleanable/blood/xeno
name = "xeno blood"
desc = "It's green and acidic. It looks like... <i>blood?</i>"
color = BLOOD_COLOR_XENO
/obj/effect/decal/cleanable/blood/splatter/xeno
color = BLOOD_COLOR_XENO
/obj/effect/decal/cleanable/blood/gibs/xeno
color = BLOOD_COLOR_XENO
gibs_reagent_id = /datum/reagent/liquidgibs/xeno
gibs_bloodtype = "X*"
/obj/effect/decal/cleanable/blood/gibs/xeno/Initialize(mapload, list/datum/disease/diseases)
. = ..()
update_icon()
/obj/effect/decal/cleanable/blood/gibs/xeno/update_icon()
add_atom_colour(blood_DNA_to_color(), FIXED_COLOUR_PRIORITY)
cut_overlays()
var/mutable_appearance/flesh = mutable_appearance(icon, "[icon_state]x_flesh")
flesh.appearance_flags = RESET_COLOR
flesh.color = body_colors
add_overlay(flesh)
/obj/effect/decal/cleanable/blood/gibs/xeno/streak(list/directions)
set waitfor = FALSE
var/list/diseases = list()
SEND_SIGNAL(src, COMSIG_GIBS_STREAK, directions, diseases)
var/direction = pick(directions)
for(var/i in 0 to pick(0, 200; 1, 150; 2, 50))
sleep(2)
if(i > 0)
var/obj/effect/decal/cleanable/blood/splatter/xeno/splat = new /obj/effect/decal/cleanable/blood/splatter/xeno(loc, diseases)
splat.transfer_blood_dna(blood_DNA, diseases)
if(!step_to(src, get_step(src, direction), 0))
break
/obj/effect/decal/cleanable/blood/gibs/xeno/up
random_icon_states = list("gib1", "gib2", "gib3", "gib4", "gib5", "gib6","gibup1","gibup1","gibup1")
/obj/effect/decal/cleanable/blood/gibs/xeno/down
random_icon_states = list("gib1", "gib2", "gib3", "gib4", "gib5", "gib6","gibdown1","gibdown1","gibdown1")
/obj/effect/decal/cleanable/blood/gibs/xeno/body
random_icon_states = list("gibhead", "gibtorso")
/obj/effect/decal/cleanable/blood/gibs/xeno/torso
random_icon_states = list("gibtorso")
/obj/effect/decal/cleanable/blood/gibs/xeno/limb
random_icon_states = list("gibleg", "gibarm")
/obj/effect/decal/cleanable/blood/gibs/xeno/core
random_icon_states = list("gibmid1", "gibmid2", "gibmid3")
/obj/effect/decal/cleanable/blood/gibs/xeno/larva
random_icon_states = list("xgiblarva1", "xgiblarva2")
/obj/effect/decal/cleanable/blood/gibs/xeno/larva/body
random_icon_states = list("xgiblarvahead", "xgiblarvatorso")
/obj/effect/decal/cleanable/blood/xtracks
icon_state = "tracks"
random_icon_states = null
/obj/effect/decal/cleanable/blood/xtracks/Initialize()
add_blood_DNA(list("UNKNOWN DNA" = "X*"))
. = ..()
@@ -1,192 +1,192 @@
/obj/effect/decal/cleanable/blood
name = "blood"
desc = "It's gooey. Perhaps it's the chef's cooking?"
icon = 'icons/effects/blood.dmi'
icon_state = "floor1"
random_icon_states = list("floor1", "floor2", "floor3", "floor4", "floor5", "floor6", "floor7")
blood_state = BLOOD_STATE_BLOOD
bloodiness = MAX_SHOE_BLOODINESS
color = BLOOD_COLOR_HUMAN //default so we don't have white splotches everywhere.
/obj/effect/decal/cleanable/blood/replace_decal(obj/effect/decal/cleanable/blood/C)
if (C.blood_DNA)
blood_DNA |= C.blood_DNA.Copy()
update_icon()
..()
/obj/effect/decal/cleanable/blood/transfer_blood_dna()
..()
update_icon()
/obj/effect/decal/cleanable/blood/transfer_mob_blood_dna()
. = ..()
update_icon()
/obj/effect/decal/cleanable/blood/update_icon()
color = blood_DNA_to_color()
/obj/effect/decal/cleanable/blood/old
name = "dried blood"
desc = "Looks like it's been here a while. Eew."
bloodiness = 0
/obj/effect/decal/cleanable/blood/old/Initialize(mapload, list/datum/disease/diseases)
..()
icon_state += "-old"
add_blood_DNA(list("Non-human DNA" = "A+"))
/obj/effect/decal/cleanable/blood/splats
random_icon_states = list("gibbl1", "gibbl2", "gibbl3", "gibbl4", "gibbl5")
/obj/effect/decal/cleanable/blood/splatter
random_icon_states = list("splatter1", "splatter2", "splatter3", "splatter4", "splatter5")
/obj/effect/decal/cleanable/blood/tracks
icon_state = "tracks"
desc = "They look like tracks left by wheels."
random_icon_states = null
/obj/effect/decal/cleanable/trail_holder //not a child of blood on purpose
name = "blood"
icon_state = "ltrails_1"
desc = "Your instincts say you shouldn't be following these."
random_icon_states = null
var/list/existing_dirs = list()
/obj/effect/decal/cleanable/trail_holder/update_icon()
color = blood_DNA_to_color()
/obj/effect/cleanable/trail_holder/Initialize()
. = ..()
update_icon()
/obj/effect/decal/cleanable/trail_holder/can_bloodcrawl_in()
return TRUE
/obj/effect/decal/cleanable/trail_holder/transfer_blood_dna()
..()
update_icon()
/obj/effect/decal/cleanable/trail_holder/transfer_mob_blood_dna()
. = ..()
update_icon()
//BLOODY FOOTPRINTS
/obj/effect/decal/cleanable/blood/footprints
name = "footprints"
icon = 'icons/effects/footprints.dmi'
icon_state = "nothingwhatsoever"
desc = "WHOSE FOOTPRINTS ARE THESE?"
random_icon_states = null
var/entered_dirs = 0
var/exited_dirs = 0
blood_state = BLOOD_STATE_BLOOD //the icon state to load images from
var/list/shoe_types = list()
/obj/effect/decal/cleanable/blood/footprints/Crossed(atom/movable/O)
if(ishuman(O))
var/mob/living/carbon/human/H = O
var/obj/item/clothing/shoes/S = H.shoes
if(S && S.bloody_shoes[blood_state])
if(color != bloodtype_to_color(S.last_bloodtype))
return
S.bloody_shoes[blood_state] = max(S.bloody_shoes[blood_state] - BLOOD_LOSS_PER_STEP, 0)
shoe_types |= S.type
if (!(entered_dirs & H.dir))
entered_dirs |= H.dir
update_icon()
/obj/effect/decal/cleanable/blood/footprints/Uncrossed(atom/movable/O)
if(ishuman(O))
var/mob/living/carbon/human/H = O
var/obj/item/clothing/shoes/S = H.shoes
if(S && S.bloody_shoes[blood_state])
if(color != bloodtype_to_color(S.last_bloodtype))//last entry - we check its color
return
S.bloody_shoes[blood_state] = max(S.bloody_shoes[blood_state] - BLOOD_LOSS_PER_STEP, 0)
shoe_types |= S.type
if (!(exited_dirs & H.dir))
exited_dirs |= H.dir
update_icon()
/obj/effect/decal/cleanable/blood/footprints/update_icon()
..()
cut_overlays()
for(var/Ddir in GLOB.cardinals)
if(entered_dirs & Ddir)
var/image/bloodstep_overlay = GLOB.bloody_footprints_cache["entered-[blood_state]-[Ddir]"]
if(!bloodstep_overlay)
GLOB.bloody_footprints_cache["entered-[blood_state]-[Ddir]"] = bloodstep_overlay = image(icon, "[blood_state]1", dir = Ddir)
add_overlay(bloodstep_overlay)
if(exited_dirs & Ddir)
var/image/bloodstep_overlay = GLOB.bloody_footprints_cache["exited-[blood_state]-[Ddir]"]
if(!bloodstep_overlay)
GLOB.bloody_footprints_cache["exited-[blood_state]-[Ddir]"] = bloodstep_overlay = image(icon, "[blood_state]2", dir = Ddir)
add_overlay(bloodstep_overlay)
alpha = BLOODY_FOOTPRINT_BASE_ALPHA + bloodiness
/obj/effect/decal/cleanable/blood/footprints/examine(mob/user)
. = ..()
if(shoe_types.len)
. += "You recognise the footprints as belonging to:"
for(var/shoe in shoe_types)
var/obj/item/clothing/shoes/S = shoe
. += "some <B>[initial(S.name)]</B> [icon2html(initial(S.icon), user)]"
/obj/effect/decal/cleanable/blood/footprints/replace_decal(obj/effect/decal/cleanable/C)
if(blood_state != C.blood_state) //We only replace footprints of the same type as us
return
if(color != C.color)
return
..()
/obj/effect/decal/cleanable/blood/footprints/can_bloodcrawl_in()
if((blood_state != BLOOD_STATE_OIL) && (blood_state != BLOOD_STATE_NOT_BLOODY))
return TRUE
return FALSE
/* Eventually TODO: make snowflake trails like baycode's
/obj/effect/decal/cleanable/blood/footprints/tracks/shoe
name = "footprints"
desc = "They look like tracks left by footwear."
icon_state = FOOTPRINT_SHOE
print_state = FOOTPRINT_SHOE
/obj/effect/decal/cleanable/blood/footprints/tracks/foot
name = "footprints"
desc = "They look like tracks left by a bare foot."
icon_state = FOOTPRINT_FOOT
print_state = FOOTPRINT_FOOT
/obj/effect/decal/cleanable/blood/footprints/tracks/snake
name = "tracks"
desc = "They look like tracks left by a giant snake."
icon_state = FOOTPRINT_SNAKE
print_state = FOOTPRINT_SNAKE
/obj/effect/decal/cleanable/blood/footprints/tracks/paw
name = "footprints"
desc = "They look like tracks left by paws."
icon_state = FOOTPRINT_PAW
print_state = FOOTPRINT_PAW
/obj/effect/decal/cleanable/blood/footprints/tracks/claw
name = "footprints"
desc = "They look like tracks left by claws."
icon_state = FOOTPRINT_CLAW
print_state = FOOTPRINT_CLAW
/obj/effect/decal/cleanable/blood/footprints/tracks/wheels
name = "tracks"
desc = "They look like tracks left by wheels."
gender = PLURAL
icon_state = FOOTPRINT_WHEEL
print_state = FOOTPRINT_WHEEL
/obj/effect/decal/cleanable/blood/footprints/tracks/body
name = "trails"
desc = "A trail left by something being dragged."
icon_state = FOOTPRINT_DRAG
print_state = FOOTPRINT_DRAG */
/obj/effect/decal/cleanable/blood
name = "blood"
desc = "It's gooey. Perhaps it's the chef's cooking?"
icon = 'icons/effects/blood.dmi'
icon_state = "floor1"
random_icon_states = list("floor1", "floor2", "floor3", "floor4", "floor5", "floor6", "floor7")
blood_state = BLOOD_STATE_BLOOD
bloodiness = MAX_SHOE_BLOODINESS
color = BLOOD_COLOR_HUMAN //default so we don't have white splotches everywhere.
/obj/effect/decal/cleanable/blood/replace_decal(obj/effect/decal/cleanable/blood/C)
if (C.blood_DNA)
blood_DNA |= C.blood_DNA.Copy()
update_icon()
..()
/obj/effect/decal/cleanable/blood/transfer_blood_dna()
..()
update_icon()
/obj/effect/decal/cleanable/blood/transfer_mob_blood_dna()
. = ..()
update_icon()
/obj/effect/decal/cleanable/blood/update_icon()
color = blood_DNA_to_color()
/obj/effect/decal/cleanable/blood/old
name = "dried blood"
desc = "Looks like it's been here a while. Eew."
bloodiness = 0
/obj/effect/decal/cleanable/blood/old/Initialize(mapload, list/datum/disease/diseases)
..()
icon_state += "-old"
add_blood_DNA(list("Non-human DNA" = "A+"))
/obj/effect/decal/cleanable/blood/splats
random_icon_states = list("gibbl1", "gibbl2", "gibbl3", "gibbl4", "gibbl5")
/obj/effect/decal/cleanable/blood/splatter
random_icon_states = list("splatter1", "splatter2", "splatter3", "splatter4", "splatter5")
/obj/effect/decal/cleanable/blood/tracks
icon_state = "tracks"
desc = "They look like tracks left by wheels."
random_icon_states = null
/obj/effect/decal/cleanable/trail_holder //not a child of blood on purpose
name = "blood"
icon_state = "ltrails_1"
desc = "Your instincts say you shouldn't be following these."
random_icon_states = null
var/list/existing_dirs = list()
/obj/effect/decal/cleanable/trail_holder/update_icon()
color = blood_DNA_to_color()
/obj/effect/cleanable/trail_holder/Initialize()
. = ..()
update_icon()
/obj/effect/decal/cleanable/trail_holder/can_bloodcrawl_in()
return TRUE
/obj/effect/decal/cleanable/trail_holder/transfer_blood_dna()
..()
update_icon()
/obj/effect/decal/cleanable/trail_holder/transfer_mob_blood_dna()
. = ..()
update_icon()
//BLOODY FOOTPRINTS
/obj/effect/decal/cleanable/blood/footprints
name = "footprints"
icon = 'icons/effects/footprints.dmi'
icon_state = "nothingwhatsoever"
desc = "WHOSE FOOTPRINTS ARE THESE?"
random_icon_states = null
var/entered_dirs = 0
var/exited_dirs = 0
blood_state = BLOOD_STATE_BLOOD //the icon state to load images from
var/list/shoe_types = list()
/obj/effect/decal/cleanable/blood/footprints/Crossed(atom/movable/O)
if(ishuman(O))
var/mob/living/carbon/human/H = O
var/obj/item/clothing/shoes/S = H.shoes
if(S && S.bloody_shoes[blood_state])
if(color != bloodtype_to_color(S.last_bloodtype))
return
S.bloody_shoes[blood_state] = max(S.bloody_shoes[blood_state] - BLOOD_LOSS_PER_STEP, 0)
shoe_types |= S.type
if (!(entered_dirs & H.dir))
entered_dirs |= H.dir
update_icon()
/obj/effect/decal/cleanable/blood/footprints/Uncrossed(atom/movable/O)
if(ishuman(O))
var/mob/living/carbon/human/H = O
var/obj/item/clothing/shoes/S = H.shoes
if(S && S.bloody_shoes[blood_state])
if(color != bloodtype_to_color(S.last_bloodtype))//last entry - we check its color
return
S.bloody_shoes[blood_state] = max(S.bloody_shoes[blood_state] - BLOOD_LOSS_PER_STEP, 0)
shoe_types |= S.type
if (!(exited_dirs & H.dir))
exited_dirs |= H.dir
update_icon()
/obj/effect/decal/cleanable/blood/footprints/update_icon()
..()
cut_overlays()
for(var/Ddir in GLOB.cardinals)
if(entered_dirs & Ddir)
var/image/bloodstep_overlay = GLOB.bloody_footprints_cache["entered-[blood_state]-[Ddir]"]
if(!bloodstep_overlay)
GLOB.bloody_footprints_cache["entered-[blood_state]-[Ddir]"] = bloodstep_overlay = image(icon, "[blood_state]1", dir = Ddir)
add_overlay(bloodstep_overlay)
if(exited_dirs & Ddir)
var/image/bloodstep_overlay = GLOB.bloody_footprints_cache["exited-[blood_state]-[Ddir]"]
if(!bloodstep_overlay)
GLOB.bloody_footprints_cache["exited-[blood_state]-[Ddir]"] = bloodstep_overlay = image(icon, "[blood_state]2", dir = Ddir)
add_overlay(bloodstep_overlay)
alpha = BLOODY_FOOTPRINT_BASE_ALPHA + bloodiness
/obj/effect/decal/cleanable/blood/footprints/examine(mob/user)
. = ..()
if(shoe_types.len)
. += "You recognise the footprints as belonging to:"
for(var/shoe in shoe_types)
var/obj/item/clothing/shoes/S = shoe
. += "some <B>[initial(S.name)]</B> [icon2html(initial(S.icon), user)]"
/obj/effect/decal/cleanable/blood/footprints/replace_decal(obj/effect/decal/cleanable/C)
if(blood_state != C.blood_state) //We only replace footprints of the same type as us
return
if(color != C.color)
return
..()
/obj/effect/decal/cleanable/blood/footprints/can_bloodcrawl_in()
if((blood_state != BLOOD_STATE_OIL) && (blood_state != BLOOD_STATE_NOT_BLOODY))
return TRUE
return FALSE
/* Eventually TODO: make snowflake trails like baycode's
/obj/effect/decal/cleanable/blood/footprints/tracks/shoe
name = "footprints"
desc = "They look like tracks left by footwear."
icon_state = FOOTPRINT_SHOE
print_state = FOOTPRINT_SHOE
/obj/effect/decal/cleanable/blood/footprints/tracks/foot
name = "footprints"
desc = "They look like tracks left by a bare foot."
icon_state = FOOTPRINT_FOOT
print_state = FOOTPRINT_FOOT
/obj/effect/decal/cleanable/blood/footprints/tracks/snake
name = "tracks"
desc = "They look like tracks left by a giant snake."
icon_state = FOOTPRINT_SNAKE
print_state = FOOTPRINT_SNAKE
/obj/effect/decal/cleanable/blood/footprints/tracks/paw
name = "footprints"
desc = "They look like tracks left by paws."
icon_state = FOOTPRINT_PAW
print_state = FOOTPRINT_PAW
/obj/effect/decal/cleanable/blood/footprints/tracks/claw
name = "footprints"
desc = "They look like tracks left by claws."
icon_state = FOOTPRINT_CLAW
print_state = FOOTPRINT_CLAW
/obj/effect/decal/cleanable/blood/footprints/tracks/wheels
name = "tracks"
desc = "They look like tracks left by wheels."
gender = PLURAL
icon_state = FOOTPRINT_WHEEL
print_state = FOOTPRINT_WHEEL
/obj/effect/decal/cleanable/blood/footprints/tracks/body
name = "trails"
desc = "A trail left by something being dragged."
icon_state = FOOTPRINT_DRAG
print_state = FOOTPRINT_DRAG */
+235 -235
View File
@@ -1,235 +1,235 @@
/obj/effect/decal/cleanable/generic
name = "clutter"
desc = "Someone should clean that up."
icon = 'icons/obj/objects.dmi'
icon_state = "shards"
/obj/effect/decal/cleanable/ash
name = "ashes"
desc = "Ashes to ashes, dust to dust, and into space."
icon = 'icons/obj/objects.dmi'
icon_state = "ash"
mergeable_decal = FALSE
/obj/effect/decal/cleanable/ash/Initialize()
. = ..()
reagents.add_reagent(/datum/reagent/ash, 30)
pixel_x = rand(-5, 5)
pixel_y = rand(-5, 5)
/obj/effect/decal/cleanable/ash/crematorium
//crematoriums need their own ash cause default ash deletes itself if created in an obj
turf_loc_check = FALSE
/obj/effect/decal/cleanable/ash/large
name = "large pile of ashes"
icon_state = "big_ash"
/obj/effect/decal/cleanable/ash/large/Initialize()
. = ..()
reagents.add_reagent(/datum/reagent/ash, 30) //double the amount of ash.
/obj/effect/decal/cleanable/glass
name = "tiny shards"
desc = "Back to sand."
icon = 'icons/obj/shards.dmi'
icon_state = "tiny"
/obj/effect/decal/cleanable/glass/Initialize()
. = ..()
setDir(pick(GLOB.cardinals))
/obj/effect/decal/cleanable/glass/ex_act()
qdel(src)
/obj/effect/decal/cleanable/glass/plasma
icon_state = "plasmatiny"
/obj/effect/decal/cleanable/dirt
name = "dirt"
desc = "Someone should clean that up."
icon_state = "dirt"
canSmoothWith = list(/obj/effect/decal/cleanable/dirt, /turf/closed/wall, /obj/structure/falsewall)
smooth = SMOOTH_FALSE
mouse_opacity = MOUSE_OPACITY_TRANSPARENT
/obj/effect/decal/cleanable/dirt/Initialize()
. = ..()
var/turf/T = get_turf(src)
if(T.tiled_dirt)
smooth = SMOOTH_MORE
icon = 'icons/effects/dirt.dmi'
icon_state = ""
queue_smooth(src)
queue_smooth_neighbors(src)
/obj/effect/decal/cleanable/dirt/Destroy()
queue_smooth_neighbors(src)
return ..()
/obj/effect/decal/cleanable/flour
name = "flour"
desc = "It's still good. Four second rule!"
icon_state = "flour"
/obj/effect/decal/cleanable/greenglow/ecto
name = "ectoplasmic puddle"
desc = "You know who to call."
light_power = 2
/obj/effect/decal/cleanable/greenglow
name = "glowing goo"
desc = "Jeez. I hope that's not for lunch."
light_color = LIGHT_COLOR_GREEN
icon_state = "greenglow"
/obj/effect/decal/cleanable/greenglow/Initialize(mapload)
. = ..()
set_light(2, 0.8, "#22FFAA")
/obj/effect/decal/cleanable/greenglow/ex_act()
return
/obj/effect/decal/cleanable/cobweb
name = "cobweb"
desc = "Somebody should remove that."
gender = NEUTER
layer = WALL_OBJ_LAYER
icon_state = "cobweb1"
resistance_flags = FLAMMABLE
/obj/effect/decal/cleanable/cobweb/cobweb2
icon_state = "cobweb2"
/obj/effect/decal/cleanable/molten_object
name = "gooey grey mass"
desc = "It looks like a melted... something."
gender = NEUTER
icon = 'icons/effects/effects.dmi'
icon_state = "molten"
mergeable_decal = FALSE
/obj/effect/decal/cleanable/molten_object/large
name = "big gooey grey mass"
icon_state = "big_molten"
//Vomit (sorry)
/obj/effect/decal/cleanable/vomit
name = "vomit"
desc = "Gosh, how unpleasant."
icon = 'icons/effects/blood.dmi'
icon_state = "vomit_1"
random_icon_states = list("vomit_1", "vomit_2", "vomit_3", "vomit_4")
/obj/effect/decal/cleanable/vomit/attack_hand(mob/user)
. = ..()
if(.)
return
if(ishuman(user))
var/mob/living/carbon/human/H = user
if(isflyperson(H))
playsound(get_turf(src), 'sound/items/drink.ogg', 50, 1) //slurp
H.visible_message("<span class='alert'>[H] extends a small proboscis into the vomit pool, sucking it with a slurping sound.</span>")
if(reagents)
for(var/datum/reagent/consumable/R in reagents.reagent_list)
if(R.nutriment_factor > 0)
H.nutrition += R.nutriment_factor * R.volume
reagents.del_reagent(R.type)
reagents.trans_to(H, reagents.total_volume)
qdel(src)
/obj/effect/decal/cleanable/vomit/old
name = "crusty dried vomit"
desc = "You try not to look at the chunks, and fail."
/obj/effect/decal/cleanable/vomit/old/Initialize(mapload, list/datum/disease/diseases)
. = ..()
icon_state += "-old"
/obj/effect/decal/cleanable/tomato_smudge
name = "tomato smudge"
desc = "It's red."
gender = NEUTER
icon = 'icons/effects/tomatodecal.dmi'
random_icon_states = list("tomato_floor1", "tomato_floor2", "tomato_floor3")
/obj/effect/decal/cleanable/plant_smudge
name = "plant smudge"
gender = NEUTER
icon = 'icons/effects/tomatodecal.dmi'
random_icon_states = list("smashed_plant")
/obj/effect/decal/cleanable/egg_smudge
name = "smashed egg"
desc = "Seems like this one won't hatch."
gender = NEUTER
icon = 'icons/effects/tomatodecal.dmi'
random_icon_states = list("smashed_egg1", "smashed_egg2", "smashed_egg3")
/obj/effect/decal/cleanable/pie_smudge //honk
name = "smashed pie"
desc = "It's pie cream from a cream pie."
gender = NEUTER
icon = 'icons/effects/tomatodecal.dmi'
random_icon_states = list("smashed_pie")
/obj/effect/decal/cleanable/chem_pile
name = "chemical pile"
desc = "A pile of chemicals. You can't quite tell what's inside it."
gender = NEUTER
icon = 'icons/obj/objects.dmi'
icon_state = "ash"
/obj/effect/decal/cleanable/shreds
name = "shreds"
desc = "The shredded remains of what appears to be clothing."
icon_state = "shreds"
gender = PLURAL
mergeable_decal = FALSE
/obj/effect/decal/cleanable/shreds/ex_act(severity, target)
if(severity == 1) //so shreds created during an explosion aren't deleted by the explosion.
qdel(src)
/obj/effect/decal/cleanable/shreds/Initialize()
pixel_x = rand(-10, 10)
pixel_y = rand(-10, 10)
. = ..()
/obj/effect/decal/cleanable/salt
name = "salt pile"
desc = "A sizable pile of table salt. Someone must be upset."
icon = 'icons/effects/tomatodecal.dmi'
icon_state = "salt_pile"
gender = NEUTER
/obj/effect/decal/cleanable/glitter
name = "generic glitter pile"
desc = "The herpes of arts and crafts."
icon = 'icons/effects/atmospherics.dmi'
gender = NEUTER
/obj/effect/decal/cleanable/glitter/pink
name = "pink glitter"
icon_state = "plasma_old"
/obj/effect/decal/cleanable/glitter/white
name = "white glitter"
icon_state = "nitrous_oxide_old"
/obj/effect/decal/cleanable/glitter/blue
name = "blue glitter"
icon_state = "freon_old"
/obj/effect/decal/cleanable/plasma
name = "stabilized plasma"
desc = "A puddle of stabilized plasma."
icon_state = "flour"
color = "#9e0089"
/obj/effect/decal/cleanable/insectguts
name = "insect guts"
desc = "One bug squashed. Four more will rise in its place."
icon = 'icons/effects/blood.dmi'
icon_state = "xfloor1"
random_icon_states = list("xfloor1", "xfloor2", "xfloor3", "xfloor4", "xfloor5", "xfloor6", "xfloor7")
/obj/effect/decal/cleanable/generic
name = "clutter"
desc = "Someone should clean that up."
icon = 'icons/obj/objects.dmi'
icon_state = "shards"
/obj/effect/decal/cleanable/ash
name = "ashes"
desc = "Ashes to ashes, dust to dust, and into space."
icon = 'icons/obj/objects.dmi'
icon_state = "ash"
mergeable_decal = FALSE
/obj/effect/decal/cleanable/ash/Initialize()
. = ..()
reagents.add_reagent(/datum/reagent/ash, 30)
pixel_x = rand(-5, 5)
pixel_y = rand(-5, 5)
/obj/effect/decal/cleanable/ash/crematorium
//crematoriums need their own ash cause default ash deletes itself if created in an obj
turf_loc_check = FALSE
/obj/effect/decal/cleanable/ash/large
name = "large pile of ashes"
icon_state = "big_ash"
/obj/effect/decal/cleanable/ash/large/Initialize()
. = ..()
reagents.add_reagent(/datum/reagent/ash, 30) //double the amount of ash.
/obj/effect/decal/cleanable/glass
name = "tiny shards"
desc = "Back to sand."
icon = 'icons/obj/shards.dmi'
icon_state = "tiny"
/obj/effect/decal/cleanable/glass/Initialize()
. = ..()
setDir(pick(GLOB.cardinals))
/obj/effect/decal/cleanable/glass/ex_act()
qdel(src)
/obj/effect/decal/cleanable/glass/plasma
icon_state = "plasmatiny"
/obj/effect/decal/cleanable/dirt
name = "dirt"
desc = "Someone should clean that up."
icon_state = "dirt"
canSmoothWith = list(/obj/effect/decal/cleanable/dirt, /turf/closed/wall, /obj/structure/falsewall)
smooth = SMOOTH_FALSE
mouse_opacity = MOUSE_OPACITY_TRANSPARENT
/obj/effect/decal/cleanable/dirt/Initialize()
. = ..()
var/turf/T = get_turf(src)
if(T.tiled_dirt)
smooth = SMOOTH_MORE
icon = 'icons/effects/dirt.dmi'
icon_state = ""
queue_smooth(src)
queue_smooth_neighbors(src)
/obj/effect/decal/cleanable/dirt/Destroy()
queue_smooth_neighbors(src)
return ..()
/obj/effect/decal/cleanable/flour
name = "flour"
desc = "It's still good. Four second rule!"
icon_state = "flour"
/obj/effect/decal/cleanable/greenglow/ecto
name = "ectoplasmic puddle"
desc = "You know who to call."
light_power = 2
/obj/effect/decal/cleanable/greenglow
name = "glowing goo"
desc = "Jeez. I hope that's not for lunch."
light_color = LIGHT_COLOR_GREEN
icon_state = "greenglow"
/obj/effect/decal/cleanable/greenglow/Initialize(mapload)
. = ..()
set_light(2, 0.8, "#22FFAA")
/obj/effect/decal/cleanable/greenglow/ex_act()
return
/obj/effect/decal/cleanable/cobweb
name = "cobweb"
desc = "Somebody should remove that."
gender = NEUTER
layer = WALL_OBJ_LAYER
icon_state = "cobweb1"
resistance_flags = FLAMMABLE
/obj/effect/decal/cleanable/cobweb/cobweb2
icon_state = "cobweb2"
/obj/effect/decal/cleanable/molten_object
name = "gooey grey mass"
desc = "It looks like a melted... something."
gender = NEUTER
icon = 'icons/effects/effects.dmi'
icon_state = "molten"
mergeable_decal = FALSE
/obj/effect/decal/cleanable/molten_object/large
name = "big gooey grey mass"
icon_state = "big_molten"
//Vomit (sorry)
/obj/effect/decal/cleanable/vomit
name = "vomit"
desc = "Gosh, how unpleasant."
icon = 'icons/effects/blood.dmi'
icon_state = "vomit_1"
random_icon_states = list("vomit_1", "vomit_2", "vomit_3", "vomit_4")
/obj/effect/decal/cleanable/vomit/attack_hand(mob/user)
. = ..()
if(.)
return
if(ishuman(user))
var/mob/living/carbon/human/H = user
if(isflyperson(H))
playsound(get_turf(src), 'sound/items/drink.ogg', 50, 1) //slurp
H.visible_message("<span class='alert'>[H] extends a small proboscis into the vomit pool, sucking it with a slurping sound.</span>")
if(reagents)
for(var/datum/reagent/consumable/R in reagents.reagent_list)
if(R.nutriment_factor > 0)
H.nutrition += R.nutriment_factor * R.volume
reagents.del_reagent(R.type)
reagents.trans_to(H, reagents.total_volume)
qdel(src)
/obj/effect/decal/cleanable/vomit/old
name = "crusty dried vomit"
desc = "You try not to look at the chunks, and fail."
/obj/effect/decal/cleanable/vomit/old/Initialize(mapload, list/datum/disease/diseases)
. = ..()
icon_state += "-old"
/obj/effect/decal/cleanable/tomato_smudge
name = "tomato smudge"
desc = "It's red."
gender = NEUTER
icon = 'icons/effects/tomatodecal.dmi'
random_icon_states = list("tomato_floor1", "tomato_floor2", "tomato_floor3")
/obj/effect/decal/cleanable/plant_smudge
name = "plant smudge"
gender = NEUTER
icon = 'icons/effects/tomatodecal.dmi'
random_icon_states = list("smashed_plant")
/obj/effect/decal/cleanable/egg_smudge
name = "smashed egg"
desc = "Seems like this one won't hatch."
gender = NEUTER
icon = 'icons/effects/tomatodecal.dmi'
random_icon_states = list("smashed_egg1", "smashed_egg2", "smashed_egg3")
/obj/effect/decal/cleanable/pie_smudge //honk
name = "smashed pie"
desc = "It's pie cream from a cream pie."
gender = NEUTER
icon = 'icons/effects/tomatodecal.dmi'
random_icon_states = list("smashed_pie")
/obj/effect/decal/cleanable/chem_pile
name = "chemical pile"
desc = "A pile of chemicals. You can't quite tell what's inside it."
gender = NEUTER
icon = 'icons/obj/objects.dmi'
icon_state = "ash"
/obj/effect/decal/cleanable/shreds
name = "shreds"
desc = "The shredded remains of what appears to be clothing."
icon_state = "shreds"
gender = PLURAL
mergeable_decal = FALSE
/obj/effect/decal/cleanable/shreds/ex_act(severity, target)
if(severity == 1) //so shreds created during an explosion aren't deleted by the explosion.
qdel(src)
/obj/effect/decal/cleanable/shreds/Initialize()
pixel_x = rand(-10, 10)
pixel_y = rand(-10, 10)
. = ..()
/obj/effect/decal/cleanable/salt
name = "salt pile"
desc = "A sizable pile of table salt. Someone must be upset."
icon = 'icons/effects/tomatodecal.dmi'
icon_state = "salt_pile"
gender = NEUTER
/obj/effect/decal/cleanable/glitter
name = "generic glitter pile"
desc = "The herpes of arts and crafts."
icon = 'icons/effects/atmospherics.dmi'
gender = NEUTER
/obj/effect/decal/cleanable/glitter/pink
name = "pink glitter"
icon_state = "plasma_old"
/obj/effect/decal/cleanable/glitter/white
name = "white glitter"
icon_state = "nitrous_oxide_old"
/obj/effect/decal/cleanable/glitter/blue
name = "blue glitter"
icon_state = "freon_old"
/obj/effect/decal/cleanable/plasma
name = "stabilized plasma"
desc = "A puddle of stabilized plasma."
icon_state = "flour"
color = "#9e0089"
/obj/effect/decal/cleanable/insectguts
name = "insect guts"
desc = "One bug squashed. Four more will rise in its place."
icon = 'icons/effects/blood.dmi'
icon_state = "xfloor1"
random_icon_states = list("xfloor1", "xfloor2", "xfloor3", "xfloor4", "xfloor5", "xfloor6", "xfloor7")
@@ -1,65 +1,65 @@
// Note: BYOND is object oriented. There is no reason for this to be copy/pasted blood code.
/obj/effect/decal/cleanable/robot_debris
name = "robot debris"
desc = "It's a useless heap of junk... <i>or is it?</i>"
icon = 'icons/mob/robots.dmi'
icon_state = "gib1"
layer = LOW_OBJ_LAYER
random_icon_states = list("gib1", "gib2", "gib3", "gib4", "gib5", "gib6", "gib7")
blood_state = BLOOD_STATE_OIL
bloodiness = BLOOD_AMOUNT_PER_DECAL
mergeable_decal = FALSE
/obj/effect/decal/cleanable/robot_debris/Initialize(mapload, list/datum/disease/diseases)
. = ..()
reagents.add_reagent(/datum/reagent/liquidgibs, 5)
/obj/effect/decal/cleanable/robot_debris/proc/streak(list/directions)
set waitfor = 0
var/direction = pick(directions)
for (var/i = 0, i < pick(1, 200; 2, 150; 3, 50), i++)
sleep(2)
if (i > 0)
if (prob(40))
new /obj/effect/decal/cleanable/oil/streak(src.loc)
else if (prob(10))
var/datum/effect_system/spark_spread/s = new /datum/effect_system/spark_spread
s.set_up(3, 1, src)
s.start()
if (!step_to(src, get_step(src, direction), 0))
break
/obj/effect/decal/cleanable/robot_debris/ex_act()
return
/obj/effect/decal/cleanable/robot_debris/limb
random_icon_states = list("gibarm", "gibleg")
/obj/effect/decal/cleanable/robot_debris/up
random_icon_states = list("gib1", "gib2", "gib3", "gib4", "gib5", "gib6", "gib7","gibup1","gibup1")
/obj/effect/decal/cleanable/robot_debris/down
random_icon_states = list("gib1", "gib2", "gib3", "gib4", "gib5", "gib6", "gib7","gibdown1","gibdown1")
/obj/effect/decal/cleanable/oil
name = "motor oil"
desc = "It's black and greasy. Looks like Beepsky made another mess."
icon = 'icons/mob/robots.dmi'
icon_state = "floor1"
random_icon_states = list("floor1", "floor2", "floor3", "floor4", "floor5", "floor6", "floor7")
blood_state = BLOOD_STATE_OIL
bloodiness = BLOOD_AMOUNT_PER_DECAL
/obj/effect/decal/cleanable/oil/Initialize()
. = ..()
reagents.add_reagent(/datum/reagent/oil, 30)
reagents.add_reagent(/datum/reagent/liquidgibs/oil, 5)
/obj/effect/decal/cleanable/oil/streak
random_icon_states = list("streak1", "streak2", "streak3", "streak4", "streak5")
/obj/effect/decal/cleanable/oil/slippery
/obj/effect/decal/cleanable/oil/slippery/Initialize()
AddComponent(/datum/component/slippery, 80, (NO_SLIP_WHEN_WALKING | SLIDE))
// Note: BYOND is object oriented. There is no reason for this to be copy/pasted blood code.
/obj/effect/decal/cleanable/robot_debris
name = "robot debris"
desc = "It's a useless heap of junk... <i>or is it?</i>"
icon = 'icons/mob/robots.dmi'
icon_state = "gib1"
layer = LOW_OBJ_LAYER
random_icon_states = list("gib1", "gib2", "gib3", "gib4", "gib5", "gib6", "gib7")
blood_state = BLOOD_STATE_OIL
bloodiness = BLOOD_AMOUNT_PER_DECAL
mergeable_decal = FALSE
/obj/effect/decal/cleanable/robot_debris/Initialize(mapload, list/datum/disease/diseases)
. = ..()
reagents.add_reagent(/datum/reagent/liquidgibs, 5)
/obj/effect/decal/cleanable/robot_debris/proc/streak(list/directions)
set waitfor = 0
var/direction = pick(directions)
for (var/i = 0, i < pick(1, 200; 2, 150; 3, 50), i++)
sleep(2)
if (i > 0)
if (prob(40))
new /obj/effect/decal/cleanable/oil/streak(src.loc)
else if (prob(10))
var/datum/effect_system/spark_spread/s = new /datum/effect_system/spark_spread
s.set_up(3, 1, src)
s.start()
if (!step_to(src, get_step(src, direction), 0))
break
/obj/effect/decal/cleanable/robot_debris/ex_act()
return
/obj/effect/decal/cleanable/robot_debris/limb
random_icon_states = list("gibarm", "gibleg")
/obj/effect/decal/cleanable/robot_debris/up
random_icon_states = list("gib1", "gib2", "gib3", "gib4", "gib5", "gib6", "gib7","gibup1","gibup1")
/obj/effect/decal/cleanable/robot_debris/down
random_icon_states = list("gib1", "gib2", "gib3", "gib4", "gib5", "gib6", "gib7","gibdown1","gibdown1")
/obj/effect/decal/cleanable/oil
name = "motor oil"
desc = "It's black and greasy. Looks like Beepsky made another mess."
icon = 'icons/mob/robots.dmi'
icon_state = "floor1"
random_icon_states = list("floor1", "floor2", "floor3", "floor4", "floor5", "floor6", "floor7")
blood_state = BLOOD_STATE_OIL
bloodiness = BLOOD_AMOUNT_PER_DECAL
/obj/effect/decal/cleanable/oil/Initialize()
. = ..()
reagents.add_reagent(/datum/reagent/oil, 30)
reagents.add_reagent(/datum/reagent/liquidgibs/oil, 5)
/obj/effect/decal/cleanable/oil/streak
random_icon_states = list("streak1", "streak2", "streak3", "streak4", "streak5")
/obj/effect/decal/cleanable/oil/slippery
/obj/effect/decal/cleanable/oil/slippery/Initialize()
AddComponent(/datum/component/slippery, 80, (NO_SLIP_WHEN_WALKING | SLIDE))
+31 -31
View File
@@ -1,31 +1,31 @@
/obj/effect/decal/cleanable/crayon
name = "rune"
desc = "Graffiti. Damn kids."
icon = 'icons/effects/crayondecal.dmi'
icon_state = "rune1"
plane = GAME_PLANE //makes the graffiti visible over a wall.
gender = NEUTER
mergeable_decal = FALSE
var/do_icon_rotate = TRUE
var/rotation = 0
var/paint_colour = "#FFFFFF"
/obj/effect/decal/cleanable/crayon/Initialize(mapload, main, type, e_name, graf_rot, alt_icon = null)
. = ..()
if(e_name)
name = e_name
desc = "A [name] vandalizing the station."
if(alt_icon)
icon = alt_icon
if(type)
icon_state = type
if(graf_rot)
rotation = graf_rot
if(rotation && do_icon_rotate)
var/matrix/M = matrix()
M.Turn(rotation)
src.transform = M
if(main)
paint_colour = main
add_atom_colour(paint_colour, FIXED_COLOUR_PRIORITY)
/obj/effect/decal/cleanable/crayon
name = "rune"
desc = "Graffiti. Damn kids."
icon = 'icons/effects/crayondecal.dmi'
icon_state = "rune1"
plane = GAME_PLANE //makes the graffiti visible over a wall.
gender = NEUTER
mergeable_decal = FALSE
var/do_icon_rotate = TRUE
var/rotation = 0
var/paint_colour = "#FFFFFF"
/obj/effect/decal/cleanable/crayon/Initialize(mapload, main, type, e_name, graf_rot, alt_icon = null)
. = ..()
if(e_name)
name = e_name
desc = "A [name] vandalizing the station."
if(alt_icon)
icon = alt_icon
if(type)
icon_state = type
if(graf_rot)
rotation = graf_rot
if(rotation && do_icon_rotate)
var/matrix/M = matrix()
M.Turn(rotation)
src.transform = M
if(main)
paint_colour = main
add_atom_colour(paint_colour, FIXED_COLOUR_PRIORITY)
+48 -48
View File
@@ -1,48 +1,48 @@
/obj/effect/decal
name = "decal"
plane = FLOOR_PLANE
anchored = TRUE
resistance_flags = FIRE_PROOF | UNACIDABLE | ACID_PROOF
var/turf_loc_check = TRUE
/obj/effect/decal/Initialize()
. = ..()
if(turf_loc_check && (!isturf(loc) || NeverShouldHaveComeHere(loc)))
return INITIALIZE_HINT_QDEL
/obj/effect/decal/blob_act(obj/structure/blob/B)
if(B && B.loc == loc)
qdel(src)
/obj/effect/decal/proc/NeverShouldHaveComeHere(turf/T)
return isclosedturf(T) || isgroundlessturf(T)
/obj/effect/decal/ex_act(severity, target)
qdel(src)
/obj/effect/decal/fire_act(exposed_temperature, exposed_volume)
if(!(resistance_flags & FIRE_PROOF)) //non fire proof decal or being burned by lava
qdel(src)
/obj/effect/decal/HandleTurfChange(turf/T)
..()
if(T == loc && NeverShouldHaveComeHere(T))
qdel(src)
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/obj/effect/turf_decal
icon = 'icons/turf/decals.dmi'
icon_state = "warningline"
layer = TURF_DECAL_LAYER
/obj/effect/turf_decal/Initialize()
..()
return INITIALIZE_HINT_QDEL
/obj/effect/turf_decal/ComponentInitialize()
. = ..()
var/turf/T = loc
if(!istype(T)) //you know this will happen somehow
CRASH("Turf decal initialized in an object/nullspace")
T.AddComponent(/datum/component/decal, icon, icon_state, dir, CLEAN_GOD, color, null, null, alpha)
/obj/effect/decal
name = "decal"
plane = FLOOR_PLANE
anchored = TRUE
resistance_flags = FIRE_PROOF | UNACIDABLE | ACID_PROOF
var/turf_loc_check = TRUE
/obj/effect/decal/Initialize()
. = ..()
if(turf_loc_check && (!isturf(loc) || NeverShouldHaveComeHere(loc)))
return INITIALIZE_HINT_QDEL
/obj/effect/decal/blob_act(obj/structure/blob/B)
if(B && B.loc == loc)
qdel(src)
/obj/effect/decal/proc/NeverShouldHaveComeHere(turf/T)
return isclosedturf(T) || isgroundlessturf(T)
/obj/effect/decal/ex_act(severity, target)
qdel(src)
/obj/effect/decal/fire_act(exposed_temperature, exposed_volume)
if(!(resistance_flags & FIRE_PROOF)) //non fire proof decal or being burned by lava
qdel(src)
/obj/effect/decal/HandleTurfChange(turf/T)
..()
if(T == loc && NeverShouldHaveComeHere(T))
qdel(src)
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/obj/effect/turf_decal
icon = 'icons/turf/decals.dmi'
icon_state = "warningline"
layer = TURF_DECAL_LAYER
/obj/effect/turf_decal/Initialize()
..()
return INITIALIZE_HINT_QDEL
/obj/effect/turf_decal/ComponentInitialize()
. = ..()
var/turf/T = loc
if(!istype(T)) //you know this will happen somehow
CRASH("Turf decal initialized in an object/nullspace")
T.AddComponent(/datum/component/decal, icon, icon_state, dir, CLEAN_GOD, color, null, null, alpha)
+31 -31
View File
@@ -1,31 +1,31 @@
/obj/effect/temp_visual/point
name = "pointer"
icon = 'icons/mob/screen_gen.dmi'
icon_state = "arrow"
layer = POINT_LAYER
duration = 25
/obj/effect/temp_visual/point/Initialize(mapload, set_invis = 0)
. = ..()
var/atom/old_loc = loc
loc = get_turf(src) // We don't want to actualy trigger anything when it moves
pixel_x = old_loc.pixel_x
pixel_y = old_loc.pixel_y
invisibility = set_invis
//Used by spraybottles.
/obj/effect/decal/chempuff
name = "chemicals"
icon = 'icons/obj/chempuff.dmi'
pass_flags = PASSTABLE | PASSGRILLE
layer = FLY_LAYER
/obj/effect/decal/chempuff/blob_act(obj/structure/blob/B)
return
/obj/effect/decal/fakelattice
name = "lattice"
desc = "A lightweight support lattice."
icon = 'icons/obj/smooth_structures/lattice.dmi'
icon_state = "lattice"
density = TRUE
/obj/effect/temp_visual/point
name = "pointer"
icon = 'icons/mob/screen_gen.dmi'
icon_state = "arrow"
layer = POINT_LAYER
duration = 25
/obj/effect/temp_visual/point/Initialize(mapload, set_invis = 0)
. = ..()
var/atom/old_loc = loc
loc = get_turf(src) // We don't want to actualy trigger anything when it moves
pixel_x = old_loc.pixel_x
pixel_y = old_loc.pixel_y
invisibility = set_invis
//Used by spraybottles.
/obj/effect/decal/chempuff
name = "chemicals"
icon = 'icons/obj/chempuff.dmi'
pass_flags = PASSTABLE | PASSGRILLE
layer = FLY_LAYER
/obj/effect/decal/chempuff/blob_act(obj/structure/blob/B)
return
/obj/effect/decal/fakelattice
name = "lattice"
desc = "A lightweight support lattice."
icon = 'icons/obj/smooth_structures/lattice.dmi'
icon_state = "lattice"
density = TRUE
+33 -33
View File
@@ -1,33 +1,33 @@
/obj/effect/decal/remains
name = "remains"
gender = PLURAL
icon = 'icons/effects/blood.dmi'
/obj/effect/decal/remains/acid_act()
visible_message("<span class='warning'>[src] dissolve[gender==PLURAL?"":"s"] into a puddle of sizzling goop!</span>")
playsound(src, 'sound/items/welder.ogg', 150, 1)
new /obj/effect/decal/cleanable/greenglow(drop_location())
qdel(src)
/obj/effect/decal/remains/human
desc = "They look like human remains. They have a strange aura about them."
icon_state = "remains"
/obj/effect/decal/remains/plasma
icon_state = "remainsplasma"
/obj/effect/decal/remains/xeno
desc = "They look like the remains of something... alien. They have a strange aura about them."
icon_state = "remainsxeno"
/obj/effect/decal/remains/xeno/larva
icon_state = "remainslarva"
/obj/effect/decal/remains/robot
desc = "They look like the remains of something mechanical. They have a strange aura about them."
icon = 'icons/mob/robots.dmi'
icon_state = "remainsrobot"
/obj/effect/decal/cleanable/robot_debris/old
name = "dusty robot debris"
desc = "Looks like nobody has touched this in a while."
/obj/effect/decal/remains
name = "remains"
gender = PLURAL
icon = 'icons/effects/blood.dmi'
/obj/effect/decal/remains/acid_act()
visible_message("<span class='warning'>[src] dissolve[gender==PLURAL?"":"s"] into a puddle of sizzling goop!</span>")
playsound(src, 'sound/items/welder.ogg', 150, 1)
new /obj/effect/decal/cleanable/greenglow(drop_location())
qdel(src)
/obj/effect/decal/remains/human
desc = "They look like human remains. They have a strange aura about them."
icon_state = "remains"
/obj/effect/decal/remains/plasma
icon_state = "remainsplasma"
/obj/effect/decal/remains/xeno
desc = "They look like the remains of something... alien. They have a strange aura about them."
icon_state = "remainsxeno"
/obj/effect/decal/remains/xeno/larva
icon_state = "remainslarva"
/obj/effect/decal/remains/robot
desc = "They look like the remains of something mechanical. They have a strange aura about them."
icon = 'icons/mob/robots.dmi'
icon_state = "remainsrobot"
/obj/effect/decal/cleanable/robot_debris/old
name = "dusty robot debris"
desc = "Looks like nobody has touched this in a while."
@@ -1,347 +1,347 @@
// Foam
// Similar to smoke, but slower and mobs absorb its reagent through their exposed skin.
#define ALUMINUM_FOAM 1
#define IRON_FOAM 2
#define RESIN_FOAM 3
/obj/effect/particle_effect/foam
name = "foam"
icon_state = "foam"
opacity = 0
anchored = TRUE
density = FALSE
layer = EDGED_TURF_LAYER
mouse_opacity = MOUSE_OPACITY_TRANSPARENT
var/amount = 3
animate_movement = 0
var/metal = 0
var/lifetime = 40
var/reagent_divisor = 7
var/static/list/blacklisted_turfs = typecacheof(list(
/turf/open/space/transit,
/turf/open/chasm,
/turf/open/lava))
/obj/effect/particle_effect/foam/firefighting
name = "firefighting foam"
lifetime = 20 //doesn't last as long as normal foam
amount = 0 //no spread
var/absorbed_plasma = 0
/obj/effect/particle_effect/foam/firefighting/MakeSlippery()
return
/obj/effect/particle_effect/foam/firefighting/process()
..()
var/turf/open/T = get_turf(src)
var/obj/effect/hotspot/hotspot = (locate(/obj/effect/hotspot) in T)
if(hotspot && istype(T) && T.air)
qdel(hotspot)
var/datum/gas_mixture/G = T.air
var/plas_amt = min(30,G.gases[/datum/gas/plasma]) //Absorb some plasma
G.gases[/datum/gas/plasma] -= plas_amt
absorbed_plasma += plas_amt
if(G.temperature > T20C)
G.temperature = max(G.temperature/2,T20C)
GAS_GARBAGE_COLLECT(G.gases)
T.air_update_turf()
/obj/effect/particle_effect/foam/firefighting/kill_foam()
STOP_PROCESSING(SSfastprocess, src)
if(absorbed_plasma)
var/obj/effect/decal/cleanable/plasma/P = (locate(/obj/effect/decal/cleanable/plasma) in get_turf(src))
if(!P)
P = new(loc)
P.reagents.add_reagent(/datum/reagent/stable_plasma, absorbed_plasma)
flick("[icon_state]-disolve", src)
QDEL_IN(src, 5)
/obj/effect/particle_effect/foam/firefighting/foam_mob(mob/living/L)
if(!istype(L))
return
L.adjust_fire_stacks(-2)
L.ExtinguishMob()
/obj/effect/particle_effect/foam/firefighting/temperature_expose(datum/gas_mixture/air, exposed_temperature, exposed_volume)
return
/obj/effect/particle_effect/foam/metal
name = "aluminium foam"
metal = ALUMINUM_FOAM
icon_state = "mfoam"
/obj/effect/particle_effect/foam/metal/MakeSlippery()
return
/obj/effect/particle_effect/foam/metal/smart
name = "smart foam"
/obj/effect/particle_effect/foam/metal/iron
name = "iron foam"
metal = IRON_FOAM
/obj/effect/particle_effect/foam/metal/resin
name = "resin foam"
metal = RESIN_FOAM
/obj/effect/particle_effect/foam/long_life
lifetime = 150
/obj/effect/particle_effect/foam/Initialize()
. = ..()
MakeSlippery()
create_reagents(1000) //limited by the size of the reagent holder anyway.
START_PROCESSING(SSfastprocess, src)
playsound(src, 'sound/effects/bubbles2.ogg', 80, 1, -3)
/obj/effect/particle_effect/foam/proc/MakeSlippery()
AddComponent(/datum/component/slippery, 100)
/obj/effect/particle_effect/foam/Destroy()
STOP_PROCESSING(SSfastprocess, src)
return ..()
/obj/effect/particle_effect/foam/proc/kill_foam()
STOP_PROCESSING(SSfastprocess, src)
switch(metal)
if(ALUMINUM_FOAM)
new /obj/structure/foamedmetal(get_turf(src))
if(IRON_FOAM)
new /obj/structure/foamedmetal/iron(get_turf(src))
if(RESIN_FOAM)
new /obj/structure/foamedmetal/resin(get_turf(src))
flick("[icon_state]-disolve", src)
QDEL_IN(src, 5)
/obj/effect/particle_effect/foam/smart/kill_foam() //Smart foam adheres to area borders for walls
STOP_PROCESSING(SSfastprocess, src)
if(metal)
var/turf/T = get_turf(src)
if(isspaceturf(T)) //Block up any exposed space
T.PlaceOnTop(/turf/open/floor/plating/foam, flags = CHANGETURF_INHERIT_AIR)
for(var/direction in GLOB.cardinals)
var/turf/cardinal_turf = get_step(T, direction)
if(get_area(cardinal_turf) != get_area(T)) //We're at an area boundary, so let's block off this turf!
new/obj/structure/foamedmetal(T)
break
flick("[icon_state]-disolve", src)
QDEL_IN(src, 5)
/obj/effect/particle_effect/foam/process()
lifetime--
if(lifetime < 1)
kill_foam()
return
var/fraction = 1/initial(reagent_divisor)
for(var/obj/O in range(0,src))
if(O.type == src.type)
continue
if(isturf(O.loc))
var/turf/T = O.loc
if(T.intact && O.level == 1) //hidden under the floor
continue
if(lifetime % reagent_divisor)
reagents.reaction(O, VAPOR, fraction)
var/hit = 0
for(var/mob/living/L in range(0,src))
hit += foam_mob(L)
if(hit)
lifetime++ //this is so the decrease from mobs hit and the natural decrease don't cumulate.
var/T = get_turf(src)
if(lifetime % reagent_divisor)
reagents.reaction(T, VAPOR, fraction)
if(--amount < 0)
return
spread_foam()
/obj/effect/particle_effect/foam/proc/foam_mob(mob/living/L)
if(lifetime<1)
return 0
if(!istype(L))
return 0
var/fraction = 1/initial(reagent_divisor)
if(lifetime % reagent_divisor)
reagents.reaction(L, VAPOR, fraction)
lifetime--
return 1
/obj/effect/particle_effect/foam/proc/spread_foam()
var/turf/t_loc = get_turf(src)
for(var/turf/T in t_loc.GetAtmosAdjacentTurfs())
var/obj/effect/particle_effect/foam/foundfoam = locate() in T //Don't spread foam where there's already foam!
if(foundfoam)
continue
if(is_type_in_typecache(T, blacklisted_turfs))
continue
for(var/mob/living/L in T)
foam_mob(L)
var/obj/effect/particle_effect/foam/F = new src.type(T)
F.amount = amount
reagents.copy_to(F, (reagents.total_volume))
F.add_atom_colour(color, FIXED_COLOUR_PRIORITY)
F.metal = metal
/obj/effect/particle_effect/foam/temperature_expose(datum/gas_mixture/air, exposed_temperature, exposed_volume)
if(prob(max(0, exposed_temperature - 475))) //foam dissolves when heated
kill_foam()
/obj/effect/particle_effect/foam/metal/temperature_expose(datum/gas_mixture/air, exposed_temperature, exposed_volume)
return
///////////////////////////////////////////////
//FOAM EFFECT DATUM
/datum/effect_system/foam_spread
var/amount = 10 // the size of the foam spread.
var/obj/chemholder
effect_type = /obj/effect/particle_effect/foam
var/metal = 0
/datum/effect_system/foam_spread/metal
effect_type = /obj/effect/particle_effect/foam/metal
/datum/effect_system/foam_spread/metal/smart
effect_type = /obj/effect/particle_effect/foam/smart
/datum/effect_system/foam_spread/long
effect_type = /obj/effect/particle_effect/foam/long_life
/datum/effect_system/foam_spread/New()
..()
chemholder = new /obj()
var/datum/reagents/R = new/datum/reagents(1000)
chemholder.reagents = R
R.my_atom = chemholder
/datum/effect_system/foam_spread/Destroy()
qdel(chemholder)
chemholder = null
return ..()
/datum/effect_system/foam_spread/set_up(amt=5, loca, datum/reagents/carry = null)
if(isturf(loca))
location = loca
else
location = get_turf(loca)
amount = round(sqrt(amt / 2), 1)
carry.copy_to(chemholder, carry.total_volume)
/datum/effect_system/foam_spread/metal/set_up(amt=5, loca, datum/reagents/carry = null, metaltype)
..()
metal = metaltype
/datum/effect_system/foam_spread/start()
var/obj/effect/particle_effect/foam/F = new effect_type(location)
var/foamcolor = mix_color_from_reagents(chemholder.reagents.reagent_list)
chemholder.reagents.copy_to(F, chemholder.reagents.total_volume/amount)
F.add_atom_colour(foamcolor, FIXED_COLOUR_PRIORITY)
F.amount = amount
F.metal = metal
//////////////////////////////////////////////////////////
// FOAM STRUCTURE. Formed by metal foams. Dense and opaque, but easy to break
/obj/structure/foamedmetal
icon = 'icons/effects/effects.dmi'
icon_state = "metalfoam"
density = TRUE
opacity = 1 // changed in New()
anchored = TRUE
layer = EDGED_TURF_LAYER
resistance_flags = FIRE_PROOF | ACID_PROOF
name = "foamed metal"
desc = "A lightweight foamed metal wall."
gender = PLURAL
max_integrity = 20
CanAtmosPass = ATMOS_PASS_DENSITY
/obj/structure/foamedmetal/Initialize()
. = ..()
air_update_turf(1)
/obj/structure/foamedmetal/Move()
var/turf/T = loc
. = ..()
move_update_air(T)
/obj/structure/foamedmetal/attack_paw(mob/user)
return attack_hand(user)
/obj/structure/foamedmetal/play_attack_sound(damage_amount, damage_type = BRUTE, damage_flag = 0)
playsound(src.loc, 'sound/weapons/tap.ogg', 100, 1)
/obj/structure/foamedmetal/attack_hand(mob/user)
. = ..()
if(.)
return
user.changeNext_move(CLICK_CD_MELEE)
user.do_attack_animation(src, ATTACK_EFFECT_PUNCH)
to_chat(user, "<span class='warning'>You hit [src] but bounce off it!</span>")
playsound(src.loc, 'sound/weapons/tap.ogg', 100, 1)
/obj/structure/foamedmetal/CanPass(atom/movable/mover, turf/target)
return !density
/obj/structure/foamedmetal/iron
max_integrity = 50
icon_state = "ironfoam"
//Atmos Backpack Resin, transparent, prevents atmos and filters the air
/obj/structure/foamedmetal/resin
name = "\improper ATMOS Resin"
desc = "A lightweight, transparent resin used to suffocate fires, scrub the air of toxins, and restore the air to a safe temperature."
opacity = FALSE
icon_state = "atmos_resin"
alpha = 120
max_integrity = 10
/obj/structure/foamedmetal/resin/Initialize()
. = ..()
if(isopenturf(loc))
var/turf/open/O = loc
O.ClearWet()
if(O.air)
var/datum/gas_mixture/G = O.air
G.temperature = 293.15
for(var/obj/effect/hotspot/H in O)
qdel(H)
var/list/G_gases = G.gases
for(var/I in G_gases)
if(I == /datum/gas/oxygen || I == /datum/gas/nitrogen)
continue
G_gases[I] = 0
GAS_GARBAGE_COLLECT(G.gases)
O.air_update_turf()
for(var/obj/machinery/atmospherics/components/unary/U in O)
if(!U.welded)
U.welded = TRUE
U.update_icon()
U.visible_message("<span class='danger'>[U] sealed shut!</span>")
for(var/mob/living/L in O)
L.ExtinguishMob()
for(var/obj/item/Item in O)
Item.extinguish()
/obj/structure/foamedmetal/resin/CanPass(atom/movable/mover, turf/target)
if(istype(mover) && (mover.pass_flags & PASSGLASS))
return TRUE
. = ..()
#undef ALUMINUM_FOAM
#undef IRON_FOAM
#undef RESIN_FOAM
// Foam
// Similar to smoke, but slower and mobs absorb its reagent through their exposed skin.
#define ALUMINUM_FOAM 1
#define IRON_FOAM 2
#define RESIN_FOAM 3
/obj/effect/particle_effect/foam
name = "foam"
icon_state = "foam"
opacity = 0
anchored = TRUE
density = FALSE
layer = EDGED_TURF_LAYER
mouse_opacity = MOUSE_OPACITY_TRANSPARENT
var/amount = 3
animate_movement = 0
var/metal = 0
var/lifetime = 40
var/reagent_divisor = 7
var/static/list/blacklisted_turfs = typecacheof(list(
/turf/open/space/transit,
/turf/open/chasm,
/turf/open/lava))
/obj/effect/particle_effect/foam/firefighting
name = "firefighting foam"
lifetime = 20 //doesn't last as long as normal foam
amount = 0 //no spread
var/absorbed_plasma = 0
/obj/effect/particle_effect/foam/firefighting/MakeSlippery()
return
/obj/effect/particle_effect/foam/firefighting/process()
..()
var/turf/open/T = get_turf(src)
var/obj/effect/hotspot/hotspot = (locate(/obj/effect/hotspot) in T)
if(hotspot && istype(T) && T.air)
qdel(hotspot)
var/datum/gas_mixture/G = T.air
var/plas_amt = min(30,G.gases[/datum/gas/plasma]) //Absorb some plasma
G.gases[/datum/gas/plasma] -= plas_amt
absorbed_plasma += plas_amt
if(G.temperature > T20C)
G.temperature = max(G.temperature/2,T20C)
GAS_GARBAGE_COLLECT(G.gases)
T.air_update_turf()
/obj/effect/particle_effect/foam/firefighting/kill_foam()
STOP_PROCESSING(SSfastprocess, src)
if(absorbed_plasma)
var/obj/effect/decal/cleanable/plasma/P = (locate(/obj/effect/decal/cleanable/plasma) in get_turf(src))
if(!P)
P = new(loc)
P.reagents.add_reagent(/datum/reagent/stable_plasma, absorbed_plasma)
flick("[icon_state]-disolve", src)
QDEL_IN(src, 5)
/obj/effect/particle_effect/foam/firefighting/foam_mob(mob/living/L)
if(!istype(L))
return
L.adjust_fire_stacks(-2)
L.ExtinguishMob()
/obj/effect/particle_effect/foam/firefighting/temperature_expose(datum/gas_mixture/air, exposed_temperature, exposed_volume)
return
/obj/effect/particle_effect/foam/metal
name = "aluminium foam"
metal = ALUMINUM_FOAM
icon_state = "mfoam"
/obj/effect/particle_effect/foam/metal/MakeSlippery()
return
/obj/effect/particle_effect/foam/metal/smart
name = "smart foam"
/obj/effect/particle_effect/foam/metal/iron
name = "iron foam"
metal = IRON_FOAM
/obj/effect/particle_effect/foam/metal/resin
name = "resin foam"
metal = RESIN_FOAM
/obj/effect/particle_effect/foam/long_life
lifetime = 150
/obj/effect/particle_effect/foam/Initialize()
. = ..()
MakeSlippery()
create_reagents(1000) //limited by the size of the reagent holder anyway.
START_PROCESSING(SSfastprocess, src)
playsound(src, 'sound/effects/bubbles2.ogg', 80, 1, -3)
/obj/effect/particle_effect/foam/proc/MakeSlippery()
AddComponent(/datum/component/slippery, 100)
/obj/effect/particle_effect/foam/Destroy()
STOP_PROCESSING(SSfastprocess, src)
return ..()
/obj/effect/particle_effect/foam/proc/kill_foam()
STOP_PROCESSING(SSfastprocess, src)
switch(metal)
if(ALUMINUM_FOAM)
new /obj/structure/foamedmetal(get_turf(src))
if(IRON_FOAM)
new /obj/structure/foamedmetal/iron(get_turf(src))
if(RESIN_FOAM)
new /obj/structure/foamedmetal/resin(get_turf(src))
flick("[icon_state]-disolve", src)
QDEL_IN(src, 5)
/obj/effect/particle_effect/foam/smart/kill_foam() //Smart foam adheres to area borders for walls
STOP_PROCESSING(SSfastprocess, src)
if(metal)
var/turf/T = get_turf(src)
if(isspaceturf(T)) //Block up any exposed space
T.PlaceOnTop(/turf/open/floor/plating/foam, flags = CHANGETURF_INHERIT_AIR)
for(var/direction in GLOB.cardinals)
var/turf/cardinal_turf = get_step(T, direction)
if(get_area(cardinal_turf) != get_area(T)) //We're at an area boundary, so let's block off this turf!
new/obj/structure/foamedmetal(T)
break
flick("[icon_state]-disolve", src)
QDEL_IN(src, 5)
/obj/effect/particle_effect/foam/process()
lifetime--
if(lifetime < 1)
kill_foam()
return
var/fraction = 1/initial(reagent_divisor)
for(var/obj/O in range(0,src))
if(O.type == src.type)
continue
if(isturf(O.loc))
var/turf/T = O.loc
if(T.intact && O.level == 1) //hidden under the floor
continue
if(lifetime % reagent_divisor)
reagents.reaction(O, VAPOR, fraction)
var/hit = 0
for(var/mob/living/L in range(0,src))
hit += foam_mob(L)
if(hit)
lifetime++ //this is so the decrease from mobs hit and the natural decrease don't cumulate.
var/T = get_turf(src)
if(lifetime % reagent_divisor)
reagents.reaction(T, VAPOR, fraction)
if(--amount < 0)
return
spread_foam()
/obj/effect/particle_effect/foam/proc/foam_mob(mob/living/L)
if(lifetime<1)
return 0
if(!istype(L))
return 0
var/fraction = 1/initial(reagent_divisor)
if(lifetime % reagent_divisor)
reagents.reaction(L, VAPOR, fraction)
lifetime--
return 1
/obj/effect/particle_effect/foam/proc/spread_foam()
var/turf/t_loc = get_turf(src)
for(var/turf/T in t_loc.GetAtmosAdjacentTurfs())
var/obj/effect/particle_effect/foam/foundfoam = locate() in T //Don't spread foam where there's already foam!
if(foundfoam)
continue
if(is_type_in_typecache(T, blacklisted_turfs))
continue
for(var/mob/living/L in T)
foam_mob(L)
var/obj/effect/particle_effect/foam/F = new src.type(T)
F.amount = amount
reagents.copy_to(F, (reagents.total_volume))
F.add_atom_colour(color, FIXED_COLOUR_PRIORITY)
F.metal = metal
/obj/effect/particle_effect/foam/temperature_expose(datum/gas_mixture/air, exposed_temperature, exposed_volume)
if(prob(max(0, exposed_temperature - 475))) //foam dissolves when heated
kill_foam()
/obj/effect/particle_effect/foam/metal/temperature_expose(datum/gas_mixture/air, exposed_temperature, exposed_volume)
return
///////////////////////////////////////////////
//FOAM EFFECT DATUM
/datum/effect_system/foam_spread
var/amount = 10 // the size of the foam spread.
var/obj/chemholder
effect_type = /obj/effect/particle_effect/foam
var/metal = 0
/datum/effect_system/foam_spread/metal
effect_type = /obj/effect/particle_effect/foam/metal
/datum/effect_system/foam_spread/metal/smart
effect_type = /obj/effect/particle_effect/foam/smart
/datum/effect_system/foam_spread/long
effect_type = /obj/effect/particle_effect/foam/long_life
/datum/effect_system/foam_spread/New()
..()
chemholder = new /obj()
var/datum/reagents/R = new/datum/reagents(1000)
chemholder.reagents = R
R.my_atom = chemholder
/datum/effect_system/foam_spread/Destroy()
qdel(chemholder)
chemholder = null
return ..()
/datum/effect_system/foam_spread/set_up(amt=5, loca, datum/reagents/carry = null)
if(isturf(loca))
location = loca
else
location = get_turf(loca)
amount = round(sqrt(amt / 2), 1)
carry.copy_to(chemholder, carry.total_volume)
/datum/effect_system/foam_spread/metal/set_up(amt=5, loca, datum/reagents/carry = null, metaltype)
..()
metal = metaltype
/datum/effect_system/foam_spread/start()
var/obj/effect/particle_effect/foam/F = new effect_type(location)
var/foamcolor = mix_color_from_reagents(chemholder.reagents.reagent_list)
chemholder.reagents.copy_to(F, chemholder.reagents.total_volume/amount)
F.add_atom_colour(foamcolor, FIXED_COLOUR_PRIORITY)
F.amount = amount
F.metal = metal
//////////////////////////////////////////////////////////
// FOAM STRUCTURE. Formed by metal foams. Dense and opaque, but easy to break
/obj/structure/foamedmetal
icon = 'icons/effects/effects.dmi'
icon_state = "metalfoam"
density = TRUE
opacity = 1 // changed in New()
anchored = TRUE
layer = EDGED_TURF_LAYER
resistance_flags = FIRE_PROOF | ACID_PROOF
name = "foamed metal"
desc = "A lightweight foamed metal wall."
gender = PLURAL
max_integrity = 20
CanAtmosPass = ATMOS_PASS_DENSITY
/obj/structure/foamedmetal/Initialize()
. = ..()
air_update_turf(1)
/obj/structure/foamedmetal/Move()
var/turf/T = loc
. = ..()
move_update_air(T)
/obj/structure/foamedmetal/attack_paw(mob/user)
return attack_hand(user)
/obj/structure/foamedmetal/play_attack_sound(damage_amount, damage_type = BRUTE, damage_flag = 0)
playsound(src.loc, 'sound/weapons/tap.ogg', 100, 1)
/obj/structure/foamedmetal/attack_hand(mob/user)
. = ..()
if(.)
return
user.changeNext_move(CLICK_CD_MELEE)
user.do_attack_animation(src, ATTACK_EFFECT_PUNCH)
to_chat(user, "<span class='warning'>You hit [src] but bounce off it!</span>")
playsound(src.loc, 'sound/weapons/tap.ogg', 100, 1)
/obj/structure/foamedmetal/CanPass(atom/movable/mover, turf/target)
return !density
/obj/structure/foamedmetal/iron
max_integrity = 50
icon_state = "ironfoam"
//Atmos Backpack Resin, transparent, prevents atmos and filters the air
/obj/structure/foamedmetal/resin
name = "\improper ATMOS Resin"
desc = "A lightweight, transparent resin used to suffocate fires, scrub the air of toxins, and restore the air to a safe temperature."
opacity = FALSE
icon_state = "atmos_resin"
alpha = 120
max_integrity = 10
/obj/structure/foamedmetal/resin/Initialize()
. = ..()
if(isopenturf(loc))
var/turf/open/O = loc
O.ClearWet()
if(O.air)
var/datum/gas_mixture/G = O.air
G.temperature = 293.15
for(var/obj/effect/hotspot/H in O)
qdel(H)
var/list/G_gases = G.gases
for(var/I in G_gases)
if(I == /datum/gas/oxygen || I == /datum/gas/nitrogen)
continue
G_gases[I] = 0
GAS_GARBAGE_COLLECT(G.gases)
O.air_update_turf()
for(var/obj/machinery/atmospherics/components/unary/U in O)
if(!U.welded)
U.welded = TRUE
U.update_icon()
U.visible_message("<span class='danger'>[U] sealed shut!</span>")
for(var/mob/living/L in O)
L.ExtinguishMob()
for(var/obj/item/Item in O)
Item.extinguish()
/obj/structure/foamedmetal/resin/CanPass(atom/movable/mover, turf/target)
if(istype(mover) && (mover.pass_flags & PASSGLASS))
return TRUE
. = ..()
#undef ALUMINUM_FOAM
#undef IRON_FOAM
#undef RESIN_FOAM
@@ -104,15 +104,4 @@
if(explosion_message)
location.visible_message("<span class='danger'>The solution violently explodes!</span>", \
"<span class='italics'>You hear an explosion!</span>")
if (amount < 1)
var/datum/effect_system/spark_spread/s = new /datum/effect_system/spark_spread
s.set_up(2, 1, location)
s.start()
for(var/mob/living/L in viewers(1, location))
if(prob(50 * amount))
to_chat(L, "<span class='danger'>The explosion knocks you down.</span>")
L.Knockdown(rand(20,100))
return
else
dyn_explosion(location, amount, flashing_factor)
dyn_explosion(location, amount, flashing_factor)
@@ -1,328 +1,328 @@
/////////////////////////////////////////////
//// SMOKE SYSTEMS
/////////////////////////////////////////////
/obj/effect/particle_effect/smoke
name = "smoke"
icon = 'icons/effects/96x96.dmi'
icon_state = "smoke"
pixel_x = -32
pixel_y = -32
opacity = 0
layer = FLY_LAYER
anchored = TRUE
mouse_opacity = MOUSE_OPACITY_TRANSPARENT
animate_movement = 0
var/amount = 4
var/lifetime = 5
var/opaque = 1 //whether the smoke can block the view when in enough amount
/obj/effect/particle_effect/smoke/proc/fade_out(frames = 16)
if(alpha == 0) //Handle already transparent case
return
if(frames == 0)
frames = 1 //We will just assume that by 0 frames, the coder meant "during one frame".
var/step = alpha / frames
for(var/i = 0, i < frames, i++)
alpha -= step
if(alpha < 160)
set_opacity(0) //if we were blocking view, we aren't now because we're fading out
stoplag()
/obj/effect/particle_effect/smoke/Initialize()
. = ..()
create_reagents(500)
START_PROCESSING(SSobj, src)
/obj/effect/particle_effect/smoke/Destroy()
STOP_PROCESSING(SSobj, src)
return ..()
/obj/effect/particle_effect/smoke/proc/kill_smoke()
STOP_PROCESSING(SSobj, src)
INVOKE_ASYNC(src, .proc/fade_out)
QDEL_IN(src, 10)
/obj/effect/particle_effect/smoke/process()
lifetime--
if(lifetime < 1)
kill_smoke()
return 0
for(var/mob/living/L in range(0,src))
smoke_mob(L)
return 1
/obj/effect/particle_effect/smoke/proc/smoke_mob(mob/living/carbon/C)
if(!istype(C))
return 0
if(lifetime<1)
return 0
if(C.internal != null || C.has_smoke_protection())
return 0
if(C.smoke_delay)
return 0
C.smoke_delay++
addtimer(CALLBACK(src, .proc/remove_smoke_delay, C), 10)
return 1
/obj/effect/particle_effect/smoke/proc/remove_smoke_delay(mob/living/carbon/C)
if(C)
C.smoke_delay = 0
/obj/effect/particle_effect/smoke/proc/spread_smoke()
var/turf/t_loc = get_turf(src)
if(!t_loc)
return
var/list/newsmokes = list()
for(var/turf/T in t_loc.GetAtmosAdjacentTurfs())
var/obj/effect/particle_effect/smoke/foundsmoke = locate() in T //Don't spread smoke where there's already smoke!
if(foundsmoke)
continue
for(var/mob/living/L in T)
smoke_mob(L)
var/obj/effect/particle_effect/smoke/S = new type(T)
reagents.copy_to(S, reagents.total_volume)
S.setDir(pick(GLOB.cardinals))
S.amount = amount-1
S.add_atom_colour(color, FIXED_COLOUR_PRIORITY)
S.lifetime = lifetime
if(S.amount>0)
if(opaque)
S.set_opacity(TRUE)
newsmokes.Add(S)
if(newsmokes.len)
spawn(1) //the smoke spreads rapidly but not instantly
for(var/obj/effect/particle_effect/smoke/SM in newsmokes)
SM.spread_smoke()
/datum/effect_system/smoke_spread
var/amount = 10
effect_type = /obj/effect/particle_effect/smoke
/datum/effect_system/smoke_spread/set_up(radius = 5, loca)
if(isturf(loca))
location = loca
else
location = get_turf(loca)
amount = radius
/datum/effect_system/smoke_spread/start()
if(holder)
location = get_turf(holder)
var/obj/effect/particle_effect/smoke/S = new effect_type(location)
S.amount = amount
if(S.amount)
S.spread_smoke()
/////////////////////////////////////////////
// Bad smoke
/////////////////////////////////////////////
/obj/effect/particle_effect/smoke/bad
lifetime = 8
/obj/effect/particle_effect/smoke/bad/smoke_mob(mob/living/carbon/M)
if(..())
M.drop_all_held_items()
M.adjustOxyLoss(1)
M.emote("cough")
return 1
/obj/effect/particle_effect/smoke/bad/CanPass(atom/movable/mover, turf/target)
if(istype(mover, /obj/item/projectile/beam))
var/obj/item/projectile/beam/B = mover
B.damage = (B.damage/2)
return 1
/datum/effect_system/smoke_spread/bad
effect_type = /obj/effect/particle_effect/smoke/bad
/////////////////////////////////////////////
// Nanofrost smoke
/////////////////////////////////////////////
/obj/effect/particle_effect/smoke/freezing
name = "nanofrost smoke"
color = "#B2FFFF"
opaque = 0
/datum/effect_system/smoke_spread/freezing
effect_type = /obj/effect/particle_effect/smoke/freezing
var/blast = 0
var/temperature = 2
var/weldvents = TRUE
var/distcheck = TRUE
/datum/effect_system/smoke_spread/freezing/proc/Chilled(atom/A)
if(isopenturf(A))
var/turf/open/T = A
if(T.air)
var/datum/gas_mixture/G = T.air
if(!distcheck || get_dist(T, location) < blast) // Otherwise we'll get silliness like people using Nanofrost to kill people through walls with cold air
G.temperature = temperature
T.air_update_turf()
for(var/obj/effect/hotspot/H in T)
qdel(H)
var/list/G_gases = G.gases
if(G_gases[/datum/gas/plasma])
G_gases[/datum/gas/nitrogen] += (G_gases[/datum/gas/plasma])
G_gases[/datum/gas/plasma] = 0
GAS_GARBAGE_COLLECT(G.gases)
if (weldvents)
for(var/obj/machinery/atmospherics/components/unary/U in T)
if(!isnull(U.welded) && !U.welded) //must be an unwelded vent pump or vent scrubber.
U.welded = TRUE
U.update_icon()
U.visible_message("<span class='danger'>[U] was frozen shut!</span>")
for(var/mob/living/L in T)
L.ExtinguishMob()
for(var/obj/item/Item in T)
Item.extinguish()
/datum/effect_system/smoke_spread/freezing/set_up(radius = 5, loca, blast_radius = 0)
..()
blast = blast_radius
/datum/effect_system/smoke_spread/freezing/start()
if(blast)
for(var/turf/T in RANGE_TURFS(blast, location))
Chilled(T)
..()
/datum/effect_system/smoke_spread/freezing/decon
temperature = 293.15
distcheck = FALSE
weldvents = FALSE
/////////////////////////////////////////////
// Sleep smoke
/////////////////////////////////////////////
/obj/effect/particle_effect/smoke/sleeping
color = "#9C3636"
lifetime = 10
/obj/effect/particle_effect/smoke/sleeping/smoke_mob(mob/living/carbon/M)
if(..())
M.Sleeping(200)
M.emote("cough")
return 1
/datum/effect_system/smoke_spread/sleeping
effect_type = /obj/effect/particle_effect/smoke/sleeping
/////////////////////////////////////////////
// Chem smoke
/////////////////////////////////////////////
/obj/effect/particle_effect/smoke/chem
lifetime = 10
/obj/effect/particle_effect/smoke/chem/process()
if(..())
var/turf/T = get_turf(src)
var/fraction = 1/initial(lifetime)
for(var/atom/movable/AM in T)
if(AM.type == src.type)
continue
if(T.intact && AM.level == 1) //hidden under the floor
continue
reagents.reaction(AM, TOUCH, fraction)
reagents.reaction(T, TOUCH, fraction)
return 1
/obj/effect/particle_effect/smoke/chem/smoke_mob(mob/living/carbon/M)
if(lifetime<1)
return 0
if(!istype(M))
return 0
var/mob/living/carbon/C = M
if(C.internal != null || C.has_smoke_protection())
return 0
var/fraction = 1/initial(lifetime)
reagents.copy_to(C, fraction*reagents.total_volume)
reagents.reaction(M, INGEST, fraction)
return 1
/datum/effect_system/smoke_spread/chem
var/obj/chemholder
effect_type = /obj/effect/particle_effect/smoke/chem
/datum/effect_system/smoke_spread/chem/New()
..()
chemholder = new /obj()
var/datum/reagents/R = new/datum/reagents(500)
chemholder.reagents = R
R.my_atom = chemholder
/datum/effect_system/smoke_spread/chem/Destroy()
qdel(chemholder)
chemholder = null
return ..()
/datum/effect_system/smoke_spread/chem/set_up(datum/reagents/carry = null, radius = 1, loca, silent = FALSE)
if(isturf(loca))
location = loca
else
location = get_turf(loca)
amount = radius
carry.copy_to(chemholder, carry.total_volume)
if(!silent)
var/contained = ""
for(var/reagent in carry.reagent_list)
contained += " [reagent] "
if(contained)
contained = "\[[contained]\]"
var/where = "[AREACOORD(location)]"
if(carry.my_atom && carry.my_atom.fingerprintslast)
var/mob/M = get_mob_by_key(carry.my_atom.fingerprintslast)
var/more = ""
if(M)
more = "[ADMIN_LOOKUPFLW(M)] "
message_admins("Smoke: ([ADMIN_VERBOSEJMP(location)])[contained]. Key: [more ? more : carry.my_atom.fingerprintslast].")
log_game("A chemical smoke reaction has taken place in ([where])[contained]. Last touched by [carry.my_atom.fingerprintslast].")
else
message_admins("Smoke: ([ADMIN_VERBOSEJMP(location)])[contained]. No associated key.")
log_game("A chemical smoke reaction has taken place in ([where])[contained]. No associated key.")
/datum/effect_system/smoke_spread/chem/start()
var/mixcolor = mix_color_from_reagents(chemholder.reagents.reagent_list)
if(holder)
location = get_turf(holder)
var/obj/effect/particle_effect/smoke/chem/S = new effect_type(location)
if(chemholder.reagents.total_volume > 1) // can't split 1 very well
chemholder.reagents.copy_to(S, chemholder.reagents.total_volume)
if(mixcolor)
S.add_atom_colour(mixcolor, FIXED_COLOUR_PRIORITY) // give the smoke color, if it has any to begin with
S.amount = amount
if(S.amount)
S.spread_smoke() //calling process right now so the smoke immediately attacks mobs.
/////////////////////////////////////////////
// Transparent smoke
/////////////////////////////////////////////
//Same as the base type, but the smoke produced is not opaque
/datum/effect_system/smoke_spread/transparent
effect_type = /obj/effect/particle_effect/smoke/transparent
/obj/effect/particle_effect/smoke/transparent
opaque = FALSE
/////////////////////////////////////////////
//// SMOKE SYSTEMS
/////////////////////////////////////////////
/obj/effect/particle_effect/smoke
name = "smoke"
icon = 'icons/effects/96x96.dmi'
icon_state = "smoke"
pixel_x = -32
pixel_y = -32
opacity = 0
layer = FLY_LAYER
anchored = TRUE
mouse_opacity = MOUSE_OPACITY_TRANSPARENT
animate_movement = 0
var/amount = 4
var/lifetime = 5
var/opaque = 1 //whether the smoke can block the view when in enough amount
/obj/effect/particle_effect/smoke/proc/fade_out(frames = 16)
if(alpha == 0) //Handle already transparent case
return
if(frames == 0)
frames = 1 //We will just assume that by 0 frames, the coder meant "during one frame".
var/step = alpha / frames
for(var/i = 0, i < frames, i++)
alpha -= step
if(alpha < 160)
set_opacity(0) //if we were blocking view, we aren't now because we're fading out
stoplag()
/obj/effect/particle_effect/smoke/Initialize()
. = ..()
create_reagents(500)
START_PROCESSING(SSobj, src)
/obj/effect/particle_effect/smoke/Destroy()
STOP_PROCESSING(SSobj, src)
return ..()
/obj/effect/particle_effect/smoke/proc/kill_smoke()
STOP_PROCESSING(SSobj, src)
INVOKE_ASYNC(src, .proc/fade_out)
QDEL_IN(src, 10)
/obj/effect/particle_effect/smoke/process()
lifetime--
if(lifetime < 1)
kill_smoke()
return 0
for(var/mob/living/L in range(0,src))
smoke_mob(L)
return 1
/obj/effect/particle_effect/smoke/proc/smoke_mob(mob/living/carbon/C)
if(!istype(C))
return 0
if(lifetime<1)
return 0
if(C.internal != null || C.has_smoke_protection())
return 0
if(C.smoke_delay)
return 0
C.smoke_delay++
addtimer(CALLBACK(src, .proc/remove_smoke_delay, C), 10)
return 1
/obj/effect/particle_effect/smoke/proc/remove_smoke_delay(mob/living/carbon/C)
if(C)
C.smoke_delay = 0
/obj/effect/particle_effect/smoke/proc/spread_smoke()
var/turf/t_loc = get_turf(src)
if(!t_loc)
return
var/list/newsmokes = list()
for(var/turf/T in t_loc.GetAtmosAdjacentTurfs())
var/obj/effect/particle_effect/smoke/foundsmoke = locate() in T //Don't spread smoke where there's already smoke!
if(foundsmoke)
continue
for(var/mob/living/L in T)
smoke_mob(L)
var/obj/effect/particle_effect/smoke/S = new type(T)
reagents.copy_to(S, reagents.total_volume)
S.setDir(pick(GLOB.cardinals))
S.amount = amount-1
S.add_atom_colour(color, FIXED_COLOUR_PRIORITY)
S.lifetime = lifetime
if(S.amount>0)
if(opaque)
S.set_opacity(TRUE)
newsmokes.Add(S)
if(newsmokes.len)
spawn(1) //the smoke spreads rapidly but not instantly
for(var/obj/effect/particle_effect/smoke/SM in newsmokes)
SM.spread_smoke()
/datum/effect_system/smoke_spread
var/amount = 10
effect_type = /obj/effect/particle_effect/smoke
/datum/effect_system/smoke_spread/set_up(radius = 5, loca)
if(isturf(loca))
location = loca
else
location = get_turf(loca)
amount = radius
/datum/effect_system/smoke_spread/start()
if(holder)
location = get_turf(holder)
var/obj/effect/particle_effect/smoke/S = new effect_type(location)
S.amount = amount
if(S.amount)
S.spread_smoke()
/////////////////////////////////////////////
// Bad smoke
/////////////////////////////////////////////
/obj/effect/particle_effect/smoke/bad
lifetime = 8
/obj/effect/particle_effect/smoke/bad/smoke_mob(mob/living/carbon/M)
if(..())
M.drop_all_held_items()
M.adjustOxyLoss(1)
M.emote("cough")
return 1
/obj/effect/particle_effect/smoke/bad/CanPass(atom/movable/mover, turf/target)
if(istype(mover, /obj/item/projectile/beam))
var/obj/item/projectile/beam/B = mover
B.damage = (B.damage/2)
return 1
/datum/effect_system/smoke_spread/bad
effect_type = /obj/effect/particle_effect/smoke/bad
/////////////////////////////////////////////
// Nanofrost smoke
/////////////////////////////////////////////
/obj/effect/particle_effect/smoke/freezing
name = "nanofrost smoke"
color = "#B2FFFF"
opaque = 0
/datum/effect_system/smoke_spread/freezing
effect_type = /obj/effect/particle_effect/smoke/freezing
var/blast = 0
var/temperature = 2
var/weldvents = TRUE
var/distcheck = TRUE
/datum/effect_system/smoke_spread/freezing/proc/Chilled(atom/A)
if(isopenturf(A))
var/turf/open/T = A
if(T.air)
var/datum/gas_mixture/G = T.air
if(!distcheck || get_dist(T, location) < blast) // Otherwise we'll get silliness like people using Nanofrost to kill people through walls with cold air
G.temperature = temperature
T.air_update_turf()
for(var/obj/effect/hotspot/H in T)
qdel(H)
var/list/G_gases = G.gases
if(G_gases[/datum/gas/plasma])
G_gases[/datum/gas/nitrogen] += (G_gases[/datum/gas/plasma])
G_gases[/datum/gas/plasma] = 0
GAS_GARBAGE_COLLECT(G.gases)
if (weldvents)
for(var/obj/machinery/atmospherics/components/unary/U in T)
if(!isnull(U.welded) && !U.welded) //must be an unwelded vent pump or vent scrubber.
U.welded = TRUE
U.update_icon()
U.visible_message("<span class='danger'>[U] was frozen shut!</span>")
for(var/mob/living/L in T)
L.ExtinguishMob()
for(var/obj/item/Item in T)
Item.extinguish()
/datum/effect_system/smoke_spread/freezing/set_up(radius = 5, loca, blast_radius = 0)
..()
blast = blast_radius
/datum/effect_system/smoke_spread/freezing/start()
if(blast)
for(var/turf/T in RANGE_TURFS(blast, location))
Chilled(T)
..()
/datum/effect_system/smoke_spread/freezing/decon
temperature = 293.15
distcheck = FALSE
weldvents = FALSE
/////////////////////////////////////////////
// Sleep smoke
/////////////////////////////////////////////
/obj/effect/particle_effect/smoke/sleeping
color = "#9C3636"
lifetime = 10
/obj/effect/particle_effect/smoke/sleeping/smoke_mob(mob/living/carbon/M)
if(..())
M.Sleeping(200)
M.emote("cough")
return 1
/datum/effect_system/smoke_spread/sleeping
effect_type = /obj/effect/particle_effect/smoke/sleeping
/////////////////////////////////////////////
// Chem smoke
/////////////////////////////////////////////
/obj/effect/particle_effect/smoke/chem
lifetime = 10
/obj/effect/particle_effect/smoke/chem/process()
if(..())
var/turf/T = get_turf(src)
var/fraction = 1/initial(lifetime)
for(var/atom/movable/AM in T)
if(AM.type == src.type)
continue
if(T.intact && AM.level == 1) //hidden under the floor
continue
reagents.reaction(AM, TOUCH, fraction)
reagents.reaction(T, TOUCH, fraction)
return 1
/obj/effect/particle_effect/smoke/chem/smoke_mob(mob/living/carbon/M)
if(lifetime<1)
return 0
if(!istype(M))
return 0
var/mob/living/carbon/C = M
if(C.internal != null || C.has_smoke_protection())
return 0
var/fraction = 1/initial(lifetime)
reagents.copy_to(C, fraction*reagents.total_volume)
reagents.reaction(M, INGEST, fraction)
return 1
/datum/effect_system/smoke_spread/chem
var/obj/chemholder
effect_type = /obj/effect/particle_effect/smoke/chem
/datum/effect_system/smoke_spread/chem/New()
..()
chemholder = new /obj()
var/datum/reagents/R = new/datum/reagents(500)
chemholder.reagents = R
R.my_atom = chemholder
/datum/effect_system/smoke_spread/chem/Destroy()
qdel(chemholder)
chemholder = null
return ..()
/datum/effect_system/smoke_spread/chem/set_up(datum/reagents/carry = null, radius = 1, loca, silent = FALSE)
if(isturf(loca))
location = loca
else
location = get_turf(loca)
amount = radius
carry.copy_to(chemholder, carry.total_volume)
if(!silent)
var/contained = ""
for(var/reagent in carry.reagent_list)
contained += " [reagent] "
if(contained)
contained = "\[[contained]\]"
var/where = "[AREACOORD(location)]"
if(carry.my_atom && carry.my_atom.fingerprintslast)
var/mob/M = get_mob_by_key(carry.my_atom.fingerprintslast)
var/more = ""
if(M)
more = "[ADMIN_LOOKUPFLW(M)] "
message_admins("Smoke: ([ADMIN_VERBOSEJMP(location)])[contained]. Key: [more ? more : carry.my_atom.fingerprintslast].")
log_game("A chemical smoke reaction has taken place in ([where])[contained]. Last touched by [carry.my_atom.fingerprintslast].")
else
message_admins("Smoke: ([ADMIN_VERBOSEJMP(location)])[contained]. No associated key.")
log_game("A chemical smoke reaction has taken place in ([where])[contained]. No associated key.")
/datum/effect_system/smoke_spread/chem/start()
var/mixcolor = mix_color_from_reagents(chemholder.reagents.reagent_list)
if(holder)
location = get_turf(holder)
var/obj/effect/particle_effect/smoke/chem/S = new effect_type(location)
if(chemholder.reagents.total_volume > 1) // can't split 1 very well
chemholder.reagents.copy_to(S, chemholder.reagents.total_volume)
if(mixcolor)
S.add_atom_colour(mixcolor, FIXED_COLOUR_PRIORITY) // give the smoke color, if it has any to begin with
S.amount = amount
if(S.amount)
S.spread_smoke() //calling process right now so the smoke immediately attacks mobs.
/////////////////////////////////////////////
// Transparent smoke
/////////////////////////////////////////////
//Same as the base type, but the smoke produced is not opaque
/datum/effect_system/smoke_spread/transparent
effect_type = /obj/effect/particle_effect/smoke/transparent
/obj/effect/particle_effect/smoke/transparent
opaque = FALSE
+37 -37
View File
@@ -1,37 +1,37 @@
/obj/effect/forcefield
desc = "A space wizard's magic wall."
name = "FORCEWALL"
icon_state = "m_shield"
anchored = TRUE
opacity = 0
density = TRUE
CanAtmosPass = ATMOS_PASS_DENSITY
var/timeleft = 300 //Set to 0 for permanent forcefields (ugh)
/obj/effect/forcefield/Initialize()
. = ..()
if(timeleft)
QDEL_IN(src, timeleft)
/obj/effect/forcefield/singularity_pull()
return
/obj/effect/forcefield/cult
desc = "An unholy shield that blocks all attacks."
name = "glowing wall"
icon = 'icons/effects/cult_effects.dmi'
icon_state = "cultshield"
CanAtmosPass = ATMOS_PASS_NO
timeleft = 200
///////////Mimewalls///////////
/obj/effect/forcefield/mime
icon_state = "nothing"
name = "invisible wall"
desc = "You have a bad feeling about this."
/obj/effect/forcefield/mime/advanced
name = "invisible blockade"
desc = "You're gonna be here awhile."
timeleft = 600
/obj/effect/forcefield
desc = "A space wizard's magic wall."
name = "FORCEWALL"
icon_state = "m_shield"
anchored = TRUE
opacity = 0
density = TRUE
CanAtmosPass = ATMOS_PASS_DENSITY
var/timeleft = 300 //Set to 0 for permanent forcefields (ugh)
/obj/effect/forcefield/Initialize()
. = ..()
if(timeleft)
QDEL_IN(src, timeleft)
/obj/effect/forcefield/singularity_pull()
return
/obj/effect/forcefield/cult
desc = "An unholy shield that blocks all attacks."
name = "glowing wall"
icon = 'icons/effects/cult_effects.dmi'
icon_state = "cultshield"
CanAtmosPass = ATMOS_PASS_NO
timeleft = 200
///////////Mimewalls///////////
/obj/effect/forcefield/mime
icon_state = "nothing"
name = "invisible wall"
desc = "You have a bad feeling about this."
/obj/effect/forcefield/mime/advanced
name = "invisible blockade"
desc = "You're gonna be here awhile."
timeleft = 600
+483 -483
View File
@@ -1,483 +1,483 @@
/obj/effect/landmark
name = "landmark"
icon = 'icons/effects/landmarks_static.dmi'
icon_state = "x2"
anchored = TRUE
layer = MID_LANDMARK_LAYER
invisibility = INVISIBILITY_ABSTRACT
resistance_flags = INDESTRUCTIBLE | LAVA_PROOF | FIRE_PROOF | UNACIDABLE | ACID_PROOF
/obj/effect/landmark/singularity_act()
return
// Please stop bombing the Observer-Start landmark.
/obj/effect/landmark/ex_act()
return
/obj/effect/landmark/singularity_pull()
return
INITIALIZE_IMMEDIATE(/obj/effect/landmark)
/obj/effect/landmark/Initialize()
. = ..()
GLOB.landmarks_list += src
/obj/effect/landmark/Destroy()
GLOB.landmarks_list -= src
return ..()
/obj/effect/landmark/start
name = "start"
icon = 'icons/mob/landmarks.dmi'
icon_state = "x"
anchored = TRUE
layer = MOB_LAYER
var/jobspawn_override = FALSE
var/delete_after_roundstart = TRUE
var/used = FALSE
/obj/effect/landmark/start/proc/after_round_start()
if(delete_after_roundstart)
qdel(src)
/obj/effect/landmark/start/New()
GLOB.start_landmarks_list += src
if(jobspawn_override)
if(!GLOB.jobspawn_overrides[name])
GLOB.jobspawn_overrides[name] = list()
GLOB.jobspawn_overrides[name] += src
..()
if(name != "start")
tag = "start*[name]"
/obj/effect/landmark/start/Destroy()
GLOB.start_landmarks_list -= src
if(jobspawn_override)
GLOB.jobspawn_overrides[name] -= src
return ..()
// START LANDMARKS FOLLOW. Don't change the names unless
// you are refactoring shitty landmark code.
/obj/effect/landmark/start/assistant
name = "Assistant"
icon_state = "Assistant"
/obj/effect/landmark/start/assistant/override
jobspawn_override = TRUE
delete_after_roundstart = FALSE
/obj/effect/landmark/start/janitor
name = "Janitor"
icon_state = "Janitor"
/obj/effect/landmark/start/cargo_technician
name = "Cargo Technician"
icon_state = "Cargo Technician"
/obj/effect/landmark/start/bartender
name = "Bartender"
icon_state = "Bartender"
/obj/effect/landmark/start/clown
name = "Clown"
icon_state = "Clown"
/obj/effect/landmark/start/mime
name = "Mime"
icon_state = "Mime"
/obj/effect/landmark/start/quartermaster
name = "Quartermaster"
icon_state = "Quartermaster"
/obj/effect/landmark/start/atmospheric_technician
name = "Atmospheric Technician"
icon_state = "Atmospheric Technician"
/obj/effect/landmark/start/cook
name = "Cook"
icon_state = "Cook"
/obj/effect/landmark/start/shaft_miner
name = "Shaft Miner"
icon_state = "Shaft Miner"
/obj/effect/landmark/start/security_officer
name = "Security Officer"
icon_state = "Security Officer"
/obj/effect/landmark/start/botanist
name = "Botanist"
icon_state = "Botanist"
/obj/effect/landmark/start/head_of_security
name = "Head of Security"
icon_state = "Head of Security"
/obj/effect/landmark/start/captain
name = "Captain"
icon_state = "Captain"
/obj/effect/landmark/start/detective
name = "Detective"
icon_state = "Detective"
/obj/effect/landmark/start/warden
name = "Warden"
icon_state = "Warden"
/obj/effect/landmark/start/chief_engineer
name = "Chief Engineer"
icon_state = "Chief Engineer"
/obj/effect/landmark/start/head_of_personnel
name = "Head of Personnel"
icon_state = "Head of Personnel"
/obj/effect/landmark/start/librarian
name = "Curator"
icon_state = "Curator"
/obj/effect/landmark/start/lawyer
name = "Lawyer"
icon_state = "Lawyer"
/obj/effect/landmark/start/station_engineer
name = "Station Engineer"
icon_state = "Station Engineer"
/obj/effect/landmark/start/medical_doctor
name = "Medical Doctor"
icon_state = "Medical Doctor"
/obj/effect/landmark/start/scientist
name = "Scientist"
icon_state = "Scientist"
/obj/effect/landmark/start/chemist
name = "Chemist"
icon_state = "Chemist"
/obj/effect/landmark/start/roboticist
name = "Roboticist"
icon_state = "Roboticist"
/obj/effect/landmark/start/research_director
name = "Research Director"
icon_state = "Research Director"
/obj/effect/landmark/start/geneticist
name = "Geneticist"
icon_state = "Geneticist"
/obj/effect/landmark/start/chief_medical_officer
name = "Chief Medical Officer"
icon_state = "Chief Medical Officer"
/obj/effect/landmark/start/virologist
name = "Virologist"
icon_state = "Virologist"
/obj/effect/landmark/start/chaplain
name = "Chaplain"
icon_state = "Chaplain"
/obj/effect/landmark/start/cyborg
name = "Cyborg"
icon_state = "Cyborg"
/obj/effect/landmark/start/ai
name = "AI"
icon_state = "AI"
delete_after_roundstart = FALSE
var/primary_ai = TRUE
var/latejoin_active = TRUE
/obj/effect/landmark/start/ai/after_round_start()
if(latejoin_active && !used)
new /obj/structure/AIcore/latejoin_inactive(loc)
return ..()
/obj/effect/landmark/start/ai/secondary
icon = 'icons/effects/landmarks_static.dmi'
icon_state = "ai_spawn"
primary_ai = FALSE
latejoin_active = FALSE
//Department Security spawns
/obj/effect/landmark/start/depsec
name = "department_sec"
icon_state = "Security Officer"
/obj/effect/landmark/start/depsec/New()
..()
GLOB.department_security_spawns += src
/obj/effect/landmark/start/depsec/Destroy()
GLOB.department_security_spawns -= src
return ..()
/obj/effect/landmark/start/depsec/supply
name = "supply_sec"
/obj/effect/landmark/start/depsec/medical
name = "medical_sec"
/obj/effect/landmark/start/depsec/engineering
name = "engineering_sec"
/obj/effect/landmark/start/depsec/science
name = "science_sec"
/obj/effect/landmark/start/wizard
name = "wizard"
icon = 'icons/effects/landmarks_static.dmi'
icon_state = "wiznerd_spawn"
/obj/effect/landmark/start/wizard/Initialize()
..()
GLOB.wizardstart += loc
return INITIALIZE_HINT_QDEL
/obj/effect/landmark/start/nukeop
name = "nukeop"
icon = 'icons/effects/landmarks_static.dmi'
icon_state = "snukeop_spawn"
/obj/effect/landmark/start/nukeop/Initialize()
..()
GLOB.nukeop_start += loc
return INITIALIZE_HINT_QDEL
/obj/effect/landmark/start/nukeop_leader
name = "nukeop leader"
icon = 'icons/effects/landmarks_static.dmi'
icon_state = "snukeop_leader_spawn"
/obj/effect/landmark/start/nukeop_leader/Initialize()
..()
GLOB.nukeop_leader_start += loc
return INITIALIZE_HINT_QDEL
// Must be immediate because players will
// join before SSatom initializes everything.
INITIALIZE_IMMEDIATE(/obj/effect/landmark/start/new_player)
/obj/effect/landmark/start/new_player
name = "New Player"
/obj/effect/landmark/start/new_player/Initialize()
..()
GLOB.newplayer_start += loc
return INITIALIZE_HINT_QDEL
/obj/effect/landmark/latejoin
name = "JoinLate"
/obj/effect/landmark/latejoin/Initialize(mapload)
..()
SSjob.latejoin_trackers += loc
return INITIALIZE_HINT_QDEL
// carp.
/obj/effect/landmark/carpspawn
name = "carpspawn"
icon_state = "carp_spawn"
// observer-start.
/obj/effect/landmark/observer_start
name = "Observer-Start"
icon_state = "observer_start"
// xenos.
/obj/effect/landmark/xeno_spawn
name = "xeno_spawn"
icon_state = "xeno_spawn"
/obj/effect/landmark/xeno_spawn/Initialize(mapload)
..()
GLOB.xeno_spawn += loc
return INITIALIZE_HINT_QDEL
// blobs.
/obj/effect/landmark/blobstart
name = "blobstart"
icon_state = "blob_start"
/obj/effect/landmark/blobstart/Initialize(mapload)
..()
GLOB.blobstart += loc
return INITIALIZE_HINT_QDEL
/obj/effect/landmark/secequipment
name = "secequipment"
icon_state = "secequipment"
/obj/effect/landmark/secequipment/Initialize(mapload)
..()
GLOB.secequipment += loc
return INITIALIZE_HINT_QDEL
/obj/effect/landmark/prisonwarp
name = "prisonwarp"
icon_state = "prisonwarp"
/obj/effect/landmark/prisonwarp/Initialize(mapload)
..()
GLOB.prisonwarp += loc
return INITIALIZE_HINT_QDEL
/obj/effect/landmark/ert_spawn
name = "Emergencyresponseteam"
icon_state = "ert_spawn"
/obj/effect/landmark/ert_spawn/Initialize(mapload)
..()
GLOB.emergencyresponseteamspawn += loc
return INITIALIZE_HINT_QDEL
/obj/effect/landmark/holding_facility
name = "Holding Facility"
icon_state = "holding_facility"
/obj/effect/landmark/holding_facility/Initialize(mapload)
..()
GLOB.holdingfacility += loc
return INITIALIZE_HINT_QDEL
/obj/effect/landmark/thunderdome/observe
name = "tdomeobserve"
icon_state = "tdome_observer"
/obj/effect/landmark/thunderdome/observe/Initialize(mapload)
..()
GLOB.tdomeobserve += loc
return INITIALIZE_HINT_QDEL
/obj/effect/landmark/thunderdome/one
name = "tdome1"
icon_state = "tdome_t1"
/obj/effect/landmark/thunderdome/one/Initialize(mapload)
..()
GLOB.tdome1 += loc
return INITIALIZE_HINT_QDEL
/obj/effect/landmark/thunderdome/two
name = "tdome2"
icon_state = "tdome_t2"
/obj/effect/landmark/thunderdome/two/Initialize(mapload)
..()
GLOB.tdome2 += loc
return INITIALIZE_HINT_QDEL
/obj/effect/landmark/thunderdome/admin
name = "tdomeadmin"
icon_state = "tdome_admin"
/obj/effect/landmark/thunderdome/admin/Initialize(mapload)
..()
GLOB.tdomeadmin += loc
return INITIALIZE_HINT_QDEL
//Servant spawn locations
/obj/effect/landmark/servant_of_ratvar
name = "servant of ratvar spawn"
icon_state = "clockwork_orange"
layer = MOB_LAYER
/obj/effect/landmark/servant_of_ratvar/Initialize(mapload)
..()
GLOB.servant_spawns += loc
return INITIALIZE_HINT_QDEL
//City of Cogs entrances
/obj/effect/landmark/city_of_cogs
name = "city of cogs entrance"
icon_state = "city_of_cogs"
/obj/effect/landmark/city_of_cogs/Initialize(mapload)
..()
GLOB.city_of_cogs_spawns += loc
return INITIALIZE_HINT_QDEL
//generic event spawns
/obj/effect/landmark/event_spawn
name = "generic event spawn"
icon_state = "generic_event"
layer = HIGH_LANDMARK_LAYER
/obj/effect/landmark/event_spawn/New()
..()
GLOB.generic_event_spawns += src
/obj/effect/landmark/event_spawn/Destroy()
GLOB.generic_event_spawns -= src
return ..()
/obj/effect/landmark/ruin
var/datum/map_template/ruin/ruin_template
/obj/effect/landmark/ruin/New(loc, my_ruin_template)
name = "ruin_[GLOB.ruin_landmarks.len + 1]"
..(loc)
ruin_template = my_ruin_template
GLOB.ruin_landmarks |= src
/obj/effect/landmark/ruin/Destroy()
GLOB.ruin_landmarks -= src
ruin_template = null
. = ..()
//------Station Rooms Landmarks------------//
/obj/effect/landmark/stationroom
var/list/templates = list()
layer = BULLET_HOLE_LAYER
/obj/effect/landmark/stationroom/New()
..()
GLOB.stationroom_landmarks += src
/obj/effect/landmark/stationroom/Destroy()
if(src in GLOB.stationroom_landmarks)
GLOB.stationroom_landmarks -= src
return ..()
/obj/effect/landmark/stationroom/proc/load(template_name)
var/turf/T = get_turf(src)
if(!T)
return FALSE
if(!template_name)
for(var/t in templates)
if(!SSmapping.station_room_templates[t])
log_world("Station room spawner placed at ([T.x], [T.y], [T.z]) has invalid ruin name of \"[t]\" in its list")
templates -= t
template_name = pickweight(templates)
if(!template_name)
GLOB.stationroom_landmarks -= src
qdel(src)
return FALSE
var/datum/map_template/template = SSmapping.station_room_templates[template_name]
if(!template)
return FALSE
testing("Room \"[template_name]\" placed at ([T.x], [T.y], [T.z])")
template.load(T, centered = FALSE)
template.loaded++
GLOB.stationroom_landmarks -= src
qdel(src)
return TRUE
// The landmark for the Engine on Box
/obj/effect/landmark/stationroom/box/engine
templates = list("Engine SM" = 3, "Engine Singulo" = 3, "Engine Tesla" = 3)
icon = 'icons/rooms/box/engine.dmi'
/obj/effect/landmark/stationroom/box/engine/New()
. = ..()
templates = CONFIG_GET(keyed_list/box_random_engine)
/obj/effect/landmark
name = "landmark"
icon = 'icons/effects/landmarks_static.dmi'
icon_state = "x2"
anchored = TRUE
layer = MID_LANDMARK_LAYER
invisibility = INVISIBILITY_ABSTRACT
resistance_flags = INDESTRUCTIBLE | LAVA_PROOF | FIRE_PROOF | UNACIDABLE | ACID_PROOF
/obj/effect/landmark/singularity_act()
return
// Please stop bombing the Observer-Start landmark.
/obj/effect/landmark/ex_act()
return
/obj/effect/landmark/singularity_pull()
return
INITIALIZE_IMMEDIATE(/obj/effect/landmark)
/obj/effect/landmark/Initialize()
. = ..()
GLOB.landmarks_list += src
/obj/effect/landmark/Destroy()
GLOB.landmarks_list -= src
return ..()
/obj/effect/landmark/start
name = "start"
icon = 'icons/mob/landmarks.dmi'
icon_state = "x"
anchored = TRUE
layer = MOB_LAYER
var/jobspawn_override = FALSE
var/delete_after_roundstart = TRUE
var/used = FALSE
/obj/effect/landmark/start/proc/after_round_start()
if(delete_after_roundstart)
qdel(src)
/obj/effect/landmark/start/New()
GLOB.start_landmarks_list += src
if(jobspawn_override)
if(!GLOB.jobspawn_overrides[name])
GLOB.jobspawn_overrides[name] = list()
GLOB.jobspawn_overrides[name] += src
..()
if(name != "start")
tag = "start*[name]"
/obj/effect/landmark/start/Destroy()
GLOB.start_landmarks_list -= src
if(jobspawn_override)
GLOB.jobspawn_overrides[name] -= src
return ..()
// START LANDMARKS FOLLOW. Don't change the names unless
// you are refactoring shitty landmark code.
/obj/effect/landmark/start/assistant
name = "Assistant"
icon_state = "Assistant"
/obj/effect/landmark/start/assistant/override
jobspawn_override = TRUE
delete_after_roundstart = FALSE
/obj/effect/landmark/start/janitor
name = "Janitor"
icon_state = "Janitor"
/obj/effect/landmark/start/cargo_technician
name = "Cargo Technician"
icon_state = "Cargo Technician"
/obj/effect/landmark/start/bartender
name = "Bartender"
icon_state = "Bartender"
/obj/effect/landmark/start/clown
name = "Clown"
icon_state = "Clown"
/obj/effect/landmark/start/mime
name = "Mime"
icon_state = "Mime"
/obj/effect/landmark/start/quartermaster
name = "Quartermaster"
icon_state = "Quartermaster"
/obj/effect/landmark/start/atmospheric_technician
name = "Atmospheric Technician"
icon_state = "Atmospheric Technician"
/obj/effect/landmark/start/cook
name = "Cook"
icon_state = "Cook"
/obj/effect/landmark/start/shaft_miner
name = "Shaft Miner"
icon_state = "Shaft Miner"
/obj/effect/landmark/start/security_officer
name = "Security Officer"
icon_state = "Security Officer"
/obj/effect/landmark/start/botanist
name = "Botanist"
icon_state = "Botanist"
/obj/effect/landmark/start/head_of_security
name = "Head of Security"
icon_state = "Head of Security"
/obj/effect/landmark/start/captain
name = "Captain"
icon_state = "Captain"
/obj/effect/landmark/start/detective
name = "Detective"
icon_state = "Detective"
/obj/effect/landmark/start/warden
name = "Warden"
icon_state = "Warden"
/obj/effect/landmark/start/chief_engineer
name = "Chief Engineer"
icon_state = "Chief Engineer"
/obj/effect/landmark/start/head_of_personnel
name = "Head of Personnel"
icon_state = "Head of Personnel"
/obj/effect/landmark/start/librarian
name = "Curator"
icon_state = "Curator"
/obj/effect/landmark/start/lawyer
name = "Lawyer"
icon_state = "Lawyer"
/obj/effect/landmark/start/station_engineer
name = "Station Engineer"
icon_state = "Station Engineer"
/obj/effect/landmark/start/medical_doctor
name = "Medical Doctor"
icon_state = "Medical Doctor"
/obj/effect/landmark/start/scientist
name = "Scientist"
icon_state = "Scientist"
/obj/effect/landmark/start/chemist
name = "Chemist"
icon_state = "Chemist"
/obj/effect/landmark/start/roboticist
name = "Roboticist"
icon_state = "Roboticist"
/obj/effect/landmark/start/research_director
name = "Research Director"
icon_state = "Research Director"
/obj/effect/landmark/start/geneticist
name = "Geneticist"
icon_state = "Geneticist"
/obj/effect/landmark/start/chief_medical_officer
name = "Chief Medical Officer"
icon_state = "Chief Medical Officer"
/obj/effect/landmark/start/virologist
name = "Virologist"
icon_state = "Virologist"
/obj/effect/landmark/start/chaplain
name = "Chaplain"
icon_state = "Chaplain"
/obj/effect/landmark/start/cyborg
name = "Cyborg"
icon_state = "Cyborg"
/obj/effect/landmark/start/ai
name = "AI"
icon_state = "AI"
delete_after_roundstart = FALSE
var/primary_ai = TRUE
var/latejoin_active = TRUE
/obj/effect/landmark/start/ai/after_round_start()
if(latejoin_active && !used)
new /obj/structure/AIcore/latejoin_inactive(loc)
return ..()
/obj/effect/landmark/start/ai/secondary
icon = 'icons/effects/landmarks_static.dmi'
icon_state = "ai_spawn"
primary_ai = FALSE
latejoin_active = FALSE
//Department Security spawns
/obj/effect/landmark/start/depsec
name = "department_sec"
icon_state = "Security Officer"
/obj/effect/landmark/start/depsec/New()
..()
GLOB.department_security_spawns += src
/obj/effect/landmark/start/depsec/Destroy()
GLOB.department_security_spawns -= src
return ..()
/obj/effect/landmark/start/depsec/supply
name = "supply_sec"
/obj/effect/landmark/start/depsec/medical
name = "medical_sec"
/obj/effect/landmark/start/depsec/engineering
name = "engineering_sec"
/obj/effect/landmark/start/depsec/science
name = "science_sec"
/obj/effect/landmark/start/wizard
name = "wizard"
icon = 'icons/effects/landmarks_static.dmi'
icon_state = "wiznerd_spawn"
/obj/effect/landmark/start/wizard/Initialize()
..()
GLOB.wizardstart += loc
return INITIALIZE_HINT_QDEL
/obj/effect/landmark/start/nukeop
name = "nukeop"
icon = 'icons/effects/landmarks_static.dmi'
icon_state = "snukeop_spawn"
/obj/effect/landmark/start/nukeop/Initialize()
..()
GLOB.nukeop_start += loc
return INITIALIZE_HINT_QDEL
/obj/effect/landmark/start/nukeop_leader
name = "nukeop leader"
icon = 'icons/effects/landmarks_static.dmi'
icon_state = "snukeop_leader_spawn"
/obj/effect/landmark/start/nukeop_leader/Initialize()
..()
GLOB.nukeop_leader_start += loc
return INITIALIZE_HINT_QDEL
// Must be immediate because players will
// join before SSatom initializes everything.
INITIALIZE_IMMEDIATE(/obj/effect/landmark/start/new_player)
/obj/effect/landmark/start/new_player
name = "New Player"
/obj/effect/landmark/start/new_player/Initialize()
..()
GLOB.newplayer_start += loc
return INITIALIZE_HINT_QDEL
/obj/effect/landmark/latejoin
name = "JoinLate"
/obj/effect/landmark/latejoin/Initialize(mapload)
..()
SSjob.latejoin_trackers += loc
return INITIALIZE_HINT_QDEL
// carp.
/obj/effect/landmark/carpspawn
name = "carpspawn"
icon_state = "carp_spawn"
// observer-start.
/obj/effect/landmark/observer_start
name = "Observer-Start"
icon_state = "observer_start"
// xenos.
/obj/effect/landmark/xeno_spawn
name = "xeno_spawn"
icon_state = "xeno_spawn"
/obj/effect/landmark/xeno_spawn/Initialize(mapload)
..()
GLOB.xeno_spawn += loc
return INITIALIZE_HINT_QDEL
// blobs.
/obj/effect/landmark/blobstart
name = "blobstart"
icon_state = "blob_start"
/obj/effect/landmark/blobstart/Initialize(mapload)
..()
GLOB.blobstart += loc
return INITIALIZE_HINT_QDEL
/obj/effect/landmark/secequipment
name = "secequipment"
icon_state = "secequipment"
/obj/effect/landmark/secequipment/Initialize(mapload)
..()
GLOB.secequipment += loc
return INITIALIZE_HINT_QDEL
/obj/effect/landmark/prisonwarp
name = "prisonwarp"
icon_state = "prisonwarp"
/obj/effect/landmark/prisonwarp/Initialize(mapload)
..()
GLOB.prisonwarp += loc
return INITIALIZE_HINT_QDEL
/obj/effect/landmark/ert_spawn
name = "Emergencyresponseteam"
icon_state = "ert_spawn"
/obj/effect/landmark/ert_spawn/Initialize(mapload)
..()
GLOB.emergencyresponseteamspawn += loc
return INITIALIZE_HINT_QDEL
/obj/effect/landmark/holding_facility
name = "Holding Facility"
icon_state = "holding_facility"
/obj/effect/landmark/holding_facility/Initialize(mapload)
..()
GLOB.holdingfacility += loc
return INITIALIZE_HINT_QDEL
/obj/effect/landmark/thunderdome/observe
name = "tdomeobserve"
icon_state = "tdome_observer"
/obj/effect/landmark/thunderdome/observe/Initialize(mapload)
..()
GLOB.tdomeobserve += loc
return INITIALIZE_HINT_QDEL
/obj/effect/landmark/thunderdome/one
name = "tdome1"
icon_state = "tdome_t1"
/obj/effect/landmark/thunderdome/one/Initialize(mapload)
..()
GLOB.tdome1 += loc
return INITIALIZE_HINT_QDEL
/obj/effect/landmark/thunderdome/two
name = "tdome2"
icon_state = "tdome_t2"
/obj/effect/landmark/thunderdome/two/Initialize(mapload)
..()
GLOB.tdome2 += loc
return INITIALIZE_HINT_QDEL
/obj/effect/landmark/thunderdome/admin
name = "tdomeadmin"
icon_state = "tdome_admin"
/obj/effect/landmark/thunderdome/admin/Initialize(mapload)
..()
GLOB.tdomeadmin += loc
return INITIALIZE_HINT_QDEL
//Servant spawn locations
/obj/effect/landmark/servant_of_ratvar
name = "servant of ratvar spawn"
icon_state = "clockwork_orange"
layer = MOB_LAYER
/obj/effect/landmark/servant_of_ratvar/Initialize(mapload)
..()
GLOB.servant_spawns += loc
return INITIALIZE_HINT_QDEL
//City of Cogs entrances
/obj/effect/landmark/city_of_cogs
name = "city of cogs entrance"
icon_state = "city_of_cogs"
/obj/effect/landmark/city_of_cogs/Initialize(mapload)
..()
GLOB.city_of_cogs_spawns += loc
return INITIALIZE_HINT_QDEL
//generic event spawns
/obj/effect/landmark/event_spawn
name = "generic event spawn"
icon_state = "generic_event"
layer = HIGH_LANDMARK_LAYER
/obj/effect/landmark/event_spawn/New()
..()
GLOB.generic_event_spawns += src
/obj/effect/landmark/event_spawn/Destroy()
GLOB.generic_event_spawns -= src
return ..()
/obj/effect/landmark/ruin
var/datum/map_template/ruin/ruin_template
/obj/effect/landmark/ruin/New(loc, my_ruin_template)
name = "ruin_[GLOB.ruin_landmarks.len + 1]"
..(loc)
ruin_template = my_ruin_template
GLOB.ruin_landmarks |= src
/obj/effect/landmark/ruin/Destroy()
GLOB.ruin_landmarks -= src
ruin_template = null
. = ..()
//------Station Rooms Landmarks------------//
/obj/effect/landmark/stationroom
var/list/templates = list()
layer = BULLET_HOLE_LAYER
/obj/effect/landmark/stationroom/New()
..()
GLOB.stationroom_landmarks += src
/obj/effect/landmark/stationroom/Destroy()
if(src in GLOB.stationroom_landmarks)
GLOB.stationroom_landmarks -= src
return ..()
/obj/effect/landmark/stationroom/proc/load(template_name)
var/turf/T = get_turf(src)
if(!T)
return FALSE
if(!template_name)
for(var/t in templates)
if(!SSmapping.station_room_templates[t])
log_world("Station room spawner placed at ([T.x], [T.y], [T.z]) has invalid ruin name of \"[t]\" in its list")
templates -= t
template_name = pickweight(templates)
if(!template_name)
GLOB.stationroom_landmarks -= src
qdel(src)
return FALSE
var/datum/map_template/template = SSmapping.station_room_templates[template_name]
if(!template)
return FALSE
testing("Room \"[template_name]\" placed at ([T.x], [T.y], [T.z])")
template.load(T, centered = FALSE)
template.loaded++
GLOB.stationroom_landmarks -= src
qdel(src)
return TRUE
// The landmark for the Engine on Box
/obj/effect/landmark/stationroom/box/engine
templates = list("Engine SM" = 3, "Engine Singulo" = 3, "Engine Tesla" = 3)
icon = 'icons/rooms/box/engine.dmi'
/obj/effect/landmark/stationroom/box/engine/New()
. = ..()
templates = CONFIG_GET(keyed_list/box_random_engine)
+176 -176
View File
@@ -1,176 +1,176 @@
/obj/effect/mine
name = "dummy mine"
desc = "Better stay away from that thing."
density = FALSE
anchored = TRUE
icon = 'icons/obj/items_and_weapons.dmi'
icon_state = "uglymine"
var/triggered = 0
/obj/effect/mine/proc/mineEffect(mob/victim)
to_chat(victim, "<span class='danger'>*click*</span>")
/obj/effect/mine/Crossed(AM as mob|obj)
if(isturf(loc))
if(ismob(AM))
var/mob/MM = AM
if(!(MM.movement_type & FLYING))
triggermine(AM)
else
triggermine(AM)
/obj/effect/mine/proc/triggermine(mob/victim)
if(triggered)
return
visible_message("<span class='danger'>[victim] sets off [icon2html(src, viewers(src))] [src]!</span>")
var/datum/effect_system/spark_spread/s = new /datum/effect_system/spark_spread
s.set_up(3, 1, src)
s.start()
mineEffect(victim)
triggered = 1
qdel(src)
/obj/effect/mine/explosive
name = "explosive mine"
var/range_devastation = 0
var/range_heavy = 1
var/range_light = 2
var/range_flash = 3
/obj/effect/mine/explosive/mineEffect(mob/victim)
explosion(loc, range_devastation, range_heavy, range_light, range_flash)
/obj/effect/mine/stun
name = "stun mine"
var/stun_time = 80
/obj/effect/mine/stun/mineEffect(mob/living/victim)
if(isliving(victim))
victim.Knockdown(stun_time)
/obj/effect/mine/kickmine
name = "kick mine"
/obj/effect/mine/kickmine/mineEffect(mob/victim)
if(isliving(victim) && victim.client)
to_chat(victim, "<span class='userdanger'>You have been kicked FOR NO REISIN!</span>")
qdel(victim.client)
/obj/effect/mine/gas
name = "oxygen mine"
var/gas_amount = 360
var/gas_type = "o2"
/obj/effect/mine/gas/mineEffect(mob/victim)
atmos_spawn_air("[gas_type]=[gas_amount]")
/obj/effect/mine/gas/plasma
name = "plasma mine"
gas_type = "plasma"
/obj/effect/mine/gas/n2o
name = "\improper N2O mine"
gas_type = "n2o"
/obj/effect/mine/sound
name = "honkblaster 1000"
var/sound = 'sound/items/bikehorn.ogg'
/obj/effect/mine/sound/mineEffect(mob/victim)
playsound(loc, sound, 100, 1)
/obj/effect/mine/sound/bwoink
name = "bwoink mine"
sound = 'sound/effects/adminhelp.ogg'
/obj/effect/mine/pickup
name = "pickup"
desc = "pick me up"
icon = 'icons/effects/effects.dmi'
icon_state = "electricity2"
density = FALSE
var/duration = 0
/obj/effect/mine/pickup/Initialize()
. = ..()
animate(src, pixel_y = 4, time = 20, loop = -1)
/obj/effect/mine/pickup/triggermine(mob/victim)
if(triggered)
return
triggered = 1
invisibility = INVISIBILITY_ABSTRACT
mineEffect(victim)
qdel(src)
/obj/effect/mine/pickup/bloodbath
name = "Red Orb"
desc = "You feel angry just looking at it."
duration = 1200 //2min
color = "#FF0000"
/obj/effect/mine/pickup/bloodbath/mineEffect(mob/living/carbon/victim)
if(!victim.client || !istype(victim))
return
to_chat(victim, "<span class='reallybig redtext'>RIP AND TEAR</span>")
var/old_color = victim.client.color
var/static/list/red_splash = list(1,0,0,0.8,0.2,0, 0.8,0,0.2,0.1,0,0)
var/static/list/pure_red = list(0,0,0,0,0,0,0,0,0,1,0,0)
spawn(0)
new /datum/hallucination/delusion(victim, TRUE, "demon",duration,0)
var/obj/item/twohanded/required/chainsaw/doomslayer/chainsaw = new(victim.loc)
victim.log_message("entered a blood frenzy", LOG_ATTACK)
ADD_TRAIT(chainsaw, TRAIT_NODROP, CHAINSAW_FRENZY_TRAIT)
victim.drop_all_held_items()
victim.put_in_hands(chainsaw, forced = TRUE)
chainsaw.attack_self(victim)
chainsaw.wield(victim)
victim.reagents.add_reagent(/datum/reagent/medicine/adminordrazine,25)
to_chat(victim, "<span class='warning'>KILL, KILL, KILL! YOU HAVE NO ALLIES ANYMORE, KILL THEM ALL!</span>")
victim.client.color = pure_red
animate(victim.client,color = red_splash, time = 10, easing = SINE_EASING|EASE_OUT)
sleep(10)
animate(victim.client,color = old_color, time = duration)//, easing = SINE_EASING|EASE_OUT)
sleep(duration)
to_chat(victim, "<span class='notice'>Your bloodlust seeps back into the bog of your subconscious and you regain self control.</span>")
qdel(chainsaw)
victim.log_message("exited a blood frenzy", LOG_ATTACK)
qdel(src)
/obj/effect/mine/pickup/healing
name = "Blue Orb"
desc = "You feel better just looking at it."
color = "#0000FF"
/obj/effect/mine/pickup/healing/mineEffect(mob/living/carbon/victim)
if(!victim.client || !istype(victim))
return
to_chat(victim, "<span class='notice'>You feel great!</span>")
victim.revive(full_heal = 1, admin_revive = 1)
/obj/effect/mine/pickup/speed
name = "Yellow Orb"
desc = "You feel faster just looking at it."
color = "#FFFF00"
duration = 300
/obj/effect/mine/pickup/speed/mineEffect(mob/living/carbon/victim)
if(!victim.client || !istype(victim))
return
to_chat(victim, "<span class='notice'>You feel fast!</span>")
victim.add_movespeed_modifier(MOVESPEED_ID_YELLOW_ORB, update=TRUE, priority=100, multiplicative_slowdown=-2, blacklisted_movetypes=(FLYING|FLOATING))
sleep(duration)
victim.remove_movespeed_modifier(MOVESPEED_ID_YELLOW_ORB)
to_chat(victim, "<span class='notice'>You slow down.</span>")
/obj/effect/mine
name = "dummy mine"
desc = "Better stay away from that thing."
density = FALSE
anchored = TRUE
icon = 'icons/obj/items_and_weapons.dmi'
icon_state = "uglymine"
var/triggered = 0
/obj/effect/mine/proc/mineEffect(mob/victim)
to_chat(victim, "<span class='danger'>*click*</span>")
/obj/effect/mine/Crossed(AM as mob|obj)
if(isturf(loc))
if(ismob(AM))
var/mob/MM = AM
if(!(MM.movement_type & FLYING))
triggermine(AM)
else
triggermine(AM)
/obj/effect/mine/proc/triggermine(mob/victim)
if(triggered)
return
visible_message("<span class='danger'>[victim] sets off [icon2html(src, viewers(src))] [src]!</span>")
var/datum/effect_system/spark_spread/s = new /datum/effect_system/spark_spread
s.set_up(3, 1, src)
s.start()
mineEffect(victim)
triggered = 1
qdel(src)
/obj/effect/mine/explosive
name = "explosive mine"
var/range_devastation = 0
var/range_heavy = 1
var/range_light = 2
var/range_flash = 3
/obj/effect/mine/explosive/mineEffect(mob/victim)
explosion(loc, range_devastation, range_heavy, range_light, range_flash)
/obj/effect/mine/stun
name = "stun mine"
var/stun_time = 80
/obj/effect/mine/stun/mineEffect(mob/living/victim)
if(isliving(victim))
victim.Knockdown(stun_time)
/obj/effect/mine/kickmine
name = "kick mine"
/obj/effect/mine/kickmine/mineEffect(mob/victim)
if(isliving(victim) && victim.client)
to_chat(victim, "<span class='userdanger'>You have been kicked FOR NO REISIN!</span>")
qdel(victim.client)
/obj/effect/mine/gas
name = "oxygen mine"
var/gas_amount = 360
var/gas_type = "o2"
/obj/effect/mine/gas/mineEffect(mob/victim)
atmos_spawn_air("[gas_type]=[gas_amount]")
/obj/effect/mine/gas/plasma
name = "plasma mine"
gas_type = "plasma"
/obj/effect/mine/gas/n2o
name = "\improper N2O mine"
gas_type = "n2o"
/obj/effect/mine/sound
name = "honkblaster 1000"
var/sound = 'sound/items/bikehorn.ogg'
/obj/effect/mine/sound/mineEffect(mob/victim)
playsound(loc, sound, 100, 1)
/obj/effect/mine/sound/bwoink
name = "bwoink mine"
sound = 'sound/effects/adminhelp.ogg'
/obj/effect/mine/pickup
name = "pickup"
desc = "pick me up"
icon = 'icons/effects/effects.dmi'
icon_state = "electricity2"
density = FALSE
var/duration = 0
/obj/effect/mine/pickup/Initialize()
. = ..()
animate(src, pixel_y = 4, time = 20, loop = -1)
/obj/effect/mine/pickup/triggermine(mob/victim)
if(triggered)
return
triggered = 1
invisibility = INVISIBILITY_ABSTRACT
mineEffect(victim)
qdel(src)
/obj/effect/mine/pickup/bloodbath
name = "Red Orb"
desc = "You feel angry just looking at it."
duration = 1200 //2min
color = "#FF0000"
/obj/effect/mine/pickup/bloodbath/mineEffect(mob/living/carbon/victim)
if(!victim.client || !istype(victim))
return
to_chat(victim, "<span class='reallybig redtext'>RIP AND TEAR</span>")
var/old_color = victim.client.color
var/static/list/red_splash = list(1,0,0,0.8,0.2,0, 0.8,0,0.2,0.1,0,0)
var/static/list/pure_red = list(0,0,0,0,0,0,0,0,0,1,0,0)
spawn(0)
new /datum/hallucination/delusion(victim, TRUE, "demon",duration,0)
var/obj/item/twohanded/required/chainsaw/doomslayer/chainsaw = new(victim.loc)
victim.log_message("entered a blood frenzy", LOG_ATTACK)
ADD_TRAIT(chainsaw, TRAIT_NODROP, CHAINSAW_FRENZY_TRAIT)
victim.drop_all_held_items()
victim.put_in_hands(chainsaw, forced = TRUE)
chainsaw.attack_self(victim)
chainsaw.wield(victim)
victim.reagents.add_reagent(/datum/reagent/medicine/adminordrazine,25)
to_chat(victim, "<span class='warning'>KILL, KILL, KILL! YOU HAVE NO ALLIES ANYMORE, KILL THEM ALL!</span>")
victim.client.color = pure_red
animate(victim.client,color = red_splash, time = 10, easing = SINE_EASING|EASE_OUT)
sleep(10)
animate(victim.client,color = old_color, time = duration)//, easing = SINE_EASING|EASE_OUT)
sleep(duration)
to_chat(victim, "<span class='notice'>Your bloodlust seeps back into the bog of your subconscious and you regain self control.</span>")
qdel(chainsaw)
victim.log_message("exited a blood frenzy", LOG_ATTACK)
qdel(src)
/obj/effect/mine/pickup/healing
name = "Blue Orb"
desc = "You feel better just looking at it."
color = "#0000FF"
/obj/effect/mine/pickup/healing/mineEffect(mob/living/carbon/victim)
if(!victim.client || !istype(victim))
return
to_chat(victim, "<span class='notice'>You feel great!</span>")
victim.revive(full_heal = 1, admin_revive = 1)
/obj/effect/mine/pickup/speed
name = "Yellow Orb"
desc = "You feel faster just looking at it."
color = "#FFFF00"
duration = 300
/obj/effect/mine/pickup/speed/mineEffect(mob/living/carbon/victim)
if(!victim.client || !istype(victim))
return
to_chat(victim, "<span class='notice'>You feel fast!</span>")
victim.add_movespeed_modifier(MOVESPEED_ID_YELLOW_ORB, update=TRUE, priority=100, multiplicative_slowdown=-2, blacklisted_movetypes=(FLYING|FLOATING))
sleep(duration)
victim.remove_movespeed_modifier(MOVESPEED_ID_YELLOW_ORB)
to_chat(victim, "<span class='notice'>You slow down.</span>")
+93 -93
View File
@@ -1,94 +1,94 @@
//The effect when you wrap a dead body in gift wrap
/obj/effect/spresent
name = "strange present"
desc = "It's a ... present?"
icon = 'icons/obj/items_and_weapons.dmi'
icon_state = "strangepresent"
density = TRUE
anchored = FALSE
/obj/effect/beam
name = "beam"
var/def_zone
pass_flags = PASSTABLE
/obj/effect/beam/singularity_act()
return
/obj/effect/beam/singularity_pull()
return
/obj/effect/spawner
name = "object spawner"
/obj/effect/list_container
name = "list container"
/obj/effect/list_container/mobl
name = "mobl"
var/master = null
var/list/container = list( )
/obj/effect/overlay/thermite
name = "thermite"
desc = "Looks hot."
icon = 'icons/effects/fire.dmi'
icon_state = "2" //what?
anchored = TRUE
opacity = TRUE
density = TRUE
layer = FLY_LAYER
/obj/effect/supplypod_selector
icon_state = "supplypod_selector"
layer = FLY_LAYER
//Makes a tile fully lit no matter what
/obj/effect/fullbright
icon = 'icons/effects/alphacolors.dmi'
icon_state = "white"
plane = LIGHTING_PLANE
layer = LIGHTING_LAYER
blend_mode = BLEND_ADD
/obj/effect/abstract/marker
name = "marker"
icon = 'icons/effects/effects.dmi'
anchored = TRUE
icon_state = "wave3"
layer = RIPPLE_LAYER
/obj/effect/abstract/marker/Initialize(mapload)
. = ..()
GLOB.all_abstract_markers += src
/obj/effect/abstract/marker/Destroy()
GLOB.all_abstract_markers -= src
. = ..()
/obj/effect/abstract/marker/at
name = "active turf marker"
/obj/effect/dummy/lighting_obj
name = "lighting fx obj"
desc = "Tell a coder if you're seeing this."
icon_state = "nothing"
light_color = "#FFFFFF"
light_range = MINIMUM_USEFUL_LIGHT_RANGE
mouse_opacity = MOUSE_OPACITY_TRANSPARENT
/obj/effect/dummy/lighting_obj/Initialize(mapload, _color, _range, _power, _duration)
. = ..()
set_light(_range ? _range : light_range, _power ? _power : light_power, _color ? _color : light_color)
if(_duration)
QDEL_IN(src, _duration)
/obj/effect/dummy/lighting_obj/moblight
name = "mob lighting fx"
/obj/effect/dummy/lighting_obj/moblight/Initialize(mapload, _color, _range, _power, _duration)
. = ..()
if(!ismob(loc))
//The effect when you wrap a dead body in gift wrap
/obj/effect/spresent
name = "strange present"
desc = "It's a ... present?"
icon = 'icons/obj/items_and_weapons.dmi'
icon_state = "strangepresent"
density = TRUE
anchored = FALSE
/obj/effect/beam
name = "beam"
var/def_zone
pass_flags = PASSTABLE
/obj/effect/beam/singularity_act()
return
/obj/effect/beam/singularity_pull()
return
/obj/effect/spawner
name = "object spawner"
/obj/effect/list_container
name = "list container"
/obj/effect/list_container/mobl
name = "mobl"
var/master = null
var/list/container = list( )
/obj/effect/overlay/thermite
name = "thermite"
desc = "Looks hot."
icon = 'icons/effects/fire.dmi'
icon_state = "2" //what?
anchored = TRUE
opacity = TRUE
density = TRUE
layer = FLY_LAYER
/obj/effect/supplypod_selector
icon_state = "supplypod_selector"
layer = FLY_LAYER
//Makes a tile fully lit no matter what
/obj/effect/fullbright
icon = 'icons/effects/alphacolors.dmi'
icon_state = "white"
plane = LIGHTING_PLANE
layer = LIGHTING_LAYER
blend_mode = BLEND_ADD
/obj/effect/abstract/marker
name = "marker"
icon = 'icons/effects/effects.dmi'
anchored = TRUE
icon_state = "wave3"
layer = RIPPLE_LAYER
/obj/effect/abstract/marker/Initialize(mapload)
. = ..()
GLOB.all_abstract_markers += src
/obj/effect/abstract/marker/Destroy()
GLOB.all_abstract_markers -= src
. = ..()
/obj/effect/abstract/marker/at
name = "active turf marker"
/obj/effect/dummy/lighting_obj
name = "lighting fx obj"
desc = "Tell a coder if you're seeing this."
icon_state = "nothing"
light_color = "#FFFFFF"
light_range = MINIMUM_USEFUL_LIGHT_RANGE
mouse_opacity = MOUSE_OPACITY_TRANSPARENT
/obj/effect/dummy/lighting_obj/Initialize(mapload, _color, _range, _power, _duration)
. = ..()
set_light(_range ? _range : light_range, _power ? _power : light_power, _color ? _color : light_color)
if(_duration)
QDEL_IN(src, _duration)
/obj/effect/dummy/lighting_obj/moblight
name = "mob lighting fx"
/obj/effect/dummy/lighting_obj/moblight/Initialize(mapload, _color, _range, _power, _duration)
. = ..()
if(!ismob(loc))
return INITIALIZE_HINT_QDEL
+185 -185
View File
@@ -1,185 +1,185 @@
/proc/create_portal_pair(turf/source, turf/destination, _creator = null, _lifespan = 300, accuracy = 0, newtype = /obj/effect/portal, atmos_link_override)
if(!istype(source) || !istype(destination))
return
var/turf/actual_destination = get_teleport_turf(destination, accuracy)
var/obj/effect/portal/P1 = new newtype(source, _creator, _lifespan, null, FALSE, null, atmos_link_override)
var/obj/effect/portal/P2 = new newtype(actual_destination, _creator, _lifespan, P1, TRUE, null, atmos_link_override)
if(!istype(P1)||!istype(P2))
return
P1.link_portal(P2)
P1.hardlinked = TRUE
return list(P1, P2)
/obj/effect/portal
name = "portal"
desc = "Looks unstable. Best to test it with the clown."
icon = 'icons/obj/stationobjs.dmi'
icon_state = "portal"
anchored = TRUE
var/mech_sized = FALSE
var/obj/effect/portal/linked
var/hardlinked = TRUE //Requires a linked portal at all times. Destroy if there's no linked portal, if there is destroy it when this one is deleted.
var/teleport_channel = TELEPORT_CHANNEL_BLUESPACE
var/creator
var/turf/hard_target //For when a portal needs a hard target and isn't to be linked.
var/atmos_link = FALSE //Link source/destination atmos.
var/turf/open/atmos_source //Atmos link source
var/turf/open/atmos_destination //Atmos link destination
var/allow_anchored = FALSE
var/innate_accuracy_penalty = 0
var/last_effect = 0
/obj/effect/portal/anom
name = "wormhole"
icon = 'icons/obj/objects.dmi'
icon_state = "anom"
mech_sized = TRUE
teleport_channel = TELEPORT_CHANNEL_WORMHOLE
/obj/effect/portal/Move(newloc)
for(var/T in newloc)
if(istype(T, /obj/effect/portal))
return FALSE
return ..()
/obj/effect/portal/attackby(obj/item/W, mob/user, params)
if(user && Adjacent(user))
user.forceMove(get_turf(src))
return TRUE
/obj/effect/portal/Crossed(atom/movable/AM, oldloc)
if(isobserver(AM))
return ..()
if(linked && (get_turf(oldloc) == get_turf(linked)))
return ..()
if(!teleport(AM))
return ..()
/obj/effect/portal/attack_tk(mob/user)
return
/obj/effect/portal/attack_hand(mob/user)
. = ..()
if(.)
return
if(get_turf(user) == get_turf(src))
teleport(user)
if(Adjacent(user))
user.forceMove(get_turf(src))
/obj/effect/portal/Initialize(mapload, _creator, _lifespan = 0, obj/effect/portal/_linked, automatic_link = FALSE, turf/hard_target_override, atmos_link_override)
. = ..()
GLOB.portals += src
if(!istype(_linked) && automatic_link)
. = INITIALIZE_HINT_QDEL
CRASH("Somebody fucked up.")
if(_lifespan > 0)
QDEL_IN(src, _lifespan)
if(!isnull(atmos_link_override))
atmos_link = atmos_link_override
link_portal(_linked)
hardlinked = automatic_link
creator = _creator
if(isturf(hard_target_override))
hard_target = hard_target_override
/obj/effect/portal/singularity_pull()
return
/obj/effect/portal/singularity_act()
return
/obj/effect/portal/proc/link_portal(obj/effect/portal/newlink)
linked = newlink
if(atmos_link)
link_atmos()
/obj/effect/portal/proc/link_atmos()
if(atmos_source || atmos_destination)
unlink_atmos()
if(!isopenturf(get_turf(src)))
return FALSE
if(linked)
if(isopenturf(get_turf(linked)))
atmos_source = get_turf(src)
atmos_destination = get_turf(linked)
else if(hard_target)
if(isopenturf(hard_target))
atmos_source = get_turf(src)
atmos_destination = hard_target
else
return FALSE
if(!istype(atmos_source) || !istype(atmos_destination))
return FALSE
LAZYINITLIST(atmos_source.atmos_adjacent_turfs)
LAZYINITLIST(atmos_destination.atmos_adjacent_turfs)
if(atmos_source.atmos_adjacent_turfs[atmos_destination] || atmos_destination.atmos_adjacent_turfs[atmos_source]) //Already linked!
return FALSE
atmos_source.atmos_adjacent_turfs[atmos_destination] = TRUE
atmos_destination.atmos_adjacent_turfs[atmos_source] = TRUE
atmos_source.air_update_turf(FALSE)
atmos_destination.air_update_turf(FALSE)
/obj/effect/portal/proc/unlink_atmos()
if(istype(atmos_source))
if(istype(atmos_destination) && !atmos_source.Adjacent(atmos_destination) && !CANATMOSPASS(atmos_destination, atmos_source))
LAZYREMOVE(atmos_source.atmos_adjacent_turfs, atmos_destination)
atmos_source = null
if(istype(atmos_destination))
if(istype(atmos_source) && !atmos_destination.Adjacent(atmos_source) && !CANATMOSPASS(atmos_source, atmos_destination))
LAZYREMOVE(atmos_destination.atmos_adjacent_turfs, atmos_source)
atmos_destination = null
/obj/effect/portal/Destroy() //Calls on_portal_destroy(destroyed portal, location of destroyed portal) on creator if creator has such call.
if(creator && hascall(creator, "on_portal_destroy"))
call(creator, "on_portal_destroy")(src, src.loc)
creator = null
GLOB.portals -= src
unlink_atmos()
if(hardlinked && !QDELETED(linked))
QDEL_NULL(linked)
else
linked = null
return ..()
/obj/effect/portal/attack_ghost(mob/dead/observer/O)
if(!teleport(O, TRUE))
return ..()
/obj/effect/portal/proc/teleport(atom/movable/M, force = FALSE)
if(!force && (!istype(M) || iseffect(M) || (ismecha(M) && !mech_sized) || (!isobj(M) && !ismob(M)))) //Things that shouldn't teleport.
return
var/turf/real_target = get_link_target_turf()
if(!istype(real_target))
return FALSE
if(!force && (!ismecha(M) && !istype(M, /obj/item/projectile) && M.anchored && !allow_anchored))
return
if(ismegafauna(M))
message_admins("[M] has used a portal at [ADMIN_VERBOSEJMP(src)] made by [usr].")
var/no_effect = FALSE
if(last_effect == world.time)
no_effect = TRUE
else
last_effect = world.time
if(do_teleport(M, real_target, innate_accuracy_penalty, no_effects = no_effect, channel = teleport_channel))
if(istype(M, /obj/item/projectile))
var/obj/item/projectile/P = M
P.ignore_source_check = TRUE
return TRUE
return FALSE
/obj/effect/portal/proc/get_link_target_turf()
var/turf/real_target
if(!istype(linked) || QDELETED(linked))
if(hardlinked)
qdel(src)
if(!istype(hard_target) || QDELETED(hard_target))
hard_target = null
return
else
real_target = hard_target
linked = null
else
real_target = get_turf(linked)
return real_target
/proc/create_portal_pair(turf/source, turf/destination, _creator = null, _lifespan = 300, accuracy = 0, newtype = /obj/effect/portal, atmos_link_override)
if(!istype(source) || !istype(destination))
return
var/turf/actual_destination = get_teleport_turf(destination, accuracy)
var/obj/effect/portal/P1 = new newtype(source, _creator, _lifespan, null, FALSE, null, atmos_link_override)
var/obj/effect/portal/P2 = new newtype(actual_destination, _creator, _lifespan, P1, TRUE, null, atmos_link_override)
if(!istype(P1)||!istype(P2))
return
P1.link_portal(P2)
P1.hardlinked = TRUE
return list(P1, P2)
/obj/effect/portal
name = "portal"
desc = "Looks unstable. Best to test it with the clown."
icon = 'icons/obj/stationobjs.dmi'
icon_state = "portal"
anchored = TRUE
var/mech_sized = FALSE
var/obj/effect/portal/linked
var/hardlinked = TRUE //Requires a linked portal at all times. Destroy if there's no linked portal, if there is destroy it when this one is deleted.
var/teleport_channel = TELEPORT_CHANNEL_BLUESPACE
var/creator
var/turf/hard_target //For when a portal needs a hard target and isn't to be linked.
var/atmos_link = FALSE //Link source/destination atmos.
var/turf/open/atmos_source //Atmos link source
var/turf/open/atmos_destination //Atmos link destination
var/allow_anchored = FALSE
var/innate_accuracy_penalty = 0
var/last_effect = 0
/obj/effect/portal/anom
name = "wormhole"
icon = 'icons/obj/objects.dmi'
icon_state = "anom"
mech_sized = TRUE
teleport_channel = TELEPORT_CHANNEL_WORMHOLE
/obj/effect/portal/Move(newloc)
for(var/T in newloc)
if(istype(T, /obj/effect/portal))
return FALSE
return ..()
/obj/effect/portal/attackby(obj/item/W, mob/user, params)
if(user && Adjacent(user))
user.forceMove(get_turf(src))
return TRUE
/obj/effect/portal/Crossed(atom/movable/AM, oldloc)
if(isobserver(AM))
return ..()
if(linked && (get_turf(oldloc) == get_turf(linked)))
return ..()
if(!teleport(AM))
return ..()
/obj/effect/portal/attack_tk(mob/user)
return
/obj/effect/portal/attack_hand(mob/user)
. = ..()
if(.)
return
if(get_turf(user) == get_turf(src))
teleport(user)
if(Adjacent(user))
user.forceMove(get_turf(src))
/obj/effect/portal/Initialize(mapload, _creator, _lifespan = 0, obj/effect/portal/_linked, automatic_link = FALSE, turf/hard_target_override, atmos_link_override)
. = ..()
GLOB.portals += src
if(!istype(_linked) && automatic_link)
. = INITIALIZE_HINT_QDEL
CRASH("Somebody fucked up.")
if(_lifespan > 0)
QDEL_IN(src, _lifespan)
if(!isnull(atmos_link_override))
atmos_link = atmos_link_override
link_portal(_linked)
hardlinked = automatic_link
creator = _creator
if(isturf(hard_target_override))
hard_target = hard_target_override
/obj/effect/portal/singularity_pull()
return
/obj/effect/portal/singularity_act()
return
/obj/effect/portal/proc/link_portal(obj/effect/portal/newlink)
linked = newlink
if(atmos_link)
link_atmos()
/obj/effect/portal/proc/link_atmos()
if(atmos_source || atmos_destination)
unlink_atmos()
if(!isopenturf(get_turf(src)))
return FALSE
if(linked)
if(isopenturf(get_turf(linked)))
atmos_source = get_turf(src)
atmos_destination = get_turf(linked)
else if(hard_target)
if(isopenturf(hard_target))
atmos_source = get_turf(src)
atmos_destination = hard_target
else
return FALSE
if(!istype(atmos_source) || !istype(atmos_destination))
return FALSE
LAZYINITLIST(atmos_source.atmos_adjacent_turfs)
LAZYINITLIST(atmos_destination.atmos_adjacent_turfs)
if(atmos_source.atmos_adjacent_turfs[atmos_destination] || atmos_destination.atmos_adjacent_turfs[atmos_source]) //Already linked!
return FALSE
atmos_source.atmos_adjacent_turfs[atmos_destination] = TRUE
atmos_destination.atmos_adjacent_turfs[atmos_source] = TRUE
atmos_source.air_update_turf(FALSE)
atmos_destination.air_update_turf(FALSE)
/obj/effect/portal/proc/unlink_atmos()
if(istype(atmos_source))
if(istype(atmos_destination) && !atmos_source.Adjacent(atmos_destination) && !CANATMOSPASS(atmos_destination, atmos_source))
LAZYREMOVE(atmos_source.atmos_adjacent_turfs, atmos_destination)
atmos_source = null
if(istype(atmos_destination))
if(istype(atmos_source) && !atmos_destination.Adjacent(atmos_source) && !CANATMOSPASS(atmos_source, atmos_destination))
LAZYREMOVE(atmos_destination.atmos_adjacent_turfs, atmos_source)
atmos_destination = null
/obj/effect/portal/Destroy() //Calls on_portal_destroy(destroyed portal, location of destroyed portal) on creator if creator has such call.
if(creator && hascall(creator, "on_portal_destroy"))
call(creator, "on_portal_destroy")(src, src.loc)
creator = null
GLOB.portals -= src
unlink_atmos()
if(hardlinked && !QDELETED(linked))
QDEL_NULL(linked)
else
linked = null
return ..()
/obj/effect/portal/attack_ghost(mob/dead/observer/O)
if(!teleport(O, TRUE))
return ..()
/obj/effect/portal/proc/teleport(atom/movable/M, force = FALSE)
if(!force && (!istype(M) || iseffect(M) || (ismecha(M) && !mech_sized) || (!isobj(M) && !ismob(M)))) //Things that shouldn't teleport.
return
var/turf/real_target = get_link_target_turf()
if(!istype(real_target))
return FALSE
if(!force && (!ismecha(M) && !istype(M, /obj/item/projectile) && M.anchored && !allow_anchored))
return
if(ismegafauna(M))
message_admins("[M] has used a portal at [ADMIN_VERBOSEJMP(src)] made by [usr].")
var/no_effect = FALSE
if(last_effect == world.time)
no_effect = TRUE
else
last_effect = world.time
if(do_teleport(M, real_target, innate_accuracy_penalty, no_effects = no_effect, channel = teleport_channel))
if(istype(M, /obj/item/projectile))
var/obj/item/projectile/P = M
P.ignore_source_check = TRUE
return TRUE
return FALSE
/obj/effect/portal/proc/get_link_target_turf()
var/turf/real_target
if(!istype(linked) || QDELETED(linked))
if(hardlinked)
qdel(src)
if(!istype(hard_target) || QDELETED(hard_target))
hard_target = null
return
else
real_target = hard_target
linked = null
else
real_target = get_turf(linked)
return real_target
+112 -112
View File
@@ -1,112 +1,112 @@
/datum/proximity_monitor
var/atom/host //the atom we are tracking
var/atom/hasprox_receiver //the atom that will receive HasProximity calls.
var/atom/last_host_loc
var/list/checkers //list of /obj/effect/abstract/proximity_checkers
var/current_range
var/ignore_if_not_on_turf //don't check turfs in range if the host's loc isn't a turf
/datum/proximity_monitor/New(atom/_host, range, _ignore_if_not_on_turf = TRUE)
checkers = list()
last_host_loc = _host.loc
ignore_if_not_on_turf = _ignore_if_not_on_turf
current_range = range
SetHost(_host)
/datum/proximity_monitor/proc/SetHost(atom/H,atom/R)
if(H == host)
return
if(host)
UnregisterSignal(host, COMSIG_MOVABLE_MOVED)
if(R)
hasprox_receiver = R
else if(hasprox_receiver == host) //Default case
hasprox_receiver = H
host = H
RegisterSignal(host, COMSIG_MOVABLE_MOVED, .proc/HandleMove)
last_host_loc = host.loc
SetRange(current_range,TRUE)
/datum/proximity_monitor/Destroy()
host = null
last_host_loc = null
hasprox_receiver = null
QDEL_LIST(checkers)
return ..()
/datum/proximity_monitor/proc/HandleMove()
var/atom/_host = host
var/atom/new_host_loc = _host.loc
if(last_host_loc != new_host_loc)
last_host_loc = new_host_loc //hopefully this won't cause GC issues with containers
var/curr_range = current_range
SetRange(curr_range, TRUE)
if(curr_range)
testing("HasProx: [host] -> [host]")
hasprox_receiver.HasProximity(host) //if we are processing, we're guaranteed to be a movable
/datum/proximity_monitor/proc/SetRange(range, force_rebuild = FALSE)
if(!force_rebuild && range == current_range)
return FALSE
. = TRUE
current_range = range
var/list/checkers_local = checkers
var/old_checkers_len = checkers_local.len
var/atom/_host = host
var/atom/loc_to_use = ignore_if_not_on_turf ? _host.loc : get_turf(_host)
if(!isturf(loc_to_use)) //only check the host's loc
if(range)
var/obj/effect/abstract/proximity_checker/pc
if(old_checkers_len)
pc = checkers_local[old_checkers_len]
--checkers_local.len
QDEL_LIST(checkers_local)
else
pc = new(loc_to_use, src)
checkers_local += pc //only check the host's loc
return
var/list/turfs = RANGE_TURFS(range, loc_to_use)
var/turfs_len = turfs.len
var/old_checkers_used = min(turfs_len, old_checkers_len)
//reuse what we can
for(var/I in 1 to old_checkers_len)
if(I <= old_checkers_used)
var/obj/effect/abstract/proximity_checker/pc = checkers_local[I]
pc.forceMove(turfs[I])
else
qdel(checkers_local[I]) //delete the leftovers
if(old_checkers_len < turfs_len)
//create what we lack
for(var/I in (old_checkers_used + 1) to turfs_len)
checkers_local += new /obj/effect/abstract/proximity_checker(turfs[I], src)
else
checkers_local.Cut(old_checkers_used + 1, old_checkers_len)
/obj/effect/abstract/proximity_checker
invisibility = INVISIBILITY_ABSTRACT
anchored = TRUE
var/datum/proximity_monitor/monitor
/obj/effect/abstract/proximity_checker/Initialize(mapload, datum/proximity_monitor/_monitor)
. = ..()
if(_monitor)
monitor = _monitor
else
stack_trace("proximity_checker created without host")
return INITIALIZE_HINT_QDEL
/obj/effect/abstract/proximity_checker/Destroy()
monitor = null
return ..()
/obj/effect/abstract/proximity_checker/Crossed(atom/movable/AM)
set waitfor = FALSE
monitor.hasprox_receiver.HasProximity(AM)
/datum/proximity_monitor
var/atom/host //the atom we are tracking
var/atom/hasprox_receiver //the atom that will receive HasProximity calls.
var/atom/last_host_loc
var/list/checkers //list of /obj/effect/abstract/proximity_checkers
var/current_range
var/ignore_if_not_on_turf //don't check turfs in range if the host's loc isn't a turf
/datum/proximity_monitor/New(atom/_host, range, _ignore_if_not_on_turf = TRUE)
checkers = list()
last_host_loc = _host.loc
ignore_if_not_on_turf = _ignore_if_not_on_turf
current_range = range
SetHost(_host)
/datum/proximity_monitor/proc/SetHost(atom/H,atom/R)
if(H == host)
return
if(host)
UnregisterSignal(host, COMSIG_MOVABLE_MOVED)
if(R)
hasprox_receiver = R
else if(hasprox_receiver == host) //Default case
hasprox_receiver = H
host = H
RegisterSignal(host, COMSIG_MOVABLE_MOVED, .proc/HandleMove)
last_host_loc = host.loc
SetRange(current_range,TRUE)
/datum/proximity_monitor/Destroy()
host = null
last_host_loc = null
hasprox_receiver = null
QDEL_LIST(checkers)
return ..()
/datum/proximity_monitor/proc/HandleMove()
var/atom/_host = host
var/atom/new_host_loc = _host.loc
if(last_host_loc != new_host_loc)
last_host_loc = new_host_loc //hopefully this won't cause GC issues with containers
var/curr_range = current_range
SetRange(curr_range, TRUE)
if(curr_range)
testing("HasProx: [host] -> [host]")
hasprox_receiver.HasProximity(host) //if we are processing, we're guaranteed to be a movable
/datum/proximity_monitor/proc/SetRange(range, force_rebuild = FALSE)
if(!force_rebuild && range == current_range)
return FALSE
. = TRUE
current_range = range
var/list/checkers_local = checkers
var/old_checkers_len = checkers_local.len
var/atom/_host = host
var/atom/loc_to_use = ignore_if_not_on_turf ? _host.loc : get_turf(_host)
if(!isturf(loc_to_use)) //only check the host's loc
if(range)
var/obj/effect/abstract/proximity_checker/pc
if(old_checkers_len)
pc = checkers_local[old_checkers_len]
--checkers_local.len
QDEL_LIST(checkers_local)
else
pc = new(loc_to_use, src)
checkers_local += pc //only check the host's loc
return
var/list/turfs = RANGE_TURFS(range, loc_to_use)
var/turfs_len = turfs.len
var/old_checkers_used = min(turfs_len, old_checkers_len)
//reuse what we can
for(var/I in 1 to old_checkers_len)
if(I <= old_checkers_used)
var/obj/effect/abstract/proximity_checker/pc = checkers_local[I]
pc.forceMove(turfs[I])
else
qdel(checkers_local[I]) //delete the leftovers
if(old_checkers_len < turfs_len)
//create what we lack
for(var/I in (old_checkers_used + 1) to turfs_len)
checkers_local += new /obj/effect/abstract/proximity_checker(turfs[I], src)
else
checkers_local.Cut(old_checkers_used + 1, old_checkers_len)
/obj/effect/abstract/proximity_checker
invisibility = INVISIBILITY_ABSTRACT
anchored = TRUE
var/datum/proximity_monitor/monitor
/obj/effect/abstract/proximity_checker/Initialize(mapload, datum/proximity_monitor/_monitor)
. = ..()
if(_monitor)
monitor = _monitor
else
stack_trace("proximity_checker created without host")
return INITIALIZE_HINT_QDEL
/obj/effect/abstract/proximity_checker/Destroy()
monitor = null
return ..()
/obj/effect/abstract/proximity_checker/Crossed(atom/movable/AM)
set waitfor = FALSE
monitor.hasprox_receiver.HasProximity(AM)
@@ -1,65 +1,65 @@
#define CELSIUS_TO_KELVIN(T_K) ((T_K) + T0C)
#define OPTIMAL_TEMP_K_PLA_BURN_SCALE(PRESSURE_P,PRESSURE_O,TEMP_O) (((PRESSURE_P) * GLOB.meta_gas_specific_heats[/datum/gas/plasma]) / (((PRESSURE_P) * GLOB.meta_gas_specific_heats[/datum/gas/plasma] + (PRESSURE_O) * GLOB.meta_gas_specific_heats[/datum/gas/oxygen]) / PLASMA_UPPER_TEMPERATURE - (PRESSURE_O) * GLOB.meta_gas_specific_heats[/datum/gas/oxygen] / CELSIUS_TO_KELVIN(TEMP_O)))
#define OPTIMAL_TEMP_K_PLA_BURN_RATIO(PRESSURE_P,PRESSURE_O,TEMP_O) (CELSIUS_TO_KELVIN(TEMP_O) * PLASMA_OXYGEN_FULLBURN * (PRESSURE_P) / (PRESSURE_O))
/obj/effect/spawner/newbomb
name = "bomb"
icon = 'icons/mob/screen_gen.dmi'
icon_state = "x"
var/temp_p = 1500
var/temp_o = 1000 // tank temperatures
var/pressure_p = 10 * ONE_ATMOSPHERE
var/pressure_o = 10 * ONE_ATMOSPHERE //tank pressures
var/assembly_type
/obj/effect/spawner/newbomb/Initialize()
. = ..()
var/obj/item/transfer_valve/V = new(src.loc)
var/obj/item/tank/internals/plasma/PT = new(V)
var/obj/item/tank/internals/oxygen/OT = new(V)
PT.air_contents.gases[/datum/gas/plasma] = pressure_p*PT.volume/(R_IDEAL_GAS_EQUATION*CELSIUS_TO_KELVIN(temp_p))
PT.air_contents.temperature = CELSIUS_TO_KELVIN(temp_p)
OT.air_contents.gases[/datum/gas/oxygen] = pressure_o*OT.volume/(R_IDEAL_GAS_EQUATION*CELSIUS_TO_KELVIN(temp_o))
OT.air_contents.temperature = CELSIUS_TO_KELVIN(temp_o)
V.tank_one = PT
V.tank_two = OT
PT.master = V
OT.master = V
if(assembly_type)
var/obj/item/assembly/A = new assembly_type(V)
V.attached_device = A
A.holder = V
V.update_icon()
return INITIALIZE_HINT_QDEL
/obj/effect/spawner/newbomb/timer/syndicate/Initialize()
temp_p = (OPTIMAL_TEMP_K_PLA_BURN_SCALE(pressure_p, pressure_o, temp_o)/2 + OPTIMAL_TEMP_K_PLA_BURN_RATIO(pressure_p, pressure_o, temp_o)/2) - T0C
. = ..()
/obj/effect/spawner/newbomb/timer
assembly_type = /obj/item/assembly/timer
/obj/effect/spawner/newbomb/timer/syndicate
pressure_o = TANK_LEAK_PRESSURE - 1
temp_o = 20
pressure_p = TANK_LEAK_PRESSURE - 1
/obj/effect/spawner/newbomb/proximity
assembly_type = /obj/item/assembly/prox_sensor
/obj/effect/spawner/newbomb/radio
assembly_type = /obj/item/assembly/signaler
#undef CELSIUS_TO_KELVIN
#undef OPTIMAL_TEMP_K_PLA_BURN_SCALE
#undef OPTIMAL_TEMP_K_PLA_BURN_RATIO
#define CELSIUS_TO_KELVIN(T_K) ((T_K) + T0C)
#define OPTIMAL_TEMP_K_PLA_BURN_SCALE(PRESSURE_P,PRESSURE_O,TEMP_O) (((PRESSURE_P) * GLOB.meta_gas_specific_heats[/datum/gas/plasma]) / (((PRESSURE_P) * GLOB.meta_gas_specific_heats[/datum/gas/plasma] + (PRESSURE_O) * GLOB.meta_gas_specific_heats[/datum/gas/oxygen]) / PLASMA_UPPER_TEMPERATURE - (PRESSURE_O) * GLOB.meta_gas_specific_heats[/datum/gas/oxygen] / CELSIUS_TO_KELVIN(TEMP_O)))
#define OPTIMAL_TEMP_K_PLA_BURN_RATIO(PRESSURE_P,PRESSURE_O,TEMP_O) (CELSIUS_TO_KELVIN(TEMP_O) * PLASMA_OXYGEN_FULLBURN * (PRESSURE_P) / (PRESSURE_O))
/obj/effect/spawner/newbomb
name = "bomb"
icon = 'icons/mob/screen_gen.dmi'
icon_state = "x"
var/temp_p = 1500
var/temp_o = 1000 // tank temperatures
var/pressure_p = 10 * ONE_ATMOSPHERE
var/pressure_o = 10 * ONE_ATMOSPHERE //tank pressures
var/assembly_type
/obj/effect/spawner/newbomb/Initialize()
. = ..()
var/obj/item/transfer_valve/V = new(src.loc)
var/obj/item/tank/internals/plasma/PT = new(V)
var/obj/item/tank/internals/oxygen/OT = new(V)
PT.air_contents.gases[/datum/gas/plasma] = pressure_p*PT.volume/(R_IDEAL_GAS_EQUATION*CELSIUS_TO_KELVIN(temp_p))
PT.air_contents.temperature = CELSIUS_TO_KELVIN(temp_p)
OT.air_contents.gases[/datum/gas/oxygen] = pressure_o*OT.volume/(R_IDEAL_GAS_EQUATION*CELSIUS_TO_KELVIN(temp_o))
OT.air_contents.temperature = CELSIUS_TO_KELVIN(temp_o)
V.tank_one = PT
V.tank_two = OT
PT.master = V
OT.master = V
if(assembly_type)
var/obj/item/assembly/A = new assembly_type(V)
V.attached_device = A
A.holder = V
V.update_icon()
return INITIALIZE_HINT_QDEL
/obj/effect/spawner/newbomb/timer/syndicate/Initialize()
temp_p = (OPTIMAL_TEMP_K_PLA_BURN_SCALE(pressure_p, pressure_o, temp_o)/2 + OPTIMAL_TEMP_K_PLA_BURN_RATIO(pressure_p, pressure_o, temp_o)/2) - T0C
. = ..()
/obj/effect/spawner/newbomb/timer
assembly_type = /obj/item/assembly/timer
/obj/effect/spawner/newbomb/timer/syndicate
pressure_o = TANK_LEAK_PRESSURE - 1
temp_o = 20
pressure_p = TANK_LEAK_PRESSURE - 1
/obj/effect/spawner/newbomb/proximity
assembly_type = /obj/item/assembly/prox_sensor
/obj/effect/spawner/newbomb/radio
assembly_type = /obj/item/assembly/signaler
#undef CELSIUS_TO_KELVIN
#undef OPTIMAL_TEMP_K_PLA_BURN_SCALE
#undef OPTIMAL_TEMP_K_PLA_BURN_RATIO
+240 -240
View File
@@ -1,240 +1,240 @@
/obj/effect/gibspawner
var/sparks = FALSE //whether sparks spread
var/virusProb = 20 //the chance for viruses to spread on the gibs
var/gib_mob_type //generate a fake mob to transfer DNA from if we weren't passed a mob.
var/gib_mob_species //We'll want to nip-pick their species for blood type stuff
var/sound_to_play = 'sound/effects/blobattack.ogg'
var/sound_vol = 60
var/list/gibtypes = list() //typepaths of the gib decals to spawn
var/list/gibamounts = list() //amount to spawn for each gib decal type we'll spawn.
var/list/gibdirections = list() //of lists of possible directions to spread each gib decal type towards.
/obj/effect/gibspawner/Initialize(mapload, mob/living/source_mob, list/datum/disease/diseases)
. = ..()
if(gibtypes.len != gibamounts.len)
stack_trace("Gib list amount length mismatch!")
return
if(gibamounts.len != gibdirections.len)
stack_trace("Gib list dir length mismatch!")
return
var/obj/effect/decal/cleanable/blood/gibs/gib = null
if(sound_to_play && isnum(sound_vol))
playsound(src, sound_to_play, sound_vol, TRUE)
if(sparks)
var/datum/effect_system/spark_spread/s = new /datum/effect_system/spark_spread
s.set_up(2, 1, loc)
s.start()
var/list/dna_to_add //find the dna to pass to the spawned gibs. do note this can be null if the mob doesn't have blood. add_blood_DNA() has built in null handling.
var/body_coloring = ""
if(source_mob)
if(!issilicon(source_mob))
dna_to_add = source_mob.get_blood_dna_list() //ez pz
if(ishuman(source_mob))
var/mob/living/carbon/human/H = source_mob
if(H.dna.species.use_skintones)
body_coloring = "#[skintone2hex(H.skin_tone)]"
else
body_coloring = "#[H.dna.features["mcolor"]]"
else if(gib_mob_type)
var/mob/living/temp_mob = new gib_mob_type(src) //generate a fake mob so that we pull the right type of DNA for the gibs.
if(gib_mob_species)
if(ishuman(temp_mob))
var/mob/living/carbon/human/H = temp_mob
H.set_species(gib_mob_species)
dna_to_add = temp_mob.get_blood_dna_list()
if(H.dna.species.use_skintones)
body_coloring = "#[skintone2hex(H.skin_tone)]"
else
body_coloring = "#[H.dna.features["mcolor"]]"
else
dna_to_add = temp_mob.get_blood_dna_list()
else if(!issilicon(temp_mob))
dna_to_add = temp_mob.get_blood_dna_list()
qdel(temp_mob)
else
dna_to_add = list("Non-human DNA" = random_blood_type()) //else, generate a random bloodtype for it.
for(var/i = 1, i<= gibtypes.len, i++)
if(gibamounts[i])
for(var/j = 1, j<= gibamounts[i], j++)
var/gibType = gibtypes[i]
gib = new gibType(loc, diseases)
if(iscarbon(loc))
var/mob/living/carbon/digester = loc
digester.stomach_contents += gib
if(dna_to_add && dna_to_add.len)
gib.add_blood_DNA(dna_to_add)
gib.body_colors = body_coloring
gib.update_icon()
var/list/directions = gibdirections[i]
if(isturf(loc))
if(directions.len)
gib.streak(directions)
return INITIALIZE_HINT_QDEL
/obj/effect/gibspawner/generic
gibtypes = list(/obj/effect/decal/cleanable/blood/gibs, /obj/effect/decal/cleanable/blood/gibs, /obj/effect/decal/cleanable/blood/gibs/core)
gibamounts = list(2, 2, 1)
sound_vol = 40
/obj/effect/gibspawner/generic/Initialize()
if(!gibdirections.len)
gibdirections = list(list(WEST, NORTHWEST, SOUTHWEST, NORTH),list(EAST, NORTHEAST, SOUTHEAST, SOUTH), list())
return ..()
/obj/effect/gibspawner/generic/animal
gib_mob_type = /mob/living/simple_animal/pet
/obj/effect/gibspawner/human
gibtypes = list(/obj/effect/decal/cleanable/blood/gibs/human/up, /obj/effect/decal/cleanable/blood/gibs/human/down, /obj/effect/decal/cleanable/blood/gibs/human, /obj/effect/decal/cleanable/blood/gibs/human, /obj/effect/decal/cleanable/blood/gibs/human/body, /obj/effect/decal/cleanable/blood/gibs/human/limb, /obj/effect/decal/cleanable/blood/gibs/human/core)
gibamounts = list(1, 1, 1, 1, 1, 1, 1)
gib_mob_type = /mob/living/carbon/human
gib_mob_species = /datum/species/human
sound_vol = 50
/obj/effect/gibspawner/human/Initialize()
if(!gibdirections.len)
gibdirections = list(list(NORTH, NORTHEAST, NORTHWEST),list(SOUTH, SOUTHEAST, SOUTHWEST),list(WEST, NORTHWEST, SOUTHWEST),list(EAST, NORTHEAST, SOUTHEAST), GLOB.alldirs, GLOB.alldirs, list())
return ..()
/obj/effect/gibspawner/human/bodypartless //only the gibs that don't look like actual full bodyparts (except torso).
gibtypes = list(/obj/effect/decal/cleanable/blood/gibs/human, /obj/effect/decal/cleanable/blood/gibs/human/core, /obj/effect/decal/cleanable/blood/gibs/human, /obj/effect/decal/cleanable/blood/gibs/human/core, /obj/effect/decal/cleanable/blood/gibs/human, /obj/effect/decal/cleanable/blood/gibs/human/torso)
gibamounts = list(1, 1, 1, 1, 1, 1)
/obj/effect/gibspawner/human/bodypartless/Initialize()
if(!gibdirections.len)
gibdirections = list(list(NORTH, NORTHEAST, NORTHWEST),list(SOUTH, SOUTHEAST, SOUTHWEST),list(WEST, NORTHWEST, SOUTHWEST),list(EAST, NORTHEAST, SOUTHEAST), GLOB.alldirs, list())
return ..()
/obj/effect/gibspawner/lizard
gibtypes = list(/obj/effect/decal/cleanable/blood/gibs/human/lizard/up, /obj/effect/decal/cleanable/blood/gibs/human/lizard/down, /obj/effect/decal/cleanable/blood/gibs/human/lizard, /obj/effect/decal/cleanable/blood/gibs/human/lizard, /obj/effect/decal/cleanable/blood/gibs/human/lizard/body, /obj/effect/decal/cleanable/blood/gibs/human/lizard/limb, /obj/effect/decal/cleanable/blood/gibs/human/lizard/core)
gibamounts = list(1, 1, 1, 1, 1, 1, 1)
gib_mob_type = /mob/living/carbon/human/species/lizard
gib_mob_species = /datum/species/lizard
sound_vol = 50
/obj/effect/gibspawner/lizard/Initialize()
if(!gibdirections.len)
gibdirections = list(list(NORTH, NORTHEAST, NORTHWEST),list(SOUTH, SOUTHEAST, SOUTHWEST),list(WEST, NORTHWEST, SOUTHWEST),list(EAST, NORTHEAST, SOUTHEAST), GLOB.alldirs, GLOB.alldirs, list())
return ..()
/obj/effect/gibspawner/lizard/bodypartless
gibtypes = list(/obj/effect/decal/cleanable/blood/gibs/human/lizard, /obj/effect/decal/cleanable/blood/gibs/human/lizard/core, /obj/effect/decal/cleanable/blood/gibs/human/lizard, /obj/effect/decal/cleanable/blood/gibs/human/lizard/core, /obj/effect/decal/cleanable/blood/gibs/human/lizard, /obj/effect/decal/cleanable/blood/gibs/human/lizard/torso)
gibamounts = list(1, 1, 1, 1, 1, 1)
/obj/effect/gibspawner/lizard/bodypartless/Initialize()
if(!gibdirections.len)
gibdirections = list(list(NORTH, NORTHEAST, NORTHWEST),list(SOUTH, SOUTHEAST, SOUTHWEST),list(WEST, NORTHWEST, SOUTHWEST),list(EAST, NORTHEAST, SOUTHEAST), GLOB.alldirs, list())
return ..()
/obj/effect/gibspawner/slime
gibtypes = list(/obj/effect/decal/cleanable/blood/gibs/slime/up, /obj/effect/decal/cleanable/blood/gibs/slime/down, /obj/effect/decal/cleanable/blood/gibs/slime, /obj/effect/decal/cleanable/blood/gibs/slime, /obj/effect/decal/cleanable/blood/gibs/slime/body, /obj/effect/decal/cleanable/blood/gibs/slime/limb, /obj/effect/decal/cleanable/blood/gibs/slime/core)
gibamounts = list(1, 1, 1, 1, 1, 1, 1)
gib_mob_type = /mob/living/carbon/human/species/roundstartslime
gib_mob_species = /datum/species/jelly/roundstartslime
sound_vol = 50
/obj/effect/gibspawner/slime/Initialize()
if(!gibdirections.len)
gibdirections = list(list(NORTH, NORTHEAST, NORTHWEST),list(SOUTH, SOUTHEAST, SOUTHWEST),list(WEST, NORTHWEST, SOUTHWEST),list(EAST, NORTHEAST, SOUTHEAST), GLOB.alldirs, GLOB.alldirs, list())
return ..()
/obj/effect/gibspawner/slime/bodypartless //only the gibs that don't look like actual full bodyparts (except torso).
gibtypes = list(/obj/effect/decal/cleanable/blood/gibs/slime, /obj/effect/decal/cleanable/blood/gibs/slime/core, /obj/effect/decal/cleanable/blood/gibs/slime, /obj/effect/decal/cleanable/blood/gibs/slime/core, /obj/effect/decal/cleanable/blood/gibs/slime, /obj/effect/decal/cleanable/blood/gibs/slime/torso)
gibamounts = list(1, 1, 1, 1, 1, 1)
/obj/effect/gibspawner/slime/bodypartless/Initialize()
if(!gibdirections.len)
gibdirections = list(list(NORTH, NORTHEAST, NORTHWEST),list(SOUTH, SOUTHEAST, SOUTHWEST),list(WEST, NORTHWEST, SOUTHWEST),list(EAST, NORTHEAST, SOUTHEAST), GLOB.alldirs, list())
return ..()
/obj/effect/gibspawner/ipc
gibtypes = list(/obj/effect/decal/cleanable/blood/gibs/ipc/up, /obj/effect/decal/cleanable/blood/gibs/ipc/down, /obj/effect/decal/cleanable/blood/gibs/ipc, /obj/effect/decal/cleanable/blood/gibs/ipc, /obj/effect/decal/cleanable/blood/gibs/ipc/body, /obj/effect/decal/cleanable/blood/gibs/ipc/limb, /obj/effect/decal/cleanable/blood/gibs/ipc/core)
gibamounts = list(1, 1, 1, 1, 1, 1, 1)
gib_mob_type = /mob/living/carbon/human/species/ipc
gib_mob_species = /datum/species/ipc
sound_vol = 50
sparks = TRUE
sound_to_play = 'sound/effects/bang.ogg'
/obj/effect/gibspawner/ipc/Initialize()
if(!gibdirections.len)
gibdirections = list(list(NORTH, NORTHEAST, NORTHWEST),list(SOUTH, SOUTHEAST, SOUTHWEST),list(WEST, NORTHWEST, SOUTHWEST),list(EAST, NORTHEAST, SOUTHEAST), GLOB.alldirs, GLOB.alldirs, list())
return ..()
/obj/effect/gibspawner/ipc/bodypartless //only the gibs that don't look like actual full bodyparts (except torso).
gibtypes = list(/obj/effect/decal/cleanable/blood/gibs/ipc, /obj/effect/decal/cleanable/blood/gibs/ipc/core, /obj/effect/decal/cleanable/blood/gibs/ipc, /obj/effect/decal/cleanable/blood/gibs/ipc/core, /obj/effect/decal/cleanable/blood/gibs/ipc, /obj/effect/decal/cleanable/blood/gibs/ipc/torso)
gibamounts = list(1, 1, 1, 1, 1, 1)
/obj/effect/gibspawner/ipc/bodypartless/Initialize()
if(!gibdirections.len)
gibdirections = list(list(NORTH, NORTHEAST, NORTHWEST),list(SOUTH, SOUTHEAST, SOUTHWEST),list(WEST, NORTHWEST, SOUTHWEST),list(EAST, NORTHEAST, SOUTHEAST), GLOB.alldirs, list())
return ..()
/obj/effect/gibspawner/xeno
gibtypes = list(/obj/effect/decal/cleanable/blood/gibs/xeno/up, /obj/effect/decal/cleanable/blood/gibs/xeno/down, /obj/effect/decal/cleanable/blood/gibs/xeno, /obj/effect/decal/cleanable/blood/gibs/xeno, /obj/effect/decal/cleanable/blood/gibs/xeno/body, /obj/effect/decal/cleanable/blood/gibs/xeno/limb, /obj/effect/decal/cleanable/blood/gibs/xeno/core)
gibamounts = list(1, 1, 1, 1, 1, 1, 1)
gib_mob_type = /mob/living/carbon/alien
/obj/effect/gibspawner/xeno/Initialize()
if(!gibdirections.len)
gibdirections = list(list(NORTH, NORTHEAST, NORTHWEST),list(SOUTH, SOUTHEAST, SOUTHWEST),list(WEST, NORTHWEST, SOUTHWEST),list(EAST, NORTHEAST, SOUTHEAST), GLOB.alldirs, GLOB.alldirs, list())
return ..()
/obj/effect/gibspawner/xeno/bodypartless //only the gibs that don't look like actual full bodyparts (except torso).
gibtypes = list(/obj/effect/decal/cleanable/blood/gibs/xeno, /obj/effect/decal/cleanable/blood/gibs/xeno/core, /obj/effect/decal/cleanable/blood/gibs/xeno, /obj/effect/decal/cleanable/blood/gibs/xeno/core, /obj/effect/decal/cleanable/blood/gibs/xeno, /obj/effect/decal/cleanable/blood/gibs/xeno/torso)
gibamounts = list(1, 1, 1, 1, 1, 1)
/obj/effect/gibspawner/xeno/bodypartless/Initialize()
if(!gibdirections.len)
gibdirections = list(list(NORTH, NORTHEAST, NORTHWEST),list(SOUTH, SOUTHEAST, SOUTHWEST),list(WEST, NORTHWEST, SOUTHWEST),list(EAST, NORTHEAST, SOUTHEAST), GLOB.alldirs, list())
return ..()
/obj/effect/gibspawner/xeno/xenoperson
gib_mob_type = /mob/living/carbon/human/species/xeno
gib_mob_species = /datum/species/xeno
/obj/effect/gibspawner/xeno/xenoperson/bodypartless
/obj/effect/gibspawner/larva
gibtypes = list(/obj/effect/decal/cleanable/blood/gibs/xeno/larva, /obj/effect/decal/cleanable/blood/gibs/xeno/larva, /obj/effect/decal/cleanable/blood/gibs/xeno/larva/body, /obj/effect/decal/cleanable/blood/gibs/xeno/larva/body)
gibamounts = list(1, 1, 1, 1)
gib_mob_type = /mob/living/carbon/alien/larva
/obj/effect/gibspawner/larva/Initialize()
if(!gibdirections.len)
gibdirections = list(list(NORTH, NORTHEAST, NORTHWEST),list(SOUTH, SOUTHEAST, SOUTHWEST), list(), GLOB.alldirs)
return ..()
/obj/effect/gibspawner/larva/bodypartless
gibtypes = list(/obj/effect/decal/cleanable/blood/gibs/xeno/larva, /obj/effect/decal/cleanable/blood/gibs/xeno/larva, /obj/effect/decal/cleanable/blood/gibs/xeno/larva)
gibamounts = list(1, 1, 1)
/obj/effect/gibspawner/larva/bodypartless/Initialize()
if(!gibdirections.len)
gibdirections = list(list(NORTH, NORTHEAST, NORTHWEST),list(SOUTH, SOUTHEAST, SOUTHWEST), list())
return ..()
/obj/effect/gibspawner/robot
sparks = TRUE
gibtypes = list(/obj/effect/decal/cleanable/robot_debris/up, /obj/effect/decal/cleanable/robot_debris/down, /obj/effect/decal/cleanable/robot_debris, /obj/effect/decal/cleanable/robot_debris, /obj/effect/decal/cleanable/robot_debris, /obj/effect/decal/cleanable/robot_debris/limb)
gibamounts = list(1, 1, 1, 1, 1, 1)
gib_mob_type = /mob/living/silicon/robot
/obj/effect/gibspawner/robot/Initialize()
if(!gibdirections.len)
gibdirections = list(list(NORTH, NORTHEAST, NORTHWEST),list(SOUTH, SOUTHEAST, SOUTHWEST),list(WEST, NORTHWEST, SOUTHWEST),list(EAST, NORTHEAST, SOUTHEAST), GLOB.alldirs, GLOB.alldirs)
gibamounts[6] = pick(0, 1, 2)
return ..()
/obj/effect/gibspawner
var/sparks = FALSE //whether sparks spread
var/virusProb = 20 //the chance for viruses to spread on the gibs
var/gib_mob_type //generate a fake mob to transfer DNA from if we weren't passed a mob.
var/gib_mob_species //We'll want to nip-pick their species for blood type stuff
var/sound_to_play = 'sound/effects/blobattack.ogg'
var/sound_vol = 60
var/list/gibtypes = list() //typepaths of the gib decals to spawn
var/list/gibamounts = list() //amount to spawn for each gib decal type we'll spawn.
var/list/gibdirections = list() //of lists of possible directions to spread each gib decal type towards.
/obj/effect/gibspawner/Initialize(mapload, mob/living/source_mob, list/datum/disease/diseases)
. = ..()
if(gibtypes.len != gibamounts.len)
stack_trace("Gib list amount length mismatch!")
return
if(gibamounts.len != gibdirections.len)
stack_trace("Gib list dir length mismatch!")
return
var/obj/effect/decal/cleanable/blood/gibs/gib = null
if(sound_to_play && isnum(sound_vol))
playsound(src, sound_to_play, sound_vol, TRUE)
if(sparks)
var/datum/effect_system/spark_spread/s = new /datum/effect_system/spark_spread
s.set_up(2, 1, loc)
s.start()
var/list/dna_to_add //find the dna to pass to the spawned gibs. do note this can be null if the mob doesn't have blood. add_blood_DNA() has built in null handling.
var/body_coloring = ""
if(source_mob)
if(!issilicon(source_mob))
dna_to_add = source_mob.get_blood_dna_list() //ez pz
if(ishuman(source_mob))
var/mob/living/carbon/human/H = source_mob
if(H.dna.species.use_skintones)
body_coloring = "#[skintone2hex(H.skin_tone)]"
else
body_coloring = "#[H.dna.features["mcolor"]]"
else if(gib_mob_type)
var/mob/living/temp_mob = new gib_mob_type(src) //generate a fake mob so that we pull the right type of DNA for the gibs.
if(gib_mob_species)
if(ishuman(temp_mob))
var/mob/living/carbon/human/H = temp_mob
H.set_species(gib_mob_species)
dna_to_add = temp_mob.get_blood_dna_list()
if(H.dna.species.use_skintones)
body_coloring = "#[skintone2hex(H.skin_tone)]"
else
body_coloring = "#[H.dna.features["mcolor"]]"
else
dna_to_add = temp_mob.get_blood_dna_list()
else if(!issilicon(temp_mob))
dna_to_add = temp_mob.get_blood_dna_list()
qdel(temp_mob)
else
dna_to_add = list("Non-human DNA" = random_blood_type()) //else, generate a random bloodtype for it.
for(var/i = 1, i<= gibtypes.len, i++)
if(gibamounts[i])
for(var/j = 1, j<= gibamounts[i], j++)
var/gibType = gibtypes[i]
gib = new gibType(loc, diseases)
if(iscarbon(loc))
var/mob/living/carbon/digester = loc
digester.stomach_contents += gib
if(dna_to_add && dna_to_add.len)
gib.add_blood_DNA(dna_to_add)
gib.body_colors = body_coloring
gib.update_icon()
var/list/directions = gibdirections[i]
if(isturf(loc))
if(directions.len)
gib.streak(directions)
return INITIALIZE_HINT_QDEL
/obj/effect/gibspawner/generic
gibtypes = list(/obj/effect/decal/cleanable/blood/gibs, /obj/effect/decal/cleanable/blood/gibs, /obj/effect/decal/cleanable/blood/gibs/core)
gibamounts = list(2, 2, 1)
sound_vol = 40
/obj/effect/gibspawner/generic/Initialize()
if(!gibdirections.len)
gibdirections = list(list(WEST, NORTHWEST, SOUTHWEST, NORTH),list(EAST, NORTHEAST, SOUTHEAST, SOUTH), list())
return ..()
/obj/effect/gibspawner/generic/animal
gib_mob_type = /mob/living/simple_animal/pet
/obj/effect/gibspawner/human
gibtypes = list(/obj/effect/decal/cleanable/blood/gibs/human/up, /obj/effect/decal/cleanable/blood/gibs/human/down, /obj/effect/decal/cleanable/blood/gibs/human, /obj/effect/decal/cleanable/blood/gibs/human, /obj/effect/decal/cleanable/blood/gibs/human/body, /obj/effect/decal/cleanable/blood/gibs/human/limb, /obj/effect/decal/cleanable/blood/gibs/human/core)
gibamounts = list(1, 1, 1, 1, 1, 1, 1)
gib_mob_type = /mob/living/carbon/human
gib_mob_species = /datum/species/human
sound_vol = 50
/obj/effect/gibspawner/human/Initialize()
if(!gibdirections.len)
gibdirections = list(list(NORTH, NORTHEAST, NORTHWEST),list(SOUTH, SOUTHEAST, SOUTHWEST),list(WEST, NORTHWEST, SOUTHWEST),list(EAST, NORTHEAST, SOUTHEAST), GLOB.alldirs, GLOB.alldirs, list())
return ..()
/obj/effect/gibspawner/human/bodypartless //only the gibs that don't look like actual full bodyparts (except torso).
gibtypes = list(/obj/effect/decal/cleanable/blood/gibs/human, /obj/effect/decal/cleanable/blood/gibs/human/core, /obj/effect/decal/cleanable/blood/gibs/human, /obj/effect/decal/cleanable/blood/gibs/human/core, /obj/effect/decal/cleanable/blood/gibs/human, /obj/effect/decal/cleanable/blood/gibs/human/torso)
gibamounts = list(1, 1, 1, 1, 1, 1)
/obj/effect/gibspawner/human/bodypartless/Initialize()
if(!gibdirections.len)
gibdirections = list(list(NORTH, NORTHEAST, NORTHWEST),list(SOUTH, SOUTHEAST, SOUTHWEST),list(WEST, NORTHWEST, SOUTHWEST),list(EAST, NORTHEAST, SOUTHEAST), GLOB.alldirs, list())
return ..()
/obj/effect/gibspawner/lizard
gibtypes = list(/obj/effect/decal/cleanable/blood/gibs/human/lizard/up, /obj/effect/decal/cleanable/blood/gibs/human/lizard/down, /obj/effect/decal/cleanable/blood/gibs/human/lizard, /obj/effect/decal/cleanable/blood/gibs/human/lizard, /obj/effect/decal/cleanable/blood/gibs/human/lizard/body, /obj/effect/decal/cleanable/blood/gibs/human/lizard/limb, /obj/effect/decal/cleanable/blood/gibs/human/lizard/core)
gibamounts = list(1, 1, 1, 1, 1, 1, 1)
gib_mob_type = /mob/living/carbon/human/species/lizard
gib_mob_species = /datum/species/lizard
sound_vol = 50
/obj/effect/gibspawner/lizard/Initialize()
if(!gibdirections.len)
gibdirections = list(list(NORTH, NORTHEAST, NORTHWEST),list(SOUTH, SOUTHEAST, SOUTHWEST),list(WEST, NORTHWEST, SOUTHWEST),list(EAST, NORTHEAST, SOUTHEAST), GLOB.alldirs, GLOB.alldirs, list())
return ..()
/obj/effect/gibspawner/lizard/bodypartless
gibtypes = list(/obj/effect/decal/cleanable/blood/gibs/human/lizard, /obj/effect/decal/cleanable/blood/gibs/human/lizard/core, /obj/effect/decal/cleanable/blood/gibs/human/lizard, /obj/effect/decal/cleanable/blood/gibs/human/lizard/core, /obj/effect/decal/cleanable/blood/gibs/human/lizard, /obj/effect/decal/cleanable/blood/gibs/human/lizard/torso)
gibamounts = list(1, 1, 1, 1, 1, 1)
/obj/effect/gibspawner/lizard/bodypartless/Initialize()
if(!gibdirections.len)
gibdirections = list(list(NORTH, NORTHEAST, NORTHWEST),list(SOUTH, SOUTHEAST, SOUTHWEST),list(WEST, NORTHWEST, SOUTHWEST),list(EAST, NORTHEAST, SOUTHEAST), GLOB.alldirs, list())
return ..()
/obj/effect/gibspawner/slime
gibtypes = list(/obj/effect/decal/cleanable/blood/gibs/slime/up, /obj/effect/decal/cleanable/blood/gibs/slime/down, /obj/effect/decal/cleanable/blood/gibs/slime, /obj/effect/decal/cleanable/blood/gibs/slime, /obj/effect/decal/cleanable/blood/gibs/slime/body, /obj/effect/decal/cleanable/blood/gibs/slime/limb, /obj/effect/decal/cleanable/blood/gibs/slime/core)
gibamounts = list(1, 1, 1, 1, 1, 1, 1)
gib_mob_type = /mob/living/carbon/human/species/roundstartslime
gib_mob_species = /datum/species/jelly/roundstartslime
sound_vol = 50
/obj/effect/gibspawner/slime/Initialize()
if(!gibdirections.len)
gibdirections = list(list(NORTH, NORTHEAST, NORTHWEST),list(SOUTH, SOUTHEAST, SOUTHWEST),list(WEST, NORTHWEST, SOUTHWEST),list(EAST, NORTHEAST, SOUTHEAST), GLOB.alldirs, GLOB.alldirs, list())
return ..()
/obj/effect/gibspawner/slime/bodypartless //only the gibs that don't look like actual full bodyparts (except torso).
gibtypes = list(/obj/effect/decal/cleanable/blood/gibs/slime, /obj/effect/decal/cleanable/blood/gibs/slime/core, /obj/effect/decal/cleanable/blood/gibs/slime, /obj/effect/decal/cleanable/blood/gibs/slime/core, /obj/effect/decal/cleanable/blood/gibs/slime, /obj/effect/decal/cleanable/blood/gibs/slime/torso)
gibamounts = list(1, 1, 1, 1, 1, 1)
/obj/effect/gibspawner/slime/bodypartless/Initialize()
if(!gibdirections.len)
gibdirections = list(list(NORTH, NORTHEAST, NORTHWEST),list(SOUTH, SOUTHEAST, SOUTHWEST),list(WEST, NORTHWEST, SOUTHWEST),list(EAST, NORTHEAST, SOUTHEAST), GLOB.alldirs, list())
return ..()
/obj/effect/gibspawner/ipc
gibtypes = list(/obj/effect/decal/cleanable/blood/gibs/ipc/up, /obj/effect/decal/cleanable/blood/gibs/ipc/down, /obj/effect/decal/cleanable/blood/gibs/ipc, /obj/effect/decal/cleanable/blood/gibs/ipc, /obj/effect/decal/cleanable/blood/gibs/ipc/body, /obj/effect/decal/cleanable/blood/gibs/ipc/limb, /obj/effect/decal/cleanable/blood/gibs/ipc/core)
gibamounts = list(1, 1, 1, 1, 1, 1, 1)
gib_mob_type = /mob/living/carbon/human/species/ipc
gib_mob_species = /datum/species/ipc
sound_vol = 50
sparks = TRUE
sound_to_play = 'sound/effects/bang.ogg'
/obj/effect/gibspawner/ipc/Initialize()
if(!gibdirections.len)
gibdirections = list(list(NORTH, NORTHEAST, NORTHWEST),list(SOUTH, SOUTHEAST, SOUTHWEST),list(WEST, NORTHWEST, SOUTHWEST),list(EAST, NORTHEAST, SOUTHEAST), GLOB.alldirs, GLOB.alldirs, list())
return ..()
/obj/effect/gibspawner/ipc/bodypartless //only the gibs that don't look like actual full bodyparts (except torso).
gibtypes = list(/obj/effect/decal/cleanable/blood/gibs/ipc, /obj/effect/decal/cleanable/blood/gibs/ipc/core, /obj/effect/decal/cleanable/blood/gibs/ipc, /obj/effect/decal/cleanable/blood/gibs/ipc/core, /obj/effect/decal/cleanable/blood/gibs/ipc, /obj/effect/decal/cleanable/blood/gibs/ipc/torso)
gibamounts = list(1, 1, 1, 1, 1, 1)
/obj/effect/gibspawner/ipc/bodypartless/Initialize()
if(!gibdirections.len)
gibdirections = list(list(NORTH, NORTHEAST, NORTHWEST),list(SOUTH, SOUTHEAST, SOUTHWEST),list(WEST, NORTHWEST, SOUTHWEST),list(EAST, NORTHEAST, SOUTHEAST), GLOB.alldirs, list())
return ..()
/obj/effect/gibspawner/xeno
gibtypes = list(/obj/effect/decal/cleanable/blood/gibs/xeno/up, /obj/effect/decal/cleanable/blood/gibs/xeno/down, /obj/effect/decal/cleanable/blood/gibs/xeno, /obj/effect/decal/cleanable/blood/gibs/xeno, /obj/effect/decal/cleanable/blood/gibs/xeno/body, /obj/effect/decal/cleanable/blood/gibs/xeno/limb, /obj/effect/decal/cleanable/blood/gibs/xeno/core)
gibamounts = list(1, 1, 1, 1, 1, 1, 1)
gib_mob_type = /mob/living/carbon/alien
/obj/effect/gibspawner/xeno/Initialize()
if(!gibdirections.len)
gibdirections = list(list(NORTH, NORTHEAST, NORTHWEST),list(SOUTH, SOUTHEAST, SOUTHWEST),list(WEST, NORTHWEST, SOUTHWEST),list(EAST, NORTHEAST, SOUTHEAST), GLOB.alldirs, GLOB.alldirs, list())
return ..()
/obj/effect/gibspawner/xeno/bodypartless //only the gibs that don't look like actual full bodyparts (except torso).
gibtypes = list(/obj/effect/decal/cleanable/blood/gibs/xeno, /obj/effect/decal/cleanable/blood/gibs/xeno/core, /obj/effect/decal/cleanable/blood/gibs/xeno, /obj/effect/decal/cleanable/blood/gibs/xeno/core, /obj/effect/decal/cleanable/blood/gibs/xeno, /obj/effect/decal/cleanable/blood/gibs/xeno/torso)
gibamounts = list(1, 1, 1, 1, 1, 1)
/obj/effect/gibspawner/xeno/bodypartless/Initialize()
if(!gibdirections.len)
gibdirections = list(list(NORTH, NORTHEAST, NORTHWEST),list(SOUTH, SOUTHEAST, SOUTHWEST),list(WEST, NORTHWEST, SOUTHWEST),list(EAST, NORTHEAST, SOUTHEAST), GLOB.alldirs, list())
return ..()
/obj/effect/gibspawner/xeno/xenoperson
gib_mob_type = /mob/living/carbon/human/species/xeno
gib_mob_species = /datum/species/xeno
/obj/effect/gibspawner/xeno/xenoperson/bodypartless
/obj/effect/gibspawner/larva
gibtypes = list(/obj/effect/decal/cleanable/blood/gibs/xeno/larva, /obj/effect/decal/cleanable/blood/gibs/xeno/larva, /obj/effect/decal/cleanable/blood/gibs/xeno/larva/body, /obj/effect/decal/cleanable/blood/gibs/xeno/larva/body)
gibamounts = list(1, 1, 1, 1)
gib_mob_type = /mob/living/carbon/alien/larva
/obj/effect/gibspawner/larva/Initialize()
if(!gibdirections.len)
gibdirections = list(list(NORTH, NORTHEAST, NORTHWEST),list(SOUTH, SOUTHEAST, SOUTHWEST), list(), GLOB.alldirs)
return ..()
/obj/effect/gibspawner/larva/bodypartless
gibtypes = list(/obj/effect/decal/cleanable/blood/gibs/xeno/larva, /obj/effect/decal/cleanable/blood/gibs/xeno/larva, /obj/effect/decal/cleanable/blood/gibs/xeno/larva)
gibamounts = list(1, 1, 1)
/obj/effect/gibspawner/larva/bodypartless/Initialize()
if(!gibdirections.len)
gibdirections = list(list(NORTH, NORTHEAST, NORTHWEST),list(SOUTH, SOUTHEAST, SOUTHWEST), list())
return ..()
/obj/effect/gibspawner/robot
sparks = TRUE
gibtypes = list(/obj/effect/decal/cleanable/robot_debris/up, /obj/effect/decal/cleanable/robot_debris/down, /obj/effect/decal/cleanable/robot_debris, /obj/effect/decal/cleanable/robot_debris, /obj/effect/decal/cleanable/robot_debris, /obj/effect/decal/cleanable/robot_debris/limb)
gibamounts = list(1, 1, 1, 1, 1, 1)
gib_mob_type = /mob/living/silicon/robot
/obj/effect/gibspawner/robot/Initialize()
if(!gibdirections.len)
gibdirections = list(list(NORTH, NORTHEAST, NORTHWEST),list(SOUTH, SOUTHEAST, SOUTHWEST),list(WEST, NORTHWEST, SOUTHWEST),list(EAST, NORTHEAST, SOUTHEAST), GLOB.alldirs, GLOB.alldirs)
gibamounts[6] = pick(0, 1, 2)
return ..()
+380 -380
View File
@@ -1,380 +1,380 @@
/obj/effect/spawner/lootdrop
icon = 'icons/effects/landmarks_static.dmi'
icon_state = "random_loot"
layer = OBJ_LAYER
var/lootcount = 1 //how many items will be spawned
var/lootdoubles = TRUE //if the same item can be spawned twice
var/list/loot //a list of possible items to spawn e.g. list(/obj/item, /obj/structure, /obj/effect)
var/fan_out_items = FALSE //Whether the items should be distributed to offsets 0,1,-1,2,-2,3,-3.. This overrides pixel_x/y on the spawner itself
/obj/effect/spawner/lootdrop/Initialize(mapload)
..()
if(loot && loot.len)
var/turf/T = get_turf(src)
var/loot_spawned = 0
while((lootcount-loot_spawned) && loot.len)
var/lootspawn = pickweight(loot)
if(!lootdoubles)
loot.Remove(lootspawn)
if(lootspawn)
var/atom/movable/spawned_loot = new lootspawn(T)
if (!fan_out_items)
if (pixel_x != 0)
spawned_loot.pixel_x = pixel_x
if (pixel_y != 0)
spawned_loot.pixel_y = pixel_y
else
if (loot_spawned)
spawned_loot.pixel_x = spawned_loot.pixel_y = ((!(loot_spawned%2)*loot_spawned/2)*-1)+((loot_spawned%2)*(loot_spawned+1)/2*1)
loot_spawned++
return INITIALIZE_HINT_QDEL
/obj/effect/spawner/lootdrop/bedsheet
icon = 'icons/obj/bedsheets.dmi'
icon_state = "random_bedsheet"
name = "random dorms bedsheet"
loot = list(/obj/item/bedsheet = 8, /obj/item/bedsheet/blue = 8, /obj/item/bedsheet/green = 8,
/obj/item/bedsheet/grey = 8, /obj/item/bedsheet/orange = 8, /obj/item/bedsheet/purple = 8,
/obj/item/bedsheet/red = 8, /obj/item/bedsheet/yellow = 8, /obj/item/bedsheet/brown = 8,
/obj/item/bedsheet/black = 8, /obj/item/bedsheet/patriot = 3, /obj/item/bedsheet/rainbow = 3,
/obj/item/bedsheet/ian = 3, /obj/item/bedsheet/runtime = 3, /obj/item/bedsheet/nanotrasen = 3,
/obj/item/bedsheet/pirate = 1, /obj/item/bedsheet/cosmos = 1, /obj/item/bedsheet/gondola = 1
)
/obj/effect/spawner/lootdrop/armory_contraband
name = "armory contraband gun spawner"
lootdoubles = FALSE
loot = list(
/obj/item/gun/ballistic/automatic/pistol = 8,
/obj/item/gun/ballistic/shotgun/automatic/combat = 5,
/obj/item/gun/ballistic/revolver/mateba,
/obj/item/gun/ballistic/automatic/pistol/deagle
)
/obj/effect/spawner/lootdrop/armory_contraband/metastation
loot = list(/obj/item/gun/ballistic/automatic/pistol = 5,
/obj/item/gun/ballistic/shotgun/automatic/combat = 5,
/obj/item/gun/ballistic/revolver/mateba,
/obj/item/gun/ballistic/automatic/pistol/deagle,
/obj/item/storage/box/syndie_kit/throwing_weapons = 3)
/obj/effect/spawner/lootdrop/gambling
name = "gambling valuables spawner"
loot = list(
/obj/item/gun/ballistic/revolver/russian = 5,
/obj/item/storage/box/syndie_kit/throwing_weapons = 1,
/obj/item/toy/cards/deck/syndicate = 2
)
/obj/effect/spawner/lootdrop/grille_or_trash
name = "maint grille or trash spawner"
loot = list(/obj/structure/grille = 5,
/obj/item/cigbutt = 1,
/obj/item/trash/cheesie = 1,
/obj/item/trash/candy = 1,
/obj/item/trash/chips = 1,
/obj/item/reagent_containers/food/snacks/deadmouse = 1,
/obj/item/trash/pistachios = 1,
/obj/item/trash/plate = 1,
/obj/item/trash/popcorn = 1,
/obj/item/trash/raisins = 1,
/obj/item/trash/sosjerky = 1,
/obj/item/trash/syndi_cakes = 1)
/obj/effect/spawner/lootdrop/three_course_meal
name = "three course meal spawner"
lootcount = 3
lootdoubles = FALSE
var/soups = list(
/obj/item/reagent_containers/food/snacks/soup/beet,
/obj/item/reagent_containers/food/snacks/soup/sweetpotato,
/obj/item/reagent_containers/food/snacks/soup/stew,
/obj/item/reagent_containers/food/snacks/soup/hotchili,
/obj/item/reagent_containers/food/snacks/soup/nettle,
/obj/item/reagent_containers/food/snacks/soup/meatball)
var/salads = list(
/obj/item/reagent_containers/food/snacks/salad/herbsalad,
/obj/item/reagent_containers/food/snacks/salad/validsalad,
/obj/item/reagent_containers/food/snacks/salad/fruit,
/obj/item/reagent_containers/food/snacks/salad/jungle,
/obj/item/reagent_containers/food/snacks/salad/aesirsalad)
var/mains = list(
/obj/item/reagent_containers/food/snacks/bearsteak,
/obj/item/reagent_containers/food/snacks/enchiladas,
/obj/item/reagent_containers/food/snacks/stewedsoymeat,
/obj/item/reagent_containers/food/snacks/burger/bigbite,
/obj/item/reagent_containers/food/snacks/burger/superbite,
/obj/item/reagent_containers/food/snacks/burger/fivealarm)
/obj/effect/spawner/lootdrop/three_course_meal/Initialize(mapload)
loot = list(pick(soups) = 1,pick(salads) = 1,pick(mains) = 1)
. = ..()
/obj/effect/spawner/lootdrop/maintenance
name = "maintenance loot spawner"
// see code/_globalvars/lists/maintenance_loot.dm for loot table
/obj/effect/spawner/lootdrop/maintenance/Initialize(mapload)
loot = GLOB.maintenance_loot
. = ..()
/obj/effect/spawner/lootdrop/glowstick
name = "random colored glowstick"
icon = 'icons/obj/lighting.dmi'
icon_state = "random_glowstick"
/obj/effect/spawner/lootdrop/glowstick/Initialize()
loot = typesof(/obj/item/flashlight/glowstick)
. = ..()
/obj/effect/spawner/lootdrop/gloves
name = "random gloves"
desc = "These gloves are supposed to be a random color..."
icon = 'icons/obj/clothing/gloves.dmi'
icon_state = "random_gloves"
loot = list(
/obj/item/clothing/gloves/color/orange = 1,
/obj/item/clothing/gloves/color/red = 1,
/obj/item/clothing/gloves/color/blue = 1,
/obj/item/clothing/gloves/color/purple = 1,
/obj/item/clothing/gloves/color/green = 1,
/obj/item/clothing/gloves/color/grey = 1,
/obj/item/clothing/gloves/color/light_brown = 1,
/obj/item/clothing/gloves/color/brown = 1,
/obj/item/clothing/gloves/color/white = 1,
/obj/item/clothing/gloves/color/rainbow = 1)
/obj/effect/spawner/lootdrop/crate_spawner
name = "lootcrate spawner" //USE PROMO CODE "SELLOUT" FOR 20% OFF!
lootdoubles = FALSE
loot = list(
/obj/structure/closet/crate/secure/loot = 20,
"" = 80
)
/obj/effect/spawner/lootdrop/organ_spawner
name = "organ spawner"
loot = list(
/obj/item/organ/heart/gland/electric = 3,
/obj/item/organ/heart/gland/trauma = 4,
/obj/item/organ/heart/gland/egg = 7,
/obj/item/organ/heart/gland/chem = 5,
/obj/item/organ/heart/gland/mindshock = 5,
/obj/item/organ/heart/gland/plasma = 7,
/obj/item/organ/heart/gland/transform = 5,
/obj/item/organ/heart/gland/slime = 4,
/obj/item/organ/heart/gland/spiderman = 5,
/obj/item/organ/heart/gland/ventcrawling = 1,
/obj/item/organ/body_egg/alien_embryo = 1,
/obj/item/organ/regenerative_core = 2)
lootcount = 3
/obj/effect/spawner/lootdrop/two_percent_xeno_egg_spawner
name = "2% chance xeno egg spawner"
loot = list(
/obj/effect/decal/remains/xeno = 49,
/obj/effect/spawner/xeno_egg_delivery = 1)
/obj/effect/spawner/lootdrop/costume
name = "random costume spawner"
/obj/effect/spawner/lootdrop/costume/Initialize()
loot = list()
for(var/path in subtypesof(/obj/effect/spawner/bundle/costume))
loot[path] = TRUE
. = ..()
// Minor lootdrops follow
/obj/effect/spawner/lootdrop/minor/beret_or_rabbitears
name = "beret or rabbit ears spawner"
loot = list(
/obj/item/clothing/head/beret = 1,
/obj/item/clothing/head/rabbitears = 1)
/obj/effect/spawner/lootdrop/minor/bowler_or_that
name = "bowler or top hat spawner"
loot = list(
/obj/item/clothing/head/bowler = 1,
/obj/item/clothing/head/that = 1)
/obj/effect/spawner/lootdrop/minor/kittyears_or_rabbitears
name = "kitty ears or rabbit ears spawner"
loot = list(
/obj/item/clothing/head/kitty = 1,
/obj/item/clothing/head/rabbitears = 1)
/obj/effect/spawner/lootdrop/minor/pirate_or_bandana
name = "pirate hat or bandana spawner"
loot = list(
/obj/item/clothing/head/pirate = 1,
/obj/item/clothing/head/bandana = 1)
/obj/effect/spawner/lootdrop/minor/twentyfive_percent_cyborg_mask
name = "25% cyborg mask spawner"
loot = list(
/obj/item/clothing/mask/gas/cyborg = 25,
"" = 75)
/obj/effect/spawner/lootdrop/aimodule_harmless // These shouldn't allow the AI to start butchering people
name = "harmless AI module spawner"
loot = list(
/obj/item/aiModule/core/full/asimov,
/obj/item/aiModule/core/full/asimovpp,
/obj/item/aiModule/core/full/hippocratic,
/obj/item/aiModule/core/full/paladin_devotion,
/obj/item/aiModule/core/full/paladin
)
/obj/effect/spawner/lootdrop/aimodule_neutral // These shouldn't allow the AI to start butchering people without reason
name = "neutral AI module spawner"
loot = list(
/obj/item/aiModule/core/full/corp,
/obj/item/aiModule/core/full/maintain,
/obj/item/aiModule/core/full/drone,
/obj/item/aiModule/core/full/peacekeeper,
/obj/item/aiModule/core/full/reporter,
/obj/item/aiModule/core/full/robocop,
/obj/item/aiModule/core/full/liveandletlive,
/obj/item/aiModule/core/full/hulkamania
)
/obj/effect/spawner/lootdrop/aimodule_harmful // These will get the shuttle called
name = "harmful AI module spawner"
loot = list(
/obj/item/aiModule/core/full/antimov,
/obj/item/aiModule/core/full/balance,
/obj/item/aiModule/core/full/tyrant,
/obj/item/aiModule/core/full/thermurderdynamic,
/obj/item/aiModule/core/full/damaged
)
/obj/effect/spawner/lootdrop/mre
name = "random MRE"
icon = 'icons/obj/storage.dmi'
icon_state = "mre"
/obj/effect/spawner/lootdrop/mre/Initialize()
for(var/A in subtypesof(/obj/item/storage/box/mre))
var/obj/item/storage/box/mre/M = A
var/our_chance = initial(M.spawner_chance)
if(our_chance)
LAZYSET(loot, M, our_chance)
return ..()
// Tech storage circuit board spawners
// For these, make sure that lootcount equals the number of list items
/obj/effect/spawner/lootdrop/techstorage
name = "generic circuit board spawner"
lootdoubles = FALSE
fan_out_items = TRUE
/obj/effect/spawner/lootdrop/techstorage/service
name = "service circuit board spawner"
lootcount = 10
loot = list(
/obj/item/circuitboard/computer/arcade/battle,
/obj/item/circuitboard/computer/arcade/orion_trail,
/obj/item/circuitboard/machine/autolathe,
/obj/item/circuitboard/computer/mining,
/obj/item/circuitboard/machine/ore_redemption,
/obj/item/circuitboard/machine/mining_equipment_vendor,
/obj/item/circuitboard/machine/microwave,
/obj/item/circuitboard/machine/chem_dispenser/drinks,
/obj/item/circuitboard/machine/chem_dispenser/drinks/beer,
/obj/item/circuitboard/computer/slot_machine
)
/obj/effect/spawner/lootdrop/techstorage/rnd
name = "RnD circuit board spawner"
lootcount = 8
loot = list(
/obj/item/circuitboard/computer/aifixer,
/obj/item/circuitboard/machine/rdserver,
/obj/item/circuitboard/computer/pandemic,
/obj/item/circuitboard/machine/mechfab,
/obj/item/circuitboard/machine/circuit_imprinter/department,
/obj/item/circuitboard/computer/teleporter,
/obj/item/circuitboard/machine/destructive_analyzer,
/obj/item/circuitboard/computer/rdconsole
)
/obj/effect/spawner/lootdrop/techstorage/security
name = "security circuit board spawner"
lootcount = 3
loot = list(
/obj/item/circuitboard/computer/secure_data,
/obj/item/circuitboard/computer/security,
/obj/item/circuitboard/computer/prisoner
)
/obj/effect/spawner/lootdrop/techstorage/engineering
name = "engineering circuit board spawner"
lootcount = 3
loot = list(
/obj/item/circuitboard/computer/atmos_alert,
/obj/item/circuitboard/computer/stationalert,
/obj/item/circuitboard/computer/powermonitor
)
/obj/effect/spawner/lootdrop/techstorage/tcomms
name = "tcomms circuit board spawner"
lootcount = 9
loot = list(
/obj/item/circuitboard/computer/message_monitor,
/obj/item/circuitboard/machine/telecomms/broadcaster,
/obj/item/circuitboard/machine/telecomms/bus,
/obj/item/circuitboard/machine/telecomms/server,
/obj/item/circuitboard/machine/telecomms/receiver,
/obj/item/circuitboard/machine/telecomms/processor,
/obj/item/circuitboard/machine/announcement_system,
/obj/item/circuitboard/computer/comm_server,
/obj/item/circuitboard/computer/comm_monitor
)
/obj/effect/spawner/lootdrop/techstorage/medical
name = "medical circuit board spawner"
lootcount = 8
loot = list(
/obj/item/circuitboard/computer/cloning,
/obj/item/circuitboard/machine/clonepod,
/obj/item/circuitboard/machine/chem_dispenser,
/obj/item/circuitboard/computer/scan_consolenew,
/obj/item/circuitboard/computer/med_data,
/obj/item/circuitboard/machine/smoke_machine,
/obj/item/circuitboard/machine/chem_master,
/obj/item/circuitboard/machine/clonescanner
)
/obj/effect/spawner/lootdrop/techstorage/AI
name = "secure AI circuit board spawner"
lootcount = 3
loot = list(
/obj/item/circuitboard/computer/aiupload,
/obj/item/circuitboard/computer/borgupload,
/obj/item/circuitboard/aicore
)
/obj/effect/spawner/lootdrop/techstorage/command
name = "secure command circuit board spawner"
lootcount = 3
loot = list(
/obj/item/circuitboard/computer/crew,
/obj/item/circuitboard/computer/communications,
/obj/item/circuitboard/computer/card
)
/obj/effect/spawner/lootdrop/techstorage/RnD_secure
name = "secure RnD circuit board spawner"
lootcount = 3
loot = list(
/obj/item/circuitboard/computer/mecha_control,
/obj/item/circuitboard/computer/apc_control,
/obj/item/circuitboard/computer/robotics
)
/obj/effect/spawner/lootdrop
icon = 'icons/effects/landmarks_static.dmi'
icon_state = "random_loot"
layer = OBJ_LAYER
var/lootcount = 1 //how many items will be spawned
var/lootdoubles = TRUE //if the same item can be spawned twice
var/list/loot //a list of possible items to spawn e.g. list(/obj/item, /obj/structure, /obj/effect)
var/fan_out_items = FALSE //Whether the items should be distributed to offsets 0,1,-1,2,-2,3,-3.. This overrides pixel_x/y on the spawner itself
/obj/effect/spawner/lootdrop/Initialize(mapload)
..()
if(loot && loot.len)
var/turf/T = get_turf(src)
var/loot_spawned = 0
while((lootcount-loot_spawned) && loot.len)
var/lootspawn = pickweight(loot)
if(!lootdoubles)
loot.Remove(lootspawn)
if(lootspawn)
var/atom/movable/spawned_loot = new lootspawn(T)
if (!fan_out_items)
if (pixel_x != 0)
spawned_loot.pixel_x = pixel_x
if (pixel_y != 0)
spawned_loot.pixel_y = pixel_y
else
if (loot_spawned)
spawned_loot.pixel_x = spawned_loot.pixel_y = ((!(loot_spawned%2)*loot_spawned/2)*-1)+((loot_spawned%2)*(loot_spawned+1)/2*1)
loot_spawned++
return INITIALIZE_HINT_QDEL
/obj/effect/spawner/lootdrop/bedsheet
icon = 'icons/obj/bedsheets.dmi'
icon_state = "random_bedsheet"
name = "random dorms bedsheet"
loot = list(/obj/item/bedsheet = 8, /obj/item/bedsheet/blue = 8, /obj/item/bedsheet/green = 8,
/obj/item/bedsheet/grey = 8, /obj/item/bedsheet/orange = 8, /obj/item/bedsheet/purple = 8,
/obj/item/bedsheet/red = 8, /obj/item/bedsheet/yellow = 8, /obj/item/bedsheet/brown = 8,
/obj/item/bedsheet/black = 8, /obj/item/bedsheet/patriot = 3, /obj/item/bedsheet/rainbow = 3,
/obj/item/bedsheet/ian = 3, /obj/item/bedsheet/runtime = 3, /obj/item/bedsheet/nanotrasen = 3,
/obj/item/bedsheet/pirate = 1, /obj/item/bedsheet/cosmos = 1, /obj/item/bedsheet/gondola = 1
)
/obj/effect/spawner/lootdrop/armory_contraband
name = "armory contraband gun spawner"
lootdoubles = FALSE
loot = list(
/obj/item/gun/ballistic/automatic/pistol = 8,
/obj/item/gun/ballistic/shotgun/automatic/combat = 5,
/obj/item/gun/ballistic/revolver/mateba,
/obj/item/gun/ballistic/automatic/pistol/deagle
)
/obj/effect/spawner/lootdrop/armory_contraband/metastation
loot = list(/obj/item/gun/ballistic/automatic/pistol = 5,
/obj/item/gun/ballistic/shotgun/automatic/combat = 5,
/obj/item/gun/ballistic/revolver/mateba,
/obj/item/gun/ballistic/automatic/pistol/deagle,
/obj/item/storage/box/syndie_kit/throwing_weapons = 3)
/obj/effect/spawner/lootdrop/gambling
name = "gambling valuables spawner"
loot = list(
/obj/item/gun/ballistic/revolver/russian = 5,
/obj/item/storage/box/syndie_kit/throwing_weapons = 1,
/obj/item/toy/cards/deck/syndicate = 2
)
/obj/effect/spawner/lootdrop/grille_or_trash
name = "maint grille or trash spawner"
loot = list(/obj/structure/grille = 5,
/obj/item/cigbutt = 1,
/obj/item/trash/cheesie = 1,
/obj/item/trash/candy = 1,
/obj/item/trash/chips = 1,
/obj/item/reagent_containers/food/snacks/deadmouse = 1,
/obj/item/trash/pistachios = 1,
/obj/item/trash/plate = 1,
/obj/item/trash/popcorn = 1,
/obj/item/trash/raisins = 1,
/obj/item/trash/sosjerky = 1,
/obj/item/trash/syndi_cakes = 1)
/obj/effect/spawner/lootdrop/three_course_meal
name = "three course meal spawner"
lootcount = 3
lootdoubles = FALSE
var/soups = list(
/obj/item/reagent_containers/food/snacks/soup/beet,
/obj/item/reagent_containers/food/snacks/soup/sweetpotato,
/obj/item/reagent_containers/food/snacks/soup/stew,
/obj/item/reagent_containers/food/snacks/soup/hotchili,
/obj/item/reagent_containers/food/snacks/soup/nettle,
/obj/item/reagent_containers/food/snacks/soup/meatball)
var/salads = list(
/obj/item/reagent_containers/food/snacks/salad/herbsalad,
/obj/item/reagent_containers/food/snacks/salad/validsalad,
/obj/item/reagent_containers/food/snacks/salad/fruit,
/obj/item/reagent_containers/food/snacks/salad/jungle,
/obj/item/reagent_containers/food/snacks/salad/aesirsalad)
var/mains = list(
/obj/item/reagent_containers/food/snacks/bearsteak,
/obj/item/reagent_containers/food/snacks/enchiladas,
/obj/item/reagent_containers/food/snacks/stewedsoymeat,
/obj/item/reagent_containers/food/snacks/burger/bigbite,
/obj/item/reagent_containers/food/snacks/burger/superbite,
/obj/item/reagent_containers/food/snacks/burger/fivealarm)
/obj/effect/spawner/lootdrop/three_course_meal/Initialize(mapload)
loot = list(pick(soups) = 1,pick(salads) = 1,pick(mains) = 1)
. = ..()
/obj/effect/spawner/lootdrop/maintenance
name = "maintenance loot spawner"
// see code/_globalvars/lists/maintenance_loot.dm for loot table
/obj/effect/spawner/lootdrop/maintenance/Initialize(mapload)
loot = GLOB.maintenance_loot
. = ..()
/obj/effect/spawner/lootdrop/glowstick
name = "random colored glowstick"
icon = 'icons/obj/lighting.dmi'
icon_state = "random_glowstick"
/obj/effect/spawner/lootdrop/glowstick/Initialize()
loot = typesof(/obj/item/flashlight/glowstick)
. = ..()
/obj/effect/spawner/lootdrop/gloves
name = "random gloves"
desc = "These gloves are supposed to be a random color..."
icon = 'icons/obj/clothing/gloves.dmi'
icon_state = "random_gloves"
loot = list(
/obj/item/clothing/gloves/color/orange = 1,
/obj/item/clothing/gloves/color/red = 1,
/obj/item/clothing/gloves/color/blue = 1,
/obj/item/clothing/gloves/color/purple = 1,
/obj/item/clothing/gloves/color/green = 1,
/obj/item/clothing/gloves/color/grey = 1,
/obj/item/clothing/gloves/color/light_brown = 1,
/obj/item/clothing/gloves/color/brown = 1,
/obj/item/clothing/gloves/color/white = 1,
/obj/item/clothing/gloves/color/rainbow = 1)
/obj/effect/spawner/lootdrop/crate_spawner
name = "lootcrate spawner" //USE PROMO CODE "SELLOUT" FOR 20% OFF!
lootdoubles = FALSE
loot = list(
/obj/structure/closet/crate/secure/loot = 20,
"" = 80
)
/obj/effect/spawner/lootdrop/organ_spawner
name = "organ spawner"
loot = list(
/obj/item/organ/heart/gland/electric = 3,
/obj/item/organ/heart/gland/trauma = 4,
/obj/item/organ/heart/gland/egg = 7,
/obj/item/organ/heart/gland/chem = 5,
/obj/item/organ/heart/gland/mindshock = 5,
/obj/item/organ/heart/gland/plasma = 7,
/obj/item/organ/heart/gland/transform = 5,
/obj/item/organ/heart/gland/slime = 4,
/obj/item/organ/heart/gland/spiderman = 5,
/obj/item/organ/heart/gland/ventcrawling = 1,
/obj/item/organ/body_egg/alien_embryo = 1,
/obj/item/organ/regenerative_core = 2)
lootcount = 3
/obj/effect/spawner/lootdrop/two_percent_xeno_egg_spawner
name = "2% chance xeno egg spawner"
loot = list(
/obj/effect/decal/remains/xeno = 49,
/obj/effect/spawner/xeno_egg_delivery = 1)
/obj/effect/spawner/lootdrop/costume
name = "random costume spawner"
/obj/effect/spawner/lootdrop/costume/Initialize()
loot = list()
for(var/path in subtypesof(/obj/effect/spawner/bundle/costume))
loot[path] = TRUE
. = ..()
// Minor lootdrops follow
/obj/effect/spawner/lootdrop/minor/beret_or_rabbitears
name = "beret or rabbit ears spawner"
loot = list(
/obj/item/clothing/head/beret = 1,
/obj/item/clothing/head/rabbitears = 1)
/obj/effect/spawner/lootdrop/minor/bowler_or_that
name = "bowler or top hat spawner"
loot = list(
/obj/item/clothing/head/bowler = 1,
/obj/item/clothing/head/that = 1)
/obj/effect/spawner/lootdrop/minor/kittyears_or_rabbitears
name = "kitty ears or rabbit ears spawner"
loot = list(
/obj/item/clothing/head/kitty = 1,
/obj/item/clothing/head/rabbitears = 1)
/obj/effect/spawner/lootdrop/minor/pirate_or_bandana
name = "pirate hat or bandana spawner"
loot = list(
/obj/item/clothing/head/pirate = 1,
/obj/item/clothing/head/bandana = 1)
/obj/effect/spawner/lootdrop/minor/twentyfive_percent_cyborg_mask
name = "25% cyborg mask spawner"
loot = list(
/obj/item/clothing/mask/gas/cyborg = 25,
"" = 75)
/obj/effect/spawner/lootdrop/aimodule_harmless // These shouldn't allow the AI to start butchering people
name = "harmless AI module spawner"
loot = list(
/obj/item/aiModule/core/full/asimov,
/obj/item/aiModule/core/full/asimovpp,
/obj/item/aiModule/core/full/hippocratic,
/obj/item/aiModule/core/full/paladin_devotion,
/obj/item/aiModule/core/full/paladin
)
/obj/effect/spawner/lootdrop/aimodule_neutral // These shouldn't allow the AI to start butchering people without reason
name = "neutral AI module spawner"
loot = list(
/obj/item/aiModule/core/full/corp,
/obj/item/aiModule/core/full/maintain,
/obj/item/aiModule/core/full/drone,
/obj/item/aiModule/core/full/peacekeeper,
/obj/item/aiModule/core/full/reporter,
/obj/item/aiModule/core/full/robocop,
/obj/item/aiModule/core/full/liveandletlive,
/obj/item/aiModule/core/full/hulkamania
)
/obj/effect/spawner/lootdrop/aimodule_harmful // These will get the shuttle called
name = "harmful AI module spawner"
loot = list(
/obj/item/aiModule/core/full/antimov,
/obj/item/aiModule/core/full/balance,
/obj/item/aiModule/core/full/tyrant,
/obj/item/aiModule/core/full/thermurderdynamic,
/obj/item/aiModule/core/full/damaged
)
/obj/effect/spawner/lootdrop/mre
name = "random MRE"
icon = 'icons/obj/storage.dmi'
icon_state = "mre"
/obj/effect/spawner/lootdrop/mre/Initialize()
for(var/A in subtypesof(/obj/item/storage/box/mre))
var/obj/item/storage/box/mre/M = A
var/our_chance = initial(M.spawner_chance)
if(our_chance)
LAZYSET(loot, M, our_chance)
return ..()
// Tech storage circuit board spawners
// For these, make sure that lootcount equals the number of list items
/obj/effect/spawner/lootdrop/techstorage
name = "generic circuit board spawner"
lootdoubles = FALSE
fan_out_items = TRUE
/obj/effect/spawner/lootdrop/techstorage/service
name = "service circuit board spawner"
lootcount = 10
loot = list(
/obj/item/circuitboard/computer/arcade/battle,
/obj/item/circuitboard/computer/arcade/orion_trail,
/obj/item/circuitboard/machine/autolathe,
/obj/item/circuitboard/computer/mining,
/obj/item/circuitboard/machine/ore_redemption,
/obj/item/circuitboard/machine/mining_equipment_vendor,
/obj/item/circuitboard/machine/microwave,
/obj/item/circuitboard/machine/chem_dispenser/drinks,
/obj/item/circuitboard/machine/chem_dispenser/drinks/beer,
/obj/item/circuitboard/computer/slot_machine
)
/obj/effect/spawner/lootdrop/techstorage/rnd
name = "RnD circuit board spawner"
lootcount = 8
loot = list(
/obj/item/circuitboard/computer/aifixer,
/obj/item/circuitboard/machine/rdserver,
/obj/item/circuitboard/computer/pandemic,
/obj/item/circuitboard/machine/mechfab,
/obj/item/circuitboard/machine/circuit_imprinter/department,
/obj/item/circuitboard/computer/teleporter,
/obj/item/circuitboard/machine/destructive_analyzer,
/obj/item/circuitboard/computer/rdconsole
)
/obj/effect/spawner/lootdrop/techstorage/security
name = "security circuit board spawner"
lootcount = 3
loot = list(
/obj/item/circuitboard/computer/secure_data,
/obj/item/circuitboard/computer/security,
/obj/item/circuitboard/computer/prisoner
)
/obj/effect/spawner/lootdrop/techstorage/engineering
name = "engineering circuit board spawner"
lootcount = 3
loot = list(
/obj/item/circuitboard/computer/atmos_alert,
/obj/item/circuitboard/computer/stationalert,
/obj/item/circuitboard/computer/powermonitor
)
/obj/effect/spawner/lootdrop/techstorage/tcomms
name = "tcomms circuit board spawner"
lootcount = 9
loot = list(
/obj/item/circuitboard/computer/message_monitor,
/obj/item/circuitboard/machine/telecomms/broadcaster,
/obj/item/circuitboard/machine/telecomms/bus,
/obj/item/circuitboard/machine/telecomms/server,
/obj/item/circuitboard/machine/telecomms/receiver,
/obj/item/circuitboard/machine/telecomms/processor,
/obj/item/circuitboard/machine/announcement_system,
/obj/item/circuitboard/computer/comm_server,
/obj/item/circuitboard/computer/comm_monitor
)
/obj/effect/spawner/lootdrop/techstorage/medical
name = "medical circuit board spawner"
lootcount = 8
loot = list(
/obj/item/circuitboard/computer/cloning,
/obj/item/circuitboard/machine/clonepod,
/obj/item/circuitboard/machine/chem_dispenser,
/obj/item/circuitboard/computer/scan_consolenew,
/obj/item/circuitboard/computer/med_data,
/obj/item/circuitboard/machine/smoke_machine,
/obj/item/circuitboard/machine/chem_master,
/obj/item/circuitboard/machine/clonescanner
)
/obj/effect/spawner/lootdrop/techstorage/AI
name = "secure AI circuit board spawner"
lootcount = 3
loot = list(
/obj/item/circuitboard/computer/aiupload,
/obj/item/circuitboard/computer/borgupload,
/obj/item/circuitboard/aicore
)
/obj/effect/spawner/lootdrop/techstorage/command
name = "secure command circuit board spawner"
lootcount = 3
loot = list(
/obj/item/circuitboard/computer/crew,
/obj/item/circuitboard/computer/communications,
/obj/item/circuitboard/computer/card
)
/obj/effect/spawner/lootdrop/techstorage/RnD_secure
name = "secure RnD circuit board spawner"
lootcount = 3
loot = list(
/obj/item/circuitboard/computer/mecha_control,
/obj/item/circuitboard/computer/apc_control,
/obj/item/circuitboard/computer/robotics
)
+237 -237
View File
@@ -1,237 +1,237 @@
//generic procs copied from obj/effect/alien
/obj/structure/spider
name = "web"
icon = 'icons/effects/effects.dmi'
desc = "It's stringy and sticky."
anchored = TRUE
density = FALSE
max_integrity = 15
/obj/structure/spider/play_attack_sound(damage_amount, damage_type = BRUTE, damage_flag = 0)
if(damage_type == BURN)//the stickiness of the web mutes all attack sounds except fire damage type
playsound(loc, 'sound/items/welder.ogg', 100, 1)
/obj/structure/spider/run_obj_armor(damage_amount, damage_type, damage_flag = 0, attack_dir)
if(damage_flag == "melee")
switch(damage_type)
if(BURN)
damage_amount *= 2
if(BRUTE)
damage_amount *= 0.25
. = ..()
/obj/structure/spider/temperature_expose(datum/gas_mixture/air, exposed_temperature, exposed_volume)
if(exposed_temperature > 300)
take_damage(5, BURN, 0, 0)
/obj/structure/spider/stickyweb
icon_state = "stickyweb1"
/obj/structure/spider/stickyweb/Initialize()
if(prob(50))
icon_state = "stickyweb2"
. = ..()
/obj/structure/spider/stickyweb/CanPass(atom/movable/mover, turf/target)
if(istype(mover, /mob/living/simple_animal/hostile/poison/giant_spider))
return TRUE
else if(isliving(mover))
if(istype(mover.pulledby, /mob/living/simple_animal/hostile/poison/giant_spider))
return TRUE
if(prob(50))
to_chat(mover, "<span class='danger'>You get stuck in \the [src] for a moment.</span>")
return FALSE
else if(istype(mover, /obj/item/projectile))
return prob(30)
return TRUE
/obj/structure/spider/eggcluster
name = "egg cluster"
desc = "They seem to pulse slightly with an inner life."
icon_state = "eggs"
var/amount_grown = 0
var/player_spiders = 0
var/directive = "" //Message from the mother
var/poison_type = "toxin"
var/poison_per_bite = 5
var/list/faction = list("spiders")
/obj/structure/spider/eggcluster/Initialize()
pixel_x = rand(3,-3)
pixel_y = rand(3,-3)
START_PROCESSING(SSobj, src)
. = ..()
/obj/structure/spider/eggcluster/process()
amount_grown += rand(0,2)
if(amount_grown >= 100)
var/num = rand(3,12)
for(var/i=0, i<num, i++)
var/obj/structure/spider/spiderling/S = new /obj/structure/spider/spiderling(src.loc)
S.poison_type = poison_type
S.poison_per_bite = poison_per_bite
S.faction = faction.Copy()
S.directive = directive
if(player_spiders)
S.player_spiders = 1
qdel(src)
/obj/structure/spider/spiderling
name = "spiderling"
desc = "It never stays still for long."
icon_state = "spiderling"
anchored = FALSE
layer = PROJECTILE_HIT_THRESHHOLD_LAYER
max_integrity = 3
var/amount_grown = 0
var/grow_as = null
var/obj/machinery/atmospherics/components/unary/vent_pump/entry_vent
var/travelling_in_vent = 0
var/player_spiders = 0
var/directive = "" //Message from the mother
var/poison_type = "toxin"
var/poison_per_bite = 5
var/list/faction = list("spiders")
/obj/structure/spider/spiderling/Destroy()
new/obj/item/reagent_containers/food/snacks/spiderling(get_turf(src))
. = ..()
/obj/structure/spider/spiderling/Initialize()
. = ..()
pixel_x = rand(6,-6)
pixel_y = rand(6,-6)
START_PROCESSING(SSobj, src)
AddComponent(/datum/component/swarming)
/obj/structure/spider/spiderling/hunter
grow_as = /mob/living/simple_animal/hostile/poison/giant_spider/hunter
/obj/structure/spider/spiderling/nurse
grow_as = /mob/living/simple_animal/hostile/poison/giant_spider/nurse
/obj/structure/spider/spiderling/midwife
grow_as = /mob/living/simple_animal/hostile/poison/giant_spider/nurse/midwife
/obj/structure/spider/spiderling/viper
grow_as = /mob/living/simple_animal/hostile/poison/giant_spider/hunter/viper
/obj/structure/spider/spiderling/tarantula
grow_as = /mob/living/simple_animal/hostile/poison/giant_spider/tarantula
/obj/structure/spider/spiderling/Bump(atom/user)
if(istype(user, /obj/structure/table))
forceMove(user.loc)
else
..()
/obj/structure/spider/spiderling/process()
if(travelling_in_vent)
if(isturf(loc))
travelling_in_vent = 0
entry_vent = null
else if(entry_vent)
if(get_dist(src, entry_vent) <= 1)
var/list/vents = list()
var/datum/pipeline/entry_vent_parent = entry_vent.parents[1]
for(var/obj/machinery/atmospherics/components/unary/vent_pump/temp_vent in entry_vent_parent.other_atmosmch)
vents.Add(temp_vent)
if(!vents.len)
entry_vent = null
return
var/obj/machinery/atmospherics/components/unary/vent_pump/exit_vent = pick(vents)
if(prob(50))
visible_message("<B>[src] scrambles into the ventilation ducts!</B>", \
"<span class='italics'>You hear something scampering through the ventilation ducts.</span>")
spawn(rand(20,60))
forceMove(exit_vent)
var/travel_time = round(get_dist(loc, exit_vent.loc) / 2)
spawn(travel_time)
if(!exit_vent || exit_vent.welded)
forceMove(entry_vent)
entry_vent = null
return
if(prob(50))
audible_message("<span class='italics'>You hear something scampering through the ventilation ducts.</span>")
sleep(travel_time)
if(!exit_vent || exit_vent.welded)
forceMove(entry_vent)
entry_vent = null
return
forceMove(exit_vent.loc)
entry_vent = null
var/area/new_area = get_area(loc)
if(new_area)
new_area.Entered(src)
//=================
else if(prob(33))
var/list/nearby = oview(10, src)
if(nearby.len)
var/target_atom = pick(nearby)
walk_to(src, target_atom)
if(prob(40))
src.visible_message("<span class='notice'>\The [src] skitters[pick(" away"," around","")].</span>")
else if(prob(10))
//ventcrawl!
for(var/obj/machinery/atmospherics/components/unary/vent_pump/v in view(7,src))
if(!v.welded)
entry_vent = v
walk_to(src, entry_vent, 1)
break
if(isturf(loc))
amount_grown += rand(0,2)
if(amount_grown >= 100)
if(!grow_as)
if(prob(3))
grow_as = pick(/mob/living/simple_animal/hostile/poison/giant_spider/tarantula, /mob/living/simple_animal/hostile/poison/giant_spider/hunter/viper, /mob/living/simple_animal/hostile/poison/giant_spider/nurse/midwife)
else
grow_as = pick(/mob/living/simple_animal/hostile/poison/giant_spider, /mob/living/simple_animal/hostile/poison/giant_spider/hunter, /mob/living/simple_animal/hostile/poison/giant_spider/nurse)
var/mob/living/simple_animal/hostile/poison/giant_spider/S = new grow_as(src.loc)
S.poison_per_bite = poison_per_bite
S.poison_type = poison_type
S.faction = faction.Copy()
S.directive = directive
if(player_spiders)
S.playable_spider = TRUE
notify_ghosts("Spider [S.name] can be controlled", null, enter_link="<a href=?src=[REF(S)];activate=1>(Click to play)</a>", source=S, action=NOTIFY_ATTACK, ignore_key = POLL_IGNORE_SPIDER, ignore_dnr_observers = TRUE)
qdel(src)
/obj/structure/spider/cocoon
name = "cocoon"
desc = "Something wrapped in silky spider web."
icon_state = "cocoon1"
max_integrity = 60
/obj/structure/spider/cocoon/Initialize()
icon_state = pick("cocoon1","cocoon2","cocoon3")
. = ..()
/obj/structure/spider/cocoon/container_resist(mob/living/user)
var/breakout_time = 600
user.changeNext_move(CLICK_CD_BREAKOUT)
user.last_special = world.time + CLICK_CD_BREAKOUT
to_chat(user, "<span class='notice'>You struggle against the tight bonds... (This will take about [DisplayTimeText(breakout_time)].)</span>")
visible_message("You see something struggling and writhing in \the [src]!")
if(do_after(user,(breakout_time), target = src))
if(!user || user.stat != CONSCIOUS || user.loc != src)
return
qdel(src)
/obj/structure/spider/cocoon/Destroy()
var/turf/T = get_turf(src)
src.visible_message("<span class='warning'>\The [src] splits open.</span>")
for(var/atom/movable/A in contents)
A.forceMove(T)
return ..()
//generic procs copied from obj/effect/alien
/obj/structure/spider
name = "web"
icon = 'icons/effects/effects.dmi'
desc = "It's stringy and sticky."
anchored = TRUE
density = FALSE
max_integrity = 15
/obj/structure/spider/play_attack_sound(damage_amount, damage_type = BRUTE, damage_flag = 0)
if(damage_type == BURN)//the stickiness of the web mutes all attack sounds except fire damage type
playsound(loc, 'sound/items/welder.ogg', 100, 1)
/obj/structure/spider/run_obj_armor(damage_amount, damage_type, damage_flag = 0, attack_dir)
if(damage_flag == "melee")
switch(damage_type)
if(BURN)
damage_amount *= 2
if(BRUTE)
damage_amount *= 0.25
. = ..()
/obj/structure/spider/temperature_expose(datum/gas_mixture/air, exposed_temperature, exposed_volume)
if(exposed_temperature > 300)
take_damage(5, BURN, 0, 0)
/obj/structure/spider/stickyweb
icon_state = "stickyweb1"
/obj/structure/spider/stickyweb/Initialize()
if(prob(50))
icon_state = "stickyweb2"
. = ..()
/obj/structure/spider/stickyweb/CanPass(atom/movable/mover, turf/target)
if(istype(mover, /mob/living/simple_animal/hostile/poison/giant_spider))
return TRUE
else if(isliving(mover))
if(istype(mover.pulledby, /mob/living/simple_animal/hostile/poison/giant_spider))
return TRUE
if(prob(50))
to_chat(mover, "<span class='danger'>You get stuck in \the [src] for a moment.</span>")
return FALSE
else if(istype(mover, /obj/item/projectile))
return prob(30)
return TRUE
/obj/structure/spider/eggcluster
name = "egg cluster"
desc = "They seem to pulse slightly with an inner life."
icon_state = "eggs"
var/amount_grown = 0
var/player_spiders = 0
var/directive = "" //Message from the mother
var/poison_type = "toxin"
var/poison_per_bite = 5
var/list/faction = list("spiders")
/obj/structure/spider/eggcluster/Initialize()
pixel_x = rand(3,-3)
pixel_y = rand(3,-3)
START_PROCESSING(SSobj, src)
. = ..()
/obj/structure/spider/eggcluster/process()
amount_grown += rand(0,2)
if(amount_grown >= 100)
var/num = rand(3,12)
for(var/i=0, i<num, i++)
var/obj/structure/spider/spiderling/S = new /obj/structure/spider/spiderling(src.loc)
S.poison_type = poison_type
S.poison_per_bite = poison_per_bite
S.faction = faction.Copy()
S.directive = directive
if(player_spiders)
S.player_spiders = 1
qdel(src)
/obj/structure/spider/spiderling
name = "spiderling"
desc = "It never stays still for long."
icon_state = "spiderling"
anchored = FALSE
layer = PROJECTILE_HIT_THRESHHOLD_LAYER
max_integrity = 3
var/amount_grown = 0
var/grow_as = null
var/obj/machinery/atmospherics/components/unary/vent_pump/entry_vent
var/travelling_in_vent = 0
var/player_spiders = 0
var/directive = "" //Message from the mother
var/poison_type = "toxin"
var/poison_per_bite = 5
var/list/faction = list("spiders")
/obj/structure/spider/spiderling/Destroy()
new/obj/item/reagent_containers/food/snacks/spiderling(get_turf(src))
. = ..()
/obj/structure/spider/spiderling/Initialize()
. = ..()
pixel_x = rand(6,-6)
pixel_y = rand(6,-6)
START_PROCESSING(SSobj, src)
AddComponent(/datum/component/swarming)
/obj/structure/spider/spiderling/hunter
grow_as = /mob/living/simple_animal/hostile/poison/giant_spider/hunter
/obj/structure/spider/spiderling/nurse
grow_as = /mob/living/simple_animal/hostile/poison/giant_spider/nurse
/obj/structure/spider/spiderling/midwife
grow_as = /mob/living/simple_animal/hostile/poison/giant_spider/nurse/midwife
/obj/structure/spider/spiderling/viper
grow_as = /mob/living/simple_animal/hostile/poison/giant_spider/hunter/viper
/obj/structure/spider/spiderling/tarantula
grow_as = /mob/living/simple_animal/hostile/poison/giant_spider/tarantula
/obj/structure/spider/spiderling/Bump(atom/user)
if(istype(user, /obj/structure/table))
forceMove(user.loc)
else
..()
/obj/structure/spider/spiderling/process()
if(travelling_in_vent)
if(isturf(loc))
travelling_in_vent = 0
entry_vent = null
else if(entry_vent)
if(get_dist(src, entry_vent) <= 1)
var/list/vents = list()
var/datum/pipeline/entry_vent_parent = entry_vent.parents[1]
for(var/obj/machinery/atmospherics/components/unary/vent_pump/temp_vent in entry_vent_parent.other_atmosmch)
vents.Add(temp_vent)
if(!vents.len)
entry_vent = null
return
var/obj/machinery/atmospherics/components/unary/vent_pump/exit_vent = pick(vents)
if(prob(50))
visible_message("<B>[src] scrambles into the ventilation ducts!</B>", \
"<span class='italics'>You hear something scampering through the ventilation ducts.</span>")
spawn(rand(20,60))
forceMove(exit_vent)
var/travel_time = round(get_dist(loc, exit_vent.loc) / 2)
spawn(travel_time)
if(!exit_vent || exit_vent.welded)
forceMove(entry_vent)
entry_vent = null
return
if(prob(50))
audible_message("<span class='italics'>You hear something scampering through the ventilation ducts.</span>")
sleep(travel_time)
if(!exit_vent || exit_vent.welded)
forceMove(entry_vent)
entry_vent = null
return
forceMove(exit_vent.loc)
entry_vent = null
var/area/new_area = get_area(loc)
if(new_area)
new_area.Entered(src)
//=================
else if(prob(33))
var/list/nearby = oview(10, src)
if(nearby.len)
var/target_atom = pick(nearby)
walk_to(src, target_atom)
if(prob(40))
src.visible_message("<span class='notice'>\The [src] skitters[pick(" away"," around","")].</span>")
else if(prob(10))
//ventcrawl!
for(var/obj/machinery/atmospherics/components/unary/vent_pump/v in view(7,src))
if(!v.welded)
entry_vent = v
walk_to(src, entry_vent, 1)
break
if(isturf(loc))
amount_grown += rand(0,2)
if(amount_grown >= 100)
if(!grow_as)
if(prob(3))
grow_as = pick(/mob/living/simple_animal/hostile/poison/giant_spider/tarantula, /mob/living/simple_animal/hostile/poison/giant_spider/hunter/viper, /mob/living/simple_animal/hostile/poison/giant_spider/nurse/midwife)
else
grow_as = pick(/mob/living/simple_animal/hostile/poison/giant_spider, /mob/living/simple_animal/hostile/poison/giant_spider/hunter, /mob/living/simple_animal/hostile/poison/giant_spider/nurse)
var/mob/living/simple_animal/hostile/poison/giant_spider/S = new grow_as(src.loc)
S.poison_per_bite = poison_per_bite
S.poison_type = poison_type
S.faction = faction.Copy()
S.directive = directive
if(player_spiders)
S.playable_spider = TRUE
notify_ghosts("Spider [S.name] can be controlled", null, enter_link="<a href=?src=[REF(S)];activate=1>(Click to play)</a>", source=S, action=NOTIFY_ATTACK, ignore_key = POLL_IGNORE_SPIDER, ignore_dnr_observers = TRUE)
qdel(src)
/obj/structure/spider/cocoon
name = "cocoon"
desc = "Something wrapped in silky spider web."
icon_state = "cocoon1"
max_integrity = 60
/obj/structure/spider/cocoon/Initialize()
icon_state = pick("cocoon1","cocoon2","cocoon3")
. = ..()
/obj/structure/spider/cocoon/container_resist(mob/living/user)
var/breakout_time = 600
user.changeNext_move(CLICK_CD_BREAKOUT)
user.last_special = world.time + CLICK_CD_BREAKOUT
to_chat(user, "<span class='notice'>You struggle against the tight bonds... (This will take about [DisplayTimeText(breakout_time)].)</span>")
visible_message("You see something struggling and writhing in \the [src]!")
if(do_after(user,(breakout_time), target = src))
if(!user || user.stat != CONSCIOUS || user.loc != src)
return
qdel(src)
/obj/structure/spider/cocoon/Destroy()
var/turf/T = get_turf(src)
src.visible_message("<span class='warning'>\The [src] splits open.</span>")
for(var/atom/movable/A in contents)
A.forceMove(T)
return ..()
+199 -199
View File
@@ -1,199 +1,199 @@
/* Simple object type, calls a proc when "stepped" on by something */
/obj/effect/step_trigger
var/affect_ghosts = 0
var/stopper = 1 // stops throwers
var/mobs_only = FALSE
invisibility = INVISIBILITY_ABSTRACT // nope cant see this shit
anchored = TRUE
/obj/effect/step_trigger/proc/Trigger(atom/movable/A)
return 0
/obj/effect/step_trigger/Crossed(H as mob|obj)
..()
if(!H)
return
if(isobserver(H) && !affect_ghosts)
return
if(!ismob(H) && mobs_only)
return
Trigger(H)
/obj/effect/step_trigger/singularity_act()
return
/obj/effect/step_trigger/singularity_pull()
return
/* Sends a message to mob when triggered*/
/obj/effect/step_trigger/message
var/message //the message to give to the mob
var/once = 1
mobs_only = TRUE
/obj/effect/step_trigger/message/Trigger(mob/M)
if(M.client)
to_chat(M, "<span class='info'>[message]</span>")
if(once)
qdel(src)
/* Tosses things in a certain direction */
/obj/effect/step_trigger/thrower
var/direction = SOUTH // the direction of throw
var/tiles = 3 // if 0: forever until atom hits a stopper
var/immobilize = 1 // if nonzero: prevents mobs from moving while they're being flung
var/speed = 1 // delay of movement
var/facedir = 0 // if 1: atom faces the direction of movement
var/nostop = 0 // if 1: will only be stopped by teleporters
var/list/affecting = list()
/obj/effect/step_trigger/thrower/Trigger(atom/A)
if(!A || !ismovableatom(A))
return
var/atom/movable/AM = A
var/curtiles = 0
var/stopthrow = 0
for(var/obj/effect/step_trigger/thrower/T in orange(2, src))
if(AM in T.affecting)
return
if(ismob(AM))
var/mob/M = AM
if(immobilize)
M.canmove = 0
affecting.Add(AM)
while(AM && !stopthrow)
if(tiles)
if(curtiles >= tiles)
break
if(AM.z != src.z)
break
curtiles++
sleep(speed)
// Calculate if we should stop the process
if(!nostop)
for(var/obj/effect/step_trigger/T in get_step(AM, direction))
if(T.stopper && T != src)
stopthrow = 1
else
for(var/obj/effect/step_trigger/teleporter/T in get_step(AM, direction))
if(T.stopper)
stopthrow = 1
if(AM)
var/predir = AM.dir
step(AM, direction)
if(!facedir)
AM.setDir(predir)
affecting.Remove(AM)
if(ismob(AM))
var/mob/M = AM
if(immobilize)
M.canmove = 1
/* Stops things thrown by a thrower, doesn't do anything */
/obj/effect/step_trigger/stopper
/* Instant teleporter */
/obj/effect/step_trigger/teleporter
var/teleport_x = 0 // teleportation coordinates (if one is null, then no teleport!)
var/teleport_y = 0
var/teleport_z = 0
/obj/effect/step_trigger/teleporter/Trigger(atom/movable/A)
if(teleport_x && teleport_y && teleport_z)
var/turf/T = locate(teleport_x, teleport_y, teleport_z)
A.forceMove(T)
/* Random teleporter, teleports atoms to locations ranging from teleport_x - teleport_x_offset, etc */
/obj/effect/step_trigger/teleporter/random
var/teleport_x_offset = 0
var/teleport_y_offset = 0
var/teleport_z_offset = 0
/obj/effect/step_trigger/teleporter/random/Trigger(atom/movable/A)
if(teleport_x && teleport_y && teleport_z)
if(teleport_x_offset && teleport_y_offset && teleport_z_offset)
var/turf/T = locate(rand(teleport_x, teleport_x_offset), rand(teleport_y, teleport_y_offset), rand(teleport_z, teleport_z_offset))
if (T)
A.forceMove(T)
/* Fancy teleporter, creates sparks and smokes when used */
/obj/effect/step_trigger/teleport_fancy
var/locationx
var/locationy
var/uses = 1 //0 for infinite uses
var/entersparks = 0
var/exitsparks = 0
var/entersmoke = 0
var/exitsmoke = 0
/obj/effect/step_trigger/teleport_fancy/Trigger(mob/M)
var/dest = locate(locationx, locationy, z)
M.Move(dest)
if(entersparks)
var/datum/effect_system/spark_spread/s = new
s.set_up(4, 1, src)
s.start()
if(exitsparks)
var/datum/effect_system/spark_spread/s = new
s.set_up(4, 1, dest)
s.start()
if(entersmoke)
var/datum/effect_system/smoke_spread/s = new
s.set_up(4, 1, src, 0)
s.start()
if(exitsmoke)
var/datum/effect_system/smoke_spread/s = new
s.set_up(4, 1, dest, 0)
s.start()
uses--
if(uses == 0)
qdel(src)
/* Simple sound player, Mapper friendly! */
/obj/effect/step_trigger/sound_effect
var/sound //eg. path to the sound, inside '' eg: 'growl.ogg'
var/volume = 100
var/freq_vary = 1 //Should the frequency of the sound vary?
var/extra_range = 0 // eg World.view = 7, extra_range = 1, 7+1 = 8, 8 turfs radius
var/happens_once = 0
var/triggerer_only = 0 //Whether the triggerer is the only person who hears this
/obj/effect/step_trigger/sound_effect/Trigger(atom/movable/A)
var/turf/T = get_turf(A)
if(!T)
return
if(triggerer_only && ismob(A))
var/mob/B = A
B.playsound_local(T, sound, volume, freq_vary)
else
playsound(T, sound, volume, freq_vary, extra_range)
if(happens_once)
qdel(src)
/* Simple object type, calls a proc when "stepped" on by something */
/obj/effect/step_trigger
var/affect_ghosts = 0
var/stopper = 1 // stops throwers
var/mobs_only = FALSE
invisibility = INVISIBILITY_ABSTRACT // nope cant see this shit
anchored = TRUE
/obj/effect/step_trigger/proc/Trigger(atom/movable/A)
return 0
/obj/effect/step_trigger/Crossed(H as mob|obj)
..()
if(!H)
return
if(isobserver(H) && !affect_ghosts)
return
if(!ismob(H) && mobs_only)
return
Trigger(H)
/obj/effect/step_trigger/singularity_act()
return
/obj/effect/step_trigger/singularity_pull()
return
/* Sends a message to mob when triggered*/
/obj/effect/step_trigger/message
var/message //the message to give to the mob
var/once = 1
mobs_only = TRUE
/obj/effect/step_trigger/message/Trigger(mob/M)
if(M.client)
to_chat(M, "<span class='info'>[message]</span>")
if(once)
qdel(src)
/* Tosses things in a certain direction */
/obj/effect/step_trigger/thrower
var/direction = SOUTH // the direction of throw
var/tiles = 3 // if 0: forever until atom hits a stopper
var/immobilize = 1 // if nonzero: prevents mobs from moving while they're being flung
var/speed = 1 // delay of movement
var/facedir = 0 // if 1: atom faces the direction of movement
var/nostop = 0 // if 1: will only be stopped by teleporters
var/list/affecting = list()
/obj/effect/step_trigger/thrower/Trigger(atom/A)
if(!A || !ismovableatom(A))
return
var/atom/movable/AM = A
var/curtiles = 0
var/stopthrow = 0
for(var/obj/effect/step_trigger/thrower/T in orange(2, src))
if(AM in T.affecting)
return
if(ismob(AM))
var/mob/M = AM
if(immobilize)
M.canmove = 0
affecting.Add(AM)
while(AM && !stopthrow)
if(tiles)
if(curtiles >= tiles)
break
if(AM.z != src.z)
break
curtiles++
sleep(speed)
// Calculate if we should stop the process
if(!nostop)
for(var/obj/effect/step_trigger/T in get_step(AM, direction))
if(T.stopper && T != src)
stopthrow = 1
else
for(var/obj/effect/step_trigger/teleporter/T in get_step(AM, direction))
if(T.stopper)
stopthrow = 1
if(AM)
var/predir = AM.dir
step(AM, direction)
if(!facedir)
AM.setDir(predir)
affecting.Remove(AM)
if(ismob(AM))
var/mob/M = AM
if(immobilize)
M.canmove = 1
/* Stops things thrown by a thrower, doesn't do anything */
/obj/effect/step_trigger/stopper
/* Instant teleporter */
/obj/effect/step_trigger/teleporter
var/teleport_x = 0 // teleportation coordinates (if one is null, then no teleport!)
var/teleport_y = 0
var/teleport_z = 0
/obj/effect/step_trigger/teleporter/Trigger(atom/movable/A)
if(teleport_x && teleport_y && teleport_z)
var/turf/T = locate(teleport_x, teleport_y, teleport_z)
A.forceMove(T)
/* Random teleporter, teleports atoms to locations ranging from teleport_x - teleport_x_offset, etc */
/obj/effect/step_trigger/teleporter/random
var/teleport_x_offset = 0
var/teleport_y_offset = 0
var/teleport_z_offset = 0
/obj/effect/step_trigger/teleporter/random/Trigger(atom/movable/A)
if(teleport_x && teleport_y && teleport_z)
if(teleport_x_offset && teleport_y_offset && teleport_z_offset)
var/turf/T = locate(rand(teleport_x, teleport_x_offset), rand(teleport_y, teleport_y_offset), rand(teleport_z, teleport_z_offset))
if (T)
A.forceMove(T)
/* Fancy teleporter, creates sparks and smokes when used */
/obj/effect/step_trigger/teleport_fancy
var/locationx
var/locationy
var/uses = 1 //0 for infinite uses
var/entersparks = 0
var/exitsparks = 0
var/entersmoke = 0
var/exitsmoke = 0
/obj/effect/step_trigger/teleport_fancy/Trigger(mob/M)
var/dest = locate(locationx, locationy, z)
M.Move(dest)
if(entersparks)
var/datum/effect_system/spark_spread/s = new
s.set_up(4, 1, src)
s.start()
if(exitsparks)
var/datum/effect_system/spark_spread/s = new
s.set_up(4, 1, dest)
s.start()
if(entersmoke)
var/datum/effect_system/smoke_spread/s = new
s.set_up(4, 1, src, 0)
s.start()
if(exitsmoke)
var/datum/effect_system/smoke_spread/s = new
s.set_up(4, 1, dest, 0)
s.start()
uses--
if(uses == 0)
qdel(src)
/* Simple sound player, Mapper friendly! */
/obj/effect/step_trigger/sound_effect
var/sound //eg. path to the sound, inside '' eg: 'growl.ogg'
var/volume = 100
var/freq_vary = 1 //Should the frequency of the sound vary?
var/extra_range = 0 // eg World.view = 7, extra_range = 1, 7+1 = 8, 8 turfs radius
var/happens_once = 0
var/triggerer_only = 0 //Whether the triggerer is the only person who hears this
/obj/effect/step_trigger/sound_effect/Trigger(atom/movable/A)
var/turf/T = get_turf(A)
if(!T)
return
if(triggerer_only && ismob(A))
var/mob/B = A
B.playsound_local(T, sound, volume, freq_vary)
else
playsound(T, sound, volume, freq_vary, extra_range)
if(happens_once)
qdel(src)
@@ -452,4 +452,45 @@
icon_state = "slugboom"
randomdir = FALSE
duration = 30
pixel_x = -24
pixel_x = -24
/obj/effect/constructing_effect
icon = 'icons/effects/effects_rcd.dmi'
icon_state = ""
layer = ABOVE_ALL_MOB_LAYER
anchored = TRUE
var/status = 0
var/delay = 0
mouse_opacity = MOUSE_OPACITY_TRANSPARENT
/obj/effect/constructing_effect/Initialize(mapload, rcd_delay, rcd_status)
. = ..()
status = rcd_status
delay = rcd_delay
if (status == RCD_DECONSTRUCT)
addtimer(CALLBACK(src, /atom/.proc/update_icon), 11)
delay -= 11
icon_state = "rcd_end_reverse"
else
update_icon()
/obj/effect/constructing_effect/update_icon()
icon_state = "rcd"
if (delay < 10)
icon_state += "_shortest"
else if (delay < 20)
icon_state += "_shorter"
else if (delay < 37)
icon_state += "_short"
if (status == RCD_DECONSTRUCT)
icon_state += "_reverse"
/obj/effect/constructing_effect/proc/end_animation()
if (status == RCD_DECONSTRUCT)
qdel(src)
else
icon_state = "rcd_end"
addtimer(CALLBACK(src, .proc/end), 15)
/obj/effect/constructing_effect/proc/end()
qdel(src)
+31 -31
View File
@@ -1,32 +1,32 @@
/proc/empulse(turf/epicenter, heavy_range, light_range, log=0)
if(!epicenter)
return
if(!isturf(epicenter))
epicenter = get_turf(epicenter.loc)
if(log)
message_admins("EMP with size ([heavy_range], [light_range]) in area [epicenter.loc.name] ")
log_game("EMP with size ([heavy_range], [light_range]) in area [epicenter.loc.name] ")
if(heavy_range >= 1)
new /obj/effect/temp_visual/emp/pulse(epicenter)
if(heavy_range > light_range)
light_range = heavy_range
for(var/A in spiral_range(light_range, epicenter))
var/atom/T = A
var/distance = get_dist(epicenter, T)
if(distance < 0)
distance = 0
if(distance < heavy_range)
T.emp_act(EMP_HEAVY)
else if(distance == heavy_range)
if(prob(50))
T.emp_act(EMP_HEAVY)
else
T.emp_act(EMP_LIGHT)
else if(distance <= light_range)
T.emp_act(EMP_LIGHT)
/proc/empulse(turf/epicenter, heavy_range, light_range, log=0)
if(!epicenter)
return
if(!isturf(epicenter))
epicenter = get_turf(epicenter.loc)
if(log)
message_admins("EMP with size ([heavy_range], [light_range]) in area [epicenter.loc.name] ")
log_game("EMP with size ([heavy_range], [light_range]) in area [epicenter.loc.name] ")
if(heavy_range >= 1)
new /obj/effect/temp_visual/emp/pulse(epicenter)
if(heavy_range > light_range)
light_range = heavy_range
for(var/A in spiral_range(light_range, epicenter))
var/atom/T = A
var/distance = get_dist(epicenter, T)
if(distance < 0)
distance = 0
if(distance < heavy_range)
T.emp_act(EMP_HEAVY)
else if(distance == heavy_range)
if(prob(50))
T.emp_act(EMP_HEAVY)
else
T.emp_act(EMP_LIGHT)
else if(distance <= light_range)
T.emp_act(EMP_LIGHT)
return 1
+851 -851
View File
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+29 -9
View File
@@ -47,7 +47,11 @@ RLD
/obj/item/construction/examine(mob/user)
. = ..()
. += "\A [src]. It currently holds [matter]/[max_matter] matter-units."
. += "It currently holds [matter]/[max_matter] matter-units."
if(upgrade & RCD_UPGRADE_FRAMES)
. += "It contains the design for machine frames, computer frames and deconstruction."
if(upgrade & RCD_UPGRADE_SIMPLE_CIRCUITS)
. += "It contains the design for firelock, air alarm, fire alarm, apc circuits and crap power cells."
/obj/item/construction/Destroy()
QDEL_NULL(spark_system)
@@ -85,9 +89,11 @@ RLD
to_chat(user, "<span class='notice'>[src] now holds [matter]/[max_matter] matter-units.</span>")
else if(istype(W, /obj/item/rcd_upgrade))
to_chat(user, "<span class='notice'>You upgrade the RCD with the [W]!</span>")
upgrade = TRUE
playsound(src.loc, 'sound/machines/click.ogg', 50, 1)
qdel(W)
var/obj/item/rcd_upgrade/rcd_up = W
if(!(upgrade & rcd_up.upgrade))
upgrade |= rcd_up.upgrade
playsound(src.loc, 'sound/machines/click.ogg', 50, 1)
qdel(W)
else
return ..()
update_icon() //ensures that ammo counters (if present) get updated
@@ -116,10 +122,10 @@ RLD
if(matter < amount)
if(user)
to_chat(user, no_ammo_message)
return 0
return FALSE
matter -= amount
update_icon()
return 1
return TRUE
/obj/item/construction/proc/checkResource(amount, mob/user)
. = matter >= amount
@@ -439,18 +445,22 @@ RLD
var/list/rcd_results = A.rcd_vals(user, src)
if(!rcd_results)
return FALSE
var/delay = rcd_results["delay"] * delay_mod
var/obj/effect/constructing_effect/rcd_effect = new(get_turf(A), delay, src.mode)
var/turf/the_turf = get_turf(A)
var/turf_coords = "[COORD(the_turf)]"
investigate_log("[user] is attempting to use [src] on [A] (loc [turf_coords] at [the_turf]) with cost [rcd_results["cost"]], delay [rcd_results["delay"]], mode [rcd_results["mode"]].", INVESTIGATE_RCD)
if(do_after(user, rcd_results["delay"] * delay_mod, target = A))
if(do_after(user, delay, target = A))
if(checkResource(rcd_results["cost"], user))
var/atom/cached = A
if(A.rcd_act(user, src, rcd_results["mode"]))
rcd_effect.end_animation()
useResource(rcd_results["cost"], user)
activate()
investigate_log("[user] used [src] on [cached] (loc [turf_coords] at [the_turf]) with cost [rcd_results["cost"]], delay [rcd_results["delay"]], mode [rcd_results["mode"]].", INVESTIGATE_RCD)
playsound(src, 'sound/machines/click.ogg', 50, 1)
return TRUE
qdel(rcd_effect)
/obj/item/construction/rcd/Initialize()
. = ..()
@@ -467,7 +477,7 @@ RLD
"Grilles & Windows" = image(icon = 'icons/mob/radial.dmi', icon_state = "grillewindow"),
"Floors & Walls" = image(icon = 'icons/mob/radial.dmi', icon_state = "wallfloor")
)
if(upgrade)
if(upgrade & RCD_UPGRADE_FRAMES)
choices += list(
"Deconstruct" = image(icon= 'icons/mob/radial.dmi', icon_state = "delete"),
"Machine Frames" = image(icon = 'icons/mob/radial.dmi', icon_state = "machine"),
@@ -593,6 +603,7 @@ RLD
energyfactor = 66
/obj/item/construction/rcd/loaded
materials = list(MAT_METAL=48000, MAT_GLASS=32000)
matter = 160
/obj/item/construction/rcd/loaded/upgraded
@@ -825,9 +836,18 @@ RLD
/obj/item/rcd_upgrade
name = "RCD advanced design disk"
desc = "It contains the design for machine frames, computer frames, and deconstruction."
desc = "It seems to be empty."
icon = 'icons/obj/module.dmi'
icon_state = "datadisk3"
var/upgrade
/obj/item/rcd_upgrade/frames
desc = "It contains the design for machine frames, computer frames and deconstruction."
upgrade = RCD_UPGRADE_FRAMES
/obj/item/rcd_upgrade/simple_circuits
desc = "It contains the design for firelock, air alarm, fire alarm, apc circuits and crap power cells."
upgrade = RCD_UPGRADE_SIMPLE_CIRCUITS
#undef GLOW_MODE
#undef LIGHT_MODE
+127 -127
View File
@@ -1,127 +1,127 @@
/obj/item/airlock_painter
name = "airlock painter"
desc = "An advanced autopainter preprogrammed with several paintjobs for airlocks. Use it on an airlock during or after construction to change the paintjob."
icon = 'icons/obj/objects.dmi'
icon_state = "paint sprayer"
item_state = "paint sprayer"
w_class = WEIGHT_CLASS_SMALL
materials = list(MAT_METAL=50, MAT_GLASS=50)
flags_1 = CONDUCT_1
item_flags = NOBLUDGEON
slot_flags = ITEM_SLOT_BELT
usesound = 'sound/effects/spray2.ogg'
var/obj/item/toner/ink = null
/obj/item/airlock_painter/Initialize()
. = ..()
ink = new /obj/item/toner(src)
//This proc doesn't just check if the painter can be used, but also uses it.
//Only call this if you are certain that the painter will be used right after this check!
/obj/item/airlock_painter/proc/use_paint(mob/user)
if(can_use(user))
ink.charges--
playsound(src.loc, 'sound/effects/spray2.ogg', 50, 1)
return 1
else
return 0
//This proc only checks if the painter can be used.
//Call this if you don't want the painter to be used right after this check, for example
//because you're expecting user input.
/obj/item/airlock_painter/proc/can_use(mob/user)
if(!ink)
to_chat(user, "<span class='notice'>There is no toner cartridge installed in [src]!</span>")
return 0
else if(ink.charges < 1)
to_chat(user, "<span class='notice'>[src] is out of ink!</span>")
return 0
else
return 1
/obj/item/airlock_painter/suicide_act(mob/user)
var/obj/item/organ/lungs/L = user.getorganslot(ORGAN_SLOT_LUNGS)
if(can_use(user) && L)
user.visible_message("<span class='suicide'>[user] is inhaling toner from [src]! It looks like [user.p_theyre()] trying to commit suicide!</span>")
use(user)
// Once you've inhaled the toner, you throw up your lungs
// and then die.
// Find out if there is an open turf in front of us,
// and if not, pick the turf we are standing on.
var/turf/T = get_step(get_turf(src), user.dir)
if(!isopenturf(T))
T = get_turf(src)
// they managed to lose their lungs between then and
// now. Good job.
if(!L)
return OXYLOSS
L.Remove(user)
// make some colorful reagent, and apply it to the lungs
L.create_reagents(10)
L.reagents.add_reagent(/datum/reagent/colorful_reagent, 10)
L.reagents.reaction(L, TOUCH, 1)
// TODO maybe add some colorful vomit?
user.visible_message("<span class='suicide'>[user] vomits out [user.p_their()] [L]!</span>")
playsound(user.loc, 'sound/effects/splat.ogg', 50, 1)
L.forceMove(T)
return (TOXLOSS|OXYLOSS)
else if(can_use(user) && !L)
user.visible_message("<span class='suicide'>[user] is spraying toner on [user.p_them()]self from [src]! It looks like [user.p_theyre()] trying to commit suicide.</span>")
user.reagents.add_reagent(/datum/reagent/colorful_reagent, 1)
user.reagents.reaction(user, TOUCH, 1)
return TOXLOSS
else
user.visible_message("<span class='suicide'>[user] is trying to inhale toner from [src]! It might be a suicide attempt if [src] had any toner.</span>")
return SHAME
/obj/item/airlock_painter/examine(mob/user)
. = ..()
if(!ink)
. += "<span class='notice'>It doesn't have a toner cartridge installed.</span>"
return
var/ink_level = "high"
if(ink.charges < 1)
ink_level = "empty"
else if((ink.charges/ink.max_charges) <= 0.25) //25%
ink_level = "low"
else if((ink.charges/ink.max_charges) > 1) //Over 100% (admin var edit)
ink_level = "dangerously high"
. += "<span class='notice'>Its ink levels look [ink_level].</span>"
/obj/item/airlock_painter/attackby(obj/item/W, mob/user, params)
if(istype(W, /obj/item/toner))
if(ink)
to_chat(user, "<span class='notice'>[src] already contains \a [ink].</span>")
return
if(!user.transferItemToLoc(W, src))
return
to_chat(user, "<span class='notice'>You install [W] into [src].</span>")
ink = W
playsound(src.loc, 'sound/machines/click.ogg', 50, 1)
else
return ..()
/obj/item/airlock_painter/attack_self(mob/user)
if(ink)
playsound(src.loc, 'sound/machines/click.ogg', 50, 1)
ink.forceMove(user.drop_location())
user.put_in_hands(ink)
to_chat(user, "<span class='notice'>You remove [ink] from [src].</span>")
ink = null
/obj/item/airlock_painter
name = "airlock painter"
desc = "An advanced autopainter preprogrammed with several paintjobs for airlocks. Use it on an airlock during or after construction to change the paintjob."
icon = 'icons/obj/objects.dmi'
icon_state = "paint sprayer"
item_state = "paint sprayer"
w_class = WEIGHT_CLASS_SMALL
materials = list(MAT_METAL=50, MAT_GLASS=50)
flags_1 = CONDUCT_1
item_flags = NOBLUDGEON
slot_flags = ITEM_SLOT_BELT
usesound = 'sound/effects/spray2.ogg'
var/obj/item/toner/ink = null
/obj/item/airlock_painter/Initialize()
. = ..()
ink = new /obj/item/toner(src)
//This proc doesn't just check if the painter can be used, but also uses it.
//Only call this if you are certain that the painter will be used right after this check!
/obj/item/airlock_painter/proc/use_paint(mob/user)
if(can_use(user))
ink.charges--
playsound(src.loc, 'sound/effects/spray2.ogg', 50, 1)
return 1
else
return 0
//This proc only checks if the painter can be used.
//Call this if you don't want the painter to be used right after this check, for example
//because you're expecting user input.
/obj/item/airlock_painter/proc/can_use(mob/user)
if(!ink)
to_chat(user, "<span class='notice'>There is no toner cartridge installed in [src]!</span>")
return 0
else if(ink.charges < 1)
to_chat(user, "<span class='notice'>[src] is out of ink!</span>")
return 0
else
return 1
/obj/item/airlock_painter/suicide_act(mob/user)
var/obj/item/organ/lungs/L = user.getorganslot(ORGAN_SLOT_LUNGS)
if(can_use(user) && L)
user.visible_message("<span class='suicide'>[user] is inhaling toner from [src]! It looks like [user.p_theyre()] trying to commit suicide!</span>")
use(user)
// Once you've inhaled the toner, you throw up your lungs
// and then die.
// Find out if there is an open turf in front of us,
// and if not, pick the turf we are standing on.
var/turf/T = get_step(get_turf(src), user.dir)
if(!isopenturf(T))
T = get_turf(src)
// they managed to lose their lungs between then and
// now. Good job.
if(!L)
return OXYLOSS
L.Remove(user)
// make some colorful reagent, and apply it to the lungs
L.create_reagents(10)
L.reagents.add_reagent(/datum/reagent/colorful_reagent, 10)
L.reagents.reaction(L, TOUCH, 1)
// TODO maybe add some colorful vomit?
user.visible_message("<span class='suicide'>[user] vomits out [user.p_their()] [L]!</span>")
playsound(user.loc, 'sound/effects/splat.ogg', 50, 1)
L.forceMove(T)
return (TOXLOSS|OXYLOSS)
else if(can_use(user) && !L)
user.visible_message("<span class='suicide'>[user] is spraying toner on [user.p_them()]self from [src]! It looks like [user.p_theyre()] trying to commit suicide.</span>")
user.reagents.add_reagent(/datum/reagent/colorful_reagent, 1)
user.reagents.reaction(user, TOUCH, 1)
return TOXLOSS
else
user.visible_message("<span class='suicide'>[user] is trying to inhale toner from [src]! It might be a suicide attempt if [src] had any toner.</span>")
return SHAME
/obj/item/airlock_painter/examine(mob/user)
. = ..()
if(!ink)
. += "<span class='notice'>It doesn't have a toner cartridge installed.</span>"
return
var/ink_level = "high"
if(ink.charges < 1)
ink_level = "empty"
else if((ink.charges/ink.max_charges) <= 0.25) //25%
ink_level = "low"
else if((ink.charges/ink.max_charges) > 1) //Over 100% (admin var edit)
ink_level = "dangerously high"
. += "<span class='notice'>Its ink levels look [ink_level].</span>"
/obj/item/airlock_painter/attackby(obj/item/W, mob/user, params)
if(istype(W, /obj/item/toner))
if(ink)
to_chat(user, "<span class='notice'>[src] already contains \a [ink].</span>")
return
if(!user.transferItemToLoc(W, src))
return
to_chat(user, "<span class='notice'>You install [W] into [src].</span>")
ink = W
playsound(src.loc, 'sound/machines/click.ogg', 50, 1)
else
return ..()
/obj/item/airlock_painter/attack_self(mob/user)
if(ink)
playsound(src.loc, 'sound/machines/click.ogg', 50, 1)
ink.forceMove(user.drop_location())
user.put_in_hands(ink)
to_chat(user, "<span class='notice'>You remove [ink] from [src].</span>")
ink = null
+83 -83
View File
@@ -1,83 +1,83 @@
/obj/item/bodybag
name = "body bag"
desc = "A folded bag designed for the storage and transportation of cadavers."
icon = 'icons/obj/bodybag.dmi'
icon_state = "bodybag_folded"
var/unfoldedbag_path = /obj/structure/closet/body_bag
w_class = WEIGHT_CLASS_SMALL
/obj/item/bodybag/attack_self(mob/user)
deploy_bodybag(user, user.loc)
/obj/item/bodybag/afterattack(atom/target, mob/user, proximity)
. = ..()
if(proximity)
if(isopenturf(target))
deploy_bodybag(user, target)
/obj/item/bodybag/proc/deploy_bodybag(mob/user, atom/location)
var/obj/structure/closet/body_bag/R = new unfoldedbag_path(location)
R.open(user)
R.add_fingerprint(user)
qdel(src)
/obj/item/bodybag/suicide_act(mob/user)
if(isopenturf(user.loc))
user.visible_message("<span class='suicide'>[user] is crawling into [src]! It looks like [user.p_theyre()] trying to commit suicide!</span>")
var/obj/structure/closet/body_bag/R = new unfoldedbag_path(user.loc)
R.add_fingerprint(user)
qdel(src)
user.forceMove(R)
playsound(src, 'sound/items/zip.ogg', 15, 1, -3)
return (OXYLOSS)
..()
// Bluespace bodybag
/obj/item/bodybag/bluespace
name = "bluespace body bag"
desc = "A folded bluespace body bag designed for the storage and transportation of cadavers."
icon = 'icons/obj/bodybag.dmi'
icon_state = "bluebodybag_folded"
unfoldedbag_path = /obj/structure/closet/body_bag/bluespace
w_class = WEIGHT_CLASS_SMALL
item_flags = NO_MAT_REDEMPTION
/obj/item/bodybag/bluespace/examine(mob/user)
. = ..()
if(contents.len)
var/s = contents.len == 1 ? "" : "s"
. += "<span class='notice'>You can make out the shape[s] of [contents.len] object[s] through the fabric.</span>"
/obj/item/bodybag/bluespace/Destroy()
for(var/atom/movable/A in contents)
A.forceMove(get_turf(src))
if(isliving(A))
to_chat(A, "<span class='notice'>You suddenly feel the space around you torn apart! You're free!</span>")
return ..()
/obj/item/bodybag/bluespace/deploy_bodybag(mob/user, atom/location)
var/obj/structure/closet/body_bag/R = new unfoldedbag_path(location)
for(var/atom/movable/A in contents)
A.forceMove(R)
if(isliving(A))
to_chat(A, "<span class='notice'>You suddenly feel air around you! You're free!</span>")
R.open(user)
R.add_fingerprint(user)
qdel(src)
/obj/item/bodybag/bluespace/container_resist(mob/living/user)
if(user.incapacitated())
to_chat(user, "<span class='warning'>You can't get out while you're restrained like this!</span>")
return
user.changeNext_move(CLICK_CD_BREAKOUT)
user.last_special = world.time + CLICK_CD_BREAKOUT
to_chat(user, "<span class='notice'>You claw at the fabric of [src], trying to tear it open...</span>")
to_chat(loc, "<span class='warning'>Someone starts trying to break free of [src]!</span>")
if(!do_after(user, 200, target = src))
to_chat(loc, "<span class='warning'>The pressure subsides. It seems that they've stopped resisting...</span>")
return
loc.visible_message("<span class='warning'>[user] suddenly appears in front of [loc]!</span>", "<span class='userdanger'>[user] breaks free of [src]!</span>")
qdel(src)
/obj/item/bodybag
name = "body bag"
desc = "A folded bag designed for the storage and transportation of cadavers."
icon = 'icons/obj/bodybag.dmi'
icon_state = "bodybag_folded"
var/unfoldedbag_path = /obj/structure/closet/body_bag
w_class = WEIGHT_CLASS_SMALL
/obj/item/bodybag/attack_self(mob/user)
deploy_bodybag(user, user.loc)
/obj/item/bodybag/afterattack(atom/target, mob/user, proximity)
. = ..()
if(proximity)
if(isopenturf(target))
deploy_bodybag(user, target)
/obj/item/bodybag/proc/deploy_bodybag(mob/user, atom/location)
var/obj/structure/closet/body_bag/R = new unfoldedbag_path(location)
R.open(user)
R.add_fingerprint(user)
qdel(src)
/obj/item/bodybag/suicide_act(mob/user)
if(isopenturf(user.loc))
user.visible_message("<span class='suicide'>[user] is crawling into [src]! It looks like [user.p_theyre()] trying to commit suicide!</span>")
var/obj/structure/closet/body_bag/R = new unfoldedbag_path(user.loc)
R.add_fingerprint(user)
qdel(src)
user.forceMove(R)
playsound(src, 'sound/items/zip.ogg', 15, 1, -3)
return (OXYLOSS)
..()
// Bluespace bodybag
/obj/item/bodybag/bluespace
name = "bluespace body bag"
desc = "A folded bluespace body bag designed for the storage and transportation of cadavers."
icon = 'icons/obj/bodybag.dmi'
icon_state = "bluebodybag_folded"
unfoldedbag_path = /obj/structure/closet/body_bag/bluespace
w_class = WEIGHT_CLASS_SMALL
item_flags = NO_MAT_REDEMPTION
/obj/item/bodybag/bluespace/examine(mob/user)
. = ..()
if(contents.len)
var/s = contents.len == 1 ? "" : "s"
. += "<span class='notice'>You can make out the shape[s] of [contents.len] object[s] through the fabric.</span>"
/obj/item/bodybag/bluespace/Destroy()
for(var/atom/movable/A in contents)
A.forceMove(get_turf(src))
if(isliving(A))
to_chat(A, "<span class='notice'>You suddenly feel the space around you torn apart! You're free!</span>")
return ..()
/obj/item/bodybag/bluespace/deploy_bodybag(mob/user, atom/location)
var/obj/structure/closet/body_bag/R = new unfoldedbag_path(location)
for(var/atom/movable/A in contents)
A.forceMove(R)
if(isliving(A))
to_chat(A, "<span class='notice'>You suddenly feel air around you! You're free!</span>")
R.open(user)
R.add_fingerprint(user)
qdel(src)
/obj/item/bodybag/bluespace/container_resist(mob/living/user)
if(user.incapacitated())
to_chat(user, "<span class='warning'>You can't get out while you're restrained like this!</span>")
return
user.changeNext_move(CLICK_CD_BREAKOUT)
user.last_special = world.time + CLICK_CD_BREAKOUT
to_chat(user, "<span class='notice'>You claw at the fabric of [src], trying to tear it open...</span>")
to_chat(loc, "<span class='warning'>Someone starts trying to break free of [src]!</span>")
if(!do_after(user, 200, target = src))
to_chat(loc, "<span class='warning'>The pressure subsides. It seems that they've stopped resisting...</span>")
return
loc.visible_message("<span class='warning'>[user] suddenly appears in front of [loc]!</span>", "<span class='userdanger'>[user] breaks free of [src]!</span>")
qdel(src)
+80 -80
View File
@@ -1,80 +1,80 @@
#define CANDLE_LUMINOSITY 2
/obj/item/candle
name = "red candle"
desc = "In Greek myth, Prometheus stole fire from the Gods and gave it to \
humankind. The jewelry he kept for himself."
icon = 'icons/obj/candle.dmi'
icon_state = "candle1"
item_state = "candle1"
w_class = WEIGHT_CLASS_TINY
light_color = LIGHT_COLOR_FIRE
heat = 1000
var/wax = 1000
var/lit = FALSE
var/infinite = FALSE
var/start_lit = FALSE
/obj/item/candle/Initialize()
. = ..()
if(start_lit)
light()
/obj/item/candle/update_icon()
icon_state = "candle[(wax > 400) ? ((wax > 750) ? 1 : 2) : 3][lit ? "_lit" : ""]"
/obj/item/candle/attackby(obj/item/W, mob/user, params)
var/msg = W.ignition_effect(src, user)
if(msg)
light(msg)
else
return ..()
/obj/item/candle/fire_act(exposed_temperature, exposed_volume)
if(!lit)
light() //honk
return ..()
/obj/item/candle/get_temperature()
return lit * heat
/obj/item/candle/proc/light(show_message)
if(!lit)
lit = TRUE
if(show_message)
usr.visible_message(show_message)
set_light(CANDLE_LUMINOSITY)
START_PROCESSING(SSobj, src)
update_icon()
/obj/item/candle/proc/put_out_candle()
if(!lit)
return
lit = FALSE
update_icon()
set_light(0)
return TRUE
/obj/item/candle/extinguish()
put_out_candle()
return ..()
/obj/item/candle/process()
if(!lit)
return PROCESS_KILL
if(!infinite)
wax--
if(!wax)
new /obj/item/trash/candle(loc)
qdel(src)
update_icon()
open_flame()
/obj/item/candle/attack_self(mob/user)
if(put_out_candle())
user.visible_message("<span class='notice'>[user] snuffs [src].</span>")
/obj/item/candle/infinite
infinite = TRUE
start_lit = TRUE
#undef CANDLE_LUMINOSITY
#define CANDLE_LUMINOSITY 2
/obj/item/candle
name = "red candle"
desc = "In Greek myth, Prometheus stole fire from the Gods and gave it to \
humankind. The jewelry he kept for himself."
icon = 'icons/obj/candle.dmi'
icon_state = "candle1"
item_state = "candle1"
w_class = WEIGHT_CLASS_TINY
light_color = LIGHT_COLOR_FIRE
heat = 1000
var/wax = 1000
var/lit = FALSE
var/infinite = FALSE
var/start_lit = FALSE
/obj/item/candle/Initialize()
. = ..()
if(start_lit)
light()
/obj/item/candle/update_icon()
icon_state = "candle[(wax > 400) ? ((wax > 750) ? 1 : 2) : 3][lit ? "_lit" : ""]"
/obj/item/candle/attackby(obj/item/W, mob/user, params)
var/msg = W.ignition_effect(src, user)
if(msg)
light(msg)
else
return ..()
/obj/item/candle/fire_act(exposed_temperature, exposed_volume)
if(!lit)
light() //honk
return ..()
/obj/item/candle/get_temperature()
return lit * heat
/obj/item/candle/proc/light(show_message)
if(!lit)
lit = TRUE
if(show_message)
usr.visible_message(show_message)
set_light(CANDLE_LUMINOSITY)
START_PROCESSING(SSobj, src)
update_icon()
/obj/item/candle/proc/put_out_candle()
if(!lit)
return
lit = FALSE
update_icon()
set_light(0)
return TRUE
/obj/item/candle/extinguish()
put_out_candle()
return ..()
/obj/item/candle/process()
if(!lit)
return PROCESS_KILL
if(!infinite)
wax--
if(!wax)
new /obj/item/trash/candle(loc)
qdel(src)
update_icon()
open_flame()
/obj/item/candle/attack_self(mob/user)
if(put_out_candle())
user.visible_message("<span class='notice'>[user] snuffs [src].</span>")
/obj/item/candle/infinite
infinite = TRUE
start_lit = TRUE
#undef CANDLE_LUMINOSITY
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -7,6 +7,10 @@
/obj/item/stack/cable_coil = 1,
/obj/item/stack/sheet/glass = 2)
/obj/item/circuitboard/machine/sleeper/syndie
name = "Syndicate Sleeper (Machine Board)"
build_path = /obj/machinery/sleeper/syndie
/obj/item/circuitboard/machine/vr_sleeper
name = "VR Sleeper (Machine Board)"
build_path = /obj/machinery/vr_sleeper
+182 -182
View File
@@ -1,183 +1,183 @@
/* Clown Items
* Contains:
* Soap
* Bike Horns
* Air Horns
* Canned Laughter
*/
/*
* Soap
*/
/obj/item/soap
name = "soap"
desc = "A cheap bar of soap. Doesn't smell."
gender = PLURAL
icon = 'icons/obj/items_and_weapons.dmi'
icon_state = "soap"
lefthand_file = 'icons/mob/inhands/equipment/custodial_lefthand.dmi'
righthand_file = 'icons/mob/inhands/equipment/custodial_righthand.dmi'
w_class = WEIGHT_CLASS_TINY
item_flags = NOBLUDGEON
throwforce = 0
throw_speed = 3
throw_range = 7
grind_results = list(/datum/reagent/lye = 10)
var/cleanspeed = 50 //slower than mop
force_string = "robust... against germs"
/obj/item/soap/Initialize()
. = ..()
AddComponent(/datum/component/slippery, 80)
/obj/item/soap/nanotrasen
desc = "A Nanotrasen brand bar of soap. Smells of plasma."
icon_state = "soapnt"
/obj/item/soap/homemade
desc = "A homemade bar of soap. Smells of... well...."
icon_state = "soapgibs"
cleanspeed = 45 // a little faster to reward chemists for going to the effort
/obj/item/soap/deluxe
desc = "A deluxe Waffle Co. brand bar of soap. Smells of high-class luxury."
icon_state = "soapdeluxe"
cleanspeed = 40 //same speed as mop because deluxe -- captain gets one of these
/obj/item/soap/syndie
desc = "An untrustworthy bar of soap made of strong chemical agents that dissolve blood faster."
icon_state = "soapsyndie"
cleanspeed = 10 //much faster than mop so it is useful for traitors who want to clean crime scenes
/obj/item/soap/suicide_act(mob/user)
user.say(";FFFFFFFFFFFFFFFFUUUUUUUDGE!!", forced="soap suicide")
user.visible_message("<span class='suicide'>[user] lifts [src] to [user.p_their()] mouth and gnaws on it furiously, producing a thick froth! [user.p_they(TRUE)]'ll never get that BB gun now!</span>")
new /obj/effect/particle_effect/foam(loc)
return (TOXLOSS)
/obj/item/soap/afterattack(atom/target, mob/user, proximity)
. = ..()
if(!proximity || !check_allowed_items(target))
return
//I couldn't feasibly fix the overlay bugs caused by cleaning items we are wearing.
//So this is a workaround. This also makes more sense from an IC standpoint. ~Carn
if(user.client && ((target in user.client.screen) && !user.is_holding(target)))
to_chat(user, "<span class='warning'>You need to take that [target.name] off before cleaning it!</span>")
else if(istype(target, /obj/effect/decal/cleanable))
user.visible_message("[user] begins to scrub \the [target.name] out with [src].", "<span class='warning'>You begin to scrub \the [target.name] out with [src]...</span>")
if(do_after(user, src.cleanspeed, target = target))
to_chat(user, "<span class='notice'>You scrub \the [target.name] out.</span>")
qdel(target)
else if(ishuman(target) && user.zone_selected == BODY_ZONE_PRECISE_MOUTH)
var/mob/living/carbon/human/H = user
user.visible_message("<span class='warning'>\the [user] washes \the [target]'s mouth out with [src.name]!</span>", "<span class='notice'>You wash \the [target]'s mouth out with [src.name]!</span>") //washes mouth out with soap sounds better than 'the soap' here
H.lip_style = null //removes lipstick
H.update_body()
return
else if(istype(target, /obj/structure/window))
user.visible_message("[user] begins to clean \the [target.name] with [src]...", "<span class='notice'>You begin to clean \the [target.name] with [src]...</span>")
if(do_after(user, src.cleanspeed, target = target))
to_chat(user, "<span class='notice'>You clean \the [target.name].</span>")
target.remove_atom_colour(WASHABLE_COLOUR_PRIORITY)
target.set_opacity(initial(target.opacity))
else
user.visible_message("[user] begins to clean \the [target.name] with [src]...", "<span class='notice'>You begin to clean \the [target.name] with [src]...</span>")
if(do_after(user, src.cleanspeed, target = target))
to_chat(user, "<span class='notice'>You clean \the [target.name].</span>")
var/obj/effect/decal/cleanable/C = locate() in target
qdel(C)
target.remove_atom_colour(WASHABLE_COLOUR_PRIORITY)
SEND_SIGNAL(target, COMSIG_COMPONENT_CLEAN_ACT, CLEAN_MEDIUM)
target.wash_cream()
return
/*
* Bike Horns
*/
/obj/item/bikehorn
name = "bike horn"
desc = "A horn off of a bicycle."
icon = 'icons/obj/items_and_weapons.dmi'
icon_state = "bike_horn"
item_state = "bike_horn"
lefthand_file = 'icons/mob/inhands/equipment/horns_lefthand.dmi'
righthand_file = 'icons/mob/inhands/equipment/horns_righthand.dmi'
throwforce = 0
hitsound = null //To prevent tap.ogg playing, as the item lacks of force
w_class = WEIGHT_CLASS_TINY
throw_speed = 3
throw_range = 7
attack_verb = list("HONKED")
var/moodlet = "honk" //used to define which kind of moodlet is added to the honked target
var/list/honksounds = list('sound/items/bikehorn.ogg' = 1)
/obj/item/bikehorn/ComponentInitialize()
. = ..()
AddComponent(/datum/component/squeak, honksounds, 50)
/obj/item/bikehorn/attack(mob/living/carbon/M, mob/living/carbon/user)
SEND_SIGNAL(M, COMSIG_ADD_MOOD_EVENT, moodlet, /datum/mood_event/honk)
return ..()
/obj/item/bikehorn/suicide_act(mob/user)
user.visible_message("<span class='suicide'>[user] solemnly points the horn at [user.p_their()] temple! It looks like [user.p_theyre()] trying to commit suicide!</span>")
playsound(src, pickweight(honksounds), 50, 1)
return (BRUTELOSS)
//air horn
/obj/item/bikehorn/airhorn
name = "air horn"
desc = "Damn son, where'd you find this?"
icon_state = "air_horn"
honksounds = list('sound/items/airhorn2.ogg' = 1)
//golden bikehorn
/obj/item/bikehorn/golden
name = "golden bike horn"
desc = "Golden? Clearly, it's made with bananium! Honk!"
icon_state = "gold_horn"
item_state = "gold_horn"
var/flip_cooldown = 0
/obj/item/bikehorn/golden/attack()
if(flip_cooldown < world.time)
flip_mobs()
return ..()
/obj/item/bikehorn/golden/attack_self(mob/user)
if(flip_cooldown < world.time)
flip_mobs()
..()
/obj/item/bikehorn/golden/proc/flip_mobs(mob/living/carbon/M, mob/user)
var/turf/T = get_turf(src)
for(M in ohearers(7, T))
if(ishuman(M) && M.can_hear())
var/mob/living/carbon/human/H = M
if(istype(H.ears, /obj/item/clothing/ears/earmuffs))
continue
M.emote("flip")
flip_cooldown = world.time + 7
/obj/item/bikehorn/silver
name = "silver bike horn"
desc = "A shiny bike horn handcrafted in the artisan workshops of Mars, with superior kevlar-reinforced rubber bulb attached to a polished plasteel reed horn."
attack_verb = list("elegantly HONKED")
icon_state = "silverhorn"
/obj/item/bikehorn/bluespacehonker
name = "bluespace bike horn"
desc = "A normal bike horn colored blue and has bluespace dust held in to reed horn allowing for silly honks through space and time, into your in childhood."
attack_verb = list("HONKED in bluespace", "HONKED", "quantumly HONKED")
icon_state = "bluespacehonker"
moodlet = "bshonk"
//canned laughter
/obj/item/reagent_containers/food/drinks/soda_cans/canned_laughter
name = "Canned Laughter"
desc = "Just looking at this makes you want to giggle."
icon_state = "laughter"
/* Clown Items
* Contains:
* Soap
* Bike Horns
* Air Horns
* Canned Laughter
*/
/*
* Soap
*/
/obj/item/soap
name = "soap"
desc = "A cheap bar of soap. Doesn't smell."
gender = PLURAL
icon = 'icons/obj/items_and_weapons.dmi'
icon_state = "soap"
lefthand_file = 'icons/mob/inhands/equipment/custodial_lefthand.dmi'
righthand_file = 'icons/mob/inhands/equipment/custodial_righthand.dmi'
w_class = WEIGHT_CLASS_TINY
item_flags = NOBLUDGEON
throwforce = 0
throw_speed = 3
throw_range = 7
grind_results = list(/datum/reagent/lye = 10)
var/cleanspeed = 50 //slower than mop
force_string = "robust... against germs"
/obj/item/soap/Initialize()
. = ..()
AddComponent(/datum/component/slippery, 80)
/obj/item/soap/nanotrasen
desc = "A Nanotrasen brand bar of soap. Smells of plasma."
icon_state = "soapnt"
/obj/item/soap/homemade
desc = "A homemade bar of soap. Smells of... well...."
icon_state = "soapgibs"
cleanspeed = 45 // a little faster to reward chemists for going to the effort
/obj/item/soap/deluxe
desc = "A deluxe Waffle Co. brand bar of soap. Smells of high-class luxury."
icon_state = "soapdeluxe"
cleanspeed = 40 //same speed as mop because deluxe -- captain gets one of these
/obj/item/soap/syndie
desc = "An untrustworthy bar of soap made of strong chemical agents that dissolve blood faster."
icon_state = "soapsyndie"
cleanspeed = 10 //much faster than mop so it is useful for traitors who want to clean crime scenes
/obj/item/soap/suicide_act(mob/user)
user.say(";FFFFFFFFFFFFFFFFUUUUUUUDGE!!", forced="soap suicide")
user.visible_message("<span class='suicide'>[user] lifts [src] to [user.p_their()] mouth and gnaws on it furiously, producing a thick froth! [user.p_they(TRUE)]'ll never get that BB gun now!</span>")
new /obj/effect/particle_effect/foam(loc)
return (TOXLOSS)
/obj/item/soap/afterattack(atom/target, mob/user, proximity)
. = ..()
if(!proximity || !check_allowed_items(target))
return
//I couldn't feasibly fix the overlay bugs caused by cleaning items we are wearing.
//So this is a workaround. This also makes more sense from an IC standpoint. ~Carn
if(user.client && ((target in user.client.screen) && !user.is_holding(target)))
to_chat(user, "<span class='warning'>You need to take that [target.name] off before cleaning it!</span>")
else if(istype(target, /obj/effect/decal/cleanable))
user.visible_message("[user] begins to scrub \the [target.name] out with [src].", "<span class='warning'>You begin to scrub \the [target.name] out with [src]...</span>")
if(do_after(user, src.cleanspeed, target = target))
to_chat(user, "<span class='notice'>You scrub \the [target.name] out.</span>")
qdel(target)
else if(ishuman(target) && user.zone_selected == BODY_ZONE_PRECISE_MOUTH)
var/mob/living/carbon/human/H = user
user.visible_message("<span class='warning'>\the [user] washes \the [target]'s mouth out with [src.name]!</span>", "<span class='notice'>You wash \the [target]'s mouth out with [src.name]!</span>") //washes mouth out with soap sounds better than 'the soap' here
H.lip_style = null //removes lipstick
H.update_body()
return
else if(istype(target, /obj/structure/window))
user.visible_message("[user] begins to clean \the [target.name] with [src]...", "<span class='notice'>You begin to clean \the [target.name] with [src]...</span>")
if(do_after(user, src.cleanspeed, target = target))
to_chat(user, "<span class='notice'>You clean \the [target.name].</span>")
target.remove_atom_colour(WASHABLE_COLOUR_PRIORITY)
target.set_opacity(initial(target.opacity))
else
user.visible_message("[user] begins to clean \the [target.name] with [src]...", "<span class='notice'>You begin to clean \the [target.name] with [src]...</span>")
if(do_after(user, src.cleanspeed, target = target))
to_chat(user, "<span class='notice'>You clean \the [target.name].</span>")
var/obj/effect/decal/cleanable/C = locate() in target
qdel(C)
target.remove_atom_colour(WASHABLE_COLOUR_PRIORITY)
SEND_SIGNAL(target, COMSIG_COMPONENT_CLEAN_ACT, CLEAN_MEDIUM)
target.wash_cream()
return
/*
* Bike Horns
*/
/obj/item/bikehorn
name = "bike horn"
desc = "A horn off of a bicycle."
icon = 'icons/obj/items_and_weapons.dmi'
icon_state = "bike_horn"
item_state = "bike_horn"
lefthand_file = 'icons/mob/inhands/equipment/horns_lefthand.dmi'
righthand_file = 'icons/mob/inhands/equipment/horns_righthand.dmi'
throwforce = 0
hitsound = null //To prevent tap.ogg playing, as the item lacks of force
w_class = WEIGHT_CLASS_TINY
throw_speed = 3
throw_range = 7
attack_verb = list("HONKED")
var/moodlet = "honk" //used to define which kind of moodlet is added to the honked target
var/list/honksounds = list('sound/items/bikehorn.ogg' = 1)
/obj/item/bikehorn/ComponentInitialize()
. = ..()
AddComponent(/datum/component/squeak, honksounds, 50)
/obj/item/bikehorn/attack(mob/living/carbon/M, mob/living/carbon/user)
SEND_SIGNAL(M, COMSIG_ADD_MOOD_EVENT, moodlet, /datum/mood_event/honk)
return ..()
/obj/item/bikehorn/suicide_act(mob/user)
user.visible_message("<span class='suicide'>[user] solemnly points the horn at [user.p_their()] temple! It looks like [user.p_theyre()] trying to commit suicide!</span>")
playsound(src, pickweight(honksounds), 50, 1)
return (BRUTELOSS)
//air horn
/obj/item/bikehorn/airhorn
name = "air horn"
desc = "Damn son, where'd you find this?"
icon_state = "air_horn"
honksounds = list('sound/items/airhorn2.ogg' = 1)
//golden bikehorn
/obj/item/bikehorn/golden
name = "golden bike horn"
desc = "Golden? Clearly, it's made with bananium! Honk!"
icon_state = "gold_horn"
item_state = "gold_horn"
var/flip_cooldown = 0
/obj/item/bikehorn/golden/attack()
if(flip_cooldown < world.time)
flip_mobs()
return ..()
/obj/item/bikehorn/golden/attack_self(mob/user)
if(flip_cooldown < world.time)
flip_mobs()
..()
/obj/item/bikehorn/golden/proc/flip_mobs(mob/living/carbon/M, mob/user)
var/turf/T = get_turf(src)
for(M in ohearers(7, T))
if(ishuman(M) && M.can_hear())
var/mob/living/carbon/human/H = M
if(istype(H.ears, /obj/item/clothing/ears/earmuffs))
continue
M.emote("flip")
flip_cooldown = world.time + 7
/obj/item/bikehorn/silver
name = "silver bike horn"
desc = "A shiny bike horn handcrafted in the artisan workshops of Mars, with superior kevlar-reinforced rubber bulb attached to a polished plasteel reed horn."
attack_verb = list("elegantly HONKED")
icon_state = "silverhorn"
/obj/item/bikehorn/bluespacehonker
name = "bluespace bike horn"
desc = "A normal bike horn colored blue and has bluespace dust held in to reed horn allowing for silly honks through space and time, into your in childhood."
attack_verb = list("HONKED in bluespace", "HONKED", "quantumly HONKED")
icon_state = "bluespacehonker"
moodlet = "bshonk"
//canned laughter
/obj/item/reagent_containers/food/drinks/soda_cans/canned_laughter
name = "Canned Laughter"
desc = "Just looking at this makes you want to giggle."
icon_state = "laughter"
list_reagents = list(/datum/reagent/consumable/laughter = 50)
+190 -190
View File
@@ -1,191 +1,191 @@
/obj/item/lipstick
gender = PLURAL
name = "red lipstick"
desc = "A generic brand of lipstick."
icon = 'icons/obj/items_and_weapons.dmi'
icon_state = "lipstick"
w_class = WEIGHT_CLASS_TINY
var/colour = "red"
var/open = FALSE
/obj/item/lipstick/purple
name = "purple lipstick"
colour = "purple"
/obj/item/lipstick/jade
//It's still called Jade, but theres no HTML color for jade, so we use lime.
name = "jade lipstick"
colour = "lime"
/obj/item/lipstick/black
name = "black lipstick"
colour = "black"
/obj/item/lipstick/random
name = "lipstick"
icon_state = "random_lipstick"
/obj/item/lipstick/random/New()
..()
icon_state = "lipstick"
colour = pick("red","purple","lime","black","green","blue","white")
name = "[colour] lipstick"
/obj/item/lipstick/attack_self(mob/user)
cut_overlays()
to_chat(user, "<span class='notice'>You twist \the [src] [open ? "closed" : "open"].</span>")
open = !open
if(open)
var/mutable_appearance/colored_overlay = mutable_appearance(icon, "lipstick_uncap_color")
colored_overlay.color = colour
icon_state = "lipstick_uncap"
add_overlay(colored_overlay)
else
icon_state = "lipstick"
/obj/item/lipstick/attack(mob/M, mob/user)
if(!open)
return
if(!ismob(M))
return
if(ishuman(M))
var/mob/living/carbon/human/H = M
if(H.is_mouth_covered())
to_chat(user, "<span class='warning'>Remove [ H == user ? "your" : "[H.p_their()]" ] mask!</span>")
return
if(H.lip_style) //if they already have lipstick on
to_chat(user, "<span class='warning'>You need to wipe off the old lipstick first!</span>")
return
if(H == user)
user.visible_message("<span class='notice'>[user] does [user.p_their()] lips with \the [src].</span>", \
"<span class='notice'>You take a moment to apply \the [src]. Perfect!</span>")
H.lip_style = "lipstick"
H.lip_color = colour
H.update_body()
else
user.visible_message("<span class='warning'>[user] begins to do [H]'s lips with \the [src].</span>", \
"<span class='notice'>You begin to apply \the [src] on [H]'s lips...</span>")
if(do_after(user, 20, target = H))
user.visible_message("[user] does [H]'s lips with \the [src].", \
"<span class='notice'>You apply \the [src] on [H]'s lips.</span>")
H.lip_style = "lipstick"
H.lip_color = colour
H.update_body()
else
to_chat(user, "<span class='warning'>Where are the lips on that?</span>")
//you can wipe off lipstick with paper!
/obj/item/paper/attack(mob/M, mob/user)
if(user.zone_selected == BODY_ZONE_PRECISE_MOUTH)
if(!ismob(M))
return
if(ishuman(M))
var/mob/living/carbon/human/H = M
if(H == user)
to_chat(user, "<span class='notice'>You wipe off the lipstick with [src].</span>")
H.lip_style = null
H.update_body()
else
user.visible_message("<span class='warning'>[user] begins to wipe [H]'s lipstick off with \the [src].</span>", \
"<span class='notice'>You begin to wipe off [H]'s lipstick...</span>")
if(do_after(user, 10, target = H))
user.visible_message("[user] wipes [H]'s lipstick off with \the [src].", \
"<span class='notice'>You wipe off [H]'s lipstick.</span>")
H.lip_style = null
H.update_body()
else
..()
/obj/item/razor
name = "electric razor"
desc = "The latest and greatest power razor born from the science of shaving."
icon = 'icons/obj/items_and_weapons.dmi'
icon_state = "razor"
flags_1 = CONDUCT_1
w_class = WEIGHT_CLASS_TINY
/obj/item/razor/suicide_act(mob/living/carbon/user)
user.visible_message("<span class='suicide'>[user] begins shaving [user.p_them()]self without the razor guard! It looks like [user.p_theyre()] trying to commit suicide!</span>")
shave(user, BODY_ZONE_PRECISE_MOUTH)
shave(user, BODY_ZONE_HEAD)//doesnt need to be BODY_ZONE_HEAD specifically, but whatever
return BRUTELOSS
/obj/item/razor/proc/shave(mob/living/carbon/human/H, location = BODY_ZONE_PRECISE_MOUTH)
if(location == BODY_ZONE_PRECISE_MOUTH)
H.facial_hair_style = "Shaved"
else
H.hair_style = "Skinhead"
H.update_hair()
playsound(loc, 'sound/items/welder2.ogg', 20, 1)
/obj/item/razor/attack(mob/M, mob/user)
if(ishuman(M))
var/mob/living/carbon/human/H = M
var/location = user.zone_selected
if((location in list(BODY_ZONE_PRECISE_EYES, BODY_ZONE_PRECISE_MOUTH, BODY_ZONE_HEAD)) && !H.get_bodypart(BODY_ZONE_HEAD))
to_chat(user, "<span class='warning'>[H] doesn't have a head!</span>")
return
if(location == BODY_ZONE_PRECISE_MOUTH)
if(!(FACEHAIR in H.dna.species.species_traits))
to_chat(user, "<span class='warning'>There is no facial hair to shave!</span>")
return
if(!get_location_accessible(H, location))
to_chat(user, "<span class='warning'>The mask is in the way!</span>")
return
if(H.facial_hair_style == "Shaved")
to_chat(user, "<span class='warning'>Already clean-shaven!</span>")
return
if(H == user) //shaving yourself
user.visible_message("[user] starts to shave [user.p_their()] facial hair with [src].", \
"<span class='notice'>You take a moment to shave your facial hair with [src]...</span>")
if(do_after(user, 50, target = H))
user.visible_message("[user] shaves [user.p_their()] facial hair clean with [src].", \
"<span class='notice'>You finish shaving with [src]. Fast and clean!</span>")
shave(H, location)
else
var/turf/H_loc = H.loc
user.visible_message("<span class='warning'>[user] tries to shave [H]'s facial hair with [src].</span>", \
"<span class='notice'>You start shaving [H]'s facial hair...</span>")
if(do_after(user, 50, target = H))
if(H_loc == H.loc)
user.visible_message("<span class='warning'>[user] shaves off [H]'s facial hair with [src].</span>", \
"<span class='notice'>You shave [H]'s facial hair clean off.</span>")
shave(H, location)
else if(location == BODY_ZONE_HEAD)
if(!(HAIR in H.dna.species.species_traits))
to_chat(user, "<span class='warning'>There is no hair to shave!</span>")
return
if(!get_location_accessible(H, location))
to_chat(user, "<span class='warning'>The headgear is in the way!</span>")
return
if(H.hair_style == "Bald" || H.hair_style == "Balding Hair" || H.hair_style == "Skinhead")
to_chat(user, "<span class='warning'>There is not enough hair left to shave!</span>")
return
if(H == user) //shaving yourself
user.visible_message("[user] starts to shave [user.p_their()] head with [src].", \
"<span class='notice'>You start to shave your head with [src]...</span>")
if(do_after(user, 5, target = H))
user.visible_message("[user] shaves [user.p_their()] head with [src].", \
"<span class='notice'>You finish shaving with [src].</span>")
shave(H, location)
else
var/turf/H_loc = H.loc
user.visible_message("<span class='warning'>[user] tries to shave [H]'s head with [src]!</span>", \
"<span class='notice'>You start shaving [H]'s head...</span>")
if(do_after(user, 50, target = H))
if(H_loc == H.loc)
user.visible_message("<span class='warning'>[user] shaves [H]'s head bald with [src]!</span>", \
"<span class='notice'>You shave [H]'s head bald.</span>")
shave(H, location)
else
..()
else
/obj/item/lipstick
gender = PLURAL
name = "red lipstick"
desc = "A generic brand of lipstick."
icon = 'icons/obj/items_and_weapons.dmi'
icon_state = "lipstick"
w_class = WEIGHT_CLASS_TINY
var/colour = "red"
var/open = FALSE
/obj/item/lipstick/purple
name = "purple lipstick"
colour = "purple"
/obj/item/lipstick/jade
//It's still called Jade, but theres no HTML color for jade, so we use lime.
name = "jade lipstick"
colour = "lime"
/obj/item/lipstick/black
name = "black lipstick"
colour = "black"
/obj/item/lipstick/random
name = "lipstick"
icon_state = "random_lipstick"
/obj/item/lipstick/random/New()
..()
icon_state = "lipstick"
colour = pick("red","purple","lime","black","green","blue","white")
name = "[colour] lipstick"
/obj/item/lipstick/attack_self(mob/user)
cut_overlays()
to_chat(user, "<span class='notice'>You twist \the [src] [open ? "closed" : "open"].</span>")
open = !open
if(open)
var/mutable_appearance/colored_overlay = mutable_appearance(icon, "lipstick_uncap_color")
colored_overlay.color = colour
icon_state = "lipstick_uncap"
add_overlay(colored_overlay)
else
icon_state = "lipstick"
/obj/item/lipstick/attack(mob/M, mob/user)
if(!open)
return
if(!ismob(M))
return
if(ishuman(M))
var/mob/living/carbon/human/H = M
if(H.is_mouth_covered())
to_chat(user, "<span class='warning'>Remove [ H == user ? "your" : "[H.p_their()]" ] mask!</span>")
return
if(H.lip_style) //if they already have lipstick on
to_chat(user, "<span class='warning'>You need to wipe off the old lipstick first!</span>")
return
if(H == user)
user.visible_message("<span class='notice'>[user] does [user.p_their()] lips with \the [src].</span>", \
"<span class='notice'>You take a moment to apply \the [src]. Perfect!</span>")
H.lip_style = "lipstick"
H.lip_color = colour
H.update_body()
else
user.visible_message("<span class='warning'>[user] begins to do [H]'s lips with \the [src].</span>", \
"<span class='notice'>You begin to apply \the [src] on [H]'s lips...</span>")
if(do_after(user, 20, target = H))
user.visible_message("[user] does [H]'s lips with \the [src].", \
"<span class='notice'>You apply \the [src] on [H]'s lips.</span>")
H.lip_style = "lipstick"
H.lip_color = colour
H.update_body()
else
to_chat(user, "<span class='warning'>Where are the lips on that?</span>")
//you can wipe off lipstick with paper!
/obj/item/paper/attack(mob/M, mob/user)
if(user.zone_selected == BODY_ZONE_PRECISE_MOUTH)
if(!ismob(M))
return
if(ishuman(M))
var/mob/living/carbon/human/H = M
if(H == user)
to_chat(user, "<span class='notice'>You wipe off the lipstick with [src].</span>")
H.lip_style = null
H.update_body()
else
user.visible_message("<span class='warning'>[user] begins to wipe [H]'s lipstick off with \the [src].</span>", \
"<span class='notice'>You begin to wipe off [H]'s lipstick...</span>")
if(do_after(user, 10, target = H))
user.visible_message("[user] wipes [H]'s lipstick off with \the [src].", \
"<span class='notice'>You wipe off [H]'s lipstick.</span>")
H.lip_style = null
H.update_body()
else
..()
/obj/item/razor
name = "electric razor"
desc = "The latest and greatest power razor born from the science of shaving."
icon = 'icons/obj/items_and_weapons.dmi'
icon_state = "razor"
flags_1 = CONDUCT_1
w_class = WEIGHT_CLASS_TINY
/obj/item/razor/suicide_act(mob/living/carbon/user)
user.visible_message("<span class='suicide'>[user] begins shaving [user.p_them()]self without the razor guard! It looks like [user.p_theyre()] trying to commit suicide!</span>")
shave(user, BODY_ZONE_PRECISE_MOUTH)
shave(user, BODY_ZONE_HEAD)//doesnt need to be BODY_ZONE_HEAD specifically, but whatever
return BRUTELOSS
/obj/item/razor/proc/shave(mob/living/carbon/human/H, location = BODY_ZONE_PRECISE_MOUTH)
if(location == BODY_ZONE_PRECISE_MOUTH)
H.facial_hair_style = "Shaved"
else
H.hair_style = "Skinhead"
H.update_hair()
playsound(loc, 'sound/items/welder2.ogg', 20, 1)
/obj/item/razor/attack(mob/M, mob/user)
if(ishuman(M))
var/mob/living/carbon/human/H = M
var/location = user.zone_selected
if((location in list(BODY_ZONE_PRECISE_EYES, BODY_ZONE_PRECISE_MOUTH, BODY_ZONE_HEAD)) && !H.get_bodypart(BODY_ZONE_HEAD))
to_chat(user, "<span class='warning'>[H] doesn't have a head!</span>")
return
if(location == BODY_ZONE_PRECISE_MOUTH)
if(!(FACEHAIR in H.dna.species.species_traits))
to_chat(user, "<span class='warning'>There is no facial hair to shave!</span>")
return
if(!get_location_accessible(H, location))
to_chat(user, "<span class='warning'>The mask is in the way!</span>")
return
if(H.facial_hair_style == "Shaved")
to_chat(user, "<span class='warning'>Already clean-shaven!</span>")
return
if(H == user) //shaving yourself
user.visible_message("[user] starts to shave [user.p_their()] facial hair with [src].", \
"<span class='notice'>You take a moment to shave your facial hair with [src]...</span>")
if(do_after(user, 50, target = H))
user.visible_message("[user] shaves [user.p_their()] facial hair clean with [src].", \
"<span class='notice'>You finish shaving with [src]. Fast and clean!</span>")
shave(H, location)
else
var/turf/H_loc = H.loc
user.visible_message("<span class='warning'>[user] tries to shave [H]'s facial hair with [src].</span>", \
"<span class='notice'>You start shaving [H]'s facial hair...</span>")
if(do_after(user, 50, target = H))
if(H_loc == H.loc)
user.visible_message("<span class='warning'>[user] shaves off [H]'s facial hair with [src].</span>", \
"<span class='notice'>You shave [H]'s facial hair clean off.</span>")
shave(H, location)
else if(location == BODY_ZONE_HEAD)
if(!(HAIR in H.dna.species.species_traits))
to_chat(user, "<span class='warning'>There is no hair to shave!</span>")
return
if(!get_location_accessible(H, location))
to_chat(user, "<span class='warning'>The headgear is in the way!</span>")
return
if(H.hair_style == "Bald" || H.hair_style == "Balding Hair" || H.hair_style == "Skinhead")
to_chat(user, "<span class='warning'>There is not enough hair left to shave!</span>")
return
if(H == user) //shaving yourself
user.visible_message("[user] starts to shave [user.p_their()] head with [src].", \
"<span class='notice'>You start to shave your head with [src]...</span>")
if(do_after(user, 5, target = H))
user.visible_message("[user] shaves [user.p_their()] head with [src].", \
"<span class='notice'>You finish shaving with [src].</span>")
shave(H, location)
else
var/turf/H_loc = H.loc
user.visible_message("<span class='warning'>[user] tries to shave [H]'s head with [src]!</span>", \
"<span class='notice'>You start shaving [H]'s head...</span>")
if(do_after(user, 50, target = H))
if(H_loc == H.loc)
user.visible_message("<span class='warning'>[user] shaves [H]'s head bald with [src]!</span>", \
"<span class='notice'>You shave [H]'s head bald.</span>")
shave(H, location)
else
..()
else
..()
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+38 -38
View File
@@ -1,38 +1,38 @@
// Radio Cartridge, essentially a remote signaler with limited spectrum.
/obj/item/integrated_signaler
name = "\improper PDA radio module"
desc = "An electronic radio system of Nanotrasen origin."
icon = 'icons/obj/module.dmi'
icon_state = "power_mod"
/obj/item/integrated_signaler
var/frequency = FREQ_SIGNALER
var/code = DEFAULT_SIGNALER_CODE
var/last_transmission
var/datum/radio_frequency/radio_connection
/obj/item/integrated_signaler/Destroy()
radio_connection = null
return ..()
/obj/item/integrated_signaler/Initialize()
. = ..()
if (frequency < MIN_FREE_FREQ || frequency > MAX_FREE_FREQ)
frequency = sanitize_frequency(frequency)
set_frequency(frequency)
/obj/item/integrated_signaler/proc/set_frequency(new_frequency)
frequency = new_frequency
radio_connection = SSradio.return_frequency(frequency)
/obj/item/integrated_signaler/proc/send_activation()
if(last_transmission && world.time < (last_transmission + 5))
return
last_transmission = world.time
var/time = time2text(world.realtime,"hh:mm:ss")
var/turf/T = get_turf(src)
GLOB.lastsignalers.Add("[time] <B>:</B> [usr.key] used [src] @ location [AREACOORD(T)] <B>:</B> [format_frequency(frequency)]/[code]")
var/datum/signal/signal = new(list("code" = code))
radio_connection.post_signal(src, signal, filter = RADIO_SIGNALER)
// Radio Cartridge, essentially a remote signaler with limited spectrum.
/obj/item/integrated_signaler
name = "\improper PDA radio module"
desc = "An electronic radio system of Nanotrasen origin."
icon = 'icons/obj/module.dmi'
icon_state = "power_mod"
/obj/item/integrated_signaler
var/frequency = FREQ_SIGNALER
var/code = DEFAULT_SIGNALER_CODE
var/last_transmission
var/datum/radio_frequency/radio_connection
/obj/item/integrated_signaler/Destroy()
radio_connection = null
return ..()
/obj/item/integrated_signaler/Initialize()
. = ..()
if (frequency < MIN_FREE_FREQ || frequency > MAX_FREE_FREQ)
frequency = sanitize_frequency(frequency)
set_frequency(frequency)
/obj/item/integrated_signaler/proc/set_frequency(new_frequency)
frequency = new_frequency
radio_connection = SSradio.return_frequency(frequency)
/obj/item/integrated_signaler/proc/send_activation()
if(last_transmission && world.time < (last_transmission + 5))
return
last_transmission = world.time
var/time = time2text(world.realtime,"hh:mm:ss")
var/turf/T = get_turf(src)
GLOB.lastsignalers.Add("[time] <B>:</B> [usr.key] used [src] @ location [AREACOORD(T)] <B>:</B> [format_frequency(frequency)]/[code]")
var/datum/signal/signal = new(list("code" = code))
radio_connection.post_signal(src, signal, filter = RADIO_SIGNALER)
+104 -104
View File
@@ -1,104 +1,104 @@
/obj/item/aicard
name = "intelliCard"
desc = "A storage device for AIs. Patent pending."
icon = 'icons/obj/aicards.dmi'
icon_state = "aicard" // aicard-full
item_state = "electronic"
lefthand_file = 'icons/mob/inhands/misc/devices_lefthand.dmi'
righthand_file = 'icons/mob/inhands/misc/devices_righthand.dmi'
w_class = WEIGHT_CLASS_SMALL
slot_flags = ITEM_SLOT_BELT
item_flags = NOBLUDGEON
var/flush = FALSE
var/mob/living/silicon/ai/AI
/obj/item/aicard/aitater
name = "intelliTater"
desc = "A stylish upgrade (?) to the intelliCard."
icon_state = "aitater"
/obj/item/aicard/aispook
name = "intelliLantern"
desc = "A spoOoOoky upgrade to the intelliCard."
icon_state = "aispook"
/obj/item/aicard/suicide_act(mob/living/user)
user.visible_message("<span class='suicide'>[user] is trying to upload [user.p_them()]self into [src]! That's not going to work out well!</span>")
return BRUTELOSS
/obj/item/aicard/afterattack(atom/target, mob/user, proximity)
. = ..()
if(!proximity || !target)
return
if(AI) //AI is on the card, implies user wants to upload it.
log_combat(user, AI, "carded", src)
target.transfer_ai(AI_TRANS_FROM_CARD, user, AI, src)
else //No AI on the card, therefore the user wants to download one.
target.transfer_ai(AI_TRANS_TO_CARD, user, null, src)
if(AI)
log_combat(user, AI, "carded", src)
update_icon() //Whatever happened, update the card's state (icon, name) to match.
/obj/item/aicard/update_icon()
cut_overlays()
if(AI)
name = "[initial(name)] - [AI.name]"
if(AI.stat == DEAD)
icon_state = "[initial(icon_state)]-404"
else
icon_state = "[initial(icon_state)]-full"
if(!AI.control_disabled)
add_overlay("[initial(icon_state)]-on")
AI.cancel_camera()
else
name = initial(name)
icon_state = initial(icon_state)
/obj/item/aicard/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, \
datum/tgui/master_ui = null, datum/ui_state/state = GLOB.hands_state)
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
if(!ui)
ui = new(user, src, ui_key, "intellicard", name, 500, 500, master_ui, state)
ui.open()
/obj/item/aicard/ui_data()
var/list/data = list()
if(AI)
data["name"] = AI.name
data["laws"] = AI.laws.get_law_list(include_zeroth = 1)
data["health"] = (AI.health + 100) / 2
data["wireless"] = !AI.control_disabled //todo disabled->enabled
data["radio"] = AI.radio_enabled
data["isDead"] = AI.stat == DEAD
data["isBraindead"] = AI.client ? FALSE : TRUE
data["wiping"] = flush
return data
/obj/item/aicard/ui_act(action,params)
if(..())
return
switch(action)
if("wipe")
if(flush)
flush = FALSE
else
var/confirm = alert("Are you sure you want to wipe this card's memory?", name, "Yes", "No")
if(confirm == "Yes" && !..())
flush = TRUE
if(AI && AI.loc == src)
to_chat(AI, "Your core files are being wiped!")
while(AI.stat != DEAD && flush)
AI.adjustOxyLoss(1)
AI.updatehealth()
sleep(5)
flush = FALSE
. = TRUE
if("wireless")
AI.control_disabled = !AI.control_disabled
to_chat(AI, "[src]'s wireless port has been [AI.control_disabled ? "disabled" : "enabled"]!")
. = TRUE
if("radio")
AI.radio_enabled = !AI.radio_enabled
to_chat(AI, "Your Subspace Transceiver has been [AI.radio_enabled ? "enabled" : "disabled"]!")
. = TRUE
update_icon()
/obj/item/aicard
name = "intelliCard"
desc = "A storage device for AIs. Patent pending."
icon = 'icons/obj/aicards.dmi'
icon_state = "aicard" // aicard-full
item_state = "electronic"
lefthand_file = 'icons/mob/inhands/misc/devices_lefthand.dmi'
righthand_file = 'icons/mob/inhands/misc/devices_righthand.dmi'
w_class = WEIGHT_CLASS_SMALL
slot_flags = ITEM_SLOT_BELT
item_flags = NOBLUDGEON
var/flush = FALSE
var/mob/living/silicon/ai/AI
/obj/item/aicard/aitater
name = "intelliTater"
desc = "A stylish upgrade (?) to the intelliCard."
icon_state = "aitater"
/obj/item/aicard/aispook
name = "intelliLantern"
desc = "A spoOoOoky upgrade to the intelliCard."
icon_state = "aispook"
/obj/item/aicard/suicide_act(mob/living/user)
user.visible_message("<span class='suicide'>[user] is trying to upload [user.p_them()]self into [src]! That's not going to work out well!</span>")
return BRUTELOSS
/obj/item/aicard/afterattack(atom/target, mob/user, proximity)
. = ..()
if(!proximity || !target)
return
if(AI) //AI is on the card, implies user wants to upload it.
log_combat(user, AI, "carded", src)
target.transfer_ai(AI_TRANS_FROM_CARD, user, AI, src)
else //No AI on the card, therefore the user wants to download one.
target.transfer_ai(AI_TRANS_TO_CARD, user, null, src)
if(AI)
log_combat(user, AI, "carded", src)
update_icon() //Whatever happened, update the card's state (icon, name) to match.
/obj/item/aicard/update_icon()
cut_overlays()
if(AI)
name = "[initial(name)] - [AI.name]"
if(AI.stat == DEAD)
icon_state = "[initial(icon_state)]-404"
else
icon_state = "[initial(icon_state)]-full"
if(!AI.control_disabled)
add_overlay("[initial(icon_state)]-on")
AI.cancel_camera()
else
name = initial(name)
icon_state = initial(icon_state)
/obj/item/aicard/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, \
datum/tgui/master_ui = null, datum/ui_state/state = GLOB.hands_state)
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
if(!ui)
ui = new(user, src, ui_key, "intellicard", name, 500, 500, master_ui, state)
ui.open()
/obj/item/aicard/ui_data()
var/list/data = list()
if(AI)
data["name"] = AI.name
data["laws"] = AI.laws.get_law_list(include_zeroth = 1)
data["health"] = (AI.health + 100) / 2
data["wireless"] = !AI.control_disabled //todo disabled->enabled
data["radio"] = AI.radio_enabled
data["isDead"] = AI.stat == DEAD
data["isBraindead"] = AI.client ? FALSE : TRUE
data["wiping"] = flush
return data
/obj/item/aicard/ui_act(action,params)
if(..())
return
switch(action)
if("wipe")
if(flush)
flush = FALSE
else
var/confirm = alert("Are you sure you want to wipe this card's memory?", name, "Yes", "No")
if(confirm == "Yes" && !..())
flush = TRUE
if(AI && AI.loc == src)
to_chat(AI, "Your core files are being wiped!")
while(AI.stat != DEAD && flush)
AI.adjustOxyLoss(1)
AI.updatehealth()
sleep(5)
flush = FALSE
. = TRUE
if("wireless")
AI.control_disabled = !AI.control_disabled
to_chat(AI, "[src]'s wireless port has been [AI.control_disabled ? "disabled" : "enabled"]!")
. = TRUE
if("radio")
AI.radio_enabled = !AI.radio_enabled
to_chat(AI, "Your Subspace Transceiver has been [AI.radio_enabled ? "enabled" : "disabled"]!")
. = TRUE
update_icon()
+308 -308
View File
@@ -1,308 +1,308 @@
#define BUGMODE_LIST 0
#define BUGMODE_MONITOR 1
#define BUGMODE_TRACK 2
/obj/item/camera_bug
name = "camera bug"
desc = "For illicit snooping through the camera network."
icon = 'icons/obj/device.dmi'
icon_state = "camera_bug"
w_class = WEIGHT_CLASS_TINY
item_state = "camera_bug"
throw_speed = 4
throw_range = 20
item_flags = NOBLUDGEON
var/obj/machinery/camera/current = null
var/last_net_update = 0
var/list/bugged_cameras = list()
var/track_mode = BUGMODE_LIST
var/last_tracked = 0
var/refresh_interval = 50
var/tracked_name = null
var/atom/tracking = null
var/last_found = null
var/last_seen = null
/obj/item/camera_bug/New()
..()
START_PROCESSING(SSobj, src)
/obj/item/camera_bug/Destroy()
get_cameras()
for(var/cam_tag in bugged_cameras)
var/obj/machinery/camera/camera = bugged_cameras[cam_tag]
if(camera.bug == src)
camera.bug = null
bugged_cameras = list()
if(tracking)
tracking = null
return ..()
/obj/item/camera_bug/interact(mob/user)
ui_interact(user)
/obj/item/camera_bug/ui_interact(mob/user = usr)
. = ..()
var/datum/browser/popup = new(user, "camerabug","Camera Bug",nref=src)
popup.set_content(menu(get_cameras()))
popup.open()
/obj/item/camera_bug/attack_self(mob/user)
user.set_machine(src)
interact(user)
/obj/item/camera_bug/check_eye(mob/user)
if ( loc != user || user.incapacitated() || user.eye_blind || !current )
user.unset_machine()
return 0
var/turf/T_user = get_turf(user.loc)
var/turf/T_current = get_turf(current)
if(T_user.z != T_current.z || !current.can_use())
to_chat(user, "<span class='danger'>[src] has lost the signal.</span>")
current = null
user.unset_machine()
return 0
return 1
/obj/item/camera_bug/on_unset_machine(mob/user)
user.reset_perspective(null)
/obj/item/camera_bug/proc/get_cameras()
if( world.time > (last_net_update + 100))
bugged_cameras = list()
for(var/obj/machinery/camera/camera in GLOB.cameranet.cameras)
if(camera.stat || !camera.can_use())
continue
if(length(list("ss13","mine", "rd", "labor", "toxins", "minisat")&camera.network))
bugged_cameras[camera.c_tag] = camera
return sortList(bugged_cameras)
/obj/item/camera_bug/proc/menu(list/cameras)
if(!cameras || !cameras.len)
return "No bugged cameras found."
var/html
switch(track_mode)
if(BUGMODE_LIST)
html = "<h3>Select a camera:</h3> <a href='?src=[REF(src)];view'>\[Cancel camera view\]</a><hr><table>"
for(var/entry in cameras)
var/obj/machinery/camera/C = cameras[entry]
var/functions = ""
if(C.bug == src)
functions = " - <a href='?src=[REF(src)];monitor=[REF(C)]'>\[Monitor\]</a> <a href='?src=[REF(src)];emp=[REF(C)]'>\[Disable\]</a>"
else
functions = " - <a href='?src=[REF(src)];monitor=[REF(C)]'>\[Monitor\]</a>"
html += "<tr><td><a href='?src=[REF(src)];view=[REF(C)]'>[entry]</a></td><td>[functions]</td></tr>"
if(BUGMODE_MONITOR)
if(current)
html = "Analyzing Camera '[current.c_tag]' <a href='?[REF(src)];mode=0'>\[Select Camera\]</a><br>"
html += camera_report()
else
track_mode = BUGMODE_LIST
return .(cameras)
if(BUGMODE_TRACK)
if(tracking)
html = "Tracking '[tracked_name]' <a href='?[REF(src)];mode=0'>\[Cancel Tracking\]</a> <a href='?src=[REF(src)];view'>\[Cancel camera view\]</a><br>"
if(last_found)
var/time_diff = round((world.time - last_seen) / 150)
var/obj/machinery/camera/C = bugged_cameras[last_found]
var/outstring
if(C)
outstring = "<a href='?[REF(src)];view=[REF(C)]'>[last_found]</a>"
else
outstring = last_found
if(!time_diff)
html += "Last seen near [outstring] (now)<br>"
else
// 15 second intervals ~ 1/4 minute
var/m = round(time_diff/4)
var/s = (time_diff - 4*m) * 15
if(!s)
s = "00"
html += "Last seen near [outstring] ([m]:[s] minute\s ago)<br>"
if( C && (C.bug == src)) //Checks to see if the camera has a bug
html += "<a href='?src=[REF(src)];emp=[REF(C)]'>\[Disable\]</a>"
else
html += "Not yet seen."
else
track_mode = BUGMODE_LIST
return .(cameras)
return html
/obj/item/camera_bug/proc/get_seens()
if(current && current.can_use())
var/list/seen = current.can_see()
return seen
/obj/item/camera_bug/proc/camera_report()
// this should only be called if current exists
var/dat = ""
var/list/seen = get_seens()
if(seen && seen.len >= 1)
var/list/names = list()
for(var/obj/singularity/S in seen) // god help you if you see more than one
if(S.name in names)
names[S.name]++
dat += "[S.name] ([names[S.name]])"
else
names[S.name] = 1
dat += "[S.name]"
var/stage = round(S.current_size / 2)+1
dat += " (Stage [stage])"
dat += " <a href='?[REF(src)];track=[REF(S)]'>\[Track\]</a><br>"
for(var/obj/mecha/M in seen)
if(M.name in names)
names[M.name]++
dat += "[M.name] ([names[M.name]])"
else
names[M.name] = 1
dat += "[M.name]"
dat += " <a href='?[REF(src)];track=[REF(M)]'>\[Track\]</a><br>"
for(var/mob/living/M in seen)
if(M.name in names)
names[M.name]++
dat += "[M.name] ([names[M.name]])"
else
names[M.name] = 1
dat += "[M.name]"
if(M.buckled && !M.lying)
dat += " (Sitting)"
if(M.lying)
dat += " (Laying down)"
dat += " <a href='?[REF(src)];track=[REF(M)]'>\[Track\]</a><br>"
if(length(dat) == 0)
dat += "No motion detected."
return dat
else
return "Camera Offline<br>"
/obj/item/camera_bug/Topic(href,list/href_list)
if(usr != loc)
usr.unset_machine()
usr << browse(null, "window=camerabug")
return
usr.set_machine(src)
if("mode" in href_list)
track_mode = text2num(href_list["mode"])
if("monitor" in href_list)
//You can't locate on a list with keys
var/list/cameras = flatten_list(bugged_cameras)
var/obj/machinery/camera/C = locate(href_list["monitor"]) in cameras
if(C && istype(C))
if(!same_z_level(C))
return
track_mode = BUGMODE_MONITOR
current = C
usr.reset_perspective(null)
interact()
if("track" in href_list)
var/list/seen = get_seens()
if(seen && seen.len >= 1)
var/atom/A = locate(href_list["track"]) in seen
if(A && istype(A))
tracking = A
tracked_name = A.name
last_found = current.c_tag
last_seen = world.time
track_mode = BUGMODE_TRACK
if("emp" in href_list)
//You can't locate on a list with keys
var/list/cameras = flatten_list(bugged_cameras)
var/obj/machinery/camera/C = locate(href_list["emp"]) in cameras
if(C && istype(C) && C.bug == src)
if(!same_z_level(C))
return
C.emp_act(EMP_HEAVY)
C.bug = null
bugged_cameras -= C.c_tag
interact()
return
if("close" in href_list)
usr.unset_machine()
current = null
return
if("view" in href_list)
//You can't locate on a list with keys
var/list/cameras = flatten_list(bugged_cameras)
var/obj/machinery/camera/C = locate(href_list["view"]) in cameras
if(C && istype(C))
if(!same_z_level(C))
return
if(!C.can_use())
to_chat(usr, "<span class='warning'>Something's wrong with that camera! You can't get a feed.</span>")
return
current = C
spawn(6)
if(src.check_eye(usr))
usr.reset_perspective(C)
interact()
else
usr.unset_machine()
usr << browse(null, "window=camerabug")
return
else
usr.unset_machine()
interact()
/obj/item/camera_bug/process()
if(track_mode == BUGMODE_LIST || (world.time < (last_tracked + refresh_interval)))
return
last_tracked = world.time
if(track_mode == BUGMODE_TRACK ) // search for user
// Note that it will be tricked if your name appears to change.
// This is not optimal but it is better than tracking you relentlessly despite everything.
if(!tracking)
src.updateSelfDialog()
return
if(tracking.name != tracked_name) // Hiding their identity, tricksy
var/mob/M = tracking
if(istype(M))
if(!(tracked_name == "Unknown" && findtext(tracking.name,"Unknown"))) // we saw then disguised before
if(!(tracked_name == M.real_name && findtext(tracking.name,M.real_name))) // or they're still ID'd
src.updateSelfDialog()//But if it's neither of those cases
return // you won't find em on the cameras
else
src.updateSelfDialog()
return
var/list/tracking_cams = list()
var/list/b_cams = get_cameras()
for(var/entry in b_cams)
tracking_cams += b_cams[entry]
var/list/target_region = view(tracking)
for(var/obj/machinery/camera/C in (target_region & tracking_cams))
if(!can_see(C,tracking)) // target may have xray, that doesn't make them visible to cameras
continue
if(C.can_use())
last_found = C.c_tag
last_seen = world.time
break
src.updateSelfDialog()
/obj/item/camera_bug/proc/same_z_level(var/obj/machinery/camera/C)
var/turf/T_cam = get_turf(C)
var/turf/T_bug = get_turf(loc)
if(!T_bug || T_cam.z != T_bug.z)
to_chat(usr, "<span class='warning'>You can't get a signal!</span>")
return FALSE
return TRUE
#undef BUGMODE_LIST
#undef BUGMODE_MONITOR
#undef BUGMODE_TRACK
#define BUGMODE_LIST 0
#define BUGMODE_MONITOR 1
#define BUGMODE_TRACK 2
/obj/item/camera_bug
name = "camera bug"
desc = "For illicit snooping through the camera network."
icon = 'icons/obj/device.dmi'
icon_state = "camera_bug"
w_class = WEIGHT_CLASS_TINY
item_state = "camera_bug"
throw_speed = 4
throw_range = 20
item_flags = NOBLUDGEON
var/obj/machinery/camera/current = null
var/last_net_update = 0
var/list/bugged_cameras = list()
var/track_mode = BUGMODE_LIST
var/last_tracked = 0
var/refresh_interval = 50
var/tracked_name = null
var/atom/tracking = null
var/last_found = null
var/last_seen = null
/obj/item/camera_bug/New()
..()
START_PROCESSING(SSobj, src)
/obj/item/camera_bug/Destroy()
get_cameras()
for(var/cam_tag in bugged_cameras)
var/obj/machinery/camera/camera = bugged_cameras[cam_tag]
if(camera.bug == src)
camera.bug = null
bugged_cameras = list()
if(tracking)
tracking = null
return ..()
/obj/item/camera_bug/interact(mob/user)
ui_interact(user)
/obj/item/camera_bug/ui_interact(mob/user = usr)
. = ..()
var/datum/browser/popup = new(user, "camerabug","Camera Bug",nref=src)
popup.set_content(menu(get_cameras()))
popup.open()
/obj/item/camera_bug/attack_self(mob/user)
user.set_machine(src)
interact(user)
/obj/item/camera_bug/check_eye(mob/user)
if ( loc != user || user.incapacitated() || user.eye_blind || !current )
user.unset_machine()
return 0
var/turf/T_user = get_turf(user.loc)
var/turf/T_current = get_turf(current)
if(T_user.z != T_current.z || !current.can_use())
to_chat(user, "<span class='danger'>[src] has lost the signal.</span>")
current = null
user.unset_machine()
return 0
return 1
/obj/item/camera_bug/on_unset_machine(mob/user)
user.reset_perspective(null)
/obj/item/camera_bug/proc/get_cameras()
if( world.time > (last_net_update + 100))
bugged_cameras = list()
for(var/obj/machinery/camera/camera in GLOB.cameranet.cameras)
if(camera.stat || !camera.can_use())
continue
if(length(list("ss13","mine", "rd", "labor", "toxins", "minisat")&camera.network))
bugged_cameras[camera.c_tag] = camera
return sortList(bugged_cameras)
/obj/item/camera_bug/proc/menu(list/cameras)
if(!cameras || !cameras.len)
return "No bugged cameras found."
var/html
switch(track_mode)
if(BUGMODE_LIST)
html = "<h3>Select a camera:</h3> <a href='?src=[REF(src)];view'>\[Cancel camera view\]</a><hr><table>"
for(var/entry in cameras)
var/obj/machinery/camera/C = cameras[entry]
var/functions = ""
if(C.bug == src)
functions = " - <a href='?src=[REF(src)];monitor=[REF(C)]'>\[Monitor\]</a> <a href='?src=[REF(src)];emp=[REF(C)]'>\[Disable\]</a>"
else
functions = " - <a href='?src=[REF(src)];monitor=[REF(C)]'>\[Monitor\]</a>"
html += "<tr><td><a href='?src=[REF(src)];view=[REF(C)]'>[entry]</a></td><td>[functions]</td></tr>"
if(BUGMODE_MONITOR)
if(current)
html = "Analyzing Camera '[current.c_tag]' <a href='?[REF(src)];mode=0'>\[Select Camera\]</a><br>"
html += camera_report()
else
track_mode = BUGMODE_LIST
return .(cameras)
if(BUGMODE_TRACK)
if(tracking)
html = "Tracking '[tracked_name]' <a href='?[REF(src)];mode=0'>\[Cancel Tracking\]</a> <a href='?src=[REF(src)];view'>\[Cancel camera view\]</a><br>"
if(last_found)
var/time_diff = round((world.time - last_seen) / 150)
var/obj/machinery/camera/C = bugged_cameras[last_found]
var/outstring
if(C)
outstring = "<a href='?[REF(src)];view=[REF(C)]'>[last_found]</a>"
else
outstring = last_found
if(!time_diff)
html += "Last seen near [outstring] (now)<br>"
else
// 15 second intervals ~ 1/4 minute
var/m = round(time_diff/4)
var/s = (time_diff - 4*m) * 15
if(!s)
s = "00"
html += "Last seen near [outstring] ([m]:[s] minute\s ago)<br>"
if( C && (C.bug == src)) //Checks to see if the camera has a bug
html += "<a href='?src=[REF(src)];emp=[REF(C)]'>\[Disable\]</a>"
else
html += "Not yet seen."
else
track_mode = BUGMODE_LIST
return .(cameras)
return html
/obj/item/camera_bug/proc/get_seens()
if(current && current.can_use())
var/list/seen = current.can_see()
return seen
/obj/item/camera_bug/proc/camera_report()
// this should only be called if current exists
var/dat = ""
var/list/seen = get_seens()
if(seen && seen.len >= 1)
var/list/names = list()
for(var/obj/singularity/S in seen) // god help you if you see more than one
if(S.name in names)
names[S.name]++
dat += "[S.name] ([names[S.name]])"
else
names[S.name] = 1
dat += "[S.name]"
var/stage = round(S.current_size / 2)+1
dat += " (Stage [stage])"
dat += " <a href='?[REF(src)];track=[REF(S)]'>\[Track\]</a><br>"
for(var/obj/mecha/M in seen)
if(M.name in names)
names[M.name]++
dat += "[M.name] ([names[M.name]])"
else
names[M.name] = 1
dat += "[M.name]"
dat += " <a href='?[REF(src)];track=[REF(M)]'>\[Track\]</a><br>"
for(var/mob/living/M in seen)
if(M.name in names)
names[M.name]++
dat += "[M.name] ([names[M.name]])"
else
names[M.name] = 1
dat += "[M.name]"
if(M.buckled && !M.lying)
dat += " (Sitting)"
if(M.lying)
dat += " (Laying down)"
dat += " <a href='?[REF(src)];track=[REF(M)]'>\[Track\]</a><br>"
if(length(dat) == 0)
dat += "No motion detected."
return dat
else
return "Camera Offline<br>"
/obj/item/camera_bug/Topic(href,list/href_list)
if(usr != loc)
usr.unset_machine()
usr << browse(null, "window=camerabug")
return
usr.set_machine(src)
if("mode" in href_list)
track_mode = text2num(href_list["mode"])
if("monitor" in href_list)
//You can't locate on a list with keys
var/list/cameras = flatten_list(bugged_cameras)
var/obj/machinery/camera/C = locate(href_list["monitor"]) in cameras
if(C && istype(C))
if(!same_z_level(C))
return
track_mode = BUGMODE_MONITOR
current = C
usr.reset_perspective(null)
interact()
if("track" in href_list)
var/list/seen = get_seens()
if(seen && seen.len >= 1)
var/atom/A = locate(href_list["track"]) in seen
if(A && istype(A))
tracking = A
tracked_name = A.name
last_found = current.c_tag
last_seen = world.time
track_mode = BUGMODE_TRACK
if("emp" in href_list)
//You can't locate on a list with keys
var/list/cameras = flatten_list(bugged_cameras)
var/obj/machinery/camera/C = locate(href_list["emp"]) in cameras
if(C && istype(C) && C.bug == src)
if(!same_z_level(C))
return
C.emp_act(EMP_HEAVY)
C.bug = null
bugged_cameras -= C.c_tag
interact()
return
if("close" in href_list)
usr.unset_machine()
current = null
return
if("view" in href_list)
//You can't locate on a list with keys
var/list/cameras = flatten_list(bugged_cameras)
var/obj/machinery/camera/C = locate(href_list["view"]) in cameras
if(C && istype(C))
if(!same_z_level(C))
return
if(!C.can_use())
to_chat(usr, "<span class='warning'>Something's wrong with that camera! You can't get a feed.</span>")
return
current = C
spawn(6)
if(src.check_eye(usr))
usr.reset_perspective(C)
interact()
else
usr.unset_machine()
usr << browse(null, "window=camerabug")
return
else
usr.unset_machine()
interact()
/obj/item/camera_bug/process()
if(track_mode == BUGMODE_LIST || (world.time < (last_tracked + refresh_interval)))
return
last_tracked = world.time
if(track_mode == BUGMODE_TRACK ) // search for user
// Note that it will be tricked if your name appears to change.
// This is not optimal but it is better than tracking you relentlessly despite everything.
if(!tracking)
src.updateSelfDialog()
return
if(tracking.name != tracked_name) // Hiding their identity, tricksy
var/mob/M = tracking
if(istype(M))
if(!(tracked_name == "Unknown" && findtext(tracking.name,"Unknown"))) // we saw then disguised before
if(!(tracked_name == M.real_name && findtext(tracking.name,M.real_name))) // or they're still ID'd
src.updateSelfDialog()//But if it's neither of those cases
return // you won't find em on the cameras
else
src.updateSelfDialog()
return
var/list/tracking_cams = list()
var/list/b_cams = get_cameras()
for(var/entry in b_cams)
tracking_cams += b_cams[entry]
var/list/target_region = view(tracking)
for(var/obj/machinery/camera/C in (target_region & tracking_cams))
if(!can_see(C,tracking)) // target may have xray, that doesn't make them visible to cameras
continue
if(C.can_use())
last_found = C.c_tag
last_seen = world.time
break
src.updateSelfDialog()
/obj/item/camera_bug/proc/same_z_level(var/obj/machinery/camera/C)
var/turf/T_cam = get_turf(C)
var/turf/T_bug = get_turf(loc)
if(!T_bug || T_cam.z != T_bug.z)
to_chat(usr, "<span class='warning'>You can't get a signal!</span>")
return FALSE
return TRUE
#undef BUGMODE_LIST
#undef BUGMODE_MONITOR
#undef BUGMODE_TRACK
@@ -16,14 +16,14 @@
/obj/item/doorCharge/ex_act(severity, target)
switch(severity)
if(1)
if(EXPLODE_DEVASTATE)
visible_message("<span class='warning'>[src] detonates!</span>")
explosion(src.loc,0,2,1,flame_range = 4)
qdel(src)
if(2)
if(EXPLODE_HEAVY)
if(prob(50))
ex_act(EXPLODE_DEVASTATE)
if(3)
if(EXPLODE_LIGHT)
if(prob(25))
ex_act(EXPLODE_DEVASTATE)
File diff suppressed because it is too large Load Diff
@@ -10,7 +10,7 @@
lefthand_file = 'icons/mob/inhands/misc/devices_lefthand.dmi'
righthand_file = 'icons/mob/inhands/misc/devices_righthand.dmi'
materials = list(MAT_METAL=250, MAT_GLASS=500)
var/max_shield_integrity = 250
var/max_shield_integrity = 100
var/shield_integrity = 250
var/max_fields = 3
var/list/current_fields
@@ -87,7 +87,7 @@
mouse_opacity = MOUSE_OPACITY_OPAQUE
resistance_flags = INDESTRUCTIBLE
CanAtmosPass = ATMOS_PASS_DENSITY
armor = list("melee" = 0, "bullet" = 25, "laser" = 50, "energy" = 50, "bomb" = 25, "bio" = 100, "rad" = 100, "fire" = 100, "acid" = 100)
armor = list("melee" = 0, "bullet" = 25, "laser" = 25, "energy" = 25, "bomb" = 25, "bio" = 100, "rad" = 100, "fire" = 100, "acid" = 100)
var/obj/item/forcefield_projector/generator
/obj/structure/projected_forcefield/Initialize(mapload, obj/item/forcefield_projector/origin)
+228 -228
View File
@@ -1,228 +1,228 @@
GLOBAL_LIST_EMPTY(GPS_list)
/obj/item/gps
name = "global positioning system"
desc = "Helping lost spacemen find their way through the planets since 2016."
icon = 'icons/obj/telescience.dmi'
icon_state = "gps-c"
w_class = WEIGHT_CLASS_SMALL
slot_flags = ITEM_SLOT_BELT
obj_flags = UNIQUE_RENAME
var/gpstag = "COM0"
var/emped = FALSE
var/tracking = TRUE
var/updating = TRUE //Automatic updating of GPS list. Can be set to manual by user.
var/global_mode = TRUE //If disabled, only GPS signals of the same Z level are shown
/obj/item/gps/examine(mob/user)
. = ..()
var/turf/curr = get_turf(src)
. += "The screen says: [get_area_name(curr, TRUE)] ([curr.x], [curr.y], [curr.z])"
. += "<span class='notice'>Alt-click to switch it [tracking ? "off":"on"].</span>"
/obj/item/gps/Initialize()
. = ..()
GLOB.GPS_list += src
name = "global positioning system ([gpstag])"
add_overlay("working")
/obj/item/gps/Destroy()
GLOB.GPS_list -= src
return ..()
/obj/item/gps/emp_act(severity)
. = ..()
if (. & EMP_PROTECT_SELF)
return
emped = TRUE
cut_overlay("working")
add_overlay("emp")
addtimer(CALLBACK(src, .proc/reboot), 300, TIMER_UNIQUE|TIMER_OVERRIDE) //if a new EMP happens, remove the old timer so it doesn't reactivate early
SStgui.close_uis(src) //Close the UI control if it is open.
/obj/item/gps/proc/reboot()
emped = FALSE
cut_overlay("emp")
add_overlay("working")
/obj/item/gps/AltClick(mob/user)
. = ..()
if(!user.canUseTopic(src, BE_CLOSE))
return
toggletracking(user)
return TRUE
/obj/item/gps/proc/toggletracking(mob/user)
if(!user.canUseTopic(src, BE_CLOSE))
return //user not valid to use gps
if(emped)
to_chat(user, "It's busted!")
return
if(tracking)
cut_overlay("working")
to_chat(user, "[src] is no longer tracking, or visible to other GPS devices.")
tracking = FALSE
else
add_overlay("working")
to_chat(user, "[src] is now tracking, and visible to other GPS devices.")
tracking = TRUE
/obj/item/gps/ui_interact(mob/user, ui_key = "gps", datum/tgui/ui = null, force_open = FALSE, datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state) // Remember to use the appropriate state.
if(emped)
to_chat(user, "[src] fizzles weakly.")
return
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
if(!ui)
var/gps_window_height = 300 + GLOB.GPS_list.len * 20 // Variable window height, depending on how many GPS units there are to show
ui = new(user, src, ui_key, "gps", "Global Positioning System", 600, gps_window_height, master_ui, state) //width, height
ui.open()
ui.set_autoupdate(state = updating)
/obj/item/gps/ui_data(mob/user)
var/list/data = list()
data["power"] = tracking
data["tag"] = gpstag
data["updating"] = updating
data["globalmode"] = global_mode
if(!tracking || emped) //Do not bother scanning if the GPS is off or EMPed
return data
var/turf/curr = get_turf(src)
data["current"] = "[get_area_name(curr, TRUE)] ([curr.x], [curr.y], [curr.z])"
var/list/signals = list()
data["signals"] = list()
for(var/gps in GLOB.GPS_list)
var/obj/item/gps/G = gps
if(G.emped || !G.tracking || G == src)
continue
var/turf/pos = get_turf(G)
if(!global_mode && pos.z != curr.z)
continue
var/list/signal = list()
signal["entrytag"] = G.gpstag //Name or 'tag' of the GPS
signal["area"] = get_area_name(G, TRUE)
signal["coord"] = "[pos.x], [pos.y], [pos.z]"
if(pos.z == curr.z) //Distance/Direction calculations for same z-level only
signal["dist"] = max(get_dist(curr, pos), 0) //Distance between the src and remote GPS turfs
signal["degrees"] = round(Get_Angle(curr, pos)) //0-360 degree directional bearing, for more precision.
var/direction = uppertext(dir2text(get_dir(curr, pos))) //Direction text (East, etc). Not as precise, but still helpful.
if(!direction)
direction = "CENTER"
signal["degrees"] = "N/A"
signal["direction"] = direction
signals += list(signal) //Add this signal to the list of signals
data["signals"] = signals
return data
/obj/item/gps/ui_act(action, params)
if(..())
return
switch(action)
if("rename")
var/a = input("Please enter desired tag.", name, gpstag) as text
a = copytext(sanitize(a), 1, 20)
gpstag = a
. = TRUE
name = "global positioning system ([gpstag])"
if("power")
toggletracking(usr)
. = TRUE
if("updating")
updating = !updating
. = TRUE
if("globalmode")
global_mode = !global_mode
. = TRUE
/obj/item/gps/science
icon_state = "gps-s"
gpstag = "SCI0"
/obj/item/gps/engineering
icon_state = "gps-e"
gpstag = "ENG0"
/obj/item/gps/mining
icon_state = "gps-m"
gpstag = "MINE0"
desc = "A positioning system helpful for rescuing trapped or injured miners, keeping one on you at all times while mining might just save your life."
/obj/item/gps/cyborg
icon_state = "gps-b"
gpstag = "BORG0"
desc = "A mining cyborg internal positioning system. Used as a recovery beacon for damaged cyborg assets, or a collaboration tool for mining teams."
/obj/item/gps/cyborg/Initialize()
. = ..()
ADD_TRAIT(src, TRAIT_NODROP, CYBORG_ITEM_TRAIT)
/obj/item/gps/internal
icon_state = null
item_flags = ABSTRACT
gpstag = "Eerie Signal"
desc = "Report to a coder immediately."
invisibility = INVISIBILITY_MAXIMUM
var/obj/item/implant/gps/implant
/obj/item/gps/internal/Initialize(mapload, obj/item/implant/gps/_implant)
. = ..()
implant = _implant
/obj/item/gps/internal/Destroy()
if(implant?.imp_in)
qdel(implant)
else
return ..()
/obj/item/gps/internal/mining
icon_state = "gps-m"
gpstag = "MINER"
desc = "A positioning system helpful for rescuing trapped or injured miners, keeping one on you at all times while mining might just save your life."
/obj/item/gps/internal/base
gpstag = "NT_AUX"
desc = "A homing signal from Nanotrasen's mining base."
/obj/item/gps/visible_debug
name = "visible GPS"
gpstag = "ADMIN"
desc = "This admin-spawn GPS unit leaves the coordinates visible \
on any turf that it passes over, for debugging. Especially useful \
for marking the area around the transition edges."
var/list/turf/tagged
/obj/item/gps/visible_debug/Initialize()
. = ..()
tagged = list()
START_PROCESSING(SSfastprocess, src)
/obj/item/gps/visible_debug/process()
var/turf/T = get_turf(src)
if(T)
// I assume it's faster to color,tag and OR the turf in, rather
// then checking if its there
T.color = RANDOM_COLOUR
T.maptext = "[T.x],[T.y],[T.z]"
tagged |= T
/obj/item/gps/visible_debug/proc/clear()
while(tagged.len)
var/turf/T = pop(tagged)
T.color = initial(T.color)
T.maptext = initial(T.maptext)
/obj/item/gps/visible_debug/Destroy()
if(tagged)
clear()
tagged = null
STOP_PROCESSING(SSfastprocess, src)
. = ..()
GLOBAL_LIST_EMPTY(GPS_list)
/obj/item/gps
name = "global positioning system"
desc = "Helping lost spacemen find their way through the planets since 2016."
icon = 'icons/obj/telescience.dmi'
icon_state = "gps-c"
w_class = WEIGHT_CLASS_SMALL
slot_flags = ITEM_SLOT_BELT
obj_flags = UNIQUE_RENAME
var/gpstag = "COM0"
var/emped = FALSE
var/tracking = TRUE
var/updating = TRUE //Automatic updating of GPS list. Can be set to manual by user.
var/global_mode = TRUE //If disabled, only GPS signals of the same Z level are shown
/obj/item/gps/examine(mob/user)
. = ..()
var/turf/curr = get_turf(src)
. += "The screen says: [get_area_name(curr, TRUE)] ([curr.x], [curr.y], [curr.z])"
. += "<span class='notice'>Alt-click to switch it [tracking ? "off":"on"].</span>"
/obj/item/gps/Initialize()
. = ..()
GLOB.GPS_list += src
name = "global positioning system ([gpstag])"
add_overlay("working")
/obj/item/gps/Destroy()
GLOB.GPS_list -= src
return ..()
/obj/item/gps/emp_act(severity)
. = ..()
if (. & EMP_PROTECT_SELF)
return
emped = TRUE
cut_overlay("working")
add_overlay("emp")
addtimer(CALLBACK(src, .proc/reboot), 300, TIMER_UNIQUE|TIMER_OVERRIDE) //if a new EMP happens, remove the old timer so it doesn't reactivate early
SStgui.close_uis(src) //Close the UI control if it is open.
/obj/item/gps/proc/reboot()
emped = FALSE
cut_overlay("emp")
add_overlay("working")
/obj/item/gps/AltClick(mob/user)
. = ..()
if(!user.canUseTopic(src, BE_CLOSE))
return
toggletracking(user)
return TRUE
/obj/item/gps/proc/toggletracking(mob/user)
if(!user.canUseTopic(src, BE_CLOSE))
return //user not valid to use gps
if(emped)
to_chat(user, "It's busted!")
return
if(tracking)
cut_overlay("working")
to_chat(user, "[src] is no longer tracking, or visible to other GPS devices.")
tracking = FALSE
else
add_overlay("working")
to_chat(user, "[src] is now tracking, and visible to other GPS devices.")
tracking = TRUE
/obj/item/gps/ui_interact(mob/user, ui_key = "gps", datum/tgui/ui = null, force_open = FALSE, datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state) // Remember to use the appropriate state.
if(emped)
to_chat(user, "[src] fizzles weakly.")
return
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
if(!ui)
var/gps_window_height = 300 + GLOB.GPS_list.len * 20 // Variable window height, depending on how many GPS units there are to show
ui = new(user, src, ui_key, "gps", "Global Positioning System", 600, gps_window_height, master_ui, state) //width, height
ui.open()
ui.set_autoupdate(state = updating)
/obj/item/gps/ui_data(mob/user)
var/list/data = list()
data["power"] = tracking
data["tag"] = gpstag
data["updating"] = updating
data["globalmode"] = global_mode
if(!tracking || emped) //Do not bother scanning if the GPS is off or EMPed
return data
var/turf/curr = get_turf(src)
data["current"] = "[get_area_name(curr, TRUE)] ([curr.x], [curr.y], [curr.z])"
var/list/signals = list()
data["signals"] = list()
for(var/gps in GLOB.GPS_list)
var/obj/item/gps/G = gps
if(G.emped || !G.tracking || G == src)
continue
var/turf/pos = get_turf(G)
if(!global_mode && pos.z != curr.z)
continue
var/list/signal = list()
signal["entrytag"] = G.gpstag //Name or 'tag' of the GPS
signal["area"] = get_area_name(G, TRUE)
signal["coord"] = "[pos.x], [pos.y], [pos.z]"
if(pos.z == curr.z) //Distance/Direction calculations for same z-level only
signal["dist"] = max(get_dist(curr, pos), 0) //Distance between the src and remote GPS turfs
signal["degrees"] = round(Get_Angle(curr, pos)) //0-360 degree directional bearing, for more precision.
var/direction = uppertext(dir2text(get_dir(curr, pos))) //Direction text (East, etc). Not as precise, but still helpful.
if(!direction)
direction = "CENTER"
signal["degrees"] = "N/A"
signal["direction"] = direction
signals += list(signal) //Add this signal to the list of signals
data["signals"] = signals
return data
/obj/item/gps/ui_act(action, params)
if(..())
return
switch(action)
if("rename")
var/a = input("Please enter desired tag.", name, gpstag) as text
a = copytext(sanitize(a), 1, 20)
gpstag = a
. = TRUE
name = "global positioning system ([gpstag])"
if("power")
toggletracking(usr)
. = TRUE
if("updating")
updating = !updating
. = TRUE
if("globalmode")
global_mode = !global_mode
. = TRUE
/obj/item/gps/science
icon_state = "gps-s"
gpstag = "SCI0"
/obj/item/gps/engineering
icon_state = "gps-e"
gpstag = "ENG0"
/obj/item/gps/mining
icon_state = "gps-m"
gpstag = "MINE0"
desc = "A positioning system helpful for rescuing trapped or injured miners, keeping one on you at all times while mining might just save your life."
/obj/item/gps/cyborg
icon_state = "gps-b"
gpstag = "BORG0"
desc = "A mining cyborg internal positioning system. Used as a recovery beacon for damaged cyborg assets, or a collaboration tool for mining teams."
/obj/item/gps/cyborg/Initialize()
. = ..()
ADD_TRAIT(src, TRAIT_NODROP, CYBORG_ITEM_TRAIT)
/obj/item/gps/internal
icon_state = null
item_flags = ABSTRACT
gpstag = "Eerie Signal"
desc = "Report to a coder immediately."
invisibility = INVISIBILITY_MAXIMUM
var/obj/item/implant/gps/implant
/obj/item/gps/internal/Initialize(mapload, obj/item/implant/gps/_implant)
. = ..()
implant = _implant
/obj/item/gps/internal/Destroy()
if(implant?.imp_in)
qdel(implant)
else
return ..()
/obj/item/gps/internal/mining
icon_state = "gps-m"
gpstag = "MINER"
desc = "A positioning system helpful for rescuing trapped or injured miners, keeping one on you at all times while mining might just save your life."
/obj/item/gps/internal/base
gpstag = "NT_AUX"
desc = "A homing signal from Nanotrasen's mining base."
/obj/item/gps/visible_debug
name = "visible GPS"
gpstag = "ADMIN"
desc = "This admin-spawn GPS unit leaves the coordinates visible \
on any turf that it passes over, for debugging. Especially useful \
for marking the area around the transition edges."
var/list/turf/tagged
/obj/item/gps/visible_debug/Initialize()
. = ..()
tagged = list()
START_PROCESSING(SSfastprocess, src)
/obj/item/gps/visible_debug/process()
var/turf/T = get_turf(src)
if(T)
// I assume it's faster to color,tag and OR the turf in, rather
// then checking if its there
T.color = RANDOM_COLOUR
T.maptext = "[T.x],[T.y],[T.z]"
tagged |= T
/obj/item/gps/visible_debug/proc/clear()
while(tagged.len)
var/turf/T = pop(tagged)
T.color = initial(T.color)
T.maptext = initial(T.maptext)
/obj/item/gps/visible_debug/Destroy()
if(tagged)
clear()
tagged = null
STOP_PROCESSING(SSfastprocess, src)
. = ..()
+285 -277
View File
@@ -1,277 +1,285 @@
//copy pasta of the space piano, don't hurt me -Pete
/obj/item/instrument
name = "generic instrument"
resistance_flags = FLAMMABLE
force = 10
max_integrity = 100
icon = 'icons/obj/musician.dmi'
lefthand_file = 'icons/mob/inhands/equipment/instruments_lefthand.dmi'
righthand_file = 'icons/mob/inhands/equipment/instruments_righthand.dmi'
var/datum/song/handheld/song
var/instrumentId = "generic"
var/instrumentExt = "mid"
var/tune_time = 0
/obj/item/instrument/Initialize()
. = ..()
song = new(instrumentId, src, instrumentExt)
/obj/item/instrument/Destroy()
if (tune_time)
STOP_PROCESSING(SSobj, src)
qdel(song)
song = null
return ..()
/obj/item/instrument/suicide_act(mob/user)
user.visible_message("<span class='suicide'>[user] begins to play 'Gloomy Sunday'! It looks like [user.p_theyre()] trying to commit suicide!</span>")
return (BRUTELOSS)
/obj/item/instrument/Initialize(mapload)
. = ..()
if(mapload)
song.tempo = song.sanitize_tempo(song.tempo) // tick_lag isn't set when the map is loaded
/obj/item/instrument/attack_self(mob/user)
if(!user.IsAdvancedToolUser())
to_chat(user, "<span class='warning'>You don't have the dexterity to do this!</span>")
return 1
interact(user)
/obj/item/instrument/interact(mob/user)
ui_interact(user)
/obj/item/instrument/ui_interact(mob/user)
if(!user)
return
if(!isliving(user) || user.stat || user.restrained() || user.lying)
return
user.set_machine(src)
song.interact(user)
/obj/item/instrument/attackby(obj/item/W, mob/user, params)
if(istype(W, /obj/item/musicaltuner))
var/mob/living/carbon/human/H = user
if (HAS_TRAIT(H, TRAIT_MUSICIAN))
if (!tune_time)
H.visible_message("[H] tunes the [src] to perfection!", "<span class='notice'>You tune the [src] to perfection!</span>")
tune_time = 300
START_PROCESSING(SSobj, src)
else
to_chat(H, "<span class='notice'>[src] is already well tuned!</span>")
else
to_chat(H, "<span class='warning'>You have no idea how to use this.</span>")
/obj/item/instrument/process()
if (tune_time)
if (song.playing)
for (var/mob/living/M in song.hearing_mobs)
M.dizziness = max(0,M.dizziness-2)
M.jitteriness = max(0,M.jitteriness-2)
M.confused = max(M.confused-1)
SEND_SIGNAL(M, COMSIG_ADD_MOOD_EVENT, "goodmusic", /datum/mood_event/goodmusic)
tune_time--
else
if (!tune_time)
if (song.playing)
loc.visible_message("<span class='warning'>[src] starts sounding a little off...</span>")
STOP_PROCESSING(SSobj, src)
/obj/item/instrument/violin
name = "space violin"
desc = "A wooden musical instrument with four strings and a bow. \"The devil went down to space, he was looking for an assistant to grief.\""
icon_state = "violin"
item_state = "violin"
hitsound = "swing_hit"
instrumentId = "violin"
/obj/item/instrument/violin/golden
name = "golden violin"
desc = "A golden musical instrument with four strings and a bow. \"The devil went down to space, he was looking for an assistant to grief.\""
icon_state = "golden_violin"
item_state = "golden_violin"
resistance_flags = LAVA_PROOF | FIRE_PROOF | ACID_PROOF
/obj/item/instrument/piano_synth
name = "synthesizer"
desc = "An advanced electronic synthesizer that can be used as various instruments."
icon_state = "synth"
item_state = "synth"
instrumentId = "piano"
instrumentExt = "ogg"
var/static/list/insTypes = list("accordion" = "mid", "bikehorn" = "ogg", "glockenspiel" = "mid", "guitar" = "ogg", "harmonica" = "mid", "piano" = "ogg", "recorder" = "mid", "saxophone" = "mid", "trombone" = "mid", "violin" = "mid", "xylophone" = "mid") //No eguitar you ear-rapey fuckers.
actions_types = list(/datum/action/item_action/synthswitch)
/obj/item/instrument/piano_synth/proc/changeInstrument(name = "piano")
song.instrumentDir = name
song.instrumentExt = insTypes[name]
/obj/item/instrument/guitar
name = "guitar"
desc = "It's made of wood and has bronze strings."
icon_state = "guitar"
item_state = "guitar"
instrumentExt = "ogg"
attack_verb = list("played metal on", "serenaded", "crashed", "smashed")
hitsound = 'sound/weapons/stringsmash.ogg'
instrumentId = "guitar"
/obj/item/instrument/eguitar
name = "electric guitar"
desc = "Makes all your shredding needs possible."
icon_state = "eguitar"
item_state = "eguitar"
force = 12
attack_verb = list("played metal on", "shredded", "crashed", "smashed")
hitsound = 'sound/weapons/stringsmash.ogg'
instrumentId = "eguitar"
instrumentExt = "ogg"
/obj/item/instrument/glockenspiel
name = "glockenspiel"
desc = "Smooth metal bars perfect for any marching band."
icon_state = "glockenspiel"
item_state = "glockenspiel"
instrumentId = "glockenspiel"
/obj/item/instrument/accordion
name = "accordion"
desc = "Pun-Pun not included."
icon_state = "accordion"
item_state = "accordion"
instrumentId = "accordion"
/obj/item/instrument/trumpet
name = "trumpet"
desc = "To announce the arrival of the king!"
icon_state = "trumpet"
item_state = "trombone"
instrumentId = "trombone"
/obj/item/instrument/trumpet/spectral
name = "spectral trumpet"
desc = "Things are about to get spooky!"
icon_state = "trumpet"
item_state = "trombone"
force = 0
instrumentId = "trombone"
attack_verb = list("played","jazzed","trumpeted","mourned","dooted","spooked")
/obj/item/instrument/trumpet/spectral/Initialize()
. = ..()
AddComponent(/datum/component/spooky)
/obj/item/instrument/trumpet/spectral/attack(mob/living/carbon/C, mob/user)
playsound (loc, 'sound/instruments/trombone/En4.mid', 100,1,-1)
..()
/obj/item/instrument/saxophone
name = "saxophone"
desc = "This soothing sound will be sure to leave your audience in tears."
icon_state = "saxophone"
item_state = "saxophone"
instrumentId = "saxophone"
/obj/item/instrument/saxophone/spectral
name = "spectral saxophone"
desc = "This spooky sound will be sure to leave mortals in bones."
icon_state = "saxophone"
item_state = "saxophone"
instrumentId = "saxophone"
force = 0
attack_verb = list("played","jazzed","saxxed","mourned","dooted","spooked")
/obj/item/instrument/saxophone/spectral/Initialize()
. = ..()
AddComponent(/datum/component/spooky)
/obj/item/instrument/saxophone/spectral/attack(mob/living/carbon/C, mob/user)
playsound (loc, 'sound/instruments/saxophone/En4.mid', 100,1,-1)
..()
/obj/item/instrument/trombone
name = "trombone"
desc = "How can any pool table ever hope to compete?"
icon_state = "trombone"
item_state = "trombone"
instrumentId = "trombone"
/obj/item/instrument/trombone/spectral
name = "spectral trombone"
desc = "A skeleton's favorite instrument. Apply directly on the mortals."
instrumentId = "trombone"
icon_state = "trombone"
item_state = "trombone"
force = 0
attack_verb = list("played","jazzed","tromboned","mourned","dooted","spooked")
/obj/item/instrument/trombone/spectral/Initialize()
. = ..()
AddComponent(/datum/component/spooky)
/obj/item/instrument/trombone/spectral/attack(mob/living/carbon/C, mob/user)
playsound (loc, 'sound/instruments/trombone/Cn4.mid', 100,1,-1)
..()
/obj/item/instrument/recorder
name = "recorder"
desc = "Just like in school, playing ability and all."
force = 5
icon_state = "recorder"
item_state = "recorder"
instrumentId = "recorder"
/obj/item/instrument/harmonica
name = "harmonica"
desc = "For when you get a bad case of the space blues."
icon_state = "harmonica"
item_state = "harmonica"
instrumentId = "harmonica"
slot_flags = ITEM_SLOT_MASK
force = 5
w_class = WEIGHT_CLASS_SMALL
actions_types = list(/datum/action/item_action/instrument)
/obj/item/instrument/harmonica/proc/handle_speech(datum/source, list/speech_args)
if(song.playing && ismob(loc))
to_chat(loc, "<span class='warning'>You stop playing the harmonica to talk...</span>")
song.playing = FALSE
/obj/item/instrument/harmonica/equipped(mob/M, slot)
. = ..()
RegisterSignal(M, COMSIG_MOB_SAY, .proc/handle_speech)
/obj/item/instrument/harmonica/dropped(mob/M)
. = ..()
UnregisterSignal(M, COMSIG_MOB_SAY)
/obj/item/instrument/bikehorn
name = "gilded bike horn"
desc = "An exquisitely decorated bike horn, capable of honking in a variety of notes."
icon_state = "bike_horn"
item_state = "bike_horn"
lefthand_file = 'icons/mob/inhands/equipment/horns_lefthand.dmi'
righthand_file = 'icons/mob/inhands/equipment/horns_righthand.dmi'
attack_verb = list("beautifully honks")
instrumentId = "bikehorn"
instrumentExt = "ogg"
w_class = WEIGHT_CLASS_TINY
force = 0
throw_speed = 3
throw_range = 15
hitsound = 'sound/items/bikehorn.ogg'
///
/obj/item/musicaltuner
name = "musical tuner"
desc = "A device for tuning musical instruments both manual and electronic alike."
icon = 'icons/obj/device.dmi'
icon_state = "musicaltuner"
slot_flags = ITEM_SLOT_BELT
w_class = WEIGHT_CLASS_SMALL
item_state = "electronic"
lefthand_file = 'icons/mob/inhands/misc/devices_lefthand.dmi'
righthand_file = 'icons/mob/inhands/misc/devices_righthand.dmi'
//copy pasta of the space piano, don't hurt me -Pete
/obj/item/instrument
name = "generic instrument"
resistance_flags = FLAMMABLE
force = 10
max_integrity = 100
icon = 'icons/obj/musician.dmi'
lefthand_file = 'icons/mob/inhands/equipment/instruments_lefthand.dmi'
righthand_file = 'icons/mob/inhands/equipment/instruments_righthand.dmi'
var/datum/song/handheld/song
var/instrumentId = "generic"
var/instrumentExt = "mid"
var/tune_time = 0
/obj/item/instrument/Initialize()
. = ..()
song = new(instrumentId, src, instrumentExt)
/obj/item/instrument/Destroy()
if (tune_time)
STOP_PROCESSING(SSobj, src)
qdel(song)
song = null
return ..()
/obj/item/instrument/suicide_act(mob/user)
user.visible_message("<span class='suicide'>[user] begins to play 'Gloomy Sunday'! It looks like [user.p_theyre()] trying to commit suicide!</span>")
return (BRUTELOSS)
/obj/item/instrument/Initialize(mapload)
. = ..()
if(mapload)
song.tempo = song.sanitize_tempo(song.tempo) // tick_lag isn't set when the map is loaded
/obj/item/instrument/attack_self(mob/user)
if(!user.IsAdvancedToolUser())
to_chat(user, "<span class='warning'>You don't have the dexterity to do this!</span>")
return 1
interact(user)
/obj/item/instrument/interact(mob/user)
ui_interact(user)
/obj/item/instrument/ui_interact(mob/user)
if(!user)
return
if(!isliving(user) || user.stat || user.restrained() || user.lying)
return
user.set_machine(src)
song.interact(user)
/obj/item/instrument/attackby(obj/item/W, mob/user, params)
if(istype(W, /obj/item/musicaltuner))
var/mob/living/carbon/human/H = user
if (HAS_TRAIT(H, TRAIT_MUSICIAN))
if (!tune_time)
H.visible_message("[H] tunes the [src] to perfection!", "<span class='notice'>You tune the [src] to perfection!</span>")
tune_time = 300
START_PROCESSING(SSobj, src)
else
to_chat(H, "<span class='notice'>[src] is already well tuned!</span>")
else
to_chat(H, "<span class='warning'>You have no idea how to use this.</span>")
/obj/item/instrument/process()
if (tune_time)
if (song.playing)
for (var/mob/living/M in song.hearing_mobs)
M.dizziness = max(0,M.dizziness-2)
M.jitteriness = max(0,M.jitteriness-2)
M.confused = max(M.confused-1)
SEND_SIGNAL(M, COMSIG_ADD_MOOD_EVENT, "goodmusic", /datum/mood_event/goodmusic)
tune_time--
else
if (!tune_time)
if (song.playing)
loc.visible_message("<span class='warning'>[src] starts sounding a little off...</span>")
STOP_PROCESSING(SSobj, src)
/obj/item/instrument/violin
name = "space violin"
desc = "A wooden musical instrument with four strings and a bow. \"The devil went down to space, he was looking for an assistant to grief.\""
icon_state = "violin"
item_state = "violin"
hitsound = "swing_hit"
instrumentId = "violin"
/obj/item/instrument/violin/golden
name = "golden violin"
desc = "A golden musical instrument with four strings and a bow. \"The devil went down to space, he was looking for an assistant to grief.\""
icon_state = "golden_violin"
item_state = "golden_violin"
resistance_flags = LAVA_PROOF | FIRE_PROOF | ACID_PROOF
/obj/item/instrument/piano_synth
name = "synthesizer"
desc = "An advanced electronic synthesizer that can be used as various instruments."
icon_state = "synth"
item_state = "synth"
instrumentId = "piano"
instrumentExt = "ogg"
var/static/list/insTypes = list("accordion" = "mid", "bikehorn" = "ogg", "glockenspiel" = "mid", "banjo" = "ogg", "guitar" = "ogg", "harmonica" = "mid", "piano" = "ogg", "recorder" = "mid", "saxophone" = "mid", "trombone" = "mid", "violin" = "mid", "xylophone" = "mid") //No eguitar you ear-rapey fuckers.
actions_types = list(/datum/action/item_action/synthswitch)
/obj/item/instrument/piano_synth/proc/changeInstrument(name = "piano")
song.instrumentDir = name
song.instrumentExt = insTypes[name]
/obj/item/instrument/banjo
name = "banjo"
desc = "A 'Mura' brand banjo. It's pretty much just a drum with a neck and strings."
icon_state = "banjo"
item_state = "banjo"
instrumentExt = "ogg"
attack_verb = list("scruggs-styled", "hum-diggitied", "shin-digged", "clawhammered")
hitsound = 'sound/weapons/banjoslap.ogg'
instrumentId = "banjo"
/obj/item/instrument/guitar
name = "guitar"
desc = "It's made of wood and has bronze strings."
icon_state = "guitar"
item_state = "guitar"
instrumentExt = "ogg"
attack_verb = list("played metal on", "serenaded", "crashed", "smashed")
hitsound = 'sound/weapons/stringsmash.ogg'
instrumentId = "guitar"
/obj/item/instrument/eguitar
name = "electric guitar"
desc = "Makes all your shredding needs possible."
icon_state = "eguitar"
item_state = "eguitar"
force = 12
attack_verb = list("played metal on", "shredded", "crashed", "smashed")
hitsound = 'sound/weapons/stringsmash.ogg'
instrumentId = "eguitar"
instrumentExt = "ogg"
/obj/item/instrument/glockenspiel
name = "glockenspiel"
desc = "Smooth metal bars perfect for any marching band."
icon_state = "glockenspiel"
item_state = "glockenspiel"
instrumentId = "glockenspiel"
/obj/item/instrument/accordion
name = "accordion"
desc = "Pun-Pun not included."
icon_state = "accordion"
item_state = "accordion"
instrumentId = "accordion"
/obj/item/instrument/trumpet
name = "trumpet"
desc = "To announce the arrival of the king!"
icon_state = "trumpet"
item_state = "trombone"
instrumentId = "trombone"
/obj/item/instrument/trumpet/spectral
name = "spectral trumpet"
desc = "Things are about to get spooky!"
icon_state = "trumpet"
item_state = "trombone"
force = 0
instrumentId = "trombone"
attack_verb = list("played","jazzed","trumpeted","mourned","dooted","spooked")
/obj/item/instrument/trumpet/spectral/Initialize()
. = ..()
AddComponent(/datum/component/spooky)
/obj/item/instrument/trumpet/spectral/attack(mob/living/carbon/C, mob/user)
playsound (loc, 'sound/instruments/trombone/En4.mid', 100,1,-1)
..()
/obj/item/instrument/saxophone
name = "saxophone"
desc = "This soothing sound will be sure to leave your audience in tears."
icon_state = "saxophone"
item_state = "saxophone"
instrumentId = "saxophone"
/obj/item/instrument/saxophone/spectral
name = "spectral saxophone"
desc = "This spooky sound will be sure to leave mortals in bones."
icon_state = "saxophone"
item_state = "saxophone"
instrumentId = "saxophone"
force = 0
attack_verb = list("played","jazzed","saxxed","mourned","dooted","spooked")
/obj/item/instrument/saxophone/spectral/Initialize()
. = ..()
AddComponent(/datum/component/spooky)
/obj/item/instrument/saxophone/spectral/attack(mob/living/carbon/C, mob/user)
playsound (loc, 'sound/instruments/saxophone/En4.mid', 100,1,-1)
..()
/obj/item/instrument/trombone
name = "trombone"
desc = "How can any pool table ever hope to compete?"
icon_state = "trombone"
item_state = "trombone"
instrumentId = "trombone"
/obj/item/instrument/trombone/spectral
name = "spectral trombone"
desc = "A skeleton's favorite instrument. Apply directly on the mortals."
instrumentId = "trombone"
icon_state = "trombone"
item_state = "trombone"
force = 0
attack_verb = list("played","jazzed","tromboned","mourned","dooted","spooked")
/obj/item/instrument/trombone/spectral/Initialize()
. = ..()
AddComponent(/datum/component/spooky)
/obj/item/instrument/trombone/spectral/attack(mob/living/carbon/C, mob/user)
playsound (loc, 'sound/instruments/trombone/Cn4.mid', 100,1,-1)
..()
/obj/item/instrument/recorder
name = "recorder"
desc = "Just like in school, playing ability and all."
force = 5
icon_state = "recorder"
item_state = "recorder"
instrumentId = "recorder"
/obj/item/instrument/harmonica
name = "harmonica"
desc = "For when you get a bad case of the space blues."
icon_state = "harmonica"
item_state = "harmonica"
instrumentId = "harmonica"
slot_flags = ITEM_SLOT_MASK
force = 5
w_class = WEIGHT_CLASS_SMALL
actions_types = list(/datum/action/item_action/instrument)
/obj/item/instrument/harmonica/proc/handle_speech(datum/source, list/speech_args)
if(song.playing && ismob(loc))
to_chat(loc, "<span class='warning'>You stop playing the harmonica to talk...</span>")
song.playing = FALSE
/obj/item/instrument/harmonica/equipped(mob/M, slot)
. = ..()
RegisterSignal(M, COMSIG_MOB_SAY, .proc/handle_speech)
/obj/item/instrument/harmonica/dropped(mob/M)
. = ..()
UnregisterSignal(M, COMSIG_MOB_SAY)
/obj/item/instrument/bikehorn
name = "gilded bike horn"
desc = "An exquisitely decorated bike horn, capable of honking in a variety of notes."
icon_state = "bike_horn"
item_state = "bike_horn"
lefthand_file = 'icons/mob/inhands/equipment/horns_lefthand.dmi'
righthand_file = 'icons/mob/inhands/equipment/horns_righthand.dmi'
attack_verb = list("beautifully honks")
instrumentId = "bikehorn"
instrumentExt = "ogg"
w_class = WEIGHT_CLASS_TINY
force = 0
throw_speed = 3
throw_range = 15
hitsound = 'sound/items/bikehorn.ogg'
/obj/item/musicaltuner
name = "musical tuner"
desc = "A device for tuning musical instruments both manual and electronic alike."
icon = 'icons/obj/device.dmi'
icon_state = "musicaltuner"
slot_flags = ITEM_SLOT_BELT
w_class = WEIGHT_CLASS_SMALL
item_state = "electronic"
lefthand_file = 'icons/mob/inhands/misc/devices_lefthand.dmi'
righthand_file = 'icons/mob/inhands/misc/devices_righthand.dmi'
+189 -189
View File
@@ -1,189 +1,189 @@
/obj/item/laser_pointer
name = "laser pointer"
desc = "Don't shine it in your eyes!"
icon = 'icons/obj/device.dmi'
icon_state = "pointer"
item_state = "pen"
var/pointer_icon_state
flags_1 = CONDUCT_1
item_flags = NOBLUDGEON
slot_flags = ITEM_SLOT_BELT
materials = list(MAT_METAL=500, MAT_GLASS=500)
w_class = WEIGHT_CLASS_SMALL
var/turf/pointer_loc
var/energy = 5
var/max_energy = 5
var/effectchance = 33
var/recharging = 0
var/recharge_locked = FALSE
var/obj/item/stock_parts/micro_laser/diode //used for upgrading!
/obj/item/laser_pointer/red
pointer_icon_state = "red_laser"
/obj/item/laser_pointer/green
pointer_icon_state = "green_laser"
/obj/item/laser_pointer/blue
pointer_icon_state = "blue_laser"
/obj/item/laser_pointer/purple
pointer_icon_state = "purple_laser"
/obj/item/laser_pointer/New()
..()
diode = new(src)
if(!pointer_icon_state)
pointer_icon_state = pick("red_laser","green_laser","blue_laser","purple_laser")
/obj/item/laser_pointer/upgraded/New()
..()
diode = new /obj/item/stock_parts/micro_laser/ultra
/obj/item/laser_pointer/attackby(obj/item/W, mob/user, params)
if(istype(W, /obj/item/stock_parts/micro_laser))
if(!diode)
if(!user.transferItemToLoc(W, src))
return
diode = W
to_chat(user, "<span class='notice'>You install a [diode.name] in [src].</span>")
else
to_chat(user, "<span class='notice'>[src] already has a diode installed.</span>")
else if(istype(W, /obj/item/screwdriver))
if(diode)
to_chat(user, "<span class='notice'>You remove the [diode.name] from \the [src].</span>")
diode.forceMove(drop_location())
diode = null
else
return ..()
/obj/item/laser_pointer/afterattack(atom/target, mob/living/user, flag, params)
. = ..()
laser_act(target, user, params)
/obj/item/laser_pointer/proc/laser_act(atom/target, mob/living/user, params)
if( !(user in (viewers(7,target))) )
return
if (!diode)
to_chat(user, "<span class='notice'>You point [src] at [target], but nothing happens!</span>")
return
if (!user.IsAdvancedToolUser())
to_chat(user, "<span class='warning'>You don't have the dexterity to do this!</span>")
return
if(HAS_TRAIT(user, TRAIT_CHUNKYFINGERS))
to_chat(user, "<span class='warning'>Your fingers can't press the button!</span>")
return
add_fingerprint(user)
//nothing happens if the battery is drained
if(recharge_locked)
to_chat(user, "<span class='notice'>You point [src] at [target], but it's still charging.</span>")
return
var/outmsg
var/turf/targloc = get_turf(target)
//human/alien mobs
if(iscarbon(target))
var/mob/living/carbon/C = target
if(user.zone_selected == BODY_ZONE_PRECISE_EYES)
log_combat(user, C, "shone in the eyes", src)
var/severity = 1
if(prob(33))
severity = 2
else if(prob(50))
severity = 0
//chance to actually hit the eyes depends on internal component
if(prob(effectchance * diode.rating) && C.flash_act(severity))
outmsg = "<span class='notice'>You blind [C] by shining [src] in [C.p_their()] eyes.</span>"
else
outmsg = "<span class='warning'>You fail to blind [C] by shining [src] at [C.p_their()] eyes!</span>"
//robots
else if(iscyborg(target))
var/mob/living/silicon/S = target
log_combat(user, S, "shone in the sensors", src)
//chance to actually hit the eyes depends on internal component
if(prob(effectchance * diode.rating))
S.flash_act(affect_silicon = 1)
S.Knockdown(rand(100,200))
to_chat(S, "<span class='danger'>Your sensors were overloaded by a laser!</span>")
outmsg = "<span class='notice'>You overload [S] by shining [src] at [S.p_their()] sensors.</span>"
else
outmsg = "<span class='warning'>You fail to overload [S] by shining [src] at [S.p_their()] sensors!</span>"
//cameras
else if(istype(target, /obj/machinery/camera))
var/obj/machinery/camera/C = target
if(prob(effectchance * diode.rating))
C.emp_act(EMP_HEAVY)
outmsg = "<span class='notice'>You hit the lens of [C] with [src], temporarily disabling the camera!</span>"
log_combat(user, C, "EMPed", src)
else
outmsg = "<span class='warning'>You miss the lens of [C] with [src]!</span>"
//catpeople
for(var/mob/living/carbon/human/H in view(1,targloc))
if(!iscatperson(H) || H.incapacitated() || H.eye_blind )
continue
if(!H.lying)
H.setDir(get_dir(H,targloc)) // kitty always looks at the light
if(prob(effectchance))
H.visible_message("<span class='warning'>[H] makes a grab for the light!</span>","<span class='userdanger'>LIGHT!</span>")
H.Move(targloc)
log_combat(user, H, "moved with a laser pointer",src)
else
H.visible_message("<span class='notice'>[H] looks briefly distracted by the light.</span>","<span class = 'warning'> You're briefly tempted by the shiny light... </span>")
else
H.visible_message("<span class='notice'>[H] stares at the light</span>","<span class = 'warning'> You stare at the light... </span>")
//cats!
for(var/mob/living/simple_animal/pet/cat/C in view(1,targloc))
if(prob(50))
C.visible_message("<span class='notice'>[C] pounces on the light!</span>","<span class='warning'>LIGHT!</span>")
C.Move(targloc)
C.resting = TRUE
C.update_canmove()
else
C.visible_message("<span class='notice'>[C] looks uninterested in your games.</span>","<span class='warning'>You spot [user] shining [src] at you. How insulting!</span>")
//laser pointer image
icon_state = "pointer_[pointer_icon_state]"
var/image/I = image('icons/obj/projectiles.dmi',targloc,pointer_icon_state,10)
var/list/click_params = params2list(params)
if(click_params)
if(click_params["icon-x"])
I.pixel_x = (text2num(click_params["icon-x"]) - 16)
if(click_params["icon-y"])
I.pixel_y = (text2num(click_params["icon-y"]) - 16)
else
I.pixel_x = target.pixel_x + rand(-5,5)
I.pixel_y = target.pixel_y + rand(-5,5)
if(outmsg)
to_chat(user, outmsg)
else
to_chat(user, "<span class='info'>You point [src] at [target].</span>")
energy -= 1
if(energy <= max_energy)
if(!recharging)
recharging = 1
START_PROCESSING(SSobj, src)
if(energy <= 0)
to_chat(user, "<span class='warning'>[src]'s battery is overused, it needs time to recharge!</span>")
recharge_locked = TRUE
flick_overlay_view(I, targloc, 10)
icon_state = "pointer"
/obj/item/laser_pointer/process()
if(prob(20 - recharge_locked*5))
energy += 1
if(energy >= max_energy)
energy = max_energy
recharging = 0
recharge_locked = FALSE
..()
/obj/item/laser_pointer
name = "laser pointer"
desc = "Don't shine it in your eyes!"
icon = 'icons/obj/device.dmi'
icon_state = "pointer"
item_state = "pen"
var/pointer_icon_state
flags_1 = CONDUCT_1
item_flags = NOBLUDGEON
slot_flags = ITEM_SLOT_BELT
materials = list(MAT_METAL=500, MAT_GLASS=500)
w_class = WEIGHT_CLASS_SMALL
var/turf/pointer_loc
var/energy = 5
var/max_energy = 5
var/effectchance = 33
var/recharging = 0
var/recharge_locked = FALSE
var/obj/item/stock_parts/micro_laser/diode //used for upgrading!
/obj/item/laser_pointer/red
pointer_icon_state = "red_laser"
/obj/item/laser_pointer/green
pointer_icon_state = "green_laser"
/obj/item/laser_pointer/blue
pointer_icon_state = "blue_laser"
/obj/item/laser_pointer/purple
pointer_icon_state = "purple_laser"
/obj/item/laser_pointer/New()
..()
diode = new(src)
if(!pointer_icon_state)
pointer_icon_state = pick("red_laser","green_laser","blue_laser","purple_laser")
/obj/item/laser_pointer/upgraded/New()
..()
diode = new /obj/item/stock_parts/micro_laser/ultra
/obj/item/laser_pointer/attackby(obj/item/W, mob/user, params)
if(istype(W, /obj/item/stock_parts/micro_laser))
if(!diode)
if(!user.transferItemToLoc(W, src))
return
diode = W
to_chat(user, "<span class='notice'>You install a [diode.name] in [src].</span>")
else
to_chat(user, "<span class='notice'>[src] already has a diode installed.</span>")
else if(istype(W, /obj/item/screwdriver))
if(diode)
to_chat(user, "<span class='notice'>You remove the [diode.name] from \the [src].</span>")
diode.forceMove(drop_location())
diode = null
else
return ..()
/obj/item/laser_pointer/afterattack(atom/target, mob/living/user, flag, params)
. = ..()
laser_act(target, user, params)
/obj/item/laser_pointer/proc/laser_act(atom/target, mob/living/user, params)
if( !(user in (viewers(7,target))) )
return
if (!diode)
to_chat(user, "<span class='notice'>You point [src] at [target], but nothing happens!</span>")
return
if (!user.IsAdvancedToolUser())
to_chat(user, "<span class='warning'>You don't have the dexterity to do this!</span>")
return
if(HAS_TRAIT(user, TRAIT_CHUNKYFINGERS))
to_chat(user, "<span class='warning'>Your fingers can't press the button!</span>")
return
add_fingerprint(user)
//nothing happens if the battery is drained
if(recharge_locked)
to_chat(user, "<span class='notice'>You point [src] at [target], but it's still charging.</span>")
return
var/outmsg
var/turf/targloc = get_turf(target)
//human/alien mobs
if(iscarbon(target))
var/mob/living/carbon/C = target
if(user.zone_selected == BODY_ZONE_PRECISE_EYES)
log_combat(user, C, "shone in the eyes", src)
var/severity = 1
if(prob(33))
severity = 2
else if(prob(50))
severity = 0
//chance to actually hit the eyes depends on internal component
if(prob(effectchance * diode.rating) && C.flash_act(severity))
outmsg = "<span class='notice'>You blind [C] by shining [src] in [C.p_their()] eyes.</span>"
else
outmsg = "<span class='warning'>You fail to blind [C] by shining [src] at [C.p_their()] eyes!</span>"
//robots
else if(iscyborg(target))
var/mob/living/silicon/S = target
log_combat(user, S, "shone in the sensors", src)
//chance to actually hit the eyes depends on internal component
if(prob(effectchance * diode.rating))
S.flash_act(affect_silicon = 1)
S.Knockdown(rand(100,200))
to_chat(S, "<span class='danger'>Your sensors were overloaded by a laser!</span>")
outmsg = "<span class='notice'>You overload [S] by shining [src] at [S.p_their()] sensors.</span>"
else
outmsg = "<span class='warning'>You fail to overload [S] by shining [src] at [S.p_their()] sensors!</span>"
//cameras
else if(istype(target, /obj/machinery/camera))
var/obj/machinery/camera/C = target
if(prob(effectchance * diode.rating))
C.emp_act(EMP_HEAVY)
outmsg = "<span class='notice'>You hit the lens of [C] with [src], temporarily disabling the camera!</span>"
log_combat(user, C, "EMPed", src)
else
outmsg = "<span class='warning'>You miss the lens of [C] with [src]!</span>"
//catpeople
for(var/mob/living/carbon/human/H in view(1,targloc))
if(!iscatperson(H) || H.incapacitated() || H.eye_blind )
continue
if(!H.lying)
H.setDir(get_dir(H,targloc)) // kitty always looks at the light
if(prob(effectchance))
H.visible_message("<span class='warning'>[H] makes a grab for the light!</span>","<span class='userdanger'>LIGHT!</span>")
H.Move(targloc)
log_combat(user, H, "moved with a laser pointer",src)
else
H.visible_message("<span class='notice'>[H] looks briefly distracted by the light.</span>","<span class = 'warning'> You're briefly tempted by the shiny light... </span>")
else
H.visible_message("<span class='notice'>[H] stares at the light</span>","<span class = 'warning'> You stare at the light... </span>")
//cats!
for(var/mob/living/simple_animal/pet/cat/C in view(1,targloc))
if(prob(50))
C.visible_message("<span class='notice'>[C] pounces on the light!</span>","<span class='warning'>LIGHT!</span>")
C.Move(targloc)
C.resting = TRUE
C.update_canmove()
else
C.visible_message("<span class='notice'>[C] looks uninterested in your games.</span>","<span class='warning'>You spot [user] shining [src] at you. How insulting!</span>")
//laser pointer image
icon_state = "pointer_[pointer_icon_state]"
var/image/I = image('icons/obj/projectiles.dmi',targloc,pointer_icon_state,10)
var/list/click_params = params2list(params)
if(click_params)
if(click_params["icon-x"])
I.pixel_x = (text2num(click_params["icon-x"]) - 16)
if(click_params["icon-y"])
I.pixel_y = (text2num(click_params["icon-y"]) - 16)
else
I.pixel_x = target.pixel_x + rand(-5,5)
I.pixel_y = target.pixel_y + rand(-5,5)
if(outmsg)
to_chat(user, outmsg)
else
to_chat(user, "<span class='info'>You point [src] at [target].</span>")
energy -= 1
if(energy <= max_energy)
if(!recharging)
recharging = 1
START_PROCESSING(SSobj, src)
if(energy <= 0)
to_chat(user, "<span class='warning'>[src]'s battery is overused, it needs time to recharge!</span>")
recharge_locked = TRUE
flick_overlay_view(I, targloc, 10)
icon_state = "pointer"
/obj/item/laser_pointer/process()
if(prob(20 - recharge_locked*5))
energy += 1
if(energy >= max_energy)
energy = max_energy
recharging = 0
recharge_locked = FALSE
..()
+272 -272
View File
@@ -1,272 +1,272 @@
// Light Replacer (LR)
//
// ABOUT THE DEVICE
//
// This is a device supposedly to be used by Janitors and Janitor Cyborgs which will
// allow them to easily replace lights. This was mostly designed for Janitor Cyborgs since
// they don't have hands or a way to replace lightbulbs.
//
// HOW IT WORKS
//
// You attack a light fixture with it, if the light fixture is broken it will replace the
// light fixture with a working light; the broken light is then placed on the floor for the
// user to then pickup with a trash bag. If it's empty then it will just place a light in the fixture.
//
// HOW TO REFILL THE DEVICE
//
// It will need to be manually refilled with lights.
// If it's part of a robot module, it will charge when the Robot is inside a Recharge Station.
//
// EMAGGED FEATURES
//
// NOTICE: The Cyborg cannot use the emagged Light Replacer and the light's explosion was nerfed. It cannot create holes in the station anymore.
//
// I'm not sure everyone will react the emag's features so please say what your opinions are of it.
//
// When emagged it will rig every light it replaces, which will explode when the light is on.
// This is VERY noticable, even the device's name changes when you emag it so if anyone
// examines you when you're holding it in your hand, you will be discovered.
// It will also be very obvious who is setting all these lights off, since only Janitor Borgs and Janitors have easy
// access to them, and only one of them can emag their device.
//
// The explosion cannot insta-kill anyone with 30% or more health.
#define LIGHT_OK 0
#define LIGHT_EMPTY 1
#define LIGHT_BROKEN 2
#define LIGHT_BURNED 3
/obj/item/lightreplacer
name = "light replacer"
desc = "A device to automatically replace lights. Refill with broken or working light bulbs, or sheets of glass."
icon = 'icons/obj/janitor.dmi'
icon_state = "lightreplacer0"
item_state = "electronic"
lefthand_file = 'icons/mob/inhands/misc/devices_lefthand.dmi'
righthand_file = 'icons/mob/inhands/misc/devices_righthand.dmi'
flags_1 = CONDUCT_1
slot_flags = ITEM_SLOT_BELT
force = 8
var/max_uses = 20
var/uses = 0
var/failmsg = ""
// How much to increase per each glass?
var/increment = 5
// How much to take from the glass?
var/decrement = 1
var/charge = 1
// Eating used bulbs gives us bulb shards
var/bulb_shards = 0
// when we get this many shards, we get a free bulb.
var/shards_required = 4
/obj/item/lightreplacer/New()
uses = max_uses / 2
failmsg = "The [name]'s refill light blinks red."
..()
/obj/item/lightreplacer/examine(mob/user)
. = ..()
. += status_string()
/obj/item/lightreplacer/attackby(obj/item/W, mob/user, params)
if(istype(W, /obj/item/stack/sheet/glass))
var/obj/item/stack/sheet/glass/G = W
if(uses >= max_uses)
to_chat(user, "<span class='warning'>[src.name] is full.</span>")
return
else if(G.use(decrement))
AddUses(increment)
to_chat(user, "<span class='notice'>You insert a piece of glass into the [src.name]. You have [uses] light\s remaining.</span>")
return
else
to_chat(user, "<span class='warning'>You need one sheet of glass to replace lights!</span>")
if(istype(W, /obj/item/shard))
if(uses >= max_uses)
to_chat(user, "<span class='warning'>[src.name] is full.</span>")
return
if(!user.temporarilyRemoveItemFromInventory(W))
return
AddUses(round(increment*0.75))
to_chat(user, "<span class='notice'>You insert a shard of glass into the [src.name]. You have [uses] light\s remaining.</span>")
qdel(W)
return
if(istype(W, /obj/item/light))
var/obj/item/light/L = W
if(L.status == 0) // LIGHT OKAY
if(uses < max_uses)
if(!user.temporarilyRemoveItemFromInventory(W))
return
AddUses(1)
qdel(L)
else
if(!user.temporarilyRemoveItemFromInventory(W))
return
to_chat(user, "<span class='notice'>You insert the [L.name] into the [src.name]</span>")
AddShards(1, user)
qdel(L)
return
if(istype(W, /obj/item/storage))
var/obj/item/storage/S = W
var/found_lightbulbs = FALSE
var/replaced_something = TRUE
for(var/obj/item/I in S.contents)
if(istype(I, /obj/item/light))
var/obj/item/light/L = I
found_lightbulbs = TRUE
if(src.uses >= max_uses)
break
if(L.status == LIGHT_OK)
replaced_something = TRUE
AddUses(1)
qdel(L)
else if(L.status == LIGHT_BROKEN || L.status == LIGHT_BURNED)
replaced_something = TRUE
AddShards(1, user)
qdel(L)
if(!found_lightbulbs)
to_chat(user, "<span class='warning'>\The [S] contains no bulbs.</span>")
return
if(!replaced_something && src.uses == max_uses)
to_chat(user, "<span class='warning'>\The [src] is full!</span>")
return
to_chat(user, "<span class='notice'>You fill \the [src] with lights from \the [S]. " + status_string() + "</span>")
/obj/item/lightreplacer/emag_act()
. = ..()
if(obj_flags & EMAGGED)
return
Emag()
return TRUE
/obj/item/lightreplacer/attack_self(mob/user)
to_chat(user, status_string())
/obj/item/lightreplacer/update_icon()
icon_state = "lightreplacer[(obj_flags & EMAGGED ? 1 : 0)]"
/obj/item/lightreplacer/proc/status_string()
return "It has [uses] light\s remaining (plus [bulb_shards] fragment\s)."
/obj/item/lightreplacer/proc/Use(mob/user)
playsound(src.loc, 'sound/machines/click.ogg', 50, 1)
AddUses(-1)
return 1
// Negative numbers will subtract
/obj/item/lightreplacer/proc/AddUses(amount = 1)
uses = CLAMP(uses + amount, 0, max_uses)
/obj/item/lightreplacer/proc/AddShards(amount = 1, user)
bulb_shards += amount
var/new_bulbs = round(bulb_shards / shards_required)
if(new_bulbs > 0)
AddUses(new_bulbs)
bulb_shards = bulb_shards % shards_required
if(new_bulbs != 0)
to_chat(user, "<span class='notice'>\The [src] has fabricated a new bulb from the broken glass it has stored. It now has [uses] uses.</span>")
playsound(src.loc, 'sound/machines/ding.ogg', 50, 1)
return new_bulbs
/obj/item/lightreplacer/proc/Charge(var/mob/user)
charge += 1
if(charge > 3)
AddUses(1)
charge = 1
/obj/item/lightreplacer/proc/ReplaceLight(obj/machinery/light/target, mob/living/U)
if(target.status != LIGHT_OK)
if(CanUse(U))
if(!Use(U))
return
to_chat(U, "<span class='notice'>You replace the [target.fitting] with \the [src].</span>")
if(target.status != LIGHT_EMPTY)
AddShards(1, U)
target.status = LIGHT_EMPTY
target.update()
var/obj/item/light/L2 = new target.light_type()
target.status = L2.status
target.switchcount = L2.switchcount
target.rigged = (obj_flags & EMAGGED ? 1 : 0)
target.brightness = L2.brightness
target.on = target.has_power()
target.update()
qdel(L2)
if(target.on && target.rigged)
target.explode()
return
else
to_chat(U, failmsg)
return
else
to_chat(U, "<span class='warning'>There is a working [target.fitting] already inserted!</span>")
return
/obj/item/lightreplacer/proc/Emag()
obj_flags ^= EMAGGED
playsound(src.loc, "sparks", 100, 1)
if(obj_flags & EMAGGED)
name = "shortcircuited [initial(name)]"
else
name = initial(name)
update_icon()
/obj/item/lightreplacer/proc/CanUse(mob/living/user)
src.add_fingerprint(user)
if(uses > 0)
return 1
else
return 0
/obj/item/lightreplacer/afterattack(atom/T, mob/U, proximity)
. = ..()
if(!proximity)
return
if(!isturf(T))
return
var/used = FALSE
for(var/atom/A in T)
if(!CanUse(U))
break
used = TRUE
if(istype(A, /obj/machinery/light))
ReplaceLight(A, U)
if(!used)
to_chat(U, failmsg)
/obj/item/lightreplacer/proc/janicart_insert(mob/user, obj/structure/janitorialcart/J)
J.put_in_cart(src, user)
J.myreplacer = src
J.update_icon()
/obj/item/lightreplacer/cyborg/janicart_insert(mob/user, obj/structure/janitorialcart/J)
return
#undef LIGHT_OK
#undef LIGHT_EMPTY
#undef LIGHT_BROKEN
#undef LIGHT_BURNED
// Light Replacer (LR)
//
// ABOUT THE DEVICE
//
// This is a device supposedly to be used by Janitors and Janitor Cyborgs which will
// allow them to easily replace lights. This was mostly designed for Janitor Cyborgs since
// they don't have hands or a way to replace lightbulbs.
//
// HOW IT WORKS
//
// You attack a light fixture with it, if the light fixture is broken it will replace the
// light fixture with a working light; the broken light is then placed on the floor for the
// user to then pickup with a trash bag. If it's empty then it will just place a light in the fixture.
//
// HOW TO REFILL THE DEVICE
//
// It will need to be manually refilled with lights.
// If it's part of a robot module, it will charge when the Robot is inside a Recharge Station.
//
// EMAGGED FEATURES
//
// NOTICE: The Cyborg cannot use the emagged Light Replacer and the light's explosion was nerfed. It cannot create holes in the station anymore.
//
// I'm not sure everyone will react the emag's features so please say what your opinions are of it.
//
// When emagged it will rig every light it replaces, which will explode when the light is on.
// This is VERY noticable, even the device's name changes when you emag it so if anyone
// examines you when you're holding it in your hand, you will be discovered.
// It will also be very obvious who is setting all these lights off, since only Janitor Borgs and Janitors have easy
// access to them, and only one of them can emag their device.
//
// The explosion cannot insta-kill anyone with 30% or more health.
#define LIGHT_OK 0
#define LIGHT_EMPTY 1
#define LIGHT_BROKEN 2
#define LIGHT_BURNED 3
/obj/item/lightreplacer
name = "light replacer"
desc = "A device to automatically replace lights. Refill with broken or working light bulbs, or sheets of glass."
icon = 'icons/obj/janitor.dmi'
icon_state = "lightreplacer0"
item_state = "electronic"
lefthand_file = 'icons/mob/inhands/misc/devices_lefthand.dmi'
righthand_file = 'icons/mob/inhands/misc/devices_righthand.dmi'
flags_1 = CONDUCT_1
slot_flags = ITEM_SLOT_BELT
force = 8
var/max_uses = 20
var/uses = 0
var/failmsg = ""
// How much to increase per each glass?
var/increment = 5
// How much to take from the glass?
var/decrement = 1
var/charge = 1
// Eating used bulbs gives us bulb shards
var/bulb_shards = 0
// when we get this many shards, we get a free bulb.
var/shards_required = 4
/obj/item/lightreplacer/New()
uses = max_uses / 2
failmsg = "The [name]'s refill light blinks red."
..()
/obj/item/lightreplacer/examine(mob/user)
. = ..()
. += status_string()
/obj/item/lightreplacer/attackby(obj/item/W, mob/user, params)
if(istype(W, /obj/item/stack/sheet/glass))
var/obj/item/stack/sheet/glass/G = W
if(uses >= max_uses)
to_chat(user, "<span class='warning'>[src.name] is full.</span>")
return
else if(G.use(decrement))
AddUses(increment)
to_chat(user, "<span class='notice'>You insert a piece of glass into the [src.name]. You have [uses] light\s remaining.</span>")
return
else
to_chat(user, "<span class='warning'>You need one sheet of glass to replace lights!</span>")
if(istype(W, /obj/item/shard))
if(uses >= max_uses)
to_chat(user, "<span class='warning'>[src.name] is full.</span>")
return
if(!user.temporarilyRemoveItemFromInventory(W))
return
AddUses(round(increment*0.75))
to_chat(user, "<span class='notice'>You insert a shard of glass into the [src.name]. You have [uses] light\s remaining.</span>")
qdel(W)
return
if(istype(W, /obj/item/light))
var/obj/item/light/L = W
if(L.status == 0) // LIGHT OKAY
if(uses < max_uses)
if(!user.temporarilyRemoveItemFromInventory(W))
return
AddUses(1)
qdel(L)
else
if(!user.temporarilyRemoveItemFromInventory(W))
return
to_chat(user, "<span class='notice'>You insert the [L.name] into the [src.name]</span>")
AddShards(1, user)
qdel(L)
return
if(istype(W, /obj/item/storage))
var/obj/item/storage/S = W
var/found_lightbulbs = FALSE
var/replaced_something = TRUE
for(var/obj/item/I in S.contents)
if(istype(I, /obj/item/light))
var/obj/item/light/L = I
found_lightbulbs = TRUE
if(src.uses >= max_uses)
break
if(L.status == LIGHT_OK)
replaced_something = TRUE
AddUses(1)
qdel(L)
else if(L.status == LIGHT_BROKEN || L.status == LIGHT_BURNED)
replaced_something = TRUE
AddShards(1, user)
qdel(L)
if(!found_lightbulbs)
to_chat(user, "<span class='warning'>\The [S] contains no bulbs.</span>")
return
if(!replaced_something && src.uses == max_uses)
to_chat(user, "<span class='warning'>\The [src] is full!</span>")
return
to_chat(user, "<span class='notice'>You fill \the [src] with lights from \the [S]. " + status_string() + "</span>")
/obj/item/lightreplacer/emag_act()
. = ..()
if(obj_flags & EMAGGED)
return
Emag()
return TRUE
/obj/item/lightreplacer/attack_self(mob/user)
to_chat(user, status_string())
/obj/item/lightreplacer/update_icon()
icon_state = "lightreplacer[(obj_flags & EMAGGED ? 1 : 0)]"
/obj/item/lightreplacer/proc/status_string()
return "It has [uses] light\s remaining (plus [bulb_shards] fragment\s)."
/obj/item/lightreplacer/proc/Use(mob/user)
playsound(src.loc, 'sound/machines/click.ogg', 50, 1)
AddUses(-1)
return 1
// Negative numbers will subtract
/obj/item/lightreplacer/proc/AddUses(amount = 1)
uses = CLAMP(uses + amount, 0, max_uses)
/obj/item/lightreplacer/proc/AddShards(amount = 1, user)
bulb_shards += amount
var/new_bulbs = round(bulb_shards / shards_required)
if(new_bulbs > 0)
AddUses(new_bulbs)
bulb_shards = bulb_shards % shards_required
if(new_bulbs != 0)
to_chat(user, "<span class='notice'>\The [src] has fabricated a new bulb from the broken glass it has stored. It now has [uses] uses.</span>")
playsound(src.loc, 'sound/machines/ding.ogg', 50, 1)
return new_bulbs
/obj/item/lightreplacer/proc/Charge(var/mob/user)
charge += 1
if(charge > 3)
AddUses(1)
charge = 1
/obj/item/lightreplacer/proc/ReplaceLight(obj/machinery/light/target, mob/living/U)
if(target.status != LIGHT_OK)
if(CanUse(U))
if(!Use(U))
return
to_chat(U, "<span class='notice'>You replace the [target.fitting] with \the [src].</span>")
if(target.status != LIGHT_EMPTY)
AddShards(1, U)
target.status = LIGHT_EMPTY
target.update()
var/obj/item/light/L2 = new target.light_type()
target.status = L2.status
target.switchcount = L2.switchcount
target.rigged = (obj_flags & EMAGGED ? 1 : 0)
target.brightness = L2.brightness
target.on = target.has_power()
target.update()
qdel(L2)
if(target.on && target.rigged)
target.explode()
return
else
to_chat(U, failmsg)
return
else
to_chat(U, "<span class='warning'>There is a working [target.fitting] already inserted!</span>")
return
/obj/item/lightreplacer/proc/Emag()
obj_flags ^= EMAGGED
playsound(src.loc, "sparks", 100, 1)
if(obj_flags & EMAGGED)
name = "shortcircuited [initial(name)]"
else
name = initial(name)
update_icon()
/obj/item/lightreplacer/proc/CanUse(mob/living/user)
src.add_fingerprint(user)
if(uses > 0)
return 1
else
return 0
/obj/item/lightreplacer/afterattack(atom/T, mob/U, proximity)
. = ..()
if(!proximity)
return
if(!isturf(T))
return
var/used = FALSE
for(var/atom/A in T)
if(!CanUse(U))
break
used = TRUE
if(istype(A, /obj/machinery/light))
ReplaceLight(A, U)
if(!used)
to_chat(U, failmsg)
/obj/item/lightreplacer/proc/janicart_insert(mob/user, obj/structure/janitorialcart/J)
J.put_in_cart(src, user)
J.myreplacer = src
J.update_icon()
/obj/item/lightreplacer/cyborg/janicart_insert(mob/user, obj/structure/janitorialcart/J)
return
#undef LIGHT_OK
#undef LIGHT_EMPTY
#undef LIGHT_BROKEN
#undef LIGHT_BURNED
+266 -266
View File
@@ -1,266 +1,266 @@
#define PROXIMITY_NONE ""
#define PROXIMITY_ON_SCREEN "_red"
#define PROXIMITY_NEAR "_yellow"
/**
* Multitool -- A multitool is used for hacking electronic devices.
*
*/
/obj/item/multitool
name = "multitool"
desc = "Used for pulsing wires to test which to cut. Not recommended by doctors."
icon = 'icons/obj/device.dmi'
icon_state = "multitool"
item_state = "multitool"
lefthand_file = 'icons/mob/inhands/equipment/tools_lefthand.dmi'
righthand_file = 'icons/mob/inhands/equipment/tools_righthand.dmi'
force = 5
w_class = WEIGHT_CLASS_SMALL
tool_behaviour = TOOL_MULTITOOL
throwforce = 0
throw_range = 7
throw_speed = 3
materials = list(MAT_METAL=50, MAT_GLASS=20)
var/obj/machinery/buffer // simple machine buffer for device linkage
toolspeed = 1
tool_behaviour = TOOL_MULTITOOL
usesound = 'sound/weapons/empty.ogg'
var/datum/integrated_io/selected_io = null //functional for integrated circuits.
var/mode = 0
/obj/item/multitool/chaplain
name = "\improper hypertool"
desc = "Used for pulsing wires to test which to cut. Also emits microwaves to fry some brains!"
damtype = BRAIN
force = 18
armour_penetration = 35
hitsound = 'sound/effects/sparks4.ogg'
var/chaplain_spawnable = TRUE
total_mass = TOTAL_MASS_MEDIEVAL_WEAPON
throw_speed = 3
throw_range = 4
throwforce = 10
obj_flags = UNIQUE_RENAME
/obj/item/multitool/chaplain/Initialize()
. = ..()
AddComponent(/datum/component/anti_magic, TRUE, TRUE, FALSE, null, null, FALSE)
/obj/item/multitool/examine(mob/user)
. = ..()
if(selected_io)
. += "<span class='notice'>Activate [src] to detach the data wire.</span>"
if(buffer)
. += "<span class='notice'>Its buffer contains [buffer].</span>"
/obj/item/multitool/suicide_act(mob/living/carbon/user)
user.visible_message("<span class='suicide'>[user] puts the [src] to [user.p_their()] chest. It looks like [user.p_theyre()] trying to pulse [user.p_their()] heart off!</span>")
return OXYLOSS//theres a reason it wasnt recommended by doctors
/obj/item/multitool/attack_self(mob/user)
if(selected_io)
selected_io = null
to_chat(user, "<span class='notice'>You clear the wired connection from the multitool.</span>")
update_icon()
/obj/item/multitool/update_icon()
if(selected_io)
icon_state = "multitool_red"
else
icon_state = "multitool"
/obj/item/multitool/proc/wire(var/datum/integrated_io/io, mob/user)
if(!io.holder.assembly)
to_chat(user, "<span class='warning'>\The [io.holder] needs to be secured inside an assembly first.</span>")
return
if(selected_io)
if(io == selected_io)
to_chat(user, "<span class='warning'>Wiring \the [selected_io.holder]'s [selected_io.name] into itself is rather pointless.</span>")
return
if(io.io_type != selected_io.io_type)
to_chat(user, "<span class='warning'>Those two types of channels are incompatible. The first is a [selected_io.io_type], \
while the second is a [io.io_type].</span>")
return
if(io.holder.assembly && io.holder.assembly != selected_io.holder.assembly)
to_chat(user, "<span class='warning'>Both \the [io.holder] and \the [selected_io.holder] need to be inside the same assembly.</span>")
return
io.connect_pin(selected_io)
to_chat(user, "<span class='notice'>You connect \the [selected_io.holder]'s [selected_io.name] to \the [io.holder]'s [io.name].</span>")
selected_io.holder.interact(user) // This is to update the UI.
selected_io = null
else
selected_io = io
to_chat(user, "<span class='notice'>You link \the multitool to \the [selected_io.holder]'s [selected_io.name] data channel.</span>")
update_icon()
/obj/item/multitool/proc/unwire(var/datum/integrated_io/io1, var/datum/integrated_io/io2, mob/user)
if(!io1.linked.len || !io2.linked.len)
to_chat(user, "<span class='warning'>There is nothing connected to the data channel.</span>")
return
if(!(io1 in io2.linked) || !(io2 in io1.linked) )
to_chat(user, "<span class='warning'>These data pins aren't connected!</span>")
return
else
io1.disconnect_pin(io2)
to_chat(user, "<span class='notice'>You clip the data connection between the [io1.holder.displayed_name]'s \
[io1.name] and the [io2.holder.displayed_name]'s [io2.name].</span>")
io1.holder.interact(user) // This is to update the UI.
update_icon()
// Syndicate device disguised as a multitool; it will turn red when an AI camera is nearby.
/obj/item/multitool/ai_detect
var/track_cooldown = 0
var/track_delay = 10 //How often it checks for proximity
var/detect_state = PROXIMITY_NONE
var/rangealert = 8 //Glows red when inside
var/rangewarning = 20 //Glows yellow when inside
var/hud_type = DATA_HUD_AI_DETECT
var/hud_on = FALSE
var/mob/camera/aiEye/remote/ai_detector/eye
var/datum/action/item_action/toggle_multitool/toggle_action
/obj/item/multitool/ai_detect/Initialize()
. = ..()
START_PROCESSING(SSobj, src)
eye = new /mob/camera/aiEye/remote/ai_detector()
toggle_action = new /datum/action/item_action/toggle_multitool(src)
/obj/item/multitool/ai_detect/Destroy()
STOP_PROCESSING(SSobj, src)
if(hud_on && ismob(loc))
remove_hud(loc)
QDEL_NULL(toggle_action)
QDEL_NULL(eye)
return ..()
/obj/item/multitool/ai_detect/ui_action_click()
return
/obj/item/multitool/ai_detect/update_icon()
if(selected_io)
icon_state = "multitool_red"
else
icon_state = "[initial(icon_state)][detect_state]"
/obj/item/multitool/ai_detect/equipped(mob/living/carbon/human/user, slot)
..()
if(hud_on)
show_hud(user)
/obj/item/multitool/ai_detect/dropped(mob/living/carbon/human/user)
..()
if(hud_on)
remove_hud(user)
/obj/item/multitool/ai_detect/process()
if(track_cooldown > world.time)
return
detect_state = PROXIMITY_NONE
if(eye.eye_user)
eye.setLoc(get_turf(src))
multitool_detect()
update_icon()
track_cooldown = world.time + track_delay
/obj/item/multitool/ai_detect/proc/toggle_hud(mob/user)
hud_on = !hud_on
if(user)
to_chat(user, "<span class='notice'>You toggle the ai detection HUD on [src] [hud_on ? "on" : "off"].</span>")
if(hud_on)
show_hud(user)
else
remove_hud(user)
/obj/item/multitool/ai_detect/proc/show_hud(mob/user)
if(user && hud_type)
var/obj/screen/plane_master/camera_static/PM = user.hud_used.plane_masters["[CAMERA_STATIC_PLANE]"]
PM.alpha = 150
var/datum/atom_hud/H = GLOB.huds[hud_type]
if(!H.hudusers[user])
H.add_hud_to(user)
eye.eye_user = user
eye.setLoc(get_turf(src))
/obj/item/multitool/ai_detect/proc/remove_hud(mob/user)
if(user && hud_type)
var/obj/screen/plane_master/camera_static/PM = user.hud_used.plane_masters["[CAMERA_STATIC_PLANE]"]
PM.alpha = 255
var/datum/atom_hud/H = GLOB.huds[hud_type]
H.remove_hud_from(user)
if(eye)
eye.setLoc(null)
eye.eye_user = null
/obj/item/multitool/ai_detect/proc/multitool_detect()
var/turf/our_turf = get_turf(src)
for(var/mob/living/silicon/ai/AI in GLOB.ai_list)
if(AI.cameraFollow == src)
detect_state = PROXIMITY_ON_SCREEN
break
if(detect_state)
return
var/datum/camerachunk/chunk = GLOB.cameranet.chunkGenerated(our_turf.x, our_turf.y, our_turf.z)
if(chunk && chunk.seenby.len)
for(var/mob/camera/aiEye/A in chunk.seenby)
if(!A.ai_detector_visible)
continue
var/turf/detect_turf = get_turf(A)
if(get_dist(our_turf, detect_turf) < rangealert)
detect_state = PROXIMITY_ON_SCREEN
break
if(get_dist(our_turf, detect_turf) < rangewarning)
detect_state = PROXIMITY_NEAR
break
/mob/camera/aiEye/remote/ai_detector
name = "AI detector eye"
ai_detector_visible = FALSE
use_static = USE_STATIC_TRANSPARENT
visible_icon = FALSE
/datum/action/item_action/toggle_multitool
name = "Toggle AI detector HUD"
check_flags = NONE
/datum/action/item_action/toggle_multitool/Trigger()
if(!..())
return 0
if(target)
var/obj/item/multitool/ai_detect/M = target
M.toggle_hud(owner)
return 1
/obj/item/multitool/cyborg
name = "multitool"
desc = "Optimised and stripped-down version of a regular multitool."
icon = 'icons/obj/items_cyborg.dmi'
icon_state = "multitool_cyborg"
toolspeed = 0.5
/obj/item/multitool/abductor
name = "alien multitool"
desc = "An omni-technological interface."
icon = 'icons/obj/abductor.dmi'
icon_state = "multitool"
toolspeed = 0.1
/obj/item/multitool/advanced
name = "advanced multitool"
desc = "The reproduction of an abductor's multitool, this multitool is a classy silver."
icon = 'icons/obj/advancedtools.dmi'
icon_state = "multitool"
toolspeed = 0.2
#define PROXIMITY_NONE ""
#define PROXIMITY_ON_SCREEN "_red"
#define PROXIMITY_NEAR "_yellow"
/**
* Multitool -- A multitool is used for hacking electronic devices.
*
*/
/obj/item/multitool
name = "multitool"
desc = "Used for pulsing wires to test which to cut. Not recommended by doctors."
icon = 'icons/obj/device.dmi'
icon_state = "multitool"
item_state = "multitool"
lefthand_file = 'icons/mob/inhands/equipment/tools_lefthand.dmi'
righthand_file = 'icons/mob/inhands/equipment/tools_righthand.dmi'
force = 5
w_class = WEIGHT_CLASS_SMALL
tool_behaviour = TOOL_MULTITOOL
throwforce = 0
throw_range = 7
throw_speed = 3
materials = list(MAT_METAL=50, MAT_GLASS=20)
var/obj/machinery/buffer // simple machine buffer for device linkage
toolspeed = 1
tool_behaviour = TOOL_MULTITOOL
usesound = 'sound/weapons/empty.ogg'
var/datum/integrated_io/selected_io = null //functional for integrated circuits.
var/mode = 0
/obj/item/multitool/chaplain
name = "\improper hypertool"
desc = "Used for pulsing wires to test which to cut. Also emits microwaves to fry some brains!"
damtype = BRAIN
force = 18
armour_penetration = 35
hitsound = 'sound/effects/sparks4.ogg'
var/chaplain_spawnable = TRUE
total_mass = TOTAL_MASS_MEDIEVAL_WEAPON
throw_speed = 3
throw_range = 4
throwforce = 10
obj_flags = UNIQUE_RENAME
/obj/item/multitool/chaplain/Initialize()
. = ..()
AddComponent(/datum/component/anti_magic, TRUE, TRUE, FALSE, null, null, FALSE)
/obj/item/multitool/examine(mob/user)
. = ..()
if(selected_io)
. += "<span class='notice'>Activate [src] to detach the data wire.</span>"
if(buffer)
. += "<span class='notice'>Its buffer contains [buffer].</span>"
/obj/item/multitool/suicide_act(mob/living/carbon/user)
user.visible_message("<span class='suicide'>[user] puts the [src] to [user.p_their()] chest. It looks like [user.p_theyre()] trying to pulse [user.p_their()] heart off!</span>")
return OXYLOSS//theres a reason it wasnt recommended by doctors
/obj/item/multitool/attack_self(mob/user)
if(selected_io)
selected_io = null
to_chat(user, "<span class='notice'>You clear the wired connection from the multitool.</span>")
update_icon()
/obj/item/multitool/update_icon()
if(selected_io)
icon_state = "multitool_red"
else
icon_state = "multitool"
/obj/item/multitool/proc/wire(var/datum/integrated_io/io, mob/user)
if(!io.holder.assembly)
to_chat(user, "<span class='warning'>\The [io.holder] needs to be secured inside an assembly first.</span>")
return
if(selected_io)
if(io == selected_io)
to_chat(user, "<span class='warning'>Wiring \the [selected_io.holder]'s [selected_io.name] into itself is rather pointless.</span>")
return
if(io.io_type != selected_io.io_type)
to_chat(user, "<span class='warning'>Those two types of channels are incompatible. The first is a [selected_io.io_type], \
while the second is a [io.io_type].</span>")
return
if(io.holder.assembly && io.holder.assembly != selected_io.holder.assembly)
to_chat(user, "<span class='warning'>Both \the [io.holder] and \the [selected_io.holder] need to be inside the same assembly.</span>")
return
io.connect_pin(selected_io)
to_chat(user, "<span class='notice'>You connect \the [selected_io.holder]'s [selected_io.name] to \the [io.holder]'s [io.name].</span>")
selected_io.holder.interact(user) // This is to update the UI.
selected_io = null
else
selected_io = io
to_chat(user, "<span class='notice'>You link \the multitool to \the [selected_io.holder]'s [selected_io.name] data channel.</span>")
update_icon()
/obj/item/multitool/proc/unwire(var/datum/integrated_io/io1, var/datum/integrated_io/io2, mob/user)
if(!io1.linked.len || !io2.linked.len)
to_chat(user, "<span class='warning'>There is nothing connected to the data channel.</span>")
return
if(!(io1 in io2.linked) || !(io2 in io1.linked) )
to_chat(user, "<span class='warning'>These data pins aren't connected!</span>")
return
else
io1.disconnect_pin(io2)
to_chat(user, "<span class='notice'>You clip the data connection between the [io1.holder.displayed_name]'s \
[io1.name] and the [io2.holder.displayed_name]'s [io2.name].</span>")
io1.holder.interact(user) // This is to update the UI.
update_icon()
// Syndicate device disguised as a multitool; it will turn red when an AI camera is nearby.
/obj/item/multitool/ai_detect
var/track_cooldown = 0
var/track_delay = 10 //How often it checks for proximity
var/detect_state = PROXIMITY_NONE
var/rangealert = 8 //Glows red when inside
var/rangewarning = 20 //Glows yellow when inside
var/hud_type = DATA_HUD_AI_DETECT
var/hud_on = FALSE
var/mob/camera/aiEye/remote/ai_detector/eye
var/datum/action/item_action/toggle_multitool/toggle_action
/obj/item/multitool/ai_detect/Initialize()
. = ..()
START_PROCESSING(SSobj, src)
eye = new /mob/camera/aiEye/remote/ai_detector()
toggle_action = new /datum/action/item_action/toggle_multitool(src)
/obj/item/multitool/ai_detect/Destroy()
STOP_PROCESSING(SSobj, src)
if(hud_on && ismob(loc))
remove_hud(loc)
QDEL_NULL(toggle_action)
QDEL_NULL(eye)
return ..()
/obj/item/multitool/ai_detect/ui_action_click()
return
/obj/item/multitool/ai_detect/update_icon()
if(selected_io)
icon_state = "multitool_red"
else
icon_state = "[initial(icon_state)][detect_state]"
/obj/item/multitool/ai_detect/equipped(mob/living/carbon/human/user, slot)
..()
if(hud_on)
show_hud(user)
/obj/item/multitool/ai_detect/dropped(mob/living/carbon/human/user)
..()
if(hud_on)
remove_hud(user)
/obj/item/multitool/ai_detect/process()
if(track_cooldown > world.time)
return
detect_state = PROXIMITY_NONE
if(eye.eye_user)
eye.setLoc(get_turf(src))
multitool_detect()
update_icon()
track_cooldown = world.time + track_delay
/obj/item/multitool/ai_detect/proc/toggle_hud(mob/user)
hud_on = !hud_on
if(user)
to_chat(user, "<span class='notice'>You toggle the ai detection HUD on [src] [hud_on ? "on" : "off"].</span>")
if(hud_on)
show_hud(user)
else
remove_hud(user)
/obj/item/multitool/ai_detect/proc/show_hud(mob/user)
if(user && hud_type)
var/obj/screen/plane_master/camera_static/PM = user.hud_used.plane_masters["[CAMERA_STATIC_PLANE]"]
PM.alpha = 150
var/datum/atom_hud/H = GLOB.huds[hud_type]
if(!H.hudusers[user])
H.add_hud_to(user)
eye.eye_user = user
eye.setLoc(get_turf(src))
/obj/item/multitool/ai_detect/proc/remove_hud(mob/user)
if(user && hud_type)
var/obj/screen/plane_master/camera_static/PM = user.hud_used.plane_masters["[CAMERA_STATIC_PLANE]"]
PM.alpha = 255
var/datum/atom_hud/H = GLOB.huds[hud_type]
H.remove_hud_from(user)
if(eye)
eye.setLoc(null)
eye.eye_user = null
/obj/item/multitool/ai_detect/proc/multitool_detect()
var/turf/our_turf = get_turf(src)
for(var/mob/living/silicon/ai/AI in GLOB.ai_list)
if(AI.cameraFollow == src)
detect_state = PROXIMITY_ON_SCREEN
break
if(detect_state)
return
var/datum/camerachunk/chunk = GLOB.cameranet.chunkGenerated(our_turf.x, our_turf.y, our_turf.z)
if(chunk && chunk.seenby.len)
for(var/mob/camera/aiEye/A in chunk.seenby)
if(!A.ai_detector_visible)
continue
var/turf/detect_turf = get_turf(A)
if(get_dist(our_turf, detect_turf) < rangealert)
detect_state = PROXIMITY_ON_SCREEN
break
if(get_dist(our_turf, detect_turf) < rangewarning)
detect_state = PROXIMITY_NEAR
break
/mob/camera/aiEye/remote/ai_detector
name = "AI detector eye"
ai_detector_visible = FALSE
use_static = USE_STATIC_TRANSPARENT
visible_icon = FALSE
/datum/action/item_action/toggle_multitool
name = "Toggle AI detector HUD"
check_flags = NONE
/datum/action/item_action/toggle_multitool/Trigger()
if(!..())
return 0
if(target)
var/obj/item/multitool/ai_detect/M = target
M.toggle_hud(owner)
return 1
/obj/item/multitool/cyborg
name = "multitool"
desc = "Optimised and stripped-down version of a regular multitool."
icon = 'icons/obj/items_cyborg.dmi'
icon_state = "multitool_cyborg"
toolspeed = 0.5
/obj/item/multitool/abductor
name = "alien multitool"
desc = "An omni-technological interface."
icon = 'icons/obj/abductor.dmi'
icon_state = "multitool"
toolspeed = 0.1
/obj/item/multitool/advanced
name = "advanced multitool"
desc = "The reproduction of an abductor's multitool, this multitool is a classy silver."
icon = 'icons/obj/advancedtools.dmi'
icon_state = "multitool"
toolspeed = 0.2
+169 -169
View File
@@ -1,169 +1,169 @@
/obj/item/paicard
name = "personal AI device"
icon = 'icons/obj/aicards.dmi'
icon_state = "pai"
item_state = "electronic"
lefthand_file = 'icons/mob/inhands/misc/devices_lefthand.dmi'
righthand_file = 'icons/mob/inhands/misc/devices_righthand.dmi'
w_class = WEIGHT_CLASS_SMALL
slot_flags = ITEM_SLOT_BELT
var/mob/living/silicon/pai/pai
resistance_flags = FIRE_PROOF | ACID_PROOF
max_integrity = 200
/obj/item/paicard/suicide_act(mob/living/user)
user.visible_message("<span class='suicide'>[user] is staring sadly at [src]! [user.p_they()] can't keep living without real human intimacy!</span>")
return OXYLOSS
/obj/item/paicard/Initialize()
SSpai.pai_card_list += src
add_overlay("pai-off")
return ..()
/obj/item/paicard/Destroy()
//Will stop people throwing friend pAIs into the singularity so they can respawn
SSpai.pai_card_list -= src
if (!QDELETED(pai))
QDEL_NULL(pai)
return ..()
/obj/item/paicard/attack_self(mob/user)
if (!in_range(src, user))
return
user.set_machine(src)
var/dat = "<TT><B>Personal AI Device</B><BR>"
if(pai)
if(!pai.master_dna || !pai.master)
dat += "<a href='byond://?src=[REF(src)];setdna=1'>Imprint Master DNA</a><br>"
dat += "Installed Personality: [pai.name]<br>"
dat += "Prime directive: <br>[pai.laws.zeroth]<br>"
for(var/slaws in pai.laws.supplied)
dat += "Additional directives: <br>[slaws]<br>"
dat += "<a href='byond://?src=[REF(src)];setlaws=1'>Configure Directives</a><br>"
dat += "<br>"
dat += "<h3>Device Settings</h3><br>"
if(pai.radio)
dat += "<b>Radio Uplink</b><br>"
dat += "Transmit: <A href='byond://?src=[REF(src)];wires=[WIRE_TX]'>[(pai.radio.wires.is_cut(WIRE_TX)) ? "Disabled" : "Enabled"]</A><br>"
dat += "Receive: <A href='byond://?src=[REF(src)];wires=[WIRE_RX]'>[(pai.radio.wires.is_cut(WIRE_RX)) ? "Disabled" : "Enabled"]</A><br>"
if(pai.radio_short)
dat += "<font color='red'>Reset radio short: <a href='byond://?src=[REF(src)];reset_radio_short=1'>\[RESET\]</a><br>"
else
dat += "<b>Radio Uplink</b><br>"
dat += "<font color=red><i>Radio firmware not loaded. Please install a pAI personality to load firmware.</i></font><br>"
if(ishuman(user))
var/mob/living/carbon/human/H = user
if(H.real_name == pai.master || H.dna.unique_enzymes == pai.master_dna)
dat += "<A href='byond://?src=[REF(src)];toggle_holo=1'>\[[pai.canholo? "Disable" : "Enable"] holomatrix projectors\]</a><br>"
dat += "<A href='byond://?src=[REF(src)];wipe=1'>\[Wipe current pAI personality\]</a><br>"
else
dat += "No personality installed.<br>"
dat += "Searching for a personality... Press view available personalities to notify potential candidates."
dat += "<A href='byond://?src=[REF(src)];request=1'>\[View available personalities\]</a><br>"
user << browse(dat, "window=paicard")
onclose(user, "paicard")
return
/obj/item/paicard/Topic(href, href_list)
if(!usr || usr.stat)
return
if(href_list["request"])
SSpai.findPAI(src, usr)
if(pai)
if(!(loc == usr))
return
if(href_list["setdna"])
if(pai.master_dna)
return
if(!iscarbon(usr))
to_chat(usr, "<span class='warning'>You don't have any DNA, or your DNA is incompatible with this device!</span>")
else
var/mob/living/carbon/M = usr
pai.master = M.real_name
pai.master_dna = M.dna.unique_enzymes
to_chat(pai, "<span class='notice'>You have been bound to a new master.</span>")
if(href_list["wipe"])
var/confirm = input("Are you CERTAIN you wish to delete the current personality? This action cannot be undone.", "Personality Wipe") in list("Yes", "No")
if(confirm == "Yes")
if(pai)
to_chat(pai, "<span class='warning'>You feel yourself slipping away from reality.</span>")
to_chat(pai, "<span class='danger'>Byte by byte you lose your sense of self.</span>")
to_chat(pai, "<span class='userdanger'>Your mental faculties leave you.</span>")
to_chat(pai, "<span class='rose'>oblivion... </span>")
qdel(pai)
if(href_list["wires"])
var/wire = text2num(href_list["wires"])
if(pai.radio)
pai.radio.wires.cut(wire)
if(href_list["reset_radio_short"])
pai.unshort_radio()
if(href_list["setlaws"])
var/newlaws = copytext(sanitize(input("Enter any additional directives you would like your pAI personality to follow. Note that these directives will not override the personality's allegiance to its imprinted master. Conflicting directives will be ignored.", "pAI Directive Configuration", pai.laws.supplied[1]) as message),1,MAX_MESSAGE_LEN)
if(newlaws && pai)
pai.add_supplied_law(0,newlaws)
if(href_list["toggle_holo"])
if(pai.canholo)
to_chat(pai, "<span class='userdanger'>Your owner has disabled your holomatrix projectors!</span>")
pai.canholo = FALSE
to_chat(usr, "<span class='warning'>You disable your pAI's holomatrix!</span>")
else
to_chat(pai, "<span class='boldnotice'>Your owner has enabled your holomatrix projectors!</span>")
pai.canholo = TRUE
to_chat(usr, "<span class='notice'>You enable your pAI's holomatrix!</span>")
attack_self(usr)
// WIRE_SIGNAL = 1
// WIRE_RECEIVE = 2
// WIRE_TRANSMIT = 4
/obj/item/paicard/proc/setPersonality(mob/living/silicon/pai/personality)
src.pai = personality
src.add_overlay("pai-null")
playsound(loc, 'sound/effects/pai_boot.ogg', 50, 1, -1)
audible_message("\The [src] plays a cheerful startup noise!")
/obj/item/paicard/proc/setEmotion(emotion)
if(pai)
src.cut_overlays()
switch(emotion)
if(1)
src.add_overlay("pai-happy")
if(2)
src.add_overlay("pai-cat")
if(3)
src.add_overlay("pai-extremely-happy")
if(4)
src.add_overlay("pai-face")
if(5)
src.add_overlay("pai-laugh")
if(6)
src.add_overlay("pai-off")
if(7)
src.add_overlay("pai-sad")
if(8)
src.add_overlay("pai-angry")
if(9)
src.add_overlay("pai-what")
if(10)
src.add_overlay("pai-null")
if(11)
src.add_overlay("pai-exclamation")
if(12)
src.add_overlay("pai-question")
if(13)
src.add_overlay("pai-sunglasses")
/obj/item/paicard/proc/alertUpdate()
visible_message("<span class ='info'>[src] flashes a message across its screen, \"Additional personalities available for download.\"", "<span class='notice'>[src] bleeps electronically.</span>")
/obj/item/paicard/emp_act(severity)
. = ..()
if (. & EMP_PROTECT_SELF)
return
if(pai && !pai.holoform)
pai.emp_act(severity)
/obj/item/paicard
name = "personal AI device"
icon = 'icons/obj/aicards.dmi'
icon_state = "pai"
item_state = "electronic"
lefthand_file = 'icons/mob/inhands/misc/devices_lefthand.dmi'
righthand_file = 'icons/mob/inhands/misc/devices_righthand.dmi'
w_class = WEIGHT_CLASS_SMALL
slot_flags = ITEM_SLOT_BELT
var/mob/living/silicon/pai/pai
resistance_flags = FIRE_PROOF | ACID_PROOF
max_integrity = 200
/obj/item/paicard/suicide_act(mob/living/user)
user.visible_message("<span class='suicide'>[user] is staring sadly at [src]! [user.p_they()] can't keep living without real human intimacy!</span>")
return OXYLOSS
/obj/item/paicard/Initialize()
SSpai.pai_card_list += src
add_overlay("pai-off")
return ..()
/obj/item/paicard/Destroy()
//Will stop people throwing friend pAIs into the singularity so they can respawn
SSpai.pai_card_list -= src
if (!QDELETED(pai))
QDEL_NULL(pai)
return ..()
/obj/item/paicard/attack_self(mob/user)
if (!in_range(src, user))
return
user.set_machine(src)
var/dat = "<TT><B>Personal AI Device</B><BR>"
if(pai)
if(!pai.master_dna || !pai.master)
dat += "<a href='byond://?src=[REF(src)];setdna=1'>Imprint Master DNA</a><br>"
dat += "Installed Personality: [pai.name]<br>"
dat += "Prime directive: <br>[pai.laws.zeroth]<br>"
for(var/slaws in pai.laws.supplied)
dat += "Additional directives: <br>[slaws]<br>"
dat += "<a href='byond://?src=[REF(src)];setlaws=1'>Configure Directives</a><br>"
dat += "<br>"
dat += "<h3>Device Settings</h3><br>"
if(pai.radio)
dat += "<b>Radio Uplink</b><br>"
dat += "Transmit: <A href='byond://?src=[REF(src)];wires=[WIRE_TX]'>[(pai.radio.wires.is_cut(WIRE_TX)) ? "Disabled" : "Enabled"]</A><br>"
dat += "Receive: <A href='byond://?src=[REF(src)];wires=[WIRE_RX]'>[(pai.radio.wires.is_cut(WIRE_RX)) ? "Disabled" : "Enabled"]</A><br>"
if(pai.radio_short)
dat += "<font color='red'>Reset radio short: <a href='byond://?src=[REF(src)];reset_radio_short=1'>\[RESET\]</a><br>"
else
dat += "<b>Radio Uplink</b><br>"
dat += "<font color=red><i>Radio firmware not loaded. Please install a pAI personality to load firmware.</i></font><br>"
if(ishuman(user))
var/mob/living/carbon/human/H = user
if(H.real_name == pai.master || H.dna.unique_enzymes == pai.master_dna)
dat += "<A href='byond://?src=[REF(src)];toggle_holo=1'>\[[pai.canholo? "Disable" : "Enable"] holomatrix projectors\]</a><br>"
dat += "<A href='byond://?src=[REF(src)];wipe=1'>\[Wipe current pAI personality\]</a><br>"
else
dat += "No personality installed.<br>"
dat += "Searching for a personality... Press view available personalities to notify potential candidates."
dat += "<A href='byond://?src=[REF(src)];request=1'>\[View available personalities\]</a><br>"
user << browse(dat, "window=paicard")
onclose(user, "paicard")
return
/obj/item/paicard/Topic(href, href_list)
if(!usr || usr.stat)
return
if(href_list["request"])
SSpai.findPAI(src, usr)
if(pai)
if(!(loc == usr))
return
if(href_list["setdna"])
if(pai.master_dna)
return
if(!iscarbon(usr))
to_chat(usr, "<span class='warning'>You don't have any DNA, or your DNA is incompatible with this device!</span>")
else
var/mob/living/carbon/M = usr
pai.master = M.real_name
pai.master_dna = M.dna.unique_enzymes
to_chat(pai, "<span class='notice'>You have been bound to a new master.</span>")
if(href_list["wipe"])
var/confirm = input("Are you CERTAIN you wish to delete the current personality? This action cannot be undone.", "Personality Wipe") in list("Yes", "No")
if(confirm == "Yes")
if(pai)
to_chat(pai, "<span class='warning'>You feel yourself slipping away from reality.</span>")
to_chat(pai, "<span class='danger'>Byte by byte you lose your sense of self.</span>")
to_chat(pai, "<span class='userdanger'>Your mental faculties leave you.</span>")
to_chat(pai, "<span class='rose'>oblivion... </span>")
qdel(pai)
if(href_list["wires"])
var/wire = text2num(href_list["wires"])
if(pai.radio)
pai.radio.wires.cut(wire)
if(href_list["reset_radio_short"])
pai.unshort_radio()
if(href_list["setlaws"])
var/newlaws = copytext(sanitize(input("Enter any additional directives you would like your pAI personality to follow. Note that these directives will not override the personality's allegiance to its imprinted master. Conflicting directives will be ignored.", "pAI Directive Configuration", pai.laws.supplied[1]) as message),1,MAX_MESSAGE_LEN)
if(newlaws && pai)
pai.add_supplied_law(0,newlaws)
if(href_list["toggle_holo"])
if(pai.canholo)
to_chat(pai, "<span class='userdanger'>Your owner has disabled your holomatrix projectors!</span>")
pai.canholo = FALSE
to_chat(usr, "<span class='warning'>You disable your pAI's holomatrix!</span>")
else
to_chat(pai, "<span class='boldnotice'>Your owner has enabled your holomatrix projectors!</span>")
pai.canholo = TRUE
to_chat(usr, "<span class='notice'>You enable your pAI's holomatrix!</span>")
attack_self(usr)
// WIRE_SIGNAL = 1
// WIRE_RECEIVE = 2
// WIRE_TRANSMIT = 4
/obj/item/paicard/proc/setPersonality(mob/living/silicon/pai/personality)
src.pai = personality
src.add_overlay("pai-null")
playsound(loc, 'sound/effects/pai_boot.ogg', 50, 1, -1)
audible_message("\The [src] plays a cheerful startup noise!")
/obj/item/paicard/proc/setEmotion(emotion)
if(pai)
src.cut_overlays()
switch(emotion)
if(1)
src.add_overlay("pai-happy")
if(2)
src.add_overlay("pai-cat")
if(3)
src.add_overlay("pai-extremely-happy")
if(4)
src.add_overlay("pai-face")
if(5)
src.add_overlay("pai-laugh")
if(6)
src.add_overlay("pai-off")
if(7)
src.add_overlay("pai-sad")
if(8)
src.add_overlay("pai-angry")
if(9)
src.add_overlay("pai-what")
if(10)
src.add_overlay("pai-null")
if(11)
src.add_overlay("pai-exclamation")
if(12)
src.add_overlay("pai-question")
if(13)
src.add_overlay("pai-sunglasses")
/obj/item/paicard/proc/alertUpdate()
visible_message("<span class ='info'>[src] flashes a message across its screen, \"Additional personalities available for download.\"", "<span class='notice'>[src] bleeps electronically.</span>")
/obj/item/paicard/emp_act(severity)
. = ..()
if (. & EMP_PROTECT_SELF)
return
if(pai && !pai.holoform)
pai.emp_act(severity)
+152 -152
View File
@@ -1,152 +1,152 @@
// Powersink - used to drain station power
/obj/item/powersink
desc = "A nulling power sink which drains energy from electrical systems."
name = "power sink"
icon = 'icons/obj/device.dmi'
icon_state = "powersink0"
item_state = "electronic"
lefthand_file = 'icons/mob/inhands/misc/devices_lefthand.dmi'
righthand_file = 'icons/mob/inhands/misc/devices_righthand.dmi'
w_class = WEIGHT_CLASS_BULKY
flags_1 = CONDUCT_1
throwforce = 5
throw_speed = 1
throw_range = 2
materials = list(MAT_METAL=750)
var/drain_rate = 1600000 // amount of power to drain per tick
var/power_drained = 0 // has drained this much power
var/max_power = 1e10 // maximum power that can be drained before exploding
var/mode = 0 // 0 = off, 1=clamped (off), 2=operating
var/admins_warned = FALSE // stop spam, only warn the admins once that we are about to boom
var/const/DISCONNECTED = 0
var/const/CLAMPED_OFF = 1
var/const/OPERATING = 2
var/obj/structure/cable/attached // the attached cable
/obj/item/powersink/update_icon()
icon_state = "powersink[mode == OPERATING]"
/obj/item/powersink/proc/set_mode(value)
if(value == mode)
return
switch(value)
if(DISCONNECTED)
attached = null
if(mode == OPERATING)
STOP_PROCESSING(SSobj, src)
anchored = FALSE
if(CLAMPED_OFF)
if(!attached)
return
if(mode == OPERATING)
STOP_PROCESSING(SSobj, src)
anchored = TRUE
if(OPERATING)
if(!attached)
return
START_PROCESSING(SSobj, src)
anchored = TRUE
mode = value
update_icon()
set_light(0)
/obj/item/powersink/attackby(obj/item/I, mob/user, params)
if(istype(I, /obj/item/screwdriver))
if(mode == DISCONNECTED)
var/turf/T = loc
if(isturf(T) && !T.intact)
attached = locate() in T
if(!attached)
to_chat(user, "<span class='warning'>This device must be placed over an exposed, powered cable node!</span>")
else
set_mode(CLAMPED_OFF)
user.visible_message( \
"[user] attaches \the [src] to the cable.", \
"<span class='notice'>You attach \the [src] to the cable.</span>",
"<span class='italics'>You hear some wires being connected to something.</span>")
else
to_chat(user, "<span class='warning'>This device must be placed over an exposed, powered cable node!</span>")
else
set_mode(DISCONNECTED)
user.visible_message( \
"[user] detaches \the [src] from the cable.", \
"<span class='notice'>You detach \the [src] from the cable.</span>",
"<span class='italics'>You hear some wires being disconnected from something.</span>")
else
return ..()
/obj/item/powersink/attack_paw()
return
/obj/item/powersink/attack_ai()
return
/obj/item/powersink/attack_hand(mob/user)
. = ..()
if(.)
return
switch(mode)
if(DISCONNECTED)
..()
if(CLAMPED_OFF)
user.visible_message( \
"[user] activates \the [src]!", \
"<span class='notice'>You activate \the [src].</span>",
"<span class='italics'>You hear a click.</span>")
message_admins("Power sink activated by [ADMIN_LOOKUPFLW(user)] at [ADMIN_VERBOSEJMP(src)]")
log_game("Power sink activated by [key_name(user)] at [AREACOORD(src)]")
set_mode(OPERATING)
if(OPERATING)
user.visible_message( \
"[user] deactivates \the [src]!", \
"<span class='notice'>You deactivate \the [src].</span>",
"<span class='italics'>You hear a click.</span>")
set_mode(CLAMPED_OFF)
/obj/item/powersink/process()
if(!attached)
set_mode(DISCONNECTED)
return
var/datum/powernet/PN = attached.powernet
if(PN)
set_light(5)
// found a powernet, so drain up to max power from it
var/drained = min ( drain_rate, attached.newavail() )
attached.add_delayedload(drained)
power_drained += drained
// if tried to drain more than available on powernet
// now look for APCs and drain their cells
if(drained < drain_rate)
for(var/obj/machinery/power/terminal/T in PN.nodes)
if(istype(T.master, /obj/machinery/power/apc))
var/obj/machinery/power/apc/A = T.master
if(A.operating && A.cell)
A.cell.charge = max(0, A.cell.charge - 50)
power_drained += 50
if(A.charging == 2) // If the cell was full
A.charging = 1 // It's no longer full
if(drained >= drain_rate)
break
if(power_drained > max_power * 0.98)
if (!admins_warned)
admins_warned = TRUE
message_admins("Power sink at ([x],[y],[z] - <A HREF='?_src_=holder;[HrefToken()];adminplayerobservecoodjump=1;X=[x];Y=[y];Z=[z]'>JMP</a>) is 95% full. Explosion imminent.")
playsound(src, 'sound/effects/screech.ogg', 100, 1, 1)
if(power_drained >= max_power)
STOP_PROCESSING(SSobj, src)
explosion(src.loc, 4,8,16,32)
qdel(src)
// Powersink - used to drain station power
/obj/item/powersink
desc = "A nulling power sink which drains energy from electrical systems."
name = "power sink"
icon = 'icons/obj/device.dmi'
icon_state = "powersink0"
item_state = "electronic"
lefthand_file = 'icons/mob/inhands/misc/devices_lefthand.dmi'
righthand_file = 'icons/mob/inhands/misc/devices_righthand.dmi'
w_class = WEIGHT_CLASS_BULKY
flags_1 = CONDUCT_1
throwforce = 5
throw_speed = 1
throw_range = 2
materials = list(MAT_METAL=750)
var/drain_rate = 1600000 // amount of power to drain per tick
var/power_drained = 0 // has drained this much power
var/max_power = 1e10 // maximum power that can be drained before exploding
var/mode = 0 // 0 = off, 1=clamped (off), 2=operating
var/admins_warned = FALSE // stop spam, only warn the admins once that we are about to boom
var/const/DISCONNECTED = 0
var/const/CLAMPED_OFF = 1
var/const/OPERATING = 2
var/obj/structure/cable/attached // the attached cable
/obj/item/powersink/update_icon()
icon_state = "powersink[mode == OPERATING]"
/obj/item/powersink/proc/set_mode(value)
if(value == mode)
return
switch(value)
if(DISCONNECTED)
attached = null
if(mode == OPERATING)
STOP_PROCESSING(SSobj, src)
anchored = FALSE
if(CLAMPED_OFF)
if(!attached)
return
if(mode == OPERATING)
STOP_PROCESSING(SSobj, src)
anchored = TRUE
if(OPERATING)
if(!attached)
return
START_PROCESSING(SSobj, src)
anchored = TRUE
mode = value
update_icon()
set_light(0)
/obj/item/powersink/attackby(obj/item/I, mob/user, params)
if(istype(I, /obj/item/screwdriver))
if(mode == DISCONNECTED)
var/turf/T = loc
if(isturf(T) && !T.intact)
attached = locate() in T
if(!attached)
to_chat(user, "<span class='warning'>This device must be placed over an exposed, powered cable node!</span>")
else
set_mode(CLAMPED_OFF)
user.visible_message( \
"[user] attaches \the [src] to the cable.", \
"<span class='notice'>You attach \the [src] to the cable.</span>",
"<span class='italics'>You hear some wires being connected to something.</span>")
else
to_chat(user, "<span class='warning'>This device must be placed over an exposed, powered cable node!</span>")
else
set_mode(DISCONNECTED)
user.visible_message( \
"[user] detaches \the [src] from the cable.", \
"<span class='notice'>You detach \the [src] from the cable.</span>",
"<span class='italics'>You hear some wires being disconnected from something.</span>")
else
return ..()
/obj/item/powersink/attack_paw()
return
/obj/item/powersink/attack_ai()
return
/obj/item/powersink/attack_hand(mob/user)
. = ..()
if(.)
return
switch(mode)
if(DISCONNECTED)
..()
if(CLAMPED_OFF)
user.visible_message( \
"[user] activates \the [src]!", \
"<span class='notice'>You activate \the [src].</span>",
"<span class='italics'>You hear a click.</span>")
message_admins("Power sink activated by [ADMIN_LOOKUPFLW(user)] at [ADMIN_VERBOSEJMP(src)]")
log_game("Power sink activated by [key_name(user)] at [AREACOORD(src)]")
set_mode(OPERATING)
if(OPERATING)
user.visible_message( \
"[user] deactivates \the [src]!", \
"<span class='notice'>You deactivate \the [src].</span>",
"<span class='italics'>You hear a click.</span>")
set_mode(CLAMPED_OFF)
/obj/item/powersink/process()
if(!attached)
set_mode(DISCONNECTED)
return
var/datum/powernet/PN = attached.powernet
if(PN)
set_light(5)
// found a powernet, so drain up to max power from it
var/drained = min ( drain_rate, attached.newavail() )
attached.add_delayedload(drained)
power_drained += drained
// if tried to drain more than available on powernet
// now look for APCs and drain their cells
if(drained < drain_rate)
for(var/obj/machinery/power/terminal/T in PN.nodes)
if(istype(T.master, /obj/machinery/power/apc))
var/obj/machinery/power/apc/A = T.master
if(A.operating && A.cell)
A.cell.charge = max(0, A.cell.charge - 50)
power_drained += 50
if(A.charging == 2) // If the cell was full
A.charging = 1 // It's no longer full
if(drained >= drain_rate)
break
if(power_drained > max_power * 0.98)
if (!admins_warned)
admins_warned = TRUE
message_admins("Power sink at ([x],[y],[z] - <A HREF='?_src_=holder;[HrefToken()];adminplayerobservecoodjump=1;X=[x];Y=[y];Z=[z]'>JMP</a>) is 95% full. Explosion imminent.")
playsound(src, 'sound/effects/screech.ogg', 100, 1, 1)
if(power_drained >= max_power)
STOP_PROCESSING(SSobj, src)
explosion(src.loc, 4,8,16,32)
qdel(src)
@@ -1,146 +1,146 @@
/obj/item/electropack
name = "electropack"
desc = "Dance my monkeys! DANCE!!!"
icon = 'icons/obj/radio.dmi'
icon_state = "electropack0"
item_state = "electropack"
lefthand_file = 'icons/mob/inhands/misc/devices_lefthand.dmi'
righthand_file = 'icons/mob/inhands/misc/devices_righthand.dmi'
flags_1 = CONDUCT_1
slot_flags = ITEM_SLOT_BACK
w_class = WEIGHT_CLASS_HUGE
materials = list(MAT_METAL=10000, MAT_GLASS=2500)
var/code = 2
var/frequency = FREQ_ELECTROPACK
var/on = TRUE
var/shock_cooldown = FALSE
/obj/item/electropack/suicide_act(mob/living/carbon/user)
user.visible_message("<span class='suicide'>[user] hooks [user.p_them()]self to the electropack and spams the trigger! It looks like [user.p_theyre()] trying to commit suicide!</span>")
return (FIRELOSS)
/obj/item/electropack/Initialize()
. = ..()
set_frequency(frequency)
/obj/item/electropack/Destroy()
SSradio.remove_object(src, frequency)
. = ..()
//ATTACK HAND IGNORING PARENT RETURN VALUE
/obj/item/electropack/attack_hand(mob/user)
if(iscarbon(user))
var/mob/living/carbon/C = user
if(src == C.back)
to_chat(user, "<span class='warning'>You need help taking this off!</span>")
return
return ..()
/obj/item/electropack/attackby(obj/item/W, mob/living/user, params)
if(istype(W, /obj/item/clothing/head/helmet))
var/obj/item/assembly/shock_kit/A = new /obj/item/assembly/shock_kit(user)
A.icon = 'icons/obj/assemblies.dmi'
if(!user.transferItemToLoc(W, A))
to_chat(user, "<span class='warning'>[W] is stuck to your hand, you cannot attach it to [src]!</span>")
return
W.master = A
A.part1 = W
user.transferItemToLoc(src, A, TRUE)
master = A
A.part2 = src
user.put_in_hands(A)
A.add_fingerprint(user)
else
return ..()
/obj/item/electropack/Topic(href, href_list)
var/mob/living/carbon/C = usr
if(usr.stat || usr.restrained() || C.back == src)
return
if(!usr.canUseTopic(src, BE_CLOSE))
usr << browse(null, "window=radio")
onclose(usr, "radio")
return
if(href_list["set"])
if(href_list["set"] == "freq")
var/new_freq = input(usr, "Input a new receiving frequency", "Electropack Frequency", format_frequency(frequency)) as num|null
if(!usr.canUseTopic(src, BE_CLOSE))
return
new_freq = unformat_frequency(new_freq)
new_freq = sanitize_frequency(new_freq, TRUE)
set_frequency(new_freq)
if(href_list["set"] == "code")
var/new_code = input(usr, "Input a new receiving code", "Electropack Code", code) as num|null
if(!usr.canUseTopic(src, BE_CLOSE))
return
new_code = round(new_code)
new_code = CLAMP(new_code, 1, 100)
code = new_code
if(href_list["set"] == "power")
if(!usr.canUseTopic(src, BE_CLOSE))
return
on = !(on)
icon_state = "electropack[on]"
if(usr)
attack_self(usr)
return
/obj/item/electropack/proc/set_frequency(new_frequency)
SSradio.remove_object(src, frequency)
frequency = new_frequency
SSradio.add_object(src, frequency, RADIO_SIGNALER)
return
/obj/item/electropack/receive_signal(datum/signal/signal)
if(!signal || signal.data["code"] != code)
return
if(isliving(loc) && on)
if(shock_cooldown == TRUE)
return
shock_cooldown = TRUE
addtimer(VARSET_CALLBACK(src, shock_cooldown, FALSE), 100)
var/mob/living/L = loc
step(L, pick(GLOB.cardinals))
to_chat(L, "<span class='danger'>You feel a sharp shock!</span>")
var/datum/effect_system/spark_spread/s = new /datum/effect_system/spark_spread
s.set_up(3, 1, L)
s.start()
L.Knockdown(100)
if(master)
master.receive_signal()
return
/obj/item/electropack/ui_interact(mob/user)
if(!ishuman(user))
return
user.set_machine(src)
var/dat = {"
<TT>
Turned [on ? "On" : "Off"] - <A href='?src=[REF(src)];set=power'>Toggle</A><BR>
<B>Frequency/Code</B> for electropack:<BR>
Frequency:
[format_frequency(src.frequency)]
<A href='byond://?src=[REF(src)];set=freq'>Set</A><BR>
Code:
[src.code]
<A href='byond://?src=[REF(src)];set=code'>Set</A><BR>
</TT>"}
user << browse(dat, "window=radio")
onclose(user, "radio")
return
/obj/item/electropack
name = "electropack"
desc = "Dance my monkeys! DANCE!!!"
icon = 'icons/obj/radio.dmi'
icon_state = "electropack0"
item_state = "electropack"
lefthand_file = 'icons/mob/inhands/misc/devices_lefthand.dmi'
righthand_file = 'icons/mob/inhands/misc/devices_righthand.dmi'
flags_1 = CONDUCT_1
slot_flags = ITEM_SLOT_BACK
w_class = WEIGHT_CLASS_HUGE
materials = list(MAT_METAL=10000, MAT_GLASS=2500)
var/code = 2
var/frequency = FREQ_ELECTROPACK
var/on = TRUE
var/shock_cooldown = FALSE
/obj/item/electropack/suicide_act(mob/living/carbon/user)
user.visible_message("<span class='suicide'>[user] hooks [user.p_them()]self to the electropack and spams the trigger! It looks like [user.p_theyre()] trying to commit suicide!</span>")
return (FIRELOSS)
/obj/item/electropack/Initialize()
. = ..()
set_frequency(frequency)
/obj/item/electropack/Destroy()
SSradio.remove_object(src, frequency)
. = ..()
//ATTACK HAND IGNORING PARENT RETURN VALUE
/obj/item/electropack/attack_hand(mob/user)
if(iscarbon(user))
var/mob/living/carbon/C = user
if(src == C.back)
to_chat(user, "<span class='warning'>You need help taking this off!</span>")
return
return ..()
/obj/item/electropack/attackby(obj/item/W, mob/living/user, params)
if(istype(W, /obj/item/clothing/head/helmet))
var/obj/item/assembly/shock_kit/A = new /obj/item/assembly/shock_kit(user)
A.icon = 'icons/obj/assemblies.dmi'
if(!user.transferItemToLoc(W, A))
to_chat(user, "<span class='warning'>[W] is stuck to your hand, you cannot attach it to [src]!</span>")
return
W.master = A
A.part1 = W
user.transferItemToLoc(src, A, TRUE)
master = A
A.part2 = src
user.put_in_hands(A)
A.add_fingerprint(user)
else
return ..()
/obj/item/electropack/Topic(href, href_list)
var/mob/living/carbon/C = usr
if(usr.stat || usr.restrained() || C.back == src)
return
if(!usr.canUseTopic(src, BE_CLOSE))
usr << browse(null, "window=radio")
onclose(usr, "radio")
return
if(href_list["set"])
if(href_list["set"] == "freq")
var/new_freq = input(usr, "Input a new receiving frequency", "Electropack Frequency", format_frequency(frequency)) as num|null
if(!usr.canUseTopic(src, BE_CLOSE))
return
new_freq = unformat_frequency(new_freq)
new_freq = sanitize_frequency(new_freq, TRUE)
set_frequency(new_freq)
if(href_list["set"] == "code")
var/new_code = input(usr, "Input a new receiving code", "Electropack Code", code) as num|null
if(!usr.canUseTopic(src, BE_CLOSE))
return
new_code = round(new_code)
new_code = CLAMP(new_code, 1, 100)
code = new_code
if(href_list["set"] == "power")
if(!usr.canUseTopic(src, BE_CLOSE))
return
on = !(on)
icon_state = "electropack[on]"
if(usr)
attack_self(usr)
return
/obj/item/electropack/proc/set_frequency(new_frequency)
SSradio.remove_object(src, frequency)
frequency = new_frequency
SSradio.add_object(src, frequency, RADIO_SIGNALER)
return
/obj/item/electropack/receive_signal(datum/signal/signal)
if(!signal || signal.data["code"] != code)
return
if(isliving(loc) && on)
if(shock_cooldown == TRUE)
return
shock_cooldown = TRUE
addtimer(VARSET_CALLBACK(src, shock_cooldown, FALSE), 100)
var/mob/living/L = loc
step(L, pick(GLOB.cardinals))
to_chat(L, "<span class='danger'>You feel a sharp shock!</span>")
var/datum/effect_system/spark_spread/s = new /datum/effect_system/spark_spread
s.set_up(3, 1, L)
s.start()
L.Knockdown(100)
if(master)
master.receive_signal()
return
/obj/item/electropack/ui_interact(mob/user)
if(!ishuman(user))
return
user.set_machine(src)
var/dat = {"
<TT>
Turned [on ? "On" : "Off"] - <A href='?src=[REF(src)];set=power'>Toggle</A><BR>
<B>Frequency/Code</B> for electropack:<BR>
Frequency:
[format_frequency(src.frequency)]
<A href='byond://?src=[REF(src)];set=freq'>Set</A><BR>
Code:
[src.code]
<A href='byond://?src=[REF(src)];set=code'>Set</A><BR>
</TT>"}
user << browse(dat, "window=radio")
onclose(user, "radio")
return
+337 -337
View File
@@ -1,337 +1,337 @@
// Used for translating channels to tokens on examination
GLOBAL_LIST_INIT(channel_tokens, list(
RADIO_CHANNEL_COMMON = RADIO_KEY_COMMON,
RADIO_CHANNEL_SCIENCE = RADIO_TOKEN_SCIENCE,
RADIO_CHANNEL_COMMAND = RADIO_TOKEN_COMMAND,
RADIO_CHANNEL_MEDICAL = RADIO_TOKEN_MEDICAL,
RADIO_CHANNEL_ENGINEERING = RADIO_TOKEN_ENGINEERING,
RADIO_CHANNEL_SECURITY = RADIO_TOKEN_SECURITY,
RADIO_CHANNEL_CENTCOM = RADIO_TOKEN_CENTCOM,
RADIO_CHANNEL_SYNDICATE = RADIO_TOKEN_SYNDICATE,
RADIO_CHANNEL_SUPPLY = RADIO_TOKEN_SUPPLY,
RADIO_CHANNEL_SERVICE = RADIO_TOKEN_SERVICE,
MODE_BINARY = MODE_TOKEN_BINARY,
RADIO_CHANNEL_AI_PRIVATE = RADIO_TOKEN_AI_PRIVATE
))
/obj/item/radio/headset
name = "radio headset"
desc = "An updated, modular intercom that fits over the head. Takes encryption keys."
icon_state = "headset"
item_state = "headset"
materials = list(MAT_METAL=75)
subspace_transmission = TRUE
canhear_range = 0 // can't hear headsets from very far away
slot_flags = ITEM_SLOT_EARS
var/obj/item/encryptionkey/keyslot2 = null
dog_fashion = null
/obj/item/radio/headset/suicide_act(mob/living/carbon/user)
user.visible_message("<span class='suicide'>[user] begins putting \the [src]'s antenna up [user.p_their()] nose! It looks like [user.p_theyre()] trying to give [user.p_them()]self cancer!</span>")
return TOXLOSS
/obj/item/radio/headset/examine(mob/user)
. = ..()
if(item_flags & IN_INVENTORY && loc == user)
// construction of frequency description
var/list/avail_chans = list("Use [RADIO_KEY_COMMON] for the currently tuned frequency")
if(translate_binary)
avail_chans += "use [MODE_TOKEN_BINARY] for [MODE_BINARY]"
if(length(channels))
for(var/i in 1 to length(channels))
if(i == 1)
avail_chans += "use [MODE_TOKEN_DEPARTMENT] or [GLOB.channel_tokens[channels[i]]] for [lowertext(channels[i])]"
else
avail_chans += "use [GLOB.channel_tokens[channels[i]]] for [lowertext(channels[i])]"
. += "<span class='notice'>A small screen on the headset displays the following available frequencies:\n[english_list(avail_chans)]."
if(command)
. += "<span class='info'>Alt-click to toggle the high-volume mode.</span>"
else
. += "<span class='notice'>A small screen on the headset flashes, it's too small to read without holding or wearing the headset.</span>"
/obj/item/radio/headset/Initialize()
. = ..()
recalculateChannels()
/obj/item/radio/headset/Destroy()
QDEL_NULL(keyslot2)
return ..()
/obj/item/radio/headset/talk_into(mob/living/M, message, channel, list/spans,datum/language/language)
if (!listening)
return ITALICS | REDUCE_RANGE
return ..()
/obj/item/radio/headset/can_receive(freq, level, AIuser)
if(ishuman(src.loc))
var/mob/living/carbon/human/H = src.loc
if(H.ears == src)
return ..(freq, level)
else if(AIuser)
return ..(freq, level)
return FALSE
/obj/item/radio/headset/syndicate //disguised to look like a normal headset for stealth ops
/obj/item/radio/headset/syndicate/alt //undisguised bowman with flash protection
name = "syndicate headset"
desc = "A syndicate headset that can be used to hear all radio frequencies. Protects ears from flashbangs."
icon_state = "syndie_headset"
item_state = "syndie_headset"
/obj/item/radio/headset/syndicate/alt/ComponentInitialize()
. = ..()
AddComponent(/datum/component/wearertargeting/earprotection, list(SLOT_EARS))
/obj/item/radio/headset/syndicate/alt/leader
name = "team leader headset"
command = TRUE
/obj/item/radio/headset/syndicate/Initialize()
. = ..()
make_syndie()
/obj/item/radio/headset/binary
/obj/item/radio/headset/binary/Initialize()
. = ..()
qdel(keyslot)
keyslot = new /obj/item/encryptionkey/binary
recalculateChannels()
/obj/item/radio/headset/headset_sec
name = "security radio headset"
desc = "This is used by your elite security force."
icon_state = "sec_headset"
keyslot = new /obj/item/encryptionkey/headset_sec
/obj/item/radio/headset/headset_sec/alt
name = "security bowman headset"
desc = "This is used by your elite security force. Protects ears from flashbangs."
icon_state = "sec_headset_alt"
item_state = "sec_headset_alt"
/obj/item/radio/headset/headset_sec/alt/ComponentInitialize()
. = ..()
AddComponent(/datum/component/wearertargeting/earprotection, list(SLOT_EARS))
/obj/item/radio/headset/headset_eng
name = "engineering radio headset"
desc = "When the engineers wish to chat like girls."
icon_state = "eng_headset"
keyslot = new /obj/item/encryptionkey/headset_eng
/obj/item/radio/headset/headset_med
name = "medical radio headset"
desc = "A headset for the trained staff of the medbay."
icon_state = "med_headset"
keyslot = new /obj/item/encryptionkey/headset_med
/obj/item/radio/headset/headset_sci
name = "science radio headset"
desc = "A sciency headset. Like usual."
icon_state = "sci_headset"
keyslot = new /obj/item/encryptionkey/headset_sci
/obj/item/radio/headset/headset_medsci
name = "medical research radio headset"
desc = "A headset that is a result of the mating between medical and science."
icon_state = "medsci_headset"
keyslot = new /obj/item/encryptionkey/headset_medsci
/obj/item/radio/headset/headset_com
name = "command radio headset"
desc = "A headset with a commanding channel.\nTo access the command channel, use :c."
icon_state = "com_headset"
keyslot = new /obj/item/encryptionkey/headset_com
/obj/item/radio/headset/heads
command = TRUE
/obj/item/radio/headset/heads/captain
name = "\proper the captain's headset"
desc = "The headset of the king."
icon_state = "com_headset"
keyslot = new /obj/item/encryptionkey/heads/captain
/obj/item/radio/headset/heads/captain/alt
name = "\proper the captain's bowman headset"
desc = "The headset of the boss. Protects ears from flashbangs."
icon_state = "com_headset_alt"
item_state = "com_headset_alt"
/obj/item/radio/headset/heads/captain/alt/ComponentInitialize()
. = ..()
AddComponent(/datum/component/wearertargeting/earprotection, list(SLOT_EARS))
/obj/item/radio/headset/heads/rd
name = "\proper the research director's headset"
desc = "Headset of the fellow who keeps society marching towards technological singularity."
icon_state = "com_headset"
keyslot = new /obj/item/encryptionkey/heads/rd
/obj/item/radio/headset/heads/hos
name = "\proper the head of security's headset"
desc = "The headset of the man in charge of keeping order and protecting the station."
icon_state = "com_headset"
keyslot = new /obj/item/encryptionkey/heads/hos
/obj/item/radio/headset/heads/hos/alt
name = "\proper the head of security's bowman headset"
desc = "The headset of the man in charge of keeping order and protecting the station. Protects ears from flashbangs."
icon_state = "com_headset_alt"
item_state = "com_headset_alt"
/obj/item/radio/headset/heads/hos/ComponentInitialize()
. = ..()
AddComponent(/datum/component/wearertargeting/earprotection, list(SLOT_EARS))
/obj/item/radio/headset/heads/ce
name = "\proper the chief engineer's headset"
desc = "The headset of the guy in charge of keeping the station powered and undamaged."
icon_state = "com_headset"
keyslot = new /obj/item/encryptionkey/heads/ce
/obj/item/radio/headset/heads/cmo
name = "\proper the chief medical officer's headset"
desc = "The headset of the highly trained medical chief."
icon_state = "com_headset"
keyslot = new /obj/item/encryptionkey/heads/cmo
/obj/item/radio/headset/heads/hop
name = "\proper the head of personnel's headset"
desc = "The headset of the guy who will one day be captain."
icon_state = "com_headset"
keyslot = new /obj/item/encryptionkey/heads/hop
/obj/item/radio/headset/headset_cargo
name = "supply radio headset"
desc = "A headset used by the QM and his slaves."
icon_state = "cargo_headset"
keyslot = new /obj/item/encryptionkey/headset_cargo
/obj/item/radio/headset/headset_cargo/mining
name = "mining radio headset"
desc = "Headset used by shaft miners."
icon_state = "mine_headset"
keyslot = new /obj/item/encryptionkey/headset_mining
/obj/item/radio/headset/headset_srv
name = "service radio headset"
desc = "Headset used by the service staff, tasked with keeping the station full, happy and clean."
icon_state = "srv_headset"
keyslot = new /obj/item/encryptionkey/headset_service
/obj/item/radio/headset/headset_clown
name = "clown's headset"
desc = "A headset for the clown. Finally. A megaphone you can't take away."
icon_state = "srv_headset"
keyslot = new /obj/item/encryptionkey/headset_service
command = TRUE
commandspan = SPAN_CLOWN
/obj/item/radio/headset/headset_cent
name = "\improper CentCom headset"
desc = "A headset used by the upper echelons of Nanotrasen."
icon_state = "cent_headset"
keyslot = new /obj/item/encryptionkey/headset_com
keyslot2 = new /obj/item/encryptionkey/headset_cent
/obj/item/radio/headset/headset_cent/empty
keyslot = null
keyslot2 = null
/obj/item/radio/headset/headset_cent/commander
keyslot = new /obj/item/encryptionkey/heads/captain
/obj/item/radio/headset/headset_cent/alt
name = "\improper CentCom bowman headset"
desc = "A headset especially for emergency response personnel. Protects ears from flashbangs."
icon_state = "cent_headset_alt"
item_state = "cent_headset_alt"
keyslot = null
/obj/item/radio/headset/headset_cent/alt/ComponentInitialize()
. = ..()
AddComponent(/datum/component/wearertargeting/earprotection, list(SLOT_EARS))
/obj/item/radio/headset/ai
name = "\proper Integrated Subspace Transceiver "
keyslot2 = new /obj/item/encryptionkey/ai
command = TRUE
/obj/item/radio/headset/ai/can_receive(freq, level)
return ..(freq, level, TRUE)
/obj/item/radio/headset/attackby(obj/item/W, mob/user, params)
user.set_machine(src)
if(istype(W, /obj/item/screwdriver))
if(keyslot || keyslot2)
for(var/ch_name in channels)
SSradio.remove_object(src, GLOB.radiochannels[ch_name])
secure_radio_connections[ch_name] = null
var/turf/T = user.drop_location()
if(T)
if(keyslot)
keyslot.forceMove(T)
keyslot = null
if(keyslot2)
keyslot2.forceMove(T)
keyslot2 = null
recalculateChannels()
to_chat(user, "<span class='notice'>You pop out the encryption keys in the headset.</span>")
else
to_chat(user, "<span class='warning'>This headset doesn't have any unique encryption keys! How useless...</span>")
else if(istype(W, /obj/item/encryptionkey))
if(keyslot && keyslot2)
to_chat(user, "<span class='warning'>The headset can't hold another key!</span>")
return
if(!keyslot)
if(!user.transferItemToLoc(W, src))
return
keyslot = W
else
if(!user.transferItemToLoc(W, src))
return
keyslot2 = W
recalculateChannels()
else
return ..()
/obj/item/radio/headset/recalculateChannels()
..()
if(keyslot2)
for(var/ch_name in keyslot2.channels)
if(!(ch_name in src.channels))
channels[ch_name] = keyslot2.channels[ch_name]
if(keyslot2.translate_binary)
translate_binary = TRUE
if(keyslot2.syndie)
syndie = TRUE
if (keyslot2.independent)
independent = TRUE
for(var/ch_name in channels)
secure_radio_connections[ch_name] = add_radio(src, GLOB.radiochannels[ch_name])
/obj/item/radio/headset/AltClick(mob/living/user)
. = ..()
if(!istype(user) || !Adjacent(user) || user.incapacitated())
return
if (command)
use_command = !use_command
to_chat(user, "<span class='notice'>You toggle high-volume mode [use_command ? "on" : "off"].</span>")
return TRUE
// Used for translating channels to tokens on examination
GLOBAL_LIST_INIT(channel_tokens, list(
RADIO_CHANNEL_COMMON = RADIO_KEY_COMMON,
RADIO_CHANNEL_SCIENCE = RADIO_TOKEN_SCIENCE,
RADIO_CHANNEL_COMMAND = RADIO_TOKEN_COMMAND,
RADIO_CHANNEL_MEDICAL = RADIO_TOKEN_MEDICAL,
RADIO_CHANNEL_ENGINEERING = RADIO_TOKEN_ENGINEERING,
RADIO_CHANNEL_SECURITY = RADIO_TOKEN_SECURITY,
RADIO_CHANNEL_CENTCOM = RADIO_TOKEN_CENTCOM,
RADIO_CHANNEL_SYNDICATE = RADIO_TOKEN_SYNDICATE,
RADIO_CHANNEL_SUPPLY = RADIO_TOKEN_SUPPLY,
RADIO_CHANNEL_SERVICE = RADIO_TOKEN_SERVICE,
MODE_BINARY = MODE_TOKEN_BINARY,
RADIO_CHANNEL_AI_PRIVATE = RADIO_TOKEN_AI_PRIVATE
))
/obj/item/radio/headset
name = "radio headset"
desc = "An updated, modular intercom that fits over the head. Takes encryption keys."
icon_state = "headset"
item_state = "headset"
materials = list(MAT_METAL=75)
subspace_transmission = TRUE
canhear_range = 0 // can't hear headsets from very far away
slot_flags = ITEM_SLOT_EARS
var/obj/item/encryptionkey/keyslot2 = null
dog_fashion = null
/obj/item/radio/headset/suicide_act(mob/living/carbon/user)
user.visible_message("<span class='suicide'>[user] begins putting \the [src]'s antenna up [user.p_their()] nose! It looks like [user.p_theyre()] trying to give [user.p_them()]self cancer!</span>")
return TOXLOSS
/obj/item/radio/headset/examine(mob/user)
. = ..()
if(item_flags & IN_INVENTORY && loc == user)
// construction of frequency description
var/list/avail_chans = list("Use [RADIO_KEY_COMMON] for the currently tuned frequency")
if(translate_binary)
avail_chans += "use [MODE_TOKEN_BINARY] for [MODE_BINARY]"
if(length(channels))
for(var/i in 1 to length(channels))
if(i == 1)
avail_chans += "use [MODE_TOKEN_DEPARTMENT] or [GLOB.channel_tokens[channels[i]]] for [lowertext(channels[i])]"
else
avail_chans += "use [GLOB.channel_tokens[channels[i]]] for [lowertext(channels[i])]"
. += "<span class='notice'>A small screen on the headset displays the following available frequencies:\n[english_list(avail_chans)]."
if(command)
. += "<span class='info'>Alt-click to toggle the high-volume mode.</span>"
else
. += "<span class='notice'>A small screen on the headset flashes, it's too small to read without holding or wearing the headset.</span>"
/obj/item/radio/headset/Initialize()
. = ..()
recalculateChannels()
/obj/item/radio/headset/Destroy()
QDEL_NULL(keyslot2)
return ..()
/obj/item/radio/headset/talk_into(mob/living/M, message, channel, list/spans,datum/language/language)
if (!listening)
return ITALICS | REDUCE_RANGE
return ..()
/obj/item/radio/headset/can_receive(freq, level, AIuser)
if(ishuman(src.loc))
var/mob/living/carbon/human/H = src.loc
if(H.ears == src)
return ..(freq, level)
else if(AIuser)
return ..(freq, level)
return FALSE
/obj/item/radio/headset/syndicate //disguised to look like a normal headset for stealth ops
/obj/item/radio/headset/syndicate/alt //undisguised bowman with flash protection
name = "syndicate headset"
desc = "A syndicate headset that can be used to hear all radio frequencies. Protects ears from flashbangs."
icon_state = "syndie_headset"
item_state = "syndie_headset"
/obj/item/radio/headset/syndicate/alt/ComponentInitialize()
. = ..()
AddComponent(/datum/component/wearertargeting/earprotection, list(SLOT_EARS))
/obj/item/radio/headset/syndicate/alt/leader
name = "team leader headset"
command = TRUE
/obj/item/radio/headset/syndicate/Initialize()
. = ..()
make_syndie()
/obj/item/radio/headset/binary
/obj/item/radio/headset/binary/Initialize()
. = ..()
qdel(keyslot)
keyslot = new /obj/item/encryptionkey/binary
recalculateChannels()
/obj/item/radio/headset/headset_sec
name = "security radio headset"
desc = "This is used by your elite security force."
icon_state = "sec_headset"
keyslot = new /obj/item/encryptionkey/headset_sec
/obj/item/radio/headset/headset_sec/alt
name = "security bowman headset"
desc = "This is used by your elite security force. Protects ears from flashbangs."
icon_state = "sec_headset_alt"
item_state = "sec_headset_alt"
/obj/item/radio/headset/headset_sec/alt/ComponentInitialize()
. = ..()
AddComponent(/datum/component/wearertargeting/earprotection, list(SLOT_EARS))
/obj/item/radio/headset/headset_eng
name = "engineering radio headset"
desc = "When the engineers wish to chat like girls."
icon_state = "eng_headset"
keyslot = new /obj/item/encryptionkey/headset_eng
/obj/item/radio/headset/headset_med
name = "medical radio headset"
desc = "A headset for the trained staff of the medbay."
icon_state = "med_headset"
keyslot = new /obj/item/encryptionkey/headset_med
/obj/item/radio/headset/headset_sci
name = "science radio headset"
desc = "A sciency headset. Like usual."
icon_state = "sci_headset"
keyslot = new /obj/item/encryptionkey/headset_sci
/obj/item/radio/headset/headset_medsci
name = "medical research radio headset"
desc = "A headset that is a result of the mating between medical and science."
icon_state = "medsci_headset"
keyslot = new /obj/item/encryptionkey/headset_medsci
/obj/item/radio/headset/headset_com
name = "command radio headset"
desc = "A headset with a commanding channel.\nTo access the command channel, use :c."
icon_state = "com_headset"
keyslot = new /obj/item/encryptionkey/headset_com
/obj/item/radio/headset/heads
command = TRUE
/obj/item/radio/headset/heads/captain
name = "\proper the captain's headset"
desc = "The headset of the king."
icon_state = "com_headset"
keyslot = new /obj/item/encryptionkey/heads/captain
/obj/item/radio/headset/heads/captain/alt
name = "\proper the captain's bowman headset"
desc = "The headset of the boss. Protects ears from flashbangs."
icon_state = "com_headset_alt"
item_state = "com_headset_alt"
/obj/item/radio/headset/heads/captain/alt/ComponentInitialize()
. = ..()
AddComponent(/datum/component/wearertargeting/earprotection, list(SLOT_EARS))
/obj/item/radio/headset/heads/rd
name = "\proper the research director's headset"
desc = "Headset of the fellow who keeps society marching towards technological singularity."
icon_state = "com_headset"
keyslot = new /obj/item/encryptionkey/heads/rd
/obj/item/radio/headset/heads/hos
name = "\proper the head of security's headset"
desc = "The headset of the man in charge of keeping order and protecting the station."
icon_state = "com_headset"
keyslot = new /obj/item/encryptionkey/heads/hos
/obj/item/radio/headset/heads/hos/alt
name = "\proper the head of security's bowman headset"
desc = "The headset of the man in charge of keeping order and protecting the station. Protects ears from flashbangs."
icon_state = "com_headset_alt"
item_state = "com_headset_alt"
/obj/item/radio/headset/heads/hos/ComponentInitialize()
. = ..()
AddComponent(/datum/component/wearertargeting/earprotection, list(SLOT_EARS))
/obj/item/radio/headset/heads/ce
name = "\proper the chief engineer's headset"
desc = "The headset of the guy in charge of keeping the station powered and undamaged."
icon_state = "com_headset"
keyslot = new /obj/item/encryptionkey/heads/ce
/obj/item/radio/headset/heads/cmo
name = "\proper the chief medical officer's headset"
desc = "The headset of the highly trained medical chief."
icon_state = "com_headset"
keyslot = new /obj/item/encryptionkey/heads/cmo
/obj/item/radio/headset/heads/hop
name = "\proper the head of personnel's headset"
desc = "The headset of the guy who will one day be captain."
icon_state = "com_headset"
keyslot = new /obj/item/encryptionkey/heads/hop
/obj/item/radio/headset/headset_cargo
name = "supply radio headset"
desc = "A headset used by the QM and his slaves."
icon_state = "cargo_headset"
keyslot = new /obj/item/encryptionkey/headset_cargo
/obj/item/radio/headset/headset_cargo/mining
name = "mining radio headset"
desc = "Headset used by shaft miners."
icon_state = "mine_headset"
keyslot = new /obj/item/encryptionkey/headset_mining
/obj/item/radio/headset/headset_srv
name = "service radio headset"
desc = "Headset used by the service staff, tasked with keeping the station full, happy and clean."
icon_state = "srv_headset"
keyslot = new /obj/item/encryptionkey/headset_service
/obj/item/radio/headset/headset_clown
name = "clown's headset"
desc = "A headset for the clown. Finally. A megaphone you can't take away."
icon_state = "srv_headset"
keyslot = new /obj/item/encryptionkey/headset_service
command = TRUE
commandspan = SPAN_CLOWN
/obj/item/radio/headset/headset_cent
name = "\improper CentCom headset"
desc = "A headset used by the upper echelons of Nanotrasen."
icon_state = "cent_headset"
keyslot = new /obj/item/encryptionkey/headset_com
keyslot2 = new /obj/item/encryptionkey/headset_cent
/obj/item/radio/headset/headset_cent/empty
keyslot = null
keyslot2 = null
/obj/item/radio/headset/headset_cent/commander
keyslot = new /obj/item/encryptionkey/heads/captain
/obj/item/radio/headset/headset_cent/alt
name = "\improper CentCom bowman headset"
desc = "A headset especially for emergency response personnel. Protects ears from flashbangs."
icon_state = "cent_headset_alt"
item_state = "cent_headset_alt"
keyslot = null
/obj/item/radio/headset/headset_cent/alt/ComponentInitialize()
. = ..()
AddComponent(/datum/component/wearertargeting/earprotection, list(SLOT_EARS))
/obj/item/radio/headset/ai
name = "\proper Integrated Subspace Transceiver "
keyslot2 = new /obj/item/encryptionkey/ai
command = TRUE
/obj/item/radio/headset/ai/can_receive(freq, level)
return ..(freq, level, TRUE)
/obj/item/radio/headset/attackby(obj/item/W, mob/user, params)
user.set_machine(src)
if(istype(W, /obj/item/screwdriver))
if(keyslot || keyslot2)
for(var/ch_name in channels)
SSradio.remove_object(src, GLOB.radiochannels[ch_name])
secure_radio_connections[ch_name] = null
var/turf/T = user.drop_location()
if(T)
if(keyslot)
keyslot.forceMove(T)
keyslot = null
if(keyslot2)
keyslot2.forceMove(T)
keyslot2 = null
recalculateChannels()
to_chat(user, "<span class='notice'>You pop out the encryption keys in the headset.</span>")
else
to_chat(user, "<span class='warning'>This headset doesn't have any unique encryption keys! How useless...</span>")
else if(istype(W, /obj/item/encryptionkey))
if(keyslot && keyslot2)
to_chat(user, "<span class='warning'>The headset can't hold another key!</span>")
return
if(!keyslot)
if(!user.transferItemToLoc(W, src))
return
keyslot = W
else
if(!user.transferItemToLoc(W, src))
return
keyslot2 = W
recalculateChannels()
else
return ..()
/obj/item/radio/headset/recalculateChannels()
..()
if(keyslot2)
for(var/ch_name in keyslot2.channels)
if(!(ch_name in src.channels))
channels[ch_name] = keyslot2.channels[ch_name]
if(keyslot2.translate_binary)
translate_binary = TRUE
if(keyslot2.syndie)
syndie = TRUE
if (keyslot2.independent)
independent = TRUE
for(var/ch_name in channels)
secure_radio_connections[ch_name] = add_radio(src, GLOB.radiochannels[ch_name])
/obj/item/radio/headset/AltClick(mob/living/user)
. = ..()
if(!istype(user) || !Adjacent(user) || user.incapacitated())
return
if (command)
use_command = !use_command
to_chat(user, "<span class='notice'>You toggle high-volume mode [use_command ? "on" : "off"].</span>")
return TRUE
+150 -150
View File
@@ -1,150 +1,150 @@
/obj/item/radio/intercom
name = "station intercom"
desc = "Talk through this."
icon_state = "intercom"
anchored = TRUE
w_class = WEIGHT_CLASS_BULKY
canhear_range = 2
var/number = 0
var/anyai = 1
var/mob/living/silicon/ai/ai = list()
var/last_tick //used to delay the powercheck
dog_fashion = null
var/unfastened = FALSE
/obj/item/radio/intercom/unscrewed
unfastened = TRUE
/obj/item/radio/intercom/ratvar
name = "hierophant intercom"
desc = "A modified intercom that uses the Hierophant network instead of subspace tech. Can listen to and broadcast on any frequency."
icon_state = "intercom_ratvar"
freerange = TRUE
/obj/item/radio/intercom/ratvar/attackby(obj/item/I, mob/living/user, params)
if(istype(I, /obj/item/screwdriver))
to_chat(user, "<span class='danger'>[src] is fastened to the wall with [is_servant_of_ratvar(user) ? "replicant alloy" : "some material you've never seen"], and can't be removed.</span>")
return //no unfastening!
. = ..()
/obj/item/radio/intercom/ratvar/process()
if(!istype(SSticker.mode, /datum/game_mode/clockwork_cult))
invisibility = INVISIBILITY_OBSERVER
alpha = 125
emped = TRUE
else
invisibility = initial(invisibility)
alpha = initial(alpha)
emped = FALSE
..()
/obj/item/radio/intercom/Initialize(mapload, ndir, building)
. = ..()
if(building)
setDir(ndir)
START_PROCESSING(SSobj, src)
/obj/item/radio/intercom/Destroy()
STOP_PROCESSING(SSobj, src)
return ..()
/obj/item/radio/intercom/examine(mob/user)
. = ..()
if(!unfastened)
. += "<span class='notice'>It's <b>screwed</b> and secured to the wall.</span>"
else
. += "<span class='notice'>It's <i>unscrewed</i> from the wall, and can be <b>detached</b>.</span>"
/obj/item/radio/intercom/attackby(obj/item/I, mob/living/user, params)
if(istype(I, /obj/item/screwdriver))
if(unfastened)
user.visible_message("<span class='notice'>[user] starts tightening [src]'s screws...</span>", "<span class='notice'>You start screwing in [src]...</span>")
if(I.use_tool(src, user, 30, volume=50))
user.visible_message("<span class='notice'>[user] tightens [src]'s screws!</span>", "<span class='notice'>You tighten [src]'s screws.</span>")
unfastened = FALSE
else
user.visible_message("<span class='notice'>[user] starts loosening [src]'s screws...</span>", "<span class='notice'>You start unscrewing [src]...</span>")
if(I.use_tool(src, user, 40, volume=50))
user.visible_message("<span class='notice'>[user] loosens [src]'s screws!</span>", "<span class='notice'>You unscrew [src], loosening it from the wall.</span>")
unfastened = TRUE
return
else if(istype(I, /obj/item/wrench))
if(!unfastened)
to_chat(user, "<span class='warning'>You need to unscrew [src] from the wall first!</span>")
return
user.visible_message("<span class='notice'>[user] starts unsecuring [src]...</span>", "<span class='notice'>You start unsecuring [src]...</span>")
I.play_tool_sound(src)
if(I.use_tool(src, user, 80))
user.visible_message("<span class='notice'>[user] unsecures [src]!</span>", "<span class='notice'>You detach [src] from the wall.</span>")
playsound(src, 'sound/items/deconstruct.ogg', 50, 1)
new/obj/item/wallframe/intercom(get_turf(src))
qdel(src)
return
return ..()
/obj/item/radio/intercom/attack_ai(mob/user)
interact(user)
/obj/item/radio/intercom/attack_hand(mob/user)
. = ..()
if(.)
return
interact(user)
/obj/item/radio/intercom/interact(mob/user)
..()
ui_interact(user, state = GLOB.default_state)
/obj/item/radio/intercom/can_receive(freq, level)
if(!on)
return FALSE
if(wires.is_cut(WIRE_RX))
return FALSE
if(!(0 in level))
var/turf/position = get_turf(src)
if(isnull(position) || !(position.z in level))
return FALSE
if(!src.listening)
return FALSE
if(freq == FREQ_SYNDICATE)
if(!(src.syndie))
return FALSE//Prevents broadcast of messages over devices lacking the encryption
return TRUE
/obj/item/radio/intercom/Hear(message, atom/movable/speaker, message_langs, raw_message, radio_freq, list/spans, message_mode, atom/movable/source)
. = ..()
if (message_mode == MODE_INTERCOM)
return // Avoid hearing the same thing twice
if(!anyai && !(speaker in ai))
return
..()
/obj/item/radio/intercom/process()
if(((world.timeofday - last_tick) > 30) || ((world.timeofday - last_tick) < 0))
last_tick = world.timeofday
var/area/A = get_area(src)
if(!A || emped)
on = FALSE
else
on = A.powered(EQUIP) // set "on" to the power status
if(!on)
icon_state = "intercom-p"
else
icon_state = initial(icon_state)
/obj/item/radio/intercom/add_blood_DNA(list/blood_dna)
return FALSE
//Created through the autolathe or through deconstructing intercoms. Can be applied to wall to make a new intercom on it!
/obj/item/wallframe/intercom
name = "intercom frame"
desc = "A ready-to-go intercom. Just slap it on a wall and screw it in!"
icon_state = "intercom"
result_path = /obj/item/radio/intercom/unscrewed
pixel_shift = 29
inverse = TRUE
materials = list(MAT_METAL = 75, MAT_GLASS = 25)
/obj/item/radio/intercom
name = "station intercom"
desc = "Talk through this."
icon_state = "intercom"
anchored = TRUE
w_class = WEIGHT_CLASS_BULKY
canhear_range = 2
var/number = 0
var/anyai = 1
var/mob/living/silicon/ai/ai = list()
var/last_tick //used to delay the powercheck
dog_fashion = null
var/unfastened = FALSE
/obj/item/radio/intercom/unscrewed
unfastened = TRUE
/obj/item/radio/intercom/ratvar
name = "hierophant intercom"
desc = "A modified intercom that uses the Hierophant network instead of subspace tech. Can listen to and broadcast on any frequency."
icon_state = "intercom_ratvar"
freerange = TRUE
/obj/item/radio/intercom/ratvar/attackby(obj/item/I, mob/living/user, params)
if(istype(I, /obj/item/screwdriver))
to_chat(user, "<span class='danger'>[src] is fastened to the wall with [is_servant_of_ratvar(user) ? "replicant alloy" : "some material you've never seen"], and can't be removed.</span>")
return //no unfastening!
. = ..()
/obj/item/radio/intercom/ratvar/process()
if(!istype(SSticker.mode, /datum/game_mode/clockwork_cult))
invisibility = INVISIBILITY_OBSERVER
alpha = 125
emped = TRUE
else
invisibility = initial(invisibility)
alpha = initial(alpha)
emped = FALSE
..()
/obj/item/radio/intercom/Initialize(mapload, ndir, building)
. = ..()
if(building)
setDir(ndir)
START_PROCESSING(SSobj, src)
/obj/item/radio/intercom/Destroy()
STOP_PROCESSING(SSobj, src)
return ..()
/obj/item/radio/intercom/examine(mob/user)
. = ..()
if(!unfastened)
. += "<span class='notice'>It's <b>screwed</b> and secured to the wall.</span>"
else
. += "<span class='notice'>It's <i>unscrewed</i> from the wall, and can be <b>detached</b>.</span>"
/obj/item/radio/intercom/attackby(obj/item/I, mob/living/user, params)
if(istype(I, /obj/item/screwdriver))
if(unfastened)
user.visible_message("<span class='notice'>[user] starts tightening [src]'s screws...</span>", "<span class='notice'>You start screwing in [src]...</span>")
if(I.use_tool(src, user, 30, volume=50))
user.visible_message("<span class='notice'>[user] tightens [src]'s screws!</span>", "<span class='notice'>You tighten [src]'s screws.</span>")
unfastened = FALSE
else
user.visible_message("<span class='notice'>[user] starts loosening [src]'s screws...</span>", "<span class='notice'>You start unscrewing [src]...</span>")
if(I.use_tool(src, user, 40, volume=50))
user.visible_message("<span class='notice'>[user] loosens [src]'s screws!</span>", "<span class='notice'>You unscrew [src], loosening it from the wall.</span>")
unfastened = TRUE
return
else if(istype(I, /obj/item/wrench))
if(!unfastened)
to_chat(user, "<span class='warning'>You need to unscrew [src] from the wall first!</span>")
return
user.visible_message("<span class='notice'>[user] starts unsecuring [src]...</span>", "<span class='notice'>You start unsecuring [src]...</span>")
I.play_tool_sound(src)
if(I.use_tool(src, user, 80))
user.visible_message("<span class='notice'>[user] unsecures [src]!</span>", "<span class='notice'>You detach [src] from the wall.</span>")
playsound(src, 'sound/items/deconstruct.ogg', 50, 1)
new/obj/item/wallframe/intercom(get_turf(src))
qdel(src)
return
return ..()
/obj/item/radio/intercom/attack_ai(mob/user)
interact(user)
/obj/item/radio/intercom/attack_hand(mob/user)
. = ..()
if(.)
return
interact(user)
/obj/item/radio/intercom/interact(mob/user)
..()
ui_interact(user, state = GLOB.default_state)
/obj/item/radio/intercom/can_receive(freq, level)
if(!on)
return FALSE
if(wires.is_cut(WIRE_RX))
return FALSE
if(!(0 in level))
var/turf/position = get_turf(src)
if(isnull(position) || !(position.z in level))
return FALSE
if(!src.listening)
return FALSE
if(freq == FREQ_SYNDICATE)
if(!(src.syndie))
return FALSE//Prevents broadcast of messages over devices lacking the encryption
return TRUE
/obj/item/radio/intercom/Hear(message, atom/movable/speaker, message_langs, raw_message, radio_freq, list/spans, message_mode, atom/movable/source)
. = ..()
if (message_mode == MODE_INTERCOM)
return // Avoid hearing the same thing twice
if(!anyai && !(speaker in ai))
return
..()
/obj/item/radio/intercom/process()
if(((world.timeofday - last_tick) > 30) || ((world.timeofday - last_tick) < 0))
last_tick = world.timeofday
var/area/A = get_area(src)
if(!A || emped)
on = FALSE
else
on = A.powered(EQUIP) // set "on" to the power status
if(!on)
icon_state = "intercom-p"
else
icon_state = initial(icon_state)
/obj/item/radio/intercom/add_blood_DNA(list/blood_dna)
return FALSE
//Created through the autolathe or through deconstructing intercoms. Can be applied to wall to make a new intercom on it!
/obj/item/wallframe/intercom
name = "intercom frame"
desc = "A ready-to-go intercom. Just slap it on a wall and screw it in!"
icon_state = "intercom"
result_path = /obj/item/radio/intercom/unscrewed
pixel_shift = 29
inverse = TRUE
materials = list(MAT_METAL = 75, MAT_GLASS = 25)
+429 -429
View File
@@ -1,429 +1,429 @@
/obj/item/radio
icon = 'icons/obj/radio.dmi'
name = "station bounced radio"
icon_state = "walkietalkie"
item_state = "walkietalkie"
desc = "A basic handheld radio that communicates with local telecommunication networks."
dog_fashion = /datum/dog_fashion/back
flags_1 = CONDUCT_1 | HEAR_1
slot_flags = ITEM_SLOT_BELT
throw_speed = 3
throw_range = 7
w_class = WEIGHT_CLASS_SMALL
materials = list(MAT_METAL=75, MAT_GLASS=25)
obj_flags = USES_TGUI
var/on = TRUE
var/frequency = FREQ_COMMON
var/canhear_range = 3 // The range around the radio in which mobs can hear what it receives.
var/emped = 0 // Tracks the number of EMPs currently stacked.
var/broadcasting = FALSE // Whether the radio will transmit dialogue it hears nearby.
var/listening = TRUE // Whether the radio is currently receiving.
var/prison_radio = FALSE // If true, the transmit wire starts cut.
var/unscrewed = FALSE // Whether wires are accessible. Toggleable by screwdrivering.
var/freerange = FALSE // If true, the radio has access to the full spectrum.
var/subspace_transmission = FALSE // If true, the radio transmits and receives on subspace exclusively.
var/subspace_switchable = FALSE // If true, subspace_transmission can be toggled at will.
var/freqlock = FALSE // Frequency lock to stop the user from untuning specialist radios.
var/use_command = FALSE // If true, broadcasts will be large and BOLD.
var/command = FALSE // If true, use_command can be toggled at will.
var/commandspan = SPAN_COMMAND //allow us to set what the fuck we want for headsets
// Encryption key handling
var/obj/item/encryptionkey/keyslot
var/translate_binary = FALSE // If true, can hear the special binary channel.
var/independent = FALSE // If true, can say/hear on the special CentCom channel.
var/syndie = FALSE // If true, hears all well-known channels automatically, and can say/hear on the Syndicate channel.
var/list/channels = list() // Map from name (see communications.dm) to on/off. First entry is current department (:h).
var/list/secure_radio_connections
var/const/FREQ_LISTENING = 1
//FREQ_BROADCASTING = 2
/obj/item/radio/suicide_act(mob/living/user)
user.visible_message("<span class='suicide'>[user] starts bouncing [src] off [user.p_their()] head! It looks like [user.p_theyre()] trying to commit suicide!</span>")
return BRUTELOSS
/obj/item/radio/proc/set_frequency(new_frequency)
SEND_SIGNAL(src, COMSIG_RADIO_NEW_FREQUENCY, args)
remove_radio(src, frequency)
frequency = add_radio(src, new_frequency)
/obj/item/radio/proc/recalculateChannels()
channels = list()
translate_binary = FALSE
syndie = FALSE
independent = FALSE
if(keyslot)
for(var/ch_name in keyslot.channels)
if(!(ch_name in channels))
channels[ch_name] = keyslot.channels[ch_name]
if(keyslot.translate_binary)
translate_binary = TRUE
if(keyslot.syndie)
syndie = TRUE
if(keyslot.independent)
independent = TRUE
for(var/ch_name in channels)
secure_radio_connections[ch_name] = add_radio(src, GLOB.radiochannels[ch_name])
/obj/item/radio/proc/make_syndie() // Turns normal radios into Syndicate radios!
qdel(keyslot)
keyslot = new /obj/item/encryptionkey/syndicate
syndie = 1
recalculateChannels()
/obj/item/radio/Destroy()
remove_radio_all(src) //Just to be sure
QDEL_NULL(wires)
QDEL_NULL(keyslot)
return ..()
/obj/item/radio/Initialize()
wires = new /datum/wires/radio(src)
if(prison_radio)
wires.cut(WIRE_TX) // OH GOD WHY
secure_radio_connections = new
. = ..()
frequency = sanitize_frequency(frequency, freerange)
set_frequency(frequency)
for(var/ch_name in channels)
secure_radio_connections[ch_name] = add_radio(src, GLOB.radiochannels[ch_name])
/obj/item/radio/ComponentInitialize()
. = ..()
AddComponent(/datum/component/empprotection, EMP_PROTECT_WIRES)
/obj/item/radio/interact(mob/user)
if(unscrewed && !isAI(user))
wires.interact(user)
add_fingerprint(user)
else
..()
/obj/item/radio/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, \
datum/tgui/master_ui = null, datum/ui_state/state = GLOB.inventory_state)
. = ..()
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
if(!ui)
ui = new(user, src, ui_key, "radio", name, 370, 220 + channels.len * 22, master_ui, state)
ui.open()
/obj/item/radio/ui_data(mob/user)
var/list/data = list()
data["broadcasting"] = broadcasting
data["listening"] = listening
data["frequency"] = frequency
data["minFrequency"] = freerange ? MIN_FREE_FREQ : MIN_FREQ
data["maxFrequency"] = freerange ? MAX_FREE_FREQ : MAX_FREQ
data["freqlock"] = freqlock
data["channels"] = list()
for(var/channel in channels)
data["channels"][channel] = channels[channel] & FREQ_LISTENING
data["command"] = command
data["useCommand"] = use_command
data["subspace"] = subspace_transmission
data["subspaceSwitchable"] = subspace_switchable
data["headset"] = istype(src, /obj/item/radio/headset)
return data
/obj/item/radio/ui_act(action, params, datum/tgui/ui)
if(..())
return
switch(action)
if("frequency")
if(freqlock)
return
var/tune = params["tune"]
var/adjust = text2num(params["adjust"])
if(tune == "input")
var/min = format_frequency(freerange ? MIN_FREE_FREQ : MIN_FREQ)
var/max = format_frequency(freerange ? MAX_FREE_FREQ : MAX_FREQ)
tune = input("Tune frequency ([min]-[max]):", name, format_frequency(frequency)) as null|num
if(!isnull(tune) && !..())
if (tune < MIN_FREE_FREQ && tune <= MAX_FREE_FREQ / 10)
// allow typing 144.7 to get 1447
tune *= 10
. = TRUE
else if(adjust)
tune = frequency + adjust * 10
. = TRUE
else if(text2num(tune) != null)
tune = tune * 10
. = TRUE
if(.)
set_frequency(sanitize_frequency(tune, freerange))
if("listen")
listening = !listening
. = TRUE
if("broadcast")
broadcasting = !broadcasting
. = TRUE
if("channel")
var/channel = params["channel"]
if(!(channel in channels))
return
if(channels[channel] & FREQ_LISTENING)
channels[channel] &= ~FREQ_LISTENING
else
channels[channel] |= FREQ_LISTENING
. = TRUE
if("command")
use_command = !use_command
. = TRUE
if("subspace")
if(subspace_switchable)
subspace_transmission = !subspace_transmission
if(!subspace_transmission)
channels = list()
else
recalculateChannels()
. = TRUE
/obj/item/radio/talk_into(atom/movable/M, message, channel, list/spans, datum/language/language)
if(!spans)
spans = list(M.speech_span)
if(!language)
language = M.get_default_language()
INVOKE_ASYNC(src, .proc/talk_into_impl, M, message, channel, spans.Copy(), language)
return ITALICS | REDUCE_RANGE
/obj/item/radio/proc/talk_into_impl(atom/movable/M, message, channel, list/spans, datum/language/language)
if(!on)
return // the device has to be on
if(!M || !message)
return
if(wires.is_cut(WIRE_TX)) // Permacell and otherwise tampered-with radios
return
if(!M.IsVocal())
return
if(use_command)
spans |= commandspan
/*
Roughly speaking, radios attempt to make a subspace transmission (which
is received, processed, and rebroadcast by the telecomms satellite) and
if that fails, they send a mundane radio transmission.
Headsets cannot send/receive mundane transmissions, only subspace.
Syndicate radios can hear transmissions on all well-known frequencies.
CentCom radios can hear the CentCom frequency no matter what.
*/
// From the channel, determine the frequency and get a reference to it.
var/freq
if(channel && channels && channels.len > 0)
if(channel == MODE_DEPARTMENT)
channel = channels[1]
freq = secure_radio_connections[channel]
if (!channels[channel]) // if the channel is turned off, don't broadcast
return
else
freq = frequency
channel = null
// Nearby active jammers severely gibberish the message
var/turf/position = get_turf(src)
for(var/obj/item/jammer/jammer in GLOB.active_jammers)
var/turf/jammer_turf = get_turf(jammer)
if(position.z == jammer_turf.z && (get_dist(position, jammer_turf) < jammer.range))
message = Gibberish(message,100)
break
// Determine the identity information which will be attached to the signal.
var/atom/movable/virtualspeaker/speaker = new(null, M, src)
// Construct the signal
var/datum/signal/subspace/vocal/signal = new(src, freq, speaker, language, message, spans)
// Independent radios, on the CentCom frequency, reach all independent radios
if (independent && (freq == FREQ_CENTCOM || freq == FREQ_CTF_RED || freq == FREQ_CTF_BLUE))
signal.data["compression"] = 0
signal.transmission_method = TRANSMISSION_SUPERSPACE
signal.levels = list(0) // reaches all Z-levels
signal.broadcast()
return
// All radios make an attempt to use the subspace system first
signal.send_to_receivers()
// If the radio is subspace-only, that's all it can do
if (subspace_transmission)
return
// Non-subspace radios will check in a couple of seconds, and if the signal
// was never received, send a mundane broadcast (no headsets).
addtimer(CALLBACK(src, .proc/backup_transmission, signal), 20)
/obj/item/radio/proc/backup_transmission(datum/signal/subspace/vocal/signal)
var/turf/T = get_turf(src)
if (signal.data["done"] && (T.z in signal.levels))
return
// Okay, the signal was never processed, send a mundane broadcast.
signal.data["compression"] = 0
signal.transmission_method = TRANSMISSION_RADIO
signal.levels = list(T.z)
signal.broadcast()
/obj/item/radio/Hear(message, atom/movable/speaker, message_language, raw_message, radio_freq, list/spans, message_mode, atom/movable/source)
. = ..()
if(radio_freq || !broadcasting || get_dist(src, speaker) > canhear_range)
return
if(message_mode == MODE_WHISPER || message_mode == MODE_WHISPER_CRIT)
// radios don't pick up whispers very well
raw_message = stars(raw_message)
else if(message_mode == MODE_L_HAND || message_mode == MODE_R_HAND)
// try to avoid being heard double
if (loc == speaker && ismob(speaker))
var/mob/M = speaker
var/idx = M.get_held_index_of_item(src)
// left hands are odd slots
if (idx && (idx % 2) == (message_mode == MODE_L_HAND))
return
talk_into(speaker, raw_message, , spans, language=message_language)
// Checks if this radio can receive on the given frequency.
/obj/item/radio/proc/can_receive(freq, level)
// deny checks
if (!on || !listening || wires.is_cut(WIRE_RX))
return FALSE
if (freq == FREQ_SYNDICATE && !syndie)
return FALSE
if (freq == FREQ_CENTCOM)
return independent // hard-ignores the z-level check
if (!(0 in level))
var/turf/position = get_turf(src)
if(!position || !(position.z in level))
return FALSE
// allow checks: are we listening on that frequency?
if (freq == frequency)
return TRUE
for(var/ch_name in channels)
if(channels[ch_name] & FREQ_LISTENING)
//the GLOB.radiochannels list is located in communications.dm
if(GLOB.radiochannels[ch_name] == text2num(freq) || syndie)
return TRUE
return FALSE
/obj/item/radio/examine(mob/user)
. = ..()
if (unscrewed)
. += "<span class='notice'>It can be attached and modified.</span>"
else
. += "<span class='notice'>It cannot be modified or attached.</span>"
/obj/item/radio/attackby(obj/item/W, mob/user, params)
add_fingerprint(user)
if(istype(W, /obj/item/screwdriver))
unscrewed = !unscrewed
if(unscrewed)
to_chat(user, "<span class='notice'>The radio can now be attached and modified!</span>")
else
to_chat(user, "<span class='notice'>The radio can no longer be modified or attached!</span>")
else
return ..()
/obj/item/radio/emp_act(severity)
. = ..()
if (. & EMP_PROTECT_SELF)
return
emped++ //There's been an EMP; better count it
var/curremp = emped //Remember which EMP this was
if (listening && ismob(loc)) // if the radio is turned on and on someone's person they notice
to_chat(loc, "<span class='warning'>\The [src] overloads.</span>")
broadcasting = FALSE
listening = FALSE
for (var/ch_name in channels)
channels[ch_name] = 0
on = FALSE
spawn(200)
if(emped == curremp) //Don't fix it if it's been EMP'd again
emped = 0
if (!istype(src, /obj/item/radio/intercom)) // intercoms will turn back on on their own
on = TRUE
///////////////////////////////
//////////Borg Radios//////////
///////////////////////////////
//Giving borgs their own radio to have some more room to work with -Sieve
/obj/item/radio/borg
name = "cyborg radio"
subspace_switchable = TRUE
dog_fashion = null
/obj/item/radio/borg/Initialize(mapload)
. = ..()
/obj/item/radio/borg/syndicate
syndie = 1
keyslot = new /obj/item/encryptionkey/syndicate
/obj/item/radio/borg/syndicate/Initialize()
. = ..()
set_frequency(FREQ_SYNDICATE)
/obj/item/radio/borg/attackby(obj/item/W, mob/user, params)
if(istype(W, /obj/item/screwdriver))
if(keyslot)
for(var/ch_name in channels)
SSradio.remove_object(src, GLOB.radiochannels[ch_name])
secure_radio_connections[ch_name] = null
if(keyslot)
var/turf/T = get_turf(user)
if(T)
keyslot.forceMove(T)
keyslot = null
recalculateChannels()
to_chat(user, "<span class='notice'>You pop out the encryption key in the radio.</span>")
else
to_chat(user, "<span class='warning'>This radio doesn't have any encryption keys!</span>")
else if(istype(W, /obj/item/encryptionkey/))
if(keyslot)
to_chat(user, "<span class='warning'>The radio can't hold another key!</span>")
return
if(!keyslot)
if(!user.transferItemToLoc(W, src))
return
keyslot = W
recalculateChannels()
/obj/item/radio/off // Station bounced radios, their only difference is spawning with the speakers off, this was made to help the lag.
listening = 0 // And it's nice to have a subtype too for future features.
dog_fashion = /datum/dog_fashion/back
/obj/item/radio/internal
var/obj/item/implant/radio/implant
/obj/item/radio/internal/Initialize(mapload, obj/item/implant/radio/_implant)
. = ..()
implant = _implant
/obj/item/radio/internal/Destroy()
if(implant?.imp_in)
qdel(implant)
else
return ..()
/obj/item/radio
icon = 'icons/obj/radio.dmi'
name = "station bounced radio"
icon_state = "walkietalkie"
item_state = "walkietalkie"
desc = "A basic handheld radio that communicates with local telecommunication networks."
dog_fashion = /datum/dog_fashion/back
flags_1 = CONDUCT_1 | HEAR_1
slot_flags = ITEM_SLOT_BELT
throw_speed = 3
throw_range = 7
w_class = WEIGHT_CLASS_SMALL
materials = list(MAT_METAL=75, MAT_GLASS=25)
obj_flags = USES_TGUI
var/on = TRUE
var/frequency = FREQ_COMMON
var/canhear_range = 3 // The range around the radio in which mobs can hear what it receives.
var/emped = 0 // Tracks the number of EMPs currently stacked.
var/broadcasting = FALSE // Whether the radio will transmit dialogue it hears nearby.
var/listening = TRUE // Whether the radio is currently receiving.
var/prison_radio = FALSE // If true, the transmit wire starts cut.
var/unscrewed = FALSE // Whether wires are accessible. Toggleable by screwdrivering.
var/freerange = FALSE // If true, the radio has access to the full spectrum.
var/subspace_transmission = FALSE // If true, the radio transmits and receives on subspace exclusively.
var/subspace_switchable = FALSE // If true, subspace_transmission can be toggled at will.
var/freqlock = FALSE // Frequency lock to stop the user from untuning specialist radios.
var/use_command = FALSE // If true, broadcasts will be large and BOLD.
var/command = FALSE // If true, use_command can be toggled at will.
var/commandspan = SPAN_COMMAND //allow us to set what the fuck we want for headsets
// Encryption key handling
var/obj/item/encryptionkey/keyslot
var/translate_binary = FALSE // If true, can hear the special binary channel.
var/independent = FALSE // If true, can say/hear on the special CentCom channel.
var/syndie = FALSE // If true, hears all well-known channels automatically, and can say/hear on the Syndicate channel.
var/list/channels = list() // Map from name (see communications.dm) to on/off. First entry is current department (:h).
var/list/secure_radio_connections
var/const/FREQ_LISTENING = 1
//FREQ_BROADCASTING = 2
/obj/item/radio/suicide_act(mob/living/user)
user.visible_message("<span class='suicide'>[user] starts bouncing [src] off [user.p_their()] head! It looks like [user.p_theyre()] trying to commit suicide!</span>")
return BRUTELOSS
/obj/item/radio/proc/set_frequency(new_frequency)
SEND_SIGNAL(src, COMSIG_RADIO_NEW_FREQUENCY, args)
remove_radio(src, frequency)
frequency = add_radio(src, new_frequency)
/obj/item/radio/proc/recalculateChannels()
channels = list()
translate_binary = FALSE
syndie = FALSE
independent = FALSE
if(keyslot)
for(var/ch_name in keyslot.channels)
if(!(ch_name in channels))
channels[ch_name] = keyslot.channels[ch_name]
if(keyslot.translate_binary)
translate_binary = TRUE
if(keyslot.syndie)
syndie = TRUE
if(keyslot.independent)
independent = TRUE
for(var/ch_name in channels)
secure_radio_connections[ch_name] = add_radio(src, GLOB.radiochannels[ch_name])
/obj/item/radio/proc/make_syndie() // Turns normal radios into Syndicate radios!
qdel(keyslot)
keyslot = new /obj/item/encryptionkey/syndicate
syndie = 1
recalculateChannels()
/obj/item/radio/Destroy()
remove_radio_all(src) //Just to be sure
QDEL_NULL(wires)
QDEL_NULL(keyslot)
return ..()
/obj/item/radio/Initialize()
wires = new /datum/wires/radio(src)
if(prison_radio)
wires.cut(WIRE_TX) // OH GOD WHY
secure_radio_connections = new
. = ..()
frequency = sanitize_frequency(frequency, freerange)
set_frequency(frequency)
for(var/ch_name in channels)
secure_radio_connections[ch_name] = add_radio(src, GLOB.radiochannels[ch_name])
/obj/item/radio/ComponentInitialize()
. = ..()
AddComponent(/datum/component/empprotection, EMP_PROTECT_WIRES)
/obj/item/radio/interact(mob/user)
if(unscrewed && !isAI(user))
wires.interact(user)
add_fingerprint(user)
else
..()
/obj/item/radio/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, \
datum/tgui/master_ui = null, datum/ui_state/state = GLOB.inventory_state)
. = ..()
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
if(!ui)
ui = new(user, src, ui_key, "radio", name, 370, 220 + channels.len * 22, master_ui, state)
ui.open()
/obj/item/radio/ui_data(mob/user)
var/list/data = list()
data["broadcasting"] = broadcasting
data["listening"] = listening
data["frequency"] = frequency
data["minFrequency"] = freerange ? MIN_FREE_FREQ : MIN_FREQ
data["maxFrequency"] = freerange ? MAX_FREE_FREQ : MAX_FREQ
data["freqlock"] = freqlock
data["channels"] = list()
for(var/channel in channels)
data["channels"][channel] = channels[channel] & FREQ_LISTENING
data["command"] = command
data["useCommand"] = use_command
data["subspace"] = subspace_transmission
data["subspaceSwitchable"] = subspace_switchable
data["headset"] = istype(src, /obj/item/radio/headset)
return data
/obj/item/radio/ui_act(action, params, datum/tgui/ui)
if(..())
return
switch(action)
if("frequency")
if(freqlock)
return
var/tune = params["tune"]
var/adjust = text2num(params["adjust"])
if(tune == "input")
var/min = format_frequency(freerange ? MIN_FREE_FREQ : MIN_FREQ)
var/max = format_frequency(freerange ? MAX_FREE_FREQ : MAX_FREQ)
tune = input("Tune frequency ([min]-[max]):", name, format_frequency(frequency)) as null|num
if(!isnull(tune) && !..())
if (tune < MIN_FREE_FREQ && tune <= MAX_FREE_FREQ / 10)
// allow typing 144.7 to get 1447
tune *= 10
. = TRUE
else if(adjust)
tune = frequency + adjust * 10
. = TRUE
else if(text2num(tune) != null)
tune = tune * 10
. = TRUE
if(.)
set_frequency(sanitize_frequency(tune, freerange))
if("listen")
listening = !listening
. = TRUE
if("broadcast")
broadcasting = !broadcasting
. = TRUE
if("channel")
var/channel = params["channel"]
if(!(channel in channels))
return
if(channels[channel] & FREQ_LISTENING)
channels[channel] &= ~FREQ_LISTENING
else
channels[channel] |= FREQ_LISTENING
. = TRUE
if("command")
use_command = !use_command
. = TRUE
if("subspace")
if(subspace_switchable)
subspace_transmission = !subspace_transmission
if(!subspace_transmission)
channels = list()
else
recalculateChannels()
. = TRUE
/obj/item/radio/talk_into(atom/movable/M, message, channel, list/spans, datum/language/language)
if(!spans)
spans = list(M.speech_span)
if(!language)
language = M.get_default_language()
INVOKE_ASYNC(src, .proc/talk_into_impl, M, message, channel, spans.Copy(), language)
return ITALICS | REDUCE_RANGE
/obj/item/radio/proc/talk_into_impl(atom/movable/M, message, channel, list/spans, datum/language/language)
if(!on)
return // the device has to be on
if(!M || !message)
return
if(wires.is_cut(WIRE_TX)) // Permacell and otherwise tampered-with radios
return
if(!M.IsVocal())
return
if(use_command)
spans |= commandspan
/*
Roughly speaking, radios attempt to make a subspace transmission (which
is received, processed, and rebroadcast by the telecomms satellite) and
if that fails, they send a mundane radio transmission.
Headsets cannot send/receive mundane transmissions, only subspace.
Syndicate radios can hear transmissions on all well-known frequencies.
CentCom radios can hear the CentCom frequency no matter what.
*/
// From the channel, determine the frequency and get a reference to it.
var/freq
if(channel && channels && channels.len > 0)
if(channel == MODE_DEPARTMENT)
channel = channels[1]
freq = secure_radio_connections[channel]
if (!channels[channel]) // if the channel is turned off, don't broadcast
return
else
freq = frequency
channel = null
// Nearby active jammers severely gibberish the message
var/turf/position = get_turf(src)
for(var/obj/item/jammer/jammer in GLOB.active_jammers)
var/turf/jammer_turf = get_turf(jammer)
if(position.z == jammer_turf.z && (get_dist(position, jammer_turf) < jammer.range))
message = Gibberish(message,100)
break
// Determine the identity information which will be attached to the signal.
var/atom/movable/virtualspeaker/speaker = new(null, M, src)
// Construct the signal
var/datum/signal/subspace/vocal/signal = new(src, freq, speaker, language, message, spans)
// Independent radios, on the CentCom frequency, reach all independent radios
if (independent && (freq == FREQ_CENTCOM || freq == FREQ_CTF_RED || freq == FREQ_CTF_BLUE))
signal.data["compression"] = 0
signal.transmission_method = TRANSMISSION_SUPERSPACE
signal.levels = list(0) // reaches all Z-levels
signal.broadcast()
return
// All radios make an attempt to use the subspace system first
signal.send_to_receivers()
// If the radio is subspace-only, that's all it can do
if (subspace_transmission)
return
// Non-subspace radios will check in a couple of seconds, and if the signal
// was never received, send a mundane broadcast (no headsets).
addtimer(CALLBACK(src, .proc/backup_transmission, signal), 20)
/obj/item/radio/proc/backup_transmission(datum/signal/subspace/vocal/signal)
var/turf/T = get_turf(src)
if (signal.data["done"] && (T.z in signal.levels))
return
// Okay, the signal was never processed, send a mundane broadcast.
signal.data["compression"] = 0
signal.transmission_method = TRANSMISSION_RADIO
signal.levels = list(T.z)
signal.broadcast()
/obj/item/radio/Hear(message, atom/movable/speaker, message_language, raw_message, radio_freq, list/spans, message_mode, atom/movable/source)
. = ..()
if(radio_freq || !broadcasting || get_dist(src, speaker) > canhear_range)
return
if(message_mode == MODE_WHISPER || message_mode == MODE_WHISPER_CRIT)
// radios don't pick up whispers very well
raw_message = stars(raw_message)
else if(message_mode == MODE_L_HAND || message_mode == MODE_R_HAND)
// try to avoid being heard double
if (loc == speaker && ismob(speaker))
var/mob/M = speaker
var/idx = M.get_held_index_of_item(src)
// left hands are odd slots
if (idx && (idx % 2) == (message_mode == MODE_L_HAND))
return
talk_into(speaker, raw_message, , spans, language=message_language)
// Checks if this radio can receive on the given frequency.
/obj/item/radio/proc/can_receive(freq, level)
// deny checks
if (!on || !listening || wires.is_cut(WIRE_RX))
return FALSE
if (freq == FREQ_SYNDICATE && !syndie)
return FALSE
if (freq == FREQ_CENTCOM)
return independent // hard-ignores the z-level check
if (!(0 in level))
var/turf/position = get_turf(src)
if(!position || !(position.z in level))
return FALSE
// allow checks: are we listening on that frequency?
if (freq == frequency)
return TRUE
for(var/ch_name in channels)
if(channels[ch_name] & FREQ_LISTENING)
//the GLOB.radiochannels list is located in communications.dm
if(GLOB.radiochannels[ch_name] == text2num(freq) || syndie)
return TRUE
return FALSE
/obj/item/radio/examine(mob/user)
. = ..()
if (unscrewed)
. += "<span class='notice'>It can be attached and modified.</span>"
else
. += "<span class='notice'>It cannot be modified or attached.</span>"
/obj/item/radio/attackby(obj/item/W, mob/user, params)
add_fingerprint(user)
if(istype(W, /obj/item/screwdriver))
unscrewed = !unscrewed
if(unscrewed)
to_chat(user, "<span class='notice'>The radio can now be attached and modified!</span>")
else
to_chat(user, "<span class='notice'>The radio can no longer be modified or attached!</span>")
else
return ..()
/obj/item/radio/emp_act(severity)
. = ..()
if (. & EMP_PROTECT_SELF)
return
emped++ //There's been an EMP; better count it
var/curremp = emped //Remember which EMP this was
if (listening && ismob(loc)) // if the radio is turned on and on someone's person they notice
to_chat(loc, "<span class='warning'>\The [src] overloads.</span>")
broadcasting = FALSE
listening = FALSE
for (var/ch_name in channels)
channels[ch_name] = 0
on = FALSE
spawn(200)
if(emped == curremp) //Don't fix it if it's been EMP'd again
emped = 0
if (!istype(src, /obj/item/radio/intercom)) // intercoms will turn back on on their own
on = TRUE
///////////////////////////////
//////////Borg Radios//////////
///////////////////////////////
//Giving borgs their own radio to have some more room to work with -Sieve
/obj/item/radio/borg
name = "cyborg radio"
subspace_switchable = TRUE
dog_fashion = null
/obj/item/radio/borg/Initialize(mapload)
. = ..()
/obj/item/radio/borg/syndicate
syndie = 1
keyslot = new /obj/item/encryptionkey/syndicate
/obj/item/radio/borg/syndicate/Initialize()
. = ..()
set_frequency(FREQ_SYNDICATE)
/obj/item/radio/borg/attackby(obj/item/W, mob/user, params)
if(istype(W, /obj/item/screwdriver))
if(keyslot)
for(var/ch_name in channels)
SSradio.remove_object(src, GLOB.radiochannels[ch_name])
secure_radio_connections[ch_name] = null
if(keyslot)
var/turf/T = get_turf(user)
if(T)
keyslot.forceMove(T)
keyslot = null
recalculateChannels()
to_chat(user, "<span class='notice'>You pop out the encryption key in the radio.</span>")
else
to_chat(user, "<span class='warning'>This radio doesn't have any encryption keys!</span>")
else if(istype(W, /obj/item/encryptionkey/))
if(keyslot)
to_chat(user, "<span class='warning'>The radio can't hold another key!</span>")
return
if(!keyslot)
if(!user.transferItemToLoc(W, src))
return
keyslot = W
recalculateChannels()
/obj/item/radio/off // Station bounced radios, their only difference is spawning with the speakers off, this was made to help the lag.
listening = 0 // And it's nice to have a subtype too for future features.
dog_fashion = /datum/dog_fashion/back
/obj/item/radio/internal
var/obj/item/implant/radio/implant
/obj/item/radio/internal/Initialize(mapload, obj/item/implant/radio/_implant)
. = ..()
implant = _implant
/obj/item/radio/internal/Destroy()
if(implant?.imp_in)
qdel(implant)
else
return ..()
File diff suppressed because it is too large Load Diff
+291 -291
View File
@@ -1,291 +1,291 @@
/obj/item/taperecorder
name = "universal recorder"
desc = "A device that can record to cassette tapes, and play them. It automatically translates the content in playback."
icon = 'icons/obj/device.dmi'
icon_state = "taperecorder_empty"
item_state = "analyzer"
lefthand_file = 'icons/mob/inhands/equipment/tools_lefthand.dmi'
righthand_file = 'icons/mob/inhands/equipment/tools_righthand.dmi'
w_class = WEIGHT_CLASS_SMALL
flags_1 = HEAR_1
slot_flags = ITEM_SLOT_BELT
materials = list(MAT_METAL=60, MAT_GLASS=30)
force = 2
throwforce = 0
var/recording = 0
var/playing = 0
var/playsleepseconds = 0
var/obj/item/tape/mytape
var/starting_tape_type = /obj/item/tape/random
var/open_panel = 0
var/canprint = 1
/obj/item/taperecorder/Initialize(mapload)
. = ..()
if(starting_tape_type)
mytape = new starting_tape_type(src)
update_icon()
/obj/item/taperecorder/examine(mob/user)
. = ..()
. += "The wire panel is [open_panel ? "opened" : "closed"]."
/obj/item/taperecorder/attackby(obj/item/I, mob/user, params)
if(!mytape && istype(I, /obj/item/tape))
if(!user.transferItemToLoc(I,src))
return
mytape = I
to_chat(user, "<span class='notice'>You insert [I] into [src].</span>")
update_icon()
/obj/item/taperecorder/proc/eject(mob/user)
if(mytape)
to_chat(user, "<span class='notice'>You remove [mytape] from [src].</span>")
stop()
user.put_in_hands(mytape)
mytape = null
update_icon()
/obj/item/taperecorder/fire_act(exposed_temperature, exposed_volume)
mytape.ruin() //Fires destroy the tape
..()
//ATTACK HAND IGNORING PARENT RETURN VALUE
/obj/item/taperecorder/attack_hand(mob/user)
if(loc == user)
if(mytape)
if(!user.is_holding(src))
return ..()
eject(user)
else
return ..()
/obj/item/taperecorder/proc/can_use(mob/user)
if(user && ismob(user))
if(!user.incapacitated())
return TRUE
return FALSE
/obj/item/taperecorder/verb/ejectverb()
set name = "Eject Tape"
set category = "Object"
if(!can_use(usr))
return
if(!mytape)
return
eject(usr)
/obj/item/taperecorder/update_icon()
if(!mytape)
icon_state = "taperecorder_empty"
else if(recording)
icon_state = "taperecorder_recording"
else if(playing)
icon_state = "taperecorder_playing"
else
icon_state = "taperecorder_idle"
/obj/item/taperecorder/Hear(message, atom/movable/speaker, message_langs, raw_message, radio_freq, spans, message_mode, atom/movable/source)
. = ..()
if(mytape && recording)
mytape.timestamp += mytape.used_capacity
mytape.storedinfo += "\[[time2text(mytape.used_capacity * 10,"mm:ss")]\] [message]"
/obj/item/taperecorder/verb/record()
set name = "Start Recording"
set category = "Object"
if(!can_use(usr))
return
if(!mytape || mytape.ruined)
return
if(recording)
return
if(playing)
return
if(mytape.used_capacity < mytape.max_capacity)
to_chat(usr, "<span class='notice'>Recording started.</span>")
recording = 1
update_icon()
mytape.timestamp += mytape.used_capacity
mytape.storedinfo += "\[[time2text(mytape.used_capacity * 10,"mm:ss")]\] Recording started."
var/used = mytape.used_capacity //to stop runtimes when you eject the tape
var/max = mytape.max_capacity
while(recording && used < max)
mytape.used_capacity++
used++
sleep(10)
recording = 0
update_icon()
else
to_chat(usr, "<span class='notice'>The tape is full.</span>")
/obj/item/taperecorder/verb/stop()
set name = "Stop"
set category = "Object"
if(!can_use(usr))
return
if(recording)
recording = 0
mytape.timestamp += mytape.used_capacity
mytape.storedinfo += "\[[time2text(mytape.used_capacity * 10,"mm:ss")]\] Recording stopped."
to_chat(usr, "<span class='notice'>Recording stopped.</span>")
return
else if(playing)
playing = 0
var/turf/T = get_turf(src)
T.visible_message("<font color=Maroon><B>Tape Recorder</B>: Playback stopped.</font>")
update_icon()
/obj/item/taperecorder/verb/play()
set name = "Play Tape"
set category = "Object"
if(!can_use(usr))
return
if(!mytape || mytape.ruined)
return
if(recording)
return
if(playing)
return
playing = 1
update_icon()
to_chat(usr, "<span class='notice'>Playing started.</span>")
var/used = mytape.used_capacity //to stop runtimes when you eject the tape
var/max = mytape.max_capacity
for(var/i = 1, used < max, sleep(10 * playsleepseconds))
if(!mytape)
break
if(playing == 0)
break
if(mytape.storedinfo.len < i)
break
say(mytape.storedinfo[i])
if(mytape.storedinfo.len < i + 1)
playsleepseconds = 1
sleep(10)
say("End of recording.")
else
playsleepseconds = mytape.timestamp[i + 1] - mytape.timestamp[i]
if(playsleepseconds > 14)
sleep(10)
say("Skipping [playsleepseconds] seconds of silence")
playsleepseconds = 1
i++
playing = 0
update_icon()
/obj/item/taperecorder/attack_self(mob/user)
if(!mytape || mytape.ruined)
return
if(recording)
stop()
else
record()
/obj/item/taperecorder/verb/print_transcript()
set name = "Print Transcript"
set category = "Object"
if(!can_use(usr))
return
if(!mytape)
return
if(!canprint)
to_chat(usr, "<span class='notice'>The recorder can't print that fast!</span>")
return
if(recording || playing)
return
to_chat(usr, "<span class='notice'>Transcript printed.</span>")
var/obj/item/paper/P = new /obj/item/paper(get_turf(src))
var/t1 = "<B>Transcript:</B><BR><BR>"
for(var/i = 1, mytape.storedinfo.len >= i, i++)
t1 += "[mytape.storedinfo[i]]<BR>"
P.info = t1
P.name = "paper- 'Transcript'"
usr.put_in_hands(P)
canprint = 0
sleep(300)
canprint = 1
//empty tape recorders
/obj/item/taperecorder/empty
starting_tape_type = null
/obj/item/tape
name = "tape"
desc = "A magnetic tape that can hold up to ten minutes of content."
icon_state = "tape_white"
icon = 'icons/obj/device.dmi'
item_state = "analyzer"
lefthand_file = 'icons/mob/inhands/equipment/tools_lefthand.dmi'
righthand_file = 'icons/mob/inhands/equipment/tools_righthand.dmi'
w_class = WEIGHT_CLASS_TINY
materials = list(MAT_METAL=20, MAT_GLASS=5)
force = 1
throwforce = 0
var/max_capacity = 600
var/used_capacity = 0
var/list/storedinfo = list()
var/list/timestamp = list()
var/ruined = 0
/obj/item/tape/fire_act(exposed_temperature, exposed_volume)
ruin()
..()
/obj/item/tape/attack_self(mob/user)
if(!ruined)
to_chat(user, "<span class='notice'>You pull out all the tape!</span>")
ruin()
/obj/item/tape/proc/ruin()
//Lets not add infinite amounts of overlays when our fireact is called
//repeatedly
if(!ruined)
add_overlay("ribbonoverlay")
ruined = 1
/obj/item/tape/proc/fix()
cut_overlay("ribbonoverlay")
ruined = 0
/obj/item/tape/attackby(obj/item/I, mob/user, params)
if(ruined && istype(I, /obj/item/screwdriver) || istype(I, /obj/item/pen))
to_chat(user, "<span class='notice'>You start winding the tape back in...</span>")
if(I.use_tool(src, user, 120))
to_chat(user, "<span class='notice'>You wound the tape back in.</span>")
fix()
//Random colour tapes
/obj/item/tape/random
icon_state = "random_tape"
/obj/item/tape/random/New()
icon_state = "tape_[pick("white", "blue", "red", "yellow", "purple")]"
..()
/obj/item/taperecorder
name = "universal recorder"
desc = "A device that can record to cassette tapes, and play them. It automatically translates the content in playback."
icon = 'icons/obj/device.dmi'
icon_state = "taperecorder_empty"
item_state = "analyzer"
lefthand_file = 'icons/mob/inhands/equipment/tools_lefthand.dmi'
righthand_file = 'icons/mob/inhands/equipment/tools_righthand.dmi'
w_class = WEIGHT_CLASS_SMALL
flags_1 = HEAR_1
slot_flags = ITEM_SLOT_BELT
materials = list(MAT_METAL=60, MAT_GLASS=30)
force = 2
throwforce = 0
var/recording = 0
var/playing = 0
var/playsleepseconds = 0
var/obj/item/tape/mytape
var/starting_tape_type = /obj/item/tape/random
var/open_panel = 0
var/canprint = 1
/obj/item/taperecorder/Initialize(mapload)
. = ..()
if(starting_tape_type)
mytape = new starting_tape_type(src)
update_icon()
/obj/item/taperecorder/examine(mob/user)
. = ..()
. += "The wire panel is [open_panel ? "opened" : "closed"]."
/obj/item/taperecorder/attackby(obj/item/I, mob/user, params)
if(!mytape && istype(I, /obj/item/tape))
if(!user.transferItemToLoc(I,src))
return
mytape = I
to_chat(user, "<span class='notice'>You insert [I] into [src].</span>")
update_icon()
/obj/item/taperecorder/proc/eject(mob/user)
if(mytape)
to_chat(user, "<span class='notice'>You remove [mytape] from [src].</span>")
stop()
user.put_in_hands(mytape)
mytape = null
update_icon()
/obj/item/taperecorder/fire_act(exposed_temperature, exposed_volume)
mytape.ruin() //Fires destroy the tape
..()
//ATTACK HAND IGNORING PARENT RETURN VALUE
/obj/item/taperecorder/attack_hand(mob/user)
if(loc == user)
if(mytape)
if(!user.is_holding(src))
return ..()
eject(user)
else
return ..()
/obj/item/taperecorder/proc/can_use(mob/user)
if(user && ismob(user))
if(!user.incapacitated())
return TRUE
return FALSE
/obj/item/taperecorder/verb/ejectverb()
set name = "Eject Tape"
set category = "Object"
if(!can_use(usr))
return
if(!mytape)
return
eject(usr)
/obj/item/taperecorder/update_icon()
if(!mytape)
icon_state = "taperecorder_empty"
else if(recording)
icon_state = "taperecorder_recording"
else if(playing)
icon_state = "taperecorder_playing"
else
icon_state = "taperecorder_idle"
/obj/item/taperecorder/Hear(message, atom/movable/speaker, message_langs, raw_message, radio_freq, spans, message_mode, atom/movable/source)
. = ..()
if(mytape && recording)
mytape.timestamp += mytape.used_capacity
mytape.storedinfo += "\[[time2text(mytape.used_capacity * 10,"mm:ss")]\] [message]"
/obj/item/taperecorder/verb/record()
set name = "Start Recording"
set category = "Object"
if(!can_use(usr))
return
if(!mytape || mytape.ruined)
return
if(recording)
return
if(playing)
return
if(mytape.used_capacity < mytape.max_capacity)
to_chat(usr, "<span class='notice'>Recording started.</span>")
recording = 1
update_icon()
mytape.timestamp += mytape.used_capacity
mytape.storedinfo += "\[[time2text(mytape.used_capacity * 10,"mm:ss")]\] Recording started."
var/used = mytape.used_capacity //to stop runtimes when you eject the tape
var/max = mytape.max_capacity
while(recording && used < max)
mytape.used_capacity++
used++
sleep(10)
recording = 0
update_icon()
else
to_chat(usr, "<span class='notice'>The tape is full.</span>")
/obj/item/taperecorder/verb/stop()
set name = "Stop"
set category = "Object"
if(!can_use(usr))
return
if(recording)
recording = 0
mytape.timestamp += mytape.used_capacity
mytape.storedinfo += "\[[time2text(mytape.used_capacity * 10,"mm:ss")]\] Recording stopped."
to_chat(usr, "<span class='notice'>Recording stopped.</span>")
return
else if(playing)
playing = 0
var/turf/T = get_turf(src)
T.visible_message("<font color=Maroon><B>Tape Recorder</B>: Playback stopped.</font>")
update_icon()
/obj/item/taperecorder/verb/play()
set name = "Play Tape"
set category = "Object"
if(!can_use(usr))
return
if(!mytape || mytape.ruined)
return
if(recording)
return
if(playing)
return
playing = 1
update_icon()
to_chat(usr, "<span class='notice'>Playing started.</span>")
var/used = mytape.used_capacity //to stop runtimes when you eject the tape
var/max = mytape.max_capacity
for(var/i = 1, used < max, sleep(10 * playsleepseconds))
if(!mytape)
break
if(playing == 0)
break
if(mytape.storedinfo.len < i)
break
say(mytape.storedinfo[i])
if(mytape.storedinfo.len < i + 1)
playsleepseconds = 1
sleep(10)
say("End of recording.")
else
playsleepseconds = mytape.timestamp[i + 1] - mytape.timestamp[i]
if(playsleepseconds > 14)
sleep(10)
say("Skipping [playsleepseconds] seconds of silence")
playsleepseconds = 1
i++
playing = 0
update_icon()
/obj/item/taperecorder/attack_self(mob/user)
if(!mytape || mytape.ruined)
return
if(recording)
stop()
else
record()
/obj/item/taperecorder/verb/print_transcript()
set name = "Print Transcript"
set category = "Object"
if(!can_use(usr))
return
if(!mytape)
return
if(!canprint)
to_chat(usr, "<span class='notice'>The recorder can't print that fast!</span>")
return
if(recording || playing)
return
to_chat(usr, "<span class='notice'>Transcript printed.</span>")
var/obj/item/paper/P = new /obj/item/paper(get_turf(src))
var/t1 = "<B>Transcript:</B><BR><BR>"
for(var/i = 1, mytape.storedinfo.len >= i, i++)
t1 += "[mytape.storedinfo[i]]<BR>"
P.info = t1
P.name = "paper- 'Transcript'"
usr.put_in_hands(P)
canprint = 0
sleep(300)
canprint = 1
//empty tape recorders
/obj/item/taperecorder/empty
starting_tape_type = null
/obj/item/tape
name = "tape"
desc = "A magnetic tape that can hold up to ten minutes of content."
icon_state = "tape_white"
icon = 'icons/obj/device.dmi'
item_state = "analyzer"
lefthand_file = 'icons/mob/inhands/equipment/tools_lefthand.dmi'
righthand_file = 'icons/mob/inhands/equipment/tools_righthand.dmi'
w_class = WEIGHT_CLASS_TINY
materials = list(MAT_METAL=20, MAT_GLASS=5)
force = 1
throwforce = 0
var/max_capacity = 600
var/used_capacity = 0
var/list/storedinfo = list()
var/list/timestamp = list()
var/ruined = 0
/obj/item/tape/fire_act(exposed_temperature, exposed_volume)
ruin()
..()
/obj/item/tape/attack_self(mob/user)
if(!ruined)
to_chat(user, "<span class='notice'>You pull out all the tape!</span>")
ruin()
/obj/item/tape/proc/ruin()
//Lets not add infinite amounts of overlays when our fireact is called
//repeatedly
if(!ruined)
add_overlay("ribbonoverlay")
ruined = 1
/obj/item/tape/proc/fix()
cut_overlay("ribbonoverlay")
ruined = 0
/obj/item/tape/attackby(obj/item/I, mob/user, params)
if(ruined && istype(I, /obj/item/screwdriver) || istype(I, /obj/item/pen))
to_chat(user, "<span class='notice'>You start winding the tape back in...</span>")
if(I.use_tool(src, user, 120))
to_chat(user, "<span class='notice'>You wound the tape back in.</span>")
fix()
//Random colour tapes
/obj/item/tape/random
icon_state = "random_tape"
/obj/item/tape/random/New()
icon_state = "tape_[pick("white", "blue", "red", "yellow", "purple")]"
..()
+237 -237
View File
@@ -1,237 +1,237 @@
/obj/item/transfer_valve
icon = 'icons/obj/assemblies.dmi'
name = "tank transfer valve"
icon_state = "valve_1"
item_state = "ttv"
lefthand_file = 'icons/mob/inhands/weapons/bombs_lefthand.dmi'
righthand_file = 'icons/mob/inhands/weapons/bombs_righthand.dmi'
desc = "Regulates the transfer of air between two tanks."
w_class = WEIGHT_CLASS_BULKY
var/obj/item/tank/tank_one
var/obj/item/tank/tank_two
var/obj/item/assembly/attached_device
var/mob/attacher = null
var/valve_open = FALSE
var/toggle = 1
/obj/item/transfer_valve/IsAssemblyHolder()
return TRUE
/obj/item/transfer_valve/attackby(obj/item/item, mob/user, params)
if(istype(item, /obj/item/tank))
if(tank_one && tank_two)
to_chat(user, "<span class='warning'>There are already two tanks attached, remove one first!</span>")
return
if(!tank_one)
if(!user.transferItemToLoc(item, src))
return
tank_one = item
to_chat(user, "<span class='notice'>You attach the tank to the transfer valve.</span>")
else if(!tank_two)
if(!user.transferItemToLoc(item, src))
return
tank_two = item
to_chat(user, "<span class='notice'>You attach the tank to the transfer valve.</span>")
update_icon()
//TODO: Have this take an assemblyholder
else if(isassembly(item))
var/obj/item/assembly/A = item
if(A.secured)
to_chat(user, "<span class='notice'>The device is secured.</span>")
return
if(attached_device)
to_chat(user, "<span class='warning'>There is already a device attached to the valve, remove it first!</span>")
return
if(!user.transferItemToLoc(item, src))
return
attached_device = A
to_chat(user, "<span class='notice'>You attach the [item] to the valve controls and secure it.</span>")
A.holder = src
A.toggle_secure() //this calls update_icon(), which calls update_icon() on the holder (i.e. the bomb).
GLOB.bombers += "[key_name(user)] attached a [item] to a transfer valve."
message_admins("[ADMIN_LOOKUPFLW(user)] attached a [item] to a transfer valve.")
log_game("[key_name(user)] attached a [item] to a transfer valve.")
attacher = user
return
//Attached device memes
/obj/item/transfer_valve/Move()
. = ..()
if(attached_device)
attached_device.holder_movement()
/obj/item/transfer_valve/dropped()
. = ..()
if(attached_device)
attached_device.dropped()
/obj/item/transfer_valve/on_found(mob/finder)
if(attached_device)
attached_device.on_found(finder)
/obj/item/transfer_valve/Crossed(atom/movable/AM as mob|obj)
. = ..()
if(attached_device)
attached_device.Crossed(AM)
/obj/item/transfer_valve/attack_hand()//Triggers mousetraps
. = ..()
if(.)
return
if(attached_device)
attached_device.attack_hand()
//These keep attached devices synced up, for example a TTV with a mouse trap being found in a bag so it's triggered, or moving the TTV with an infrared beam sensor to update the beam's direction.
/obj/item/transfer_valve/attack_self(mob/user)
user.set_machine(src)
var/dat = {"<B> Valve properties: </B>
<BR> <B> Attachment one:</B> [tank_one] [tank_one ? "<A href='?src=[REF(src)];tankone=1'>Remove</A>" : ""]
<BR> <B> Attachment two:</B> [tank_two] [tank_two ? "<A href='?src=[REF(src)];tanktwo=1'>Remove</A>" : ""]
<BR> <B> Valve attachment:</B> [attached_device ? "<A href='?src=[REF(src)];device=1'>[attached_device]</A>" : "None"] [attached_device ? "<A href='?src=[REF(src)];rem_device=1'>Remove</A>" : ""]
<BR> <B> Valve status: </B> [ valve_open ? "<A href='?src=[REF(src)];open=1'>Closed</A> <B>Open</B>" : "<B>Closed</B> <A href='?src=[REF(src)];open=1'>Open</A>"]"}
var/datum/browser/popup = new(user, "trans_valve", name)
popup.set_content(dat)
popup.open()
return
/obj/item/transfer_valve/Topic(href, href_list)
..()
if(!usr.canUseTopic(src))
return
if(tank_one && href_list["tankone"])
split_gases()
valve_open = FALSE
tank_one.forceMove(drop_location())
tank_one = null
update_icon()
else if(tank_two && href_list["tanktwo"])
split_gases()
valve_open = FALSE
tank_two.forceMove(drop_location())
tank_two = null
update_icon()
else if(href_list["open"])
toggle_valve()
else if(attached_device)
if(href_list["rem_device"])
attached_device.on_detach()
attached_device = null
update_icon()
if(href_list["device"])
attached_device.attack_self(usr)
attack_self(usr)
add_fingerprint(usr)
/obj/item/transfer_valve/proc/process_activation(obj/item/D)
if(toggle)
toggle = FALSE
toggle_valve()
addtimer(CALLBACK(src, .proc/toggle_off), 5) //To stop a signal being spammed from a proxy sensor constantly going off or whatever
/obj/item/transfer_valve/proc/toggle_off()
toggle = TRUE
/obj/item/transfer_valve/update_icon()
cut_overlays()
underlays = null
if(!tank_one && !tank_two && !attached_device)
icon_state = "valve_1"
return
icon_state = "valve"
if(tank_one)
add_overlay("[tank_one.icon_state]")
if(tank_two)
var/icon/J = new(icon, icon_state = "[tank_two.icon_state]")
J.Shift(WEST, 13)
underlays += J
if(attached_device)
add_overlay("device")
if(istype(attached_device, /obj/item/assembly/infra))
var/obj/item/assembly/infra/sensor = attached_device
if(sensor.on && sensor.visible)
add_overlay("proxy_beam")
/obj/item/transfer_valve/proc/merge_gases(datum/gas_mixture/target, change_volume = TRUE)
var/target_self = FALSE
if(!target || (target == tank_one.air_contents))
target = tank_two.air_contents
if(target == tank_two.air_contents)
target_self = TRUE
if(change_volume)
if(!target_self)
target.volume += tank_two.volume
target.volume += tank_one.air_contents.volume
var/datum/gas_mixture/temp
temp = tank_one.air_contents.remove_ratio(1)
target.merge(temp)
if(!target_self)
temp = tank_two.air_contents.remove_ratio(1)
target.merge(temp)
/obj/item/transfer_valve/proc/split_gases()
if (!valve_open || !tank_one || !tank_two)
return
var/ratio1 = tank_one.air_contents.volume/tank_two.air_contents.volume
var/datum/gas_mixture/temp
temp = tank_two.air_contents.remove_ratio(ratio1)
tank_one.air_contents.merge(temp)
tank_two.air_contents.volume -= tank_one.air_contents.volume
/*
Exadv1: I know this isn't how it's going to work, but this was just to check
it explodes properly when it gets a signal (and it does).
*/
/obj/item/transfer_valve/proc/toggle_valve()
if(!valve_open && tank_one && tank_two)
valve_open = TRUE
var/turf/bombturf = get_turf(src)
var/attachment
if(attached_device)
if(istype(attached_device, /obj/item/assembly/signaler))
attachment = "<A HREF='?_src_=holder;[HrefToken()];secrets=list_signalers'>[attached_device]</A>"
else
attachment = attached_device
var/admin_attachment_message
var/attachment_message
if(attachment)
admin_attachment_message = " with [attachment] attached by [attacher ? ADMIN_LOOKUPFLW(attacher) : "Unknown"]"
attachment_message = " with [attachment] attached by [attacher ? key_name_admin(attacher) : "Unknown"]"
var/mob/bomber = get_mob_by_key(fingerprintslast)
var/admin_bomber_message
var/bomber_message
if(bomber)
admin_bomber_message = " - Last touched by: [ADMIN_LOOKUPFLW(bomber)]"
bomber_message = " - Last touched by: [key_name_admin(bomber)]"
var/admin_bomb_message = "Bomb valve opened in [ADMIN_VERBOSEJMP(bombturf)][admin_attachment_message][admin_bomber_message]"
GLOB.bombers += admin_bomb_message
message_admins(admin_bomb_message, 0, 1)
log_game("Bomb valve opened in [AREACOORD(bombturf)][attachment_message][bomber_message]")
merge_gases()
for(var/i in 1 to 6)
addtimer(CALLBACK(src, /atom/.proc/update_icon), 20 + (i - 1) * 10)
else if(valve_open && tank_one && tank_two)
split_gases()
valve_open = FALSE
update_icon()
// this doesn't do anything but the timer etc. expects it to be here
// eventually maybe have it update icon to show state (timer, prox etc.) like old bombs
/obj/item/transfer_valve/proc/c_state()
return
/obj/item/transfer_valve
icon = 'icons/obj/assemblies.dmi'
name = "tank transfer valve"
icon_state = "valve_1"
item_state = "ttv"
lefthand_file = 'icons/mob/inhands/weapons/bombs_lefthand.dmi'
righthand_file = 'icons/mob/inhands/weapons/bombs_righthand.dmi'
desc = "Regulates the transfer of air between two tanks."
w_class = WEIGHT_CLASS_BULKY
var/obj/item/tank/tank_one
var/obj/item/tank/tank_two
var/obj/item/assembly/attached_device
var/mob/attacher = null
var/valve_open = FALSE
var/toggle = 1
/obj/item/transfer_valve/IsAssemblyHolder()
return TRUE
/obj/item/transfer_valve/attackby(obj/item/item, mob/user, params)
if(istype(item, /obj/item/tank))
if(tank_one && tank_two)
to_chat(user, "<span class='warning'>There are already two tanks attached, remove one first!</span>")
return
if(!tank_one)
if(!user.transferItemToLoc(item, src))
return
tank_one = item
to_chat(user, "<span class='notice'>You attach the tank to the transfer valve.</span>")
else if(!tank_two)
if(!user.transferItemToLoc(item, src))
return
tank_two = item
to_chat(user, "<span class='notice'>You attach the tank to the transfer valve.</span>")
update_icon()
//TODO: Have this take an assemblyholder
else if(isassembly(item))
var/obj/item/assembly/A = item
if(A.secured)
to_chat(user, "<span class='notice'>The device is secured.</span>")
return
if(attached_device)
to_chat(user, "<span class='warning'>There is already a device attached to the valve, remove it first!</span>")
return
if(!user.transferItemToLoc(item, src))
return
attached_device = A
to_chat(user, "<span class='notice'>You attach the [item] to the valve controls and secure it.</span>")
A.holder = src
A.toggle_secure() //this calls update_icon(), which calls update_icon() on the holder (i.e. the bomb).
GLOB.bombers += "[key_name(user)] attached a [item] to a transfer valve."
message_admins("[ADMIN_LOOKUPFLW(user)] attached a [item] to a transfer valve.")
log_game("[key_name(user)] attached a [item] to a transfer valve.")
attacher = user
return
//Attached device memes
/obj/item/transfer_valve/Move()
. = ..()
if(attached_device)
attached_device.holder_movement()
/obj/item/transfer_valve/dropped()
. = ..()
if(attached_device)
attached_device.dropped()
/obj/item/transfer_valve/on_found(mob/finder)
if(attached_device)
attached_device.on_found(finder)
/obj/item/transfer_valve/Crossed(atom/movable/AM as mob|obj)
. = ..()
if(attached_device)
attached_device.Crossed(AM)
/obj/item/transfer_valve/attack_hand()//Triggers mousetraps
. = ..()
if(.)
return
if(attached_device)
attached_device.attack_hand()
//These keep attached devices synced up, for example a TTV with a mouse trap being found in a bag so it's triggered, or moving the TTV with an infrared beam sensor to update the beam's direction.
/obj/item/transfer_valve/attack_self(mob/user)
user.set_machine(src)
var/dat = {"<B> Valve properties: </B>
<BR> <B> Attachment one:</B> [tank_one] [tank_one ? "<A href='?src=[REF(src)];tankone=1'>Remove</A>" : ""]
<BR> <B> Attachment two:</B> [tank_two] [tank_two ? "<A href='?src=[REF(src)];tanktwo=1'>Remove</A>" : ""]
<BR> <B> Valve attachment:</B> [attached_device ? "<A href='?src=[REF(src)];device=1'>[attached_device]</A>" : "None"] [attached_device ? "<A href='?src=[REF(src)];rem_device=1'>Remove</A>" : ""]
<BR> <B> Valve status: </B> [ valve_open ? "<A href='?src=[REF(src)];open=1'>Closed</A> <B>Open</B>" : "<B>Closed</B> <A href='?src=[REF(src)];open=1'>Open</A>"]"}
var/datum/browser/popup = new(user, "trans_valve", name)
popup.set_content(dat)
popup.open()
return
/obj/item/transfer_valve/Topic(href, href_list)
..()
if(!usr.canUseTopic(src))
return
if(tank_one && href_list["tankone"])
split_gases()
valve_open = FALSE
tank_one.forceMove(drop_location())
tank_one = null
update_icon()
else if(tank_two && href_list["tanktwo"])
split_gases()
valve_open = FALSE
tank_two.forceMove(drop_location())
tank_two = null
update_icon()
else if(href_list["open"])
toggle_valve()
else if(attached_device)
if(href_list["rem_device"])
attached_device.on_detach()
attached_device = null
update_icon()
if(href_list["device"])
attached_device.attack_self(usr)
attack_self(usr)
add_fingerprint(usr)
/obj/item/transfer_valve/proc/process_activation(obj/item/D)
if(toggle)
toggle = FALSE
toggle_valve()
addtimer(CALLBACK(src, .proc/toggle_off), 5) //To stop a signal being spammed from a proxy sensor constantly going off or whatever
/obj/item/transfer_valve/proc/toggle_off()
toggle = TRUE
/obj/item/transfer_valve/update_icon()
cut_overlays()
underlays = null
if(!tank_one && !tank_two && !attached_device)
icon_state = "valve_1"
return
icon_state = "valve"
if(tank_one)
add_overlay("[tank_one.icon_state]")
if(tank_two)
var/icon/J = new(icon, icon_state = "[tank_two.icon_state]")
J.Shift(WEST, 13)
underlays += J
if(attached_device)
add_overlay("device")
if(istype(attached_device, /obj/item/assembly/infra))
var/obj/item/assembly/infra/sensor = attached_device
if(sensor.on && sensor.visible)
add_overlay("proxy_beam")
/obj/item/transfer_valve/proc/merge_gases(datum/gas_mixture/target, change_volume = TRUE)
var/target_self = FALSE
if(!target || (target == tank_one.air_contents))
target = tank_two.air_contents
if(target == tank_two.air_contents)
target_self = TRUE
if(change_volume)
if(!target_self)
target.volume += tank_two.volume
target.volume += tank_one.air_contents.volume
var/datum/gas_mixture/temp
temp = tank_one.air_contents.remove_ratio(1)
target.merge(temp)
if(!target_self)
temp = tank_two.air_contents.remove_ratio(1)
target.merge(temp)
/obj/item/transfer_valve/proc/split_gases()
if (!valve_open || !tank_one || !tank_two)
return
var/ratio1 = tank_one.air_contents.volume/tank_two.air_contents.volume
var/datum/gas_mixture/temp
temp = tank_two.air_contents.remove_ratio(ratio1)
tank_one.air_contents.merge(temp)
tank_two.air_contents.volume -= tank_one.air_contents.volume
/*
Exadv1: I know this isn't how it's going to work, but this was just to check
it explodes properly when it gets a signal (and it does).
*/
/obj/item/transfer_valve/proc/toggle_valve()
if(!valve_open && tank_one && tank_two)
valve_open = TRUE
var/turf/bombturf = get_turf(src)
var/attachment
if(attached_device)
if(istype(attached_device, /obj/item/assembly/signaler))
attachment = "<A HREF='?_src_=holder;[HrefToken()];secrets=list_signalers'>[attached_device]</A>"
else
attachment = attached_device
var/admin_attachment_message
var/attachment_message
if(attachment)
admin_attachment_message = " with [attachment] attached by [attacher ? ADMIN_LOOKUPFLW(attacher) : "Unknown"]"
attachment_message = " with [attachment] attached by [attacher ? key_name_admin(attacher) : "Unknown"]"
var/mob/bomber = get_mob_by_key(fingerprintslast)
var/admin_bomber_message
var/bomber_message
if(bomber)
admin_bomber_message = " - Last touched by: [ADMIN_LOOKUPFLW(bomber)]"
bomber_message = " - Last touched by: [key_name_admin(bomber)]"
var/admin_bomb_message = "Bomb valve opened in [ADMIN_VERBOSEJMP(bombturf)][admin_attachment_message][admin_bomber_message]"
GLOB.bombers += admin_bomb_message
message_admins(admin_bomb_message, 0, 1)
log_game("Bomb valve opened in [AREACOORD(bombturf)][attachment_message][bomber_message]")
merge_gases()
for(var/i in 1 to 6)
addtimer(CALLBACK(src, /atom/.proc/update_icon), 20 + (i - 1) * 10)
else if(valve_open && tank_one && tank_two)
split_gases()
valve_open = FALSE
update_icon()
// this doesn't do anything but the timer etc. expects it to be here
// eventually maybe have it update icon to show state (timer, prox etc.) like old bombs
/obj/item/transfer_valve/proc/c_state()
return
+197 -197
View File
@@ -1,197 +1,197 @@
/obj/item/storage/pill_bottle/dice
name = "bag of dice"
desc = "Contains all the luck you'll ever need."
icon = 'icons/obj/dice.dmi'
icon_state = "dicebag"
/obj/item/storage/pill_bottle/dice/Initialize()
. = ..()
var/special_die = pick("1","2","fudge","space","00","8bd20","4dd6","100")
if(special_die == "1")
new /obj/item/dice/d1(src)
if(special_die == "2")
new /obj/item/dice/d2(src)
new /obj/item/dice/d4(src)
new /obj/item/dice/d6(src)
if(special_die == "fudge")
new /obj/item/dice/fudge(src)
if(special_die == "space")
new /obj/item/dice/d6/space(src)
new /obj/item/dice/d8(src)
new /obj/item/dice/d10(src)
if(special_die == "00")
new /obj/item/dice/d00(src)
new /obj/item/dice/d12(src)
new /obj/item/dice/d20(src)
if(special_die == "8bd20")
new /obj/item/dice/eightbd20(src)
if(special_die == "4dd6")
new /obj/item/dice/fourdd6(src)
if(special_die == "100")
new /obj/item/dice/d100(src)
/obj/item/storage/pill_bottle/dice/suicide_act(mob/user)
user.visible_message("<span class='suicide'>[user] is gambling with death! It looks like [user.p_theyre()] trying to commit suicide!</span>")
return (OXYLOSS)
/obj/item/dice //depreciated d6, use /obj/item/dice/d6 if you actually want a d6
name = "die"
desc = "A die with six sides. Basic and serviceable."
icon = 'icons/obj/dice.dmi'
icon_state = "d6"
w_class = WEIGHT_CLASS_TINY
var/sides = 6
var/result = null
var/list/special_faces = list() //entries should match up to sides var if used
var/can_be_rigged = TRUE
var/rigged = FALSE
/obj/item/dice/Initialize()
. = ..()
result = roll(sides)
update_icon()
/obj/item/dice/suicide_act(mob/user)
user.visible_message("<span class='suicide'>[user] is gambling with death! It looks like [user.p_theyre()] trying to commit suicide!</span>")
return (OXYLOSS)
/obj/item/dice/d1
name = "d1"
desc = "A die with only one side. Deterministic!"
icon_state = "d1"
sides = 1
/obj/item/dice/d2
name = "d2"
desc = "A die with two sides. Coins are undignified!"
icon_state = "d2"
sides = 2
/obj/item/dice/d4
name = "d4"
desc = "A die with four sides. The nerd's caltrop."
icon_state = "d4"
sides = 4
/obj/item/dice/d4/Initialize(mapload)
. = ..()
AddComponent(/datum/component/caltrop, 4)
/obj/item/dice/d6
name = "d6"
/obj/item/dice/d6/space
name = "space cube"
desc = "A die with six sides. 6 TIMES 255 TIMES 255 TILE TOTAL EXISTENCE, SQUARE YOUR MIND OF EDUCATED STUPID: 2 DOES NOT EXIST."
icon_state = "spaced6"
/obj/item/dice/d6/space/Initialize()
. = ..()
if(prob(10))
name = "spess cube"
/obj/item/dice/fudge
name = "fudge die"
desc = "A die with six sides but only three results. Is this a plus or a minus? Your mind is drawing a blank..."
sides = 3 //shhh
icon_state = "fudge"
special_faces = list("minus","blank","plus")
/obj/item/dice/d8
name = "d8"
desc = "A die with eight sides. It feels... lucky."
icon_state = "d8"
sides = 8
/obj/item/dice/d10
name = "d10"
desc = "A die with ten sides. Useful for percentages."
icon_state = "d10"
sides = 10
/obj/item/dice/d00
name = "d00"
desc = "A die with ten sides. Works better for d100 rolls than a golf ball."
icon_state = "d00"
sides = 10
/obj/item/dice/d12
name = "d12"
desc = "A die with twelve sides. There's an air of neglect about it."
icon_state = "d12"
sides = 12
/obj/item/dice/d20
name = "d20"
desc = "A die with twenty sides. The preferred die to throw at the GM."
icon_state = "d20"
sides = 20
/obj/item/dice/d100
name = "d100"
desc = "A die with one hundred sides! Probably not fairly weighted..."
icon_state = "d100"
w_class = WEIGHT_CLASS_SMALL
sides = 100
/obj/item/dice/d100/update_icon()
return
/obj/item/dice/eightbd20
name = "strange d20"
desc = "A weird die with raised text printed on the faces. Everything's white on white so reading it is a struggle. What poor design!"
icon_state = "8bd20"
sides = 20
special_faces = list("It is certain","It is decidedly so","Without a doubt","Yes, definitely","You may rely on it","As I see it, yes","Most likely","Outlook good","Yes","Signs point to yes","Reply hazy try again","Ask again later","Better not tell you now","Cannot predict now","Concentrate and ask again","Don't count on it","My reply is no","My sources say no","Outlook not so good","Very doubtful")
/obj/item/dice/eightbd20/update_icon()
return
/obj/item/dice/fourdd6
name = "4d d6"
desc = "A die that exists in four dimensional space. Properly interpreting them can only be done with the help of a mathematician, a physicist, and a priest."
icon_state = "4dd6"
sides = 48
special_faces = list("Cube-Side: 1-1","Cube-Side: 1-2","Cube-Side: 1-3","Cube-Side: 1-4","Cube-Side: 1-5","Cube-Side: 1-6","Cube-Side: 2-1","Cube-Side: 2-2","Cube-Side: 2-3","Cube-Side: 2-4","Cube-Side: 2-5","Cube-Side: 2-6","Cube-Side: 3-1","Cube-Side: 3-2","Cube-Side: 3-3","Cube-Side: 3-4","Cube-Side: 3-5","Cube-Side: 3-6","Cube-Side: 4-1","Cube-Side: 4-2","Cube-Side: 4-3","Cube-Side: 4-4","Cube-Side: 4-5","Cube-Side: 4-6","Cube-Side: 5-1","Cube-Side: 5-2","Cube-Side: 5-3","Cube-Side: 5-4","Cube-Side: 5-5","Cube-Side: 5-6","Cube-Side: 6-1","Cube-Side: 6-2","Cube-Side: 6-3","Cube-Side: 6-4","Cube-Side: 6-5","Cube-Side: 6-6","Cube-Side: 7-1","Cube-Side: 7-2","Cube-Side: 7-3","Cube-Side: 7-4","Cube-Side: 7-5","Cube-Side: 7-6","Cube-Side: 8-1","Cube-Side: 8-2","Cube-Side: 8-3","Cube-Side: 8-4","Cube-Side: 8-5","Cube-Side: 8-6")
/obj/item/dice/fourdd6/update_icon()
return
/obj/item/dice/attack_self(mob/user)
diceroll(user)
/obj/item/dice/throw_impact(atom/target)
diceroll(thrownby)
. = ..()
/obj/item/dice/proc/diceroll(mob/user)
result = roll(sides)
if(rigged && result != rigged)
if(prob(CLAMP(1/(sides - 1) * 100, 25, 80)))
result = rigged
var/fake_result = roll(sides)//Daredevil isn't as good as he used to be
var/comment = ""
if(sides == 20 && result == 20)
comment = "NAT 20!"
else if(sides == 20 && result == 1)
comment = "Ouch, bad luck."
update_icon()
if(initial(icon_state) == "d00")
result = (result - 1)*10
if(special_faces.len == sides)
result = special_faces[result]
if(user != null) //Dice was rolled in someone's hand
user.visible_message("[user] has thrown [src]. It lands on [result]. [comment]", \
"<span class='notice'>You throw [src]. It lands on [result]. [comment]</span>", \
"<span class='italics'>You hear [src] rolling, it sounds like a [fake_result].</span>")
else if(!src.throwing) //Dice was thrown and is coming to rest
visible_message("<span class='notice'>[src] rolls to a stop, landing on [result]. [comment]</span>")
/obj/item/dice/update_icon()
cut_overlays()
add_overlay("[src.icon_state]-[src.result]")
/obj/item/dice/microwave_act(obj/machinery/microwave/M)
if(can_be_rigged)
rigged = result
..(M)
/obj/item/storage/pill_bottle/dice
name = "bag of dice"
desc = "Contains all the luck you'll ever need."
icon = 'icons/obj/dice.dmi'
icon_state = "dicebag"
/obj/item/storage/pill_bottle/dice/Initialize()
. = ..()
var/special_die = pick("1","2","fudge","space","00","8bd20","4dd6","100")
if(special_die == "1")
new /obj/item/dice/d1(src)
if(special_die == "2")
new /obj/item/dice/d2(src)
new /obj/item/dice/d4(src)
new /obj/item/dice/d6(src)
if(special_die == "fudge")
new /obj/item/dice/fudge(src)
if(special_die == "space")
new /obj/item/dice/d6/space(src)
new /obj/item/dice/d8(src)
new /obj/item/dice/d10(src)
if(special_die == "00")
new /obj/item/dice/d00(src)
new /obj/item/dice/d12(src)
new /obj/item/dice/d20(src)
if(special_die == "8bd20")
new /obj/item/dice/eightbd20(src)
if(special_die == "4dd6")
new /obj/item/dice/fourdd6(src)
if(special_die == "100")
new /obj/item/dice/d100(src)
/obj/item/storage/pill_bottle/dice/suicide_act(mob/user)
user.visible_message("<span class='suicide'>[user] is gambling with death! It looks like [user.p_theyre()] trying to commit suicide!</span>")
return (OXYLOSS)
/obj/item/dice //depreciated d6, use /obj/item/dice/d6 if you actually want a d6
name = "die"
desc = "A die with six sides. Basic and serviceable."
icon = 'icons/obj/dice.dmi'
icon_state = "d6"
w_class = WEIGHT_CLASS_TINY
var/sides = 6
var/result = null
var/list/special_faces = list() //entries should match up to sides var if used
var/can_be_rigged = TRUE
var/rigged = FALSE
/obj/item/dice/Initialize()
. = ..()
result = roll(sides)
update_icon()
/obj/item/dice/suicide_act(mob/user)
user.visible_message("<span class='suicide'>[user] is gambling with death! It looks like [user.p_theyre()] trying to commit suicide!</span>")
return (OXYLOSS)
/obj/item/dice/d1
name = "d1"
desc = "A die with only one side. Deterministic!"
icon_state = "d1"
sides = 1
/obj/item/dice/d2
name = "d2"
desc = "A die with two sides. Coins are undignified!"
icon_state = "d2"
sides = 2
/obj/item/dice/d4
name = "d4"
desc = "A die with four sides. The nerd's caltrop."
icon_state = "d4"
sides = 4
/obj/item/dice/d4/Initialize(mapload)
. = ..()
AddComponent(/datum/component/caltrop, 4)
/obj/item/dice/d6
name = "d6"
/obj/item/dice/d6/space
name = "space cube"
desc = "A die with six sides. 6 TIMES 255 TIMES 255 TILE TOTAL EXISTENCE, SQUARE YOUR MIND OF EDUCATED STUPID: 2 DOES NOT EXIST."
icon_state = "spaced6"
/obj/item/dice/d6/space/Initialize()
. = ..()
if(prob(10))
name = "spess cube"
/obj/item/dice/fudge
name = "fudge die"
desc = "A die with six sides but only three results. Is this a plus or a minus? Your mind is drawing a blank..."
sides = 3 //shhh
icon_state = "fudge"
special_faces = list("minus","blank","plus")
/obj/item/dice/d8
name = "d8"
desc = "A die with eight sides. It feels... lucky."
icon_state = "d8"
sides = 8
/obj/item/dice/d10
name = "d10"
desc = "A die with ten sides. Useful for percentages."
icon_state = "d10"
sides = 10
/obj/item/dice/d00
name = "d00"
desc = "A die with ten sides. Works better for d100 rolls than a golf ball."
icon_state = "d00"
sides = 10
/obj/item/dice/d12
name = "d12"
desc = "A die with twelve sides. There's an air of neglect about it."
icon_state = "d12"
sides = 12
/obj/item/dice/d20
name = "d20"
desc = "A die with twenty sides. The preferred die to throw at the GM."
icon_state = "d20"
sides = 20
/obj/item/dice/d100
name = "d100"
desc = "A die with one hundred sides! Probably not fairly weighted..."
icon_state = "d100"
w_class = WEIGHT_CLASS_SMALL
sides = 100
/obj/item/dice/d100/update_icon()
return
/obj/item/dice/eightbd20
name = "strange d20"
desc = "A weird die with raised text printed on the faces. Everything's white on white so reading it is a struggle. What poor design!"
icon_state = "8bd20"
sides = 20
special_faces = list("It is certain","It is decidedly so","Without a doubt","Yes, definitely","You may rely on it","As I see it, yes","Most likely","Outlook good","Yes","Signs point to yes","Reply hazy try again","Ask again later","Better not tell you now","Cannot predict now","Concentrate and ask again","Don't count on it","My reply is no","My sources say no","Outlook not so good","Very doubtful")
/obj/item/dice/eightbd20/update_icon()
return
/obj/item/dice/fourdd6
name = "4d d6"
desc = "A die that exists in four dimensional space. Properly interpreting them can only be done with the help of a mathematician, a physicist, and a priest."
icon_state = "4dd6"
sides = 48
special_faces = list("Cube-Side: 1-1","Cube-Side: 1-2","Cube-Side: 1-3","Cube-Side: 1-4","Cube-Side: 1-5","Cube-Side: 1-6","Cube-Side: 2-1","Cube-Side: 2-2","Cube-Side: 2-3","Cube-Side: 2-4","Cube-Side: 2-5","Cube-Side: 2-6","Cube-Side: 3-1","Cube-Side: 3-2","Cube-Side: 3-3","Cube-Side: 3-4","Cube-Side: 3-5","Cube-Side: 3-6","Cube-Side: 4-1","Cube-Side: 4-2","Cube-Side: 4-3","Cube-Side: 4-4","Cube-Side: 4-5","Cube-Side: 4-6","Cube-Side: 5-1","Cube-Side: 5-2","Cube-Side: 5-3","Cube-Side: 5-4","Cube-Side: 5-5","Cube-Side: 5-6","Cube-Side: 6-1","Cube-Side: 6-2","Cube-Side: 6-3","Cube-Side: 6-4","Cube-Side: 6-5","Cube-Side: 6-6","Cube-Side: 7-1","Cube-Side: 7-2","Cube-Side: 7-3","Cube-Side: 7-4","Cube-Side: 7-5","Cube-Side: 7-6","Cube-Side: 8-1","Cube-Side: 8-2","Cube-Side: 8-3","Cube-Side: 8-4","Cube-Side: 8-5","Cube-Side: 8-6")
/obj/item/dice/fourdd6/update_icon()
return
/obj/item/dice/attack_self(mob/user)
diceroll(user)
/obj/item/dice/throw_impact(atom/target)
diceroll(thrownby)
. = ..()
/obj/item/dice/proc/diceroll(mob/user)
result = roll(sides)
if(rigged && result != rigged)
if(prob(CLAMP(1/(sides - 1) * 100, 25, 80)))
result = rigged
var/fake_result = roll(sides)//Daredevil isn't as good as he used to be
var/comment = ""
if(sides == 20 && result == 20)
comment = "NAT 20!"
else if(sides == 20 && result == 1)
comment = "Ouch, bad luck."
update_icon()
if(initial(icon_state) == "d00")
result = (result - 1)*10
if(special_faces.len == sides)
result = special_faces[result]
if(user != null) //Dice was rolled in someone's hand
user.visible_message("[user] has thrown [src]. It lands on [result]. [comment]", \
"<span class='notice'>You throw [src]. It lands on [result]. [comment]</span>", \
"<span class='italics'>You hear [src] rolling, it sounds like a [fake_result].</span>")
else if(!src.throwing) //Dice was thrown and is coming to rest
visible_message("<span class='notice'>[src] rolls to a stop, landing on [result]. [comment]</span>")
/obj/item/dice/update_icon()
cut_overlays()
add_overlay("[src.icon_state]-[src.result]")
/obj/item/dice/microwave_act(obj/machinery/microwave/M)
if(can_be_rigged)
rigged = result
..(M)
+369 -369
View File
@@ -1,369 +1,369 @@
/obj/item/dnainjector
name = "\improper DNA injector"
desc = "This injects the person with DNA."
icon = 'icons/obj/items_and_weapons.dmi'
icon_state = "dnainjector"
lefthand_file = 'icons/mob/inhands/equipment/medical_lefthand.dmi'
righthand_file = 'icons/mob/inhands/equipment/medical_righthand.dmi'
throw_speed = 3
throw_range = 5
w_class = WEIGHT_CLASS_TINY
var/damage_coeff = 1
var/list/fields
var/list/add_mutations = list()
var/list/remove_mutations = list()
var/list/add_mutations_static = list()
var/list/remove_mutations_static = list()
var/used = 0
/obj/item/dnainjector/attack_paw(mob/user)
return attack_hand(user)
/obj/item/dnainjector/proc/prepare()
for(var/mut_key in add_mutations_static)
add_mutations.Add(GLOB.mutations_list[mut_key])
for(var/mut_key in remove_mutations_static)
remove_mutations.Add(GLOB.mutations_list[mut_key])
/obj/item/dnainjector/proc/inject(mob/living/carbon/M, mob/user)
prepare()
if(M.has_dna() && !HAS_TRAIT(M, TRAIT_RADIMMUNE) && !HAS_TRAIT(M, TRAIT_NOCLONE))
M.radiation += rand(20/(damage_coeff ** 2),50/(damage_coeff ** 2))
var/log_msg = "[key_name(user)] injected [key_name(M)] with the [name]"
for(var/datum/mutation/human/HM in remove_mutations)
HM.force_lose(M)
for(var/datum/mutation/human/HM in add_mutations)
if(HM.name == RACEMUT)
message_admins("[ADMIN_LOOKUPFLW(user)] injected [key_name_admin(M)] with the [name] <span class='danger'>(MONKEY)</span>")
log_msg += " (MONKEY)"
HM.force_give(M)
if(fields)
if(fields["name"] && fields["UE"] && fields["blood_type"])
M.real_name = fields["name"]
M.dna.unique_enzymes = fields["UE"]
M.name = M.real_name
M.dna.blood_type = fields["blood_type"]
if(fields["UI"]) //UI+UE
M.dna.uni_identity = merge_text(M.dna.uni_identity, fields["UI"])
M.updateappearance(mutations_overlay_update=1)
log_attack("[log_msg] [loc_name(user)]")
return TRUE
return FALSE
/obj/item/dnainjector/attack(mob/target, mob/user)
if(!user.IsAdvancedToolUser())
to_chat(user, "<span class='warning'>You don't have the dexterity to do this!</span>")
return
if(used)
to_chat(user, "<span class='warning'>This injector is used up!</span>")
return
if(ishuman(target))
var/mob/living/carbon/human/humantarget = target
if (!humantarget.can_inject(user, 1))
return
log_combat(user, target, "attempted to inject", src)
if(target != user)
target.visible_message("<span class='danger'>[user] is trying to inject [target] with [src]!</span>", "<span class='userdanger'>[user] is trying to inject [target] with [src]!</span>")
if(!do_mob(user, target) || used)
return
target.visible_message("<span class='danger'>[user] injects [target] with the syringe with [src]!", \
"<span class='userdanger'>[user] injects [target] with the syringe with [src]!</span>")
else
to_chat(user, "<span class='notice'>You inject yourself with [src].</span>")
log_combat(user, target, "injected", src)
if(!inject(target, user)) //Now we actually do the heavy lifting.
to_chat(user, "<span class='notice'>It appears that [target] does not have compatible DNA.</span>")
used = 1
icon_state = "dnainjector0"
desc += " This one is used up."
/obj/item/dnainjector/antihulk
name = "\improper DNA injector (Anti-Hulk)"
desc = "Cures green skin."
remove_mutations_static = list(HULK)
/obj/item/dnainjector/hulkmut
name = "\improper DNA injector (Hulk)"
desc = "This will make you big and strong, but give you a bad skin condition."
add_mutations_static = list(HULK)
/obj/item/dnainjector/xraymut
name = "\improper DNA injector (X-ray)"
desc = "Finally you can see what the Captain does."
add_mutations_static = list(XRAY)
/obj/item/dnainjector/antixray
name = "\improper DNA injector (Anti-X-ray)"
desc = "It will make you see harder."
remove_mutations_static = list(XRAY)
/////////////////////////////////////
/obj/item/dnainjector/antiglasses
name = "\improper DNA injector (Anti-Glasses)"
desc = "Toss away those glasses!"
remove_mutations_static = list(BADSIGHT)
/obj/item/dnainjector/glassesmut
name = "\improper DNA injector (Glasses)"
desc = "Will make you need dorkish glasses."
add_mutations_static = list(BADSIGHT)
/obj/item/dnainjector/epimut
name = "\improper DNA injector (Epi.)"
desc = "Shake shake shake the room!"
add_mutations_static = list(EPILEPSY)
/obj/item/dnainjector/antiepi
name = "\improper DNA injector (Anti-Epi.)"
desc = "Will fix you up from shaking the room."
remove_mutations_static = list(EPILEPSY)
////////////////////////////////////
/obj/item/dnainjector/anticough
name = "\improper DNA injector (Anti-Cough)"
desc = "Will stop that awful noise."
remove_mutations_static = list(COUGH)
/obj/item/dnainjector/coughmut
name = "\improper DNA injector (Cough)"
desc = "Will bring forth a sound of horror from your throat."
add_mutations_static = list(COUGH)
/obj/item/dnainjector/antidwarf
name = "\improper DNA injector (Anti-Dwarfism)"
desc = "Helps you grow big and strong."
remove_mutations_static = list(DWARFISM)
/obj/item/dnainjector/dwarf
name = "\improper DNA injector (Dwarfism)"
desc = "It's a small world after all."
add_mutations_static = list(DWARFISM)
/obj/item/dnainjector/clumsymut
name = "\improper DNA injector (Clumsy)"
desc = "Makes clown minions."
add_mutations_static = list(CLOWNMUT)
/obj/item/dnainjector/anticlumsy
name = "\improper DNA injector (Anti-Clumsy)"
desc = "Apply this for Security Clown."
remove_mutations_static = list(CLOWNMUT)
/obj/item/dnainjector/antitour
name = "\improper DNA injector (Anti-Tour.)"
desc = "Will cure Tourette's."
remove_mutations_static = list(TOURETTES)
/obj/item/dnainjector/tourmut
name = "\improper DNA injector (Tour.)"
desc = "Gives you a nasty case of Tourette's."
add_mutations_static = list(TOURETTES)
/obj/item/dnainjector/stuttmut
name = "\improper DNA injector (Stutt.)"
desc = "Makes you s-s-stuttterrr."
add_mutations_static = list(NERVOUS)
/obj/item/dnainjector/antistutt
name = "\improper DNA injector (Anti-Stutt.)"
desc = "Fixes that speaking impairment."
remove_mutations_static = list(NERVOUS)
/obj/item/dnainjector/antifire
name = "\improper DNA injector (Anti-Fire)"
desc = "Cures fire."
remove_mutations_static = list(COLDRES)
/obj/item/dnainjector/firemut
name = "\improper DNA injector (Fire)"
desc = "Gives you fire."
add_mutations_static = list(COLDRES)
/obj/item/dnainjector/blindmut
name = "\improper DNA injector (Blind)"
desc = "Makes you not see anything."
add_mutations_static = list(BLINDMUT)
/obj/item/dnainjector/antiblind
name = "\improper DNA injector (Anti-Blind)"
desc = "IT'S A MIRACLE!!!"
remove_mutations_static = list(BLINDMUT)
/obj/item/dnainjector/antitele
name = "\improper DNA injector (Anti-Tele.)"
desc = "Will make you not able to control your mind."
remove_mutations_static = list(TK)
/obj/item/dnainjector/telemut
name = "\improper DNA injector (Tele.)"
desc = "Super brain man!"
add_mutations_static = list(TK)
/obj/item/dnainjector/telemut/darkbundle
name = "\improper DNA injector"
desc = "Good. Let the hate flow through you."
/obj/item/dnainjector/deafmut
name = "\improper DNA injector (Deaf)"
desc = "Sorry, what did you say?"
add_mutations_static = list(DEAFMUT)
/obj/item/dnainjector/antideaf
name = "\improper DNA injector (Anti-Deaf)"
desc = "Will make you hear once more."
remove_mutations_static = list(DEAFMUT)
/obj/item/dnainjector/h2m
name = "\improper DNA injector (Human > Monkey)"
desc = "Will make you a flea bag."
add_mutations_static = list(RACEMUT)
/obj/item/dnainjector/m2h
name = "\improper DNA injector (Monkey > Human)"
desc = "Will make you...less hairy."
remove_mutations_static = list(RACEMUT)
/obj/item/dnainjector/antichameleon
name = "\improper DNA injector (Anti-Chameleon)"
remove_mutations_static = list(CHAMELEON)
/obj/item/dnainjector/chameleonmut
name = "\improper DNA injector (Chameleon)"
add_mutations_static = list(CHAMELEON)
/obj/item/dnainjector/antiwacky
name = "\improper DNA injector (Anti-Wacky)"
remove_mutations_static = list(WACKY)
/obj/item/dnainjector/wackymut
name = "\improper DNA injector (Wacky)"
add_mutations_static = list(WACKY)
/obj/item/dnainjector/antimute
name = "\improper DNA injector (Anti-Mute)"
remove_mutations_static = list(MUT_MUTE)
/obj/item/dnainjector/mutemut
name = "\improper DNA injector (Mute)"
add_mutations_static = list(MUT_MUTE)
/obj/item/dnainjector/antismile
name = "\improper DNA injector (Anti-Smile)"
remove_mutations_static = list(SMILE)
/obj/item/dnainjector/smilemut
name = "\improper DNA injector (Smile)"
add_mutations_static = list(SMILE)
/obj/item/dnainjector/unintelligiblemut
name = "\improper DNA injector (Unintelligible)"
add_mutations_static = list(UNINTELLIGIBLE)
/obj/item/dnainjector/antiunintelligible
name = "\improper DNA injector (Anti-Unintelligible)"
remove_mutations_static = list(UNINTELLIGIBLE)
/obj/item/dnainjector/swedishmut
name = "\improper DNA injector (Swedish)"
add_mutations_static = list(SWEDISH)
/obj/item/dnainjector/antiswedish
name = "\improper DNA injector (Anti-Swedish)"
remove_mutations_static = list(SWEDISH)
/obj/item/dnainjector/chavmut
name = "\improper DNA injector (Chav)"
add_mutations_static = list(CHAV)
/obj/item/dnainjector/antichav
name = "\improper DNA injector (Anti-Chav)"
remove_mutations_static = list(CHAV)
/obj/item/dnainjector/elvismut
name = "\improper DNA injector (Elvis)"
add_mutations_static = list(ELVIS)
/obj/item/dnainjector/antielvis
name = "\improper DNA injector (Anti-Elvis)"
remove_mutations_static = list(ELVIS)
/obj/item/dnainjector/lasereyesmut
name = "\improper DNA injector (Laser Eyes)"
add_mutations_static = list(LASEREYES)
/obj/item/dnainjector/antilasereyes
name = "\improper DNA injector (Anti-Laser Eyes)"
remove_mutations_static = list(LASEREYES)
/obj/item/dnainjector/timed
var/duration = 600
/obj/item/dnainjector/timed/inject(mob/living/carbon/M, mob/user)
prepare()
if(M.stat == DEAD) //prevents dead people from having their DNA changed
to_chat(user, "<span class='notice'>You can't modify [M]'s DNA while [M.p_theyre()] dead.</span>")
return FALSE
if(M.has_dna() && !(HAS_TRAIT(M, TRAIT_NOCLONE)))
M.radiation += rand(20/(damage_coeff ** 2),50/(damage_coeff ** 2))
var/log_msg = "[key_name(user)] injected [key_name(M)] with the [name]"
var/endtime = world.time+duration
for(var/datum/mutation/human/HM in remove_mutations)
if(HM.name == RACEMUT)
if(ishuman(M))
continue
M = HM.force_lose(M)
else
HM.force_lose(M)
for(var/datum/mutation/human/HM in add_mutations)
if((HM in M.dna.mutations) && !(M.dna.temporary_mutations[HM.name]))
continue //Skip permanent mutations we already have.
if(HM.name == RACEMUT && ishuman(M))
message_admins("[ADMIN_LOOKUPFLW(user)] injected [key_name_admin(M)] with the [name] <span class='danger'>(MONKEY)</span>")
log_msg += " (MONKEY)"
M = HM.force_give(M)
else
HM.force_give(M)
M.dna.temporary_mutations[HM.name] = endtime
if(fields)
if(fields["name"] && fields["UE"] && fields["blood_type"])
if(!M.dna.previous["name"])
M.dna.previous["name"] = M.real_name
if(!M.dna.previous["UE"])
M.dna.previous["UE"] = M.dna.unique_enzymes
if(!M.dna.previous["blood_type"])
M.dna.previous["blood_type"] = M.dna.blood_type
M.real_name = fields["name"]
M.dna.unique_enzymes = fields["UE"]
M.name = M.real_name
M.dna.blood_type = fields["blood_type"]
M.dna.temporary_mutations[UE_CHANGED] = endtime
if(fields["UI"]) //UI+UE
if(!M.dna.previous["UI"])
M.dna.previous["UI"] = M.dna.uni_identity
M.dna.uni_identity = merge_text(M.dna.uni_identity, fields["UI"])
M.updateappearance(mutations_overlay_update=1)
M.dna.temporary_mutations[UI_CHANGED] = endtime
log_attack("[log_msg] [loc_name(user)]")
return TRUE
else
return FALSE
/obj/item/dnainjector/timed/hulk
name = "\improper DNA injector (Hulk)"
desc = "This will make you big and strong, but give you a bad skin condition."
add_mutations_static = list(HULK)
/obj/item/dnainjector/timed/h2m
name = "\improper DNA injector (Human > Monkey)"
desc = "Will make you a flea bag."
add_mutations_static = list(RACEMUT)
/obj/item/dnainjector
name = "\improper DNA injector"
desc = "This injects the person with DNA."
icon = 'icons/obj/items_and_weapons.dmi'
icon_state = "dnainjector"
lefthand_file = 'icons/mob/inhands/equipment/medical_lefthand.dmi'
righthand_file = 'icons/mob/inhands/equipment/medical_righthand.dmi'
throw_speed = 3
throw_range = 5
w_class = WEIGHT_CLASS_TINY
var/damage_coeff = 1
var/list/fields
var/list/add_mutations = list()
var/list/remove_mutations = list()
var/list/add_mutations_static = list()
var/list/remove_mutations_static = list()
var/used = 0
/obj/item/dnainjector/attack_paw(mob/user)
return attack_hand(user)
/obj/item/dnainjector/proc/prepare()
for(var/mut_key in add_mutations_static)
add_mutations.Add(GLOB.mutations_list[mut_key])
for(var/mut_key in remove_mutations_static)
remove_mutations.Add(GLOB.mutations_list[mut_key])
/obj/item/dnainjector/proc/inject(mob/living/carbon/M, mob/user)
prepare()
if(M.has_dna() && !HAS_TRAIT(M, TRAIT_RADIMMUNE) && !HAS_TRAIT(M, TRAIT_NOCLONE))
M.radiation += rand(20/(damage_coeff ** 2),50/(damage_coeff ** 2))
var/log_msg = "[key_name(user)] injected [key_name(M)] with the [name]"
for(var/datum/mutation/human/HM in remove_mutations)
HM.force_lose(M)
for(var/datum/mutation/human/HM in add_mutations)
if(HM.name == RACEMUT)
message_admins("[ADMIN_LOOKUPFLW(user)] injected [key_name_admin(M)] with the [name] <span class='danger'>(MONKEY)</span>")
log_msg += " (MONKEY)"
HM.force_give(M)
if(fields)
if(fields["name"] && fields["UE"] && fields["blood_type"])
M.real_name = fields["name"]
M.dna.unique_enzymes = fields["UE"]
M.name = M.real_name
M.dna.blood_type = fields["blood_type"]
if(fields["UI"]) //UI+UE
M.dna.uni_identity = merge_text(M.dna.uni_identity, fields["UI"])
M.updateappearance(mutations_overlay_update=1)
log_attack("[log_msg] [loc_name(user)]")
return TRUE
return FALSE
/obj/item/dnainjector/attack(mob/target, mob/user)
if(!user.IsAdvancedToolUser())
to_chat(user, "<span class='warning'>You don't have the dexterity to do this!</span>")
return
if(used)
to_chat(user, "<span class='warning'>This injector is used up!</span>")
return
if(ishuman(target))
var/mob/living/carbon/human/humantarget = target
if (!humantarget.can_inject(user, 1))
return
log_combat(user, target, "attempted to inject", src)
if(target != user)
target.visible_message("<span class='danger'>[user] is trying to inject [target] with [src]!</span>", "<span class='userdanger'>[user] is trying to inject [target] with [src]!</span>")
if(!do_mob(user, target) || used)
return
target.visible_message("<span class='danger'>[user] injects [target] with the syringe with [src]!", \
"<span class='userdanger'>[user] injects [target] with the syringe with [src]!</span>")
else
to_chat(user, "<span class='notice'>You inject yourself with [src].</span>")
log_combat(user, target, "injected", src)
if(!inject(target, user)) //Now we actually do the heavy lifting.
to_chat(user, "<span class='notice'>It appears that [target] does not have compatible DNA.</span>")
used = 1
icon_state = "dnainjector0"
desc += " This one is used up."
/obj/item/dnainjector/antihulk
name = "\improper DNA injector (Anti-Hulk)"
desc = "Cures green skin."
remove_mutations_static = list(HULK)
/obj/item/dnainjector/hulkmut
name = "\improper DNA injector (Hulk)"
desc = "This will make you big and strong, but give you a bad skin condition."
add_mutations_static = list(HULK)
/obj/item/dnainjector/xraymut
name = "\improper DNA injector (X-ray)"
desc = "Finally you can see what the Captain does."
add_mutations_static = list(XRAY)
/obj/item/dnainjector/antixray
name = "\improper DNA injector (Anti-X-ray)"
desc = "It will make you see harder."
remove_mutations_static = list(XRAY)
/////////////////////////////////////
/obj/item/dnainjector/antiglasses
name = "\improper DNA injector (Anti-Glasses)"
desc = "Toss away those glasses!"
remove_mutations_static = list(BADSIGHT)
/obj/item/dnainjector/glassesmut
name = "\improper DNA injector (Glasses)"
desc = "Will make you need dorkish glasses."
add_mutations_static = list(BADSIGHT)
/obj/item/dnainjector/epimut
name = "\improper DNA injector (Epi.)"
desc = "Shake shake shake the room!"
add_mutations_static = list(EPILEPSY)
/obj/item/dnainjector/antiepi
name = "\improper DNA injector (Anti-Epi.)"
desc = "Will fix you up from shaking the room."
remove_mutations_static = list(EPILEPSY)
////////////////////////////////////
/obj/item/dnainjector/anticough
name = "\improper DNA injector (Anti-Cough)"
desc = "Will stop that awful noise."
remove_mutations_static = list(COUGH)
/obj/item/dnainjector/coughmut
name = "\improper DNA injector (Cough)"
desc = "Will bring forth a sound of horror from your throat."
add_mutations_static = list(COUGH)
/obj/item/dnainjector/antidwarf
name = "\improper DNA injector (Anti-Dwarfism)"
desc = "Helps you grow big and strong."
remove_mutations_static = list(DWARFISM)
/obj/item/dnainjector/dwarf
name = "\improper DNA injector (Dwarfism)"
desc = "It's a small world after all."
add_mutations_static = list(DWARFISM)
/obj/item/dnainjector/clumsymut
name = "\improper DNA injector (Clumsy)"
desc = "Makes clown minions."
add_mutations_static = list(CLOWNMUT)
/obj/item/dnainjector/anticlumsy
name = "\improper DNA injector (Anti-Clumsy)"
desc = "Apply this for Security Clown."
remove_mutations_static = list(CLOWNMUT)
/obj/item/dnainjector/antitour
name = "\improper DNA injector (Anti-Tour.)"
desc = "Will cure Tourette's."
remove_mutations_static = list(TOURETTES)
/obj/item/dnainjector/tourmut
name = "\improper DNA injector (Tour.)"
desc = "Gives you a nasty case of Tourette's."
add_mutations_static = list(TOURETTES)
/obj/item/dnainjector/stuttmut
name = "\improper DNA injector (Stutt.)"
desc = "Makes you s-s-stuttterrr."
add_mutations_static = list(NERVOUS)
/obj/item/dnainjector/antistutt
name = "\improper DNA injector (Anti-Stutt.)"
desc = "Fixes that speaking impairment."
remove_mutations_static = list(NERVOUS)
/obj/item/dnainjector/antifire
name = "\improper DNA injector (Anti-Fire)"
desc = "Cures fire."
remove_mutations_static = list(COLDRES)
/obj/item/dnainjector/firemut
name = "\improper DNA injector (Fire)"
desc = "Gives you fire."
add_mutations_static = list(COLDRES)
/obj/item/dnainjector/blindmut
name = "\improper DNA injector (Blind)"
desc = "Makes you not see anything."
add_mutations_static = list(BLINDMUT)
/obj/item/dnainjector/antiblind
name = "\improper DNA injector (Anti-Blind)"
desc = "IT'S A MIRACLE!!!"
remove_mutations_static = list(BLINDMUT)
/obj/item/dnainjector/antitele
name = "\improper DNA injector (Anti-Tele.)"
desc = "Will make you not able to control your mind."
remove_mutations_static = list(TK)
/obj/item/dnainjector/telemut
name = "\improper DNA injector (Tele.)"
desc = "Super brain man!"
add_mutations_static = list(TK)
/obj/item/dnainjector/telemut/darkbundle
name = "\improper DNA injector"
desc = "Good. Let the hate flow through you."
/obj/item/dnainjector/deafmut
name = "\improper DNA injector (Deaf)"
desc = "Sorry, what did you say?"
add_mutations_static = list(DEAFMUT)
/obj/item/dnainjector/antideaf
name = "\improper DNA injector (Anti-Deaf)"
desc = "Will make you hear once more."
remove_mutations_static = list(DEAFMUT)
/obj/item/dnainjector/h2m
name = "\improper DNA injector (Human > Monkey)"
desc = "Will make you a flea bag."
add_mutations_static = list(RACEMUT)
/obj/item/dnainjector/m2h
name = "\improper DNA injector (Monkey > Human)"
desc = "Will make you...less hairy."
remove_mutations_static = list(RACEMUT)
/obj/item/dnainjector/antichameleon
name = "\improper DNA injector (Anti-Chameleon)"
remove_mutations_static = list(CHAMELEON)
/obj/item/dnainjector/chameleonmut
name = "\improper DNA injector (Chameleon)"
add_mutations_static = list(CHAMELEON)
/obj/item/dnainjector/antiwacky
name = "\improper DNA injector (Anti-Wacky)"
remove_mutations_static = list(WACKY)
/obj/item/dnainjector/wackymut
name = "\improper DNA injector (Wacky)"
add_mutations_static = list(WACKY)
/obj/item/dnainjector/antimute
name = "\improper DNA injector (Anti-Mute)"
remove_mutations_static = list(MUT_MUTE)
/obj/item/dnainjector/mutemut
name = "\improper DNA injector (Mute)"
add_mutations_static = list(MUT_MUTE)
/obj/item/dnainjector/antismile
name = "\improper DNA injector (Anti-Smile)"
remove_mutations_static = list(SMILE)
/obj/item/dnainjector/smilemut
name = "\improper DNA injector (Smile)"
add_mutations_static = list(SMILE)
/obj/item/dnainjector/unintelligiblemut
name = "\improper DNA injector (Unintelligible)"
add_mutations_static = list(UNINTELLIGIBLE)
/obj/item/dnainjector/antiunintelligible
name = "\improper DNA injector (Anti-Unintelligible)"
remove_mutations_static = list(UNINTELLIGIBLE)
/obj/item/dnainjector/swedishmut
name = "\improper DNA injector (Swedish)"
add_mutations_static = list(SWEDISH)
/obj/item/dnainjector/antiswedish
name = "\improper DNA injector (Anti-Swedish)"
remove_mutations_static = list(SWEDISH)
/obj/item/dnainjector/chavmut
name = "\improper DNA injector (Chav)"
add_mutations_static = list(CHAV)
/obj/item/dnainjector/antichav
name = "\improper DNA injector (Anti-Chav)"
remove_mutations_static = list(CHAV)
/obj/item/dnainjector/elvismut
name = "\improper DNA injector (Elvis)"
add_mutations_static = list(ELVIS)
/obj/item/dnainjector/antielvis
name = "\improper DNA injector (Anti-Elvis)"
remove_mutations_static = list(ELVIS)
/obj/item/dnainjector/lasereyesmut
name = "\improper DNA injector (Laser Eyes)"
add_mutations_static = list(LASEREYES)
/obj/item/dnainjector/antilasereyes
name = "\improper DNA injector (Anti-Laser Eyes)"
remove_mutations_static = list(LASEREYES)
/obj/item/dnainjector/timed
var/duration = 600
/obj/item/dnainjector/timed/inject(mob/living/carbon/M, mob/user)
prepare()
if(M.stat == DEAD) //prevents dead people from having their DNA changed
to_chat(user, "<span class='notice'>You can't modify [M]'s DNA while [M.p_theyre()] dead.</span>")
return FALSE
if(M.has_dna() && !(HAS_TRAIT(M, TRAIT_NOCLONE)))
M.radiation += rand(20/(damage_coeff ** 2),50/(damage_coeff ** 2))
var/log_msg = "[key_name(user)] injected [key_name(M)] with the [name]"
var/endtime = world.time+duration
for(var/datum/mutation/human/HM in remove_mutations)
if(HM.name == RACEMUT)
if(ishuman(M))
continue
M = HM.force_lose(M)
else
HM.force_lose(M)
for(var/datum/mutation/human/HM in add_mutations)
if((HM in M.dna.mutations) && !(M.dna.temporary_mutations[HM.name]))
continue //Skip permanent mutations we already have.
if(HM.name == RACEMUT && ishuman(M))
message_admins("[ADMIN_LOOKUPFLW(user)] injected [key_name_admin(M)] with the [name] <span class='danger'>(MONKEY)</span>")
log_msg += " (MONKEY)"
M = HM.force_give(M)
else
HM.force_give(M)
M.dna.temporary_mutations[HM.name] = endtime
if(fields)
if(fields["name"] && fields["UE"] && fields["blood_type"])
if(!M.dna.previous["name"])
M.dna.previous["name"] = M.real_name
if(!M.dna.previous["UE"])
M.dna.previous["UE"] = M.dna.unique_enzymes
if(!M.dna.previous["blood_type"])
M.dna.previous["blood_type"] = M.dna.blood_type
M.real_name = fields["name"]
M.dna.unique_enzymes = fields["UE"]
M.name = M.real_name
M.dna.blood_type = fields["blood_type"]
M.dna.temporary_mutations[UE_CHANGED] = endtime
if(fields["UI"]) //UI+UE
if(!M.dna.previous["UI"])
M.dna.previous["UI"] = M.dna.uni_identity
M.dna.uni_identity = merge_text(M.dna.uni_identity, fields["UI"])
M.updateappearance(mutations_overlay_update=1)
M.dna.temporary_mutations[UI_CHANGED] = endtime
log_attack("[log_msg] [loc_name(user)]")
return TRUE
else
return FALSE
/obj/item/dnainjector/timed/hulk
name = "\improper DNA injector (Hulk)"
desc = "This will make you big and strong, but give you a bad skin condition."
add_mutations_static = list(HULK)
/obj/item/dnainjector/timed/h2m
name = "\improper DNA injector (Human > Monkey)"
desc = "Will make you a flea bag."
add_mutations_static = list(RACEMUT)
+257 -257
View File
@@ -1,257 +1,257 @@
/obj/item/extinguisher
name = "fire extinguisher"
desc = "A traditional red fire extinguisher."
icon = 'icons/obj/items_and_weapons.dmi'
icon_state = "fire_extinguisher0"
item_state = "fire_extinguisher"
hitsound = 'sound/weapons/smash.ogg'
flags_1 = CONDUCT_1
throwforce = 10
w_class = WEIGHT_CLASS_NORMAL
throw_speed = 2
throw_range = 7
force = 10
materials = list(MAT_METAL = 90)
attack_verb = list("slammed", "whacked", "bashed", "thunked", "battered", "bludgeoned", "thrashed")
dog_fashion = /datum/dog_fashion/back
resistance_flags = FIRE_PROOF
var/max_water = 50
var/last_use = 1
var/chem = /datum/reagent/water
var/safety = TRUE
var/refilling = FALSE
var/tanktype = /obj/structure/reagent_dispensers/watertank
var/sprite_name = "fire_extinguisher"
var/power = 5 //Maximum distance launched water will travel
var/precision = FALSE //By default, turfs picked from a spray are random, set to 1 to make it always have at least one water effect per row
var/cooling_power = 2 //Sets the cooling_temperature of the water reagent datum inside of the extinguisher when it is refilled
/obj/item/extinguisher/mini
name = "pocket fire extinguisher"
desc = "A light and compact fibreglass-framed model fire extinguisher."
icon_state = "miniFE0"
item_state = "miniFE"
hitsound = null //it is much lighter, after all.
flags_1 = null //doesn't CONDUCT_1
throwforce = 2
w_class = WEIGHT_CLASS_SMALL
force = 3
materials = list(MAT_METAL = 50, MAT_GLASS = 40)
max_water = 30
sprite_name = "miniFE"
dog_fashion = null
/obj/item/extinguisher/mini/family
name = "pocket fire extinguisher"
desc = "A old fashen pocket fire extinguisher that has been modified with a larger water tank, and a small high-power sprayer. It feels cool to the touch and has a small humming to it..."
icon_state = "miniFE0"
item_state = "miniFE"
throwforce = 1
w_class = WEIGHT_CLASS_SMALL
force = 2
max_water = 40
power = 7
cooling_power = 3
/obj/item/extinguisher/Initialize()
. = ..()
create_reagents(max_water, AMOUNT_VISIBLE)
reagents.add_reagent(chem, max_water)
/obj/item/extinguisher/advanced
name = "advanced fire extinguisher"
desc = "Used to stop thermonuclear fires from spreading inside your engine."
icon_state = "foam_extinguisher0"
//item_state = "foam_extinguisher" needs sprite
dog_fashion = null
chem = "firefighting_foam"
tanktype = /obj/structure/reagent_dispensers/foamtank
sprite_name = "foam_extinguisher"
precision = TRUE
/obj/item/extinguisher/proc/refill()
create_reagents(max_water, AMOUNT_VISIBLE)
reagents.add_reagent(chem, max_water)
/obj/item/extinguisher/suicide_act(mob/living/carbon/user)
if (!safety && (reagents.total_volume >= 1))
user.visible_message("<span class='suicide'>[user] puts the nozzle to [user.p_their()] mouth. It looks like [user.p_theyre()] trying to extinguish the spark of life!</span>")
afterattack(user,user)
return OXYLOSS
else if (safety && (reagents.total_volume >= 1))
user.visible_message("<span class='warning'>[user] puts the nozzle to [user.p_their()] mouth... The safety's still on!</span>")
return SHAME
else
user.visible_message("<span class='warning'>[user] puts the nozzle to [user.p_their()] mouth... [src] is empty!</span>")
return SHAME
/obj/item/extinguisher/attack_self(mob/user)
safety = !safety
src.icon_state = "[sprite_name][!safety]"
to_chat(user, "The safety is [safety ? "on" : "off"].")
return
/obj/item/extinguisher/attack(mob/M, mob/user)
if(user.a_intent == INTENT_HELP && !safety) //If we're on help intent and going to spray people, don't bash them.
return FALSE
else
return ..()
/obj/item/extinguisher/attack_obj(obj/O, mob/living/user)
if(AttemptRefill(O, user))
refilling = TRUE
return FALSE
else
return ..()
/obj/item/extinguisher/examine(mob/user)
. = ..()
. += "The safety is [safety ? "on" : "off"]."
if(reagents.total_volume)
. += "<span class='notice'>You can loose its <b>screws</b> to empty it.</span>"
/obj/item/extinguisher/proc/AttemptRefill(atom/target, mob/user)
if(istype(target, tanktype) && target.Adjacent(user))
var/safety_save = safety
safety = TRUE
if(reagents.total_volume == reagents.maximum_volume)
to_chat(user, "<span class='warning'>\The [src] is already full!</span>")
safety = safety_save
return 1
var/obj/structure/reagent_dispensers/W = target //will it work?
var/transferred = W.reagents.trans_to(src, max_water)
if(transferred > 0)
to_chat(user, "<span class='notice'>\The [src] has been refilled by [transferred] units.</span>")
playsound(src.loc, 'sound/effects/refill.ogg', 50, 1, -6)
for(var/datum/reagent/water/R in reagents.reagent_list)
R.cooling_temperature = cooling_power
else
to_chat(user, "<span class='warning'>\The [W] is empty!</span>")
safety = safety_save
return 1
else
return 0
/obj/item/extinguisher/afterattack(atom/target, mob/user , flag)
. = ..()
// Make it so the extinguisher doesn't spray yourself when you click your inventory items
if (target.loc == user)
return
//TODO; Add support for reagents in water.
if(refilling)
refilling = FALSE
return
if (!safety)
if (src.reagents.total_volume < 1)
to_chat(usr, "<span class='warning'>\The [src] is empty!</span>")
return
if (world.time < src.last_use + 12)
return
src.last_use = world.time
playsound(src.loc, 'sound/effects/extinguish.ogg', 75, 1, -3)
var/direction = get_dir(src,target)
if(user.buckled && isobj(user.buckled) && !user.buckled.anchored)
var/obj/B = user.buckled
var/movementdirection = turn(direction,180)
addtimer(CALLBACK(src, /obj/item/extinguisher/proc/move_chair, B, movementdirection), 1)
else user.newtonian_move(turn(direction, 180))
//Get all the turfs that can be shot at
var/turf/T = get_turf(target)
var/turf/T1 = get_step(T,turn(direction, 90))
var/turf/T2 = get_step(T,turn(direction, -90))
var/list/the_targets = list(T,T1,T2)
if(precision)
var/turf/T3 = get_step(T1, turn(direction, 90))
var/turf/T4 = get_step(T2,turn(direction, -90))
the_targets.Add(T3,T4)
var/list/water_particles=list()
for(var/a=0, a<5, a++)
var/obj/effect/particle_effect/water/W = new /obj/effect/particle_effect/water(get_turf(src))
var/my_target = pick(the_targets)
water_particles[W] = my_target
// If precise, remove turf from targets so it won't be picked more than once
if(precision)
the_targets -= my_target
var/datum/reagents/R = new/datum/reagents(5)
W.reagents = R
R.my_atom = W
reagents.trans_to(W,1)
//Make em move dat ass, hun
addtimer(CALLBACK(src, /obj/item/extinguisher/proc/move_particles, water_particles), 2)
//Particle movement loop
/obj/item/extinguisher/proc/move_particles(var/list/particles, var/repetition=0)
//Check if there's anything in here first
if(!particles || particles.len == 0)
return
// Second loop: Get all the water particles and make them move to their target
for(var/obj/effect/particle_effect/water/W in particles)
var/turf/my_target = particles[W]
if(!W)
continue
step_towards(W,my_target)
if(!W.reagents)
continue
W.reagents.reaction(get_turf(W))
for(var/A in get_turf(W))
W.reagents.reaction(A)
if(W.loc == my_target)
break
if(repetition < power)
repetition++
addtimer(CALLBACK(src, /obj/item/extinguisher/proc/move_particles, particles, repetition), 2)
//Chair movement loop
/obj/item/extinguisher/proc/move_chair(var/obj/B, var/movementdirection, var/repetition=0)
step(B, movementdirection)
var/timer_seconds
switch(repetition)
if(0 to 2)
timer_seconds = 1
if(3 to 4)
timer_seconds = 2
if(5 to 8)
timer_seconds = 3
else
return
repetition++
addtimer(CALLBACK(src, /obj/item/extinguisher/proc/move_chair, B, movementdirection, repetition), timer_seconds)
/obj/item/extinguisher/screwdriver_act(mob/user, obj/item/tool)
if(!user.canUseTopic(src, BE_CLOSE, ismonkey(user)))
return
EmptyExtinguisher(user)
/obj/item/extinguisher/proc/EmptyExtinguisher(var/mob/user)
if(loc == user && reagents.total_volume)
reagents.clear_reagents()
var/turf/T = get_turf(loc)
if(isopenturf(T))
var/turf/open/theturf = T
theturf.MakeSlippery(TURF_WET_WATER, min_wet_time = 10 SECONDS, wet_time_to_add = 5 SECONDS)
user.visible_message("[user] empties out \the [src] onto the floor using the release valve.", "<span class='info'>You quietly empty out \the [src] by loosing the release valve's screws.</span>")
//firebot assembly
/obj/item/extinguisher/attackby(obj/O, mob/user, params)
if(istype(O, /obj/item/bodypart/l_arm/robot) || istype(O, /obj/item/bodypart/r_arm/robot))
to_chat(user, "<span class='notice'>You add [O] to [src].</span>")
qdel(O)
qdel(src)
user.put_in_hands(new /obj/item/bot_assembly/firebot)
else
..()
/obj/item/extinguisher
name = "fire extinguisher"
desc = "A traditional red fire extinguisher."
icon = 'icons/obj/items_and_weapons.dmi'
icon_state = "fire_extinguisher0"
item_state = "fire_extinguisher"
hitsound = 'sound/weapons/smash.ogg'
flags_1 = CONDUCT_1
throwforce = 10
w_class = WEIGHT_CLASS_NORMAL
throw_speed = 2
throw_range = 7
force = 10
materials = list(MAT_METAL = 90)
attack_verb = list("slammed", "whacked", "bashed", "thunked", "battered", "bludgeoned", "thrashed")
dog_fashion = /datum/dog_fashion/back
resistance_flags = FIRE_PROOF
var/max_water = 50
var/last_use = 1
var/chem = /datum/reagent/water
var/safety = TRUE
var/refilling = FALSE
var/tanktype = /obj/structure/reagent_dispensers/watertank
var/sprite_name = "fire_extinguisher"
var/power = 5 //Maximum distance launched water will travel
var/precision = FALSE //By default, turfs picked from a spray are random, set to 1 to make it always have at least one water effect per row
var/cooling_power = 2 //Sets the cooling_temperature of the water reagent datum inside of the extinguisher when it is refilled
/obj/item/extinguisher/mini
name = "pocket fire extinguisher"
desc = "A light and compact fibreglass-framed model fire extinguisher."
icon_state = "miniFE0"
item_state = "miniFE"
hitsound = null //it is much lighter, after all.
flags_1 = null //doesn't CONDUCT_1
throwforce = 2
w_class = WEIGHT_CLASS_SMALL
force = 3
materials = list(MAT_METAL = 50, MAT_GLASS = 40)
max_water = 30
sprite_name = "miniFE"
dog_fashion = null
/obj/item/extinguisher/mini/family
name = "pocket fire extinguisher"
desc = "A old fashen pocket fire extinguisher that has been modified with a larger water tank, and a small high-power sprayer. It feels cool to the touch and has a small humming to it..."
icon_state = "miniFE0"
item_state = "miniFE"
throwforce = 1
w_class = WEIGHT_CLASS_SMALL
force = 2
max_water = 40
power = 7
cooling_power = 3
/obj/item/extinguisher/Initialize()
. = ..()
create_reagents(max_water, AMOUNT_VISIBLE)
reagents.add_reagent(chem, max_water)
/obj/item/extinguisher/advanced
name = "advanced fire extinguisher"
desc = "Used to stop thermonuclear fires from spreading inside your engine."
icon_state = "foam_extinguisher0"
//item_state = "foam_extinguisher" needs sprite
dog_fashion = null
chem = /datum/reagent/firefighting_foam
tanktype = /obj/structure/reagent_dispensers/foamtank
sprite_name = "foam_extinguisher"
precision = TRUE
/obj/item/extinguisher/proc/refill()
create_reagents(max_water, AMOUNT_VISIBLE)
reagents.add_reagent(chem, max_water)
/obj/item/extinguisher/suicide_act(mob/living/carbon/user)
if (!safety && (reagents.total_volume >= 1))
user.visible_message("<span class='suicide'>[user] puts the nozzle to [user.p_their()] mouth. It looks like [user.p_theyre()] trying to extinguish the spark of life!</span>")
afterattack(user,user)
return OXYLOSS
else if (safety && (reagents.total_volume >= 1))
user.visible_message("<span class='warning'>[user] puts the nozzle to [user.p_their()] mouth... The safety's still on!</span>")
return SHAME
else
user.visible_message("<span class='warning'>[user] puts the nozzle to [user.p_their()] mouth... [src] is empty!</span>")
return SHAME
/obj/item/extinguisher/attack_self(mob/user)
safety = !safety
src.icon_state = "[sprite_name][!safety]"
to_chat(user, "The safety is [safety ? "on" : "off"].")
return
/obj/item/extinguisher/attack(mob/M, mob/user)
if(user.a_intent == INTENT_HELP && !safety) //If we're on help intent and going to spray people, don't bash them.
return FALSE
else
return ..()
/obj/item/extinguisher/attack_obj(obj/O, mob/living/user)
if(AttemptRefill(O, user))
refilling = TRUE
return FALSE
else
return ..()
/obj/item/extinguisher/examine(mob/user)
. = ..()
. += "The safety is [safety ? "on" : "off"]."
if(reagents.total_volume)
. += "<span class='notice'>You can loose its <b>screws</b> to empty it.</span>"
/obj/item/extinguisher/proc/AttemptRefill(atom/target, mob/user)
if(istype(target, tanktype) && target.Adjacent(user))
var/safety_save = safety
safety = TRUE
if(reagents.total_volume == reagents.maximum_volume)
to_chat(user, "<span class='warning'>\The [src] is already full!</span>")
safety = safety_save
return 1
var/obj/structure/reagent_dispensers/W = target //will it work?
var/transferred = W.reagents.trans_to(src, max_water)
if(transferred > 0)
to_chat(user, "<span class='notice'>\The [src] has been refilled by [transferred] units.</span>")
playsound(src.loc, 'sound/effects/refill.ogg', 50, 1, -6)
for(var/datum/reagent/water/R in reagents.reagent_list)
R.cooling_temperature = cooling_power
else
to_chat(user, "<span class='warning'>\The [W] is empty!</span>")
safety = safety_save
return 1
else
return 0
/obj/item/extinguisher/afterattack(atom/target, mob/user , flag)
. = ..()
// Make it so the extinguisher doesn't spray yourself when you click your inventory items
if (target.loc == user)
return
//TODO; Add support for reagents in water.
if(refilling)
refilling = FALSE
return
if (!safety)
if (src.reagents.total_volume < 1)
to_chat(usr, "<span class='warning'>\The [src] is empty!</span>")
return
if (world.time < src.last_use + 12)
return
src.last_use = world.time
playsound(src.loc, 'sound/effects/extinguish.ogg', 75, 1, -3)
var/direction = get_dir(src,target)
if(user.buckled && isobj(user.buckled) && !user.buckled.anchored)
var/obj/B = user.buckled
var/movementdirection = turn(direction,180)
addtimer(CALLBACK(src, /obj/item/extinguisher/proc/move_chair, B, movementdirection), 1)
else user.newtonian_move(turn(direction, 180))
//Get all the turfs that can be shot at
var/turf/T = get_turf(target)
var/turf/T1 = get_step(T,turn(direction, 90))
var/turf/T2 = get_step(T,turn(direction, -90))
var/list/the_targets = list(T,T1,T2)
if(precision)
var/turf/T3 = get_step(T1, turn(direction, 90))
var/turf/T4 = get_step(T2,turn(direction, -90))
the_targets.Add(T3,T4)
var/list/water_particles=list()
for(var/a=0, a<5, a++)
var/obj/effect/particle_effect/water/W = new /obj/effect/particle_effect/water(get_turf(src))
var/my_target = pick(the_targets)
water_particles[W] = my_target
// If precise, remove turf from targets so it won't be picked more than once
if(precision)
the_targets -= my_target
var/datum/reagents/R = new/datum/reagents(5)
W.reagents = R
R.my_atom = W
reagents.trans_to(W,1)
//Make em move dat ass, hun
addtimer(CALLBACK(src, /obj/item/extinguisher/proc/move_particles, water_particles), 2)
//Particle movement loop
/obj/item/extinguisher/proc/move_particles(var/list/particles, var/repetition=0)
//Check if there's anything in here first
if(!particles || particles.len == 0)
return
// Second loop: Get all the water particles and make them move to their target
for(var/obj/effect/particle_effect/water/W in particles)
var/turf/my_target = particles[W]
if(!W)
continue
step_towards(W,my_target)
if(!W.reagents)
continue
W.reagents.reaction(get_turf(W))
for(var/A in get_turf(W))
W.reagents.reaction(A)
if(W.loc == my_target)
break
if(repetition < power)
repetition++
addtimer(CALLBACK(src, /obj/item/extinguisher/proc/move_particles, particles, repetition), 2)
//Chair movement loop
/obj/item/extinguisher/proc/move_chair(var/obj/B, var/movementdirection, var/repetition=0)
step(B, movementdirection)
var/timer_seconds
switch(repetition)
if(0 to 2)
timer_seconds = 1
if(3 to 4)
timer_seconds = 2
if(5 to 8)
timer_seconds = 3
else
return
repetition++
addtimer(CALLBACK(src, /obj/item/extinguisher/proc/move_chair, B, movementdirection, repetition), timer_seconds)
/obj/item/extinguisher/screwdriver_act(mob/user, obj/item/tool)
if(!user.canUseTopic(src, BE_CLOSE, ismonkey(user)))
return
EmptyExtinguisher(user)
/obj/item/extinguisher/proc/EmptyExtinguisher(var/mob/user)
if(loc == user && reagents.total_volume)
reagents.clear_reagents()
var/turf/T = get_turf(loc)
if(isopenturf(T))
var/turf/open/theturf = T
theturf.MakeSlippery(TURF_WET_WATER, min_wet_time = 10 SECONDS, wet_time_to_add = 5 SECONDS)
user.visible_message("[user] empties out \the [src] onto the floor using the release valve.", "<span class='info'>You quietly empty out \the [src] by loosing the release valve's screws.</span>")
//firebot assembly
/obj/item/extinguisher/attackby(obj/O, mob/user, params)
if(istype(O, /obj/item/bodypart/l_arm/robot) || istype(O, /obj/item/bodypart/r_arm/robot))
to_chat(user, "<span class='notice'>You add [O] to [src].</span>")
qdel(O)
qdel(src)
user.put_in_hands(new /obj/item/bot_assembly/firebot)
else
..()
File diff suppressed because it is too large Load Diff
+44 -44
View File
@@ -1,44 +1,44 @@
/obj/item/grenade/flashbang
name = "flashbang"
icon_state = "flashbang"
item_state = "flashbang"
lefthand_file = 'icons/mob/inhands/equipment/security_lefthand.dmi'
righthand_file = 'icons/mob/inhands/equipment/security_righthand.dmi'
var/flashbang_range = 7 //how many tiles away the mob will be stunned.
/obj/item/grenade/flashbang/prime()
update_mob()
var/flashbang_turf = get_turf(src)
if(!flashbang_turf)
return
do_sparks(rand(5, 9), FALSE, src)
playsound(flashbang_turf, 'sound/weapons/flashbang.ogg', 100, TRUE, 8, 0.9)
new /obj/effect/dummy/lighting_obj (flashbang_turf, LIGHT_COLOR_WHITE, (flashbang_range + 2), 4, 2)
flashbang_mobs(flashbang_turf, flashbang_range)
qdel(src)
/obj/item/grenade/flashbang/proc/flashbang_mobs(turf/source, range)
var/list/banged = get_hearers_in_view(range, source)
var/list/flashed = viewers(range, source)
for(var/mob/living/l in banged)
bang(l, source)
for(var/mob/living/l in flashed)
flash(l, source)
/obj/item/grenade/flashbang/proc/bang(mob/living/M, turf/source)
if(M.stat == DEAD) //They're dead!
return
M.show_message("<span class='warning'>BANG</span>", MSG_AUDIBLE)
var/distance = get_dist(get_turf(M), source)
if(!distance || loc == M || loc == M.loc) //Stop allahu akbarring rooms with this.
M.Knockdown(200)
M.soundbang_act(1, 200, 10, 15)
else
M.soundbang_act(1, max(200/max(1,distance), 60), rand(0, 5))
/obj/item/grenade/flashbang/proc/flash(mob/living/M, turf/source)
if(M.stat == DEAD) //They're dead!
return
var/distance = get_dist(get_turf(M), source)
if(M.flash_act(affect_silicon = 1))
M.Knockdown(max(200/max(1,distance), 60))
/obj/item/grenade/flashbang
name = "flashbang"
icon_state = "flashbang"
item_state = "flashbang"
lefthand_file = 'icons/mob/inhands/equipment/security_lefthand.dmi'
righthand_file = 'icons/mob/inhands/equipment/security_righthand.dmi'
var/flashbang_range = 7 //how many tiles away the mob will be stunned.
/obj/item/grenade/flashbang/prime()
update_mob()
var/flashbang_turf = get_turf(src)
if(!flashbang_turf)
return
do_sparks(rand(5, 9), FALSE, src)
playsound(flashbang_turf, 'sound/weapons/flashbang.ogg', 100, TRUE, 8, 0.9)
new /obj/effect/dummy/lighting_obj (flashbang_turf, LIGHT_COLOR_WHITE, (flashbang_range + 2), 4, 2)
flashbang_mobs(flashbang_turf, flashbang_range)
qdel(src)
/obj/item/grenade/flashbang/proc/flashbang_mobs(turf/source, range)
var/list/banged = get_hearers_in_view(range, source)
var/list/flashed = viewers(range, source)
for(var/mob/living/l in banged)
bang(l, source)
for(var/mob/living/l in flashed)
flash(l, source)
/obj/item/grenade/flashbang/proc/bang(mob/living/M, turf/source)
if(M.stat == DEAD) //They're dead!
return
M.show_message("<span class='warning'>BANG</span>", MSG_AUDIBLE)
var/distance = get_dist(get_turf(M), source)
if(!distance || loc == M || loc == M.loc) //Stop allahu akbarring rooms with this.
M.Knockdown(200)
M.soundbang_act(1, 200, 10, 15)
else
M.soundbang_act(1, max(200/max(1,distance), 60), rand(0, 5))
/obj/item/grenade/flashbang/proc/flash(mob/living/M, turf/source)
if(M.stat == DEAD) //They're dead!
return
var/distance = get_dist(get_turf(M), source)
if(M.flash_act(affect_silicon = 1))
M.Knockdown(max(200/max(1,distance), 60))
+60 -60
View File
@@ -1,60 +1,60 @@
//improvised explosives//
/obj/item/grenade/iedcasing
name = "improvised firebomb"
desc = "A weak, improvised incendiary device."
w_class = WEIGHT_CLASS_SMALL
icon = 'icons/obj/grenade.dmi'
icon_state = "improvised_grenade"
item_state = "flashbang"
lefthand_file = 'icons/mob/inhands/equipment/security_lefthand.dmi'
righthand_file = 'icons/mob/inhands/equipment/security_righthand.dmi'
throw_speed = 3
throw_range = 7
flags_1 = CONDUCT_1
slot_flags = ITEM_SLOT_BELT
active = 0
det_time = 50
display_timer = 0
var/range = 3
var/list/times
/obj/item/grenade/iedcasing/Initialize()
. = ..()
add_overlay("improvised_grenade_filled")
add_overlay("improvised_grenade_wired")
times = list("5" = 10, "-1" = 20, "[rand(30,80)]" = 50, "[rand(65,180)]" = 20)// "Premature, Dud, Short Fuse, Long Fuse"=[weighting value]
det_time = text2num(pickweight(times))
if(det_time < 0) //checking for 'duds'
range = 1
det_time = rand(30,80)
else
range = pick(2,2,2,3,3,3,4)
/obj/item/grenade/iedcasing/CheckParts(list/parts_list)
..()
var/obj/item/reagent_containers/food/drinks/soda_cans/can = locate() in contents
if(can)
can.pixel_x = 0 //Reset the sprite's position to make it consistent with the rest of the IED
can.pixel_y = 0
var/mutable_appearance/can_underlay = new(can)
can_underlay.layer = FLOAT_LAYER
can_underlay.plane = FLOAT_PLANE
underlays += can_underlay
/obj/item/grenade/iedcasing/attack_self(mob/user) //
if(!active)
if(clown_check(user))
to_chat(user, "<span class='warning'>You light the [name]!</span>")
cut_overlay("improvised_grenade_filled")
preprime(user, null, FALSE)
/obj/item/grenade/iedcasing/prime() //Blowing that can up
update_mob()
explosion(src.loc,-1,-1,2, flame_range = 4) // small explosion, plus a very large fireball.
qdel(src)
/obj/item/grenade/iedcasing/examine(mob/user)
. = ..()
. += "You can't tell when it will explode!"
//improvised explosives//
/obj/item/grenade/iedcasing
name = "improvised firebomb"
desc = "A weak, improvised incendiary device."
w_class = WEIGHT_CLASS_SMALL
icon = 'icons/obj/grenade.dmi'
icon_state = "improvised_grenade"
item_state = "flashbang"
lefthand_file = 'icons/mob/inhands/equipment/security_lefthand.dmi'
righthand_file = 'icons/mob/inhands/equipment/security_righthand.dmi'
throw_speed = 3
throw_range = 7
flags_1 = CONDUCT_1
slot_flags = ITEM_SLOT_BELT
active = 0
det_time = 50
display_timer = 0
var/range = 3
var/list/times
/obj/item/grenade/iedcasing/Initialize()
. = ..()
add_overlay("improvised_grenade_filled")
add_overlay("improvised_grenade_wired")
times = list("5" = 10, "-1" = 20, "[rand(30,80)]" = 50, "[rand(65,180)]" = 20)// "Premature, Dud, Short Fuse, Long Fuse"=[weighting value]
det_time = text2num(pickweight(times))
if(det_time < 0) //checking for 'duds'
range = 1
det_time = rand(30,80)
else
range = pick(2,2,2,3,3,3,4)
/obj/item/grenade/iedcasing/CheckParts(list/parts_list)
..()
var/obj/item/reagent_containers/food/drinks/soda_cans/can = locate() in contents
if(can)
can.pixel_x = 0 //Reset the sprite's position to make it consistent with the rest of the IED
can.pixel_y = 0
var/mutable_appearance/can_underlay = new(can)
can_underlay.layer = FLOAT_LAYER
can_underlay.plane = FLOAT_PLANE
underlays += can_underlay
/obj/item/grenade/iedcasing/attack_self(mob/user) //
if(!active)
if(clown_check(user))
to_chat(user, "<span class='warning'>You light the [name]!</span>")
cut_overlay("improvised_grenade_filled")
preprime(user, null, FALSE)
/obj/item/grenade/iedcasing/prime() //Blowing that can up
update_mob()
explosion(src.loc,-1,-1,2, flame_range = 4) // small explosion, plus a very large fireball.
qdel(src)
/obj/item/grenade/iedcasing/examine(mob/user)
. = ..()
. += "You can't tell when it will explode!"
+124 -124
View File
@@ -1,124 +1,124 @@
/obj/item/grenade
name = "grenade"
desc = "It has an adjustable timer."
w_class = WEIGHT_CLASS_SMALL
icon = 'icons/obj/grenade.dmi'
icon_state = "grenade"
item_state = "flashbang"
lefthand_file = 'icons/mob/inhands/equipment/security_lefthand.dmi'
righthand_file = 'icons/mob/inhands/equipment/security_righthand.dmi'
throw_speed = 3
throw_range = 7
flags_1 = CONDUCT_1
slot_flags = ITEM_SLOT_BELT
resistance_flags = FLAMMABLE
max_integrity = 40
var/active = 0
var/det_time = 50
var/display_timer = 1
var/clumsy_check = GRENADE_CLUMSY_FUMBLE
/obj/item/grenade/suicide_act(mob/living/carbon/user)
user.visible_message("<span class='suicide'>[user] primes [src], then eats it! It looks like [user.p_theyre()] trying to commit suicide!</span>")
playsound(src, 'sound/items/eatfood.ogg', 50, 1)
preprime(user, det_time)
user.transferItemToLoc(src, user, TRUE)//>eat a grenade set to 5 seconds >rush captain
sleep(det_time)//so you dont die instantly
return BRUTELOSS
/obj/item/grenade/deconstruct(disassembled = TRUE)
if(!disassembled)
prime()
if(!QDELETED(src))
qdel(src)
/obj/item/grenade/proc/clown_check(mob/living/carbon/human/user)
var/clumsy = HAS_TRAIT(user, TRAIT_CLUMSY)
if(clumsy && (clumsy_check == GRENADE_CLUMSY_FUMBLE))
if(prob(50))
to_chat(user, "<span class='warning'>Huh? How does this thing work?</span>")
preprime(user, 5, FALSE)
return FALSE
else if(!clumsy && (clumsy_check == GRENADE_NONCLUMSY_FUMBLE))
to_chat(user, "<span class='warning'>You pull the pin on [src]. Attached to it is a pink ribbon that says, \"<span class='clown'>HONK</span>\"</span>")
preprime(user, 5, FALSE)
return FALSE
return TRUE
/obj/item/grenade/examine(mob/user)
. = ..()
if(display_timer)
if(det_time > 1)
. += "The timer is set to [DisplayTimeText(det_time)]."
else
. += "\The [src] is set for instant detonation."
/obj/item/grenade/attack_self(mob/user)
if(!active)
if(clown_check(user))
preprime(user)
/obj/item/grenade/proc/log_grenade(mob/user, turf/T)
var/message = "[ADMIN_LOOKUPFLW(user)]) has primed \a [src] for detonation at [ADMIN_VERBOSEJMP(T)]"
GLOB.bombers += message
message_admins(message)
log_game("[key_name(user)] has primed \a [src] for detonation at [AREACOORD(T)].")
/obj/item/grenade/proc/preprime(mob/user, delayoverride, msg = TRUE, volume = 60)
var/turf/T = get_turf(src)
log_grenade(user, T) //Inbuilt admin procs already handle null users
if(user)
add_fingerprint(user)
if(iscarbon(user))
var/mob/living/carbon/C = user
C.throw_mode_on()
if(msg)
to_chat(user, "<span class='warning'>You prime [src]! [DisplayTimeText(det_time)]!</span>")
playsound(src, 'sound/weapons/armbomb.ogg', volume, 1)
active = TRUE
icon_state = initial(icon_state) + "_active"
addtimer(CALLBACK(src, .proc/prime), isnull(delayoverride)? det_time : delayoverride)
/obj/item/grenade/proc/prime()
var/turf/T = get_turf(src)
log_game("Grenade detonation at [AREACOORD(T)], location [loc]")
/obj/item/grenade/proc/update_mob()
if(ismob(loc))
var/mob/M = loc
M.dropItemToGround(src)
else if(isitem(loc))
var/obj/item/I = loc
I.grenade_prime_react(src)
/obj/item/grenade/attackby(obj/item/W, mob/user, params)
if(istype(W, /obj/item/screwdriver))
switch(det_time)
if ("1")
det_time = 10
to_chat(user, "<span class='notice'>You set the [name] for 1 second detonation time.</span>")
if ("10")
det_time = 30
to_chat(user, "<span class='notice'>You set the [name] for 3 second detonation time.</span>")
if ("30")
det_time = 50
to_chat(user, "<span class='notice'>You set the [name] for 5 second detonation time.</span>")
if ("50")
det_time = 1
to_chat(user, "<span class='notice'>You set the [name] for instant detonation.</span>")
add_fingerprint(user)
else
return ..()
/obj/item/grenade/attack_paw(mob/user)
return attack_hand(user)
/obj/item/grenade/hit_reaction(mob/living/carbon/human/owner, atom/movable/hitby, attack_text = "the attack", final_block_chance = 0, damage = 0, attack_type = MELEE_ATTACK)
var/obj/item/projectile/P = hitby
if(damage && attack_type == PROJECTILE_ATTACK && P.damage_type != STAMINA && prob(15))
owner.visible_message("<span class='danger'>[attack_text] hits [owner]'s [src], setting it off! What a shot!</span>")
prime()
return TRUE //It hit the grenade, not them
/obj/item/grenade
name = "grenade"
desc = "It has an adjustable timer."
w_class = WEIGHT_CLASS_SMALL
icon = 'icons/obj/grenade.dmi'
icon_state = "grenade"
item_state = "flashbang"
lefthand_file = 'icons/mob/inhands/equipment/security_lefthand.dmi'
righthand_file = 'icons/mob/inhands/equipment/security_righthand.dmi'
throw_speed = 3
throw_range = 7
flags_1 = CONDUCT_1
slot_flags = ITEM_SLOT_BELT
resistance_flags = FLAMMABLE
max_integrity = 40
var/active = 0
var/det_time = 50
var/display_timer = 1
var/clumsy_check = GRENADE_CLUMSY_FUMBLE
/obj/item/grenade/suicide_act(mob/living/carbon/user)
user.visible_message("<span class='suicide'>[user] primes [src], then eats it! It looks like [user.p_theyre()] trying to commit suicide!</span>")
playsound(src, 'sound/items/eatfood.ogg', 50, 1)
preprime(user, det_time)
user.transferItemToLoc(src, user, TRUE)//>eat a grenade set to 5 seconds >rush captain
sleep(det_time)//so you dont die instantly
return BRUTELOSS
/obj/item/grenade/deconstruct(disassembled = TRUE)
if(!disassembled)
prime()
if(!QDELETED(src))
qdel(src)
/obj/item/grenade/proc/clown_check(mob/living/carbon/human/user)
var/clumsy = HAS_TRAIT(user, TRAIT_CLUMSY)
if(clumsy && (clumsy_check == GRENADE_CLUMSY_FUMBLE))
if(prob(50))
to_chat(user, "<span class='warning'>Huh? How does this thing work?</span>")
preprime(user, 5, FALSE)
return FALSE
else if(!clumsy && (clumsy_check == GRENADE_NONCLUMSY_FUMBLE))
to_chat(user, "<span class='warning'>You pull the pin on [src]. Attached to it is a pink ribbon that says, \"<span class='clown'>HONK</span>\"</span>")
preprime(user, 5, FALSE)
return FALSE
return TRUE
/obj/item/grenade/examine(mob/user)
. = ..()
if(display_timer)
if(det_time > 1)
. += "The timer is set to [DisplayTimeText(det_time)]."
else
. += "\The [src] is set for instant detonation."
/obj/item/grenade/attack_self(mob/user)
if(!active)
if(clown_check(user))
preprime(user)
/obj/item/grenade/proc/log_grenade(mob/user, turf/T)
var/message = "[ADMIN_LOOKUPFLW(user)]) has primed \a [src] for detonation at [ADMIN_VERBOSEJMP(T)]"
GLOB.bombers += message
message_admins(message)
log_game("[key_name(user)] has primed \a [src] for detonation at [AREACOORD(T)].")
/obj/item/grenade/proc/preprime(mob/user, delayoverride, msg = TRUE, volume = 60)
var/turf/T = get_turf(src)
log_grenade(user, T) //Inbuilt admin procs already handle null users
if(user)
add_fingerprint(user)
if(iscarbon(user))
var/mob/living/carbon/C = user
C.throw_mode_on()
if(msg)
to_chat(user, "<span class='warning'>You prime [src]! [DisplayTimeText(det_time)]!</span>")
playsound(src, 'sound/weapons/armbomb.ogg', volume, 1)
active = TRUE
icon_state = initial(icon_state) + "_active"
addtimer(CALLBACK(src, .proc/prime), isnull(delayoverride)? det_time : delayoverride)
/obj/item/grenade/proc/prime()
var/turf/T = get_turf(src)
log_game("Grenade detonation at [AREACOORD(T)], location [loc]")
/obj/item/grenade/proc/update_mob()
if(ismob(loc))
var/mob/M = loc
M.dropItemToGround(src)
else if(isitem(loc))
var/obj/item/I = loc
I.grenade_prime_react(src)
/obj/item/grenade/attackby(obj/item/W, mob/user, params)
if(istype(W, /obj/item/screwdriver))
switch(det_time)
if ("1")
det_time = 10
to_chat(user, "<span class='notice'>You set the [name] for 1 second detonation time.</span>")
if ("10")
det_time = 30
to_chat(user, "<span class='notice'>You set the [name] for 3 second detonation time.</span>")
if ("30")
det_time = 50
to_chat(user, "<span class='notice'>You set the [name] for 5 second detonation time.</span>")
if ("50")
det_time = 1
to_chat(user, "<span class='notice'>You set the [name] for instant detonation.</span>")
add_fingerprint(user)
else
return ..()
/obj/item/grenade/attack_paw(mob/user)
return attack_hand(user)
/obj/item/grenade/hit_reaction(mob/living/carbon/human/owner, atom/movable/hitby, attack_text = "the attack", final_block_chance = 0, damage = 0, attack_type = MELEE_ATTACK)
var/obj/item/projectile/P = hitby
if(damage && attack_type == PROJECTILE_ATTACK && P.damage_type != STAMINA && prob(15))
owner.visible_message("<span class='danger'>[attack_text] hits [owner]'s [src], setting it off! What a shot!</span>")
prime()
return TRUE //It hit the grenade, not them
+1 -1
View File
@@ -62,7 +62,7 @@
location = get_turf(target)
target.cut_overlay(plastic_overlay, TRUE)
if(!ismob(target) || full_damage_on_mobs)
target.ex_act(2, target)
target.ex_act(EXPLODE_HEAVY, target)
else
location = get_turf(src)
if(location)
+31 -31
View File
@@ -1,31 +1,31 @@
/obj/item/grenade/smokebomb
name = "smoke grenade"
desc = "The word 'Dank' is scribbled on it in crayon."
icon = 'icons/obj/grenade.dmi'
icon_state = "smokewhite"
det_time = 20
item_state = "flashbang"
slot_flags = ITEM_SLOT_BELT
var/datum/effect_system/smoke_spread/bad/smoke
/obj/item/grenade/smokebomb/New()
..()
src.smoke = new /datum/effect_system/smoke_spread/bad
src.smoke.attach(src)
/obj/item/grenade/smokebomb/Destroy()
qdel(smoke)
return ..()
/obj/item/grenade/smokebomb/prime()
update_mob()
playsound(src.loc, 'sound/effects/smoke.ogg', 50, 1, -3)
smoke.set_up(4, src)
smoke.start()
for(var/obj/structure/blob/B in view(8,src))
var/damage = round(30/(get_dist(B,src)+1))
B.take_damage(damage, BURN, "melee", 0)
sleep(80)
qdel(src)
/obj/item/grenade/smokebomb
name = "smoke grenade"
desc = "The word 'Dank' is scribbled on it in crayon."
icon = 'icons/obj/grenade.dmi'
icon_state = "smokewhite"
det_time = 20
item_state = "flashbang"
slot_flags = ITEM_SLOT_BELT
var/datum/effect_system/smoke_spread/bad/smoke
/obj/item/grenade/smokebomb/New()
..()
src.smoke = new /datum/effect_system/smoke_spread/bad
src.smoke.attach(src)
/obj/item/grenade/smokebomb/Destroy()
qdel(smoke)
return ..()
/obj/item/grenade/smokebomb/prime()
update_mob()
playsound(src.loc, 'sound/effects/smoke.ogg', 50, 1, -3)
smoke.set_up(4, src)
smoke.start()
for(var/obj/structure/blob/B in view(8,src))
var/damage = round(30/(get_dist(B,src)+1))
B.take_damage(damage, BURN, "melee", 0)
sleep(80)
qdel(src)
@@ -1,50 +1,50 @@
/obj/item/grenade/syndieminibomb
desc = "A syndicate manufactured explosive used to sow destruction and chaos."
name = "syndicate minibomb"
icon = 'icons/obj/grenade.dmi'
icon_state = "syndicate"
item_state = "flashbang"
/obj/item/grenade/syndieminibomb/prime()
update_mob()
explosion(src.loc,1,2,4,flame_range = 2)
qdel(src)
/obj/item/grenade/syndieminibomb/concussion
name = "HE Grenade"
desc = "A compact shrapnel grenade meant to devastate nearby organisms and cause some damage in the process. Pull pin and throw opposite direction."
icon_state = "concussion"
/obj/item/grenade/syndieminibomb/concussion/prime()
update_mob()
explosion(src.loc,0,2,3,flame_range = 3)
qdel(src)
/obj/item/grenade/syndieminibomb/concussion/frag
name = "frag grenade"
desc = "Fire in the hole."
icon_state = "frag"
/obj/item/grenade/gluon
desc = "An advanced grenade that releases a harmful stream of gluons inducing radiation in those nearby. These gluon streams will also make victims feel exhausted, and induce shivering. This extreme coldness will also likely wet any nearby floors."
name = "gluon frag grenade"
icon = 'icons/obj/grenade.dmi'
icon_state = "bluefrag"
item_state = "flashbang"
var/freeze_range = 4
var/rad_damage = 350
var/stamina_damage = 30
/obj/item/grenade/gluon/prime()
update_mob()
playsound(loc, 'sound/effects/empulse.ogg', 50, 1)
radiation_pulse(src, rad_damage)
for(var/turf/T in view(freeze_range,loc))
if(isfloorturf(T))
var/turf/open/floor/F = T
F.MakeSlippery(TURF_WET_PERMAFROST, 6 MINUTES)
for(var/mob/living/carbon/L in T)
L.adjustStaminaLoss(stamina_damage)
L.adjust_bodytemperature(-230)
qdel(src)
/obj/item/grenade/syndieminibomb
desc = "A syndicate manufactured explosive used to sow destruction and chaos."
name = "syndicate minibomb"
icon = 'icons/obj/grenade.dmi'
icon_state = "syndicate"
item_state = "flashbang"
/obj/item/grenade/syndieminibomb/prime()
update_mob()
explosion(src.loc,1,2,4,flame_range = 2)
qdel(src)
/obj/item/grenade/syndieminibomb/concussion
name = "HE Grenade"
desc = "A compact shrapnel grenade meant to devastate nearby organisms and cause some damage in the process. Pull pin and throw opposite direction."
icon_state = "concussion"
/obj/item/grenade/syndieminibomb/concussion/prime()
update_mob()
explosion(src.loc,0,2,3,flame_range = 3)
qdel(src)
/obj/item/grenade/syndieminibomb/concussion/frag
name = "frag grenade"
desc = "Fire in the hole."
icon_state = "frag"
/obj/item/grenade/gluon
desc = "An advanced grenade that releases a harmful stream of gluons inducing radiation in those nearby. These gluon streams will also make victims feel exhausted, and induce shivering. This extreme coldness will also likely wet any nearby floors."
name = "gluon frag grenade"
icon = 'icons/obj/grenade.dmi'
icon_state = "bluefrag"
item_state = "flashbang"
var/freeze_range = 4
var/rad_damage = 350
var/stamina_damage = 30
/obj/item/grenade/gluon/prime()
update_mob()
playsound(loc, 'sound/effects/empulse.ogg', 50, 1)
radiation_pulse(src, rad_damage)
for(var/turf/T in view(freeze_range,loc))
if(isfloorturf(T))
var/turf/open/floor/F = T
F.MakeSlippery(TURF_WET_PERMAFROST, 6 MINUTES)
for(var/mob/living/carbon/L in T)
L.adjustStaminaLoss(stamina_damage)
L.adjust_bodytemperature(-230)
qdel(src)
+376 -376
View File
@@ -1,376 +1,376 @@
/obj/item/restraints
breakouttime = 600
var/demoralize_criminals = TRUE // checked on carbon/carbon.dm to decide wheter to apply the handcuffed negative moodlet or not.
/obj/item/restraints/suicide_act(mob/living/carbon/user)
user.visible_message("<span class='suicide'>[user] is strangling [user.p_them()]self with [src]! It looks like [user.p_theyre()] trying to commit suicide!</span>")
return(OXYLOSS)
/obj/item/restraints/Destroy()
if(iscarbon(loc))
var/mob/living/carbon/M = loc
if(M.handcuffed == src)
M.handcuffed = null
M.update_handcuffed()
if(M.buckled && M.buckled.buckle_requires_restraints)
M.buckled.unbuckle_mob(M)
if(M.legcuffed == src)
M.legcuffed = null
M.update_inv_legcuffed()
return ..()
//Handcuffs
/obj/item/restraints/handcuffs
name = "handcuffs"
desc = "Use this to keep prisoners in line."
gender = PLURAL
icon = 'icons/obj/items_and_weapons.dmi'
icon_state = "handcuff"
item_state = "handcuff"
lefthand_file = 'icons/mob/inhands/equipment/security_lefthand.dmi'
righthand_file = 'icons/mob/inhands/equipment/security_righthand.dmi'
flags_1 = CONDUCT_1
slot_flags = ITEM_SLOT_BELT
throwforce = 0
w_class = WEIGHT_CLASS_SMALL
throw_speed = 3
throw_range = 5
materials = list(MAT_METAL=500)
breakouttime = 600 //Deciseconds = 60s = 1 minute
armor = list("melee" = 0, "bullet" = 0, "laser" = 0, "energy" = 0, "bomb" = 0, "bio" = 0, "rad" = 0, "fire" = 50, "acid" = 50)
var/cuffsound = 'sound/weapons/handcuffs.ogg'
var/trashtype = null //for disposable cuffs
/obj/item/restraints/handcuffs/attack(mob/living/carbon/C, mob/living/user)
if(!istype(C))
return
if(iscarbon(user) && (HAS_TRAIT(user, TRAIT_CLUMSY) && prob(50)))
to_chat(user, "<span class='warning'>Uh... how do those things work?!</span>")
apply_cuffs(user,user)
return
// chance of monkey retaliation
if(ismonkey(C) && prob(MONKEY_CUFF_RETALIATION_PROB))
var/mob/living/carbon/monkey/M
M = C
M.retaliate(user)
if(!C.handcuffed)
if(C.get_num_arms(FALSE) >= 2 || C.get_arm_ignore())
C.visible_message("<span class='danger'>[user] is trying to put [src.name] on [C]!</span>", \
"<span class='userdanger'>[user] is trying to put [src.name] on [C]!</span>")
playsound(loc, cuffsound, 30, 1, -2)
if(do_mob(user, C, 30) && (C.get_num_arms(FALSE) >= 2 || C.get_arm_ignore()))
if(iscyborg(user))
apply_cuffs(C, user, TRUE)
else
apply_cuffs(C, user)
to_chat(user, "<span class='notice'>You handcuff [C].</span>")
SSblackbox.record_feedback("tally", "handcuffs", 1, type)
log_combat(user, C, "handcuffed")
else
to_chat(user, "<span class='warning'>You fail to handcuff [C]!</span>")
else
to_chat(user, "<span class='warning'>[C] doesn't have two hands...</span>")
/obj/item/restraints/handcuffs/proc/apply_cuffs(mob/living/carbon/target, mob/user, var/dispense = 0)
if(target.handcuffed)
return
if(!user.temporarilyRemoveItemFromInventory(src) && !dispense)
return
var/obj/item/restraints/handcuffs/cuffs = src
if(trashtype)
cuffs = new trashtype()
else if(dispense)
cuffs = new type()
cuffs.forceMove(target)
target.handcuffed = cuffs
target.update_handcuffed()
if(trashtype && !dispense)
qdel(src)
if(iscyborg(user))
playsound(user, "law", 50, 0)
return
/obj/item/restraints/handcuffs/sinew
name = "sinew restraints"
desc = "A pair of restraints fashioned from long strands of flesh."
icon = 'icons/obj/mining.dmi'
icon_state = "sinewcuff"
breakouttime = 300 //Deciseconds = 30s
cuffsound = 'sound/weapons/cablecuff.ogg'
/obj/item/restraints/handcuffs/cable
name = "cable restraints"
desc = "Looks like some cables tied together. Could be used to tie something up."
icon_state = "cuff"
item_state = "coil"
item_color = "red"
color = "#ff0000"
lefthand_file = 'icons/mob/inhands/equipment/tools_lefthand.dmi'
righthand_file = 'icons/mob/inhands/equipment/tools_righthand.dmi'
materials = list(MAT_METAL=150, MAT_GLASS=75)
breakouttime = 300 //Deciseconds = 30s
cuffsound = 'sound/weapons/cablecuff.ogg'
/obj/item/restraints/handcuffs/cable/Initialize(mapload, param_color)
. = ..()
var/list/cable_colors = GLOB.cable_colors
item_color = param_color || item_color || pick(cable_colors)
if(cable_colors[item_color])
item_color = cable_colors[item_color]
update_icon()
/obj/item/restraints/handcuffs/cable/update_icon()
color = null
add_atom_colour(item_color, FIXED_COLOUR_PRIORITY)
/obj/item/restraints/handcuffs/cable/red
item_color = "red"
color = "#ff0000"
/obj/item/restraints/handcuffs/cable/yellow
item_color = "yellow"
color = "#ffff00"
/obj/item/restraints/handcuffs/cable/blue
item_color = "blue"
color = "#1919c8"
/obj/item/restraints/handcuffs/cable/green
item_color = "green"
color = "#00aa00"
/obj/item/restraints/handcuffs/cable/pink
item_color = "pink"
color = "#ff3ccd"
/obj/item/restraints/handcuffs/cable/orange
item_color = "orange"
color = "#ff8000"
/obj/item/restraints/handcuffs/cable/cyan
item_color = "cyan"
color = "#00ffff"
/obj/item/restraints/handcuffs/cable/white
item_color = "white"
/obj/item/restraints/handcuffs/cable/attackby(obj/item/I, mob/user, params)
..()
if(istype(I, /obj/item/stack/rods))
var/obj/item/stack/rods/R = I
if (R.use(1))
var/obj/item/wirerod/W = new /obj/item/wirerod
remove_item_from_storage(user)
user.put_in_hands(W)
to_chat(user, "<span class='notice'>You wrap the cable restraint around the top of the rod.</span>")
qdel(src)
else
to_chat(user, "<span class='warning'>You need one rod to make a wired rod!</span>")
return
else if(istype(I, /obj/item/stack/sheet/metal))
var/obj/item/stack/sheet/metal/M = I
if(M.get_amount() < 6)
to_chat(user, "<span class='warning'>You need at least six metal sheets to make good enough weights!</span>")
return
to_chat(user, "<span class='notice'>You begin to apply [I] to [src]...</span>")
if(do_after(user, 35, target = src))
if(M.get_amount() < 6 || !M)
return
var/obj/item/restraints/legcuffs/bola/S = new /obj/item/restraints/legcuffs/bola
M.use(6)
user.put_in_hands(S)
to_chat(user, "<span class='notice'>You make some weights out of [I] and tie them to [src].</span>")
remove_item_from_storage(user)
qdel(src)
else
return ..()
/obj/item/restraints/handcuffs/cable/zipties
name = "zipties"
desc = "Plastic, disposable zipties that can be used to restrain temporarily but are destroyed after use."
item_state = "zipties"
lefthand_file = 'icons/mob/inhands/equipment/security_lefthand.dmi'
righthand_file = 'icons/mob/inhands/equipment/security_righthand.dmi'
materials = list()
breakouttime = 450 //Deciseconds = 45s
trashtype = /obj/item/restraints/handcuffs/cable/zipties/used
item_color = "white"
/obj/item/restraints/handcuffs/cable/zipties/used
desc = "A pair of broken zipties."
icon_state = "cuff_used"
/obj/item/restraints/handcuffs/cable/zipties/used/attack()
return
/obj/item/restraints/handcuffs/alien
icon_state = "handcuffAlien"
/obj/item/restraints/handcuffs/fake
name = "fake handcuffs"
desc = "Fake handcuffs meant for gag purposes."
breakouttime = 10 //Deciseconds = 1s
demoralize_criminals = FALSE
/obj/item/restraints/handcuffs/fake/kinky
name = "kinky handcuffs"
desc = "Fake handcuffs meant for erotic roleplay."
icon = 'modular_citadel/icons/obj/items_and_weapons.dmi'
icon_state = "handcuffgag"
item_state = "kinkycuff"
//Legcuffs
/obj/item/restraints/legcuffs
name = "leg cuffs"
desc = "Use this to keep prisoners in line."
gender = PLURAL
icon = 'icons/obj/items_and_weapons.dmi'
icon_state = "handcuff"
item_state = "legcuff"
lefthand_file = 'icons/mob/inhands/equipment/security_lefthand.dmi'
righthand_file = 'icons/mob/inhands/equipment/security_righthand.dmi'
flags_1 = CONDUCT_1
throwforce = 0
w_class = WEIGHT_CLASS_NORMAL
slowdown = 7
breakouttime = 300 //Deciseconds = 30s = 0.5 minute
/obj/item/restraints/legcuffs/beartrap
name = "bear trap"
throw_speed = 1
throw_range = 1
icon_state = "beartrap"
desc = "A trap used to catch bears and other legged creatures."
var/armed = 0
var/trap_damage = 20
/obj/item/restraints/legcuffs/beartrap/Initialize()
. = ..()
icon_state = "[initial(icon_state)][armed]"
/obj/item/restraints/legcuffs/beartrap/suicide_act(mob/user)
user.visible_message("<span class='suicide'>[user] is sticking [user.p_their()] head in the [src.name]! It looks like [user.p_theyre()] trying to commit suicide!</span>")
playsound(loc, 'sound/weapons/bladeslice.ogg', 50, 1, -1)
return (BRUTELOSS)
/obj/item/restraints/legcuffs/beartrap/attack_self(mob/user)
..()
if(ishuman(user) && !user.stat && !user.restrained())
armed = !armed
icon_state = "[initial(icon_state)][armed]"
to_chat(user, "<span class='notice'>[src] is now [armed ? "armed" : "disarmed"]</span>")
/obj/item/restraints/legcuffs/beartrap/Crossed(AM as mob|obj)
if(armed && isturf(src.loc))
if(isliving(AM))
var/mob/living/L = AM
var/snap = 0
var/def_zone = BODY_ZONE_CHEST
if(iscarbon(L))
var/mob/living/carbon/C = L
snap = 1
if(!C.lying)
def_zone = pick(BODY_ZONE_L_LEG, BODY_ZONE_R_LEG)
if(!C.legcuffed && C.get_num_legs(FALSE) >= 2) //beartrap can't cuff your leg if there's already a beartrap or legcuffs, or you don't have two legs.
C.legcuffed = src
forceMove(C)
C.update_inv_legcuffed()
SSblackbox.record_feedback("tally", "handcuffs", 1, type)
else if(isanimal(L))
var/mob/living/simple_animal/SA = L
if(SA.mob_size > MOB_SIZE_TINY)
snap = 1
if(L.movement_type & FLYING)
snap = 0
if(snap)
armed = 0
icon_state = "[initial(icon_state)][armed]"
playsound(src.loc, 'sound/effects/snap.ogg', 50, 1)
L.visible_message("<span class='danger'>[L] triggers \the [src].</span>", \
"<span class='userdanger'>You trigger \the [src]!</span>")
L.apply_damage(trap_damage,BRUTE, def_zone)
..()
/obj/item/restraints/legcuffs/beartrap/energy
name = "energy snare"
armed = 1
icon_state = "e_snare"
trap_damage = 0
item_flags = DROPDEL
flags_1 = NONE
/obj/item/restraints/legcuffs/beartrap/energy/New()
..()
addtimer(CALLBACK(src, .proc/dissipate), 100)
/obj/item/restraints/legcuffs/beartrap/energy/proc/dissipate()
if(!ismob(loc))
do_sparks(1, TRUE, src)
qdel(src)
/obj/item/restraints/legcuffs/beartrap/energy/attack_hand(mob/user)
Crossed(user) //honk
. = ..()
/obj/item/restraints/legcuffs/beartrap/energy/cyborg
breakouttime = 20 // Cyborgs shouldn't have a strong restraint
/obj/item/restraints/legcuffs/bola
name = "bola"
desc = "A restraining device designed to be thrown at the target. Upon connecting with said target, it will wrap around their legs, making it difficult for them to move quickly."
icon_state = "bola"
breakouttime = 35//easy to apply, easy to break out of
gender = NEUTER
var/knockdown = 0
/obj/item/restraints/legcuffs/bola/throw_at(atom/target, range, speed, mob/thrower, spin=1, diagonals_first = 0, datum/callback/callback)
if(!..())
return
playsound(src.loc,'sound/weapons/bolathrow.ogg', 75, 1)
/obj/item/restraints/legcuffs/bola/throw_impact(atom/hit_atom)
if(..() || !iscarbon(hit_atom))//if it gets caught or the target can't be cuffed,
return//abort
var/mob/living/carbon/C = hit_atom
if(!C.legcuffed && C.get_num_legs(FALSE) >= 2)
visible_message("<span class='danger'>\The [src] ensnares [C]!</span>")
C.legcuffed = src
forceMove(C)
C.update_inv_legcuffed()
SSblackbox.record_feedback("tally", "handcuffs", 1, type)
to_chat(C, "<span class='userdanger'>\The [src] ensnares you!</span>")
C.Knockdown(knockdown)
/obj/item/restraints/legcuffs/bola/tactical//traitor variant
name = "reinforced bola"
desc = "A strong bola, made with a long steel chain. It looks heavy, enough so that it could trip somebody."
icon_state = "bola_r"
breakouttime = 70
knockdown = 20
/obj/item/restraints/legcuffs/bola/energy //For Security
name = "energy bola"
desc = "A specialized hard-light bola designed to ensnare fleeing criminals and aid in arrests."
icon_state = "ebola"
hitsound = 'sound/weapons/taserhit.ogg'
w_class = WEIGHT_CLASS_SMALL
breakouttime = 60
/obj/item/restraints/legcuffs/bola/energy/throw_impact(atom/hit_atom)
if(iscarbon(hit_atom))
var/obj/item/restraints/legcuffs/beartrap/B = new /obj/item/restraints/legcuffs/beartrap/energy/cyborg(get_turf(hit_atom))
B.Crossed(hit_atom)
qdel(src)
..()
/obj/item/restraints
breakouttime = 600
var/demoralize_criminals = TRUE // checked on carbon/carbon.dm to decide wheter to apply the handcuffed negative moodlet or not.
/obj/item/restraints/suicide_act(mob/living/carbon/user)
user.visible_message("<span class='suicide'>[user] is strangling [user.p_them()]self with [src]! It looks like [user.p_theyre()] trying to commit suicide!</span>")
return(OXYLOSS)
/obj/item/restraints/Destroy()
if(iscarbon(loc))
var/mob/living/carbon/M = loc
if(M.handcuffed == src)
M.handcuffed = null
M.update_handcuffed()
if(M.buckled && M.buckled.buckle_requires_restraints)
M.buckled.unbuckle_mob(M)
if(M.legcuffed == src)
M.legcuffed = null
M.update_inv_legcuffed()
return ..()
//Handcuffs
/obj/item/restraints/handcuffs
name = "handcuffs"
desc = "Use this to keep prisoners in line."
gender = PLURAL
icon = 'icons/obj/items_and_weapons.dmi'
icon_state = "handcuff"
item_state = "handcuff"
lefthand_file = 'icons/mob/inhands/equipment/security_lefthand.dmi'
righthand_file = 'icons/mob/inhands/equipment/security_righthand.dmi'
flags_1 = CONDUCT_1
slot_flags = ITEM_SLOT_BELT
throwforce = 0
w_class = WEIGHT_CLASS_SMALL
throw_speed = 3
throw_range = 5
materials = list(MAT_METAL=500)
breakouttime = 600 //Deciseconds = 60s = 1 minute
armor = list("melee" = 0, "bullet" = 0, "laser" = 0, "energy" = 0, "bomb" = 0, "bio" = 0, "rad" = 0, "fire" = 50, "acid" = 50)
var/cuffsound = 'sound/weapons/handcuffs.ogg'
var/trashtype = null //for disposable cuffs
/obj/item/restraints/handcuffs/attack(mob/living/carbon/C, mob/living/user)
if(!istype(C))
return
if(iscarbon(user) && (HAS_TRAIT(user, TRAIT_CLUMSY) && prob(50)))
to_chat(user, "<span class='warning'>Uh... how do those things work?!</span>")
apply_cuffs(user,user)
return
// chance of monkey retaliation
if(ismonkey(C) && prob(MONKEY_CUFF_RETALIATION_PROB))
var/mob/living/carbon/monkey/M
M = C
M.retaliate(user)
if(!C.handcuffed)
if(C.get_num_arms(FALSE) >= 2 || C.get_arm_ignore())
C.visible_message("<span class='danger'>[user] is trying to put [src.name] on [C]!</span>", \
"<span class='userdanger'>[user] is trying to put [src.name] on [C]!</span>")
playsound(loc, cuffsound, 30, 1, -2)
if(do_mob(user, C, 30) && (C.get_num_arms(FALSE) >= 2 || C.get_arm_ignore()))
if(iscyborg(user))
apply_cuffs(C, user, TRUE)
else
apply_cuffs(C, user)
to_chat(user, "<span class='notice'>You handcuff [C].</span>")
SSblackbox.record_feedback("tally", "handcuffs", 1, type)
log_combat(user, C, "handcuffed")
else
to_chat(user, "<span class='warning'>You fail to handcuff [C]!</span>")
else
to_chat(user, "<span class='warning'>[C] doesn't have two hands...</span>")
/obj/item/restraints/handcuffs/proc/apply_cuffs(mob/living/carbon/target, mob/user, var/dispense = 0)
if(target.handcuffed)
return
if(!user.temporarilyRemoveItemFromInventory(src) && !dispense)
return
var/obj/item/restraints/handcuffs/cuffs = src
if(trashtype)
cuffs = new trashtype()
else if(dispense)
cuffs = new type()
cuffs.forceMove(target)
target.handcuffed = cuffs
target.update_handcuffed()
if(trashtype && !dispense)
qdel(src)
if(iscyborg(user))
playsound(user, "law", 50, 0)
return
/obj/item/restraints/handcuffs/sinew
name = "sinew restraints"
desc = "A pair of restraints fashioned from long strands of flesh."
icon = 'icons/obj/mining.dmi'
icon_state = "sinewcuff"
breakouttime = 300 //Deciseconds = 30s
cuffsound = 'sound/weapons/cablecuff.ogg'
/obj/item/restraints/handcuffs/cable
name = "cable restraints"
desc = "Looks like some cables tied together. Could be used to tie something up."
icon_state = "cuff"
item_state = "coil"
item_color = "red"
color = "#ff0000"
lefthand_file = 'icons/mob/inhands/equipment/tools_lefthand.dmi'
righthand_file = 'icons/mob/inhands/equipment/tools_righthand.dmi'
materials = list(MAT_METAL=150, MAT_GLASS=75)
breakouttime = 300 //Deciseconds = 30s
cuffsound = 'sound/weapons/cablecuff.ogg'
/obj/item/restraints/handcuffs/cable/Initialize(mapload, param_color)
. = ..()
var/list/cable_colors = GLOB.cable_colors
item_color = param_color || item_color || pick(cable_colors)
if(cable_colors[item_color])
item_color = cable_colors[item_color]
update_icon()
/obj/item/restraints/handcuffs/cable/update_icon()
color = null
add_atom_colour(item_color, FIXED_COLOUR_PRIORITY)
/obj/item/restraints/handcuffs/cable/red
item_color = "red"
color = "#ff0000"
/obj/item/restraints/handcuffs/cable/yellow
item_color = "yellow"
color = "#ffff00"
/obj/item/restraints/handcuffs/cable/blue
item_color = "blue"
color = "#1919c8"
/obj/item/restraints/handcuffs/cable/green
item_color = "green"
color = "#00aa00"
/obj/item/restraints/handcuffs/cable/pink
item_color = "pink"
color = "#ff3ccd"
/obj/item/restraints/handcuffs/cable/orange
item_color = "orange"
color = "#ff8000"
/obj/item/restraints/handcuffs/cable/cyan
item_color = "cyan"
color = "#00ffff"
/obj/item/restraints/handcuffs/cable/white
item_color = "white"
/obj/item/restraints/handcuffs/cable/attackby(obj/item/I, mob/user, params)
..()
if(istype(I, /obj/item/stack/rods))
var/obj/item/stack/rods/R = I
if (R.use(1))
var/obj/item/wirerod/W = new /obj/item/wirerod
remove_item_from_storage(user)
user.put_in_hands(W)
to_chat(user, "<span class='notice'>You wrap the cable restraint around the top of the rod.</span>")
qdel(src)
else
to_chat(user, "<span class='warning'>You need one rod to make a wired rod!</span>")
return
else if(istype(I, /obj/item/stack/sheet/metal))
var/obj/item/stack/sheet/metal/M = I
if(M.get_amount() < 6)
to_chat(user, "<span class='warning'>You need at least six metal sheets to make good enough weights!</span>")
return
to_chat(user, "<span class='notice'>You begin to apply [I] to [src]...</span>")
if(do_after(user, 35, target = src))
if(M.get_amount() < 6 || !M)
return
var/obj/item/restraints/legcuffs/bola/S = new /obj/item/restraints/legcuffs/bola
M.use(6)
user.put_in_hands(S)
to_chat(user, "<span class='notice'>You make some weights out of [I] and tie them to [src].</span>")
remove_item_from_storage(user)
qdel(src)
else
return ..()
/obj/item/restraints/handcuffs/cable/zipties
name = "zipties"
desc = "Plastic, disposable zipties that can be used to restrain temporarily but are destroyed after use."
item_state = "zipties"
lefthand_file = 'icons/mob/inhands/equipment/security_lefthand.dmi'
righthand_file = 'icons/mob/inhands/equipment/security_righthand.dmi'
materials = list()
breakouttime = 450 //Deciseconds = 45s
trashtype = /obj/item/restraints/handcuffs/cable/zipties/used
item_color = "white"
/obj/item/restraints/handcuffs/cable/zipties/used
desc = "A pair of broken zipties."
icon_state = "cuff_used"
/obj/item/restraints/handcuffs/cable/zipties/used/attack()
return
/obj/item/restraints/handcuffs/alien
icon_state = "handcuffAlien"
/obj/item/restraints/handcuffs/fake
name = "fake handcuffs"
desc = "Fake handcuffs meant for gag purposes."
breakouttime = 10 //Deciseconds = 1s
demoralize_criminals = FALSE
/obj/item/restraints/handcuffs/fake/kinky
name = "kinky handcuffs"
desc = "Fake handcuffs meant for erotic roleplay."
icon = 'modular_citadel/icons/obj/items_and_weapons.dmi'
icon_state = "handcuffgag"
item_state = "kinkycuff"
//Legcuffs
/obj/item/restraints/legcuffs
name = "leg cuffs"
desc = "Use this to keep prisoners in line."
gender = PLURAL
icon = 'icons/obj/items_and_weapons.dmi'
icon_state = "handcuff"
item_state = "legcuff"
lefthand_file = 'icons/mob/inhands/equipment/security_lefthand.dmi'
righthand_file = 'icons/mob/inhands/equipment/security_righthand.dmi'
flags_1 = CONDUCT_1
throwforce = 0
w_class = WEIGHT_CLASS_NORMAL
slowdown = 7
breakouttime = 300 //Deciseconds = 30s = 0.5 minute
/obj/item/restraints/legcuffs/beartrap
name = "bear trap"
throw_speed = 1
throw_range = 1
icon_state = "beartrap"
desc = "A trap used to catch bears and other legged creatures."
var/armed = 0
var/trap_damage = 20
/obj/item/restraints/legcuffs/beartrap/Initialize()
. = ..()
icon_state = "[initial(icon_state)][armed]"
/obj/item/restraints/legcuffs/beartrap/suicide_act(mob/user)
user.visible_message("<span class='suicide'>[user] is sticking [user.p_their()] head in the [src.name]! It looks like [user.p_theyre()] trying to commit suicide!</span>")
playsound(loc, 'sound/weapons/bladeslice.ogg', 50, 1, -1)
return (BRUTELOSS)
/obj/item/restraints/legcuffs/beartrap/attack_self(mob/user)
..()
if(ishuman(user) && !user.stat && !user.restrained())
armed = !armed
icon_state = "[initial(icon_state)][armed]"
to_chat(user, "<span class='notice'>[src] is now [armed ? "armed" : "disarmed"]</span>")
/obj/item/restraints/legcuffs/beartrap/Crossed(AM as mob|obj)
if(armed && isturf(src.loc))
if(isliving(AM))
var/mob/living/L = AM
var/snap = 0
var/def_zone = BODY_ZONE_CHEST
if(iscarbon(L))
var/mob/living/carbon/C = L
snap = 1
if(!C.lying)
def_zone = pick(BODY_ZONE_L_LEG, BODY_ZONE_R_LEG)
if(!C.legcuffed && C.get_num_legs(FALSE) >= 2) //beartrap can't cuff your leg if there's already a beartrap or legcuffs, or you don't have two legs.
C.legcuffed = src
forceMove(C)
C.update_inv_legcuffed()
SSblackbox.record_feedback("tally", "handcuffs", 1, type)
else if(isanimal(L))
var/mob/living/simple_animal/SA = L
if(SA.mob_size > MOB_SIZE_TINY)
snap = 1
if(L.movement_type & FLYING)
snap = 0
if(snap)
armed = 0
icon_state = "[initial(icon_state)][armed]"
playsound(src.loc, 'sound/effects/snap.ogg', 50, 1)
L.visible_message("<span class='danger'>[L] triggers \the [src].</span>", \
"<span class='userdanger'>You trigger \the [src]!</span>")
L.apply_damage(trap_damage,BRUTE, def_zone)
..()
/obj/item/restraints/legcuffs/beartrap/energy
name = "energy snare"
armed = 1
icon_state = "e_snare"
trap_damage = 0
item_flags = DROPDEL
flags_1 = NONE
/obj/item/restraints/legcuffs/beartrap/energy/New()
..()
addtimer(CALLBACK(src, .proc/dissipate), 100)
/obj/item/restraints/legcuffs/beartrap/energy/proc/dissipate()
if(!ismob(loc))
do_sparks(1, TRUE, src)
qdel(src)
/obj/item/restraints/legcuffs/beartrap/energy/attack_hand(mob/user)
Crossed(user) //honk
. = ..()
/obj/item/restraints/legcuffs/beartrap/energy/cyborg
breakouttime = 20 // Cyborgs shouldn't have a strong restraint
/obj/item/restraints/legcuffs/bola
name = "bola"
desc = "A restraining device designed to be thrown at the target. Upon connecting with said target, it will wrap around their legs, making it difficult for them to move quickly."
icon_state = "bola"
breakouttime = 35//easy to apply, easy to break out of
gender = NEUTER
var/knockdown = 0
/obj/item/restraints/legcuffs/bola/throw_at(atom/target, range, speed, mob/thrower, spin=1, diagonals_first = 0, datum/callback/callback)
if(!..())
return
playsound(src.loc,'sound/weapons/bolathrow.ogg', 75, 1)
/obj/item/restraints/legcuffs/bola/throw_impact(atom/hit_atom)
if(..() || !iscarbon(hit_atom))//if it gets caught or the target can't be cuffed,
return//abort
var/mob/living/carbon/C = hit_atom
if(!C.legcuffed && C.get_num_legs(FALSE) >= 2)
visible_message("<span class='danger'>\The [src] ensnares [C]!</span>")
C.legcuffed = src
forceMove(C)
C.update_inv_legcuffed()
SSblackbox.record_feedback("tally", "handcuffs", 1, type)
to_chat(C, "<span class='userdanger'>\The [src] ensnares you!</span>")
C.Knockdown(knockdown)
/obj/item/restraints/legcuffs/bola/tactical//traitor variant
name = "reinforced bola"
desc = "A strong bola, made with a long steel chain. It looks heavy, enough so that it could trip somebody."
icon_state = "bola_r"
breakouttime = 70
knockdown = 20
/obj/item/restraints/legcuffs/bola/energy //For Security
name = "energy bola"
desc = "A specialized hard-light bola designed to ensnare fleeing criminals and aid in arrests."
icon_state = "ebola"
hitsound = 'sound/weapons/taserhit.ogg'
w_class = WEIGHT_CLASS_SMALL
breakouttime = 60
/obj/item/restraints/legcuffs/bola/energy/throw_impact(atom/hit_atom)
if(iscarbon(hit_atom))
var/obj/item/restraints/legcuffs/beartrap/B = new /obj/item/restraints/legcuffs/beartrap/energy/cyborg(get_turf(hit_atom))
B.Crossed(hit_atom)
qdel(src)
..()
+171 -171
View File
@@ -1,171 +1,171 @@
//CREATOR'S NOTE: DO NOT FUCKING GIVE THIS TO BOTANY!
/obj/item/hot_potato
name = "hot potato"
desc = "A label on the side of this potato reads \"Product of DonkCo Service Wing. Activate far away from populated areas. Device will only attach to sapient creatures.\" <span class='boldnotice'>You can attack anyone with it to force it on them instead of yourself!</span>"
icon = 'icons/obj/hydroponics/harvest.dmi'
icon_state = "potato"
item_flags = NOBLUDGEON
force = 0
var/icon_off = "potato"
var/icon_on = "potato_active"
var/detonation_timerid
var/activation_time = 0
var/timer = 600 //deciseconds
var/show_timer = FALSE
var/reusable = FALSE //absolute madman
var/sticky = TRUE
var/forceful_attachment = TRUE
var/stimulant = TRUE
var/detonate_explosion = TRUE
var/detonate_dev_range = 0
var/detonate_heavy_range = 0
var/detonate_light_range = 2
var/detonate_flash_range = 5
var/detonate_fire_range = 5
var/active = FALSE
var/color_val = FALSE
var/datum/weakref/current
/obj/item/hot_potato/Destroy()
if(active)
deactivate()
return ..()
/obj/item/hot_potato/proc/colorize(mob/target)
//Clear color from old target
if(current)
var/mob/M = current.resolve()
if(istype(M))
M.remove_atom_colour(FIXED_COLOUR_PRIORITY)
//Give to new target
current = null
//Swap colors
color_val = !color_val
if(istype(target))
current = WEAKREF(target)
target.add_atom_colour(color_val? "#ffff00" : "#00ffff", FIXED_COLOUR_PRIORITY)
/obj/item/hot_potato/proc/detonate()
var/atom/location = loc
location.visible_message("<span class='userdanger'>[src] [detonate_explosion? "explodes" : "activates"]!</span>", "<span class='userdanger'>[src] activates! You've ran out of time!</span>")
if(detonate_explosion)
explosion(src, detonate_dev_range, detonate_heavy_range, detonate_light_range, detonate_flash_range, flame_range = detonate_fire_range)
deactivate()
if(!reusable)
var/mob/M = loc
if(istype(M))
M.dropItemToGround(src, TRUE)
qdel(src)
/obj/item/hot_potato/attack_self(mob/user)
if(activate(timer, user))
user.visible_message("<span class='boldwarning'>[user] squeezes [src], which promptly starts to flash red-hot colors!</span>", "<span class='boldwarning'>You squeeze [src], activating its countdown and attachment mechanism!</span>",
"<span class='boldwarning'>You hear a mechanical click and a loud beeping!</span>")
return
return ..()
/obj/item/hot_potato/process()
if(stimulant)
if(isliving(loc))
var/mob/living/L = loc
L.SetStun(0)
L.SetKnockdown(0)
L.SetSleeping(0)
L.SetUnconscious(0)
L.reagents.add_reagent(/datum/reagent/medicine/muscle_stimulant, CLAMP(5 - L.reagents.get_reagent_amount(/datum/reagent/medicine/muscle_stimulant), 0, 5)) //If you don't have legs or get bola'd, tough luck!
colorize(L)
/obj/item/hot_potato/examine(mob/user)
. = ..()
if(active)
. += "<span class='warning'>[src] is flashing red-hot! You should probably get rid of it!</span>"
if(show_timer)
. += "<span class='warning'>[src]'s timer looks to be at [DisplayTimeText(activation_time - world.time)]!</span>"
/obj/item/hot_potato/equipped(mob/user)
. = ..()
if(active)
to_chat(user, "<span class='userdanger'>You have a really bad feeling about [src]!</span>")
/obj/item/hot_potato/afterattack(atom/target, mob/user, adjacent, params)
. = ..()
if(!adjacent || !ismob(target))
return
force_onto(target, user)
/obj/item/hot_potato/proc/force_onto(mob/living/victim, mob/user)
if(!istype(victim) || user != loc || victim == user)
return FALSE
if(!victim.client)
to_chat(user, "<span class='boldwarning'>[src] refuses to attach to a non-sapient creature!</span>")
if(victim.stat != CONSCIOUS || !victim.get_num_legs())
to_chat(user, "<span class='boldwarning'>[src] refuses to attach to someone incapable of using it!</span>")
user.temporarilyRemoveItemFromInventory(src, TRUE)
. = FALSE
if(!victim.put_in_hands(src))
if(forceful_attachment)
victim.dropItemToGround(victim.get_inactive_held_item())
if(!victim.put_in_hands(src))
victim.dropItemToGround(victim.get_active_held_item())
if(victim.put_in_hands(src))
. = TRUE
else
. = TRUE
else
. = TRUE
if(.)
log_combat(user, victim, "forced a hot potato with explosive variables ([detonate_explosion]-[detonate_dev_range]/[detonate_heavy_range]/[detonate_light_range]/[detonate_flash_range]/[detonate_fire_range]) onto")
user.visible_message("<span class='userdanger'>[user] forces [src] onto [victim]!</span>", "<span class='userdanger'>You force [src] onto [victim]!</span>", "<span class='boldwarning'>You hear a mechanical click and a beep.</span>")
colorize(null)
else
log_combat(user, victim, "tried to force a hot potato with explosive variables ([detonate_explosion]-[detonate_dev_range]/[detonate_heavy_range]/[detonate_light_range]/[detonate_flash_range]/[detonate_fire_range]) onto")
user.visible_message("<span class='boldwarning'>[user] tried to force [src] onto [victim], but it could not attach!</span>", "<span class='boldwarning'>You try to force [src] onto [victim], but it is unable to attach!</span>", "<span class='boldwarning'>You hear a mechanical click and two buzzes.</span>")
user.put_in_hands(src)
/obj/item/hot_potato/dropped(mob/user)
. = ..()
colorize(null)
/obj/item/hot_potato/proc/activate(delay, mob/user)
if(active)
return
update_icon()
if(sticky)
ADD_TRAIT(src, TRAIT_NODROP, HOT_POTATO_TRAIT)
name = "primed [name]"
activation_time = timer + world.time
detonation_timerid = addtimer(CALLBACK(src, .proc/detonate), delay, TIMER_STOPPABLE)
START_PROCESSING(SSfastprocess, src)
var/turf/T = get_turf(src)
message_admins("[user? "[ADMIN_LOOKUPFLW(user)] has primed [src]" : "A [src] has been primed"] (Timer:[delay],Explosive:[detonate_explosion],Range:[detonate_dev_range]/[detonate_heavy_range]/[detonate_light_range]/[detonate_fire_range]) for detonation at [ADMIN_VERBOSEJMP(T)]")
log_game("[user ? "[key_name(user)] has primed [src]" : "A [src] has been primed"] ([detonate_dev_range]/[detonate_heavy_range]/[detonate_light_range]/[detonate_fire_range]) for detonation at [AREACOORD(T)]")
active = TRUE
/obj/item/hot_potato/proc/deactivate()
update_icon()
name = initial(name)
REMOVE_TRAIT(src, TRAIT_NODROP, HOT_POTATO_TRAIT)
deltimer(detonation_timerid)
STOP_PROCESSING(SSfastprocess, src)
detonation_timerid = null
colorize(null)
active = FALSE
/obj/item/hot_potato/update_icon()
icon_state = active? icon_on : icon_off
/obj/item/hot_potato/syndicate
detonate_light_range = 4
detonate_fire_range = 5
/obj/item/hot_potato/harmless
detonate_explosion = FALSE
/obj/item/hot_potato/harmless/toy
desc = "A label on the side of this potato reads \"Product of DonkCo Toys and Recreation department.\" <span class='boldnotice'>You can attack anyone with it to put it on them instead, if they have a free hand to take it!</span>"
sticky = FALSE
reusable = TRUE
forceful_attachment = FALSE
//CREATOR'S NOTE: DO NOT FUCKING GIVE THIS TO BOTANY!
/obj/item/hot_potato
name = "hot potato"
desc = "A label on the side of this potato reads \"Product of DonkCo Service Wing. Activate far away from populated areas. Device will only attach to sapient creatures.\" <span class='boldnotice'>You can attack anyone with it to force it on them instead of yourself!</span>"
icon = 'icons/obj/hydroponics/harvest.dmi'
icon_state = "potato"
item_flags = NOBLUDGEON
force = 0
var/icon_off = "potato"
var/icon_on = "potato_active"
var/detonation_timerid
var/activation_time = 0
var/timer = 600 //deciseconds
var/show_timer = FALSE
var/reusable = FALSE //absolute madman
var/sticky = TRUE
var/forceful_attachment = TRUE
var/stimulant = TRUE
var/detonate_explosion = TRUE
var/detonate_dev_range = 0
var/detonate_heavy_range = 0
var/detonate_light_range = 2
var/detonate_flash_range = 5
var/detonate_fire_range = 5
var/active = FALSE
var/color_val = FALSE
var/datum/weakref/current
/obj/item/hot_potato/Destroy()
if(active)
deactivate()
return ..()
/obj/item/hot_potato/proc/colorize(mob/target)
//Clear color from old target
if(current)
var/mob/M = current.resolve()
if(istype(M))
M.remove_atom_colour(FIXED_COLOUR_PRIORITY)
//Give to new target
current = null
//Swap colors
color_val = !color_val
if(istype(target))
current = WEAKREF(target)
target.add_atom_colour(color_val? "#ffff00" : "#00ffff", FIXED_COLOUR_PRIORITY)
/obj/item/hot_potato/proc/detonate()
var/atom/location = loc
location.visible_message("<span class='userdanger'>[src] [detonate_explosion? "explodes" : "activates"]!</span>", "<span class='userdanger'>[src] activates! You've ran out of time!</span>")
if(detonate_explosion)
explosion(src, detonate_dev_range, detonate_heavy_range, detonate_light_range, detonate_flash_range, flame_range = detonate_fire_range)
deactivate()
if(!reusable)
var/mob/M = loc
if(istype(M))
M.dropItemToGround(src, TRUE)
qdel(src)
/obj/item/hot_potato/attack_self(mob/user)
if(activate(timer, user))
user.visible_message("<span class='boldwarning'>[user] squeezes [src], which promptly starts to flash red-hot colors!</span>", "<span class='boldwarning'>You squeeze [src], activating its countdown and attachment mechanism!</span>",
"<span class='boldwarning'>You hear a mechanical click and a loud beeping!</span>")
return
return ..()
/obj/item/hot_potato/process()
if(stimulant)
if(isliving(loc))
var/mob/living/L = loc
L.SetStun(0)
L.SetKnockdown(0)
L.SetSleeping(0)
L.SetUnconscious(0)
L.reagents.add_reagent(/datum/reagent/medicine/muscle_stimulant, CLAMP(5 - L.reagents.get_reagent_amount(/datum/reagent/medicine/muscle_stimulant), 0, 5)) //If you don't have legs or get bola'd, tough luck!
colorize(L)
/obj/item/hot_potato/examine(mob/user)
. = ..()
if(active)
. += "<span class='warning'>[src] is flashing red-hot! You should probably get rid of it!</span>"
if(show_timer)
. += "<span class='warning'>[src]'s timer looks to be at [DisplayTimeText(activation_time - world.time)]!</span>"
/obj/item/hot_potato/equipped(mob/user)
. = ..()
if(active)
to_chat(user, "<span class='userdanger'>You have a really bad feeling about [src]!</span>")
/obj/item/hot_potato/afterattack(atom/target, mob/user, adjacent, params)
. = ..()
if(!adjacent || !ismob(target))
return
force_onto(target, user)
/obj/item/hot_potato/proc/force_onto(mob/living/victim, mob/user)
if(!istype(victim) || user != loc || victim == user)
return FALSE
if(!victim.client)
to_chat(user, "<span class='boldwarning'>[src] refuses to attach to a non-sapient creature!</span>")
if(victim.stat != CONSCIOUS || !victim.get_num_legs())
to_chat(user, "<span class='boldwarning'>[src] refuses to attach to someone incapable of using it!</span>")
user.temporarilyRemoveItemFromInventory(src, TRUE)
. = FALSE
if(!victim.put_in_hands(src))
if(forceful_attachment)
victim.dropItemToGround(victim.get_inactive_held_item())
if(!victim.put_in_hands(src))
victim.dropItemToGround(victim.get_active_held_item())
if(victim.put_in_hands(src))
. = TRUE
else
. = TRUE
else
. = TRUE
if(.)
log_combat(user, victim, "forced a hot potato with explosive variables ([detonate_explosion]-[detonate_dev_range]/[detonate_heavy_range]/[detonate_light_range]/[detonate_flash_range]/[detonate_fire_range]) onto")
user.visible_message("<span class='userdanger'>[user] forces [src] onto [victim]!</span>", "<span class='userdanger'>You force [src] onto [victim]!</span>", "<span class='boldwarning'>You hear a mechanical click and a beep.</span>")
colorize(null)
else
log_combat(user, victim, "tried to force a hot potato with explosive variables ([detonate_explosion]-[detonate_dev_range]/[detonate_heavy_range]/[detonate_light_range]/[detonate_flash_range]/[detonate_fire_range]) onto")
user.visible_message("<span class='boldwarning'>[user] tried to force [src] onto [victim], but it could not attach!</span>", "<span class='boldwarning'>You try to force [src] onto [victim], but it is unable to attach!</span>", "<span class='boldwarning'>You hear a mechanical click and two buzzes.</span>")
user.put_in_hands(src)
/obj/item/hot_potato/dropped(mob/user)
. = ..()
colorize(null)
/obj/item/hot_potato/proc/activate(delay, mob/user)
if(active)
return
update_icon()
if(sticky)
ADD_TRAIT(src, TRAIT_NODROP, HOT_POTATO_TRAIT)
name = "primed [name]"
activation_time = timer + world.time
detonation_timerid = addtimer(CALLBACK(src, .proc/detonate), delay, TIMER_STOPPABLE)
START_PROCESSING(SSfastprocess, src)
var/turf/T = get_turf(src)
message_admins("[user? "[ADMIN_LOOKUPFLW(user)] has primed [src]" : "A [src] has been primed"] (Timer:[delay],Explosive:[detonate_explosion],Range:[detonate_dev_range]/[detonate_heavy_range]/[detonate_light_range]/[detonate_fire_range]) for detonation at [ADMIN_VERBOSEJMP(T)]")
log_game("[user ? "[key_name(user)] has primed [src]" : "A [src] has been primed"] ([detonate_dev_range]/[detonate_heavy_range]/[detonate_light_range]/[detonate_fire_range]) for detonation at [AREACOORD(T)]")
active = TRUE
/obj/item/hot_potato/proc/deactivate()
update_icon()
name = initial(name)
REMOVE_TRAIT(src, TRAIT_NODROP, HOT_POTATO_TRAIT)
deltimer(detonation_timerid)
STOP_PROCESSING(SSfastprocess, src)
detonation_timerid = null
colorize(null)
active = FALSE
/obj/item/hot_potato/update_icon()
icon_state = active? icon_on : icon_off
/obj/item/hot_potato/syndicate
detonate_light_range = 4
detonate_fire_range = 5
/obj/item/hot_potato/harmless
detonate_explosion = FALSE
/obj/item/hot_potato/harmless/toy
desc = "A label on the side of this potato reads \"Product of DonkCo Toys and Recreation department.\" <span class='boldnotice'>You can attack anyone with it to put it on them instead, if they have a free hand to take it!</span>"
sticky = FALSE
reusable = TRUE
forceful_attachment = FALSE
+114 -114
View File
@@ -1,114 +1,114 @@
/obj/item/implant
name = "implant"
icon = 'icons/obj/implants.dmi'
icon_state = "generic" //Shows up as the action button icon
actions_types = list(/datum/action/item_action/hands_free/activate)
var/activated = TRUE //1 for implant types that can be activated, 0 for ones that are "always on" like mindshield implants
var/mob/living/imp_in = null
item_color = "b"
var/allow_multiple = FALSE
var/uses = -1
item_flags = DROPDEL
/obj/item/implant/proc/trigger(emote, mob/living/carbon/source)
return
/obj/item/implant/proc/on_death(emote, mob/living/carbon/source)
return
/obj/item/implant/proc/activate()
SEND_SIGNAL(src, COMSIG_IMPLANT_ACTIVATED)
/obj/item/implant/ui_action_click()
activate("action_button")
/obj/item/implant/proc/can_be_implanted_in(mob/living/target) // for human-only and other special requirements
return TRUE
/mob/living/proc/can_be_implanted()
return TRUE
/mob/living/silicon/can_be_implanted()
return FALSE
/mob/living/simple_animal/can_be_implanted()
return healable //Applies to robots and most non-organics, exceptions can override.
//What does the implant do upon injection?
//return 1 if the implant injects
//return 0 if there is no room for implant / it fails
/obj/item/implant/proc/implant(mob/living/target, mob/user, silent = FALSE)
if(SEND_SIGNAL(src, COMSIG_IMPLANT_IMPLANTING, args) & COMPONENT_STOP_IMPLANTING)
return
LAZYINITLIST(target.implants)
if(!target.can_be_implanted() || !can_be_implanted_in(target))
return FALSE
for(var/X in target.implants)
var/obj/item/implant/imp_e = X
var/flags = SEND_SIGNAL(imp_e, COMSIG_IMPLANT_OTHER, args, src)
if(flags & COMPONENT_DELETE_NEW_IMPLANT)
UNSETEMPTY(target.implants)
qdel(src)
return TRUE
if(flags & COMPONENT_DELETE_OLD_IMPLANT)
qdel(imp_e)
continue
if(flags & COMPONENT_STOP_IMPLANTING)
UNSETEMPTY(target.implants)
return FALSE
if(istype(imp_e, type))
if(!allow_multiple)
if(imp_e.uses < initial(imp_e.uses)*2)
if(uses == -1)
imp_e.uses = -1
else
imp_e.uses = min(imp_e.uses + uses, initial(imp_e.uses)*2)
qdel(src)
return TRUE
else
return FALSE
moveToNullspace()
imp_in = target
target.implants += src
if(activated)
for(var/X in actions)
var/datum/action/A = X
A.Grant(target)
if(ishuman(target))
var/mob/living/carbon/human/H = target
H.sec_hud_set_implants()
if(user)
log_combat(user, target, "implanted", "\a [name]")
return TRUE
/obj/item/implant/proc/removed(mob/living/source, silent = FALSE, special = 0)
SEND_SIGNAL(src, COMSIG_IMPLANT_REMOVING, args)
imp_in = null
source.implants -= src
for(var/X in actions)
var/datum/action/A = X
A.Remove(source)
if(ishuman(source))
var/mob/living/carbon/human/H = source
H.sec_hud_set_implants()
return 1
/obj/item/implant/Destroy()
if(imp_in)
removed(imp_in)
return ..()
/obj/item/implant/proc/get_data()
return "No information available about this implant."
/obj/item/implant/dropped(mob/user)
. = 1
..()
/obj/item/implant
name = "implant"
icon = 'icons/obj/implants.dmi'
icon_state = "generic" //Shows up as the action button icon
actions_types = list(/datum/action/item_action/hands_free/activate)
var/activated = TRUE //1 for implant types that can be activated, 0 for ones that are "always on" like mindshield implants
var/mob/living/imp_in = null
item_color = "b"
var/allow_multiple = FALSE
var/uses = -1
item_flags = DROPDEL
/obj/item/implant/proc/trigger(emote, mob/living/carbon/source)
return
/obj/item/implant/proc/on_death(emote, mob/living/carbon/source)
return
/obj/item/implant/proc/activate()
SEND_SIGNAL(src, COMSIG_IMPLANT_ACTIVATED)
/obj/item/implant/ui_action_click()
activate("action_button")
/obj/item/implant/proc/can_be_implanted_in(mob/living/target) // for human-only and other special requirements
return TRUE
/mob/living/proc/can_be_implanted()
return TRUE
/mob/living/silicon/can_be_implanted()
return FALSE
/mob/living/simple_animal/can_be_implanted()
return healable //Applies to robots and most non-organics, exceptions can override.
//What does the implant do upon injection?
//return 1 if the implant injects
//return 0 if there is no room for implant / it fails
/obj/item/implant/proc/implant(mob/living/target, mob/user, silent = FALSE)
if(SEND_SIGNAL(src, COMSIG_IMPLANT_IMPLANTING, args) & COMPONENT_STOP_IMPLANTING)
return
LAZYINITLIST(target.implants)
if(!target.can_be_implanted() || !can_be_implanted_in(target))
return FALSE
for(var/X in target.implants)
var/obj/item/implant/imp_e = X
var/flags = SEND_SIGNAL(imp_e, COMSIG_IMPLANT_OTHER, args, src)
if(flags & COMPONENT_DELETE_NEW_IMPLANT)
UNSETEMPTY(target.implants)
qdel(src)
return TRUE
if(flags & COMPONENT_DELETE_OLD_IMPLANT)
qdel(imp_e)
continue
if(flags & COMPONENT_STOP_IMPLANTING)
UNSETEMPTY(target.implants)
return FALSE
if(istype(imp_e, type))
if(!allow_multiple)
if(imp_e.uses < initial(imp_e.uses)*2)
if(uses == -1)
imp_e.uses = -1
else
imp_e.uses = min(imp_e.uses + uses, initial(imp_e.uses)*2)
qdel(src)
return TRUE
else
return FALSE
moveToNullspace()
imp_in = target
target.implants += src
if(activated)
for(var/X in actions)
var/datum/action/A = X
A.Grant(target)
if(ishuman(target))
var/mob/living/carbon/human/H = target
H.sec_hud_set_implants()
if(user)
log_combat(user, target, "implanted", "\a [name]")
return TRUE
/obj/item/implant/proc/removed(mob/living/source, silent = FALSE, special = 0)
SEND_SIGNAL(src, COMSIG_IMPLANT_REMOVING, args)
imp_in = null
source.implants -= src
for(var/X in actions)
var/datum/action/A = X
A.Remove(source)
if(ishuman(source))
var/mob/living/carbon/human/H = source
H.sec_hud_set_implants()
return 1
/obj/item/implant/Destroy()
if(imp_in)
removed(imp_in)
return ..()
/obj/item/implant/proc/get_data()
return "No information available about this implant."
/obj/item/implant/dropped(mob/user)
. = 1
..()
+83 -83
View File
@@ -1,83 +1,83 @@
/obj/item/implantcase
name = "implant case"
desc = "A glass case containing an implant."
icon = 'icons/obj/items_and_weapons.dmi'
icon_state = "implantcase-0"
item_state = "implantcase"
lefthand_file = 'icons/mob/inhands/equipment/medical_lefthand.dmi'
righthand_file = 'icons/mob/inhands/equipment/medical_righthand.dmi'
throw_speed = 2
throw_range = 5
w_class = WEIGHT_CLASS_TINY
materials = list(MAT_GLASS=500)
var/obj/item/implant/imp = null
var/imp_type
/obj/item/implantcase/update_icon()
if(imp)
icon_state = "implantcase-[imp.item_color]"
reagents = imp.reagents
else
icon_state = "implantcase-0"
reagents = null
/obj/item/implantcase/attackby(obj/item/W, mob/user, params)
if(istype(W, /obj/item/pen))
if(!user.is_literate())
to_chat(user, "<span class='notice'>You scribble illegibly on the side of [src]!</span>")
return
var/t = stripped_input(user, "What would you like the label to be?", name, null)
if(user.get_active_held_item() != W)
return
if(!user.canUseTopic(src, BE_CLOSE))
return
if(t)
name = "implant case - '[t]'"
else
name = "implant case"
else if(istype(W, /obj/item/implanter))
var/obj/item/implanter/I = W
if(I.imp)
if(imp || I.imp.imp_in)
return
I.imp.forceMove(src)
imp = I.imp
I.imp = null
update_icon()
I.update_icon()
else
if(imp)
if(I.imp)
return
imp.forceMove(I)
I.imp = imp
imp = null
update_icon()
I.update_icon()
else
return ..()
/obj/item/implantcase/Initialize(mapload)
. = ..()
if(imp_type)
imp = new imp_type(src)
update_icon()
/obj/item/implantcase/tracking
name = "implant case - 'Tracking'"
desc = "A glass case containing a tracking implant."
imp_type = /obj/item/implant/tracking
/obj/item/implantcase/weapons_auth
name = "implant case - 'Firearms Authentication'"
desc = "A glass case containing a firearms authentication implant."
imp_type = /obj/item/implant/weapons_auth
/obj/item/implantcase/adrenaline
name = "implant case - 'Adrenaline'"
desc = "A glass case containing an adrenaline implant."
imp_type = /obj/item/implant/adrenalin
/obj/item/implantcase
name = "implant case"
desc = "A glass case containing an implant."
icon = 'icons/obj/items_and_weapons.dmi'
icon_state = "implantcase-0"
item_state = "implantcase"
lefthand_file = 'icons/mob/inhands/equipment/medical_lefthand.dmi'
righthand_file = 'icons/mob/inhands/equipment/medical_righthand.dmi'
throw_speed = 2
throw_range = 5
w_class = WEIGHT_CLASS_TINY
materials = list(MAT_GLASS=500)
var/obj/item/implant/imp = null
var/imp_type
/obj/item/implantcase/update_icon()
if(imp)
icon_state = "implantcase-[imp.item_color]"
reagents = imp.reagents
else
icon_state = "implantcase-0"
reagents = null
/obj/item/implantcase/attackby(obj/item/W, mob/user, params)
if(istype(W, /obj/item/pen))
if(!user.is_literate())
to_chat(user, "<span class='notice'>You scribble illegibly on the side of [src]!</span>")
return
var/t = stripped_input(user, "What would you like the label to be?", name, null)
if(user.get_active_held_item() != W)
return
if(!user.canUseTopic(src, BE_CLOSE))
return
if(t)
name = "implant case - '[t]'"
else
name = "implant case"
else if(istype(W, /obj/item/implanter))
var/obj/item/implanter/I = W
if(I.imp)
if(imp || I.imp.imp_in)
return
I.imp.forceMove(src)
imp = I.imp
I.imp = null
update_icon()
I.update_icon()
else
if(imp)
if(I.imp)
return
imp.forceMove(I)
I.imp = imp
imp = null
update_icon()
I.update_icon()
else
return ..()
/obj/item/implantcase/Initialize(mapload)
. = ..()
if(imp_type)
imp = new imp_type(src)
update_icon()
/obj/item/implantcase/tracking
name = "implant case - 'Tracking'"
desc = "A glass case containing a tracking implant."
imp_type = /obj/item/implant/tracking
/obj/item/implantcase/weapons_auth
name = "implant case - 'Firearms Authentication'"
desc = "A glass case containing a firearms authentication implant."
imp_type = /obj/item/implant/weapons_auth
/obj/item/implantcase/adrenaline
name = "implant case - 'Adrenaline'"
desc = "A glass case containing an adrenaline implant."
imp_type = /obj/item/implant/adrenalin
+192 -192
View File
@@ -1,193 +1,193 @@
/obj/machinery/implantchair
name = "mindshield implanter"
desc = "Used to implant occupants with mindshield implants."
icon = 'icons/obj/machines/implantchair.dmi'
icon_state = "implantchair"
density = TRUE
opacity = 0
var/ready = TRUE
var/replenishing = FALSE
var/ready_implants = 5
var/max_implants = 5
var/injection_cooldown = 600
var/replenish_cooldown = 6000
var/implant_type = /obj/item/implant/mindshield
var/auto_inject = FALSE
var/auto_replenish = TRUE
var/special = FALSE
var/special_name = "special function"
var/message_cooldown
var/breakout_time = 600
/obj/machinery/implantchair/Initialize()
. = ..()
open_machine()
update_icon()
/obj/machinery/implantchair/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, datum/tgui/master_ui = null, datum/ui_state/state = GLOB.notcontained_state)
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
if(!ui)
ui = new(user, src, ui_key, "implantchair", name, 375, 280, master_ui, state)
ui.open()
/obj/machinery/implantchair/ui_data()
var/list/data = list()
data["occupied"] = occupant ? 1 : 0
data["open"] = state_open
data["occupant"] = list()
if(occupant)
var/mob/living/mob_occupant = occupant
data["occupant"]["name"] = mob_occupant.name
data["occupant"]["stat"] = mob_occupant.stat
data["special_name"] = special ? special_name : null
data["ready_implants"] = ready_implants
data["ready"] = ready
data["replenishing"] = replenishing
return data
/obj/machinery/implantchair/ui_act(action, params)
if(..())
return
switch(action)
if("door")
if(state_open)
close_machine()
else
open_machine()
. = TRUE
if("implant")
implant(occupant,usr)
. = TRUE
/obj/machinery/implantchair/proc/implant(mob/living/M,mob/user)
if (!istype(M))
return
if(!ready_implants || !ready)
return
if(implant_action(M,user))
ready_implants--
if(!replenishing && auto_replenish)
replenishing = TRUE
addtimer(CALLBACK(src,"replenish"),replenish_cooldown)
if(injection_cooldown > 0)
ready = FALSE
addtimer(CALLBACK(src,"set_ready"),injection_cooldown)
else
playsound(get_turf(src), 'sound/machines/buzz-sigh.ogg', 25, 1)
update_icon()
/obj/machinery/implantchair/proc/implant_action(mob/living/M)
var/obj/item/I = new implant_type
if(istype(I, /obj/item/implant))
var/obj/item/implant/P = I
if(P.implant(M))
visible_message("<span class='warning'>[M] has been implanted by [src].</span>")
return TRUE
else if(istype(I, /obj/item/organ))
var/obj/item/organ/P = I
P.Insert(M, drop_if_replaced = FALSE)
visible_message("<span class='warning'>[M] has been implanted by [src].</span>")
return TRUE
/obj/machinery/implantchair/update_icon()
icon_state = initial(icon_state)
if(state_open)
icon_state += "_open"
if(occupant)
icon_state += "_occupied"
if(ready)
add_overlay("ready")
else
cut_overlays()
/obj/machinery/implantchair/proc/replenish()
if(ready_implants < max_implants)
ready_implants++
if(ready_implants < max_implants)
addtimer(CALLBACK(src,"replenish"),replenish_cooldown)
else
replenishing = FALSE
/obj/machinery/implantchair/proc/set_ready()
ready = TRUE
update_icon()
/obj/machinery/implantchair/container_resist(mob/living/user)
user.changeNext_move(CLICK_CD_BREAKOUT)
user.last_special = world.time + CLICK_CD_BREAKOUT
user.visible_message("<span class='notice'>You see [user] kicking against the door of [src]!</span>", \
"<span class='notice'>You lean on the back of [src] and start pushing the door open... (this will take about [DisplayTimeText(breakout_time)].)</span>", \
"<span class='italics'>You hear a metallic creaking from [src].</span>")
if(do_after(user,(breakout_time), target = src))
if(!user || user.stat != CONSCIOUS || user.loc != src || state_open)
return
user.visible_message("<span class='warning'>[user] successfully broke out of [src]!</span>", \
"<span class='notice'>You successfully break out of [src]!</span>")
open_machine()
/obj/machinery/implantchair/relaymove(mob/user)
if(message_cooldown <= world.time)
message_cooldown = world.time + 50
to_chat(user, "<span class='warning'>[src]'s door won't budge!</span>")
/obj/machinery/implantchair/MouseDrop_T(mob/target, mob/user)
if(user.stat || user.lying || !Adjacent(user) || !user.Adjacent(target) || !isliving(target) || !user.IsAdvancedToolUser())
return
close_machine(target)
/obj/machinery/implantchair/close_machine(mob/living/user)
if((isnull(user) || istype(user)) && state_open)
..(user)
if(auto_inject && ready && ready_implants > 0)
implant(user,null)
/obj/machinery/implantchair/genepurge
name = "Genetic purifier"
desc = "Used to purge a human genome of foreign influences."
special = TRUE
special_name = "Purge genome"
injection_cooldown = 0
replenish_cooldown = 300
/obj/machinery/implantchair/genepurge/implant_action(mob/living/carbon/human/H,mob/user)
if(!istype(H))
return 0
H.set_species(/datum/species/human, 1)//lizards go home
purrbation_remove(H)//remove cats
H.dna.remove_all_mutations()//hulks out
return 1
/obj/machinery/implantchair/brainwash
name = "Neural Imprinter"
desc = "Used to <s>indoctrinate</s> rehabilitate hardened recidivists."
special_name = "Imprint"
injection_cooldown = 3000
auto_inject = FALSE
auto_replenish = FALSE
special = TRUE
var/objective = "Obey the law. Praise Nanotrasen."
var/custom = FALSE
/obj/machinery/implantchair/brainwash/implant_action(mob/living/C,mob/user)
if(!istype(C) || !C.mind) // I don't know how this makes any sense for silicons but laws trump objectives anyway.
return FALSE
if(custom)
if(!user || !user.Adjacent(src))
return FALSE
objective = stripped_input(usr,"What order do you want to imprint on [C]?","Enter the order","",120)
message_admins("[ADMIN_LOOKUPFLW(user)] set brainwash machine objective to '[objective]'.")
log_game("[key_name(user)] set brainwash machine objective to '[objective]'.")
if(HAS_TRAIT(C, TRAIT_MINDSHIELD))
return FALSE
brainwash(C, objective)
message_admins("[ADMIN_LOOKUPFLW(user)] brainwashed [key_name_admin(C)] with objective '[objective]'.")
log_game("[key_name(user)] brainwashed [key_name(C)] with objective '[objective]'.")
/obj/machinery/implantchair
name = "mindshield implanter"
desc = "Used to implant occupants with mindshield implants."
icon = 'icons/obj/machines/implantchair.dmi'
icon_state = "implantchair"
density = TRUE
opacity = 0
var/ready = TRUE
var/replenishing = FALSE
var/ready_implants = 5
var/max_implants = 5
var/injection_cooldown = 600
var/replenish_cooldown = 6000
var/implant_type = /obj/item/implant/mindshield
var/auto_inject = FALSE
var/auto_replenish = TRUE
var/special = FALSE
var/special_name = "special function"
var/message_cooldown
var/breakout_time = 600
/obj/machinery/implantchair/Initialize()
. = ..()
open_machine()
update_icon()
/obj/machinery/implantchair/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, datum/tgui/master_ui = null, datum/ui_state/state = GLOB.notcontained_state)
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
if(!ui)
ui = new(user, src, ui_key, "implantchair", name, 375, 280, master_ui, state)
ui.open()
/obj/machinery/implantchair/ui_data()
var/list/data = list()
data["occupied"] = occupant ? 1 : 0
data["open"] = state_open
data["occupant"] = list()
if(occupant)
var/mob/living/mob_occupant = occupant
data["occupant"]["name"] = mob_occupant.name
data["occupant"]["stat"] = mob_occupant.stat
data["special_name"] = special ? special_name : null
data["ready_implants"] = ready_implants
data["ready"] = ready
data["replenishing"] = replenishing
return data
/obj/machinery/implantchair/ui_act(action, params)
if(..())
return
switch(action)
if("door")
if(state_open)
close_machine()
else
open_machine()
. = TRUE
if("implant")
implant(occupant,usr)
. = TRUE
/obj/machinery/implantchair/proc/implant(mob/living/M,mob/user)
if (!istype(M))
return
if(!ready_implants || !ready)
return
if(implant_action(M,user))
ready_implants--
if(!replenishing && auto_replenish)
replenishing = TRUE
addtimer(CALLBACK(src,"replenish"),replenish_cooldown)
if(injection_cooldown > 0)
ready = FALSE
addtimer(CALLBACK(src,"set_ready"),injection_cooldown)
else
playsound(get_turf(src), 'sound/machines/buzz-sigh.ogg', 25, 1)
update_icon()
/obj/machinery/implantchair/proc/implant_action(mob/living/M)
var/obj/item/I = new implant_type
if(istype(I, /obj/item/implant))
var/obj/item/implant/P = I
if(P.implant(M))
visible_message("<span class='warning'>[M] has been implanted by [src].</span>")
return TRUE
else if(istype(I, /obj/item/organ))
var/obj/item/organ/P = I
P.Insert(M, drop_if_replaced = FALSE)
visible_message("<span class='warning'>[M] has been implanted by [src].</span>")
return TRUE
/obj/machinery/implantchair/update_icon()
icon_state = initial(icon_state)
if(state_open)
icon_state += "_open"
if(occupant)
icon_state += "_occupied"
if(ready)
add_overlay("ready")
else
cut_overlays()
/obj/machinery/implantchair/proc/replenish()
if(ready_implants < max_implants)
ready_implants++
if(ready_implants < max_implants)
addtimer(CALLBACK(src,"replenish"),replenish_cooldown)
else
replenishing = FALSE
/obj/machinery/implantchair/proc/set_ready()
ready = TRUE
update_icon()
/obj/machinery/implantchair/container_resist(mob/living/user)
user.changeNext_move(CLICK_CD_BREAKOUT)
user.last_special = world.time + CLICK_CD_BREAKOUT
user.visible_message("<span class='notice'>You see [user] kicking against the door of [src]!</span>", \
"<span class='notice'>You lean on the back of [src] and start pushing the door open... (this will take about [DisplayTimeText(breakout_time)].)</span>", \
"<span class='italics'>You hear a metallic creaking from [src].</span>")
if(do_after(user,(breakout_time), target = src))
if(!user || user.stat != CONSCIOUS || user.loc != src || state_open)
return
user.visible_message("<span class='warning'>[user] successfully broke out of [src]!</span>", \
"<span class='notice'>You successfully break out of [src]!</span>")
open_machine()
/obj/machinery/implantchair/relaymove(mob/user)
if(message_cooldown <= world.time)
message_cooldown = world.time + 50
to_chat(user, "<span class='warning'>[src]'s door won't budge!</span>")
/obj/machinery/implantchair/MouseDrop_T(mob/target, mob/user)
if(user.stat || user.lying || !Adjacent(user) || !user.Adjacent(target) || !isliving(target) || !user.IsAdvancedToolUser())
return
close_machine(target)
/obj/machinery/implantchair/close_machine(mob/living/user)
if((isnull(user) || istype(user)) && state_open)
..(user)
if(auto_inject && ready && ready_implants > 0)
implant(user,null)
/obj/machinery/implantchair/genepurge
name = "Genetic purifier"
desc = "Used to purge a human genome of foreign influences."
special = TRUE
special_name = "Purge genome"
injection_cooldown = 0
replenish_cooldown = 300
/obj/machinery/implantchair/genepurge/implant_action(mob/living/carbon/human/H,mob/user)
if(!istype(H))
return 0
H.set_species(/datum/species/human, 1)//lizards go home
purrbation_remove(H)//remove cats
H.dna.remove_all_mutations()//hulks out
return 1
/obj/machinery/implantchair/brainwash
name = "Neural Imprinter"
desc = "Used to <s>indoctrinate</s> rehabilitate hardened recidivists."
special_name = "Imprint"
injection_cooldown = 3000
auto_inject = FALSE
auto_replenish = FALSE
special = TRUE
var/objective = "Obey the law. Praise Nanotrasen."
var/custom = FALSE
/obj/machinery/implantchair/brainwash/implant_action(mob/living/C,mob/user)
if(!istype(C) || !C.mind) // I don't know how this makes any sense for silicons but laws trump objectives anyway.
return FALSE
if(custom)
if(!user || !user.Adjacent(src))
return FALSE
objective = stripped_input(usr,"What order do you want to imprint on [C]?","Enter the order","",120)
message_admins("[ADMIN_LOOKUPFLW(user)] set brainwash machine objective to '[objective]'.")
log_game("[key_name(user)] set brainwash machine objective to '[objective]'.")
if(HAS_TRAIT(C, TRAIT_MINDSHIELD))
return FALSE
brainwash(C, objective)
message_admins("[ADMIN_LOOKUPFLW(user)] brainwashed [key_name_admin(C)] with objective '[objective]'.")
log_game("[key_name(user)] brainwashed [key_name(C)] with objective '[objective]'.")
return TRUE
+76 -76
View File
@@ -1,77 +1,77 @@
/obj/item/implanter
name = "implanter"
desc = "A sterile automatic implant injector."
icon = 'icons/obj/items_and_weapons.dmi'
icon_state = "implanter0"
item_state = "syringe_0"
lefthand_file = 'icons/mob/inhands/equipment/medical_lefthand.dmi'
righthand_file = 'icons/mob/inhands/equipment/medical_righthand.dmi'
throw_speed = 3
throw_range = 5
w_class = WEIGHT_CLASS_SMALL
materials = list(MAT_METAL=600, MAT_GLASS=200)
var/obj/item/implant/imp = null
var/imp_type = null
/obj/item/implanter/update_icon()
if(imp)
icon_state = "implanter1"
else
icon_state = "implanter0"
/obj/item/implanter/attack(mob/living/M, mob/user)
if(!istype(M))
return
if(user && imp)
if(M != user)
M.visible_message("<span class='warning'>[user] is attempting to implant [M].</span>")
var/turf/T = get_turf(M)
if(T && (M == user || do_mob(user, M, 50)))
if(src && imp)
if(imp.implant(M, user))
if (M == user)
to_chat(user, "<span class='notice'>You implant yourself.</span>")
else
M.visible_message("[user] has implanted [M].", "<span class='notice'>[user] implants you.</span>")
imp = null
update_icon()
else
to_chat(user, "<span class='warning'>[src] fails to implant [M].</span>")
/obj/item/implanter/attackby(obj/item/W, mob/user, params)
if(istype(W, /obj/item/pen))
if(!user.is_literate())
to_chat(user, "<span class='notice'>You prod at [src] with [W]!</span>")
return
var/t = stripped_input(user, "What would you like the label to be?", name, null)
if(user.get_active_held_item() != W)
return
if(!user.canUseTopic(src, BE_CLOSE))
return
if(t)
name = "implanter ([t])"
else
name = "implanter"
else
return ..()
/obj/item/implanter/Initialize(mapload)
. = ..()
if(imp_type)
imp = new imp_type(src)
update_icon()
/obj/item/implanter/adrenalin
name = "implanter (adrenalin)"
imp_type = /obj/item/implant/adrenalin
/obj/item/implanter/emp
name = "implanter (EMP)"
imp_type = /obj/item/implant/emp
/obj/item/implanter/stealth
name = "implanter (stealth)"
/obj/item/implanter
name = "implanter"
desc = "A sterile automatic implant injector."
icon = 'icons/obj/items_and_weapons.dmi'
icon_state = "implanter0"
item_state = "syringe_0"
lefthand_file = 'icons/mob/inhands/equipment/medical_lefthand.dmi'
righthand_file = 'icons/mob/inhands/equipment/medical_righthand.dmi'
throw_speed = 3
throw_range = 5
w_class = WEIGHT_CLASS_SMALL
materials = list(MAT_METAL=600, MAT_GLASS=200)
var/obj/item/implant/imp = null
var/imp_type = null
/obj/item/implanter/update_icon()
if(imp)
icon_state = "implanter1"
else
icon_state = "implanter0"
/obj/item/implanter/attack(mob/living/M, mob/user)
if(!istype(M))
return
if(user && imp)
if(M != user)
M.visible_message("<span class='warning'>[user] is attempting to implant [M].</span>")
var/turf/T = get_turf(M)
if(T && (M == user || do_mob(user, M, 50)))
if(src && imp)
if(imp.implant(M, user))
if (M == user)
to_chat(user, "<span class='notice'>You implant yourself.</span>")
else
M.visible_message("[user] has implanted [M].", "<span class='notice'>[user] implants you.</span>")
imp = null
update_icon()
else
to_chat(user, "<span class='warning'>[src] fails to implant [M].</span>")
/obj/item/implanter/attackby(obj/item/W, mob/user, params)
if(istype(W, /obj/item/pen))
if(!user.is_literate())
to_chat(user, "<span class='notice'>You prod at [src] with [W]!</span>")
return
var/t = stripped_input(user, "What would you like the label to be?", name, null)
if(user.get_active_held_item() != W)
return
if(!user.canUseTopic(src, BE_CLOSE))
return
if(t)
name = "implanter ([t])"
else
name = "implanter"
else
return ..()
/obj/item/implanter/Initialize(mapload)
. = ..()
if(imp_type)
imp = new imp_type(src)
update_icon()
/obj/item/implanter/adrenalin
name = "implanter (adrenalin)"
imp_type = /obj/item/implant/adrenalin
/obj/item/implanter/emp
name = "implanter (EMP)"
imp_type = /obj/item/implant/emp
/obj/item/implanter/stealth
name = "implanter (stealth)"
imp_type = /obj/item/implant/stealth
+183 -183
View File
@@ -1,183 +1,183 @@
/* Kitchen tools
* Contains:
* Fork
* Kitchen knives
* Ritual Knife
* Butcher's cleaver
* Combat Knife
* Rolling Pins
*/
/obj/item/kitchen
icon = 'icons/obj/kitchen.dmi'
lefthand_file = 'icons/mob/inhands/equipment/kitchen_lefthand.dmi'
righthand_file = 'icons/mob/inhands/equipment/kitchen_righthand.dmi'
/obj/item/kitchen/fork
name = "fork"
desc = "Pointy."
icon_state = "fork"
force = 5
w_class = WEIGHT_CLASS_TINY
throwforce = 0
throw_speed = 3
throw_range = 5
materials = list(MAT_METAL=80)
flags_1 = CONDUCT_1
attack_verb = list("attacked", "stabbed", "poked")
hitsound = 'sound/weapons/bladeslice.ogg'
armor = list("melee" = 0, "bullet" = 0, "laser" = 0, "energy" = 0, "bomb" = 0, "bio" = 0, "rad" = 0, "fire" = 50, "acid" = 30)
var/datum/reagent/forkload //used to eat omelette
/obj/item/kitchen/fork/suicide_act(mob/living/carbon/user)
user.visible_message("<span class='suicide'>[user] stabs \the [src] into [user.p_their()] chest! It looks like [user.p_theyre()] trying to take a bite out of [user.p_them()]self!</span>")
playsound(src, 'sound/items/eatfood.ogg', 50, 1)
return BRUTELOSS
/obj/item/kitchen/fork/attack(mob/living/carbon/M, mob/living/carbon/user)
if(!istype(M))
return ..()
if(forkload)
if(M == user)
M.visible_message("<span class='notice'>[user] eats a delicious forkful of omelette!</span>")
M.reagents.add_reagent(forkload.type, 1)
else
M.visible_message("<span class='notice'>[user] feeds [M] a delicious forkful of omelette!</span>")
M.reagents.add_reagent(forkload.type, 1)
icon_state = "fork"
forkload = null
else if(user.zone_selected == BODY_ZONE_PRECISE_EYES)
return eyestab(M,user)
else
return ..()
/obj/item/kitchen/knife
name = "kitchen knife"
icon_state = "knife"
desc = "A general purpose Chef's Knife made by SpaceCook Incorporated. Guaranteed to stay sharp for years to come."
flags_1 = CONDUCT_1
force = 10
w_class = WEIGHT_CLASS_SMALL
throwforce = 10
hitsound = 'sound/weapons/bladeslice.ogg'
throw_speed = 3
throw_range = 6
materials = list(MAT_METAL=12000)
attack_verb = list("slashed", "stabbed", "sliced", "torn", "ripped", "diced", "cut")
sharpness = IS_SHARP_ACCURATE
armor = list("melee" = 0, "bullet" = 0, "laser" = 0, "energy" = 0, "bomb" = 0, "bio" = 0, "rad" = 0, "fire" = 50, "acid" = 50)
var/bayonet = FALSE //Can this be attached to a gun?
/obj/item/kitchen/knife/Initialize()
. = ..()
AddComponent(/datum/component/butchering, 80 - force, 100, force - 10) //bonus chance increases depending on force
/obj/item/kitchen/knife/attack(mob/living/carbon/M, mob/living/carbon/user)
if(user.zone_selected == BODY_ZONE_PRECISE_EYES)
return eyestab(M,user)
else
return ..()
/obj/item/kitchen/knife/suicide_act(mob/user)
user.visible_message(pick("<span class='suicide'>[user] is slitting [user.p_their()] wrists with the [src.name]! It looks like [user.p_theyre()] trying to commit suicide.</span>", \
"<span class='suicide'>[user] is slitting [user.p_their()] throat with the [src.name]! It looks like [user.p_theyre()] trying to commit suicide.</span>", \
"<span class='suicide'>[user] is slitting [user.p_their()] stomach open with the [src.name]! It looks like [user.p_theyre()] trying to commit seppuku.</span>"))
return (BRUTELOSS)
/obj/item/kitchen/knife/ritual
name = "ritual knife"
desc = "The unearthly energies that once powered this blade are now dormant."
icon = 'icons/obj/wizard.dmi'
icon_state = "render"
item_state = "knife"
lefthand_file = 'icons/mob/inhands/equipment/kitchen_lefthand.dmi'
righthand_file = 'icons/mob/inhands/equipment/kitchen_righthand.dmi'
w_class = WEIGHT_CLASS_NORMAL
/obj/item/kitchen/knife/butcher
name = "butcher's cleaver"
icon_state = "butch"
desc = "A huge thing used for chopping and chopping up meat. This includes clowns and clown by-products."
flags_1 = CONDUCT_1
force = 15
throwforce = 10
materials = list(MAT_METAL=18000)
attack_verb = list("cleaved", "slashed", "stabbed", "sliced", "torn", "ripped", "diced", "cut")
w_class = WEIGHT_CLASS_NORMAL
/obj/item/kitchen/knife/combat
name = "combat knife"
icon_state = "buckknife"
item_state = "knife"
desc = "A military combat utility survival knife."
force = 20
throwforce = 20
attack_verb = list("slashed", "stabbed", "sliced", "torn", "ripped", "cut")
bayonet = TRUE
/obj/item/kitchen/knife/combat/survival
name = "survival knife"
icon_state = "survivalknife"
item_state = "knife"
desc = "A hunting grade survival knife."
force = 15
throwforce = 15
bayonet = TRUE
/obj/item/kitchen/knife/combat/bone
name = "bone dagger"
item_state = "bone_dagger"
icon_state = "bone_dagger"
lefthand_file = 'icons/mob/inhands/weapons/swords_lefthand.dmi'
righthand_file = 'icons/mob/inhands/weapons/swords_righthand.dmi'
desc = "A sharpened bone. The bare minimum in survival."
force = 15
throwforce = 15
materials = list()
/obj/item/kitchen/knife/combat/cyborg
name = "cyborg knife"
icon = 'icons/obj/items_cyborg.dmi'
icon_state = "knife"
desc = "A cyborg-mounted plasteel knife. Extremely sharp and durable."
/obj/item/kitchen/knife/carrotshiv
name = "carrot shiv"
icon_state = "carrotshiv"
item_state = "carrotshiv"
lefthand_file = 'icons/mob/inhands/weapons/swords_lefthand.dmi'
righthand_file = 'icons/mob/inhands/weapons/swords_righthand.dmi'
desc = "Unlike other carrots, you should probably keep this far away from your eyes."
force = 8
throwforce = 12//fuck git
materials = list()
attack_verb = list("shanked", "shivved")
armor = list("melee" = 0, "bullet" = 0, "laser" = 0, "energy" = 0, "bomb" = 0, "bio" = 0, "rad" = 0, "fire" = 0, "acid" = 0)
/obj/item/kitchen/rollingpin
name = "rolling pin"
desc = "Used to knock out the Bartender."
icon_state = "rolling_pin"
force = 8
throwforce = 5
throw_speed = 3
throw_range = 7
w_class = WEIGHT_CLASS_NORMAL
attack_verb = list("bashed", "battered", "bludgeoned", "thrashed", "whacked")
/obj/item/kitchen/rollingpin/suicide_act(mob/living/carbon/user)
user.visible_message("<span class='suicide'>[user] begins flattening [user.p_their()] head with \the [src]! It looks like [user.p_theyre()] trying to commit suicide!</span>")
return BRUTELOSS
/* Trays moved to /obj/item/storage/bag */
/obj/item/kitchen/knife/scimitar
name = "Scimitar knife"
desc = "A knife used to cleanly butcher. Its razor-sharp edge has been honed for butchering, but has been poorly maintained over the years."
attack_verb = list("cleaved", "slashed", "stabbed", "sliced", "torn", "ripped", "diced", "cut")
/obj/item/kitchen/knife/scimiar/Initialize()
. = ..()
AddComponent(/datum/component/butchering, 90 - force, 100, force - 60) //bonus chance increases depending on force
/* Kitchen tools
* Contains:
* Fork
* Kitchen knives
* Ritual Knife
* Butcher's cleaver
* Combat Knife
* Rolling Pins
*/
/obj/item/kitchen
icon = 'icons/obj/kitchen.dmi'
lefthand_file = 'icons/mob/inhands/equipment/kitchen_lefthand.dmi'
righthand_file = 'icons/mob/inhands/equipment/kitchen_righthand.dmi'
/obj/item/kitchen/fork
name = "fork"
desc = "Pointy."
icon_state = "fork"
force = 5
w_class = WEIGHT_CLASS_TINY
throwforce = 0
throw_speed = 3
throw_range = 5
materials = list(MAT_METAL=80)
flags_1 = CONDUCT_1
attack_verb = list("attacked", "stabbed", "poked")
hitsound = 'sound/weapons/bladeslice.ogg'
armor = list("melee" = 0, "bullet" = 0, "laser" = 0, "energy" = 0, "bomb" = 0, "bio" = 0, "rad" = 0, "fire" = 50, "acid" = 30)
var/datum/reagent/forkload //used to eat omelette
/obj/item/kitchen/fork/suicide_act(mob/living/carbon/user)
user.visible_message("<span class='suicide'>[user] stabs \the [src] into [user.p_their()] chest! It looks like [user.p_theyre()] trying to take a bite out of [user.p_them()]self!</span>")
playsound(src, 'sound/items/eatfood.ogg', 50, 1)
return BRUTELOSS
/obj/item/kitchen/fork/attack(mob/living/carbon/M, mob/living/carbon/user)
if(!istype(M))
return ..()
if(forkload)
if(M == user)
M.visible_message("<span class='notice'>[user] eats a delicious forkful of omelette!</span>")
M.reagents.add_reagent(forkload.type, 1)
else
M.visible_message("<span class='notice'>[user] feeds [M] a delicious forkful of omelette!</span>")
M.reagents.add_reagent(forkload.type, 1)
icon_state = "fork"
forkload = null
else if(user.zone_selected == BODY_ZONE_PRECISE_EYES)
return eyestab(M,user)
else
return ..()
/obj/item/kitchen/knife
name = "kitchen knife"
icon_state = "knife"
desc = "A general purpose Chef's Knife made by SpaceCook Incorporated. Guaranteed to stay sharp for years to come."
flags_1 = CONDUCT_1
force = 10
w_class = WEIGHT_CLASS_SMALL
throwforce = 10
hitsound = 'sound/weapons/bladeslice.ogg'
throw_speed = 3
throw_range = 6
materials = list(MAT_METAL=12000)
attack_verb = list("slashed", "stabbed", "sliced", "torn", "ripped", "diced", "cut")
sharpness = IS_SHARP_ACCURATE
armor = list("melee" = 0, "bullet" = 0, "laser" = 0, "energy" = 0, "bomb" = 0, "bio" = 0, "rad" = 0, "fire" = 50, "acid" = 50)
var/bayonet = FALSE //Can this be attached to a gun?
/obj/item/kitchen/knife/Initialize()
. = ..()
AddComponent(/datum/component/butchering, 80 - force, 100, force - 10) //bonus chance increases depending on force
/obj/item/kitchen/knife/attack(mob/living/carbon/M, mob/living/carbon/user)
if(user.zone_selected == BODY_ZONE_PRECISE_EYES)
return eyestab(M,user)
else
return ..()
/obj/item/kitchen/knife/suicide_act(mob/user)
user.visible_message(pick("<span class='suicide'>[user] is slitting [user.p_their()] wrists with the [src.name]! It looks like [user.p_theyre()] trying to commit suicide.</span>", \
"<span class='suicide'>[user] is slitting [user.p_their()] throat with the [src.name]! It looks like [user.p_theyre()] trying to commit suicide.</span>", \
"<span class='suicide'>[user] is slitting [user.p_their()] stomach open with the [src.name]! It looks like [user.p_theyre()] trying to commit seppuku.</span>"))
return (BRUTELOSS)
/obj/item/kitchen/knife/ritual
name = "ritual knife"
desc = "The unearthly energies that once powered this blade are now dormant."
icon = 'icons/obj/wizard.dmi'
icon_state = "render"
item_state = "knife"
lefthand_file = 'icons/mob/inhands/equipment/kitchen_lefthand.dmi'
righthand_file = 'icons/mob/inhands/equipment/kitchen_righthand.dmi'
w_class = WEIGHT_CLASS_NORMAL
/obj/item/kitchen/knife/butcher
name = "butcher's cleaver"
icon_state = "butch"
desc = "A huge thing used for chopping and chopping up meat. This includes clowns and clown by-products."
flags_1 = CONDUCT_1
force = 15
throwforce = 10
materials = list(MAT_METAL=18000)
attack_verb = list("cleaved", "slashed", "stabbed", "sliced", "torn", "ripped", "diced", "cut")
w_class = WEIGHT_CLASS_NORMAL
/obj/item/kitchen/knife/combat
name = "combat knife"
icon_state = "buckknife"
item_state = "knife"
desc = "A military combat utility survival knife."
force = 20
throwforce = 20
attack_verb = list("slashed", "stabbed", "sliced", "torn", "ripped", "cut")
bayonet = TRUE
/obj/item/kitchen/knife/combat/survival
name = "survival knife"
icon_state = "survivalknife"
item_state = "knife"
desc = "A hunting grade survival knife."
force = 15
throwforce = 15
bayonet = TRUE
/obj/item/kitchen/knife/combat/bone
name = "bone dagger"
item_state = "bone_dagger"
icon_state = "bone_dagger"
lefthand_file = 'icons/mob/inhands/weapons/swords_lefthand.dmi'
righthand_file = 'icons/mob/inhands/weapons/swords_righthand.dmi'
desc = "A sharpened bone. The bare minimum in survival."
force = 15
throwforce = 15
materials = list()
/obj/item/kitchen/knife/combat/cyborg
name = "cyborg knife"
icon = 'icons/obj/items_cyborg.dmi'
icon_state = "knife"
desc = "A cyborg-mounted plasteel knife. Extremely sharp and durable."
/obj/item/kitchen/knife/carrotshiv
name = "carrot shiv"
icon_state = "carrotshiv"
item_state = "carrotshiv"
lefthand_file = 'icons/mob/inhands/weapons/swords_lefthand.dmi'
righthand_file = 'icons/mob/inhands/weapons/swords_righthand.dmi'
desc = "Unlike other carrots, you should probably keep this far away from your eyes."
force = 8
throwforce = 12//fuck git
materials = list()
attack_verb = list("shanked", "shivved")
armor = list("melee" = 0, "bullet" = 0, "laser" = 0, "energy" = 0, "bomb" = 0, "bio" = 0, "rad" = 0, "fire" = 0, "acid" = 0)
/obj/item/kitchen/rollingpin
name = "rolling pin"
desc = "Used to knock out the Bartender."
icon_state = "rolling_pin"
force = 8
throwforce = 5
throw_speed = 3
throw_range = 7
w_class = WEIGHT_CLASS_NORMAL
attack_verb = list("bashed", "battered", "bludgeoned", "thrashed", "whacked")
/obj/item/kitchen/rollingpin/suicide_act(mob/living/carbon/user)
user.visible_message("<span class='suicide'>[user] begins flattening [user.p_their()] head with \the [src]! It looks like [user.p_theyre()] trying to commit suicide!</span>")
return BRUTELOSS
/* Trays moved to /obj/item/storage/bag */
/obj/item/kitchen/knife/scimitar
name = "Scimitar knife"
desc = "A knife used to cleanly butcher. Its razor-sharp edge has been honed for butchering, but has been poorly maintained over the years."
attack_verb = list("cleaved", "slashed", "stabbed", "sliced", "torn", "ripped", "diced", "cut")
/obj/item/kitchen/knife/scimiar/Initialize()
. = ..()
AddComponent(/datum/component/butchering, 90 - force, 100, force - 60) //bonus chance increases depending on force
File diff suppressed because it is too large Load Diff
+386 -386
View File
@@ -1,386 +1,386 @@
/obj/item/melee/transforming/energy
hitsound_on = 'sound/weapons/blade1.ogg'
heat = 3500
max_integrity = 200
armor = list("melee" = 0, "bullet" = 0, "laser" = 0, "energy" = 0, "bomb" = 0, "bio" = 0, "rad" = 0, "fire" = 100, "acid" = 30)
resistance_flags = FIRE_PROOF
var/brightness_on = 3
total_mass = 0.4 //Survival flashlights typically weigh around 5 ounces.
/obj/item/melee/transforming/energy/Initialize()
. = ..()
total_mass_on = (total_mass_on ? total_mass_on : (w_class_on * 0.75))
if(active)
set_light(brightness_on)
START_PROCESSING(SSobj, src)
/obj/item/melee/transforming/energy/Destroy()
STOP_PROCESSING(SSobj, src)
return ..()
/obj/item/melee/transforming/energy/suicide_act(mob/user)
if(!active)
transform_weapon(user, TRUE)
user.visible_message("<span class='suicide'>[user] is [pick("slitting [user.p_their()] stomach open with", "falling on")] [src]! It looks like [user.p_theyre()] trying to commit seppuku!</span>")
return (BRUTELOSS|FIRELOSS)
/obj/item/melee/transforming/energy/add_blood_DNA(list/blood_dna)
return FALSE
/obj/item/melee/transforming/energy/get_sharpness()
return active * sharpness
/obj/item/melee/transforming/energy/process()
open_flame()
/obj/item/melee/transforming/energy/transform_weapon(mob/living/user, supress_message_text)
. = ..()
if(.)
if(active)
if(item_color)
icon_state = "sword[item_color]"
START_PROCESSING(SSobj, src)
set_light(brightness_on)
else
STOP_PROCESSING(SSobj, src)
set_light(0)
/obj/item/melee/transforming/energy/get_temperature()
return active * heat
/obj/item/melee/transforming/energy/ignition_effect(atom/A, mob/user)
if(!active)
return ""
var/in_mouth = ""
if(iscarbon(user))
var/mob/living/carbon/C = user
if(C.wear_mask)
in_mouth = ", barely missing [C.p_their()] nose"
. = "<span class='warning'>[user] swings [user.p_their()] [name][in_mouth]. [user.p_they(TRUE)] light[user.p_s()] [user.p_their()] [A.name] in the process.</span>"
playsound(loc, hitsound, get_clamped_volume(), 1, -1)
add_fingerprint(user)
/obj/item/melee/transforming/energy/axe
name = "energy axe"
desc = "An energized battle axe."
icon_state = "axe0"
lefthand_file = 'icons/mob/inhands/weapons/axes_lefthand.dmi'
righthand_file = 'icons/mob/inhands/weapons/axes_righthand.dmi'
force = 40
force_on = 150
throwforce = 25
throwforce_on = 30
hitsound = 'sound/weapons/bladeslice.ogg'
throw_speed = 3
throw_range = 5
w_class = WEIGHT_CLASS_NORMAL
w_class_on = WEIGHT_CLASS_HUGE
flags_1 = CONDUCT_1
armour_penetration = 100
attack_verb_off = list("attacked", "chopped", "cleaved", "torn", "cut")
attack_verb_on = list()
light_color = "#40ceff"
total_mass = null
/obj/item/melee/transforming/energy/axe/suicide_act(mob/user)
user.visible_message("<span class='suicide'>[user] swings [src] towards [user.p_their()] head! It looks like [user.p_theyre()] trying to commit suicide!</span>")
return (BRUTELOSS|FIRELOSS)
/obj/item/melee/transforming/energy/sword
name = "energy sword"
desc = "May the force be within you."
icon_state = "sword0"
lefthand_file = 'icons/mob/inhands/weapons/swords_lefthand.dmi'
righthand_file = 'icons/mob/inhands/weapons/swords_righthand.dmi'
force = 3
throwforce = 5
hitsound = "swing_hit" //it starts deactivated
attack_verb_off = list("tapped", "poked")
throw_speed = 3
throw_range = 5
sharpness = IS_SHARP
embedding = list("embed_chance" = 75, "embedded_impact_pain_multiplier" = 10)
armour_penetration = 35
block_chance = 50
/obj/item/melee/transforming/energy/sword/transform_weapon(mob/living/user, supress_message_text)
. = ..()
if(. && active && item_color)
icon_state = "sword[item_color]"
/obj/item/melee/transforming/energy/sword/hit_reaction(mob/living/carbon/human/owner, atom/movable/hitby, attack_text = "the attack", final_block_chance = 0, damage = 0, attack_type = MELEE_ATTACK)
if(active)
return ..()
return 0
/obj/item/melee/transforming/energy/sword/cyborg
item_color = "red"
var/hitcost = 50
/obj/item/melee/transforming/energy/sword/cyborg/attack(mob/M, var/mob/living/silicon/robot/R)
if(R.cell)
var/obj/item/stock_parts/cell/C = R.cell
if(active && !(C.use(hitcost)))
attack_self(R)
to_chat(R, "<span class='notice'>It's out of charge!</span>")
return
return ..()
/obj/item/melee/transforming/energy/sword/cyborg/saw //Used by medical Syndicate cyborgs
name = "energy saw"
desc = "For heavy duty cutting. It has a carbon-fiber blade in addition to a toggleable hard-light edge to dramatically increase sharpness."
force_on = 30
force = 18 //About as much as a spear
hitsound = 'sound/weapons/circsawhit.ogg'
icon = 'icons/obj/surgery.dmi'
icon_state = "esaw_0"
icon_state_on = "esaw_1"
item_color = null //stops icon from breaking when turned on.
hitcost = 75 //Costs more than a standard cyborg esword
w_class = WEIGHT_CLASS_NORMAL
sharpness = IS_SHARP
light_color = "#40ceff"
tool_behaviour = TOOL_SAW
toolspeed = 0.7
/obj/item/melee/transforming/energy/sword/cyborg/saw/hit_reaction(mob/living/carbon/human/owner, atom/movable/hitby, attack_text = "the attack", final_block_chance = 0, damage = 0, attack_type = MELEE_ATTACK)
return 0
/obj/item/melee/transforming/energy/sword/saber
var/list/possible_colors = list("red" = LIGHT_COLOR_RED, "blue" = LIGHT_COLOR_LIGHT_CYAN, "green" = LIGHT_COLOR_GREEN, "purple" = LIGHT_COLOR_LAVENDER)
var/hacked = FALSE
/obj/item/melee/transforming/energy/sword/saber/Initialize(mapload)
. = ..()
if(LAZYLEN(possible_colors))
var/set_color = pick(possible_colors)
item_color = set_color
light_color = possible_colors[set_color]
/obj/item/melee/transforming/energy/sword/saber/process()
. = ..()
if(hacked)
var/set_color = pick(possible_colors)
light_color = possible_colors[set_color]
update_light()
/obj/item/melee/transforming/energy/sword/saber/red
possible_colors = list("red" = LIGHT_COLOR_RED)
/obj/item/melee/transforming/energy/sword/saber/blue
possible_colors = list("blue" = LIGHT_COLOR_LIGHT_CYAN)
/obj/item/melee/transforming/energy/sword/saber/green
possible_colors = list("green" = LIGHT_COLOR_GREEN)
/obj/item/melee/transforming/energy/sword/saber/purple
possible_colors = list("purple" = LIGHT_COLOR_LAVENDER)
/obj/item/melee/transforming/energy/sword/saber/attackby(obj/item/W, mob/living/user, params)
if(istype(W, /obj/item/multitool))
if(!hacked)
hacked = TRUE
item_color = "rainbow"
to_chat(user, "<span class='warning'>RNBW_ENGAGE</span>")
if(active)
icon_state = "swordrainbow"
user.update_inv_hands()
else
to_chat(user, "<span class='warning'>It's already fabulous!</span>")
else
return ..()
/obj/item/melee/transforming/energy/sword/pirate
name = "energy cutlass"
desc = "Arrrr matey."
icon_state = "cutlass0"
lefthand_file = 'icons/mob/inhands/weapons/swords_lefthand.dmi'
righthand_file = 'icons/mob/inhands/weapons/swords_righthand.dmi'
icon_state_on = "cutlass1"
light_color = "#ff0000"
/obj/item/melee/transforming/energy/blade
name = "energy blade"
desc = "A concentrated beam of energy in the shape of a blade. Very stylish... and lethal."
icon_state = "blade"
lefthand_file = 'icons/mob/inhands/weapons/swords_lefthand.dmi'
righthand_file = 'icons/mob/inhands/weapons/swords_righthand.dmi'
force = 30 //Normal attacks deal esword damage
hitsound = 'sound/weapons/blade1.ogg'
active = 1
throwforce = 1 //Throwing or dropping the item deletes it.
throw_speed = 3
throw_range = 1
w_class = WEIGHT_CLASS_BULKY//So you can't hide it in your pocket or some such.
var/datum/effect_system/spark_spread/spark_system
sharpness = IS_SHARP
//Most of the other special functions are handled in their own files. aka special snowflake code so kewl
/obj/item/melee/transforming/energy/blade/Initialize()
. = ..()
spark_system = new /datum/effect_system/spark_spread()
spark_system.set_up(5, 0, src)
spark_system.attach(src)
/obj/item/melee/transforming/energy/blade/transform_weapon(mob/living/user, supress_message_text)
return
/obj/item/melee/transforming/energy/blade/hardlight
name = "hardlight blade"
desc = "An extremely sharp blade made out of hard light. Packs quite a punch."
icon_state = "lightblade"
item_state = "lightblade"
/*/////////////////////////////////////////////////////////////////////////
///////////// The TRUE Energy Sword ///////////////////////////
*//////////////////////////////////////////////////////////////////////////
/obj/item/melee/transforming/energy/sword/cx
name = "non-eutactic blade"
desc = "The Non-Eutactic Blade utilizes a hardlight blade that is dynamically 'forged' on demand to create a deadly sharp edge that is unbreakable."
icon_state = "cxsword_hilt"
item_state = "cxsword"
force = 3
force_on = 21
throwforce = 5
throwforce_on = 20
hitsound = "swing_hit" //it starts deactivated
hitsound_on = 'sound/weapons/nebhit.ogg'
attack_verb_off = list("tapped", "poked")
throw_speed = 3
throw_range = 5
sharpness = IS_SHARP
embedding = list("embedded_pain_multiplier" = 6, "embed_chance" = 20, "embedded_fall_chance" = 60)
armour_penetration = 10
block_chance = 35
light_color = "#37FFF7"
actions_types = list()
/obj/item/melee/transforming/energy/sword/cx/pre_altattackby(atom/A, mob/living/user, params) //checks if it can do right click memes
altafterattack(A, user, TRUE, params)
return TRUE
/obj/item/melee/transforming/energy/sword/cx/altafterattack(atom/target, mob/living/carbon/user, proximity_flag, click_parameters) //does right click memes
if(istype(user))
user.visible_message("<span class='notice'>[user] points the tip of [src] at [target].</span>", "<span class='notice'>You point the tip of [src] at [target].</span>")
return TRUE
/obj/item/melee/transforming/energy/sword/cx/transform_weapon(mob/living/user, supress_message_text)
active = !active //I'd use a ..() here but it'd inherit from the regular esword's proc instead, so SPAGHETTI CODE
if(active) //also I'd need to rip out the iconstate changing bits
force = force_on
throwforce = throwforce_on
hitsound = hitsound_on
throw_speed = 4
if(attack_verb_on.len)
attack_verb = attack_verb_on
w_class = w_class_on
START_PROCESSING(SSobj, src)
set_light(brightness_on)
update_icon()
else
force = initial(force)
throwforce = initial(throwforce)
hitsound = initial(hitsound)
throw_speed = initial(throw_speed)
if(attack_verb_off.len)
attack_verb = attack_verb_off
w_class = initial(w_class)
STOP_PROCESSING(SSobj, src)
set_light(0)
update_icon()
transform_messages(user, supress_message_text)
add_fingerprint(user)
return TRUE
/obj/item/melee/transforming/energy/sword/cx/transform_messages(mob/living/user, supress_message_text)
playsound(user, active ? 'sound/weapons/nebon.ogg' : 'sound/weapons/neboff.ogg', 65, 1)
if(!supress_message_text)
to_chat(user, "<span class='notice'>[src] [active ? "is now active":"can now be concealed"].</span>")
/obj/item/melee/transforming/energy/sword/cx/update_icon()
var/mutable_appearance/blade_overlay = mutable_appearance(icon, "cxsword_blade")
var/mutable_appearance/gem_overlay = mutable_appearance(icon, "cxsword_gem")
if(light_color)
blade_overlay.color = light_color
gem_overlay.color = light_color
cut_overlays() //So that it doesn't keep stacking overlays non-stop on top of each other
add_overlay(gem_overlay)
if(active)
add_overlay(blade_overlay)
if(ismob(loc))
var/mob/M = loc
M.update_inv_hands()
/obj/item/melee/transforming/energy/sword/cx/AltClick(mob/living/user)
. = ..()
if(!in_range(src, user)) //Basic checks to prevent abuse
return
if(user.incapacitated() || !istype(user))
to_chat(user, "<span class='warning'>You can't do that right now!</span>")
return TRUE
if(alert("Are you sure you want to recolor your blade?", "Confirm Repaint", "Yes", "No") == "Yes")
var/energy_color_input = input(usr,"","Choose Energy Color",light_color) as color|null
if(energy_color_input)
light_color = sanitize_hexcolor(energy_color_input, desired_format=6, include_crunch=1)
update_icon()
update_light()
return TRUE
/obj/item/melee/transforming/energy/sword/cx/examine(mob/user)
. = ..()
. += "<span class='notice'>Alt-click to recolor it.</span>"
/obj/item/melee/transforming/energy/sword/cx/worn_overlays(isinhands, icon_file, style_flags = NONE)
. = ..()
if(active)
if(isinhands)
var/mutable_appearance/blade_inhand = mutable_appearance(icon_file, "cxsword_blade")
blade_inhand.color = light_color
. += blade_inhand
//Broken version. Not a toy, but not as strong.
/obj/item/melee/transforming/energy/sword/cx/broken
name = "misaligned non-eutactic blade"
desc = "The Non-Eutactic Blade utilizes a hardlight blade that is dynamically 'forged' on demand to create a deadly sharp edge that is unbreakable. This one seems to have a damaged handle and misaligned components, causing the blade to be unstable at best"
force_on = 15 //As strong a survival knife/bone dagger
/obj/item/melee/transforming/energy/sword/cx/attackby(obj/item/W, mob/living/user, params)
if(istype(W, /obj/item/melee/transforming/energy/sword/cx))
if(HAS_TRAIT(W, TRAIT_NODROP) || HAS_TRAIT(src, TRAIT_NODROP))
to_chat(user, "<span class='warning'>\the [HAS_TRAIT(src, TRAIT_NODROP) ? src : W] is stuck to your hand, you can't attach it to \the [HAS_TRAIT(src, TRAIT_NODROP) ? W : src]!</span>")
return
else
to_chat(user, "<span class='notice'>You combine the two light swords, making a single supermassive blade! You're cool.</span>")
new /obj/item/twohanded/dualsaber/hypereutactic(user.drop_location())
qdel(W)
qdel(src)
else
return ..()
//////// Tatortot NEB /////////////// (same stats as regular esword)
/obj/item/melee/transforming/energy/sword/cx/traitor
name = "\improper Dragon's Tooth Sword"
desc = "The Dragon's Tooth sword is a blackmarket modification of a Non-Eutactic Blade, \
which utilizes a hardlight blade that is dynamically 'forged' on demand to create a deadly sharp edge that is unbreakable. \
It appears to have a wooden grip and a shaved down guard."
icon_state = "cxsword_hilt_traitor"
force_on = 30
armour_penetration = 35
embedding = list("embedded_pain_multiplier" = 10, "embed_chance" = 75, "embedded_fall_chance" = 0, "embedded_impact_pain_multiplier" = 10)
block_chance = 50
hitsound_on = 'sound/weapons/blade1.ogg'
light_color = "#37F0FF"
/obj/item/melee/transforming/energy/sword/cx/traitor/transform_messages(mob/living/user, supress_message_text)
playsound(user, active ? 'sound/weapons/saberon.ogg' : 'sound/weapons/saberoff.ogg', 35, 1)
if(!supress_message_text)
to_chat(user, "<span class='notice'>[src] [active ? "is now active":"can now be concealed"].</span>")
/obj/item/melee/transforming/energy
hitsound_on = 'sound/weapons/blade1.ogg'
heat = 3500
max_integrity = 200
armor = list("melee" = 0, "bullet" = 0, "laser" = 0, "energy" = 0, "bomb" = 0, "bio" = 0, "rad" = 0, "fire" = 100, "acid" = 30)
resistance_flags = FIRE_PROOF
var/brightness_on = 3
total_mass = 0.4 //Survival flashlights typically weigh around 5 ounces.
/obj/item/melee/transforming/energy/Initialize()
. = ..()
total_mass_on = (total_mass_on ? total_mass_on : (w_class_on * 0.75))
if(active)
set_light(brightness_on)
START_PROCESSING(SSobj, src)
/obj/item/melee/transforming/energy/Destroy()
STOP_PROCESSING(SSobj, src)
return ..()
/obj/item/melee/transforming/energy/suicide_act(mob/user)
if(!active)
transform_weapon(user, TRUE)
user.visible_message("<span class='suicide'>[user] is [pick("slitting [user.p_their()] stomach open with", "falling on")] [src]! It looks like [user.p_theyre()] trying to commit seppuku!</span>")
return (BRUTELOSS|FIRELOSS)
/obj/item/melee/transforming/energy/add_blood_DNA(list/blood_dna)
return FALSE
/obj/item/melee/transforming/energy/get_sharpness()
return active * sharpness
/obj/item/melee/transforming/energy/process()
open_flame()
/obj/item/melee/transforming/energy/transform_weapon(mob/living/user, supress_message_text)
. = ..()
if(.)
if(active)
if(item_color)
icon_state = "sword[item_color]"
START_PROCESSING(SSobj, src)
set_light(brightness_on)
else
STOP_PROCESSING(SSobj, src)
set_light(0)
/obj/item/melee/transforming/energy/get_temperature()
return active * heat
/obj/item/melee/transforming/energy/ignition_effect(atom/A, mob/user)
if(!active)
return ""
var/in_mouth = ""
if(iscarbon(user))
var/mob/living/carbon/C = user
if(C.wear_mask)
in_mouth = ", barely missing [C.p_their()] nose"
. = "<span class='warning'>[user] swings [user.p_their()] [name][in_mouth]. [user.p_they(TRUE)] light[user.p_s()] [user.p_their()] [A.name] in the process.</span>"
playsound(loc, hitsound, get_clamped_volume(), 1, -1)
add_fingerprint(user)
/obj/item/melee/transforming/energy/axe
name = "energy axe"
desc = "An energized battle axe."
icon_state = "axe0"
lefthand_file = 'icons/mob/inhands/weapons/axes_lefthand.dmi'
righthand_file = 'icons/mob/inhands/weapons/axes_righthand.dmi'
force = 40
force_on = 150
throwforce = 25
throwforce_on = 30
hitsound = 'sound/weapons/bladeslice.ogg'
throw_speed = 3
throw_range = 5
w_class = WEIGHT_CLASS_NORMAL
w_class_on = WEIGHT_CLASS_HUGE
flags_1 = CONDUCT_1
armour_penetration = 100
attack_verb_off = list("attacked", "chopped", "cleaved", "torn", "cut")
attack_verb_on = list()
light_color = "#40ceff"
total_mass = null
/obj/item/melee/transforming/energy/axe/suicide_act(mob/user)
user.visible_message("<span class='suicide'>[user] swings [src] towards [user.p_their()] head! It looks like [user.p_theyre()] trying to commit suicide!</span>")
return (BRUTELOSS|FIRELOSS)
/obj/item/melee/transforming/energy/sword
name = "energy sword"
desc = "May the force be within you."
icon_state = "sword0"
lefthand_file = 'icons/mob/inhands/weapons/swords_lefthand.dmi'
righthand_file = 'icons/mob/inhands/weapons/swords_righthand.dmi'
force = 3
throwforce = 5
hitsound = "swing_hit" //it starts deactivated
attack_verb_off = list("tapped", "poked")
throw_speed = 3
throw_range = 5
sharpness = IS_SHARP
embedding = list("embed_chance" = 75, "embedded_impact_pain_multiplier" = 10)
armour_penetration = 35
block_chance = 50
/obj/item/melee/transforming/energy/sword/transform_weapon(mob/living/user, supress_message_text)
. = ..()
if(. && active && item_color)
icon_state = "sword[item_color]"
/obj/item/melee/transforming/energy/sword/hit_reaction(mob/living/carbon/human/owner, atom/movable/hitby, attack_text = "the attack", final_block_chance = 0, damage = 0, attack_type = MELEE_ATTACK)
if(active)
return ..()
return 0
/obj/item/melee/transforming/energy/sword/cyborg
item_color = "red"
var/hitcost = 50
/obj/item/melee/transforming/energy/sword/cyborg/attack(mob/M, var/mob/living/silicon/robot/R)
if(R.cell)
var/obj/item/stock_parts/cell/C = R.cell
if(active && !(C.use(hitcost)))
attack_self(R)
to_chat(R, "<span class='notice'>It's out of charge!</span>")
return
return ..()
/obj/item/melee/transforming/energy/sword/cyborg/saw //Used by medical Syndicate cyborgs
name = "energy saw"
desc = "For heavy duty cutting. It has a carbon-fiber blade in addition to a toggleable hard-light edge to dramatically increase sharpness."
force_on = 30
force = 18 //About as much as a spear
hitsound = 'sound/weapons/circsawhit.ogg'
icon = 'icons/obj/surgery.dmi'
icon_state = "esaw_0"
icon_state_on = "esaw_1"
item_color = null //stops icon from breaking when turned on.
hitcost = 75 //Costs more than a standard cyborg esword
w_class = WEIGHT_CLASS_NORMAL
sharpness = IS_SHARP
light_color = "#40ceff"
tool_behaviour = TOOL_SAW
toolspeed = 0.7
/obj/item/melee/transforming/energy/sword/cyborg/saw/hit_reaction(mob/living/carbon/human/owner, atom/movable/hitby, attack_text = "the attack", final_block_chance = 0, damage = 0, attack_type = MELEE_ATTACK)
return 0
/obj/item/melee/transforming/energy/sword/saber
var/list/possible_colors = list("red" = LIGHT_COLOR_RED, "blue" = LIGHT_COLOR_LIGHT_CYAN, "green" = LIGHT_COLOR_GREEN, "purple" = LIGHT_COLOR_LAVENDER)
var/hacked = FALSE
/obj/item/melee/transforming/energy/sword/saber/Initialize(mapload)
. = ..()
if(LAZYLEN(possible_colors))
var/set_color = pick(possible_colors)
item_color = set_color
light_color = possible_colors[set_color]
/obj/item/melee/transforming/energy/sword/saber/process()
. = ..()
if(hacked)
var/set_color = pick(possible_colors)
light_color = possible_colors[set_color]
update_light()
/obj/item/melee/transforming/energy/sword/saber/red
possible_colors = list("red" = LIGHT_COLOR_RED)
/obj/item/melee/transforming/energy/sword/saber/blue
possible_colors = list("blue" = LIGHT_COLOR_LIGHT_CYAN)
/obj/item/melee/transforming/energy/sword/saber/green
possible_colors = list("green" = LIGHT_COLOR_GREEN)
/obj/item/melee/transforming/energy/sword/saber/purple
possible_colors = list("purple" = LIGHT_COLOR_LAVENDER)
/obj/item/melee/transforming/energy/sword/saber/attackby(obj/item/W, mob/living/user, params)
if(istype(W, /obj/item/multitool))
if(!hacked)
hacked = TRUE
item_color = "rainbow"
to_chat(user, "<span class='warning'>RNBW_ENGAGE</span>")
if(active)
icon_state = "swordrainbow"
user.update_inv_hands()
else
to_chat(user, "<span class='warning'>It's already fabulous!</span>")
else
return ..()
/obj/item/melee/transforming/energy/sword/pirate
name = "energy cutlass"
desc = "Arrrr matey."
icon_state = "cutlass0"
lefthand_file = 'icons/mob/inhands/weapons/swords_lefthand.dmi'
righthand_file = 'icons/mob/inhands/weapons/swords_righthand.dmi'
icon_state_on = "cutlass1"
light_color = "#ff0000"
/obj/item/melee/transforming/energy/blade
name = "energy blade"
desc = "A concentrated beam of energy in the shape of a blade. Very stylish... and lethal."
icon_state = "blade"
lefthand_file = 'icons/mob/inhands/weapons/swords_lefthand.dmi'
righthand_file = 'icons/mob/inhands/weapons/swords_righthand.dmi'
force = 30 //Normal attacks deal esword damage
hitsound = 'sound/weapons/blade1.ogg'
active = 1
throwforce = 1 //Throwing or dropping the item deletes it.
throw_speed = 3
throw_range = 1
w_class = WEIGHT_CLASS_BULKY//So you can't hide it in your pocket or some such.
var/datum/effect_system/spark_spread/spark_system
sharpness = IS_SHARP
//Most of the other special functions are handled in their own files. aka special snowflake code so kewl
/obj/item/melee/transforming/energy/blade/Initialize()
. = ..()
spark_system = new /datum/effect_system/spark_spread()
spark_system.set_up(5, 0, src)
spark_system.attach(src)
/obj/item/melee/transforming/energy/blade/transform_weapon(mob/living/user, supress_message_text)
return
/obj/item/melee/transforming/energy/blade/hardlight
name = "hardlight blade"
desc = "An extremely sharp blade made out of hard light. Packs quite a punch."
icon_state = "lightblade"
item_state = "lightblade"
/*/////////////////////////////////////////////////////////////////////////
///////////// The TRUE Energy Sword ///////////////////////////
*//////////////////////////////////////////////////////////////////////////
/obj/item/melee/transforming/energy/sword/cx
name = "non-eutactic blade"
desc = "The Non-Eutactic Blade utilizes a hardlight blade that is dynamically 'forged' on demand to create a deadly sharp edge that is unbreakable."
icon_state = "cxsword_hilt"
item_state = "cxsword"
force = 3
force_on = 21
throwforce = 5
throwforce_on = 20
hitsound = "swing_hit" //it starts deactivated
hitsound_on = 'sound/weapons/nebhit.ogg'
attack_verb_off = list("tapped", "poked")
throw_speed = 3
throw_range = 5
sharpness = IS_SHARP
embedding = list("embedded_pain_multiplier" = 6, "embed_chance" = 20, "embedded_fall_chance" = 60)
armour_penetration = 10
block_chance = 35
light_color = "#37FFF7"
actions_types = list()
/obj/item/melee/transforming/energy/sword/cx/pre_altattackby(atom/A, mob/living/user, params) //checks if it can do right click memes
altafterattack(A, user, TRUE, params)
return TRUE
/obj/item/melee/transforming/energy/sword/cx/altafterattack(atom/target, mob/living/carbon/user, proximity_flag, click_parameters) //does right click memes
if(istype(user))
user.visible_message("<span class='notice'>[user] points the tip of [src] at [target].</span>", "<span class='notice'>You point the tip of [src] at [target].</span>")
return TRUE
/obj/item/melee/transforming/energy/sword/cx/transform_weapon(mob/living/user, supress_message_text)
active = !active //I'd use a ..() here but it'd inherit from the regular esword's proc instead, so SPAGHETTI CODE
if(active) //also I'd need to rip out the iconstate changing bits
force = force_on
throwforce = throwforce_on
hitsound = hitsound_on
throw_speed = 4
if(attack_verb_on.len)
attack_verb = attack_verb_on
w_class = w_class_on
START_PROCESSING(SSobj, src)
set_light(brightness_on)
update_icon()
else
force = initial(force)
throwforce = initial(throwforce)
hitsound = initial(hitsound)
throw_speed = initial(throw_speed)
if(attack_verb_off.len)
attack_verb = attack_verb_off
w_class = initial(w_class)
STOP_PROCESSING(SSobj, src)
set_light(0)
update_icon()
transform_messages(user, supress_message_text)
add_fingerprint(user)
return TRUE
/obj/item/melee/transforming/energy/sword/cx/transform_messages(mob/living/user, supress_message_text)
playsound(user, active ? 'sound/weapons/nebon.ogg' : 'sound/weapons/neboff.ogg', 65, 1)
if(!supress_message_text)
to_chat(user, "<span class='notice'>[src] [active ? "is now active":"can now be concealed"].</span>")
/obj/item/melee/transforming/energy/sword/cx/update_icon()
var/mutable_appearance/blade_overlay = mutable_appearance(icon, "cxsword_blade")
var/mutable_appearance/gem_overlay = mutable_appearance(icon, "cxsword_gem")
if(light_color)
blade_overlay.color = light_color
gem_overlay.color = light_color
cut_overlays() //So that it doesn't keep stacking overlays non-stop on top of each other
add_overlay(gem_overlay)
if(active)
add_overlay(blade_overlay)
if(ismob(loc))
var/mob/M = loc
M.update_inv_hands()
/obj/item/melee/transforming/energy/sword/cx/AltClick(mob/living/user)
. = ..()
if(!in_range(src, user)) //Basic checks to prevent abuse
return
if(user.incapacitated() || !istype(user))
to_chat(user, "<span class='warning'>You can't do that right now!</span>")
return TRUE
if(alert("Are you sure you want to recolor your blade?", "Confirm Repaint", "Yes", "No") == "Yes")
var/energy_color_input = input(usr,"","Choose Energy Color",light_color) as color|null
if(energy_color_input)
light_color = sanitize_hexcolor(energy_color_input, desired_format=6, include_crunch=1)
update_icon()
update_light()
return TRUE
/obj/item/melee/transforming/energy/sword/cx/examine(mob/user)
. = ..()
. += "<span class='notice'>Alt-click to recolor it.</span>"
/obj/item/melee/transforming/energy/sword/cx/worn_overlays(isinhands, icon_file, style_flags = NONE)
. = ..()
if(active)
if(isinhands)
var/mutable_appearance/blade_inhand = mutable_appearance(icon_file, "cxsword_blade")
blade_inhand.color = light_color
. += blade_inhand
//Broken version. Not a toy, but not as strong.
/obj/item/melee/transforming/energy/sword/cx/broken
name = "misaligned non-eutactic blade"
desc = "The Non-Eutactic Blade utilizes a hardlight blade that is dynamically 'forged' on demand to create a deadly sharp edge that is unbreakable. This one seems to have a damaged handle and misaligned components, causing the blade to be unstable at best"
force_on = 15 //As strong a survival knife/bone dagger
/obj/item/melee/transforming/energy/sword/cx/attackby(obj/item/W, mob/living/user, params)
if(istype(W, /obj/item/melee/transforming/energy/sword/cx))
if(HAS_TRAIT(W, TRAIT_NODROP) || HAS_TRAIT(src, TRAIT_NODROP))
to_chat(user, "<span class='warning'>\the [HAS_TRAIT(src, TRAIT_NODROP) ? src : W] is stuck to your hand, you can't attach it to \the [HAS_TRAIT(src, TRAIT_NODROP) ? W : src]!</span>")
return
else
to_chat(user, "<span class='notice'>You combine the two light swords, making a single supermassive blade! You're cool.</span>")
new /obj/item/twohanded/dualsaber/hypereutactic(user.drop_location())
qdel(W)
qdel(src)
else
return ..()
//////// Tatortot NEB /////////////// (same stats as regular esword)
/obj/item/melee/transforming/energy/sword/cx/traitor
name = "\improper Dragon's Tooth Sword"
desc = "The Dragon's Tooth sword is a blackmarket modification of a Non-Eutactic Blade, \
which utilizes a hardlight blade that is dynamically 'forged' on demand to create a deadly sharp edge that is unbreakable. \
It appears to have a wooden grip and a shaved down guard."
icon_state = "cxsword_hilt_traitor"
force_on = 30
armour_penetration = 35
embedding = list("embedded_pain_multiplier" = 10, "embed_chance" = 75, "embedded_fall_chance" = 0, "embedded_impact_pain_multiplier" = 10)
block_chance = 50
hitsound_on = 'sound/weapons/blade1.ogg'
light_color = "#37F0FF"
/obj/item/melee/transforming/energy/sword/cx/traitor/transform_messages(mob/living/user, supress_message_text)
playsound(user, active ? 'sound/weapons/saberon.ogg' : 'sound/weapons/saberoff.ogg', 35, 1)
if(!supress_message_text)
to_chat(user, "<span class='notice'>[src] [active ? "is now active":"can now be concealed"].</span>")
+13 -13
View File
@@ -1,13 +1,13 @@
/obj/item/pai_cable
desc = "A flexible coated cable with a universal jack on one end."
name = "data cable"
icon = 'icons/obj/power.dmi'
icon_state = "wire1"
item_flags = NOBLUDGEON
var/obj/machinery/machine
/obj/item/pai_cable/proc/plugin(obj/machinery/M, mob/living/user)
if(!user.transferItemToLoc(src, M))
return
user.visible_message("[user] inserts [src] into a data port on [M].", "<span class='notice'>You insert [src] into a data port on [M].</span>", "<span class='italics'>You hear the satisfying click of a wire jack fastening into place.</span>")
machine = M
/obj/item/pai_cable
desc = "A flexible coated cable with a universal jack on one end."
name = "data cable"
icon = 'icons/obj/power.dmi'
icon_state = "wire1"
item_flags = NOBLUDGEON
var/obj/machinery/machine
/obj/item/pai_cable/proc/plugin(obj/machinery/M, mob/living/user)
if(!user.transferItemToLoc(src, M))
return
user.visible_message("[user] inserts [src] into a data port on [M].", "<span class='notice'>You insert [src] into a data port on [M].</span>", "<span class='italics'>You hear the satisfying click of a wire jack fastening into place.</span>")
machine = M
File diff suppressed because it is too large Load Diff
+413 -413
View File
@@ -1,413 +1,413 @@
//The robot bodyparts have been moved to code/module/surgery/bodyparts/robot_bodyparts.dm
/obj/item/robot_suit
name = "cyborg endoskeleton"
desc = "A complex metal backbone with standard limb sockets and pseudomuscle anchors."
icon = 'icons/mob/augmentation/augments.dmi'
icon_state = "robo_suit"
var/obj/item/bodypart/l_arm/robot/l_arm = null
var/obj/item/bodypart/r_arm/robot/r_arm = null
var/obj/item/bodypart/l_leg/robot/l_leg = null
var/obj/item/bodypart/r_leg/robot/r_leg = null
var/obj/item/bodypart/chest/robot/chest = null
var/obj/item/bodypart/head/robot/head = null
var/created_name = ""
var/mob/living/silicon/ai/forced_ai
var/locomotion = 1
var/lawsync = 1
var/aisync = 1
var/panel_locked = TRUE
/obj/item/robot_suit/New()
..()
update_icon()
/obj/item/robot_suit/prebuilt/New()
l_arm = new(src)
r_arm = new(src)
l_leg = new(src)
r_leg = new(src)
head = new(src)
head.flash1 = new(head)
head.flash2 = new(head)
chest = new(src)
chest.wired = TRUE
chest.cell = new /obj/item/stock_parts/cell/high/plus(chest)
..()
/obj/item/robot_suit/update_icon()
cut_overlays()
if(l_arm)
add_overlay("[l_arm.icon_state]+o")
if(r_arm)
add_overlay("[r_arm.icon_state]+o")
if(chest)
add_overlay("[chest.icon_state]+o")
if(l_leg)
add_overlay("[l_leg.icon_state]+o")
if(r_leg)
add_overlay("[r_leg.icon_state]+o")
if(head)
add_overlay("[head.icon_state]+o")
/obj/item/robot_suit/proc/check_completion()
if(src.l_arm && src.r_arm)
if(src.l_leg && src.r_leg)
if(src.chest && src.head)
SSblackbox.record_feedback("amount", "cyborg_frames_built", 1)
return 1
return 0
/obj/item/robot_suit/wrench_act(mob/living/user, obj/item/I) //Deconstucts empty borg shell. Flashes remain unbroken because they haven't been used yet
var/turf/T = get_turf(src)
if(l_leg || r_leg || chest || l_arm || r_arm || head)
if(I.use_tool(src, user, 5, volume=50))
if(l_leg)
l_leg.forceMove(T)
l_leg = null
if(r_leg)
r_leg.forceMove(T)
r_leg = null
if(chest)
if (chest.cell) //Sanity check.
chest.cell.forceMove(T)
chest.cell = null
chest.forceMove(T)
new /obj/item/stack/cable_coil(T, 1)
chest.wired = FALSE
chest = null
if(l_arm)
l_arm.forceMove(T)
l_arm = null
if(r_arm)
r_arm.forceMove(T)
r_arm = null
if(head)
head.forceMove(T)
head.flash1.forceMove(T)
head.flash1 = null
head.flash2.forceMove(T)
head.flash2 = null
head = null
to_chat(user, "<span class='notice'>You disassemble the cyborg shell.</span>")
else
to_chat(user, "<span class='notice'>There is nothing to remove from the endoskeleton.</span>")
update_icon()
/obj/item/robot_suit/proc/put_in_hand_or_drop(mob/living/user, obj/item/I) //normal put_in_hands() drops the item ontop of the player, this drops it at the suit's loc
if(!user.put_in_hands(I))
I.forceMove(drop_location())
return FALSE
return TRUE
/obj/item/robot_suit/screwdriver_act(mob/living/user, obj/item/I) //Swaps the power cell if you're holding a new one in your other hand.
. = ..()
if(.)
return TRUE
if(!chest) //can't remove a cell if there's no chest to remove it from.
to_chat(user, "<span class='notice'>[src] has no attached torso.</span>")
return
var/obj/item/stock_parts/cell/temp_cell = user.is_holding_item_of_type(/obj/item/stock_parts/cell)
var/swap_failed
if(!temp_cell) //if we're not holding a cell
swap_failed = TRUE
else if(!user.transferItemToLoc(temp_cell, chest))
swap_failed = TRUE
to_chat(user, "<span class='warning'>[temp_cell] is stuck to your hand, you can't put it in [src]!</span>")
if(chest.cell) //drop the chest's current cell no matter what.
put_in_hand_or_drop(user, chest.cell)
if(swap_failed) //we didn't transfer any new items.
if(chest.cell) //old cell ejected, nothing inserted.
to_chat(user, "<span class='notice'>You remove [chest.cell] from [src].</span>")
chest.cell = null
else
to_chat(user, "<span class='notice'>The power cell slot in [src]'s torso is empty.</span>")
return
to_chat(user, "<span class='notice'>You [chest.cell ? "replace [src]'s [chest.cell.name] with [temp_cell]" : "insert [temp_cell] into [src]"].</span>")
chest.cell = temp_cell
return TRUE
/obj/item/robot_suit/attackby(obj/item/W, mob/user, params)
if(istype(W, /obj/item/stack/sheet/metal))
var/obj/item/stack/sheet/metal/M = W
if(!l_arm && !r_arm && !l_leg && !r_leg && !chest && !head)
if (M.use(1))
var/obj/item/bot_assembly/ed209/B = new
B.forceMove(drop_location())
to_chat(user, "<span class='notice'>You arm the robot frame.</span>")
var/holding_this = user.get_inactive_held_item()==src
qdel(src)
if (holding_this)
user.put_in_inactive_hand(B)
else
to_chat(user, "<span class='warning'>You need one sheet of metal to start building ED-209!</span>")
return
else if(istype(W, /obj/item/bodypart/l_leg/robot))
if(src.l_leg)
return
if(!user.transferItemToLoc(W, src))
return
W.icon_state = initial(W.icon_state)
W.cut_overlays()
src.l_leg = W
update_icon()
else if(istype(W, /obj/item/bodypart/r_leg/robot))
if(src.r_leg)
return
if(!user.transferItemToLoc(W, src))
return
W.icon_state = initial(W.icon_state)
W.cut_overlays()
src.r_leg = W
update_icon()
else if(istype(W, /obj/item/bodypart/l_arm/robot))
if(src.l_arm)
return
if(!user.transferItemToLoc(W, src))
return
W.icon_state = initial(W.icon_state)
W.cut_overlays()
src.l_arm = W
update_icon()
else if(istype(W, /obj/item/bodypart/r_arm/robot))
if(src.r_arm)
return
if(!user.transferItemToLoc(W, src))
return
W.icon_state = initial(W.icon_state)//in case it is a dismembered robotic limb
W.cut_overlays()
src.r_arm = W
update_icon()
else if(istype(W, /obj/item/bodypart/chest/robot))
var/obj/item/bodypart/chest/robot/CH = W
if(src.chest)
return
if(CH.wired && CH.cell)
if(!user.transferItemToLoc(CH, src))
return
CH.icon_state = initial(CH.icon_state) //in case it is a dismembered robotic limb
CH.cut_overlays()
src.chest = CH
update_icon()
else if(!CH.wired)
to_chat(user, "<span class='warning'>You need to attach wires to it first!</span>")
else
to_chat(user, "<span class='warning'>You need to attach a cell to it first!</span>")
else if(istype(W, /obj/item/bodypart/head/robot))
var/obj/item/bodypart/head/robot/HD = W
for(var/X in HD.contents)
if(istype(X, /obj/item/organ))
to_chat(user, "<span class='warning'>There are organs inside [HD]!</span>")
return
if(src.head)
return
if(HD.flash2 && HD.flash1)
if(!user.transferItemToLoc(HD, src))
return
HD.icon_state = initial(HD.icon_state)//in case it is a dismembered robotic limb
HD.cut_overlays()
src.head = HD
update_icon()
else
to_chat(user, "<span class='warning'>You need to attach a flash to it first!</span>")
else if (istype(W, /obj/item/multitool))
if(check_completion())
Interact(user)
else
to_chat(user, "<span class='warning'>The endoskeleton must be assembled before debugging can begin!</span>")
else if(istype(W, /obj/item/mmi))
var/obj/item/mmi/M = W
if(check_completion())
if(!chest.cell)
to_chat(user, "<span class='warning'>The endoskeleton still needs a power cell!</span>")
return
if(!isturf(loc))
to_chat(user, "<span class='warning'>You can't put [M] in, the frame has to be standing on the ground to be perfectly precise!</span>")
return
if(!M.brainmob)
to_chat(user, "<span class='warning'>Sticking an empty [M.name] into the frame would sort of defeat the purpose!</span>")
return
var/mob/living/brain/BM = M.brainmob
if(!BM.key || !BM.mind)
to_chat(user, "<span class='warning'>The MMI indicates that their mind is completely unresponsive; there's no point!</span>")
return
if(!BM.client) //braindead
to_chat(user, "<span class='warning'>The MMI indicates that their mind is currently inactive; it might change!</span>")
return
if(BM.stat == DEAD || (M.brain && M.brain.organ_flags & ORGAN_FAILING))
to_chat(user, "<span class='warning'>Sticking a dead brain into the frame would sort of defeat the purpose!</span>")
return
if(jobban_isbanned(BM, "Cyborg") || QDELETED(src) || QDELETED(BM) || QDELETED(user) || QDELETED(M) || !Adjacent(user))
if(!QDELETED(M))
to_chat(user, "<span class='warning'>This [M.name] does not seem to fit!</span>")
return
if(!user.temporarilyRemoveItemFromInventory(W))
return
var/mob/living/silicon/robot/O = new /mob/living/silicon/robot(get_turf(loc))
if(!O)
return
if(M.laws && M.laws.id != DEFAULT_AI_LAWID)
aisync = 0
lawsync = 0
O.laws = M.laws
M.laws.associate(O)
O.invisibility = 0
//Transfer debug settings to new mob
O.custom_name = created_name
O.locked = panel_locked
if(!aisync)
lawsync = 0
O.connected_ai = null
else
O.notify_ai(NEW_BORG)
if(forced_ai)
O.connected_ai = forced_ai
if(!lawsync)
O.lawupdate = 0
if(M.laws.id == DEFAULT_AI_LAWID)
O.make_laws()
SSticker.mode.remove_antag_for_borging(BM.mind)
if(!istype(M.laws, /datum/ai_laws/ratvar))
remove_servant_of_ratvar(BM, TRUE)
BM.mind.transfer_to(O)
if(O.mind && O.mind.special_role)
O.mind.store_memory("As a cyborg, you must obey your silicon laws and master AI above all else. Your objectives will consider you to be dead.")
to_chat(O, "<span class='userdanger'>You have been robotized!</span>")
to_chat(O, "<span class='danger'>You must obey your silicon laws and master AI above all else. Your objectives will consider you to be dead.</span>")
O.job = "Cyborg"
O.cell = chest.cell
chest.cell.forceMove(O)
chest.cell = null
W.forceMove(O)//Should fix cybros run time erroring when blown up. It got deleted before, along with the frame.
if(O.mmi) //we delete the mmi created by robot/New()
qdel(O.mmi)
O.mmi = W //and give the real mmi to the borg.
O.updatename()
SSblackbox.record_feedback("amount", "cyborg_birth", 1)
forceMove(O)
O.robot_suit = src
if(!locomotion)
O.lockcharge = 1
O.update_canmove()
to_chat(O, "<span class='warning'>Error: Servo motors unresponsive.</span>")
else
to_chat(user, "<span class='warning'>The MMI must go in after everything else!</span>")
else if(istype(W, /obj/item/borg/upgrade/ai))
var/obj/item/borg/upgrade/ai/M = W
if(check_completion())
if(!isturf(loc))
to_chat(user, "<span class='warning'>You cannot install[M], the frame has to be standing on the ground to be perfectly precise!</span>")
return
if(!user.temporarilyRemoveItemFromInventory(M))
to_chat(user, "<span class='warning'>[M] is stuck to your hand!</span>")
return
qdel(M)
var/mob/living/silicon/robot/O = new /mob/living/silicon/robot/shell(get_turf(src))
if(!aisync)
lawsync = FALSE
O.connected_ai = null
else
if(forced_ai)
O.connected_ai = forced_ai
O.notify_ai(AI_SHELL)
if(!lawsync)
O.lawupdate = FALSE
O.make_laws()
O.cell = chest.cell
chest.cell.forceMove(O)
chest.cell = null
O.locked = panel_locked
O.job = "Cyborg"
forceMove(O)
O.robot_suit = src
if(!locomotion)
O.lockcharge = TRUE
O.update_canmove()
else if(istype(W, /obj/item/pen))
to_chat(user, "<span class='warning'>You need to use a multitool to name [src]!</span>")
else
return ..()
/obj/item/robot_suit/proc/Interact(mob/user)
var/t1 = "Designation: <A href='?src=[REF(src)];Name=1'>[(created_name ? "[created_name]" : "Default Cyborg")]</a><br>\n"
t1 += "Master AI: <A href='?src=[REF(src)];Master=1'>[(forced_ai ? "[forced_ai.name]" : "Automatic")]</a><br><br>\n"
t1 += "LawSync Port: <A href='?src=[REF(src)];Law=1'>[(lawsync ? "Open" : "Closed")]</a><br>\n"
t1 += "AI Connection Port: <A href='?src=[REF(src)];AI=1'>[(aisync ? "Open" : "Closed")]</a><br>\n"
t1 += "Servo Motor Functions: <A href='?src=[REF(src)];Loco=1'>[(locomotion ? "Unlocked" : "Locked")]</a><br>\n"
t1 += "Panel Lock: <A href='?src=[REF(src)];Panel=1'>[(panel_locked ? "Engaged" : "Disengaged")]</a><br>\n"
var/datum/browser/popup = new(user, "robotdebug", "Cyborg Boot Debug", 310, 220)
popup.set_content(t1)
popup.open()
/obj/item/robot_suit/Topic(href, href_list)
if(usr.incapacitated() || !Adjacent(usr))
return
var/mob/living/living_user = usr
var/obj/item/item_in_hand = living_user.get_active_held_item()
if(!istype(item_in_hand, /obj/item/multitool))
to_chat(living_user, "<span class='warning'>You need a multitool!</span>")
return
if(href_list["Name"])
var/new_name = reject_bad_name(input(usr, "Enter new designation. Set to blank to reset to default.", "Cyborg Debug", src.created_name),1)
if(!in_range(src, usr) && src.loc != usr)
return
if(new_name)
created_name = new_name
else
created_name = ""
else if(href_list["Master"])
forced_ai = select_active_ai(usr)
if(!forced_ai)
to_chat(usr, "<span class='error'>No active AIs detected.</span>")
else if(href_list["Law"])
lawsync = !lawsync
else if(href_list["AI"])
aisync = !aisync
else if(href_list["Loco"])
locomotion = !locomotion
else if(href_list["Panel"])
panel_locked = !panel_locked
add_fingerprint(usr)
Interact(usr)
//The robot bodyparts have been moved to code/module/surgery/bodyparts/robot_bodyparts.dm
/obj/item/robot_suit
name = "cyborg endoskeleton"
desc = "A complex metal backbone with standard limb sockets and pseudomuscle anchors."
icon = 'icons/mob/augmentation/augments.dmi'
icon_state = "robo_suit"
var/obj/item/bodypart/l_arm/robot/l_arm = null
var/obj/item/bodypart/r_arm/robot/r_arm = null
var/obj/item/bodypart/l_leg/robot/l_leg = null
var/obj/item/bodypart/r_leg/robot/r_leg = null
var/obj/item/bodypart/chest/robot/chest = null
var/obj/item/bodypart/head/robot/head = null
var/created_name = ""
var/mob/living/silicon/ai/forced_ai
var/locomotion = 1
var/lawsync = 1
var/aisync = 1
var/panel_locked = TRUE
/obj/item/robot_suit/New()
..()
update_icon()
/obj/item/robot_suit/prebuilt/New()
l_arm = new(src)
r_arm = new(src)
l_leg = new(src)
r_leg = new(src)
head = new(src)
head.flash1 = new(head)
head.flash2 = new(head)
chest = new(src)
chest.wired = TRUE
chest.cell = new /obj/item/stock_parts/cell/high/plus(chest)
..()
/obj/item/robot_suit/update_icon()
cut_overlays()
if(l_arm)
add_overlay("[l_arm.icon_state]+o")
if(r_arm)
add_overlay("[r_arm.icon_state]+o")
if(chest)
add_overlay("[chest.icon_state]+o")
if(l_leg)
add_overlay("[l_leg.icon_state]+o")
if(r_leg)
add_overlay("[r_leg.icon_state]+o")
if(head)
add_overlay("[head.icon_state]+o")
/obj/item/robot_suit/proc/check_completion()
if(src.l_arm && src.r_arm)
if(src.l_leg && src.r_leg)
if(src.chest && src.head)
SSblackbox.record_feedback("amount", "cyborg_frames_built", 1)
return 1
return 0
/obj/item/robot_suit/wrench_act(mob/living/user, obj/item/I) //Deconstucts empty borg shell. Flashes remain unbroken because they haven't been used yet
var/turf/T = get_turf(src)
if(l_leg || r_leg || chest || l_arm || r_arm || head)
if(I.use_tool(src, user, 5, volume=50))
if(l_leg)
l_leg.forceMove(T)
l_leg = null
if(r_leg)
r_leg.forceMove(T)
r_leg = null
if(chest)
if (chest.cell) //Sanity check.
chest.cell.forceMove(T)
chest.cell = null
chest.forceMove(T)
new /obj/item/stack/cable_coil(T, 1)
chest.wired = FALSE
chest = null
if(l_arm)
l_arm.forceMove(T)
l_arm = null
if(r_arm)
r_arm.forceMove(T)
r_arm = null
if(head)
head.forceMove(T)
head.flash1.forceMove(T)
head.flash1 = null
head.flash2.forceMove(T)
head.flash2 = null
head = null
to_chat(user, "<span class='notice'>You disassemble the cyborg shell.</span>")
else
to_chat(user, "<span class='notice'>There is nothing to remove from the endoskeleton.</span>")
update_icon()
/obj/item/robot_suit/proc/put_in_hand_or_drop(mob/living/user, obj/item/I) //normal put_in_hands() drops the item ontop of the player, this drops it at the suit's loc
if(!user.put_in_hands(I))
I.forceMove(drop_location())
return FALSE
return TRUE
/obj/item/robot_suit/screwdriver_act(mob/living/user, obj/item/I) //Swaps the power cell if you're holding a new one in your other hand.
. = ..()
if(.)
return TRUE
if(!chest) //can't remove a cell if there's no chest to remove it from.
to_chat(user, "<span class='notice'>[src] has no attached torso.</span>")
return
var/obj/item/stock_parts/cell/temp_cell = user.is_holding_item_of_type(/obj/item/stock_parts/cell)
var/swap_failed
if(!temp_cell) //if we're not holding a cell
swap_failed = TRUE
else if(!user.transferItemToLoc(temp_cell, chest))
swap_failed = TRUE
to_chat(user, "<span class='warning'>[temp_cell] is stuck to your hand, you can't put it in [src]!</span>")
if(chest.cell) //drop the chest's current cell no matter what.
put_in_hand_or_drop(user, chest.cell)
if(swap_failed) //we didn't transfer any new items.
if(chest.cell) //old cell ejected, nothing inserted.
to_chat(user, "<span class='notice'>You remove [chest.cell] from [src].</span>")
chest.cell = null
else
to_chat(user, "<span class='notice'>The power cell slot in [src]'s torso is empty.</span>")
return
to_chat(user, "<span class='notice'>You [chest.cell ? "replace [src]'s [chest.cell.name] with [temp_cell]" : "insert [temp_cell] into [src]"].</span>")
chest.cell = temp_cell
return TRUE
/obj/item/robot_suit/attackby(obj/item/W, mob/user, params)
if(istype(W, /obj/item/stack/sheet/metal))
var/obj/item/stack/sheet/metal/M = W
if(!l_arm && !r_arm && !l_leg && !r_leg && !chest && !head)
if (M.use(1))
var/obj/item/bot_assembly/ed209/B = new
B.forceMove(drop_location())
to_chat(user, "<span class='notice'>You arm the robot frame.</span>")
var/holding_this = user.get_inactive_held_item()==src
qdel(src)
if (holding_this)
user.put_in_inactive_hand(B)
else
to_chat(user, "<span class='warning'>You need one sheet of metal to start building ED-209!</span>")
return
else if(istype(W, /obj/item/bodypart/l_leg/robot))
if(src.l_leg)
return
if(!user.transferItemToLoc(W, src))
return
W.icon_state = initial(W.icon_state)
W.cut_overlays()
src.l_leg = W
update_icon()
else if(istype(W, /obj/item/bodypart/r_leg/robot))
if(src.r_leg)
return
if(!user.transferItemToLoc(W, src))
return
W.icon_state = initial(W.icon_state)
W.cut_overlays()
src.r_leg = W
update_icon()
else if(istype(W, /obj/item/bodypart/l_arm/robot))
if(src.l_arm)
return
if(!user.transferItemToLoc(W, src))
return
W.icon_state = initial(W.icon_state)
W.cut_overlays()
src.l_arm = W
update_icon()
else if(istype(W, /obj/item/bodypart/r_arm/robot))
if(src.r_arm)
return
if(!user.transferItemToLoc(W, src))
return
W.icon_state = initial(W.icon_state)//in case it is a dismembered robotic limb
W.cut_overlays()
src.r_arm = W
update_icon()
else if(istype(W, /obj/item/bodypart/chest/robot))
var/obj/item/bodypart/chest/robot/CH = W
if(src.chest)
return
if(CH.wired && CH.cell)
if(!user.transferItemToLoc(CH, src))
return
CH.icon_state = initial(CH.icon_state) //in case it is a dismembered robotic limb
CH.cut_overlays()
src.chest = CH
update_icon()
else if(!CH.wired)
to_chat(user, "<span class='warning'>You need to attach wires to it first!</span>")
else
to_chat(user, "<span class='warning'>You need to attach a cell to it first!</span>")
else if(istype(W, /obj/item/bodypart/head/robot))
var/obj/item/bodypart/head/robot/HD = W
for(var/X in HD.contents)
if(istype(X, /obj/item/organ))
to_chat(user, "<span class='warning'>There are organs inside [HD]!</span>")
return
if(src.head)
return
if(HD.flash2 && HD.flash1)
if(!user.transferItemToLoc(HD, src))
return
HD.icon_state = initial(HD.icon_state)//in case it is a dismembered robotic limb
HD.cut_overlays()
src.head = HD
update_icon()
else
to_chat(user, "<span class='warning'>You need to attach a flash to it first!</span>")
else if (istype(W, /obj/item/multitool))
if(check_completion())
Interact(user)
else
to_chat(user, "<span class='warning'>The endoskeleton must be assembled before debugging can begin!</span>")
else if(istype(W, /obj/item/mmi))
var/obj/item/mmi/M = W
if(check_completion())
if(!chest.cell)
to_chat(user, "<span class='warning'>The endoskeleton still needs a power cell!</span>")
return
if(!isturf(loc))
to_chat(user, "<span class='warning'>You can't put [M] in, the frame has to be standing on the ground to be perfectly precise!</span>")
return
if(!M.brainmob)
to_chat(user, "<span class='warning'>Sticking an empty [M.name] into the frame would sort of defeat the purpose!</span>")
return
var/mob/living/brain/BM = M.brainmob
if(!BM.key || !BM.mind)
to_chat(user, "<span class='warning'>The MMI indicates that their mind is completely unresponsive; there's no point!</span>")
return
if(!BM.client) //braindead
to_chat(user, "<span class='warning'>The MMI indicates that their mind is currently inactive; it might change!</span>")
return
if(BM.stat == DEAD || (M.brain && M.brain.organ_flags & ORGAN_FAILING))
to_chat(user, "<span class='warning'>Sticking a dead brain into the frame would sort of defeat the purpose!</span>")
return
if(jobban_isbanned(BM, "Cyborg") || QDELETED(src) || QDELETED(BM) || QDELETED(user) || QDELETED(M) || !Adjacent(user))
if(!QDELETED(M))
to_chat(user, "<span class='warning'>This [M.name] does not seem to fit!</span>")
return
if(!user.temporarilyRemoveItemFromInventory(W))
return
var/mob/living/silicon/robot/O = new /mob/living/silicon/robot(get_turf(loc))
if(!O)
return
if(M.laws && M.laws.id != DEFAULT_AI_LAWID)
aisync = 0
lawsync = 0
O.laws = M.laws
M.laws.associate(O)
O.invisibility = 0
//Transfer debug settings to new mob
O.custom_name = created_name
O.locked = panel_locked
if(!aisync)
lawsync = 0
O.connected_ai = null
else
O.notify_ai(NEW_BORG)
if(forced_ai)
O.connected_ai = forced_ai
if(!lawsync)
O.lawupdate = 0
if(M.laws.id == DEFAULT_AI_LAWID)
O.make_laws()
SSticker.mode.remove_antag_for_borging(BM.mind)
if(!istype(M.laws, /datum/ai_laws/ratvar))
remove_servant_of_ratvar(BM, TRUE)
BM.mind.transfer_to(O)
if(O.mind && O.mind.special_role)
O.mind.store_memory("As a cyborg, you must obey your silicon laws and master AI above all else. Your objectives will consider you to be dead.")
to_chat(O, "<span class='userdanger'>You have been robotized!</span>")
to_chat(O, "<span class='danger'>You must obey your silicon laws and master AI above all else. Your objectives will consider you to be dead.</span>")
O.job = "Cyborg"
O.cell = chest.cell
chest.cell.forceMove(O)
chest.cell = null
W.forceMove(O)//Should fix cybros run time erroring when blown up. It got deleted before, along with the frame.
if(O.mmi) //we delete the mmi created by robot/New()
qdel(O.mmi)
O.mmi = W //and give the real mmi to the borg.
O.updatename()
SSblackbox.record_feedback("amount", "cyborg_birth", 1)
forceMove(O)
O.robot_suit = src
if(!locomotion)
O.lockcharge = 1
O.update_canmove()
to_chat(O, "<span class='warning'>Error: Servo motors unresponsive.</span>")
else
to_chat(user, "<span class='warning'>The MMI must go in after everything else!</span>")
else if(istype(W, /obj/item/borg/upgrade/ai))
var/obj/item/borg/upgrade/ai/M = W
if(check_completion())
if(!isturf(loc))
to_chat(user, "<span class='warning'>You cannot install[M], the frame has to be standing on the ground to be perfectly precise!</span>")
return
if(!user.temporarilyRemoveItemFromInventory(M))
to_chat(user, "<span class='warning'>[M] is stuck to your hand!</span>")
return
qdel(M)
var/mob/living/silicon/robot/O = new /mob/living/silicon/robot/shell(get_turf(src))
if(!aisync)
lawsync = FALSE
O.connected_ai = null
else
if(forced_ai)
O.connected_ai = forced_ai
O.notify_ai(AI_SHELL)
if(!lawsync)
O.lawupdate = FALSE
O.make_laws()
O.cell = chest.cell
chest.cell.forceMove(O)
chest.cell = null
O.locked = panel_locked
O.job = "Cyborg"
forceMove(O)
O.robot_suit = src
if(!locomotion)
O.lockcharge = TRUE
O.update_canmove()
else if(istype(W, /obj/item/pen))
to_chat(user, "<span class='warning'>You need to use a multitool to name [src]!</span>")
else
return ..()
/obj/item/robot_suit/proc/Interact(mob/user)
var/t1 = "Designation: <A href='?src=[REF(src)];Name=1'>[(created_name ? "[created_name]" : "Default Cyborg")]</a><br>\n"
t1 += "Master AI: <A href='?src=[REF(src)];Master=1'>[(forced_ai ? "[forced_ai.name]" : "Automatic")]</a><br><br>\n"
t1 += "LawSync Port: <A href='?src=[REF(src)];Law=1'>[(lawsync ? "Open" : "Closed")]</a><br>\n"
t1 += "AI Connection Port: <A href='?src=[REF(src)];AI=1'>[(aisync ? "Open" : "Closed")]</a><br>\n"
t1 += "Servo Motor Functions: <A href='?src=[REF(src)];Loco=1'>[(locomotion ? "Unlocked" : "Locked")]</a><br>\n"
t1 += "Panel Lock: <A href='?src=[REF(src)];Panel=1'>[(panel_locked ? "Engaged" : "Disengaged")]</a><br>\n"
var/datum/browser/popup = new(user, "robotdebug", "Cyborg Boot Debug", 310, 220)
popup.set_content(t1)
popup.open()
/obj/item/robot_suit/Topic(href, href_list)
if(usr.incapacitated() || !Adjacent(usr))
return
var/mob/living/living_user = usr
var/obj/item/item_in_hand = living_user.get_active_held_item()
if(!istype(item_in_hand, /obj/item/multitool))
to_chat(living_user, "<span class='warning'>You need a multitool!</span>")
return
if(href_list["Name"])
var/new_name = reject_bad_name(input(usr, "Enter new designation. Set to blank to reset to default.", "Cyborg Debug", src.created_name),1)
if(!in_range(src, usr) && src.loc != usr)
return
if(new_name)
created_name = new_name
else
created_name = ""
else if(href_list["Master"])
forced_ai = select_active_ai(usr)
if(!forced_ai)
to_chat(usr, "<span class='error'>No active AIs detected.</span>")
else if(href_list["Law"])
lawsync = !lawsync
else if(href_list["AI"])
aisync = !aisync
else if(href_list["Loco"])
locomotion = !locomotion
else if(href_list["Panel"])
panel_locked = !panel_locked
add_fingerprint(usr)
Interact(usr)
File diff suppressed because it is too large Load Diff
+73 -73
View File
@@ -1,73 +1,73 @@
/obj/item/teleportation_scroll
name = "scroll of teleportation"
desc = "A scroll for moving around."
icon = 'icons/obj/wizard.dmi'
icon_state = "scroll"
var/uses = 4
w_class = WEIGHT_CLASS_SMALL
item_state = "paper"
throw_speed = 3
throw_range = 7
resistance_flags = FLAMMABLE
/obj/item/teleportation_scroll/apprentice
name = "lesser scroll of teleportation"
uses = 1
/obj/item/teleportation_scroll/attack_self(mob/user)
user.set_machine(src)
var/dat = "<B>Teleportation Scroll:</B><BR>"
dat += "Number of uses: [src.uses]<BR>"
dat += "<HR>"
dat += "<B>Four uses, use them wisely:</B><BR>"
dat += "<A href='byond://?src=[REF(src)];spell_teleport=1'>Teleport</A><BR>"
dat += "Kind regards,<br>Wizards Federation<br><br>P.S. Don't forget to bring your gear, you'll need it to cast most spells.<HR>"
user << browse(dat, "window=scroll")
onclose(user, "scroll")
return
/obj/item/teleportation_scroll/Topic(href, href_list)
..()
if (usr.stat || usr.restrained() || src.loc != usr)
return
if (!ishuman(usr))
return 1
var/mob/living/carbon/human/H = usr
if(H.is_holding(src))
H.set_machine(src)
if (href_list["spell_teleport"])
if(uses)
teleportscroll(H)
if(H)
attack_self(H)
return
/obj/item/teleportation_scroll/proc/teleportscroll(mob/user)
var/A
A = input(user, "Area to jump to", "BOOYEA", A) as null|anything in GLOB.teleportlocs
if(!src || QDELETED(src) || !user || !user.is_holding(src) || user.incapacitated() || !A || !uses)
return
var/area/thearea = GLOB.teleportlocs[A]
var/datum/effect_system/smoke_spread/smoke = new
smoke.set_up(2, user.loc)
smoke.attach(user)
smoke.start()
var/list/L = list()
for(var/turf/T in get_area_turfs(thearea.type))
if(!is_blocked_turf(T))
L += T
if(!L.len)
to_chat(user, "The spell matrix was unable to locate a suitable teleport destination for an unknown reason. Sorry.")
return
if(do_teleport(user, pick(L), forceMove = TRUE, channel = TELEPORT_CHANNEL_MAGIC, forced = TRUE))
smoke.start()
uses--
else
to_chat(user, "The spell matrix was disrupted by something near the destination.")
/obj/item/teleportation_scroll
name = "scroll of teleportation"
desc = "A scroll for moving around."
icon = 'icons/obj/wizard.dmi'
icon_state = "scroll"
var/uses = 4
w_class = WEIGHT_CLASS_SMALL
item_state = "paper"
throw_speed = 3
throw_range = 7
resistance_flags = FLAMMABLE
/obj/item/teleportation_scroll/apprentice
name = "lesser scroll of teleportation"
uses = 1
/obj/item/teleportation_scroll/attack_self(mob/user)
user.set_machine(src)
var/dat = "<B>Teleportation Scroll:</B><BR>"
dat += "Number of uses: [src.uses]<BR>"
dat += "<HR>"
dat += "<B>Four uses, use them wisely:</B><BR>"
dat += "<A href='byond://?src=[REF(src)];spell_teleport=1'>Teleport</A><BR>"
dat += "Kind regards,<br>Wizards Federation<br><br>P.S. Don't forget to bring your gear, you'll need it to cast most spells.<HR>"
user << browse(dat, "window=scroll")
onclose(user, "scroll")
return
/obj/item/teleportation_scroll/Topic(href, href_list)
..()
if (usr.stat || usr.restrained() || src.loc != usr)
return
if (!ishuman(usr))
return 1
var/mob/living/carbon/human/H = usr
if(H.is_holding(src))
H.set_machine(src)
if (href_list["spell_teleport"])
if(uses)
teleportscroll(H)
if(H)
attack_self(H)
return
/obj/item/teleportation_scroll/proc/teleportscroll(mob/user)
var/A
A = input(user, "Area to jump to", "BOOYEA", A) as null|anything in GLOB.teleportlocs
if(!src || QDELETED(src) || !user || !user.is_holding(src) || user.incapacitated() || !A || !uses)
return
var/area/thearea = GLOB.teleportlocs[A]
var/datum/effect_system/smoke_spread/smoke = new
smoke.set_up(2, user.loc)
smoke.attach(user)
smoke.start()
var/list/L = list()
for(var/turf/T in get_area_turfs(thearea.type))
if(!is_blocked_turf(T))
L += T
if(!L.len)
to_chat(user, "The spell matrix was unable to locate a suitable teleport destination for an unknown reason. Sorry.")
return
if(do_teleport(user, pick(L), forceMove = TRUE, channel = TELEPORT_CHANNEL_MAGIC, forced = TRUE))
smoke.start()
uses--
else
to_chat(user, "The spell matrix was disrupted by something near the destination.")
+183 -183
View File
@@ -1,183 +1,183 @@
/obj/item/shield
name = "shield"
block_chance = 50
armor = list("melee" = 50, "bullet" = 50, "laser" = 50, "energy" = 0, "bomb" = 30, "bio" = 0, "rad" = 0, "fire" = 80, "acid" = 70)
/obj/item/shield/riot
name = "riot shield"
desc = "A shield adept at blocking blunt objects from connecting with the torso of the shield wielder."
icon = 'icons/obj/items_and_weapons.dmi'
icon_state = "riot"
lefthand_file = 'icons/mob/inhands/equipment/shields_lefthand.dmi'
righthand_file = 'icons/mob/inhands/equipment/shields_righthand.dmi'
slot_flags = ITEM_SLOT_BACK
force = 10
throwforce = 5
throw_speed = 2
throw_range = 3
w_class = WEIGHT_CLASS_BULKY
materials = list(MAT_GLASS=7500, MAT_METAL=1000)
attack_verb = list("shoved", "bashed")
var/cooldown = 0 //shield bash cooldown. based on world.time
/obj/item/shield/riot/attackby(obj/item/W, mob/user, params)
if(istype(W, /obj/item/melee/baton))
if(cooldown < world.time - 25)
user.visible_message("<span class='warning'>[user] bashes [src] with [W]!</span>")
playsound(user.loc, 'sound/effects/shieldbash.ogg', 50, 1)
cooldown = world.time
else
return ..()
/obj/item/shield/hit_reaction(mob/living/carbon/human/owner, atom/movable/hitby, attack_text = "the attack", final_block_chance = 0, damage = 0, attack_type = MELEE_ATTACK)
if(attack_type == THROWN_PROJECTILE_ATTACK)
final_block_chance += 30
if(attack_type == LEAP_ATTACK)
final_block_chance = 100
return ..()
/obj/item/shield/riot/roman
name = "\improper Roman shield"
desc = "Bears an inscription on the inside: <i>\"Romanes venio domus\"</i>."
icon_state = "roman_shield"
item_state = "roman_shield"
lefthand_file = 'icons/mob/inhands/equipment/shields_lefthand.dmi'
righthand_file = 'icons/mob/inhands/equipment/shields_righthand.dmi'
/obj/item/shield/riot/roman/fake
desc = "Bears an inscription on the inside: <i>\"Romanes venio domus\"</i>. It appears to be a bit flimsy."
block_chance = 0
armor = list("melee" = 0, "bullet" = 0, "laser" = 0, "energy" = 0, "bomb" = 0, "bio" = 0, "rad" = 0, "fire" = 0, "acid" = 0)
/obj/item/shield/riot/buckler
name = "wooden buckler"
desc = "A medieval wooden buckler."
icon_state = "buckler"
item_state = "buckler"
lefthand_file = 'icons/mob/inhands/equipment/shields_lefthand.dmi'
righthand_file = 'icons/mob/inhands/equipment/shields_righthand.dmi'
materials = list()
resistance_flags = FLAMMABLE
block_chance = 30
/obj/item/shield/energy
name = "energy combat shield"
desc = "A shield that reflects almost all energy projectiles, but is useless against physical attacks. It can be retracted, expanded, and stored anywhere."
icon = 'icons/obj/items_and_weapons.dmi'
lefthand_file = 'icons/mob/inhands/equipment/shields_lefthand.dmi'
righthand_file = 'icons/mob/inhands/equipment/shields_righthand.dmi'
w_class = WEIGHT_CLASS_TINY
attack_verb = list("shoved", "bashed")
throw_range = 5
force = 3
throwforce = 3
throw_speed = 3
var/base_icon_state = "eshield" // [base_icon_state]1 for expanded, [base_icon_state]0 for contracted
var/on_force = 10
var/on_throwforce = 8
var/on_throw_speed = 2
var/active = 0
var/clumsy_check = TRUE
/obj/item/shield/energy/Initialize()
. = ..()
icon_state = "[base_icon_state]0"
/obj/item/shield/energy/hit_reaction(mob/living/carbon/human/owner, atom/movable/hitby, attack_text = "the attack", final_block_chance = 0, damage = 0, attack_type = MELEE_ATTACK)
return 0
/obj/item/shield/energy/IsReflect()
return (active)
/obj/item/shield/energy/attack_self(mob/living/carbon/human/user)
if(clumsy_check && HAS_TRAIT(user, TRAIT_CLUMSY) && prob(50))
to_chat(user, "<span class='warning'>You beat yourself in the head with [src].</span>")
user.take_bodypart_damage(5)
active = !active
icon_state = "[base_icon_state][active]"
if(active)
force = on_force
throwforce = on_throwforce
throw_speed = on_throw_speed
w_class = WEIGHT_CLASS_BULKY
playsound(user, 'sound/weapons/saberon.ogg', 35, 1)
to_chat(user, "<span class='notice'>[src] is now active.</span>")
else
force = initial(force)
throwforce = initial(throwforce)
throw_speed = initial(throw_speed)
w_class = WEIGHT_CLASS_TINY
playsound(user, 'sound/weapons/saberoff.ogg', 35, 1)
to_chat(user, "<span class='notice'>[src] can now be concealed.</span>")
add_fingerprint(user)
/obj/item/shield/riot/tele
name = "telescopic shield"
desc = "An advanced riot shield made of lightweight materials that collapses for easy storage."
icon = 'icons/obj/items_and_weapons.dmi'
icon_state = "teleriot0"
lefthand_file = 'icons/mob/inhands/equipment/shields_lefthand.dmi'
righthand_file = 'icons/mob/inhands/equipment/shields_righthand.dmi'
slot_flags = null
force = 3
throwforce = 3
throw_speed = 3
throw_range = 4
w_class = WEIGHT_CLASS_NORMAL
var/active = 0
/obj/item/shield/riot/tele/hit_reaction(mob/living/carbon/human/owner, atom/movable/hitby, attack_text = "the attack", final_block_chance = 0, damage = 0, attack_type = MELEE_ATTACK)
if(active)
return ..()
return 0
/obj/item/shield/riot/tele/attack_self(mob/living/user)
active = !active
icon_state = "teleriot[active]"
playsound(src.loc, 'sound/weapons/batonextend.ogg', 50, 1)
if(active)
force = 8
throwforce = 5
throw_speed = 2
w_class = WEIGHT_CLASS_BULKY
slot_flags = ITEM_SLOT_BACK
to_chat(user, "<span class='notice'>You extend \the [src].</span>")
else
force = 3
throwforce = 3
throw_speed = 3
w_class = WEIGHT_CLASS_NORMAL
slot_flags = null
to_chat(user, "<span class='notice'>[src] can now be concealed.</span>")
add_fingerprint(user)
/obj/item/shield/makeshift
name = "metal shield"
desc = "A large shield made of wired and welded sheets of metal. The handle is made of cloth and leather making it unwieldy."
armor = list("melee" = 25, "bullet" = 25, "laser" = 5, "energy" = 0, "bomb" = 30, "bio" = 0, "rad" = 0, "fire" = 70, "acid" = 80)
lefthand_file = 'icons/mob/inhands/equipment/shields_lefthand.dmi'
righthand_file = 'icons/mob/inhands/equipment/shields_righthand.dmi'
icon = 'icons/obj/items_and_weapons.dmi'
item_state = "metal"
icon_state = "makeshift_shield"
materials = list(MAT_METAL = 18000)
slot_flags = null
block_chance = 35
force = 10
throwforce = 7
/obj/item/shield/riot/tower
name = "tower shield"
desc = "A massive shield that can block a lot of attacks, can take a lot of abuse before braking."
armor = list("melee" = 95, "bullet" = 95, "laser" = 75, "energy" = 60, "bomb" = 90, "bio" = 90, "rad" = 0, "fire" = 90, "acid" = 10) //Armor for the item, dosnt transfer to user
item_state = "metal"
icon_state = "metal"
icon = 'icons/obj/items_and_weapons.dmi'
block_chance = 75 //1/4 shots will hit*
force = 16
slowdown = 2
throwforce = 15 //Massive pice of metal
w_class = WEIGHT_CLASS_HUGE
item_flags = SLOWS_WHILE_IN_HAND
/obj/item/shield
name = "shield"
block_chance = 50
armor = list("melee" = 50, "bullet" = 50, "laser" = 50, "energy" = 0, "bomb" = 30, "bio" = 0, "rad" = 0, "fire" = 80, "acid" = 70)
/obj/item/shield/riot
name = "riot shield"
desc = "A shield adept at blocking blunt objects from connecting with the torso of the shield wielder."
icon = 'icons/obj/items_and_weapons.dmi'
icon_state = "riot"
lefthand_file = 'icons/mob/inhands/equipment/shields_lefthand.dmi'
righthand_file = 'icons/mob/inhands/equipment/shields_righthand.dmi'
slot_flags = ITEM_SLOT_BACK
force = 10
throwforce = 5
throw_speed = 2
throw_range = 3
w_class = WEIGHT_CLASS_BULKY
materials = list(MAT_GLASS=7500, MAT_METAL=1000)
attack_verb = list("shoved", "bashed")
var/cooldown = 0 //shield bash cooldown. based on world.time
/obj/item/shield/riot/attackby(obj/item/W, mob/user, params)
if(istype(W, /obj/item/melee/baton))
if(cooldown < world.time - 25)
user.visible_message("<span class='warning'>[user] bashes [src] with [W]!</span>")
playsound(user.loc, 'sound/effects/shieldbash.ogg', 50, 1)
cooldown = world.time
else
return ..()
/obj/item/shield/hit_reaction(mob/living/carbon/human/owner, atom/movable/hitby, attack_text = "the attack", final_block_chance = 0, damage = 0, attack_type = MELEE_ATTACK)
if(attack_type == THROWN_PROJECTILE_ATTACK)
final_block_chance += 30
if(attack_type == LEAP_ATTACK)
final_block_chance = 100
return ..()
/obj/item/shield/riot/roman
name = "\improper Roman shield"
desc = "Bears an inscription on the inside: <i>\"Romanes venio domus\"</i>."
icon_state = "roman_shield"
item_state = "roman_shield"
lefthand_file = 'icons/mob/inhands/equipment/shields_lefthand.dmi'
righthand_file = 'icons/mob/inhands/equipment/shields_righthand.dmi'
/obj/item/shield/riot/roman/fake
desc = "Bears an inscription on the inside: <i>\"Romanes venio domus\"</i>. It appears to be a bit flimsy."
block_chance = 0
armor = list("melee" = 0, "bullet" = 0, "laser" = 0, "energy" = 0, "bomb" = 0, "bio" = 0, "rad" = 0, "fire" = 0, "acid" = 0)
/obj/item/shield/riot/buckler
name = "wooden buckler"
desc = "A medieval wooden buckler."
icon_state = "buckler"
item_state = "buckler"
lefthand_file = 'icons/mob/inhands/equipment/shields_lefthand.dmi'
righthand_file = 'icons/mob/inhands/equipment/shields_righthand.dmi'
materials = list()
resistance_flags = FLAMMABLE
block_chance = 30
/obj/item/shield/energy
name = "energy combat shield"
desc = "A shield that reflects almost all energy projectiles, but is useless against physical attacks. It can be retracted, expanded, and stored anywhere."
icon = 'icons/obj/items_and_weapons.dmi'
lefthand_file = 'icons/mob/inhands/equipment/shields_lefthand.dmi'
righthand_file = 'icons/mob/inhands/equipment/shields_righthand.dmi'
w_class = WEIGHT_CLASS_TINY
attack_verb = list("shoved", "bashed")
throw_range = 5
force = 3
throwforce = 3
throw_speed = 3
var/base_icon_state = "eshield" // [base_icon_state]1 for expanded, [base_icon_state]0 for contracted
var/on_force = 10
var/on_throwforce = 8
var/on_throw_speed = 2
var/active = 0
var/clumsy_check = TRUE
/obj/item/shield/energy/Initialize()
. = ..()
icon_state = "[base_icon_state]0"
/obj/item/shield/energy/hit_reaction(mob/living/carbon/human/owner, atom/movable/hitby, attack_text = "the attack", final_block_chance = 0, damage = 0, attack_type = MELEE_ATTACK)
return 0
/obj/item/shield/energy/IsReflect()
return (active)
/obj/item/shield/energy/attack_self(mob/living/carbon/human/user)
if(clumsy_check && HAS_TRAIT(user, TRAIT_CLUMSY) && prob(50))
to_chat(user, "<span class='warning'>You beat yourself in the head with [src].</span>")
user.take_bodypart_damage(5)
active = !active
icon_state = "[base_icon_state][active]"
if(active)
force = on_force
throwforce = on_throwforce
throw_speed = on_throw_speed
w_class = WEIGHT_CLASS_BULKY
playsound(user, 'sound/weapons/saberon.ogg', 35, 1)
to_chat(user, "<span class='notice'>[src] is now active.</span>")
else
force = initial(force)
throwforce = initial(throwforce)
throw_speed = initial(throw_speed)
w_class = WEIGHT_CLASS_TINY
playsound(user, 'sound/weapons/saberoff.ogg', 35, 1)
to_chat(user, "<span class='notice'>[src] can now be concealed.</span>")
add_fingerprint(user)
/obj/item/shield/riot/tele
name = "telescopic shield"
desc = "An advanced riot shield made of lightweight materials that collapses for easy storage."
icon = 'icons/obj/items_and_weapons.dmi'
icon_state = "teleriot0"
lefthand_file = 'icons/mob/inhands/equipment/shields_lefthand.dmi'
righthand_file = 'icons/mob/inhands/equipment/shields_righthand.dmi'
slot_flags = null
force = 3
throwforce = 3
throw_speed = 3
throw_range = 4
w_class = WEIGHT_CLASS_NORMAL
var/active = 0
/obj/item/shield/riot/tele/hit_reaction(mob/living/carbon/human/owner, atom/movable/hitby, attack_text = "the attack", final_block_chance = 0, damage = 0, attack_type = MELEE_ATTACK)
if(active)
return ..()
return 0
/obj/item/shield/riot/tele/attack_self(mob/living/user)
active = !active
icon_state = "teleriot[active]"
playsound(src.loc, 'sound/weapons/batonextend.ogg', 50, 1)
if(active)
force = 8
throwforce = 5
throw_speed = 2
w_class = WEIGHT_CLASS_BULKY
slot_flags = ITEM_SLOT_BACK
to_chat(user, "<span class='notice'>You extend \the [src].</span>")
else
force = 3
throwforce = 3
throw_speed = 3
w_class = WEIGHT_CLASS_NORMAL
slot_flags = null
to_chat(user, "<span class='notice'>[src] can now be concealed.</span>")
add_fingerprint(user)
/obj/item/shield/makeshift
name = "metal shield"
desc = "A large shield made of wired and welded sheets of metal. The handle is made of cloth and leather making it unwieldy."
armor = list("melee" = 25, "bullet" = 25, "laser" = 5, "energy" = 0, "bomb" = 30, "bio" = 0, "rad" = 0, "fire" = 70, "acid" = 80)
lefthand_file = 'icons/mob/inhands/equipment/shields_lefthand.dmi'
righthand_file = 'icons/mob/inhands/equipment/shields_righthand.dmi'
icon = 'icons/obj/items_and_weapons.dmi'
item_state = "metal"
icon_state = "makeshift_shield"
materials = list(MAT_METAL = 18000)
slot_flags = null
block_chance = 35
force = 10
throwforce = 7
/obj/item/shield/riot/tower
name = "tower shield"
desc = "A massive shield that can block a lot of attacks, can take a lot of abuse before braking."
armor = list("melee" = 95, "bullet" = 95, "laser" = 75, "energy" = 60, "bomb" = 90, "bio" = 90, "rad" = 0, "fire" = 90, "acid" = 10) //Armor for the item, dosnt transfer to user
item_state = "metal"
icon_state = "metal"
icon = 'icons/obj/items_and_weapons.dmi'
block_chance = 75 //1/4 shots will hit*
force = 16
slowdown = 2
throwforce = 15 //Massive pice of metal
w_class = WEIGHT_CLASS_HUGE
item_flags = SLOWS_WHILE_IN_HAND
+96 -96
View File
@@ -1,96 +1,96 @@
/obj/item/target
name = "shooting target"
desc = "A shooting target."
icon = 'icons/obj/objects.dmi'
icon_state = "target_h"
density = FALSE
var/hp = 1800
var/obj/structure/target_stake/pinnedLoc
/obj/item/target/Destroy()
removeOverlays()
if(pinnedLoc)
pinnedLoc.nullPinnedTarget()
return ..()
/obj/item/target/proc/nullPinnedLoc()
pinnedLoc = null
density = FALSE
/obj/item/target/proc/removeOverlays()
cut_overlays()
/obj/item/target/Move()
. = ..()
if(pinnedLoc)
pinnedLoc.forceMove(loc)
/obj/item/target/welder_act(mob/living/user, obj/item/I)
if(I.use_tool(src, user, 0, volume=40))
removeOverlays()
to_chat(user, "<span class='notice'>You slice off [src]'s uneven chunks of aluminium and scorch marks.</span>")
return TRUE
/obj/item/target/attack_hand(mob/user)
. = ..()
if(.)
return
if(pinnedLoc)
pinnedLoc.removeTarget(user)
/obj/item/target/syndicate
icon_state = "target_s"
desc = "A shooting target that looks like syndicate scum."
hp = 2600
/obj/item/target/alien
icon_state = "target_q"
desc = "A shooting target that looks like a xenomorphic alien."
hp = 2350
/obj/item/target/alien/anchored
anchored = TRUE
/obj/item/target/clown
icon_state = "target_c"
desc = "A shooting target that looks like a useless clown."
hp = 2000
#define DECALTYPE_SCORCH 1
#define DECALTYPE_BULLET 2
/obj/item/target/clown/bullet_act(obj/item/projectile/P)
..()
playsound(src.loc, 'sound/items/bikehorn.ogg', 50, 1)
/obj/item/target/bullet_act(obj/item/projectile/P)
if(istype(P, /obj/item/projectile/bullet/reusable)) // If it's a foam dart, don't bother with any of this other shit
return P.on_hit(src, 0)
var/p_x = P.p_x + pick(0,0,0,0,0,-1,1) // really ugly way of coding "sometimes offset P.p_x!"
var/p_y = P.p_y + pick(0,0,0,0,0,-1,1)
var/decaltype = DECALTYPE_SCORCH
if(istype(P, /obj/item/projectile/bullet))
decaltype = DECALTYPE_BULLET
var/icon/C = icon(icon,icon_state)
if(C.GetPixel(p_x, p_y) && P.original == src && overlays.len <= 35) // if the located pixel isn't blank (null)
hp -= P.damage
if(hp <= 0)
visible_message("<span class='danger'>[src] breaks into tiny pieces and collapses!</span>")
qdel(src)
var/image/bullet_hole = image('icons/effects/effects.dmi', "scorch", OBJ_LAYER + 0.5)
bullet_hole.pixel_x = p_x - 1 //offset correction
bullet_hole.pixel_y = p_y - 1
if(decaltype == DECALTYPE_SCORCH)
bullet_hole.setDir(pick(NORTH,SOUTH,EAST,WEST))// random scorch design
if(P.damage >= 20 || istype(P, /obj/item/projectile/beam/practice))
bullet_hole.setDir(pick(NORTH,SOUTH,EAST,WEST))
else
bullet_hole.icon_state = "light_scorch"
else
bullet_hole.icon_state = "dent"
add_overlay(bullet_hole)
return
return -1
#undef DECALTYPE_SCORCH
#undef DECALTYPE_BULLET
/obj/item/target
name = "shooting target"
desc = "A shooting target."
icon = 'icons/obj/objects.dmi'
icon_state = "target_h"
density = FALSE
var/hp = 1800
var/obj/structure/target_stake/pinnedLoc
/obj/item/target/Destroy()
removeOverlays()
if(pinnedLoc)
pinnedLoc.nullPinnedTarget()
return ..()
/obj/item/target/proc/nullPinnedLoc()
pinnedLoc = null
density = FALSE
/obj/item/target/proc/removeOverlays()
cut_overlays()
/obj/item/target/Move()
. = ..()
if(pinnedLoc)
pinnedLoc.forceMove(loc)
/obj/item/target/welder_act(mob/living/user, obj/item/I)
if(I.use_tool(src, user, 0, volume=40))
removeOverlays()
to_chat(user, "<span class='notice'>You slice off [src]'s uneven chunks of aluminium and scorch marks.</span>")
return TRUE
/obj/item/target/attack_hand(mob/user)
. = ..()
if(.)
return
if(pinnedLoc)
pinnedLoc.removeTarget(user)
/obj/item/target/syndicate
icon_state = "target_s"
desc = "A shooting target that looks like syndicate scum."
hp = 2600
/obj/item/target/alien
icon_state = "target_q"
desc = "A shooting target that looks like a xenomorphic alien."
hp = 2350
/obj/item/target/alien/anchored
anchored = TRUE
/obj/item/target/clown
icon_state = "target_c"
desc = "A shooting target that looks like a useless clown."
hp = 2000
#define DECALTYPE_SCORCH 1
#define DECALTYPE_BULLET 2
/obj/item/target/clown/bullet_act(obj/item/projectile/P)
..()
playsound(src.loc, 'sound/items/bikehorn.ogg', 50, 1)
/obj/item/target/bullet_act(obj/item/projectile/P)
if(istype(P, /obj/item/projectile/bullet/reusable)) // If it's a foam dart, don't bother with any of this other shit
return P.on_hit(src, 0)
var/p_x = P.p_x + pick(0,0,0,0,0,-1,1) // really ugly way of coding "sometimes offset P.p_x!"
var/p_y = P.p_y + pick(0,0,0,0,0,-1,1)
var/decaltype = DECALTYPE_SCORCH
if(istype(P, /obj/item/projectile/bullet))
decaltype = DECALTYPE_BULLET
var/icon/C = icon(icon,icon_state)
if(C.GetPixel(p_x, p_y) && P.original == src && overlays.len <= 35) // if the located pixel isn't blank (null)
hp -= P.damage
if(hp <= 0)
visible_message("<span class='danger'>[src] breaks into tiny pieces and collapses!</span>")
qdel(src)
var/image/bullet_hole = image('icons/effects/effects.dmi', "scorch", OBJ_LAYER + 0.5)
bullet_hole.pixel_x = p_x - 1 //offset correction
bullet_hole.pixel_y = p_y - 1
if(decaltype == DECALTYPE_SCORCH)
bullet_hole.setDir(pick(NORTH,SOUTH,EAST,WEST))// random scorch design
if(P.damage >= 20 || istype(P, /obj/item/projectile/beam/practice))
bullet_hole.setDir(pick(NORTH,SOUTH,EAST,WEST))
else
bullet_hole.icon_state = "light_scorch"
else
bullet_hole.icon_state = "dent"
add_overlay(bullet_hole)
return
return -1
#undef DECALTYPE_SCORCH
#undef DECALTYPE_BULLET
+115 -115
View File
@@ -1,115 +1,115 @@
/obj/item/twohanded/singularityhammer
name = "singularity hammer"
desc = "The pinnacle of close combat technology, the hammer harnesses the power of a miniaturized singularity to deal crushing blows."
icon_state = "mjollnir0"
lefthand_file = 'icons/mob/inhands/weapons/hammers_lefthand.dmi'
righthand_file = 'icons/mob/inhands/weapons/hammers_righthand.dmi'
flags_1 = CONDUCT_1
slot_flags = ITEM_SLOT_BACK
force = 5
force_unwielded = 5
force_wielded = 20
throwforce = 15
throw_range = 1
w_class = WEIGHT_CLASS_HUGE
var/charged = 5
armor = list("melee" = 50, "bullet" = 50, "laser" = 50, "energy" = 0, "bomb" = 50, "bio" = 0, "rad" = 0, "fire" = 100, "acid" = 100)
resistance_flags = FIRE_PROOF | ACID_PROOF
force_string = "LORD SINGULOTH HIMSELF"
total_mass = TOTAL_MASS_MEDIEVAL_WEAPON
/obj/item/twohanded/singularityhammer/New()
..()
START_PROCESSING(SSobj, src)
/obj/item/twohanded/singularityhammer/Destroy()
STOP_PROCESSING(SSobj, src)
return ..()
/obj/item/twohanded/singularityhammer/process()
if(charged < 5)
charged++
return
/obj/item/twohanded/singularityhammer/update_icon() //Currently only here to fuck with the on-mob icons.
icon_state = "mjollnir[wielded]"
return
/obj/item/twohanded/singularityhammer/proc/vortex(turf/pull, mob/wielder)
for(var/atom/X in orange(5,pull))
if(ismovableatom(X))
var/atom/movable/A = X
if(A == wielder)
continue
if(A && !A.anchored && !ishuman(X))
step_towards(A,pull)
step_towards(A,pull)
step_towards(A,pull)
else if(ishuman(X))
var/mob/living/carbon/human/H = X
if(istype(H.shoes, /obj/item/clothing/shoes/magboots))
var/obj/item/clothing/shoes/magboots/M = H.shoes
if(M.magpulse)
continue
H.apply_effect(20, EFFECT_KNOCKDOWN, 0)
step_towards(H,pull)
step_towards(H,pull)
step_towards(H,pull)
return
/obj/item/twohanded/singularityhammer/afterattack(atom/A as mob|obj|turf|area, mob/user, proximity)
. = ..()
if(!proximity)
return
if(wielded)
if(charged == 5)
charged = 0
if(istype(A, /mob/living/))
var/mob/living/Z = A
Z.take_bodypart_damage(20,0)
playsound(user, 'sound/weapons/marauder.ogg', 50, 1)
var/turf/target = get_turf(A)
vortex(target,user)
/obj/item/twohanded/mjollnir
name = "Mjolnir"
desc = "A weapon worthy of a god, able to strike with the force of a lightning bolt. It crackles with barely contained energy."
icon_state = "mjollnir0"
lefthand_file = 'icons/mob/inhands/weapons/hammers_lefthand.dmi'
righthand_file = 'icons/mob/inhands/weapons/hammers_righthand.dmi'
flags_1 = CONDUCT_1
slot_flags = ITEM_SLOT_BACK
force = 5
force_unwielded = 5
force_wielded = 25
throwforce = 30
throw_range = 7
w_class = WEIGHT_CLASS_HUGE
total_mass = TOTAL_MASS_MEDIEVAL_WEAPON
/obj/item/twohanded/mjollnir/proc/shock(mob/living/target)
target.Stun(60)
var/datum/effect_system/lightning_spread/s = new /datum/effect_system/lightning_spread
s.set_up(5, 1, target.loc)
s.start()
target.visible_message("<span class='danger'>[target.name] was shocked by [src]!</span>", \
"<span class='userdanger'>You feel a powerful shock course through your body sending you flying!</span>", \
"<span class='italics'>You hear a heavy electrical crack!</span>")
var/atom/throw_target = get_edge_target_turf(target, get_dir(src, get_step_away(target, src)))
target.throw_at(throw_target, 200, 4)
return
/obj/item/twohanded/mjollnir/attack(mob/living/M, mob/user)
..()
if(wielded)
playsound(src.loc, "sparks", 50, 1)
shock(M)
/obj/item/twohanded/mjollnir/throw_impact(atom/target)
. = ..()
if(isliving(target))
shock(target)
/obj/item/twohanded/mjollnir/update_icon() //Currently only here to fuck with the on-mob icons.
icon_state = "mjollnir[wielded]"
return
/obj/item/twohanded/singularityhammer
name = "singularity hammer"
desc = "The pinnacle of close combat technology, the hammer harnesses the power of a miniaturized singularity to deal crushing blows."
icon_state = "mjollnir0"
lefthand_file = 'icons/mob/inhands/weapons/hammers_lefthand.dmi'
righthand_file = 'icons/mob/inhands/weapons/hammers_righthand.dmi'
flags_1 = CONDUCT_1
slot_flags = ITEM_SLOT_BACK
force = 5
force_unwielded = 5
force_wielded = 20
throwforce = 15
throw_range = 1
w_class = WEIGHT_CLASS_HUGE
var/charged = 5
armor = list("melee" = 50, "bullet" = 50, "laser" = 50, "energy" = 0, "bomb" = 50, "bio" = 0, "rad" = 0, "fire" = 100, "acid" = 100)
resistance_flags = FIRE_PROOF | ACID_PROOF
force_string = "LORD SINGULOTH HIMSELF"
total_mass = TOTAL_MASS_MEDIEVAL_WEAPON
/obj/item/twohanded/singularityhammer/New()
..()
START_PROCESSING(SSobj, src)
/obj/item/twohanded/singularityhammer/Destroy()
STOP_PROCESSING(SSobj, src)
return ..()
/obj/item/twohanded/singularityhammer/process()
if(charged < 5)
charged++
return
/obj/item/twohanded/singularityhammer/update_icon() //Currently only here to fuck with the on-mob icons.
icon_state = "mjollnir[wielded]"
return
/obj/item/twohanded/singularityhammer/proc/vortex(turf/pull, mob/wielder)
for(var/atom/X in orange(5,pull))
if(ismovableatom(X))
var/atom/movable/A = X
if(A == wielder)
continue
if(A && !A.anchored && !ishuman(X))
step_towards(A,pull)
step_towards(A,pull)
step_towards(A,pull)
else if(ishuman(X))
var/mob/living/carbon/human/H = X
if(istype(H.shoes, /obj/item/clothing/shoes/magboots))
var/obj/item/clothing/shoes/magboots/M = H.shoes
if(M.magpulse)
continue
H.apply_effect(20, EFFECT_KNOCKDOWN, 0)
step_towards(H,pull)
step_towards(H,pull)
step_towards(H,pull)
return
/obj/item/twohanded/singularityhammer/afterattack(atom/A as mob|obj|turf|area, mob/user, proximity)
. = ..()
if(!proximity)
return
if(wielded)
if(charged == 5)
charged = 0
if(istype(A, /mob/living/))
var/mob/living/Z = A
Z.take_bodypart_damage(20,0)
playsound(user, 'sound/weapons/marauder.ogg', 50, 1)
var/turf/target = get_turf(A)
vortex(target,user)
/obj/item/twohanded/mjollnir
name = "Mjolnir"
desc = "A weapon worthy of a god, able to strike with the force of a lightning bolt. It crackles with barely contained energy."
icon_state = "mjollnir0"
lefthand_file = 'icons/mob/inhands/weapons/hammers_lefthand.dmi'
righthand_file = 'icons/mob/inhands/weapons/hammers_righthand.dmi'
flags_1 = CONDUCT_1
slot_flags = ITEM_SLOT_BACK
force = 5
force_unwielded = 5
force_wielded = 25
throwforce = 30
throw_range = 7
w_class = WEIGHT_CLASS_HUGE
total_mass = TOTAL_MASS_MEDIEVAL_WEAPON
/obj/item/twohanded/mjollnir/proc/shock(mob/living/target)
target.Stun(60)
var/datum/effect_system/lightning_spread/s = new /datum/effect_system/lightning_spread
s.set_up(5, 1, target.loc)
s.start()
target.visible_message("<span class='danger'>[target.name] was shocked by [src]!</span>", \
"<span class='userdanger'>You feel a powerful shock course through your body sending you flying!</span>", \
"<span class='italics'>You hear a heavy electrical crack!</span>")
var/atom/throw_target = get_edge_target_turf(target, get_dir(src, get_step_away(target, src)))
target.throw_at(throw_target, 200, 4)
return
/obj/item/twohanded/mjollnir/attack(mob/living/M, mob/user)
..()
if(wielded)
playsound(src.loc, "sparks", 50, 1)
shock(M)
/obj/item/twohanded/mjollnir/throw_impact(atom/target)
. = ..()
if(isliving(target))
shock(target)
/obj/item/twohanded/mjollnir/update_icon() //Currently only here to fuck with the on-mob icons.
icon_state = "mjollnir[wielded]"
return
+89 -89
View File
@@ -1,89 +1,89 @@
//Bluespace crystals, used in telescience and when crushed it will blink you to a random turf.
/obj/item/stack/ore/bluespace_crystal
name = "bluespace crystal"
desc = "A glowing bluespace crystal, not much is known about how they work. It looks very delicate."
icon = 'icons/obj/telescience.dmi'
icon_state = "bluespace_crystal"
singular_name = "bluespace crystal"
w_class = WEIGHT_CLASS_TINY
materials = list(MAT_BLUESPACE=MINERAL_MATERIAL_AMOUNT)
points = 50
var/blink_range = 8 // The teleport range when crushed/thrown at someone.
refined_type = /obj/item/stack/sheet/bluespace_crystal
grind_results = list(/datum/reagent/bluespace = 20)
/obj/item/stack/ore/bluespace_crystal/refined
name = "refined bluespace crystal"
points = 0
refined_type = null
/obj/item/stack/ore/bluespace_crystal/Initialize()
. = ..()
pixel_x = rand(-5, 5)
pixel_y = rand(-5, 5)
/obj/item/stack/ore/bluespace_crystal/get_part_rating()
return 1
/obj/item/stack/ore/bluespace_crystal/attack_self(mob/user)
user.visible_message("<span class='warning'>[user] crushes [src]!</span>", "<span class='danger'>You crush [src]!</span>")
new /obj/effect/particle_effect/sparks(loc)
playsound(loc, "sparks", 50, 1)
blink_mob(user)
use(1)
/obj/item/stack/ore/bluespace_crystal/proc/blink_mob(mob/living/L)
do_teleport(L, get_turf(L), blink_range, asoundin = 'sound/effects/phasein.ogg', channel = TELEPORT_CHANNEL_BLUESPACE)
/obj/item/stack/ore/bluespace_crystal/throw_impact(atom/hit_atom)
if(!..()) // not caught in mid-air
visible_message("<span class='notice'>[src] fizzles and disappears upon impact!</span>")
var/turf/T = get_turf(hit_atom)
new /obj/effect/particle_effect/sparks(T)
playsound(loc, "sparks", 50, 1)
if(isliving(hit_atom))
blink_mob(hit_atom)
use(1)
//Artificial bluespace crystal, doesn't give you much research.
/obj/item/stack/ore/bluespace_crystal/artificial
name = "artificial bluespace crystal"
desc = "An artificially made bluespace crystal, it looks delicate."
materials = list(MAT_BLUESPACE=MINERAL_MATERIAL_AMOUNT*0.5)
blink_range = 4 // Not as good as the organic stuff!
points = 0 //nice try
refined_type = null
grind_results = list(/datum/reagent/bluespace = 10, /datum/reagent/silicon = 20)
//Polycrystals, aka stacks
/obj/item/stack/sheet/bluespace_crystal
name = "bluespace polycrystal"
icon = 'icons/obj/telescience.dmi'
icon_state = "polycrystal"
item_state = "sheet-polycrystal"
singular_name = "bluespace polycrystal"
desc = "A stable polycrystal, made of fused-together bluespace crystals. You could probably break one off."
materials = list(MAT_BLUESPACE=MINERAL_MATERIAL_AMOUNT)
attack_verb = list("bluespace polybashed", "bluespace polybattered", "bluespace polybludgeoned", "bluespace polythrashed", "bluespace polysmashed")
novariants = TRUE
grind_results = list(/datum/reagent/bluespace = 20)
point_value = 30
var/crystal_type = /obj/item/stack/ore/bluespace_crystal/refined
/obj/item/stack/sheet/bluespace_crystal/attack_self(mob/user)// to prevent the construction menu from ever happening
to_chat(user, "<span class='warning'>You cannot crush the polycrystal in-hand, try breaking one off.</span>")
//ATTACK HAND IGNORING PARENT RETURN VALUE
/obj/item/stack/sheet/bluespace_crystal/attack_hand(mob/user)
if(user.get_inactive_held_item() == src)
if(zero_amount())
return
var/BC = new crystal_type(src)
user.put_in_hands(BC)
use(1)
if(!amount)
to_chat(user, "<span class='notice'>You break the final crystal off.</span>")
else
to_chat(user, "<span class='notice'>You break off a crystal.</span>")
else
..()
//Bluespace crystals, used in telescience and when crushed it will blink you to a random turf.
/obj/item/stack/ore/bluespace_crystal
name = "bluespace crystal"
desc = "A glowing bluespace crystal, not much is known about how they work. It looks very delicate."
icon = 'icons/obj/telescience.dmi'
icon_state = "bluespace_crystal"
singular_name = "bluespace crystal"
w_class = WEIGHT_CLASS_TINY
materials = list(MAT_BLUESPACE=MINERAL_MATERIAL_AMOUNT)
points = 50
var/blink_range = 8 // The teleport range when crushed/thrown at someone.
refined_type = /obj/item/stack/sheet/bluespace_crystal
grind_results = list(/datum/reagent/bluespace = 20)
/obj/item/stack/ore/bluespace_crystal/refined
name = "refined bluespace crystal"
points = 0
refined_type = null
/obj/item/stack/ore/bluespace_crystal/Initialize()
. = ..()
pixel_x = rand(-5, 5)
pixel_y = rand(-5, 5)
/obj/item/stack/ore/bluespace_crystal/get_part_rating()
return 1
/obj/item/stack/ore/bluespace_crystal/attack_self(mob/user)
user.visible_message("<span class='warning'>[user] crushes [src]!</span>", "<span class='danger'>You crush [src]!</span>")
new /obj/effect/particle_effect/sparks(loc)
playsound(loc, "sparks", 50, 1)
blink_mob(user)
use(1)
/obj/item/stack/ore/bluespace_crystal/proc/blink_mob(mob/living/L)
do_teleport(L, get_turf(L), blink_range, asoundin = 'sound/effects/phasein.ogg', channel = TELEPORT_CHANNEL_BLUESPACE)
/obj/item/stack/ore/bluespace_crystal/throw_impact(atom/hit_atom)
if(!..()) // not caught in mid-air
visible_message("<span class='notice'>[src] fizzles and disappears upon impact!</span>")
var/turf/T = get_turf(hit_atom)
new /obj/effect/particle_effect/sparks(T)
playsound(loc, "sparks", 50, 1)
if(isliving(hit_atom))
blink_mob(hit_atom)
use(1)
//Artificial bluespace crystal, doesn't give you much research.
/obj/item/stack/ore/bluespace_crystal/artificial
name = "artificial bluespace crystal"
desc = "An artificially made bluespace crystal, it looks delicate."
materials = list(MAT_BLUESPACE=MINERAL_MATERIAL_AMOUNT*0.5)
blink_range = 4 // Not as good as the organic stuff!
points = 0 //nice try
refined_type = null
grind_results = list(/datum/reagent/bluespace = 10, /datum/reagent/silicon = 20)
//Polycrystals, aka stacks
/obj/item/stack/sheet/bluespace_crystal
name = "bluespace polycrystal"
icon = 'icons/obj/telescience.dmi'
icon_state = "polycrystal"
item_state = "sheet-polycrystal"
singular_name = "bluespace polycrystal"
desc = "A stable polycrystal, made of fused-together bluespace crystals. You could probably break one off."
materials = list(MAT_BLUESPACE=MINERAL_MATERIAL_AMOUNT)
attack_verb = list("bluespace polybashed", "bluespace polybattered", "bluespace polybludgeoned", "bluespace polythrashed", "bluespace polysmashed")
novariants = TRUE
grind_results = list(/datum/reagent/bluespace = 20)
point_value = 30
var/crystal_type = /obj/item/stack/ore/bluespace_crystal/refined
/obj/item/stack/sheet/bluespace_crystal/attack_self(mob/user)// to prevent the construction menu from ever happening
to_chat(user, "<span class='warning'>You cannot crush the polycrystal in-hand, try breaking one off.</span>")
//ATTACK HAND IGNORING PARENT RETURN VALUE
/obj/item/stack/sheet/bluespace_crystal/attack_hand(mob/user)
if(user.get_inactive_held_item() == src)
if(zero_amount())
return
var/BC = new crystal_type(src)
user.put_in_hands(BC)
use(1)
if(!amount)
to_chat(user, "<span class='notice'>You break the final crystal off.</span>")
else
to_chat(user, "<span class='notice'>You break off a crystal.</span>")
else
..()
+155 -155
View File
@@ -1,155 +1,155 @@
/obj/item/stack/medical
name = "medical pack"
singular_name = "medical pack"
icon = 'icons/obj/stack_objects.dmi'
amount = 12
max_amount = 12
w_class = WEIGHT_CLASS_TINY
full_w_class = WEIGHT_CLASS_TINY
throw_speed = 3
throw_range = 7
resistance_flags = FLAMMABLE
max_integrity = 40
novariants = FALSE
item_flags = NOBLUDGEON
var/self_delay = 50
/obj/item/stack/medical/attack(mob/living/M, mob/user)
. = ..()
if(!M.can_inject(user, TRUE))
return
if(M == user)
user.visible_message("<span class='notice'>[user] starts to apply \the [src] on [user.p_them()]self...</span>", "<span class='notice'>You begin applying \the [src] on yourself...</span>")
if(!do_mob(user, M, self_delay, extra_checks=CALLBACK(M, /mob/living/proc/can_inject, user, TRUE)))
return
if(heal(M, user))
log_combat(user, M, "healed", src.name)
use(1)
/obj/item/stack/medical/proc/heal(mob/living/M, mob/user)
return
/obj/item/stack/medical/proc/heal_carbon(mob/living/carbon/C, mob/user, brute, burn)
var/obj/item/bodypart/affecting = C.get_bodypart(check_zone(user.zone_selected))
if(!affecting) //Missing limb?
to_chat(user, "<span class='warning'>[C] doesn't have \a [parse_zone(user.zone_selected)]!</span>")
return
if(affecting.status == BODYPART_ORGANIC) //Limb must be organic to be healed - RR
if(affecting.brute_dam && brute || affecting.burn_dam && burn)
user.visible_message("<span class='green'>[user] applies \the [src] on [C]'s [affecting.name].</span>", "<span class='green'>You apply \the [src] on [C]'s [affecting.name].</span>")
if(affecting.heal_damage(brute, burn))
C.update_damage_overlays()
return TRUE
to_chat(user, "<span class='notice'>[C]'s [affecting.name] can not be healed with \the [src].</span>")
return
to_chat(user, "<span class='notice'>\The [src] won't work on a robotic limb!</span>")
/obj/item/stack/medical/get_belt_overlay()
return mutable_appearance('icons/obj/clothing/belt_overlays.dmi', "pouch")
/obj/item/stack/medical/bruise_pack
name = "bruise pack"
singular_name = "bruise pack"
desc = "A therapeutic gel pack and bandages designed to treat blunt-force trauma."
icon_state = "brutepack"
lefthand_file = 'icons/mob/inhands/equipment/medical_lefthand.dmi'
righthand_file = 'icons/mob/inhands/equipment/medical_righthand.dmi'
var/heal_brute = 20
self_delay = 20
grind_results = list(/datum/reagent/medicine/styptic_powder = 10)
/obj/item/stack/medical/bruise_pack/heal(mob/living/M, mob/user)
if(M.stat == DEAD)
to_chat(user, "<span class='notice'> [M] is dead. You can not help [M.p_them()]!</span>")
return
if(isanimal(M))
var/mob/living/simple_animal/critter = M
if (!(critter.healable))
to_chat(user, "<span class='notice'> You cannot use \the [src] on [M]!</span>")
return FALSE
else if (critter.health == critter.maxHealth)
to_chat(user, "<span class='notice'> [M] is at full health.</span>")
return FALSE
user.visible_message("<span class='green'>[user] applies \the [src] on [M].</span>", "<span class='green'>You apply \the [src] on [M].</span>")
M.heal_bodypart_damage((heal_brute/2))
return TRUE
if(iscarbon(M))
return heal_carbon(M, user, heal_brute, 0)
to_chat(user, "<span class='notice'>You can't heal [M] with the \the [src]!</span>")
/obj/item/stack/medical/bruise_pack/suicide_act(mob/user)
user.visible_message("<span class='suicide'>[user] is bludgeoning [user.p_them()]self with [src]! It looks like [user.p_theyre()] trying to commit suicide!</span>")
return (BRUTELOSS)
/obj/item/stack/medical/gauze
name = "medical gauze"
desc = "A roll of elastic cloth that is extremely effective at stopping bleeding, heals minor wounds."
gender = PLURAL
singular_name = "medical gauze"
icon_state = "gauze"
var/stop_bleeding = 1800
var/heal_brute = 5
self_delay = 10
/obj/item/stack/medical/gauze/heal(mob/living/M, mob/user)
if(ishuman(M))
var/mob/living/carbon/human/H = M
if(!H.bleedsuppress && H.bleed_rate) //so you can't stack bleed suppression
H.suppress_bloodloss(stop_bleeding)
to_chat(user, "<span class='notice'>You stop the bleeding of [M]!</span>")
return TRUE
to_chat(user, "<span class='notice'>You can not use \the [src] on [M]!</span>")
/obj/item/stack/medical/gauze/attackby(obj/item/I, mob/user, params)
if(I.tool_behaviour == TOOL_WIRECUTTER || I.get_sharpness())
if(get_amount() < 2)
to_chat(user, "<span class='warning'>You need at least two gauzes to do this!</span>")
return
new /obj/item/stack/sheet/cloth(user.drop_location())
user.visible_message("[user] cuts [src] into pieces of cloth with [I].", \
"<span class='notice'>You cut [src] into pieces of cloth with [I].</span>", \
"<span class='italics'>You hear cutting.</span>")
use(2)
else
return ..()
/obj/item/stack/medical/gauze/suicide_act(mob/living/user)
user.visible_message("<span class='suicide'>[user] begins tightening \the [src] around [user.p_their()] neck! It looks like [user.p_they()] forgot how to use medical supplies!</span>")
return OXYLOSS
/obj/item/stack/medical/gauze/improvised
name = "improvised gauze"
singular_name = "improvised gauze"
desc = "A roll of cloth roughly cut from something that can stop bleeding, but does not heal wounds."
stop_bleeding = 900
heal_brute = 0
/obj/item/stack/medical/gauze/cyborg
materials = list()
is_cyborg = 1
cost = 250
/obj/item/stack/medical/ointment
name = "ointment"
desc = "Used to treat those nasty burn wounds."
gender = PLURAL
singular_name = "ointment"
icon_state = "ointment"
lefthand_file = 'icons/mob/inhands/equipment/medical_lefthand.dmi'
righthand_file = 'icons/mob/inhands/equipment/medical_righthand.dmi'
var/heal_burn = 20
self_delay = 20
grind_results = list(/datum/reagent/medicine/silver_sulfadiazine = 10)
/obj/item/stack/medical/ointment/heal(mob/living/M, mob/user)
if(M.stat == DEAD)
to_chat(user, "<span class='notice'> [M] is dead. You can not help [M.p_them()]!</span>")
return
if(iscarbon(M))
return heal_carbon(M, user, 0, heal_burn)
to_chat(user, "<span class='notice'>You can't heal [M] with the \the [src]!</span>")
/obj/item/stack/medical/ointment/suicide_act(mob/living/user)
user.visible_message("<span class='suicide'>[user] is squeezing \the [src] into [user.p_their()] mouth! [user.p_do(TRUE)]n't [user.p_they()] know that stuff is toxic?</span>")
return TOXLOSS
/obj/item/stack/medical
name = "medical pack"
singular_name = "medical pack"
icon = 'icons/obj/stack_objects.dmi'
amount = 12
max_amount = 12
w_class = WEIGHT_CLASS_TINY
full_w_class = WEIGHT_CLASS_TINY
throw_speed = 3
throw_range = 7
resistance_flags = FLAMMABLE
max_integrity = 40
novariants = FALSE
item_flags = NOBLUDGEON
var/self_delay = 50
/obj/item/stack/medical/attack(mob/living/M, mob/user)
. = ..()
if(!M.can_inject(user, TRUE))
return
if(M == user)
user.visible_message("<span class='notice'>[user] starts to apply \the [src] on [user.p_them()]self...</span>", "<span class='notice'>You begin applying \the [src] on yourself...</span>")
if(!do_mob(user, M, self_delay, extra_checks=CALLBACK(M, /mob/living/proc/can_inject, user, TRUE)))
return
if(heal(M, user))
log_combat(user, M, "healed", src.name)
use(1)
/obj/item/stack/medical/proc/heal(mob/living/M, mob/user)
return
/obj/item/stack/medical/proc/heal_carbon(mob/living/carbon/C, mob/user, brute, burn)
var/obj/item/bodypart/affecting = C.get_bodypart(check_zone(user.zone_selected))
if(!affecting) //Missing limb?
to_chat(user, "<span class='warning'>[C] doesn't have \a [parse_zone(user.zone_selected)]!</span>")
return
if(affecting.status == BODYPART_ORGANIC) //Limb must be organic to be healed - RR
if(affecting.brute_dam && brute || affecting.burn_dam && burn)
user.visible_message("<span class='green'>[user] applies \the [src] on [C]'s [affecting.name].</span>", "<span class='green'>You apply \the [src] on [C]'s [affecting.name].</span>")
if(affecting.heal_damage(brute, burn))
C.update_damage_overlays()
return TRUE
to_chat(user, "<span class='notice'>[C]'s [affecting.name] can not be healed with \the [src].</span>")
return
to_chat(user, "<span class='notice'>\The [src] won't work on a robotic limb!</span>")
/obj/item/stack/medical/get_belt_overlay()
return mutable_appearance('icons/obj/clothing/belt_overlays.dmi', "pouch")
/obj/item/stack/medical/bruise_pack
name = "bruise pack"
singular_name = "bruise pack"
desc = "A therapeutic gel pack and bandages designed to treat blunt-force trauma."
icon_state = "brutepack"
lefthand_file = 'icons/mob/inhands/equipment/medical_lefthand.dmi'
righthand_file = 'icons/mob/inhands/equipment/medical_righthand.dmi'
var/heal_brute = 20
self_delay = 20
grind_results = list(/datum/reagent/medicine/styptic_powder = 10)
/obj/item/stack/medical/bruise_pack/heal(mob/living/M, mob/user)
if(M.stat == DEAD)
to_chat(user, "<span class='notice'> [M] is dead. You can not help [M.p_them()]!</span>")
return
if(isanimal(M))
var/mob/living/simple_animal/critter = M
if (!(critter.healable))
to_chat(user, "<span class='notice'> You cannot use \the [src] on [M]!</span>")
return FALSE
else if (critter.health == critter.maxHealth)
to_chat(user, "<span class='notice'> [M] is at full health.</span>")
return FALSE
user.visible_message("<span class='green'>[user] applies \the [src] on [M].</span>", "<span class='green'>You apply \the [src] on [M].</span>")
M.heal_bodypart_damage((heal_brute/2))
return TRUE
if(iscarbon(M))
return heal_carbon(M, user, heal_brute, 0)
to_chat(user, "<span class='notice'>You can't heal [M] with the \the [src]!</span>")
/obj/item/stack/medical/bruise_pack/suicide_act(mob/user)
user.visible_message("<span class='suicide'>[user] is bludgeoning [user.p_them()]self with [src]! It looks like [user.p_theyre()] trying to commit suicide!</span>")
return (BRUTELOSS)
/obj/item/stack/medical/gauze
name = "medical gauze"
desc = "A roll of elastic cloth that is extremely effective at stopping bleeding, heals minor wounds."
gender = PLURAL
singular_name = "medical gauze"
icon_state = "gauze"
var/stop_bleeding = 1800
var/heal_brute = 5
self_delay = 10
/obj/item/stack/medical/gauze/heal(mob/living/M, mob/user)
if(ishuman(M))
var/mob/living/carbon/human/H = M
if(!H.bleedsuppress && H.bleed_rate) //so you can't stack bleed suppression
H.suppress_bloodloss(stop_bleeding)
to_chat(user, "<span class='notice'>You stop the bleeding of [M]!</span>")
return TRUE
to_chat(user, "<span class='notice'>You can not use \the [src] on [M]!</span>")
/obj/item/stack/medical/gauze/attackby(obj/item/I, mob/user, params)
if(I.tool_behaviour == TOOL_WIRECUTTER || I.get_sharpness())
if(get_amount() < 2)
to_chat(user, "<span class='warning'>You need at least two gauzes to do this!</span>")
return
new /obj/item/stack/sheet/cloth(user.drop_location())
user.visible_message("[user] cuts [src] into pieces of cloth with [I].", \
"<span class='notice'>You cut [src] into pieces of cloth with [I].</span>", \
"<span class='italics'>You hear cutting.</span>")
use(2)
else
return ..()
/obj/item/stack/medical/gauze/suicide_act(mob/living/user)
user.visible_message("<span class='suicide'>[user] begins tightening \the [src] around [user.p_their()] neck! It looks like [user.p_they()] forgot how to use medical supplies!</span>")
return OXYLOSS
/obj/item/stack/medical/gauze/improvised
name = "improvised gauze"
singular_name = "improvised gauze"
desc = "A roll of cloth roughly cut from something that can stop bleeding, but does not heal wounds."
stop_bleeding = 900
heal_brute = 0
/obj/item/stack/medical/gauze/cyborg
materials = list()
is_cyborg = 1
cost = 250
/obj/item/stack/medical/ointment
name = "ointment"
desc = "Used to treat those nasty burn wounds."
gender = PLURAL
singular_name = "ointment"
icon_state = "ointment"
lefthand_file = 'icons/mob/inhands/equipment/medical_lefthand.dmi'
righthand_file = 'icons/mob/inhands/equipment/medical_righthand.dmi'
var/heal_burn = 20
self_delay = 20
grind_results = list(/datum/reagent/medicine/silver_sulfadiazine = 10)
/obj/item/stack/medical/ointment/heal(mob/living/M, mob/user)
if(M.stat == DEAD)
to_chat(user, "<span class='notice'> [M] is dead. You can not help [M.p_them()]!</span>")
return
if(iscarbon(M))
return heal_carbon(M, user, 0, heal_burn)
to_chat(user, "<span class='notice'>You can't heal [M] with the \the [src]!</span>")
/obj/item/stack/medical/ointment/suicide_act(mob/living/user)
user.visible_message("<span class='suicide'>[user] is squeezing \the [src] into [user.p_their()] mouth! [user.p_do(TRUE)]n't [user.p_they()] know that stuff is toxic?</span>")
return TOXLOSS
+87 -87
View File
@@ -1,87 +1,87 @@
GLOBAL_LIST_INIT(rod_recipes, list ( \
new/datum/stack_recipe("grille", /obj/structure/grille, 2, time = 10, one_per_turf = 1, on_floor = 1), \
new/datum/stack_recipe("table frame", /obj/structure/table_frame, 2, time = 10, one_per_turf = 1, on_floor = 1), \
new/datum/stack_recipe("scooter frame", /obj/item/scooter_frame, 10, time = 25, one_per_turf = 0), \
))
/obj/item/stack/rods
name = "metal rod"
desc = "Some rods. Can be used for building or something."
singular_name = "metal rod"
icon_state = "rods"
item_state = "rods"
flags_1 = CONDUCT_1
w_class = WEIGHT_CLASS_NORMAL
force = 9
throwforce = 10
throw_speed = 3
throw_range = 7
materials = list(MAT_METAL=1000)
max_amount = 50
attack_verb = list("hit", "bludgeoned", "whacked")
hitsound = 'sound/weapons/grenadelaunch.ogg'
novariants = TRUE
/obj/item/stack/rods/suicide_act(mob/living/carbon/user)
user.visible_message("<span class='suicide'>[user] begins to stuff \the [src] down [user.p_their()] throat! It looks like [user.p_theyre()] trying to commit suicide!</span>")//it looks like theyre ur mum
return BRUTELOSS
/obj/item/stack/rods/Initialize(mapload, new_amount, merge = TRUE)
. = ..()
recipes = GLOB.rod_recipes
update_icon()
/obj/item/stack/rods/update_icon()
var/amount = get_amount()
if((amount <= 5) && (amount > 0))
icon_state = "rods-[amount]"
else
icon_state = "rods"
/obj/item/stack/rods/attackby(obj/item/W, mob/user, params)
if(istype(W, /obj/item/weldingtool))
if(get_amount() < 2)
to_chat(user, "<span class='warning'>You need at least two rods to do this!</span>")
return
if(W.use_tool(src, user, 0, volume=40))
var/obj/item/stack/sheet/metal/new_item = new(usr.loc)
user.visible_message("[user.name] shaped [src] into metal with [W].", \
"<span class='notice'>You shape [src] into metal with [W].</span>", \
"<span class='italics'>You hear welding.</span>")
var/obj/item/stack/rods/R = src
src = null
var/replace = (user.get_inactive_held_item()==R)
R.use(2)
if (!R && replace)
user.put_in_hands(new_item)
else if(istype(W, /obj/item/reagent_containers/food/snacks))
var/obj/item/reagent_containers/food/snacks/S = W
if(amount != 1)
to_chat(user, "<span class='warning'>You must use a single rod!</span>")
else if(S.w_class > WEIGHT_CLASS_SMALL)
to_chat(user, "<span class='warning'>The ingredient is too big for [src]!</span>")
else
var/obj/item/reagent_containers/food/snacks/customizable/A = new/obj/item/reagent_containers/food/snacks/customizable/kebab(get_turf(src))
A.initialize_custom_food(src, S, user)
else
return ..()
/obj/item/stack/rods/cyborg
materials = list()
is_cyborg = 1
cost = 250
/obj/item/stack/rods/cyborg/update_icon()
return
/obj/item/stack/rods/ten
amount = 10
/obj/item/stack/rods/twentyfive
amount = 25
/obj/item/stack/rods/fifty
amount = 50
GLOBAL_LIST_INIT(rod_recipes, list ( \
new/datum/stack_recipe("grille", /obj/structure/grille, 2, time = 10, one_per_turf = 1, on_floor = 1), \
new/datum/stack_recipe("table frame", /obj/structure/table_frame, 2, time = 10, one_per_turf = 1, on_floor = 1), \
new/datum/stack_recipe("scooter frame", /obj/item/scooter_frame, 10, time = 25, one_per_turf = 0), \
))
/obj/item/stack/rods
name = "metal rod"
desc = "Some rods. Can be used for building or something."
singular_name = "metal rod"
icon_state = "rods"
item_state = "rods"
flags_1 = CONDUCT_1
w_class = WEIGHT_CLASS_NORMAL
force = 9
throwforce = 10
throw_speed = 3
throw_range = 7
materials = list(MAT_METAL=1000)
max_amount = 50
attack_verb = list("hit", "bludgeoned", "whacked")
hitsound = 'sound/weapons/grenadelaunch.ogg'
novariants = TRUE
/obj/item/stack/rods/suicide_act(mob/living/carbon/user)
user.visible_message("<span class='suicide'>[user] begins to stuff \the [src] down [user.p_their()] throat! It looks like [user.p_theyre()] trying to commit suicide!</span>")//it looks like theyre ur mum
return BRUTELOSS
/obj/item/stack/rods/Initialize(mapload, new_amount, merge = TRUE)
. = ..()
recipes = GLOB.rod_recipes
update_icon()
/obj/item/stack/rods/update_icon()
var/amount = get_amount()
if((amount <= 5) && (amount > 0))
icon_state = "rods-[amount]"
else
icon_state = "rods"
/obj/item/stack/rods/attackby(obj/item/W, mob/user, params)
if(istype(W, /obj/item/weldingtool))
if(get_amount() < 2)
to_chat(user, "<span class='warning'>You need at least two rods to do this!</span>")
return
if(W.use_tool(src, user, 0, volume=40))
var/obj/item/stack/sheet/metal/new_item = new(usr.loc)
user.visible_message("[user.name] shaped [src] into metal with [W].", \
"<span class='notice'>You shape [src] into metal with [W].</span>", \
"<span class='italics'>You hear welding.</span>")
var/obj/item/stack/rods/R = src
src = null
var/replace = (user.get_inactive_held_item()==R)
R.use(2)
if (!R && replace)
user.put_in_hands(new_item)
else if(istype(W, /obj/item/reagent_containers/food/snacks))
var/obj/item/reagent_containers/food/snacks/S = W
if(amount != 1)
to_chat(user, "<span class='warning'>You must use a single rod!</span>")
else if(S.w_class > WEIGHT_CLASS_SMALL)
to_chat(user, "<span class='warning'>The ingredient is too big for [src]!</span>")
else
var/obj/item/reagent_containers/food/snacks/customizable/A = new/obj/item/reagent_containers/food/snacks/customizable/kebab(get_turf(src))
A.initialize_custom_food(src, S, user)
else
return ..()
/obj/item/stack/rods/cyborg
materials = list()
is_cyborg = 1
cost = 250
/obj/item/stack/rods/cyborg/update_icon()
return
/obj/item/stack/rods/ten
amount = 10
/obj/item/stack/rods/twentyfive
amount = 25
/obj/item/stack/rods/fifty
amount = 50
+344 -344
View File
@@ -1,345 +1,345 @@
/* Glass stack types
* Contains:
* Glass sheets
* Reinforced glass sheets
* Glass shards - TODO: Move this into code/game/object/item/weapons
*/
/*
* Glass sheets
*/
GLOBAL_LIST_INIT(glass_recipes, list ( \
new/datum/stack_recipe("directional window", /obj/structure/window/unanchored, time = 0, on_floor = TRUE, window_checks = TRUE), \
new/datum/stack_recipe("fulltile window", /obj/structure/window/fulltile/unanchored, 2, time = 0, on_floor = TRUE, window_checks = TRUE) \
))
/obj/item/stack/sheet/glass
name = "glass"
desc = "HOLY SHEET! That is a lot of glass."
singular_name = "glass sheet"
icon_state = "sheet-glass"
item_state = "sheet-glass"
materials = list(MAT_GLASS=MINERAL_MATERIAL_AMOUNT)
armor = list("melee" = 0, "bullet" = 0, "laser" = 0, "energy" = 0, "bomb" = 0, "bio" = 0, "rad" = 0, "fire" = 50, "acid" = 100)
resistance_flags = ACID_PROOF
merge_type = /obj/item/stack/sheet/glass
grind_results = list(/datum/reagent/silicon = 20)
point_value = 1
tableVariant = /obj/structure/table/glass
/obj/item/stack/sheet/glass/suicide_act(mob/living/carbon/user)
user.visible_message("<span class='suicide'>[user] begins to slice [user.p_their()] neck with \the [src]! It looks like [user.p_theyre()] trying to commit suicide!</span>")
return BRUTELOSS
/obj/item/stack/sheet/glass/cyborg
materials = list()
is_cyborg = 1
cost = 500
/obj/item/stack/sheet/glass/fifty
amount = 50
/obj/item/stack/sheet/glass/five
amount = 5
/obj/item/stack/sheet/glass/Initialize(mapload, new_amount, merge = TRUE)
recipes = GLOB.glass_recipes
return ..()
/obj/item/stack/sheet/glass/attackby(obj/item/W, mob/user, params)
add_fingerprint(user)
if(istype(W, /obj/item/stack/cable_coil))
var/obj/item/stack/cable_coil/CC = W
if (get_amount() < 1 || CC.get_amount() < 5)
to_chat(user, "<span class='warning>You need five lengths of coil and one sheet of glass to make wired glass!</span>")
return
CC.use(5)
use(1)
to_chat(user, "<span class='notice'>You attach wire to the [name].</span>")
var/obj/item/stack/light_w/new_tile = new(user.loc)
new_tile.add_fingerprint(user)
else if(istype(W, /obj/item/stack/rods))
var/obj/item/stack/rods/V = W
if (V.get_amount() >= 1 && get_amount() >= 1)
var/obj/item/stack/sheet/rglass/RG = new (get_turf(user))
RG.add_fingerprint(user)
var/replace = user.get_inactive_held_item()==src
V.use(1)
use(1)
if(QDELETED(src) && replace)
user.put_in_hands(RG)
else
to_chat(user, "<span class='warning'>You need one rod and one sheet of glass to make reinforced glass!</span>")
return
else
return ..()
GLOBAL_LIST_INIT(pglass_recipes, list ( \
new/datum/stack_recipe("directional window", /obj/structure/window/plasma/unanchored, time = 0, on_floor = TRUE, window_checks = TRUE), \
new/datum/stack_recipe("fulltile window", /obj/structure/window/plasma/fulltile/unanchored, 2, time = 0, on_floor = TRUE, window_checks = TRUE) \
))
/obj/item/stack/sheet/plasmaglass
name = "plasma glass"
desc = "A glass sheet made out of a plasma-silicate alloy. It looks extremely tough and heavily fire resistant."
singular_name = "plasma glass sheet"
icon_state = "sheet-pglass"
item_state = "sheet-pglass"
materials = list(MAT_PLASMA=MINERAL_MATERIAL_AMOUNT * 0.5, MAT_GLASS=MINERAL_MATERIAL_AMOUNT)
armor = list("melee" = 0, "bullet" = 0, "laser" = 0, "energy" = 0, "bomb" = 0, "bio" = 0, "rad" = 0, "fire" = 75, "acid" = 100)
resistance_flags = ACID_PROOF
merge_type = /obj/item/stack/sheet/plasmaglass
grind_results = list(/datum/reagent/silicon = 20, /datum/reagent/toxin/plasma = 10)
tableVariant = /obj/structure/table/plasmaglass
/obj/item/stack/sheet/plasmaglass/fifty
amount = 50
/obj/item/stack/sheet/plasmaglass/Initialize(mapload, new_amount, merge = TRUE)
recipes = GLOB.pglass_recipes
return ..()
/obj/item/stack/sheet/plasmaglass/attackby(obj/item/W, mob/user, params)
add_fingerprint(user)
if(istype(W, /obj/item/stack/rods))
var/obj/item/stack/rods/V = W
if (V.get_amount() >= 1 && get_amount() >= 1)
var/obj/item/stack/sheet/plasmarglass/RG = new (get_turf(user))
RG.add_fingerprint(user)
var/replace = user.get_inactive_held_item()==src
V.use(1)
use(1)
if(QDELETED(src) && replace)
user.put_in_hands(RG)
else
to_chat(user, "<span class='warning'>You need one rod and one sheet of plasma glass to make reinforced plasma glass!</span>")
return
else
return ..()
/*
* Reinforced glass sheets
*/
GLOBAL_LIST_INIT(reinforced_glass_recipes, list ( \
new/datum/stack_recipe("windoor frame", /obj/structure/windoor_assembly, 5, time = 0, on_floor = TRUE, window_checks = TRUE), \
null, \
new/datum/stack_recipe("directional reinforced window", /obj/structure/window/reinforced/unanchored, time = 0, on_floor = TRUE, window_checks = TRUE), \
new/datum/stack_recipe("fulltile reinforced window", /obj/structure/window/reinforced/fulltile/unanchored, 2, time = 0, on_floor = TRUE, window_checks = TRUE) \
))
/obj/item/stack/sheet/rglass
name = "reinforced glass"
desc = "Glass which seems to have rods or something stuck in them."
singular_name = "reinforced glass sheet"
icon_state = "sheet-rglass"
item_state = "sheet-rglass"
materials = list(MAT_METAL=MINERAL_MATERIAL_AMOUNT * 0.5, MAT_GLASS=MINERAL_MATERIAL_AMOUNT)
armor = list("melee" = 0, "bullet" = 0, "laser" = 0, "energy" = 0, "bomb" = 0, "bio" = 0, "rad" = 0, "fire" = 70, "acid" = 100)
resistance_flags = ACID_PROOF
merge_type = /obj/item/stack/sheet/rglass
grind_results = list(/datum/reagent/silicon = 20, /datum/reagent/iron = 10)
point_value = 4
/obj/item/stack/sheet/rglass/attackby(obj/item/W, mob/user, params)
add_fingerprint(user)
..()
/obj/item/stack/sheet/rglass/cyborg
materials = list()
var/datum/robot_energy_storage/glasource
var/metcost = 250
var/glacost = 500
/obj/item/stack/sheet/rglass/cyborg/get_amount()
return min(round(source.energy / metcost), round(glasource.energy / glacost))
/obj/item/stack/sheet/rglass/cyborg/use(used, transfer = FALSE) // Requires special checks, because it uses two storages
source.use_charge(used * metcost)
glasource.use_charge(used * glacost)
/obj/item/stack/sheet/rglass/cyborg/add(amount)
source.add_charge(amount * metcost)
glasource.add_charge(amount * glacost)
/obj/item/stack/sheet/rglass/Initialize(mapload, new_amount, merge = TRUE)
recipes = GLOB.reinforced_glass_recipes
return ..()
GLOBAL_LIST_INIT(prglass_recipes, list ( \
new/datum/stack_recipe("directional reinforced window", /obj/structure/window/plasma/reinforced/unanchored, time = 0, on_floor = TRUE, window_checks = TRUE), \
new/datum/stack_recipe("fulltile reinforced window", /obj/structure/window/plasma/reinforced/fulltile/unanchored, 2, time = 0, on_floor = TRUE, window_checks = TRUE) \
))
/obj/item/stack/sheet/plasmarglass
name = "reinforced plasma glass"
desc = "A glass sheet made out of a plasma-silicate alloy and a rod matrix. It looks hopelessly tough and nearly fire-proof!"
singular_name = "reinforced plasma glass sheet"
icon_state = "sheet-prglass"
item_state = "sheet-prglass"
materials = list(MAT_PLASMA=MINERAL_MATERIAL_AMOUNT * 0.5, MAT_GLASS=MINERAL_MATERIAL_AMOUNT, MAT_METAL=MINERAL_MATERIAL_AMOUNT * 0.5,)
armor = list("melee" = 20, "bullet" = 0, "laser" = 0, "energy" = 0, "bomb" = 0, "bio" = 0, "rad" = 0, "fire" = 80, "acid" = 100)
resistance_flags = ACID_PROOF
merge_type = /obj/item/stack/sheet/plasmarglass
grind_results = list(/datum/reagent/silicon = 20, /datum/reagent/toxin/plasma = 10, /datum/reagent/iron = 10)
point_value = 23
/obj/item/stack/sheet/plasmarglass/Initialize(mapload, new_amount, merge = TRUE)
recipes = GLOB.prglass_recipes
return ..()
GLOBAL_LIST_INIT(titaniumglass_recipes, list(
new/datum/stack_recipe("shuttle window", /obj/structure/window/shuttle/unanchored, 2, time = 0, on_floor = TRUE, window_checks = TRUE)
))
/obj/item/stack/sheet/titaniumglass
name = "titanium glass"
desc = "A glass sheet made out of a titanium-silicate alloy."
singular_name = "titanium glass sheet"
icon_state = "sheet-titaniumglass"
item_state = "sheet-titaniumglass"
materials = list(MAT_TITANIUM=MINERAL_MATERIAL_AMOUNT * 0.5, MAT_GLASS=MINERAL_MATERIAL_AMOUNT)
armor = list("melee" = 0, "bullet" = 0, "laser" = 0, "energy" = 0, "bomb" = 0, "bio" = 0, "rad" = 0, "fire" = 80, "acid" = 100)
resistance_flags = ACID_PROOF
merge_type = /obj/item/stack/sheet/titaniumglass
/obj/item/stack/sheet/titaniumglass/Initialize(mapload, new_amount, merge = TRUE)
recipes = GLOB.titaniumglass_recipes
return ..()
GLOBAL_LIST_INIT(plastitaniumglass_recipes, list(
new/datum/stack_recipe("plastitanium window", /obj/structure/window/plastitanium/unanchored, 2, time = 0, on_floor = TRUE, window_checks = TRUE)
))
/obj/item/stack/sheet/plastitaniumglass
name = "plastitanium glass"
desc = "A glass sheet made out of a plasma-titanium-silicate alloy."
singular_name = "plastitanium glass sheet"
icon_state = "sheet-plastitaniumglass"
item_state = "sheet-plastitaniumglass"
materials = list(MAT_TITANIUM=MINERAL_MATERIAL_AMOUNT * 0.5, MAT_PLASMA=MINERAL_MATERIAL_AMOUNT * 0.5, MAT_GLASS=MINERAL_MATERIAL_AMOUNT)
armor = list("melee" = 0, "bullet" = 0, "laser" = 0, "energy" = 0, "bomb" = 0, "bio" = 0, "rad" = 0, "fire" = 80, "acid" = 100)
resistance_flags = ACID_PROOF
merge_type = /obj/item/stack/sheet/plastitaniumglass
/obj/item/stack/sheet/plastitaniumglass/Initialize(mapload, new_amount, merge = TRUE)
recipes = GLOB.plastitaniumglass_recipes
return ..()
/obj/item/shard
name = "shard"
desc = "A nasty looking shard of glass."
icon = 'icons/obj/shards.dmi'
icon_state = "large"
w_class = WEIGHT_CLASS_TINY
force = 5
throwforce = 10
item_state = "shard-glass"
lefthand_file = 'icons/mob/inhands/weapons/melee_lefthand.dmi'
righthand_file = 'icons/mob/inhands/weapons/melee_righthand.dmi'
materials = list(MAT_GLASS=MINERAL_MATERIAL_AMOUNT)
attack_verb = list("stabbed", "slashed", "sliced", "cut")
hitsound = 'sound/weapons/bladeslice.ogg'
resistance_flags = ACID_PROOF
armor = list("melee" = 100, "bullet" = 0, "laser" = 0, "energy" = 100, "bomb" = 0, "bio" = 0, "rad" = 0, "fire" = 50, "acid" = 100)
max_integrity = 40
sharpness = IS_SHARP
var/icon_prefix
/obj/item/shard/suicide_act(mob/user)
user.visible_message("<span class='suicide'>[user] is slitting [user.p_their()] [pick("wrists", "throat")] with the shard of glass! It looks like [user.p_theyre()] trying to commit suicide.</span>")
return (BRUTELOSS)
/obj/item/shard/Initialize()
. = ..()
AddComponent(/datum/component/caltrop, force)
AddComponent(/datum/component/butchering, 150, 65)
icon_state = pick("large", "medium", "small")
switch(icon_state)
if("small")
pixel_x = rand(-12, 12)
pixel_y = rand(-12, 12)
if("medium")
pixel_x = rand(-8, 8)
pixel_y = rand(-8, 8)
if("large")
pixel_x = rand(-5, 5)
pixel_y = rand(-5, 5)
if (icon_prefix)
icon_state = "[icon_prefix][icon_state]"
var/turf/T = get_turf(src)
if(T && is_station_level(T.z))
SSblackbox.record_feedback("tally", "station_mess_created", 1, name)
/obj/item/shard/Destroy()
. = ..()
var/turf/T = get_turf(src)
if(T && is_station_level(T.z))
SSblackbox.record_feedback("tally", "station_mess_destroyed", 1, name)
/obj/item/shard/afterattack(atom/A as mob|obj, mob/user, proximity)
. = ..()
if(!proximity || !(src in user))
return
if(isturf(A))
return
if(istype(A, /obj/item/storage))
return
var/hit_hand = ((user.active_hand_index % 2 == 0) ? "r_" : "l_") + "arm"
if(ishuman(user))
var/mob/living/carbon/human/H = user
if(!H.gloves && !HAS_TRAIT(H, TRAIT_PIERCEIMMUNE)) // golems, etc
to_chat(H, "<span class='warning'>[src] cuts into your hand!</span>")
H.apply_damage(force*0.5, BRUTE, hit_hand)
else if(ismonkey(user))
var/mob/living/carbon/monkey/M = user
if(!HAS_TRAIT(M, TRAIT_PIERCEIMMUNE))
to_chat(M, "<span class='warning'>[src] cuts into your hand!</span>")
M.apply_damage(force*0.5, BRUTE, hit_hand)
/obj/item/shard/attackby(obj/item/I, mob/user, params)
if(istype(I, /obj/item/lightreplacer))
I.attackby(src, user)
else
return ..()
/obj/item/shard/welder_act(mob/living/user, obj/item/I)
..()
if(I.use_tool(src, user, 0, volume=50))
var/obj/item/stack/sheet/glass/NG = new (user.loc)
for(var/obj/item/stack/sheet/glass/G in user.loc)
if(G == NG)
continue
if(G.amount >= G.max_amount)
continue
G.attackby(NG, user)
to_chat(user, "<span class='notice'>You add the newly-formed glass to the stack. It now contains [NG.amount] sheet\s.</span>")
qdel(src)
return TRUE
/obj/item/shard/Crossed(mob/living/L)
if(istype(L) && has_gravity(loc))
if(HAS_TRAIT(L, TRAIT_LIGHT_STEP))
playsound(loc, 'sound/effects/glass_step.ogg', 30, 1)
else
playsound(loc, 'sound/effects/glass_step.ogg', 50, 1)
return ..()
/obj/item/shard/plasma
name = "purple shard"
desc = "A nasty looking shard of plasma glass."
force = 6
throwforce = 11
icon_state = "plasmalarge"
materials = list(MAT_PLASMA=MINERAL_MATERIAL_AMOUNT * 0.5, MAT_GLASS=MINERAL_MATERIAL_AMOUNT)
/* Glass stack types
* Contains:
* Glass sheets
* Reinforced glass sheets
* Glass shards - TODO: Move this into code/game/object/item/weapons
*/
/*
* Glass sheets
*/
GLOBAL_LIST_INIT(glass_recipes, list ( \
new/datum/stack_recipe("directional window", /obj/structure/window/unanchored, time = 0, on_floor = TRUE, window_checks = TRUE), \
new/datum/stack_recipe("fulltile window", /obj/structure/window/fulltile/unanchored, 2, time = 0, on_floor = TRUE, window_checks = TRUE) \
))
/obj/item/stack/sheet/glass
name = "glass"
desc = "HOLY SHEET! That is a lot of glass."
singular_name = "glass sheet"
icon_state = "sheet-glass"
item_state = "sheet-glass"
materials = list(MAT_GLASS=MINERAL_MATERIAL_AMOUNT)
armor = list("melee" = 0, "bullet" = 0, "laser" = 0, "energy" = 0, "bomb" = 0, "bio" = 0, "rad" = 0, "fire" = 50, "acid" = 100)
resistance_flags = ACID_PROOF
merge_type = /obj/item/stack/sheet/glass
grind_results = list(/datum/reagent/silicon = 20)
point_value = 1
tableVariant = /obj/structure/table/glass
/obj/item/stack/sheet/glass/suicide_act(mob/living/carbon/user)
user.visible_message("<span class='suicide'>[user] begins to slice [user.p_their()] neck with \the [src]! It looks like [user.p_theyre()] trying to commit suicide!</span>")
return BRUTELOSS
/obj/item/stack/sheet/glass/cyborg
materials = list()
is_cyborg = 1
cost = 500
/obj/item/stack/sheet/glass/fifty
amount = 50
/obj/item/stack/sheet/glass/five
amount = 5
/obj/item/stack/sheet/glass/Initialize(mapload, new_amount, merge = TRUE)
recipes = GLOB.glass_recipes
return ..()
/obj/item/stack/sheet/glass/attackby(obj/item/W, mob/user, params)
add_fingerprint(user)
if(istype(W, /obj/item/stack/cable_coil))
var/obj/item/stack/cable_coil/CC = W
if (get_amount() < 1 || CC.get_amount() < 5)
to_chat(user, "<span class='warning>You need five lengths of coil and one sheet of glass to make wired glass!</span>")
return
CC.use(5)
use(1)
to_chat(user, "<span class='notice'>You attach wire to the [name].</span>")
var/obj/item/stack/light_w/new_tile = new(user.loc)
new_tile.add_fingerprint(user)
else if(istype(W, /obj/item/stack/rods))
var/obj/item/stack/rods/V = W
if (V.get_amount() >= 1 && get_amount() >= 1)
var/obj/item/stack/sheet/rglass/RG = new (get_turf(user))
RG.add_fingerprint(user)
var/replace = user.get_inactive_held_item()==src
V.use(1)
use(1)
if(QDELETED(src) && replace)
user.put_in_hands(RG)
else
to_chat(user, "<span class='warning'>You need one rod and one sheet of glass to make reinforced glass!</span>")
return
else
return ..()
GLOBAL_LIST_INIT(pglass_recipes, list ( \
new/datum/stack_recipe("directional window", /obj/structure/window/plasma/unanchored, time = 0, on_floor = TRUE, window_checks = TRUE), \
new/datum/stack_recipe("fulltile window", /obj/structure/window/plasma/fulltile/unanchored, 2, time = 0, on_floor = TRUE, window_checks = TRUE) \
))
/obj/item/stack/sheet/plasmaglass
name = "plasma glass"
desc = "A glass sheet made out of a plasma-silicate alloy. It looks extremely tough and heavily fire resistant."
singular_name = "plasma glass sheet"
icon_state = "sheet-pglass"
item_state = "sheet-pglass"
materials = list(MAT_PLASMA=MINERAL_MATERIAL_AMOUNT * 0.5, MAT_GLASS=MINERAL_MATERIAL_AMOUNT)
armor = list("melee" = 0, "bullet" = 0, "laser" = 0, "energy" = 0, "bomb" = 0, "bio" = 0, "rad" = 0, "fire" = 75, "acid" = 100)
resistance_flags = ACID_PROOF
merge_type = /obj/item/stack/sheet/plasmaglass
grind_results = list(/datum/reagent/silicon = 20, /datum/reagent/toxin/plasma = 10)
tableVariant = /obj/structure/table/plasmaglass
/obj/item/stack/sheet/plasmaglass/fifty
amount = 50
/obj/item/stack/sheet/plasmaglass/Initialize(mapload, new_amount, merge = TRUE)
recipes = GLOB.pglass_recipes
return ..()
/obj/item/stack/sheet/plasmaglass/attackby(obj/item/W, mob/user, params)
add_fingerprint(user)
if(istype(W, /obj/item/stack/rods))
var/obj/item/stack/rods/V = W
if (V.get_amount() >= 1 && get_amount() >= 1)
var/obj/item/stack/sheet/plasmarglass/RG = new (get_turf(user))
RG.add_fingerprint(user)
var/replace = user.get_inactive_held_item()==src
V.use(1)
use(1)
if(QDELETED(src) && replace)
user.put_in_hands(RG)
else
to_chat(user, "<span class='warning'>You need one rod and one sheet of plasma glass to make reinforced plasma glass!</span>")
return
else
return ..()
/*
* Reinforced glass sheets
*/
GLOBAL_LIST_INIT(reinforced_glass_recipes, list ( \
new/datum/stack_recipe("windoor frame", /obj/structure/windoor_assembly, 5, time = 0, on_floor = TRUE, window_checks = TRUE), \
null, \
new/datum/stack_recipe("directional reinforced window", /obj/structure/window/reinforced/unanchored, time = 0, on_floor = TRUE, window_checks = TRUE), \
new/datum/stack_recipe("fulltile reinforced window", /obj/structure/window/reinforced/fulltile/unanchored, 2, time = 0, on_floor = TRUE, window_checks = TRUE) \
))
/obj/item/stack/sheet/rglass
name = "reinforced glass"
desc = "Glass which seems to have rods or something stuck in them."
singular_name = "reinforced glass sheet"
icon_state = "sheet-rglass"
item_state = "sheet-rglass"
materials = list(MAT_METAL=MINERAL_MATERIAL_AMOUNT * 0.5, MAT_GLASS=MINERAL_MATERIAL_AMOUNT)
armor = list("melee" = 0, "bullet" = 0, "laser" = 0, "energy" = 0, "bomb" = 0, "bio" = 0, "rad" = 0, "fire" = 70, "acid" = 100)
resistance_flags = ACID_PROOF
merge_type = /obj/item/stack/sheet/rglass
grind_results = list(/datum/reagent/silicon = 20, /datum/reagent/iron = 10)
point_value = 4
/obj/item/stack/sheet/rglass/attackby(obj/item/W, mob/user, params)
add_fingerprint(user)
..()
/obj/item/stack/sheet/rglass/cyborg
materials = list()
var/datum/robot_energy_storage/glasource
var/metcost = 250
var/glacost = 500
/obj/item/stack/sheet/rglass/cyborg/get_amount()
return min(round(source.energy / metcost), round(glasource.energy / glacost))
/obj/item/stack/sheet/rglass/cyborg/use(used, transfer = FALSE) // Requires special checks, because it uses two storages
source.use_charge(used * metcost)
glasource.use_charge(used * glacost)
/obj/item/stack/sheet/rglass/cyborg/add(amount)
source.add_charge(amount * metcost)
glasource.add_charge(amount * glacost)
/obj/item/stack/sheet/rglass/Initialize(mapload, new_amount, merge = TRUE)
recipes = GLOB.reinforced_glass_recipes
return ..()
GLOBAL_LIST_INIT(prglass_recipes, list ( \
new/datum/stack_recipe("directional reinforced window", /obj/structure/window/plasma/reinforced/unanchored, time = 0, on_floor = TRUE, window_checks = TRUE), \
new/datum/stack_recipe("fulltile reinforced window", /obj/structure/window/plasma/reinforced/fulltile/unanchored, 2, time = 0, on_floor = TRUE, window_checks = TRUE) \
))
/obj/item/stack/sheet/plasmarglass
name = "reinforced plasma glass"
desc = "A glass sheet made out of a plasma-silicate alloy and a rod matrix. It looks hopelessly tough and nearly fire-proof!"
singular_name = "reinforced plasma glass sheet"
icon_state = "sheet-prglass"
item_state = "sheet-prglass"
materials = list(MAT_PLASMA=MINERAL_MATERIAL_AMOUNT * 0.5, MAT_GLASS=MINERAL_MATERIAL_AMOUNT, MAT_METAL=MINERAL_MATERIAL_AMOUNT * 0.5,)
armor = list("melee" = 20, "bullet" = 0, "laser" = 0, "energy" = 0, "bomb" = 0, "bio" = 0, "rad" = 0, "fire" = 80, "acid" = 100)
resistance_flags = ACID_PROOF
merge_type = /obj/item/stack/sheet/plasmarglass
grind_results = list(/datum/reagent/silicon = 20, /datum/reagent/toxin/plasma = 10, /datum/reagent/iron = 10)
point_value = 23
/obj/item/stack/sheet/plasmarglass/Initialize(mapload, new_amount, merge = TRUE)
recipes = GLOB.prglass_recipes
return ..()
GLOBAL_LIST_INIT(titaniumglass_recipes, list(
new/datum/stack_recipe("shuttle window", /obj/structure/window/shuttle/unanchored, 2, time = 0, on_floor = TRUE, window_checks = TRUE)
))
/obj/item/stack/sheet/titaniumglass
name = "titanium glass"
desc = "A glass sheet made out of a titanium-silicate alloy."
singular_name = "titanium glass sheet"
icon_state = "sheet-titaniumglass"
item_state = "sheet-titaniumglass"
materials = list(MAT_TITANIUM=MINERAL_MATERIAL_AMOUNT * 0.5, MAT_GLASS=MINERAL_MATERIAL_AMOUNT)
armor = list("melee" = 0, "bullet" = 0, "laser" = 0, "energy" = 0, "bomb" = 0, "bio" = 0, "rad" = 0, "fire" = 80, "acid" = 100)
resistance_flags = ACID_PROOF
merge_type = /obj/item/stack/sheet/titaniumglass
/obj/item/stack/sheet/titaniumglass/Initialize(mapload, new_amount, merge = TRUE)
recipes = GLOB.titaniumglass_recipes
return ..()
GLOBAL_LIST_INIT(plastitaniumglass_recipes, list(
new/datum/stack_recipe("plastitanium window", /obj/structure/window/plastitanium/unanchored, 2, time = 0, on_floor = TRUE, window_checks = TRUE)
))
/obj/item/stack/sheet/plastitaniumglass
name = "plastitanium glass"
desc = "A glass sheet made out of a plasma-titanium-silicate alloy."
singular_name = "plastitanium glass sheet"
icon_state = "sheet-plastitaniumglass"
item_state = "sheet-plastitaniumglass"
materials = list(MAT_TITANIUM=MINERAL_MATERIAL_AMOUNT * 0.5, MAT_PLASMA=MINERAL_MATERIAL_AMOUNT * 0.5, MAT_GLASS=MINERAL_MATERIAL_AMOUNT)
armor = list("melee" = 0, "bullet" = 0, "laser" = 0, "energy" = 0, "bomb" = 0, "bio" = 0, "rad" = 0, "fire" = 80, "acid" = 100)
resistance_flags = ACID_PROOF
merge_type = /obj/item/stack/sheet/plastitaniumglass
/obj/item/stack/sheet/plastitaniumglass/Initialize(mapload, new_amount, merge = TRUE)
recipes = GLOB.plastitaniumglass_recipes
return ..()
/obj/item/shard
name = "shard"
desc = "A nasty looking shard of glass."
icon = 'icons/obj/shards.dmi'
icon_state = "large"
w_class = WEIGHT_CLASS_TINY
force = 5
throwforce = 10
item_state = "shard-glass"
lefthand_file = 'icons/mob/inhands/weapons/melee_lefthand.dmi'
righthand_file = 'icons/mob/inhands/weapons/melee_righthand.dmi'
materials = list(MAT_GLASS=MINERAL_MATERIAL_AMOUNT)
attack_verb = list("stabbed", "slashed", "sliced", "cut")
hitsound = 'sound/weapons/bladeslice.ogg'
resistance_flags = ACID_PROOF
armor = list("melee" = 100, "bullet" = 0, "laser" = 0, "energy" = 100, "bomb" = 0, "bio" = 0, "rad" = 0, "fire" = 50, "acid" = 100)
max_integrity = 40
sharpness = IS_SHARP
var/icon_prefix
/obj/item/shard/suicide_act(mob/user)
user.visible_message("<span class='suicide'>[user] is slitting [user.p_their()] [pick("wrists", "throat")] with the shard of glass! It looks like [user.p_theyre()] trying to commit suicide.</span>")
return (BRUTELOSS)
/obj/item/shard/Initialize()
. = ..()
AddComponent(/datum/component/caltrop, force)
AddComponent(/datum/component/butchering, 150, 65)
icon_state = pick("large", "medium", "small")
switch(icon_state)
if("small")
pixel_x = rand(-12, 12)
pixel_y = rand(-12, 12)
if("medium")
pixel_x = rand(-8, 8)
pixel_y = rand(-8, 8)
if("large")
pixel_x = rand(-5, 5)
pixel_y = rand(-5, 5)
if (icon_prefix)
icon_state = "[icon_prefix][icon_state]"
var/turf/T = get_turf(src)
if(T && is_station_level(T.z))
SSblackbox.record_feedback("tally", "station_mess_created", 1, name)
/obj/item/shard/Destroy()
. = ..()
var/turf/T = get_turf(src)
if(T && is_station_level(T.z))
SSblackbox.record_feedback("tally", "station_mess_destroyed", 1, name)
/obj/item/shard/afterattack(atom/A as mob|obj, mob/user, proximity)
. = ..()
if(!proximity || !(src in user))
return
if(isturf(A))
return
if(istype(A, /obj/item/storage))
return
var/hit_hand = ((user.active_hand_index % 2 == 0) ? "r_" : "l_") + "arm"
if(ishuman(user))
var/mob/living/carbon/human/H = user
if(!H.gloves && !HAS_TRAIT(H, TRAIT_PIERCEIMMUNE)) // golems, etc
to_chat(H, "<span class='warning'>[src] cuts into your hand!</span>")
H.apply_damage(force*0.5, BRUTE, hit_hand)
else if(ismonkey(user))
var/mob/living/carbon/monkey/M = user
if(!HAS_TRAIT(M, TRAIT_PIERCEIMMUNE))
to_chat(M, "<span class='warning'>[src] cuts into your hand!</span>")
M.apply_damage(force*0.5, BRUTE, hit_hand)
/obj/item/shard/attackby(obj/item/I, mob/user, params)
if(istype(I, /obj/item/lightreplacer))
I.attackby(src, user)
else
return ..()
/obj/item/shard/welder_act(mob/living/user, obj/item/I)
..()
if(I.use_tool(src, user, 0, volume=50))
var/obj/item/stack/sheet/glass/NG = new (user.loc)
for(var/obj/item/stack/sheet/glass/G in user.loc)
if(G == NG)
continue
if(G.amount >= G.max_amount)
continue
G.attackby(NG, user)
to_chat(user, "<span class='notice'>You add the newly-formed glass to the stack. It now contains [NG.amount] sheet\s.</span>")
qdel(src)
return TRUE
/obj/item/shard/Crossed(mob/living/L)
if(istype(L) && has_gravity(loc))
if(HAS_TRAIT(L, TRAIT_LIGHT_STEP))
playsound(loc, 'sound/effects/glass_step.ogg', 30, 1)
else
playsound(loc, 'sound/effects/glass_step.ogg', 50, 1)
return ..()
/obj/item/shard/plasma
name = "purple shard"
desc = "A nasty looking shard of plasma glass."
force = 6
throwforce = 11
icon_state = "plasmalarge"
materials = list(MAT_PLASMA=MINERAL_MATERIAL_AMOUNT * 0.5, MAT_GLASS=MINERAL_MATERIAL_AMOUNT)
icon_prefix = "plasma"
+248 -248
View File
@@ -1,248 +1,248 @@
/obj/item/stack/sheet/animalhide
name = "hide"
desc = "Something went wrong."
icon_state = "sheet-hide"
item_state = "sheet-hide"
novariants = TRUE
/obj/item/stack/sheet/animalhide/human
name = "human skin"
desc = "The by-product of human farming."
singular_name = "human skin piece"
novariants = FALSE
GLOBAL_LIST_INIT(human_recipes, list( \
new/datum/stack_recipe("bloated human costume", /obj/item/clothing/suit/hooded/bloated_human, 5), \
))
/obj/item/stack/sheet/animalhide/human/Initialize(mapload, new_amount, merge = TRUE)
recipes = GLOB.human_recipes
return ..()
/obj/item/stack/sheet/animalhide/generic
name = "skin"
desc = "A piece of skin."
singular_name = "skin piece"
novariants = FALSE
/obj/item/stack/sheet/animalhide/corgi
name = "corgi hide"
desc = "The by-product of corgi farming."
singular_name = "corgi hide piece"
icon_state = "sheet-corgi"
item_state = "sheet-corgi"
GLOBAL_LIST_INIT(gondola_recipes, list ( \
new/datum/stack_recipe("gondola mask", /obj/item/clothing/mask/gondola, 1), \
new/datum/stack_recipe("gondola suit", /obj/item/clothing/under/gondola, 2), \
new/datum/stack_recipe("gondola bedsheet", /obj/item/bedsheet/gondola, 1), \
))
/obj/item/stack/sheet/animalhide/gondola
name = "gondola hide"
desc = "The extremely valuable product of gondola hunting."
singular_name = "gondola hide piece"
icon_state = "sheet-gondola"
item_state = "sheet-gondola"
/obj/item/stack/sheet/animalhide/gondola/Initialize(mapload, new_amount, merge = TRUE)
recipes = GLOB.gondola_recipes
return ..()
GLOBAL_LIST_INIT(corgi_recipes, list ( \
new/datum/stack_recipe("corgi costume", /obj/item/clothing/suit/hooded/ian_costume, 3), \
))
/obj/item/stack/sheet/animalhide/corgi/Initialize(mapload, new_amount, merge = TRUE)
recipes = GLOB.corgi_recipes
return ..()
/obj/item/stack/sheet/animalhide/cat
name = "cat hide"
desc = "The by-product of cat farming."
singular_name = "cat hide piece"
icon_state = "sheet-cat"
item_state = "sheet-cat"
/obj/item/stack/sheet/animalhide/monkey
name = "monkey hide"
desc = "The by-product of monkey farming."
singular_name = "monkey hide piece"
icon_state = "sheet-monkey"
icon_state = "sheet-monkey"
GLOBAL_LIST_INIT(monkey_recipes, list ( \
new/datum/stack_recipe("monkey mask", /obj/item/clothing/mask/gas/monkeymask, 1), \
new/datum/stack_recipe("monkey suit", /obj/item/clothing/suit/monkeysuit, 2), \
))
/obj/item/stack/sheet/animalhide/monkey/Initialize(mapload, new_amount, merge = TRUE)
recipes = GLOB.monkey_recipes
return ..()
/obj/item/stack/sheet/animalhide/lizard
name = "lizard skin"
desc = "Sssssss..."
singular_name = "lizard skin piece"
icon_state = "sheet-lizard"
item_state = "sheet-lizard"
/obj/item/stack/sheet/animalhide/xeno
name = "alien hide"
desc = "The skin of a terrible creature."
singular_name = "alien hide piece"
icon_state = "sheet-xeno"
item_state = "sheet-xeno"
GLOBAL_LIST_INIT(xeno_recipes, list ( \
new/datum/stack_recipe("alien helmet", /obj/item/clothing/head/xenos, 1), \
new/datum/stack_recipe("alien suit", /obj/item/clothing/suit/xenos, 2), \
))
/obj/item/stack/sheet/animalhide/xeno/Initialize(mapload, new_amount, merge = TRUE)
recipes = GLOB.xeno_recipes
return ..()
//don't see anywhere else to put these, maybe together they could be used to make the xenos suit?
/obj/item/stack/sheet/xenochitin
name = "alien chitin"
desc = "A piece of the hide of a terrible creature."
singular_name = "alien hide piece"
icon = 'icons/mob/alien.dmi'
icon_state = "chitin"
novariants = TRUE
/obj/item/xenos_claw
name = "alien claw"
desc = "The claw of a terrible creature."
icon = 'icons/mob/alien.dmi'
icon_state = "claw"
/obj/item/weed_extract
name = "weed extract"
desc = "A piece of slimy, purplish weed."
icon = 'icons/mob/alien.dmi'
icon_state = "weed_extract"
/obj/item/stack/sheet/hairlesshide
name = "hairless hide"
desc = "This hide was stripped of its hair, but still needs washing and tanning."
singular_name = "hairless hide piece"
icon_state = "sheet-hairlesshide"
item_state = "sheet-hairlesshide"
/obj/item/stack/sheet/wetleather
name = "wet leather"
desc = "This leather has been cleaned but still needs to be dried."
singular_name = "wet leather piece"
icon_state = "sheet-wetleather"
item_state = "sheet-wetleather"
var/wetness = 30 //Reduced when exposed to high temperautres
var/drying_threshold_temperature = 500 //Kelvin to start drying
/*
* Leather SHeet
*/
/obj/item/stack/sheet/leather
name = "leather"
desc = "The by-product of mob grinding."
singular_name = "leather piece"
icon_state = "sheet-leather"
item_state = "sheet-leather"
GLOBAL_LIST_INIT(leather_recipes, list ( \
new/datum/stack_recipe("wallet", /obj/item/storage/wallet, 1), \
new/datum/stack_recipe("muzzle", /obj/item/clothing/mask/muzzle, 2), \
new/datum/stack_recipe("botany gloves", /obj/item/clothing/gloves/botanic_leather, 3), \
new/datum/stack_recipe("toolbelt", /obj/item/storage/belt/utility, 4), \
new/datum/stack_recipe("leather satchel", /obj/item/storage/backpack/satchel/leather, 5), \
new/datum/stack_recipe("bandolier", /obj/item/storage/belt/bandolier, 5), \
new/datum/stack_recipe("leather jacket", /obj/item/clothing/suit/jacket/leather, 7), \
new/datum/stack_recipe("leather shoes", /obj/item/clothing/shoes/laceup, 2), \
new/datum/stack_recipe("leather overcoat", /obj/item/clothing/suit/jacket/leather/overcoat, 10), \
))
/obj/item/stack/sheet/leather/Initialize(mapload, new_amount, merge = TRUE)
recipes = GLOB.leather_recipes
return ..()
/*
* Sinew
*/
/obj/item/stack/sheet/sinew
name = "watcher sinew"
icon = 'icons/obj/mining.dmi'
desc = "Long stringy filaments which presumably came from a watcher's wings."
singular_name = "watcher sinew"
icon_state = "sinew"
novariants = TRUE
GLOBAL_LIST_INIT(sinew_recipes, list ( \
new/datum/stack_recipe("sinew restraints", /obj/item/restraints/handcuffs/sinew, 1), \
))
/obj/item/stack/sheet/sinew/Initialize(mapload, new_amount, merge = TRUE)
recipes = GLOB.sinew_recipes
return ..()
/*
* Plates
*/
/obj/item/stack/sheet/animalhide/goliath_hide
name = "goliath hide plates"
desc = "Pieces of a goliath's rocky hide, these might be able to make your suit a bit more durable to attack from the local fauna."
icon = 'icons/obj/mining.dmi'
icon_state = "goliath_hide"
singular_name = "hide plate"
max_amount = 6
novariants = FALSE
item_flags = NOBLUDGEON
w_class = WEIGHT_CLASS_NORMAL
layer = MOB_LAYER
/obj/item/stack/sheet/animalhide/ashdrake
name = "ash drake hide"
desc = "The strong, scaled hide of an ash drake."
icon = 'icons/obj/mining.dmi'
icon_state = "dragon_hide"
singular_name = "drake plate"
max_amount = 10
novariants = FALSE
item_flags = NOBLUDGEON
w_class = WEIGHT_CLASS_NORMAL
layer = MOB_LAYER
//Step one - dehairing.
/obj/item/stack/sheet/animalhide/attackby(obj/item/W, mob/user, params)
if(W.get_sharpness())
playsound(loc, 'sound/weapons/slice.ogg', 50, 1, -1)
user.visible_message("[user] starts cutting hair off \the [src].", "<span class='notice'>You start cutting the hair off \the [src]...</span>", "<span class='italics'>You hear the sound of a knife rubbing against flesh.</span>")
if(do_after(user, 50, target = src))
to_chat(user, "<span class='notice'>You cut the hair from this [src.singular_name].</span>")
new /obj/item/stack/sheet/hairlesshide(user.drop_location(), 1)
use(1)
else
return ..()
//Step two - washing..... it's actually in washing machine code.
//Step three - drying
/obj/item/stack/sheet/wetleather/temperature_expose(datum/gas_mixture/air, exposed_temperature, exposed_volume)
..()
if(exposed_temperature >= drying_threshold_temperature)
wetness--
if(wetness == 0)
new /obj/item/stack/sheet/leather(drop_location(), 1)
wetness = initial(wetness)
use(1)
/obj/item/stack/sheet/wetleather/microwave_act(obj/machinery/microwave/MW)
..()
new /obj/item/stack/sheet/leather(drop_location(), amount)
qdel(src)
/obj/item/stack/sheet/animalhide
name = "hide"
desc = "Something went wrong."
icon_state = "sheet-hide"
item_state = "sheet-hide"
novariants = TRUE
/obj/item/stack/sheet/animalhide/human
name = "human skin"
desc = "The by-product of human farming."
singular_name = "human skin piece"
novariants = FALSE
GLOBAL_LIST_INIT(human_recipes, list( \
new/datum/stack_recipe("bloated human costume", /obj/item/clothing/suit/hooded/bloated_human, 5), \
))
/obj/item/stack/sheet/animalhide/human/Initialize(mapload, new_amount, merge = TRUE)
recipes = GLOB.human_recipes
return ..()
/obj/item/stack/sheet/animalhide/generic
name = "skin"
desc = "A piece of skin."
singular_name = "skin piece"
novariants = FALSE
/obj/item/stack/sheet/animalhide/corgi
name = "corgi hide"
desc = "The by-product of corgi farming."
singular_name = "corgi hide piece"
icon_state = "sheet-corgi"
item_state = "sheet-corgi"
GLOBAL_LIST_INIT(gondola_recipes, list ( \
new/datum/stack_recipe("gondola mask", /obj/item/clothing/mask/gondola, 1), \
new/datum/stack_recipe("gondola suit", /obj/item/clothing/under/gondola, 2), \
new/datum/stack_recipe("gondola bedsheet", /obj/item/bedsheet/gondola, 1), \
))
/obj/item/stack/sheet/animalhide/gondola
name = "gondola hide"
desc = "The extremely valuable product of gondola hunting."
singular_name = "gondola hide piece"
icon_state = "sheet-gondola"
item_state = "sheet-gondola"
/obj/item/stack/sheet/animalhide/gondola/Initialize(mapload, new_amount, merge = TRUE)
recipes = GLOB.gondola_recipes
return ..()
GLOBAL_LIST_INIT(corgi_recipes, list ( \
new/datum/stack_recipe("corgi costume", /obj/item/clothing/suit/hooded/ian_costume, 3), \
))
/obj/item/stack/sheet/animalhide/corgi/Initialize(mapload, new_amount, merge = TRUE)
recipes = GLOB.corgi_recipes
return ..()
/obj/item/stack/sheet/animalhide/cat
name = "cat hide"
desc = "The by-product of cat farming."
singular_name = "cat hide piece"
icon_state = "sheet-cat"
item_state = "sheet-cat"
/obj/item/stack/sheet/animalhide/monkey
name = "monkey hide"
desc = "The by-product of monkey farming."
singular_name = "monkey hide piece"
icon_state = "sheet-monkey"
icon_state = "sheet-monkey"
GLOBAL_LIST_INIT(monkey_recipes, list ( \
new/datum/stack_recipe("monkey mask", /obj/item/clothing/mask/gas/monkeymask, 1), \
new/datum/stack_recipe("monkey suit", /obj/item/clothing/suit/monkeysuit, 2), \
))
/obj/item/stack/sheet/animalhide/monkey/Initialize(mapload, new_amount, merge = TRUE)
recipes = GLOB.monkey_recipes
return ..()
/obj/item/stack/sheet/animalhide/lizard
name = "lizard skin"
desc = "Sssssss..."
singular_name = "lizard skin piece"
icon_state = "sheet-lizard"
item_state = "sheet-lizard"
/obj/item/stack/sheet/animalhide/xeno
name = "alien hide"
desc = "The skin of a terrible creature."
singular_name = "alien hide piece"
icon_state = "sheet-xeno"
item_state = "sheet-xeno"
GLOBAL_LIST_INIT(xeno_recipes, list ( \
new/datum/stack_recipe("alien helmet", /obj/item/clothing/head/xenos, 1), \
new/datum/stack_recipe("alien suit", /obj/item/clothing/suit/xenos, 2), \
))
/obj/item/stack/sheet/animalhide/xeno/Initialize(mapload, new_amount, merge = TRUE)
recipes = GLOB.xeno_recipes
return ..()
//don't see anywhere else to put these, maybe together they could be used to make the xenos suit?
/obj/item/stack/sheet/xenochitin
name = "alien chitin"
desc = "A piece of the hide of a terrible creature."
singular_name = "alien hide piece"
icon = 'icons/mob/alien.dmi'
icon_state = "chitin"
novariants = TRUE
/obj/item/xenos_claw
name = "alien claw"
desc = "The claw of a terrible creature."
icon = 'icons/mob/alien.dmi'
icon_state = "claw"
/obj/item/weed_extract
name = "weed extract"
desc = "A piece of slimy, purplish weed."
icon = 'icons/mob/alien.dmi'
icon_state = "weed_extract"
/obj/item/stack/sheet/hairlesshide
name = "hairless hide"
desc = "This hide was stripped of its hair, but still needs washing and tanning."
singular_name = "hairless hide piece"
icon_state = "sheet-hairlesshide"
item_state = "sheet-hairlesshide"
/obj/item/stack/sheet/wetleather
name = "wet leather"
desc = "This leather has been cleaned but still needs to be dried."
singular_name = "wet leather piece"
icon_state = "sheet-wetleather"
item_state = "sheet-wetleather"
var/wetness = 30 //Reduced when exposed to high temperautres
var/drying_threshold_temperature = 500 //Kelvin to start drying
/*
* Leather SHeet
*/
/obj/item/stack/sheet/leather
name = "leather"
desc = "The by-product of mob grinding."
singular_name = "leather piece"
icon_state = "sheet-leather"
item_state = "sheet-leather"
GLOBAL_LIST_INIT(leather_recipes, list ( \
new/datum/stack_recipe("wallet", /obj/item/storage/wallet, 1), \
new/datum/stack_recipe("muzzle", /obj/item/clothing/mask/muzzle, 2), \
new/datum/stack_recipe("botany gloves", /obj/item/clothing/gloves/botanic_leather, 3), \
new/datum/stack_recipe("toolbelt", /obj/item/storage/belt/utility, 4), \
new/datum/stack_recipe("leather satchel", /obj/item/storage/backpack/satchel/leather, 5), \
new/datum/stack_recipe("bandolier", /obj/item/storage/belt/bandolier, 5), \
new/datum/stack_recipe("leather jacket", /obj/item/clothing/suit/jacket/leather, 7), \
new/datum/stack_recipe("leather shoes", /obj/item/clothing/shoes/laceup, 2), \
new/datum/stack_recipe("leather overcoat", /obj/item/clothing/suit/jacket/leather/overcoat, 10), \
))
/obj/item/stack/sheet/leather/Initialize(mapload, new_amount, merge = TRUE)
recipes = GLOB.leather_recipes
return ..()
/*
* Sinew
*/
/obj/item/stack/sheet/sinew
name = "watcher sinew"
icon = 'icons/obj/mining.dmi'
desc = "Long stringy filaments which presumably came from a watcher's wings."
singular_name = "watcher sinew"
icon_state = "sinew"
novariants = TRUE
GLOBAL_LIST_INIT(sinew_recipes, list ( \
new/datum/stack_recipe("sinew restraints", /obj/item/restraints/handcuffs/sinew, 1), \
))
/obj/item/stack/sheet/sinew/Initialize(mapload, new_amount, merge = TRUE)
recipes = GLOB.sinew_recipes
return ..()
/*
* Plates
*/
/obj/item/stack/sheet/animalhide/goliath_hide
name = "goliath hide plates"
desc = "Pieces of a goliath's rocky hide, these might be able to make your suit a bit more durable to attack from the local fauna."
icon = 'icons/obj/mining.dmi'
icon_state = "goliath_hide"
singular_name = "hide plate"
max_amount = 6
novariants = FALSE
item_flags = NOBLUDGEON
w_class = WEIGHT_CLASS_NORMAL
layer = MOB_LAYER
/obj/item/stack/sheet/animalhide/ashdrake
name = "ash drake hide"
desc = "The strong, scaled hide of an ash drake."
icon = 'icons/obj/mining.dmi'
icon_state = "dragon_hide"
singular_name = "drake plate"
max_amount = 10
novariants = FALSE
item_flags = NOBLUDGEON
w_class = WEIGHT_CLASS_NORMAL
layer = MOB_LAYER
//Step one - dehairing.
/obj/item/stack/sheet/animalhide/attackby(obj/item/W, mob/user, params)
if(W.get_sharpness())
playsound(loc, 'sound/weapons/slice.ogg', 50, 1, -1)
user.visible_message("[user] starts cutting hair off \the [src].", "<span class='notice'>You start cutting the hair off \the [src]...</span>", "<span class='italics'>You hear the sound of a knife rubbing against flesh.</span>")
if(do_after(user, 50, target = src))
to_chat(user, "<span class='notice'>You cut the hair from this [src.singular_name].</span>")
new /obj/item/stack/sheet/hairlesshide(user.drop_location(), 1)
use(1)
else
return ..()
//Step two - washing..... it's actually in washing machine code.
//Step three - drying
/obj/item/stack/sheet/wetleather/temperature_expose(datum/gas_mixture/air, exposed_temperature, exposed_volume)
..()
if(exposed_temperature >= drying_threshold_temperature)
wetness--
if(wetness == 0)
new /obj/item/stack/sheet/leather(drop_location(), 1)
wetness = initial(wetness)
use(1)
/obj/item/stack/sheet/wetleather/microwave_act(obj/machinery/microwave/MW)
..()
new /obj/item/stack/sheet/leather(drop_location(), amount)
qdel(src)
+35 -35
View File
@@ -1,35 +1,35 @@
/obj/item/stack/light_w
name = "wired glass tile"
singular_name = "wired glass floor tile"
desc = "A glass tile, which is wired, somehow."
icon = 'icons/obj/tiles.dmi'
icon_state = "glass_wire"
w_class = WEIGHT_CLASS_NORMAL
force = 3
throwforce = 5
throw_speed = 3
throw_range = 7
flags_1 = CONDUCT_1
max_amount = 60
grind_results = list(/datum/reagent/silicon = 20, /datum/reagent/copper = 5)
/obj/item/stack/light_w/attackby(obj/item/O, mob/user, params)
if(istype(O, /obj/item/stack/sheet/metal))
var/obj/item/stack/sheet/metal/M = O
if (M.use(1))
var/obj/item/L = new /obj/item/stack/tile/light(user.drop_location())
to_chat(user, "<span class='notice'>You make a light tile.</span>")
L.add_fingerprint(user)
use(1)
else
to_chat(user, "<span class='warning'>You need one metal sheet to finish the light tile!</span>")
else
return ..()
/obj/item/stack/light_w/wirecutter_act(mob/living/user, obj/item/I)
var/atom/Tsec = user.drop_location()
var/obj/item/stack/cable_coil/CC = new (Tsec, 5)
CC.add_fingerprint(user)
var/obj/item/stack/sheet/glass/G = new (Tsec)
G.add_fingerprint(user)
use(1)
/obj/item/stack/light_w
name = "wired glass tile"
singular_name = "wired glass floor tile"
desc = "A glass tile, which is wired, somehow."
icon = 'icons/obj/tiles.dmi'
icon_state = "glass_wire"
w_class = WEIGHT_CLASS_NORMAL
force = 3
throwforce = 5
throw_speed = 3
throw_range = 7
flags_1 = CONDUCT_1
max_amount = 60
grind_results = list(/datum/reagent/silicon = 20, /datum/reagent/copper = 5)
/obj/item/stack/light_w/attackby(obj/item/O, mob/user, params)
if(istype(O, /obj/item/stack/sheet/metal))
var/obj/item/stack/sheet/metal/M = O
if (M.use(1))
var/obj/item/L = new /obj/item/stack/tile/light(user.drop_location())
to_chat(user, "<span class='notice'>You make a light tile.</span>")
L.add_fingerprint(user)
use(1)
else
to_chat(user, "<span class='warning'>You need one metal sheet to finish the light tile!</span>")
else
return ..()
/obj/item/stack/light_w/wirecutter_act(mob/living/user, obj/item/I)
var/atom/Tsec = user.drop_location()
var/obj/item/stack/cable_coil/CC = new (Tsec, 5)
CC.add_fingerprint(user)
var/obj/item/stack/sheet/glass/G = new (Tsec)
G.add_fingerprint(user)
use(1)
@@ -331,30 +331,6 @@ GLOBAL_LIST_INIT(plastitanium_recipes, list ( \
recipes = GLOB.plastitanium_recipes
. = ..()
/*
* Snow
*/
/obj/item/stack/sheet/mineral/snow
name = "snow"
icon_state = "sheet-snow"
item_state = "sheet-snow"
singular_name = "snow block"
force = 1
throwforce = 2
grind_results = list(/datum/reagent/consumable/ice = 20)
merge_type = /obj/item/stack/sheet/mineral/snow
GLOBAL_LIST_INIT(snow_recipes, list ( \
new/datum/stack_recipe("Snow Wall", /turf/closed/wall/mineral/snow, 5, one_per_turf = 1, on_floor = 1), \
new/datum/stack_recipe("Snowman", /obj/structure/statue/snow/snowman, 5, one_per_turf = 1, on_floor = 1), \
new/datum/stack_recipe("Snowball", /obj/item/toy/snowball, 1), \
))
/obj/item/stack/sheet/mineral/snow/Initialize(mapload, new_amount, merge = TRUE)
recipes = GLOB.snow_recipes
. = ..()
/****************************** Others ****************************/
/*
@@ -386,6 +362,29 @@ GLOBAL_LIST_INIT(adamantine_recipes, list(
novariants = TRUE
merge_type = /obj/item/stack/sheet/mineral/mythril
/*
* Snow
*/
/obj/item/stack/sheet/mineral/snow
name = "snow"
icon_state = "sheet-snow"
item_state = "sheet-snow"
singular_name = "snow block"
force = 1
throwforce = 2
grind_results = list(/datum/reagent/consumable/ice = 20)
merge_type = /obj/item/stack/sheet/mineral/snow
GLOBAL_LIST_INIT(snow_recipes, list ( \
new/datum/stack_recipe("Snow Wall", /turf/closed/wall/mineral/snow, 5, one_per_turf = 1, on_floor = 1), \
new/datum/stack_recipe("Snowman", /obj/structure/statue/snow/snowman, 5, one_per_turf = 1, on_floor = 1), \
new/datum/stack_recipe("Snowball", /obj/item/toy/snowball, 1), \
))
/obj/item/stack/sheet/mineral/snow/Initialize(mapload, new_amount, merge = TRUE)
recipes = GLOB.snow_recipes
. = ..()
/*
* Alien Alloy
*/
@@ -442,4 +441,4 @@ GLOBAL_LIST_INIT(abductor_recipes, list ( \
amount = 5
/obj/item/stack/sheet/mineral/coal/ten
amount = 10
amount = 10
@@ -3,13 +3,18 @@
* Metal
* Plasteel
* Wood
* Bamboo
* Cloth
* Plastic
* Silk
* Durathread
* Cardboard
* Paper Frames
* Runed Metal (cult)
* Brass (clockwork cult)
* Bronze (bake brass)
* Gems
* Bones
* Plastic
* Paper Frames
* Cotton/Duracotton
*/
@@ -240,7 +245,6 @@ GLOBAL_LIST_INIT(wood_recipes, list ( \
novariants = TRUE
grind_results = list(/datum/reagent/carbon = 20)
/obj/item/stack/sheet/mineral/wood/attackby(obj/item/W, mob/user, params) // NOTE: sheet_types.dm is where the WOOD stack lives. Maybe move this over there.
// Taken from /obj/item/stack/rods/attackby in [rods.dm]
if(W.get_sharpness())
@@ -302,7 +306,6 @@ GLOBAL_LIST_INIT(bamboo_recipes, list ( \
recipes = GLOB.bamboo_recipes
return ..()
/*
* Cloth
*/
@@ -356,6 +359,9 @@ GLOBAL_LIST_INIT(cloth_recipes, list ( \
/obj/item/stack/sheet/cloth/thirty
amount = 30
/*
* Silk
*/
/obj/item/stack/sheet/silk
name = "silk"
desc = "A long soft material. This one is just made out of cotton rather then any spiders or wyrms"
@@ -369,7 +375,9 @@ GLOBAL_LIST_INIT(cloth_recipes, list ( \
// recipes = GLOB.silk_recipes
// return ..()
//Durathread fuck slash-asterisk comments
/*
* Durathread
*/
GLOBAL_LIST_INIT(durathread_recipes, list ( \
new/datum/stack_recipe("durathread jumpsuit", /obj/item/clothing/under/durathread, 4, time = 40),
new/datum/stack_recipe("durathread beret", /obj/item/clothing/head/beret/durathread, 2, time = 40), \
@@ -392,8 +400,6 @@ GLOBAL_LIST_INIT(cloth_recipes, list ( \
recipes = GLOB.durathread_recipes
return ..()
/*
* Cardboard
*/
@@ -487,7 +493,6 @@ GLOBAL_LIST_INIT(cardboard_recipes, list ( \
else
. = ..()
/*
* Runed Metal
*/
@@ -712,6 +717,7 @@ GLOBAL_LIST_INIT(plastic_recipes, list(
item_state = "sheet-plastic"
materials = list(MAT_PLASTIC=MINERAL_MATERIAL_AMOUNT)
throwforce = 7
grind_results = list(/datum/reagent/glitter/white = 60)
merge_type = /obj/item/stack/sheet/plastic
/obj/item/stack/sheet/plastic/fifty
@@ -748,7 +754,6 @@ new /datum/stack_recipe("paper frame door", /obj/structure/mineral_door/paperfra
/obj/item/stack/sheet/paperframes/fifty
amount = 50
//durathread and cotton raw
/obj/item/stack/sheet/cotton
name = "raw cotton bundle"
+17 -17
View File
@@ -1,18 +1,18 @@
/obj/item/stack/sheet
name = "sheet"
lefthand_file = 'icons/mob/inhands/misc/sheets_lefthand.dmi'
righthand_file = 'icons/mob/inhands/misc/sheets_righthand.dmi'
full_w_class = WEIGHT_CLASS_NORMAL
force = 5
throwforce = 5
max_amount = 50
throw_speed = 1
throw_range = 3
attack_verb = list("bashed", "battered", "bludgeoned", "thrashed", "smashed")
novariants = FALSE
var/perunit = MINERAL_MATERIAL_AMOUNT
var/sheettype = null //this is used for girders in the creation of walls/false walls
var/point_value = 0 //turn-in value for the gulag stacker - loosely relative to its rarity
var/is_fabric = FALSE //is this a valid material for the loom?
var/loom_result //result from pulling on the loom
/obj/item/stack/sheet
name = "sheet"
lefthand_file = 'icons/mob/inhands/misc/sheets_lefthand.dmi'
righthand_file = 'icons/mob/inhands/misc/sheets_righthand.dmi'
full_w_class = WEIGHT_CLASS_NORMAL
force = 5
throwforce = 5
max_amount = 50
throw_speed = 1
throw_range = 3
attack_verb = list("bashed", "battered", "bludgeoned", "thrashed", "smashed")
novariants = FALSE
var/perunit = MINERAL_MATERIAL_AMOUNT
var/sheettype = null //this is used for girders in the creation of walls/false walls
var/point_value = 0 //turn-in value for the gulag stacker - loosely relative to its rarity
var/is_fabric = FALSE //is this a valid material for the loom?
var/loom_result //result from pulling on the loom
var/pull_effort = 0 //amount of delay when pulling on the loom
File diff suppressed because it is too large Load Diff
+418 -418
View File
@@ -1,418 +1,418 @@
/*
* These absorb the functionality of the plant bag, ore satchel, etc
* They use the use_to_pickup, quick_gather, and quick_empty functions
* that were already defined in weapon/storage, but which had been
* re-implemented in other classes.
*
* Contains:
* Trash Bag
* Mining Satchel
* Plant Bag
* Sheet Snatcher
* Book Bag
* Biowaste Bag
*
* -Sayu
*/
// Generic non-item
/obj/item/storage/bag
slot_flags = ITEM_SLOT_BELT
/obj/item/storage/bag/ComponentInitialize()
. = ..()
var/datum/component/storage/STR = GetComponent(/datum/component/storage)
STR.allow_quick_gather = TRUE
STR.allow_quick_empty = TRUE
STR.display_numerical_stacking = TRUE
STR.click_gather = TRUE
// -----------------------------
// Trash bag
// -----------------------------
/obj/item/storage/bag/trash
name = "trash bag"
desc = "It's the heavy-duty black polymer kind. Time to take out the trash!"
icon = 'icons/obj/janitor.dmi'
icon_state = "trashbag"
item_state = "trashbag"
lefthand_file = 'icons/mob/inhands/equipment/custodial_lefthand.dmi'
righthand_file = 'icons/mob/inhands/equipment/custodial_righthand.dmi'
w_class = WEIGHT_CLASS_BULKY
var/insertable = TRUE
/obj/item/storage/bag/trash/ComponentInitialize()
. = ..()
var/datum/component/storage/STR = GetComponent(/datum/component/storage)
STR.max_w_class = WEIGHT_CLASS_SMALL
STR.max_combined_w_class = 30
STR.max_items = 30
STR.cant_hold = typecacheof(list(/obj/item/disk/nuclear))
STR.limited_random_access = TRUE
STR.limited_random_access_stack_position = 3
/obj/item/storage/bag/trash/suicide_act(mob/user)
user.visible_message("<span class='suicide'>[user] puts [src] over [user.p_their()] head and starts chomping at the insides! Disgusting!</span>")
playsound(loc, 'sound/items/eatfood.ogg', 50, 1, -1)
return (TOXLOSS)
/obj/item/storage/bag/trash/update_icon()
if(contents.len == 0)
icon_state = "[initial(icon_state)]"
else if(contents.len < 12)
icon_state = "[initial(icon_state)]1"
else if(contents.len < 21)
icon_state = "[initial(icon_state)]2"
else icon_state = "[initial(icon_state)]3"
/obj/item/storage/bag/trash/cyborg
insertable = FALSE
/obj/item/storage/bag/trash/proc/janicart_insert(mob/user, obj/structure/janitorialcart/J)
if(insertable)
J.put_in_cart(src, user)
J.mybag=src
J.update_icon()
else
to_chat(user, "<span class='warning'>You are unable to fit your [name] into the [J.name].</span>")
return
/obj/item/storage/bag/trash/bluespace
name = "trash bag of holding"
desc = "The latest and greatest in custodial convenience, a trashbag that is capable of holding vast quantities of garbage."
icon_state = "bluetrashbag"
item_flags = NO_MAT_REDEMPTION
rad_flags = RAD_PROTECT_CONTENTS | RAD_NO_CONTAMINATE
/obj/item/storage/bag/trash/bluespace/ComponentInitialize()
. = ..()
var/datum/component/storage/STR = GetComponent(/datum/component/storage)
STR.max_combined_w_class = 60
STR.max_items = 60
STR.limited_random_access_stack_position = 5
/obj/item/storage/bag/trash/bluespace/cyborg
insertable = FALSE
// -----------------------------
// Mining Satchel
// -----------------------------
/obj/item/storage/bag/ore
name = "mining satchel"
desc = "This little bugger can be used to store and transport ores."
icon = 'icons/obj/mining.dmi'
icon_state = "satchel"
slot_flags = ITEM_SLOT_BELT | ITEM_SLOT_POCKET
w_class = WEIGHT_CLASS_NORMAL
component_type = /datum/component/storage/concrete/stack
var/spam_protection = FALSE //If this is TRUE, the holder won't receive any messages when they fail to pick up ore through crossing it
var/mob/listeningTo
rad_flags = RAD_PROTECT_CONTENTS | RAD_NO_CONTAMINATE
var/range = null
/obj/item/storage/bag/ore/ComponentInitialize()
. = ..()
var/datum/component/storage/concrete/stack/STR = GetComponent(/datum/component/storage/concrete/stack)
STR.allow_quick_empty = TRUE
STR.can_hold = typecacheof(list(/obj/item/stack/ore))
STR.max_w_class = WEIGHT_CLASS_HUGE
STR.max_combined_stack_amount = 50
/obj/item/storage/bag/ore/equipped(mob/user)
. = ..()
if(listeningTo == user)
return
if(listeningTo)
UnregisterSignal(listeningTo, COMSIG_MOVABLE_MOVED)
RegisterSignal(user, COMSIG_MOVABLE_MOVED, .proc/Pickup_ores)
listeningTo = user
/obj/item/storage/bag/ore/dropped()
. = ..()
if(listeningTo)
UnregisterSignal(listeningTo, COMSIG_MOVABLE_MOVED)
listeningTo = null
/obj/item/storage/bag/ore/proc/Pickup_ores(mob/living/user)
var/show_message = FALSE
var/obj/structure/ore_box/box
var/turf/tile = user.loc
if (!isturf(tile))
return
if (istype(user.pulling, /obj/structure/ore_box))
box = user.pulling
if(issilicon(user))
var/mob/living/silicon/robot/borgo = user
for(var/obj/item/cyborg_clamp/C in borgo.module.modules)
for(var/obj/structure/ore_box/B in C)
box = B
var/datum/component/storage/STR = GetComponent(/datum/component/storage)
if(STR)
for(var/A in tile)
if (!is_type_in_typecache(A, STR.can_hold))
continue
if (box)
if(range)
for(var/obj/item/stack/ore/ore in range(range, user))
user.transferItemToLoc(ore, box)
user.transferItemToLoc(A, box)
show_message = TRUE
else if(SEND_SIGNAL(src, COMSIG_TRY_STORAGE_INSERT, A, user, TRUE))
show_message = TRUE
else
if(!spam_protection)
to_chat(user, "<span class='warning'>Your [name] is full and can't hold any more!</span>")
spam_protection = TRUE
continue
if(show_message)
playsound(user, "rustle", 50, TRUE)
if (box)
user.visible_message("<span class='notice'>[user] offloads the ores beneath [user.p_them()] into [box].</span>", \
"<span class='notice'>You offload the ores beneath you into your [box].</span>")
else
user.visible_message("<span class='notice'>[user] scoops up the ores beneath [user.p_them()].</span>", \
"<span class='notice'>You scoop up the ores beneath you with your [name].</span>")
spam_protection = FALSE
/obj/item/storage/bag/ore/cyborg
name = "cyborg mining satchel"
range = 1
/obj/item/storage/bag/ore/cyborg/ComponentInitialize()
. = ..()
var/datum/component/storage/concrete/stack/STR = GetComponent(/datum/component/storage/concrete/stack)
STR.allow_quick_empty = TRUE
STR.can_hold = typecacheof(list(/obj/item/stack/ore))
STR.max_w_class = WEIGHT_CLASS_HUGE
STR.max_combined_stack_amount = 150
/obj/item/storage/bag/ore/large
name = "large mining satchel"
desc = "This bag can hold three times the ore in many small pockets. Shockingly foldable and compact for its volume."
/obj/item/storage/bag/ore/large/ComponentInitialize()
. = ..()
var/datum/component/storage/concrete/stack/STR = GetComponent(/datum/component/storage/concrete/stack)
STR.allow_quick_empty = TRUE
STR.can_hold = typecacheof(list(/obj/item/stack/ore))
STR.max_w_class = WEIGHT_CLASS_HUGE
STR.max_combined_stack_amount = 150
/obj/item/storage/bag/ore/holding //miners, your messiah has arrived
name = "mining satchel of holding"
desc = "A revolution in convenience, this satchel allows for huge amounts of ore storage. It's been outfitted with anti-malfunction safety measures."
icon_state = "satchel_bspace"
/obj/item/storage/bag/ore/holding/ComponentInitialize()
. = ..()
var/datum/component/storage/concrete/stack/STR = GetComponent(/datum/component/storage/concrete/stack)
STR.max_items = INFINITY
STR.max_combined_w_class = INFINITY
STR.max_combined_stack_amount = INFINITY
// -----------------------------
// Plant bag
// -----------------------------
/obj/item/storage/bag/plants
name = "plant bag"
icon = 'icons/obj/hydroponics/equipment.dmi'
icon_state = "plantbag"
w_class = WEIGHT_CLASS_TINY
resistance_flags = FLAMMABLE
/obj/item/storage/bag/plants/ComponentInitialize()
. = ..()
var/datum/component/storage/STR = GetComponent(/datum/component/storage)
STR.max_w_class = WEIGHT_CLASS_NORMAL
STR.max_combined_w_class = 100
STR.max_items = 100
STR.can_hold = typecacheof(list(/obj/item/reagent_containers/food/snacks/grown, /obj/item/seeds, /obj/item/grown, /obj/item/reagent_containers/honeycomb))
////////
/obj/item/storage/bag/plants/portaseeder
name = "portable seed extractor"
desc = "For the enterprising botanist on the go. Less efficient than the stationary model, it creates one seed per plant."
icon_state = "portaseeder"
/obj/item/storage/bag/plants/portaseeder/verb/dissolve_contents()
set name = "Activate Seed Extraction"
set category = "Object"
set desc = "Activate to convert your plants into plantable seeds."
if(usr.stat || !usr.canmove || usr.restrained())
return
for(var/obj/item/O in contents)
seedify(O, 1)
// -----------------------------
// Sheet Snatcher
// -----------------------------
// Because it stacks stacks, this doesn't operate normally.
// However, making it a storage/bag allows us to reuse existing code in some places. -Sayu
/obj/item/storage/bag/sheetsnatcher
name = "sheet snatcher"
desc = "A patented Nanotrasen storage system designed for any kind of mineral sheet."
icon = 'icons/obj/mining.dmi'
icon_state = "sheetsnatcher"
var/capacity = 300; //the number of sheets it can carry.
w_class = WEIGHT_CLASS_NORMAL
component_type = /datum/component/storage/concrete/stack
/obj/item/storage/bag/sheetsnatcher/ComponentInitialize()
. = ..()
var/datum/component/storage/concrete/stack/STR = GetComponent(/datum/component/storage/concrete/stack)
STR.allow_quick_empty = TRUE
STR.can_hold = typecacheof(list(/obj/item/stack/sheet))
STR.cant_hold = typecacheof(list(/obj/item/stack/sheet/mineral/sandstone, /obj/item/stack/sheet/mineral/wood))
STR.max_combined_stack_amount = 300
// -----------------------------
// Sheet Snatcher (Cyborg)
// -----------------------------
/obj/item/storage/bag/sheetsnatcher/borg
name = "sheet snatcher 9000"
desc = ""
capacity = 500//Borgs get more because >specialization
/obj/item/storage/bag/sheetsnatcher/borg/ComponentInitialize()
. = ..()
var/datum/component/storage/concrete/stack/STR = GetComponent(/datum/component/storage/concrete/stack)
STR.max_combined_stack_amount = 500
// -----------------------------
// Book bag
// -----------------------------
/obj/item/storage/bag/books
name = "book bag"
desc = "A bag for books."
icon = 'icons/obj/library.dmi'
icon_state = "bookbag"
w_class = WEIGHT_CLASS_BULKY //Bigger than a book because physics
resistance_flags = FLAMMABLE
/obj/item/storage/bag/books/ComponentInitialize()
. = ..()
var/datum/component/storage/STR = GetComponent(/datum/component/storage)
STR.max_w_class = WEIGHT_CLASS_NORMAL
STR.max_combined_w_class = 21
STR.max_items = 7
STR.display_numerical_stacking = FALSE
STR.can_hold = typecacheof(list(/obj/item/book, /obj/item/storage/book, /obj/item/spellbook))
/*
* Trays - Agouri
*/
/obj/item/storage/bag/tray
name = "tray"
icon = 'icons/obj/food/containers.dmi'
icon_state = "tray"
desc = "A metal tray to lay food on."
force = 5
throwforce = 10
throw_speed = 3
throw_range = 5
w_class = WEIGHT_CLASS_BULKY
flags_1 = CONDUCT_1
materials = list(MAT_METAL=3000)
/obj/item/storage/bag/tray/ComponentInitialize()
. = ..()
var/datum/component/storage/STR = GetComponent(/datum/component/storage)
STR.insert_preposition = "on"
/obj/item/storage/bag/tray/attack(mob/living/M, mob/living/user)
. = ..()
// Drop all the things. All of them.
var/list/obj/item/oldContents = contents.Copy()
SEND_SIGNAL(src, COMSIG_TRY_STORAGE_QUICK_EMPTY)
// Make each item scatter a bit
for(var/obj/item/I in oldContents)
spawn()
for(var/i = 1, i <= rand(1,2), i++)
if(I)
step(I, pick(NORTH,SOUTH,EAST,WEST))
sleep(rand(2,4))
if(prob(50))
playsound(M, 'sound/items/trayhit1.ogg', 50, 1)
else
playsound(M, 'sound/items/trayhit2.ogg', 50, 1)
if(ishuman(M) || ismonkey(M))
if(prob(10))
M.Knockdown(40)
update_icon()
/obj/item/storage/bag/tray/update_icon()
cut_overlays()
for(var/obj/item/I in contents)
add_overlay(new /mutable_appearance(I))
/obj/item/storage/bag/tray/Entered()
. = ..()
update_icon()
/obj/item/storage/bag/tray/Exited()
. = ..()
update_icon()
/*
* Chemistry bag
*/
/obj/item/storage/bag/chemistry
name = "chemistry bag"
icon = 'icons/obj/chemical.dmi'
icon_state = "bag"
desc = "A bag for storing pills, patches, and bottles."
w_class = WEIGHT_CLASS_TINY
resistance_flags = FLAMMABLE
/obj/item/storage/bag/chemistry/ComponentInitialize()
. = ..()
var/datum/component/storage/STR = GetComponent(/datum/component/storage)
STR.max_combined_w_class = 200
STR.max_items = 50
STR.insert_preposition = "in"
STR.can_hold = typecacheof(list(/obj/item/reagent_containers/pill, /obj/item/reagent_containers/glass/beaker, /obj/item/reagent_containers/glass/bottle, /obj/item/reagent_containers/syringe/dart))
/*
* Biowaste bag (mostly for xenobiologists)
*/
/obj/item/storage/bag/bio
name = "bio bag"
icon = 'icons/obj/chemical.dmi'
icon_state = "biobag"
desc = "A bag for the safe transportation and disposal of biowaste and other biological materials."
w_class = WEIGHT_CLASS_TINY
resistance_flags = FLAMMABLE
/obj/item/storage/bag/bio/ComponentInitialize()
. = ..()
var/datum/component/storage/STR = GetComponent(/datum/component/storage)
STR.max_combined_w_class = 200
STR.max_items = 25
STR.insert_preposition = "in"
STR.can_hold = typecacheof(list(/obj/item/slime_extract, /obj/item/reagent_containers/syringe, /obj/item/reagent_containers/glass/beaker, /obj/item/reagent_containers/glass/bottle, /obj/item/reagent_containers/blood, /obj/item/reagent_containers/hypospray/medipen, /obj/item/reagent_containers/food/snacks/deadmouse, /obj/item/reagent_containers/food/snacks/monkeycube))
/obj/item/storage/bag/bio/holding
name = "bio bag of holding"
icon = 'icons/obj/chemical.dmi'
icon_state = "bspace_biobag"
desc = "A bag for the safe transportation and disposal of biowaste and other biological materials."
rad_flags = RAD_PROTECT_CONTENTS | RAD_NO_CONTAMINATE
/obj/item/storage/bag/bio/holding/ComponentInitialize()
. = ..()
var/datum/component/storage/STR = GetComponent(/datum/component/storage)
STR.max_combined_w_class = INFINITY
STR.max_items = 100
/*
* These absorb the functionality of the plant bag, ore satchel, etc
* They use the use_to_pickup, quick_gather, and quick_empty functions
* that were already defined in weapon/storage, but which had been
* re-implemented in other classes.
*
* Contains:
* Trash Bag
* Mining Satchel
* Plant Bag
* Sheet Snatcher
* Book Bag
* Biowaste Bag
*
* -Sayu
*/
// Generic non-item
/obj/item/storage/bag
slot_flags = ITEM_SLOT_BELT
/obj/item/storage/bag/ComponentInitialize()
. = ..()
var/datum/component/storage/STR = GetComponent(/datum/component/storage)
STR.allow_quick_gather = TRUE
STR.allow_quick_empty = TRUE
STR.display_numerical_stacking = TRUE
STR.click_gather = TRUE
// -----------------------------
// Trash bag
// -----------------------------
/obj/item/storage/bag/trash
name = "trash bag"
desc = "It's the heavy-duty black polymer kind. Time to take out the trash!"
icon = 'icons/obj/janitor.dmi'
icon_state = "trashbag"
item_state = "trashbag"
lefthand_file = 'icons/mob/inhands/equipment/custodial_lefthand.dmi'
righthand_file = 'icons/mob/inhands/equipment/custodial_righthand.dmi'
w_class = WEIGHT_CLASS_BULKY
var/insertable = TRUE
/obj/item/storage/bag/trash/ComponentInitialize()
. = ..()
var/datum/component/storage/STR = GetComponent(/datum/component/storage)
STR.max_w_class = WEIGHT_CLASS_SMALL
STR.max_combined_w_class = 30
STR.max_items = 30
STR.cant_hold = typecacheof(list(/obj/item/disk/nuclear))
STR.limited_random_access = TRUE
STR.limited_random_access_stack_position = 3
/obj/item/storage/bag/trash/suicide_act(mob/user)
user.visible_message("<span class='suicide'>[user] puts [src] over [user.p_their()] head and starts chomping at the insides! Disgusting!</span>")
playsound(loc, 'sound/items/eatfood.ogg', 50, 1, -1)
return (TOXLOSS)
/obj/item/storage/bag/trash/update_icon()
if(contents.len == 0)
icon_state = "[initial(icon_state)]"
else if(contents.len < 12)
icon_state = "[initial(icon_state)]1"
else if(contents.len < 21)
icon_state = "[initial(icon_state)]2"
else icon_state = "[initial(icon_state)]3"
/obj/item/storage/bag/trash/cyborg
insertable = FALSE
/obj/item/storage/bag/trash/proc/janicart_insert(mob/user, obj/structure/janitorialcart/J)
if(insertable)
J.put_in_cart(src, user)
J.mybag=src
J.update_icon()
else
to_chat(user, "<span class='warning'>You are unable to fit your [name] into the [J.name].</span>")
return
/obj/item/storage/bag/trash/bluespace
name = "trash bag of holding"
desc = "The latest and greatest in custodial convenience, a trashbag that is capable of holding vast quantities of garbage."
icon_state = "bluetrashbag"
item_flags = NO_MAT_REDEMPTION
rad_flags = RAD_PROTECT_CONTENTS | RAD_NO_CONTAMINATE
/obj/item/storage/bag/trash/bluespace/ComponentInitialize()
. = ..()
var/datum/component/storage/STR = GetComponent(/datum/component/storage)
STR.max_combined_w_class = 60
STR.max_items = 60
STR.limited_random_access_stack_position = 5
/obj/item/storage/bag/trash/bluespace/cyborg
insertable = FALSE
// -----------------------------
// Mining Satchel
// -----------------------------
/obj/item/storage/bag/ore
name = "mining satchel"
desc = "This little bugger can be used to store and transport ores."
icon = 'icons/obj/mining.dmi'
icon_state = "satchel"
slot_flags = ITEM_SLOT_BELT | ITEM_SLOT_POCKET
w_class = WEIGHT_CLASS_NORMAL
component_type = /datum/component/storage/concrete/stack
var/spam_protection = FALSE //If this is TRUE, the holder won't receive any messages when they fail to pick up ore through crossing it
var/mob/listeningTo
rad_flags = RAD_PROTECT_CONTENTS | RAD_NO_CONTAMINATE
var/range = null
/obj/item/storage/bag/ore/ComponentInitialize()
. = ..()
var/datum/component/storage/concrete/stack/STR = GetComponent(/datum/component/storage/concrete/stack)
STR.allow_quick_empty = TRUE
STR.can_hold = typecacheof(list(/obj/item/stack/ore))
STR.max_w_class = WEIGHT_CLASS_HUGE
STR.max_combined_stack_amount = 50
/obj/item/storage/bag/ore/equipped(mob/user)
. = ..()
if(listeningTo == user)
return
if(listeningTo)
UnregisterSignal(listeningTo, COMSIG_MOVABLE_MOVED)
RegisterSignal(user, COMSIG_MOVABLE_MOVED, .proc/Pickup_ores)
listeningTo = user
/obj/item/storage/bag/ore/dropped()
. = ..()
if(listeningTo)
UnregisterSignal(listeningTo, COMSIG_MOVABLE_MOVED)
listeningTo = null
/obj/item/storage/bag/ore/proc/Pickup_ores(mob/living/user)
var/show_message = FALSE
var/obj/structure/ore_box/box
var/turf/tile = user.loc
if (!isturf(tile))
return
if (istype(user.pulling, /obj/structure/ore_box))
box = user.pulling
if(issilicon(user))
var/mob/living/silicon/robot/borgo = user
for(var/obj/item/cyborg_clamp/C in borgo.module.modules)
for(var/obj/structure/ore_box/B in C)
box = B
var/datum/component/storage/STR = GetComponent(/datum/component/storage)
if(STR)
for(var/A in tile)
if (!is_type_in_typecache(A, STR.can_hold))
continue
if (box)
if(range)
for(var/obj/item/stack/ore/ore in range(range, user))
user.transferItemToLoc(ore, box)
user.transferItemToLoc(A, box)
show_message = TRUE
else if(SEND_SIGNAL(src, COMSIG_TRY_STORAGE_INSERT, A, user, TRUE))
show_message = TRUE
else
if(!spam_protection)
to_chat(user, "<span class='warning'>Your [name] is full and can't hold any more!</span>")
spam_protection = TRUE
continue
if(show_message)
playsound(user, "rustle", 50, TRUE)
if (box)
user.visible_message("<span class='notice'>[user] offloads the ores beneath [user.p_them()] into [box].</span>", \
"<span class='notice'>You offload the ores beneath you into your [box].</span>")
else
user.visible_message("<span class='notice'>[user] scoops up the ores beneath [user.p_them()].</span>", \
"<span class='notice'>You scoop up the ores beneath you with your [name].</span>")
spam_protection = FALSE
/obj/item/storage/bag/ore/cyborg
name = "cyborg mining satchel"
range = 1
/obj/item/storage/bag/ore/cyborg/ComponentInitialize()
. = ..()
var/datum/component/storage/concrete/stack/STR = GetComponent(/datum/component/storage/concrete/stack)
STR.allow_quick_empty = TRUE
STR.can_hold = typecacheof(list(/obj/item/stack/ore))
STR.max_w_class = WEIGHT_CLASS_HUGE
STR.max_combined_stack_amount = 150
/obj/item/storage/bag/ore/large
name = "large mining satchel"
desc = "This bag can hold three times the ore in many small pockets. Shockingly foldable and compact for its volume."
/obj/item/storage/bag/ore/large/ComponentInitialize()
. = ..()
var/datum/component/storage/concrete/stack/STR = GetComponent(/datum/component/storage/concrete/stack)
STR.allow_quick_empty = TRUE
STR.can_hold = typecacheof(list(/obj/item/stack/ore))
STR.max_w_class = WEIGHT_CLASS_HUGE
STR.max_combined_stack_amount = 150
/obj/item/storage/bag/ore/holding //miners, your messiah has arrived
name = "mining satchel of holding"
desc = "A revolution in convenience, this satchel allows for huge amounts of ore storage. It's been outfitted with anti-malfunction safety measures."
icon_state = "satchel_bspace"
/obj/item/storage/bag/ore/holding/ComponentInitialize()
. = ..()
var/datum/component/storage/concrete/stack/STR = GetComponent(/datum/component/storage/concrete/stack)
STR.max_items = INFINITY
STR.max_combined_w_class = INFINITY
STR.max_combined_stack_amount = INFINITY
// -----------------------------
// Plant bag
// -----------------------------
/obj/item/storage/bag/plants
name = "plant bag"
icon = 'icons/obj/hydroponics/equipment.dmi'
icon_state = "plantbag"
w_class = WEIGHT_CLASS_TINY
resistance_flags = FLAMMABLE
/obj/item/storage/bag/plants/ComponentInitialize()
. = ..()
var/datum/component/storage/STR = GetComponent(/datum/component/storage)
STR.max_w_class = WEIGHT_CLASS_NORMAL
STR.max_combined_w_class = 100
STR.max_items = 100
STR.can_hold = typecacheof(list(/obj/item/reagent_containers/food/snacks/grown, /obj/item/seeds, /obj/item/grown, /obj/item/reagent_containers/honeycomb))
////////
/obj/item/storage/bag/plants/portaseeder
name = "portable seed extractor"
desc = "For the enterprising botanist on the go. Less efficient than the stationary model, it creates one seed per plant."
icon_state = "portaseeder"
/obj/item/storage/bag/plants/portaseeder/verb/dissolve_contents()
set name = "Activate Seed Extraction"
set category = "Object"
set desc = "Activate to convert your plants into plantable seeds."
if(usr.stat || !usr.canmove || usr.restrained())
return
for(var/obj/item/O in contents)
seedify(O, 1)
// -----------------------------
// Sheet Snatcher
// -----------------------------
// Because it stacks stacks, this doesn't operate normally.
// However, making it a storage/bag allows us to reuse existing code in some places. -Sayu
/obj/item/storage/bag/sheetsnatcher
name = "sheet snatcher"
desc = "A patented Nanotrasen storage system designed for any kind of mineral sheet."
icon = 'icons/obj/mining.dmi'
icon_state = "sheetsnatcher"
var/capacity = 300; //the number of sheets it can carry.
w_class = WEIGHT_CLASS_NORMAL
component_type = /datum/component/storage/concrete/stack
/obj/item/storage/bag/sheetsnatcher/ComponentInitialize()
. = ..()
var/datum/component/storage/concrete/stack/STR = GetComponent(/datum/component/storage/concrete/stack)
STR.allow_quick_empty = TRUE
STR.can_hold = typecacheof(list(/obj/item/stack/sheet))
STR.cant_hold = typecacheof(list(/obj/item/stack/sheet/mineral/sandstone, /obj/item/stack/sheet/mineral/wood))
STR.max_combined_stack_amount = 300
// -----------------------------
// Sheet Snatcher (Cyborg)
// -----------------------------
/obj/item/storage/bag/sheetsnatcher/borg
name = "sheet snatcher 9000"
desc = ""
capacity = 500//Borgs get more because >specialization
/obj/item/storage/bag/sheetsnatcher/borg/ComponentInitialize()
. = ..()
var/datum/component/storage/concrete/stack/STR = GetComponent(/datum/component/storage/concrete/stack)
STR.max_combined_stack_amount = 500
// -----------------------------
// Book bag
// -----------------------------
/obj/item/storage/bag/books
name = "book bag"
desc = "A bag for books."
icon = 'icons/obj/library.dmi'
icon_state = "bookbag"
w_class = WEIGHT_CLASS_BULKY //Bigger than a book because physics
resistance_flags = FLAMMABLE
/obj/item/storage/bag/books/ComponentInitialize()
. = ..()
var/datum/component/storage/STR = GetComponent(/datum/component/storage)
STR.max_w_class = WEIGHT_CLASS_NORMAL
STR.max_combined_w_class = 21
STR.max_items = 7
STR.display_numerical_stacking = FALSE
STR.can_hold = typecacheof(list(/obj/item/book, /obj/item/storage/book, /obj/item/spellbook))
/*
* Trays - Agouri
*/
/obj/item/storage/bag/tray
name = "tray"
icon = 'icons/obj/food/containers.dmi'
icon_state = "tray"
desc = "A metal tray to lay food on."
force = 5
throwforce = 10
throw_speed = 3
throw_range = 5
w_class = WEIGHT_CLASS_BULKY
flags_1 = CONDUCT_1
materials = list(MAT_METAL=3000)
/obj/item/storage/bag/tray/ComponentInitialize()
. = ..()
var/datum/component/storage/STR = GetComponent(/datum/component/storage)
STR.insert_preposition = "on"
/obj/item/storage/bag/tray/attack(mob/living/M, mob/living/user)
. = ..()
// Drop all the things. All of them.
var/list/obj/item/oldContents = contents.Copy()
SEND_SIGNAL(src, COMSIG_TRY_STORAGE_QUICK_EMPTY)
// Make each item scatter a bit
for(var/obj/item/I in oldContents)
spawn()
for(var/i = 1, i <= rand(1,2), i++)
if(I)
step(I, pick(NORTH,SOUTH,EAST,WEST))
sleep(rand(2,4))
if(prob(50))
playsound(M, 'sound/items/trayhit1.ogg', 50, 1)
else
playsound(M, 'sound/items/trayhit2.ogg', 50, 1)
if(ishuman(M) || ismonkey(M))
if(prob(10))
M.Knockdown(40)
update_icon()
/obj/item/storage/bag/tray/update_icon()
cut_overlays()
for(var/obj/item/I in contents)
add_overlay(new /mutable_appearance(I))
/obj/item/storage/bag/tray/Entered()
. = ..()
update_icon()
/obj/item/storage/bag/tray/Exited()
. = ..()
update_icon()
/*
* Chemistry bag
*/
/obj/item/storage/bag/chemistry
name = "chemistry bag"
icon = 'icons/obj/chemical.dmi'
icon_state = "bag"
desc = "A bag for storing pills, patches, and bottles."
w_class = WEIGHT_CLASS_TINY
resistance_flags = FLAMMABLE
/obj/item/storage/bag/chemistry/ComponentInitialize()
. = ..()
var/datum/component/storage/STR = GetComponent(/datum/component/storage)
STR.max_combined_w_class = 200
STR.max_items = 50
STR.insert_preposition = "in"
STR.can_hold = typecacheof(list(/obj/item/reagent_containers/pill, /obj/item/reagent_containers/glass/beaker, /obj/item/reagent_containers/glass/bottle, /obj/item/reagent_containers/syringe/dart))
/*
* Biowaste bag (mostly for xenobiologists)
*/
/obj/item/storage/bag/bio
name = "bio bag"
icon = 'icons/obj/chemical.dmi'
icon_state = "biobag"
desc = "A bag for the safe transportation and disposal of biowaste and other biological materials."
w_class = WEIGHT_CLASS_TINY
resistance_flags = FLAMMABLE
/obj/item/storage/bag/bio/ComponentInitialize()
. = ..()
var/datum/component/storage/STR = GetComponent(/datum/component/storage)
STR.max_combined_w_class = 200
STR.max_items = 25
STR.insert_preposition = "in"
STR.can_hold = typecacheof(list(/obj/item/slime_extract, /obj/item/reagent_containers/syringe, /obj/item/reagent_containers/glass/beaker, /obj/item/reagent_containers/glass/bottle, /obj/item/reagent_containers/blood, /obj/item/reagent_containers/hypospray/medipen, /obj/item/reagent_containers/food/snacks/deadmouse, /obj/item/reagent_containers/food/snacks/monkeycube))
/obj/item/storage/bag/bio/holding
name = "bio bag of holding"
icon = 'icons/obj/chemical.dmi'
icon_state = "bspace_biobag"
desc = "A bag for the safe transportation and disposal of biowaste and other biological materials."
rad_flags = RAD_PROTECT_CONTENTS | RAD_NO_CONTAMINATE
/obj/item/storage/bag/bio/holding/ComponentInitialize()
. = ..()
var/datum/component/storage/STR = GetComponent(/datum/component/storage)
STR.max_combined_w_class = INFINITY
STR.max_items = 100
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+115 -115
View File
@@ -1,115 +1,115 @@
/obj/item/storage/briefcase
name = "briefcase"
desc = "It's made of AUTHENTIC faux-leather and has a price-tag still attached. Its owner must be a real professional."
icon_state = "briefcase"
lefthand_file = 'icons/mob/inhands/equipment/briefcase_lefthand.dmi'
righthand_file = 'icons/mob/inhands/equipment/briefcase_righthand.dmi'
flags_1 = CONDUCT_1
force = 8
hitsound = "swing_hit"
throw_speed = 2
throw_range = 4
w_class = WEIGHT_CLASS_BULKY
attack_verb = list("bashed", "battered", "bludgeoned", "thrashed", "whacked")
resistance_flags = FLAMMABLE
max_integrity = 150
var/folder_path = /obj/item/folder //this is the path of the folder that gets spawned in New()
/obj/item/storage/briefcase/ComponentInitialize()
. = ..()
var/datum/component/storage/STR = GetComponent(/datum/component/storage)
STR.max_w_class = WEIGHT_CLASS_NORMAL
STR.max_combined_w_class = 21
/obj/item/storage/briefcase/PopulateContents()
new /obj/item/pen(src)
var/obj/item/folder/folder = new folder_path(src)
for(var/i in 1 to 6)
new /obj/item/paper(folder)
/obj/item/storage/briefcase/crafted
desc = "Hand crafted suitcase made of leather and cloth."
force = 6
max_integrity = 50
/obj/item/storage/briefcase/crafted/PopulateContents()
return //So we dont spawn items
/obj/item/storage/briefcase/lawyer
folder_path = /obj/item/folder/blue
/obj/item/storage/briefcase/lawyer/family
name = "battered briefcase"
icon_state = "gbriefcase"
lefthand_file = 'icons/mob/inhands/equipment/briefcase_lefthand.dmi'
righthand_file = 'icons/mob/inhands/equipment/briefcase_righthand.dmi'
desc = "An old briefcase with a golden trim. It's clear they don't make them as good as they used to. Comes with an added belt clip!"
slot_flags = ITEM_SLOT_BELT
/obj/item/storage/briefcase/lawyer/family/ComponentInitialize()
. = ..()
var/datum/component/storage/STR = GetComponent(/datum/component/storage)
STR.max_w_class = WEIGHT_CLASS_NORMAL
STR.max_combined_w_class = 14
/obj/item/storage/briefcase/lawyer/family/PopulateContents()
new /obj/item/stamp/law(src)
new /obj/item/pen/fountain(src)
new /obj/item/paper_bin(src)
new /obj/item/storage/box/evidence(src)
new /obj/item/storage/box/lawyer(src)
/obj/item/storage/box/lawyer
name = "Box of lawyer tools"
desc = "A custom made box, full of items used by a Lawyer, all packed into one box!"
/obj/item/storage/box/lawyer/PopulateContents()
new /obj/item/clothing/gloves/color/white(src)
new /obj/item/folder/white(src)
new /obj/item/clothing/glasses/regular(src)
new /obj/item/folder/red(src)
new /obj/item/gavelhammer(src)
new /obj/item/stack/sheet/cloth(src)
new /obj/item/reagent_containers/glass/beaker/waterbottle(src)
/obj/item/storage/briefcase/lawyer/PopulateContents()
new /obj/item/stamp/law(src)
..()
/obj/item/storage/briefcase/sniperbundle
desc = "Its label reads \"genuine hardened Captain leather\", but suspiciously has no other tags or branding. Smells like L'Air du Temps."
force = 10
/obj/item/storage/briefcase/sniperbundle/PopulateContents()
..() // in case you need any paperwork done after your rampage
new /obj/item/gun/ballistic/automatic/sniper_rifle/syndicate(src)
new /obj/item/clothing/neck/tie/red(src)
new /obj/item/clothing/under/syndicate/sniper(src)
new /obj/item/ammo_box/magazine/sniper_rounds/soporific(src)
new /obj/item/ammo_box/magazine/sniper_rounds/soporific(src)
new /obj/item/suppressor/specialoffer(src)
/obj/item/storage/briefcase/modularbundle
desc = "Its label reads \"genuine hardened Captain leather\", but suspiciously has no other tags or branding."
force = 10
/obj/item/storage/briefcase/modularbundle/PopulateContents()
new /obj/item/gun/ballistic/automatic/pistol/modular(src)
new /obj/item/suppressor(src)
new /obj/item/ammo_box/magazine/m10mm(src)
new /obj/item/ammo_box/magazine/m10mm/soporific(src)
new /obj/item/ammo_box/c10mm/soporific(src)
new /obj/item/clothing/under/lawyer/blacksuit(src)
new /obj/item/clothing/accessory/waistcoat(src)
new /obj/item/clothing/suit/toggle/lawyer/black/syndie(src)
/obj/item/storage/briefcase/medical
name = "medical briefcase"
icon_state = "medbriefcase"
desc = "A white with a blue cross brieface, this is ment to hold medical gear that would not be able to normally fit in a bag."
/obj/item/storage/briefcase/medical/PopulateContents()
new /obj/item/clothing/neck/stethoscope(src)
new /obj/item/healthanalyzer(src)
..() //In case of paperwork
/obj/item/storage/briefcase
name = "briefcase"
desc = "It's made of AUTHENTIC faux-leather and has a price-tag still attached. Its owner must be a real professional."
icon_state = "briefcase"
lefthand_file = 'icons/mob/inhands/equipment/briefcase_lefthand.dmi'
righthand_file = 'icons/mob/inhands/equipment/briefcase_righthand.dmi'
flags_1 = CONDUCT_1
force = 8
hitsound = "swing_hit"
throw_speed = 2
throw_range = 4
w_class = WEIGHT_CLASS_BULKY
attack_verb = list("bashed", "battered", "bludgeoned", "thrashed", "whacked")
resistance_flags = FLAMMABLE
max_integrity = 150
var/folder_path = /obj/item/folder //this is the path of the folder that gets spawned in New()
/obj/item/storage/briefcase/ComponentInitialize()
. = ..()
var/datum/component/storage/STR = GetComponent(/datum/component/storage)
STR.max_w_class = WEIGHT_CLASS_NORMAL
STR.max_combined_w_class = 21
/obj/item/storage/briefcase/PopulateContents()
new /obj/item/pen(src)
var/obj/item/folder/folder = new folder_path(src)
for(var/i in 1 to 6)
new /obj/item/paper(folder)
/obj/item/storage/briefcase/crafted
desc = "Hand crafted suitcase made of leather and cloth."
force = 6
max_integrity = 50
/obj/item/storage/briefcase/crafted/PopulateContents()
return //So we dont spawn items
/obj/item/storage/briefcase/lawyer
folder_path = /obj/item/folder/blue
/obj/item/storage/briefcase/lawyer/family
name = "battered briefcase"
icon_state = "gbriefcase"
lefthand_file = 'icons/mob/inhands/equipment/briefcase_lefthand.dmi'
righthand_file = 'icons/mob/inhands/equipment/briefcase_righthand.dmi'
desc = "An old briefcase with a golden trim. It's clear they don't make them as good as they used to. Comes with an added belt clip!"
slot_flags = ITEM_SLOT_BELT
/obj/item/storage/briefcase/lawyer/family/ComponentInitialize()
. = ..()
var/datum/component/storage/STR = GetComponent(/datum/component/storage)
STR.max_w_class = WEIGHT_CLASS_NORMAL
STR.max_combined_w_class = 14
/obj/item/storage/briefcase/lawyer/family/PopulateContents()
new /obj/item/stamp/law(src)
new /obj/item/pen/fountain(src)
new /obj/item/paper_bin(src)
new /obj/item/storage/box/evidence(src)
new /obj/item/storage/box/lawyer(src)
/obj/item/storage/box/lawyer
name = "Box of lawyer tools"
desc = "A custom made box, full of items used by a Lawyer, all packed into one box!"
/obj/item/storage/box/lawyer/PopulateContents()
new /obj/item/clothing/gloves/color/white(src)
new /obj/item/folder/white(src)
new /obj/item/clothing/glasses/regular(src)
new /obj/item/folder/red(src)
new /obj/item/gavelhammer(src)
new /obj/item/stack/sheet/cloth(src)
new /obj/item/reagent_containers/glass/beaker/waterbottle(src)
/obj/item/storage/briefcase/lawyer/PopulateContents()
new /obj/item/stamp/law(src)
..()
/obj/item/storage/briefcase/sniperbundle
desc = "Its label reads \"genuine hardened Captain leather\", but suspiciously has no other tags or branding. Smells like L'Air du Temps."
force = 10
/obj/item/storage/briefcase/sniperbundle/PopulateContents()
..() // in case you need any paperwork done after your rampage
new /obj/item/gun/ballistic/automatic/sniper_rifle/syndicate(src)
new /obj/item/clothing/neck/tie/red(src)
new /obj/item/clothing/under/syndicate/sniper(src)
new /obj/item/ammo_box/magazine/sniper_rounds/soporific(src)
new /obj/item/ammo_box/magazine/sniper_rounds/soporific(src)
new /obj/item/suppressor/specialoffer(src)
/obj/item/storage/briefcase/modularbundle
desc = "Its label reads \"genuine hardened Captain leather\", but suspiciously has no other tags or branding."
force = 10
/obj/item/storage/briefcase/modularbundle/PopulateContents()
new /obj/item/gun/ballistic/automatic/pistol/modular(src)
new /obj/item/suppressor(src)
new /obj/item/ammo_box/magazine/m10mm(src)
new /obj/item/ammo_box/magazine/m10mm/soporific(src)
new /obj/item/ammo_box/c10mm/soporific(src)
new /obj/item/clothing/under/lawyer/blacksuit(src)
new /obj/item/clothing/accessory/waistcoat(src)
new /obj/item/clothing/suit/toggle/lawyer/black/syndie(src)
/obj/item/storage/briefcase/medical
name = "medical briefcase"
icon_state = "medbriefcase"
desc = "A white with a blue cross brieface, this is ment to hold medical gear that would not be able to normally fit in a bag."
/obj/item/storage/briefcase/medical/PopulateContents()
new /obj/item/clothing/neck/stethoscope(src)
new /obj/item/healthanalyzer(src)
..() //In case of paperwork

Some files were not shown because too many files have changed in this diff Show More