From 02d6e7a303e8d7203f4228b3acbf11086ab53dc7 Mon Sep 17 00:00:00 2001 From: Chinsky Date: Fri, 5 Jun 2015 12:49:48 +0300 Subject: [PATCH 001/215] Fixes #9605 Now organ DNA is sync'd to newly created character. --- code/modules/mob/living/carbon/human/human.dm | 2 ++ code/modules/mob/living/carbon/human/human_organs.dm | 7 ++++++- code/modules/mob/new_player/new_player.dm | 2 +- code/modules/organs/organ.dm | 6 ++++++ 4 files changed, 15 insertions(+), 2 deletions(-) diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index 10e165fa5fb..9273c3372a0 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -41,7 +41,9 @@ ..() if(dna) + dna.ready_dna(new_character) dna.real_name = real_name + sync_organ_dna() make_blood() /mob/living/carbon/human/Destroy() diff --git a/code/modules/mob/living/carbon/human/human_organs.dm b/code/modules/mob/living/carbon/human/human_organs.dm index f2c64fa52ad..2dec075afa6 100644 --- a/code/modules/mob/living/carbon/human/human_organs.dm +++ b/code/modules/mob/living/carbon/human/human_organs.dm @@ -171,4 +171,9 @@ //New are added for reagents to random organs. for(var/datum/reagent/A in reagents.reagent_list) var/obj/item/organ/O = pick(organs) - O.trace_chemicals[A.name] = 100 \ No newline at end of file + O.trace_chemicals[A.name] = 100 + +/mob/living/carbon/human/proc/sync_organ_dna() + var/list/all_bits = internal_organs|organs + for(var/obj/item/organ/O in all_bits) + O.set_dna(dna) \ No newline at end of file diff --git a/code/modules/mob/new_player/new_player.dm b/code/modules/mob/new_player/new_player.dm index 1e18882137d..8bd0be34bc0 100644 --- a/code/modules/mob/new_player/new_player.dm +++ b/code/modules/mob/new_player/new_player.dm @@ -467,7 +467,7 @@ new_character.name = real_name new_character.dna.ready_dna(new_character) new_character.dna.b_type = client.prefs.b_type - + new_character.sync_organ_dna() if(client.prefs.disabilities) // Set defer to 1 if you add more crap here so it only recalculates struc_enzymes once. - N3X new_character.dna.SetSEState(GLASSESBLOCK,1,0) diff --git a/code/modules/organs/organ.dm b/code/modules/organs/organ.dm index 038a350fb58..7afe7293dd2 100644 --- a/code/modules/organs/organ.dm +++ b/code/modules/organs/organ.dm @@ -57,6 +57,12 @@ var/list/organ_cache = list() if(internal) holder.internal_organs |= src +/obj/item/organ/proc/set_dna(var/datum/dna/new_dna) + if(new_dna) + dna = new_dna.Clone() + blood_DNA.Cut() + blood_DNA[dna.unique_enzymes] = dna.b_type + /obj/item/organ/proc/die() if(status & ORGAN_ROBOT) return From a07d20d65797f22c3a95170ab7e63d411a1c11a2 Mon Sep 17 00:00:00 2001 From: PsiOmegaDelta Date: Fri, 5 Jun 2015 14:58:35 +0200 Subject: [PATCH 002/215] Ports /tg/'s meteor implementation. Merges the two meteor events into one, and now takes severity into consideration instead. Including the basic meteors there are also new types ranging from flaming to radioactive which may drop appropriate types of ore. --- code/game/atoms.dm | 3 - code/game/gamemodes/events/clang.dm | 2 +- code/game/gamemodes/events/dust.dm | 2 +- code/game/gamemodes/meteor/meteor.dm | 6 +- code/game/gamemodes/meteor/meteors.dm | 346 +++++++++++------- code/game/machinery/atmoalter/canister.dm | 5 - code/game/machinery/bots/bots.dm | 4 - code/game/machinery/computer/computer.dm | 10 - code/game/machinery/computer3/computer.dm | 14 +- code/game/machinery/deployable.dm | 9 - code/game/machinery/doors/door.dm | 4 - code/game/machinery/hologram.dm | 4 - code/game/machinery/turrets.dm | 4 - code/game/mecha/mecha.dm | 4 - code/game/objects/effects/aliens.dm | 5 - code/game/objects/items/weapons/weaponry.dm | 4 - code/game/objects/structures.dm | 6 - .../structures/crates_lockers/closets.dm | 7 - .../crates_lockers/closets/statue.dm | 21 +- code/game/objects/structures/displaycase.dm | 7 - code/game/objects/structures/grille.dm | 3 - code/game/objects/structures/inflatable.dm | 3 - code/game/objects/structures/lamarr_cage.dm | 7 - code/game/objects/structures/safe.dm | 5 - code/game/objects/structures/window.dm | 4 - code/game/turfs/simulated/walls.dm | 10 - code/modules/admin/verbs/icarus.dm | 3 +- code/modules/events/event_container.dm | 16 +- code/modules/events/event_dynamic.dm | 1 - code/modules/events/meteors.dm | 59 ++- code/modules/holodeck/HolodeckControl.dm | 10 - .../mob/living/carbon/alien/alien_attacks.dm | 11 - code/modules/mob/living/carbon/human/human.dm | 16 - .../mob/living/carbon/metroid/metroid.dm | 9 - code/modules/mob/living/silicon/ai/ai.dm | 11 - code/modules/mob/living/silicon/pai/pai.dm | 11 - .../modules/mob/living/silicon/robot/robot.dm | 11 - .../power/singularity/containment_field.dm | 3 - code/modules/power/singularity/emitter.dm | 3 - .../power/singularity/field_generator.dm | 3 - .../particle_accelerator.dm | 12 - .../modules/projectiles/projectile/special.dm | 2 +- code/modules/reagents/Chemistry-Machinery.dm | 4 - code/modules/research/circuitprinter.dm | 4 - code/modules/research/destructive_analyzer.dm | 4 - code/modules/research/server.dm | 4 - code/modules/shieldgen/emergency_shield.dm | 14 - code/modules/shieldgen/energy_field.dm | 5 - code/modules/vehicles/vehicle.dm | 4 - icons/obj/meteor.dmi | Bin 11700 -> 4545 bytes 50 files changed, 276 insertions(+), 443 deletions(-) diff --git a/code/game/atoms.dm b/code/game/atoms.dm index d40d10bf93e..628a707af44 100644 --- a/code/game/atoms.dm +++ b/code/game/atoms.dm @@ -67,9 +67,6 @@ return flags & INSERT_CONTAINER */ -/atom/proc/meteorhit(obj/meteor as obj) - return - /atom/proc/allow_drop() return 1 diff --git a/code/game/gamemodes/events/clang.dm b/code/game/gamemodes/events/clang.dm index 74fb9ee5079..d1b82af9409 100644 --- a/code/game/gamemodes/events/clang.dm +++ b/code/game/gamemodes/events/clang.dm @@ -34,7 +34,7 @@ In my current plan for it, 'solid' will be defined as anything with density == 1 else if (istype(clong, /mob)) if(clong.density || prob(10)) - clong.meteorhit(src) + clong.ex_act(1) else qdel(src) diff --git a/code/game/gamemodes/events/dust.dm b/code/game/gamemodes/events/dust.dm index 13cdb511e81..492b932e462 100644 --- a/code/game/gamemodes/events/dust.dm +++ b/code/game/gamemodes/events/dust.dm @@ -102,7 +102,7 @@ The "dust" will damage the hull of the station causin minor hull breaches. playsound(src.loc, 'sound/effects/meteorimpact.ogg', 40, 1) if(ismob(A)) - A.meteorhit(src)//This should work for now I guess + A.ex_act(strength)//This should work for now I guess else if(!istype(A,/obj/machinery/power/emitter) && !istype(A,/obj/machinery/field_generator)) //Protect the singularity from getting released every round! A.ex_act(strength) //Changing emitter/field gen ex_act would make it immune to bombs and C4 diff --git a/code/game/gamemodes/meteor/meteor.dm b/code/game/gamemodes/meteor/meteor.dm index 335360d40d0..593f4a3d22d 100644 --- a/code/game/gamemodes/meteor/meteor.dm +++ b/code/game/gamemodes/meteor/meteor.dm @@ -9,14 +9,16 @@ votable = 0 uplink_welcome = "EVIL METEOR Uplink Console:" deny_respawn = 1 + var/next_wave = METEOR_DELAY /datum/game_mode/meteor/post_setup() defer_powernet_rebuild = 2//Might help with the lag ..() /datum/game_mode/meteor/process() - if(world.time >= METEOR_DELAY) - spawn() spawn_meteors(6) + if(world.time >= next_wave) + next_wave = world.time + meteor_wave_delay + spawn() spawn_meteors(6, meteors_normal) /datum/game_mode/meteor/declare_completion() var/text diff --git a/code/game/gamemodes/meteor/meteors.dm b/code/game/gamemodes/meteor/meteors.dm index 06d9b291a2d..96367b4a115 100644 --- a/code/game/gamemodes/meteor/meteors.dm +++ b/code/game/gamemodes/meteor/meteors.dm @@ -1,167 +1,259 @@ /var/const/meteor_wave_delay = 625 //minimum wait between waves in tenths of seconds //set to at least 100 unless you want evarr ruining every round -/var/const/meteors_in_wave = 50 -/var/const/meteors_in_small_wave = 10 +//Meteors probability of spawning during a given wave +/var/list/meteors_normal = list(/obj/effect/meteor/dust=3, /obj/effect/meteor/medium=8, /obj/effect/meteor/big=3, \ + /obj/effect/meteor/flaming=1, /obj/effect/meteor/irradiated=3) //for normal meteor event -/proc/meteor_wave(var/number = meteors_in_wave) - if(!ticker || wavesecret) - return +/var/list/meteors_threatening = list(/obj/effect/meteor/medium=4, /obj/effect/meteor/big=8, \ + /obj/effect/meteor/flaming=3, /obj/effect/meteor/irradiated=3) //for threatening meteor event - wavesecret = 1 - for(var/i = 0 to number) - spawn(rand(10,100)) - spawn_meteor() - spawn(meteor_wave_delay) - wavesecret = 0 +/var/list/meteors_catastrophic = list(/obj/effect/meteor/medium=5, /obj/effect/meteor/big=75, \ + /obj/effect/meteor/flaming=10, /obj/effect/meteor/irradiated=10, /obj/effect/meteor/tunguska = 1) //for catastrophic meteor event -/proc/spawn_meteors(var/number = meteors_in_small_wave) +/var/list/meteors_dust = list(/obj/effect/meteor/dust) //for space dust event + + +/////////////////////////////// +//Meteor spawning global procs +/////////////////////////////// + +/proc/spawn_meteors(var/number = 10, var/list/meteortypes) for(var/i = 0; i < number; i++) - spawn(0) - spawn_meteor() + spawn_meteor(meteortypes) -/proc/spawn_meteor() - - var/startx - var/starty - var/endx - var/endy +/proc/spawn_meteor(var/list/meteortypes) var/turf/pickedstart var/turf/pickedgoal var/max_i = 10//number of tries to spawn meteor. - - - do - switch(pick(1,2,3,4)) - if(1) //NORTH - starty = world.maxy-(TRANSITIONEDGE+1) - startx = rand((TRANSITIONEDGE+1), world.maxx-(TRANSITIONEDGE+1)) - endy = TRANSITIONEDGE - endx = rand(TRANSITIONEDGE, world.maxx-TRANSITIONEDGE) - if(2) //EAST - starty = rand((TRANSITIONEDGE+1),world.maxy-(TRANSITIONEDGE+1)) - startx = world.maxx-(TRANSITIONEDGE+1) - endy = rand(TRANSITIONEDGE, world.maxy-TRANSITIONEDGE) - endx = TRANSITIONEDGE - if(3) //SOUTH - starty = (TRANSITIONEDGE+1) - startx = rand((TRANSITIONEDGE+1), world.maxx-(TRANSITIONEDGE+1)) - endy = world.maxy-TRANSITIONEDGE - endx = rand(TRANSITIONEDGE, world.maxx-TRANSITIONEDGE) - if(4) //WEST - starty = rand((TRANSITIONEDGE+1), world.maxy-(TRANSITIONEDGE+1)) - startx = (TRANSITIONEDGE+1) - endy = rand(TRANSITIONEDGE,world.maxy-TRANSITIONEDGE) - endx = world.maxx-TRANSITIONEDGE - - pickedstart = locate(startx, starty, 1) - pickedgoal = locate(endx, endy, 1) + while (!istype(pickedstart, /turf/space)) + var/startSide = pick(cardinal) + pickedstart = spaceDebrisStartLoc(startSide, 1) + pickedgoal = spaceDebrisFinishLoc(startSide, 1) max_i-- - if(max_i<=0) return - - while (!istype(pickedstart, /turf/space)) //FUUUCK, should never happen. - - - var/obj/effect/meteor/M - switch(rand(1, 100)) - - if(1 to 10) - M = new /obj/effect/meteor/big( pickedstart ) - if(11 to 75) - M = new /obj/effect/meteor( pickedstart ) - if(76 to 100) - M = new /obj/effect/meteor/small( pickedstart ) - + if(max_i<=0) + return + var/Me = pickweight(meteortypes) + var/obj/effect/meteor/M = new Me(pickedstart) M.dest = pickedgoal + M.z_original = 1 spawn(0) walk_towards(M, M.dest, 1) - return +/proc/spaceDebrisStartLoc(startSide, Z) + var/starty + var/startx + switch(startSide) + if(1) //NORTH + starty = world.maxy-(TRANSITIONEDGE+1) + startx = rand((TRANSITIONEDGE+1), world.maxx-(TRANSITIONEDGE+1)) + if(2) //EAST + starty = rand((TRANSITIONEDGE+1),world.maxy-(TRANSITIONEDGE+1)) + startx = world.maxx-(TRANSITIONEDGE+1) + if(3) //SOUTH + starty = (TRANSITIONEDGE+1) + startx = rand((TRANSITIONEDGE+1), world.maxx-(TRANSITIONEDGE+1)) + if(4) //WEST + starty = rand((TRANSITIONEDGE+1), world.maxy-(TRANSITIONEDGE+1)) + startx = (TRANSITIONEDGE+1) + var/turf/T = locate(startx, starty, Z) + return T + +/proc/spaceDebrisFinishLoc(startSide, Z) + var/endy + var/endx + switch(startSide) + if(1) //NORTH + endy = TRANSITIONEDGE + endx = rand(TRANSITIONEDGE, world.maxx-TRANSITIONEDGE) + if(2) //EAST + endy = rand(TRANSITIONEDGE, world.maxy-TRANSITIONEDGE) + endx = TRANSITIONEDGE + if(3) //SOUTH + endy = world.maxy-TRANSITIONEDGE + endx = rand(TRANSITIONEDGE, world.maxx-TRANSITIONEDGE) + if(4) //WEST + endy = rand(TRANSITIONEDGE,world.maxy-TRANSITIONEDGE) + endx = world.maxx-TRANSITIONEDGE + var/turf/T = locate(endx, endy, Z) + return T + +/////////////////////// +//The meteor effect +////////////////////// + /obj/effect/meteor - name = "meteor" + name = "the concept of meteor" + desc = "You should probably run instead of gawking at this." icon = 'icons/obj/meteor.dmi' - icon_state = "flaming" + icon_state = "small" density = 1 - anchored = 1.0 - var/hits = 1 - var/detonation_chance = 15 - var/power = 4 - var/power_step = 1 + anchored = 1 + var/hits = 4 + var/hitpwr = 2 //Level of ex_act to be called on hit. var/dest pass_flags = PASSTABLE + var/heavy = 0 + var/meteorsound = 'sound/effects/meteorimpact.ogg' + var/z_original = 1 -/obj/effect/meteor/small - name = "small meteor" - icon_state = "smallf" - pass_flags = PASSTABLE | PASSGRILLE - power = 2 + var/meteordrop = /obj/item/weapon/ore/iron + var/dropamt = 2 + +/obj/effect/meteor/Move() + if(z != z_original || loc == dest) + qdel(src) + return + + . = ..() //process movement... + + if(.)//.. if did move, ram the turf we get in + var/turf/T = get_turf(loc) + ram_turf(T) + + if(prob(10) && !istype(T, /turf/space))//randomly takes a 'hit' from ramming + get_hit() + + return . /obj/effect/meteor/Destroy() walk(src,0) //this cancels the walk_towards() proc ..() +/obj/effect/meteor/New() + ..() + //SpinAnimation() + /obj/effect/meteor/Bump(atom/A) - spawn(0) + if(A) + ram_turf(get_turf(A)) + playsound(src.loc, meteorsound, 40, 1) + get_hit() - if (A) - A.meteorhit(src) - playsound(src.loc, 'sound/effects/meteorimpact.ogg', 40, 1) - if (--src.hits <= 0) +/obj/effect/meteor/proc/ram_turf(var/turf/T) + //first bust whatever is in the turf + for(var/atom/A in T) + if(A != src) + A.ex_act(hitpwr) - //Prevent meteors from blowing up the singularity's containment. - //Changing emitter and generator ex_act would result in them being bomb and C4 proof. - if(!istype(A,/obj/machinery/power/emitter) && \ - !istype(A,/obj/machinery/field_generator) && \ - prob(detonation_chance)) - explosion(loc, power, power + power_step, power + power_step * 2, power + power_step * 3, 0) - qdel(src) - return + //then, ram the turf if it still exists + if(T) + T.ex_act(hitpwr) -/obj/effect/meteor/ex_act(severity) - - if (severity < 4) +//process getting 'hit' by colliding with a dense object +//or randomly when ramming turfs +/obj/effect/meteor/proc/get_hit() + hits-- + if(hits <= 0) + make_debris() + meteor_effect(heavy) qdel(src) + +/obj/effect/meteor/ex_act() return -/obj/effect/meteor/big - name = "big meteor" - hits = 5 - power = 1 - - ex_act(severity) - return - - Bump(atom/A) - spawn(0) - //Prevent meteors from blowing up the singularity's containment. - //Changing emitter and generator ex_act would result in them being bomb and C4 proof - if(!istype(A,/obj/machinery/power/emitter) && \ - !istype(A,/obj/machinery/field_generator)) - if(--src.hits <= 0) - qdel(src) //Dont blow up singularity containment if we get stuck there. - - if (A) - for(var/mob/M in player_list) - var/turf/T = get_turf(M) - if(!T || T.z != src.z) - continue - shake_camera(M, 3, get_dist(M.loc, src.loc) > 20 ? 1 : 3) - playsound(src.loc, 'sound/effects/meteorimpact.ogg', 40, 1) - explosion(src.loc, 0, 1, 2, 3, 0) - - if (--src.hits <= 0) - if(prob(detonation_chance) && !istype(A, /obj/structure/grille)) - explosion(loc, power, power + power_step, power + power_step * 2, power + power_step * 3, 0) - qdel(src) - return - -/obj/effect/meteor/attackby(obj/item/weapon/W as obj, mob/user as mob) +/obj/effect/meteor/attackby(obj/item/weapon/W as obj, mob/user as mob, params) if(istype(W, /obj/item/weapon/pickaxe)) qdel(src) return - ..() + ..() -/obj/effect/meteor/touch_map_edge() - qdel(src) +/obj/effect/meteor/proc/make_debris() + for(var/throws = dropamt, throws > 0, throws--) + var/obj/item/O = new meteordrop(get_turf(src)) + O.throw_at(dest, 5, 10) + +/obj/effect/meteor/proc/meteor_effect(var/sound=1) + if(sound) + for(var/mob/M in player_list) + var/turf/T = get_turf(M) + if(!T || T.z != src.z) + continue + var/dist = get_dist(M.loc, src.loc) + shake_camera(M, dist > 20 ? 3 : 5, dist > 20 ? 1 : 3) + M.playsound_local(src.loc, meteorsound, 50, 1, get_rand_frequency(), 10) + +/////////////////////// +//Meteor types +/////////////////////// + +//Dust +/obj/effect/meteor/dust + name = "space dust" + icon_state = "dust" + pass_flags = PASSTABLE | PASSGRILLE + hits = 1 + hitpwr = 3 + meteorsound = 'sound/weapons/throwtap.ogg' + meteordrop = /obj/item/weapon/ore/glass + +//Medium-sized +/obj/effect/meteor/medium + name = "meteor" + dropamt = 3 + +/obj/effect/meteor/medium/meteor_effect() + ..(heavy) + explosion(src.loc, 0, 1, 2, 3, 0) + +//Large-sized +/obj/effect/meteor/big + name = "big meteor" + icon_state = "large" + hits = 6 + heavy = 1 + dropamt = 4 + +/obj/effect/meteor/big/meteor_effect() + ..(heavy) + explosion(src.loc, 1, 2, 3, 4, 0) + +//Flaming meteor +/obj/effect/meteor/flaming + name = "flaming meteor" + icon_state = "flaming" + hits = 5 + heavy = 1 + meteorsound = 'sound/effects/bamf.ogg' + meteordrop = /obj/item/weapon/ore/phoron + +/obj/effect/meteor/flaming/meteor_effect() + ..(heavy) + explosion(src.loc, 1, 2, 3, 4, 0, 0, 5) + +//Radiation meteor +/obj/effect/meteor/irradiated + name = "glowing meteor" + icon_state = "glowing" + heavy = 1 + meteordrop = /obj/item/weapon/ore/uranium + + +/obj/effect/meteor/irradiated/meteor_effect() + ..(heavy) + explosion(src.loc, 0, 0, 4, 3, 0) + new /obj/effect/decal/cleanable/greenglow(get_turf(src)) + for(var/mob/living/L in view(5, src)) + L.apply_effect(40, IRRADIATE) + +//Station buster Tunguska +/obj/effect/meteor/tunguska + name = "tunguska meteor" + icon_state = "flaming" + desc = "Your life briefly passes before your eyes the moment you lay them on this monstruosity" + hits = 30 + hitpwr = 1 + heavy = 1 + meteorsound = 'sound/effects/bamf.ogg' + meteordrop = /obj/item/weapon/ore/phoron + +/obj/effect/meteor/tunguska/meteor_effect() + ..(heavy) + explosion(src.loc, 5, 10, 15, 20, 0) + +/obj/effect/meteor/tunguska/Bump() + ..() + if(prob(20)) + explosion(src.loc,2,4,6,8) diff --git a/code/game/machinery/atmoalter/canister.dm b/code/game/machinery/atmoalter/canister.dm index c84d030cc46..21550121cdf 100644 --- a/code/game/machinery/atmoalter/canister.dm +++ b/code/game/machinery/atmoalter/canister.dm @@ -240,11 +240,6 @@ update_flag healthcheck() ..() -/obj/machinery/portable_atmospherics/canister/meteorhit(var/obj/O as obj) - src.health = 0 - healthcheck() - return - /obj/machinery/portable_atmospherics/canister/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob) if(!istype(W, /obj/item/weapon/wrench) && !istype(W, /obj/item/weapon/tank) && !istype(W, /obj/item/device/analyzer) && !istype(W, /obj/item/device/pda)) visible_message("\The [user] hits \the [src] with \a [W]!") diff --git a/code/game/machinery/bots/bots.dm b/code/game/machinery/bots/bots.dm index ad9a964ca9d..803615adaf8 100644 --- a/code/game/machinery/bots/bots.dm +++ b/code/game/machinery/bots/bots.dm @@ -86,10 +86,6 @@ ..() healthcheck() -/obj/machinery/bot/meteorhit() - src.explode() - return - /obj/machinery/bot/blob_act() src.health -= rand(20,40)*fire_dam_coeff healthcheck() diff --git a/code/game/machinery/computer/computer.dm b/code/game/machinery/computer/computer.dm index b32f9e9daa0..74edf74ea9b 100644 --- a/code/game/machinery/computer/computer.dm +++ b/code/game/machinery/computer/computer.dm @@ -20,16 +20,6 @@ return 0 return 1 -/obj/machinery/computer/meteorhit(var/obj/O as obj) - for(var/x in verbs) - verbs -= x - set_broken() - var/datum/effect/effect/system/smoke_spread/smoke = PoolOrNew(/datum/effect/effect/system/smoke_spread) - smoke.set_up(5, 0, src) - smoke.start() - return - - /obj/machinery/computer/emp_act(severity) if(prob(20/severity)) set_broken() ..() diff --git a/code/game/machinery/computer3/computer.dm b/code/game/machinery/computer3/computer.dm index 902d8ef1a45..6b6a2f84914 100644 --- a/code/game/machinery/computer3/computer.dm +++ b/code/game/machinery/computer3/computer.dm @@ -75,15 +75,15 @@ set name = "Reset Computer" set category = "Object" set src in view(1) - + if(usr.stat || usr.restrained() || usr.lying || !istype(usr, /mob/living)) usr << "You can't do that." return - + if(!Adjacent(usr)) usr << "You can't reach it." return - + Reset() New(var/L, var/built = 0) @@ -199,14 +199,6 @@ // todo does this do enough - - meteorhit(var/obj/O as obj) - for(var/x in verbs) - verbs -= x - set_broken() - return - - emp_act(severity) if(prob(20/severity)) set_broken() ..() diff --git a/code/game/machinery/deployable.dm b/code/game/machinery/deployable.dm index e3c8607b88d..73501f283d7 100644 --- a/code/game/machinery/deployable.dm +++ b/code/game/machinery/deployable.dm @@ -127,11 +127,6 @@ for reference: dismantle() return -/obj/structure/barricade/meteorhit() - visible_message("\The [src] is smashed apart!") - dismantle() - return - /obj/structure/barricade/blob_act() src.health -= 25 if (src.health <= 0) @@ -252,10 +247,6 @@ for reference: anchored = !anchored icon_state = "barrier[src.locked]" - meteorhit() - src.explode() - return - blob_act() src.health -= 25 if (src.health <= 0) diff --git a/code/game/machinery/doors/door.dm b/code/game/machinery/doors/door.dm index 69dc6987957..9f5a831b165 100644 --- a/code/game/machinery/doors/door.dm +++ b/code/game/machinery/doors/door.dm @@ -146,10 +146,6 @@ else do_animate("deny") return -/obj/machinery/door/meteorhit(obj/M as obj) - src.open() - return - /obj/machinery/door/bullet_act(var/obj/item/projectile/Proj) ..() diff --git a/code/game/machinery/hologram.dm b/code/game/machinery/hologram.dm index 424971cc710..1383bf56e7e 100644 --- a/code/game/machinery/hologram.dm +++ b/code/game/machinery/hologram.dm @@ -200,10 +200,6 @@ For the other part of the code, check silicon say.dm. Particularly robot talk.*/ qdel(src) return -/obj/machinery/hologram/meteorhit() - qdel(src) - return - /obj/machinery/hologram/holopad/Destroy() for (var/mob/living/silicon/ai/master in masters) clear_holo(master) diff --git a/code/game/machinery/turrets.dm b/code/game/machinery/turrets.dm index e04034ad93c..a3ac073a90b 100644 --- a/code/game/machinery/turrets.dm +++ b/code/game/machinery/turrets.dm @@ -399,10 +399,6 @@ qdel(src) return - meteorhit() - qdel(src) - return - attack_hand(mob/user as mob) user.set_machine(src) var/dat = {" diff --git a/code/game/mecha/mecha.dm b/code/game/mecha/mecha.dm index 2d5c2201bd3..32fc2e01232 100644 --- a/code/game/mecha/mecha.dm +++ b/code/game/mecha/mecha.dm @@ -648,10 +648,6 @@ return */ -//TODO -/obj/mecha/meteorhit() - return ex_act(rand(1,3))//should do for now - /obj/mecha/emp_act(severity) if(get_charge()) use_power((cell.charge/2)/severity) diff --git a/code/game/objects/effects/aliens.dm b/code/game/objects/effects/aliens.dm index d9e88e70e06..cd6d1e76d38 100644 --- a/code/game/objects/effects/aliens.dm +++ b/code/game/objects/effects/aliens.dm @@ -82,11 +82,6 @@ healthcheck() return -/obj/effect/alien/resin/meteorhit() - health-=50 - healthcheck() - return - /obj/effect/alien/resin/hitby(AM as mob|obj) ..() for(var/mob/O in viewers(src, null)) diff --git a/code/game/objects/items/weapons/weaponry.dm b/code/game/objects/items/weapons/weaponry.dm index 867c5155e08..e9670ce4d72 100644 --- a/code/game/objects/items/weapons/weaponry.dm +++ b/code/game/objects/items/weapons/weaponry.dm @@ -217,10 +217,6 @@ health = 0 healthcheck() -/obj/effect/energy_net/meteorhit() - health = 0 - healthcheck() - /obj/effect/energy_net/attack_hand(var/mob/user) var/mob/living/carbon/human/H = user diff --git a/code/game/objects/structures.dm b/code/game/objects/structures.dm index 8039814f4fe..1f25043e894 100644 --- a/code/game/objects/structures.dm +++ b/code/game/objects/structures.dm @@ -32,9 +32,6 @@ if(prob(50)) qdel(src) -/obj/structure/meteorhit(obj/O as obj) - qdel(src) - /obj/structure/attack_tk() return @@ -50,9 +47,6 @@ if(3.0) return -/obj/structure/meteorhit(obj/O as obj) - qdel(src) - /obj/structure/New() ..() if(climbable) diff --git a/code/game/objects/structures/crates_lockers/closets.dm b/code/game/objects/structures/crates_lockers/closets.dm index e66d5c488a6..7d2ca17eb96 100644 --- a/code/game/objects/structures/crates_lockers/closets.dm +++ b/code/game/objects/structures/crates_lockers/closets.dm @@ -210,13 +210,6 @@ A.loc = src.loc qdel(src) -/obj/structure/closet/meteorhit(obj/O as obj) - if(O.icon_state == "flaming") - for(var/mob/M in src) - M.meteorhit(O) - src.dump_contents() - qdel(src) - /obj/structure/closet/attackby(obj/item/weapon/W as obj, mob/user as mob) if(src.opened) if(istype(W, /obj/item/weapon/grab)) diff --git a/code/game/objects/structures/crates_lockers/closets/statue.dm b/code/game/objects/structures/crates_lockers/closets/statue.dm index b59cd62dfa3..5458f3da948 100644 --- a/code/game/objects/structures/crates_lockers/closets/statue.dm +++ b/code/game/objects/structures/crates_lockers/closets/statue.dm @@ -80,12 +80,15 @@ /obj/structure/closet/statue/toggle() return -/obj/structure/closet/statue/bullet_act(var/obj/item/projectile/Proj) - health -= Proj.damage +/obj/structure/closet/statue/proc/check_health() if(health <= 0) for(var/mob/M in src) shatter(M) +/obj/structure/closet/statue/bullet_act(var/obj/item/projectile/Proj) + health -= Proj.damage + check_health() + return /obj/structure/closet/statue/attack_generic(var/mob/user, damage, attacktext, environment_smash) @@ -97,19 +100,17 @@ for(var/mob/M in src) shatter(M) -/obj/structure/closet/statue/meteorhit(obj/O as obj) - if(O.icon_state == "flaming") - for(var/mob/M in src) - M.meteorhit(O) - shatter(M) +/obj/structure/closet/statue/ex_act(severity) + for(var/mob/M in src) + M.ex_act(severity) + health -= 60 / severity + check_health() /obj/structure/closet/statue/attackby(obj/item/I as obj, mob/user as mob) health -= I.force user.do_attack_animation(src) visible_message("[user] strikes [src] with [I].") - if(health <= 0) - for(var/mob/M in src) - shatter(M) + check_health() /obj/structure/closet/statue/MouseDrop_T() return diff --git a/code/game/objects/structures/displaycase.dm b/code/game/objects/structures/displaycase.dm index 3c5d5ec8494..bc6217f7746 100644 --- a/code/game/objects/structures/displaycase.dm +++ b/code/game/objects/structures/displaycase.dm @@ -43,13 +43,6 @@ occupied = 0 qdel(src) - -/obj/structure/displaycase/meteorhit(obj/O as obj) - new /obj/item/weapon/material/shard( src.loc ) - new /obj/item/weapon/gun/energy/captain( src.loc ) - qdel(src) - - /obj/structure/displaycase/proc/healthcheck() if (src.health <= 0) if (!( src.destroyed )) diff --git a/code/game/objects/structures/grille.dm b/code/game/objects/structures/grille.dm index fa7a448bd66..cc154918e62 100644 --- a/code/game/objects/structures/grille.dm +++ b/code/game/objects/structures/grille.dm @@ -19,9 +19,6 @@ /obj/structure/grille/blob_act() qdel(src) -/obj/structure/grille/meteorhit(var/obj/M) - qdel(src) - /obj/structure/grille/update_icon() if(destroyed) icon_state = "[initial(icon_state)]-b" diff --git a/code/game/objects/structures/inflatable.dm b/code/game/objects/structures/inflatable.dm index cd8fad5ec5e..f31b098b5b3 100644 --- a/code/game/objects/structures/inflatable.dm +++ b/code/game/objects/structures/inflatable.dm @@ -63,9 +63,6 @@ /obj/structure/inflatable/blob_act() deflate(1) -/obj/structure/inflatable/meteorhit() - deflate(1) - /obj/structure/inflatable/attack_hand(mob/user as mob) add_fingerprint(user) return diff --git a/code/game/objects/structures/lamarr_cage.dm b/code/game/objects/structures/lamarr_cage.dm index 8c3cc5e6f2a..13d6694822d 100644 --- a/code/game/objects/structures/lamarr_cage.dm +++ b/code/game/objects/structures/lamarr_cage.dm @@ -39,13 +39,6 @@ Break() qdel(src) - -/obj/structure/lamarr/meteorhit(obj/O as obj) - new /obj/item/weapon/material/shard( src.loc ) - Break() - qdel(src) - - /obj/structure/lamarr/proc/healthcheck() if (src.health <= 0) if (!( src.destroyed )) diff --git a/code/game/objects/structures/safe.dm b/code/game/objects/structures/safe.dm index 199635cd0fe..0bbfe9f2f01 100644 --- a/code/game/objects/structures/safe.dm +++ b/code/game/objects/structures/safe.dm @@ -167,11 +167,6 @@ obj/structure/safe/blob_act() obj/structure/safe/ex_act(severity) return - -obj/structure/safe/meteorhit(obj/O as obj) - return - - //FLOOR SAFES /obj/structure/safe/floor name = "floor safe" diff --git a/code/game/objects/structures/window.dm b/code/game/objects/structures/window.dm index 26bc16e070a..1fec557b8d4 100644 --- a/code/game/objects/structures/window.dm +++ b/code/game/objects/structures/window.dm @@ -125,10 +125,6 @@ /obj/structure/window/blob_act() shatter() - -/obj/structure/window/meteorhit() - shatter() - //TODO: Make full windows a separate type of window. //Once a full window, it will always be a full window, so there's no point //having the same type for both. diff --git a/code/game/turfs/simulated/walls.dm b/code/game/turfs/simulated/walls.dm index 65b40e1fdfc..8015c47c8c0 100644 --- a/code/game/turfs/simulated/walls.dm +++ b/code/game/turfs/simulated/walls.dm @@ -233,16 +233,6 @@ var/list/global/wall_cache = list() // F.sd_LumReset() //TODO: ~Carn return -/turf/simulated/wall/meteorhit(obj/M as obj) - var/rotting = (locate(/obj/effect/overlay/wallrot) in src) - if (prob(15) && !rotting) - dismantle_wall() - else if(prob(70) && !rotting) - ChangeTurf(/turf/simulated/floor/plating) - else - ReplaceWithLattice() - return 0 - /turf/simulated/wall/proc/radiate() var/total_radiation = material.radioactivity + (reinf_material ? reinf_material.radioactivity / 2 : 0) if(!total_radiation) diff --git a/code/modules/admin/verbs/icarus.dm b/code/modules/admin/verbs/icarus.dm index 1f9b2dd4c4b..ef322d40dde 100644 --- a/code/modules/admin/verbs/icarus.dm +++ b/code/modules/admin/verbs/icarus.dm @@ -111,11 +111,10 @@ proc/Icarus_FireCannon(var/turf/target) target = locate(x, y, target.z) // Finally fire the fucker. - var/obj/effect/meteor/small/projectile = new (start) + var/obj/effect/meteor/projectile = new (start) projectile.dest = target projectile.name = "main gun projectile" // stealthy projectile.hits = 6 - projectile.detonation_chance = 99 // it's a missile/cannon round thing! // Make sure it travels spawn(0) diff --git a/code/modules/events/event_container.dm b/code/modules/events/event_container.dm index 3c1aeba23f9..cd65ca7ea3f 100644 --- a/code/modules/events/event_container.dm +++ b/code/modules/events/event_container.dm @@ -153,7 +153,7 @@ var/global/list/severity_to_string = list(EVENT_LEVEL_MUNDANE = "Mundane", EVENT new /datum/event_meta(EVENT_LEVEL_MODERATE, "Gravity Failure", /datum/event/gravity, 75, list(ASSIGNMENT_ENGINEER = 60)), new /datum/event_meta(EVENT_LEVEL_MODERATE, "Grid Check", /datum/event/grid_check, 200, list(ASSIGNMENT_SCIENTIST = 10)), new /datum/event_meta(EVENT_LEVEL_MODERATE, "Ion Storm", /datum/event/ionstorm, 0, list(ASSIGNMENT_AI = 50, ASSIGNMENT_CYBORG = 50, ASSIGNMENT_ENGINEER = 15, ASSIGNMENT_SCIENTIST = 5)), - new /datum/event_meta(EVENT_LEVEL_MODERATE, "Meteor Shower", /datum/event/meteor_shower, 0, list(ASSIGNMENT_ENGINEER = 20)), + new /datum/event_meta(EVENT_LEVEL_MODERATE, "Meteor Shower", /datum/event/meteor_wave, 0, list(ASSIGNMENT_ENGINEER = 20)), new /datum/event_meta(EVENT_LEVEL_MODERATE, "Prison Break", /datum/event/prison_break, 0, list(ASSIGNMENT_SECURITY = 100)), new /datum/event_meta(EVENT_LEVEL_MODERATE, "Radiation Storm", /datum/event/radiation_storm, 0, list(ASSIGNMENT_MEDICAL = 50), 1), new /datum/event_meta(EVENT_LEVEL_MODERATE, "Random Antagonist", /datum/event/random_antag, 2.5, list(ASSIGNMENT_SECURITY = 1), 1, 0, 5), @@ -168,13 +168,13 @@ var/global/list/severity_to_string = list(EVENT_LEVEL_MUNDANE = "Mundane", EVENT /datum/event_container/major severity = EVENT_LEVEL_MAJOR available_events = list( - new /datum/event_meta(EVENT_LEVEL_MAJOR, "Nothing", /datum/event/nothing, 1320), - new /datum/event_meta(EVENT_LEVEL_MAJOR, "Blob", /datum/event/blob, 0, list(ASSIGNMENT_ENGINEER = 60), 1), - new /datum/event_meta(EVENT_LEVEL_MAJOR, "Carp Migration", /datum/event/carp_migration, 0, list(ASSIGNMENT_SECURITY = 3), 1), - new /datum/event_meta(EVENT_LEVEL_MAJOR, "Containment Breach", /datum/event/prison_break/station, 0, list(ASSIGNMENT_ANY = 5)), - new /datum/event_meta(EVENT_LEVEL_MAJOR, "Meteor Wave", /datum/event/meteor_wave, 0, list(ASSIGNMENT_ENGINEER = 3), 1), - new /datum/event_meta(EVENT_LEVEL_MAJOR, "Space Vines", /datum/event/spacevine, 0, list(ASSIGNMENT_ENGINEER = 15), 1), - new /datum/event_meta(EVENT_LEVEL_MAJOR, "Viral Infection", /datum/event/viral_infection, 0, list(ASSIGNMENT_MEDICAL = 30), 1), + new /datum/event_meta(EVENT_LEVEL_MAJOR, "Nothing", /datum/event/nothing, 1320), + new /datum/event_meta(EVENT_LEVEL_MAJOR, "Blob", /datum/event/blob, 0, list(ASSIGNMENT_ENGINEER = 60), 1), + new /datum/event_meta(EVENT_LEVEL_MAJOR, "Carp Migration", /datum/event/carp_migration, 0, list(ASSIGNMENT_SECURITY = 3), 1), + new /datum/event_meta(EVENT_LEVEL_MAJOR, "Containment Breach", /datum/event/prison_break/station,0,list(ASSIGNMENT_ANY = 5)), + new /datum/event_meta(EVENT_LEVEL_MAJOR, "Meteor Wave", /datum/event/meteor_wave, 0, list(ASSIGNMENT_ENGINEER = 3), 1), + new /datum/event_meta(EVENT_LEVEL_MAJOR, "Space Vines", /datum/event/spacevine, 0, list(ASSIGNMENT_ENGINEER = 15), 1), + new /datum/event_meta(EVENT_LEVEL_MAJOR, "Viral Infection", /datum/event/viral_infection, 0, list(ASSIGNMENT_MEDICAL = 30), 1), ) diff --git a/code/modules/events/event_dynamic.dm b/code/modules/events/event_dynamic.dm index 3539130c275..d34fadeb32c 100644 --- a/code/modules/events/event_dynamic.dm +++ b/code/modules/events/event_dynamic.dm @@ -71,7 +71,6 @@ var/list/event_last_fired = list() possibleEvents[/datum/event/spacevine] = 10 + 5 * active_with_role["Engineer"] if(minutes_passed >= 30) // Give engineers time to set up engine possibleEvents[/datum/event/meteor_wave] = 10 * active_with_role["Engineer"] - possibleEvents[/datum/event/meteor_shower] = 20 * active_with_role["Engineer"] possibleEvents[/datum/event/blob] = 10 * active_with_role["Engineer"] if(active_with_role["Medical"] > 0) diff --git a/code/modules/events/meteors.dm b/code/modules/events/meteors.dm index 45d59ca8cd0..43093a3de8a 100644 --- a/code/modules/events/meteors.dm +++ b/code/modules/events/meteors.dm @@ -1,44 +1,39 @@ -//meteor storms are much heavier /datum/event/meteor_wave - startWhen = 6 - endWhen = 33 - -/datum/event/meteor_wave/setup() - endWhen = rand(15,30) * 3 - -/datum/event/meteor_wave/announce() - command_announcement.Announce("Meteors have been detected on collision course with the station.", "Meteor Alert", new_sound = 'sound/AI/meteors.ogg') - -/datum/event/meteor_wave/tick() - if(IsMultiple(activeFor, 3)) - meteor_wave(rand(2,5)) - -/datum/event/meteor_wave/end() - command_announcement.Announce("The station has cleared the meteor storm.", "Meteor Alert") - -// -/datum/event/meteor_shower startWhen = 5 endWhen = 7 var/next_meteor = 6 var/waves = 1 -/datum/event/meteor_shower/setup() - waves = rand(2,5) +/datum/event/meteor_wave/setup() + waves = severity * rand(1,3) -/datum/event/meteor_shower/announce() - command_announcement.Announce("The station is now in a meteor shower.", "Meteor Alert") +/datum/event/meteor_wave/announce() + switch(severity) + if(EVENT_LEVEL_MAJOR) + command_announcement.Announce("Meteors have been detected on collision course with the station.", "Meteor Alert", new_sound = 'sound/AI/meteors.ogg') + else + command_announcement.Announce("The station is now in a meteor shower.", "Meteor Alert") //meteor showers are lighter and more common, -/datum/event/meteor_shower/tick() +/datum/event/meteor_wave/tick() if(activeFor >= next_meteor) - meteor_wave(rand(1,4)) - next_meteor += rand(20,100) + spawn() spawn_meteors(severity * rand(1,2), get_meteors()) + next_meteor += rand(15, 30) / severity waves-- - if(waves <= 0) - endWhen = activeFor + 1 - else - endWhen = next_meteor + 1 + endWhen = (waves <= 0 ? activeFor + 15 : next_meteor + 1) -/datum/event/meteor_shower/end() - command_announcement.Announce("The station has cleared the meteor shower", "Meteor Alert") +/datum/event/meteor_wave/end() + switch(severity) + if(EVENT_LEVEL_MAJOR) + command_announcement.Announce("The station has cleared the meteor storm.", "Meteor Alert") + else + command_announcement.Announce("The station has cleared the meteor shower", "Meteor Alert") + +/datum/event/meteor_wave/proc/get_meteors() + switch(severity) + if(EVENT_LEVEL_MAJOR) + return meteors_catastrophic + if(EVENT_LEVEL_MODERATE) + return meteors_threatening + else + return meteors_normal diff --git a/code/modules/holodeck/HolodeckControl.dm b/code/modules/holodeck/HolodeckControl.dm index 45eaf758f94..373c75ceea8 100644 --- a/code/modules/holodeck/HolodeckControl.dm +++ b/code/modules/holodeck/HolodeckControl.dm @@ -158,16 +158,6 @@ emergencyShutdown() ..() -/obj/machinery/computer/HolodeckControl/meteorhit(var/obj/O as obj) - emergencyShutdown() - ..() - - -/obj/machinery/computer/HolodeckControl/emp_act(severity) - emergencyShutdown() - ..() - - /obj/machinery/computer/HolodeckControl/ex_act(severity) emergencyShutdown() ..() diff --git a/code/modules/mob/living/carbon/alien/alien_attacks.dm b/code/modules/mob/living/carbon/alien/alien_attacks.dm index 62768945a36..578059e6e0d 100644 --- a/code/modules/mob/living/carbon/alien/alien_attacks.dm +++ b/code/modules/mob/living/carbon/alien/alien_attacks.dm @@ -3,17 +3,6 @@ /mob/living/carbon/alien/attack_ui(slot_id) return -/mob/living/carbon/alien/meteorhit(O as obj) - for(var/mob/M in viewers(src, null)) - if ((M.client && !( M.blinded ))) - M.show_message(text("\red [] has been hit by []", src, O), 1) - if (health > 0) - adjustBruteLoss((istype(O, /obj/effect/meteor/small) ? 10 : 25)) - adjustFireLoss(30) - - updatehealth() - return - /mob/living/carbon/alien/attack_hand(mob/living/carbon/M as mob) ..() diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index 10e165fa5fb..718f9c6533d 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -177,22 +177,6 @@ apply_damage(rand(30,40), BRUTE, affecting, run_armor_check(affecting, "melee")) return -/mob/living/carbon/human/meteorhit(O as obj) - for(var/mob/M in viewers(src, null)) - if ((M.client && !( M.blinded ))) - M.show_message("\red [src] has been hit by [O]", 1) - if (health > 0) - var/obj/item/organ/external/affecting = get_organ(pick("chest", "chest", "chest", "head")) - if(!affecting) return - if (istype(O, /obj/effect/immovablerod)) - if(affecting.take_damage(101, 0)) - UpdateDamageIcon() - else - if(affecting.take_damage((istype(O, /obj/effect/meteor/small) ? 10 : 25), 30)) - UpdateDamageIcon() - updatehealth() - return - /mob/living/carbon/human/proc/implant_loyalty(mob/living/carbon/human/M, override = FALSE) // Won't override by default. if(!config.use_loyalty_implants && !override) return // Nuh-uh. diff --git a/code/modules/mob/living/carbon/metroid/metroid.dm b/code/modules/mob/living/carbon/metroid/metroid.dm index 8c97286e3fa..d7994b3a608 100644 --- a/code/modules/mob/living/carbon/metroid/metroid.dm +++ b/code/modules/mob/living/carbon/metroid/metroid.dm @@ -220,15 +220,6 @@ /mob/living/carbon/slime/attack_ui(slot) return -/mob/living/carbon/slime/meteorhit(O as obj) - visible_message("[src] has been hit by [O]") - - adjustBruteLoss((istype(O, /obj/effect/meteor/small) ? 10 : 25)) - adjustFireLoss(30) - - updatehealth() - return - /mob/living/carbon/slime/attack_hand(mob/living/carbon/human/M as mob) ..() diff --git a/code/modules/mob/living/silicon/ai/ai.dm b/code/modules/mob/living/silicon/ai/ai.dm index c0df651d4b9..dd0ba82a569 100644 --- a/code/modules/mob/living/silicon/ai/ai.dm +++ b/code/modules/mob/living/silicon/ai/ai.dm @@ -452,17 +452,6 @@ var/list/ai_verbs_default = list( return -/mob/living/silicon/ai/meteorhit(obj/O as obj) - for(var/mob/M in viewers(src, null)) - M.show_message(text("\red [] has been hit by []", src, O), 1) - //Foreach goto(19) - if (health > 0) - adjustBruteLoss(30) - if ((O.icon_state == "flaming")) - adjustFireLoss(40) - updatehealth() - return - /mob/living/silicon/ai/reset_view(atom/A) if(camera) camera.set_light(0) diff --git a/code/modules/mob/living/silicon/pai/pai.dm b/code/modules/mob/living/silicon/pai/pai.dm index 99e5684e4e4..b0a27ad52fb 100644 --- a/code/modules/mob/living/silicon/pai/pai.dm +++ b/code/modules/mob/living/silicon/pai/pai.dm @@ -169,17 +169,6 @@ if(3) src << "You feel an electric surge run through your circuitry and become acutely aware at how lucky you are that you can still feel at all." -// See software.dm for Topic() -/mob/living/silicon/pai/meteorhit(obj/O as obj) - for(var/mob/M in viewers(src, null)) - M.show_message(text("\red [] has been hit by []", src, O), 1) - if (src.health > 0) - src.adjustBruteLoss(30) - if ((O.icon_state == "flaming")) - src.adjustFireLoss(40) - src.updatehealth() - return - /mob/living/silicon/pai/proc/switchCamera(var/obj/machinery/camera/C) if(istype(usr, /mob/living)) var/mob/living/U = usr diff --git a/code/modules/mob/living/silicon/robot/robot.dm b/code/modules/mob/living/silicon/robot/robot.dm index e71db5693d1..c7a1d1145c6 100644 --- a/code/modules/mob/living/silicon/robot/robot.dm +++ b/code/modules/mob/living/silicon/robot/robot.dm @@ -450,17 +450,6 @@ /mob/living/silicon/robot/restrained() return 0 -/mob/living/silicon/robot/meteorhit(obj/O as obj) - for(var/mob/M in viewers(src, null)) - M.show_message(text("\red [src] has been hit by [O]"), 1) - //Foreach goto(19) - if (health > 0) - adjustBruteLoss(30) - if ((O.icon_state == "flaming")) - adjustFireLoss(40) - updatehealth() - return - /mob/living/silicon/robot/bullet_act(var/obj/item/projectile/Proj) ..(Proj) if(prob(75) && Proj.damage > 0) spark_system.start() diff --git a/code/modules/power/singularity/containment_field.dm b/code/modules/power/singularity/containment_field.dm index 8b512644606..6ae977735bd 100644 --- a/code/modules/power/singularity/containment_field.dm +++ b/code/modules/power/singularity/containment_field.dm @@ -36,9 +36,6 @@ /obj/machinery/containment_field/ex_act(severity) return 0 -/obj/machinery/containment_field/meteorhit() - return 0 - /obj/machinery/containment_field/HasProximity(atom/movable/AM as mob|obj) if(istype(AM,/mob/living/silicon) && prob(40)) shock(AM) diff --git a/code/modules/power/singularity/emitter.dm b/code/modules/power/singularity/emitter.dm index 11606b3dc1c..789a6b13d7f 100644 --- a/code/modules/power/singularity/emitter.dm +++ b/code/modules/power/singularity/emitter.dm @@ -93,9 +93,6 @@ src.use_power = 1 */ return 1 -/obj/machinery/containment_field/meteorhit() - return 0 - /obj/machinery/power/emitter/process() if(stat & (BROKEN)) return diff --git a/code/modules/power/singularity/field_generator.dm b/code/modules/power/singularity/field_generator.dm index 2f388006371..5532f8ce9ea 100644 --- a/code/modules/power/singularity/field_generator.dm +++ b/code/modules/power/singularity/field_generator.dm @@ -166,9 +166,6 @@ field_generator power level display else ..() -/obj/machinery/containment_field/meteorhit() - return 0 - /obj/machinery/field_generator/bullet_act(var/obj/item/projectile/Proj) if(istype(Proj, /obj/item/projectile/beam)) power += Proj.damage * EMITTER_DAMAGE_POWER_TRANSFER diff --git a/code/modules/power/singularity/particle_accelerator/particle_accelerator.dm b/code/modules/power/singularity/particle_accelerator/particle_accelerator.dm index 6ae932dee1d..ec659eca583 100644 --- a/code/modules/power/singularity/particle_accelerator/particle_accelerator.dm +++ b/code/modules/power/singularity/particle_accelerator/particle_accelerator.dm @@ -163,12 +163,6 @@ So, hopefully this is helpful if any more icons are to be added/changed/wonderin qdel(src) return - -/obj/structure/particle_accelerator/meteorhit() - if(prob(50)) - qdel(src) - return - /obj/structure/particle_accelerator/update_icon() switch(construction_state) if(0,1) @@ -351,12 +345,6 @@ So, hopefully this is helpful if any more icons are to be added/changed/wonderin return -/obj/machinery/particle_accelerator/meteorhit() - if(prob(50)) - qdel(src) - return - - /obj/machinery/particle_accelerator/proc/update_state() return 0 diff --git a/code/modules/projectiles/projectile/special.dm b/code/modules/projectiles/projectile/special.dm index 9ef0aea43c5..6f42a099f13 100644 --- a/code/modules/projectiles/projectile/special.dm +++ b/code/modules/projectiles/projectile/special.dm @@ -59,7 +59,7 @@ if(src)//Do not add to this if() statement, otherwise the meteor won't delete them if(A) - A.meteorhit(src) + A.ex_act(3) playsound(src.loc, 'sound/effects/meteorimpact.ogg', 40, 1) for(var/mob/M in range(10, src)) diff --git a/code/modules/reagents/Chemistry-Machinery.dm b/code/modules/reagents/Chemistry-Machinery.dm index 7f6da07d671..9d742d726a2 100644 --- a/code/modules/reagents/Chemistry-Machinery.dm +++ b/code/modules/reagents/Chemistry-Machinery.dm @@ -48,10 +48,6 @@ if (prob(50)) qdel(src) -/obj/machinery/chem_master/meteorhit() - qdel(src) - return - /obj/machinery/chem_master/attackby(var/obj/item/weapon/B as obj, var/mob/user as mob) if(istype(B, /obj/item/weapon/reagent_containers/glass)) diff --git a/code/modules/research/circuitprinter.dm b/code/modules/research/circuitprinter.dm index 57812535b65..7c43450ce28 100644 --- a/code/modules/research/circuitprinter.dm +++ b/code/modules/research/circuitprinter.dm @@ -83,10 +83,6 @@ using metal and glass, it uses glass and reagents (usually sulphuric acid). if(prob(50)) qdel(src) -/obj/machinery/r_n_d/circuit_imprinter/meteorhit() - qdel(src) - return - /obj/machinery/r_n_d/circuit_imprinter/proc/TotalMaterials() var/t = 0 for(var/f in materials) diff --git a/code/modules/research/destructive_analyzer.dm b/code/modules/research/destructive_analyzer.dm index 9b97fecd951..c6cbff24966 100644 --- a/code/modules/research/destructive_analyzer.dm +++ b/code/modules/research/destructive_analyzer.dm @@ -31,10 +31,6 @@ Note: Must be placed within 3 tiles of the R&D Console T += S.rating decon_mod = T * 0.1 -/obj/machinery/r_n_d/destructive_analyzer/meteorhit() - qdel(src) - return - /obj/machinery/r_n_d/destructive_analyzer/update_icon() if(panel_open) icon_state = "d_analyzer_t" diff --git a/code/modules/research/server.dm b/code/modules/research/server.dm index cca8f65b161..a2184d6b79e 100644 --- a/code/modules/research/server.dm +++ b/code/modules/research/server.dm @@ -71,10 +71,6 @@ produce_heat() delay = initial(delay) -/obj/machinery/r_n_d/server/meteorhit(var/obj/O as obj) - griefProtection() - ..() - /obj/machinery/r_n_d/server/emp_act(severity) griefProtection() ..() diff --git a/code/modules/shieldgen/emergency_shield.dm b/code/modules/shieldgen/emergency_shield.dm index 15bfa973ed8..9918afb0680 100644 --- a/code/modules/shieldgen/emergency_shield.dm +++ b/code/modules/shieldgen/emergency_shield.dm @@ -59,13 +59,6 @@ ..() -/obj/machinery/shield/meteorhit() - src.health -= max_health*0.75 //3/4 health as damage - check_failure() - opacity = 1 - spawn(20) if(src) opacity = 0 - return - /obj/machinery/shield/bullet_act(var/obj/item/projectile/Proj) health -= Proj.damage ..() @@ -225,13 +218,6 @@ update_icon() return -/obj/machinery/shieldgen/meteorhit(obj/O as obj) - src.health -= max_health*0.25 //A quarter of the machine's health - if (prob(5)) - src.malfunction = 1 - src.checkhp() - return - /obj/machinery/shieldgen/ex_act(severity) switch(severity) if(1.0) diff --git a/code/modules/shieldgen/energy_field.dm b/code/modules/shieldgen/energy_field.dm index 074d3abbfa9..7b26e1696f2 100644 --- a/code/modules/shieldgen/energy_field.dm +++ b/code/modules/shieldgen/energy_field.dm @@ -27,11 +27,6 @@ /obj/effect/energy_field/bullet_act(var/obj/item/projectile/Proj) Stress(Proj.damage / 10) -/obj/effect/energy_field/meteorhit(obj/effect/meteor/M as obj) - if(M) - walk(M,0) - Stress(2) - /obj/effect/energy_field/proc/Stress(var/severity) strength -= severity diff --git a/code/modules/vehicles/vehicle.dm b/code/modules/vehicles/vehicle.dm index 556e82cd0c8..f28b001fef2 100644 --- a/code/modules/vehicles/vehicle.dm +++ b/code/modules/vehicles/vehicle.dm @@ -119,10 +119,6 @@ ..() healthcheck() -/obj/vehicle/meteorhit() - explode() - return - /obj/vehicle/blob_act() src.health -= rand(20,40)*fire_dam_coeff healthcheck() diff --git a/icons/obj/meteor.dmi b/icons/obj/meteor.dmi index 123a5bdf86e55167b5aaabba0447077b867c0f0d..b9a83d510efe719a384bdd5115768428d73123a2 100644 GIT binary patch literal 4545 zcmV;y5kBsTP)V=-0C=2@%DoE1AQXn-*>e>i$zJ-mx)eikNbW)KLG?EmG1GI6C)@u}4z;B!Osr%#&7Htrq3&8`pK3J@5(bGaQWtw@UOYpJoEb_YXCK%Zi;`?p5^c+^ zKR_@fa&F%_=R24A|1F$9f1Zc9fAHMz8~A&N_kQ2NgNV`5QTukEzw^#JLbvA<9!k*0 z@Vn9fvM+FvL?VGCNhnzf83llIT)^-5W11$=ogp3?pi3M-e%wx*d&u~6n5Ic8l|so% zyrjRtxx_{CQXb2)-0wR^fZH45ftH|&i3xk27iS_;EXxN^w|wiL=%@_FyU|*!!U?MA_M{ffDS|S0&%nL)ffF4 z5{KG^nx={B*SH|HbAcvnBoYa9UB|L4EX!i@;wzj>XV|04$g)f-mEzS`UtME_ElZF? zh-FzwlH}@OuVrB6wZh>rfJ-`nuIqTcUJS$N+4bHXeaqGr3rW{Wq!XyBimIvr+{%l9D8?xyGgq;E(}rLcCrtfj|JS*GsKd!;yeq z8zLMI69@#{YGYtvz$K;8XdsFrwOVb<*ExRtxE)7!NsDJ>E}9qJ>uQ=tI-TwyU)S}v zx07H>&0r-UuFB*SHzQ*;Hf(^E#3vF7>h-!S0|16$5R1hy45KGRtan|91i#)*vgSEc?!v+oDkWsJK?}-eoCg1DzQYw|)WH&uM?OrPs3c1I{VliNI zMi?C(wKYvcQ560~J$O)!t-u&I)`TKh4 z$^fg$w{82b%fM>*{eA+0fLjGQKjCngMx)^p4{aixVqh~!YbnkpE|8~P)mWB=HKn5` zEZ57k`*k!;b4dp}5_BSwaLK<_7YrMS0EhfWqp?N?6s0|kT2BVHifXlrVHnKK&5_UN zUDBPOKp=oD%PcM~;`9036qxXAqcJU*X~<>h4x zg+jNdz9l9mCIo1c=^&rayHexx`6!i2`2BtoiG*7eI9M%P-6Csc$>nk#$#-R)?{vLz zvm~}G3t5)Yb)7^a;gWyUdWGL`wl|}QNF>6-!U6!Qsv?Ranx^6PdhvKX1Ofq6Ri#p? z0KI9#)-%FNBoa3})VaAi_j}HmVl#OE{r3gO%bmH-nDQDUR+?0*J&te`z%k4#^2;vy z&fhJ|;#cwizGVdjT^hi$EVukyDKo3duT(1dd_F``>}dz=7-1#+e!p9RRjXC1)vB8V z9P*t~cr*8+sw#;@0$G;%=geWwaRKFUC%Mq(<~8a2WEItwA5~S|Xj!lOU5Ty?;8-ve z3bC-TK)GDTFbo2LKnMAuP{`H8yM@(JSglrpc8TibfUS~0Iy!1Qo~-9|G)YIx>aOlX zoA{KK-~_L5jz4ix%XB>ZN$E8=8l0$E4_!xq^I)M+h-$S;e}6yA%gY_)>$=|4@xyAY z7lm+>e5Vp}w12ZvxN>fDSl!Qu$~kzc?Sv}_j)$c~WKqeYy177ARSrq}iK_{uwyjWA z^_DW!^(dlHC=iRq$mjEf!(pn`D&cULa=Gl1zmuZbqTw;VV7fA-`AmW1420c>jJ5Wzzgo z`Vd7?$Y!%0a^jS!vL$gi`x3wAL#7hhj;8E(c%WX&uWqQ;8+-T48D4$$Ra=rIUemwJ zS?dD%l-@B`SXuL{s!BSMM%E;z$aIi@yDk_WFaxZ_YGd4uC>%X9YAYycXdvJ0IUHD) z)qW-U*Pg&Zx8%bEY=C=>)t#&?%dRBJvg}qt8zCPa8er47)o7tx;vGCRz?|`gGiyFK z41+Ug&O9_q7uZk^7#|hBR7ihyV|N+c2?5{XbM zmE1YZ(W6K0Kp@~o#dgBmZ@+EF<8kKa=Q(!l*tUzxt|Q>xci*+0Wr(FxsY7~_$)rnu zu~@t-IpM^K6ZXoy)9o?)_U+?|C!XN(#~5T#NHz+DqM zG&IEQ?ChGQioL?*r%!iHq9}??Pfw%kI`i}MYi2gv0bLou@jS=- z>-9R(Xaul%CjAVVOon>Bj`N*f;`Hg$b}$$u7z|RWRA@GvT_5Z5cqo_4T)upn{{DWh zT)EQId+P-@6aj7TFA|Ln5C}^gIJlp(ULYD9AekKM*-d@?@y7zR_4~yaUu4IQ9prL3 z=I7@TMX~GiOiWA&jYb1q*U9B_oH})C+vR{eCgJh%aXXnz0#GUyDc&fMRCY6$&w{i> zxq2PDDG>4O0(v8{2M!#t0h-MweSLl8ayfSH+}ZI865!1@-?aPt`|)@@)M_19r>TK6wNtIbZ*p(SauEJkrp3(`=IZGZy((9oav1>-Vi?f z>@%)jy^3KN{NM*a5TNb($z+mfH0r*aHVgx=*UR+uG&^_hWNd8A9vd6m_Oq_8`T%Dk zY$P&(xmYDOG{EJ&O67cn#A}zy{rheL{va(x0^S{b`j0O)T8kd8?fegZ^rL^72%;!*UAs7r| zm?ot{8SO>|FYQH8SO4=-JW`8=W|6)~3o*P%L#PuQ9H4I2IePSH&*h+0Dp9Fan3^$$r5=ij3D~)G!3e@ zPGDyrp+{Q?*B`+&d>B>@K@{0&V*bfbequYDE>n$IRDC+%mRc?MaQiAJLg4-XTKM#<;% zv|241jRuBcu(Y(qo;`a=rBYay#kaooEe;$wz}~%kw`FqPP!)s?_A>az5Pd?3R^7)} zmuB(#eDr^3mi);V@d*J~_CT}kY+w81$6Xihf*??@*D+0#Xf(>?14;-WjJ z%IEVN>ZI=lx=F%5Ko)~d0?H%kEfrB-BoOf87bNTg^a=g=#V~VUT_-XSp{}XW5`c~8 zyjyjyKm6ej1%R=!F}qMG&}y~T{jMmAT)K3LC!c&0(=@Sdn^-J{rfEbX5qI;*cEN28 z@YiNa0{U#Jw}{NMeQ+^Hw%6Z)|ieHisR zrP2+O$vw0^zRk~8$I`$3?QiW*KKZ1b;QRY&wOSa4vF>h})u>jheEH>cTUoNw7p zfiE*(k=QvzDxOCDb)4pcm-4kLc2mG^w!JPE;|7TFCRJ!Nuf=-+`VIMkl2tg2-pP#2tD7cYu zJKXP;aT}bM3z$Y*a-2k)OeS6Lcl7^$Komu?*({o-@zhgK-IsgV3^uebs8}qzUJh-! zaaKqK0)dW7=w8F)@o?kD4VIRcIyMe&cXS;AlarG|`^{Je!!Ssv(?p|DSMv?Sa3kP; zEK8i2m=KnhmbiNLDu4OQU$$-4vl^S)pmFr*QTIhX;4V>o5Z8p>?;NnH)zN3poDo*P f>3YzJ-!AxnoLw1Xm|VmC00000NkvXXu0mjfo(}V2 literal 11700 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 BhbsU8 From 079b0af6b07e51c5588cde4088b65b6038326dbc Mon Sep 17 00:00:00 2001 From: PsiOmegaDelta Date: Fri, 5 Jun 2015 15:47:33 +0200 Subject: [PATCH 003/215] Adds spinning animation for meteors. --- baystation12.dme | 1 + code/_helpers/matrices.dm | 17 +++++++++++++++++ code/game/gamemodes/meteor/meteors.dm | 2 +- code/modules/events/meteors.dm | 4 ++-- code/modules/supermatter/supermatter.dm | 8 ++++---- 5 files changed, 25 insertions(+), 7 deletions(-) create mode 100644 code/_helpers/matrices.dm diff --git a/baystation12.dme b/baystation12.dme index 143149c577f..e94c923fd04 100644 --- a/baystation12.dme +++ b/baystation12.dme @@ -36,6 +36,7 @@ #include "code\_helpers\lists.dm" #include "code\_helpers\logging.dm" #include "code\_helpers\maths.dm" +#include "code\_helpers\matrices.dm" #include "code\_helpers\mobs.dm" #include "code\_helpers\names.dm" #include "code\_helpers\sanitize_values.dm" diff --git a/code/_helpers/matrices.dm b/code/_helpers/matrices.dm new file mode 100644 index 00000000000..abb0366382d --- /dev/null +++ b/code/_helpers/matrices.dm @@ -0,0 +1,17 @@ +/matrix/proc/TurnTo(old_angle, new_angle) + . = new_angle - old_angle + Turn(.) //BYOND handles cases such as -270, 360, 540 etc. DOES NOT HANDLE 180 TURNS WELL, THEY TWEEN AND LOOK LIKE SHIT + + +/atom/proc/SpinAnimation(speed = 10, loops = -1) + var/matrix/m120 = matrix(transform) + m120.Turn(120) + var/matrix/m240 = matrix(transform) + m240.Turn(240) + var/matrix/m360 = matrix(transform) + speed /= 3 //Gives us 3 equal time segments for our three turns. + //Why not one turn? Because byond will see that the start and finish are the same place and do nothing + //Why not two turns? Because byond will do a flip instead of a turn + animate(src, transform = m120, time = speed, loops) + animate(transform = m240, time = speed) + animate(transform = m360, time = speed) diff --git a/code/game/gamemodes/meteor/meteors.dm b/code/game/gamemodes/meteor/meteors.dm index 96367b4a115..544a0462511 100644 --- a/code/game/gamemodes/meteor/meteors.dm +++ b/code/game/gamemodes/meteor/meteors.dm @@ -123,7 +123,7 @@ /obj/effect/meteor/New() ..() - //SpinAnimation() + SpinAnimation() /obj/effect/meteor/Bump(atom/A) if(A) diff --git a/code/modules/events/meteors.dm b/code/modules/events/meteors.dm index 43093a3de8a..ae2adeef320 100644 --- a/code/modules/events/meteors.dm +++ b/code/modules/events/meteors.dm @@ -16,11 +16,11 @@ //meteor showers are lighter and more common, /datum/event/meteor_wave/tick() - if(activeFor >= next_meteor) + if(waves && activeFor >= next_meteor) spawn() spawn_meteors(severity * rand(1,2), get_meteors()) next_meteor += rand(15, 30) / severity waves-- - endWhen = (waves <= 0 ? activeFor + 15 : next_meteor + 1) + endWhen = (waves ? next_meteor + 1 : activeFor + 15) /datum/event/meteor_wave/end() switch(severity) diff --git a/code/modules/supermatter/supermatter.dm b/code/modules/supermatter/supermatter.dm index c08f85b2982..c30f5773135 100644 --- a/code/modules/supermatter/supermatter.dm +++ b/code/modules/supermatter/supermatter.dm @@ -157,15 +157,15 @@ /obj/machinery/power/supermatter/get_transit_zlevel() //don't send it back to the station -- most of the time - if(prob(99)) + if(prob(99)) var/list/candidates = accessible_z_levels.Copy() for(var/zlevel in config.station_levels) candidates.Remove("[zlevel]") candidates.Remove("[src.z]") - + if(candidates.len) return text2num(pickweight(candidates)) - + return ..() /obj/machinery/power/supermatter/process() @@ -382,7 +382,7 @@ defer_powernet_rebuild = 1 // Let's just make this one loop. for(var/atom/X in orange(pull_radius,src)) - X.singularity_pull(src, STAGE_FIVE) + spawn() X.singularity_pull(src, STAGE_FIVE) if(defer_powernet_rebuild != 2) defer_powernet_rebuild = 0 From 19866f734b0d6d073e3f1a7e13d60eb1b0dfc50a Mon Sep 17 00:00:00 2001 From: PsiOmegaDelta Date: Fri, 5 Jun 2015 16:07:59 +0200 Subject: [PATCH 004/215] Changelog entry. --- html/changelogs/PsiOmegaDelta-Meteors.yml | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 html/changelogs/PsiOmegaDelta-Meteors.yml diff --git a/html/changelogs/PsiOmegaDelta-Meteors.yml b/html/changelogs/PsiOmegaDelta-Meteors.yml new file mode 100644 index 00000000000..ad4a3bf87fb --- /dev/null +++ b/html/changelogs/PsiOmegaDelta-Meteors.yml @@ -0,0 +1,5 @@ +author: PsiOmegaDelta +delete-after: True + +changes: + - rscadd: "Ports /tg/'s meteor event. Meteors now appear to be more accurate, come in a greater variety, and may drop ores on their final destruction." From 69e0ebf71e39e5f86d472bbf4508b38d46a122e1 Mon Sep 17 00:00:00 2001 From: Atlantis Date: Sat, 6 Jun 2015 07:21:34 +0200 Subject: [PATCH 005/215] Implements Destroy() for organs - This fixes annoying roundstart GC errors, and should fix other limb/organ related GC errors as well. --- code/modules/organs/organ.dm | 21 +++++++++++++++++++++ code/modules/organs/organ_external.dm | 14 ++++++++++++++ 2 files changed, 35 insertions(+) diff --git a/code/modules/organs/organ.dm b/code/modules/organs/organ.dm index 7e7e2e81782..86620ba50e0 100644 --- a/code/modules/organs/organ.dm +++ b/code/modules/organs/organ.dm @@ -24,6 +24,27 @@ var/list/organ_cache = list() // links chemical IDs to number of ticks for which they'll stay in the blood germ_level = 0 +/obj/item/organ/Destroy() + if(!owner) + return ..() + + if((owner.internal_organs) && (src in owner.internal_organs)) + owner.internal_organs -= src + + if((owner.internal_organs_by_name) && (src in owner.internal_organs_by_name)) + owner.internal_organs_by_name -= src + + if((owner.organs) && (src in owner.organs)) + owner.internal_organs -= src + + if((owner.organs_by_name) && (src in owner.organs_by_name)) + owner.organs_by_name -= src + + if(src in owner.contents) + owner.contents -= src + + return ..() + /obj/item/organ/proc/update_health() return diff --git a/code/modules/organs/organ_external.dm b/code/modules/organs/organ_external.dm index a92219c7339..5434e98acce 100644 --- a/code/modules/organs/organ_external.dm +++ b/code/modules/organs/organ_external.dm @@ -48,6 +48,20 @@ var/can_grasp var/can_stand +/obj/item/organ/external/Destroy() + if(parent && parent.children) + parent.children -= src + + if(children) + for(var/obj/item/organ/external/C in children) + qdel(C) + + if(internal_organs) + for(var/obj/item/organ/O in internal_organs) + qdel(O) + + return ..() + /obj/item/organ/external/attack_self(var/mob/user) if(!contents.len) return ..() From b16bf61d03930e8841a9db5eda9d0e04036668c6 Mon Sep 17 00:00:00 2001 From: Atlantis Date: Sat, 6 Jun 2015 09:43:39 +0200 Subject: [PATCH 006/215] Implements Destroy() for buildable SMES units. - This also means GC errors for SMES coils and probably cable coils are fixed. Both of these things are in used in SMESs' construction components. --- code/modules/power/smes_construction.dm | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/code/modules/power/smes_construction.dm b/code/modules/power/smes_construction.dm index b2e584c1366..0160868a14e 100644 --- a/code/modules/power/smes_construction.dm +++ b/code/modules/power/smes_construction.dm @@ -75,6 +75,15 @@ charge = 0 should_be_mapped = 1 +/obj/machinery/power/smes/buildable/Destroy() + qdel(wires) + if(component_parts) + for(var/atom/A in component_parts) + qdel(A) + + return ..() + + // Proc: process() // Parameters: None // Description: Uses parent process, but if grounding wire is cut causes sparks to fly around. From 8a5a969002aede928a7b8a6bfcc2e6f938d1b7c5 Mon Sep 17 00:00:00 2001 From: Atlantis Date: Sat, 6 Jun 2015 11:04:41 +0200 Subject: [PATCH 007/215] More Destroy()s, better implementation - Re-implements Destroy() for SMES units. This time moves relevant (de)construction code all the way up to obj/machinery/. This should fix any potential GC issues with deconstruction of component-based machines. - Implements Destroy() for breaker boxes. - Fixes SMES units lacking disconnect_terminal(), causing GC errors. --- code/game/machinery/machinery.dm | 9 +++++++++ code/modules/power/breaker_box.dm | 5 +++++ code/modules/power/power.dm | 2 ++ code/modules/power/smes.dm | 8 +++++--- code/modules/power/smes_construction.dm | 9 ++++----- 5 files changed, 25 insertions(+), 8 deletions(-) diff --git a/code/game/machinery/machinery.dm b/code/game/machinery/machinery.dm index d9b579ab038..313efe3bb2c 100644 --- a/code/game/machinery/machinery.dm +++ b/code/game/machinery/machinery.dm @@ -123,6 +123,15 @@ Class Procs: /obj/machinery/Destroy() machines -= src + if(component_parts) + for(var/atom/A in component_parts) + if(A.loc == src) // If the components are inside the machine, delete them. + qdel(A) + else // Otherwise we assume they were dropped to the ground during deconstruction, and were not removed from the component_parts list by deconstruction code. + component_parts -= A + if(contents) // The same for contents. + for(var/atom/A in contents) + qdel(A) ..() /obj/machinery/process()//If you dont use process or power why are you here diff --git a/code/modules/power/breaker_box.dm b/code/modules/power/breaker_box.dm index 2faa50a4e6f..5930dd53e7c 100644 --- a/code/modules/power/breaker_box.dm +++ b/code/modules/power/breaker_box.dm @@ -19,6 +19,11 @@ var/RCon_tag = "NO_TAG" var/update_locked = 0 +/obj/machinery/power/breakerbox/Destroy() + ..() + for(var/obj/nano_module/rcon/R in world) + R.FindDevices() + /obj/machinery/power/breakerbox/activated icon_state = "bbox_on" diff --git a/code/modules/power/power.dm b/code/modules/power/power.dm index 3b9d094bda8..7d51af8e352 100644 --- a/code/modules/power/power.dm +++ b/code/modules/power/power.dm @@ -17,6 +17,8 @@ /obj/machinery/power/Destroy() disconnect_from_network() + disconnect_terminal() + ..() /////////////////////////////// diff --git a/code/modules/power/smes.dm b/code/modules/power/smes.dm index e42c5289b7d..5fcffca1207 100644 --- a/code/modules/power/smes.dm +++ b/code/modules/power/smes.dm @@ -84,10 +84,12 @@ return -/obj/machinery/power/smes/Destroy() +/obj/machinery/power/smes/disconnect_terminal() if(terminal) - disconnect_terminal() - ..() + terminal.master = null + terminal = null + return 1 + return 0 /obj/machinery/power/smes/update_icon() overlays.Cut() diff --git a/code/modules/power/smes_construction.dm b/code/modules/power/smes_construction.dm index 0160868a14e..095c172aac5 100644 --- a/code/modules/power/smes_construction.dm +++ b/code/modules/power/smes_construction.dm @@ -76,12 +76,10 @@ should_be_mapped = 1 /obj/machinery/power/smes/buildable/Destroy() + ..() qdel(wires) - if(component_parts) - for(var/atom/A in component_parts) - qdel(A) - - return ..() + for(var/obj/nano_module/rcon/R in world) + R.FindDevices() // Proc: process() @@ -354,6 +352,7 @@ if(I.reliability != 100 && crit_fail) I.crit_fail = 1 I.loc = src.loc + component_parts -= I qdel(src) return From bb33905803b2ab179b8ea9b66fc70249a476ea0c Mon Sep 17 00:00:00 2001 From: Atlantis Date: Sun, 7 Jun 2015 05:29:43 +0200 Subject: [PATCH 008/215] Fixes minor typo in organ Destroy() --- code/modules/organs/organ.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/modules/organs/organ.dm b/code/modules/organs/organ.dm index 86620ba50e0..933c1de7089 100644 --- a/code/modules/organs/organ.dm +++ b/code/modules/organs/organ.dm @@ -35,7 +35,7 @@ var/list/organ_cache = list() owner.internal_organs_by_name -= src if((owner.organs) && (src in owner.organs)) - owner.internal_organs -= src + owner.organs -= src if((owner.organs_by_name) && (src in owner.organs_by_name)) owner.organs_by_name -= src From 41d4c2eb130801febe13835ea5073d2d45ceb8d2 Mon Sep 17 00:00:00 2001 From: Atlantis Date: Sun, 7 Jun 2015 06:26:10 +0200 Subject: [PATCH 009/215] Refactors /obj/item/apc_frame to /obj/item/frame/apc - This fixes broken APC frame placement on walls - #9537 --- code/game/objects/items/apc_frame.dm | 6 +++--- code/modules/materials/material_recipes.dm | 2 +- code/modules/power/apc.dm | 6 +++--- maps/exodus-1.dmm | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/code/game/objects/items/apc_frame.dm b/code/game/objects/items/apc_frame.dm index 0f3fdde0d81..5847201cde2 100644 --- a/code/game/objects/items/apc_frame.dm +++ b/code/game/objects/items/apc_frame.dm @@ -1,19 +1,19 @@ // APC HULL -/obj/item/apc_frame +/obj/item/frame/apc name = "\improper APC frame" desc = "Used for repairing or building APCs" icon = 'icons/obj/apc_repair.dmi' icon_state = "apc_frame" flags = CONDUCT -/obj/item/apc_frame/attackby(obj/item/weapon/W as obj, mob/user as mob) +/obj/item/frame/apc/attackby(obj/item/weapon/W as obj, mob/user as mob) ..() if (istype(W, /obj/item/weapon/wrench)) new /obj/item/stack/material/steel( get_turf(src.loc), 2 ) qdel(src) -/obj/item/apc_frame/proc/try_build(turf/on_wall) +/obj/item/frame/apc/try_build(turf/on_wall) if (get_dist(on_wall,usr)>1) return var/ndir = get_dir(usr,on_wall) diff --git a/code/modules/materials/material_recipes.dm b/code/modules/materials/material_recipes.dm index dd325942a05..c24490d6dbe 100644 --- a/code/modules/materials/material_recipes.dm +++ b/code/modules/materials/material_recipes.dm @@ -74,7 +74,7 @@ recipes += new/datum/stack_recipe("grenade casing", /obj/item/weapon/grenade/chem_grenade) recipes += new/datum/stack_recipe("light fixture frame", /obj/item/frame/light, 2) recipes += new/datum/stack_recipe("small light fixture frame", /obj/item/frame/light/small, 1) - recipes += new/datum/stack_recipe("apc frame", /obj/item/apc_frame, 2) + recipes += new/datum/stack_recipe("apc frame", /obj/item/frame/apc, 2) recipes += new/datum/stack_recipe("air alarm frame", /obj/item/frame/air_alarm, 2) recipes += new/datum/stack_recipe("fire alarm frame", /obj/item/frame/fire_alarm, 2) diff --git a/code/modules/power/apc.dm b/code/modules/power/apc.dm index 21f0f6c1a59..8b6771dff35 100644 --- a/code/modules/power/apc.dm +++ b/code/modules/power/apc.dm @@ -596,14 +596,14 @@ "You disassembled the broken APC frame.",\ "You hear welding.") else - new /obj/item/apc_frame(loc) + new /obj/item/frame/apc(loc) user.visible_message(\ "[src] has been cut from the wall by [user.name] with the weldingtool.",\ "You cut the APC frame from the wall.",\ "You hear welding.") qdel(src) return - else if (istype(W, /obj/item/apc_frame) && opened && emagged) + else if (istype(W, /obj/item/frame/apc) && opened && emagged) emagged = 0 if (opened==2) opened = 1 @@ -612,7 +612,7 @@ "You replace the damaged APC frontal panel with a new one.") qdel(W) update_icon() - else if (istype(W, /obj/item/apc_frame) && opened && ((stat & BROKEN) || hacker)) + else if (istype(W, /obj/item/frame/apc) && opened && ((stat & BROKEN) || hacker)) if (has_electronics) user << "You cannot repair this APC until you remove the electronics still inside." return diff --git a/maps/exodus-1.dmm b/maps/exodus-1.dmm index 2b5f781cfb2..87db3544118 100644 --- a/maps/exodus-1.dmm +++ b/maps/exodus-1.dmm @@ -4249,7 +4249,7 @@ "bDK" = (/obj/structure/disposalpipe/segment,/obj/machinery/door/airlock/glass_medical{id_tag = "GeneticsDoor"; name = "Genetics Laboratory"; req_access = list(9)},/turf/simulated/floor{icon_state = "white"},/area/medical/medbay2) "bDL" = (/turf/simulated/floor{icon_state = "white"},/area/medical/genetics_cloning) "bDM" = (/obj/machinery/disposal,/obj/structure/disposalpipe/trunk,/obj/item/device/radio/intercom{broadcasting = 0; name = "Station Intercom (General)"; pixel_y = 20},/turf/simulated/floor{icon_state = "white"},/area/medical/genetics_cloning) -"bDN" = (/obj/item/apc_frame,/obj/effect/decal/cleanable/dirt,/obj/structure/cable/green{d2 = 2; icon_state = "0-2"},/turf/simulated/floor/plating,/area/medical/genetics) +"bDN" = (/obj/item/frame/apc,/obj/effect/decal/cleanable/dirt,/obj/structure/cable/green{d2 = 2; icon_state = "0-2"},/turf/simulated/floor/plating,/area/medical/genetics) "bDO" = (/obj/structure/disposalpipe/segment,/turf/simulated/floor/plating,/area/medical/genetics) "bDP" = (/obj/machinery/door/firedoor,/obj/machinery/door/blast/shutters{density = 0; dir = 2; icon_state = "shutter0"; id = "acute1"; name = "EMT Storage Privacy Shutters"; opacity = 0},/obj/machinery/light_switch{pixel_x = 22; pixel_y = 0},/turf/simulated/floor{tag = "icon-whitebluefull"; icon_state = "whitebluefull"},/area/medical/sleeper) "bDQ" = (/obj/structure/table/standard,/obj/item/device/mmi,/obj/item/device/mmi,/obj/item/device/mmi,/turf/simulated/floor,/area/assembly/robotics) From 0135051498b00883e6a70686c513b5cbeb330124 Mon Sep 17 00:00:00 2001 From: Atlantis Date: Sun, 7 Jun 2015 06:43:50 +0200 Subject: [PATCH 010/215] Fixes #9706 - Adds checks whether the turf exists. This should prevent runtimes. - Moves ..() call in food/snacks/grown after seed.thrown_at() call. I believe this was causing the runtime in first place. --- code/modules/hydroponics/grown.dm | 2 +- code/modules/hydroponics/seed.dm | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/code/modules/hydroponics/grown.dm b/code/modules/hydroponics/grown.dm index 8b7678f19f6..931ce29d196 100644 --- a/code/modules/hydroponics/grown.dm +++ b/code/modules/hydroponics/grown.dm @@ -167,8 +167,8 @@ return /obj/item/weapon/reagent_containers/food/snacks/grown/throw_impact(atom/hit_atom) - ..() if(seed) seed.thrown_at(src,hit_atom) + ..() /obj/item/weapon/reagent_containers/food/snacks/grown/attackby(var/obj/item/weapon/W, var/mob/user) diff --git a/code/modules/hydroponics/seed.dm b/code/modules/hydroponics/seed.dm index 9fd666fbb6d..59bc3481d95 100644 --- a/code/modules/hydroponics/seed.dm +++ b/code/modules/hydroponics/seed.dm @@ -229,7 +229,8 @@ for(var/mob/living/M in T.contents) apply_special_effect(M) splatter(T,thrown) - origin_turf.visible_message("The [thrown.name] explodes!") + if(origin_turf) + origin_turf.visible_message("The [thrown.name] explodes!") qdel(thrown) return @@ -242,7 +243,8 @@ if(get_trait(TRAIT_JUICY) && splatted) splatter(origin_turf,thrown) - origin_turf.visible_message("The [thrown.name] splatters against [target]!") + if(origin_turf) + origin_turf.visible_message("The [thrown.name] splatters against [target]!") qdel(thrown) /datum/seed/proc/handle_environment(var/turf/current_turf, var/datum/gas_mixture/environment, var/light_supplied, var/check_only) From dc3c2991bfa29ac5a4e4a4ae530ed3415475d7bb Mon Sep 17 00:00:00 2001 From: PsiOmega Date: Sun, 7 Jun 2015 09:14:23 +0200 Subject: [PATCH 011/215] Replaces numbers with constants. --- code/game/gamemodes/meteor/meteors.dm | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/code/game/gamemodes/meteor/meteors.dm b/code/game/gamemodes/meteor/meteors.dm index 544a0462511..6f5e6ab7322 100644 --- a/code/game/gamemodes/meteor/meteors.dm +++ b/code/game/gamemodes/meteor/meteors.dm @@ -45,16 +45,16 @@ var/starty var/startx switch(startSide) - if(1) //NORTH + if(NORTH) starty = world.maxy-(TRANSITIONEDGE+1) startx = rand((TRANSITIONEDGE+1), world.maxx-(TRANSITIONEDGE+1)) - if(2) //EAST + if(EAST) starty = rand((TRANSITIONEDGE+1),world.maxy-(TRANSITIONEDGE+1)) startx = world.maxx-(TRANSITIONEDGE+1) - if(3) //SOUTH + if(SOUTH) starty = (TRANSITIONEDGE+1) startx = rand((TRANSITIONEDGE+1), world.maxx-(TRANSITIONEDGE+1)) - if(4) //WEST + if(WEST) starty = rand((TRANSITIONEDGE+1), world.maxy-(TRANSITIONEDGE+1)) startx = (TRANSITIONEDGE+1) var/turf/T = locate(startx, starty, Z) @@ -64,16 +64,16 @@ var/endy var/endx switch(startSide) - if(1) //NORTH + if(NORTH) endy = TRANSITIONEDGE endx = rand(TRANSITIONEDGE, world.maxx-TRANSITIONEDGE) - if(2) //EAST + if(EAST) endy = rand(TRANSITIONEDGE, world.maxy-TRANSITIONEDGE) endx = TRANSITIONEDGE - if(3) //SOUTH + if(SOUTH) endy = world.maxy-TRANSITIONEDGE endx = rand(TRANSITIONEDGE, world.maxx-TRANSITIONEDGE) - if(4) //WEST + if(WEST) endy = rand(TRANSITIONEDGE,world.maxy-TRANSITIONEDGE) endx = world.maxx-TRANSITIONEDGE var/turf/T = locate(endx, endy, Z) From 26e5734e93545b4eca0f21f60164ceddf321760f Mon Sep 17 00:00:00 2001 From: PsiOmega Date: Sun, 7 Jun 2015 13:24:36 +0200 Subject: [PATCH 012/215] The AI screen now glows. With the color depending on the chosen display screen. --- baystation12.dme | 2 + code/modules/mob/living/silicon/ai/ai.dm | 228 ++++---------------- code/modules/mob/living/silicon/ai/death.dm | 8 +- code/modules/mob/living/silicon/ai/icons.dm | 155 +++++++++++++ code/modules/mob/living/silicon/ai/life.dm | 6 +- code/modules/mob/living/silicon/ai/malf.dm | 140 ++++++++++++ 6 files changed, 343 insertions(+), 196 deletions(-) create mode 100644 code/modules/mob/living/silicon/ai/icons.dm create mode 100644 code/modules/mob/living/silicon/ai/malf.dm diff --git a/baystation12.dme b/baystation12.dme index 370edab8425..333a87029f4 100644 --- a/baystation12.dme +++ b/baystation12.dme @@ -1255,11 +1255,13 @@ #include "code\modules\mob\living\silicon\ai\ai.dm" #include "code\modules\mob\living\silicon\ai\death.dm" #include "code\modules\mob\living\silicon\ai\examine.dm" +#include "code\modules\mob\living\silicon\ai\icons.dm" #include "code\modules\mob\living\silicon\ai\latejoin.dm" #include "code\modules\mob\living\silicon\ai\laws.dm" #include "code\modules\mob\living\silicon\ai\life.dm" #include "code\modules\mob\living\silicon\ai\login.dm" #include "code\modules\mob\living\silicon\ai\logout.dm" +#include "code\modules\mob\living\silicon\ai\malf.dm" #include "code\modules\mob\living\silicon\decoy\death.dm" #include "code\modules\mob\living\silicon\decoy\decoy.dm" #include "code\modules\mob\living\silicon\decoy\life.dm" diff --git a/code/modules/mob/living/silicon/ai/ai.dm b/code/modules/mob/living/silicon/ai/ai.dm index c0df651d4b9..fb92fa18173 100644 --- a/code/modules/mob/living/silicon/ai/ai.dm +++ b/code/modules/mob/living/silicon/ai/ai.dm @@ -55,7 +55,6 @@ var/list/ai_verbs_default = list( var/obj/item/device/pda/ai/aiPDA = null var/obj/item/device/multitool/aiMulti = null var/obj/item/device/radio/headset/heads/ai_integrated/aiRadio = null - var/custom_sprite = 0 //For our custom sprites var/camera_light_on = 0 //Defines if the AI toggled the light on the camera it's looking through. var/datum/trackable/track = null var/last_announcement = "" @@ -80,6 +79,9 @@ var/list/ai_verbs_default = list( var/override_CPUStorage = 0 // Bonus/Penalty CPU Storage. For use by admins/testers. var/override_CPURate = 0 // Bonus/Penalty CPU generation rate. For use by admins/testers. + var/datum/ai_icon/selected_sprite // The selected icon set + var/custom_sprite = 0 // Whether the selected icon is custom + /mob/living/silicon/ai/proc/add_ai_verbs() src.verbs |= ai_verbs_default @@ -196,12 +198,34 @@ var/list/ai_verbs_default = list( src << "These laws may be changed by other players, or by you being the traitor." job = "AI" + setup_icon() /mob/living/silicon/ai/Destroy() ai_list -= src qdel(eyeobj) ..() +/mob/living/silicon/ai/proc/setup_icon() + var/file = file2text("config/custom_sprites.txt") + var/lines = text2list(file, "\n") + + for(var/line in lines) + // split & clean up + var/list/Entry = text2list(line, ":") + for(var/i = 1 to Entry.len) + Entry[i] = trim(Entry[i]) + + if(Entry.len < 2) + continue; + + if(Entry[1] == src.ckey && Entry[2] == src.real_name) + icon = CUSTOM_ITEM_SYNTH + custom_sprite = 1 + selected_sprite = new/datum/ai_icon("Custom", "[src.ckey]-ai", "4", "[ckey]-ai-crash", "#FFFFFF", "#FFFFFF", "#FFFFFF") + else + selected_sprite = default_ai_icon + updateicon() + /mob/living/silicon/ai/pointed(atom/A as mob|obj|turf in view()) set popup_menu = 0 set src = usr.contents @@ -263,57 +287,11 @@ var/list/ai_verbs_default = list( set name = "Set AI Core Display" if(stat || aiRestorePowerRoutine) return - if(!custom_sprite) //Check to see if custom sprite time, checking the appopriate file to change a var - var/file = file2text("config/custom_sprites.txt") - var/lines = text2list(file, "\n") - - for(var/line in lines) - // split & clean up - var/list/Entry = text2list(line, ":") - for(var/i = 1 to Entry.len) - Entry[i] = trim(Entry[i]) - - if(Entry.len < 2) - continue; - - if(Entry[1] == src.ckey && Entry[2] == src.real_name) - custom_sprite = 1 //They're in the list? Custom sprite time - icon = CUSTOM_ITEM_SYNTH - - //if(icon_state == initial(icon_state)) - var/icontype = "" - if (custom_sprite == 1) icontype = ("Custom")//automagically selects custom sprite if one is available - else icontype = input("Select an icon!", "AI", null, null) in list("Monochrome", "Rainbow", "Blue", "Inverted", "Text", "Smiley", "Angry", "Dorf", "Matrix", "Bliss", "Firewall", "Green", "Red", "Static", "Triumvirate", "Triumvirate Static", "Soviet", "Trapped", "Heartline", "Chatterbox", "Helios", "Dug Too Deep", "Goon", "Database", "Glitchman", "Lonestar", "Nanotrasen") - switch(icontype) - if("Custom") icon_state = "[src.ckey]-ai" - if("Rainbow") icon_state = "ai-clown" - if("Monochrome") icon_state = "ai-mono" - if("Inverted") icon_state = "ai-u" - if("Firewall") icon_state = "ai-magma" - if("Green") icon_state = "ai-wierd" - if("Red") icon_state = "ai-red" - if("Static") icon_state = "ai-static" - if("Text") icon_state = "ai-text" - if("Smiley") icon_state = "ai-smiley" - if("Matrix") icon_state = "ai-matrix" - if("Angry") icon_state = "ai-angryface" - if("Dorf") icon_state = "ai-dorf" - if("Bliss") icon_state = "ai-bliss" - if("Triumvirate") icon_state = "ai-triumvirate" - if("Triumvirate Static") icon_state = "ai-triumvirate-malf" - if("Soviet") icon_state = "ai-redoctober" - if("Trapped") icon_state = "ai-hades" - if("Heartline") icon_state = "ai-heartline" - if("Chatterbox") icon_state = "ai-president" - if("Helios") icon_state = "ai-helios" - if("Dug Too Deep") icon_state = "ai-toodeep" - if("Goon") icon_state = "ai-goon" - if("Database") icon_state = "ai-database" - if("Glitchman") icon_state = "ai-glitchman" - if("Lonestar") icon_state = "ai-lonestar" - if("Nanotrasen") icon_state = "ai-nanotrasen" - else icon_state = "ai" + if (!custom_sprite) + var/new_sprite = input("Select an icon!", "AI", selected_sprite) as null|anything in ai_icons + if(new_sprite) selected_sprite = new_sprite + updateicon() // this verb lets the ai see the stations manifest /mob/living/silicon/ai/proc/ai_roster() @@ -701,146 +679,18 @@ var/list/ai_verbs_default = list( return ..() -// NEWMALF FUNCTIONS/PROCEDURES +/mob/living/silicon/ai/updateicon() + if(!selected_sprite) selected_sprite = default_ai_icon -// Sets up malfunction-related variables, research system and such. -/mob/living/silicon/ai/proc/setup_for_malf() - var/mob/living/silicon/ai/user = src - // Setup Variables - malfunctioning = 1 - research = new/datum/malf_research() - research.owner = src - hacked_apcs = list() - recalc_cpu() - - verbs += new/datum/game_mode/malfunction/verb/ai_select_hardware() - verbs += new/datum/game_mode/malfunction/verb/ai_select_research() - verbs += new/datum/game_mode/malfunction/verb/ai_help() - - // And greet user with some OOC info. - user << "You are malfunctioning, you do not have to follow any laws." - user << "Use ai-help command to view relevant information about your abilities" - -// Safely remove malfunction status, fixing hacked APCs and resetting variables. -/mob/living/silicon/ai/proc/stop_malf() - var/mob/living/silicon/ai/user = src - // Generic variables - malfunctioning = 0 - sleep(10) - research = null - // Fix hacked APCs - if(hacked_apcs) - for(var/obj/machinery/power/apc/A in hacked_apcs) - A.hacker = null - hacked_apcs = null - // Reset our verbs - src.verbs = null - add_ai_verbs() - // Let them know. - user << "You are no longer malfunctioning. Your abilities have been removed." - -// Called every tick. Checks if AI is malfunctioning. If yes calls Process on research datum which handles all logic. -/mob/living/silicon/ai/proc/malf_process() - if(!malfunctioning) - return - if(!research) - if(!errored) - errored = 1 - error("malf_process() called on AI without research datum. Report this.") - message_admins("ERROR: malf_process() called on AI without research datum. If admin modified one of the AI's vars revert the change and don't modify variables directly, instead use ProcCall or admin panels.") - spawn(1200) - errored = 0 - return - recalc_cpu() - if(APU_power || aiRestorePowerRoutine != 0) - research.process(1) + if(stat == DEAD) + icon_state = selected_sprite.dead_icon + set_light(3, 1, selected_sprite.dead_light) + else if(aiRestorePowerRoutine) + icon_state = selected_sprite.nopower_icon + set_light(1, 1, selected_sprite.nopower_light) else - research.process(0) - -// Recalculates CPU time gain and storage capacities. -/mob/living/silicon/ai/proc/recalc_cpu() - // AI Starts with these values. - var/cpu_gain = 0.01 - var/cpu_storage = 10 - - // Off-Station APCs should not count towards CPU generation. - for(var/obj/machinery/power/apc/A in hacked_apcs) - if(A.z in config.station_levels) - cpu_gain += 0.002 - cpu_storage += 10 - - research.max_cpu = cpu_storage + override_CPUStorage - if(hardware && istype(hardware, /datum/malf_hardware/dual_ram)) - research.max_cpu = research.max_cpu * 1.5 - research.stored_cpu = min(research.stored_cpu, research.max_cpu) - - research.cpu_increase_per_tick = cpu_gain + override_CPURate - if(hardware && istype(hardware, /datum/malf_hardware/dual_cpu)) - research.cpu_increase_per_tick = research.cpu_increase_per_tick * 2 - -// Starts AI's APU generator -/mob/living/silicon/ai/proc/start_apu(var/shutup = 0) - if(!hardware || !istype(hardware, /datum/malf_hardware/apu_gen)) - if(!shutup) - src << "You do not have an APU generator and you shouldn't have this verb. Report this." - return - if(hardware_integrity() < 50) - if(!shutup) - src << "Starting APU... FAULT(System Damaged)" - return - if(!shutup) - src << "Starting APU... ONLINE" - APU_power = 1 - -// Stops AI's APU generator -/mob/living/silicon/ai/proc/stop_apu(var/shutup = 0) - if(!hardware || !istype(hardware, /datum/malf_hardware/apu_gen)) - return - - if(APU_power) - APU_power = 0 - if(!shutup) - src << "Shutting down APU... DONE" - -// Returns percentage of AI's remaining backup capacitor charge (maxhealth - oxyloss). -/mob/living/silicon/ai/proc/backup_capacitor() - return ((200 - getOxyLoss()) / 2) - -// Returns percentage of AI's remaining hardware integrity (maxhealth - (bruteloss + fireloss)) -/mob/living/silicon/ai/proc/hardware_integrity() - return (health-config.health_threshold_dead)/2 - -// Shows capacitor charge and hardware integrity information to the AI in Status tab. -/mob/living/silicon/ai/show_system_integrity() - if(!src.stat) - stat(null, text("Hardware integrity: [hardware_integrity()]%")) - stat(null, text("Internal capacitor: [backup_capacitor()]%")) - else - stat(null, text("Systems nonfunctional")) - -// Shows AI Malfunction related information to the AI. -/mob/living/silicon/ai/show_malf_ai() - if(src.is_malf()) - if(src.hacked_apcs) - stat(null, "Hacked APCs: [src.hacked_apcs.len]") - stat(null, "System Status: [src.hacking ? "Busy" : "Stand-By"]") - if(src.research) - stat(null, "Available CPU: [src.research.stored_cpu] TFlops") - stat(null, "Maximal CPU: [src.research.max_cpu] TFlops") - stat(null, "CPU generation rate: [src.research.cpu_increase_per_tick] TFlops/s") - stat(null, "Current research focus: [src.research.focus ? src.research.focus.name : "None"]") - if(src.research.focus) - stat(null, "Research completed: [round(src.research.focus.invested, 0.1)]/[round(src.research.focus.price)]") - if(system_override == 1) - stat(null, "SYSTEM OVERRIDE INITIATED") - else if(system_override == 2) - stat(null, "SYSTEM OVERRIDE COMPLETED") - -// Cleaner proc for creating powersupply for an AI. -/mob/living/silicon/ai/proc/create_powersupply() - if(psupply) - del(psupply) - psupply = new/obj/machinery/ai_powersupply(src) + icon_state = selected_sprite.alive_icon + set_light(1, 1, selected_sprite.alive_light) #undef AI_CHECK_WIRELESS #undef AI_CHECK_RADIO diff --git a/code/modules/mob/living/silicon/ai/death.dm b/code/modules/mob/living/silicon/ai/death.dm index 5c453966fca..0c33834db74 100644 --- a/code/modules/mob/living/silicon/ai/death.dm +++ b/code/modules/mob/living/silicon/ai/death.dm @@ -3,11 +3,6 @@ if(stat == DEAD) return - if (src.custom_sprite == 1)//check for custom AI sprite, defaulting to blue screen if no. - icon_state = "[ckey]-ai-crash" - else - icon_state = "ai-crash" - if(src.eyeobj) src.eyeobj.setLoc(get_turf(src)) @@ -20,4 +15,5 @@ var/obj/item/device/aicard/card = loc card.update_icon() - return ..(gibbed,"gives one shrill beep before falling lifeless.") + . = ..(gibbed,"gives one shrill beep before falling lifeless.") + density = 1 diff --git a/code/modules/mob/living/silicon/ai/icons.dm b/code/modules/mob/living/silicon/ai/icons.dm new file mode 100644 index 00000000000..83689c9dd4d --- /dev/null +++ b/code/modules/mob/living/silicon/ai/icons.dm @@ -0,0 +1,155 @@ +var/datum/ai_icon/default_ai_icon = new/datum/ai_icon/blue() +var/list/datum/ai_icon/ai_icons + +/datum/ai_icon + var/name + var/alive_icon + var/alive_light = "#FFFFFF" + var/nopower_icon = "4" + var/nopower_light = "#FFFFFF" + var/dead_icon = "ai-crash" + var/dead_light = "#000099" + +/datum/ai_icon/New(var/name, var/alive_icon, var/nopower_icon, var/dead_icon, var/alive_light, var/nopower_light, var/dead_light) + if(name) + src.name = name + src.alive_icon = alive_icon + src.nopower_icon = nopower_icon + src.dead_icon = dead_icon + src.alive_light = alive_light + src.nopower_light = nopower_light + src.dead_light = dead_light + if(!ai_icons) + ai_icons = list() + init_subtypes(/datum/ai_icon, ai_icons) + ..() + +/datum/ai_icon/red + name = "Red" + alive_icon = "ai-red" + alive_light = "#F04848" + +/datum/ai_icon/green + name = "Green" + alive_icon = "ai-wierd" + alive_light = "#00FF99" + +/datum/ai_icon/blue + name = "Blue" + alive_icon = "ai" + alive_light = "#81DDFF" + +/datum/ai_icon/angry + name = "Angry" + alive_icon = "ai-angryface" + alive_light = "#FFFF33" + +/datum/ai_icon/bliss + name = "Bliss" + alive_icon = "ai-bliss" + alive_light = "#5C7A4A" + +/datum/ai_icon/chatterbox + name = "Chatterbox" + alive_icon = "ai-president" + alive_light = "#40666B" + +/datum/ai_icon/database + name = "Database" + alive_icon = "ai-database" + +/datum/ai_icon/dorf + name = "Dorf" + alive_icon = "ai-dorf" + +/datum/ai_icon/dugtodeep + name = "Dug Too Deep" + alive_icon = "ai-toodeep" + alive_light = "#81DDFF" + +/datum/ai_icon/firewall + name = "Firewall" + alive_icon = "ai-magma" + alive_light = "#FF4126" + +/datum/ai_icon/glitchman + name = "Glitchman" + alive_icon = "ai-glitchman" + +/datum/ai_icon/goon + name = "Goon" + alive_icon = "ai-goon" + alive_light = "#3E5C80" + +/datum/ai_icon/heartline + name = "Heartline" + alive_icon = "ai-heartline" + dead_icon = "ai-heartline_dead" + +/datum/ai_icon/helios + name = "Helios" + alive_icon = "ai-helios" + alive_light = "#F2CF73" + +/datum/ai_icon/inverted + name = "Inverted" + alive_icon = "ai-u" + alive_light = "#81DDFF" + +/datum/ai_icon/lonestar + name = "Lonestar" + alive_icon = "ai-lonestar" + alive_light = "#58751C" + +/datum/ai_icon/matrix + name = "Matrix" + alive_icon = "ai-matrix" + alive_light = "#449944" + +/datum/ai_icon/monochrome + name = "Monochrome" + alive_icon = "ai-mono" + alive_light = "#585858" + +/datum/ai_icon/nanotrasen + name = "Nanotrasen" + alive_icon = "ai-nanotrasen" + alive_light = "#000029" + +/datum/ai_icon/rainbow + name = "Rainbow" + alive_icon = "ai-clown" + alive_light = "#E50213" + +/datum/ai_icon/smiley + name = "Smiley" + alive_icon = "ai-smiley" + alive_light = "#F3DD00" + +/datum/ai_icon/soviet + name = "Soviet" + alive_icon = "ai-redoctober" + alive_light = "#FF4307" + +/datum/ai_icon/Static + name = "Static" + alive_icon = "ai-static" + alive_light = "#4784C1" + +/datum/ai_icon/text + name = "Text" + alive_icon = "ai-text" + +/datum/ai_icon/trapped + name = "Trapped" + alive_icon = "ai-hades" + +/datum/ai_icon/triumvirate_static + name = "Triumvirate" + alive_icon = "ai-triumvirate" + alive_light = "#020B2B" + +/datum/ai_icon/triumvirate_static + name = "Triumvirate Static" + alive_icon = "ai-static" + alive_light = "#020B2B" diff --git a/code/modules/mob/living/silicon/ai/life.dm b/code/modules/mob/living/silicon/ai/life.dm index 5e0b0589c53..84d3cfd2298 100644 --- a/code/modules/mob/living/silicon/ai/life.dm +++ b/code/modules/mob/living/silicon/ai/life.dm @@ -61,15 +61,18 @@ src << "Alert cancelled. Power has been restored without our assistance." aiRestorePowerRoutine = 0 src.blind.layer = 0 + updateicon() return else if (aiRestorePowerRoutine==3) src << "Alert cancelled. Power has been restored." aiRestorePowerRoutine = 0 src.blind.layer = 0 + updateicon() return else if (APU_power) aiRestorePowerRoutine = 0 src.blind.layer = 0 + updateicon() return else var/area/current_area = get_area(src) @@ -79,7 +82,7 @@ aiRestorePowerRoutine = 1 //Blind the AI - + updateicon() src.blind.screen_loc = "1,1 to 15,15" if (src.blind.layer!=18) src.blind.layer = 18 @@ -147,6 +150,7 @@ aiRestorePowerRoutine = 3 src << "Here are your current laws:" show_laws() + updateicon() sleep(50) theAPC = null diff --git a/code/modules/mob/living/silicon/ai/malf.dm b/code/modules/mob/living/silicon/ai/malf.dm new file mode 100644 index 00000000000..0510a04535d --- /dev/null +++ b/code/modules/mob/living/silicon/ai/malf.dm @@ -0,0 +1,140 @@ +// NEWMALF FUNCTIONS/PROCEDURES + +// Sets up malfunction-related variables, research system and such. +/mob/living/silicon/ai/proc/setup_for_malf() + var/mob/living/silicon/ai/user = src + // Setup Variables + malfunctioning = 1 + research = new/datum/malf_research() + research.owner = src + hacked_apcs = list() + recalc_cpu() + + verbs += new/datum/game_mode/malfunction/verb/ai_select_hardware() + verbs += new/datum/game_mode/malfunction/verb/ai_select_research() + verbs += new/datum/game_mode/malfunction/verb/ai_help() + + // And greet user with some OOC info. + user << "You are malfunctioning, you do not have to follow any laws." + user << "Use ai-help command to view relevant information about your abilities" + +// Safely remove malfunction status, fixing hacked APCs and resetting variables. +/mob/living/silicon/ai/proc/stop_malf() + var/mob/living/silicon/ai/user = src + // Generic variables + malfunctioning = 0 + sleep(10) + research = null + // Fix hacked APCs + if(hacked_apcs) + for(var/obj/machinery/power/apc/A in hacked_apcs) + A.hacker = null + hacked_apcs = null + // Reset our verbs + src.verbs = null + add_ai_verbs() + // Let them know. + user << "You are no longer malfunctioning. Your abilities have been removed." + +// Called every tick. Checks if AI is malfunctioning. If yes calls Process on research datum which handles all logic. +/mob/living/silicon/ai/proc/malf_process() + if(!malfunctioning) + return + if(!research) + if(!errored) + errored = 1 + error("malf_process() called on AI without research datum. Report this.") + message_admins("ERROR: malf_process() called on AI without research datum. If admin modified one of the AI's vars revert the change and don't modify variables directly, instead use ProcCall or admin panels.") + spawn(1200) + errored = 0 + return + recalc_cpu() + if(APU_power || aiRestorePowerRoutine != 0) + research.process(1) + else + research.process(0) + +// Recalculates CPU time gain and storage capacities. +/mob/living/silicon/ai/proc/recalc_cpu() + // AI Starts with these values. + var/cpu_gain = 0.01 + var/cpu_storage = 10 + + // Off-Station APCs should not count towards CPU generation. + for(var/obj/machinery/power/apc/A in hacked_apcs) + if(A.z in config.station_levels) + cpu_gain += 0.002 + cpu_storage += 10 + + research.max_cpu = cpu_storage + override_CPUStorage + if(hardware && istype(hardware, /datum/malf_hardware/dual_ram)) + research.max_cpu = research.max_cpu * 1.5 + research.stored_cpu = min(research.stored_cpu, research.max_cpu) + + research.cpu_increase_per_tick = cpu_gain + override_CPURate + if(hardware && istype(hardware, /datum/malf_hardware/dual_cpu)) + research.cpu_increase_per_tick = research.cpu_increase_per_tick * 2 + +// Starts AI's APU generator +/mob/living/silicon/ai/proc/start_apu(var/shutup = 0) + if(!hardware || !istype(hardware, /datum/malf_hardware/apu_gen)) + if(!shutup) + src << "You do not have an APU generator and you shouldn't have this verb. Report this." + return + if(hardware_integrity() < 50) + if(!shutup) + src << "Starting APU... FAULT(System Damaged)" + return + if(!shutup) + src << "Starting APU... ONLINE" + APU_power = 1 + +// Stops AI's APU generator +/mob/living/silicon/ai/proc/stop_apu(var/shutup = 0) + if(!hardware || !istype(hardware, /datum/malf_hardware/apu_gen)) + return + + if(APU_power) + APU_power = 0 + if(!shutup) + src << "Shutting down APU... DONE" + +// Returns percentage of AI's remaining backup capacitor charge (maxhealth - oxyloss). +/mob/living/silicon/ai/proc/backup_capacitor() + return ((200 - getOxyLoss()) / 2) + +// Returns percentage of AI's remaining hardware integrity (maxhealth - (bruteloss + fireloss)) +/mob/living/silicon/ai/proc/hardware_integrity() + return (health-config.health_threshold_dead)/2 + +// Shows capacitor charge and hardware integrity information to the AI in Status tab. +/mob/living/silicon/ai/show_system_integrity() + if(!src.stat) + stat(null, text("Hardware integrity: [hardware_integrity()]%")) + stat(null, text("Internal capacitor: [backup_capacitor()]%")) + else + stat(null, text("Systems nonfunctional")) + +// Shows AI Malfunction related information to the AI. +/mob/living/silicon/ai/show_malf_ai() + if(src.is_malf()) + if(src.hacked_apcs) + stat(null, "Hacked APCs: [src.hacked_apcs.len]") + stat(null, "System Status: [src.hacking ? "Busy" : "Stand-By"]") + if(src.research) + stat(null, "Available CPU: [src.research.stored_cpu] TFlops") + stat(null, "Maximal CPU: [src.research.max_cpu] TFlops") + stat(null, "CPU generation rate: [src.research.cpu_increase_per_tick] TFlops/s") + stat(null, "Current research focus: [src.research.focus ? src.research.focus.name : "None"]") + if(src.research.focus) + stat(null, "Research completed: [round(src.research.focus.invested, 0.1)]/[round(src.research.focus.price)]") + if(system_override == 1) + stat(null, "SYSTEM OVERRIDE INITIATED") + else if(system_override == 2) + stat(null, "SYSTEM OVERRIDE COMPLETED") + +// Cleaner proc for creating powersupply for an AI. +/mob/living/silicon/ai/proc/create_powersupply() + if(psupply) + del(psupply) + psupply = new/obj/machinery/ai_powersupply(src) From 9be20905a7fc14148652c8c0fd7290365f1c7202 Mon Sep 17 00:00:00 2001 From: PsiOmega Date: Sun, 7 Jun 2015 13:48:44 +0200 Subject: [PATCH 013/215] Changelog entry. --- html/changelogs/PsiOmegaDelta-AIGlow.yml | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 html/changelogs/PsiOmegaDelta-AIGlow.yml diff --git a/html/changelogs/PsiOmegaDelta-AIGlow.yml b/html/changelogs/PsiOmegaDelta-AIGlow.yml new file mode 100644 index 00000000000..3f15bf26f77 --- /dev/null +++ b/html/changelogs/PsiOmegaDelta-AIGlow.yml @@ -0,0 +1,4 @@ +author: PsiOmegaDelta +delete-after: True +changes: + - rscadd: "The AI chassis now glows, with the color depending on the currently selected display." \ No newline at end of file From 9f93abbaf3e32dccbef8fbc2fedb2612985192a0 Mon Sep 17 00:00:00 2001 From: Techhead0 Date: Sun, 7 Jun 2015 12:31:55 -0400 Subject: [PATCH 014/215] Removes Beehive and Pompadours from Unathi hairstyles. As per Unathi Loremaster Ikky's request. Tested to not corrupt savefiles. --- code/modules/mob/new_player/sprite_accessories.dm | 2 -- 1 file changed, 2 deletions(-) diff --git a/code/modules/mob/new_player/sprite_accessories.dm b/code/modules/mob/new_player/sprite_accessories.dm index 240093fec91..37f0f29803d 100644 --- a/code/modules/mob/new_player/sprite_accessories.dm +++ b/code/modules/mob/new_player/sprite_accessories.dm @@ -136,7 +136,6 @@ name = "Pompadour" icon_state = "hair_pompadour" gender = MALE - species_allowed = list("Human","Unathi") quiff name = "Quiff" @@ -159,7 +158,6 @@ name = "Beehive" icon_state = "hair_beehive" gender = FEMALE - species_allowed = list("Human","Unathi") beehive2 name = "Beehive 2" From ccb01cd4eddeec6d93dba16eae7e37a58132e817 Mon Sep 17 00:00:00 2001 From: zonthori Date: Sun, 7 Jun 2015 13:38:44 -0600 Subject: [PATCH 015/215] Fixes https://github.com/Baystation12/Baystation12/issues/9728 Fixes custom welding helmet sprites to break when toggled. https://github.com/Baystation12/Baystation12/issues/9728 --- code/modules/clothing/head/misc_special.dm | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/code/modules/clothing/head/misc_special.dm b/code/modules/clothing/head/misc_special.dm index 1a0052d3168..6f4e9b9a934 100644 --- a/code/modules/clothing/head/misc_special.dm +++ b/code/modules/clothing/head/misc_special.dm @@ -25,8 +25,11 @@ icon_action_button = "action_welding" siemens_coefficient = 0.9 w_class = 3 + var/base_state /obj/item/clothing/head/welding/attack_self() + if(!base_state) + base_state = icon_state toggle() @@ -40,13 +43,13 @@ src.up = !src.up src.flags |= (HEADCOVERSEYES | HEADCOVERSMOUTH) flags_inv |= (HIDEMASK|HIDEEARS|HIDEEYES|HIDEFACE) - icon_state = initial(icon_state) + icon_state = "[base_state]" usr << "You flip the [src] down to protect your eyes." else src.up = !src.up src.flags &= ~(HEADCOVERSEYES | HEADCOVERSMOUTH) flags_inv &= ~(HIDEMASK|HIDEEARS|HIDEEYES|HIDEFACE) - icon_state = "[initial(icon_state)]up" + icon_state = "[base_state]up" usr << "You push the [src] up out of your face." update_clothing_icon() //so our mob-overlays update From 98ca5466e2c401a61dd341349fab24efe1bd6191 Mon Sep 17 00:00:00 2001 From: zonthori Date: Sun, 7 Jun 2015 13:56:11 -0600 Subject: [PATCH 016/215] Straight base_state --- code/modules/clothing/head/misc_special.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/modules/clothing/head/misc_special.dm b/code/modules/clothing/head/misc_special.dm index 6f4e9b9a934..5b3485186ff 100644 --- a/code/modules/clothing/head/misc_special.dm +++ b/code/modules/clothing/head/misc_special.dm @@ -43,7 +43,7 @@ src.up = !src.up src.flags |= (HEADCOVERSEYES | HEADCOVERSMOUTH) flags_inv |= (HIDEMASK|HIDEEARS|HIDEEYES|HIDEFACE) - icon_state = "[base_state]" + icon_state = base_state usr << "You flip the [src] down to protect your eyes." else src.up = !src.up From cad9b59c25362b876a6586d68a2257da04acccb2 Mon Sep 17 00:00:00 2001 From: PsiOmegaDelta Date: Mon, 8 Jun 2015 09:10:33 +0200 Subject: [PATCH 017/215] AI restrictions and rejuvenation. Ensures the AI cannot use Topics() while unpowered. Ensures the AI is properly rejuvenated by the AI verb, as a functional AI will now never be lying down. --- code/modules/mob/living/silicon/ai/ai.dm | 12 ++++++++---- code/modules/mob/living/silicon/ai/life.dm | 7 ++++--- code/modules/nano/interaction/base.dm | 2 +- 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/code/modules/mob/living/silicon/ai/ai.dm b/code/modules/mob/living/silicon/ai/ai.dm index 9c874f54b17..ac626586ce9 100644 --- a/code/modules/mob/living/silicon/ai/ai.dm +++ b/code/modules/mob/living/silicon/ai/ai.dm @@ -678,16 +678,20 @@ var/list/ai_verbs_default = list( set desc = "Augment visual feed with internal sensor overlays" toggle_sensor_mode() -/mob/living/silicon/ai/proc/check_unable(var/flags = 0) +/mob/living/silicon/ai/proc/check_unable(var/flags = 0, var/feedback = 1) if(stat == DEAD) - src << "You are dead!" + if(feedback) src << "You are dead!" + return 1 + + if(aiRestorePowerRoutine) + if(feedback) src << "You lack power!" return 1 if((flags & AI_CHECK_WIRELESS) && src.control_disabled) - src << "Wireless control is disabled!" + if(feedback) src << "Wireless control is disabled!" return 1 if((flags & AI_CHECK_RADIO) && src.aiRadio.disabledAi) - src << "System Error - Transceiver Disabled!" + if(feedback) src << "System Error - Transceiver Disabled!" return 1 return 0 diff --git a/code/modules/mob/living/silicon/ai/life.dm b/code/modules/mob/living/silicon/ai/life.dm index 5e0b0589c53..ed8c650f7a9 100644 --- a/code/modules/mob/living/silicon/ai/life.dm +++ b/code/modules/mob/living/silicon/ai/life.dm @@ -1,5 +1,5 @@ /mob/living/silicon/ai/Life() - if (src.stat == 2) + if (src.stat == DEAD) return else //I'm not removing that shitton of tabs, unneeded as they are. -- Urist //Being dead doesn't mean your temperature never changes @@ -33,8 +33,8 @@ aiRestorePowerRoutine = 0 // Necessary if AI activated it's APU AFTER losing primary power. adjustOxyLoss(-1) - // Handle EMP-stun - handle_stunned() + handle_stunned() // Handle EMP-stun + lying = 0 // Handle lying down malf_process() @@ -176,3 +176,4 @@ /mob/living/silicon/ai/rejuvenate() ..() add_ai_verbs(src) + diff --git a/code/modules/nano/interaction/base.dm b/code/modules/nano/interaction/base.dm index 10cda75162e..602185bb8ab 100644 --- a/code/modules/nano/interaction/base.dm +++ b/code/modules/nano/interaction/base.dm @@ -21,7 +21,7 @@ /mob/living/silicon/ai/shared_nano_interaction() if(lacks_power()) return STATUS_CLOSE - if (check_unable(1)) + if (check_unable(1, 0)) return STATUS_CLOSE return ..() From 78647e06254a3c98fe5a15119ab5e83c28ce168e Mon Sep 17 00:00:00 2001 From: PsiOmegaDelta Date: Mon, 8 Jun 2015 09:58:06 +0200 Subject: [PATCH 018/215] Changelog update. --- html/changelog.html | 6 ++++++ html/changelogs/.all_changelog.yml | 4 ++++ html/changelogs/PsiOmegaDelta-AIGlow.yml | 4 ---- 3 files changed, 10 insertions(+), 4 deletions(-) delete mode 100644 html/changelogs/PsiOmegaDelta-AIGlow.yml diff --git a/html/changelog.html b/html/changelog.html index cb99a616023..c1b455e4bf7 100644 --- a/html/changelog.html +++ b/html/changelog.html @@ -56,6 +56,12 @@ -->
+

08 June 2015

+

PsiOmegaDelta updated:

+
    +
  • The AI chassis now glows, with the color depending on the currently selected display.
  • +
+

05 June 2015

PsiOmegaDelta updated:

    diff --git a/html/changelogs/.all_changelog.yml b/html/changelogs/.all_changelog.yml index af6233ae6ca..c5be3443a06 100644 --- a/html/changelogs/.all_changelog.yml +++ b/html/changelogs/.all_changelog.yml @@ -1963,3 +1963,7 @@ DO NOT EDIT THIS FILE BY HAND! AUTOMATICALLY GENERATED BY ss13_genchangelog.py. - tweak: Makes the special wizard projectile staffs, Animate, Change, Focus and any future ones only usable by wizards. Also makes it so only wizards can use spellbooks and teleportation scrolls. +2015-06-08: + PsiOmegaDelta: + - rscadd: The AI chassis now glows, with the color depending on the currently selected + display. diff --git a/html/changelogs/PsiOmegaDelta-AIGlow.yml b/html/changelogs/PsiOmegaDelta-AIGlow.yml deleted file mode 100644 index 3f15bf26f77..00000000000 --- a/html/changelogs/PsiOmegaDelta-AIGlow.yml +++ /dev/null @@ -1,4 +0,0 @@ -author: PsiOmegaDelta -delete-after: True -changes: - - rscadd: "The AI chassis now glows, with the color depending on the currently selected display." \ No newline at end of file From f2f34b9a3898959894e3637bd29d91d34f30821c Mon Sep 17 00:00:00 2001 From: Techhead0 Date: Mon, 8 Jun 2015 04:43:01 -0400 Subject: [PATCH 019/215] Minor tweaks to voidsuits. Component removal uses a dialogue box instead of removing items in a set order. Renames "Eject Tank" to avoid duplicate verb names. Changes order of components when equipping voidsuits. Two user message changes. --- code/modules/clothing/spacesuits/void/void.dm | 43 +++++++++++-------- 1 file changed, 24 insertions(+), 19 deletions(-) diff --git a/code/modules/clothing/spacesuits/void/void.dm b/code/modules/clothing/spacesuits/void/void.dm index 246f37c0e44..aef27243492 100644 --- a/code/modules/clothing/spacesuits/void/void.dm +++ b/code/modules/clothing/spacesuits/void/void.dm @@ -83,6 +83,10 @@ if(H.wear_suit != src) return + if(boots) + if (H.equip_to_slot_if_possible(boots, slot_shoes)) + boots.canremove = 0 + if(helmet) if(H.head) M << "You are unable to deploy your suit's helmet as \the [H.head] is in the way." @@ -90,10 +94,6 @@ M << "Your suit's helmet deploys with a hiss." helmet.canremove = 0 - if(boots) - if (H.equip_to_slot_if_possible(boots, slot_shoes)) - boots.canremove = 0 - if(tank) if(H.s_store) //In case someone finds a way. M << "Alarmingly, the valve on your suit's installed tank fails to engage." @@ -101,6 +101,7 @@ M << "The valve on your suit's installed tank safely engages." tank.canremove = 0 + /obj/item/clothing/suit/space/void/dropped() ..() @@ -151,7 +152,7 @@ helmet.loc = src else if(H.head) - H << "You cannot deploy your helmet while wearing another helmet." + H << "You cannot deploy your helmet while wearing \the [H.head]." return if(H.equip_to_slot_if_possible(helmet, slot_head)) helmet.pickup(H) @@ -161,7 +162,7 @@ /obj/item/clothing/suit/space/void/verb/eject_tank() - set name = "Eject Tank" + set name = "Eject Voidsuit Tank" set category = "Object" set src in usr @@ -187,22 +188,26 @@ if(!istype(user,/mob/living)) return if(istype(src.loc,/mob/living)) - user << "How do you propose to modify a hardsuit while it is being worn?" + user << "How do you propose to modify a voidsuit while it is being worn?" return if(istype(W,/obj/item/weapon/screwdriver)) - if(tank) - user << "You pop \the [tank] out of \the [src]'s storage compartment." - tank.loc = get_turf(src) - src.tank = null - else if(helmet) - user << "You detatch \the [helmet] from \the [src]'s helmet mount." - helmet.loc = get_turf(src) - src.helmet = null - else if (boots) - user << "You detatch \the [boots] from \the [src]'s boot mounts." - boots.loc = get_turf(src) - src.boots = null + if(helmet || boots || tank) + var/choice = input("What component would you like to remove?") as null|anything in list(helmet,boots,tank) + if(!choice) return + + if(choice == tank) //No, a switch doesn't work here. Sorry. ~Techhead + user << "You pop \the [tank] out of \the [src]'s storage compartment." + tank.loc = get_turf(src) + src.tank = null + else if(choice == helmet) + user << "You detatch \the [helmet] from \the [src]'s helmet mount." + helmet.loc = get_turf(src) + src.helmet = null + else if(choice == boots) + user << "You detatch \the [boots] from \the [src]'s boot mounts." + boots.loc = get_turf(src) + src.boots = null else user << "\The [src] does not have anything installed." return From 37f02ebc933cf6df47412928e974cff0c16927d7 Mon Sep 17 00:00:00 2001 From: Kelenius Date: Mon, 8 Jun 2015 12:41:58 +0300 Subject: [PATCH 020/215] Fixes #9738 - reagents always overdose --- code/modules/reagents/Chemistry-Reagents.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/modules/reagents/Chemistry-Reagents.dm b/code/modules/reagents/Chemistry-Reagents.dm index 0e0da75e2a6..f222b4b6b3b 100644 --- a/code/modules/reagents/Chemistry-Reagents.dm +++ b/code/modules/reagents/Chemistry-Reagents.dm @@ -38,7 +38,7 @@ return if(!affects_dead && M.stat == DEAD) return - if(overdose && (location == CHEM_BLOOD)) + if(overdose && (dose > overdose) && (location == CHEM_BLOOD)) overdose(M, alien) var/removed = metabolism if(ingest_met && (location == CHEM_INGEST)) From 364c2dc01a7aca1625c1367944681623a8aa47c5 Mon Sep 17 00:00:00 2001 From: Chinsky Date: Fri, 5 Jun 2015 13:18:27 +0300 Subject: [PATCH 021/215] Fixes typo. --- code/modules/mob/living/carbon/human/human.dm | 2 +- code/modules/organs/organ_external.dm | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index 9273c3372a0..120067144f0 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -41,7 +41,7 @@ ..() if(dna) - dna.ready_dna(new_character) + dna.ready_dna(src) dna.real_name = real_name sync_organ_dna() make_blood() diff --git a/code/modules/organs/organ_external.dm b/code/modules/organs/organ_external.dm index b7541153a50..3ff375faa11 100644 --- a/code/modules/organs/organ_external.dm +++ b/code/modules/organs/organ_external.dm @@ -613,7 +613,7 @@ Note that amputating the affected organ does in fact remove the infection from t //things tend to bleed if they are CUT OPEN if (open && !clamped && (H && !(H.species.flags & NO_BLOOD))) status |= ORGAN_BLEEDING - + //Bone fractures if(config.bones_can_break && brute_dam > min_broken_damage * config.organ_health_multiplier && !(status & ORGAN_ROBOT)) src.fracture() @@ -908,7 +908,7 @@ Note that amputating the affected organ does in fact remove the infection from t /obj/item/organ/external/proc/is_usable() if((status & ORGAN_ROBOT) && get_damage() >= max_damage) //robot limbs just become inoperable at max damage - return + return return !is_dislocated() && !(status & (ORGAN_DESTROYED|ORGAN_MUTATED|ORGAN_DEAD)) /obj/item/organ/external/proc/is_malfunctioning() @@ -1051,6 +1051,7 @@ Note that amputating the affected organ does in fact remove the infection from t if(6 to INFINITY) flavor_text += "a ton of [wound]\s" return english_list(flavor_text) + /**************************************************** ORGAN DEFINES ****************************************************/ From 20542bf84b28fd7e2f40b319c83c429500109c79 Mon Sep 17 00:00:00 2001 From: PsiOmegaDelta Date: Mon, 8 Jun 2015 17:00:11 +0200 Subject: [PATCH 022/215] NanoUI sources can now be datums instead of atom/movable. Also accidentally fixes #7042 as the AI no longer cares about the machinery var. --- code/game/machinery/computer/RCON_Console.dm | 2 +- code/game/machinery/computer/atmos_control.dm | 2 +- code/game/machinery/computer/crew.dm | 2 +- code/game/machinery/computer/station_alert.dm | 8 +++--- code/game/objects/structures/mirror.dm | 2 +- code/modules/admin/admin_verbs.dm | 2 +- .../mob/living/carbon/human/appearance.dm | 2 +- code/modules/mob/living/silicon/ai/life.dm | 4 --- code/modules/mob/living/silicon/subystems.dm | 12 ++++----- code/modules/nano/interaction/base.dm | 4 +-- code/modules/nano/modules/alarm_monitor.dm | 22 ++++++++-------- code/modules/nano/modules/atmos_control.dm | 26 +++++++++---------- code/modules/nano/modules/crew_monitor.dm | 11 +++----- code/modules/nano/modules/human_appearance.dm | 25 +++++++++--------- code/modules/nano/modules/law_manager.dm | 18 ++++++------- code/modules/nano/modules/nano_module.dm | 13 +++++++--- code/modules/nano/modules/power_monitor.dm | 10 +++---- code/modules/nano/modules/rcon.dm | 11 ++++---- code/modules/nano/nanoexternal.dm | 2 +- code/modules/nano/nanoui.dm | 4 +-- .../power/sensors/sensor_monitoring.dm | 2 +- 21 files changed, 89 insertions(+), 95 deletions(-) diff --git a/code/game/machinery/computer/RCON_Console.dm b/code/game/machinery/computer/RCON_Console.dm index cf275eb5ce8..17d0552779a 100644 --- a/code/game/machinery/computer/RCON_Console.dm +++ b/code/game/machinery/computer/RCON_Console.dm @@ -13,7 +13,7 @@ circuit = /obj/item/weapon/circuitboard/rcon_console req_one_access = list(access_engine) var/current_tag = null - var/obj/nano_module/rcon/rcon + var/datum/nano_module/rcon/rcon /obj/machinery/computer/rcon/New() ..() diff --git a/code/game/machinery/computer/atmos_control.dm b/code/game/machinery/computer/atmos_control.dm index 07b075a5f1b..46d27357501 100644 --- a/code/game/machinery/computer/atmos_control.dm +++ b/code/game/machinery/computer/atmos_control.dm @@ -12,7 +12,7 @@ circuit = "/obj/item/weapon/circuitboard/atmoscontrol" req_access = list(access_ce) var/list/monitored_alarm_ids = null - var/obj/nano_module/atmos_control/atmos_control + var/datum/nano_module/atmos_control/atmos_control /obj/machinery/computer/atmoscontrol/New() ..() diff --git a/code/game/machinery/computer/crew.dm b/code/game/machinery/computer/crew.dm index 6928d104ca7..6df502891f2 100644 --- a/code/game/machinery/computer/crew.dm +++ b/code/game/machinery/computer/crew.dm @@ -7,7 +7,7 @@ idle_power_usage = 250 active_power_usage = 500 circuit = "/obj/item/weapon/circuitboard/crew" - var/obj/nano_module/crew_monitor/crew_monitor + var/datum/nano_module/crew_monitor/crew_monitor /obj/machinery/computer/crew/New() crew_monitor = new(src) diff --git a/code/game/machinery/computer/station_alert.dm b/code/game/machinery/computer/station_alert.dm index 696273d2ab8..ea0952e9f71 100644 --- a/code/game/machinery/computer/station_alert.dm +++ b/code/game/machinery/computer/station_alert.dm @@ -5,15 +5,15 @@ icon_state = "alert:0" light_color = "#e6ffff" circuit = /obj/item/weapon/circuitboard/stationalert_engineering - var/obj/nano_module/alarm_monitor/alarm_monitor - var/monitor_type = /obj/nano_module/alarm_monitor/engineering + var/datum/nano_module/alarm_monitor/alarm_monitor + var/monitor_type = /datum/nano_module/alarm_monitor/engineering /obj/machinery/computer/station_alert/security - monitor_type = /obj/nano_module/alarm_monitor/security + monitor_type = /datum/nano_module/alarm_monitor/security circuit = /obj/item/weapon/circuitboard/stationalert_security /obj/machinery/computer/station_alert/all - monitor_type = /obj/nano_module/alarm_monitor/all + monitor_type = /datum/nano_module/alarm_monitor/all circuit = /obj/item/weapon/circuitboard/stationalert_all /obj/machinery/computer/station_alert/New() diff --git a/code/game/objects/structures/mirror.dm b/code/game/objects/structures/mirror.dm index 8141dcf5a39..acae4725546 100644 --- a/code/game/objects/structures/mirror.dm +++ b/code/game/objects/structures/mirror.dm @@ -14,7 +14,7 @@ if(shattered) return if(ishuman(user)) - var/obj/nano_module/appearance_changer/AC = ui_users[user] + var/datum/nano_module/appearance_changer/AC = ui_users[user] if(!AC) AC = new(src, user) AC.name = "SalonPro Nano-Mirror(TM)" diff --git a/code/modules/admin/admin_verbs.dm b/code/modules/admin/admin_verbs.dm index af1e049b39e..ef4fa997c81 100644 --- a/code/modules/admin/admin_verbs.dm +++ b/code/modules/admin/admin_verbs.dm @@ -735,7 +735,7 @@ var/list/admin_verbs_mentor = list( var/mob/living/silicon/S = input("Select silicon.", "Manage Silicon Laws") as null|anything in silicon_mob_list if(!S) return - var/obj/nano_module/law_manager/L = new(S) + var/datum/nano_module/law_manager/L = new(S) L.ui_interact(usr, state = admin_state) admin_log_and_message_admins("has opened [S]'s law manager.") feedback_add_details("admin_verb","MSL") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! diff --git a/code/modules/mob/living/carbon/human/appearance.dm b/code/modules/mob/living/carbon/human/appearance.dm index 5f9527b93b9..39904901459 100644 --- a/code/modules/mob/living/carbon/human/appearance.dm +++ b/code/modules/mob/living/carbon/human/appearance.dm @@ -1,5 +1,5 @@ /mob/living/carbon/human/proc/change_appearance(var/flags = APPEARANCE_ALL_HAIR, var/location = src, var/mob/user = src, var/check_species_whitelist = 1, var/list/species_whitelist = list(), var/list/species_blacklist = list(), var/datum/topic_state/state = default_state) - var/obj/nano_module/appearance_changer/AC = new(location, src, check_species_whitelist, species_whitelist, species_blacklist) + var/datum/nano_module/appearance_changer/AC = new(location, src, check_species_whitelist, species_whitelist, species_blacklist) AC.flags = flags AC.ui_interact(user, state = state) diff --git a/code/modules/mob/living/silicon/ai/life.dm b/code/modules/mob/living/silicon/ai/life.dm index 84d3cfd2298..b8132b53570 100644 --- a/code/modules/mob/living/silicon/ai/life.dm +++ b/code/modules/mob/living/silicon/ai/life.dm @@ -20,10 +20,6 @@ if(!psupply) create_powersupply() - if (src.machine) - if (!( src.machine.check_eye(src) )) - src.reset_view(null) - // Handle power damage (oxy) if(aiRestorePowerRoutine != 0 && !APU_power) // Lose power diff --git a/code/modules/mob/living/silicon/subystems.dm b/code/modules/mob/living/silicon/subystems.dm index e8909b0b509..f79f5664a22 100644 --- a/code/modules/mob/living/silicon/subystems.dm +++ b/code/modules/mob/living/silicon/subystems.dm @@ -1,11 +1,11 @@ /mob/living/silicon var/register_alarms = 1 - var/obj/nano_module/alarm_monitor/all/alarm_monitor - var/obj/nano_module/atmos_control/atmos_control - var/obj/nano_module/crew_monitor/crew_monitor - var/obj/nano_module/law_manager/law_manager - var/obj/nano_module/power_monitor/power_monitor - var/obj/nano_module/rcon/rcon + var/datum/nano_module/alarm_monitor/all/alarm_monitor + var/datum/nano_module/atmos_control/atmos_control + var/datum/nano_module/crew_monitor/crew_monitor + var/datum/nano_module/law_manager/law_manager + var/datum/nano_module/power_monitor/power_monitor + var/datum/nano_module/rcon/rcon /mob/living/silicon var/list/silicon_subsystems = list( diff --git a/code/modules/nano/interaction/base.dm b/code/modules/nano/interaction/base.dm index 10cda75162e..8e4aeb56401 100644 --- a/code/modules/nano/interaction/base.dm +++ b/code/modules/nano/interaction/base.dm @@ -1,7 +1,7 @@ -/atom/proc/nano_host() +/datum/proc/nano_host() return src -/atom/proc/CanUseTopic(var/mob/user, var/datum/topic_state/state) +/datum/proc/CanUseTopic(var/mob/user, var/datum/topic_state/state) var/src_object = nano_host() return state.can_use_topic(src_object, user) diff --git a/code/modules/nano/modules/alarm_monitor.dm b/code/modules/nano/modules/alarm_monitor.dm index d073f6f6d20..5040241d0ff 100644 --- a/code/modules/nano/modules/alarm_monitor.dm +++ b/code/modules/nano/modules/alarm_monitor.dm @@ -1,50 +1,50 @@ -/obj/nano_module/alarm_monitor +/datum/nano_module/alarm_monitor name = "Alarm monitor" var/list_cameras = 0 // Whether or not to list camera references. A future goal would be to merge this with the enginering/security camera console. Currently really only for AI-use. var/list/datum/alarm_handler/alarm_handlers // The particular list of alarm handlers this alarm monitor should present to the user. -/obj/nano_module/alarm_monitor/all/New() +/datum/nano_module/alarm_monitor/all/New() ..() alarm_handlers = alarm_manager.all_handlers -/obj/nano_module/alarm_monitor/engineering/New() +/datum/nano_module/alarm_monitor/engineering/New() ..() alarm_handlers = list(atmosphere_alarm, fire_alarm, power_alarm) -/obj/nano_module/alarm_monitor/security/New() +/datum/nano_module/alarm_monitor/security/New() ..() alarm_handlers = list(camera_alarm, motion_alarm) -/obj/nano_module/alarm_monitor/proc/register(var/object, var/procName) +/datum/nano_module/alarm_monitor/proc/register(var/object, var/procName) for(var/datum/alarm_handler/AH in alarm_handlers) AH.register(object, procName) -/obj/nano_module/alarm_monitor/proc/unregister(var/object) +/datum/nano_module/alarm_monitor/proc/unregister(var/object) for(var/datum/alarm_handler/AH in alarm_handlers) AH.unregister(object) -/obj/nano_module/alarm_monitor/proc/all_alarms() +/datum/nano_module/alarm_monitor/proc/all_alarms() var/list/all_alarms = new() for(var/datum/alarm_handler/AH in alarm_handlers) all_alarms += AH.alarms return all_alarms -/obj/nano_module/alarm_monitor/proc/major_alarms() +/datum/nano_module/alarm_monitor/proc/major_alarms() var/list/all_alarms = new() for(var/datum/alarm_handler/AH in alarm_handlers) all_alarms += AH.major_alarms() return all_alarms -/obj/nano_module/alarm_monitor/proc/minor_alarms() +/datum/nano_module/alarm_monitor/proc/minor_alarms() var/list/all_alarms = new() for(var/datum/alarm_handler/AH in alarm_handlers) all_alarms += AH.minor_alarms() return all_alarms -/obj/nano_module/alarm_monitor/ai/Topic(ref, href_list) +/datum/nano_module/alarm_monitor/ai/Topic(ref, href_list) if(..()) return 1 if(href_list["switchTo"]) @@ -56,7 +56,7 @@ usr.switch_to_camera(C) return 1 -/obj/nano_module/alarm_monitor/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1, var/datum/topic_state/state = default_state) +/datum/nano_module/alarm_monitor/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1, var/datum/topic_state/state = default_state) var/data[0] var/categories[0] diff --git a/code/modules/nano/modules/atmos_control.dm b/code/modules/nano/modules/atmos_control.dm index 38975268651..e1cc519b2f9 100644 --- a/code/modules/nano/modules/atmos_control.dm +++ b/code/modules/nano/modules/atmos_control.dm @@ -1,16 +1,14 @@ -/obj/nano_module/atmos_control +/datum/nano_module/atmos_control name = "Atmospherics Control" - var/ui_ref + var/obj/access = new() var/emagged = 0 + var/ui_ref var/list/monitored_alarms = list() - var/datum/topic_state/atmos_state -/obj/nano_module/atmos_control/New(atmos_computer, req_access, req_one_access, monitored_alarm_ids) +/datum/nano_module/atmos_control/New(atmos_computer, req_access, req_one_access, monitored_alarm_ids) ..() - loc = atmos_computer - src.req_access = req_access - src.req_one_access = req_one_access - atmos_state = default_state + access.req_access = req_access + access.req_one_access = req_one_access if(monitored_alarm_ids) for(var/obj/machinery/alarm/alarm in machines) @@ -19,7 +17,7 @@ // machines may not yet be ordered at this point monitored_alarms = dd_sortedObjectList(monitored_alarms) -/obj/nano_module/atmos_control/Topic(href, href_list) +/datum/nano_module/atmos_control/Topic(href, href_list) if(..()) return 1 @@ -31,7 +29,7 @@ alarm.ui_interact(usr, master_ui = ui_ref, state = TS) return 1 -/obj/nano_module/atmos_control/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1, var/master_ui = null, var/datum/topic_state/state = default_state) +/datum/nano_module/atmos_control/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1, var/master_ui = null, var/datum/topic_state/state = default_state) var/data[0] var/alarms[0] @@ -48,15 +46,15 @@ ui.set_auto_update(1) ui_ref = ui -/obj/nano_module/atmos_control/proc/generate_state(air_alarm) +/datum/nano_module/atmos_control/proc/generate_state(air_alarm) var/datum/topic_state/air_alarm/state = new() state.atmos_control = src state.air_alarm = air_alarm return state /datum/topic_state/air_alarm - var/obj/nano_module/atmos_control/atmos_control = null - var/obj/machinery/alarm/air_alarm = null + var/datum/nano_module/atmos_control/atmos_control = null + var/obj/machinery/alarm/air_alarm = null /datum/topic_state/air_alarm/can_use_topic(var/src_object, var/mob/user) if(has_access(user)) @@ -71,4 +69,4 @@ return extra_href /datum/topic_state/air_alarm/proc/has_access(var/mob/user) - return user && (user.isAI() || atmos_control.allowed(user) || atmos_control.emagged || air_alarm.rcon_setting == RCON_YES || (air_alarm.alarm_area.atmosalm && air_alarm.rcon_setting == RCON_AUTO)) + return user && (user.isAI() || atmos_control.access.allowed(user) || atmos_control.emagged || air_alarm.rcon_setting == RCON_YES || (air_alarm.alarm_area.atmosalm && air_alarm.rcon_setting == RCON_AUTO)) diff --git a/code/modules/nano/modules/crew_monitor.dm b/code/modules/nano/modules/crew_monitor.dm index 2758b859d77..cd52ad6603c 100644 --- a/code/modules/nano/modules/crew_monitor.dm +++ b/code/modules/nano/modules/crew_monitor.dm @@ -1,8 +1,8 @@ -/obj/nano_module/crew_monitor +/datum/nano_module/crew_monitor name = "Crew monitor" var/list/tracked = new -/obj/nano_module/crew_monitor/Topic(href, href_list) +/datum/nano_module/crew_monitor/Topic(href, href_list) if(..()) return var/turf/T = get_turf(src) if (!T || !(T.z in config.player_levels)) @@ -14,9 +14,6 @@ usr.unset_machine() ui.close() return 0 - if(href_list["update"]) - src.updateDialog() - return 1 if(href_list["track"]) if(usr.isAI()) var/mob/living/silicon/ai/AI = usr @@ -25,7 +22,7 @@ AI.ai_actual_track(H) return 1 -/obj/nano_module/crew_monitor/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1, var/datum/topic_state/state = default_state) +/datum/nano_module/crew_monitor/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1, var/datum/topic_state/state = default_state) user.set_machine(src) src.scan() @@ -87,7 +84,7 @@ // should make the UI auto-update; doesn't seem to? ui.set_auto_update(1) -/obj/nano_module/crew_monitor/proc/scan() +/datum/nano_module/crew_monitor/proc/scan() for(var/mob/living/carbon/human/H in mob_list) if(istype(H.w_uniform, /obj/item/clothing/under)) var/obj/item/clothing/under/C = H.w_uniform diff --git a/code/modules/nano/modules/human_appearance.dm b/code/modules/nano/modules/human_appearance.dm index 47324c47b07..3b3deff06c1 100644 --- a/code/modules/nano/modules/human_appearance.dm +++ b/code/modules/nano/modules/human_appearance.dm @@ -1,6 +1,6 @@ -/obj/nano_module/appearance_changer +/datum/nano_module/appearance_changer name = "Appearance Editor" - flags = APPEARANCE_ALL_HAIR + var/flags = APPEARANCE_ALL_HAIR var/mob/living/carbon/human/owner = null var/list/valid_species = list() var/list/valid_hairstyles = list() @@ -10,15 +10,14 @@ var/list/whitelist var/list/blacklist -/obj/nano_module/appearance_changer/New(var/location, var/mob/living/carbon/human/H, var/check_species_whitelist = 1, var/list/species_whitelist = list(), var/list/species_blacklist = list()) +/datum/nano_module/appearance_changer/New(var/location, var/mob/living/carbon/human/H, var/check_species_whitelist = 1, var/list/species_whitelist = list(), var/list/species_blacklist = list()) ..() - loc = location owner = H src.check_whitelist = check_species_whitelist src.whitelist = species_whitelist src.blacklist = species_blacklist -/obj/nano_module/appearance_changer/Topic(ref, href_list, var/nowindow, var/datum/topic_state/state = default_state) +/datum/nano_module/appearance_changer/Topic(ref, href_list, var/nowindow, var/datum/topic_state/state = default_state) if(..()) return 1 @@ -91,7 +90,7 @@ return 0 -/obj/nano_module/appearance_changer/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1, var/datum/topic_state/state = default_state) +/datum/nano_module/appearance_changer/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1, var/datum/topic_state/state = default_state) generate_data(check_whitelist, whitelist, blacklist) var/data[0] @@ -128,31 +127,31 @@ data["change_facial_hair_color"] = can_change(APPEARANCE_FACIAL_HAIR_COLOR) ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open) if (!ui) - ui = new(user, src, ui_key, "appearance_changer.tmpl", "[src.name]", 800, 450, state = state) + ui = new(user, src, ui_key, "appearance_changer.tmpl", "[src]", 800, 450, state = state) ui.set_initial_data(data) ui.open() ui.set_auto_update(1) -/obj/nano_module/appearance_changer/proc/update_dna() +/datum/nano_module/appearance_changer/proc/update_dna() if(owner && (flags & APPEARANCE_UPDATE_DNA)) owner.update_dna() -/obj/nano_module/appearance_changer/proc/can_change(var/flag) +/datum/nano_module/appearance_changer/proc/can_change(var/flag) return owner && (flags & flag) -/obj/nano_module/appearance_changer/proc/can_change_skin_tone() +/datum/nano_module/appearance_changer/proc/can_change_skin_tone() return owner && (flags & APPEARANCE_SKIN) && owner.species.flags & HAS_SKIN_TONE -/obj/nano_module/appearance_changer/proc/can_change_skin_color() +/datum/nano_module/appearance_changer/proc/can_change_skin_color() return owner && (flags & APPEARANCE_SKIN) && owner.species.flags & HAS_SKIN_COLOR -/obj/nano_module/appearance_changer/proc/cut_and_generate_data() +/datum/nano_module/appearance_changer/proc/cut_and_generate_data() // Making the assumption that the available species remain constant valid_facial_hairstyles.Cut() valid_facial_hairstyles.Cut() generate_data() -/obj/nano_module/appearance_changer/proc/generate_data() +/datum/nano_module/appearance_changer/proc/generate_data() if(!valid_species.len) valid_species = owner.generate_valid_species(check_whitelist, whitelist, blacklist) if(!valid_hairstyles.len || !valid_facial_hairstyles.len) diff --git a/code/modules/nano/modules/law_manager.dm b/code/modules/nano/modules/law_manager.dm index 98c2cdc9054..d471bf7a99e 100644 --- a/code/modules/nano/modules/law_manager.dm +++ b/code/modules/nano/modules/law_manager.dm @@ -1,6 +1,5 @@ -/obj/nano_module/law_manager +/datum/nano_module/law_manager name = "Law manager" - var/ion_law = "IonLaw" var/zeroth_law = "ZerothLaw" var/inherent_law = "InherentLaw" @@ -13,9 +12,8 @@ var/global/list/datum/ai_laws/player_laws var/mob/living/silicon/owner = null -/obj/nano_module/law_manager/New(var/mob/living/silicon/S) +/datum/nano_module/law_manager/New(var/mob/living/silicon/S) ..() - loc = S owner = S if(!admin_laws) @@ -29,7 +27,7 @@ if(laws.selectable) player_laws += laws -/obj/nano_module/law_manager/Topic(href, href_list) +/datum/nano_module/law_manager/Topic(href, href_list) if(..()) return 1 @@ -149,7 +147,7 @@ return 0 -/obj/nano_module/law_manager/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1, var/datum/topic_state/state = default_state) +/datum/nano_module/law_manager/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1, var/datum/topic_state/state = default_state) var/data[0] owner.lawsync() @@ -185,14 +183,14 @@ ui.open() ui.set_auto_update(1) -/obj/nano_module/law_manager/proc/package_laws(var/list/data, var/field, var/list/datum/ai_law/laws) +/datum/nano_module/law_manager/proc/package_laws(var/list/data, var/field, var/list/datum/ai_law/laws) var/packaged_laws[0] for(var/datum/ai_law/AL in laws) packaged_laws[++packaged_laws.len] = list("law" = sanitize(AL.law), "index" = AL.get_index(), "state" = owner.laws.get_state_law(AL), "ref" = "\ref[AL]") data[field] = packaged_laws data["has_[field]"] = packaged_laws.len -/obj/nano_module/law_manager/proc/package_multiple_laws(var/list/datum/ai_laws/laws) +/datum/nano_module/law_manager/proc/package_multiple_laws(var/list/datum/ai_laws/laws) var/law_sets[0] for(var/datum/ai_laws/ALs in laws) var/packaged_laws[0] @@ -204,7 +202,7 @@ return law_sets -/obj/nano_module/law_manager/proc/is_malf(var/mob/user) +/datum/nano_module/law_manager/proc/is_malf(var/mob/user) return (is_admin(user) && !owner.is_slaved()) || owner.is_malf_or_traitor() /mob/living/silicon/proc/is_slaved() @@ -213,7 +211,7 @@ /mob/living/silicon/robot/is_slaved() return lawupdate && connected_ai ? sanitize(connected_ai.name) : null -/obj/nano_module/law_manager/proc/sync_laws(var/mob/living/silicon/ai/AI) +/datum/nano_module/law_manager/proc/sync_laws(var/mob/living/silicon/ai/AI) if(!AI) return for(var/mob/living/silicon/robot/R in AI.connected_robots) diff --git a/code/modules/nano/modules/nano_module.dm b/code/modules/nano/modules/nano_module.dm index 3fa82750992..0cdf451d6fb 100644 --- a/code/modules/nano/modules/nano_module.dm +++ b/code/modules/nano/modules/nano_module.dm @@ -1,5 +1,12 @@ -/obj/nano_module/nano_host() - return loc +/datum/nano_module + var/name + var/host -/obj/nano_module/proc/can_still_topic(var/datum/topic_state/state = default_state) +/datum/nano_module/New(var/host) + src.host = host + +/datum/nano_module/nano_host() + return host ? host : src + +/datum/nano_module/proc/can_still_topic(var/datum/topic_state/state = default_state) return CanUseTopic(usr, state) == STATUS_INTERACTIVE diff --git a/code/modules/nano/modules/power_monitor.dm b/code/modules/nano/modules/power_monitor.dm index ed7c64aa943..07076fac0ad 100644 --- a/code/modules/nano/modules/power_monitor.dm +++ b/code/modules/nano/modules/power_monitor.dm @@ -1,13 +1,13 @@ -/obj/nano_module/power_monitor +/datum/nano_module/power_monitor name = "Power monitor" var/list/grid_sensors var/active_sensor = null //name_tag of the currently selected sensor -/obj/nano_module/power_monitor/New() +/datum/nano_module/power_monitor/New() ..() refresh_sensors() -/obj/nano_module/power_monitor/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1, var/datum/topic_state/state = default_state) +/datum/nano_module/power_monitor/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1, var/datum/topic_state/state = default_state) var/list/data = list() var/list/sensors = list() // Focus: If it remains null if no sensor is selected and UI will display sensor list, otherwise it will display sensor reading. @@ -34,7 +34,7 @@ ui.set_auto_update(1) // Refreshes list of active sensors kept on this computer. -/obj/nano_module/power_monitor/proc/refresh_sensors() +/datum/nano_module/power_monitor/proc/refresh_sensors() grid_sensors = list() var/turf/T = get_turf(src) for(var/obj/machinery/power/sensor/S in machines) @@ -45,7 +45,7 @@ grid_sensors += S // Allows us to process UI clicks, which are relayed in form of hrefs. -/obj/nano_module/power_monitor/Topic(href, href_list) +/datum/nano_module/power_monitor/Topic(href, href_list) if(..()) return if( href_list["clear"] ) diff --git a/code/modules/nano/modules/rcon.dm b/code/modules/nano/modules/rcon.dm index 58e55894c1b..8950f1228e8 100644 --- a/code/modules/nano/modules/rcon.dm +++ b/code/modules/nano/modules/rcon.dm @@ -1,6 +1,5 @@ -/obj/nano_module/rcon +/datum/nano_module/rcon name = "Power RCON" - var/list/known_SMESs = null var/list/known_breakers = null // Allows you to hide specific parts of the UI @@ -8,7 +7,7 @@ var/hide_SMES_details = 0 var/hide_breakers = 0 -/obj/nano_module/rcon/ui_interact(mob/user, ui_key = "rcon", datum/nanoui/ui=null, force_open=1, var/datum/topic_state/state = default_state) +/datum/nano_module/rcon/ui_interact(mob/user, ui_key = "rcon", datum/nanoui/ui=null, force_open=1, var/datum/topic_state/state = default_state) FindDevices() // Update our devices list var/data[0] @@ -49,7 +48,7 @@ // Proc: Topic() // Parameters: 2 (href, href_list - allows us to process UI clicks) // Description: Allows us to process UI clicks, which are relayed in form of hrefs. -/obj/nano_module/rcon/Topic(href, href_list) +/datum/nano_module/rcon/Topic(href, href_list) if(..()) return @@ -93,7 +92,7 @@ // Proc: GetSMESByTag() // Parameters: 1 (tag - RCON tag of SMES we want to look up) // Description: Looks up and returns SMES which has matching RCON tag -/obj/nano_module/rcon/proc/GetSMESByTag(var/tag) +/datum/nano_module/rcon/proc/GetSMESByTag(var/tag) if(!tag) return @@ -104,7 +103,7 @@ // Proc: FindDevices() // Parameters: None // Description: Refreshes local list of known devices. -/obj/nano_module/rcon/proc/FindDevices() +/datum/nano_module/rcon/proc/FindDevices() known_SMESs = new /list() for(var/obj/machinery/power/smes/buildable/SMES in machines) if(SMES.RCon_tag && (SMES.RCon_tag != "NO_TAG") && SMES.RCon) diff --git a/code/modules/nano/nanoexternal.dm b/code/modules/nano/nanoexternal.dm index bb283accf52..08f9deffa9f 100644 --- a/code/modules/nano/nanoexternal.dm +++ b/code/modules/nano/nanoexternal.dm @@ -37,7 +37,7 @@ * * @return nothing */ -/atom/movable/proc/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1, var/datum/nano_ui/master_ui = null, var/datum/topic_state/state = default_state) +/datum/proc/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1, var/datum/nano_ui/master_ui = null, var/datum/topic_state/state = default_state) return // Used by the Nano UI Manager (/datum/nanomanager) to track UIs opened by this mob diff --git a/code/modules/nano/nanoui.dm b/code/modules/nano/nanoui.dm index f134d5d93b4..9108f23e62b 100644 --- a/code/modules/nano/nanoui.dm +++ b/code/modules/nano/nanoui.dm @@ -10,7 +10,7 @@ nanoui is used to open and update nano browser uis // the user who opened this ui var/mob/user // the object this ui "belongs" to - var/atom/movable/src_object + var/datum/src_object // the title of this ui var/title // the key of this ui, this is to allow multiple (different) uis for each src_object @@ -176,7 +176,7 @@ nanoui is used to open and update nano browser uis /datum/nanoui/proc/get_config_data() var/list/config_data = list( "title" = title, - "srcObject" = list("name" = src_object.name), + "srcObject" = list("name" = "[src_object]"), "stateKey" = state_key, "status" = status, "autoUpdateLayout" = auto_update_layout, diff --git a/code/modules/power/sensors/sensor_monitoring.dm b/code/modules/power/sensors/sensor_monitoring.dm index c4e9a191e93..3233337db0c 100644 --- a/code/modules/power/sensors/sensor_monitoring.dm +++ b/code/modules/power/sensors/sensor_monitoring.dm @@ -18,7 +18,7 @@ use_power = 1 idle_power_usage = 300 active_power_usage = 300 - var/obj/nano_module/power_monitor/power_monitor + var/datum/nano_module/power_monitor/power_monitor // Checks the sensors for alerts. If change (alerts cleared or detected) occurs, calls for icon update. /obj/machinery/computer/power_monitor/process() From 13cb32fa7fa85743387af7daf4c9af7813c6e175 Mon Sep 17 00:00:00 2001 From: PsiOmega Date: Mon, 8 Jun 2015 17:37:56 +0200 Subject: [PATCH 023/215] Another MayRespawn() fix. Being unable to reenter your body now allows you to respawn, even if your body lives. --- code/modules/mob/dead/observer/observer.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/modules/mob/dead/observer/observer.dm b/code/modules/mob/dead/observer/observer.dm index f65b07b2c79..c7dea3bb9d1 100644 --- a/code/modules/mob/dead/observer/observer.dm +++ b/code/modules/mob/dead/observer/observer.dm @@ -622,7 +622,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp mob/dead/observer/MayRespawn(var/feedback = 0) if(!client) return 0 - if(mind && mind.current && mind.current.stat != DEAD) + if(mind && mind.current && mind.current.stat != DEAD && can_reenter_corpse) if(feedback) src << "Your non-dead body prevent you from respawning." return 0 From ec68454f63f255722c24d87cae9ea81105e9eacf Mon Sep 17 00:00:00 2001 From: PsiOmegaDelta Date: Tue, 9 Jun 2015 08:47:53 +0200 Subject: [PATCH 024/215] Fixes #9753. Being admin jumped or jumping to another location now cancels ghost tracking. Also adds proper permission checks. --- code/modules/admin/verbs/adminjump.dm | 32 +++++++++++++++++++-------- 1 file changed, 23 insertions(+), 9 deletions(-) diff --git a/code/modules/admin/verbs/adminjump.dm b/code/modules/admin/verbs/adminjump.dm index ab9e8c1cd36..1ff9a1d1cc6 100644 --- a/code/modules/admin/verbs/adminjump.dm +++ b/code/modules/admin/verbs/adminjump.dm @@ -1,12 +1,19 @@ +/mob/proc/on_mob_jump() + return + +/mob/dead/observer/on_mob_jump() + following = null + /client/proc/Jump(var/area/A in return_sorted_areas()) set name = "Jump to Area" set desc = "Area to jump to" set category = "Admin" - if(!src.holder) + if(!check_rights(R_ADMIN, user = src)) src << "Only administrators may use this command." return if(config.allow_admin_jump) + usr.on_mob_jump() usr.loc = pick(get_area_turfs(A)) log_admin("[key_name(usr)] jumped to [A]") @@ -18,12 +25,13 @@ /client/proc/jumptoturf(var/turf/T in world) set name = "Jump to Turf" set category = "Admin" - if(!src.holder) + if(!check_rights(R_ADMIN, user = src)) src << "Only administrators may use this command." return if(config.allow_admin_jump) log_admin("[key_name(usr)] jumped to [T.x],[T.y],[T.z] in [T.loc]") message_admins("[key_name_admin(usr)] jumped to [T.x],[T.y],[T.z] in [T.loc]", 1) + usr.on_mob_jump() usr.loc = T feedback_add_details("admin_verb","JT") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! else @@ -34,7 +42,7 @@ set category = "Admin" set name = "Jump to Mob" - if(!src.holder) + if(!check_rights(R_ADMIN, user = src)) src << "Only administrators may use this command." return @@ -46,6 +54,7 @@ var/turf/T = get_turf(M) if(T && isturf(T)) feedback_add_details("admin_verb","JM") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! + A.on_mob_jump() A.loc = T else A << "This mob is not located in the game world." @@ -56,13 +65,14 @@ set category = "Admin" set name = "Jump to Coordinate" - if (!holder) + if(!check_rights(R_ADMIN, user = src)) src << "Only administrators may use this command." return if (config.allow_admin_jump) if(src.mob) var/mob/A = src.mob + A.on_mob_jump() A.x = tx A.y = ty A.z = tz @@ -76,7 +86,7 @@ set category = "Admin" set name = "Jump to Key" - if(!src.holder) + if(!check_rights(R_ADMIN, user = src)) src << "Only administrators may use this command." return @@ -91,6 +101,7 @@ var/mob/M = selection:mob log_admin("[key_name(usr)] jumped to [key_name(M)]") message_admins("[key_name_admin(usr)] jumped to [key_name_admin(M)]", 1) + usr.on_mob_jump() usr.loc = M.loc feedback_add_details("admin_verb","JK") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! else @@ -100,12 +111,13 @@ set category = "Admin" set name = "Get Mob" set desc = "Mob to teleport" - if(!src.holder) + if(!check_rights(R_ADMIN, user = src)) src << "Only administrators may use this command." return if(config.allow_admin_jump) log_admin("[key_name(usr)] teleported [key_name(M)]") message_admins("[key_name_admin(usr)] teleported [key_name_admin(M)]", 1) + M.on_mob_jump() M.loc = get_turf(usr) feedback_add_details("admin_verb","GM") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! else @@ -116,7 +128,7 @@ set name = "Get Key" set desc = "Key to teleport" - if(!src.holder) + if(!check_rights(R_ADMIN, user = src)) src << "Only administrators may use this command." return @@ -134,6 +146,7 @@ log_admin("[key_name(usr)] teleported [key_name(M)]") message_admins("[key_name_admin(usr)] teleported [key_name(M)]", 1) if(M) + M.on_mob_jump() M.loc = get_turf(usr) feedback_add_details("admin_verb","GK") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! else @@ -142,16 +155,17 @@ /client/proc/sendmob(var/mob/M in sortmobs()) set category = "Admin" set name = "Send Mob" - if(!src.holder) + if(!check_rights(R_ADMIN, user = src)) src << "Only administrators may use this command." return var/area/A = input(usr, "Pick an area.", "Pick an area") in return_sorted_areas() if(A) if(config.allow_admin_jump) + M.on_mob_jump() M.loc = pick(get_area_turfs(A)) feedback_add_details("admin_verb","SMOB") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! log_admin("[key_name(usr)] teleported [key_name(M)] to [A]") message_admins("[key_name_admin(usr)] teleported [key_name_admin(M)] to [A]", 1) else - alert("Admin jumping disabled") \ No newline at end of file + alert("Admin jumping disabled") From 9541133888cc7d281a885438b25d528650e1827c Mon Sep 17 00:00:00 2001 From: PsiOmegaDelta Date: Tue, 9 Jun 2015 12:18:05 +0200 Subject: [PATCH 025/215] Changelog update. --- html/changelog.html | 6 ++++++ html/changelogs/.all_changelog.yml | 4 ++++ html/changelogs/PsiOmegaDelta-Meteors.yml | 5 ----- 3 files changed, 10 insertions(+), 5 deletions(-) delete mode 100644 html/changelogs/PsiOmegaDelta-Meteors.yml diff --git a/html/changelog.html b/html/changelog.html index c1b455e4bf7..33c541f8813 100644 --- a/html/changelog.html +++ b/html/changelog.html @@ -56,6 +56,12 @@ -->
    +

    09 June 2015

    +

    PsiOmegaDelta updated:

    +
      +
    • Ports /tg/'s meteor event. Meteors now appear to be more accurate, come in a greater variety, and may drop ores on their final destruction.
    • +
    +

    08 June 2015

    PsiOmegaDelta updated:

      diff --git a/html/changelogs/.all_changelog.yml b/html/changelogs/.all_changelog.yml index c5be3443a06..95f5265a453 100644 --- a/html/changelogs/.all_changelog.yml +++ b/html/changelogs/.all_changelog.yml @@ -1967,3 +1967,7 @@ DO NOT EDIT THIS FILE BY HAND! AUTOMATICALLY GENERATED BY ss13_genchangelog.py. PsiOmegaDelta: - rscadd: The AI chassis now glows, with the color depending on the currently selected display. +2015-06-09: + PsiOmegaDelta: + - rscadd: Ports /tg/'s meteor event. Meteors now appear to be more accurate, come + in a greater variety, and may drop ores on their final destruction. diff --git a/html/changelogs/PsiOmegaDelta-Meteors.yml b/html/changelogs/PsiOmegaDelta-Meteors.yml deleted file mode 100644 index ad4a3bf87fb..00000000000 --- a/html/changelogs/PsiOmegaDelta-Meteors.yml +++ /dev/null @@ -1,5 +0,0 @@ -author: PsiOmegaDelta -delete-after: True - -changes: - - rscadd: "Ports /tg/'s meteor event. Meteors now appear to be more accurate, come in a greater variety, and may drop ores on their final destruction." From 3591bd559977f68af34014e0f41ea69cbbc45e4f Mon Sep 17 00:00:00 2001 From: PsiOmega Date: Tue, 9 Jun 2015 15:36:27 +0200 Subject: [PATCH 026/215] Travis now builds using version 508.1287 throw is now a keyword. Updates usages where necessary to allow compilation. --- .travis.yml | 4 ++-- code/modules/mob/living/carbon/carbon.dm | 2 +- code/modules/mob/mob_grab.dm | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 81b8487f483..1c6b3ecedce 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,8 +2,8 @@ language: c env: - BYOND_MAJOR="507" - BYOND_MINOR="1282" + BYOND_MAJOR="508" + BYOND_MINOR="1287" before_install: - sudo apt-get update -qq diff --git a/code/modules/mob/living/carbon/carbon.dm b/code/modules/mob/living/carbon/carbon.dm index 7c3599e726d..5b29fa5130b 100644 --- a/code/modules/mob/living/carbon/carbon.dm +++ b/code/modules/mob/living/carbon/carbon.dm @@ -285,7 +285,7 @@ if (istype(item, /obj/item/weapon/grab)) var/obj/item/weapon/grab/G = item - item = G.throw() //throw the person instead of the grab + item = G.throw_held() //throw the person instead of the grab if(ismob(item)) var/turf/start_T = get_turf(loc) //Get the start and target tile for the descriptors var/turf/end_T = get_turf(target) diff --git a/code/modules/mob/mob_grab.dm b/code/modules/mob/mob_grab.dm index 2d26f3b6056..f984274cad6 100644 --- a/code/modules/mob/mob_grab.dm +++ b/code/modules/mob/mob_grab.dm @@ -41,7 +41,7 @@ ..() //Used by throw code to hand over the mob, instead of throwing the grab. The grab is then deleted by the throw code. -/obj/item/weapon/grab/proc/throw() +/obj/item/weapon/grab/proc/throw_held() if(affecting) if(affecting.buckled) return null From ebc58b08d92b465dedd94c57de1aa0b89d288196 Mon Sep 17 00:00:00 2001 From: PsiOmega Date: Tue, 9 Jun 2015 16:24:47 +0200 Subject: [PATCH 027/215] Power monitor UI now attempts to get the turf of its host. get_turf() gets upset when attempting to get the loc of the power monitor itself, now being a datum. --- code/modules/nano/modules/power_monitor.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/modules/nano/modules/power_monitor.dm b/code/modules/nano/modules/power_monitor.dm index 07076fac0ad..9d386e8c932 100644 --- a/code/modules/nano/modules/power_monitor.dm +++ b/code/modules/nano/modules/power_monitor.dm @@ -36,7 +36,7 @@ // Refreshes list of active sensors kept on this computer. /datum/nano_module/power_monitor/proc/refresh_sensors() grid_sensors = list() - var/turf/T = get_turf(src) + var/turf/T = get_turf(nano_host()) for(var/obj/machinery/power/sensor/S in machines) if((T && S.loc.z == T.z) || (S.long_range)) // Consoles have range on their Z-Level. Sensors with long_range var will work between Z levels. if(S.name_tag == "#UNKN#") // Default name. Shouldn't happen! From 6f70049a128b008272bccbea97417c8d64bcc111 Mon Sep 17 00:00:00 2001 From: PsiOmega Date: Tue, 9 Jun 2015 15:29:11 +0200 Subject: [PATCH 028/215] Expanded ghost following. Ghosts can now follow the Eye of a speaking mob, if it has one, or the body of someone who has died. Partial port of https://github.com/ParadiseSS13/Paradise/pull/1151. --- code/modules/mob/dead/observer/observer.dm | 13 +++++++++++++ code/modules/mob/hear_say.dm | 4 ++-- code/modules/mob/mob_helpers.dm | 2 +- 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/code/modules/mob/dead/observer/observer.dm b/code/modules/mob/dead/observer/observer.dm index 914576c5ee1..9f023b04697 100644 --- a/code/modules/mob/dead/observer/observer.dm +++ b/code/modules/mob/dead/observer/observer.dm @@ -681,3 +681,16 @@ mob/dead/observer/MayRespawn(var/feedback = 0) src << "antagHUD restrictions prevent you from respawning." return 0 return 1 + +/proc/ghost_follow_link(var/atom/target, var/atom/ghost) + if((!target) || (!ghost)) return + . = "follow" + + if(istype(target, /mob/dead/observer)) + var/mob/dead/observer/O = target + if(O.mind && O.mind.current) + . += "|body" + else if(istype(target, /mob)) // Eye follow links + var/mob/M = target + if(M.client && M.eyeobj) // No point following clientless eyes + . += "|eye" diff --git a/code/modules/mob/hear_say.dm b/code/modules/mob/hear_say.dm index e5e91c4bdc7..707334f4b47 100644 --- a/code/modules/mob/hear_say.dm +++ b/code/modules/mob/hear_say.dm @@ -55,7 +55,7 @@ return if(speaker_name != speaker.real_name && speaker.real_name) speaker_name = "[speaker.real_name] ([speaker_name])" - track = "(follow) " + track = "([ghost_follow_link(speaker, src)]) " if(client.prefs.toggles & CHAT_GHOSTEARS && speaker in view(src)) message = "[message]" @@ -180,7 +180,7 @@ if(istype(src, /mob/dead/observer)) if(speaker_name != speaker.real_name && !isAI(speaker)) //Announce computer and various stuff that broadcasts doesn't use it's real name but AI's can't pretend to be other mobs. speaker_name = "[speaker.real_name] ([speaker_name])" - track = "[speaker_name] (follow)" + track = "[speaker_name] ([ghost_follow_link(speaker, src)])" var/formatted if(language) diff --git a/code/modules/mob/mob_helpers.dm b/code/modules/mob/mob_helpers.dm index 79115b61b29..563c7c5551d 100644 --- a/code/modules/mob/mob_helpers.dm +++ b/code/modules/mob/mob_helpers.dm @@ -555,7 +555,7 @@ proc/is_blind(A) var/lname if(subject) if(subject != M) - follow = "(follow) " + follow = "([ghost_follow_link(subject, M)]) " if(M.stat != DEAD && M.client.holder) follow = "(JMP) " var/mob/dead/observer/DM From 1f33ccdfb0cbefc8b57221fed408303cd2ac729c Mon Sep 17 00:00:00 2001 From: PsiOmega Date: Tue, 9 Jun 2015 19:58:03 +0200 Subject: [PATCH 029/215] The turret control now glows. --- code/game/machinery/turret_control.dm | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/code/game/machinery/turret_control.dm b/code/game/machinery/turret_control.dm index 223b503f4f7..943242d4092 100644 --- a/code/game/machinery/turret_control.dm +++ b/code/game/machinery/turret_control.dm @@ -191,13 +191,17 @@ ..() if(stat & NOPOWER) icon_state = "control_off" + set_light(0) else if (enabled) if (lethal) icon_state = "control_kill" + set_light(1.5, 1,"#990000") else icon_state = "control_stun" + set_light(1.5, 1,"#FF9900") else icon_state = "control_standby" + set_light(1.5, 1,"#003300") /obj/machinery/turretid/emp_act(severity) if(enabled) From 43a1bd0241f268110b6eef66640df8eaffd721c4 Mon Sep 17 00:00:00 2001 From: PsiOmega Date: Tue, 9 Jun 2015 20:04:00 +0200 Subject: [PATCH 030/215] Changelog entry. --- html/changelogs/PsiOmegaDelta-TurretControlGlow.yml | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 html/changelogs/PsiOmegaDelta-TurretControlGlow.yml diff --git a/html/changelogs/PsiOmegaDelta-TurretControlGlow.yml b/html/changelogs/PsiOmegaDelta-TurretControlGlow.yml new file mode 100644 index 00000000000..35a230b9152 --- /dev/null +++ b/html/changelogs/PsiOmegaDelta-TurretControlGlow.yml @@ -0,0 +1,4 @@ +author: PsiOmegaDelta +delete-after: True +changes: + - rscadd: "Turret controls now glow, with the color depending on the current mode." From 399d810dba88647c098666faa64f319bf73028e4 Mon Sep 17 00:00:00 2001 From: PsiOmega Date: Tue, 9 Jun 2015 20:06:30 +0200 Subject: [PATCH 031/215] Improves turret control NanoUI template. Buttons are now disabled when the appropriate mode is selected, preventing them from turning blue on mouse hover. --- nano/templates/turret_control.tmpl | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/nano/templates/turret_control.tmpl b/nano/templates/turret_control.tmpl index 4e0e1acc89c..a529bcbb108 100644 --- a/nano/templates/turret_control.tmpl +++ b/nano/templates/turret_control.tmpl @@ -10,8 +10,8 @@ Turret Status:
    - {{:helper.link('Enabled', null, {'command' : 'enable', 'value' : 1}, null, data.enabled ?'redButton' : null)}} - {{:helper.link('Disabled',null, {'command' : 'enable', 'value' : 0}, null,!data.enabled ? 'selected' : null)}} + {{:helper.link('Enabled', null, {'command' : 'enable', 'value' : 1}, data.enabled ?'redButton' : null)}} + {{:helper.link('Disabled',null, {'command' : 'enable', 'value' : 0}, !data.enabled ? 'selected' : null)}}
@@ -21,8 +21,8 @@ Lethal Mode:
- {{:helper.link('On', null, {'command' : 'lethal', 'value' : 1}, null, data.lethal ?'redButton' : null)}} - {{:helper.link('Off',null, {'command' : 'lethal', 'value' : 0}, null,!data.lethal ? 'selected' : null)}} + {{:helper.link('On', null, {'command' : 'lethal', 'value' : 1}, data.lethal ?'redButton' : null)}} + {{:helper.link('Off',null, {'command' : 'lethal', 'value' : 0}, !data.lethal ? 'selected' : null)}}
{{/if}} @@ -33,8 +33,8 @@ {{:value.category}}
- {{:helper.link('On', null, {'command' : value.setting, 'value' : 1}, null, value.value ? 'selected' : null)}} - {{:helper.link('Off',null, {'command' : value.setting, 'value' : 0}, null,!value.value ? 'selected' : null)}} + {{:helper.link('On', null, {'command' : value.setting, 'value' : 1}, value.value ? 'selected' : null)}} + {{:helper.link('Off',null, {'command' : value.setting, 'value' : 0}, !value.value ? 'selected' : null)}}
{{/for}} From 581c9b13080e40da32f0938fbecfae9b23ca2ea2 Mon Sep 17 00:00:00 2001 From: PsiOmega Date: Tue, 9 Jun 2015 20:14:05 +0200 Subject: [PATCH 032/215] Fixes admin jumps. Changes the checks and message target around, now targets usr instead of src. --- code/modules/admin/verbs/adminjump.dm | 32 +++++++++++++-------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/code/modules/admin/verbs/adminjump.dm b/code/modules/admin/verbs/adminjump.dm index 1ff9a1d1cc6..e84543e88f4 100644 --- a/code/modules/admin/verbs/adminjump.dm +++ b/code/modules/admin/verbs/adminjump.dm @@ -8,8 +8,8 @@ set name = "Jump to Area" set desc = "Area to jump to" set category = "Admin" - if(!check_rights(R_ADMIN, user = src)) - src << "Only administrators may use this command." + if(!check_rights(R_ADMIN)) + usr << "Only administrators may use this command." return if(config.allow_admin_jump) @@ -25,8 +25,8 @@ /client/proc/jumptoturf(var/turf/T in world) set name = "Jump to Turf" set category = "Admin" - if(!check_rights(R_ADMIN, user = src)) - src << "Only administrators may use this command." + if(!check_rights(R_ADMIN)) + usr << "Only administrators may use this command." return if(config.allow_admin_jump) log_admin("[key_name(usr)] jumped to [T.x],[T.y],[T.z] in [T.loc]") @@ -42,8 +42,8 @@ set category = "Admin" set name = "Jump to Mob" - if(!check_rights(R_ADMIN, user = src)) - src << "Only administrators may use this command." + if(!check_rights(R_ADMIN)) + usr << "Only administrators may use this command." return if(config.allow_admin_jump) @@ -65,8 +65,8 @@ set category = "Admin" set name = "Jump to Coordinate" - if(!check_rights(R_ADMIN, user = src)) - src << "Only administrators may use this command." + if(!check_rights(R_ADMIN)) + usr << "Only administrators may use this command." return if (config.allow_admin_jump) @@ -86,8 +86,8 @@ set category = "Admin" set name = "Jump to Key" - if(!check_rights(R_ADMIN, user = src)) - src << "Only administrators may use this command." + if(!check_rights(R_ADMIN)) + usr << "Only administrators may use this command." return if(config.allow_admin_jump) @@ -111,8 +111,8 @@ set category = "Admin" set name = "Get Mob" set desc = "Mob to teleport" - if(!check_rights(R_ADMIN, user = src)) - src << "Only administrators may use this command." + if(!check_rights(R_ADMIN)) + usr << "Only administrators may use this command." return if(config.allow_admin_jump) log_admin("[key_name(usr)] teleported [key_name(M)]") @@ -128,8 +128,8 @@ set name = "Get Key" set desc = "Key to teleport" - if(!check_rights(R_ADMIN, user = src)) - src << "Only administrators may use this command." + if(!check_rights(R_ADMIN)) + usr << "Only administrators may use this command." return if(config.allow_admin_jump) @@ -155,8 +155,8 @@ /client/proc/sendmob(var/mob/M in sortmobs()) set category = "Admin" set name = "Send Mob" - if(!check_rights(R_ADMIN, user = src)) - src << "Only administrators may use this command." + if(!check_rights(R_ADMIN)) + usr << "Only administrators may use this command." return var/area/A = input(usr, "Pick an area.", "Pick an area") in return_sorted_areas() if(A) From 17488168ab3b53d08c7bf40d9f16835198f64234 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 9 Jun 2015 18:49:09 -0500 Subject: [PATCH 033/215] Fixes for #9731 and #9469. --- .../objects/items/weapons/grenades/chem_grenade.dm | 8 ++++++++ code/game/objects/items/weapons/grenades/grenade.dm | 10 ++++++---- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/code/game/objects/items/weapons/grenades/chem_grenade.dm b/code/game/objects/items/weapons/grenades/chem_grenade.dm index bb440d1215a..b07707107ce 100644 --- a/code/game/objects/items/weapons/grenades/chem_grenade.dm +++ b/code/game/objects/items/weapons/grenades/chem_grenade.dm @@ -5,6 +5,7 @@ desc = "A hand made chemical grenade." w_class = 2.0 force = 2.0 + det_time = null var/stage = 0 var/state = 0 var/path = 0 @@ -25,6 +26,7 @@ detonator.detached() usr.put_in_hands(detonator) detonator=null + det_time = null stage=0 icon_state = initial(icon_state) else if(beakers.len) @@ -60,6 +62,12 @@ user.remove_from_mob(det) det.loc = src detonator = det + if(istimer(detonator.a_left)) + var/obj/item/device/assembly/timer/T = detonator.a_left + det_time = 10*T.time + if(istimer(detonator.a_right)) + var/obj/item/device/assembly/timer/T = detonator.a_right + det_time = 10*T.time icon_state = initial(icon_state) +"_ass" name = "unsecured grenade with [beakers.len] containers[detonator?" and detonator":""]" stage = 1 diff --git a/code/game/objects/items/weapons/grenades/grenade.dm b/code/game/objects/items/weapons/grenades/grenade.dm index f5017538072..1565d321b67 100644 --- a/code/game/objects/items/weapons/grenades/grenade.dm +++ b/code/game/objects/items/weapons/grenades/grenade.dm @@ -47,6 +47,8 @@ if(det_time > 1) user << "The timer is set to [det_time/10] seconds." return + if(det_time == null) + return user << "\The [src] is set for instant detonation." @@ -89,16 +91,16 @@ /obj/item/weapon/grenade/attackby(obj/item/weapon/W as obj, mob/user as mob) if(isscrewdriver(W)) switch(det_time) - if ("1") + if (1) det_time = 10 user << "You set the [name] for 1 second detonation time." - if ("10") + if (10) det_time = 30 user << "You set the [name] for 3 second detonation time." - if ("30") + if (30) det_time = 50 user << "You set the [name] for 5 second detonation time." - if ("50") + if (50) det_time = 1 user << "You set the [name] for instant detonation." add_fingerprint(user) From b1368fb71205d57245b3600d4e44bb26935adfa0 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 9 Jun 2015 19:51:33 -0500 Subject: [PATCH 034/215] Changes chemgrenade time in description to be correct after failed detonation. --- code/game/objects/items/weapons/grenades/chem_grenade.dm | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/code/game/objects/items/weapons/grenades/chem_grenade.dm b/code/game/objects/items/weapons/grenades/chem_grenade.dm index b07707107ce..d90f76771ae 100644 --- a/code/game/objects/items/weapons/grenades/chem_grenade.dm +++ b/code/game/objects/items/weapons/grenades/chem_grenade.dm @@ -151,6 +151,13 @@ if(!has_reagents) icon_state = initial(icon_state) +"_locked" playsound(src.loc, 'sound/items/Screwdriver2.ogg', 50, 1) + spawn(0.001) //Otherwise det_time is erroneously set to 0 after this + if(istimer(detonator.a_left)) //Make sure description reflects that the timer has been reset + var/obj/item/device/assembly/timer/T = detonator.a_left + det_time = 10*T.time + if(istimer(detonator.a_right)) + var/obj/item/device/assembly/timer/T = detonator.a_right + det_time = 10*T.time return playsound(src.loc, 'sound/effects/bamf.ogg', 50, 1) From 72a716b66cd300de752e4db920726a977a510fb2 Mon Sep 17 00:00:00 2001 From: mwerezak Date: Tue, 9 Jun 2015 21:39:45 -0400 Subject: [PATCH 035/215] Attempts to make transferring reagents a bit more logical Attempts to give trans_to, touch, and trans_to_* procs more distinct purposes. Applying reagents to things now calls touch() before attempting to transfer reagents. Reagents that affect fire stacks now do so from touch. Fixes #9750 when combined with the above. Also fixes acid affect_touch dealing brute instead of burn. --- code/modules/reagents/Chemistry-Holder.dm | 97 ++++++++++++------- code/modules/reagents/Chemistry-Readme.dm | 13 ++- code/modules/reagents/Chemistry-Reagents.dm | 7 +- .../Chemistry-Reagents-Core.dm | 26 ++--- .../Chemistry-Reagents-Dispenser.dm | 8 +- .../Chemistry-Reagents-Other.dm | 11 +-- .../Chemistry-Reagents-Toxins.dm | 9 +- 7 files changed, 104 insertions(+), 67 deletions(-) diff --git a/code/modules/reagents/Chemistry-Holder.dm b/code/modules/reagents/Chemistry-Holder.dm index 6b5b9d7a0db..fcfd4b96c60 100644 --- a/code/modules/reagents/Chemistry-Holder.dm +++ b/code/modules/reagents/Chemistry-Holder.dm @@ -288,43 +288,13 @@ /* Holder-to-atom and similar procs */ -/datum/reagents/proc/touch(var/atom/target) // This picks the appropriate reaction. Reagents are not guaranteed to transfer to the target. - if(ismob(target)) - touch_mob(target) - if(isturf(target)) - touch_turf(target) - if(isobj(target)) - touch_obj(target) - return - -/datum/reagents/proc/touch_mob(var/mob/target) - if(!target || !istype(target)) - return - - for(var/datum/reagent/current in reagent_list) - current.touch_mob(target) - - update_total() - -/datum/reagents/proc/touch_turf(var/turf/target) - if(!target || !istype(target)) - return - - for(var/datum/reagent/current in reagent_list) - current.touch_turf(target) - - update_total() - -/datum/reagents/proc/touch_obj(var/obj/target) - if(!target || !istype(target)) - return - - for(var/datum/reagent/current in reagent_list) - current.touch_obj(target) - - update_total() - +//The general proc for applying reagents to things. This proc assumes the reagents are being applied externally, +//not directly injected into the contents. It first calls touch, then the appropriate trans_to_*() or splash_mob(). +//If for some reason touch effects are bypassed (e.g. injecting stuff directly into a reagent container or person), +//call the appropriate trans_to_*() proc. /datum/reagents/proc/trans_to(var/atom/target, var/amount = 1, var/multiplier = 1, var/copy = 0) + touch(target) //First, handle mere touch effects + if(ismob(target)) //warning("[my_atom] is trying to transfer reagents to [target], which is a mob, using trans_to()") //return trans_to_mob(target, amount, multiplier, copy) @@ -351,9 +321,62 @@ return F.trans_to(target, amount) // Let this proc check the atom's type +// When applying reagents to an atom externally, touch() is called to trigger any on-touch effects of the reagent. +// This does not handle transferring reagents to things. +// For example, splashing someone with water will get them wet and extinguish them if they are on fire, +// even if they are wearing an impermeable suit that prevents the reagents from contacting the skin. +/datum/reagents/proc/touch(var/atom/target) + if(ismob(target)) + touch_mob(target) + if(isturf(target)) + touch_turf(target) + if(isobj(target)) + touch_obj(target) + return + +/datum/reagents/proc/touch_mob(var/mob/target) + if(!target || !istype(target)) + return + + for(var/datum/reagent/current in reagent_list) + current.touch_mob(target, current.volume) + + update_total() + +/datum/reagents/proc/touch_turf(var/turf/target) + if(!target || !istype(target)) + return + + for(var/datum/reagent/current in reagent_list) + current.touch_turf(target, current.volume) + + update_total() + +/datum/reagents/proc/touch_obj(var/obj/target) + if(!target || !istype(target)) + return + + for(var/datum/reagent/current in reagent_list) + current.touch_obj(target, current.volume) + + update_total() + +// Attempts to place a reagent on the mob's skin. +// Reagents are not guaranteed to transfer to the target. /datum/reagents/proc/splash_mob(var/mob/target, var/amount = 1, var/clothes = 1) var/perm = 0 - var/list/L = list("head" = THERMAL_PROTECTION_HEAD, "upper_torso" = THERMAL_PROTECTION_UPPER_TORSO, "lower_torso" = THERMAL_PROTECTION_LOWER_TORSO, "legs" = THERMAL_PROTECTION_LEG_LEFT + THERMAL_PROTECTION_LEG_RIGHT, "feet" = THERMAL_PROTECTION_FOOT_LEFT + THERMAL_PROTECTION_FOOT_RIGHT, "arms" = THERMAL_PROTECTION_ARM_LEFT + THERMAL_PROTECTION_ARM_RIGHT, "hands" = THERMAL_PROTECTION_HAND_LEFT + THERMAL_PROTECTION_HAND_RIGHT) + + //this all seems very human-specific + var/list/L = list( + "head" = THERMAL_PROTECTION_HEAD, + "upper_torso" = THERMAL_PROTECTION_UPPER_TORSO, + "lower_torso" = THERMAL_PROTECTION_LOWER_TORSO, + "legs" = THERMAL_PROTECTION_LEG_LEFT + THERMAL_PROTECTION_LEG_RIGHT, + "feet" = THERMAL_PROTECTION_FOOT_LEFT + THERMAL_PROTECTION_FOOT_RIGHT, + "arms" = THERMAL_PROTECTION_ARM_LEFT + THERMAL_PROTECTION_ARM_RIGHT, + "hands" = THERMAL_PROTECTION_HAND_LEFT + THERMAL_PROTECTION_HAND_RIGHT + ) + if(clothes) for(var/obj/item/clothing/C in target.get_equipped_items()) if(C.permeability_coefficient == 1 || C.body_parts_covered == 0) diff --git a/code/modules/reagents/Chemistry-Readme.dm b/code/modules/reagents/Chemistry-Readme.dm index 399e856bf33..cb3c6a8458c 100644 --- a/code/modules/reagents/Chemistry-Readme.dm +++ b/code/modules/reagents/Chemistry-Readme.dm @@ -88,7 +88,12 @@ About the Holder: Transfers [amount] reagents from [src] to [target], multiplying them by [multiplier]. Returns actual amount removed from [src] (not amount transferred to [target]). If [copy] is 1, copies reagents instead. touch(var/atom/target) - Not recommended to use. Calls touch_mob(target), touch_turf(target), or touch_obj(target), depending on target's type. + When applying reagents to an atom externally, touch() is called to trigger any on-touch effects of the reagent. + This does not handle transferring reagents to things. + For example, splashing someone with water will get them wet and extinguish them if they are on fire, + even if they are wearing an impermeable suit that prevents the reagents from contacting the skin. + Basically just defers to touch_mob(target), touch_turf(target), or touch_obj(target), depending on target's type. + Not recommended to use this directly, since trans_to() calls it before attempting to transfer. touch_mob(var/mob/target) Calls each reagent's touch_mob(target). @@ -100,7 +105,11 @@ About the Holder: Calls each reagent's touch_obj(target). trans_to(var/atom/target, var/amount = 1, var/multiplier = 1, var/copy = 0) - Checks the type of [target], calling splash_mob(target, amount), trans_to_turf(target, amount, multiplier, copy), or trans_to_obj(target, amount, multiplier, copy). + The general proc for applying reagents to things externally (as opposed to directly injected into the contents). + It first calls touch, then the appropriate trans_to_*() or splash_mob(). + If for some reason you want touch effects to be bypassed (e.g. injecting stuff directly into a reagent container or person), call the appropriate trans_to_*() proc. + + Calls touch() before checking the type of [target], calling splash_mob(target, amount), trans_to_turf(target, amount, multiplier, copy), or trans_to_obj(target, amount, multiplier, copy). trans_id_to(var/atom/target, var/id, var/amount = 1) Transfers [amount] of [id] to [target]. Returns amount transferred. diff --git a/code/modules/reagents/Chemistry-Reagents.dm b/code/modules/reagents/Chemistry-Reagents.dm index 0e0da75e2a6..13c7aaf7bca 100644 --- a/code/modules/reagents/Chemistry-Reagents.dm +++ b/code/modules/reagents/Chemistry-Reagents.dm @@ -24,13 +24,14 @@ /datum/reagent/proc/remove_self(var/amount) // Shortcut holder.remove_reagent(id, amount) -/datum/reagent/proc/touch_mob(var/mob/M) // This doesn't apply to being splashed - this is for, e.g. extinguishers and sprays. The difference is that reagent is not on the mob - it's in another object. +// This doesn't apply to skin contact - this is for, e.g. extinguishers and sprays. The difference is that reagent is not directly on the mob's skin - it might just be on their clothing. +/datum/reagent/proc/touch_mob(var/mob/M, var/amount) return -/datum/reagent/proc/touch_obj(var/obj/O) // Acid melting, cleaner cleaning, etc +/datum/reagent/proc/touch_obj(var/obj/O, var/amount) // Acid melting, cleaner cleaning, etc return -/datum/reagent/proc/touch_turf(var/turf/T) // Cleaner cleaning, lube lubbing, etc, all go here +/datum/reagent/proc/touch_turf(var/turf/T, var/amount) // Cleaner cleaning, lube lubbing, etc, all go here return /datum/reagent/proc/on_mob_life(var/mob/living/carbon/M, var/alien, var/location) // Currently, on_mob_life is called on carbons. Any interaction with non-carbon mobs (lube) will need to be done in touch_mob. diff --git a/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Core.dm b/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Core.dm index d957e88a4c7..7d73b1ce201 100644 --- a/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Core.dm +++ b/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Core.dm @@ -155,6 +155,17 @@ if(!cube.wrapped) cube.Expand() +/datum/reagent/water/touch_mob(var/mob/living/L, var/amount) + if(istype(L)) + var/needed = L.fire_stacks * 10 + if(amount > needed) + L.fire_stacks = 0 + L.ExtinguishMob() + remove_self(needed) + else + L.adjust_fire_stacks(-(amount / 10)) + remove_self(amount) + /datum/reagent/water/affect_touch(var/mob/living/carbon/M, var/alien, var/removed) if(istype(M, /mob/living/carbon/slime)) var/mob/living/carbon/slime/S = M @@ -165,15 +176,6 @@ ++S.Discipline if(dose == removed) S.visible_message("[S]'s flesh sizzles where the water touches it!", "Your flesh burns in the water!") - var/needed = M.fire_stacks * 10 - if(volume > needed) - M.fire_stacks = 0 - M.ExtinguishMob() - remove_self(needed) - else - M.adjust_fire_stacks(-(volume / 10)) - remove_self(volume) - return /datum/reagent/fuel name = "Welding fuel" @@ -194,5 +196,7 @@ /datum/reagent/fuel/affect_blood(var/mob/living/carbon/M, var/alien, var/removed) M.adjustToxLoss(2 * removed) -/datum/reagent/fuel/affect_touch(var/mob/living/carbon/M, var/alien, var/removed) // Splashing people with welding fuel to make them easy to ignite! - M.adjust_fire_stacks(0.1 * removed) +/datum/reagent/fuel/touch_mob(var/mob/living/L, var/amount) + if(istype(L)) + L.adjust_fire_stacks(amount / 10) // Splashing people with welding fuel to make them easy to ignite! + diff --git a/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Dispenser.dm b/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Dispenser.dm index b9caf096d65..5822b6edf86 100644 --- a/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Dispenser.dm +++ b/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Dispenser.dm @@ -70,9 +70,9 @@ glass_name = "glass of ethanol" glass_desc = "A well-known alcohol with a variety of applications." -/datum/reagent/ethanol/affect_touch(var/mob/living/carbon/M, var/alien, var/removed) - M.adjust_fire_stacks(removed / 15) - return +/datum/reagent/ethanol/touch_mob(var/mob/living/L, var/amount) + if(istype(L)) + L.adjust_fire_stacks(amount / 15) /datum/reagent/ethanol/affect_blood(var/mob/living/carbon/M, var/alien, var/removed) M.adjustToxLoss(removed * 2 * toxicity) @@ -318,7 +318,7 @@ return if(volume < meltdose) // Not enough to melt anything - M.take_organ_damage(removed * power * 0.2) + M.take_organ_damage(0, removed * power * 0.2) //burn damage, since it causes chemical burns. Acid doesn't make bones shatter, like brute trauma would. return if(!M.unacidable && removed > 0) if(istype(M, /mob/living/carbon/human) && volume >= meltdose) diff --git a/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Other.dm b/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Other.dm index 0b57ef93725..63cfb46235e 100644 --- a/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Other.dm +++ b/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Other.dm @@ -67,10 +67,7 @@ /datum/reagent/paint/touch_mob(var/mob/M) if(istype(M) && !istype(M, /mob/dead)) //painting ghosts: not allowed - M.color = color - -/datum/reagent/paint/affect_touch(var/mob/living/carbon/M, var/alien, var/removed) - M.color = color + M.color = color //maybe someday change this to paint only clothes and exposed body parts for human mobs. /datum/reagent/paint/get_data() return color @@ -265,9 +262,9 @@ remove_self(5) return -/datum/reagent/thermite/affect_touch(var/mob/living/carbon/M, var/alien, var/removed) - M.adjust_fire_stacks(removed * 0.2) - return +/datum/reagent/thermite/touch_mob(var/mob/living/L, var/amount) + if(istype(L)) + L.adjust_fire_stacks(amount / 5) /datum/reagent/thermite/affect_blood(var/mob/living/carbon/M, var/alien, var/removed) M.adjustFireLoss(3 * removed) diff --git a/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Toxins.dm b/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Toxins.dm index 92b6b67796a..fcf2f658a0a 100644 --- a/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Toxins.dm +++ b/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Toxins.dm @@ -45,9 +45,12 @@ color = "#9D14DB" strength = 30 +/datum/reagent/toxin/phoron/touch_mob(var/mob/living/L, var/amount) + if(istype(L)) + L.adjust_fire_stacks(amount / 5) + /datum/reagent/toxin/phoron/affect_touch(var/mob/living/carbon/M, var/alien, var/removed) - ..() - M.adjust_fire_stacks(removed / 5) + M.take_organ_damage(0, removed * 0.1) //being splashed directly with phoron causes minor chemical burns /datum/reagent/toxin/phoron/touch_turf(var/turf/simulated/T) if(!istype(T)) @@ -494,7 +497,7 @@ /datum/reagent/nanites/affect_touch(var/mob/living/carbon/M, var/alien, var/removed) if(prob(10)) - M.contract_disease(new /datum/disease/robotic_transformation(0), 1) + M.contract_disease(new /datum/disease/robotic_transformation(0), 1) //What /datum/reagent/nanites/affect_blood(var/mob/living/carbon/M, var/alien, var/removed) M.contract_disease(new /datum/disease/robotic_transformation(0), 1) From 2dbd0ac007209b54df5cf4befe6c5c1ef204eaa2 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 9 Jun 2015 22:02:14 -0500 Subject: [PATCH 036/215] Fixes formatting for spawn() before updating description. --- .../objects/items/weapons/grenades/chem_grenade.dm | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/code/game/objects/items/weapons/grenades/chem_grenade.dm b/code/game/objects/items/weapons/grenades/chem_grenade.dm index d90f76771ae..d181fa38c29 100644 --- a/code/game/objects/items/weapons/grenades/chem_grenade.dm +++ b/code/game/objects/items/weapons/grenades/chem_grenade.dm @@ -152,12 +152,12 @@ icon_state = initial(icon_state) +"_locked" playsound(src.loc, 'sound/items/Screwdriver2.ogg', 50, 1) spawn(0.001) //Otherwise det_time is erroneously set to 0 after this - if(istimer(detonator.a_left)) //Make sure description reflects that the timer has been reset - var/obj/item/device/assembly/timer/T = detonator.a_left - det_time = 10*T.time - if(istimer(detonator.a_right)) - var/obj/item/device/assembly/timer/T = detonator.a_right - det_time = 10*T.time + if(istimer(detonator.a_left)) //Make sure description reflects that the timer has been reset + var/obj/item/device/assembly/timer/T = detonator.a_left + det_time = 10*T.time + if(istimer(detonator.a_right)) + var/obj/item/device/assembly/timer/T = detonator.a_right + det_time = 10*T.time return playsound(src.loc, 'sound/effects/bamf.ogg', 50, 1) From 13a43e6cfd14cf5c876110ec950d09b0de71df4c Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 9 Jun 2015 22:35:16 -0500 Subject: [PATCH 037/215] Changes description update spawn() to use 0 instead of small decimal. --- code/game/objects/items/weapons/grenades/chem_grenade.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/game/objects/items/weapons/grenades/chem_grenade.dm b/code/game/objects/items/weapons/grenades/chem_grenade.dm index d181fa38c29..34dab3bc6e1 100644 --- a/code/game/objects/items/weapons/grenades/chem_grenade.dm +++ b/code/game/objects/items/weapons/grenades/chem_grenade.dm @@ -151,7 +151,7 @@ if(!has_reagents) icon_state = initial(icon_state) +"_locked" playsound(src.loc, 'sound/items/Screwdriver2.ogg', 50, 1) - spawn(0.001) //Otherwise det_time is erroneously set to 0 after this + spawn(0) //Otherwise det_time is erroneously set to 0 after this if(istimer(detonator.a_left)) //Make sure description reflects that the timer has been reset var/obj/item/device/assembly/timer/T = detonator.a_left det_time = 10*T.time From 8007d4278319d63af090bdb7cd94d1b58c1d93c3 Mon Sep 17 00:00:00 2001 From: mwerezak Date: Wed, 10 Jun 2015 00:03:08 -0400 Subject: [PATCH 038/215] Adjusts usages of reagent transfer procs Adds splash() proc for futureproofing. Replaces instances of splash_mob() with splash() Replaces instances of trans_to() with splash() where appropriate. --- code/game/objects/effects/chem/water.dm | 2 +- code/game/objects/items/toys.dm | 2 +- code/modules/reagents/Chemistry-Holder.dm | 6 ++++++ code/modules/reagents/Chemistry-Readme.dm | 1 + code/modules/reagents/reagent_containers.dm | 2 +- code/modules/reagents/reagent_containers/dropper.dm | 2 +- .../reagents/reagent_containers/food/drinks/bottle.dm | 2 +- code/modules/reagents/reagent_containers/food/snacks.dm | 2 +- code/modules/reagents/reagent_containers/glass.dm | 2 +- code/modules/reagents/reagent_containers/spray.dm | 4 ++-- 10 files changed, 16 insertions(+), 9 deletions(-) diff --git a/code/game/objects/effects/chem/water.dm b/code/game/objects/effects/chem/water.dm index eac107923ed..30f436db9a3 100644 --- a/code/game/objects/effects/chem/water.dm +++ b/code/game/objects/effects/chem/water.dm @@ -30,7 +30,7 @@ else if(ismob(A) && !M) M = A if(M) - reagents.splash_mob(M, reagents.total_volume) + reagents.trans_to(M, reagents.total_volume) break if(T == get_turf(target)) break diff --git a/code/game/objects/items/toys.dm b/code/game/objects/items/toys.dm index 8290296fe00..dcb12f2a5de 100644 --- a/code/game/objects/items/toys.dm +++ b/code/game/objects/items/toys.dm @@ -61,7 +61,7 @@ else if(O.reagents.total_volume >= 1) if(O.reagents.has_reagent("pacid", 1)) user << "The acid chews through the balloon!" - O.reagents.splash_mob(user, reagents.total_volume) + O.reagents.splash(user, reagents.total_volume) qdel(src) else src.desc = "A translucent balloon with some form of liquid sloshing around in it." diff --git a/code/modules/reagents/Chemistry-Holder.dm b/code/modules/reagents/Chemistry-Holder.dm index fcfd4b96c60..f346f174915 100644 --- a/code/modules/reagents/Chemistry-Holder.dm +++ b/code/modules/reagents/Chemistry-Holder.dm @@ -305,6 +305,11 @@ return trans_to_obj(target, amount, multiplier, copy) return 0 +//Using this in case we want to differentiate splashing an atom from transferring reagents to it later down the road. +//For now it just calls trans_to. +/datum/reagents/proc/splash(var/atom/target, var/amount = 1, var/multiplier = 1, var/copy = 0) + trans_to(target, amount, multiplier, copy) + /datum/reagents/proc/trans_id_to(var/atom/target, var/id, var/amount = 1) if (!target || !target.reagents) return @@ -363,6 +368,7 @@ // Attempts to place a reagent on the mob's skin. // Reagents are not guaranteed to transfer to the target. +// Do not call this directly, call trans_to() instead. /datum/reagents/proc/splash_mob(var/mob/target, var/amount = 1, var/clothes = 1) var/perm = 0 diff --git a/code/modules/reagents/Chemistry-Readme.dm b/code/modules/reagents/Chemistry-Readme.dm index cb3c6a8458c..9a49d409e08 100644 --- a/code/modules/reagents/Chemistry-Readme.dm +++ b/code/modules/reagents/Chemistry-Readme.dm @@ -116,6 +116,7 @@ About the Holder: splash_mob(var/mob/target, var/amount = 1, var/clothes = 1) Checks mob's clothing if [clothes] is 1 and transfers [amount] reagents to mob's skin. + Don't call this directly. Call apply_to() instead. trans_to_mob(var/mob/target, var/amount = 1, var/type = CHEM_BLOOD, var/multiplier = 1, var/copy = 0) Transfers [amount] reagents to the mob's appropriate holder, depending on [type]. Ignores protection. diff --git a/code/modules/reagents/reagent_containers.dm b/code/modules/reagents/reagent_containers.dm index 2d0a1469b58..39c6075ae26 100644 --- a/code/modules/reagents/reagent_containers.dm +++ b/code/modules/reagents/reagent_containers.dm @@ -72,7 +72,7 @@ msg_admin_attack("[user.name] ([user.ckey]) splashed [target.name] ([target.key]) with [name]. Reagents: [contained] (INTENT: [uppertext(user.a_intent)]) (JMP)") user.visible_message("[target] has been splashed with something by [user]!", "You splash the solution onto [target].") - reagents.splash_mob(target, reagents.total_volume) + reagents.splash(target, reagents.total_volume) return 1 /obj/item/weapon/reagent_containers/proc/self_feed_message(var/mob/user) diff --git a/code/modules/reagents/reagent_containers/dropper.dm b/code/modules/reagents/reagent_containers/dropper.dm index c67c6ab7de6..44fd6b1a497 100644 --- a/code/modules/reagents/reagent_containers/dropper.dm +++ b/code/modules/reagents/reagent_containers/dropper.dm @@ -64,7 +64,7 @@ return else - trans = reagents.trans_to(target, amount_per_transfer_from_this) + trans = reagents.splash(target, amount_per_transfer_from_this) //sprinkling reagents on generic non-mobs user << "You transfer [trans] units of the solution." else // Taking from something diff --git a/code/modules/reagents/reagent_containers/food/drinks/bottle.dm b/code/modules/reagents/reagent_containers/food/drinks/bottle.dm index e6b1308603d..7e289a45f35 100644 --- a/code/modules/reagents/reagent_containers/food/drinks/bottle.dm +++ b/code/modules/reagents/reagent_containers/food/drinks/bottle.dm @@ -78,7 +78,7 @@ //The reagents in the bottle splash all over the target, thanks for the idea Nodrak if(reagents) user.visible_message("The contents of the [src] splash all over [target]!") - reagents.splash_mob(target, reagents.total_volume) + reagents.splash(target, reagents.total_volume) //Finally, smash the bottle. This kills (qdel) the bottle. src.smash(target, user) diff --git a/code/modules/reagents/reagent_containers/food/snacks.dm b/code/modules/reagents/reagent_containers/food/snacks.dm index 65257f7d035..4f828d23a31 100644 --- a/code/modules/reagents/reagent_containers/food/snacks.dm +++ b/code/modules/reagents/reagent_containers/food/snacks.dm @@ -483,7 +483,7 @@ /obj/item/weapon/reagent_containers/food/snacks/egg/throw_impact(atom/hit_atom) ..() new/obj/effect/decal/cleanable/egg_smudge(src.loc) - src.reagents.trans_to(hit_atom, reagents.total_volume) + src.reagents.splash(hit_atom, reagents.total_volume) src.visible_message("\red [src.name] has been squashed.","\red You hear a smack.") qdel(src) diff --git a/code/modules/reagents/reagent_containers/glass.dm b/code/modules/reagents/reagent_containers/glass.dm index 836b500df34..26f58fb4712 100644 --- a/code/modules/reagents/reagent_containers/glass.dm +++ b/code/modules/reagents/reagent_containers/glass.dm @@ -88,7 +88,7 @@ if(reagents.total_volume) user << "You splash the solution onto [target]." - reagents.trans_to(target, reagents.total_volume) + reagents.splash(target, reagents.total_volume) return attackby(obj/item/weapon/W as obj, mob/user as mob) diff --git a/code/modules/reagents/reagent_containers/spray.dm b/code/modules/reagents/reagent_containers/spray.dm index c041f529eea..0da6f7e0c4c 100644 --- a/code/modules/reagents/reagent_containers/spray.dm +++ b/code/modules/reagents/reagent_containers/spray.dm @@ -53,7 +53,7 @@ /obj/item/weapon/reagent_containers/spray/proc/Spray_at(atom/A as mob|obj, mob/user as mob, proximity) if (A.density && proximity) A.visible_message("[usr] sprays [A] with [src].") - reagents.trans_to(A, amount_per_transfer_from_this) + reagents.splash(A, amount_per_transfer_from_this) else spawn(0) var/obj/effect/effect/water/chempuff/D = new/obj/effect/effect/water/chempuff(get_turf(src)) @@ -88,7 +88,7 @@ return if(isturf(usr.loc)) usr << "You empty \the [src] onto the floor." - reagents.trans_to(usr.loc, reagents.total_volume) + reagents.splash(usr.loc, reagents.total_volume) //space cleaner /obj/item/weapon/reagent_containers/spray/cleaner From 58d512d1e6a21f6cbc74190e1f5b4801d79d690e Mon Sep 17 00:00:00 2001 From: mwerezak Date: Wed, 10 Jun 2015 00:49:26 -0400 Subject: [PATCH 039/215] Fixes tajaran name generation, tweaks --- code/modules/mob/language/station.dm | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/code/modules/mob/language/station.dm b/code/modules/mob/language/station.dm index d5900769b35..82ee92232d7 100644 --- a/code/modules/mob/language/station.dm +++ b/code/modules/mob/language/station.dm @@ -41,18 +41,18 @@ colour = "tajaran" key = "j" flags = WHITELISTED - syllables = list("rr","rr","tajr","kir","raj","kii","mir","kra","ahk","nal","vah","khaz","jri","ran","darr", \ - "mi","jri","dynh","manq","rhe","zar","rrhaz","kal","chur","eech","thaa","dra","jurl","mah","sanu","dra","ii'r", \ - "ka","aasi","far","wa","baq","ara","qara","zir","sam","mak","hrar","nja","rir","khan","jun","dar","rik","kah", \ - "hal","ket","jurl","mah","tul","cresh","azu","ragh", "mro", "mra") + syllables = list("mrr","rr","tajr","kir","raj","kii","mir","kra","ahk","nal","vah","khaz","jri","ran","darr", + "mi","jri","dynh","manq","rhe","zar","rrhaz","kal","chur","eech","thaa","dra","jurl","mah","sanu","dra","ii'r", + "ka","aasi","far","wa","baq","ara","qara","zir","sam","mak","hrar","nja","rir","khan","jun","dar","rik","kah", + "hal","ket","jurl","mah","tul","cresh","azu","ragh","mro","mra","mrro","mrra") /datum/language/tajaran/get_random_name(var/gender) var/new_name = ..(gender,1) - if(prob(80)) - new_name += " [pick(list("Hadii","Kaytam","Zhan-Khazan","Hharar","Njarir'Akhan"))]" + if(prob(50)) + new_name += " [pick(list("Hadii","Kaytam","Nazkiin","Zhan-Khazan","Hharar","Njarir'Akhan","Faaira'Nrezi","Rhezar","Mi'dynh","Rrhazkal","Bayan","Al'Manq","Mi'jri","Chur'eech","Sanu'dra","Ii'rka"))]" else - new_name += ..(gender,1) + new_name += " [..(gender,1)]" return new_name /datum/language/skrell From 449c8c8d8f96accce324e074a539fe646dc8b19d Mon Sep 17 00:00:00 2001 From: PsiOmegaDelta Date: Wed, 10 Jun 2015 10:08:17 +0200 Subject: [PATCH 040/215] Refactors the ghost_follow_link proc to not use istype checks. --- code/modules/mob/dead/observer/observer.dm | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/code/modules/mob/dead/observer/observer.dm b/code/modules/mob/dead/observer/observer.dm index 9f023b04697..37aecab0432 100644 --- a/code/modules/mob/dead/observer/observer.dm +++ b/code/modules/mob/dead/observer/observer.dm @@ -682,15 +682,18 @@ mob/dead/observer/MayRespawn(var/feedback = 0) return 0 return 1 +/atom/proc/extra_ghost_link() + return + +/mob/extra_ghost_link(var/atom/ghost) + if(mind && eyeobj) + return "|eye" + +/mob/dead/observer/extra_ghost_link(var/atom/ghost) + if(mind && mind.current) + return "|body" + /proc/ghost_follow_link(var/atom/target, var/atom/ghost) if((!target) || (!ghost)) return . = "follow" - - if(istype(target, /mob/dead/observer)) - var/mob/dead/observer/O = target - if(O.mind && O.mind.current) - . += "|body" - else if(istype(target, /mob)) // Eye follow links - var/mob/M = target - if(M.client && M.eyeobj) // No point following clientless eyes - . += "|eye" + . += target.extra_ghost_link(ghost) From b44da1ee42dcb852ac3959d175eb68a343e0eea6 Mon Sep 17 00:00:00 2001 From: PsiOmegaDelta Date: Wed, 10 Jun 2015 10:55:23 +0200 Subject: [PATCH 041/215] Admin JMP now includes a link to EYE or BDY if any. --- code/game/verbs/ooc.dm | 2 +- code/modules/admin/admin.dm | 8 +++---- code/modules/admin/topic.dm | 26 ++++++++++++++++++++-- code/modules/admin/verbs/adminsay.dm | 4 ++-- code/modules/admin/verbs/pray.dm | 6 ++--- code/modules/mob/dead/observer/observer.dm | 2 +- code/modules/mob/mob_helpers.dm | 2 +- code/modules/paperwork/faxmachine.dm | 2 +- 8 files changed, 37 insertions(+), 15 deletions(-) diff --git a/code/game/verbs/ooc.dm b/code/game/verbs/ooc.dm index fa4f88083f5..9d40b49bcf5 100644 --- a/code/game/verbs/ooc.dm +++ b/code/game/verbs/ooc.dm @@ -125,7 +125,7 @@ if(target in admins) admin_stuff += "/([key])" if(target != src) - admin_stuff += "(JMP)" + admin_stuff += "([admin_jump_link(mob, target.holder)])" if(target.mob in heard) send = 1 diff --git a/code/modules/admin/admin.dm b/code/modules/admin/admin.dm index 5e486c195a8..bdf9e43bb92 100644 --- a/code/modules/admin/admin.dm +++ b/code/modules/admin/admin.dm @@ -58,7 +58,7 @@ proc/admin_notice(var/message, var/rights) TP - PM - SM - - JMP\]
+ [admin_jump_link(M, src)]\]
Mob type = [M.type]

Kick | Warn | @@ -1306,15 +1306,15 @@ proc/admin_notice(var/message, var/rights) if(2) //Admins var/ref_mob = "\ref[M]" - return "[key_name(C, link, name, highlight_special)](?) (PP) (VV) (SM) (JMP) (CA)" + return "[key_name(C, link, name, highlight_special)](?) (PP) (VV) (SM) ([admin_jump_link(M, src)]) (CA)" if(3) //Devs var/ref_mob = "\ref[M]" - return "[key_name(C, link, name, highlight_special)](VV)(JMP)" + return "[key_name(C, link, name, highlight_special)](VV)([admin_jump_link(ref_mob, src)])" if(4) //Mentors var/ref_mob = "\ref[M]" - return "[key_name(C, link, name, highlight_special)] (?) (PP) (VV) (SM) (JMP)" + return "[key_name(C, link, name, highlight_special)] (?) (PP) (VV) (SM) ([admin_jump_link(ref_mob, src)])" /proc/ishost(whom) diff --git a/code/modules/admin/topic.dm b/code/modules/admin/topic.dm index e780c9fd5df..65d466164b8 100644 --- a/code/modules/admin/topic.dm +++ b/code/modules/admin/topic.dm @@ -1247,7 +1247,7 @@ src.owner << "Name = [M.name]; Real_name = [M.real_name]; Mind_name = [M.mind?"[M.mind.name]":""]; Key = [M.key];" src.owner << "Location = [location_description];" src.owner << "[special_role_description]" - src.owner << "(PM) (PP) (VV) (SM) (JMP) (CA)" + src.owner << "(PM) (PP) (VV) (SM) ([admin_jump_link(M, src)]) (CA)" else if(href_list["adminspawncookie"]) if(!check_rights(R_ADMIN|R_FUN)) return @@ -2659,4 +2659,26 @@ mob/living/carbon/human/can_centcom_reply() return istype(l_ear, /obj/item/device/radio/headset) || istype(r_ear, /obj/item/device/radio/headset) mob/living/silicon/ai/can_centcom_reply() - return common_radio != null && !check_unable(2) \ No newline at end of file + return common_radio != null && !check_unable(2) + +/atom/proc/extra_admin_link() + return + +/mob/extra_admin_link(var/source) + if(client && eyeobj) + return "|EYE" + +/mob/dead/observer/extra_admin_link(var/source) + if(mind && mind.current) + return "|BDY" + +/proc/admin_jump_link(var/atom/target, var/source) + if(!target) return + // The way admin jump links handle their src is weirdly inconsistent... + if(istype(source, /datum/admins)) + source = "src=\ref[source]" + else + source = "_src_=holder" + + . = "JMP" + . += target.extra_admin_link(source) diff --git a/code/modules/admin/verbs/adminsay.dm b/code/modules/admin/verbs/adminsay.dm index fdbbe8d4e1e..84764b55aaa 100644 --- a/code/modules/admin/verbs/adminsay.dm +++ b/code/modules/admin/verbs/adminsay.dm @@ -12,7 +12,7 @@ if(check_rights(R_ADMIN,0)) for(var/client/C in admins) if(R_ADMIN & C.holder.rights) - C << "" + create_text_tag("admin", "ADMIN:", C) + " [key_name(usr, 1)](JMP): [msg]" + C << "" + create_text_tag("admin", "ADMIN:", C) + " [key_name(usr, 1)]([admin_jump_link(mob, src)]): [msg]" feedback_add_details("admin_verb","M") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! @@ -33,6 +33,6 @@ if(check_rights(R_ADMIN, 0)) sender_name = "[sender_name]" for(var/client/C in admins) - C << "" + create_text_tag("mod", "MOD:", C) + " [sender_name](JMP): [msg]" + C << "" + create_text_tag("mod", "MOD:", C) + " [sender_name]([admin_jump_link(mob, C.holder)]): [msg]" feedback_add_details("admin_verb","MS") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! diff --git a/code/modules/admin/verbs/pray.dm b/code/modules/admin/verbs/pray.dm index d987c52260b..dc4b79c0058 100644 --- a/code/modules/admin/verbs/pray.dm +++ b/code/modules/admin/verbs/pray.dm @@ -17,7 +17,7 @@ return var/image/cross = image('icons/obj/storage.dmi',"bible") - msg = "\blue \icon[cross] PRAY: [key_name(src, 1)] (?) (PP) (VV) (SM) (JMP) (CA) (SC): [msg]" + msg = "\blue \icon[cross] PRAY: [key_name(src, 1)] (?) (PP) (VV) (SM) ([admin_jump_link(src, src)]) (CA) (SC): [msg]" for(var/client/C in admins) if(R_ADMIN & C.holder.rights) @@ -29,13 +29,13 @@ //log_admin("HELP: [key_name(src)]: [msg]") /proc/Centcomm_announce(var/msg, var/mob/Sender, var/iamessage) - msg = "\blue CENTCOMM[iamessage ? " IA" : ""]:[key_name(Sender, 1)] (PP) (VV) (SM) (JMP) (CA) (BSA) (RPLY): [msg]" + msg = "\blue CENTCOMM[iamessage ? " IA" : ""]:[key_name(Sender, 1)] (PP) (VV) (SM) ([admin_jump_link(Sender, src)]) (CA) (BSA) (RPLY): [msg]" for(var/client/C in admins) if(R_ADMIN & C.holder.rights) C << msg /proc/Syndicate_announce(var/msg, var/mob/Sender) - msg = "\blue ILLEGAL:[key_name(Sender, 1)] (PP) (VV) (SM) (JMP) (CA) (BSA) (RPLY): [msg]" + msg = "\blue ILLEGAL:[key_name(Sender, 1)] (PP) (VV) (SM) ([admin_jump_link(Sender, src)]) (CA) (BSA) (RPLY): [msg]" for(var/client/C in admins) if(R_ADMIN & C.holder.rights) C << msg diff --git a/code/modules/mob/dead/observer/observer.dm b/code/modules/mob/dead/observer/observer.dm index 37aecab0432..85b71aef4fd 100644 --- a/code/modules/mob/dead/observer/observer.dm +++ b/code/modules/mob/dead/observer/observer.dm @@ -686,7 +686,7 @@ mob/dead/observer/MayRespawn(var/feedback = 0) return /mob/extra_ghost_link(var/atom/ghost) - if(mind && eyeobj) + if(client && eyeobj) return "|eye" /mob/dead/observer/extra_ghost_link(var/atom/ghost) diff --git a/code/modules/mob/mob_helpers.dm b/code/modules/mob/mob_helpers.dm index 563c7c5551d..324c99b0b1b 100644 --- a/code/modules/mob/mob_helpers.dm +++ b/code/modules/mob/mob_helpers.dm @@ -557,7 +557,7 @@ proc/is_blind(A) if(subject != M) follow = "([ghost_follow_link(subject, M)]) " if(M.stat != DEAD && M.client.holder) - follow = "(JMP) " + follow = "([admin_jump_link(subject, M.client.holder)]) " var/mob/dead/observer/DM if(istype(subject, /mob/dead/observer)) DM = subject diff --git a/code/modules/paperwork/faxmachine.dm b/code/modules/paperwork/faxmachine.dm index 7cd104870f4..44d42e1b9d1 100644 --- a/code/modules/paperwork/faxmachine.dm +++ b/code/modules/paperwork/faxmachine.dm @@ -211,7 +211,7 @@ var/list/adminfaxes = list() //cache for faxes that have been sent to admins /obj/machinery/photocopier/faxmachine/proc/message_admins(var/mob/sender, var/faxname, var/obj/item/sent, var/reply_type, font_colour="#006100") - var/msg = "\blue [faxname]: [key_name(sender, 1)] (PP) (VV) (SM) (JMP) (CA) (REPLY): Receiving '[sent.name]' via secure connection ... view message" + var/msg = "\blue [faxname]: [key_name(sender, 1)] (PP) (VV) (SM) ([admin_jump_link(sender, src)]) (CA) (REPLY): Receiving '[sent.name]' via secure connection ... view message" for(var/client/C in admins) if(R_ADMIN & C.holder.rights) From b7c9969f87ae08bb2b0b48695b8f783e8d3714e4 Mon Sep 17 00:00:00 2001 From: PsiOmegaDelta Date: Wed, 10 Jun 2015 11:35:00 +0200 Subject: [PATCH 042/215] Corrects mob reference. --- code/modules/admin/admin.dm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/modules/admin/admin.dm b/code/modules/admin/admin.dm index bdf9e43bb92..40a75861e4f 100644 --- a/code/modules/admin/admin.dm +++ b/code/modules/admin/admin.dm @@ -1310,11 +1310,11 @@ proc/admin_notice(var/message, var/rights) if(3) //Devs var/ref_mob = "\ref[M]" - return "[key_name(C, link, name, highlight_special)](VV)([admin_jump_link(ref_mob, src)])" + return "[key_name(C, link, name, highlight_special)](VV)([admin_jump_link(M, src)])" if(4) //Mentors var/ref_mob = "\ref[M]" - return "[key_name(C, link, name, highlight_special)] (?) (PP) (VV) (SM) ([admin_jump_link(ref_mob, src)])" + return "[key_name(C, link, name, highlight_special)] (?) (PP) (VV) (SM) ([admin_jump_link(M, src)])" /proc/ishost(whom) From 4b04b867ac7ff48ac5de56758331db83ae13ca16 Mon Sep 17 00:00:00 2001 From: Zuhayr Date: Wed, 10 Jun 2015 12:32:50 +0930 Subject: [PATCH 043/215] Fxes #9625 --- code/modules/hydroponics/spreading/spreading.dm | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/code/modules/hydroponics/spreading/spreading.dm b/code/modules/hydroponics/spreading/spreading.dm index e62a96c2ce9..87894c6d734 100644 --- a/code/modules/hydroponics/spreading/spreading.dm +++ b/code/modules/hydroponics/spreading/spreading.dm @@ -196,16 +196,19 @@ layer = 3 density = 0 -/obj/effect/plant/proc/calc_dir(turf/location = loc) +/obj/effect/plant/proc/calc_dir() set background = 1 + var/turf/T = get_turf(src) + if(!istype(T)) return + var/direction = 16 for(var/wallDir in cardinal) - var/turf/newTurf = get_step(location,wallDir) + var/turf/newTurf = get_step(T,wallDir) if(newTurf.density) direction |= wallDir - for(var/obj/effect/plant/shroom in location) + for(var/obj/effect/plant/shroom in T.contents) if(shroom == src) continue if(shroom.floor) //special From 8a2c0226dcf6daeae6434a7aefc9866205bfdf84 Mon Sep 17 00:00:00 2001 From: Zuhayr Date: Wed, 10 Jun 2015 12:45:03 +0930 Subject: [PATCH 044/215] Fixes #9597 --- code/modules/materials/materials.dm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/modules/materials/materials.dm b/code/modules/materials/materials.dm index 710e8caf9d6..0409a8b7f1b 100644 --- a/code/modules/materials/materials.dm +++ b/code/modules/materials/materials.dm @@ -273,7 +273,7 @@ var/list/name_to_material hardness = 80 weight = 23 stack_origin_tech = "materials=2" - composite_material = list() //todo + composite_material = list(DEFAULT_WALL_MATERIAL = 3750, "platinum" = 3750) //todo /material/glass name = "glass" @@ -316,7 +316,7 @@ var/list/name_to_material hardness = 40 weight = 30 stack_origin_tech = "materials=2" - composite_material = list() //todo + composite_material = list(DEFAULT_WALL_MATERIAL = 1875,"glass" = 3750) /material/plastic name = "plastic" From 018c3fc2aa4ebb00ea46360a5db0df7d8fd2d9be Mon Sep 17 00:00:00 2001 From: Zuhayr Date: Wed, 10 Jun 2015 13:21:07 +0930 Subject: [PATCH 045/215] Fixes #9517 and #9542 --- code/modules/mob/freelook/mask/update_triggers.dm | 2 +- code/modules/mob/living/simple_animal/simple_animal.dm | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/code/modules/mob/freelook/mask/update_triggers.dm b/code/modules/mob/freelook/mask/update_triggers.dm index a8e68058fde..8100a309a22 100644 --- a/code/modules/mob/freelook/mask/update_triggers.dm +++ b/code/modules/mob/freelook/mask/update_triggers.dm @@ -35,7 +35,7 @@ cultnet.updateVisibility(src, 0) /mob/living/death(gibbed, deathmessage="seizes up and falls limp...") - if(..()) + if(..(gibbed, deathmessage)) // If true, the mob went from living to dead (assuming everyone has been overriding as they should...) cultnet.updateVisibility(src) diff --git a/code/modules/mob/living/simple_animal/simple_animal.dm b/code/modules/mob/living/simple_animal/simple_animal.dm index e2ec5059a2b..4b33818033b 100644 --- a/code/modules/mob/living/simple_animal/simple_animal.dm +++ b/code/modules/mob/living/simple_animal/simple_animal.dm @@ -295,7 +295,7 @@ if(!O.force) visible_message("[user] gently taps [src] with \the [O].") return - + if(O.force > resistance) var/damage = O.force if (O.damtype == HALLOSS) @@ -306,8 +306,8 @@ adjustBruteLoss(damage) else usr << "[src] has been attacked with the [O] by [user].") + + visible_message("\The [src] has been attacked with the [O] by [user].") user.do_attack_animation(src) /mob/living/simple_animal/movement_delay() @@ -327,10 +327,10 @@ if(statpanel("Status") && show_stat_health) stat(null, "Health: [round((health / maxHealth) * 100)]%") -/mob/living/simple_animal/death(gibbed, deathmessage="") +/mob/living/simple_animal/death(gibbed, deathmessage = "dies!") icon_state = icon_dead density = 0 - return ..() + return ..(gibbed,deathmessage) /mob/living/simple_animal/ex_act(severity) if(!blinded) From cef958cac2f52aeaa90983d7c73bd2ec844130e4 Mon Sep 17 00:00:00 2001 From: Zuhayr Date: Wed, 10 Jun 2015 14:19:55 +0930 Subject: [PATCH 046/215] Fixes #9503 --- code/datums/mind.dm | 758 ++++++++---------- .../mob/living/carbon/brain/posibrain.dm | 1 + code/modules/mob/mob.dm | 3 +- 3 files changed, 347 insertions(+), 415 deletions(-) diff --git a/code/datums/mind.dm b/code/datums/mind.dm index cfbd1551452..fac5c75fc38 100644 --- a/code/datums/mind.dm +++ b/code/datums/mind.dm @@ -29,7 +29,7 @@ */ -datum/mind +/datum/mind var/key var/name //replaces mob/var/original_name var/mob/living/current @@ -58,459 +58,389 @@ datum/mind // the world.time since the mob has been brigged, or -1 if not at all var/brigged_since = -1 - New(var/key) - src.key = key - //put this here for easier tracking ingame var/datum/money_account/initial_account - proc/transfer_to(mob/living/new_character) - if(!istype(new_character)) - world.log << "## DEBUG: transfer_to(): Some idiot has tried to transfer_to() a non mob/living mob. Please inform Carn" - if(current) //remove ourself from our old body's mind variable - if(changeling) - current.remove_changeling_powers() - current.verbs -= /datum/changeling/proc/EvolutionMenu - current.mind = null +/datum/mind/New(var/key) + src.key = key - nanomanager.user_transferred(current, new_character) // transfer active NanoUI instances to new user - if(new_character.mind) //remove any mind currently in our new body's mind variable - new_character.mind.current = null - - current = new_character //link ourself to our new body - new_character.mind = src //and link our new body to ourself +/datum/mind/proc/transfer_to(mob/living/new_character) + if(!istype(new_character)) + world.log << "## DEBUG: transfer_to(): Some idiot has tried to transfer_to() a non mob/living mob. Please inform Carn" + if(current) //remove ourself from our old body's mind variable if(changeling) - new_character.make_changeling() + current.remove_changeling_powers() + current.verbs -= /datum/changeling/proc/EvolutionMenu + current.mind = null - if(active) - new_character.key = key //now transfer the key to link the client to our new body + nanomanager.user_transferred(current, new_character) // transfer active NanoUI instances to new user + if(new_character.mind) //remove any mind currently in our new body's mind variable + new_character.mind.current = null - proc/store_memory(new_text) - memory += "[new_text]
" + current = new_character //link ourself to our new body + new_character.mind = src //and link our new body to ourself - proc/show_memory(mob/recipient) - var/output = "[current.real_name]'s Memory
" - output += memory + if(changeling) + new_character.make_changeling() - if(objectives.len>0) - output += "
Objectives:" + if(active) + new_character.key = key //now transfer the key to link the client to our new body - var/obj_count = 1 - for(var/datum/objective/objective in objectives) - output += "Objective #[obj_count]: [objective.explanation_text]" - obj_count++ +/datum/mind/proc/store_memory(new_text) + memory += "[new_text]
" - recipient << browse(output,"window=memory") +/datum/mind/proc/show_memory(mob/recipient) + var/output = "[current.real_name]'s Memory
" + output += memory - proc/edit_memory() - if(!ticker || !ticker.mode) - alert("Not before round-start!", "Alert") - return + if(objectives.len>0) + output += "
Objectives:" - var/out = "[name][(current&&(current.real_name!=name))?" (as [current.real_name])":""]
" - out += "Mind currently owned by key: [key] [active?"(synced)":"(not synced)"]
" - out += "Assigned role: [assigned_role]. Edit
" - out += "
" - out += "Factions and special roles:
" - for(var/antag_type in all_antag_types) - var/datum/antagonist/antag = all_antag_types[antag_type] - out += "[antag.get_panel_entry(src)]" - out += "

" - out += "Objectives
" + var/obj_count = 1 + for(var/datum/objective/objective in objectives) + output += "Objective #[obj_count]: [objective.explanation_text]" + obj_count++ - if(objectives && objectives.len) - var/num = 1 - for(var/datum/objective/O in objectives) - out += "Objective #[num]: [O.explanation_text] " - if(O.completed) - out += "(complete)" - else - out += "(incomplete)" - out += " \[toggle\]" - out += " \[remove\]
" - num++ - out += "
\[announce objectives\]" + recipient << browse(output,"window=memory") - else - out += "None." - out += "
\[add\]" - usr << browse(out, "window=edit_memory[src]") +/datum/mind/proc/edit_memory() + if(!ticker || !ticker.mode) + alert("Not before round-start!", "Alert") + return - Topic(href, href_list) - if(!check_rights(R_ADMIN)) return + var/out = "[name][(current&&(current.real_name!=name))?" (as [current.real_name])":""]
" + out += "Mind currently owned by key: [key] [active?"(synced)":"(not synced)"]
" + out += "Assigned role: [assigned_role]. Edit
" + out += "
" + out += "Factions and special roles:
" + for(var/antag_type in all_antag_types) + var/datum/antagonist/antag = all_antag_types[antag_type] + out += "[antag.get_panel_entry(src)]" + out += "

" + out += "Objectives
" - if(href_list["add_antagonist"]) - var/datum/antagonist/antag = all_antag_types[href_list["add_antagonist"]] - if(antag) antag.add_antagonist(src) - - else if(href_list["remove_antagonist"]) - var/datum/antagonist/antag = all_antag_types[href_list["remove_antagonist"]] - if(antag) antag.remove_antagonist(src) - - else if(href_list["equip_antagonist"]) - var/datum/antagonist/antag = all_antag_types[href_list["equip_antagonist"]] - if(antag) antag.equip(src.current) - - else if(href_list["unequip_antagonist"]) - var/datum/antagonist/antag = all_antag_types[href_list["unequip_antagonist"]] - if(antag) antag.unequip(src.current) - - else if(href_list["move_antag_to_spawn"]) - var/datum/antagonist/antag = all_antag_types[href_list["move_antag_to_spawn"]] - if(antag) antag.place_mob(src.current) - - else if (href_list["role_edit"]) - var/new_role = input("Select new role", "Assigned role", assigned_role) as null|anything in joblist - if (!new_role) return - assigned_role = new_role - - else if (href_list["memory_edit"]) - var/new_memo = sanitize(input("Write new memory", "Memory", memory) as null|message) - if (isnull(new_memo)) return - memory = new_memo - - else if (href_list["obj_edit"] || href_list["obj_add"]) - var/datum/objective/objective - var/objective_pos - var/def_value - - if (href_list["obj_edit"]) - objective = locate(href_list["obj_edit"]) - if (!objective) return - objective_pos = objectives.Find(objective) - - //Text strings are easy to manipulate. Revised for simplicity. - var/temp_obj_type = "[objective.type]"//Convert path into a text string. - def_value = copytext(temp_obj_type, 19)//Convert last part of path into an objective keyword. - if(!def_value)//If it's a custom objective, it will be an empty string. - def_value = "custom" - - var/new_obj_type = input("Select objective type:", "Objective type", def_value) as null|anything in list("assassinate", "debrain", "protect", "prevent", "harm", "brig", "hijack", "escape", "survive", "steal", "download", "mercenary", "capture", "absorb", "custom") - if (!new_obj_type) return - - var/datum/objective/new_objective = null - - switch (new_obj_type) - if ("assassinate","protect","debrain", "harm", "brig") - //To determine what to name the objective in explanation text. - var/objective_type_capital = uppertext(copytext(new_obj_type, 1,2))//Capitalize first letter. - var/objective_type_text = copytext(new_obj_type, 2)//Leave the rest of the text. - var/objective_type = "[objective_type_capital][objective_type_text]"//Add them together into a text string. - - var/list/possible_targets = list("Free objective") - for(var/datum/mind/possible_target in ticker.minds) - if ((possible_target != src) && istype(possible_target.current, /mob/living/carbon/human)) - possible_targets += possible_target.current - - var/mob/def_target = null - var/objective_list[] = list(/datum/objective/assassinate, /datum/objective/protect, /datum/objective/debrain) - if (objective&&(objective.type in objective_list) && objective:target) - def_target = objective:target.current - - var/new_target = input("Select target:", "Objective target", def_target) as null|anything in possible_targets - if (!new_target) return - - var/objective_path = text2path("/datum/objective/[new_obj_type]") - if (new_target == "Free objective") - new_objective = new objective_path - new_objective.owner = src - new_objective:target = null - new_objective.explanation_text = "Free objective" - else - new_objective = new objective_path - new_objective.owner = src - new_objective:target = new_target:mind - //Will display as special role if the target is set as MODE. Ninjas/commandos/nuke ops. - new_objective.explanation_text = "[objective_type] [new_target:real_name], the [new_target:mind:assigned_role=="MODE" ? (new_target:mind:special_role) : (new_target:mind:assigned_role)]." - - if ("prevent") - new_objective = new /datum/objective/block - new_objective.owner = src - - if ("hijack") - new_objective = new /datum/objective/hijack - new_objective.owner = src - - if ("escape") - new_objective = new /datum/objective/escape - new_objective.owner = src - - if ("survive") - new_objective = new /datum/objective/survive - new_objective.owner = src - - if ("mercenary") - new_objective = new /datum/objective/nuclear - new_objective.owner = src - - if ("steal") - if (!istype(objective, /datum/objective/steal)) - new_objective = new /datum/objective/steal - new_objective.owner = src - else - new_objective = objective - var/datum/objective/steal/steal = new_objective - if (!steal.select_target()) - return - - if("download","capture","absorb") - var/def_num - if(objective&&objective.type==text2path("/datum/objective/[new_obj_type]")) - def_num = objective.target_amount - - var/target_number = input("Input target number:", "Objective", def_num) as num|null - if (isnull(target_number))//Ordinarily, you wouldn't need isnull. In this case, the value may already exist. - return - - switch(new_obj_type) - if("download") - new_objective = new /datum/objective/download - new_objective.explanation_text = "Download [target_number] research levels." - if("capture") - new_objective = new /datum/objective/capture - new_objective.explanation_text = "Accumulate [target_number] capture points." - if("absorb") - new_objective = new /datum/objective/absorb - new_objective.explanation_text = "Absorb [target_number] compatible genomes." - new_objective.owner = src - new_objective.target_amount = target_number - - if ("custom") - var/expl = sanitize(input("Custom objective:", "Objective", objective ? objective.explanation_text : "") as text|null) - if (!expl) return - new_objective = new /datum/objective - new_objective.owner = src - new_objective.explanation_text = expl - - if (!new_objective) return - - if (objective) - objectives -= objective - objectives.Insert(objective_pos, new_objective) + if(objectives && objectives.len) + var/num = 1 + for(var/datum/objective/O in objectives) + out += "Objective #[num]: [O.explanation_text] " + if(O.completed) + out += "(complete)" else - objectives += new_objective + out += "(incomplete)" + out += " \[toggle\]" + out += " \[remove\]
" + num++ + out += "
\[announce objectives\]" - else if (href_list["obj_delete"]) - var/datum/objective/objective = locate(href_list["obj_delete"]) - if(!istype(objective)) return - objectives -= objective + else + out += "None." + out += "
\[add\]" + usr << browse(out, "window=edit_memory[src]") - else if(href_list["obj_completed"]) - var/datum/objective/objective = locate(href_list["obj_completed"]) - if(!istype(objective)) return - objective.completed = !objective.completed +/datum/mind/Topic(href, href_list) + if(!check_rights(R_ADMIN)) return - else if(href_list["implant"]) - var/mob/living/carbon/human/H = current + if(href_list["add_antagonist"]) + var/datum/antagonist/antag = all_antag_types[href_list["add_antagonist"]] + if(antag) antag.add_antagonist(src) - BITSET(H.hud_updateflag, IMPLOYAL_HUD) // updates that players HUD images so secHUD's pick up they are implanted or not. + else if(href_list["remove_antagonist"]) + var/datum/antagonist/antag = all_antag_types[href_list["remove_antagonist"]] + if(antag) antag.remove_antagonist(src) - switch(href_list["implant"]) - if("remove") - for(var/obj/item/weapon/implant/loyalty/I in H.contents) - for(var/obj/item/organ/external/organs in H.organs) - if(I in organs.implants) - qdel(I) - break - H << "Your loyalty implant has been deactivated." - log_admin("[key_name_admin(usr)] has de-loyalty implanted [current].") - if("add") - H << "You somehow have become the recepient of a loyalty transplant, and it just activated!" - H.implant_loyalty(H, override = TRUE) - log_admin("[key_name_admin(usr)] has loyalty implanted [current].") + else if(href_list["equip_antagonist"]) + var/datum/antagonist/antag = all_antag_types[href_list["equip_antagonist"]] + if(antag) antag.equip(src.current) + + else if(href_list["unequip_antagonist"]) + var/datum/antagonist/antag = all_antag_types[href_list["unequip_antagonist"]] + if(antag) antag.unequip(src.current) + + else if(href_list["move_antag_to_spawn"]) + var/datum/antagonist/antag = all_antag_types[href_list["move_antag_to_spawn"]] + if(antag) antag.place_mob(src.current) + + else if (href_list["role_edit"]) + var/new_role = input("Select new role", "Assigned role", assigned_role) as null|anything in joblist + if (!new_role) return + assigned_role = new_role + + else if (href_list["memory_edit"]) + var/new_memo = sanitize(input("Write new memory", "Memory", memory) as null|message) + if (isnull(new_memo)) return + memory = new_memo + + else if (href_list["obj_edit"] || href_list["obj_add"]) + var/datum/objective/objective + var/objective_pos + var/def_value + + if (href_list["obj_edit"]) + objective = locate(href_list["obj_edit"]) + if (!objective) return + objective_pos = objectives.Find(objective) + + //Text strings are easy to manipulate. Revised for simplicity. + var/temp_obj_type = "[objective.type]"//Convert path into a text string. + def_value = copytext(temp_obj_type, 19)//Convert last part of path into an objective keyword. + if(!def_value)//If it's a custom objective, it will be an empty string. + def_value = "custom" + + var/new_obj_type = input("Select objective type:", "Objective type", def_value) as null|anything in list("assassinate", "debrain", "protect", "prevent", "harm", "brig", "hijack", "escape", "survive", "steal", "download", "mercenary", "capture", "absorb", "custom") + if (!new_obj_type) return + + var/datum/objective/new_objective = null + + switch (new_obj_type) + if ("assassinate","protect","debrain", "harm", "brig") + //To determine what to name the objective in explanation text. + var/objective_type_capital = uppertext(copytext(new_obj_type, 1,2))//Capitalize first letter. + var/objective_type_text = copytext(new_obj_type, 2)//Leave the rest of the text. + var/objective_type = "[objective_type_capital][objective_type_text]"//Add them together into a text string. + + var/list/possible_targets = list("Free objective") + for(var/datum/mind/possible_target in ticker.minds) + if ((possible_target != src) && istype(possible_target.current, /mob/living/carbon/human)) + possible_targets += possible_target.current + + var/mob/def_target = null + var/objective_list[] = list(/datum/objective/assassinate, /datum/objective/protect, /datum/objective/debrain) + if (objective&&(objective.type in objective_list) && objective:target) + def_target = objective:target.current + + var/new_target = input("Select target:", "Objective target", def_target) as null|anything in possible_targets + if (!new_target) return + + var/objective_path = text2path("/datum/objective/[new_obj_type]") + if (new_target == "Free objective") + new_objective = new objective_path + new_objective.owner = src + new_objective:target = null + new_objective.explanation_text = "Free objective" else - /* - else if (href_list["monkey"]) - var/mob/living/L = current - if (L.monkeyizing) - return - switch(href_list["monkey"]) - if("healthy") - if (usr.client.holder.rights & R_ADMIN) - var/mob/living/carbon/human/H = current - var/mob/living/carbon/monkey/M = current - if (istype(H)) - log_admin("[key_name(usr)] attempting to monkeyize [key_name(current)]") - message_admins("\blue [key_name_admin(usr)] attempting to monkeyize [key_name_admin(current)]") - src = null - M = H.monkeyize() - src = M.mind - //world << "DEBUG: \"healthy\": M=[M], M.mind=[M.mind], src=[src]!" - else if (istype(M) && length(M.viruses)) - for(var/datum/disease/D in M.viruses) - D.cure(0) - sleep(0) //because deleting of virus is done through spawn(0) - if("infected") - if (usr.client.holder.rights & R_ADMIN) - var/mob/living/carbon/human/H = current - var/mob/living/carbon/monkey/M = current - if (istype(H)) - log_admin("[key_name(usr)] attempting to monkeyize and infect [key_name(current)]") - message_admins("\blue [key_name_admin(usr)] attempting to monkeyize and infect [key_name_admin(current)]", 1) - src = null - M = H.monkeyize() - src = M.mind - current.contract_disease(new /datum/disease/jungle_fever,1,0) - else if (istype(M)) - current.contract_disease(new /datum/disease/jungle_fever,1,0) - if("human") - var/mob/living/carbon/monkey/M = current - if (istype(M)) - for(var/datum/disease/D in M.viruses) - if (istype(D,/datum/disease/jungle_fever)) - D.cure(0) - sleep(0) //because deleting of virus is doing throught spawn(0) - log_admin("[key_name(usr)] attempting to humanize [key_name(current)]") - message_admins("\blue [key_name_admin(usr)] attempting to humanize [key_name_admin(current)]") - var/obj/item/weapon/dnainjector/m2h/m2h = new - var/obj/item/weapon/implant/mobfinder = new(M) //hack because humanizing deletes mind --rastaf0 - src = null - m2h.inject(M) - src = mobfinder.loc:mind - qdel(mobfinder) - current.radiation -= 50 - */ - else if (href_list["silicon"]) - BITSET(current.hud_updateflag, SPECIALROLE_HUD) - switch(href_list["silicon"]) + new_objective = new objective_path + new_objective.owner = src + new_objective:target = new_target:mind + //Will display as special role if the target is set as MODE. Ninjas/commandos/nuke ops. + new_objective.explanation_text = "[objective_type] [new_target:real_name], the [new_target:mind:assigned_role=="MODE" ? (new_target:mind:special_role) : (new_target:mind:assigned_role)]." - if("unemag") - var/mob/living/silicon/robot/R = current - if (istype(R)) + if ("prevent") + new_objective = new /datum/objective/block + new_objective.owner = src + + if ("hijack") + new_objective = new /datum/objective/hijack + new_objective.owner = src + + if ("escape") + new_objective = new /datum/objective/escape + new_objective.owner = src + + if ("survive") + new_objective = new /datum/objective/survive + new_objective.owner = src + + if ("mercenary") + new_objective = new /datum/objective/nuclear + new_objective.owner = src + + if ("steal") + if (!istype(objective, /datum/objective/steal)) + new_objective = new /datum/objective/steal + new_objective.owner = src + else + new_objective = objective + var/datum/objective/steal/steal = new_objective + if (!steal.select_target()) + return + + if("download","capture","absorb") + var/def_num + if(objective&&objective.type==text2path("/datum/objective/[new_obj_type]")) + def_num = objective.target_amount + + var/target_number = input("Input target number:", "Objective", def_num) as num|null + if (isnull(target_number))//Ordinarily, you wouldn't need isnull. In this case, the value may already exist. + return + + switch(new_obj_type) + if("download") + new_objective = new /datum/objective/download + new_objective.explanation_text = "Download [target_number] research levels." + if("capture") + new_objective = new /datum/objective/capture + new_objective.explanation_text = "Accumulate [target_number] capture points." + if("absorb") + new_objective = new /datum/objective/absorb + new_objective.explanation_text = "Absorb [target_number] compatible genomes." + new_objective.owner = src + new_objective.target_amount = target_number + + if ("custom") + var/expl = sanitize(input("Custom objective:", "Objective", objective ? objective.explanation_text : "") as text|null) + if (!expl) return + new_objective = new /datum/objective + new_objective.owner = src + new_objective.explanation_text = expl + + if (!new_objective) return + + if (objective) + objectives -= objective + objectives.Insert(objective_pos, new_objective) + else + objectives += new_objective + + else if (href_list["obj_delete"]) + var/datum/objective/objective = locate(href_list["obj_delete"]) + if(!istype(objective)) return + objectives -= objective + + else if(href_list["obj_completed"]) + var/datum/objective/objective = locate(href_list["obj_completed"]) + if(!istype(objective)) return + objective.completed = !objective.completed + + else if(href_list["implant"]) + var/mob/living/carbon/human/H = current + + BITSET(H.hud_updateflag, IMPLOYAL_HUD) // updates that players HUD images so secHUD's pick up they are implanted or not. + + switch(href_list["implant"]) + if("remove") + for(var/obj/item/weapon/implant/loyalty/I in H.contents) + for(var/obj/item/organ/external/organs in H.organs) + if(I in organs.implants) + qdel(I) + break + H << "Your loyalty implant has been deactivated." + log_admin("[key_name_admin(usr)] has de-loyalty implanted [current].") + if("add") + H << "You somehow have become the recepient of a loyalty transplant, and it just activated!" + H.implant_loyalty(H, override = TRUE) + log_admin("[key_name_admin(usr)] has loyalty implanted [current].") + else + else if (href_list["silicon"]) + BITSET(current.hud_updateflag, SPECIALROLE_HUD) + switch(href_list["silicon"]) + + if("unemag") + var/mob/living/silicon/robot/R = current + if (istype(R)) + R.emagged = 0 + if (R.activated(R.module.emag)) + R.module_active = null + if(R.module_state_1 == R.module.emag) + R.module_state_1 = null + R.contents -= R.module.emag + else if(R.module_state_2 == R.module.emag) + R.module_state_2 = null + R.contents -= R.module.emag + else if(R.module_state_3 == R.module.emag) + R.module_state_3 = null + R.contents -= R.module.emag + log_admin("[key_name_admin(usr)] has unemag'ed [R].") + + if("unemagcyborgs") + if (istype(current, /mob/living/silicon/ai)) + var/mob/living/silicon/ai/ai = current + for (var/mob/living/silicon/robot/R in ai.connected_robots) R.emagged = 0 - if (R.activated(R.module.emag)) - R.module_active = null - if(R.module_state_1 == R.module.emag) - R.module_state_1 = null - R.contents -= R.module.emag - else if(R.module_state_2 == R.module.emag) - R.module_state_2 = null - R.contents -= R.module.emag - else if(R.module_state_3 == R.module.emag) - R.module_state_3 = null - R.contents -= R.module.emag - log_admin("[key_name_admin(usr)] has unemag'ed [R].") + if (R.module) + if (R.activated(R.module.emag)) + R.module_active = null + if(R.module_state_1 == R.module.emag) + R.module_state_1 = null + R.contents -= R.module.emag + else if(R.module_state_2 == R.module.emag) + R.module_state_2 = null + R.contents -= R.module.emag + else if(R.module_state_3 == R.module.emag) + R.module_state_3 = null + R.contents -= R.module.emag + log_admin("[key_name_admin(usr)] has unemag'ed [ai]'s Cyborgs.") - if("unemagcyborgs") - if (istype(current, /mob/living/silicon/ai)) - var/mob/living/silicon/ai/ai = current - for (var/mob/living/silicon/robot/R in ai.connected_robots) - R.emagged = 0 - if (R.module) - if (R.activated(R.module.emag)) - R.module_active = null - if(R.module_state_1 == R.module.emag) - R.module_state_1 = null - R.contents -= R.module.emag - else if(R.module_state_2 == R.module.emag) - R.module_state_2 = null - R.contents -= R.module.emag - else if(R.module_state_3 == R.module.emag) - R.module_state_3 = null - R.contents -= R.module.emag - log_admin("[key_name_admin(usr)] has unemag'ed [ai]'s Cyborgs.") - - else if (href_list["common"]) - switch(href_list["common"]) - if("undress") - for(var/obj/item/W in current) - current.drop_from_inventory(W) - if("takeuplink") - take_uplink() - memory = null//Remove any memory they may have had. - if("crystals") - if (usr.client.holder.rights & R_FUN) - var/obj/item/device/uplink/hidden/suplink = find_syndicate_uplink() - var/crystals + else if (href_list["common"]) + switch(href_list["common"]) + if("undress") + for(var/obj/item/W in current) + current.drop_from_inventory(W) + if("takeuplink") + take_uplink() + memory = null//Remove any memory they may have had. + if("crystals") + if (usr.client.holder.rights & R_FUN) + var/obj/item/device/uplink/hidden/suplink = find_syndicate_uplink() + var/crystals + if (suplink) + crystals = suplink.uses + crystals = input("Amount of telecrystals for [key]","Operative uplink", crystals) as null|num + if (!isnull(crystals)) if (suplink) - crystals = suplink.uses - crystals = input("Amount of telecrystals for [key]","Operative uplink", crystals) as null|num - if (!isnull(crystals)) - if (suplink) - suplink.uses = crystals + suplink.uses = crystals - else if (href_list["obj_announce"]) - var/obj_count = 1 - current << "\blue Your current objectives:" - for(var/datum/objective/objective in objectives) - current << "Objective #[obj_count]: [objective.explanation_text]" - obj_count++ - edit_memory() -/* - proc/clear_memory(var/silent = 1) - var/datum/game_mode/current_mode = ticker.mode + else if (href_list["obj_announce"]) + var/obj_count = 1 + current << "\blue Your current objectives:" + for(var/datum/objective/objective in objectives) + current << "Objective #[obj_count]: [objective.explanation_text]" + obj_count++ + edit_memory() - // remove traitor uplinks - var/list/L = current.get_contents() - for (var/t in L) - if (istype(t, /obj/item/device/pda)) - if (t:uplink) qdel(t:uplink) - t:uplink = null - else if (istype(t, /obj/item/device/radio)) - if (t:traitorradio) qdel(t:traitorradio) - t:traitorradio = null - t:traitor_frequency = 0.0 - else if (istype(t, /obj/item/weapon/SWF_uplink) || istype(t, /obj/item/weapon/syndicate_uplink)) - if (t:origradio) - var/obj/item/device/radio/R = t:origradio - R.loc = current.loc - R.traitorradio = null - R.traitor_frequency = 0.0 - qdel(t) +/datum/mind/proc/find_syndicate_uplink() + var/list/L = current.get_contents() + for (var/obj/item/I in L) + if (I.hidden_uplink) + return I.hidden_uplink + return null - // remove wizards spells - //If there are more special powers that need removal, they can be procced into here./N - current.spellremove(current) - - // clear memory - memory = "" - special_role = null - -*/ - - proc/find_syndicate_uplink() - var/list/L = current.get_contents() - for (var/obj/item/I in L) - if (I.hidden_uplink) - return I.hidden_uplink - return null - - proc/take_uplink() - var/obj/item/device/uplink/hidden/H = find_syndicate_uplink() - if(H) - qdel(H) +/datum/mind/proc/take_uplink() + var/obj/item/device/uplink/hidden/H = find_syndicate_uplink() + if(H) + qdel(H) - // check whether this mind's mob has been brigged for the given duration - // have to call this periodically for the duration to work properly - proc/is_brigged(duration) - var/turf/T = current.loc - if(!istype(T)) - brigged_since = -1 - return 0 - - var/is_currently_brigged = 0 - - if(istype(T.loc,/area/security/brig)) - is_currently_brigged = 1 - for(var/obj/item/weapon/card/id/card in current) +// check whether this mind's mob has been brigged for the given duration +// have to call this periodically for the duration to work properly +/datum/mind/proc/is_brigged(duration) + var/turf/T = current.loc + if(!istype(T)) + brigged_since = -1 + return 0 + var/is_currently_brigged = 0 + if(istype(T.loc,/area/security/brig)) + is_currently_brigged = 1 + for(var/obj/item/weapon/card/id/card in current) + is_currently_brigged = 0 + break // if they still have ID they're not brigged + for(var/obj/item/device/pda/P in current) + if(P.id) is_currently_brigged = 0 break // if they still have ID they're not brigged - for(var/obj/item/device/pda/P in current) - if(P.id) - is_currently_brigged = 0 - break // if they still have ID they're not brigged - if(!is_currently_brigged) - brigged_since = -1 - return 0 + if(!is_currently_brigged) + brigged_since = -1 + return 0 - if(brigged_since == -1) - brigged_since = world.time + if(brigged_since == -1) + brigged_since = world.time - return (duration <= world.time - brigged_since) + return (duration <= world.time - brigged_since) +/datum/mind/proc/reset() + assigned_role = null + special_role = null + role_alt_title = null + assigned_job = null + //faction = null //Uncommenting this causes a compile error due to 'undefined type', fucked if I know. + changeling = null + initial_account = null + objectives = list() + special_verbs = list() + has_been_rev = 0 + rev_cooldown = 0 + brigged_since = -1 //Antagonist role check /mob/living/proc/check_special_role(role) diff --git a/code/modules/mob/living/carbon/brain/posibrain.dm b/code/modules/mob/living/carbon/brain/posibrain.dm index b9ff795aaaf..5d66d68695f 100644 --- a/code/modules/mob/living/carbon/brain/posibrain.dm +++ b/code/modules/mob/living/carbon/brain/posibrain.dm @@ -60,6 +60,7 @@ src.searching = 0 src.brainmob.mind = candidate.mind src.brainmob.ckey = candidate.ckey + src.brainmob.mind.reset() src.name = "positronic brain ([src.brainmob.name])" src.brainmob << "You are a positronic brain, brought into existence on [station_name()]." src.brainmob << "As a synthetic intelligence, you answer to all crewmembers, as well as the AI." diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index 0ff35abdca2..50dfbbfe93d 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -362,7 +362,8 @@ return M.key = key -// M.Login() //wat + if(M.mind) + M.mind.reset() return /client/verb/changes() From 48b063a96eb8bdbefe4dd1fc28aa228f4ffa03c2 Mon Sep 17 00:00:00 2001 From: Zuhayr Date: Wed, 10 Jun 2015 21:57:00 +0930 Subject: [PATCH 047/215] Fixes #9620 --- code/modules/hydroponics/_hydro_setup.dm | 3 +- code/modules/hydroponics/grown.dm | 49 ++++++++++++++++++++++- code/modules/hydroponics/seed.dm | 6 ++- code/modules/hydroponics/seed_datums.dm | 2 + icons/obj/hydroponics_misc.dmi | Bin 0 -> 337 bytes 5 files changed, 55 insertions(+), 5 deletions(-) create mode 100644 icons/obj/hydroponics_misc.dmi diff --git a/code/modules/hydroponics/_hydro_setup.dm b/code/modules/hydroponics/_hydro_setup.dm index a3fd4604a66..4641aa3ace8 100644 --- a/code/modules/hydroponics/_hydro_setup.dm +++ b/code/modules/hydroponics/_hydro_setup.dm @@ -55,4 +55,5 @@ #define TRAIT_PRODUCT_COLOUR 35 #define TRAIT_BIOLUM 36 #define TRAIT_BIOLUM_COLOUR 37 -#define TRAIT_IMMUTABLE 38 \ No newline at end of file +#define TRAIT_IMMUTABLE 38 +#define TRAIT_FLESH_COLOUR 39 \ No newline at end of file diff --git a/code/modules/hydroponics/grown.dm b/code/modules/hydroponics/grown.dm index 8b7678f19f6..72f0e444abc 100644 --- a/code/modules/hydroponics/grown.dm +++ b/code/modules/hydroponics/grown.dm @@ -194,9 +194,11 @@ else if(seed.chems) if(istype(W,/obj/item/weapon/material/hatchet) && !isnull(seed.chems["woodpulp"])) user.show_message("You make planks out of \the [src]!", 1) + var/flesh_colour = seed.get_trait(TRAIT_FLESH_COLOUR) + if(!flesh_colour) flesh_colour = seed.get_trait(TRAIT_PRODUCT_COLOUR) for(var/i=0,i<2,i++) var/obj/item/stack/material/wood/NG = new (user.loc) - NG.color = seed.get_trait(TRAIT_PRODUCT_COLOUR) + if(flesh_colour) NG.color = flesh_colour for (var/obj/item/stack/material/wood/G in user.loc) if(G==NG) continue @@ -221,6 +223,15 @@ new /obj/item/weapon/reagent_containers/food/snacks/soydope(get_turf(src)) qdel(src) return + else //This may need to be made more specific, but at this point I am not sure what the criteria should be. + user << "You slice up \the [src]." + var/slices = rand(3,5) + var/reagents_to_transfer = round(reagents.total_volume/slices) + for(var/i=i;i<=slices;i++) + var/obj/item/weapon/reagent_containers/food/snacks/fruit_slice/F = new(get_turf(src),seed) + if(reagents_to_transfer) reagents.trans_to_obj(F,reagents_to_transfer) + qdel(src) + return ..() /obj/item/weapon/reagent_containers/food/snacks/grown/attack(var/mob/living/carbon/M, var/mob/user, var/def_zone) @@ -301,9 +312,11 @@ if(seed.kitchen_tag == "grass") user.show_message("You make a grass tile out of \the [src]!", 1) + var/flesh_colour = seed.get_trait(TRAIT_FLESH_COLOUR) + if(!flesh_colour) flesh_colour = seed.get_trait(TRAIT_PRODUCT_COLOUR) for(var/i=0,i<2,i++) var/obj/item/stack/tile/grass/G = new (user.loc) - G.color = seed.get_trait(TRAIT_PRODUCT_COLOUR) + if(flesh_colour) G.color = flesh_colour for (var/obj/item/stack/tile/grass/NG in user.loc) if(G==NG) continue @@ -358,3 +371,35 @@ /obj/item/weapon/reagent_containers/food/snacks/grown/ambrosiavulgaris plantname = "ambrosia" + +/obj/item/weapon/reagent_containers/food/snacks/fruit_slice + name = "fruit slice" + desc = "A slice of some tasty fruit." + icon = 'icons/obj/hydroponics_misc.dmi' + icon_state = "" + +var/list/fruit_icon_cache = list() + +/obj/item/weapon/reagent_containers/food/snacks/fruit_slice/New(var/newloc, var/datum/seed/S) + ..(newloc) + // Need to go through and make a general image caching controller. Todo. + if(!istype(S)) + qdel(src) + return + + name = "[S.seed_name] slice" + desc = "A slice of \a [S.seed_name]. Tasty, probably." + + var/rind_colour = S.get_trait(TRAIT_PRODUCT_COLOUR) + var/flesh_colour = S.get_trait(TRAIT_FLESH_COLOUR) + if(!flesh_colour) flesh_colour = rind_colour + if(!fruit_icon_cache["rind-[rind_colour]"]) + var/image/I = image(icon,"fruit_rind") + I.color = rind_colour + fruit_icon_cache["rind-[rind_colour]"] = I + overlays |= fruit_icon_cache["rind-[rind_colour]"] + if(!fruit_icon_cache["slice-[rind_colour]"]) + var/image/I = image(icon,"fruit_slice") + I.color = flesh_colour + fruit_icon_cache["slice-[rind_colour]"] = I + overlays |= fruit_icon_cache["slice-[rind_colour]"] \ No newline at end of file diff --git a/code/modules/hydroponics/seed.dm b/code/modules/hydroponics/seed.dm index 9fd666fbb6d..2331c328dcc 100644 --- a/code/modules/hydroponics/seed.dm +++ b/code/modules/hydroponics/seed.dm @@ -60,6 +60,7 @@ set_trait(TRAIT_IDEAL_HEAT, 293) // Preferred temperature in Kelvin. set_trait(TRAIT_NUTRIENT_CONSUMPTION, 0.25) // Plant eats this much per tick. set_trait(TRAIT_PLANT_COLOUR, "#46B543") // Colour of the plant icon. + set_trait(TRAIT_FLESH_COLOUR, "#46B543") spawn(5) sleep(-1) @@ -169,8 +170,9 @@ if(get_trait(TRAIT_BIOLUM_COLOUR)) clr = get_trait(TRAIT_BIOLUM_COLOUR) splat.set_light(get_trait(TRAIT_BIOLUM), l_color = clr) - if(get_trait(TRAIT_PRODUCT_COLOUR)) - splat.color = get_trait(TRAIT_PRODUCT_COLOUR) + var/flesh_colour = get_trait(TRAIT_FLESH_COLOUR) + if(!flesh_colour) flesh_colour = get_trait(TRAIT_PRODUCT_COLOUR) + if(flesh_colour) splat.color = get_trait(TRAIT_PRODUCT_COLOUR) if(chems) for(var/mob/living/M in T.contents) diff --git a/code/modules/hydroponics/seed_datums.dm b/code/modules/hydroponics/seed_datums.dm index cfbf024edaf..d93de272863 100644 --- a/code/modules/hydroponics/seed_datums.dm +++ b/code/modules/hydroponics/seed_datums.dm @@ -244,6 +244,7 @@ set_trait(TRAIT_PRODUCT_ICON,"apple") set_trait(TRAIT_PRODUCT_COLOUR,"#FF540A") set_trait(TRAIT_PLANT_ICON,"tree2") + set_trait(TRAIT_FLESH_COLOUR,"#E8E39B") /datum/seed/apple/poison name = "poisonapple" @@ -804,6 +805,7 @@ set_trait(TRAIT_PRODUCT_COLOUR,"#326B30") set_trait(TRAIT_PLANT_COLOUR,"#257522") set_trait(TRAIT_PLANT_ICON,"vine2") + set_trait(TRAIT_FLESH_COLOUR,"#F22C2C") /datum/seed/pumpkin name = "pumpkin" diff --git a/icons/obj/hydroponics_misc.dmi b/icons/obj/hydroponics_misc.dmi new file mode 100644 index 0000000000000000000000000000000000000000..a5c594d93ff9fadfa688db26bf17cf2dd5d0fe86 GIT binary patch literal 337 zcmV-X0j~auP)H9JO0004WQchCV=-0C=2J zR&a84_w-Y6@%7{?OD!tS%+FJ>RWQ*r;NmRLOex6#a*U0*I5Sc+(=$pSoZ^zil2jm5 zDXpk9vn0MaCo?%!iHkEOv#1y-YRJWzR+N~V3SpzEEy~PG!KGAL!PU<$1dB`J7j zo#o>I003=CL_t(IjqQ%x4S*mFMJuoXod6pKFxCMKbpM%*@ln#K0~pQ^3HP+U0G-Yw zLoy%U Date: Wed, 10 Jun 2015 22:11:33 +0930 Subject: [PATCH 048/215] Fixes #9777 --- baystation12.dme | 1 - .../game/objects/items/stacks/sheets/glass.dm | 174 ------------------ code/game/objects/structures/grille.dm | 11 +- code/modules/hydroponics/grown.dm | 2 +- code/modules/hydroponics/seed.dm | 3 +- code/modules/hydroponics/seed_datums.dm | 3 + code/modules/materials/material_sheets.dm | 39 +++- code/modules/materials/material_synth.dm | 6 + code/modules/materials/materials.dm | 153 +++++++++++++-- 9 files changed, 196 insertions(+), 196 deletions(-) delete mode 100644 code/game/objects/items/stacks/sheets/glass.dm diff --git a/baystation12.dme b/baystation12.dme index 3dc5369865a..ce1f5b27c0f 100644 --- a/baystation12.dme +++ b/baystation12.dme @@ -601,7 +601,6 @@ #include "code\game\objects\items\stacks\nanopaste.dm" #include "code\game\objects\items\stacks\rods.dm" #include "code\game\objects\items\stacks\stack.dm" -#include "code\game\objects\items\stacks\sheets\glass.dm" #include "code\game\objects\items\stacks\sheets\leather.dm" #include "code\game\objects\items\stacks\sheets\light.dm" #include "code\game\objects\items\stacks\tiles\light.dm" diff --git a/code/game/objects/items/stacks/sheets/glass.dm b/code/game/objects/items/stacks/sheets/glass.dm deleted file mode 100644 index fd20de103c3..00000000000 --- a/code/game/objects/items/stacks/sheets/glass.dm +++ /dev/null @@ -1,174 +0,0 @@ -/* Glass stack types - * Contains: - * Glass sheets - * Reinforced glass sheets - * Phoron Glass Sheets - * Reinforced Phoron Glass Sheets (AKA Holy fuck strong windows) - * Glass shards - TODO: Move this into code/game/object/item/weapons - */ - -/* - * Glass sheets - */ -/obj/item/stack/material/glass - name = "glass" - singular_name = "glass sheet" - icon_state = "sheet-glass" - var/created_window = /obj/structure/window/basic - var/is_reinforced = 0 - var/list/construction_options = list("One Direction", "Full Window") - default_type = "glass" - -/obj/item/stack/material/glass/attack_self(mob/user as mob) - construct_window(user) - -/obj/item/stack/material/glass/attackby(obj/item/W, mob/user) - ..() - if(!is_reinforced) - if(istype(W,/obj/item/stack/cable_coil)) - var/obj/item/stack/cable_coil/CC = W - if (get_amount() < 1 || CC.get_amount() < 5) - user << "You attach wire to the [name]." - new /obj/item/stack/light_w(user.loc) - else if(istype(W, /obj/item/stack/rods)) - var/obj/item/stack/rods/V = W - if (V.get_amount() < 1 || get_amount() < 1) - user << "You need one rod and one sheet of glass to make reinforced glass." - return - - var/obj/item/stack/material/glass/reinforced/RG = new (user.loc) - RG.add_fingerprint(user) - RG.add_to_stacks(user) - var/obj/item/stack/material/glass/G = src - src = null - var/replace = (user.get_inactive_hand()==G) - V.use(1) - G.use(1) - if (!G && replace) - user.put_in_hands(RG) - -/obj/item/stack/material/glass/proc/construct_window(mob/user as mob) - if(!user || !src) return 0 - if(!istype(user.loc,/turf)) return 0 - if(!user.IsAdvancedToolUser()) - return 0 - var/title = "Sheet-[name]" - title += " ([src.get_amount()] sheet\s left)" - switch(input(title, "What would you like to construct?") as null|anything in construction_options) - if("One Direction") - if(!src) return 1 - if(src.loc != user) return 1 - - var/list/directions = new/list(cardinal) - var/i = 0 - for (var/obj/structure/window/win in user.loc) - i++ - if(i >= 4) - user << "\red There are too many windows in this location." - return 1 - directions-=win.dir - if(!(win.dir in cardinal)) - user << "\red Can't let you do that." - return 1 - - //Determine the direction. It will first check in the direction the person making the window is facing, if it finds an already made window it will try looking at the next cardinal direction, etc. - var/dir_to_set = 2 - for(var/direction in list( user.dir, turn(user.dir,90), turn(user.dir,180), turn(user.dir,270) )) - var/found = 0 - for(var/obj/structure/window/WT in user.loc) - if(WT.dir == direction) - found = 1 - if(!found) - dir_to_set = direction - break - new created_window( user.loc, dir_to_set, 1 ) - src.use(1) - if("Full Window") - if(!src) return 1 - if(src.loc != user) return 1 - if(src.get_amount() < 4) - user << "\red You need more glass to do that." - return 1 - if(locate(/obj/structure/window) in user.loc) - user << "\red There is a window in the way." - return 1 - new created_window( user.loc, SOUTHWEST, 1 ) - src.use(4) - if("Windoor") - if(!is_reinforced) return 1 - - - if(!src || src.loc != user) return 1 - - if(isturf(user.loc) && locate(/obj/structure/windoor_assembly/, user.loc)) - user << "\red There is already a windoor assembly in that location." - return 1 - - if(isturf(user.loc) && locate(/obj/machinery/door/window/, user.loc)) - user << "\red There is already a windoor in that location." - return 1 - - if(src.get_amount() < 5) - user << "\red You need more glass to do that." - return 1 - - new /obj/structure/windoor_assembly(user.loc, user.dir, 1) - src.use(5) - - return 0 - - -/* - * Reinforced glass sheets - */ -/obj/item/stack/material/glass/reinforced - name = "reinforced glass" - singular_name = "reinforced glass sheet" - icon_state = "sheet-rglass" - default_type = "reinforced glass" - created_window = /obj/structure/window/reinforced - is_reinforced = 1 - construction_options = list("One Direction", "Full Window", "Windoor") - -/* - * Phoron Glass sheets - */ -/obj/item/stack/material/glass/phoronglass - name = "phoron glass" - singular_name = "phoron glass sheet" - icon_state = "sheet-phoronglass" - created_window = /obj/structure/window/phoronbasic - default_type = "phoron glass" - -/obj/item/stack/material/glass/phoronglass/attackby(obj/item/W, mob/user) - ..() - if( istype(W, /obj/item/stack/rods) ) - var/obj/item/stack/rods/V = W - var/obj/item/stack/material/glass/phoronrglass/RG = new (user.loc) - RG.add_fingerprint(user) - RG.add_to_stacks(user) - V.use(1) - var/obj/item/stack/material/glass/G = src - src = null - var/replace = (user.get_inactive_hand()==G) - G.use(1) - if (!G && !RG && replace) - user.put_in_hands(RG) - else - return ..() - -/* - * Reinforced phoron glass sheets - */ -/obj/item/stack/material/glass/phoronrglass - name = "reinforced phoron glass" - singular_name = "reinforced phoron glass sheet" - icon_state = "sheet-phoronrglass" - default_type = "reinforced phoron glass" - created_window = /obj/structure/window/phoronreinforced - is_reinforced = 1 diff --git a/code/game/objects/structures/grille.dm b/code/game/objects/structures/grille.dm index fa7a448bd66..7829705a63e 100644 --- a/code/game/objects/structures/grille.dm +++ b/code/game/objects/structures/grille.dm @@ -114,9 +114,12 @@ "You have [anchored ? "fastened the grille to" : "unfastened the grill from"] the floor.") return -//window placing begin - else if(istype(W,/obj/item/stack/material/glass)) - var/obj/item/stack/material/glass/ST = W +//window placing begin //TODO CONVERT PROPERLY TO MATERIAL DATUM + else if(istype(W,/obj/item/stack/material)) + var/obj/item/stack/material/ST = W + if(!ST.material.created_window) + return 0 + var/dir_to_set = 1 if(loc == user.loc) dir_to_set = user.dir @@ -146,7 +149,7 @@ user << "There is already a window facing this way there." return - var/wtype = ST.created_window + var/wtype = ST.material.created_window if (ST.use(1)) var/obj/structure/window/WD = new wtype(loc, dir_to_set, 1) user << "You place the [WD] on [src]." diff --git a/code/modules/hydroponics/grown.dm b/code/modules/hydroponics/grown.dm index 72f0e444abc..031fc8b23d0 100644 --- a/code/modules/hydroponics/grown.dm +++ b/code/modules/hydroponics/grown.dm @@ -223,7 +223,7 @@ new /obj/item/weapon/reagent_containers/food/snacks/soydope(get_turf(src)) qdel(src) return - else //This may need to be made more specific, but at this point I am not sure what the criteria should be. + else if(seed.get_trait(TRAIT_FLESH_COLOUR)) user << "You slice up \the [src]." var/slices = rand(3,5) var/reagents_to_transfer = round(reagents.total_volume/slices) diff --git a/code/modules/hydroponics/seed.dm b/code/modules/hydroponics/seed.dm index 2331c328dcc..9afa043256f 100644 --- a/code/modules/hydroponics/seed.dm +++ b/code/modules/hydroponics/seed.dm @@ -60,7 +60,6 @@ set_trait(TRAIT_IDEAL_HEAT, 293) // Preferred temperature in Kelvin. set_trait(TRAIT_NUTRIENT_CONSUMPTION, 0.25) // Plant eats this much per tick. set_trait(TRAIT_PLANT_COLOUR, "#46B543") // Colour of the plant icon. - set_trait(TRAIT_FLESH_COLOUR, "#46B543") spawn(5) sleep(-1) @@ -637,7 +636,7 @@ if(GENE_STRUCTURE) traits_to_copy = list(TRAIT_PLANT_ICON,TRAIT_PRODUCT_ICON,TRAIT_HARVEST_REPEAT) if(GENE_FRUIT) - traits_to_copy = list(TRAIT_STINGS,TRAIT_EXPLOSIVE,TRAIT_JUICY) + traits_to_copy = list(TRAIT_STINGS,TRAIT_EXPLOSIVE,TRAIT_FLESH_COLOUR,TRAIT_JUICY) if(GENE_SPECIAL) traits_to_copy = list(TRAIT_TELEPORTING) diff --git a/code/modules/hydroponics/seed_datums.dm b/code/modules/hydroponics/seed_datums.dm index d93de272863..b8b05307883 100644 --- a/code/modules/hydroponics/seed_datums.dm +++ b/code/modules/hydroponics/seed_datums.dm @@ -844,6 +844,7 @@ set_trait(TRAIT_PRODUCT_ICON,"treefruit") set_trait(TRAIT_PRODUCT_COLOUR,"#3AF026") set_trait(TRAIT_PLANT_ICON,"tree") + set_trait(TRAIT_FLESH_COLOUR,"#3AF026") /datum/seed/citrus/lemon name = "lemon" @@ -856,6 +857,7 @@ ..() set_trait(TRAIT_PRODUCES_POWER,1) set_trait(TRAIT_PRODUCT_COLOUR,"#F0E226") + set_trait(TRAIT_FLESH_COLOUR,"#F0E226") /datum/seed/citrus/orange name = "orange" @@ -867,6 +869,7 @@ /datum/seed/citrus/orange/New() ..() set_trait(TRAIT_PRODUCT_COLOUR,"#FFC20A") + set_trait(TRAIT_FLESH_COLOUR,"#FFC20A") /datum/seed/grass name = "grass" diff --git a/code/modules/materials/material_sheets.dm b/code/modules/materials/material_sheets.dm index ec6f51540f4..62b3c433dc9 100644 --- a/code/modules/materials/material_sheets.dm +++ b/code/modules/materials/material_sheets.dm @@ -47,6 +47,19 @@ return 0 ..(S,tamount,1) +/obj/item/stack/material/attack_self(var/mob/user) + if(!material.build_windows(user, src)) + ..() + +/obj/item/stack/material/attackby(var/obj/item/W, var/mob/user) + if(istype(W,/obj/item/stack/cable_coil)) + material.build_wired_product(user, W, src) + return + else if(istype(W, /obj/item/stack/rods)) + material.build_rod_product(user, W, src) + return + return ..() + /obj/item/stack/material/iron name = "iron" icon_state = "sheet-silver" @@ -75,7 +88,7 @@ default_type = "phoron" /obj/item/stack/material/plastic - name = "Plastic" + name = "plastic" icon_state = "sheet-plastic" default_type = "plastic" @@ -151,3 +164,27 @@ singular_name = "leather piece" icon_state = "sheet-leather" default_type = "leather" + +/obj/item/stack/material/glass + name = "glass" + singular_name = "glass sheet" + icon_state = "sheet-glass" + default_type = "glass" + +/obj/item/stack/material/glass/reinforced + name = "reinforced glass" + singular_name = "reinforced glass sheet" + icon_state = "sheet-rglass" + default_type = "reinforced glass" + +/obj/item/stack/material/glass/phoronglass + name = "phoron glass" + singular_name = "phoron glass sheet" + icon_state = "sheet-phoronglass" + default_type = "phoron glass" + +/obj/item/stack/material/glass/phoronrglass + name = "reinforced phoron glass" + singular_name = "reinforced phoron glass sheet" + icon_state = "sheet-phoronrglass" + default_type = "reinforced phoron glass" diff --git a/code/modules/materials/material_synth.dm b/code/modules/materials/material_synth.dm index a0977e69c5f..23b0e7e5462 100644 --- a/code/modules/materials/material_synth.dm +++ b/code/modules/materials/material_synth.dm @@ -13,20 +13,26 @@ matter = null /obj/item/stack/material/cyborg/plastic + icon_state = "sheet-plastic" default_type = "plastic" /obj/item/stack/material/cyborg/steel + icon_state = "sheet-metal" default_type = "steel" /obj/item/stack/material/cyborg/plasteel + icon_state = "sheet-plasteel" default_type = "plasteel" /obj/item/stack/material/cyborg/wood + icon_state = "sheet-wood" default_type = "wood" /obj/item/stack/material/cyborg/glass + icon_state = "sheet-glass" default_type = "glass" /obj/item/stack/material/cyborg/glass/reinforced + icon_state = "sheet-rglass" default_type = "reinforced glass" charge_costs = list(500, 1000) \ No newline at end of file diff --git a/code/modules/materials/materials.dm b/code/modules/materials/materials.dm index 0409a8b7f1b..0e2fecff36b 100644 --- a/code/modules/materials/materials.dm +++ b/code/modules/materials/materials.dm @@ -77,6 +77,12 @@ var/list/name_to_material var/conductive = 1 // Objects with this var add CONDUCTS to flags on spawn. var/list/composite_material // If set, object matter var will be a list containing these values. + // Placeholder vars for the time being, todo properly integrate windows/light tiles/rods. + var/created_window + var/rod_product + var/wire_product + var/list/window_options = list() + // Damage values. var/hardness = 60 // Prob of wall destruction by hulk, used for edge damage in weapons. var/weight = 20 // Determines blunt damage/throwforce for weapons. @@ -90,6 +96,37 @@ var/list/name_to_material // Wallrot crumble message. var/rotting_touch_message = "crumbles under your touch" +// Placeholders for light tiles and rglass. +/material/proc/build_rod_product(var/mob/user, var/obj/item/stack/used_stack, var/obj/item/stack/target_stack) + if(!rod_product) + user << "You cannot make anything out of \the [target_stack]" + return + if(used_stack.get_amount() < 1 || target_stack.get_amount() < 1) + user << "You need one rod and one sheet of [display_name] to make anything useful." + return + used_stack.use(1) + target_stack.use(1) + var/obj/item/stack/S = new rod_product(get_turf(user)) + S.add_fingerprint(user) + S.add_to_stacks(user) + if(!(user.l_hand && user.r_hand)) + user.put_in_hands(S) + +/material/proc/build_wired_product(var/mob/user, var/obj/item/stack/used_stack, var/obj/item/stack/target_stack) + if(!wire_product) + user << "You cannot make anything out of \the [target_stack]" + return + if(used_stack.get_amount() < 5 || target_stack.get_amount() < 1) + user << "You need five wires and one sheet of [display_name] to make anything useful." + return + + used_stack.use(5) + target_stack.use(1) + user << "You attach wire to the [name]." + var/obj/item/product = new wire_product(get_turf(user)) + if(!(user.l_hand && user.r_hand)) + user.put_in_hands(product) + // Make sure we have a display name and shard icon even if they aren't explicitly set. /material/New() ..() @@ -100,6 +137,10 @@ var/list/name_to_material if(!shard_icon) shard_icon = shard_type +// This is a placeholder for proper integration of windows/windoors into the system. +/material/proc/build_windows(var/mob/living/user, var/obj/item/stack/used_stack) + return 0 + // Weapons handle applying a divisor for this value locally. /material/proc/get_blunt_damage() return weight //todo @@ -288,21 +329,82 @@ var/list/name_to_material weight = 15 door_icon_base = "stone" destruction_desc = "shatters" + window_options = list("One Direction", "Full Window") + created_window = /obj/structure/window/basic + wire_product = /obj/item/stack/light_w + rod_product = /obj/item/stack/material/glass/reinforced -/material/glass/phoron - name = "phoron glass" - stack_type = /obj/item/stack/material/glass/phoronglass - flags = MATERIAL_BRITTLE - ignition_point = 300 - integrity = 200 // idk why but phoron windows are strong, so. - icon_colour = "#FC2BC5" - stack_origin_tech = "materials=3;phorontech=2" +/material/glass/build_windows(var/mob/living/user, var/obj/item/stack/used_stack) -/material/glass/phoron/reinforced - name = "reinforced phoron glass" - stack_type = /obj/item/stack/material/glass/phoronrglass - stack_origin_tech = "materials=4;phorontech=2" - composite_material = list() //todo + if(!user || !used_stack || !created_window || !window_options.len) + return 0 + + if(!user.IsAdvancedToolUser()) + user << "This task is too complex for your clumsy hands." + return 1 + + var/turf/T = user.loc + if(!istype(T)) + user << "You must be standing on open flooring to build a window." + return 1 + + var/title = "Sheet-[used_stack.name] ([used_stack.get_amount()] sheet\s left)" + var/choice = input(title, "What would you like to construct?") as null|anything in window_options + + if(!choice || !used_stack || !user || used_stack.loc != user || user.stat || user.loc != T) + return 1 + + // Get data for building windows here. + var/list/possible_directions = cardinal.Copy() + var/window_count = 0 + for (var/obj/structure/window/check_window in user.loc) + window_count++ + possible_directions -= check_window.dir + + // Get the closest available dir to the user's current facing. + var/build_dir = SOUTHWEST //Default to southwest for fulltile windows. + var/failed_to_build + + if(window_count >= 4) + failed_to_build = 1 + else + if(choice in list("One Direction","Windoor")) + if(possible_directions.len) + for(var/direction in list(user.dir, turn(user.dir,90), turn(user.dir,180), turn(user.dir,270) )) + if(direction in possible_directions) + build_dir = direction + break + else + failed_to_build = 1 + if(!failed_to_build && choice == "Windoor") + if(!is_reinforced()) + user << "This material is not reinforced enough to use for a door." + return + if((locate(/obj/structure/windoor_assembly) in T.contents) || (locate(/obj/machinery/door/window) in T.contents)) + failed_to_build = 1 + if(failed_to_build) + user << "There is no room in this location." + return 1 + + var/build_path = /obj/structure/windoor_assembly + var/sheets_needed = 4 + if(choice == "Windoor") + sheets_needed = 5 + build_dir = user.dir + else + build_path = created_window + + if(used_stack.get_amount() < sheets_needed) + user << "You need at least [sheets_needed] sheets to build this." + return 1 + + // Build the structure and update sheet count etc. + used_stack.use(sheets_needed) + new build_path(T, build_dir, 1) + return 1 + +/material/glass/proc/is_reinforced() + return (hardness > 35) //todo /material/glass/reinforced name = "reinforced glass" @@ -317,6 +419,31 @@ var/list/name_to_material weight = 30 stack_origin_tech = "materials=2" composite_material = list(DEFAULT_WALL_MATERIAL = 1875,"glass" = 3750) + window_options = list("One Direction", "Full Window", "Windoor") + created_window = /obj/structure/window/reinforced + wire_product = null + rod_product = null + +/material/glass/phoron + name = "phoron glass" + stack_type = /obj/item/stack/material/glass/phoronglass + flags = MATERIAL_BRITTLE + ignition_point = 300 + integrity = 200 // idk why but phoron windows are strong, so. + icon_colour = "#FC2BC5" + stack_origin_tech = "materials=3;phorontech=2" + created_window = /obj/structure/window/phoronbasic + wire_product = null + rod_product = /obj/item/stack/material/glass/phoronrglass + +/material/glass/phoron/reinforced + name = "reinforced phoron glass" + stack_type = /obj/item/stack/material/glass/phoronrglass + stack_origin_tech = "materials=4;phorontech=2" + composite_material = list() //todo + created_window = /obj/structure/window/phoronreinforced + hardness = 40 + rod_product = null /material/plastic name = "plastic" From 2bd0d7a2f4331fb90505418eb5cce01c1690174e Mon Sep 17 00:00:00 2001 From: PsiOmega Date: Wed, 10 Jun 2015 17:56:31 +0200 Subject: [PATCH 049/215] Automatic player note fixes. Player notes should now properly include the relevant admin's ckey. Automatically adds temporary and permanent bans to the player's notes. --- code/modules/admin/player_notes.dm | 32 ++++++------------------------ code/modules/admin/topic.dm | 25 +++++------------------ 2 files changed, 11 insertions(+), 46 deletions(-) diff --git a/code/modules/admin/player_notes.dm b/code/modules/admin/player_notes.dm index 3a74da5fca6..25f6638ee08 100644 --- a/code/modules/admin/player_notes.dm +++ b/code/modules/admin/player_notes.dm @@ -27,26 +27,6 @@ datum/admins/proc/notes_gethtml(var/ckey) . += "[dir]
" return - -//handles adding notes to the end of a ckey's buffer -//originally had seperate entries such as var/by to record who left the note and when -//but the current bansystem is a heap of dung. -/proc/notes_add(var/ckey, var/note) - if(!ckey) - ckey = ckey(input(usr,"Who would you like to add notes for?","Enter a ckey",null) as text|null) - if(!ckey) return - - if(!note) - note = html_encode(input(usr,"Enter your note:","Enter some text",null) as message|null) - if(!note) return - - var/savefile/notesfile = new(NOTESFILE) - if(!notesfile) return - notesfile.cd = "/[ckey]" - notesfile.eof = 1 //move to the end of the buffer - notesfile << "[time2text(world.realtime,"DD-MMM-YYYY")] | [note][(usr && usr.ckey)?" ~[usr.ckey]":""]" - return - //handles removing entries from the buffer, or removing the entire directory if no start_index is given /proc/notes_remove(var/ckey, var/start_index, var/end_index) var/savefile/notesfile = new(NOTESFILE) @@ -85,7 +65,7 @@ datum/admins/proc/notes_gethtml(var/ckey) //Hijacking this file for BS12 playernotes functions. I like this ^ one systemm alright, but converting sounds too bothersome~ Chinsky. -/proc/notes_add(var/key, var/note, var/mob/usr) +/proc/notes_add(var/key, var/note, var/mob/user) if (!key || !note) return @@ -111,9 +91,9 @@ datum/admins/proc/notes_gethtml(var/ckey) var/day_loc = findtext(full_date, time2text(world.timeofday, "DD")) var/datum/player_info/P = new - if (usr) - P.author = usr.key - P.rank = usr.client.holder.rank + if (user) + P.author = user.key + P.rank = user.client.holder.rank else P.author = "Adminbot" P.rank = "Friendly Robot" @@ -123,8 +103,8 @@ datum/admins/proc/notes_gethtml(var/ckey) infos += P info << infos - message_admins("\blue [key_name_admin(usr)] has edited [key]'s notes.") - log_admin("[key_name(usr)] has edited [key]'s notes.") + message_admins("\blue [key_name_admin(user)] has edited [key]'s notes.") + log_admin("[key_name(user)] has edited [key]'s notes.") del info diff --git a/code/modules/admin/topic.dm b/code/modules/admin/topic.dm index 750af5e4d9b..3f6e3242ade 100644 --- a/code/modules/admin/topic.dm +++ b/code/modules/admin/topic.dm @@ -110,6 +110,7 @@ banreason = "(MANUAL BAN) "+banreason DB_ban_record(bantype, playermob, banduration, banreason, banjob, null, banckey) + notes_add(playermob.ckey,banreason,usr) else if(href_list["editrights"]) if(!check_rights(R_PERMISSIONS)) @@ -757,7 +758,7 @@ msg = job else msg += ", [job]" - notes_add(M.ckey, "Banned from [msg] - [reason]") + notes_add(M.ckey, "Banned from [msg] - [reason]", usr) message_admins("\blue [key_name_admin(usr)] banned [key_name_admin(M)] from [msg] for [mins] minutes", 1) M << "\redYou have been jobbanned by [usr.client.ckey] from: [msg]." M << "\red The reason is: [reason]" @@ -778,7 +779,7 @@ jobban_fullban(M, job, "[reason]; By [usr.ckey] on [time2text(world.realtime)]") if(!msg) msg = job else msg += ", [job]" - notes_add(M.ckey, "Banned from [msg] - [reason]") + notes_add(M.ckey, "Banned from [msg] - [reason]", usr) message_admins("\blue [key_name_admin(usr)] banned [key_name_admin(M)] from [msg]", 1) M << "\redYou have been jobbanned by [usr.client.ckey] from: [msg]." M << "\red The reason is: [reason]" @@ -832,25 +833,7 @@ message_admins("\blue [key_name_admin(usr)] booted [key_name_admin(M)].", 1) //M.client = null del(M.client) -/* - //Player Notes - else if(href_list["notes"]) - var/ckey = href_list["ckey"] - if(!ckey) - var/mob/M = locate(href_list["mob"]) - if(ismob(M)) - ckey = M.ckey - switch(href_list["notes"]) - if("show") - notes_show(ckey) - if("add") - notes_add(ckey,href_list["text"]) - notes_show(ckey) - if("remove") - notes_remove(ckey,text2num(href_list["from"]),text2num(href_list["to"])) - notes_show(ckey) -*/ else if(href_list["removejobban"]) if(!check_rights(R_BAN)) return @@ -885,6 +868,7 @@ return AddBan(M.ckey, M.computer_id, reason, usr.ckey, 1, mins) ban_unban_log_save("[usr.client.ckey] has banned [M.ckey]. - Reason: [reason] - This will be removed in [mins] minutes.") + notes_add(M.ckey,"[usr.client.ckey] has banned [M.ckey]. - Reason: [reason] - This will be removed in [mins] minutes.",usr) M << "\redYou have been banned by [usr.client.ckey].\nReason: [reason]." M << "\red This is a temporary ban, it will be removed in [mins] minutes." feedback_inc("ban_tmp",1) @@ -917,6 +901,7 @@ else M << "\red No ban appeals URL has been set." ban_unban_log_save("[usr.client.ckey] has permabanned [M.ckey]. - Reason: [reason] - This is a permanent ban.") + notes_add(M.ckey,"[usr.client.ckey] has permabanned [M.ckey]. - Reason: [reason] - This is a permanent ban.",usr) log_admin("[usr.client.ckey] has banned [M.ckey].\nReason: [reason]\nThis is a permanent ban.") message_admins("\blue[usr.client.ckey] has banned [M.ckey].\nReason: [reason]\nThis is a permanent ban.") feedback_inc("ban_perma",1) From a57688c64f3fa98827f15d4b799b3259c37b7de0 Mon Sep 17 00:00:00 2001 From: Zuhayr Date: Thu, 11 Jun 2015 08:38:32 +0930 Subject: [PATCH 050/215] Fixes tiny oversight in ghost trap datum. GG global vars. --- code/modules/ghosttrap/trap.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/modules/ghosttrap/trap.dm b/code/modules/ghosttrap/trap.dm index dd53c1a389b..7da10319043 100644 --- a/code/modules/ghosttrap/trap.dm +++ b/code/modules/ghosttrap/trap.dm @@ -109,6 +109,6 @@ proc/populate_ghost_traps() /datum/ghosttrap/plant/welcome_candidate(var/mob/target) target << "