Skip to content

Commit

Permalink
Merge pull request #980 from ACCount12/mining-update
Browse files Browse the repository at this point in the history
Mining update
  • Loading branch information
RemieRichards committed Sep 1, 2014
2 parents 84cfb31 + c2e3de1 commit 5ff9af6
Show file tree
Hide file tree
Showing 33 changed files with 321 additions and 97 deletions.
2 changes: 1 addition & 1 deletion code/__HELPERS/unsorted.dm
Expand Up @@ -1264,7 +1264,7 @@ proc/is_hot(obj/item/W as obj)
return 1000
else
return 0
if(/obj/item/weapon/pickaxe/plasmacutter)
if(/obj/item/weapon/gun/energy/plasmacutter)
return 3800
if(/obj/item/weapon/melee/energy)
return 3500
Expand Down
3 changes: 2 additions & 1 deletion code/_globalvars/lists/objects.dm
Expand Up @@ -13,4 +13,5 @@ var/global/list/chemical_reagents_list //list of all /datum/reagent datums in
var/global/list/surgeries_list = list() //list of all surgeries by name, associated with their path.
var/global/list/table_recipes = list() //list of all table craft recipes
var/global/list/med_hud_users = list() //list of all entities using a medical HUD.
var/global/list/sec_hud_users = list() //list of all entities using a security HUD.
var/global/list/sec_hud_users = list() //list of all entities using a security HUD.
var/global/list/mining_hud_users = list() //list of all entities using a mining HUD. TODO: make mining bots use this.
38 changes: 36 additions & 2 deletions code/game/data_huds.dm
Expand Up @@ -3,15 +3,20 @@ Use the regular_hud_updates() proc before process_med_hud(mob) or process_sec_hu
the HUD updates properly! */

//Deletes the current HUD images so they can be refreshed with new ones.
/image/var/hud_remove = 0


mob/proc/regular_hud_updates() //Used in the life.dm of mobs that can use HUDs.
if(client)
for(var/image/hud in client.images)
if(copytext(hud.icon_state,1,4) == "hud")
if(hud.hud_remove)
client.images -= hud
if(src in med_hud_users)
med_hud_users -= src
if(src in sec_hud_users)
sec_hud_users -= src
if(src in mining_hud_users)
mining_hud_users -= src


//Medical HUD procs
Expand Down Expand Up @@ -62,6 +67,7 @@ proc/process_med_hud(var/mob/M, var/mob/eye)
if(!C) continue

holder = patient.hud_list[HEALTH_HUD]
holder.hud_remove = 1
if(patient.stat == 2)
holder.icon_state = "hudhealth-100"
else
Expand Down Expand Up @@ -98,6 +104,7 @@ proc/process_sec_hud(var/mob/M, var/advanced_mode,var/mob/eye)
for(var/mob/living/carbon/human/perp in range(T))
holder = perp.hud_list[ID_HUD]
holder.icon_state = "hudno_id"
holder.hud_remove = 1
if(perp.wear_id)
holder.icon_state = "hud[ckey(perp.wear_id.GetJobName())]"
C.images += holder
Expand Down Expand Up @@ -131,4 +138,31 @@ proc/process_sec_hud(var/mob/M, var/advanced_mode,var/mob/eye)
if("Released") holder.icon_state = "hudreleased"
else
continue
C.images += holder
C.images += holder


proc/process_mining_hud(var/mob/M, var/mob/eye)
if(!M)
return
if(!M.client)
return

var/client/C = M.client

var/turf/eye_turf
if(eye)
eye_turf = get_turf(eye)
else
eye_turf = get_turf(M)

var/list/L = list()

for(var/turf/simulated/mineral/MT in range(7, eye_turf))
if(MT.scan_state)
L += MT

for(var/turf/simulated/mineral/MT in L)
var/turf/T = get_turf(MT)
var/image/I = image('icons/turf/walls.dmi', loc = T, icon_state = MT.scan_state, layer = 18)
I.hud_remove = 1
C.images += I
9 changes: 6 additions & 3 deletions code/game/machinery/recharger.dm
Expand Up @@ -22,9 +22,12 @@
user << "<span class='notice'>[src] blinks red as you try to insert [G].</span>"
return

if (istype(G, /obj/item/weapon/gun/energy/gun/nuclear) || istype(G, /obj/item/weapon/gun/energy/crossbow))
user << "<span class='notice'>Your gun's recharge port was removed to make room for a miniaturized reactor.</span>"
return
if(istype(G, /obj/item/weapon/gun/energy))
var/obj/item/weapon/gun/energy/gun = G
if(!gun.can_charge)
user << "<span class='notice'>Your gun has no external power connector.</span>"
return

user.drop_item()
G.loc = src
charging = G
Expand Down
18 changes: 18 additions & 0 deletions code/game/mecha/equipment/weapons/weapons.dm
Expand Up @@ -79,6 +79,24 @@
projectile = /obj/item/projectile/beam/pulse/heavy
fire_sound = 'sound/weapons/marauder.ogg'

/obj/item/mecha_parts/mecha_equipment/weapon/energy/plasma
equip_cooldown = 8
name = "217-D Heavy Plasma Cutter"
desc = "A device that shoots resonant plasma bursts at extreme velocity. The blasts are capable of crushing rock and demloishing solid obstacles."
icon_state = "mecha_plasmacutter"
item_state = "plasmacutter"
energy_drain = 45
origin_tech = "materials=3;combat=2;powerstorage=3;plasma=3"
projectile = /obj/item/projectile/plasma/adv/mech
fire_sound = 'sound/weapons/pulse.ogg'
construction_cost = list("metal"=20000,"silver"=6000,"plasma"=2000)

/obj/item/mecha_parts/mecha_equipment/weapon/energy/plasma/can_attach(obj/mecha/M as obj)
if(istype(M, /obj/mecha/working))
if(M.equipment.len<M.max_equip)
return 1
return 0


/obj/item/projectile/beam/pulse/heavy
name = "heavy pulse laser"
Expand Down
14 changes: 14 additions & 0 deletions code/game/mecha/mecha.dm
Expand Up @@ -70,6 +70,8 @@

var/stepsound = 'sound/mecha/mechturn.ogg'

var/obj/item/clothing/glasses/hud


/obj/mecha/New()
..()
Expand Down Expand Up @@ -1005,6 +1007,12 @@
playsound(src, 'sound/machines/windowdoor.ogg', 50, 1)
if(!hasInternalDamage())
src.occupant << sound('sound/mecha/nominal.ogg',volume=50)

if(hud)
if(H.glasses)
occupant_message("<font color='red'>[H.glasses] prevent you from using [src] [hud]</font>")
else
H.glasses = hud
return 1
else
return 0
Expand Down Expand Up @@ -1156,6 +1164,12 @@
mmi.mecha = null
src.occupant.canmove = 0
src.verbs += /obj/mecha/verb/eject

if(ishuman(occupant))
var/mob/living/carbon/human/H = occupant
if(H.glasses == hud)
H.glasses = null

src.occupant = null
src.icon_state = initial(icon_state)+"-open"
src.dir = dir_in
Expand Down
1 change: 1 addition & 0 deletions code/game/mecha/mecha_control_console.dm
Expand Up @@ -64,6 +64,7 @@
desc = "Device used to transmit exosuit data."
icon = 'icons/obj/device.dmi'
icon_state = "motion2"
w_class = 2
origin_tech = "programming=2;magnets=2"
construction_time = 50
construction_cost = list("metal"=500)
Expand Down
13 changes: 1 addition & 12 deletions code/game/mecha/medical/odysseus.dm
Expand Up @@ -9,23 +9,12 @@
internal_damage_threshold = 35
deflect_chance = 15
step_energy_drain = 6
var/obj/item/clothing/glasses/hud/health/mech/hud

New()
..()
hud = new /obj/item/clothing/glasses/hud/health/mech(src)
return

moved_inside(var/mob/living/carbon/human/H as mob)
if(..())
if(H.glasses)
occupant_message("<font color='red'>[H.glasses] prevent you from using [src] [hud]</font>")
else
H.glasses = hud
return 1
else
return 0

go_out()
if(ishuman(occupant))
var/mob/living/carbon/human/H = occupant
Expand Down Expand Up @@ -59,7 +48,7 @@

//TODO - Check documentation for client.eye and client.perspective...
/obj/item/clothing/glasses/hud/health/mech
name = "integrated medical Hud"
name = "integrated medical HUD"


process_hud(var/mob/M)
Expand Down
33 changes: 27 additions & 6 deletions code/game/mecha/working/ripley.dm
Expand Up @@ -2,18 +2,30 @@
desc = "Autonomous Power Loader Unit. The workhorse of the exosuit world."
name = "\improper APLU \"Ripley\""
icon_state = "ripley"
step_in = 6
step_in = 5
max_temperature = 20000
health = 200
wreckage = /obj/structure/mecha_wreckage/ripley
damage_absorption = list("brute"=0.8,"fire"=1,"bullet"=0.8,"laser"=0.9,"energy"=1,"bomb"=0.6)
max_equip = 6
var/list/cargo = new
var/cargo_capacity = 15

/*
/obj/mecha/working/ripley/New()
..()
return
*/
hud = new /obj/item/clothing/glasses/meson/adv/mech(src)

/obj/mecha/working/ripley/Move()
. = ..()
if(. && (locate(/obj/item/mecha_parts/mecha_equipment/tool/hydraulic_clamp) in equipment))
var/obj/structure/ore_box/ore_box = locate(/obj/structure/ore_box) in cargo
if(ore_box)
for(var/obj/item/weapon/ore/ore in get_turf(src))
ore.Move(ore_box)

/obj/item/clothing/glasses/meson/adv/mech
name = "Advanced Meson Visor"


/obj/mecha/working/ripley/firefighter
desc = "Standart APLU chassis was refitted with additional thermal protection and cistern."
Expand All @@ -22,7 +34,8 @@
max_temperature = 65000
health = 250
lights_power = 8
damage_absorption = list("fire"=0.5,"bullet"=0.8,"bomb"=0.5)
max_equip = 5 // More armor, less tools
damage_absorption = list("brute"=0.8,"fire"=0.5,"bullet"=0.7,"laser"=0.8,"energy"=1,"bomb"=0.4)
wreckage = /obj/structure/mecha_wreckage/ripley/firefighter

/obj/mecha/working/ripley/deathripley
Expand All @@ -46,7 +59,7 @@
return

/obj/mecha/working/ripley/mining
desc = "An old, dusty mining ripley."
desc = "An old, dusty mining Ripley."
name = "\improper APLU \"Miner\""

/obj/mecha/working/ripley/mining/New()
Expand All @@ -59,6 +72,14 @@
var/obj/item/mecha_parts/mecha_equipment/tool/drill/D = new /obj/item/mecha_parts/mecha_equipment/tool/drill
D.attach(src)

//Add possible plasma cutter
if(prob(25))
var/obj/item/mecha_parts/mecha_equipment/M = new /obj/item/mecha_parts/mecha_equipment/weapon/energy/plasma
M.attach(src)

//Add ore box to cargo
cargo.Add(new /obj/structure/ore_box(src))

//Attach hydrolic clamp
var/obj/item/mecha_parts/mecha_equipment/tool/hydraulic_clamp/HC = new /obj/item/mecha_parts/mecha_equipment/tool/hydraulic_clamp
HC.attach(src)
Expand Down
27 changes: 1 addition & 26 deletions code/game/mecha/working/working.dm
Expand Up @@ -4,29 +4,4 @@
/obj/mecha/working/New()
..()
new /obj/item/mecha_parts/mecha_tracking(src)
return

/*
/obj/mecha/working/melee_action(atom/target as obj|mob|turf)
if(internal_damage&MECHA_INT_CONTROL_LOST)
target = pick(oview(1,src))
if(selected_tool)
selected_tool.action(target)
return
*/

/obj/mecha/working/range_action(atom/target as obj|mob|turf)
return

/*
/obj/mecha/working/get_stats_part()
var/output = ..()
output += "<b>[src.name] Tools:</b><div style=\"margin-left: 15px;\">"
if(equipment.len)
for(var/obj/item/mecha_parts/mecha_equipment/MT in equipment)
output += "[selected==MT?"<b>":"<a href='?src=\ref[src];select_equip=\ref[MT]'>"][MT.get_equip_info()][selected==MT?"</b>":"</a>"]<br>"
else
output += "None"
output += "</div>"
return output
*/
return
2 changes: 1 addition & 1 deletion code/game/objects/structures/false_walls.dm
Expand Up @@ -113,7 +113,7 @@
else
user << "<span class='warning'>You can't reach, close it first!</span>"

if(istype(W, /obj/item/weapon/pickaxe/plasmacutter) || istype(W, /obj/item/weapon/pickaxe/diamonddrill) || istype(W, /obj/item/weapon/melee/energy/blade))
if(istype(W, /obj/item/weapon/gun/energy/plasmacutter) || istype(W, /obj/item/weapon/pickaxe/diamonddrill) || istype(W, /obj/item/weapon/melee/energy/blade))
dismantle()

/obj/structure/falsewall/proc/dismantle(mob/user)
Expand Down
4 changes: 2 additions & 2 deletions code/game/objects/structures/girders.dm
Expand Up @@ -25,7 +25,7 @@
transfer_fingerprints_to(G)
qdel(src)

else if(istype(W, /obj/item/weapon/pickaxe/plasmacutter))
else if(istype(W, /obj/item/weapon/gun/energy/plasmacutter))
user << "<span class='notice'>Now slicing apart the girder...</span>"
if(do_after(user,30))
if(!src) return
Expand Down Expand Up @@ -219,7 +219,7 @@
transfer_fingerprints_to(R)
qdel(src)

else if(istype(W, /obj/item/weapon/pickaxe/plasmacutter))
else if(istype(W, /obj/item/weapon/gun/energy/plasmacutter))
user << "<span class='notice'>Now slicing apart the girder...</span>"
if(do_after(user,30))
user << "<span class='notice'>You slice apart the girder!</span>"
Expand Down
4 changes: 2 additions & 2 deletions code/game/turfs/simulated/walls.dm
Expand Up @@ -157,7 +157,7 @@
thermitemelt(user)
return

else if(istype(W, /obj/item/weapon/pickaxe/plasmacutter))
else if(istype(W, /obj/item/weapon/gun/energy/plasmacutter))
thermitemelt(user)
return

Expand Down Expand Up @@ -191,7 +191,7 @@
user << "<span class='notice'>You need more welding fuel to complete this task.</span>"
return

else if( istype(W, /obj/item/weapon/pickaxe/plasmacutter) )
else if( istype(W, /obj/item/weapon/gun/energy/plasmacutter) )

user << "<span class='notice'>You begin slicing through the outer plating.</span>"
playsound(src, 'sound/items/Welder.ogg', 100, 1)
Expand Down
6 changes: 3 additions & 3 deletions code/game/turfs/simulated/walls_reinforced.dm
Expand Up @@ -28,7 +28,7 @@
thermitemelt(user)
return

else if(istype(W, /obj/item/weapon/pickaxe/plasmacutter))
else if(istype(W, /obj/item/weapon/gun/energy/plasmacutter))
thermitemelt(user)
return

Expand Down Expand Up @@ -103,7 +103,7 @@
user << "<span class='notice'>You need more welding fuel to complete this task.</span>"
return

if( istype(W, /obj/item/weapon/pickaxe/plasmacutter) )
if( istype(W, /obj/item/weapon/gun/energy/plasmacutter) )

user << "<span class='notice'>You begin slicing through the metal cover.</span>"
playsound(src, 'sound/items/Welder.ogg', 100, 1)
Expand Down Expand Up @@ -167,7 +167,7 @@
user << "<span class='notice'>You need more welding fuel to complete this task.</span>"
return

if( istype(W, /obj/item/weapon/pickaxe/plasmacutter) )
if( istype(W, /obj/item/weapon/gun/energy/plasmacutter) )

user << "<span class='notice'>You begin slicing through the support rods.</span>"
playsound(src, 'sound/items/Welder.ogg', 100, 1)
Expand Down
10 changes: 10 additions & 0 deletions code/modules/clothing/glasses/glasses.dm
Expand Up @@ -8,6 +8,16 @@
vision_flags = SEE_TURFS
invis_view = SEE_INVISIBLE_MINIMUM

/obj/item/clothing/glasses/meson/adv
name = "Advanced Meson Scanner"
desc = "Used by engineering and mining staff to see basic structural and terrain layouts through walls, regardless of lighting condition."
darkness_view = 4
origin_tech = "magnets=3;engineering=3"
hud = 1

/obj/item/clothing/glasses/meson/adv/process_hud(var/mob/M)
process_mining_hud(M)

/obj/item/clothing/glasses/meson/gar
name = "Gar Mesons"
icon_state = "garm"
Expand Down

0 comments on commit 5ff9af6

Please sign in to comment.