Merge remote-tracking branch 'upstream/master' into AnPrimAssistants
This commit is contained in:
@@ -281,7 +281,6 @@ GLOBAL_LIST_EMPTY(antagonists)
|
||||
. = CONFIG_GET(keyed_list/antag_threat)[lowertext(name)]
|
||||
if(. == null)
|
||||
return threat
|
||||
return threat
|
||||
|
||||
//This one is created by admin tools for custom objectives
|
||||
/datum/antagonist/custom
|
||||
|
||||
@@ -4,11 +4,17 @@
|
||||
antagpanel_category = "Blob"
|
||||
show_to_ghosts = TRUE
|
||||
job_rank = ROLE_BLOB
|
||||
threat = 20
|
||||
threat = 50
|
||||
var/datum/action/innate/blobpop/pop_action
|
||||
var/starting_points_human_blob = 60
|
||||
var/point_rate_human_blob = 2
|
||||
|
||||
/datum/antagonist/blob/threat()
|
||||
. = ..()
|
||||
if(isovermind(owner.current))
|
||||
var/mob/camera/blob/overmind = owner.current
|
||||
. *= (overmind.blobs_legit.len / overmind.max_count)
|
||||
|
||||
/datum/antagonist/blob/roundend_report()
|
||||
var/basic_report = ..()
|
||||
//Display max blobpoints for blebs that lost
|
||||
|
||||
@@ -75,7 +75,6 @@
|
||||
desc = "A floating, fragile spore."
|
||||
icon_state = "blobpod"
|
||||
icon_living = "blobpod"
|
||||
threat = 0.2
|
||||
health = 30
|
||||
maxHealth = 30
|
||||
verb_say = "psychically pulses"
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
unique_name = 1
|
||||
minbodytemp = 0
|
||||
unsuitable_atmos_damage = 0
|
||||
threat = 1
|
||||
atmos_requirements = list("min_oxy" = 0, "max_oxy" = 0, "min_tox" = 0, "max_tox" = 0, "min_co2" = 0, "max_co2" = 0, "min_n2" = 0, "max_n2" = 0) //Robotic
|
||||
damage_coeff = list(BRUTE = 1, BURN = 1, TOX = 0, CLONE = 0, STAMINA = 0, OXY = 0)
|
||||
healable = FALSE
|
||||
|
||||
@@ -9,7 +9,6 @@
|
||||
desc = "The stalwart apparition of a soldier, blazing with crimson flames. It's armed with a gladius and shield."
|
||||
icon_state = "clockwork_marauder"
|
||||
mob_biotypes = MOB_HUMANOID
|
||||
threat = 3
|
||||
health = 120
|
||||
maxHealth = 120
|
||||
force_threshold = 8
|
||||
|
||||
@@ -70,7 +70,6 @@
|
||||
icon_living = "swarmer"
|
||||
icon_dead = "swarmer_unactivated"
|
||||
icon_gib = null
|
||||
threat = 0.5
|
||||
wander = 0
|
||||
harm_intent_damage = 5
|
||||
minbodytemp = 0
|
||||
|
||||
@@ -16,6 +16,18 @@
|
||||
var/datum/team/xeno/xeno_team
|
||||
threat = 3
|
||||
|
||||
/datum/antagonist/xeno/threat()
|
||||
. = 1
|
||||
if(isalienhunter(owner))
|
||||
. = 2
|
||||
else if(isaliensentinel(owner))
|
||||
. = 4
|
||||
else if(isalienroyal(owner))
|
||||
if(isalienqueen(owner))
|
||||
. = 8
|
||||
else
|
||||
. = 6
|
||||
|
||||
/datum/antagonist/xeno/create_team(datum/team/xeno/new_team)
|
||||
if(!new_team)
|
||||
for(var/datum/antagonist/xeno/X in GLOB.antagonists)
|
||||
|
||||
@@ -264,7 +264,7 @@
|
||||
name = "pipes"
|
||||
|
||||
/datum/asset/spritesheet/pipes/register()
|
||||
for (var/each in list('icons/obj/atmospherics/pipes/pipe_item.dmi', 'icons/obj/atmospherics/pipes/disposal.dmi'))
|
||||
for (var/each in list('icons/obj/atmospherics/pipes/pipe_item.dmi', 'icons/obj/atmospherics/pipes/disposal.dmi', 'icons/obj/atmospherics/pipes/transit_tube.dmi', 'icons/obj/plumbing/fluid_ducts.dmi'))
|
||||
InsertAll("", each, GLOB.alldirs)
|
||||
..()
|
||||
|
||||
@@ -388,9 +388,11 @@
|
||||
Insert("polycrystal", 'icons/obj/telescience.dmi', "polycrystal")
|
||||
..()
|
||||
|
||||
|
||||
/datum/asset/spritesheet/mafia
|
||||
name = "mafia"
|
||||
|
||||
/datum/asset/spritesheet/mafia/register()
|
||||
InsertAll("", 'icons/obj/mafia.dmi')
|
||||
..()
|
||||
|
||||
|
||||
@@ -118,8 +118,7 @@
|
||||
|
||||
// Set the clothing's integrity back to 100%, remove all damage to bodyparts, and generally fix it up
|
||||
/obj/item/clothing/proc/repair(mob/user, params)
|
||||
damaged_clothes = CLOTHING_PRISTINE
|
||||
update_clothes_damaged_state(FALSE)
|
||||
update_clothes_damaged_state(CLOTHING_PRISTINE)
|
||||
obj_integrity = max_integrity
|
||||
name = initial(name) // remove "tattered" or "shredded" if there's a prefix
|
||||
body_parts_covered = initial(body_parts_covered)
|
||||
@@ -196,7 +195,7 @@
|
||||
if(3 to INFINITY) // take better care of your shit, dude
|
||||
name = "tattered [initial(name)]"
|
||||
|
||||
update_clothes_damaged_state()
|
||||
update_clothes_damaged_state(CLOTHING_DAMAGED)
|
||||
|
||||
/obj/item/clothing/Destroy()
|
||||
user_vars_remembered = null //Oh god somebody put REFERENCES in here? not to worry, we'll clean it up
|
||||
@@ -257,7 +256,7 @@
|
||||
how_cool_are_your_threads += "Adding or removing items from [src] makes no noise.\n"
|
||||
how_cool_are_your_threads += "</span>"
|
||||
. += how_cool_are_your_threads.Join()
|
||||
|
||||
|
||||
if(LAZYLEN(armor_list))
|
||||
armor_list.Cut()
|
||||
if(armor.bio)
|
||||
@@ -346,10 +345,16 @@
|
||||
var/mob/M = loc
|
||||
to_chat(M, "<span class='warning'>Your [name] starts to fall apart!</span>")
|
||||
|
||||
/obj/item/clothing/proc/update_clothes_damaged_state(damaging = TRUE)
|
||||
var/index = "[REF(initial(icon))]-[initial(icon_state)]"
|
||||
var/static/list/damaged_clothes_icons = list()
|
||||
if(damaging)
|
||||
//This mostly exists so subtypes can call appriopriate update icon calls on the wearer.
|
||||
/obj/item/clothing/proc/update_clothes_damaged_state(damaged_state = CLOTHING_DAMAGED)
|
||||
damaged_clothes = damaged_state
|
||||
update_icon()
|
||||
|
||||
/obj/item/clothing/update_overlays()
|
||||
. = ..()
|
||||
if(damaged_clothes)
|
||||
var/index = "[REF(initial(icon))]-[initial(icon_state)]"
|
||||
var/static/list/damaged_clothes_icons = list()
|
||||
var/icon/damaged_clothes_icon = damaged_clothes_icons[index]
|
||||
if(!damaged_clothes_icon)
|
||||
damaged_clothes_icon = icon(initial(icon), initial(icon_state), , 1) //we only want to apply damaged effect to the initial icon_state for each object
|
||||
@@ -357,9 +362,7 @@
|
||||
damaged_clothes_icon.Blend(icon('icons/effects/item_damage.dmi', "itemdamaged"), ICON_MULTIPLY) //adds damage effect and the remaining white areas become transparant
|
||||
damaged_clothes_icon = fcopy_rsc(damaged_clothes_icon)
|
||||
damaged_clothes_icons[index] = damaged_clothes_icon
|
||||
add_overlay(damaged_clothes_icon, TRUE)
|
||||
else
|
||||
cut_overlay(damaged_clothes_icons[index], TRUE)
|
||||
. += damaged_clothes_icon
|
||||
|
||||
/*
|
||||
SEE_SELF // can see self, no matter what
|
||||
|
||||
@@ -12,6 +12,10 @@
|
||||
/obj/item/clothing/mask/balaclava/attack_self(mob/user)
|
||||
adjustmask(user)
|
||||
|
||||
/obj/item/clothing/mask/balaclava/breath
|
||||
name = "breathaclava"
|
||||
clothing_flags = ALLOWINTERNALS
|
||||
|
||||
/obj/item/clothing/mask/infiltrator
|
||||
name = "insidious balaclava"
|
||||
desc = "An incredibly suspicious balaclava made with Syndicate nanofibers to absorb impacts slightly while obfuscating the voice and face using a garbled vocoder."
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
typepath = /datum/round_event/ghost_role/alien_infestation
|
||||
weight = 5
|
||||
gamemode_blacklist = list("dynamic")
|
||||
min_players = 10
|
||||
min_players = 25
|
||||
max_occurrences = 1
|
||||
|
||||
/datum/round_event/ghost_role/alien_infestation
|
||||
|
||||
@@ -27,7 +27,6 @@
|
||||
"How do I vore people?",
|
||||
"ERP?",
|
||||
"Not epic bros...")
|
||||
threat = 5
|
||||
|
||||
|
||||
/datum/round_event/brand_intelligence/announce(fake)
|
||||
|
||||
@@ -30,7 +30,6 @@
|
||||
icon_dead = "magicarp_dead"
|
||||
icon_gib = "magicarp_gib"
|
||||
ranged = 1
|
||||
threat = 4
|
||||
retreat_distance = 2
|
||||
minimum_distance = 0 //Between shots they can and will close in to nash
|
||||
projectiletype = /obj/item/projectile/magic
|
||||
@@ -52,7 +51,6 @@
|
||||
color = "#00FFFF"
|
||||
maxHealth = 75
|
||||
health = 75
|
||||
threat = 7
|
||||
|
||||
/mob/living/simple_animal/hostile/carp/ranged/chaos/Shoot()
|
||||
projectiletype = pick(allowed_projectile_types)
|
||||
|
||||
@@ -190,7 +190,6 @@
|
||||
icon_dead = "scary_clown"
|
||||
icon_gib = "scary_clown"
|
||||
speak = list("...", ". . .")
|
||||
threat = 3
|
||||
maxHealth = 120
|
||||
health = 120
|
||||
emote_see = list("silently stares")
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
var/self_sufficiency_req = 20 //Required total dose to make a self-sufficient hydro tray. 1:1 with earthsblood.
|
||||
var/self_sufficiency_progress = 0
|
||||
var/self_sustaining = FALSE //If the tray generates nutrients and water on its own
|
||||
|
||||
var/canirrigate = TRUE //tin
|
||||
|
||||
/obj/machinery/hydroponics/constructable
|
||||
name = "hydroponics tray"
|
||||
@@ -847,12 +847,13 @@
|
||||
if (!anchored)
|
||||
to_chat(user, "<span class='warning'>Anchor the tray first!</span>")
|
||||
return
|
||||
using_irrigation = !using_irrigation
|
||||
O.play_tool_sound(src)
|
||||
user.visible_message("<span class='notice'>[user] [using_irrigation ? "" : "dis"]connects [src]'s irrigation hoses.</span>", \
|
||||
"<span class='notice'>You [using_irrigation ? "" : "dis"]connect [src]'s irrigation hoses.</span>")
|
||||
for(var/obj/machinery/hydroponics/h in range(1,src))
|
||||
h.update_icon()
|
||||
if(canirrigate)
|
||||
using_irrigation = !using_irrigation
|
||||
O.play_tool_sound(src)
|
||||
user.visible_message("<span class='notice'>[user] [using_irrigation ? "" : "dis"]connects [src]'s irrigation hoses.</span>", \
|
||||
"<span class='notice'>You [using_irrigation ? "" : "dis"]connect [src]'s irrigation hoses.</span>")
|
||||
for(var/obj/machinery/hydroponics/h in range(1,src))
|
||||
h.update_icon()
|
||||
|
||||
else if(istype(O, /obj/item/shovel/spade))
|
||||
if(!myseed && !weedlevel)
|
||||
@@ -910,11 +911,14 @@
|
||||
harvest = 0
|
||||
lastproduce = age
|
||||
if(istype(myseed, /obj/item/seeds/replicapod))
|
||||
to_chat(user, "<span class='notice'>You harvest from the [myseed.plantname].</span>")
|
||||
if(user)//runtimes
|
||||
to_chat(user, "<span class='notice'>You harvest from the [myseed.plantname].</span>")
|
||||
else if(myseed.getYield() <= 0)
|
||||
to_chat(user, "<span class='warning'>You fail to harvest anything useful!</span>")
|
||||
if(user)
|
||||
to_chat(user, "<span class='warning'>You fail to harvest anything useful!</span>")
|
||||
else
|
||||
to_chat(user, "<span class='notice'>You harvest [myseed.getYield()] items from the [myseed.plantname].</span>")
|
||||
if(user)
|
||||
to_chat(user, "<span class='notice'>You harvest [myseed.getYield()] items from the [myseed.plantname].</span>")
|
||||
if(!myseed.get_gene(/datum/plant_gene/trait/repeated_harvest))
|
||||
qdel(myseed)
|
||||
myseed = null
|
||||
|
||||
@@ -190,6 +190,31 @@ obj/item/seeds/proc/is_gene_forbidden(typepath)
|
||||
parent.update_tray(user)
|
||||
return result
|
||||
|
||||
/obj/item/seeds/proc/harvest_userless()
|
||||
var/obj/machinery/hydroponics/parent = loc //for ease of access
|
||||
var/t_amount = 0
|
||||
var/list/result = list()
|
||||
var/output_loc = parent.loc
|
||||
var/product_name
|
||||
while(t_amount < getYield())
|
||||
var/obj/item/reagent_containers/food/snacks/grown/t_prod = new product(output_loc, src)
|
||||
if(parent.myseed.plantname != initial(parent.myseed.plantname))
|
||||
t_prod.name = lowertext(parent.myseed.plantname)
|
||||
if(productdesc)
|
||||
t_prod.desc = productdesc
|
||||
t_prod.seed.name = parent.myseed.name
|
||||
t_prod.seed.desc = parent.myseed.desc
|
||||
t_prod.seed.plantname = parent.myseed.plantname
|
||||
result.Add(t_prod) // User gets a consumable
|
||||
if(!t_prod)
|
||||
return
|
||||
t_amount++
|
||||
product_name = parent.myseed.plantname
|
||||
if(getYield() >= 1)
|
||||
SSblackbox.record_feedback("tally", "food_harvested", getYield(), product_name)
|
||||
parent.investigate_log("autmoatic harvest of [getYield()] of [src], with seed traits [english_list(genes)] and reagents_add [english_list(reagents_add)] and potency [potency].", INVESTIGATE_BOTANY)
|
||||
parent.update_tray()
|
||||
return result
|
||||
|
||||
/obj/item/seeds/proc/prepare_result(var/obj/item/reagent_containers/food/snacks/grown/T)
|
||||
if(!T.reagents)
|
||||
|
||||
@@ -157,7 +157,7 @@
|
||||
/datum/sprite_accessory/snouts/mam_snouts
|
||||
color_src = MATRIXED
|
||||
icon = 'modular_citadel/icons/mob/mam_snouts.dmi'
|
||||
recommended_species = list("mammal", "slimeperson", "insect", "podweak")
|
||||
recommended_species = list("mammal", "slimeperson", "insect", "podweak", "lizard")
|
||||
mutant_part_string = "snout"
|
||||
relevant_layers = list(BODY_ADJ_LAYER, BODY_FRONT_LAYER)
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ INITIALIZE_IMMEDIATE(/mob/living/carbon/human/dummy)
|
||||
/mob/living/carbon/human/dummy/proc/wipe_state()
|
||||
delete_equipment()
|
||||
icon_render_key = null
|
||||
cut_overlays(TRUE)
|
||||
cut_overlays()
|
||||
|
||||
//Inefficient pooling/caching way.
|
||||
GLOBAL_LIST_EMPTY(human_dummy_list)
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
say_mod = "hisses"
|
||||
default_color = "00FF00"
|
||||
species_traits = list(MUTCOLORS,EYECOLOR,HAIR,FACEHAIR,LIPS,HORNCOLOR,WINGCOLOR,HAS_FLESH,HAS_BONE)
|
||||
mutant_bodyparts = list("tail_lizard", "snout", "spines", "horns", "frills", "body_markings", "legs", "taur", "deco_wings")
|
||||
inherent_biotypes = MOB_ORGANIC|MOB_HUMANOID|MOB_REPTILE
|
||||
mutanttongue = /obj/item/organ/tongue/lizard
|
||||
mutanttail = /obj/item/organ/tail/lizard
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
response_disarm_simple = "flail at"
|
||||
response_harm_continuous = "punches"
|
||||
response_harm_simple = "punch"
|
||||
threat = 1
|
||||
speak_chance = 1
|
||||
icon = 'icons/mob/mob.dmi'
|
||||
speed = 0
|
||||
@@ -122,7 +121,6 @@
|
||||
desc = "A massive, armored construct built to spearhead attacks and soak up enemy fire."
|
||||
icon_state = "behemoth"
|
||||
icon_living = "behemoth"
|
||||
threat = 3
|
||||
maxHealth = 150
|
||||
health = 150
|
||||
response_harm_continuous = "harmlessly punches"
|
||||
@@ -187,7 +185,6 @@
|
||||
desc = "A wicked, clawed shell constructed to assassinate enemies and sow chaos behind enemy lines."
|
||||
icon_state = "floating"
|
||||
icon_living = "floating"
|
||||
threat = 3
|
||||
maxHealth = 65
|
||||
health = 65
|
||||
melee_damage_lower = 20
|
||||
|
||||
@@ -58,7 +58,7 @@
|
||||
eyes_overlay.pixel_y = -8
|
||||
moustache_overlay.pixel_y = -8
|
||||
|
||||
cut_overlays(TRUE)
|
||||
cut_overlays()
|
||||
add_overlay(body_overlay)
|
||||
add_overlay(eyes_overlay)
|
||||
add_overlay(moustache_overlay)
|
||||
|
||||
@@ -8,7 +8,6 @@ GLOBAL_LIST_EMPTY(parasites) //all currently existing/living guardians
|
||||
name = "Guardian Spirit"
|
||||
real_name = "Guardian Spirit"
|
||||
desc = "A mysterious being that stands by its charge, ever vigilant."
|
||||
threat = 5
|
||||
speak_emote = list("hisses")
|
||||
gender = NEUTER
|
||||
mob_biotypes = NONE
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
icon_dead = "alienh_dead"
|
||||
icon_gib = "syndicate_gib"
|
||||
gender = FEMALE
|
||||
threat = 1
|
||||
response_help_continuous = "pokes"
|
||||
response_help_simple = "poke"
|
||||
response_disarm_continuous = "shoves"
|
||||
@@ -69,7 +68,6 @@
|
||||
icon_state = "aliens"
|
||||
icon_living = "aliens"
|
||||
icon_dead = "aliens_dead"
|
||||
threat = 3
|
||||
health = 150
|
||||
maxHealth = 150
|
||||
melee_damage_lower = 15
|
||||
@@ -87,7 +85,6 @@
|
||||
icon_living = "alienq"
|
||||
icon_dead = "alienq_dead"
|
||||
pixel_x = -16
|
||||
threat = 8
|
||||
health = 250
|
||||
maxHealth = 250
|
||||
melee_damage_lower = 15
|
||||
@@ -167,7 +164,6 @@
|
||||
name = "lusty xenomorph maid"
|
||||
melee_damage_lower = 0
|
||||
melee_damage_upper = 0
|
||||
threat = -1
|
||||
a_intent = INTENT_HELP
|
||||
friendly_verb_continuous = "caresses"
|
||||
friendly_verb_simple = "caress"
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
/mob/living/simple_animal/hostile/bear
|
||||
name = "space bear"
|
||||
desc = "You don't need to be faster than a space bear, you just need to outrun your crewmates."
|
||||
threat = 1
|
||||
icon_state = "bear"
|
||||
icon_living = "bear"
|
||||
icon_dead = "bear_dead"
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
icon_state = ""
|
||||
icon_living = ""
|
||||
icon = 'icons/mob/bees.dmi'
|
||||
threat = 0.3
|
||||
gender = FEMALE
|
||||
speak_emote = list("buzzes")
|
||||
emote_hear = list("buzzes")
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
/mob/living/simple_animal/hostile/boss
|
||||
name = "A Perfectly Generic Boss Placeholder"
|
||||
desc = ""
|
||||
threat = 10
|
||||
robust_searching = TRUE
|
||||
stat_attack = UNCONSCIOUS
|
||||
status_flags = NONE
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
icon_living = "carp"
|
||||
icon_dead = "carp_dead"
|
||||
icon_gib = "carp_gib"
|
||||
threat = 0.1
|
||||
mob_biotypes = MOB_ORGANIC|MOB_BEAST
|
||||
speak_chance = 0
|
||||
turns_per_move = 5
|
||||
@@ -74,7 +73,6 @@
|
||||
icon_living = "megacarp"
|
||||
icon_dead = "megacarp_dead"
|
||||
icon_gib = "megacarp_gib"
|
||||
threat = 3
|
||||
regen_amount = 6
|
||||
|
||||
maxHealth = 30
|
||||
@@ -98,7 +96,6 @@
|
||||
name = "Cayenne"
|
||||
desc = "A failed Syndicate experiment in weaponized space carp technology, it now serves as a lovable mascot."
|
||||
gender = FEMALE
|
||||
threat = 5
|
||||
regen_amount = 8
|
||||
|
||||
speak_emote = list("squeaks")
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
/mob/living/simple_animal/hostile/dark_wizard
|
||||
name = "Dark Wizard"
|
||||
desc = "Killing amateurs since the dawn of times."
|
||||
threat = 3
|
||||
icon = 'icons/mob/simple_human.dmi'
|
||||
icon_state = "dark_wizard"
|
||||
icon_living = "dark_wizard"
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
icon_state = "faithless"
|
||||
icon_living = "faithless"
|
||||
icon_dead = "faithless_dead"
|
||||
threat = 1
|
||||
mob_biotypes = MOB_ORGANIC|MOB_HUMANOID
|
||||
gender = MALE
|
||||
speak_chance = 0
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
|
||||
//basic spider mob, these generally guard nests
|
||||
/mob/living/simple_animal/hostile/poison/giant_spider
|
||||
threat = 1
|
||||
name = "giant spider"
|
||||
desc = "Furry and black, it makes you shudder to look at it. This one has deep red eyes."
|
||||
icon_state = "guard"
|
||||
|
||||
@@ -9,7 +9,6 @@
|
||||
icon_state = "crawling"
|
||||
icon_living = "crawling"
|
||||
icon_dead = "dead"
|
||||
threat = 0.5
|
||||
mob_biotypes = MOB_ORGANIC|MOB_HUMANOID
|
||||
speak_chance = 80
|
||||
maxHealth = 220
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
icon_state = "headcrab"
|
||||
icon_living = "headcrab"
|
||||
icon_dead = "headcrab_dead"
|
||||
threat = 1
|
||||
gender = NEUTER
|
||||
health = 50
|
||||
maxHealth = 50
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
stop_automated_movement_when_pulled = 0
|
||||
obj_damage = 40
|
||||
environment_smash = ENVIRONMENT_SMASH_STRUCTURES //Bitflags. Set to ENVIRONMENT_SMASH_STRUCTURES to break closets,tables,racks, etc; ENVIRONMENT_SMASH_WALLS for walls; ENVIRONMENT_SMASH_RWALLS for rwalls
|
||||
var/threat = 0 // for dynamic
|
||||
var/atom/target
|
||||
var/ranged = FALSE
|
||||
var/rapid = 0 //How many shots per volley.
|
||||
@@ -600,6 +599,3 @@ mob/living/simple_animal/hostile/proc/DestroySurroundings() // for use with mega
|
||||
. += M
|
||||
else if (M.loc.type in hostile_machines)
|
||||
. += M.loc
|
||||
|
||||
/mob/living/simple_animal/hostile/proc/threat()
|
||||
return threat
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
icon_living = "leaper"
|
||||
icon_dead = "leaper_dead"
|
||||
mob_biotypes = MOB_ORGANIC|MOB_BEAST
|
||||
threat = 2
|
||||
maxHealth = 300
|
||||
health = 300
|
||||
ranged = TRUE
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
icon_living = "arachnid"
|
||||
icon_dead = "arachnid_dead"
|
||||
mob_biotypes = MOB_ORGANIC|MOB_BUG
|
||||
threat = 2
|
||||
melee_damage_lower = 30
|
||||
melee_damage_upper = 30
|
||||
maxHealth = 300
|
||||
|
||||
@@ -14,7 +14,6 @@
|
||||
icon_living = "mook"
|
||||
icon_dead = "mook_dead"
|
||||
mob_biotypes = MOB_ORGANIC|MOB_HUMANOID
|
||||
threat = 0.5
|
||||
pixel_x = -16
|
||||
maxHealth = 45
|
||||
health = 45
|
||||
|
||||
@@ -13,7 +13,6 @@
|
||||
icon_state = "seedling"
|
||||
icon_living = "seedling"
|
||||
icon_dead = "seedling_dead"
|
||||
threat = 0.5
|
||||
maxHealth = 100
|
||||
health = 100
|
||||
melee_damage_lower = 30
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
icon_living = "tomato"
|
||||
icon_dead = "tomato_dead"
|
||||
gender = NEUTER
|
||||
threat = 0.3
|
||||
speak_chance = 0
|
||||
turns_per_move = 5
|
||||
maxHealth = 30
|
||||
|
||||
@@ -23,7 +23,6 @@ Difficulty: Medium
|
||||
/mob/living/simple_animal/hostile/megafauna/blood_drunk_miner
|
||||
name = "blood-drunk miner"
|
||||
desc = "A miner destined to wander forever, engaged in an endless hunt."
|
||||
threat = 15
|
||||
health = 900
|
||||
maxHealth = 900
|
||||
icon_state = "miner"
|
||||
|
||||
@@ -26,7 +26,6 @@ Difficulty: Hard
|
||||
/mob/living/simple_animal/hostile/megafauna/bubblegum
|
||||
name = "bubblegum"
|
||||
desc = "In what passes for a hierarchy among slaughter demons, this one is king."
|
||||
threat = 35
|
||||
health = 2500
|
||||
maxHealth = 2500
|
||||
attack_verb_continuous = "rends"
|
||||
|
||||
@@ -24,7 +24,6 @@ Difficulty: Very Hard
|
||||
/mob/living/simple_animal/hostile/megafauna/colossus
|
||||
name = "colossus"
|
||||
desc = "A monstrous creature protected by heavy shielding."
|
||||
threat = 40
|
||||
health = 2500
|
||||
maxHealth = 2500
|
||||
attack_verb_continuous = "judges"
|
||||
@@ -603,7 +602,6 @@ Difficulty: Very Hard
|
||||
icon_state = "lightgeist"
|
||||
icon_living = "lightgeist"
|
||||
icon_dead = "butterfly_dead"
|
||||
threat = -0.7
|
||||
turns_per_move = 1
|
||||
response_help_continuous = "waves away"
|
||||
response_help_simple = "wave away"
|
||||
|
||||
@@ -38,7 +38,6 @@ Difficulty: Medium
|
||||
/mob/living/simple_animal/hostile/megafauna/dragon
|
||||
name = "ash drake"
|
||||
desc = "Guardians of the necropolis."
|
||||
threat = 30
|
||||
health = 2500
|
||||
maxHealth = 2500
|
||||
spacewalk = TRUE
|
||||
|
||||
@@ -37,7 +37,6 @@ Difficulty: Normal
|
||||
/mob/living/simple_animal/hostile/megafauna/hierophant
|
||||
name = "hierophant"
|
||||
desc = "A massive metal club that hangs in the air as though waiting. It'll make you dance to its beat."
|
||||
threat = 30
|
||||
health = 2500
|
||||
maxHealth = 2500
|
||||
attack_verb_continuous = "clubs"
|
||||
|
||||
@@ -18,7 +18,6 @@ Difficulty: Medium
|
||||
|
||||
/mob/living/simple_animal/hostile/megafauna/legion
|
||||
name = "Legion"
|
||||
threat = 30
|
||||
health = 800
|
||||
maxHealth = 800
|
||||
spacewalk = TRUE
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
icon_aggro = "Basilisk_alert"
|
||||
icon_dead = "Basilisk_dead"
|
||||
icon_gib = "syndicate_gib"
|
||||
threat = 4
|
||||
mob_biotypes = MOB_ORGANIC|MOB_BEAST
|
||||
move_to_delay = 20
|
||||
projectiletype = /obj/item/projectile/temp/basilisk
|
||||
|
||||
@@ -10,7 +10,6 @@
|
||||
move_to_delay = 5
|
||||
vision_range = 20
|
||||
aggro_vision_range = 20
|
||||
threat = 1
|
||||
maxHealth = 40 //easy to kill, but oh, will you be seeing a lot of them.
|
||||
health = 40
|
||||
melee_damage_lower = 10
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
robust_searching = TRUE
|
||||
ranged_ignores_vision = TRUE
|
||||
ranged = TRUE
|
||||
threat = 5
|
||||
obj_damage = 5
|
||||
vision_range = 6
|
||||
aggro_vision_range = 18
|
||||
|
||||
-1
@@ -25,7 +25,6 @@
|
||||
icon_aggro = "broodmother"
|
||||
icon_dead = "egg_sac"
|
||||
icon_gib = "syndicate_gib"
|
||||
threat = 10
|
||||
maxHealth = 800
|
||||
health = 800
|
||||
melee_damage_lower = 30
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
icon_aggro = "herald"
|
||||
icon_dead = "herald_dying"
|
||||
icon_gib = "syndicate_gib"
|
||||
threat = 10
|
||||
maxHealth = 800
|
||||
health = 800
|
||||
melee_damage_lower = 20
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
icon_aggro = "legionnaire"
|
||||
icon_dead = "legionnaire_dead"
|
||||
icon_gib = "syndicate_gib"
|
||||
threat = 10
|
||||
maxHealth = 800
|
||||
health = 800
|
||||
melee_damage_lower = 30
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
icon_aggro = "pandora"
|
||||
icon_dead = "pandora_dead"
|
||||
icon_gib = "syndicate_gib"
|
||||
threat = 10
|
||||
maxHealth = 800
|
||||
health = 800
|
||||
melee_damage_lower = 15
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
icon_aggro = "Goldgrub_alert"
|
||||
icon_dead = "Goldgrub_dead"
|
||||
icon_gib = "syndicate_gib"
|
||||
threat = 0.2
|
||||
mob_biotypes = MOB_ORGANIC|MOB_BEAST
|
||||
vision_range = 2
|
||||
aggro_vision_range = 9
|
||||
|
||||
@@ -10,7 +10,6 @@
|
||||
icon_gib = "syndicate_gib"
|
||||
mob_biotypes = MOB_ORGANIC|MOB_BEAST
|
||||
mouse_opacity = MOUSE_OPACITY_OPAQUE
|
||||
threat = 2
|
||||
move_to_delay = 10
|
||||
ranged = 1
|
||||
ranged_cooldown_time = 60
|
||||
|
||||
@@ -9,7 +9,6 @@
|
||||
icon_gib = "syndicate_gib"
|
||||
mob_biotypes = MOB_ORGANIC
|
||||
mouse_opacity = MOUSE_OPACITY_OPAQUE
|
||||
threat = 4
|
||||
move_to_delay = 14
|
||||
ranged = 1
|
||||
vision_range = 4
|
||||
@@ -241,7 +240,6 @@
|
||||
icon_state = "legion"
|
||||
icon_living = "legion"
|
||||
icon_dead = "legion"
|
||||
threat = 5
|
||||
health = 450
|
||||
maxHealth = 450
|
||||
melee_damage_lower = 20
|
||||
|
||||
@@ -10,7 +10,6 @@
|
||||
obj_damage = 100
|
||||
melee_damage_lower = 25
|
||||
melee_damage_upper = 50
|
||||
threat = 2
|
||||
attack_verb_continuous = "slashes"
|
||||
attack_verb_simple = "slash"
|
||||
attack_sound = 'sound/weapons/bladeslice.ogg'
|
||||
|
||||
@@ -10,7 +10,6 @@
|
||||
turns_per_move = 5
|
||||
response_help_continuous = "pushes"
|
||||
response_help_simple = "push"
|
||||
threat = 3
|
||||
speed = 0
|
||||
maxHealth = 115
|
||||
health = 115
|
||||
|
||||
@@ -10,7 +10,6 @@
|
||||
speak_chance = 0
|
||||
turns_per_move = 5
|
||||
speed = 0
|
||||
threat = 1
|
||||
maxHealth = 100
|
||||
health = 100
|
||||
harm_intent_damage = 5
|
||||
|
||||
@@ -19,7 +19,6 @@
|
||||
response_harm_continuous = "kicks"
|
||||
response_harm_simple = "kick"
|
||||
speed = 0
|
||||
threat = 1
|
||||
maxHealth = 75
|
||||
health = 75
|
||||
harm_intent_damage = 18
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
speak_emote = list("rattles")
|
||||
emote_see = list("rattles")
|
||||
a_intent = INTENT_HARM
|
||||
threat = 0.5
|
||||
maxHealth = 40
|
||||
blood_volume = 0
|
||||
health = 40
|
||||
@@ -64,7 +63,6 @@
|
||||
icon_state = "templar"
|
||||
icon_living = "templar"
|
||||
icon_dead = "templar_dead"
|
||||
threat = 1.5
|
||||
maxHealth = 150
|
||||
health = 150
|
||||
weather_immunities = list("snow")
|
||||
@@ -98,7 +96,6 @@
|
||||
icon_state = "plasma_miner"
|
||||
icon_living = "plasma_miner"
|
||||
icon_dead = "plasma_miner"
|
||||
threat = 2
|
||||
maxHealth = 150
|
||||
health = 150
|
||||
harm_intent_damage = 10
|
||||
@@ -116,7 +113,6 @@
|
||||
icon_state = "plasma_miner_tool"
|
||||
icon_living = "plasma_miner_tool"
|
||||
icon_dead = "plasma_miner_tool"
|
||||
threat = 3
|
||||
maxHealth = 185
|
||||
health = 185
|
||||
harm_intent_damage = 15
|
||||
|
||||
@@ -10,7 +10,6 @@
|
||||
gender = NEUTER
|
||||
a_intent = INTENT_HARM
|
||||
mob_biotypes = MOB_HUMANOID
|
||||
threat = 3
|
||||
response_help_continuous = "touches"
|
||||
response_help_simple = "touch"
|
||||
response_disarm_continuous = "pushes"
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
icon_living = "stickman"
|
||||
icon_dead = "stickman_dead"
|
||||
icon_gib = "syndicate_gib"
|
||||
threat = 0.5
|
||||
mob_biotypes = MOB_HUMANOID
|
||||
gender = MALE
|
||||
speak_chance = 0
|
||||
|
||||
@@ -25,7 +25,6 @@
|
||||
mob_biotypes = MOB_ORGANIC|MOB_HUMANOID
|
||||
speak_chance = 0
|
||||
turns_per_move = 5
|
||||
threat = 1
|
||||
speed = 0
|
||||
stat_attack = UNCONSCIOUS
|
||||
robust_searching = 1
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
icon_dead = "pine_1"
|
||||
icon_gib = "pine_1"
|
||||
gender = NEUTER
|
||||
threat = 1
|
||||
speak_chance = 0
|
||||
turns_per_move = 5
|
||||
response_help_continuous = "brushes"
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
mob_biotypes = MOB_ORGANIC|MOB_HUMANOID
|
||||
speak_chance = 0
|
||||
turns_per_move = 3
|
||||
threat = 3
|
||||
speed = 0
|
||||
maxHealth = 100
|
||||
health = 100
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
mob_biotypes = MOB_ORGANIC|MOB_BEAST
|
||||
mouse_opacity = MOUSE_OPACITY_ICON
|
||||
move_to_delay = 5
|
||||
threat = 1
|
||||
friendly_verb_continuous = "floats near"
|
||||
friendly_verb_simple = "float near"
|
||||
speak_emote = list("puffs")
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
mob_biotypes = MOB_ORGANIC|MOB_HUMANOID
|
||||
speak_chance = 0
|
||||
stat_attack = UNCONSCIOUS //braains
|
||||
threat = 1
|
||||
maxHealth = 100
|
||||
health = 100
|
||||
harm_intent_damage = 5
|
||||
|
||||
@@ -0,0 +1,433 @@
|
||||
/*
|
||||
All the important duct code:
|
||||
/code/datums/components/plumbing/plumbing.dm
|
||||
/code/datums/ductnet.dm
|
||||
*/
|
||||
/obj/machinery/duct
|
||||
name = "fluid duct"
|
||||
icon = 'icons/obj/plumbing/fluid_ducts.dmi'
|
||||
icon_state = "nduct"
|
||||
|
||||
///bitfield with the directions we're connected in
|
||||
var/connects
|
||||
///set to TRUE to disable smart duct behaviour
|
||||
var/dumb = FALSE
|
||||
///wheter we allow our connects to be changed after initialization or not
|
||||
var/lock_connects = FALSE
|
||||
///our ductnet, wich tracks what we're connected to
|
||||
var/datum/ductnet/duct
|
||||
///amount we can transfer per process. note that the ductnet can carry as much as the lowest capacity duct
|
||||
var/capacity = 10
|
||||
|
||||
///the color of our duct
|
||||
var/duct_color = null
|
||||
///TRUE to ignore colors, so yeah we also connect with other colors without issue
|
||||
var/ignore_colors = FALSE
|
||||
///1,2,4,8,16
|
||||
var/duct_layer = DUCT_LAYER_DEFAULT
|
||||
///whether we allow our layers to be altered
|
||||
var/lock_layers = FALSE
|
||||
///TRUE to let colors connect when forced with a wrench, false to just not do that at all
|
||||
var/color_to_color_support = TRUE
|
||||
///wheter to even bother with plumbing code or not
|
||||
var/active = TRUE
|
||||
///track ducts we're connected to. Mainly for ducts we connect to that we normally wouldn't, like different layers and colors, for when we regenerate the ducts
|
||||
var/list/neighbours = list()
|
||||
///wheter we just unanchored or drop whatever is in the variable. either is safe
|
||||
var/drop_on_wrench = /obj/item/stack/ducts
|
||||
|
||||
/obj/machinery/duct/Initialize(mapload, no_anchor, color_of_duct = "#ffffff", layer_of_duct = DUCT_LAYER_DEFAULT, force_connects)
|
||||
. = ..()
|
||||
|
||||
if(no_anchor)
|
||||
active = FALSE
|
||||
set_anchored(FALSE)
|
||||
else if(!can_anchor())
|
||||
qdel(src)
|
||||
CRASH("Overlapping ducts detected")
|
||||
|
||||
if(force_connects)
|
||||
connects = force_connects //skip change_connects() because we're still initializing and we need to set our connects at one point
|
||||
if(!lock_layers)
|
||||
duct_layer = layer_of_duct
|
||||
if(!ignore_colors)
|
||||
duct_color = color_of_duct
|
||||
if(duct_color)
|
||||
add_atom_colour(duct_color, FIXED_COLOUR_PRIORITY)
|
||||
|
||||
handle_layer()
|
||||
|
||||
for(var/obj/machinery/duct/D in loc)
|
||||
if(D == src)
|
||||
continue
|
||||
if(D.duct_layer & duct_layer)
|
||||
disconnect_duct()
|
||||
|
||||
if(active)
|
||||
attempt_connect()
|
||||
|
||||
|
||||
///start looking around us for stuff to connect to
|
||||
/obj/machinery/duct/proc/attempt_connect()
|
||||
|
||||
for(var/atom/movable/AM in loc)
|
||||
var/datum/component/plumbing/P = AM.GetComponent(/datum/component/plumbing)
|
||||
if(P?.active)
|
||||
disconnect_duct() //let's not built under plumbing machinery
|
||||
return
|
||||
for(var/D in GLOB.cardinals)
|
||||
if(dumb && !(D & connects))
|
||||
continue
|
||||
for(var/atom/movable/AM in get_step(src, D))
|
||||
if(connect_network(AM, D))
|
||||
add_connects(D)
|
||||
update_icon()
|
||||
|
||||
///see if whatever we found can be connected to
|
||||
/obj/machinery/duct/proc/connect_network(atom/movable/AM, direction, ignore_color)
|
||||
if(istype(AM, /obj/machinery/duct))
|
||||
return connect_duct(AM, direction, ignore_color)
|
||||
|
||||
var/plumber = AM.GetComponent(/datum/component/plumbing)
|
||||
if(!plumber)
|
||||
return
|
||||
return connect_plumber(plumber, direction)
|
||||
|
||||
///connect to a duct
|
||||
/obj/machinery/duct/proc/connect_duct(obj/machinery/duct/D, direction, ignore_color)
|
||||
var/opposite_dir = turn(direction, 180)
|
||||
if(!active || !D.active)
|
||||
return
|
||||
|
||||
if(!dumb && D.dumb && !(opposite_dir & D.connects))
|
||||
return
|
||||
if(dumb && D.dumb && !(connects & D.connects)) //we eliminated a few more scenarios in attempt connect
|
||||
return
|
||||
|
||||
if((duct == D.duct) && duct)//check if we're not just comparing two null values
|
||||
add_neighbour(D, direction)
|
||||
|
||||
D.add_connects(opposite_dir)
|
||||
D.update_icon()
|
||||
return TRUE //tell the current pipe to also update it's sprite
|
||||
if(!(D in neighbours)) //we cool
|
||||
if((duct_color != D.duct_color) && !(ignore_colors || D.ignore_colors))
|
||||
return
|
||||
if(!(duct_layer & D.duct_layer))
|
||||
return
|
||||
|
||||
if(D.duct)
|
||||
if(duct)
|
||||
duct.assimilate(D.duct)
|
||||
else
|
||||
D.duct.add_duct(src)
|
||||
else
|
||||
if(duct)
|
||||
duct.add_duct(D)
|
||||
else
|
||||
create_duct()
|
||||
duct.add_duct(D)
|
||||
add_neighbour(D, direction)
|
||||
//tell our buddy its time to pass on the torch of connecting to pipes. This shouldn't ever infinitely loop since it only works on pipes that havent been inductrinated
|
||||
D.attempt_connect()
|
||||
|
||||
return TRUE
|
||||
|
||||
///connect to a plumbing object
|
||||
/obj/machinery/duct/proc/connect_plumber(datum/component/plumbing/P, direction)
|
||||
var/opposite_dir = turn(direction, 180)
|
||||
if(duct_layer != DUCT_LAYER_DEFAULT) //plumbing devices don't support multilayering. 3 is the default layer so we only use that. We can change this later
|
||||
return FALSE
|
||||
|
||||
if(!P.active)
|
||||
return
|
||||
|
||||
var/comp_directions = P.supply_connects + P.demand_connects //they should never, ever have supply and demand connects overlap or catastrophic failure
|
||||
if(opposite_dir & comp_directions)
|
||||
if(!duct)
|
||||
create_duct()
|
||||
if(duct.add_plumber(P, opposite_dir))
|
||||
neighbours[P.parent] = direction
|
||||
return TRUE
|
||||
|
||||
///we disconnect ourself from our neighbours. we also destroy our ductnet and tell our neighbours to make a new one
|
||||
/obj/machinery/duct/proc/disconnect_duct(skipanchor)
|
||||
if(!skipanchor) //since set_anchored calls us too.
|
||||
set_anchored(FALSE)
|
||||
active = FALSE
|
||||
if(duct)
|
||||
duct.remove_duct(src)
|
||||
lose_neighbours()
|
||||
reset_connects(0)
|
||||
update_icon()
|
||||
if(ispath(drop_on_wrench) && !QDELING(src))
|
||||
new drop_on_wrench(drop_location())
|
||||
qdel(src)
|
||||
|
||||
///''''''''''''''''optimized''''''''''''''''' proc for quickly reconnecting after a duct net was destroyed
|
||||
/obj/machinery/duct/proc/reconnect()
|
||||
if(neighbours.len && !duct)
|
||||
create_duct()
|
||||
for(var/atom/movable/AM in neighbours)
|
||||
if(istype(AM, /obj/machinery/duct))
|
||||
var/obj/machinery/duct/D = AM
|
||||
if(D.duct)
|
||||
if(D.duct == duct) //we're already connected
|
||||
continue
|
||||
else
|
||||
duct.assimilate(D.duct)
|
||||
continue
|
||||
else
|
||||
duct.add_duct(D)
|
||||
D.reconnect()
|
||||
else
|
||||
var/datum/component/plumbing/P = AM.GetComponent(/datum/component/plumbing)
|
||||
if(AM in get_step(src, neighbours[AM])) //did we move?
|
||||
if(P)
|
||||
connect_plumber(P, neighbours[AM])
|
||||
else
|
||||
neighbours -= AM //we moved
|
||||
|
||||
///Special proc to draw a new connect frame based on neighbours. not the norm so we can support multiple duct kinds
|
||||
/obj/machinery/duct/proc/generate_connects()
|
||||
if(lock_connects)
|
||||
return
|
||||
connects = 0
|
||||
for(var/A in neighbours)
|
||||
connects |= neighbours[A]
|
||||
update_icon()
|
||||
|
||||
///create a new duct datum
|
||||
/obj/machinery/duct/proc/create_duct()
|
||||
duct = new()
|
||||
duct.add_duct(src)
|
||||
|
||||
///add a duct as neighbour. this means we're connected and will connect again if we ever regenerate
|
||||
/obj/machinery/duct/proc/add_neighbour(obj/machinery/duct/D, direction)
|
||||
if(!(D in neighbours))
|
||||
neighbours[D] = direction
|
||||
if(!(src in D.neighbours))
|
||||
D.neighbours[src] = turn(direction, 180)
|
||||
|
||||
///remove all our neighbours, and remove us from our neighbours aswell
|
||||
/obj/machinery/duct/proc/lose_neighbours()
|
||||
for(var/obj/machinery/duct/D in neighbours)
|
||||
D.neighbours.Remove(src)
|
||||
neighbours = list()
|
||||
|
||||
///add a connect direction
|
||||
/obj/machinery/duct/proc/add_connects(new_connects) //make this a define to cut proc calls?
|
||||
if(!lock_connects)
|
||||
connects |= new_connects
|
||||
|
||||
///remove a connect direction
|
||||
/obj/machinery/duct/proc/remove_connects(dead_connects)
|
||||
if(!lock_connects)
|
||||
connects &= ~dead_connects
|
||||
|
||||
///remove our connects
|
||||
/obj/machinery/duct/proc/reset_connects()
|
||||
if(!lock_connects)
|
||||
connects = 0
|
||||
|
||||
///get a list of the ducts we can connect to if we are dumb
|
||||
/obj/machinery/duct/proc/get_adjacent_ducts()
|
||||
var/list/adjacents = list()
|
||||
for(var/A in GLOB.cardinals)
|
||||
if(A & connects)
|
||||
for(var/obj/machinery/duct/D in get_step(src, A))
|
||||
if((turn(A, 180) & D.connects) && D.active)
|
||||
adjacents += D
|
||||
return adjacents
|
||||
|
||||
/obj/machinery/duct/update_icon_state()
|
||||
var/temp_icon = initial(icon_state)
|
||||
for(var/D in GLOB.cardinals)
|
||||
if(D & connects)
|
||||
if(D == NORTH)
|
||||
temp_icon += "_n"
|
||||
if(D == SOUTH)
|
||||
temp_icon += "_s"
|
||||
if(D == EAST)
|
||||
temp_icon += "_e"
|
||||
if(D == WEST)
|
||||
temp_icon += "_w"
|
||||
icon_state = temp_icon
|
||||
|
||||
///update the layer we are on
|
||||
/obj/machinery/duct/proc/handle_layer()
|
||||
var/offset
|
||||
switch(duct_layer)//it's a bitfield, but it's fine because it only works when there's one layer, and multiple layers should be handled differently
|
||||
if(FIRST_DUCT_LAYER)
|
||||
offset = -10
|
||||
if(SECOND_DUCT_LAYER)
|
||||
offset = -5
|
||||
if(THIRD_DUCT_LAYER)
|
||||
offset = 0
|
||||
if(FOURTH_DUCT_LAYER)
|
||||
offset = 5
|
||||
if(FIFTH_DUCT_LAYER)
|
||||
offset = 10
|
||||
pixel_x = offset
|
||||
pixel_y = offset
|
||||
|
||||
|
||||
/obj/machinery/duct/set_anchored(anchorvalue)
|
||||
. = ..()
|
||||
if(isnull(.))
|
||||
return
|
||||
if(anchorvalue)
|
||||
active = TRUE
|
||||
attempt_connect()
|
||||
else
|
||||
disconnect_duct(TRUE)
|
||||
|
||||
/obj/machinery/duct/wrench_act(mob/living/user, obj/item/I) //I can also be the RPD
|
||||
..()
|
||||
add_fingerprint(user)
|
||||
I.play_tool_sound(src)
|
||||
if(anchored || can_anchor())
|
||||
set_anchored(!anchored)
|
||||
user.visible_message( \
|
||||
"[user] [anchored ? null : "un"]fastens \the [src].", \
|
||||
"<span class='notice'>You [anchored ? null : "un"]fasten \the [src].</span>", \
|
||||
"<span class='hear'>You hear ratcheting.</span>")
|
||||
return TRUE
|
||||
///collection of all the sanity checks to prevent us from stacking ducts that shouldn't be stacked
|
||||
/obj/machinery/duct/proc/can_anchor(turf/T)
|
||||
if(!T)
|
||||
T = get_turf(src)
|
||||
for(var/obj/machinery/duct/D in T)
|
||||
if(!anchored || D == src)
|
||||
continue
|
||||
for(var/A in GLOB.cardinals)
|
||||
if(A & connects && A & D.connects)
|
||||
return FALSE
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/duct/doMove(destination)
|
||||
. = ..()
|
||||
disconnect_duct()
|
||||
anchored = FALSE
|
||||
|
||||
/obj/machinery/duct/Destroy()
|
||||
disconnect_duct()
|
||||
return ..()
|
||||
|
||||
/obj/machinery/duct/MouseDrop_T(atom/A, mob/living/user)
|
||||
if(!istype(A, /obj/machinery/duct))
|
||||
return
|
||||
var/obj/machinery/duct/D = A
|
||||
var/obj/item/I = user.get_active_held_item()
|
||||
if(I?.tool_behaviour != TOOL_WRENCH)
|
||||
to_chat(user, "<span class='warning'>You need to be holding a wrench in your active hand to do that!</span>")
|
||||
return
|
||||
if(get_dist(src, D) != 1)
|
||||
return
|
||||
var/direction = get_dir(src, D)
|
||||
if(!(direction in GLOB.cardinals))
|
||||
return
|
||||
if(duct_layer != D.duct_layer)
|
||||
return
|
||||
|
||||
add_connects(direction) //the connect of the other duct is handled in connect_network, but do this here for the parent duct because it's not necessary in normal cases
|
||||
add_neighbour(D, direction)
|
||||
connect_network(D, direction, TRUE)
|
||||
update_icon()
|
||||
|
||||
///has a total of 5 layers and doesnt give a shit about color. its also dumb so doesnt autoconnect.
|
||||
/obj/machinery/duct/multilayered
|
||||
name = "duct layer-manifold"
|
||||
icon = 'icons/obj/2x2.dmi'
|
||||
icon_state = "multiduct"
|
||||
pixel_x = -15
|
||||
pixel_y = -15
|
||||
|
||||
color_to_color_support = FALSE
|
||||
duct_layer = FIRST_DUCT_LAYER | SECOND_DUCT_LAYER | THIRD_DUCT_LAYER | FOURTH_DUCT_LAYER | FIFTH_DUCT_LAYER
|
||||
drop_on_wrench = null
|
||||
|
||||
lock_connects = TRUE
|
||||
lock_layers = TRUE
|
||||
ignore_colors = TRUE
|
||||
dumb = TRUE
|
||||
|
||||
active = FALSE
|
||||
anchored = FALSE
|
||||
|
||||
/obj/machinery/duct/multilayered/Initialize(mapload, no_anchor, color_of_duct, layer_of_duct = DUCT_LAYER_DEFAULT, force_connects)
|
||||
. = ..()
|
||||
update_connects()
|
||||
|
||||
/obj/machinery/duct/multilayered/ComponentInitialize()
|
||||
. = ..()
|
||||
AddElement(/datum/element/update_icon_blocker)
|
||||
|
||||
/obj/machinery/duct/multilayered/wrench_act(mob/living/user, obj/item/I)
|
||||
. = ..()
|
||||
update_connects()
|
||||
|
||||
/obj/machinery/duct/multilayered/proc/update_connects()
|
||||
if(dir & NORTH || dir & SOUTH)
|
||||
connects = NORTH | SOUTH
|
||||
else
|
||||
connects = EAST | WEST
|
||||
|
||||
///don't connect to other multilayered stuff because honestly it shouldn't be done and I dont wanna deal with it
|
||||
/obj/machinery/duct/multilayered/connect_duct(obj/machinery/duct/D, direction, ignore_color)
|
||||
if(istype(D, /obj/machinery/duct/multilayered))
|
||||
return
|
||||
return ..()
|
||||
|
||||
/obj/machinery/duct/multilayered/handle_layer()
|
||||
return
|
||||
|
||||
/obj/item/stack/ducts
|
||||
name = "stack of duct"
|
||||
desc = "A stack of fluid ducts."
|
||||
singular_name = "duct"
|
||||
icon = 'icons/obj/plumbing/fluid_ducts.dmi'
|
||||
icon_state = "ducts"
|
||||
custom_materials = list(/datum/material/iron=500)
|
||||
w_class = WEIGHT_CLASS_TINY
|
||||
novariants = FALSE
|
||||
max_amount = 50
|
||||
item_flags = NOBLUDGEON
|
||||
merge_type = /obj/item/stack/ducts
|
||||
///Color of our duct
|
||||
var/duct_color = "grey"
|
||||
///Default layer of our duct
|
||||
var/duct_layer = "Default Layer"
|
||||
///Assoc index with all the available layers. yes five might be a bit much. Colors uses a global by the way
|
||||
var/list/layers = list("First Layer" = FIRST_DUCT_LAYER, "Second Layer" = SECOND_DUCT_LAYER, "Default Layer" = DUCT_LAYER_DEFAULT,
|
||||
"Fourth Layer" = FOURTH_DUCT_LAYER, "Fifth Layer" = FIFTH_DUCT_LAYER)
|
||||
|
||||
/obj/item/stack/ducts/examine(mob/user)
|
||||
. = ..()
|
||||
. += "<span class='notice'>It's current color and layer are [duct_color] and [duct_layer]. Use in-hand to change.</span>"
|
||||
|
||||
/obj/item/stack/ducts/attack_self(mob/user)
|
||||
var/new_layer = input("Select a layer", "Layer") as null|anything in layers
|
||||
if(new_layer)
|
||||
duct_layer = new_layer
|
||||
var/new_color = input("Select a color", "Color") as null|anything in GLOB.pipe_paint_colors
|
||||
if(new_color)
|
||||
duct_color = new_color
|
||||
add_atom_colour(GLOB.pipe_paint_colors[new_color], FIXED_COLOUR_PRIORITY)
|
||||
|
||||
/obj/item/stack/ducts/afterattack(atom/A, user, proximity)
|
||||
. = ..()
|
||||
if(!proximity)
|
||||
return
|
||||
if(istype(A, /obj/machinery/duct))
|
||||
var/obj/machinery/duct/D = A
|
||||
if(!D.anchored)
|
||||
add(1)
|
||||
qdel(D)
|
||||
if(istype(A, /turf/open) && use(1))
|
||||
var/turf/open/OT = A
|
||||
new /obj/machinery/duct(OT, FALSE, GLOB.pipe_paint_colors[duct_color], layers[duct_layer])
|
||||
playsound(get_turf(src), 'sound/machines/click.ogg', 50, TRUE)
|
||||
|
||||
/obj/item/stack/ducts/fifty
|
||||
amount = 50
|
||||
@@ -0,0 +1,98 @@
|
||||
/**Basic plumbing object.
|
||||
* It doesn't really hold anything special, YET.
|
||||
* Objects that are plumbing but not a subtype are as of writing liquid pumps and the reagent_dispenser tank
|
||||
* Also please note that the plumbing component is toggled on and off by the component using a signal from default_unfasten_wrench, so dont worry about it
|
||||
*/
|
||||
/obj/machinery/plumbing
|
||||
name = "pipe thing"
|
||||
icon = 'icons/obj/plumbing/plumbers.dmi'
|
||||
icon_state = "pump"
|
||||
density = TRUE
|
||||
active_power_usage = 30
|
||||
use_power = ACTIVE_POWER_USE
|
||||
resistance_flags = FIRE_PROOF | UNACIDABLE | ACID_PROOF
|
||||
///Plumbing machinery is always gonna need reagents, so we might aswell put it here
|
||||
var/buffer = 50
|
||||
///Flags for reagents, like INJECTABLE, TRANSPARENT bla bla everything thats in DEFINES/reagents.dm
|
||||
var/reagent_flags = TRANSPARENT
|
||||
///wheter we partake in rcd construction or not
|
||||
var/rcd_constructable = TRUE
|
||||
///cost of the plumbing rcd construction
|
||||
var/rcd_cost = 15
|
||||
///delay of constructing it throught the plumbing rcd
|
||||
var/rcd_delay = 10
|
||||
|
||||
/obj/machinery/plumbing/Initialize(mapload, bolt = TRUE)
|
||||
. = ..()
|
||||
anchored = bolt
|
||||
create_reagents(buffer, reagent_flags)
|
||||
AddComponent(/datum/component/simple_rotation, ROTATION_ALTCLICK | ROTATION_CLOCKWISE | ROTATION_COUNTERCLOCKWISE | ROTATION_VERBS, null, CALLBACK(src, .proc/can_be_rotated))
|
||||
|
||||
/obj/machinery/plumbing/proc/can_be_rotated(mob/user,rotation_type)
|
||||
return TRUE
|
||||
|
||||
|
||||
/obj/machinery/plumbing/examine(mob/user)
|
||||
. = ..()
|
||||
. += "<span class='notice'>The maximum volume display reads: <b>[reagents.maximum_volume] units</b>.</span>"
|
||||
|
||||
/obj/machinery/plumbing/wrench_act(mob/living/user, obj/item/I)
|
||||
..()
|
||||
default_unfasten_wrench(user, I)
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/plumbing/plunger_act(obj/item/plunger/P, mob/living/user, reinforced)
|
||||
to_chat(user, "<span class='notice'>You start furiously plunging [name].")
|
||||
if(do_after(user, 30, target = src))
|
||||
to_chat(user, "<span class='notice'>You finish plunging the [name].")
|
||||
reagents.reaction(get_turf(src), TOUCH) //splash on the floor
|
||||
reagents.clear_reagents()
|
||||
|
||||
/obj/machinery/plumbing/welder_act(mob/living/user, obj/item/I)
|
||||
. = ..()
|
||||
if(anchored)
|
||||
to_chat(user, "<span class='warning'>The [name] needs to be unbolted to do that!</span")
|
||||
if(I.tool_start_check(user, amount=0))
|
||||
to_chat(user, "<span class='notice'>You start slicing the [name] apart.</span")
|
||||
if(I.use_tool(src, user, rcd_delay * 2, volume=50))
|
||||
deconstruct(TRUE)
|
||||
to_chat(user, "<span class='notice'>You slice the [name] apart.</span")
|
||||
return TRUE
|
||||
|
||||
///We can empty beakers in here and everything
|
||||
/obj/machinery/plumbing/input
|
||||
name = "input gate"
|
||||
desc = "Can be manually filled with reagents from containers."
|
||||
icon_state = "pipe_input"
|
||||
reagent_flags = TRANSPARENT | REFILLABLE
|
||||
rcd_cost = 5
|
||||
rcd_delay = 5
|
||||
|
||||
/obj/machinery/plumbing/input/Initialize(mapload, bolt)
|
||||
. = ..()
|
||||
AddComponent(/datum/component/plumbing/simple_supply, bolt)
|
||||
|
||||
///We can fill beakers in here and everything. we dont inheret from input because it has nothing that we need
|
||||
/obj/machinery/plumbing/output
|
||||
name = "output gate"
|
||||
desc = "A manual output for plumbing systems, for taking reagents directly into containers."
|
||||
icon_state = "pipe_output"
|
||||
reagent_flags = TRANSPARENT | DRAINABLE
|
||||
rcd_cost = 5
|
||||
rcd_delay = 5
|
||||
|
||||
/obj/machinery/plumbing/output/Initialize(mapload, bolt)
|
||||
. = ..()
|
||||
AddComponent(/datum/component/plumbing/simple_demand, bolt)
|
||||
|
||||
/obj/machinery/plumbing/tank
|
||||
name = "chemical tank"
|
||||
desc = "A massive chemical holding tank."
|
||||
icon_state = "tank"
|
||||
buffer = 400
|
||||
rcd_cost = 25
|
||||
rcd_delay = 20
|
||||
|
||||
/obj/machinery/plumbing/tank/Initialize(mapload, bolt)
|
||||
. = ..()
|
||||
AddComponent(/datum/component/plumbing/tank, bolt)
|
||||
@@ -0,0 +1,105 @@
|
||||
//we cant use defines in tgui, so use a string instead of magic numbers
|
||||
#define COOLING "Cooling"
|
||||
#define HEATING "Heating"
|
||||
#define NEUTRAL "Neutral"
|
||||
|
||||
///this the plumbing version of a heater/freezer.
|
||||
/obj/machinery/plumbing/acclimator
|
||||
name = "chemical acclimator"
|
||||
desc = "An efficient cooler and heater for the perfect showering temperature or illicit chemical factory."
|
||||
|
||||
icon_state = "acclimator"
|
||||
buffer = 200
|
||||
|
||||
///towards wich temperature do we build?
|
||||
var/target_temperature = 300
|
||||
///I cant find a good name for this. Basically if target is 300, and this is 10, it will still target 300 but will start emptying itself at 290 and 310.
|
||||
var/allowed_temperature_difference = 1
|
||||
///cool/heat power
|
||||
var/heater_coefficient = 0.1
|
||||
///Are we turned on or off? this is from the on and off button
|
||||
var/enabled = TRUE
|
||||
///COOLING, HEATING or NEUTRAL. We track this for change, so we dont needlessly update our icon
|
||||
var/acclimate_state
|
||||
/**We can't take anything in, at least till we're emptied. Down side of the round robin chem transfer, otherwise while emptying 5u of an unreacted chem gets added,
|
||||
and you get nasty leftovers
|
||||
*/
|
||||
var/emptying = FALSE
|
||||
ui_x = 320
|
||||
ui_y = 310
|
||||
|
||||
/obj/machinery/plumbing/acclimator/Initialize(mapload, bolt)
|
||||
. = ..()
|
||||
AddComponent(/datum/component/plumbing/acclimator, bolt)
|
||||
|
||||
/obj/machinery/plumbing/acclimator/process()
|
||||
if(stat & NOPOWER || !enabled || !reagents.total_volume || reagents.chem_temp == target_temperature)
|
||||
if(acclimate_state != NEUTRAL)
|
||||
acclimate_state = NEUTRAL
|
||||
update_icon()
|
||||
if(!reagents.total_volume)
|
||||
emptying = FALSE
|
||||
return
|
||||
|
||||
if(reagents.chem_temp < target_temperature && acclimate_state != HEATING) //note that we check if the temperature is the same at the start
|
||||
acclimate_state = HEATING
|
||||
update_icon()
|
||||
else if(reagents.chem_temp > target_temperature && acclimate_state != COOLING)
|
||||
acclimate_state = COOLING
|
||||
update_icon()
|
||||
if(!emptying)
|
||||
if(reagents.chem_temp >= target_temperature && target_temperature + allowed_temperature_difference >= reagents.chem_temp) //cooling here
|
||||
emptying = TRUE
|
||||
if(reagents.chem_temp <= target_temperature && target_temperature - allowed_temperature_difference <= reagents.chem_temp) //heating here
|
||||
emptying = TRUE
|
||||
|
||||
reagents.adjust_thermal_energy((target_temperature - reagents.chem_temp) * heater_coefficient * SPECIFIC_HEAT_DEFAULT * reagents.total_volume) //keep constant with chem heater
|
||||
reagents.handle_reactions()
|
||||
|
||||
/obj/machinery/plumbing/acclimator/update_icon()
|
||||
icon_state = initial(icon_state)
|
||||
switch(acclimate_state)
|
||||
if(COOLING)
|
||||
icon_state += "_cold"
|
||||
if(HEATING)
|
||||
icon_state += "_hot"
|
||||
|
||||
/obj/machinery/plumbing/acclimator/ui_interact(mob/user, datum/tgui/ui)
|
||||
ui = SStgui.try_update_ui(user, src, ui)
|
||||
if(!ui)
|
||||
ui = new(user, src, "ChemAcclimator", name)
|
||||
ui.open()
|
||||
|
||||
/obj/machinery/plumbing/acclimator/ui_data(mob/user)
|
||||
var/list/data = list()
|
||||
|
||||
data["enabled"] = enabled
|
||||
data["chem_temp"] = reagents.chem_temp
|
||||
data["target_temperature"] = target_temperature
|
||||
data["allowed_temperature_difference"] = allowed_temperature_difference
|
||||
data["acclimate_state"] = acclimate_state
|
||||
data["max_volume"] = reagents.maximum_volume
|
||||
data["reagent_volume"] = reagents.total_volume
|
||||
data["emptying"] = emptying
|
||||
return data
|
||||
|
||||
/obj/machinery/plumbing/acclimator/ui_act(action, params)
|
||||
if(..())
|
||||
return
|
||||
. = TRUE
|
||||
switch(action)
|
||||
if("set_target_temperature")
|
||||
var/target = text2num(params["temperature"])
|
||||
target_temperature = clamp(target, 0, 1000)
|
||||
if("set_allowed_temperature_difference")
|
||||
var/target = text2num(params["temperature"])
|
||||
allowed_temperature_difference = clamp(target, 0, 1000)
|
||||
if("toggle_power")
|
||||
enabled = !enabled
|
||||
if("change_volume")
|
||||
var/target = text2num(params["volume"])
|
||||
reagents.maximum_volume = clamp(round(target), 1, buffer)
|
||||
|
||||
#undef COOLING
|
||||
#undef HEATING
|
||||
#undef NEUTRAL
|
||||
@@ -0,0 +1,65 @@
|
||||
/obj/machinery/hydroponics/constructable/automagic
|
||||
name = "automated hydroponics system"
|
||||
desc = "The bane of botanists everywhere. Accepts chemical reagents via plumbing, automatically harvests and removes dead plants."
|
||||
obj_flags = CAN_BE_HIT | UNIQUE_RENAME
|
||||
circuit = /obj/item/circuitboard/machine/hydroponics/automagic
|
||||
self_sufficiency_req = 400 //automating hydroponics makes gaia sad so she needs more drugs to turn they tray godly.
|
||||
canirrigate = FALSE
|
||||
|
||||
|
||||
/obj/machinery/hydroponics/constructable/automagic/attackby(obj/item/O, mob/user, params)
|
||||
if(istype(O, /obj/item/reagent_containers))
|
||||
return FALSE //avoid fucky wuckies
|
||||
..()
|
||||
|
||||
/obj/machinery/hydroponics/constructable/automagic/default_unfasten_wrench(mob/user, obj/item/I, time = 20)
|
||||
. = ..()
|
||||
if(. == SUCCESSFUL_UNFASTEN)
|
||||
user.visible_message("<span class='notice'>[user.name] [anchored ? "fasten" : "unfasten"] [src]</span>", \
|
||||
"<span class='notice'>You [anchored ? "fasten" : "unfasten"] [src]</span>")
|
||||
var/datum/component/plumbing/CP = GetComponent(/datum/component/plumbing)
|
||||
if(anchored)
|
||||
CP.enable()
|
||||
else
|
||||
CP.disable()
|
||||
|
||||
/obj/machinery/hydroponics/constructable/automagic/Destroy()
|
||||
. = ..()
|
||||
STOP_PROCESSING(SSobj, src)
|
||||
|
||||
/obj/machinery/hydroponics/constructable/automagic/Initialize(mapload)
|
||||
. = ..()
|
||||
START_PROCESSING(SSobj, src)
|
||||
create_reagents(100 , AMOUNT_VISIBLE)
|
||||
|
||||
/obj/machinery/hydroponics/constructable/automagic/ComponentInitialize()
|
||||
. = ..()
|
||||
AddComponent(/datum/component/simple_rotation, ROTATION_ALTCLICK | ROTATION_CLOCKWISE | ROTATION_COUNTERCLOCKWISE | ROTATION_VERBS, null, CALLBACK(src, .proc/can_be_rotated))
|
||||
AddComponent(/datum/component/plumbing/simple_demand)
|
||||
|
||||
/obj/machinery/hydroponics/constructable/proc/can_be_rotated(mob/user, rotation_type)
|
||||
return !anchored
|
||||
|
||||
/obj/machinery/hydroponics/constructable/automagic/process()
|
||||
if(reagents)
|
||||
applyChemicals(reagents)
|
||||
reagents.clear_reagents()
|
||||
if(dead)
|
||||
dead = 0
|
||||
qdel(myseed)
|
||||
myseed = null
|
||||
update_icon()
|
||||
name = initial(name)
|
||||
desc = initial(desc)
|
||||
if(harvest)
|
||||
myseed.harvest_userless()
|
||||
harvest = 0
|
||||
lastproduce = age
|
||||
if(!myseed.get_gene(/datum/plant_gene/trait/repeated_harvest))
|
||||
qdel(myseed)
|
||||
myseed = null
|
||||
dead = 0
|
||||
name = initial(name)
|
||||
desc = initial(desc)
|
||||
update_icon()
|
||||
..()
|
||||
@@ -0,0 +1,79 @@
|
||||
/obj/machinery/plumbing/bottler
|
||||
name = "chemical bottler"
|
||||
desc = "Puts reagents into containers, like bottles and beakers."
|
||||
icon_state = "bottler"
|
||||
layer = ABOVE_ALL_MOB_LAYER
|
||||
reagent_flags = TRANSPARENT | DRAINABLE
|
||||
rcd_cost = 50
|
||||
rcd_delay = 50
|
||||
buffer = 100
|
||||
///how much do we fill
|
||||
var/wanted_amount = 10
|
||||
///where things are sent
|
||||
var/turf/goodspot = null
|
||||
///where things are taken
|
||||
var/turf/inputspot = null
|
||||
///where beakers that are already full will be sent
|
||||
var/turf/badspot = null
|
||||
|
||||
/obj/machinery/plumbing/bottler/Initialize(mapload, bolt)
|
||||
. = ..()
|
||||
AddComponent(/datum/component/plumbing/simple_demand, bolt)
|
||||
setDir(dir)
|
||||
|
||||
/obj/machinery/plumbing/bottler/can_be_rotated(mob/user, rotation_type)
|
||||
if(anchored)
|
||||
to_chat(user, "<span class='warning'>It is fastened to the floor!</span>")
|
||||
return FALSE
|
||||
return TRUE
|
||||
|
||||
///changes the tile array
|
||||
/obj/machinery/plumbing/bottler/setDir(newdir)
|
||||
. = ..()
|
||||
switch(dir)
|
||||
if(NORTH)
|
||||
goodspot = get_step(get_turf(src), NORTH)
|
||||
inputspot = get_step(get_turf(src), SOUTH)
|
||||
badspot = get_step(get_turf(src), EAST)
|
||||
if(SOUTH)
|
||||
goodspot = get_step(get_turf(src), SOUTH)
|
||||
inputspot = get_step(get_turf(src), NORTH)
|
||||
badspot = get_step(get_turf(src), WEST)
|
||||
if(WEST)
|
||||
goodspot = get_step(get_turf(src), WEST)
|
||||
inputspot = get_step(get_turf(src), EAST)
|
||||
badspot = get_step(get_turf(src), NORTH)
|
||||
if(EAST)
|
||||
goodspot = get_step(get_turf(src), EAST)
|
||||
inputspot = get_step(get_turf(src), WEST)
|
||||
badspot = get_step(get_turf(src), SOUTH)
|
||||
|
||||
///changing input ammount with a window
|
||||
/obj/machinery/plumbing/bottler/interact(mob/user)
|
||||
. = ..()
|
||||
wanted_amount = clamp(round(input(user,"maximum is 100u","set ammount to fill with") as num|null, 1), 1, 100)
|
||||
reagents.clear_reagents()
|
||||
to_chat(user, "<span class='notice'> The [src] will now fill for [wanted_amount]u.</span>")
|
||||
|
||||
/obj/machinery/plumbing/bottler/process()
|
||||
if(stat & NOPOWER)
|
||||
return
|
||||
///see if machine has enough to fill
|
||||
if(reagents.total_volume >= wanted_amount && anchored)
|
||||
var/obj/AM = pick(inputspot.contents)///pick a reagent_container that could be used
|
||||
if(istype(AM, /obj/item/reagent_containers) && (!istype(AM, /obj/item/reagent_containers/hypospray/medipen)))
|
||||
var/obj/item/reagent_containers/B = AM
|
||||
///see if it would overflow else inject
|
||||
if((B.reagents.total_volume + wanted_amount) <= B.reagents.maximum_volume)
|
||||
reagents.trans_to(B, wanted_amount)
|
||||
B.forceMove(goodspot)
|
||||
return
|
||||
///glass was full so we move it away
|
||||
AM.forceMove(badspot)
|
||||
if(istype(AM, /obj/item/slime_extract)) ///slime extracts need inject
|
||||
AM.forceMove(goodspot)
|
||||
reagents.trans_to(AM, wanted_amount)
|
||||
return
|
||||
if(istype(AM, /obj/item/slimecross/industrial)) ///no need to move slimecross industrial things
|
||||
reagents.trans_to(AM, wanted_amount)
|
||||
return
|
||||
@@ -0,0 +1,21 @@
|
||||
/obj/machinery/plumbing/disposer
|
||||
name = "chemical disposer"
|
||||
desc = "Breaks down chemicals and annihilates them."
|
||||
icon_state = "disposal"
|
||||
///we remove 10 reagents per second
|
||||
var/disposal_rate = 10
|
||||
|
||||
/obj/machinery/plumbing/disposer/Initialize(mapload, bolt)
|
||||
. = ..()
|
||||
AddComponent(/datum/component/plumbing/simple_demand, bolt)
|
||||
|
||||
/obj/machinery/plumbing/disposer/process()
|
||||
if(stat & NOPOWER)
|
||||
return
|
||||
if(reagents.total_volume)
|
||||
if(icon_state != initial(icon_state) + "_working") //threw it here instead of update icon since it only has two states
|
||||
icon_state = initial(icon_state) + "_working"
|
||||
reagents.remove_any(disposal_rate)
|
||||
else
|
||||
if(icon_state != initial(icon_state))
|
||||
icon_state = initial(icon_state)
|
||||
@@ -0,0 +1,59 @@
|
||||
/obj/machinery/plumbing/fermenter //FULLY AUTOMATIC BEER BREWING. TRULY, THE FUTURE.
|
||||
name = "chemical fermenter"
|
||||
desc = "Turns plants into various types of booze."
|
||||
icon_state = "fermenter"
|
||||
layer = ABOVE_ALL_MOB_LAYER
|
||||
reagent_flags = TRANSPARENT | DRAINABLE
|
||||
rcd_cost = 30
|
||||
rcd_delay = 30
|
||||
buffer = 400
|
||||
///input dir
|
||||
var/eat_dir = SOUTH
|
||||
|
||||
/obj/machinery/plumbing/fermenter/Initialize(mapload, bolt)
|
||||
. = ..()
|
||||
AddComponent(/datum/component/plumbing/simple_supply, bolt)
|
||||
|
||||
/obj/machinery/plumbing/fermenter/can_be_rotated(mob/user,rotation_type)
|
||||
if(anchored)
|
||||
to_chat(user, "<span class='warning'>It is fastened to the floor!</span>")
|
||||
return FALSE
|
||||
switch(eat_dir)
|
||||
if(WEST)
|
||||
eat_dir = NORTH
|
||||
return TRUE
|
||||
if(EAST)
|
||||
eat_dir = SOUTH
|
||||
return TRUE
|
||||
if(NORTH)
|
||||
eat_dir = EAST
|
||||
return TRUE
|
||||
if(SOUTH)
|
||||
eat_dir = WEST
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/plumbing/fermenter/CanPass(atom/movable/AM)
|
||||
. = ..()
|
||||
if(!anchored)
|
||||
return
|
||||
var/move_dir = get_dir(loc, AM.loc)
|
||||
if(move_dir == eat_dir)
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/plumbing/fermenter/Crossed(atom/movable/AM)
|
||||
. = ..()
|
||||
ferment(AM)
|
||||
|
||||
/obj/machinery/plumbing/fermenter/proc/ferment(atom/AM)
|
||||
if(stat & NOPOWER)
|
||||
return
|
||||
if(reagents.holder_full())
|
||||
return
|
||||
if(!isitem(AM))
|
||||
return
|
||||
if(istype(AM, /obj/item/reagent_containers/food/snacks/grown))
|
||||
var/obj/item/reagent_containers/food/snacks/grown/G = AM
|
||||
if(G.distill_reagent)
|
||||
var/amount = G.seed.potency * 0.25
|
||||
reagents.add_reagent(G.distill_reagent, amount)
|
||||
qdel(G)
|
||||
@@ -0,0 +1,65 @@
|
||||
///chemical plumbing filter. If it's not filtered by left and right, it goes straight.
|
||||
/obj/machinery/plumbing/filter
|
||||
name = "chemical filter"
|
||||
desc = "A chemical filter for filtering chemicals. The left and right outputs appear to be from the perspective of the input port."
|
||||
icon_state = "filter"
|
||||
density = FALSE
|
||||
|
||||
///whitelist of chems id's that go to the left side. Empty to disable port
|
||||
var/list/left = list()
|
||||
///whitelist of chem id's that go to the right side. Empty to disable port
|
||||
var/list/right = list()
|
||||
///whitelist of chems but their name instead of path
|
||||
var/list/english_left = list()
|
||||
///whitelist of chems but their name instead of path
|
||||
var/list/english_right = list()
|
||||
|
||||
/obj/machinery/plumbing/filter/Initialize(mapload, bolt)
|
||||
. = ..()
|
||||
AddComponent(/datum/component/plumbing/filter, bolt)
|
||||
|
||||
/obj/machinery/plumbing/filter/ui_interact(mob/user, datum/tgui/ui)
|
||||
ui = SStgui.try_update_ui(user, src, ui)
|
||||
if(!ui)
|
||||
ui = new(user, src, "ChemFilter", name)
|
||||
ui.open()
|
||||
|
||||
/obj/machinery/plumbing/filter/ui_data(mob/user)
|
||||
var/list/data = list()
|
||||
data["left"] = english_left
|
||||
data["right"] = english_right
|
||||
return data
|
||||
|
||||
/obj/machinery/plumbing/filter/ui_act(action, params)
|
||||
if(..())
|
||||
return
|
||||
. = TRUE
|
||||
switch(action)
|
||||
if("add")
|
||||
var/new_chem_name = params["name"]
|
||||
var/chem_id = get_chem_id(new_chem_name)
|
||||
if(chem_id)
|
||||
switch(params["which"])
|
||||
if("left")
|
||||
if(!left.Find(chem_id))
|
||||
english_left += new_chem_name
|
||||
left += chem_id
|
||||
if("right")
|
||||
if(!right.Find(chem_id))
|
||||
english_right += new_chem_name
|
||||
right += chem_id
|
||||
else
|
||||
to_chat(usr, "<span class='warning'>No such known reagent exists!</span>")
|
||||
|
||||
if("remove")
|
||||
var/chem_name = params["reagent"]
|
||||
var/chem_id = get_chem_id(chem_name)
|
||||
switch(params["which"])
|
||||
if("left")
|
||||
if(english_left.Find(chem_name))
|
||||
english_left -= chem_name
|
||||
left -= chem_id
|
||||
if("right")
|
||||
if(english_right.Find(chem_name))
|
||||
english_right -= chem_name
|
||||
right -= chem_id
|
||||
@@ -0,0 +1,64 @@
|
||||
/obj/machinery/plumbing/grinder_chemical
|
||||
name = "chemical grinder"
|
||||
desc = "chemical grinder."
|
||||
icon_state = "grinder_chemical"
|
||||
layer = ABOVE_ALL_MOB_LAYER
|
||||
reagent_flags = TRANSPARENT | DRAINABLE
|
||||
rcd_cost = 30
|
||||
rcd_delay = 30
|
||||
buffer = 400
|
||||
var/eat_dir = NORTH
|
||||
|
||||
/obj/machinery/plumbing/grinder_chemical/Initialize(mapload, bolt)
|
||||
. = ..()
|
||||
AddComponent(/datum/component/plumbing/simple_supply, bolt)
|
||||
|
||||
/obj/machinery/plumbing/grinder_chemical/can_be_rotated(mob/user,rotation_type)
|
||||
if(anchored)
|
||||
to_chat(user, "<span class='warning'>It is fastened to the floor!</span>")
|
||||
return FALSE
|
||||
switch(eat_dir)
|
||||
if(WEST)
|
||||
eat_dir = NORTH
|
||||
return TRUE
|
||||
if(EAST)
|
||||
eat_dir = SOUTH
|
||||
return TRUE
|
||||
if(NORTH)
|
||||
eat_dir = EAST
|
||||
return TRUE
|
||||
if(SOUTH)
|
||||
eat_dir = WEST
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/plumbing/grinder_chemical/CanPass(atom/movable/AM)
|
||||
. = ..()
|
||||
if(!anchored)
|
||||
return
|
||||
var/move_dir = get_dir(loc, AM.loc)
|
||||
if(move_dir == eat_dir)
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/plumbing/grinder_chemical/Crossed(atom/movable/AM)
|
||||
. = ..()
|
||||
grind(AM)
|
||||
|
||||
/obj/machinery/plumbing/grinder_chemical/proc/grind(atom/AM)
|
||||
if(stat & NOPOWER)
|
||||
return
|
||||
if(reagents.holder_full())
|
||||
return
|
||||
if(!isitem(AM))
|
||||
return
|
||||
var/obj/item/I = AM
|
||||
if(I.juice_results || I.grind_results)
|
||||
if(I.juice_results)
|
||||
I.on_juice()
|
||||
reagents.add_reagent_list(I.juice_results)
|
||||
if(I.reagents)
|
||||
I.reagents.trans_to(src, I.reagents.total_volume)
|
||||
qdel(I)
|
||||
return
|
||||
I.on_grind()
|
||||
reagents.add_reagent_list(I.grind_results)
|
||||
qdel(I)
|
||||
@@ -0,0 +1,94 @@
|
||||
/obj/machinery/medipen_refiller
|
||||
name = "Medipen Refiller"
|
||||
desc = "A machine that refills used medipens with chemicals."
|
||||
icon = 'icons/obj/machines/medipen_refiller.dmi'
|
||||
icon_state = "medipen_refiller"
|
||||
density = TRUE
|
||||
circuit = /obj/item/circuitboard/machine/medipen_refiller
|
||||
idle_power_usage = 100
|
||||
/// list of medipen subtypes it can refill
|
||||
var/list/allowed = list(/obj/item/reagent_containers/hypospray/medipen = /datum/reagent/medicine/epinephrine,
|
||||
/obj/item/reagent_containers/hypospray/medipen/ekit = /datum/reagent/medicine/epinephrine,
|
||||
/obj/item/reagent_containers/hypospray/medipen/firelocker = /datum/reagent/medicine/oxandrolone,
|
||||
/obj/item/reagent_containers/hypospray/medipen/stimpack = /datum/reagent/medicine/ephedrine,
|
||||
/obj/item/reagent_containers/hypospray/medipen/blood_loss = /datum/reagent/medicine/coagulant/weak)
|
||||
/// var to prevent glitches in the animation
|
||||
var/busy = FALSE
|
||||
|
||||
/obj/machinery/medipen_refiller/Initialize()
|
||||
. = ..()
|
||||
create_reagents(100, TRANSPARENT)
|
||||
for(var/obj/item/stock_parts/matter_bin/B in component_parts)
|
||||
reagents.maximum_volume += 100 * B.rating
|
||||
AddComponent(/datum/component/plumbing/simple_demand)
|
||||
|
||||
|
||||
/obj/machinery/medipen_refiller/RefreshParts()
|
||||
var/new_volume = 100
|
||||
for(var/obj/item/stock_parts/matter_bin/B in component_parts)
|
||||
new_volume += 100 * B.rating
|
||||
if(!reagents)
|
||||
create_reagents(new_volume, TRANSPARENT)
|
||||
reagents.maximum_volume = new_volume
|
||||
return TRUE
|
||||
|
||||
/// handles the messages and animation, calls refill to end the animation
|
||||
/obj/machinery/medipen_refiller/attackby(obj/item/I, mob/user, params)
|
||||
if(busy)
|
||||
to_chat(user, "<span class='danger'>The machine is busy.</span>")
|
||||
return
|
||||
if(istype(I, /obj/item/reagent_containers) && I.is_open_container())
|
||||
var/obj/item/reagent_containers/RC = I
|
||||
var/units = RC.reagents.trans_to(src, RC.amount_per_transfer_from_this)
|
||||
if(units)
|
||||
to_chat(user, "<span class='notice'>You transfer [units] units of the solution to the [name].</span>")
|
||||
return
|
||||
else
|
||||
to_chat(user, "<span class='danger'>The [name] is full.</span>")
|
||||
return
|
||||
if(istype(I, /obj/item/reagent_containers/hypospray/medipen))
|
||||
var/obj/item/reagent_containers/hypospray/medipen/P = I
|
||||
if(!(LAZYFIND(allowed, P.type)))
|
||||
to_chat(user, "<span class='danger'>Error! Unknown schematics.</span>")
|
||||
return
|
||||
if(P.reagents?.reagent_list.len)
|
||||
to_chat(user, "<span class='notice'>The medipen is already filled.</span>")
|
||||
return
|
||||
if(reagents.has_reagent(allowed[P.type], 10))
|
||||
busy = TRUE
|
||||
add_overlay("active")
|
||||
addtimer(CALLBACK(src, .proc/refill, P, user), 20)
|
||||
qdel(P)
|
||||
return
|
||||
to_chat(user, "<span class='danger'>There aren't enough reagents to finish this operation.</span>")
|
||||
return
|
||||
..()
|
||||
|
||||
/obj/machinery/medipen_refiller/plunger_act(obj/item/plunger/P, mob/living/user, reinforced)
|
||||
to_chat(user, "<span class='notice'>You start furiously plunging [name].</span>")
|
||||
if(do_after(user, 30, target = src))
|
||||
to_chat(user, "<span class='notice'>You finish plunging the [name].</span>")
|
||||
reagents.clear_reagents()
|
||||
|
||||
/obj/machinery/medipen_refiller/wrench_act(mob/living/user, obj/item/I)
|
||||
..()
|
||||
default_unfasten_wrench(user, I)
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/medipen_refiller/crowbar_act(mob/user, obj/item/I)
|
||||
..()
|
||||
default_deconstruction_crowbar(I)
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/medipen_refiller/screwdriver_act(mob/living/user, obj/item/I)
|
||||
. = ..()
|
||||
if(!.)
|
||||
return default_deconstruction_screwdriver(user, "medipen_refiller_open", "medipen_refiller", I)
|
||||
|
||||
/// refills the medipen
|
||||
/obj/machinery/medipen_refiller/proc/refill(obj/item/reagent_containers/hypospray/medipen/P, mob/user)
|
||||
new P.type(loc)
|
||||
reagents.remove_reagent(allowed[P.type], 10)
|
||||
cut_overlays()
|
||||
busy = FALSE
|
||||
to_chat(user, "<span class='notice'>Medipen refilled.</span>")
|
||||
@@ -0,0 +1,127 @@
|
||||
///We take a constant input of reagents, and produce a pill once a set volume is reached
|
||||
/obj/machinery/plumbing/pill_press
|
||||
name = "chemical press"
|
||||
desc = "A press that makes pills, patches and bottles."
|
||||
icon_state = "pill_press"
|
||||
///maximum size of a pill
|
||||
var/max_pill_volume = 50
|
||||
///maximum size of a patch
|
||||
var/max_patch_volume = 40
|
||||
///maximum size of a bottle
|
||||
var/max_bottle_volume = 30
|
||||
///current operating product (pills or patches)
|
||||
var/product = "pill"
|
||||
///the minimum size a pill or patch can be
|
||||
var/min_volume = 5
|
||||
///the maximum size a pill or patch can be
|
||||
var/max_volume = 50
|
||||
///selected size of the product
|
||||
var/current_volume = 10
|
||||
///prefix for the product name
|
||||
var/product_name = "factory"
|
||||
///the icon_state number for the pill.
|
||||
var/pill_number = RANDOM_PILL_STYLE
|
||||
///list of id's and icons for the pill selection of the ui
|
||||
var/list/pill_styles
|
||||
///list of products stored in the machine, so we dont have 610 pills on one tile
|
||||
var/list/stored_products = list()
|
||||
///max amount of pills allowed on our tile before we start storing them instead
|
||||
var/max_floor_products = 50 //haha massive pill piles
|
||||
|
||||
/obj/machinery/plumbing/pill_press/examine(mob/user)
|
||||
. = ..()
|
||||
. += "<span class='notice'>The [name] currently has [stored_products.len] stored. There needs to be less than [max_floor_products ] on the floor to continue dispensing.</span>"
|
||||
|
||||
/obj/machinery/plumbing/pill_press/Initialize(mapload, bolt)
|
||||
. = ..()
|
||||
AddComponent(/datum/component/plumbing/simple_demand, bolt)
|
||||
|
||||
//expertly copypasted from chemmasters
|
||||
var/datum/asset/spritesheet/simple/assets = get_asset_datum(/datum/asset/spritesheet/simple/pills)
|
||||
pill_styles = list()
|
||||
for (var/x in 1 to PILL_STYLE_COUNT)
|
||||
var/list/SL = list()
|
||||
SL["id"] = x
|
||||
SL["htmltag"] = assets.icon_tag("pill[x]")
|
||||
pill_styles += list(SL)
|
||||
|
||||
|
||||
/obj/machinery/plumbing/pill_press/process()
|
||||
if(stat & NOPOWER)
|
||||
return
|
||||
if(reagents.total_volume >= current_volume)
|
||||
if (product == "pill")
|
||||
var/obj/item/reagent_containers/pill/P = new(src)
|
||||
reagents.trans_to(P, current_volume)
|
||||
P.name = trim("[product_name] pill")
|
||||
stored_products += P
|
||||
if(pill_number == RANDOM_PILL_STYLE)
|
||||
P.icon_state = "pill[rand(1,21)]"
|
||||
else
|
||||
P.icon_state = "pill[pill_number]"
|
||||
if(P.icon_state == "pill4") //mirrored from chem masters
|
||||
P.desc = "A tablet or capsule, but not just any, a red one, one taken by the ones not scared of knowledge, freedom, uncertainty and the brutal truths of reality."
|
||||
else if (product == "patch")
|
||||
var/obj/item/reagent_containers/pill/patch/P = new(src)
|
||||
reagents.trans_to(P, current_volume)
|
||||
P.name = trim("[product_name] patch")
|
||||
stored_products += P
|
||||
else if (product == "bottle")
|
||||
var/obj/item/reagent_containers/glass/bottle/P = new(src)
|
||||
reagents.trans_to(P, current_volume)
|
||||
P.name = trim("[product_name] bottle")
|
||||
stored_products += P
|
||||
if(stored_products.len)
|
||||
var/pill_amount = 0
|
||||
for(var/obj/item/reagent_containers/pill/P in loc)
|
||||
pill_amount++
|
||||
if(pill_amount >= max_floor_products) //too much so just stop
|
||||
break
|
||||
if(pill_amount < max_floor_products)
|
||||
var/atom/movable/AM = stored_products[1] //AM because forceMove is all we need
|
||||
stored_products -= AM
|
||||
AM.forceMove(drop_location())
|
||||
|
||||
|
||||
/obj/machinery/plumbing/pill_press/ui_assets(mob/user)
|
||||
return list(
|
||||
get_asset_datum(/datum/asset/spritesheet/simple/pills),
|
||||
)
|
||||
|
||||
/obj/machinery/plumbing/pill_press/ui_interact(mob/user, datum/tgui/ui)
|
||||
ui = SStgui.try_update_ui(user, src, ui)
|
||||
if(!ui)
|
||||
ui = new(user, src, "ChemPress", name)
|
||||
ui.open()
|
||||
|
||||
/obj/machinery/plumbing/pill_press/ui_data(mob/user)
|
||||
var/list/data = list()
|
||||
data["pill_style"] = pill_number
|
||||
data["current_volume"] = current_volume
|
||||
data["product_name"] = product_name
|
||||
data["pill_styles"] = pill_styles
|
||||
data["product"] = product
|
||||
data["min_volume"] = min_volume
|
||||
data["max_volume"] = max_volume
|
||||
return data
|
||||
|
||||
/obj/machinery/plumbing/pill_press/ui_act(action, params)
|
||||
if(..())
|
||||
return
|
||||
. = TRUE
|
||||
switch(action)
|
||||
if("change_pill_style")
|
||||
pill_number = clamp(text2num(params["id"]), 1 , PILL_STYLE_COUNT)
|
||||
if("change_current_volume")
|
||||
current_volume = clamp(text2num(params["volume"]), min_volume, max_volume)
|
||||
if("change_product_name")
|
||||
product_name = html_encode(params["name"])
|
||||
if("change_product")
|
||||
product = params["product"]
|
||||
if (product == "pill")
|
||||
max_volume = max_pill_volume
|
||||
else if (product == "patch")
|
||||
max_volume = max_patch_volume
|
||||
else if (product == "bottle")
|
||||
max_volume = max_bottle_volume
|
||||
current_volume = clamp(current_volume, min_volume, max_volume)
|
||||
@@ -0,0 +1,64 @@
|
||||
///We pump liquids from activated(plungerated) geysers to a plumbing outlet. We don't need to be wired.
|
||||
/obj/machinery/plumbing/liquid_pump
|
||||
name = "liquid pump"
|
||||
desc = "Pump up those sweet liquids from under the surface. Uses thermal energy from geysers to power itself." //better than placing 200 cables, because it wasnt fun
|
||||
icon = 'icons/obj/plumbing/plumbers.dmi'
|
||||
icon_state = "pump"
|
||||
anchored = FALSE
|
||||
density = TRUE
|
||||
idle_power_usage = 10
|
||||
active_power_usage = 1000
|
||||
|
||||
rcd_cost = 30
|
||||
rcd_delay = 40
|
||||
|
||||
///units we pump per process (2 seconds)
|
||||
var/pump_power = 2
|
||||
///set to true if the loop couldnt find a geyser in process, so it remembers and stops checking every loop until moved. more accurate name would be absolutely_no_geyser_under_me_so_dont_try
|
||||
var/geyserless = FALSE
|
||||
///The geyser object
|
||||
var/obj/structure/geyser/geyser
|
||||
///volume of our internal buffer
|
||||
var/volume = 200
|
||||
|
||||
/obj/machinery/plumbing/liquid_pump/Initialize(mapload, bolt)
|
||||
. = ..()
|
||||
AddComponent(/datum/component/plumbing/simple_supply, bolt)
|
||||
|
||||
///please note that the component has a hook in the parent call, wich handles activating and deactivating
|
||||
/obj/machinery/plumbing/liquid_pump/default_unfasten_wrench(mob/user, obj/item/I, time = 20)
|
||||
. = ..()
|
||||
if(. == SUCCESSFUL_UNFASTEN)
|
||||
geyser = null
|
||||
update_icon()
|
||||
geyserless = FALSE //we switched state, so lets just set this back aswell
|
||||
|
||||
/obj/machinery/plumbing/liquid_pump/process()
|
||||
if(!anchored || panel_open || geyserless)
|
||||
return
|
||||
|
||||
if(!geyser)
|
||||
for(var/obj/structure/geyser/G in loc.contents)
|
||||
geyser = G
|
||||
update_icon()
|
||||
if(!geyser) //we didnt find one, abort
|
||||
geyserless = TRUE
|
||||
visible_message("<span class='warning'>The [name] makes a sad beep!</span>")
|
||||
playsound(src, 'sound/machines/buzz-sigh.ogg', 50)
|
||||
return
|
||||
|
||||
pump()
|
||||
|
||||
///pump up that sweet geyser nectar
|
||||
/obj/machinery/plumbing/liquid_pump/proc/pump()
|
||||
if(!geyser || !geyser.reagents)
|
||||
return
|
||||
geyser.reagents.trans_to(src, pump_power)
|
||||
|
||||
/obj/machinery/plumbing/liquid_pump/update_icon_state()
|
||||
if(geyser)
|
||||
icon_state = initial(icon_state) + "-on"
|
||||
else if(panel_open)
|
||||
icon_state = initial(icon_state) + "-open"
|
||||
else
|
||||
icon_state = initial(icon_state)
|
||||
@@ -0,0 +1,63 @@
|
||||
///a reaction chamber for plumbing. pretty much everything can react, but this one keeps the reagents seperated and only reacts under your given terms
|
||||
/obj/machinery/plumbing/reaction_chamber
|
||||
name = "reaction chamber"
|
||||
desc = "Keeps chemicals seperated until given conditions are met."
|
||||
icon_state = "reaction_chamber"
|
||||
buffer = 200
|
||||
reagent_flags = TRANSPARENT | NO_REACT
|
||||
|
||||
/**list of set reagents that the reaction_chamber allows in, and must all be present before mixing is enabled.
|
||||
* example: list(/datum/reagent/water = 20, /datum/reagent/fuel/oil = 50)
|
||||
*/
|
||||
var/list/required_reagents = list()
|
||||
///our reagent goal has been reached, so now we lock our inputs and start emptying
|
||||
var/emptying = FALSE
|
||||
|
||||
/obj/machinery/plumbing/reaction_chamber/Initialize(mapload, bolt)
|
||||
. = ..()
|
||||
AddComponent(/datum/component/plumbing/reaction_chamber, bolt)
|
||||
|
||||
/obj/machinery/plumbing/reaction_chamber/on_reagent_change()
|
||||
if(reagents.total_volume == 0 && emptying) //we were emptying, but now we aren't
|
||||
emptying = FALSE
|
||||
reagent_flags |= NO_REACT
|
||||
|
||||
/obj/machinery/plumbing/reaction_chamber/power_change()
|
||||
. = ..()
|
||||
if(use_power != NO_POWER_USE)
|
||||
icon_state = initial(icon_state) + "_on"
|
||||
else
|
||||
icon_state = initial(icon_state)
|
||||
|
||||
/obj/machinery/plumbing/reaction_chamber/ui_interact(mob/user, datum/tgui/ui)
|
||||
ui = SStgui.try_update_ui(user, src, ui)
|
||||
if(!ui)
|
||||
ui = new(user, src, "ChemReactionChamber", name)
|
||||
ui.open()
|
||||
|
||||
/obj/machinery/plumbing/reaction_chamber/ui_data(mob/user)
|
||||
var/list/data = list()
|
||||
var/list/text_reagents = list()
|
||||
for(var/A in required_reagents) //make a list where the key is text, because that looks alot better in the ui than a typepath
|
||||
var/datum/reagent/R = A
|
||||
text_reagents[initial(R.name)] = required_reagents[R]
|
||||
|
||||
data["reagents"] = text_reagents
|
||||
data["emptying"] = emptying
|
||||
return data
|
||||
|
||||
/obj/machinery/plumbing/reaction_chamber/ui_act(action, params)
|
||||
if(..())
|
||||
return
|
||||
. = TRUE
|
||||
switch(action)
|
||||
if("remove")
|
||||
var/reagent = get_chem_id(params["chem"])
|
||||
if(reagent)
|
||||
required_reagents.Remove(reagent)
|
||||
if("add")
|
||||
var/input_reagent = get_chem_id(params["chem"])
|
||||
if(input_reagent && !required_reagents.Find(input_reagent))
|
||||
var/input_amount = text2num(params["amount"])
|
||||
if(input_amount)
|
||||
required_reagents[input_reagent] = input_amount
|
||||
@@ -0,0 +1,50 @@
|
||||
///it splits the reagents however you want. So you can "every 60 units, 45 goes left and 15 goes straight". The side direction is EAST, you can change this in the component
|
||||
/obj/machinery/plumbing/splitter
|
||||
name = "Chemical Splitter"
|
||||
desc = "A chemical splitter for smart chemical factorization. Waits till a set of conditions is met and then stops all input and splits the buffer evenly or other in two ducts."
|
||||
icon_state = "splitter"
|
||||
buffer = 100
|
||||
density = FALSE
|
||||
|
||||
///constantly switches between TRUE and FALSE. TRUE means the batch tick goes straight, FALSE means the next batch goes in the side duct.
|
||||
var/turn_straight = TRUE
|
||||
///how much we must transfer straight. note input can be as high as 10 reagents per process, usually
|
||||
var/transfer_straight = 5
|
||||
///how much we must transfer to the side
|
||||
var/transfer_side = 5
|
||||
//the maximum you can set the transfer to
|
||||
var/max_transfer = 9
|
||||
|
||||
|
||||
/obj/machinery/plumbing/splitter/Initialize(mapload, bolt)
|
||||
. = ..()
|
||||
AddComponent(/datum/component/plumbing/splitter, bolt)
|
||||
|
||||
/obj/machinery/plumbing/splitter/ui_interact(mob/user, datum/tgui/ui)
|
||||
ui = SStgui.try_update_ui(user, src, ui)
|
||||
if(!ui)
|
||||
ui = new(user, src, "ChemSplitter", name)
|
||||
ui.open()
|
||||
|
||||
/obj/machinery/plumbing/splitter/ui_data(mob/user)
|
||||
var/list/data = list()
|
||||
data["straight"] = transfer_straight
|
||||
data["side"] = transfer_side
|
||||
data["max_transfer"] = max_transfer
|
||||
return data
|
||||
|
||||
/obj/machinery/plumbing/splitter/ui_act(action, params)
|
||||
if(..())
|
||||
return
|
||||
. = TRUE
|
||||
switch(action)
|
||||
if("set_amount")
|
||||
var/direction = params["target"]
|
||||
var/value = clamp(text2num(params["amount"]), 1, max_transfer)
|
||||
switch(direction)
|
||||
if("straight")
|
||||
transfer_straight = value
|
||||
if("side")
|
||||
transfer_side = value
|
||||
else
|
||||
return FALSE
|
||||
@@ -0,0 +1,111 @@
|
||||
///A single machine that produces a single chem. Can be placed in unison with others through plumbing to create chemical factories
|
||||
/obj/machinery/plumbing/synthesizer
|
||||
name = "chemical synthesizer"
|
||||
desc = "Produces a single chemical at a given volume. Must be plumbed. Most effective when working in unison with other chemical synthesizers, heaters and filters."
|
||||
|
||||
icon_state = "synthesizer"
|
||||
icon = 'icons/obj/plumbing/plumbers.dmi'
|
||||
rcd_cost = 25
|
||||
rcd_delay = 15
|
||||
|
||||
///Amount we produce for every process. Ideally keep under 5 since thats currently the standard duct capacity
|
||||
var/amount = 1
|
||||
///The maximum we can produce for every process
|
||||
buffer = 5
|
||||
///I track them here because I have no idea how I'd make tgui loop like that
|
||||
var/static/list/possible_amounts = list(0,1,2,3,4,5)
|
||||
///The reagent we are producing. We are a typepath, but are also typecast because there's several occations where we need to use initial.
|
||||
var/datum/reagent/reagent_id = null
|
||||
///straight up copied from chem dispenser. Being a subtype would be extremely tedious and making it global would restrict potential subtypes using different dispensable_reagents
|
||||
var/list/dispensable_reagents = list(
|
||||
/datum/reagent/aluminium,
|
||||
/datum/reagent/bromine,
|
||||
/datum/reagent/carbon,
|
||||
/datum/reagent/chlorine,
|
||||
/datum/reagent/copper,
|
||||
/datum/reagent/consumable/ethanol,
|
||||
/datum/reagent/fluorine,
|
||||
/datum/reagent/hydrogen,
|
||||
/datum/reagent/iodine,
|
||||
/datum/reagent/iron,
|
||||
/datum/reagent/lithium,
|
||||
/datum/reagent/mercury,
|
||||
/datum/reagent/nitrogen,
|
||||
/datum/reagent/oxygen,
|
||||
/datum/reagent/phosphorus,
|
||||
/datum/reagent/potassium,
|
||||
/datum/reagent/radium,
|
||||
/datum/reagent/silicon,
|
||||
/datum/reagent/silver,
|
||||
/datum/reagent/sodium,
|
||||
/datum/reagent/stable_plasma,
|
||||
/datum/reagent/consumable/sugar,
|
||||
/datum/reagent/sulfur,
|
||||
/datum/reagent/toxin/acid,
|
||||
/datum/reagent/water,
|
||||
/datum/reagent/fuel,
|
||||
)
|
||||
|
||||
/obj/machinery/plumbing/synthesizer/Initialize(mapload, bolt)
|
||||
. = ..()
|
||||
AddComponent(/datum/component/plumbing/simple_supply, bolt)
|
||||
|
||||
/obj/machinery/plumbing/synthesizer/process()
|
||||
if(stat & NOPOWER || !reagent_id || !amount)
|
||||
return
|
||||
if(reagents.total_volume >= amount) //otherwise we get leftovers, and we need this to be precise
|
||||
return
|
||||
reagents.add_reagent(reagent_id, amount)
|
||||
|
||||
/obj/machinery/plumbing/synthesizer/ui_interact(mob/user, datum/tgui/ui)
|
||||
ui = SStgui.try_update_ui(user, src, ui)
|
||||
if(!ui)
|
||||
ui = new(user, src, "ChemSynthesizer", name)
|
||||
ui.open()
|
||||
|
||||
/obj/machinery/plumbing/synthesizer/ui_data(mob/user)
|
||||
var/list/data = list()
|
||||
|
||||
var/is_hallucinating = user.hallucinating()
|
||||
var/list/chemicals = list()
|
||||
|
||||
for(var/A in dispensable_reagents)
|
||||
var/datum/reagent/R = GLOB.chemical_reagents_list[A]
|
||||
if(R)
|
||||
var/chemname = R.name
|
||||
if(is_hallucinating && prob(5))
|
||||
chemname = "[pick_list_replacements("hallucination.json", "chemicals")]"
|
||||
chemicals.Add(list(list("title" = chemname, "id" = ckey(R.name))))
|
||||
data["chemicals"] = chemicals
|
||||
data["amount"] = amount
|
||||
data["possible_amounts"] = possible_amounts
|
||||
|
||||
data["current_reagent"] = ckey(initial(reagent_id.name))
|
||||
return data
|
||||
|
||||
/obj/machinery/plumbing/synthesizer/ui_act(action, params)
|
||||
if(..())
|
||||
return
|
||||
. = TRUE
|
||||
switch(action)
|
||||
if("amount")
|
||||
var/new_amount = text2num(params["target"])
|
||||
if(new_amount in possible_amounts)
|
||||
amount = new_amount
|
||||
. = TRUE
|
||||
if("select")
|
||||
var/new_reagent = GLOB.name2reagent[params["reagent"]]
|
||||
if(new_reagent in dispensable_reagents)
|
||||
reagent_id = new_reagent
|
||||
. = TRUE
|
||||
update_icon()
|
||||
reagents.clear_reagents()
|
||||
|
||||
/obj/machinery/plumbing/synthesizer/update_overlays()
|
||||
. = ..()
|
||||
var/mutable_appearance/r_overlay = mutable_appearance(icon, "[icon_state]_overlay")
|
||||
if(reagent_id)
|
||||
r_overlay.color = initial(reagent_id.color)
|
||||
else
|
||||
r_overlay.color = "#FFFFFF"
|
||||
. += r_overlay
|
||||
@@ -1009,7 +1009,7 @@
|
||||
. = UI_INTERACTIVE
|
||||
|
||||
/obj/machinery/power/apc/ui_act(action, params)
|
||||
if(..() || !can_use(usr, 1) || (locked && area.hasSiliconAccessInArea(usr, PRIVILEDGES_SILICON|PRIVILEDGES_DRONE) && !failure_timer && action != "toggle_nightshift") || (integration_cog && (is_servant_of_ratvar(usr))))
|
||||
if(..() || !can_use(usr, 1) || (locked && !area.hasSiliconAccessInArea(usr, PRIVILEDGES_SILICON|PRIVILEDGES_DRONE) && !failure_timer && action != "toggle_nightshift" && (!integration_cog || !(is_servant_of_ratvar(usr)))))
|
||||
return
|
||||
switch(action)
|
||||
if("lock")
|
||||
|
||||
@@ -62,7 +62,8 @@
|
||||
var/no_pin_required = FALSE //whether the gun can be fired without a pin
|
||||
|
||||
var/obj/item/flashlight/gun_light
|
||||
var/can_flashlight = 0
|
||||
var/can_flashlight = FALSE
|
||||
var/gunlight_state = "flight"
|
||||
var/obj/item/kitchen/knife/bayonet
|
||||
var/mutable_appearance/knife_overlay
|
||||
var/can_bayonet = FALSE
|
||||
@@ -417,14 +418,7 @@
|
||||
return
|
||||
to_chat(user, "<span class='notice'>You attach \the [K] to the front of \the [src].</span>")
|
||||
bayonet = K
|
||||
var/state = "bayonet" //Generic state.
|
||||
if(bayonet.icon_state in icon_states('icons/obj/guns/bayonets.dmi')) //Snowflake state?
|
||||
state = bayonet.icon_state
|
||||
var/icon/bayonet_icons = 'icons/obj/guns/bayonets.dmi'
|
||||
knife_overlay = mutable_appearance(bayonet_icons, state)
|
||||
knife_overlay.pixel_x = knife_x_offset
|
||||
knife_overlay.pixel_y = knife_y_offset
|
||||
add_overlay(knife_overlay, TRUE)
|
||||
update_icon()
|
||||
else if(istype(I, /obj/item/screwdriver))
|
||||
if(gun_light)
|
||||
var/obj/item/flashlight/seclite/S = gun_light
|
||||
@@ -439,8 +433,7 @@
|
||||
var/obj/item/kitchen/knife/K = bayonet
|
||||
K.forceMove(get_turf(user))
|
||||
bayonet = null
|
||||
cut_overlay(knife_overlay, TRUE)
|
||||
knife_overlay = null
|
||||
update_icon()
|
||||
else
|
||||
return ..()
|
||||
|
||||
@@ -468,22 +461,35 @@
|
||||
set_light(gun_light.brightness_on, gun_light.flashlight_power, gun_light.light_color)
|
||||
else
|
||||
set_light(0)
|
||||
cut_overlays(flashlight_overlay, TRUE)
|
||||
var/state = "flight[gun_light.on? "_on":""]" //Generic state.
|
||||
else
|
||||
set_light(0)
|
||||
update_icon()
|
||||
for(var/X in actions)
|
||||
var/datum/action/A = X
|
||||
A.UpdateButtonIcon()
|
||||
|
||||
/obj/item/gun/update_overlays()
|
||||
. = ..()
|
||||
if(gun_light)
|
||||
var/mutable_appearance/flashlight_overlay
|
||||
var/state = "[gunlight_state][gun_light.on? "_on":""]" //Generic state.
|
||||
if(gun_light.icon_state in icon_states('icons/obj/guns/flashlights.dmi')) //Snowflake state?
|
||||
state = gun_light.icon_state
|
||||
flashlight_overlay = mutable_appearance('icons/obj/guns/flashlights.dmi', state)
|
||||
flashlight_overlay.pixel_x = flight_x_offset
|
||||
flashlight_overlay.pixel_y = flight_y_offset
|
||||
add_overlay(flashlight_overlay, TRUE)
|
||||
else
|
||||
set_light(0)
|
||||
cut_overlays(flashlight_overlay, TRUE)
|
||||
flashlight_overlay = null
|
||||
update_icon(TRUE)
|
||||
for(var/X in actions)
|
||||
var/datum/action/A = X
|
||||
A.UpdateButtonIcon()
|
||||
. += flashlight_overlay
|
||||
|
||||
if(bayonet)
|
||||
var/mutable_appearance/knife_overlay
|
||||
var/state = "bayonet" //Generic state.
|
||||
if(bayonet.icon_state in icon_states('icons/obj/guns/bayonets.dmi')) //Snowflake state?
|
||||
state = bayonet.icon_state
|
||||
var/icon/bayonet_icons = 'icons/obj/guns/bayonets.dmi'
|
||||
knife_overlay = mutable_appearance(bayonet_icons, state)
|
||||
knife_overlay.pixel_x = knife_x_offset
|
||||
knife_overlay.pixel_y = knife_y_offset
|
||||
. += knife_overlay
|
||||
|
||||
/obj/item/gun/item_action_slot_check(slot, mob/user, datum/action/A)
|
||||
if(istype(A, /datum/action/item_action/toggle_scope_zoom) && slot != SLOT_HANDS)
|
||||
|
||||
@@ -18,13 +18,15 @@
|
||||
/obj/item/gun/ballistic/automatic/proto/unrestricted
|
||||
pin = /obj/item/firing_pin
|
||||
|
||||
/obj/item/gun/ballistic/automatic/update_icon()
|
||||
..()
|
||||
/obj/item/gun/ballistic/automatic/update_overlays()
|
||||
. = ..()
|
||||
if(automatic_burst_overlay)
|
||||
if(!select)
|
||||
add_overlay("[initial(icon_state)]semi")
|
||||
. += ("[initial(icon_state)]semi")
|
||||
if(select == 1)
|
||||
add_overlay("[initial(icon_state)]burst")
|
||||
. += "[initial(icon_state)]burst"
|
||||
|
||||
/obj/item/gun/ballistic/automatic/update_icon_state()
|
||||
icon_state = "[initial(icon_state)][magazine ? "-[magazine.max_ammo]" : ""][chambered ? "" : "-e"][suppressed ? "-suppressed" : ""]"
|
||||
|
||||
/obj/item/gun/ballistic/automatic/attackby(obj/item/A, mob/user, params)
|
||||
@@ -115,8 +117,7 @@
|
||||
. = ..()
|
||||
empty_alarm()
|
||||
|
||||
/obj/item/gun/ballistic/automatic/c20r/update_icon()
|
||||
..()
|
||||
/obj/item/gun/ballistic/automatic/c20r/update_icon_state()
|
||||
icon_state = "c20r[magazine ? "-[CEILING(get_ammo(0)/4, 1)*4]" : ""][chambered ? "" : "-e"][suppressed ? "-suppressed" : ""]"
|
||||
|
||||
/obj/item/gun/ballistic/automatic/wt550
|
||||
@@ -141,9 +142,8 @@
|
||||
. = ..()
|
||||
spread = 0
|
||||
|
||||
/obj/item/gun/ballistic/automatic/wt550/update_icon()
|
||||
..()
|
||||
icon_state = "wt550[magazine ? "-[CEILING(( (get_ammo(FALSE) / magazine.max_ammo) * 20) /4, 1)*4]" : "-0"]" //Sprites only support up to 20.
|
||||
/obj/item/gun/ballistic/automatic/wt550/update_icon_state()
|
||||
icon_state = "wt550[magazine ? "-[CEILING(((get_ammo(FALSE) / magazine.max_ammo) * 20) /4, 1)*4]" : "-0"]" //Sprites only support up to 20.
|
||||
|
||||
/obj/item/gun/ballistic/automatic/mini_uzi
|
||||
name = "\improper Type U3 Uzi"
|
||||
@@ -160,6 +160,7 @@
|
||||
mag_type = /obj/item/ammo_box/magazine/m556
|
||||
fire_sound = 'sound/weapons/gunshot_smg.ogg'
|
||||
can_suppress = FALSE
|
||||
automatic_burst_overlay = FALSE
|
||||
var/obj/item/gun/ballistic/revolver/grenadelauncher/underbarrel
|
||||
burst_size = 3
|
||||
burst_shot_delay = 2
|
||||
@@ -191,18 +192,19 @@
|
||||
underbarrel.attackby(A, user, params)
|
||||
else
|
||||
..()
|
||||
/obj/item/gun/ballistic/automatic/m90/update_icon()
|
||||
..()
|
||||
cut_overlays()
|
||||
/obj/item/gun/ballistic/automatic/m90/update_overlays()
|
||||
. = ..()
|
||||
switch(select)
|
||||
if(0)
|
||||
add_overlay("[initial(icon_state)]semi")
|
||||
. += "[initial(icon_state)]semi"
|
||||
if(1)
|
||||
add_overlay("[initial(icon_state)]burst")
|
||||
. += "[initial(icon_state)]burst"
|
||||
if(2)
|
||||
add_overlay("[initial(icon_state)]gren")
|
||||
. += "[initial(icon_state)]gren"
|
||||
|
||||
/obj/item/gun/ballistic/automatic/m90/update_icon_state()
|
||||
icon_state = "[initial(icon_state)][magazine ? "" : "-e"]"
|
||||
return
|
||||
|
||||
/obj/item/gun/ballistic/automatic/m90/burst_select()
|
||||
var/mob/living/carbon/human/user = usr
|
||||
switch(select)
|
||||
@@ -257,6 +259,7 @@
|
||||
weapon_weight = WEAPON_MEDIUM
|
||||
mag_type = /obj/item/ammo_box/magazine/m12g
|
||||
fire_sound = 'sound/weapons/gunshot.ogg'
|
||||
automatic_burst_overlay = FALSE
|
||||
can_suppress = FALSE
|
||||
burst_size = 1
|
||||
pin = /obj/item/firing_pin/implant/pindicate
|
||||
@@ -269,10 +272,13 @@
|
||||
. = ..()
|
||||
update_icon()
|
||||
|
||||
/obj/item/gun/ballistic/automatic/shotgun/bulldog/update_icon()
|
||||
cut_overlays()
|
||||
/obj/item/gun/ballistic/automatic/shotgun/bulldog/update_icon_state()
|
||||
return
|
||||
|
||||
/obj/item/gun/ballistic/automatic/shotgun/bulldog/update_overlays()
|
||||
. = ..()
|
||||
if(magazine)
|
||||
add_overlay("[magazine.icon_state]")
|
||||
. += "[magazine.icon_state]"
|
||||
icon_state = "bulldog[chambered ? "" : "-e"]"
|
||||
|
||||
/obj/item/gun/ballistic/automatic/shotgun/bulldog/afterattack()
|
||||
@@ -298,6 +304,7 @@
|
||||
burst_shot_delay = 1
|
||||
spread = 7
|
||||
pin = /obj/item/firing_pin/implant/pindicate
|
||||
automatic_burst_overlay = FALSE
|
||||
|
||||
/obj/item/gun/ballistic/automatic/l6_saw/unrestricted
|
||||
pin = /obj/item/firing_pin
|
||||
@@ -316,7 +323,7 @@
|
||||
playsound(user, 'sound/weapons/sawclose.ogg', 60, 1)
|
||||
update_icon()
|
||||
|
||||
/obj/item/gun/ballistic/automatic/l6_saw/update_icon()
|
||||
/obj/item/gun/ballistic/automatic/l6_saw/update_icon_state()
|
||||
icon_state = "l6[cover_open ? "open" : "closed"][magazine ? CEILING(get_ammo(0)/12.5, 1)*25 : "-empty"][suppressed ? "-suppressed" : ""]"
|
||||
item_state = "l6[cover_open ? "openmag" : "closedmag"]"
|
||||
|
||||
@@ -369,9 +376,10 @@
|
||||
zoom_amt = 10 //Long range, enough to see in front of you, but no tiles behind you.
|
||||
zoom_out_amt = 13
|
||||
slot_flags = ITEM_SLOT_BACK
|
||||
automatic_burst_overlay = FALSE
|
||||
actions_types = list()
|
||||
|
||||
/obj/item/gun/ballistic/automatic/sniper_rifle/update_icon()
|
||||
/obj/item/gun/ballistic/automatic/sniper_rifle/update_icon_state()
|
||||
if(magazine)
|
||||
icon_state = "sniper-mag"
|
||||
else
|
||||
@@ -397,9 +405,10 @@
|
||||
can_suppress = TRUE
|
||||
w_class = WEIGHT_CLASS_HUGE
|
||||
slot_flags = ITEM_SLOT_BACK
|
||||
automatic_burst_overlay = FALSE
|
||||
actions_types = list()
|
||||
|
||||
/obj/item/gun/ballistic/automatic/surplus/update_icon()
|
||||
/obj/item/gun/ballistic/automatic/surplus/update_icon_state()
|
||||
if(magazine)
|
||||
icon_state = "surplus"
|
||||
else
|
||||
@@ -413,6 +422,7 @@
|
||||
icon_state = "oldrifle"
|
||||
item_state = "arg"
|
||||
mag_type = /obj/item/ammo_box/magazine/recharge
|
||||
automatic_burst_overlay = FALSE
|
||||
fire_delay = 2
|
||||
can_suppress = FALSE
|
||||
burst_size = 1
|
||||
@@ -420,7 +430,5 @@
|
||||
fire_sound = 'sound/weapons/laser.ogg'
|
||||
casing_ejector = FALSE
|
||||
|
||||
/obj/item/gun/ballistic/automatic/laser/update_icon()
|
||||
..()
|
||||
/obj/item/gun/ballistic/automatic/laser/update_icon_state()
|
||||
icon_state = "oldrifle[magazine ? "-[CEILING(get_ammo(0)/4, 1)*4]" : ""]"
|
||||
return
|
||||
|
||||
@@ -42,8 +42,7 @@
|
||||
actions_types = list()
|
||||
casing_ejector = FALSE
|
||||
|
||||
/obj/item/gun/ballistic/automatic/gyropistol/update_icon()
|
||||
..()
|
||||
/obj/item/gun/ballistic/automatic/gyropistol/update_icon_state()
|
||||
icon_state = "[initial(icon_state)][magazine ? "loaded" : ""]"
|
||||
|
||||
/obj/item/gun/ballistic/automatic/speargun
|
||||
@@ -54,6 +53,7 @@
|
||||
w_class = WEIGHT_CLASS_BULKY
|
||||
force = 10
|
||||
can_suppress = FALSE
|
||||
automatic_burst_overlay = FALSE
|
||||
mag_type = /obj/item/ammo_box/magazine/internal/speargun
|
||||
fire_sound = 'sound/weapons/grenadelaunch.ogg'
|
||||
burst_size = 1
|
||||
@@ -62,8 +62,9 @@
|
||||
actions_types = list()
|
||||
casing_ejector = FALSE
|
||||
|
||||
/obj/item/gun/ballistic/automatic/speargun/update_icon()
|
||||
return
|
||||
/obj/item/gun/ballistic/automatic/speargun/ComponentInitialize()
|
||||
. = ..()
|
||||
AddElement(/datum/element/update_icon_blocker)
|
||||
|
||||
/obj/item/gun/ballistic/automatic/speargun/attack_self()
|
||||
return
|
||||
@@ -137,7 +138,7 @@
|
||||
chamber_round()
|
||||
update_icon()
|
||||
|
||||
/obj/item/gun/ballistic/rocketlauncher/update_icon()
|
||||
/obj/item/gun/ballistic/rocketlauncher/update_icon_state()
|
||||
icon_state = "[initial(icon_state)]-[chambered ? "1" : "0"]"
|
||||
|
||||
/obj/item/gun/ballistic/rocketlauncher/suicide_act(mob/living/user)
|
||||
|
||||
@@ -75,8 +75,7 @@
|
||||
recoil = 2
|
||||
weapon_weight = WEAPON_HEAVY
|
||||
|
||||
/obj/item/gun/ballistic/automatic/magrifle/hyperburst/update_icon()
|
||||
..()
|
||||
/obj/item/gun/ballistic/automatic/magrifle/hyperburst/update_icon_state()
|
||||
icon_state = "hyperburst[magazine ? "-[get_ammo()]" : ""][chambered ? "" : "-e"]"
|
||||
|
||||
///magpistol///
|
||||
@@ -92,12 +91,14 @@
|
||||
fire_delay = 2
|
||||
inaccuracy_modifier = 0.25
|
||||
cell_type = /obj/item/stock_parts/cell/magnetic/pistol
|
||||
automatic_burst_overlay = FALSE
|
||||
|
||||
/obj/item/gun/ballistic/automatic/magrifle/pistol/update_icon()
|
||||
..()
|
||||
cut_overlays()
|
||||
/obj/item/gun/ballistic/automatic/magrifle/pistol/update_overlays()
|
||||
. = ..()
|
||||
if(magazine)
|
||||
add_overlay("magpistol-magazine")
|
||||
. += "magpistol-magazine"
|
||||
|
||||
/obj/item/gun/ballistic/automatic/magrifle/pistol/update_icon_state()
|
||||
icon_state = "[initial(icon_state)][chambered ? "" : "-e"]"
|
||||
|
||||
/obj/item/gun/ballistic/automatic/magrifle/pistol/nopin
|
||||
|
||||
@@ -8,12 +8,12 @@
|
||||
burst_size = 1
|
||||
fire_delay = 0
|
||||
actions_types = list()
|
||||
automatic_burst_overlay = FALSE
|
||||
|
||||
/obj/item/gun/ballistic/automatic/pistol/no_mag
|
||||
spawnwithmagazine = FALSE
|
||||
|
||||
/obj/item/gun/ballistic/automatic/pistol/update_icon()
|
||||
..()
|
||||
/obj/item/gun/ballistic/automatic/pistol/update_icon_state()
|
||||
icon_state = "[initial(icon_state)][chambered ? "" : "-e"][suppressed ? "-suppressed" : ""]"
|
||||
|
||||
/obj/item/gun/ballistic/automatic/pistol/suppressed/Initialize(mapload)
|
||||
@@ -28,6 +28,7 @@
|
||||
icon = 'modular_citadel/icons/obj/guns/cit_guns.dmi'
|
||||
icon_state = "cde"
|
||||
can_unsuppress = TRUE
|
||||
automatic_burst_overlay = FALSE
|
||||
obj_flags = UNIQUE_RENAME
|
||||
unique_reskin = list("Default" = "cde",
|
||||
"N-99" = "n99",
|
||||
@@ -38,20 +39,18 @@
|
||||
"PX4 Storm" = "px4"
|
||||
)
|
||||
|
||||
/obj/item/gun/ballistic/automatic/pistol/modular/update_icon()
|
||||
..()
|
||||
/obj/item/gun/ballistic/automatic/pistol/modular/update_icon_state()
|
||||
if(current_skin)
|
||||
icon_state = "[unique_reskin[current_skin]][chambered ? "" : "-e"][suppressed ? "-suppressed" : ""]"
|
||||
else
|
||||
icon_state = "[initial(icon_state)][chambered ? "" : "-e"][suppressed ? "-suppressed" : ""]"
|
||||
|
||||
/obj/item/gun/ballistic/automatic/pistol/modular/update_overlays()
|
||||
. = ..()
|
||||
if(magazine && suppressed)
|
||||
cut_overlays()
|
||||
add_overlay("[unique_reskin[current_skin]]-magazine-sup") //Yes, this means the default iconstate can't have a magazine overlay
|
||||
. += "[unique_reskin[current_skin]]-magazine-sup" //Yes, this means the default iconstate can't have a magazine overlay
|
||||
else if (magazine)
|
||||
cut_overlays()
|
||||
add_overlay("[unique_reskin[current_skin]]-magazine")
|
||||
else
|
||||
cut_overlays()
|
||||
. += "[unique_reskin[current_skin]]-magazine"
|
||||
|
||||
/obj/item/gun/ballistic/automatic/pistol/m1911
|
||||
name = "\improper M1911"
|
||||
@@ -77,14 +76,14 @@
|
||||
force = 14
|
||||
mag_type = /obj/item/ammo_box/magazine/m50
|
||||
can_suppress = FALSE
|
||||
automatic_burst_overlay = FALSE
|
||||
|
||||
/obj/item/gun/ballistic/automatic/pistol/deagle/update_icon()
|
||||
..()
|
||||
/obj/item/gun/ballistic/automatic/pistol/deagle/update_overlays()
|
||||
. = ..()
|
||||
if(magazine)
|
||||
cut_overlays()
|
||||
add_overlay("deagle_magazine")
|
||||
else
|
||||
cut_overlays()
|
||||
. += "deagle_magazine"
|
||||
|
||||
/obj/item/gun/ballistic/automatic/pistol/deagle/update_icon_state()
|
||||
icon_state = "[initial(icon_state)][chambered ? "" : "-e"]"
|
||||
|
||||
/obj/item/gun/ballistic/automatic/pistol/deagle/gold
|
||||
@@ -142,14 +141,14 @@
|
||||
actions_types = list()
|
||||
fire_sound = 'sound/weapons/blastcannon.ogg'
|
||||
spread = 20 //damn thing has no rifling.
|
||||
automatic_burst_overlay = FALSE
|
||||
|
||||
/obj/item/gun/ballistic/automatic/pistol/antitank/update_icon()
|
||||
..()
|
||||
/obj/item/gun/ballistic/automatic/pistol/antitank/update_overlays()
|
||||
. = ..()
|
||||
if(magazine)
|
||||
cut_overlays()
|
||||
add_overlay("atp-mag")
|
||||
else
|
||||
cut_overlays()
|
||||
. += "atp-mag"
|
||||
|
||||
/obj/item/gun/ballistic/automatic/pistol/antitank/update_icon_state()
|
||||
icon_state = "[initial(icon_state)][chambered ? "" : "-e"]"
|
||||
|
||||
/obj/item/gun/ballistic/automatic/pistol/antitank/syndicate
|
||||
|
||||
@@ -348,10 +348,10 @@
|
||||
else
|
||||
to_chat(user, "<span class='warning'>You need at least ten lengths of cable if you want to make a sling!</span>")
|
||||
|
||||
/obj/item/gun/ballistic/revolver/doublebarrel/improvised/update_icon()
|
||||
..()
|
||||
/obj/item/gun/ballistic/revolver/doublebarrel/improvised/update_overlays()
|
||||
. = ..()
|
||||
if(slung)
|
||||
icon_state += "sling"
|
||||
. += "[icon_state]sling"
|
||||
|
||||
/obj/item/gun/ballistic/revolver/doublebarrel/improvised/sawoff(mob/user)
|
||||
. = ..()
|
||||
|
||||
@@ -164,10 +164,10 @@
|
||||
else
|
||||
to_chat(user, "<span class='warning'>You need at least ten lengths of cable if you want to make a sling!</span>")
|
||||
|
||||
/obj/item/gun/ballistic/shotgun/boltaction/improvised/update_icon()
|
||||
..()
|
||||
/obj/item/gun/ballistic/shotgun/boltaction/improvised/update_overlays()
|
||||
. = ..()
|
||||
if(slung)
|
||||
icon_state += "sling"
|
||||
. += "[icon_state]sling"
|
||||
|
||||
/obj/item/gun/ballistic/shotgun/boltaction/enchanted
|
||||
name = "enchanted bolt action rifle"
|
||||
@@ -272,7 +272,7 @@
|
||||
spread = 2
|
||||
update_icon()
|
||||
|
||||
/obj/item/gun/ballistic/shotgun/automatic/combat/compact/update_icon()
|
||||
/obj/item/gun/ballistic/shotgun/automatic/combat/compact/update_icon_state()
|
||||
icon_state = "[current_skin ? unique_reskin[current_skin] : "cshotgun"][stock ? "" : "c"]"
|
||||
|
||||
//Dual Feed Shotgun
|
||||
|
||||
@@ -27,9 +27,9 @@
|
||||
burst_size = 1
|
||||
fire_delay = 0
|
||||
actions_types = list()
|
||||
automatic_burst_overlay = FALSE
|
||||
|
||||
/obj/item/gun/ballistic/automatic/toy/pistol/update_icon()
|
||||
..()
|
||||
/obj/item/gun/ballistic/automatic/toy/pistol/update_icon_state()
|
||||
icon_state = "[initial(icon_state)][chambered ? "" : "-e"][suppressed ? "-suppressed" : ""]"
|
||||
|
||||
/obj/item/gun/ballistic/automatic/toy/pistol/riot
|
||||
|
||||
@@ -29,7 +29,6 @@
|
||||
var/charge_sections = 4
|
||||
ammo_x_offset = 2
|
||||
var/shaded_charge = FALSE //if this gun uses a stateful charge bar for more detail
|
||||
var/old_ratio = 0 // stores the gun's previous ammo "ratio" to see if it needs an updated icon
|
||||
var/selfcharge = EGUN_NO_SELFCHARGE // EGUN_SELFCHARGE if true, EGUN_SELFCHARGE_BORG drains the cyborg's cell to recharge its own
|
||||
var/charge_tick = 0
|
||||
var/charge_delay = 4
|
||||
@@ -64,10 +63,20 @@
|
||||
START_PROCESSING(SSobj, src)
|
||||
update_icon()
|
||||
|
||||
/obj/item/gun/energy/ComponentInitialize()
|
||||
. = ..()
|
||||
AddElement(/datum/element/update_icon_updates_onmob)
|
||||
|
||||
/obj/item/gun/energy/Destroy()
|
||||
STOP_PROCESSING(SSobj, src)
|
||||
return ..()
|
||||
|
||||
/obj/item/gun/energy/handle_atom_del(atom/A)
|
||||
if(A == cell)
|
||||
cell = null
|
||||
update_icon()
|
||||
return ..()
|
||||
|
||||
/obj/item/gun/energy/examine(mob/user)
|
||||
. = ..()
|
||||
if(!right_click_overridden)
|
||||
@@ -226,46 +235,47 @@
|
||||
#undef DECREMENT_OR_WRAP
|
||||
#undef IS_VALID_INDEX
|
||||
|
||||
/obj/item/gun/energy/update_icon(force_update)
|
||||
if(QDELETED(src))
|
||||
/obj/item/gun/energy/update_icon_state()
|
||||
if(initial(item_state))
|
||||
return
|
||||
..()
|
||||
var/ratio = get_charge_ratio()
|
||||
var/new_item_state = ""
|
||||
new_item_state = initial(icon_state)
|
||||
if(modifystate)
|
||||
var/obj/item/ammo_casing/energy/shot = ammo_type[current_firemode_index]
|
||||
new_item_state += "[shot.select_name]"
|
||||
new_item_state += "[ratio]"
|
||||
item_state = new_item_state
|
||||
|
||||
/obj/item/gun/energy/update_overlays()
|
||||
. = ..()
|
||||
if(QDELETED(src))
|
||||
return
|
||||
if(!automatic_charge_overlays)
|
||||
return
|
||||
var/ratio = can_shoot() ? CEILING(clamp(cell.charge / cell.maxcharge, 0, 1) * charge_sections, 1) : 0
|
||||
// Sets the ratio to 0 if the gun doesn't have enough charge to fire, or if it's power cell is removed.
|
||||
// TG issues #5361 & #47908
|
||||
if(ratio == old_ratio && !force_update)
|
||||
return
|
||||
old_ratio = ratio
|
||||
cut_overlays()
|
||||
var/iconState = "[icon_state]_charge"
|
||||
var/itemState = null
|
||||
if(!initial(item_state))
|
||||
itemState = icon_state
|
||||
var/overlay_icon_state = "[icon_state]_charge"
|
||||
var/ratio = get_charge_ratio()
|
||||
if (modifystate)
|
||||
var/obj/item/ammo_casing/energy/shot = ammo_type[current_firemode_index]
|
||||
add_overlay("[icon_state]_[shot.select_name]")
|
||||
iconState += "_[shot.select_name]"
|
||||
if(itemState)
|
||||
itemState += "[shot.select_name]"
|
||||
. += "[icon_state]_[shot.select_name]"
|
||||
overlay_icon_state += "_[shot.select_name]"
|
||||
if(ratio == 0)
|
||||
add_overlay("[icon_state]_empty")
|
||||
. += "[icon_state]_empty"
|
||||
else
|
||||
if(!shaded_charge)
|
||||
var/mutable_appearance/charge_overlay = mutable_appearance(icon, iconState)
|
||||
var/mutable_appearance/charge_overlay = mutable_appearance(icon, overlay_icon_state)
|
||||
for(var/i = ratio, i >= 1, i--)
|
||||
charge_overlay.pixel_x = ammo_x_offset * (i - 1)
|
||||
charge_overlay.pixel_y = ammo_y_offset * (i - 1)
|
||||
add_overlay(charge_overlay)
|
||||
. += charge_overlay
|
||||
else
|
||||
add_overlay("[icon_state]_charge[ratio]")
|
||||
if(itemState)
|
||||
itemState += "[ratio]"
|
||||
item_state = itemState
|
||||
if(ismob(loc)) //forces inhands to update
|
||||
var/mob/M = loc
|
||||
M.update_inv_hands()
|
||||
. += "[icon_state]_charge[ratio]"
|
||||
|
||||
///Used by update_icon_state() and update_overlays()
|
||||
/obj/item/gun/energy/proc/get_charge_ratio()
|
||||
return can_shoot() ? CEILING(clamp(cell.charge / cell.maxcharge, 0, 1) * charge_sections, 1) : 0
|
||||
// Sets the ratio to 0 if the gun doesn't have enough charge to fire, or if its power cell is removed.
|
||||
|
||||
/obj/item/gun/energy/suicide_act(mob/living/user)
|
||||
if (istype(user) && can_shoot() && can_trigger_gun(user) && user.get_bodypart(BODY_ZONE_HEAD))
|
||||
|
||||
@@ -207,12 +207,11 @@
|
||||
to_chat(user,"<span class='notice'>You switch [src] setting to [setting] mode.</span>")
|
||||
update_icon()
|
||||
|
||||
/obj/item/gun/energy/dueling/update_icon(force_update)
|
||||
/obj/item/gun/energy/dueling/update_overlays(force_update)
|
||||
. = ..()
|
||||
if(setting_overlay)
|
||||
cut_overlay(setting_overlay)
|
||||
setting_overlay.icon_state = setting_iconstate()
|
||||
add_overlay(setting_overlay)
|
||||
. += setting_overlay
|
||||
|
||||
/obj/item/gun/energy/dueling/Destroy()
|
||||
if(duel)
|
||||
@@ -363,8 +362,7 @@
|
||||
STR.max_items = 2
|
||||
STR.can_hold = typecacheof(/obj/item/gun/energy/dueling)
|
||||
|
||||
/obj/item/storage/lockbox/dueling/update_icon()
|
||||
cut_overlays()
|
||||
/obj/item/storage/lockbox/dueling/update_icon_state()
|
||||
var/locked = SEND_SIGNAL(src, COMSIG_IS_STORAGE_LOCKED)
|
||||
if(locked)
|
||||
icon_state = "medalbox+l"
|
||||
|
||||
@@ -19,17 +19,13 @@
|
||||
cell_type = /obj/item/stock_parts/cell{charge = 600; maxcharge = 600}
|
||||
ammo_x_offset = 2
|
||||
charge_sections = 3
|
||||
gunlight_state = "mini-light"
|
||||
can_flashlight = 0 // Can't attach or detach the flashlight, and override it's icon update
|
||||
|
||||
/obj/item/gun/energy/e_gun/mini/Initialize()
|
||||
gun_light = new /obj/item/flashlight/seclite(src)
|
||||
return ..()
|
||||
|
||||
/obj/item/gun/energy/e_gun/mini/update_icon()
|
||||
..()
|
||||
if(gun_light && gun_light.on)
|
||||
add_overlay("mini-light")
|
||||
|
||||
/obj/item/gun/energy/e_gun/stun
|
||||
name = "tactical energy gun"
|
||||
desc = "Military issue energy gun, is able to fire stun rounds."
|
||||
@@ -138,15 +134,15 @@
|
||||
return
|
||||
fail_chance = min(fail_chance + round(15/severity), 100)
|
||||
|
||||
/obj/item/gun/energy/e_gun/nuclear/update_icon()
|
||||
..()
|
||||
/obj/item/gun/energy/e_gun/nuclear/update_overlays()
|
||||
. = ..()
|
||||
if(crit_fail)
|
||||
add_overlay("[icon_state]_fail_3")
|
||||
. += "[icon_state]_fail_3"
|
||||
else
|
||||
switch(fail_tick)
|
||||
if(0)
|
||||
add_overlay("[icon_state]_fail_0")
|
||||
. += "[icon_state]_fail_0"
|
||||
if(1 to 150)
|
||||
add_overlay("[icon_state]_fail_1")
|
||||
. += "[icon_state]_fail_1"
|
||||
if(151 to INFINITY)
|
||||
add_overlay("[icon_state]_fail_2")
|
||||
. += "[icon_state]_fail_2"
|
||||
|
||||
@@ -46,13 +46,6 @@
|
||||
range = 4
|
||||
log_override = TRUE
|
||||
|
||||
/obj/item/gun/energy/kinetic_accelerator/premiumka/update_icon()
|
||||
..()
|
||||
if(!can_shoot())
|
||||
add_overlay("[icon_state]_empty")
|
||||
else
|
||||
cut_overlays()
|
||||
|
||||
/obj/item/gun/energy/kinetic_accelerator/getinaccuracy(mob/living/user, bonus_spread, stamloss)
|
||||
var/old_fire_delay = fire_delay //It's pretty irrelevant tbh but whatever.
|
||||
fire_delay = overheat_time
|
||||
@@ -186,12 +179,10 @@
|
||||
update_icon()
|
||||
overheat = FALSE
|
||||
|
||||
/obj/item/gun/energy/kinetic_accelerator/update_icon()
|
||||
..()
|
||||
/obj/item/gun/energy/kinetic_accelerator/update_overlays()
|
||||
. = ..()
|
||||
if(!can_shoot())
|
||||
add_overlay("[icon_state]_empty")
|
||||
else
|
||||
cut_overlays()
|
||||
. += "[icon_state]_empty"
|
||||
|
||||
//Casing
|
||||
/obj/item/ammo_casing/energy/kinetic
|
||||
|
||||
@@ -34,11 +34,11 @@
|
||||
pin = null
|
||||
ammo_x_offset = 1
|
||||
|
||||
/obj/item/gun/energy/decloner/update_icon()
|
||||
/obj/item/gun/energy/decloner/update_overlays()
|
||||
..()
|
||||
var/obj/item/ammo_casing/energy/shot = ammo_type[current_firemode_index]
|
||||
if(!QDELETED(cell) && (cell.charge > shot.e_cost))
|
||||
add_overlay("decloner_spin")
|
||||
. += "decloner_spin"
|
||||
|
||||
/obj/item/gun/energy/floragun
|
||||
name = "floral somatoray"
|
||||
@@ -134,9 +134,10 @@
|
||||
tool_behaviour = TOOL_WELDER
|
||||
toolspeed = 0.7 //plasmacutters can be used as welders, and are faster than standard welders
|
||||
|
||||
/obj/item/gun/energy/plasmacutter/Initialize()
|
||||
/obj/item/gun/energy/plasmacutter/ComponentInitialize()
|
||||
. = ..()
|
||||
AddComponent(/datum/component/butchering, 25, 105, 0, 'sound/weapons/plasma_cutter.ogg')
|
||||
AddElement(/datum/element/update_icon_blocker)
|
||||
|
||||
/obj/item/gun/energy/plasmacutter/examine(mob/user)
|
||||
. = ..()
|
||||
@@ -166,9 +167,6 @@
|
||||
/obj/item/gun/energy/plasmacutter/use(amount)
|
||||
return cell.use(amount * 100)
|
||||
|
||||
/obj/item/gun/energy/plasmacutter/update_icon()
|
||||
return
|
||||
|
||||
/obj/item/gun/energy/plasmacutter/adv
|
||||
name = "advanced plasma cutter"
|
||||
icon_state = "adv_plasmacutter"
|
||||
@@ -183,11 +181,12 @@
|
||||
icon_state = "wormhole_projector"
|
||||
pin = null
|
||||
inaccuracy_modifier = 0.25
|
||||
automatic_charge_overlays = FALSE
|
||||
var/obj/effect/portal/p_blue
|
||||
var/obj/effect/portal/p_orange
|
||||
var/atmos_link = FALSE
|
||||
|
||||
/obj/item/gun/energy/wormhole_projector/update_icon()
|
||||
/obj/item/gun/energy/wormhole_projector/update_icon_state()
|
||||
icon_state = "[initial(icon_state)][current_firemode_index]"
|
||||
item_state = icon_state
|
||||
|
||||
@@ -256,8 +255,9 @@
|
||||
can_charge = 0
|
||||
use_cyborg_cell = 1
|
||||
|
||||
/obj/item/gun/energy/printer/update_icon()
|
||||
return
|
||||
/obj/item/gun/energy/printer/ComponentInitialize()
|
||||
. = ..()
|
||||
AddElement(/datum/element/update_icon_blocker)
|
||||
|
||||
/obj/item/gun/energy/printer/emp_act()
|
||||
return
|
||||
@@ -321,14 +321,14 @@
|
||||
inaccuracy_modifier = 0.25
|
||||
cell_type = /obj/item/stock_parts/cell/super
|
||||
ammo_type = list(/obj/item/ammo_casing/energy/emitter)
|
||||
automatic_charge_overlays = FALSE
|
||||
|
||||
/obj/item/gun/energy/emitter/update_icon()
|
||||
..()
|
||||
/obj/item/gun/energy/emitter/update_icon_state()
|
||||
var/obj/item/ammo_casing/energy/shot = ammo_type[current_firemode_index]
|
||||
if(!QDELETED(cell) && (cell.charge > shot.e_cost))
|
||||
add_overlay("emitter_carbine_empty")
|
||||
icon_state = "emitter_carbine_empty"
|
||||
else
|
||||
add_overlay("emitter_carbine")
|
||||
icon_state = "emitter_carbine"
|
||||
|
||||
//the pickle ray
|
||||
/obj/item/gun/energy/pickle_gun
|
||||
|
||||
@@ -35,6 +35,7 @@
|
||||
slowdown = 1
|
||||
item_flags = NO_MAT_REDEMPTION | SLOWS_WHILE_IN_HAND | NEEDS_PERMIT
|
||||
pin = null
|
||||
automatic_charge_overlays = FALSE
|
||||
var/aiming = FALSE
|
||||
var/aiming_time = 14
|
||||
var/aiming_time_fire_threshold = 5
|
||||
@@ -152,13 +153,13 @@
|
||||
current_zoom_x = 0
|
||||
current_zoom_y = 0
|
||||
|
||||
/obj/item/gun/energy/beam_rifle/update_icon()
|
||||
cut_overlays()
|
||||
/obj/item/gun/energy/beam_rifle/update_overlays()
|
||||
. = ..()
|
||||
var/obj/item/ammo_casing/energy/primary_ammo = ammo_type[1]
|
||||
if(!QDELETED(cell) && (cell.charge > primary_ammo.e_cost))
|
||||
add_overlay(charged_overlay)
|
||||
. += charged_overlay
|
||||
else
|
||||
add_overlay(drained_overlay)
|
||||
. += drained_overlay
|
||||
|
||||
/obj/item/gun/energy/beam_rifle/attack_self(mob/user)
|
||||
if(!structure_piercing)
|
||||
|
||||
@@ -41,18 +41,16 @@
|
||||
user.put_in_hands(bomb)
|
||||
user.visible_message("<span class='warning'>[user] detaches [bomb] from [src].</span>")
|
||||
bomb = null
|
||||
name = initial(name)
|
||||
desc = initial(desc)
|
||||
update_icon()
|
||||
return ..()
|
||||
|
||||
/obj/item/gun/blastcannon/update_icon()
|
||||
/obj/item/gun/blastcannon/update_icon_state()
|
||||
if(bomb)
|
||||
icon_state = icon_state_loaded
|
||||
name = "blast cannon"
|
||||
desc = "A makeshift device used to concentrate a bomb's blast energy to a narrow wave."
|
||||
else
|
||||
icon_state = initial(icon_state)
|
||||
name = initial(name)
|
||||
desc = initial(desc)
|
||||
|
||||
/obj/item/gun/blastcannon/attackby(obj/O, mob/user)
|
||||
if(istype(O, /obj/item/transfer_valve))
|
||||
@@ -65,6 +63,8 @@
|
||||
return FALSE
|
||||
user.visible_message("<span class='warning'>[user] attaches [T] to [src]!</span>")
|
||||
bomb = T
|
||||
name = "blast cannon"
|
||||
desc = "A makeshift device used to concentrate a bomb's blast energy to a narrow wave."
|
||||
update_icon()
|
||||
return TRUE
|
||||
return ..()
|
||||
|
||||
@@ -1165,3 +1165,9 @@
|
||||
random_reagents += R
|
||||
var/picked_reagent = pick(random_reagents)
|
||||
return picked_reagent
|
||||
|
||||
/proc/get_chem_id(chem_name)
|
||||
for(var/X in GLOB.chemical_reagents_list)
|
||||
var/datum/reagent/R = GLOB.chemical_reagents_list[X]
|
||||
if(ckey(chem_name) == ckey(lowertext(R.name)))
|
||||
return X
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
#define PILL_STYLE_COUNT 22 //Update this if you add more pill icons or you die
|
||||
#define RANDOM_PILL_STYLE 22 //Dont change this one though
|
||||
|
||||
/obj/machinery/chem_master
|
||||
name = "ChemMaster 3000"
|
||||
|
||||
@@ -36,6 +36,14 @@
|
||||
for(var/obj/item/stock_parts/matter_bin/B in component_parts)
|
||||
reagents.maximum_volume += REAGENTS_BASE_VOLUME * B.rating
|
||||
|
||||
/obj/machinery/smoke_machine/ComponentInitialize()
|
||||
. = ..()
|
||||
AddComponent(/datum/component/simple_rotation, ROTATION_ALTCLICK | ROTATION_CLOCKWISE | ROTATION_COUNTERCLOCKWISE | ROTATION_VERBS, null, CALLBACK(src, .proc/can_be_rotated))
|
||||
AddComponent(/datum/component/plumbing/simple_demand) //this SURELY CANT' LEAD TO BAD THINGS HAPPENING.
|
||||
|
||||
/obj/machinery/smoke_machine/proc/can_be_rotated(mob/user, rotation_type)
|
||||
return !anchored
|
||||
|
||||
/obj/machinery/smoke_machine/update_icon_state()
|
||||
if((!is_operational()) || (!on) || (reagents.total_volume == 0))
|
||||
if (panel_open)
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user