From 72c8e681e3f59d78f7e2513b45b342d5b07505c4 Mon Sep 17 00:00:00 2001 From: Dip Date: Tue, 22 Sep 2020 16:37:51 -0300 Subject: [PATCH] runtimev1-experimental --- code/controllers/subsystem/jukeboxes.dm | 2 +- code/datums/diseases/transformation.dm | 10 +++---- code/datums/dna.dm | 7 +++-- code/datums/radiation_wave.dm | 28 +++++++++++++------ code/datums/traits/good.dm | 9 +++--- code/game/machinery/dance_machine.dm | 9 +++--- code/game/objects/effects/spiders.dm | 10 +++++++ code/game/objects/items/pinpointer.dm | 2 +- code/game/objects/items/stacks/wrap.dm | 2 +- code/game/objects/structures/door_assembly.dm | 4 ++- code/game/objects/structures/girders.dm | 9 ++++-- code/game/turfs/turf.dm | 5 +++- .../atmospherics/environmental/LINDA_fire.dm | 17 ++++++----- code/modules/clothing/spacesuits/hardsuit.dm | 2 +- code/modules/holodeck/holo_effect.dm | 2 +- .../subtypes/manipulation.dm | 2 +- .../carbon/human/species_types/plasmamen.dm | 2 +- .../hostile/mining_mobs/mining_mobs.dm | 2 +- .../reagents/chemistry/recipes/special.dm | 3 +- code/modules/reagents/reagent_containers.dm | 15 ++++++---- .../reagents/reagent_containers/glass.dm | 6 +--- .../xenobiology/crossbreeding/stabilized.dm | 4 +-- code/modules/spells/spell_types/summonitem.dm | 2 +- code/modules/surgery/organs/augments_chest.dm | 2 ++ code/modules/surgery/organs/liver.dm | 7 +++-- 25 files changed, 100 insertions(+), 63 deletions(-) diff --git a/code/controllers/subsystem/jukeboxes.dm b/code/controllers/subsystem/jukeboxes.dm index 1532a3f4..b43f50d8 100644 --- a/code/controllers/subsystem/jukeboxes.dm +++ b/code/controllers/subsystem/jukeboxes.dm @@ -103,7 +103,7 @@ SUBSYSTEM_DEF(jukeboxes) for(var/mob/M in GLOB.player_list) if(!M.client) continue - if(!(M.client.prefs.toggles & SOUND_INSTRUMENTS)) + if(!(M.client.prefs.toggles & SOUND_INSTRUMENTS) || !M.can_hear()) M.stop_sound_channel(jukeinfo[2]) continue diff --git a/code/datums/diseases/transformation.dm b/code/datums/diseases/transformation.dm index 4df985f0..292f93aa 100644 --- a/code/datums/diseases/transformation.dm +++ b/code/datums/diseases/transformation.dm @@ -20,11 +20,11 @@ /datum/disease/transformation/Copy() var/datum/disease/transformation/D = ..() - D.stage1 = stage1.Copy() - D.stage2 = stage2.Copy() - D.stage3 = stage3.Copy() - D.stage4 = stage4.Copy() - D.stage5 = stage5.Copy() + D.stage1 = stage1?.Copy() + D.stage2 = stage2?.Copy() + D.stage3 = stage3?.Copy() + D.stage4 = stage4?.Copy() + D.stage5 = stage5?.Copy() D.new_form = D.new_form return D diff --git a/code/datums/dna.dm b/code/datums/dna.dm index 360c2451..53581bfd 100644 --- a/code/datums/dna.dm +++ b/code/datums/dna.dm @@ -137,10 +137,11 @@ return . /datum/dna/proc/generate_dna_blocks() - var/bonus + var/list/mutations_temp = GLOB.good_mutations + GLOB.bad_mutations + GLOB.not_good_mutations if(species && species.inert_mutation) - bonus = GET_INITIALIZED_MUTATION(species.inert_mutation) - var/list/mutations_temp = GLOB.good_mutations + GLOB.bad_mutations + GLOB.not_good_mutations + bonus + var/bonus = GET_INITIALIZED_MUTATION(species.inert_mutation) + if(bonus) + mutations_temp += bonus if(!LAZYLEN(mutations_temp)) return mutation_index.Cut() diff --git a/code/datums/radiation_wave.dm b/code/datums/radiation_wave.dm index 1d1929b6..fe018a87 100644 --- a/code/datums/radiation_wave.dm +++ b/code/datums/radiation_wave.dm @@ -3,6 +3,7 @@ var/turf/master_turf //The center of the wave var/steps=0 //How far we've moved var/intensity //How strong it was originaly + var/remaining_contam //How much contaminated material it still has var/range_modifier //Higher than 1 makes it drop off faster, 0.5 makes it drop off half etc var/move_dir //The direction of movement var/list/__dirs //The directions to the side of the wave, stored for easy looping @@ -18,6 +19,7 @@ __dirs+=turn(dir, -90) intensity = _intensity + remaining_contam = intensity range_modifier = _range_modifier can_contaminate = _can_contaminate @@ -46,8 +48,9 @@ qdel(src) return - radiate(atoms, FLOOR(strength, 1)) - + if(radiate(atoms, FLOOR(min(strength,remaining_contam), 1))) + //oof ow ouch + remaining_contam = max(0,remaining_contam-((min(strength,remaining_contam)-RAD_MINIMUM_CONTAMINATION) * RAD_CONTAMINATION_STR_COEFFICIENT)) check_obstructions(atoms) // reduce our overall strength if there are radiation insulators /datum/radiation_wave/proc/get_rad_atoms() @@ -66,6 +69,8 @@ place = cmaster_turf for(var/i in 1 to distance) place = get_step(place, dir) + if(!place) + break atoms += get_rad_contents(place) return atoms @@ -87,7 +92,8 @@ intensity *= (1-((1-thing.rad_insulation)/width)) /datum/radiation_wave/proc/radiate(list/atoms, strength) - var/contamination_chance = (strength-RAD_MINIMUM_CONTAMINATION) * RAD_CONTAMINATION_CHANCE_COEFFICIENT * min(1, 1/(steps*range_modifier)) + var/can_contam = strength >= RAD_MINIMUM_CONTAMINATION + var/list/contam_atoms = list() for(var/k in 1 to atoms.len) var/atom/thing = atoms[k] if(!thing) @@ -99,16 +105,22 @@ // modify the ignored_things list in __HELPERS/radiation.dm instead var/static/list/blacklisted = typecacheof(list( /turf, + /mob, /obj/structure/cable, /obj/machinery/atmospherics, /obj/item/ammo_casing, - /obj/item/implant, /obj/singularity )) if(!can_contaminate || blacklisted[thing.type]) continue - if(prob(contamination_chance)) // Only stronk rads get to have little baby rads - if(SEND_SIGNAL(thing, COMSIG_ATOM_RAD_CONTAMINATING, strength) & COMPONENT_BLOCK_CONTAMINATION) - continue - var/rad_strength = (strength-RAD_MINIMUM_CONTAMINATION) * RAD_CONTAMINATION_STR_COEFFICIENT + if(CHECK_BITFIELD(thing.rad_flags, RAD_NO_CONTAMINATE) || SEND_SIGNAL(thing, COMSIG_ATOM_RAD_CONTAMINATING, strength) & COMPONENT_BLOCK_CONTAMINATION) + continue + contam_atoms += thing + var/did_contam = 0 + if(can_contam && contam_atoms.len) + var/rad_strength = ((strength-RAD_MINIMUM_CONTAMINATION) * RAD_CONTAMINATION_STR_COEFFICIENT)/contam_atoms.len + for(var/A in contam_atoms) + var/atom/thing = A thing.AddComponent(/datum/component/radioactive, rad_strength, source) + did_contam = 1 + return did_contam diff --git a/code/datums/traits/good.dm b/code/datums/traits/good.dm index 64cf2df7..ca4a46e9 100644 --- a/code/datums/traits/good.dm +++ b/code/datums/traits/good.dm @@ -196,13 +196,12 @@ lose_text = "You feel like your blood pressure went down." /datum/quirk/bloodpressure/add() - var/mob/living/M = quirk_holder - M.blood_ratio = 1.2 - M.blood_volume += 150 + quirk_holder.blood_ratio = 1.2 + quirk_holder.blood_volume += 150 /datum/quirk/bloodpressure/remove() - var/mob/living/M = quirk_holder - M.blood_ratio = 1 + if(quirk_holder) + quirk_holder.blood_ratio = 1 /datum/quirk/tough name = "Tough" diff --git a/code/game/machinery/dance_machine.dm b/code/game/machinery/dance_machine.dm index 1c6d7134..78eff08e 100644 --- a/code/game/machinery/dance_machine.dm +++ b/code/game/machinery/dance_machine.dm @@ -406,12 +406,11 @@ lying_prev = 0 /obj/machinery/jukebox/proc/dance_over() - SSjukeboxes.removejukebox(SSjukeboxes.findjukeboxindex(src)) + var/position = SSjukeboxes.findjukeboxindex(src) + if(!position) + return + SSjukeboxes.removejukebox(position) STOP_PROCESSING(SSobj, src) - for(var/mob/living/L in rangers) - if(!L || !L.client) - continue - L.stop_sound_channel(CHANNEL_JUKEBOX) rangers = list() /obj/machinery/jukebox/disco/dance_over() diff --git a/code/game/objects/effects/spiders.dm b/code/game/objects/effects/spiders.dm index 17d387ec..d53e7250 100644 --- a/code/game/objects/effects/spiders.dm +++ b/code/game/objects/effects/spiders.dm @@ -128,6 +128,16 @@ else ..() +/obj/structure/spider/spiderling/attack_hand(mob/user) + . = ..() + if(user.a_intent != INTENT_HELP) + user.changeNext_move(CLICK_CD_MELEE) + user.do_attack_animation(src) + user.visible_message("[user] splats [src].", "You splat [src].", "You hear a splat...") + playsound(loc, 'sound/effects/snap.ogg', 25) + qdel(src) + return TRUE + /obj/structure/spider/spiderling/process() if(travelling_in_vent) if(isturf(loc)) diff --git a/code/game/objects/items/pinpointer.dm b/code/game/objects/items/pinpointer.dm index c4ad324a..e2082037 100644 --- a/code/game/objects/items/pinpointer.dm +++ b/code/game/objects/items/pinpointer.dm @@ -79,7 +79,7 @@ /obj/item/pinpointer/crew/proc/trackable(mob/living/carbon/human/H) var/turf/here = get_turf(src) - if((H.z == 0 || H.z == here.z) && istype(H.w_uniform, /obj/item/clothing/under)) + if(H && (H.z == 0 || H.z == here.z) && istype(H.w_uniform, /obj/item/clothing/under)) var/obj/item/clothing/under/U = H.w_uniform // Suit sensors must be on maximum. diff --git a/code/game/objects/items/stacks/wrap.dm b/code/game/objects/items/stacks/wrap.dm index b438c863..10240e90 100644 --- a/code/game/objects/items/stacks/wrap.dm +++ b/code/game/objects/items/stacks/wrap.dm @@ -66,7 +66,7 @@ return if(!istype(target)) return - if(target.anchored) + if(target.anchored || (user in target)) return if(isitem(target)) diff --git a/code/game/objects/structures/door_assembly.dm b/code/game/objects/structures/door_assembly.dm index 915d45be..31e8b347 100644 --- a/code/game/objects/structures/door_assembly.dm +++ b/code/game/objects/structures/door_assembly.dm @@ -205,6 +205,9 @@ if(!mineral) if(istype(G, /obj/item/stack/sheet/mineral) && G.sheettype) var/M = G.sheettype + var/mineralassembly = text2path("/obj/structure/door_assembly/door_assembly_[M]") + if(!mineralassembly) + return if(G.get_amount() >= 2) playsound(src, 'sound/items/crowbar.ogg', 100, 1) user.visible_message("[user] adds [G.name] to the airlock assembly.", \ @@ -214,7 +217,6 @@ return to_chat(user, "You install [M] plating into the airlock assembly.") G.use(2) - var/mineralassembly = text2path("/obj/structure/door_assembly/door_assembly_[M]") var/obj/structure/door_assembly/MA = new mineralassembly(loc) transfer_assembly_vars(src, MA, TRUE) else diff --git a/code/game/objects/structures/girders.dm b/code/game/objects/structures/girders.dm index cd870752..eba82a56 100644 --- a/code/game/objects/structures/girders.dm +++ b/code/game/objects/structures/girders.dm @@ -167,6 +167,9 @@ if(S.sheettype && S.sheettype != "runed") var/M = S.sheettype if(state == GIRDER_DISPLACED) + var/F = text2path("/obj/structure/falsewall/[M]") + if(!F) + return if(S.get_amount() < 2) to_chat(user, "You need at least two sheets to create a false wall!") return @@ -175,11 +178,13 @@ return S.use(2) to_chat(user, "You create a false wall. Push on it to open or close the passage.") - var/F = text2path("/obj/structure/falsewall/[M]") var/obj/structure/FW = new F (loc) transfer_fingerprints_to(FW) qdel(src) else + var/F = text2path("/turf/closed/wall/mineral/[M]") + if(!F) + return if(S.get_amount() < 2) to_chat(user, "You need at least two sheets to add plating!") return @@ -190,7 +195,7 @@ S.use(2) to_chat(user, "You add the plating.") var/turf/T = get_turf(src) - T.PlaceOnTop(text2path("/turf/closed/wall/mineral/[M]")) + T.PlaceOnTop(F) transfer_fingerprints_to(T) qdel(src) return diff --git a/code/game/turfs/turf.dm b/code/game/turfs/turf.dm index 19e6fc68..b402fbe2 100644 --- a/code/game/turfs/turf.dm +++ b/code/game/turfs/turf.dm @@ -46,6 +46,9 @@ // by default, vis_contents is inherited from the turf that was here before vis_contents.Cut() + + if(color) + add_atom_colour(color, FIXED_COLOUR_PRIORITY) assemble_baseturfs() @@ -479,4 +482,4 @@ //Whatever happens after high temperature fire dies out or thermite reaction works. //Should return new turf /turf/proc/Melt() - return ScrapeAway() \ No newline at end of file + return ScrapeAway() diff --git a/code/modules/atmospherics/environmental/LINDA_fire.dm b/code/modules/atmospherics/environmental/LINDA_fire.dm index d1da05e4..2d42d120 100644 --- a/code/modules/atmospherics/environmental/LINDA_fire.dm +++ b/code/modules/atmospherics/environmental/LINDA_fire.dm @@ -9,7 +9,7 @@ return -/turf/open/hotspot_expose(exposed_temperature, exposed_volume, soh) +/turf/open/hotspot_expose(exposed_temperature, exposed_volume, soh = FALSE, holo = FALSE) var/datum/gas_mixture/air_contents = return_air() if(!air_contents) return 0 @@ -35,7 +35,7 @@ if(oxy < 0.5) return 0 - active_hotspot = new /obj/effect/hotspot(src) + active_hotspot = new /obj/effect/hotspot(src, holo) active_hotspot.temperature = exposed_temperature*50 active_hotspot.volume = exposed_volume*25 @@ -67,8 +67,10 @@ var/bypassing = FALSE var/visual_update_tick = 0 -/obj/effect/hotspot/Initialize() +/obj/effect/hotspot/Initialize(mapload, holo = FALSE) . = ..() + if(holo) + flags_1 |= HOLOGRAM_1 SSair.hotspots += src perform_exposure() setDir(pick(GLOB.cardinals)) @@ -192,15 +194,15 @@ if(bypassing) icon_state = "3" - location.burn_tile() - + if(!(flags_1 & HOLOGRAM_1)) + location.burn_tile() //Possible spread due to radiated heat if(location.air.temperature > FIRE_MINIMUM_TEMPERATURE_TO_SPREAD) var/radiated_temperature = location.air.temperature*FIRE_SPREAD_RADIOSITY_SCALE for(var/t in location.atmos_adjacent_turfs) var/turf/open/T = t if(T.active_hotspot) - T.hotspot_expose(radiated_temperature, CELL_VOLUME/4) + T.hotspot_expose(radiated_temperature, CELL_VOLUME/4, flags_1 & HOLOGRAM_1) else if(volume > CELL_VOLUME*0.4) @@ -224,7 +226,8 @@ var/turf/open/T = loc if(istype(T) && T.active_hotspot == src) T.active_hotspot = null - DestroyTurf() + if(!(flags_1 & HOLOGRAM_1)) + DestroyTurf() return ..() /obj/effect/hotspot/proc/DestroyTurf() diff --git a/code/modules/clothing/spacesuits/hardsuit.dm b/code/modules/clothing/spacesuits/hardsuit.dm index 9bb9453b..ffab865c 100644 --- a/code/modules/clothing/spacesuits/hardsuit.dm +++ b/code/modules/clothing/spacesuits/hardsuit.dm @@ -43,7 +43,7 @@ /obj/item/clothing/head/helmet/space/hardsuit/dropped(mob/user) ..() - if(suit) + if(suit && !ismob(loc)) //equipped() will handle mob cases, so it doesn't disengage twice. suit.RemoveHelmet() soundloop.stop(user) diff --git a/code/modules/holodeck/holo_effect.dm b/code/modules/holodeck/holo_effect.dm index 308cec1c..8211e5ed 100644 --- a/code/modules/holodeck/holo_effect.dm +++ b/code/modules/holodeck/holo_effect.dm @@ -62,7 +62,7 @@ s.set_up(3, 1, T) s.start() T.temperature = 5000 - T.hotspot_expose(50000,50000,1) + T.hotspot_expose(50000, 50000, TRUE, TRUE) diff --git a/code/modules/integrated_electronics/subtypes/manipulation.dm b/code/modules/integrated_electronics/subtypes/manipulation.dm index 682e76a4..83efa6ca 100644 --- a/code/modules/integrated_electronics/subtypes/manipulation.dm +++ b/code/modules/integrated_electronics/subtypes/manipulation.dm @@ -78,7 +78,7 @@ for(var/i in 1 to length(harvest_output)) harvest_output[i] = WEAKREF(harvest_output[i]) - if(harvest_output.len) + if(length(harvest_output)) set_pin_data(IC_OUTPUT, 1, harvest_output) push_data() if(1) diff --git a/code/modules/mob/living/carbon/human/species_types/plasmamen.dm b/code/modules/mob/living/carbon/human/species_types/plasmamen.dm index b59869e1..6601d55f 100644 --- a/code/modules/mob/living/carbon/human/species_types/plasmamen.dm +++ b/code/modules/mob/living/carbon/human/species_types/plasmamen.dm @@ -53,7 +53,7 @@ . = ..() /datum/species/plasmaman/before_equip_job(datum/job/J, mob/living/carbon/human/H, visualsOnly = FALSE) - var/current_job = J.title + var/current_job = J?.title var/datum/outfit/plasmaman/O = new /datum/outfit/plasmaman switch(current_job) if("Chaplain") diff --git a/code/modules/mob/living/simple_animal/hostile/mining_mobs/mining_mobs.dm b/code/modules/mob/living/simple_animal/hostile/mining_mobs/mining_mobs.dm index 96b19160..edbf7903 100644 --- a/code/modules/mob/living/simple_animal/hostile/mining_mobs/mining_mobs.dm +++ b/code/modules/mob/living/simple_animal/hostile/mining_mobs/mining_mobs.dm @@ -63,7 +63,7 @@ ..(gibbed) /mob/living/simple_animal/hostile/asteroid/proc/spawn_crusher_loot() - butcher_results[crusher_loot] = 1 + LAZYSET(butcher_results, crusher_loot, 1) /mob/living/simple_animal/hostile/asteroid/handle_temperature_damage() if(bodytemperature < minbodytemp) diff --git a/code/modules/reagents/chemistry/recipes/special.dm b/code/modules/reagents/chemistry/recipes/special.dm index 15337210..89380399 100644 --- a/code/modules/reagents/chemistry/recipes/special.dm +++ b/code/modules/reagents/chemistry/recipes/special.dm @@ -187,6 +187,7 @@ GLOBAL_LIST_INIT(food_reagents, build_reagents_to_food()) //reagentid = related var/datum/chemical_reaction/recipe = get_chemical_reaction(recipe_id) if(!recipe) info = "This recipe is illegible." + return var/list/dat = list("