From 97962ba59b8c5724d8e68d4b6037f5779965557d Mon Sep 17 00:00:00 2001 From: GunHog Date: Mon, 9 Mar 2015 08:47:38 -0500 Subject: [PATCH 1/4] Fixes "Sensor Augmentation" showing in silicon verbs - Fixes #8167 --- code/modules/mob/living/silicon/silicon.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/modules/mob/living/silicon/silicon.dm b/code/modules/mob/living/silicon/silicon.dm index 461456ff887..68eeaf670d7 100644 --- a/code/modules/mob/living/silicon/silicon.dm +++ b/code/modules/mob/living/silicon/silicon.dm @@ -338,7 +338,7 @@ var/datum/atom_hud/medsensor = huds[med_hud] medsensor.add_hud_to(src) -/mob/living/silicon/verb/sensor_mode() +/mob/living/silicon/proc/sensor_mode() set name = "Set Sensor Augmentation" var/sensor_type = input("Please select sensor type.", "Sensor Integration", null) in list("Security", "Medical","Disable") remove_med_sec_hud() From 7ba8af5222c5026af26a02be239231e966192bcf Mon Sep 17 00:00:00 2001 From: phil235 Date: Tue, 10 Mar 2015 20:30:46 +0100 Subject: [PATCH 2/4] Fixes steel cap bug. Steel cap now growns steel logs similar to wooden logs, you use the hatchet to get rods. Reorganizes all flashing to use the same mob proc 'flash_eyes()' (welding tool use, flashbang, flashers, laserpointers, etc). Fixes making sandstone not stacking the result sandstones on the floor. Sandstone, grass tile and carpet tile now look for other incomplete stack on their creation location to try to put them all in one stack (exactly like wood planks). Fix typos. Remove banglet var from all flashbangs, making flashbangs from clusters behave exactly like the other ones. Renames eyecheck()proc to check_eye_prot() and moves it to mob/living level, elso creates check_ear_prot() for checking ear protection. --- code/game/machinery/camera/camera.dm | 6 +- code/game/machinery/camera/camera_assembly.dm | 5 +- code/game/machinery/flasher.dm | 21 +--- code/game/objects/items/devices/flash.dm | 21 ++-- .../objects/items/devices/laserpointer.dm | 52 ++-------- .../items/weapons/grenades/clusterbuster.dm | 1 - .../items/weapons/grenades/flashbang.dm | 32 ++---- .../items/weapons/grenades/spawnergrenade.dm | 4 +- code/game/objects/items/weapons/tools.dm | 44 +-------- code/modules/events/anomaly_bluespace.dm | 3 +- code/modules/hydroponics/grown.dm | 6 ++ code/modules/hydroponics/growninedible.dm | 39 ++++---- code/modules/hydroponics/seeds.dm | 4 +- code/modules/mining/ores_coins.dm | 25 +++-- code/modules/mob/living/carbon/alien/alien.dm | 2 +- code/modules/mob/living/carbon/carbon.dm | 93 +++++++++++++++++- .../mob/living/carbon/human/human_helpers.dm | 8 +- code/modules/mob/living/carbon/life.dm | 11 +-- code/modules/mob/living/living.dm | 14 +++ .../reagents/Chemistry-Goon-Medicine.dm | 3 +- code/modules/reagents/Chemistry-Recipes.dm | 7 +- icons/obj/hydroponics/harvest.dmi | Bin 42201 -> 42555 bytes 22 files changed, 204 insertions(+), 197 deletions(-) diff --git a/code/game/machinery/camera/camera.dm b/code/game/machinery/camera/camera.dm index 8a8b1836eae..ca12735a07d 100644 --- a/code/game/machinery/camera/camera.dm +++ b/code/game/machinery/camera/camera.dm @@ -323,17 +323,15 @@ return null -/obj/machinery/camera/proc/weld(var/obj/item/weapon/weldingtool/WT, var/mob/user) +/obj/machinery/camera/proc/weld(var/obj/item/weapon/weldingtool/WT, var/mob/living/user) if(busy) return 0 - if(!WT.isOn()) + if(!WT.remove_fuel(0, user)) return 0 - // Do after stuff here user << "You start to weld [src]." playsound(src.loc, 'sound/items/Welder.ogg', 50, 1) - WT.eyecheck(user) busy = 1 if(do_after(user, 100)) busy = 0 diff --git a/code/game/machinery/camera/camera_assembly.dm b/code/game/machinery/camera/camera_assembly.dm index 5e36e6ff1af..10d4c1716b6 100644 --- a/code/game/machinery/camera/camera_assembly.dm +++ b/code/game/machinery/camera/camera_assembly.dm @@ -149,16 +149,15 @@ if(!anchored) ..() -/obj/item/weapon/camera_assembly/proc/weld(var/obj/item/weapon/weldingtool/WT, var/mob/user) +/obj/item/weapon/camera_assembly/proc/weld(var/obj/item/weapon/weldingtool/WT, var/mob/living/user) if(busy) return 0 - if(!WT.isOn()) + if(!WT.remove_fuel(0, user)) return 0 user << "You start to weld \the [src].." playsound(src.loc, 'sound/items/Welder.ogg', 50, 1) - WT.eyecheck(user) busy = 1 if(do_after(user, 20)) busy = 0 diff --git a/code/game/machinery/flasher.dm b/code/game/machinery/flasher.dm index da34431eee6..3873123583f 100644 --- a/code/game/machinery/flasher.dm +++ b/code/game/machinery/flasher.dm @@ -78,26 +78,13 @@ last_flash = world.time use_power(1000) - for (var/mob/O in viewers(src, null)) - if (get_dist(src, O) > src.range) + for (var/mob/living/L in viewers(src, null)) + if (get_dist(src, L) > range) continue - if (istype(O, /mob/living/carbon/human)) - var/mob/living/carbon/human/H = O - if(!H.eyecheck() <= 0) - continue + if(L.flash_eyes()) + L.Weaken(strength) - if (istype(O, /mob/living/carbon/alien))//So aliens don't get flashed (they have no external eyes)/N - continue - - O.Weaken(strength) - if ((O.eye_stat > 15 && prob(O.eye_stat + 50))) - flick("e_flash", O:flash) - O.eye_stat += rand(1, 2) - else - if(!O.eye_blind) - flick("flash", O:flash) - O.eye_stat += rand(0, 2) return 1 diff --git a/code/game/objects/items/devices/flash.dm b/code/game/objects/items/devices/flash.dm index 5496413aff1..e680889e33d 100644 --- a/code/game/objects/items/devices/flash.dm +++ b/code/game/objects/items/devices/flash.dm @@ -59,19 +59,17 @@ /obj/item/device/flash/proc/flash_carbon(var/mob/living/carbon/M, var/mob/user = null, var/power = 5, targeted = 1) add_logs(user, M, "flashed", object="[src.name]") - var/safety = M.eyecheck() - if(safety <= 0) - M.confused += power - flick("e_flash", M.flash) - if(user && targeted) + if(user && targeted) + if(M.flash_eyes(1, 1)) + M.confused += power terrible_conversion_proc(M, user) M.Stun(1) user.visible_message("[user] blinds [M] with the flash!") - return 1 - else - if(user && targeted) + else user.visible_message("[user] fails to blind [M] with the flash!") - return 0 + else + if(M.flash_eyes()) + M.confused += power /obj/item/device/flash/attack(mob/living/M, mob/user) if(!try_use_flash(user)) @@ -82,9 +80,10 @@ return 1 else if(issilicon(M)) - M.Weaken(rand(5,10)) add_logs(user, M, "flashed", object="[src.name]") - user.visible_message("[user] overloads [M]'s sensors with the flash!") + if(M.flash_eyes()) + M.Weaken(rand(5,10)) + user.visible_message("[user] overloads [M]'s sensors with the flash!") return 1 user.visible_message("[user] fails to blind [M] with the flash!") diff --git a/code/game/objects/items/devices/laserpointer.dm b/code/game/objects/items/devices/laserpointer.dm index fc6892d28aa..4dc95ea12e3 100644 --- a/code/game/objects/items/devices/laserpointer.dm +++ b/code/game/objects/items/devices/laserpointer.dm @@ -96,52 +96,19 @@ //human/alien mobs if(iscarbon(target)) + var/mob/living/carbon/C = target if(user.zone_sel.selecting == "eyes") - var/mob/living/carbon/C = target + add_logs(user, C, "shone in the eyes", object="laser pointer") + + var/severity = 1 + if(prob(33)) + severity = 2 + else if(prob(50)) + severity = 0 //20% chance to actually hit the eyes - if(prob(effectchance * diode.rating)) - add_logs(user, C, "shone in the eyes", object="laser pointer") - - //eye target check + if(prob(effectchance * diode.rating) && C.flash_eyes(severity)) outmsg = "You blind [C] by shining [src] in their eyes." - var/eye_prot = C.eyecheck() - if(C.eye_blind || eye_prot >= 2) - eye_prot = 4 - var/severity = 3 - eye_prot - if(prob(33)) - severity += 1 - else if(prob(50)) - severity -= 1 - severity = min(max(severity, 0), 4) - - switch(severity) - if(0) - //no effect - C << "A small, bright dot appears in your vision." - if(1) - //industrial grade eye protection - C.eye_stat += rand(0, 2) - C << "Something bright flashes in the corner of your vision!" - if(2) - //basic eye protection (sunglasses) - flick("flash", C.flash) - C.eye_stat += rand(1, 6) - C << "Your eyes were blinded!" - if(3) - //no eye protection - if(prob(2)) - C.Weaken(1) - flick("e_flash", C.flash) - C.eye_stat += rand(3, 7) - C << "Your eyes were blinded!" - if(4) - //the effect has been worsened by something - if(prob(5)) - C.Weaken(1) - flick("e_flash", C.flash) - C.eye_stat += rand(5, 10) - C << "Your eyes were blinded!" else outmsg = "You fail to blind [C] by shining [src] at their eyes." @@ -150,6 +117,7 @@ var/mob/living/silicon/S = target //20% chance to actually hit the sensors if(prob(effectchance * diode.rating)) + S.flash_eyes() S.Weaken(rand(5,10)) S << "Your sensors were overloaded by a laser!" outmsg = "You overload [S] by shining [src] at their sensors." diff --git a/code/game/objects/items/weapons/grenades/clusterbuster.dm b/code/game/objects/items/weapons/grenades/clusterbuster.dm index 63d4c41aa1c..31576237a04 100644 --- a/code/game/objects/items/weapons/grenades/clusterbuster.dm +++ b/code/game/objects/items/weapons/grenades/clusterbuster.dm @@ -76,7 +76,6 @@ ///////////////////////////////// /obj/item/weapon/grenade/flashbang/cluster icon_state = "flashbang_active" - banglet = 1 /obj/item/weapon/grenade/clusterbuster/emp name = "Electromagnetic Storm" diff --git a/code/game/objects/items/weapons/grenades/flashbang.dm b/code/game/objects/items/weapons/grenades/flashbang.dm index 6db5b1f306d..8157a2208e7 100644 --- a/code/game/objects/items/weapons/grenades/flashbang.dm +++ b/code/game/objects/items/weapons/grenades/flashbang.dm @@ -3,7 +3,6 @@ icon_state = "flashbang" item_state = "flashbang" origin_tech = "materials=2;combat=1" - var/banglet = 0 /obj/item/weapon/grenade/flashbang/prime() update_mob() @@ -23,33 +22,15 @@ M.show_message("BANG", 2) playsound(loc, 'sound/effects/bang.ogg', 25, 1) -//Checking for protections - var/eye_safety = 0 - var/ear_safety = 0 +//Checking for protection + var/ear_safety = M.check_ear_prot() var/distance = max(1,get_dist(src,T)) - var/takes_eye_damage = 0 - if(iscarbon(M)) - takes_eye_damage++ - var/mob/living/carbon/C = M - eye_safety = C.eyecheck() - if(ishuman(C)) - var/mob/living/carbon/human/H = C - if((H.ears && (H.ears.flags & EARBANGPROTECT)) || (H.head && (H.head.flags & HEADBANGPROTECT))) - ear_safety++ //Flash - if(!eye_safety) - flick("e_flash", M.flash) + if(M.flash_eyes()) M.eye_stat += rand(1, 3) M.Stun(max(10/distance, 3)) M.Weaken(max(10/distance, 3)) - if (M.eye_stat >= 20 && takes_eye_damage) - M << "Your eyes start to burn badly!" - M.disabilities |= NEARSIGHT - if(!banglet) - if (prob(M.eye_stat - 20 + 1)) - M << "You can't see anything!" - M.disabilities |= BLIND //Bang if((loc == M) || loc == M.loc)//Holding on person or being exactly where lies is significantly more dangerous and voids protection @@ -61,10 +42,9 @@ M.setEarDamage(M.ear_damage + rand(0, 5), max(M.ear_deaf,15)) if (M.ear_damage >= 15) M << "Your ears start to ring badly!" - if(!banglet) - if(prob(M.ear_damage - 10 + 5)) - M << "You can't hear anything!" - M.disabilities |= DEAF + if(prob(M.ear_damage - 10 + 5)) + M << "You can't hear anything!" + M.disabilities |= DEAF else if (M.ear_damage >= 5) M << "Your ears start to ring!" diff --git a/code/game/objects/items/weapons/grenades/spawnergrenade.dm b/code/game/objects/items/weapons/grenades/spawnergrenade.dm index c104bfd9c73..9edf321b7e8 100644 --- a/code/game/objects/items/weapons/grenades/spawnergrenade.dm +++ b/code/game/objects/items/weapons/grenades/spawnergrenade.dm @@ -5,7 +5,6 @@ icon_state = "delivery" item_state = "flashbang" origin_tech = "materials=3;magnets=4" - var/banglet = 0 var/spawner_type = null // must be an object path var/deliveryamt = 1 // amount of type to deliver @@ -16,8 +15,7 @@ var/turf/T = get_turf(src) playsound(T, 'sound/effects/phasein.ogg', 100, 1) for(var/mob/living/carbon/human/M in viewers(T, null)) - if(M:eyecheck() <= 0) - flick("e_flash", M.flash) // flash dose faggots + M.flash_eyes() for(var/i=1, i<=deliveryamt, i++) var/atom/movable/x = new spawner_type diff --git a/code/game/objects/items/weapons/tools.dm b/code/game/objects/items/weapons/tools.dm index fe4713a37c5..dabcab90e2d 100644 --- a/code/game/objects/items/weapons/tools.dm +++ b/code/game/objects/items/weapons/tools.dm @@ -269,15 +269,15 @@ return reagents.get_reagent_amount("fuel") -//Removes fuel from the welding tool. If a mob is passed, it will perform an eyecheck on the mob. This should probably be renamed to use() -/obj/item/weapon/weldingtool/proc/remove_fuel(amount = 1, mob/M = null) +//Removes fuel from the welding tool. If a mob is passed, it will try to flash the mob's eyes. This should probably be renamed to use() +/obj/item/weapon/weldingtool/proc/remove_fuel(amount = 1, mob/living/M = null) if(!welding || !check_fuel()) return 0 if(get_fuel() >= amount) reagents.remove_reagent("fuel", amount) check_fuel() if(M) - eyecheck(M) + M.flash_eyes(2) return 1 else if(M) @@ -331,44 +331,6 @@ hitsound = "swing_hit" icon_state = "welder" - - -//Decides whether or not to damage a player's eyes based on what they're wearing as protection -//Note: This should probably be moved to mob -/obj/item/weapon/weldingtool/proc/eyecheck(mob/user) - if(!iscarbon(user)) - return 1 - var/mob/living/carbon/C = user - var/safety = C.eyecheck() - - switch(safety) - if(1) - usr << "Your eyes sting a little." - user.eye_stat += rand(1, 2) - if(user.eye_stat > 12) - user.eye_blurry += rand(3, 6) - if(0) - usr << "Your eyes burn." - user.eye_stat += rand(2, 4) - if(user.eye_stat > 10) - user.eye_blurry += rand(4, 10) - if(-1) - usr << "Your thermals intensify the welder's glow. Your eyes itch and burn severely!" - user.eye_blurry += rand(12, 20) - user.eye_stat += rand(12, 16) - if(user.eye_stat > 10 && safety < 2) - user << "Your eyes are really starting to hurt. This can't be good for you!" - if (prob(user.eye_stat - 25 + 1)) - user << "You go blind!" - user.disabilities |= BLIND - else if(prob(user.eye_stat - 15 + 1)) - user << "You go blind!" - user.eye_blind = 5 - user.eye_blurry = 5 - user.disabilities |= NEARSIGHT - spawn(100) - user.disabilities &= ~NEARSIGHT - /obj/item/weapon/weldingtool/proc/flamethrower_screwdriver(obj/item/I, mob/user) if(welding) user << "Turn it off first." diff --git a/code/modules/events/anomaly_bluespace.dm b/code/modules/events/anomaly_bluespace.dm index 5171ca6a4b6..91f71dc1fe9 100644 --- a/code/modules/events/anomaly_bluespace.dm +++ b/code/modules/events/anomaly_bluespace.dm @@ -44,8 +44,7 @@ var/list/flashers = list() for(var/mob/living/carbon/human/M in viewers(TO, null)) - if(M:eyecheck() <= 0) - flick("e_flash", M.flash) // flash dose faggots + if(M.flash_eyes()) flashers += M var/y_distance = TO.y - FROM.y diff --git a/code/modules/hydroponics/grown.dm b/code/modules/hydroponics/grown.dm index 66ff37b9a56..0d873c95e8c 100644 --- a/code/modules/hydroponics/grown.dm +++ b/code/modules/hydroponics/grown.dm @@ -969,6 +969,9 @@ obj/item/weapon/reagent_containers/food/snacks/grown/shell/eggy/add_juice() GT.amount = GT.max_amount else GT.amount = grassAmt + for(var/obj/item/stack/tile/grass/GR in user.loc) + if(GR != GT && GR.amount < GR.max_amount) + GR.attackby(GT, user) //we try to transfer all old unfinished stacks to the new stack we created. grassAmt -= GT.max_amount qdel(src) return @@ -991,6 +994,9 @@ obj/item/weapon/reagent_containers/food/snacks/grown/shell/eggy/add_juice() CT.amount = CT.max_amount else CT.amount = carpetAmt + for(var/obj/item/stack/tile/carpet/CA in user.loc) + if(CA != CT && CA.amount < CA.max_amount) + CA.attackby(CT, user) //we try to transfer all old unfinished stacks to the new stack we created. carpetAmt -= CT.max_amount qdel(src) return diff --git a/code/modules/hydroponics/growninedible.dm b/code/modules/hydroponics/growninedible.dm index 27c3ff1d38e..0fe9d609cb7 100644 --- a/code/modules/hydroponics/growninedible.dm +++ b/code/modules/hydroponics/growninedible.dm @@ -4,7 +4,7 @@ /obj/item/weapon/grown // Grown weapons name = "grown_weapon" - icon = 'icons/obj/weapons.dmi' + icon = 'icons/obj/hydroponics/harvest.dmi' var/seed = null var/plantname = "" var/product //a type path @@ -45,7 +45,6 @@ seed = /obj/item/seeds/towermycelium name = "tower-cap log" desc = "It's better than bad, it's good!" - icon = 'icons/obj/hydroponics/harvest.dmi' icon_state = "logs" force = 5 throwforce = 5 @@ -55,6 +54,8 @@ plant_type = 2 origin_tech = "materials=1" attack_verb = list("bashed", "battered", "bludgeoned", "whacked") + var/plank_type = /obj/item/stack/sheet/mineral/wood + var/plank_name = "wooden planks" var/list/accepted = list(/obj/item/weapon/reagent_containers/food/snacks/grown/tobacco, /obj/item/weapon/reagent_containers/food/snacks/grown/tobacco/space, /obj/item/weapon/reagent_containers/food/snacks/grown/tea/aspera, @@ -67,19 +68,16 @@ /obj/item/weapon/grown/log/attackby(obj/item/weapon/W as obj, mob/user as mob, params) ..() if(istype(W, /obj/item/weapon/circular_saw) || istype(W, /obj/item/weapon/hatchet) || (istype(W, /obj/item/weapon/twohanded/fireaxe) && W:wielded) || istype(W, /obj/item/weapon/melee/energy)) - user.show_message("You make planks out of \the [src]!", 1) - for(var/i = 0,i < 2,i++) - var/obj/item/stack/sheet/mineral/wood/NG = new (user.loc) - for (var/obj/item/stack/sheet/mineral/wood/G in user.loc) - if(G == NG) - continue - if(G.amount >= G.max_amount) - continue - G.amount += round(potency / 25) - G.attackby(NG, user) - usr << "You add the newly-formed wood to the stack. It now contains [NG.amount] planks." + user.show_message("You make [plank_name] out of \the [src]!", 1) + var/obj/item/stack/plank = new plank_type(user.loc, 1 + round(potency / 25)) + var/old_plank_amount = plank.amount + for(var/obj/item/stack/ST in user.loc) + if(ST != plank && istype(ST, plank_type) && ST.amount < ST.max_amount) + ST.attackby(plank, user) //we try to transfer all old unfinished stacks to the new stack we created. + if(plank.amount > old_plank_amount) + user << "You add the newly-formed [plank_name] to the stack. It now contains [plank.amount] [plank_name]." qdel(src) - return + if(is_type_in_list(W,accepted)) var/obj/item/weapon/reagent_containers/food/snacks/grown/leaf = W if(leaf.dry) @@ -93,11 +91,19 @@ else usr << " You must dry this first." +/obj/item/weapon/grown/log/steel + seed = /obj/item/seeds/steelmycelium + name = "steel-cap log" + desc = "It's made of metal." + icon_state = "steellogs" + accepted = list() + plank_type = /obj/item/stack/rods + plank_name = "rods" + /obj/item/weapon/grown/sunflower // FLOWER POWER! seed = /obj/item/seeds/sunflowerseed name = "sunflower" desc = "It's beautiful! A certain person might beat you to death if you trample these." - icon = 'icons/obj/hydroponics/harvest.dmi' icon_state = "sunflower" damtype = "fire" force = 0 @@ -116,7 +122,6 @@ seed = /obj/item/seeds/novaflowerseed name = "novaflower" desc = "These beautiful flowers have a crisp smokey scent, like a summer bonfire." - icon = 'icons/obj/hydroponics/harvest.dmi' icon_state = "novaflower" damtype = "fire" force = 0 @@ -288,7 +293,6 @@ /obj/item/weapon/grown/corncob name = "corn cob" desc = "A reminder of meals gone by." - icon = 'icons/obj/hydroponics/harvest.dmi' icon_state = "corncob" item_state = "corncob" w_class = 1.0 @@ -308,7 +312,6 @@ /obj/item/weapon/grown/snapcorn name = "snap corn" desc = "A cob with snap pops" - icon = 'icons/obj/hydroponics/harvest.dmi' icon_state = "snapcorn" item_state = "corncob" w_class = 1.0 diff --git a/code/modules/hydroponics/seeds.dm b/code/modules/hydroponics/seeds.dm index 287a8e398e2..1d818bc3253 100644 --- a/code/modules/hydroponics/seeds.dm +++ b/code/modules/hydroponics/seeds.dm @@ -719,11 +719,11 @@ /obj/item/seeds/steelmycelium name = "pack of steel-cap mycelium" - desc = "This mycelium grows into metal rods." + desc = "This mycelium grows into steel logs." icon_state = "mycelium-steelcap" species = "steelcap" plantname = "Steel Caps" - product = /obj/item/stack/rods + product = /obj/item/weapon/grown/log/steel lifespan = 80 endurance = 50 maturation = 15 diff --git a/code/modules/mining/ores_coins.dm b/code/modules/mining/ores_coins.dm index 73374998632..50633e0c792 100644 --- a/code/modules/mining/ores_coins.dm +++ b/code/modules/mining/ores_coins.dm @@ -38,17 +38,22 @@ points = 1 refined_type = /obj/item/stack/sheet/glass -/obj/item/weapon/ore/glass/attack_self(mob/living/user as mob) //It's magic I ain't gonna explain how instant conversion with no tool works. -- Urist +/obj/item/weapon/ore/glass/attack_self(mob/living/user as mob) user << "You use the sand to make sandstone." - for(var/i = 0,i < 1,i++) - var/obj/item/stack/sheet/mineral/sandstone/S = new (user.loc) - for (var/obj/item/weapon/ore/glass/G in user.loc) - if(S.amount < S.max_amount) - S.amount++ - qdel(G) - else - i-- - break + var/sandAmt = 1 + for(var/obj/item/weapon/ore/glass/G in user.loc) // The sand on the floor + sandAmt += 1 + qdel(G) + while(sandAmt > 0) + var/obj/item/stack/sheet/mineral/sandstone/SS = new /obj/item/stack/sheet/mineral/sandstone(user.loc) + if(sandAmt >= SS.max_amount) + SS.amount = SS.max_amount + else + SS.amount = sandAmt + for(var/obj/item/stack/sheet/mineral/sandstone/SA in user.loc) + if(SA != SS && SA.amount < SA.max_amount) + SA.attackby(SS, user) //we try to transfer all old unfinished stacks to the new stack we created. + sandAmt -= SS.max_amount qdel(src) return diff --git a/code/modules/mob/living/carbon/alien/alien.dm b/code/modules/mob/living/carbon/alien/alien.dm index cba4f274cf5..013051ca169 100644 --- a/code/modules/mob/living/carbon/alien/alien.dm +++ b/code/modules/mob/living/carbon/alien/alien.dm @@ -50,7 +50,7 @@ /mob/living/carbon/alien/proc/getPlasma() return storedPlasma -/mob/living/carbon/alien/eyecheck() +/mob/living/carbon/alien/check_eye_prot() return 2 /mob/living/carbon/alien/getToxLoss() diff --git a/code/modules/mob/living/carbon/carbon.dm b/code/modules/mob/living/carbon/carbon.dm index a9b1f519542..e61dcca180d 100644 --- a/code/modules/mob/living/carbon/carbon.dm +++ b/code/modules/mob/living/carbon/carbon.dm @@ -155,8 +155,97 @@ playsound(loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1) -/mob/living/carbon/proc/eyecheck() - return 0 + + + + +/mob/living/carbon/flash_eyes(intensity = 1, override_blindness_check = 0) + var/damage = intensity - check_eye_prot() + if(..()) // we've been flashed + switch(damage) + if(1) + src << "Your eyes sting a little." + if(prob(40)) + eye_stat += 1 + + if(2) + src << "Your eyes burn." + eye_stat += rand(2, 4) + + else + src << "Your eyes itch and burn severely!" + eye_stat += rand(12, 16) + + if(eye_stat > 10) + eye_blind += damage + eye_blurry += damage * rand(3, 6) + + if(eye_stat > 20) + if (prob(eye_stat - 20)) + src << "Your eyes start to burn badly!" + disabilities |= NEARSIGHT + else if(prob(eye_stat - 25)) + src << "You can't see anything!" + disabilities |= BLIND + else + src << "Your eyes are really starting to hurt. This can't be good for you!" + return 1 + + else if(damage == 0) // just enough protection + if(prob(20)) + src << "Something bright flashes in the corner of your vision!" + + + + + +/* + + + var/eye_prot = C.check_eye_prot() + if(C.eye_blind || eye_prot >= 2) + eye_prot = 4 + var/severity = 3 - eye_prot + if(prob(33)) + severity += 1 + else if(prob(50)) + severity -= 1 + severity = min(max(severity, 0), 4) + + switch(severity) + if(0) + //no effect + C << "A small, bright dot appears in your vision." + if(1) + //industrial grade eye protection + C.eye_stat += rand(0, 2) + C << "Something bright flashes in the corner of your vision!" + if(2) + //basic eye protection (sunglasses) + flick("flash", C.flash) + C.eye_stat += rand(1, 6) + C << "Your eyes were blinded!" + if(3) + //no eye protection + if(prob(2)) + C.Weaken(1) + flick("e_flash", C.flash) + C.eye_stat += rand(3, 7) + C << "Your eyes were blinded!" + if(4) + //the effect has been worsened by something + if(prob(5)) + C.Weaken(1) + flick("e_flash", C.flash) + C.eye_stat += rand(5, 10) + C << "Your eyes were blinded!" + + + + +*/ + + /mob/living/carbon/proc/tintcheck() return 0 diff --git a/code/modules/mob/living/carbon/human/human_helpers.dm b/code/modules/mob/living/carbon/human/human_helpers.dm index ccdc5aa956c..f622ed76642 100644 --- a/code/modules/mob/living/carbon/human/human_helpers.dm +++ b/code/modules/mob/living/carbon/human/human_helpers.dm @@ -75,9 +75,9 @@ if(wear_id) return wear_id.GetID() -///eyecheck() +///checkeyeprot() ///Returns a number between -1 to 2 -/mob/living/carbon/human/eyecheck() +/mob/living/carbon/human/check_eye_prot() var/number = 0 if(istype(src.head, /obj/item/clothing/head)) //are they wearing something on their head var/obj/item/clothing/head/HFP = src.head //if yes gets the flash protection value from that item @@ -90,6 +90,10 @@ number += MFP.flash_protect return number +/mob/living/carbon/human/check_ear_prot() + if((ears && (ears.flags & EARBANGPROTECT)) || (head && (head.flags & HEADBANGPROTECT))) + return 1 + ///tintcheck() ///Checks eye covering items for visually impairing tinting, such as welding masks ///Checked in life.dm. 0 & 1 = no impairment, 2 = welding mask overlay, 3 = You can see jack, but you can't see shit. diff --git a/code/modules/mob/living/carbon/life.dm b/code/modules/mob/living/carbon/life.dm index b4181b590a0..0a57a05ea7e 100644 --- a/code/modules/mob/living/carbon/life.dm +++ b/code/modules/mob/living/carbon/life.dm @@ -446,12 +446,11 @@ /mob/living/carbon/proc/handle_disabilities() //Eyes - if(disabilities & BLIND || stat) //blindness from disability or unconsciousness doesn't get better on its own - eye_blind = max(eye_blind, 1) - else if(eye_blind) //blindness, heals slowly over time - eye_blind = max(eye_blind-1,0) - else if(eye_blurry) //blurry eyes heal slowly - eye_blurry = max(eye_blurry-1, 0) + if(!(disabilities & BLIND) && !stat) //blindness from disability or unconsciousness doesn't get better on its own + if(eye_blind) //blindness, heals slowly over time + eye_blind = max(eye_blind-1,0) + else if(eye_blurry) //blurry eyes heal slowly + eye_blurry = max(eye_blurry-1, 0) //Ears if(disabilities & DEAF) //disabled-deaf, doesn't get better on its own diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index 3772bd681fa..abfa8d63be5 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -782,6 +782,20 @@ Sorry Giacom. Please don't be mad :( animate(src, pixel_y = initial(pixel_y), time = 10) floating = 0 +/mob/living/proc/flash_eyes(intensity = 1, override_blindness_check = 0) + if(check_eye_prot() < intensity && (override_blindness_check || !(disabilities & BLIND))) + flick("e_flash", flash) + return 1 + + +//this returns the mob's protection again eye damage (number between -1 and 2) +/mob/living/proc/check_eye_prot() + return 0 + +//this returns the mob's protection again ear damage (0 or 1) +/mob/living/proc/check_ear_prot() + return 0 + // The src mob is trying to strip an item from someone // Override if a certain type of mob should be behave differently when stripping items (can't, for example) /mob/living/stripPanelUnequip(obj/item/what, mob/who, where) diff --git a/code/modules/reagents/Chemistry-Goon-Medicine.dm b/code/modules/reagents/Chemistry-Goon-Medicine.dm index ab16118b87f..9b8de1d248e 100644 --- a/code/modules/reagents/Chemistry-Goon-Medicine.dm +++ b/code/modules/reagents/Chemistry-Goon-Medicine.dm @@ -698,8 +698,7 @@ proc/chemical_mob_spawn(var/datum/reagents/holder, var/amount_to_spawn, var/reac playsound(get_turf(holder.my_atom), 'sound/effects/phasein.ogg', 100, 1) for(var/mob/living/carbon/human/H in viewers(get_turf(holder.my_atom), null)) - if(H:eyecheck() <= 0) - flick("e_flash", H.flash) + H.flash_eyes() for(var/i = 1, i <= amount_to_spawn, i++) var/chosen = pick(critters) var/mob/living/simple_animal/hostile/C = new chosen diff --git a/code/modules/reagents/Chemistry-Recipes.dm b/code/modules/reagents/Chemistry-Recipes.dm index 59764ed8e08..a2c5ae0eef6 100644 --- a/code/modules/reagents/Chemistry-Recipes.dm +++ b/code/modules/reagents/Chemistry-Recipes.dm @@ -198,7 +198,7 @@ silicate s.set_up(2, 1, location) s.start() for(var/mob/living/carbon/C in get_hearers_in_view(5, location)) - if(C.eyecheck()) + if(C.check_eye_prot()) continue flick("e_flash", C.flash) if(get_dist(C, location) < 4) @@ -640,7 +640,7 @@ datum/chemical_reaction/pestkiller playsound(get_turf(holder.my_atom), 'sound/effects/phasein.ogg', 100, 1) for(var/mob/living/carbon/human/M in viewers(get_turf(holder.my_atom), null)) - if(M:eyecheck() <= 0) + if(M:check_eye_prot() <= 0) flick("e_flash", M.flash) for(var/i = 1, i <= 4 + rand(1,2), i++) @@ -671,8 +671,7 @@ datum/chemical_reaction/pestkiller playsound(get_turf(holder.my_atom), 'sound/effects/phasein.ogg', 100, 1) for(var/mob/living/carbon/human/M in viewers(get_turf(holder.my_atom), null)) - if(M:eyecheck() <= 0) - flick("e_flash", M.flash) + M.flash_eyes() for(var/i = 1, i <= 4 + rand(1,2), i++) var/chosen = pick(borks) diff --git a/icons/obj/hydroponics/harvest.dmi b/icons/obj/hydroponics/harvest.dmi index f841e0894918c14eddb02611009a1657ff15cf45..a6973c6bf1ef78c097e79debafbc5c41d9a4febe 100644 GIT binary patch delta 8239 zcmV+~Akg30$pX8~0+1vkqk2?WbVOxyV{&P5bZKvH004NLm6y+M+b|5q&&g95?KP1` z9)B9K@FfO*rvC6F`Q>`JfBfE?6k3u#OA|$HN=TboKQcMoDE*^3h&41ito{%HYy zCg`4mVa=Qu8V6A7Z(*LOqCWNz1iHpe}CRr zV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RTrL~3Jwjpt00Fy6L_t(ZIZ3cB&8%71 z535W|fP)CoX!q+-Rbs$V-I1Rmyx0J|0v82TFc@+4kG3#e{D@X-ZwjyfU~1^DRGvKm6ed zf8lW25t;*sL&0Wq;PqBAefs$a#ql00mH-D3VBhEu=oR_Zmz4q>vQgha6gTN#x&n`$ z3J-*l_JVoxv#`h~hr0m#4TCYFzk%deUsg(eb-=U^kAs=4(3Q$EbEG#SzX|h*>bar3y@%|w^q{YI*!XlS!1Q_Gc9?xfCVPVmiYy@b@ o&%(mua3d=~OMVs>7Ka=E2jqk7luGJp(f|Me07*qoM6N<$f|G-&;{X5v From 60e152c54ea155c3eb678222e83f755e95e037f5 Mon Sep 17 00:00:00 2001 From: phil235 Date: Tue, 10 Mar 2015 20:43:21 +0100 Subject: [PATCH 3/4] slight adjustments.. --- code/modules/mob/living/carbon/carbon.dm | 59 ---------------------- code/modules/mob/living/living.dm | 6 +-- code/modules/reagents/Chemistry-Recipes.dm | 3 +- 3 files changed, 4 insertions(+), 64 deletions(-) diff --git a/code/modules/mob/living/carbon/carbon.dm b/code/modules/mob/living/carbon/carbon.dm index e61dcca180d..a8918fd3051 100644 --- a/code/modules/mob/living/carbon/carbon.dm +++ b/code/modules/mob/living/carbon/carbon.dm @@ -133,8 +133,6 @@ else mode() // Activate held item - - /mob/living/carbon/proc/help_shake_act(mob/living/carbon/M) if(health >= 0) @@ -154,11 +152,6 @@ playsound(loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1) - - - - - /mob/living/carbon/flash_eyes(intensity = 1, override_blindness_check = 0) var/damage = intensity - check_eye_prot() if(..()) // we've been flashed @@ -195,58 +188,6 @@ if(prob(20)) src << "Something bright flashes in the corner of your vision!" - - - - -/* - - - var/eye_prot = C.check_eye_prot() - if(C.eye_blind || eye_prot >= 2) - eye_prot = 4 - var/severity = 3 - eye_prot - if(prob(33)) - severity += 1 - else if(prob(50)) - severity -= 1 - severity = min(max(severity, 0), 4) - - switch(severity) - if(0) - //no effect - C << "A small, bright dot appears in your vision." - if(1) - //industrial grade eye protection - C.eye_stat += rand(0, 2) - C << "Something bright flashes in the corner of your vision!" - if(2) - //basic eye protection (sunglasses) - flick("flash", C.flash) - C.eye_stat += rand(1, 6) - C << "Your eyes were blinded!" - if(3) - //no eye protection - if(prob(2)) - C.Weaken(1) - flick("e_flash", C.flash) - C.eye_stat += rand(3, 7) - C << "Your eyes were blinded!" - if(4) - //the effect has been worsened by something - if(prob(5)) - C.Weaken(1) - flick("e_flash", C.flash) - C.eye_stat += rand(5, 10) - C << "Your eyes were blinded!" - - - - -*/ - - - /mob/living/carbon/proc/tintcheck() return 0 diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index abfa8d63be5..782b47d5847 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -782,17 +782,17 @@ Sorry Giacom. Please don't be mad :( animate(src, pixel_y = initial(pixel_y), time = 10) floating = 0 +//called when the mob receives a bright flash /mob/living/proc/flash_eyes(intensity = 1, override_blindness_check = 0) if(check_eye_prot() < intensity && (override_blindness_check || !(disabilities & BLIND))) flick("e_flash", flash) return 1 - -//this returns the mob's protection again eye damage (number between -1 and 2) +//this returns the mob's protection against eye damage (number between -1 and 2) /mob/living/proc/check_eye_prot() return 0 -//this returns the mob's protection again ear damage (0 or 1) +//this returns the mob's protection against ear damage (0 or 1) /mob/living/proc/check_ear_prot() return 0 diff --git a/code/modules/reagents/Chemistry-Recipes.dm b/code/modules/reagents/Chemistry-Recipes.dm index a2c5ae0eef6..6dc2ff7dc7d 100644 --- a/code/modules/reagents/Chemistry-Recipes.dm +++ b/code/modules/reagents/Chemistry-Recipes.dm @@ -640,8 +640,7 @@ datum/chemical_reaction/pestkiller playsound(get_turf(holder.my_atom), 'sound/effects/phasein.ogg', 100, 1) for(var/mob/living/carbon/human/M in viewers(get_turf(holder.my_atom), null)) - if(M:check_eye_prot() <= 0) - flick("e_flash", M.flash) + M.flash_eyes() for(var/i = 1, i <= 4 + rand(1,2), i++) var/chosen = pick(borks) From c04468576f3dd808f3176a9b235bfbf2bbcaf34e Mon Sep 17 00:00:00 2001 From: phil235 Date: Thu, 12 Mar 2015 19:54:36 +0100 Subject: [PATCH 4/4] Fixes chemsprayer duplicating reagents. Simplifying its code. Chem puff spray can no longer give more chems to mobs than it contains. Mobs being in front of the chem puff shorten its total range. Fixes using the spray at short range not showing the whole chemical puff animation. For a given max range of a spray, aiming closer will now transfer more chemicals to each mobs/objs/turfs than aiming the furthest. --- code/game/machinery/bots/medbot.dm | 2 +- .../reagents/reagent_containers/spray.dm | 63 ++++++++----------- 2 files changed, 28 insertions(+), 37 deletions(-) diff --git a/code/game/machinery/bots/medbot.dm b/code/game/machinery/bots/medbot.dm index 2dafe5746f3..4115a3cc462 100644 --- a/code/game/machinery/bots/medbot.dm +++ b/code/game/machinery/bots/medbot.dm @@ -479,7 +479,7 @@ if(reagent_id == "internal_beaker") if(use_beaker && reagent_glass && reagent_glass.reagents.total_volume) reagent_glass.reagents.trans_to(patient,injection_amount) //Inject from beaker instead. - reagent_glass.reagents.reaction(patient, 2) + reagent_glass.reagents.reaction(patient, INGEST) else patient.reagents.add_reagent(reagent_id,injection_amount) C.visible_message("[src] injects [patient] with the syringe!", \ diff --git a/code/modules/reagents/reagent_containers/spray.dm b/code/modules/reagents/reagent_containers/spray.dm index 6eae3e52b29..f1c55d5a383 100644 --- a/code/modules/reagents/reagent_containers/spray.dm +++ b/code/modules/reagents/reagent_containers/spray.dm @@ -62,19 +62,35 @@ /obj/item/weapon/reagent_containers/spray/proc/spray(var/atom/A) + var/range = max(min(spray_currentrange, get_dist(src, A)), 1) var/obj/effect/decal/chempuff/D = new /obj/effect/decal/chempuff(get_turf(src)) D.create_reagents(amount_per_transfer_from_this) - reagents.trans_to(D, amount_per_transfer_from_this, 1/spray_currentrange) + reagents.trans_to(D, amount_per_transfer_from_this, 1/range) D.color = mix_color_from_reagents(D.reagents.reagent_list) + var/puff_reagent_left = range //how many turf, mob or dense objet we can react with before we consider the chem puff consumed + var/wait_step = max(round(9/range),2) spawn(0) - for(var/i=0, i 0) + D.reagents.reaction(get_turf(D)) + puff_reagent_left -= 1 + + if(puff_reagent_left <= 0) // we used all the puff so we delete it. + qdel(D) + return + qdel(D) /obj/item/weapon/reagent_containers/spray/attack_self(var/mob/user) @@ -146,41 +162,16 @@ /obj/item/weapon/reagent_containers/spray/chemsprayer/spray(var/atom/A) - var/Sprays[3] - for(var/i=1, i<=3, i++) // intialize sprays - if(src.reagents.total_volume < 1) break - var/obj/effect/decal/chempuff/D = new/obj/effect/decal/chempuff(get_turf(src)) - D.create_reagents(amount_per_transfer_from_this) - src.reagents.trans_to(D, amount_per_transfer_from_this) - - D.color = mix_color_from_reagents(D.reagents.reagent_list) - - Sprays[i] = D - var/direction = get_dir(src, A) var/turf/T = get_turf(A) var/turf/T1 = get_step(T,turn(direction, 90)) var/turf/T2 = get_step(T,turn(direction, -90)) var/list/the_targets = list(T,T1,T2) - for(var/i=1, i<=Sprays.len, i++) - spawn() - var/obj/effect/decal/chempuff/D = Sprays[i] - if(!D) continue - - // Spreads the sprays a little bit - var/turf/my_target = pick(the_targets) - the_targets -= my_target - - for(var/j=0, j<=spray_currentrange, j++) - step_towards(D, my_target) - D.reagents.reaction(get_turf(D)) - for(var/atom/t in get_turf(D)) - D.reagents.reaction(t) - sleep(2) - qdel(D) - - + for(var/i=1, i<=3, i++) // intialize sprays + if(reagents.total_volume < 1) + return + ..(the_targets[i]) /obj/item/weapon/reagent_containers/spray/chemsprayer/attack_self(var/mob/user)