diff --git a/code/modules/mining/mine_turfs.dm b/code/modules/mining/mine_turfs.dm index 236c4269f0a..1bd8dd5db69 100644 --- a/code/modules/mining/mine_turfs.dm +++ b/code/modules/mining/mine_turfs.dm @@ -644,14 +644,14 @@ var/list/mining_overlay_cache = list() var/pain = 0 if(prob(50)) pain = 1 - for(var/mob/living/M in range(src, 200)) + for(var/mob/living/M in range(src, 5)) //Let's only hit people nearby us. to_chat(M, span_danger("[pick("A high-pitched [pick("keening","wailing","whistle")]","A rumbling noise like [pick("thunder","heavy machinery")]")] somehow penetrates your mind before fading away!")) if(pain) flick("pain",M.pain) M.flash_eyes() if(prob(50)) M.Stun(5) - M.make_jittery(1000) //SHAKY + M.make_jittery(50) //SHAKY this used to be 1000(seizure) but I toned it to 50 to be less aggressive. if(prob(25)) excavate_find(prob(25), finds[1]) else if(rand(1,500) == 1) diff --git a/code/modules/xenoarcheaology/artifacts/artifact.dm b/code/modules/xenoarcheaology/artifacts/artifact.dm index 0f160d38c81..6b0ecdb8e73 100644 --- a/code/modules/xenoarcheaology/artifacts/artifact.dm +++ b/code/modules/xenoarcheaology/artifacts/artifact.dm @@ -37,7 +37,6 @@ . = ..() /obj/machinery/artifact/Initialize(mapload) - . = ..() if(ispath(artifact_master)) AddComponent(artifact_master) @@ -78,7 +77,9 @@ name = "intricately carved statue" desc = "A strange statue." my_effect.trigger = pick(TRIGGER_TOUCH, TRIGGER_HEAT, TRIGGER_COLD) - + artifact_master.do_large_randomization() + . = ..() + update_icon() /obj/machinery/artifact/update_icon() ..() diff --git a/code/modules/xenoarcheaology/effect.dm b/code/modules/xenoarcheaology/effect.dm index 1f053c18713..2b6a0a86fa0 100644 --- a/code/modules/xenoarcheaology/effect.dm +++ b/code/modules/xenoarcheaology/effect.dm @@ -20,6 +20,8 @@ // The last time the effect was toggled. var/last_activation = 0 + // If we can start activated or not! + var/can_start_activated = TRUE /datum/artifact_effect/Destroy() master = null //Master still exists even if our effect gets destroyed. No need to qdel_null. @@ -61,29 +63,31 @@ if(3) //large range, long charge time chargelevelmax = rand(20, 120) - effectrange = rand(20, 100) //VOREStation Edit - Map size. + effectrange = rand(20, 100) + if(can_start_activated && prob(50)) + ToggleActivate(TRUE, TRUE) -/datum/artifact_effect/proc/ToggleActivate(var/reveal_toggle = 1) +/datum/artifact_effect/proc/ToggleActivate(var/reveal_toggle = TRUE, var/spawn_toggle = FALSE) //so that other stuff happens first set waitfor = FALSE var/atom/target = get_master_holder() + if(world.time - last_activation > 1 SECOND) last_activation = world.time if(activated) - activated = 0 + activated = FALSE else - activated = 1 + activated = TRUE if(reveal_toggle && target) - if(!isliving(target)) - target.update_icon() + if(!isliving(target) && !(spawn_toggle && istype(target, /obj/machinery/artifact))) //This is to keep it from updating icons if our owner is a large artifact + target.update_icon() //As it will runtime since it hasn't set it's artifact_master yet. The update icon is handled in /obj/machinery/artifact/Initialize() var/display_msg if(activated) display_msg = pick("momentarily glows brightly!","distorts slightly for a moment!","flickers slightly!","vibrates!","shimmers slightly for a moment!") else display_msg = pick("grows dull!","fades in intensity!","suddenly becomes very still!","suddenly becomes very quiet!") - if(active_effect) if(activated) target.underlays.Add(active_effect) @@ -192,6 +196,7 @@ . += " Activation index involves " + span_bold("precise temperature conditions.") + " Heating/Cooling the atmosphere (>[ARTIFACT_HEAT_TRIGGER]K or <[ARTIFACT_COLD_TRIGGER]K) or using a welder are potential triggers." else . += " Unable to determine any data about activation trigger." + . += "
" //returns 0..1, with 1 being no protection and 0 being fully protected /proc/GetAnomalySusceptibility(var/mob/living/carbon/human/H) diff --git a/code/modules/xenoarcheaology/effect_master.dm b/code/modules/xenoarcheaology/effect_master.dm index 74c19c47d1a..24beb616ae2 100644 --- a/code/modules/xenoarcheaology/effect_master.dm +++ b/code/modules/xenoarcheaology/effect_master.dm @@ -79,6 +79,12 @@ var/list/toxic_reagents = list(TOXIN_PATH) do_setup() return +// This handles the randomization for large artifacts. This allows them to spawn in and do the 50/50 to see if they'll be activated or not. +/datum/component/artifact_master/proc/do_large_randomization() + for(var/datum/artifact_effect/my_effect in my_effects) + if(my_effect.can_start_activated && prob(50)) + my_effect.ToggleActivate(TRUE, TRUE) + /* * Component System Registry. * Here be dragons. @@ -269,9 +275,12 @@ var/list/toxic_reagents = list(TOXIN_PATH) else if(ishuman(bumped) && GetAnomalySusceptibility(bumped) >= 0.5) if (my_effect.trigger == TRIGGER_TOUCH) my_effect.ToggleActivate() + warn = 1 if(my_effect.activated && my_effect.effect == EFFECT_TOUCH) my_effect.DoEffectTouch(bumped) - warn = 1 + continue //We activated it, go ahead and move on to the next. If we don't continue, we hit them with the effect again. + if(my_effect.effect == EFFECT_TOUCH && my_effect.activated) //We are activated and have a touch effect! + my_effect.DoEffectTouch(bumped) if(warn && isliving(bumped)) to_chat(bumped, span_filter_notice(span_bold("You accidentally touch \the [holder] as it hits you."))) @@ -286,11 +295,15 @@ var/list/toxic_reagents = list(TOXIN_PATH) my_effect.ToggleActivate() else if(ishuman(M) && !istype(M:gloves,/obj/item/clothing/gloves)) - if (my_effect.trigger == TRIGGER_TOUCH) + if(my_effect.trigger == TRIGGER_TOUCH) my_effect.ToggleActivate(M) + warn = 1 if(my_effect.activated && my_effect.effect == EFFECT_TOUCH) my_effect.DoEffectTouch(M) - warn = 1 + continue //We activated it, go ahead and move on to the next. If we don't continue, we hit them with the effect again. + if(my_effect.effect == EFFECT_TOUCH && my_effect.activated) //We are activated and have a touch effect! + my_effect.DoEffectTouch(M) + if(warn && isliving(M)) to_chat(M, span_filter_notice(span_bold("You accidentally touch \the [holder]."))) @@ -313,6 +326,9 @@ var/list/toxic_reagents = list(TOXIN_PATH) my_effect.ToggleActivate() if(my_effect.activated && my_effect.effect == EFFECT_TOUCH) my_effect.DoEffectTouch(user) + continue //We activated it, go ahead and move on to the next. If we don't continue, we hit them with the effect again. + if(my_effect.effect == EFFECT_TOUCH && my_effect.activated) //We are activated and have a touch effect! + my_effect.DoEffectTouch(user) if(triggered) to_chat(user, span_filter_notice(span_bold("You touch [holder]."))) diff --git a/code/modules/xenoarcheaology/effects/atmospheric.dm b/code/modules/xenoarcheaology/effects/atmospheric.dm index 16f90d0b0f2..fe1c80e5f86 100644 --- a/code/modules/xenoarcheaology/effects/atmospheric.dm +++ b/code/modules/xenoarcheaology/effects/atmospheric.dm @@ -5,6 +5,7 @@ var/random = TRUE effect_type = EFFECT_GAS effect = EFFECT_AURA + can_start_activated = FALSE //This is set to FALSE so we do NOT CREATE IMMEDIATE HELLFIRES effect_color = "#a5a5a5" diff --git a/code/modules/xenoarcheaology/finds/finds.dm b/code/modules/xenoarcheaology/finds/finds.dm index 1249785e408..876683fb8e6 100644 --- a/code/modules/xenoarcheaology/finds/finds.dm +++ b/code/modules/xenoarcheaology/finds/finds.dm @@ -1,7 +1,7 @@ /datum/find var/find_type = 0 //random according to the digsite type var/excavation_required = 0 //random 10 - 190 - var/view_range = 40 //how close excavation has to come to show an overlay on the turf + var/view_range = 200 //how close excavation has to come to show an overlay on the turf var/prob_delicate = 0 //probability it requires an active suspension field to not insta-crumble. Set to 0 to nullify the need for suspension field. /datum/find/New(var/digsite, var/exc_req)