module things, jfc

This commit is contained in:
Poojawa
2018-09-11 07:51:01 -05:00
parent 8b9ef1e400
commit 284e9d0325
695 changed files with 11343 additions and 5661 deletions
+4 -5
View File
@@ -134,7 +134,7 @@ interface with the mining shuttle at the landing site if a mobile beacon is also
shuttleId = "mining" //The base can only be dropped once, so this gives the console a new purpose.
possible_destinations = "mining_home;mining_away;landing_zone_dock;mining_public"
/obj/machinery/computer/auxillary_base/proc/set_landing_zone(turf/T, mob/user, var/no_restrictions)
/obj/machinery/computer/auxillary_base/proc/set_landing_zone(turf/T, mob/user, no_restrictions)
var/obj/docking_port/mobile/auxillary_base/base_dock = locate(/obj/docking_port/mobile/auxillary_base) in SSshuttle.mobile
if(!base_dock) //Not all maps have an Aux base. This object is useless in that case.
to_chat(user, "<span class='warning'>This station is not equipped with an auxillary base. Please contact your Nanotrasen contractor.</span>")
@@ -151,8 +151,8 @@ interface with the mining shuttle at the landing site if a mobile beacon is also
if(!is_mining_level(T.z))
return BAD_ZLEVEL
var/colony_radius = CEILING(max(base_dock.width, base_dock.height)*0.5, 1)
var/list/colony_turfs = block(locate(T.x - colony_radius, T.y - colony_radius, T.z), locate(T.x + colony_radius, T.y + colony_radius, T.z))
var/list/colony_turfs = base_dock.return_ordered_turfs(T.x,T.y,T.z,base_dock.dir)
for(var/i in 1 to colony_turfs.len)
CHECK_TICK
var/turf/place = colony_turfs[i]
@@ -239,7 +239,6 @@ interface with the mining shuttle at the landing site if a mobile beacon is also
/obj/docking_port/mobile/auxillary_base
name = "auxillary base"
id = "colony_drop"
timid = FALSE
//Reminder to map-makers to set these values equal to the size of your base.
dheight = 4
dwidth = 4
@@ -355,7 +354,7 @@ interface with the mining shuttle at the landing site if a mobile beacon is also
qdel(Mport)
return
if(!mining_shuttle.canDock(Mport))
if(mining_shuttle.canDock(Mport) != SHUTTLE_CAN_DOCK)
to_chat(user, "<span class='warning'>Unable to secure a valid docking zone. Please try again in an open area near, but not within the aux. mining base.</span>")
SSshuttle.stationary.Remove(Mport)
qdel(Mport)
@@ -61,7 +61,7 @@
icon_state = "hostile_env"
item_state = "hostile_env"
clothing_flags = THICKMATERIAL //not spaceproof
max_heat_protection_temperature = FIRE_IMMUNITY_SUIT_MAX_TEMP_PROTECT
max_heat_protection_temperature = FIRE_IMMUNITY_MAX_TEMP_PROTECT
resistance_flags = FIRE_PROOF | LAVA_PROOF
slowdown = 0
armor = list("melee" = 70, "bullet" = 40, "laser" = 10, "energy" = 10, "bomb" = 50, "bio" = 100, "rad" = 100, "fire" = 100, "acid" = 100)
@@ -91,7 +91,7 @@
icon_state = "hostile_env"
item_state = "hostile_env"
w_class = WEIGHT_CLASS_NORMAL
max_heat_protection_temperature = FIRE_IMMUNITY_HELM_MAX_TEMP_PROTECT
max_heat_protection_temperature = FIRE_IMMUNITY_MAX_TEMP_PROTECT
clothing_flags = THICKMATERIAL // no space protection
armor = list("melee" = 70, "bullet" = 40, "laser" = 10, "energy" = 10, "bomb" = 50, "bio" = 100, "rad" = 100, "fire" = 100, "acid" = 100)
resistance_flags = FIRE_PROOF | LAVA_PROOF
@@ -72,6 +72,7 @@
C.total_damage += target_health - target.health //we did some damage, but let's not assume how much we did
/obj/item/twohanded/required/kinetic_crusher/afterattack(atom/target, mob/living/user, proximity_flag, clickparams)
. = ..()
if(!proximity_flag && charged)//Mark a target, or mine a tile.
var/turf/proj_turf = user.loc
if(!isturf(proj_turf))
@@ -16,6 +16,7 @@
var/revive_type = SENTIENCE_ORGANIC //So you can't revive boss monsters or robots with it
/obj/item/lazarus_injector/afterattack(atom/target, mob/user, proximity_flag)
. = ..()
if(!loaded)
return
if(isliving(target) && proximity_flag)
@@ -7,6 +7,7 @@
w_class = WEIGHT_CLASS_TINY
/obj/item/hivelordstabilizer/afterattack(obj/item/organ/M, mob/user)
. = ..()
var/obj/item/organ/regenerative_core/C = M
if(!istype(C, /obj/item/organ/regenerative_core))
to_chat(user, "<span class='warning'>The stabilizer only works on certain types of monster organs, generally regenerative in nature.</span>")
@@ -62,10 +63,11 @@
/obj/item/organ/regenerative_core/on_life()
..()
if(owner.health < HEALTH_THRESHOLD_CRIT)
if(owner.health < owner.crit_threshold)
ui_action_click()
/obj/item/organ/regenerative_core/afterattack(atom/target, mob/user, proximity_flag)
. = ..()
if(proximity_flag && ishuman(target))
var/mob/living/carbon/human/H = target
if(inert)
@@ -83,7 +85,6 @@
SSblackbox.record_feedback("nested tally", "hivelord_core", 1, list("[type]", "used", "self"))
H.revive(full_heal = 1)
qdel(src)
..()
/obj/item/organ/regenerative_core/Insert(mob/living/carbon/M, special = 0, drop_if_replaced = TRUE)
. = ..()
+1 -1
View File
@@ -100,7 +100,7 @@
playsound(T,'sound/weapons/resonator_blast.ogg',50,1)
for(var/mob/living/L in T)
if(creator)
add_logs(creator, L, "used a resonator field on", "resonator")
log_combat(creator, L, "used a resonator field on", "resonator")
to_chat(L, "<span class='userdanger'>[src] ruptured with you in it!</span>")
L.apply_damage(resonance_damage, BRUTE)
qdel(src)
@@ -175,8 +175,6 @@
desc = "A heated storage unit."
icon_state = "donkvendor"
icon = 'icons/obj/lavaland/donkvendor.dmi'
icon_on = "donkvendor"
icon_off = "donkvendor"
light_range = 5
light_power = 1.2
light_color = "#DDFFD3"
@@ -185,6 +183,9 @@
flags_1 = NODECONSTRUCT_1
var/empty = FALSE
/obj/machinery/smartfridge/survival_pod/update_icon()
return
/obj/machinery/smartfridge/survival_pod/Initialize(mapload)
. = ..()
if(empty)
@@ -247,11 +248,6 @@
. = ..()
air_update_turf(1)
/obj/structure/fans/Destroy()
var/turf/T = loc
. = ..()
T.air_update_turf(1)
//Inivisible, indestructible fans
/obj/structure/fans/tiny/invisible
name = "air flow blocker"
+1
View File
@@ -38,6 +38,7 @@ GLOBAL_LIST_EMPTY(total_extraction_beacons)
to_chat(user, "You link the extraction pack to the beacon system.")
/obj/item/extraction_pack/afterattack(atom/movable/A, mob/living/carbon/human/user, flag, params)
. = ..()
if(!beacon)
to_chat(user, "[src] is not linked to a beacon, and cannot be used.")
return
@@ -135,6 +135,7 @@ GLOBAL_LIST(labor_sheet_values)
/obj/machinery/mineral/stacking_machine/laborstacker
force_connect = TRUE
var/points = 0 //The unclaimed value of ore stacked.
/obj/machinery/mineral/stacking_machine/laborstacker/process_sheet(obj/item/stack/sheet/inp)
+5 -2
View File
@@ -152,6 +152,7 @@
resistance_flags = FLAMMABLE
max_integrity = 100
seed = /obj/item/seeds/lavaland/polypore
wine_power = 20
/obj/item/reagent_containers/food/snacks/grown/ash_flora/Initialize()
. = ..()
@@ -167,7 +168,7 @@
list_reagents = list("nutriment" = 3, "vitfro" = 2, "nicotine" = 2)
icon_state = "mushroom_leaf"
seed = /obj/item/seeds/lavaland/porcini
wine_power = 40
/obj/item/reagent_containers/food/snacks/grown/ash_flora/mushroom_cap
name = "mushroom cap"
@@ -175,7 +176,7 @@
list_reagents = list("mindbreaker" = 2, "entpoly" = 4, "mushroomhallucinogen" = 2)
icon_state = "mushroom_cap"
seed = /obj/item/seeds/lavaland/inocybe
wine_power = 70
/obj/item/reagent_containers/food/snacks/grown/ash_flora/mushroom_stem
name = "mushroom stem"
@@ -184,6 +185,7 @@
icon_state = "mushroom_stem"
light_range = 1
seed = /obj/item/seeds/lavaland/ember
wine_power = 60
/obj/item/reagent_containers/food/snacks/grown/ash_flora/cactus_fruit
name = "cactus fruit"
@@ -191,6 +193,7 @@
desc = "A cactus fruit covered in a thick, reddish skin. And some ash."
icon_state = "cactus_fruit"
seed = /obj/item/seeds/lavaland/cactus
wine_power = 50
/obj/item/reagent_containers/glass/bowl/mushroom_bowl
name = "mushroom bowl"
@@ -164,22 +164,22 @@
var/failText = "<span class='warning'>The snake seems unsatisfied with your incomplete oath and returns to it's previous place on the rod, returning to its dormant, wooden state. You must stand still while completing your oath!</span>"
to_chat(itemUser, "<span class='notice'>The wooden snake that was carved into the rod seems to suddenly come alive and begins to slither down your arm! The compulsion to help others grows abnormally strong...</span>")
if(do_after(itemUser, 40, target = itemUser))
itemUser.say("I swear to fulfill, to the best of my ability and judgment, this covenant:")
itemUser.say("I swear to fulfill, to the best of my ability and judgment, this covenant:", forced = "hippocratic oath")
else
to_chat(itemUser, failText)
return
if(do_after(itemUser, 20, target = itemUser))
itemUser.say("I will apply, for the benefit of the sick, all measures that are required, avoiding those twin traps of overtreatment and therapeutic nihilism.")
itemUser.say("I will apply, for the benefit of the sick, all measures that are required, avoiding those twin traps of overtreatment and therapeutic nihilism.", forced = "hippocratic oath")
else
to_chat(itemUser, failText)
return
if(do_after(itemUser, 30, target = itemUser))
itemUser.say("I will remember that I remain a member of society, with special obligations to all my fellow human beings, those sound of mind and body as well as the infirm.")
itemUser.say("I will remember that I remain a member of society, with special obligations to all my fellow human beings, those sound of mind and body as well as the infirm.", forced = "hippocratic oath")
else
to_chat(itemUser, failText)
return
if(do_after(itemUser, 30, target = itemUser))
itemUser.say("If I do not violate this oath, may I enjoy life and art, respected while I live and remembered with affection thereafter. May I always act so as to preserve the finest traditions of my calling and may I long experience the joy of healing those who seek my help.")
itemUser.say("If I do not violate this oath, may I enjoy life and art, respected while I live and remembered with affection thereafter. May I always act so as to preserve the finest traditions of my calling and may I long experience the joy of healing those who seek my help.", forced = "hippocratic oath")
else
to_chat(itemUser, failText)
return
@@ -434,10 +434,11 @@
//Immortality Talisman
/obj/item/immortality_talisman
name = "Immortality Talisman"
name = "\improper Immortality Talisman"
desc = "A dread talisman that can render you completely invulnerable."
icon = 'icons/obj/lavaland/artefacts.dmi'
icon_state = "talisman"
resistance_flags = INDESTRUCTIBLE | LAVA_PROOF | FIRE_PROOF | UNACIDABLE | ACID_PROOF
actions_types = list(/datum/action/item_action/immortality)
var/cooldown = 0
@@ -448,12 +449,6 @@
/datum/action/item_action/immortality
name = "Immortality"
/obj/item/immortality_talisman/Destroy(force)
if(force)
. = ..()
else
return QDEL_HINT_LETMELIVE
/obj/item/immortality_talisman/attack_self(mob/user)
if(cooldown < world.time)
SSblackbox.record_feedback("amount", "immortality_talisman_uses", 1)
@@ -467,6 +462,8 @@
user.notransform = 1
user.status_flags |= GODMODE
addtimer(CALLBACK(src, .proc/return_to_reality, user, Z), 100)
else
to_chat(user, "<span class='warning'>[src] is not ready yet!</span>")
/obj/item/immortality_talisman/proc/return_to_reality(mob/user, obj/effect/immortality_talisman/Z)
user.status_flags &= ~GODMODE
@@ -899,7 +896,7 @@
var/static/list/banned_turfs = typecacheof(list(/turf/open/space/transit, /turf/closed))
/obj/item/lava_staff/afterattack(atom/target, mob/user, proximity_flag, click_parameters)
..()
. = ..()
if(timer > world.time)
return
@@ -975,7 +972,7 @@
to_chat(user, "<span class='notice'>You shatter the bottle!</span>")
playsound(user.loc, 'sound/effects/glassbr1.ogg', 100, 1)
message_admins("<span class='adminnotice'>[ADMIN_LOOKUPFLW(user)] has activated a bottle of mayhem!</span>")
add_logs(user, null, "activated a bottle of mayhem", src)
log_combat(user, null, "activated a bottle of mayhem", src)
qdel(src)
/obj/item/blood_contract
@@ -1019,7 +1016,7 @@
var/datum/objective/survive/survive = new
survive.owner = L.mind
L.mind.objectives += survive
add_logs(user, L, "took out a blood contract on", src)
log_combat(user, L, "took out a blood contract on", src)
to_chat(L, "<span class='userdanger'>You've been marked for death! Don't let the demons get you! KILL THEM ALL!</span>")
L.add_atom_colour("#FF0000", ADMIN_COLOUR_PRIORITY)
var/obj/effect/mine/pickup/bloodbath/B = new(L)
@@ -1082,7 +1079,7 @@
to_chat(user, "<span class='hierophant_warning'>The[beacon ? " beacon is not currently":"re is a beacon"] attached.</span>")
/obj/item/hierophant_club/suicide_act(mob/living/user)
say("Xverwpsgexmrk...")
say("Xverwpsgexmrk...", forced = "hierophant club suicide")
user.visible_message("<span class='suicide'>[user] holds [src] into the air! It looks like [user.p_theyre()] trying to commit suicide!</span>")
new/obj/effect/temp_visual/hierophant/telegraph(get_turf(user))
playsound(user,'sound/machines/airlockopen.ogg', 75, TRUE)
@@ -1097,7 +1094,7 @@
qdel(user)
/obj/item/hierophant_club/afterattack(atom/target, mob/user, proximity_flag, click_parameters)
..()
. = ..()
var/turf/T = get_turf(target)
if(!T || timer > world.time)
return
@@ -1105,7 +1102,7 @@
timer = world.time + CLICK_CD_MELEE //by default, melee attacks only cause melee blasts, and have an accordingly short cooldown
if(proximity_flag)
INVOKE_ASYNC(src, .proc/aoe_burst, T, user)
add_logs(user, target, "fired 3x3 blast at", src)
log_combat(user, target, "fired 3x3 blast at", src)
else
if(ismineralturf(target) && get_dist(user, target) < 6) //target is minerals, we can hit it(even if we can't see it)
INVOKE_ASYNC(src, .proc/cardinal_blasts, T, user)
@@ -1117,10 +1114,10 @@
var/obj/effect/temp_visual/hierophant/chaser/C = new(get_turf(user), user, target, chaser_speed, friendly_fire_check)
C.damage = 30
C.monster_damage_boost = FALSE
add_logs(user, target, "fired a chaser at", src)
log_combat(user, target, "fired a chaser at", src)
else
INVOKE_ASYNC(src, .proc/cardinal_blasts, T, user) //otherwise, just do cardinal blast
add_logs(user, target, "fired cardinal blast at", src)
log_combat(user, target, "fired cardinal blast at", src)
else
to_chat(user, "<span class='warning'>That target is out of range!</span>" )
timer = world.time
@@ -1232,7 +1229,7 @@
INVOKE_ASYNC(src, .proc/prepare_icon_update)
beacon.icon_state = "hierophant_tele_off"
return
add_logs(user, beacon, "teleported self from [AREACOORD(source)] to")
user.log_message("teleported self from [AREACOORD(source)] to [beacon]")
new /obj/effect/temp_visual/hierophant/telegraph/teleport(T, user)
new /obj/effect/temp_visual/hierophant/telegraph/teleport(source, user)
for(var/t in RANGE_TURFS(1, T))
@@ -1279,7 +1276,7 @@
return
M.visible_message("<span class='hierophant_warning'>[M] fades in!</span>")
if(user != M)
add_logs(user, M, "teleported", null, "from [AREACOORD(source)]")
log_combat(user, M, "teleported", null, "from [AREACOORD(source)]")
/obj/item/hierophant_club/proc/cardinal_blasts(turf/T, mob/living/user) //fire cardinal cross blasts with a delay
if(!T)
+46 -61
View File
@@ -16,17 +16,20 @@
playsound(loc, pick(hit_sounds), 25, 1, -1)
if(isliving(user))
var/mob/living/L = user
SEND_SIGNAL(user, COMSIG_ADD_MOOD_EVENT, "exercise", /datum/mood_event/exercise)
L.apply_status_effect(STATUS_EFFECT_EXERCISED)
/obj/structure/stacklifter
/obj/structure/weightmachine
name = "Weight Machine"
desc = "Just looking at this thing makes you feel tired."
icon = 'goon/icons/obj/fitness.dmi'
icon_state = "fitnesslifter"
density = TRUE
anchored = TRUE
var/icon_state_inuse
/obj/structure/stacklifter/attack_hand(mob/living/user)
/obj/structure/weightmachine/proc/AnimateMachine(mob/living/user)
return
/obj/structure/weightmachine/attack_hand(mob/living/user)
. = ..()
if(.)
return
@@ -35,76 +38,58 @@
return
else
obj_flags |= IN_USE
icon_state = "fitnesslifter2"
icon_state = icon_state_inuse
user.setDir(SOUTH)
user.Stun(80)
user.forceMove(src.loc)
var/bragmessage = pick("pushing it to the limit","going into overdrive","burning with determination","rising up to the challenge", "getting strong now","getting ripped")
user.visible_message("<B>[user] is [bragmessage]!</B>")
var/lifts = 0
while (lifts++ < 6)
if (user.loc != src.loc)
break
sleep(3)
animate(user, pixel_y = -2, time = 3)
sleep(3)
animate(user, pixel_y = -4, time = 3)
sleep(3)
playsound(user, 'goon/sound/effects/spring.ogg', 60, 1)
AnimateMachine(user)
playsound(user, 'sound/machines/click.ogg', 60, 1)
obj_flags &= ~IN_USE
user.pixel_y = 0
var/finishmessage = pick("You feel stronger!","You feel like you can take on the world!","You feel robust!","You feel indestructible!")
icon_state = "fitnesslifter"
SEND_SIGNAL(user, COMSIG_ADD_MOOD_EVENT, "exercise", /datum/mood_event/exercise)
icon_state = initial(icon_state)
to_chat(user, finishmessage)
user.apply_status_effect(STATUS_EFFECT_EXERCISED)
/obj/structure/weightlifter
name = "Weight Machine"
desc = "Just looking at this thing makes you feel tired."
/obj/structure/weightmachine/stacklifter
icon = 'goon/icons/obj/fitness.dmi'
icon_state = "fitnesslifter"
icon_state_inuse = "fitnesslifter2"
/obj/structure/weightmachine/stacklifter/AnimateMachine(mob/living/user)
var/lifts = 0
while (lifts++ < 6)
if (user.loc != src.loc)
break
sleep(3)
animate(user, pixel_y = -2, time = 3)
sleep(3)
animate(user, pixel_y = -4, time = 3)
sleep(3)
playsound(user, 'goon/sound/effects/spring.ogg', 60, 1)
/obj/structure/weightmachine/weightlifter
icon = 'goon/icons/obj/fitness.dmi'
icon_state = "fitnessweight"
density = TRUE
anchored = TRUE
icon_state_inuse = "fitnessweight-c"
/obj/structure/weightlifter/attack_hand(mob/living/user)
. = ..()
if(.)
return
if(obj_flags & IN_USE)
to_chat(user, "It's already in use - wait a bit.")
return
else
obj_flags |= IN_USE
icon_state = "fitnessweight-c"
user.setDir(SOUTH)
user.Stun(80)
user.forceMove(src.loc)
var/mutable_appearance/swole_overlay = mutable_appearance(icon, "fitnessweight-w", WALL_OBJ_LAYER)
add_overlay(swole_overlay)
var/bragmessage = pick("pushing it to the limit","going into overdrive","burning with determination","rising up to the challenge", "getting strong now","getting ripped")
user.visible_message("<B>[user] is [bragmessage]!</B>")
var/reps = 0
user.pixel_y = 5
while (reps++ < 6)
if (user.loc != src.loc)
break
for (var/innerReps = max(reps, 1), innerReps > 0, innerReps--)
sleep(3)
animate(user, pixel_y = (user.pixel_y == 3) ? 5 : 3, time = 3)
playsound(user, 'goon/sound/effects/spring.ogg', 60, 1)
sleep(3)
animate(user, pixel_y = 2, time = 3)
sleep(3)
playsound(user, 'sound/machines/click.ogg', 60, 1)
obj_flags &= ~IN_USE
animate(user, pixel_y = 0, time = 3)
var/finishmessage = pick("You feel stronger!","You feel like you can take on the world!","You feel robust!","You feel indestructible!")
icon_state = "fitnessweight"
cut_overlay(swole_overlay)
to_chat(user, "[finishmessage]")
user.apply_status_effect(STATUS_EFFECT_EXERCISED)
/obj/structure/weightmachine/weightlifter/AnimateMachine(mob/living/user)
var/mutable_appearance/swole_overlay = mutable_appearance(icon, "fitnessweight-w", WALL_OBJ_LAYER)
add_overlay(swole_overlay)
var/reps = 0
user.pixel_y = 5
while (reps++ < 6)
if (user.loc != src.loc)
break
for (var/innerReps = max(reps, 1), innerReps > 0, innerReps--)
sleep(3)
animate(user, pixel_y = (user.pixel_y == 3) ? 5 : 3, time = 3)
playsound(user, 'goon/sound/effects/spring.ogg', 60, 1)
sleep(3)
animate(user, pixel_y = 2, time = 3)
sleep(3)
cut_overlay(swole_overlay)
+1 -1
View File
@@ -82,7 +82,7 @@
/obj/machinery/mineral/processing_unit/Initialize()
. = ..()
proximity_monitor = new(src, 1)
AddComponent(/datum/component/material_container, list(MAT_METAL, MAT_GLASS, MAT_SILVER, MAT_GOLD, MAT_DIAMOND, MAT_PLASMA, MAT_URANIUM, MAT_BANANIUM, MAT_TITANIUM, MAT_BLUESPACE), INFINITY, TRUE, list(/obj/item/stack))
AddComponent(/datum/component/material_container, list(MAT_METAL, MAT_GLASS, MAT_SILVER, MAT_GOLD, MAT_DIAMOND, MAT_PLASMA, MAT_URANIUM, MAT_BANANIUM, MAT_TITANIUM, MAT_BLUESPACE), INFINITY, TRUE, /obj/item/stack)
stored_research = new /datum/techweb/specialized/autounlocking/smelter
/obj/machinery/mineral/processing_unit/Destroy()
+69 -62
View File
@@ -13,7 +13,6 @@
speed_process = TRUE
circuit = /obj/item/circuitboard/machine/ore_redemption
layer = BELOW_OBJ_LAYER
var/req_access_reclaim = ACCESS_MINING_STATION
var/obj/item/card/id/inserted_id
var/points = 0
var/ore_pickup_rate = 15
@@ -24,11 +23,12 @@
var/list/ore_buffer = list()
var/datum/techweb/stored_research
var/obj/item/disk/design_disk/inserted_disk
var/datum/component/remote_materials/materials
/obj/machinery/mineral/ore_redemption/Initialize()
/obj/machinery/mineral/ore_redemption/Initialize(mapload)
. = ..()
AddComponent(/datum/component/material_container, list(MAT_METAL, MAT_GLASS, MAT_SILVER, MAT_GOLD, MAT_DIAMOND, MAT_PLASMA, MAT_URANIUM, MAT_BANANIUM, MAT_TITANIUM, MAT_BLUESPACE),INFINITY, FALSE, list(/obj/item/stack))
stored_research = new /datum/techweb/specialized/autounlocking/smelter
materials = AddComponent(/datum/component/remote_materials, "orm", mapload)
/obj/machinery/mineral/ore_redemption/Destroy()
QDEL_NULL(stored_research)
@@ -49,35 +49,43 @@
sheet_per_ore = sheet_per_ore_temp
/obj/machinery/mineral/ore_redemption/proc/smelt_ore(obj/item/stack/ore/O)
var/datum/component/material_container/mat_container = materials.mat_container
if (!mat_container)
return
ore_buffer -= O
if(O && O.refined_type)
points += O.points * point_upgrade * O.amount
GET_COMPONENT(materials, /datum/component/material_container)
var/material_amount = materials.get_item_material_amount(O)
var/material_amount = mat_container.get_item_material_amount(O)
if(!material_amount)
qdel(O) //no materials, incinerate it
else if(!materials.has_space(material_amount * sheet_per_ore * O.amount)) //if there is no space, eject it
else if(!mat_container.has_space(material_amount * sheet_per_ore * O.amount)) //if there is no space, eject it
unload_mineral(O)
else
materials.insert_item(O, sheet_per_ore) //insert it
var/mats = O.materials & mat_container.materials
var/amount = O.amount
var/id = inserted_id && inserted_id.registered_name
if (id)
id = " (ID: [id])"
mat_container.insert_item(O, sheet_per_ore) //insert it
materials.silo_log(src, "smelted", amount, "ores[id]", mats)
qdel(O)
/obj/machinery/mineral/ore_redemption/proc/can_smelt_alloy(datum/design/D)
if(D.make_reagents.len)
var/datum/component/material_container/mat_container = materials.mat_container
if(!mat_container || D.make_reagents.len)
return FALSE
var/build_amount = 0
GET_COMPONENT(materials, /datum/component/material_container)
for(var/mat_id in D.materials)
var/M = D.materials[mat_id]
var/datum/material/redemption_mat = materials.materials[mat_id]
var/datum/material/redemption_mat = mat_container.materials[mat_id]
if(!M || !redemption_mat)
return FALSE
@@ -102,17 +110,18 @@
smelt_ore(ore)
/obj/machinery/mineral/ore_redemption/proc/send_console_message()
if(!is_station_level(z))
var/datum/component/material_container/mat_container = materials.mat_container
if(!mat_container || !is_station_level(z))
return
message_sent = TRUE
var/area/A = get_area(src)
var/msg = "Now available in [A]:<br>"
var/has_minerals = FALSE
GET_COMPONENT(materials, /datum/component/material_container)
for(var/mat_id in materials.materials)
var/datum/material/M = materials.materials[mat_id]
for(var/mat_id in mat_container.materials)
var/datum/material/M = mat_container.materials[mat_id]
var/mineral_amount = M.amount / MINERAL_MATERIAL_AMOUNT
if(mineral_amount)
has_minerals = TRUE
@@ -126,7 +135,7 @@
D.createmessage("Ore Redemption Machine", "New minerals available!", msg, 1, 0)
/obj/machinery/mineral/ore_redemption/process()
if(panel_open || !powered())
if(!materials.mat_container || panel_open || !powered())
return
var/atom/input = get_step(src, input_dir)
var/obj/structure/ore_box/OB = locate() in input
@@ -147,10 +156,6 @@
send_console_message()
/obj/machinery/mineral/ore_redemption/attackby(obj/item/W, mob/user, params)
GET_COMPONENT(materials, /datum/component/material_container)
if(default_pry_open(W))
materials.retrieve_all()
return
if(default_unfasten_wrench(user, W))
return
if(default_deconstruction_screwdriver(user, "ore_redemption-open", "ore_redemption", W))
@@ -170,22 +175,18 @@
interact(user)
return
if(istype(W, /obj/item/multitool) && panel_open)
input_dir = turn(input_dir, -90)
output_dir = turn(output_dir, -90)
to_chat(user, "<span class='notice'>You change [src]'s I/O settings, setting the input to [dir2text(input_dir)] and the output to [dir2text(output_dir)].</span>")
return
if(istype(W, /obj/item/disk/design_disk))
if(user.transferItemToLoc(W, src))
inserted_disk = W
return TRUE
return ..()
/obj/machinery/mineral/ore_redemption/on_deconstruction()
GET_COMPONENT(materials, /datum/component/material_container)
materials.retrieve_all()
..()
/obj/machinery/mineral/ore_redemption/multitool_act(mob/living/user, obj/item/multitool/I)
if (panel_open)
input_dir = turn(input_dir, -90)
output_dir = turn(output_dir, -90)
to_chat(user, "<span class='notice'>You change [src]'s I/O settings, setting the input to [dir2text(input_dir)] and the output to [dir2text(output_dir)].</span>")
return TRUE
/obj/machinery/mineral/ore_redemption/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state)
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
@@ -201,16 +202,25 @@
data["claimedPoints"] = inserted_id.mining_points
data["materials"] = list()
GET_COMPONENT(materials, /datum/component/material_container)
for(var/mat_id in materials.materials)
var/datum/material/M = materials.materials[mat_id]
var/sheet_amount = M.amount ? M.amount / MINERAL_MATERIAL_AMOUNT : "0"
data["materials"] += list(list("name" = M.name, "id" = M.id, "amount" = sheet_amount, "value" = ore_values[M.id] * point_upgrade))
var/datum/component/material_container/mat_container = materials.mat_container
if (mat_container)
for(var/mat_id in mat_container.materials)
var/datum/material/M = mat_container.materials[mat_id]
var/sheet_amount = M.amount ? M.amount / MINERAL_MATERIAL_AMOUNT : "0"
data["materials"] += list(list("name" = M.name, "id" = M.id, "amount" = sheet_amount, "value" = ore_values[M.id] * point_upgrade))
data["alloys"] = list()
for(var/v in stored_research.researched_designs)
var/datum/design/D = stored_research.researched_designs[v]
data["alloys"] += list(list("name" = D.name, "id" = D.id, "amount" = can_smelt_alloy(D)))
if (!mat_container)
data["disconnected"] = "local mineral storage is unavailable"
else if (!materials.silo)
data["disconnected"] = "no ore silo connection is available; storing locally"
else if (materials.on_hold())
data["disconnected"] = "mineral withdrawal is on hold"
data["alloys"] = list()
for(var/v in stored_research.researched_designs)
var/datum/design/D = stored_research.researched_designs[v]
data["alloys"] += list(list("name" = D.name, "id" = D.id, "amount" = can_smelt_alloy(D)))
data["diskDesigns"] = list()
if(inserted_disk)
data["hasDisk"] = TRUE
@@ -225,7 +235,7 @@
/obj/machinery/mineral/ore_redemption/ui_act(action, params)
if(..())
return
GET_COMPONENT(materials, /datum/component/material_container)
var/datum/component/material_container/mat_container = materials.mat_container
switch(action)
if("Eject")
if(!inserted_id)
@@ -248,12 +258,17 @@
points = 0
return TRUE
if("Release")
if(check_access(inserted_id) || allowed(usr)) //Check the ID inside, otherwise check the user
if(!mat_container)
return
if(materials.on_hold())
to_chat(usr, "<span class='warning'>Mineral access is on hold, please contact the quartermaster.</span>")
else if(!check_access(inserted_id) && !allowed(usr)) //Check the ID inside, otherwise check the user
to_chat(usr, "<span class='warning'>Required access not found.</span>")
else
var/mat_id = params["id"]
if(!materials.materials[mat_id])
if(!mat_container.materials[mat_id])
return
var/datum/material/mat = materials.materials[mat_id]
var/datum/material/mat = mat_container.materials[mat_id]
var/stored_amount = mat.amount / MINERAL_MATERIAL_AMOUNT
if(!stored_amount)
@@ -266,10 +281,10 @@
desired = input("How many sheets?", "How many sheets would you like to smelt?", 1) as null|num
var/sheets_to_remove = round(min(desired,50,stored_amount))
materials.retrieve_sheets(sheets_to_remove, mat_id, get_step(src, output_dir))
else
to_chat(usr, "<span class='warning'>Required access not found.</span>")
var/count = mat_container.retrieve_sheets(sheets_to_remove, mat_id, get_step(src, output_dir))
var/list/mats = list()
mats[mat_id] = MINERAL_MATERIAL_AMOUNT
materials.silo_log(src, "released", -count, "sheets", mats)
return TRUE
if("diskInsert")
var/obj/item/disk/design_disk/disk = usr.get_active_held_item()
@@ -291,6 +306,11 @@
stored_research.add_design(inserted_disk.blueprints[n])
return TRUE
if("Smelt")
if(!mat_container)
return
if(materials.on_hold())
to_chat(usr, "<span class='warning'>Mineral access is on hold, please contact the quartermaster.</span>")
return
var/alloy_id = params["id"]
var/datum/design/alloy = stored_research.isDesignResearchedID(alloy_id)
if((check_access(inserted_id) || allowed(usr)) && alloy)
@@ -301,7 +321,8 @@
else
desired = input("How many sheets?", "How many sheets would you like to smelt?", 1) as null|num
var/amount = round(min(desired,50,smelt_amount))
materials.use_amount(alloy.materials, amount)
mat_container.use_amount(alloy.materials, amount)
materials.silo_log(src, "released", -amount, "sheets", alloy.materials)
var/output
if(ispath(alloy.build_path, /obj/item/stack/sheet))
output = new alloy.build_path(src, amount)
@@ -311,20 +332,6 @@
else
to_chat(usr, "<span class='warning'>Required access not found.</span>")
return TRUE
if("SmeltAll")
var/alloy_id = params["id"]
var/datum/design/alloy = stored_research.isDesignResearchedID(alloy_id)
if((check_access(inserted_id) || allowed(usr)) && alloy)
var/smelt_amount = can_smelt_alloy(alloy)
while(smelt_amount > 0)
materials.use_amount(alloy.materials)
smelt_amount--
var/output = new alloy.build_path(src)
unload_mineral(output)
CHECK_TICK
else
to_chat(usr, "<span class='warning'>Required access not found.</span>")
return TRUE
/obj/machinery/mineral/ore_redemption/ex_act(severity, target)
do_sparks(5, TRUE, src)
+234
View File
@@ -0,0 +1,234 @@
GLOBAL_DATUM(ore_silo_default, /obj/machinery/ore_silo)
GLOBAL_LIST_EMPTY(silo_access_logs)
/obj/machinery/ore_silo
name = "ore silo"
desc = "An all-in-one bluespace storage and transmission system for the station's mineral distribution needs."
icon = 'icons/obj/mining.dmi'
icon_state = "silo"
density = TRUE
circuit = /obj/item/circuitboard/machine/ore_silo
var/list/holds = list()
var/list/datum/component/remote_materials/connected = list()
var/log_page = 1
/obj/machinery/ore_silo/Initialize(mapload)
. = ..()
AddComponent(/datum/component/material_container,
list(MAT_METAL, MAT_GLASS, MAT_SILVER, MAT_GOLD, MAT_DIAMOND, MAT_PLASMA, MAT_URANIUM, MAT_BANANIUM, MAT_TITANIUM, MAT_BLUESPACE, MAT_PLASTIC),
INFINITY,
FALSE,
/obj/item/stack,
null,
null,
TRUE)
if (!GLOB.ore_silo_default && mapload && is_station_level(z))
GLOB.ore_silo_default = src
/obj/machinery/ore_silo/Destroy()
if (GLOB.ore_silo_default == src)
GLOB.ore_silo_default = null
for(var/C in connected)
var/datum/component/remote_materials/mats = C
mats.disconnect_from(src)
GET_COMPONENT(materials, /datum/component/material_container)
materials.retrieve_all()
return ..()
/obj/machinery/ore_silo/proc/remote_attackby(obj/machinery/M, mob/user, obj/item/stack/I)
GET_COMPONENT(materials, /datum/component/material_container)
// stolen from /datum/component/material_container/proc/OnAttackBy
if(user.a_intent != INTENT_HELP)
return
if(I.item_flags & ABSTRACT)
return
if(!istype(I) || (I.flags_1 & HOLOGRAM_1) || (I.item_flags & NO_MAT_REDEMPTION))
to_chat(user, "<span class='warning'>[M] won't accept [I]!</span>")
return
var/item_mats = I.materials & materials.materials
if(!length(item_mats))
to_chat(user, "<span class='warning'>[I] does not contain sufficient materials to be accepted by [M].</span>")
return
// assumes unlimited space...
var/amount = I.amount
materials.user_insert(I, user)
silo_log(M, "deposited", amount, "sheets", item_mats)
return TRUE
/obj/machinery/ore_silo/attackby(obj/item/W, mob/user, params)
if (istype(W, /obj/item/stack))
return remote_attackby(src, user, W)
return ..()
/obj/machinery/ore_silo/ui_interact(mob/user)
user.set_machine(src)
var/datum/browser/popup = new(user, "ore_silo", null, 600, 550)
popup.set_content(generate_ui())
popup.open()
/obj/machinery/ore_silo/proc/generate_ui()
GET_COMPONENT(materials, /datum/component/material_container)
var/list/ui = list("<head><title>Ore Silo</title></head><body><div class='statusDisplay'><h2>Stored Material:</h2>")
var/any = FALSE
for(var/M in materials.materials)
var/datum/material/mat = materials.materials[M]
var/sheets = round(mat.amount) / MINERAL_MATERIAL_AMOUNT
if (sheets)
if (sheets >= 1)
ui += "<a href='?src=[REF(src)];ejectsheet=[mat.id];eject_amt=1'>Eject</a>"
else
ui += "<span class='linkOff'>Eject</span>"
if (sheets >= 20)
ui += "<a href='?src=[REF(src)];ejectsheet=[mat.id];eject_amt=20'>20x</a>"
else
ui += "<span class='linkOff'>20x</span>"
ui += "<b>[mat.name]</b>: [sheets] sheets<br>"
any = TRUE
if(!any)
ui += "Nothing!"
ui += "</div><div class='statusDisplay'><h2>Connected Machines:</h2>"
for(var/C in connected)
var/datum/component/remote_materials/mats = C
var/atom/parent = mats.parent
var/hold_key = "[get_area(parent)]/[mats.category]"
ui += "<a href='?src=[REF(src)];remove=[REF(mats)]'>Remove</a>"
ui += "<a href='?src=[REF(src)];hold[!holds[hold_key]]=[url_encode(hold_key)]'>[holds[hold_key] ? "Allow" : "Hold"]</a>"
ui += " <b>[parent.name]</b> in [get_area_name(parent, TRUE)]<br>"
if(!connected.len)
ui += "Nothing!"
ui += "</div><div class='statusDisplay'><h2>Access Logs:</h2>"
var/list/logs = GLOB.silo_access_logs[REF(src)]
var/len = LAZYLEN(logs)
var/num_pages = 1 + round((len - 1) / 30)
var/page = CLAMP(log_page, 1, num_pages)
if(num_pages > 1)
for(var/i in 1 to num_pages)
if(i == page)
ui += "<span class='linkOff'>[i]</span>"
else
ui += "<a href='?src=[REF(src)];page=[i]'>[i]</a>"
ui += "<ol>"
any = FALSE
for(var/i in (page - 1) * 30 + 1 to min(page * 30, len))
var/datum/ore_silo_log/entry = logs[i]
ui += "<li value=[len + 1 - i]>[entry.formatted]</li>"
any = TRUE
if (!any)
ui += "<li>Nothing!</li>"
ui += "</ol></div>"
return ui.Join()
/obj/machinery/ore_silo/Topic(href, href_list)
if(..())
return
add_fingerprint(usr)
usr.set_machine(src)
if(href_list["remove"])
var/datum/component/remote_materials/mats = locate(href_list["remove"]) in connected
if (mats)
mats.disconnect_from(src)
connected -= mats
updateUsrDialog()
return TRUE
else if(href_list["hold1"])
holds[href_list["hold1"]] = TRUE
updateUsrDialog()
return TRUE
else if(href_list["hold0"])
holds -= href_list["hold0"]
updateUsrDialog()
return TRUE
else if(href_list["ejectsheet"])
var/eject_sheet = href_list["ejectsheet"]
GET_COMPONENT(materials, /datum/component/material_container)
var/count = materials.retrieve_sheets(text2num(href_list["eject_amt"]), eject_sheet, drop_location())
var/list/matlist = list()
matlist[eject_sheet] = MINERAL_MATERIAL_AMOUNT
silo_log(src, "ejected", -count, "sheets", matlist)
return TRUE
else if(href_list["page"])
log_page = text2num(href_list["page"]) || 1
updateUsrDialog()
return TRUE
/obj/machinery/ore_silo/multitool_act(mob/living/user, obj/item/multitool/I)
if (istype(I))
to_chat(user, "<span class='notice'>You log [src] in the multitool's buffer.</span>")
I.buffer = src
return TRUE
/obj/machinery/ore_silo/proc/silo_log(obj/machinery/M, action, amount, noun, list/mats)
if (!length(mats))
return
var/datum/ore_silo_log/entry = new(M, action, amount, noun, mats)
var/list/logs = GLOB.silo_access_logs[REF(src)]
if(!LAZYLEN(logs))
GLOB.silo_access_logs[REF(src)] = logs = list(entry)
else if(!logs[1].merge(entry))
logs.Insert(1, entry)
updateUsrDialog()
flick("silo_active", src)
/obj/machinery/ore_silo/examine(mob/user)
..()
to_chat(user, "<span class='notice'>[src] can be linked to techfabs, circuit printers and protolathes with a multitool.</span>")
/datum/ore_silo_log
var/name // for VV
var/formatted // for display
var/timestamp
var/machine_name
var/area_name
var/action
var/noun
var/amount
var/list/materials
/datum/ore_silo_log/New(obj/machinery/M, _action, _amount, _noun, list/mats=list())
timestamp = station_time_timestamp()
machine_name = M.name
area_name = get_area_name(M, TRUE)
action = _action
amount = _amount
noun = _noun
materials = mats.Copy()
for(var/each in materials)
materials[each] *= abs(_amount)
format()
/datum/ore_silo_log/proc/merge(datum/ore_silo_log/other)
if (other == src || action != other.action || noun != other.noun)
return FALSE
if (machine_name != other.machine_name || area_name != other.area_name)
return FALSE
timestamp = other.timestamp
amount += other.amount
for(var/each in other.materials)
materials[each] += other.materials[each]
format()
return TRUE
/datum/ore_silo_log/proc/format()
name = "[machine_name]: [action] [amount]x [noun]"
var/list/msg = list("([timestamp]) <b>[machine_name]</b> in [area_name]<br>[action] [abs(amount)]x [noun]<br>")
var/sep = ""
for(var/key in materials)
var/val = round(materials[key]) / MINERAL_MATERIAL_AMOUNT
msg += sep
sep = ", "
msg += "[amount < 0 ? "-" : "+"][val] [copytext(key, 2)]"
formatted = msg.Join()
+27 -18
View File
@@ -71,42 +71,51 @@
desc = "A machine that automatically stacks acquired materials. Controlled by a nearby console."
density = TRUE
circuit = /obj/item/circuitboard/machine/stacking_machine
input_dir = EAST
output_dir = WEST
var/obj/machinery/mineral/stacking_unit_console/CONSOLE
var/stk_types = list()
var/stk_amt = list()
var/stack_list[0] //Key: Type. Value: Instance of type.
var/stack_amt = 50; //ammount to stack before releassing
input_dir = EAST
output_dir = WEST
var/stack_amt = 50 //amount to stack before releassing
var/datum/component/remote_materials/materials
var/force_connect = FALSE
/obj/machinery/mineral/stacking_machine/Initialize()
/obj/machinery/mineral/stacking_machine/Initialize(mapload)
. = ..()
proximity_monitor = new(src, 1)
materials = AddComponent(/datum/component/remote_materials, "stacking", mapload, FALSE, mapload && force_connect)
/obj/machinery/mineral/stacking_machine/HasProximity(atom/movable/AM)
if(istype(AM, /obj/item/stack/sheet) && AM.loc == get_step(src, input_dir))
process_sheet(AM)
/obj/machinery/mineral/stacking_machine/multitool_act(mob/living/user, obj/item/I)
if(istype(I, /obj/item/multitool))
var/obj/item/multitool/M = I
if(!istype(M.buffer, /obj/machinery/mineral/stacking_unit_console))
to_chat(user, "<span class='warning'>The [I] has no linkage data in its buffer.</span>")
return FALSE
else
/obj/machinery/mineral/stacking_machine/multitool_act(mob/living/user, obj/item/multitool/M)
if(istype(M))
if(istype(M.buffer, /obj/machinery/mineral/stacking_unit_console))
CONSOLE = M.buffer
CONSOLE.machine = src
to_chat(user, "<span class='notice'>You link [src] to the console in [I]'s buffer.</span>")
to_chat(user, "<span class='notice'>You link [src] to the console in [M]'s buffer.</span>")
return TRUE
/obj/machinery/mineral/stacking_machine/proc/process_sheet(obj/item/stack/sheet/inp)
if(!(inp.type in stack_list)) //It's the first of this sheet added
var/obj/item/stack/sheet/s = new inp.type(src, 0)
stack_list[inp.type] = s
var/obj/item/stack/sheet/storage = stack_list[inp.type]
var/key = inp.merge_type
var/obj/item/stack/sheet/storage = stack_list[key]
if(!storage) //It's the first of this sheet added
stack_list[key] = storage = new inp.type(src, 0)
storage.amount += inp.amount //Stack the sheets
while(storage.amount > stack_amt) //Get rid of excessive stackage
qdel(inp)
if(materials.silo && !materials.on_hold()) //Dump the sheets to the silo
var/matlist = storage.materials & materials.mat_container.materials
if (length(matlist))
var/inserted = materials.mat_container.insert_stack(storage)
materials.silo_log(src, "collected", inserted, "sheets", matlist)
if (QDELETED(storage))
stack_list -= key
return
while(storage.amount >= stack_amt) //Get rid of excessive stackage
var/obj/item/stack/sheet/out = new inp.type(null, stack_amt)
unload_mineral(out)
storage.amount -= stack_amt
qdel(inp) //Let the old sheet garbage collect
+3 -3
View File
@@ -234,7 +234,7 @@
/obj/item/card/mining_point_card
name = "mining points card"
desc = "A small card preloaded with mining points. Swipe your ID card over it to transfer the points, then discard."
icon_state = "data"
icon_state = "data_1"
var/points = 500
/obj/item/card/mining_point_card/attackby(obj/item/I, mob/user, params)
@@ -256,9 +256,10 @@
/obj/item/card/mining_access_card
name = "mining access card"
desc = "A small card, that when used on any ID, will add mining access."
icon_state = "data"
icon_state = "data_1"
/obj/item/card/mining_access_card/afterattack(atom/movable/AM, mob/user, proximity)
. = ..()
if(istype(AM, /obj/item/card/id) && proximity)
var/obj/item/card/id/I = AM
I.access |= ACCESS_MINING
@@ -267,7 +268,6 @@
I.access |= ACCESS_CARGO
to_chat(user, "You upgrade [I] with mining access.")
qdel(src)
..()
/obj/item/storage/backpack/duffelbag/mining_conscript
name = "mining conscription kit"
+1
View File
@@ -270,6 +270,7 @@
icon = 'icons/obj/module.dmi'
/obj/item/mine_bot_upgrade/afterattack(mob/living/simple_animal/hostile/mining_drone/M, mob/user, proximity)
. = ..()
if(!istype(M) || !proximity)
return
upgrade_bot(M, user)
+1 -1
View File
@@ -15,7 +15,7 @@
/obj/machinery/mineral/mint/Initialize()
. = ..()
AddComponent(/datum/component/material_container, list(MAT_METAL, MAT_PLASMA, MAT_SILVER, MAT_GOLD, MAT_URANIUM, MAT_DIAMOND, MAT_BANANIUM), MINERAL_MATERIAL_AMOUNT * 50, FALSE, list(/obj/item/stack))
AddComponent(/datum/component/material_container, list(MAT_METAL, MAT_PLASMA, MAT_SILVER, MAT_GOLD, MAT_URANIUM, MAT_DIAMOND, MAT_BANANIUM), MINERAL_MATERIAL_AMOUNT * 50, FALSE, /obj/item/stack)
/obj/machinery/mineral/mint/process()
var/turf/T = get_step(src, input_dir)
-1
View File
@@ -335,7 +335,6 @@ GLOBAL_LIST_INIT(sand_recipes, list(\
/obj/item/coin/proc/manual_suicide(mob/living/user)
var/index = sideslist.Find(coinflip)
message_admins("coinflip landed on [coinflip] which is [index] in sideslist")
if (index==2)//tails
user.visible_message("<span class='suicide'>\the [src] lands on [coinflip]! [user] promptly falls over, dead!</span>")
user.adjustOxyLoss(200)