diff --git a/code/defines/obj.dm b/code/defines/obj.dm index 3e2786156f2..703d86464cd 100644 --- a/code/defines/obj.dm +++ b/code/defines/obj.dm @@ -1209,6 +1209,15 @@ throw_range = 3 var/perunit = 3750 +/obj/item/stack/sheet/attackby(obj/item/weapon/W as obj, mob/user as mob) + if (istype(W, /obj/item/weapon/sheetsnatcher)) + var/obj/item/weapon/sheetsnatcher/S = W + if(!S.mode) + S.add(src,user) + else + for (var/obj/item/stack/sheet/stack in locate(src.x,src.y,src.z)) + S.add(stack,user) + /obj/item/stack/sheet/wood name = "wooden planks" desc = "One can only guess that this is a bunch of wood." diff --git a/code/game/mecha/equipment/tools/tools.dm b/code/game/mecha/equipment/tools/tools.dm index 093528955df..a6760ae6083 100644 --- a/code/game/mecha/equipment/tools/tools.dm +++ b/code/game/mecha/equipment/tools/tools.dm @@ -114,6 +114,51 @@ equip_cooldown = 20 force = 15 + action(atom/target) + if(!action_checks(target)) return + set_ready_state(0) + chassis.use_power(energy_drain) + chassis.visible_message("[chassis] starts to drill [target]", "You hear the drill.") + occupant_message("You start to drill [target]") + var/T = chassis.loc + var/C = target.loc //why are these backwards? we may never know -Pete + if(do_after_cooldown(target)) + if(T == chassis.loc && src == chassis.selected) + if(istype(target, /turf/simulated/wall/r_wall)) + if(do_after_cooldown(target))//To slow down how fast mechs can drill through the station + log_message("Drilled through [target]") + target.ex_act(3) + else if(istype(target, /turf/simulated/mineral)) + for(var/turf/simulated/mineral/M in range(chassis,1)) + if(get_dir(chassis,M)&chassis.dir) + M.gets_drilled() + log_message("Drilled through [target]") + if(locate(/obj/item/mecha_parts/mecha_equipment/tool/hydraulic_clamp) in chassis.equipment) + var/obj/structure/ore_box/ore_box = locate(/obj/structure/ore_box) in chassis:cargo + if(ore_box) + for(var/obj/item/weapon/ore/ore in range(chassis,1)) + if(get_dir(chassis,ore)&chassis.dir) + ore.Move(ore_box) + else if(istype(target,/turf/simulated/floor/plating/airless/asteroid)) + for(var/turf/simulated/floor/plating/airless/asteroid/M in range(target,1)) + M.gets_dug() + log_message("Drilled through [target]") + if(locate(/obj/item/mecha_parts/mecha_equipment/tool/hydraulic_clamp) in chassis.equipment) + var/obj/structure/ore_box/ore_box = locate(/obj/structure/ore_box) in chassis:cargo + if(ore_box) + for(var/obj/item/weapon/ore/ore in range(chassis,1)) + ore.Move(ore_box) + else if(target.loc == C) + log_message("Drilled through [target]") + target.ex_act(2) + return 1 + + can_attach(obj/mecha/M as obj) + if(..()) + if(istype(M, /obj/mecha/working) || istype(M, /obj/mecha/combat)) + return 1 + return 0 + /obj/item/mecha_parts/mecha_equipment/tool/extinguisher name = "Extinguisher" desc = "Exosuit-mounted extinguisher (Can be attached to: Engineering exosuits)" diff --git a/code/game/mecha/working/ripley.dm b/code/game/mecha/working/ripley.dm index f6f60d7e509..8530ad0993a 100644 --- a/code/game/mecha/working/ripley.dm +++ b/code/game/mecha/working/ripley.dm @@ -46,8 +46,7 @@ name = "APLU \"Miner\"" /obj/mecha/working/ripley/mining/New() - //Do not use ..() here, doing so would spawn it with a tracking beacon allowing people to find secret mining asteroid rooms easily. - + ..() //Attach drill if(prob(25)) //Possible diamond drill... Feeling lucky? var/obj/item/mecha_parts/mecha_equipment/tool/drill/diamonddrill/D = new /obj/item/mecha_parts/mecha_equipment/tool/drill/diamonddrill @@ -59,6 +58,8 @@ //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) + for(var/obj/item/mecha_parts/mecha_tracking/B in src.contents)//Deletes the beacon so it can't be found easily + del (B) /obj/mecha/working/ripley/Exit(atom/movable/O) if(O in cargo) diff --git a/code/game/turf.dm b/code/game/turf.dm index d8a569dfda0..d15bd2bca31 100644 --- a/code/game/turf.dm +++ b/code/game/turf.dm @@ -151,9 +151,32 @@ /turf/proc/ReplaceWithFloor(explode=0) var/prior_icon = icon_old var/old_dir = dir + var/aoxy = 0//Holders to assimilate air from nearby turfs + var/anitro = 0 + var/aco = 0 + var/atox = 0 + var/atemp = 0 var/turf/simulated/floor/W = new /turf/simulated/floor( locate(src.x, src.y, src.z) ) + for(var/direction in cardinal) + var/turf/T = get_step(src,direction) + if(istype(T,/turf/space)) + continue + else if(istype(T,/turf/simulated)) + var/turf/simulated/S = T + if(S.air) + aoxy += S.air.oxygen + anitro += S.air.nitrogen + aco += S.air.carbon_dioxide + atox += S.air.toxins + atemp += S.air.temperature + W.air.oxygen = (aoxy/4) + W.air.nitrogen = (anitro/4) + W.air.carbon_dioxide = (aco/4) + W.air.toxins = (atox/4) + W.air.temperature = (atemp/4) + W.RemoveLattice() W.dir = old_dir if(prior_icon) W.icon_state = prior_icon @@ -169,8 +192,31 @@ /turf/proc/ReplaceWithPlating() var/prior_icon = icon_old var/old_dir = dir + var/aoxy = 0//Holders to assimilate air from nearby turfs + var/anitro = 0 + var/aco = 0 + var/atox = 0 + var/atemp = 0 var/turf/simulated/floor/plating/W = new /turf/simulated/floor/plating( locate(src.x, src.y, src.z) ) + for(var/direction in cardinal) + var/turf/T = get_step(src,direction) + if(istype(T,/turf/space)) + continue + else if(istype(T,/turf/simulated)) + var/turf/simulated/S = T + if(S.air) + aoxy += S.air.oxygen + anitro += S.air.nitrogen + aco += S.air.carbon_dioxide + atox += S.air.toxins + atemp += S.air.temperature + W.air.oxygen = (aoxy/4) + W.air.oxygen = (aoxy/4) + W.air.nitrogen = (anitro/4) + W.air.carbon_dioxide = (aco/4) + W.air.toxins = (atox/4) + W.air.temperature = (atemp/4) W.RemoveLattice() W.dir = old_dir diff --git a/code/modules/mining/mine_items.dm b/code/modules/mining/mine_items.dm index 4ad43b8ba06..ad4ea961b57 100644 --- a/code/modules/mining/mine_items.dm +++ b/code/modules/mining/mine_items.dm @@ -249,7 +249,7 @@ proc/move_mining_shuttle() name = "Diamond Mining Drill" icon_state = "diamonddrill" item_state = "jackhammer" - digspeed = 0 //Digs through walls, girders, and can dig up sand + digspeed = 5 //Digs through walls, girders, and can dig up sand origin_tech = "materials=6;powerstorage=4;engineering=5" desc = "Yours is the drill that will pierce the heavens!" diff --git a/code/modules/mining/mine_turfs.dm b/code/modules/mining/mine_turfs.dm index 64d01082761..48a52ef2ddd 100644 --- a/code/modules/mining/mine_turfs.dm +++ b/code/modules/mining/mine_turfs.dm @@ -14,6 +14,7 @@ var/mineralAmt = 0 var/spread = 0 //will the seam spread? var/spreadChance = 0 //the percentual chance of an ore spreading to the neighbouring tiles + var/last_act = 0 /turf/simulated/mineral/Del() return @@ -216,7 +217,9 @@ return */ //Watch your tabbing, microwave. --NEO - + if(last_act+W:digspeed > world.time)//prevents message spam + return + last_act = world.time user << "\red You start picking." playsound(user, 'Genhit.ogg', 20, 1) @@ -263,6 +266,28 @@ mineralAmt = 5 return*/ +/turf/simulated/mineral/Bumped(AM as mob|obj) + ..() + if(istype(AM,/mob/living/carbon/human)) + var/mob/living/carbon/human/H = AM + if(istype(H.l_hand,/obj/item/weapon/pickaxe)) + src.attackby(H.l_hand,H) + else if(istype(H.r_hand,/obj/item/weapon/pickaxe)) + src.attackby(H.r_hand,H) + return + else if(istype(AM,/mob/living/silicon/robot)) + var/mob/living/silicon/robot/R = AM + if(istype(R.module_active,/obj/item/weapon/pickaxe)) + src.attackby(R.module_active,R) + return +/* else if(istype(AM,/obj/mecha)) + var/obj/mecha/M = AM + if(istype(M.selected,/obj/item/mecha_parts/mecha_equipment/tool/drill)) + src.attackby(M.selected,M) + return*/ +//Aparantly mechs are just TOO COOL to call Bump(), so fuck em (for now) + else + return /**********************Asteroid**************************/ @@ -320,8 +345,7 @@ if ((user.loc == T && user.equipped() == W)) user << "\blue You dug a hole." gets_dug() - else - ..(W,user) + if ((istype(W,/obj/item/weapon/pickaxe/drill))) var/turf/T = user.loc if (!( istype(T, /turf) )) @@ -338,8 +362,6 @@ if ((user.loc == T && user.equipped() == W)) user << "\blue You dug a hole." gets_dug() - else - ..(W,user) if ((istype(W,/obj/item/weapon/pickaxe/diamonddrill)) || (istype(W,/obj/item/weapon/pickaxe/borgdrill))) var/turf/T = user.loc @@ -357,9 +379,16 @@ if ((user.loc == T && user.equipped() == W)) user << "\blue You dug a hole." gets_dug() + + if(istype(W,/obj/item/weapon/satchel)) + var/obj/item/weapon/satchel/S = W + if(S.mode) + for(var/obj/item/weapon/ore/O in src.contents) + O.attackby(W,user) + return + else ..(W,user) - return /turf/simulated/floor/plating/airless/asteroid/proc/gets_dug() @@ -415,4 +444,18 @@ if(istype(get_step(src, SOUTH), /turf/simulated/floor/plating/airless/asteroid)) A = get_step(src, SOUTH) A.updateMineralOverlays() - src.updateMineralOverlays() \ No newline at end of file + src.updateMineralOverlays() + +/turf/simulated/floor/plating/airless/asteroid/Entered(atom/movable/M as mob|obj) + ..() + if(istype(M,/mob/living/silicon/robot)) + var/mob/living/silicon/robot/R = M + if(istype(R.module, /obj/item/weapon/robot_module/miner)) + if(istype(R.module_state_1,/obj/item/weapon/satchel/borg)) + src.attackby(R.module_state_1,R) + else if(istype(R.module_state_2,/obj/item/weapon/satchel/borg)) + src.attackby(R.module_state_2,R) + else if(istype(R.module_state_3,/obj/item/weapon/satchel/borg)) + src.attackby(R.module_state_3,R) + else + return \ No newline at end of file diff --git a/code/modules/mining/satchel_ore_boxdm.dm b/code/modules/mining/satchel_ore_boxdm.dm index d116cb00580..caf339f8f98 100644 --- a/code/modules/mining/satchel_ore_boxdm.dm +++ b/code/modules/mining/satchel_ore_boxdm.dm @@ -120,4 +120,165 @@ O.loc = src.loc usr << "\blue You empty the box" src.updateUsrDialog() - return \ No newline at end of file + return + +/**********************Sheet Snatcher**************************/ +//Stolen satchel code, making it a box just wouldn't work well for this -Sieve + +/obj/item/weapon/sheetsnatcher + icon = 'mining.dmi' + icon_state = "sheetsnatcher" + name = "Sheet Snatcher" + desc = "A patented Nanotrasen storage system designed for any kind of mineral sheet." + var/mode = 1; //0 = pick one at a time, 1 = pick all on tile + var/capacity = 300; //the number of sheets it can carry. + flags = FPRINT | TABLEPASS + w_class = 3 + var/metal = 0//Holder values, to have a count of how much of each type is in the snatcher + var/glass = 0 + var/gold = 0 + var/silver = 0 + var/diamond = 0 + var/plasma = 0 + var/uranium = 0 + var/clown = 0 + var/euranium = 0 + var/plasteel = 0 + +/obj/item/weapon/sheetsnatcher/attack_self(mob/user as mob)//Credit goes to carn on this one + var/location = get_turf(src) //fetches the turf containing the object. (so stuff spawns on the floor) + if(metal) + var/obj/item/stack/sheet/metal/S = new (location) + var/stacksize = min(metal,50) //maximum stack size is 50! + S.amount = stacksize + metal -= stacksize + if(glass) + var/obj/item/stack/sheet/glass/S = new (location) + var/stacksize = min(glass,50) + S.amount = stacksize + glass -= stacksize + if(gold) + var/obj/item/stack/sheet/gold/S = new (location) + var/stacksize = min(gold,50) + S.amount = stacksize + gold -= stacksize + if(silver) + var/obj/item/stack/sheet/silver/S = new (location) + var/stacksize = min(silver,50) + S.amount = stacksize + silver -= stacksize + if(diamond) + var/obj/item/stack/sheet/diamond/S = new (location) + var/stacksize = min(diamond,50) + S.amount = stacksize + diamond -= stacksize + if(plasma) + var/obj/item/stack/sheet/plasma/S = new (location) + var/stacksize = min(plasma,50) + S.amount = stacksize + plasma -= stacksize + if(uranium) + var/obj/item/stack/sheet/uranium/S = new (location) + var/stacksize = min(uranium,50) + S.amount = stacksize + uranium -= stacksize + if(clown) + var/obj/item/stack/sheet/clown/S = new (location) + var/stacksize = min(clown,50) + S.amount = stacksize + clown -= stacksize + if(euranium) + var/obj/item/stack/sheet/enruranium/S = new (location) + var/stacksize = min(euranium,50) + S.amount = stacksize + euranium -= stacksize + if(plasteel) + var/obj/item/stack/sheet/plasteel/S = new (location) + var/stacksize = min(plasteel,50) + S.amount = stacksize + plasteel -= stacksize + else if(!metal && !glass && !gold && !silver && !diamond && !plasma && !uranium && !clown && !euranium && !plasteel) + user << "\blue You empty the snatch." + return + + +/obj/item/weapon/sheetsnatcher/attackby(obj/item/weapon/W as obj, mob/user as mob) + ..() + if (istype(W, /obj/item/stack/sheet)) + var/obj/item/stack/sheet/O = W + src.add(O,user) + return + +/obj/item/weapon/sheetsnatcher/verb/toggle_mode() + set name = "Switch Sheet Snatcher Method" + set category = "Object" + + mode = !mode + switch (mode) + if(1) + usr << "The snatcher now picks up all sheets on a tile at once." + if(0) + usr << "The snatcher now picks up one sheet at a time." + +/obj/item/weapon/sheetsnatcher/proc/add(var/obj/item/stack/sheet/S as obj, mob/user as mob)//Handles sheets, adds them to the holder values + if((S.name == "Sandstone Bricks") || (S.name == "Wood Planks"))//Does not pick up sandstone or wood, as they are not true sheets + return + var/current = metal+glass+gold+silver+diamond+plasma+uranium+clown + if(capacity == current)//If it's full, you're done + user << "\red The snatcher is full." + return + if(capacity < current + S.amount)//If the stack will fill it up + var/diff = capacity - current + switch(S.name) + if("metal") + metal += diff + if("glass") + glass += diff + if("silver") + silver += diff + if("gold") + gold += diff + if("diamond") + diamond += diff + if("solid plasma") + plasma += diff + if("uranium") + uranium += diff + if("bananium") + clown += diff + if("enriched uranium") + euranium += diff + if("plasteel") + plasteel += diff + S.amount -= diff + user << "\blue You add the [S.name] to the [name]" + else + switch(S.name) + if("metal") + metal += S.amount + if("glass") + glass += S.amount + if("silver") + silver += S.amount + if("gold") + gold += S.amount + if("diamond") + diamond += S.amount + if("solid plasma") + plasma += S.amount + if("uranium") + uranium += S.amount + if("bananium") + clown += S.amount + if("enriched uranium") + euranium += S.amount + if("plasteel") + plasteel += S.amount + user << "\blue You add the [S.name] to the [name]" + del (S) + return + +/obj/item/weapon/sheetsnatcher/borg + name = "Sheet Snatcher 9000" + desc = "" + capacity = 500//Borgs get more because >specialization \ No newline at end of file diff --git a/code/modules/mob/living/silicon/robot/robot_modules.dm b/code/modules/mob/living/silicon/robot/robot_modules.dm index 039888914d8..bbf301676a1 100644 --- a/code/modules/mob/living/silicon/robot/robot_modules.dm +++ b/code/modules/mob/living/silicon/robot/robot_modules.dm @@ -198,8 +198,8 @@ src.emag = new /obj/item/borg/stun(src) src.modules += new /obj/item/weapon/satchel/borg(src) src.modules += new /obj/item/weapon/pickaxe/borgdrill(src) + src.modules += new /obj/item/weapon/sheetsnatcher/borg(src) // src.modules += new /obj/item/weapon/shovel(src) Uneeded due to buffed drill -// src.jetpack += new/obj/item/weapon/tank/jetpack/carbondioxide(src) return diff --git a/html/changelog.html b/html/changelog.html index b102ffbb46a..5ab731b3ee9 100644 --- a/html/changelog.html +++ b/html/changelog.html @@ -46,6 +46,21 @@ Stuff which is in development and not yet visible to players or just code relate should be listed in the changelog upon commit tho. Thanks. --> +