Revert "PLASE"

This reverts commit 8af225e6e3.
This commit is contained in:
Fermi
2019-11-24 03:06:08 +00:00
parent aeb8606ce0
commit ba4fa1ef67
2145 changed files with 1387321 additions and 5257 deletions
+287
View File
@@ -0,0 +1,287 @@
//Aux base construction console
/mob/camera/aiEye/remote/base_construction
name = "construction holo-drone"
move_on_shuttle = 1 //Allows any curious crew to watch the base after it leaves. (This is safe as the base cannot be modified once it leaves)
icon = 'icons/obj/mining.dmi'
icon_state = "construction_drone"
var/area/starting_area
/mob/camera/aiEye/remote/base_construction/Initialize()
. = ..()
starting_area = get_area(loc)
/mob/camera/aiEye/remote/base_construction/setLoc(var/t)
var/area/curr_area = get_area(t)
if(curr_area == starting_area || istype(curr_area, /area/shuttle/auxillary_base))
return ..()
//While players are only allowed to build in the base area, but consoles starting outside the base can move into the base area to begin work.
/mob/camera/aiEye/remote/base_construction/relaymove(mob/user, direct)
dir = direct //This camera eye is visible as a drone, and needs to keep the dir updated
..()
/obj/item/construction/rcd/internal //Base console's internal RCD. Roundstart consoles are filled, rebuilt cosoles start empty.
name = "internal RCD"
max_matter = 600 //Bigger container and faster speeds due to being specialized and stationary.
no_ammo_message = "<span class='warning'>Internal matter exhausted. Please add additional materials.</span>"
delay_mod = 0.5
adjacency_check = FALSE
upgrade = TRUE
var/obj/machinery/computer/camera_advanced/base_construction/console
/obj/item/construction/rcd/internal/check_menu(mob/living/user)
if(!istype(user) || user.incapacitated() || !user.Adjacent(console))
return FALSE
return TRUE
/obj/machinery/computer/camera_advanced/base_construction
name = "base construction console"
desc = "An industrial computer integrated with a camera-assisted rapid construction drone."
networks = list("ss13")
var/obj/item/construction/rcd/internal/RCD //Internal RCD. The computer passes user commands to this in order to avoid massive copypaste.
circuit = /obj/item/circuitboard/computer/base_construction
off_action = new/datum/action/innate/camera_off/base_construction
jump_action = null
var/datum/action/innate/aux_base/switch_mode/switch_mode_action = new //Action for switching the RCD's build modes
var/datum/action/innate/aux_base/build/build_action = new //Action for using the RCD
var/datum/action/innate/aux_base/airlock_type/airlock_mode_action = new //Action for setting the airlock type
var/datum/action/innate/aux_base/window_type/window_action = new //Action for setting the window type
var/datum/action/innate/aux_base/place_fan/fan_action = new //Action for spawning fans
var/fans_remaining = 0 //Number of fans in stock.
var/datum/action/innate/aux_base/install_turret/turret_action = new //Action for spawning turrets
var/turret_stock = 0 //Turrets in stock
var/obj/machinery/computer/auxillary_base/found_aux_console //Tracker for the Aux base console, so the eye can always find it.
icon_screen = "mining"
icon_keyboard = "rd_key"
light_color = LIGHT_COLOR_PINK
/obj/machinery/computer/camera_advanced/base_construction/Initialize(mapload)
. = ..()
RCD = new(src)
RCD.console = src
if(mapload) //Map spawned consoles have a filled RCD and stocked special structures
RCD.matter = RCD.max_matter
fans_remaining = 4
turret_stock = 4
/obj/machinery/computer/camera_advanced/base_construction/CreateEye()
var/spawn_spot
for(var/obj/machinery/computer/auxillary_base/ABC in GLOB.machines)
if(istype(get_area(ABC), /area/shuttle/auxillary_base))
found_aux_console = ABC
break
if(found_aux_console)
spawn_spot = found_aux_console
else
spawn_spot = src
eyeobj = new /mob/camera/aiEye/remote/base_construction(get_turf(spawn_spot))
eyeobj.origin = src
/obj/machinery/computer/camera_advanced/base_construction/attackby(obj/item/W, mob/user, params)
if(istype(W, /obj/item/rcd_ammo) || istype(W, /obj/item/stack/sheet))
RCD.attackby(W, user, params) //If trying to feed the console more materials, pass it along to the RCD.
else
return ..()
/obj/machinery/computer/camera_advanced/base_construction/Destroy()
QDEL_NULL(RCD)
return ..()
/obj/machinery/computer/camera_advanced/base_construction/GrantActions(mob/living/user)
..()
if(switch_mode_action)
switch_mode_action.target = src
switch_mode_action.Grant(user)
actions += switch_mode_action
if(build_action)
build_action.target = src
build_action.Grant(user)
actions += build_action
if(airlock_mode_action)
airlock_mode_action.target = src
airlock_mode_action.Grant(user)
actions += airlock_mode_action
if(window_action)
window_action.target = src
window_action.Grant(user)
actions += window_action
if(fan_action)
fan_action.target = src
fan_action.Grant(user)
actions += fan_action
if(turret_action)
turret_action.target = src
turret_action.Grant(user)
actions += turret_action
eyeobj.invisibility = 0 //When the eye is in use, make it visible to players so they know when someone is building.
/obj/machinery/computer/camera_advanced/base_construction/remove_eye_control(mob/living/user)
..()
eyeobj.invisibility = INVISIBILITY_MAXIMUM //Hide the eye when not in use.
/datum/action/innate/aux_base //Parent aux base action
icon_icon = 'icons/mob/actions/actions_construction.dmi'
var/mob/living/C //Mob using the action
var/mob/camera/aiEye/remote/base_construction/remote_eye //Console's eye mob
var/obj/machinery/computer/camera_advanced/base_construction/B //Console itself
/datum/action/innate/aux_base/Activate()
if(!target)
return TRUE
C = owner
remote_eye = C.remote_control
B = target
if(!B.RCD) //The console must always have an RCD.
B.RCD = new /obj/item/construction/rcd/internal(B) //If the RCD is lost somehow, make a new (empty) one!
B.RCD.console = B
/datum/action/innate/aux_base/proc/check_spot()
//Check a loction to see if it is inside the aux base at the station. Camera visbility checks omitted so as to not hinder construction.
var/turf/build_target = get_turf(remote_eye)
var/area/build_area = get_area(build_target)
if(!istype(build_area, /area/shuttle/auxillary_base))
to_chat(owner, "<span class='warning'>You can only build within the mining base!</span>")
return FALSE
if(!is_station_level(build_target.z))
to_chat(owner, "<span class='warning'>The mining base has launched and can no longer be modified.</span>")
return FALSE
return TRUE
/datum/action/innate/camera_off/base_construction
name = "Log out"
//*******************FUNCTIONS*******************
/datum/action/innate/aux_base/build
name = "Build"
button_icon_state = "build"
/datum/action/innate/aux_base/build/Activate()
if(..())
return
if(!check_spot())
return
var/turf/target_turf = get_turf(remote_eye)
var/atom/rcd_target = target_turf
//Find airlocks and other shite
for(var/obj/S in target_turf)
if(LAZYLEN(S.rcd_vals(owner,B.RCD)))
rcd_target = S //If we don't break out of this loop we'll get the last placed thing
owner.changeNext_move(CLICK_CD_RANGE)
B.RCD.afterattack(rcd_target, owner, TRUE) //Activate the RCD and force it to work remotely!
playsound(target_turf, 'sound/items/deconstruct.ogg', 60, 1)
/datum/action/innate/aux_base/switch_mode
name = "Switch Mode"
button_icon_state = "builder_mode"
/datum/action/innate/aux_base/switch_mode/Activate()
if(..())
return
var/list/buildlist = list("Walls and Floors" = 1,"Airlocks" = 2,"Deconstruction" = 3,"Windows and Grilles" = 4)
var/buildmode = input("Set construction mode.", "Base Console", null) in buildlist
if(buildmode)
B.RCD.mode = buildlist[buildmode]
to_chat(owner, "Build mode is now [buildmode].")
/datum/action/innate/aux_base/airlock_type
name = "Change Airlock Settings"
button_icon_state = "airlock_select"
/datum/action/innate/aux_base/airlock_type/Activate()
if(..())
return
var/mode = alert("Modify Type or Access?", "Airlock Settings", "Type", "Access", "None")
switch(mode)
if("Type")
B.RCD.change_airlock_setting(usr)
if("Access")
B.RCD.change_airlock_access(usr)
/datum/action/innate/aux_base/window_type
name = "Select Window Type"
button_icon_state = "window_select"
/datum/action/innate/aux_base/window_type/Activate()
if(..())
return
B.RCD.toggle_window_type(usr)
/datum/action/innate/aux_base/place_fan
name = "Place Tiny Fan"
button_icon_state = "build_fan"
/datum/action/innate/aux_base/place_fan/Activate()
if(..())
return
var/turf/fan_turf = get_turf(remote_eye)
if(!B.fans_remaining)
to_chat(owner, "<span class='warning'>[B] is out of fans!</span>")
return
if(!check_spot())
return
if(fan_turf.density)
to_chat(owner, "<span class='warning'>Fans may only be placed on a floor.</span>")
return
new /obj/structure/fans/tiny(fan_turf)
B.fans_remaining--
to_chat(owner, "<span class='notice'>Tiny fan placed. [B.fans_remaining] remaining.</span>")
playsound(fan_turf, 'sound/machines/click.ogg', 50, 1)
/datum/action/innate/aux_base/install_turret
name = "Install Plasma Anti-Wildlife Turret"
button_icon_state = "build_turret"
/datum/action/innate/aux_base/install_turret/Activate()
if(..())
return
if(!check_spot())
return
if(!B.turret_stock)
to_chat(owner, "<span class='warning'>Unable to construct additional turrets.</span>")
return
var/turf/turret_turf = get_turf(remote_eye)
if(is_blocked_turf(turret_turf))
to_chat(owner, "<span class='warning'>Location is obstructed by something. Please clear the location and try again.</span>")
return
var/obj/machinery/porta_turret/aux_base/T = new /obj/machinery/porta_turret/aux_base(turret_turf)
if(B.found_aux_console)
B.found_aux_console.turrets += T //Add new turret to the console's control
B.turret_stock--
to_chat(owner, "<span class='notice'>Turret installation complete!</span>")
playsound(turret_turf, 'sound/items/drill_use.ogg', 65, 1)
@@ -0,0 +1,185 @@
/****************Explorer's Suit and Mask****************/
/obj/item/clothing/suit/hooded/explorer
name = "explorer suit"
desc = "An armoured suit for exploring harsh environments."
icon_state = "explorer"
item_state = "explorer"
body_parts_covered = CHEST|GROIN|LEGS|ARMS
min_cold_protection_temperature = FIRE_SUIT_MIN_TEMP_PROTECT
cold_protection = CHEST|GROIN|LEGS|ARMS
max_heat_protection_temperature = FIRE_SUIT_MAX_TEMP_PROTECT
heat_protection = CHEST|GROIN|LEGS|ARMS
hoodtype = /obj/item/clothing/head/hooded/explorer
armor = list("melee" = 30, "bullet" = 20, "laser" = 20, "energy" = 20, "bomb" = 50, "bio" = 100, "rad" = 50, "fire" = 50, "acid" = 50)
flags_inv = HIDEJUMPSUIT|HIDETAUR
allowed = list(/obj/item/flashlight, /obj/item/tank/internals, /obj/item/resonator, /obj/item/mining_scanner, /obj/item/t_scanner/adv_mining_scanner, /obj/item/gun/energy/kinetic_accelerator, /obj/item/pickaxe)
resistance_flags = FIRE_PROOF
tauric = TRUE //Citadel Add for tauric hardsuits
/obj/item/clothing/head/hooded/explorer
name = "explorer hood"
desc = "An armoured hood for exploring harsh environments."
icon_state = "explorer"
body_parts_covered = HEAD
flags_inv = HIDEHAIR|HIDEFACE|HIDEEARS
min_cold_protection_temperature = FIRE_HELM_MIN_TEMP_PROTECT
max_heat_protection_temperature = FIRE_HELM_MAX_TEMP_PROTECT
armor = list("melee" = 30, "bullet" = 20, "laser" = 20, "energy" = 20, "bomb" = 50, "bio" = 100, "rad" = 50, "fire" = 50, "acid" = 50)
resistance_flags = FIRE_PROOF
/obj/item/clothing/suit/hooded/explorer/standard
/obj/item/clothing/head/hooded/explorer/standard
/obj/item/clothing/suit/hooded/explorer/standard/Initialize()
. = ..()
AddComponent(/datum/component/armor_plate)
/obj/item/clothing/head/hooded/explorer/standard/Initialize()
. = ..()
AddComponent(/datum/component/armor_plate)
/obj/item/clothing/mask/gas/explorer
name = "explorer gas mask"
desc = "A military-grade gas mask that can be connected to an air supply."
icon_state = "gas_mining"
visor_flags = BLOCK_GAS_SMOKE_EFFECT | ALLOWINTERNALS
visor_flags_inv = HIDEFACIALHAIR
visor_flags_cover = MASKCOVERSMOUTH
actions_types = list(/datum/action/item_action/adjust)
armor = list("melee" = 10, "bullet" = 5, "laser" = 5, "energy" = 5, "bomb" = 0, "bio" = 50, "rad" = 0, "fire" = 20, "acid" = 40)
resistance_flags = FIRE_PROOF
/obj/item/clothing/mask/gas/explorer/attack_self(mob/user)
adjustmask(user)
/obj/item/clothing/mask/gas/explorer/adjustmask(user)
..()
w_class = mask_adjusted ? WEIGHT_CLASS_NORMAL : WEIGHT_CLASS_SMALL
/obj/item/clothing/mask/gas/explorer/folded/Initialize()
. = ..()
adjustmask()
/obj/item/clothing/suit/space/hostile_environment
name = "H.E.C.K. suit"
desc = "Hostile Environment Cross-Kinetic Suit: A suit designed to withstand the wide variety of hazards from Lavaland. It wasn't enough for its last owner."
icon_state = "hostile_env"
item_state = "hostile_env"
clothing_flags = THICKMATERIAL //not spaceproof
max_heat_protection_temperature = FIRE_IMMUNITY_MAX_TEMP_PROTECT
resistance_flags = FIRE_PROOF | LAVA_PROOF
tauric = TRUE //Citadel Add for tauric hardsuits
slowdown = 0
armor = list("melee" = 70, "bullet" = 40, "laser" = 10, "energy" = 10, "bomb" = 50, "bio" = 100, "rad" = 100, "fire" = 100, "acid" = 100)
allowed = list(/obj/item/flashlight, /obj/item/tank/internals, /obj/item/resonator, /obj/item/mining_scanner, /obj/item/t_scanner/adv_mining_scanner, /obj/item/gun/energy/kinetic_accelerator, /obj/item/pickaxe)
/obj/item/clothing/suit/space/hostile_environment/Initialize()
. = ..()
AddComponent(/datum/component/spraycan_paintable)
START_PROCESSING(SSobj, src)
/obj/item/clothing/suit/space/hostile_environment/Destroy()
STOP_PROCESSING(SSobj, src)
return ..()
/obj/item/clothing/suit/space/hostile_environment/process()
var/mob/living/carbon/C = loc
if(istype(C) && prob(2)) //cursed by bubblegum
if(prob(15))
new /datum/hallucination/oh_yeah(C)
to_chat(C, "<span class='colossus'><b>[pick("I AM IMMORTAL.","I SHALL TAKE BACK WHAT'S MINE.","I SEE YOU.","YOU CANNOT ESCAPE ME FOREVER.","DEATH CANNOT HOLD ME.")]</b></span>")
else
to_chat(C, "<span class='warning'>[pick("You hear faint whispers.","You smell ash.","You feel hot.","You hear a roar in the distance.")]</span>")
/obj/item/clothing/head/helmet/space/hostile_environment
name = "H.E.C.K. helmet"
desc = "Hostile Environiment Cross-Kinetic Helmet: A helmet designed to withstand the wide variety of hazards from Lavaland. It wasn't enough for its last owner."
icon_state = "hostile_env"
item_state = "hostile_env"
w_class = WEIGHT_CLASS_NORMAL
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
/obj/item/clothing/head/helmet/space/hostile_environment/Initialize()
. = ..()
AddComponent(/datum/component/spraycan_paintable)
update_icon()
/obj/item/clothing/head/helmet/space/hostile_environment/update_icon()
..()
cut_overlays()
var/mutable_appearance/glass_overlay = mutable_appearance(icon, "hostile_env_glass")
glass_overlay.appearance_flags = RESET_COLOR
add_overlay(glass_overlay)
/obj/item/clothing/head/helmet/space/hostile_environment/worn_overlays(isinhands)
. = ..()
if(!isinhands)
var/mutable_appearance/M = mutable_appearance('icons/mob/head.dmi', "hostile_env_glass")
M.appearance_flags = RESET_COLOR
. += M
// CITADEL ADDITIONS BELOW
/****************SEVA Suit and Mask****************/
/obj/item/clothing/suit/hooded/explorer/seva
name = "SEVA Suit"
desc = "A fire-proof suit for exploring hot environments. Its design and material make it easier for a Goliath to keep their grip on the wearer."
icon_state = "seva"
item_state = "seva"
w_class = WEIGHT_CLASS_BULKY
max_heat_protection_temperature = FIRE_IMMUNITY_MAX_TEMP_PROTECT
heat_protection = CHEST|GROIN|LEGS|FEET|ARMS|HANDS
hoodtype = /obj/item/clothing/head/hooded/explorer/seva
armor = list("melee" = 15, "bullet" = 10, "laser" = 10, "energy" = 10, "bomb" = 25, "bio" = 50, "rad" = 25, "fire" = 100, "acid" = 25)
resistance_flags = FIRE_PROOF | GOLIATH_WEAKNESS
/obj/item/clothing/head/hooded/explorer/seva
name = "SEVA Hood"
desc = "A fire-proof hood for exploring hot environments. Its design and material make it easier for a Goliath to keep their grip on the wearer."
icon_state = "seva"
item_state = "seva"
max_heat_protection_temperature = FIRE_IMMUNITY_MAX_TEMP_PROTECT
armor = list("melee" = 10, "bullet" = 10, "laser" = 10, "energy" = 10, "bomb" = 25, "bio" = 50, "rad" = 25, "fire" = 100, "acid" = 25)
resistance_flags = FIRE_PROOF | GOLIATH_WEAKNESS
/obj/item/clothing/mask/gas/seva
name = "SEVA Mask"
desc = "A face-covering plate that can be connected to an air supply. Intended for use with the SEVA Suit."
icon_state = "seva"
item_state = "seva"
resistance_flags = FIRE_PROOF
/****************Exo-Suit and Mask****************/
/obj/item/clothing/suit/hooded/explorer/exo
name = "Exo-suit"
desc = "A robust suit for fighting dangerous animals. Its design and material make it harder for a Goliath to keep their grip on the wearer."
icon_state = "exo"
item_state = "exo"
w_class = WEIGHT_CLASS_BULKY
heat_protection = CHEST|GROIN|LEGS|FEET|ARMS|HANDS
hoodtype = /obj/item/clothing/head/hooded/explorer/exo
armor = list("melee" = 65, "bullet" = 5, "laser" = 5, "energy" = 5, "bomb" = 60, "bio" = 25, "rad" = 10, "fire" = 0, "acid" = 0)
resistance_flags = FIRE_PROOF | GOLIATH_RESISTANCE
/obj/item/clothing/head/hooded/explorer/exo
name = "Exo-hood"
desc = "A robust helmet for fighting dangerous animals. Its design and material make it harder for a Goliath to keep their grip on the wearer."
icon_state = "exo"
item_state = "exo"
armor = list("melee" = 65, "bullet" = 5, "laser" = 5, "energy" = 5, "bomb" = 60, "bio" = 25, "rad" = 10, "fire" = 0, "acid" = 0)
resistance_flags = FIRE_PROOF | GOLIATH_RESISTANCE
/obj/item/clothing/mask/gas/exo
name = "Exosuit Mask"
desc = "A face-covering mask that can be connected to an air supply. Intended for use with the Exosuit."
icon_state = "exo"
item_state = "exo"
resistance_flags = FIRE_PROOF
@@ -0,0 +1,445 @@
/*********************Mining Hammer****************/
/obj/item/twohanded/kinetic_crusher
icon = 'icons/obj/mining.dmi'
icon_state = "crusher"
item_state = "crusher0"
lefthand_file = 'icons/mob/inhands/weapons/hammers_lefthand.dmi'
righthand_file = 'icons/mob/inhands/weapons/hammers_righthand.dmi'
name = "proto-kinetic crusher"
desc = "An early design of the proto-kinetic accelerator, it is little more than an combination of various mining tools cobbled together, forming a high-tech club. \
While it is an effective mining tool, it did little to aid any but the most skilled and/or suicidal miners against local fauna."
force = 0 //You can't hit stuff unless wielded
w_class = WEIGHT_CLASS_BULKY
slot_flags = ITEM_SLOT_BACK
force_unwielded = 0
force_wielded = 20
throwforce = 5
throw_speed = 4
armour_penetration = 10
materials = list(MAT_METAL=1150, MAT_GLASS=2075)
hitsound = 'sound/weapons/bladeslice.ogg'
attack_verb = list("smashed", "crushed", "cleaved", "chopped", "pulped")
sharpness = IS_SHARP
actions_types = list(/datum/action/item_action/toggle_light)
var/list/trophies = list()
var/charged = TRUE
var/charge_time = 15
var/detonation_damage = 50
var/backstab_bonus = 30
var/light_on = FALSE
var/brightness_on = 7
/obj/item/twohanded/kinetic_crusher/Initialize()
. = ..()
AddComponent(/datum/component/butchering, 60, 110) //technically it's huge and bulky, but this provides an incentive to use it
/obj/item/twohanded/kinetic_crusher/Destroy()
QDEL_LIST(trophies)
return ..()
/obj/item/twohanded/kinetic_crusher/examine(mob/living/user)
..()
to_chat(user, "<span class='notice'>Mark a large creature with the destabilizing force, then hit them in melee to do <b>[force_wielded + detonation_damage]</b> damage.</span>")
to_chat(user, "<span class='notice'>Does <b>[force_wielded + detonation_damage + backstab_bonus]</b> damage if the target is backstabbed, instead of <b>[force_wielded + detonation_damage]</b>.</span>")
for(var/t in trophies)
var/obj/item/crusher_trophy/T = t
to_chat(user, "<span class='notice'>It has \a [T] attached, which causes [T.effect_desc()].</span>")
/obj/item/twohanded/kinetic_crusher/attackby(obj/item/I, mob/living/user)
if(istype(I, /obj/item/crowbar))
if(LAZYLEN(trophies))
to_chat(user, "<span class='notice'>You remove [src]'s trophies.</span>")
I.play_tool_sound(src)
for(var/t in trophies)
var/obj/item/crusher_trophy/T = t
T.remove_from(src, user)
else
to_chat(user, "<span class='warning'>There are no trophies on [src].</span>")
else if(istype(I, /obj/item/crusher_trophy))
var/obj/item/crusher_trophy/T = I
T.add_to(src, user)
else
return ..()
/obj/item/twohanded/kinetic_crusher/attack(mob/living/target, mob/living/carbon/user)
if(!wielded)
to_chat(user, "<span class='warning'>[src] is too heavy to use with one hand.")
return
var/datum/status_effect/crusher_damage/C = target.has_status_effect(STATUS_EFFECT_CRUSHERDAMAGETRACKING)
var/target_health = target.health
..()
for(var/t in trophies)
if(!QDELETED(target))
var/obj/item/crusher_trophy/T = t
T.on_melee_hit(target, user)
if(!QDELETED(C) && !QDELETED(target))
C.total_damage += target_health - target.health //we did some damage, but let's not assume how much we did
/obj/item/twohanded/kinetic_crusher/afterattack(atom/target, mob/living/user, proximity_flag, clickparams)
. = ..()
if(istype(target, /obj/item/crusher_trophy))
var/obj/item/crusher_trophy/T = target
T.add_to(src, user)
if(!wielded)
return
if(!proximity_flag && charged)//Mark a target, or mine a tile.
var/turf/proj_turf = user.loc
if(!isturf(proj_turf))
return
var/obj/item/projectile/destabilizer/D = new /obj/item/projectile/destabilizer(proj_turf)
for(var/t in trophies)
var/obj/item/crusher_trophy/T = t
T.on_projectile_fire(D, user)
D.preparePixelProjectile(target, user, clickparams)
D.firer = user
D.hammer_synced = src
playsound(user, 'sound/weapons/plasma_cutter.ogg', 100, 1)
D.fire()
charged = FALSE
update_icon()
addtimer(CALLBACK(src, .proc/Recharge), charge_time)
return
if(proximity_flag && isliving(target))
var/mob/living/L = target
var/datum/status_effect/crusher_mark/CM = L.has_status_effect(STATUS_EFFECT_CRUSHERMARK)
if(!CM || CM.hammer_synced != src || !L.remove_status_effect(STATUS_EFFECT_CRUSHERMARK))
return
var/datum/status_effect/crusher_damage/C = L.has_status_effect(STATUS_EFFECT_CRUSHERDAMAGETRACKING)
var/target_health = L.health
for(var/t in trophies)
var/obj/item/crusher_trophy/T = t
T.on_mark_detonation(target, user)
if(!QDELETED(L))
if(!QDELETED(C))
C.total_damage += target_health - L.health //we did some damage, but let's not assume how much we did
new /obj/effect/temp_visual/kinetic_blast(get_turf(L))
var/backstab_dir = get_dir(user, L)
var/def_check = L.getarmor(type = "bomb")
if((user.dir & backstab_dir) && (L.dir & backstab_dir))
if(!QDELETED(C))
C.total_damage += detonation_damage + backstab_bonus //cheat a little and add the total before killing it, so certain mobs don't have much lower chances of giving an item
L.apply_damage(detonation_damage + backstab_bonus, BRUTE, blocked = def_check)
playsound(user, 'sound/weapons/kenetic_accel.ogg', 100, 1) //Seriously who spelled it wrong
else
if(!QDELETED(C))
C.total_damage += detonation_damage
L.apply_damage(detonation_damage, BRUTE, blocked = def_check)
if(user && lavaland_equipment_pressure_check(get_turf(user))) //CIT CHANGE - makes sure below only happens in low pressure environments
user.adjustStaminaLoss(-30)//CIT CHANGE - makes crushers heal stamina
/obj/item/twohanded/kinetic_crusher/proc/Recharge()
if(!charged)
charged = TRUE
update_icon()
playsound(src.loc, 'sound/weapons/kenetic_reload.ogg', 60, 1)
/obj/item/twohanded/kinetic_crusher/ui_action_click(mob/user, actiontype)
light_on = !light_on
playsound(user, 'sound/weapons/empty.ogg', 100, TRUE)
update_brightness(user)
update_icon()
/obj/item/twohanded/kinetic_crusher/proc/update_brightness(mob/user = null)
if(light_on)
set_light(brightness_on)
else
set_light(0)
/obj/item/twohanded/kinetic_crusher/update_icon()
..()
cut_overlays()
if(!charged)
add_overlay("[icon_state]_uncharged")
if(light_on)
add_overlay("[icon_state]_lit")
spawn(1)
for(var/X in actions)
var/datum/action/A = X
A.UpdateButtonIcon()
item_state = "crusher[wielded]"
//destablizing force
/obj/item/projectile/destabilizer
name = "destabilizing force"
icon_state = "pulse1"
nodamage = TRUE
damage = 0 //We're just here to mark people. This is still a melee weapon.
damage_type = BRUTE
flag = "bomb"
range = 6
log_override = TRUE
var/obj/item/twohanded/kinetic_crusher/hammer_synced
/obj/item/projectile/destabilizer/Destroy()
hammer_synced = null
return ..()
/obj/item/projectile/destabilizer/on_hit(atom/target, blocked = FALSE)
if(isliving(target))
var/mob/living/L = target
var/had_effect = (L.has_status_effect(STATUS_EFFECT_CRUSHERMARK)) //used as a boolean
var/datum/status_effect/crusher_mark/CM = L.apply_status_effect(STATUS_EFFECT_CRUSHERMARK, hammer_synced)
if(hammer_synced)
for(var/t in hammer_synced.trophies)
var/obj/item/crusher_trophy/T = t
T.on_mark_application(target, CM, had_effect)
var/target_turf = get_turf(target)
if(ismineralturf(target_turf))
var/turf/closed/mineral/M = target_turf
new /obj/effect/temp_visual/kinetic_blast(M)
M.gets_drilled(firer)
..()
//trophies
/obj/item/crusher_trophy
name = "tail spike"
desc = "A strange spike with no usage."
icon = 'icons/obj/lavaland/artefacts.dmi'
icon_state = "tail_spike"
var/bonus_value = 10 //if it has a bonus effect, this is how much that effect is
var/denied_type = /obj/item/crusher_trophy
/obj/item/crusher_trophy/examine(mob/living/user)
..()
to_chat(user, "<span class='notice'>Causes [effect_desc()] when attached to a kinetic crusher.</span>")
/obj/item/crusher_trophy/proc/effect_desc()
return "errors"
/obj/item/crusher_trophy/attackby(obj/item/A, mob/living/user)
if(istype(A, /obj/item/twohanded/kinetic_crusher))
add_to(A, user)
else
..()
/obj/item/crusher_trophy/proc/add_to(obj/item/twohanded/kinetic_crusher/H, mob/living/user)
for(var/t in H.trophies)
var/obj/item/crusher_trophy/T = t
if(istype(T, denied_type) || istype(src, T.denied_type))
to_chat(user, "<span class='warning'>You can't seem to attach [src] to [H]. Maybe remove a few trophies?</span>")
return FALSE
if(!user.transferItemToLoc(src, H))
return
H.trophies += src
to_chat(user, "<span class='notice'>You attach [src] to [H].</span>")
return TRUE
/obj/item/crusher_trophy/proc/remove_from(obj/item/twohanded/kinetic_crusher/H, mob/living/user)
forceMove(get_turf(H))
H.trophies -= src
return TRUE
/obj/item/crusher_trophy/proc/on_melee_hit(mob/living/target, mob/living/user) //the target and the user
/obj/item/crusher_trophy/proc/on_projectile_fire(obj/item/projectile/destabilizer/marker, mob/living/user) //the projectile fired and the user
/obj/item/crusher_trophy/proc/on_mark_application(mob/living/target, datum/status_effect/crusher_mark/mark, had_mark) //the target, the mark applied, and if the target had a mark before
/obj/item/crusher_trophy/proc/on_mark_detonation(mob/living/target, mob/living/user) //the target and the user
//goliath
/obj/item/crusher_trophy/goliath_tentacle
name = "goliath tentacle"
desc = "A sliced-off goliath tentacle. Suitable as a trophy for a kinetic crusher."
icon_state = "goliath_tentacle"
denied_type = /obj/item/crusher_trophy/goliath_tentacle
bonus_value = 2
var/missing_health_ratio = 0.1
var/missing_health_desc = 10
/obj/item/crusher_trophy/goliath_tentacle/effect_desc()
return "mark detonation to do <b>[bonus_value]</b> more damage for every <b>[missing_health_desc]</b> health you are missing"
/obj/item/crusher_trophy/goliath_tentacle/on_mark_detonation(mob/living/target, mob/living/user)
var/missing_health = user.health - user.maxHealth
missing_health *= missing_health_ratio //bonus is active at all times, even if you're above 90 health
missing_health *= bonus_value //multiply the remaining amount by bonus_value
if(missing_health > 0)
target.adjustBruteLoss(missing_health) //and do that much damage
//watcher
/obj/item/crusher_trophy/watcher_wing
name = "watcher wing"
desc = "A wing ripped from a watcher. Suitable as a trophy for a kinetic crusher."
icon_state = "watcher_wing"
denied_type = /obj/item/crusher_trophy/watcher_wing
bonus_value = 10
/obj/item/crusher_trophy/watcher_wing/effect_desc()
return "mark detonation to prevent certain creatures from using certain attacks for <b>[bonus_value*0.1]</b> second\s"
/obj/item/crusher_trophy/watcher_wing/on_mark_detonation(mob/living/target, mob/living/user)
if(ishostile(target))
var/mob/living/simple_animal/hostile/H = target
if(H.ranged) //briefly delay ranged attacks
if(H.ranged_cooldown >= world.time)
H.ranged_cooldown += bonus_value
else
H.ranged_cooldown = bonus_value + world.time
//magmawing watcher
/obj/item/crusher_trophy/blaster_tubes/magma_wing
name = "magmawing watcher wing"
desc = "A still-searing wing from a magmawing watcher. Suitable as a trophy for a kinetic crusher."
icon_state = "magma_wing"
gender = NEUTER
bonus_value = 5
/obj/item/crusher_trophy/blaster_tubes/magma_wing/effect_desc()
return "mark detonation to make the next destabilizer shot deal <b>[bonus_value]</b> damage"
/obj/item/crusher_trophy/blaster_tubes/magma_wing/on_projectile_fire(obj/item/projectile/destabilizer/marker, mob/living/user)
if(deadly_shot)
marker.name = "heated [marker.name]"
marker.icon_state = "lava"
marker.damage = bonus_value
marker.nodamage = FALSE
deadly_shot = FALSE
//icewing watcher
/obj/item/crusher_trophy/watcher_wing/ice_wing
name = "icewing watcher wing"
desc = "A carefully preserved frozen wing from an icewing watcher. Suitable as a trophy for a kinetic crusher."
icon_state = "ice_wing"
bonus_value = 8
//legion
/obj/item/crusher_trophy/legion_skull
name = "legion skull"
desc = "A dead and lifeless legion skull. Suitable as a trophy for a kinetic crusher."
icon_state = "legion_skull"
denied_type = /obj/item/crusher_trophy/legion_skull
bonus_value = 3
/obj/item/crusher_trophy/legion_skull/effect_desc()
return "a kinetic crusher to recharge <b>[bonus_value*0.1]</b> second\s faster"
/obj/item/crusher_trophy/legion_skull/add_to(obj/item/twohanded/kinetic_crusher/H, mob/living/user)
. = ..()
if(.)
H.charge_time -= bonus_value
/obj/item/crusher_trophy/legion_skull/remove_from(obj/item/twohanded/kinetic_crusher/H, mob/living/user)
. = ..()
if(.)
H.charge_time += bonus_value
//blood-drunk hunter
/obj/item/crusher_trophy/miner_eye
name = "eye of a blood-drunk hunter"
desc = "Its pupil is collapsed and turned to mush. Suitable as a trophy for a kinetic crusher."
icon_state = "hunter_eye"
denied_type = /obj/item/crusher_trophy/miner_eye
/obj/item/crusher_trophy/miner_eye/effect_desc()
return "mark detonation to grant stun immunity and <b>90%</b> damage reduction for <b>1</b> second"
/obj/item/crusher_trophy/miner_eye/on_mark_detonation(mob/living/target, mob/living/user)
user.apply_status_effect(STATUS_EFFECT_BLOODDRUNK)
//ash drake
/obj/item/crusher_trophy/tail_spike
desc = "A spike taken from an ash drake's tail. Suitable as a trophy for a kinetic crusher."
denied_type = /obj/item/crusher_trophy/tail_spike
bonus_value = 5
/obj/item/crusher_trophy/tail_spike/effect_desc()
return "mark detonation to do <b>[bonus_value]</b> damage to nearby creatures and push them back"
/obj/item/crusher_trophy/tail_spike/on_mark_detonation(mob/living/target, mob/living/user)
for(var/mob/living/L in oview(2, user))
if(L.stat == DEAD)
continue
playsound(L, 'sound/magic/fireball.ogg', 20, 1)
new /obj/effect/temp_visual/fire(L.loc)
addtimer(CALLBACK(src, .proc/pushback, L, user), 1) //no free backstabs, we push AFTER module stuff is done
L.adjustFireLoss(bonus_value, forced = TRUE)
/obj/item/crusher_trophy/tail_spike/proc/pushback(mob/living/target, mob/living/user)
if(!QDELETED(target) && !QDELETED(user) && (!target.anchored || ismegafauna(target))) //megafauna will always be pushed
step(target, get_dir(user, target))
//bubblegum
/obj/item/crusher_trophy/demon_claws
name = "demon claws"
desc = "A set of blood-drenched claws from a massive demon's hand. Suitable as a trophy for a kinetic crusher."
icon_state = "demon_claws"
gender = PLURAL
denied_type = /obj/item/crusher_trophy/demon_claws
bonus_value = 10
var/static/list/damage_heal_order = list(BRUTE, BURN, OXY)
/obj/item/crusher_trophy/demon_claws/effect_desc()
return "melee hits to do <b>[bonus_value * 0.2]</b> more damage and heal you for <b>[bonus_value * 0.1]</b>, with <b>5X</b> effect on mark detonation"
/obj/item/crusher_trophy/demon_claws/add_to(obj/item/twohanded/kinetic_crusher/H, mob/living/user)
. = ..()
if(.)
H.force += bonus_value * 0.2
H.force_unwielded += bonus_value * 0.2
H.force_wielded += bonus_value * 0.2
H.detonation_damage += bonus_value * 0.8
/obj/item/crusher_trophy/demon_claws/remove_from(obj/item/twohanded/kinetic_crusher/H, mob/living/user)
. = ..()
if(.)
H.force -= bonus_value * 0.2
H.force_unwielded -= bonus_value * 0.2
H.force_wielded -= bonus_value * 0.2
H.detonation_damage -= bonus_value * 0.8
/obj/item/crusher_trophy/demon_claws/on_melee_hit(mob/living/target, mob/living/user)
user.heal_ordered_damage(bonus_value * 0.1, damage_heal_order)
/obj/item/crusher_trophy/demon_claws/on_mark_detonation(mob/living/target, mob/living/user)
user.heal_ordered_damage(bonus_value * 0.4, damage_heal_order)
//colossus
/obj/item/crusher_trophy/blaster_tubes
name = "blaster tubes"
desc = "The blaster tubes from a colossus's arm. Suitable as a trophy for a kinetic crusher."
icon_state = "blaster_tubes"
gender = PLURAL
denied_type = /obj/item/crusher_trophy/blaster_tubes
bonus_value = 15
var/deadly_shot = FALSE
/obj/item/crusher_trophy/blaster_tubes/effect_desc()
return "mark detonation to make the next destabilizer shot deal <b>[bonus_value]</b> damage but move slower"
/obj/item/crusher_trophy/blaster_tubes/on_projectile_fire(obj/item/projectile/destabilizer/marker, mob/living/user)
if(deadly_shot)
marker.name = "deadly [marker.name]"
marker.icon_state = "chronobolt"
marker.damage = bonus_value
marker.nodamage = FALSE
marker.speed = 2
deadly_shot = FALSE
/obj/item/crusher_trophy/blaster_tubes/on_mark_detonation(mob/living/target, mob/living/user)
deadly_shot = TRUE
addtimer(CALLBACK(src, .proc/reset_deadly_shot), 300, TIMER_UNIQUE|TIMER_OVERRIDE)
/obj/item/crusher_trophy/blaster_tubes/proc/reset_deadly_shot()
deadly_shot = FALSE
//hierophant
/obj/item/crusher_trophy/vortex_talisman
name = "vortex talisman"
desc = "A glowing trinket that was originally the Hierophant's beacon. Suitable as a trophy for a kinetic crusher."
icon_state = "vortex_talisman"
denied_type = /obj/item/crusher_trophy/vortex_talisman
/obj/item/crusher_trophy/vortex_talisman/effect_desc()
return "mark detonation to create a barrier you can pass"
/obj/item/crusher_trophy/vortex_talisman/on_mark_detonation(mob/living/target, mob/living/user)
var/turf/T = get_turf(user)
new /obj/effect/temp_visual/hierophant/wall/crusher(T, user) //a wall only you can pass!
var/turf/otherT = get_step(T, turn(user.dir, 90))
if(otherT)
new /obj/effect/temp_visual/hierophant/wall/crusher(otherT, user)
otherT = get_step(T, turn(user.dir, -90))
if(otherT)
new /obj/effect/temp_visual/hierophant/wall/crusher(otherT, user)
/obj/effect/temp_visual/hierophant/wall/crusher
duration = 75
File diff suppressed because it is too large Load Diff
+211
View File
@@ -0,0 +1,211 @@
#define SMELT_AMOUNT 10
/**********************Mineral processing unit console**************************/
/obj/machinery/mineral
var/input_dir = NORTH
var/output_dir = SOUTH
/obj/machinery/mineral/proc/unload_mineral(atom/movable/S)
S.forceMove(drop_location())
var/turf/T = get_step(src,output_dir)
if(T)
S.forceMove(T)
/obj/machinery/mineral/processing_unit_console
name = "production machine console"
icon = 'icons/obj/machines/mining_machines.dmi'
icon_state = "console"
density = TRUE
var/obj/machinery/mineral/processing_unit/machine = null
var/machinedir = EAST
speed_process = TRUE
/obj/machinery/mineral/processing_unit_console/Initialize()
. = ..()
machine = locate(/obj/machinery/mineral/processing_unit, get_step(src, machinedir))
if (machine)
machine.CONSOLE = src
else
return INITIALIZE_HINT_QDEL
/obj/machinery/mineral/processing_unit_console/ui_interact(mob/user)
. = ..()
if(!machine)
return
var/dat = machine.get_machine_data()
var/datum/browser/popup = new(user, "processing", "Smelting Console", 300, 500)
popup.set_content(dat)
popup.open()
/obj/machinery/mineral/processing_unit_console/Topic(href, href_list)
if(..())
return
usr.set_machine(src)
add_fingerprint(usr)
if(href_list["material"])
machine.selected_material = href_list["material"]
machine.selected_alloy = null
if(href_list["alloy"])
machine.selected_material = null
machine.selected_alloy = href_list["alloy"]
if(href_list["set_on"])
machine.on = (href_list["set_on"] == "on")
updateUsrDialog()
return
/obj/machinery/mineral/processing_unit_console/Destroy()
machine = null
return ..()
/**********************Mineral processing unit**************************/
/obj/machinery/mineral/processing_unit
name = "furnace"
icon = 'icons/obj/machines/mining_machines.dmi'
icon_state = "furnace"
density = TRUE
var/obj/machinery/mineral/CONSOLE = null
var/on = FALSE
var/selected_material = MAT_METAL
var/selected_alloy = null
var/datum/techweb/stored_research
/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, /obj/item/stack)
stored_research = new /datum/techweb/specialized/autounlocking/smelter
/obj/machinery/mineral/processing_unit/Destroy()
CONSOLE = null
QDEL_NULL(stored_research)
return ..()
/obj/machinery/mineral/processing_unit/HasProximity(atom/movable/AM)
if(istype(AM, /obj/item/stack/ore) && AM.loc == get_step(src, input_dir))
process_ore(AM)
/obj/machinery/mineral/processing_unit/proc/process_ore(obj/item/stack/ore/O)
var/datum/component/material_container/materials = GetComponent(/datum/component/material_container)
var/material_amount = materials.get_item_material_amount(O)
if(!materials.has_space(material_amount))
unload_mineral(O)
else
materials.insert_item(O)
qdel(O)
if(CONSOLE)
CONSOLE.updateUsrDialog()
/obj/machinery/mineral/processing_unit/proc/get_machine_data()
var/dat = "<b>Smelter control console</b><br><br>"
var/datum/component/material_container/materials = GetComponent(/datum/component/material_container)
for(var/mat_id in materials.materials)
var/datum/material/M = materials.materials[mat_id]
dat += "<span class=\"res_name\">[M.name]: </span>[M.amount] cm&sup3;"
if (selected_material == mat_id)
dat += " <i>Smelting</i>"
else
dat += " <A href='?src=[REF(CONSOLE)];material=[mat_id]'><b>Not Smelting</b></A> "
dat += "<br>"
dat += "<br><br>"
dat += "<b>Smelt Alloys</b><br>"
for(var/v in stored_research.researched_designs)
var/datum/design/D = SSresearch.techweb_design_by_id(v)
dat += "<span class=\"res_name\">[D.name] "
if (selected_alloy == D.id)
dat += " <i>Smelting</i>"
else
dat += " <A href='?src=[REF(CONSOLE)];alloy=[D.id]'><b>Not Smelting</b></A> "
dat += "<br>"
dat += "<br><br>"
//On or off
dat += "Machine is currently "
if (on)
dat += "<A href='?src=[REF(CONSOLE)];set_on=off'>On</A> "
else
dat += "<A href='?src=[REF(CONSOLE)];set_on=on'>Off</A> "
return dat
/obj/machinery/mineral/processing_unit/process()
if (on)
if(selected_material)
smelt_ore()
else if(selected_alloy)
smelt_alloy()
if(CONSOLE)
CONSOLE.updateUsrDialog()
/obj/machinery/mineral/processing_unit/proc/smelt_ore()
var/datum/component/material_container/materials = GetComponent(/datum/component/material_container)
var/datum/material/mat = materials.materials[selected_material]
if(mat)
var/sheets_to_remove = (mat.amount >= (MINERAL_MATERIAL_AMOUNT * SMELT_AMOUNT) ) ? SMELT_AMOUNT : round(mat.amount / MINERAL_MATERIAL_AMOUNT)
if(!sheets_to_remove)
on = FALSE
else
var/out = get_step(src, output_dir)
materials.retrieve_sheets(sheets_to_remove, selected_material, out)
/obj/machinery/mineral/processing_unit/proc/smelt_alloy()
var/datum/design/alloy = stored_research.isDesignResearchedID(selected_alloy) //check if it's a valid design
if(!alloy)
on = FALSE
return
var/amount = can_smelt(alloy)
if(!amount)
on = FALSE
return
var/datum/component/material_container/materials = GetComponent(/datum/component/material_container)
materials.use_amount(alloy.materials, amount)
generate_mineral(alloy.build_path)
/obj/machinery/mineral/processing_unit/proc/can_smelt(datum/design/D)
if(D.make_reagents.len)
return FALSE
var/build_amount = SMELT_AMOUNT
var/datum/component/material_container/materials = GetComponent(/datum/component/material_container)
for(var/mat_id in D.materials)
var/M = D.materials[mat_id]
var/datum/material/smelter_mat = materials.materials[mat_id]
if(!M || !smelter_mat)
return FALSE
build_amount = min(build_amount, round(smelter_mat.amount / M))
return build_amount
/obj/machinery/mineral/processing_unit/proc/generate_mineral(P)
var/O = new P(src)
unload_mineral(O)
/obj/machinery/mineral/processing_unit/on_deconstruction()
var/datum/component/material_container/materials = GetComponent(/datum/component/material_container)
materials.retrieve_all()
..()
#undef SMELT_AMOUNT
+342
View File
@@ -0,0 +1,342 @@
/**********************Ore Redemption Unit**************************/
//Turns all the various mining machines into a single unit to speed up mining and establish a point system
/obj/machinery/mineral/ore_redemption
name = "ore redemption machine"
desc = "A machine that accepts ore and instantly transforms it into workable material sheets. Points for ore are generated based on type and can be redeemed at a mining equipment vendor."
icon = 'icons/obj/machines/mining_machines.dmi'
icon_state = "ore_redemption"
density = TRUE
input_dir = NORTH
output_dir = SOUTH
req_access = list(ACCESS_MINERAL_STOREROOM)
speed_process = TRUE
circuit = /obj/item/circuitboard/machine/ore_redemption
layer = BELOW_OBJ_LAYER
var/points = 0
var/ore_pickup_rate = 15
var/sheet_per_ore = 1
var/point_upgrade = 1
var/list/ore_values = list(MAT_GLASS = 1, MAT_METAL = 1, MAT_PLASMA = 15, MAT_SILVER = 16, MAT_GOLD = 18, MAT_TITANIUM = 30, MAT_URANIUM = 30, MAT_DIAMOND = 50, MAT_BLUESPACE = 50, MAT_BANANIUM = 60)
var/message_sent = FALSE
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(mapload)
. = ..()
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)
return ..()
/obj/machinery/mineral/ore_redemption/RefreshParts()
var/ore_pickup_rate_temp = 15
var/point_upgrade_temp = 1
var/sheet_per_ore_temp = 1
for(var/obj/item/stock_parts/matter_bin/B in component_parts)
sheet_per_ore_temp = 0.65 + (0.35 * B.rating)
for(var/obj/item/stock_parts/manipulator/M in component_parts)
ore_pickup_rate_temp = 15 * M.rating
for(var/obj/item/stock_parts/micro_laser/L in component_parts)
point_upgrade_temp = 0.65 + (0.35 * L.rating)
ore_pickup_rate = ore_pickup_rate_temp
point_upgrade = point_upgrade_temp
sheet_per_ore = sheet_per_ore_temp
/obj/machinery/mineral/ore_redemption/examine(mob/user)
. = ..()
if(in_range(user, src) || isobserver(user))
. += "<span class='notice'>The status display reads: Smelting <b>[sheet_per_ore]</b> sheet(s) per piece of ore.<br>Ore pickup speed at <b>[ore_pickup_rate]</b>.</span>"
/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
if(O.refined_type == null)
return
ore_buffer -= O
if(O && O.refined_type)
points += O.points * O.amount
var/material_amount = mat_container.get_item_material_amount(O)
if(!material_amount)
qdel(O) //no materials, incinerate 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
var/mats = O.materials & mat_container.materials
var/amount = O.amount
mat_container.insert_item(O, sheet_per_ore) //insert it
materials.silo_log(src, "smelted", amount, "ores", mats)
qdel(O)
/obj/machinery/mineral/ore_redemption/proc/can_smelt_alloy(datum/design/D)
var/datum/component/material_container/mat_container = materials.mat_container
if(!mat_container || D.make_reagents.len)
return FALSE
var/build_amount = 0
for(var/mat_id in D.materials)
var/M = D.materials[mat_id]
var/datum/material/redemption_mat = mat_container.materials[mat_id]
if(!M || !redemption_mat)
return FALSE
var/smeltable_sheets = FLOOR(redemption_mat.amount / M, 1)
if(!smeltable_sheets)
return FALSE
if(!build_amount)
build_amount = smeltable_sheets
build_amount = min(build_amount, smeltable_sheets)
return build_amount
/obj/machinery/mineral/ore_redemption/proc/process_ores(list/ores_to_process)
var/current_amount = 0
for(var/ore in ores_to_process)
if(current_amount >= ore_pickup_rate)
break
smelt_ore(ore)
/obj/machinery/mineral/ore_redemption/proc/send_console_message()
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
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
msg += "[capitalize(M.name)]: [mineral_amount] sheets<br>"
if(!has_minerals)
return
for(var/obj/machinery/requests_console/D in GLOB.allConsoles)
if(D.receive_ore_updates)
D.createmessage("Ore Redemption Machine", "New minerals available!", msg, 1, 0)
/obj/machinery/mineral/ore_redemption/process()
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
if(OB)
input = OB
for(var/obj/item/stack/ore/O in input)
if(QDELETED(O))
continue
ore_buffer |= O
O.forceMove(src)
CHECK_TICK
if(LAZYLEN(ore_buffer))
message_sent = FALSE
process_ores(ore_buffer)
else if(!message_sent)
send_console_message()
/obj/machinery/mineral/ore_redemption/attackby(obj/item/W, mob/user, params)
if(default_unfasten_wrench(user, W))
return
if(default_deconstruction_screwdriver(user, "ore_redemption-open", "ore_redemption", W))
updateUsrDialog()
return
if(default_deconstruction_crowbar(W))
return
if(!powered())
return ..()
if(istype(W, /obj/item/disk/design_disk))
if(user.transferItemToLoc(W, src))
inserted_disk = W
return TRUE
if(istype(W, /obj/item/stack/ore/bluespace_crystal/refined))
to_chat(user, "<span class='notice'>[W] has already been refined!</span>")
return
return ..()
/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)
if(!ui)
ui = new(user, src, ui_key, "ore_redemption_machine", "Ore Redemption Machine", 440, 550, master_ui, state)
ui.open()
/obj/machinery/mineral/ore_redemption/ui_data(mob/user)
var/list/data = list()
data["unclaimedPoints"] = points
data["materials"] = list()
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 = SSresearch.techweb_design_by_id(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["diskDesigns"] = list()
if(inserted_disk)
data["hasDisk"] = TRUE
if(inserted_disk.blueprints.len)
var/index = 1
for (var/datum/design/thisdesign in inserted_disk.blueprints)
if(thisdesign)
data["diskDesigns"] += list(list("name" = thisdesign.name, "index" = index, "canupload" = thisdesign.build_type&SMELTER))
index++
return data
/obj/machinery/mineral/ore_redemption/ui_act(action, params)
if(..())
return
var/datum/component/material_container/mat_container = materials.mat_container
switch(action)
if("Claim")
var/mob/M = usr
var/obj/item/card/id/I = M.get_idcard(TRUE)
if(points)
if(I)
I.mining_points += points
points = 0
else
to_chat(usr, "<span class='warning'>No ID detected.</span>")
else
to_chat(usr, "<span class='warning'>No points to claim.</span>")
return TRUE
if("Release")
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(!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(!mat_container.materials[mat_id])
return
var/datum/material/mat = mat_container.materials[mat_id]
var/stored_amount = mat.amount / MINERAL_MATERIAL_AMOUNT
if(!stored_amount)
return
var/desired = 0
if (params["sheets"])
desired = text2num(params["sheets"])
else
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))
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)
//Logging deleted for quick coding
return TRUE
if("diskInsert")
var/obj/item/disk/design_disk/disk = usr.get_active_held_item()
if(istype(disk))
if(!usr.transferItemToLoc(disk,src))
return
inserted_disk = disk
else
to_chat(usr, "<span class='warning'>Not a valid Design Disk!</span>")
return TRUE
if("diskEject")
if(inserted_disk)
usr.put_in_hands(inserted_disk)
inserted_disk = null
return TRUE
if("diskUpload")
var/n = text2num(params["design"])
if(inserted_disk && inserted_disk.blueprints && inserted_disk.blueprints[n])
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)
var/mob/M = usr
var/obj/item/card/id/I = M.get_idcard(TRUE)
if((check_access(I) || allowed(usr)) && alloy)
var/smelt_amount = can_smelt_alloy(alloy)
var/desired = 0
if (params["sheets"])
desired = text2num(params["sheets"])
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))
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)
else
output = new alloy.build_path(src)
unload_mineral(output)
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)
..()
/obj/machinery/mineral/ore_redemption/power_change()
..()
update_icon()
/obj/machinery/mineral/ore_redemption/update_icon()
if(powered())
icon_state = initial(icon_state)
else
icon_state = "[initial(icon_state)]-off"
return
+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)
var/datum/component/material_container/materials = GetComponent(/datum/component/material_container)
materials.retrieve_all()
return ..()
/obj/machinery/ore_silo/proc/remote_attackby(obj/machinery/M, mob/user, obj/item/stack/I)
var/datum/component/material_container/materials = GetComponent(/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()
var/datum/component/material_container/materials = GetComponent(/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"]
var/datum/component/material_container/materials = GetComponent(/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/datum/ore_silo_log/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("hh:mm:ss")
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()
+91
View File
@@ -0,0 +1,91 @@
/**********************Light************************/
//this item is intended to give the effect of entering the mine, so that light gradually fades
/obj/effect/light_emitter
name = "Light emitter"
anchored = TRUE
invisibility = 101
var/set_luminosity = 8
var/set_cap = 0
/obj/effect/light_emitter/Initialize()
. = ..()
set_light(set_luminosity, set_cap)
/obj/effect/light_emitter/singularity_pull()
return
/obj/effect/light_emitter/singularity_act()
return
/**********************Miner Lockers**************************/
/obj/structure/closet/wardrobe/miner
name = "mining wardrobe"
icon_door = "mixed"
/obj/structure/closet/wardrobe/miner/PopulateContents()
new /obj/item/storage/backpack/duffelbag(src)
new /obj/item/storage/backpack/explorer(src)
new /obj/item/storage/backpack/satchel/explorer(src)
new /obj/item/clothing/under/rank/miner/lavaland(src)
new /obj/item/clothing/under/rank/miner/lavaland(src)
new /obj/item/clothing/under/rank/miner/lavaland(src)
new /obj/item/clothing/shoes/workboots/mining(src)
new /obj/item/clothing/shoes/workboots/mining(src)
new /obj/item/clothing/shoes/workboots/mining(src)
new /obj/item/clothing/gloves/color/black(src)
new /obj/item/clothing/gloves/color/black(src)
new /obj/item/clothing/gloves/color/black(src)
/obj/structure/closet/secure_closet/miner
name = "miner's equipment"
icon_state = "mining"
req_access = list(ACCESS_MINING)
/obj/structure/closet/secure_closet/miner/unlocked
locked = FALSE
/obj/structure/closet/secure_closet/miner/PopulateContents()
..()
new /obj/item/stack/sheet/mineral/sandbags(src, 5)
new /obj/item/storage/box/emptysandbags(src)
new /obj/item/shovel(src)
new /obj/item/pickaxe/mini(src)
new /obj/item/radio/headset/headset_cargo/mining(src)
new /obj/item/flashlight/seclite(src)
new /obj/item/storage/bag/plants(src)
new /obj/item/storage/bag/ore(src)
new /obj/item/t_scanner/adv_mining_scanner/lesser(src)
new /obj/item/gun/energy/kinetic_accelerator(src)
new /obj/item/clothing/glasses/meson(src)
new /obj/item/survivalcapsule(src)
new /obj/item/assault_pod/mining(src)
/**********************Shuttle Computer**************************/
/obj/machinery/computer/shuttle/mining
name = "mining shuttle console"
desc = "Used to call and send the mining shuttle."
req_access = list(ACCESS_MINING)
circuit = /obj/item/circuitboard/computer/mining_shuttle
shuttleId = "mining"
possible_destinations = "mining_home;mining_away;landing_zone_dock;mining_public"
no_destination_swap = 1
var/static/list/dumb_rev_heads = list()
//ATTACK HAND IGNORING PARENT RETURN VALUE
/obj/machinery/computer/shuttle/mining/attack_hand(mob/user)
if(is_station_level(user.z) && user.mind && is_head_revolutionary(user) && !(user.mind in dumb_rev_heads))
to_chat(user, "<span class='warning'>You get a feeling that leaving the station might be a REALLY dumb idea...</span>")
dumb_rev_heads += user.mind
return
. = ..()
/**********************Mining car (Crate like thing, not the rail car)**************************/
/obj/structure/closet/crate/miningcar
desc = "A mining car. This one doesn't work on rails, but has to be dragged."
name = "Mining car (not for rails)"
icon_state = "miningcar"
+105
View File
@@ -0,0 +1,105 @@
/**********************Mint**************************/
/obj/machinery/mineral/mint
name = "coin press"
icon = 'icons/obj/economy.dmi'
icon_state = "coinpress0"
density = TRUE
var/newCoins = 0 //how many coins the machine made in it's last load
var/processing = FALSE
var/chosen = MAT_METAL //which material will be used to make coins
var/coinsToProduce = 10
speed_process = TRUE
/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, /obj/item/stack)
/obj/machinery/mineral/mint/process()
var/turf/T = get_step(src, input_dir)
if(!T)
return
var/datum/component/material_container/materials = GetComponent(/datum/component/material_container)
for(var/obj/item/stack/sheet/O in T)
materials.insert_stack(O, O.amount)
/obj/machinery/mineral/mint/attack_hand(mob/user)
. = ..()
if(.)
return
var/dat = "<b>Coin Press</b><br>"
var/datum/component/material_container/materials = GetComponent(/datum/component/material_container)
for(var/mat_id in materials.materials)
var/datum/material/M = materials.materials[mat_id]
if(!M.amount && chosen != mat_id)
continue
dat += "<br><b>[M.name] amount:</b> [M.amount] cm<sup>3</sup> "
if (chosen == mat_id)
dat += "<b>Chosen</b>"
else
dat += "<A href='?src=[REF(src)];choose=[mat_id]'>Choose</A>"
var/datum/material/M = materials.materials[chosen]
dat += "<br><br>Will produce [coinsToProduce] [lowertext(M.name)] coins if enough materials are available.<br>"
dat += "<A href='?src=[REF(src)];chooseAmt=-10'>-10</A> "
dat += "<A href='?src=[REF(src)];chooseAmt=-5'>-5</A> "
dat += "<A href='?src=[REF(src)];chooseAmt=-1'>-1</A> "
dat += "<A href='?src=[REF(src)];chooseAmt=1'>+1</A> "
dat += "<A href='?src=[REF(src)];chooseAmt=5'>+5</A> "
dat += "<A href='?src=[REF(src)];chooseAmt=10'>+10</A> "
dat += "<br><br>In total this machine produced <font color='green'><b>[newCoins]</b></font> coins."
dat += "<br><A href='?src=[REF(src)];makeCoins=[1]'>Make coins</A>"
user << browse(dat, "window=mint")
/obj/machinery/mineral/mint/Topic(href, href_list)
if(..())
return
usr.set_machine(src)
src.add_fingerprint(usr)
if(processing==1)
to_chat(usr, "<span class='notice'>The machine is processing.</span>")
return
var/datum/component/material_container/materials = GetComponent(/datum/component/material_container)
if(href_list["choose"])
if(materials.materials[href_list["choose"]])
chosen = href_list["choose"]
if(href_list["chooseAmt"])
coinsToProduce = CLAMP(coinsToProduce + text2num(href_list["chooseAmt"]), 0, 1000)
if(href_list["makeCoins"])
var/temp_coins = coinsToProduce
processing = TRUE
icon_state = "coinpress1"
var/coin_mat = MINERAL_MATERIAL_AMOUNT * 0.2
var/datum/material/M = materials.materials[chosen]
if(!M || !M.coin_type)
updateUsrDialog()
return
while(coinsToProduce > 0 && materials.use_amount_type(coin_mat, chosen))
create_coins(M.coin_type)
coinsToProduce--
newCoins++
src.updateUsrDialog()
sleep(5)
icon_state = "coinpress0"
processing = FALSE
coinsToProduce = temp_coins
src.updateUsrDialog()
return
/obj/machinery/mineral/mint/proc/create_coins(P)
var/turf/T = get_step(src,output_dir)
if(T)
var/obj/item/O = new P(src)
var/obj/item/storage/bag/money/M = locate(/obj/item/storage/bag/money, T)
if(!M)
M = new /obj/item/storage/bag/money(src)
unload_mineral(M)
O.forceMove(M)
+27
View File
@@ -0,0 +1,27 @@
/*****************************Money bag********************************/
/obj/item/storage/bag/money
name = "money bag"
icon_state = "moneybag"
force = 10
throwforce = 0
resistance_flags = FLAMMABLE
max_integrity = 100
w_class = WEIGHT_CLASS_BULKY
/obj/item/storage/bag/money/Initialize()
. = ..()
var/datum/component/storage/STR = GetComponent(/datum/component/storage)
STR.max_w_class = WEIGHT_CLASS_NORMAL
STR.max_items = 40
STR.max_combined_w_class = 40
STR.can_hold = typecacheof(list(/obj/item/coin, /obj/item/stack/spacecash))
/obj/item/storage/bag/money/vault/PopulateContents()
new /obj/item/coin/silver(src)
new /obj/item/coin/silver(src)
new /obj/item/coin/silver(src)
new /obj/item/coin/silver(src)
new /obj/item/coin/gold(src)
new /obj/item/coin/gold(src)
new /obj/item/coin/adamantine(src)