diff --git a/code/__defines/weather.dm b/code/__defines/weather.dm new file mode 100644 index 0000000000..32b9d93d0f --- /dev/null +++ b/code/__defines/weather.dm @@ -0,0 +1,6 @@ +#define HAS_PLANET_EFFECT 0x1 +#define EFFECT_ALL_MOBS 0x2 +#define EFFECT_ONLY_HUMANS 0x4 +#define EFFECT_ONLY_LIVING 0x8 +#define EFFECT_ONLY_ROBOTS 0x10 +#define EFFECT_ALWAYS_HITS 0x20 diff --git a/code/controllers/subsystems/planets.dm b/code/controllers/subsystems/planets.dm index 0dd04f6f92..4ad613b4ce 100644 --- a/code/controllers/subsystems/planets.dm +++ b/code/controllers/subsystems/planets.dm @@ -24,9 +24,11 @@ SUBSYSTEM_DEF(planets) for(var/P in planet_datums) var/datum/planet/NP = new P() planets.Add(NP) - for(var/Z in NP.expected_z_levels) + for(var/index in 1 to length(NP.expected_z_levels)) + var/Z = NP.expected_z_levels[index] if(!isnum(Z)) Z = GLOB.map_templates_loaded[Z] + NP.expected_z_levels[index] = Z if(Z > length(z_to_planet)) z_to_planet.len = Z if(z_to_planet[Z]) diff --git a/code/game/objects/items.dm b/code/game/objects/items.dm index 116ff01af8..5f9da5ed45 100644 --- a/code/game/objects/items.dm +++ b/code/game/objects/items.dm @@ -588,14 +588,14 @@ var/list/global/slot_flags_enumeration = list( if(!(usr)) //BS12 EDIT return - if(!usr.canmove || usr.stat || usr.restrained() || !Adjacent(usr)) + if(!usr.canmove || usr.stat || usr.restrained() || !Adjacent(usr) || usr.is_incorporeal()) return if(isanimal(usr)) //VOREStation Edit Start - Allows simple mobs with hands to use the pickup verb var/mob/living/simple_mob/s = usr if(!s.has_hands) to_chat(usr, span_warning("You can't pick things up!")) return - else if((!istype(usr, /mob/living/carbon)) || (istype(usr, /mob/living/carbon/brain)))//Is humanoid, and is not a brain + else if((!iscarbon(usr)) || (isbrain(usr)))//Is humanoid, and is not a brain to_chat(usr, span_warning("You can't pick things up!")) return var/mob/living/L = usr @@ -608,7 +608,7 @@ var/list/global/slot_flags_enumeration = list( if(L.get_active_hand()) //Hand is not full //VOREStation Edit End to_chat(usr, span_warning("Your hand is full.")) return - if(!istype(src.loc, /turf)) //Object is on a turf + if(!isturf(src.loc)) //Object is on a turf to_chat(usr, span_warning("You can't pick that up!")) return //All checks are done, time to pick it up! @@ -632,7 +632,7 @@ var/list/global/slot_flags_enumeration = list( /obj/item/proc/get_loc_turf() var/atom/L = loc - while(L && !istype(L, /turf/)) + while(L && !isturf(L)) L = L.loc return loc diff --git a/code/modules/admin/verbs/randomverbs_vr.dm b/code/modules/admin/verbs/randomverbs_vr.dm index 8cd3c50604..5cab940f6f 100644 --- a/code/modules/admin/verbs/randomverbs_vr.dm +++ b/code/modules/admin/verbs/randomverbs_vr.dm @@ -42,6 +42,8 @@ if(vorgans == "No") organs = 0 + var/flavor = tgui_alert(src, "Spawn mob with their character's flavor text?", "Flavor text", list("General", "Robot", "Cancel")) + var/spawnloc if(!src.mob) to_chat(src, "Can't spawn them in unless you're in a valid spawn location!") @@ -61,10 +63,18 @@ new_mob.key = picked_client.key //Finally put them in the mob + if(flavor == "General") + new_mob.flavor_text = new_mob?.client?.prefs?.flavor_texts["general"] + if(flavor == "Robot") + new_mob.flavor_text = new_mob?.client?.prefs?.flavour_texts_robot["Default"] if(organs) new_mob.copy_from_prefs_vr() if(LAZYLEN(new_mob.vore_organs)) new_mob.vore_selected = new_mob.vore_organs[1] + if(isanimal(new_mob)) + var/mob/living/simple_mob/Sm = new_mob + Sm.vore_active = TRUE + Sm.voremob_loaded = TRUE log_admin("[key_name_admin(src)] has spawned [new_mob.key] as mob [new_mob.type].") message_admins("[key_name_admin(src)] has spawned [new_mob.key] as mob [new_mob.type].", 1) diff --git a/code/modules/mob/living/carbon/human/examine.dm b/code/modules/mob/living/carbon/human/examine.dm index 127663c5fe..f370219796 100644 --- a/code/modules/mob/living/carbon/human/examine.dm +++ b/code/modules/mob/living/carbon/human/examine.dm @@ -279,6 +279,7 @@ var/list/vorestrings = list() vorestrings += examine_weight() vorestrings += examine_nutrition() + vorestrings += examine_reagent_bellies() // reagent bellies vorestrings += examine_bellies() vorestrings += examine_pickup_size() vorestrings += examine_step_size() diff --git a/code/modules/mob/living/inventory.dm b/code/modules/mob/living/inventory.dm index e8c7283574..594967fccb 100644 --- a/code/modules/mob/living/inventory.dm +++ b/code/modules/mob/living/inventory.dm @@ -183,7 +183,9 @@ // This handles the drag-open inventory panel. /mob/living/MouseDrop(atom/over_object) var/mob/living/L = over_object - if(istype(L) && L != src && L == usr && Adjacent(L) && !L.is_incorporeal()) + if(L.is_incorporeal()) + return + if(istype(L) && L != src && L == usr && Adjacent(L)) show_inventory_panel(L) . = ..() diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index c933c9f61f..e9c4ea2f7b 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -49,6 +49,9 @@ if(istype(nest, /obj/structure/blob/factory)) var/obj/structure/blob/factory/F = nest F.spores -= src + if(istype(nest, /obj/structure/mob_spawner)) + var/obj/structure/mob_spawner/S = nest + S.get_death_report(src) nest = null if(buckled) buckled.unbuckle_mob(src, TRUE) diff --git a/code/modules/mob/living/silicon/pai/examine.dm b/code/modules/mob/living/silicon/pai/examine.dm index 35f5139faf..9b3dece097 100644 --- a/code/modules/mob/living/silicon/pai/examine.dm +++ b/code/modules/mob/living/silicon/pai/examine.dm @@ -6,6 +6,7 @@ if(!src.client) . += "It appears to be in stand-by mode." //afk if(UNCONSCIOUS) . += span_warning("It doesn't seem to be responding.") if(DEAD) . += span_deadsay("It looks completely unsalvageable.") + . += attempt_vr(src,"examine_reagent_bellies",args) // reagent bellies // VOREStation Edit: Start . += attempt_vr(src,"examine_bellies",args) //VOREStation Edit diff --git a/code/modules/mob/living/silicon/robot/examine.dm b/code/modules/mob/living/silicon/robot/examine.dm index 2622411e1e..957915e4c2 100644 --- a/code/modules/mob/living/silicon/robot/examine.dm +++ b/code/modules/mob/living/silicon/robot/examine.dm @@ -29,6 +29,7 @@ . += "It appears to be in stand-by mode." //afk if(UNCONSCIOUS) . += span_warning("It doesn't seem to be responding.") if(DEAD) . += span_deadsay("It looks completely unsalvageable.") + . += attempt_vr(src,"examine_reagent_bellies",args) // reagent bellies // VOREStation Edit: Start . += attempt_vr(src,"examine_bellies_borg",args) //VOREStation Edit diff --git a/code/modules/mob/living/simple_mob/harvesting.dm b/code/modules/mob/living/simple_mob/harvesting.dm index a1b3e5ef0d..66cf2a89cd 100644 --- a/code/modules/mob/living/simple_mob/harvesting.dm +++ b/code/modules/mob/living/simple_mob/harvesting.dm @@ -25,6 +25,13 @@ else . += span_notice("It can be [harvest_verb] now.") + . += attempt_vr(src,"examine_reagent_bellies",args) + + . += attempt_vr(src,"examine_bellies",args) + . += "" + + if(print_flavor_text()) . += "
[print_flavor_text()]" + /mob/living/simple_mob/proc/livestock_harvest(var/obj/item/tool, var/mob/living/user) if(!LAZYLEN(harvest_results)) // Might be a unique interaction of an object using the proc to do something weird, or just someone's a donk. harvest_recent = world.time diff --git a/code/modules/mob/living/simple_mob/simple_mob_vr.dm b/code/modules/mob/living/simple_mob/simple_mob_vr.dm index 3b08da3eca..ece16687ad 100644 --- a/code/modules/mob/living/simple_mob/simple_mob_vr.dm +++ b/code/modules/mob/living/simple_mob/simple_mob_vr.dm @@ -54,6 +54,8 @@ // Release belly contents before being gc'd! /mob/living/simple_mob/Destroy() + if(mob_radio) + QDEL_NULL(mob_radio) release_vore_contents() LAZYCLEARLIST(prey_excludes) return ..() diff --git a/code/modules/mob/living/simple_mob/subtypes/vore/macrophage.dm b/code/modules/mob/living/simple_mob/subtypes/vore/macrophage.dm index 77963a9b9c..21b252b23d 100644 --- a/code/modules/mob/living/simple_mob/subtypes/vore/macrophage.dm +++ b/code/modules/mob/living/simple_mob/subtypes/vore/macrophage.dm @@ -129,6 +129,7 @@ var/obj/belly/B = new /obj/belly/macrophage(src) vore_selected = B + . = ..() /datum/ai_holder/simple_mob/melee/macrophage var/datum/disease/virus = null diff --git a/code/modules/mob/living/simple_mob/subtypes/vore/shadekin/shadekin.dm b/code/modules/mob/living/simple_mob/subtypes/vore/shadekin/shadekin.dm index 3783f14977..725b4a29ab 100644 --- a/code/modules/mob/living/simple_mob/subtypes/vore/shadekin/shadekin.dm +++ b/code/modules/mob/living/simple_mob/subtypes/vore/shadekin/shadekin.dm @@ -197,6 +197,7 @@ "The stinging and aching gives way to numbness as you're slowly smothered out. Your body is steadily reduced to nutrients and energy for the creature to continue on its way.", "The chaos of being digested fades as you're snuffed out by a harsh clench! You're steadily broken down into a thick paste, processed and absorbed by the predator!" ) + . = ..() /mob/living/simple_mob/shadekin/Life() . = ..() diff --git a/code/modules/planet/sif.dm b/code/modules/planet/sif.dm index 916b303db9..3874e01e89 100644 --- a/code/modules/planet/sif.dm +++ b/code/modules/planet/sif.dm @@ -293,28 +293,27 @@ var/datum/planet/sif/planet_sif = null ) outdoor_sounds_type = /datum/looping_sound/weather/rain indoor_sounds_type = /datum/looping_sound/weather/rain/indoors + effect_flags = HAS_PLANET_EFFECT | EFFECT_ONLY_LIVING -/datum/weather/sif/rain/process_effects() - ..() - for(var/mob/living/L as anything in living_mob_list) - if(L.z in holder.our_planet.expected_z_levels) - var/turf/T = get_turf(L) - if(!T.is_outdoors()) - continue // They're indoors, so no need to rain on them. +/datum/weather/sif/rain/planet_effect(mob/living/L) + if(L.z in holder.our_planet.expected_z_levels) + var/turf/T = get_turf(L) + if(!T.is_outdoors()) + return // They're indoors, so no need to rain on them. - // If they have an open umbrella, it'll guard from rain - var/obj/item/melee/umbrella/U = L.get_active_hand() - if(!istype(U) || !U.open) - U = L.get_inactive_hand() + // If they have an open umbrella, it'll guard from rain + var/obj/item/melee/umbrella/U = L.get_active_hand() + if(!istype(U) || !U.open) + U = L.get_inactive_hand() - if(istype(U) && U.open) - if(show_message) - to_chat(L, span_notice("Rain patters softly onto your umbrella.")) - continue - - L.water_act(1) + if(istype(U) && U.open) if(show_message) - to_chat(L, effect_message) + to_chat(L, span_notice("Rain patters softly onto your umbrella.")) + return + + L.water_act(1) + if(show_message) + to_chat(L, effect_message) /datum/weather/sif/storm name = "storm" @@ -345,30 +344,31 @@ var/datum/planet/sif/planet_sif = null WEATHER_FOG = 3, WEATHER_OVERCAST = 2 ) + effect_flags = HAS_PLANET_EFFECT | EFFECT_ONLY_LIVING + +/datum/weather/sif/storm/planet_effect(mob/living/L) + if(L.z in holder.our_planet.expected_z_levels) + var/turf/T = get_turf(L) + if(!T.is_outdoors()) + return // They're indoors, so no need to rain on them. + + // If they have an open umbrella, it'll guard from rain + var/obj/item/melee/umbrella/U = L.get_active_hand() + if(!istype(U) || !U.open) + U = L.get_inactive_hand() + + if(istype(U) && U.open) + if(show_message) + to_chat(L, span_notice("Rain showers loudly onto your umbrella!")) + return + + + L.water_act(2) + if(show_message) + to_chat(L, effect_message) /datum/weather/sif/storm/process_effects() ..() - for(var/mob/living/L as anything in living_mob_list) - if(L.z in holder.our_planet.expected_z_levels) - var/turf/T = get_turf(L) - if(!T.is_outdoors()) - continue // They're indoors, so no need to rain on them. - - // If they have an open umbrella, it'll guard from rain - var/obj/item/melee/umbrella/U = L.get_active_hand() - if(!istype(U) || !U.open) - U = L.get_inactive_hand() - - if(istype(U) && U.open) - if(show_message) - to_chat(L, span_notice("Rain showers loudly onto your umbrella!")) - continue - - - L.water_act(2) - if(show_message) - to_chat(L, effect_message) - handle_lightning() // This gets called to do lightning periodically. @@ -401,41 +401,40 @@ var/datum/planet/sif/planet_sif = null "It begins to hail.", "An intense chill is felt, and chunks of ice start to fall from the sky, towards you." ) + effect_flags = HAS_PLANET_EFFECT | EFFECT_ONLY_HUMANS -/datum/weather/sif/hail/process_effects() - ..() - for(var/mob/living/carbon/H as anything in human_mob_list) - if(H.z in holder.our_planet.expected_z_levels) - var/turf/T = get_turf(H) - if(!T.is_outdoors()) - continue // They're indoors, so no need to pelt them with ice. +/datum/weather/sif/hail/planet_effect(mob/living/carbon/H) + if(H.z in holder.our_planet.expected_z_levels) + var/turf/T = get_turf(H) + if(!T.is_outdoors()) + return // They're indoors, so no need to pelt them with ice. - // If they have an open umbrella, it'll guard from hail - var/obj/item/melee/umbrella/U = H.get_active_hand() - if(!istype(U) || !U.open) - U = H.get_inactive_hand() + // If they have an open umbrella, it'll guard from hail + var/obj/item/melee/umbrella/U = H.get_active_hand() + if(!istype(U) || !U.open) + U = H.get_inactive_hand() - if(istype(U) && U.open) - if(show_message) - to_chat(H, span_notice("Hail patters onto your umbrella.")) - continue - - var/target_zone = pick(BP_ALL) - var/amount_blocked = H.run_armor_check(target_zone, "melee") - var/amount_soaked = H.get_armor_soak(target_zone, "melee") - - var/damage = rand(1,3) - - if(amount_blocked >= 30) - continue // No need to apply damage. Hardhats are 30. They should probably protect you from hail on your head. - //Voidsuits are likewise 40, and riot, 80. Clothes are all less than 30. - - if(amount_soaked >= damage) - continue // No need to apply damage. - - H.apply_damage(damage, BRUTE, target_zone, amount_blocked, amount_soaked, used_weapon = "hail") + if(istype(U) && U.open) if(show_message) - to_chat(H, effect_message) + to_chat(H, span_notice("Hail patters onto your umbrella.")) + return + + var/target_zone = pick(BP_ALL) + var/amount_blocked = H.run_armor_check(target_zone, "melee") + var/amount_soaked = H.get_armor_soak(target_zone, "melee") + + var/damage = rand(1,3) + + if(amount_blocked >= 30) + return // No need to apply damage. Hardhats are 30. They should probably protect you from hail on your head. + //Voidsuits are likewise 40, and riot, 80. Clothes are all less than 30. + + if(amount_soaked >= damage) + return // No need to apply damage. + + H.apply_damage(damage, BRUTE, target_zone, amount_blocked, amount_soaked, used_weapon = "hail") + if(show_message) + to_chat(H, effect_message) /datum/weather/sif/fog name = "fog" @@ -520,16 +519,15 @@ var/datum/planet/sif/planet_sif = null // Lets recycle. outdoor_sounds_type = /datum/looping_sound/weather/outside_blizzard indoor_sounds_type = /datum/looping_sound/weather/inside_blizzard + effect_flags = HAS_PLANET_EFFECT | EFFECT_ONLY_LIVING -/datum/weather/sif/ash_storm/process_effects() - ..() - for(var/mob/living/L as anything in living_mob_list) - if(L.z in holder.our_planet.expected_z_levels) - var/turf/T = get_turf(L) - if(!T.is_outdoors()) - continue // They're indoors, so no need to burn them with ash. +/datum/weather/sif/ash_storm/planet_effect(mob/living/L) + if(L.z in holder.our_planet.expected_z_levels) + var/turf/T = get_turf(L) + if(!T.is_outdoors()) + return // They're indoors, so no need to burn them with ash. - L.inflict_heat_damage(rand(1, 3)) + L.inflict_heat_damage(rand(1, 3)) // Totally radical. @@ -556,17 +554,16 @@ var/datum/planet/sif/planet_sif = null // How much radiation is bursted onto a random tile near a mob. var/fallout_rad_low = RAD_LEVEL_HIGH var/fallout_rad_high = RAD_LEVEL_VERY_HIGH + effect_flags = HAS_PLANET_EFFECT | EFFECT_ONLY_LIVING -/datum/weather/sif/fallout/process_effects() - ..() - for(var/mob/living/L as anything in living_mob_list) - if(L.z in holder.our_planet.expected_z_levels) - irradiate_nearby_turf(L) - var/turf/T = get_turf(L) - if(!T.is_outdoors()) - continue // They're indoors, so no need to irradiate them with fallout. +/datum/weather/sif/fallout/planet_effect(mob/living/L) + if(L.z in holder.our_planet.expected_z_levels) + irradiate_nearby_turf(L) + var/turf/T = get_turf(L) + if(!T.is_outdoors()) + return // They're indoors, so no need to irradiate them with fallout. - L.rad_act(rand(direct_rad_low, direct_rad_high)) + L.rad_act(rand(direct_rad_low, direct_rad_high)) // This makes random tiles near people radioactive for awhile. // Tiles far away from people are left alone, for performance. diff --git a/code/modules/planet/virgo3b_vr.dm b/code/modules/planet/virgo3b_vr.dm index c6cc301c9c..292afea2f5 100644 --- a/code/modules/planet/virgo3b_vr.dm +++ b/code/modules/planet/virgo3b_vr.dm @@ -285,28 +285,27 @@ var/datum/planet/virgo3b/planet_virgo3b = null imminent_transition_message = "Light drips of water are starting to fall from the sky." outdoor_sounds_type = /datum/looping_sound/weather/rain indoor_sounds_type = /datum/looping_sound/weather/rain/indoors + effect_flags = HAS_PLANET_EFFECT | EFFECT_ONLY_LIVING -/datum/weather/virgo3b/rain/process_effects() - ..() - for(var/mob/living/L as anything in living_mob_list) - if(L.z in holder.our_planet.expected_z_levels) - var/turf/T = get_turf(L) - if(!T.is_outdoors()) - continue // They're indoors, so no need to rain on them. +/datum/weather/virgo3b/rain/planet_effect(mob/living/L) + if(L.z in holder.our_planet.expected_z_levels) + var/turf/T = get_turf(L) + if(!T.is_outdoors()) + return // They're indoors, so no need to rain on them. - // If they have an open umbrella, it'll guard from rain - var/obj/item/melee/umbrella/U = L.get_active_hand() - if(!istype(U) || !U.open) - U = L.get_inactive_hand() + // If they have an open umbrella, it'll guard from rain + var/obj/item/melee/umbrella/U = L.get_active_hand() + if(!istype(U) || !U.open) + U = L.get_inactive_hand() - if(istype(U) && U.open) - if(show_message) - to_chat(L, span_notice("Rain patters softly onto your umbrella.")) - continue - - L.water_act(1) + if(istype(U) && U.open) if(show_message) - to_chat(L, effect_message) + to_chat(L, span_notice("Rain patters softly onto your umbrella.")) + return + + L.water_act(1) + if(show_message) + to_chat(L, effect_message) /datum/weather/virgo3b/storm name = "storm" @@ -338,30 +337,31 @@ var/datum/planet/virgo3b/planet_virgo3b = null WEATHER_HAIL = 10, WEATHER_OVERCAST = 5 ) + effect_flags = HAS_PLANET_EFFECT | EFFECT_ONLY_LIVING + +/datum/weather/virgo3b/storm/planet_effect(mob/living/L) + if(L.z in holder.our_planet.expected_z_levels) + var/turf/T = get_turf(L) + if(!T.is_outdoors()) + return // They're indoors, so no need to rain on them. + + // If they have an open umbrella, it'll guard from rain + var/obj/item/melee/umbrella/U = L.get_active_hand() + if(!istype(U) || !U.open) + U = L.get_inactive_hand() + + if(istype(U) && U.open) + if(show_message) + to_chat(L, span_notice("Rain patters softly onto your umbrella.")) + return + + + L.water_act(2) + if(show_message) + to_chat(L, effect_message) /datum/weather/virgo3b/storm/process_effects() ..() - for(var/mob/living/L as anything in living_mob_list) - if(L.z in holder.our_planet.expected_z_levels) - var/turf/T = get_turf(L) - if(!T.is_outdoors()) - continue // They're indoors, so no need to rain on them. - - // If they have an open umbrella, it'll guard from rain - var/obj/item/melee/umbrella/U = L.get_active_hand() - if(!istype(U) || !U.open) - U = L.get_inactive_hand() - - if(istype(U) && U.open) - if(show_message) - to_chat(L, span_notice("Rain patters softly onto your umbrella.")) - continue - - - L.water_act(2) - if(show_message) - to_chat(L, effect_message) - handle_lightning() // This gets called to do lightning periodically. @@ -396,41 +396,40 @@ var/datum/planet/virgo3b/planet_virgo3b = null "An intense chill is felt, and chunks of ice start to fall from the sky, towards you." ) imminent_transition_message = "Small bits of ice are falling from the sky, growing larger by the second. Hail is starting, get to cover!" + effect_flags = HAS_PLANET_EFFECT | EFFECT_ONLY_HUMANS -/datum/weather/virgo3b/hail/process_effects() - ..() - for(var/mob/living/carbon/H as anything in human_mob_list) - if(H.z in holder.our_planet.expected_z_levels) - var/turf/T = get_turf(H) - if(!T.is_outdoors()) - continue // They're indoors, so no need to pelt them with ice. +/datum/weather/virgo3b/hail/planet_effect(mob/living/carbon/H) + if(H.z in holder.our_planet.expected_z_levels) + var/turf/T = get_turf(H) + if(!T.is_outdoors()) + return // They're indoors, so no need to pelt them with ice. - // If they have an open umbrella, it'll guard from hail - var/obj/item/melee/umbrella/U = H.get_active_hand() - if(!istype(U) || !U.open) - U = H.get_inactive_hand() + // If they have an open umbrella, it'll guard from hail + var/obj/item/melee/umbrella/U = H.get_active_hand() + if(!istype(U) || !U.open) + U = H.get_inactive_hand() - if(istype(U) && U.open) - if(show_message) - to_chat(H, span_notice("Hail patters onto your umbrella.")) - continue - - var/target_zone = pick(BP_ALL) - var/amount_blocked = H.run_armor_check(target_zone, "melee") - var/amount_soaked = H.get_armor_soak(target_zone, "melee") - - var/damage = rand(1,3) - - if(amount_blocked >= 30) - continue // No need to apply damage. Hardhats are 30. They should probably protect you from hail on your head. - //Voidsuits are likewise 40, and riot, 80. Clothes are all less than 30. - - if(amount_soaked >= damage) - continue // No need to apply damage. - - H.apply_damage(damage, BRUTE, target_zone, amount_blocked, amount_soaked) + if(istype(U) && U.open) if(show_message) - to_chat(H, effect_message) + to_chat(H, span_notice("Hail patters onto your umbrella.")) + return + + var/target_zone = pick(BP_ALL) + var/amount_blocked = H.run_armor_check(target_zone, "melee") + var/amount_soaked = H.get_armor_soak(target_zone, "melee") + + var/damage = rand(1,3) + + if(amount_blocked >= 30) + return // No need to apply damage. Hardhats are 30. They should probably protect you from hail on your head. + //Voidsuits are likewise 40, and riot, 80. Clothes are all less than 30. + + if(amount_soaked >= damage) + return // No need to apply damage. + + H.apply_damage(damage, BRUTE, target_zone, amount_blocked, amount_soaked) + if(show_message) + to_chat(H, effect_message) /datum/weather/virgo3b/fog name = "fog" @@ -516,16 +515,15 @@ var/datum/planet/virgo3b/planet_virgo3b = null // Lets recycle. outdoor_sounds_type = /datum/looping_sound/weather/outside_blizzard indoor_sounds_type = /datum/looping_sound/weather/inside_blizzard + effect_flags = HAS_PLANET_EFFECT | EFFECT_ONLY_LIVING -/datum/weather/virgo3b/ash_storm/process_effects() - ..() - for(var/mob/living/L as anything in living_mob_list) - if(L.z in holder.our_planet.expected_z_levels) - var/turf/T = get_turf(L) - if(!T.is_outdoors()) - continue // They're indoors, so no need to burn them with ash. +/datum/weather/virgo3b/ash_storm/planet_effect(mob/living/L) + if(L.z in holder.our_planet.expected_z_levels) + var/turf/T = get_turf(L) + if(!T.is_outdoors()) + return // They're indoors, so no need to burn them with ash. - L.inflict_heat_damage(rand(1, 3)) + L.inflict_heat_damage(rand(1, 3)) /datum/weather/virgo3b/ash_storm_safe name = "light ash storm" @@ -575,17 +573,16 @@ var/datum/planet/virgo3b/planet_virgo3b = null // How much radiation is bursted onto a random tile near a mob. var/fallout_rad_low = RAD_LEVEL_HIGH var/fallout_rad_high = RAD_LEVEL_VERY_HIGH + effect_flags = HAS_PLANET_EFFECT | EFFECT_ONLY_LIVING -/datum/weather/virgo3b/fallout/process_effects() - ..() - for(var/mob/living/L as anything in living_mob_list) - if(L.z in holder.our_planet.expected_z_levels) - irradiate_nearby_turf(L) - var/turf/T = get_turf(L) - if(!T.is_outdoors()) - continue // They're indoors, so no need to irradiate them with fallout. +/datum/weather/virgo3b/fallout/planet_effect(mob/living/L) + if(L.z in holder.our_planet.expected_z_levels) + irradiate_nearby_turf(L) + var/turf/T = get_turf(L) + if(!T.is_outdoors()) + return // They're indoors, so no need to irradiate them with fallout. - L.rad_act(rand(direct_rad_low, direct_rad_high)) + L.rad_act(rand(direct_rad_low, direct_rad_high)) // This makes random tiles near people radioactive for awhile. // Tiles far away from people are left alone, for performance. diff --git a/code/modules/planet/virgo3c_vr.dm b/code/modules/planet/virgo3c_vr.dm index a31cf3f342..a7fc846840 100644 --- a/code/modules/planet/virgo3c_vr.dm +++ b/code/modules/planet/virgo3c_vr.dm @@ -274,28 +274,27 @@ var/datum/planet/virgo3c/planet_virgo3c = null "The sky is dark, and rain falls down upon you." ) imminent_transition_message = "Light drips of water are starting to fall from the sky." + effect_flags = HAS_PLANET_EFFECT | EFFECT_ONLY_LIVING -/datum/weather/virgo3c/rain/process_effects() - ..() - for(var/mob/living/L as anything in living_mob_list) - if(L.z in holder.our_planet.expected_z_levels) - var/turf/T = get_turf(L) - if(!T.is_outdoors()) - continue // They're indoors, so no need to rain on them. +/datum/weather/virgo3c/rain/planet_effect(mob/living/L) + if(L.z in holder.our_planet.expected_z_levels) + var/turf/T = get_turf(L) + if(!T.is_outdoors()) + return // They're indoors, so no need to rain on them. - // If they have an open umbrella, it'll guard from rain - var/obj/item/melee/umbrella/U = L.get_active_hand() - if(!istype(U) || !U.open) - U = L.get_inactive_hand() + // If they have an open umbrella, it'll guard from rain + var/obj/item/melee/umbrella/U = L.get_active_hand() + if(!istype(U) || !U.open) + U = L.get_inactive_hand() - if(istype(U) && U.open) - if(show_message) - to_chat(L, span_notice("Rain patters softly onto your umbrella.")) - continue - - L.water_act(1) + if(istype(U) && U.open) if(show_message) - to_chat(L, effect_message) + to_chat(L, span_notice("Rain patters softly onto your umbrella.")) + return + + L.water_act(1) + if(show_message) + to_chat(L, effect_message) /datum/weather/virgo3c/storm name = "storm" @@ -328,30 +327,31 @@ var/datum/planet/virgo3c/planet_virgo3c = null WEATHER_BLIZZARD = 5, WEATHER_HAIL = 5 ) + effect_flags = HAS_PLANET_EFFECT | EFFECT_ONLY_LIVING + +/datum/weather/virgo3c/storm/planet_effect(mob/living/L) + if(L.z in holder.our_planet.expected_z_levels) + var/turf/T = get_turf(L) + if(!T.is_outdoors()) + return // They're indoors, so no need to rain on them. + + // If they have an open umbrella, it'll guard from rain + var/obj/item/melee/umbrella/U = L.get_active_hand() + if(!istype(U) || !U.open) + U = L.get_inactive_hand() + + if(istype(U) && U.open) + if(show_message) + to_chat(L, span_notice("Rain showers loudly onto your umbrella!")) + return + + + L.water_act(2) + if(show_message) + to_chat(L, effect_message) /datum/weather/virgo3c/storm/process_effects() ..() - for(var/mob/living/L as anything in living_mob_list) - if(L.z in holder.our_planet.expected_z_levels) - var/turf/T = get_turf(L) - if(!T.is_outdoors()) - continue // They're indoors, so no need to rain on them. - - // If they have an open umbrella, it'll guard from rain - var/obj/item/melee/umbrella/U = L.get_active_hand() - if(!istype(U) || !U.open) - U = L.get_inactive_hand() - - if(istype(U) && U.open) - if(show_message) - to_chat(L, span_notice("Rain showers loudly onto your umbrella!")) - continue - - - L.water_act(2) - if(show_message) - to_chat(L, effect_message) - handle_lightning() // This gets called to do lightning periodically. @@ -386,41 +386,40 @@ var/datum/planet/virgo3c/planet_virgo3c = null "An intense chill is felt, and chunks of ice start to fall from the sky, towards you." ) imminent_transition_message = "Small bits of ice are falling from the sky, growing larger by the second. Hail is starting, get to cover!" + effect_flags = HAS_PLANET_EFFECT | EFFECT_ONLY_HUMANS -/datum/weather/virgo3c/hail/process_effects() - ..() - for(var/mob/living/carbon/H as anything in human_mob_list) - if(H.z in holder.our_planet.expected_z_levels) - var/turf/T = get_turf(H) - if(!T.is_outdoors()) - continue // They're indoors, so no need to pelt them with ice. +/datum/weather/virgo3c/hail/planet_effect(mob/living/carbon/H) + if(H.z in holder.our_planet.expected_z_levels) + var/turf/T = get_turf(H) + if(!T.is_outdoors()) + return // They're indoors, so no need to pelt them with ice. - // If they have an open umbrella, it'll guard from hail - var/obj/item/melee/umbrella/U = H.get_active_hand() - if(!istype(U) || !U.open) - U = H.get_inactive_hand() + // If they have an open umbrella, it'll guard from hail + var/obj/item/melee/umbrella/U = H.get_active_hand() + if(!istype(U) || !U.open) + U = H.get_inactive_hand() - if(istype(U) && U.open) - if(show_message) - to_chat(H, span_notice("Hail patters onto your umbrella.")) - continue - - var/target_zone = pick(BP_ALL) - var/amount_blocked = H.run_armor_check(target_zone, "melee") - var/amount_soaked = H.get_armor_soak(target_zone, "melee") - - var/damage = rand(1,3) - - if(amount_blocked >= 30) - continue // No need to apply damage. Hardhats are 30. They should probably protect you from hail on your head. - //Voidsuits are likewise 40, and riot, 80. Clothes are all less than 30. - - if(amount_soaked >= damage) - continue // No need to apply damage. - - H.apply_damage(damage, BRUTE, target_zone, amount_blocked, amount_soaked) + if(istype(U) && U.open) if(show_message) - to_chat(H, effect_message) + to_chat(H, span_notice("Hail patters onto your umbrella.")) + return + + var/target_zone = pick(BP_ALL) + var/amount_blocked = H.run_armor_check(target_zone, "melee") + var/amount_soaked = H.get_armor_soak(target_zone, "melee") + + var/damage = rand(1,3) + + if(amount_blocked >= 30) + return // No need to apply damage. Hardhats are 30. They should probably protect you from hail on your head. + //Voidsuits are likewise 40, and riot, 80. Clothes are all less than 30. + + if(amount_soaked >= damage) + return // No need to apply damage. + + H.apply_damage(damage, BRUTE, target_zone, amount_blocked, amount_soaked) + if(show_message) + to_chat(H, effect_message) /datum/weather/virgo3c/fog name = "fog" @@ -515,19 +514,18 @@ var/datum/planet/virgo3c/planet_virgo3c = null // Lets recycle. outdoor_sounds_type = /datum/looping_sound/weather/outside_blizzard indoor_sounds_type = /datum/looping_sound/weather/inside_blizzard + effect_flags = HAS_PLANET_EFFECT | EFFECT_ONLY_LIVING -/datum/weather/virgo3c/ash_storm/process_effects() - ..() - for(var/mob/living/L as anything in living_mob_list) - if(L.z in holder.our_planet.expected_z_levels) - var/turf/T = get_turf(L) - if(!T.is_outdoors()) - continue // They're indoors, so no need to burn them with ash. - else if (isanimal(L)) - continue //Don't murder the wildlife, they live here it's fine +/datum/weather/virgo3c/ash_storm/planet_effect(mob/living/L) + if(L.z in holder.our_planet.expected_z_levels) + var/turf/T = get_turf(L) + if(!T.is_outdoors()) + return // They're indoors, so no need to burn them with ash. + else if (isanimal(L)) + return //Don't murder the wildlife, they live here it's fine - L.inflict_heat_damage(1) - to_chat(L, span_warning("Smoldering ash singes you!")) + L.inflict_heat_damage(1) + to_chat(L, span_warning("Smoldering ash singes you!")) @@ -579,17 +577,16 @@ var/datum/planet/virgo3c/planet_virgo3c = null // How much radiation is bursted onto a random tile near a mob. var/fallout_rad_low = RAD_LEVEL_HIGH var/fallout_rad_high = RAD_LEVEL_VERY_HIGH + effect_flags = HAS_PLANET_EFFECT | EFFECT_ONLY_LIVING -/datum/weather/virgo3c/fallout/process_effects() - ..() - for(var/mob/living/L as anything in living_mob_list) - if(L.z in holder.our_planet.expected_z_levels) - irradiate_nearby_turf(L) - var/turf/T = get_turf(L) - if(!T.is_outdoors()) - continue // They're indoors, so no need to irradiate them with fallout. +/datum/weather/virgo3c/fallout/planet_effect(mob/living/L) + if(L.z in holder.our_planet.expected_z_levels) + irradiate_nearby_turf(L) + var/turf/T = get_turf(L) + if(!T.is_outdoors()) + return // They're indoors, so no need to irradiate them with fallout. - L.rad_act(rand(direct_rad_low, direct_rad_high)) + L.rad_act(rand(direct_rad_low, direct_rad_high)) // This makes random tiles near people radioactive for awhile. // Tiles far away from people are left alone, for performance. diff --git a/code/modules/planet/virgo4_vr.dm b/code/modules/planet/virgo4_vr.dm index 4898480db9..bb249aa61c 100644 --- a/code/modules/planet/virgo4_vr.dm +++ b/code/modules/planet/virgo4_vr.dm @@ -264,28 +264,27 @@ var/datum/planet/virgo4/planet_virgo4 = null imminent_transition_message = "Light drips of water are starting to fall from the sky." outdoor_sounds_type = /datum/looping_sound/weather/rain indoor_sounds_type = /datum/looping_sound/weather/rain/indoors + effect_flags = HAS_PLANET_EFFECT | EFFECT_ONLY_LIVING -/datum/weather/virgo4/rain/process_effects() - ..() - for(var/mob/living/L as anything in living_mob_list) - if(L.z in holder.our_planet.expected_z_levels) - var/turf/T = get_turf(L) - if(!T.is_outdoors()) - continue // They're indoors, so no need to rain on them. +/datum/weather/virgo4/rain/planet_effect(mob/living/L) + if(L.z in holder.our_planet.expected_z_levels) + var/turf/T = get_turf(L) + if(!T.is_outdoors()) + return // They're indoors, so no need to rain on them. - // If they have an open umbrella, it'll guard from rain - var/obj/item/melee/umbrella/U = L.get_active_hand() - if(!istype(U) || !U.open) - U = L.get_inactive_hand() + // If they have an open umbrella, it'll guard from rain + var/obj/item/melee/umbrella/U = L.get_active_hand() + if(!istype(U) || !U.open) + U = L.get_inactive_hand() - if(istype(U) && U.open) - if(show_message) - to_chat(L, span_notice("Rain patters softly onto your umbrella.")) - continue - - L.water_act(1) + if(istype(U) && U.open) if(show_message) - to_chat(L, effect_message) + to_chat(L, span_notice("Rain patters softly onto your umbrella.")) + return + + L.water_act(1) + if(show_message) + to_chat(L, effect_message) /datum/weather/virgo4/storm name = "storm" @@ -314,30 +313,31 @@ var/datum/planet/virgo4/planet_virgo4 = null WEATHER_STORM = 10, WEATHER_RAIN = 80 ) + effect_flags = HAS_PLANET_EFFECT | EFFECT_ONLY_LIVING + +/datum/weather/virgo4/storm/planet_effect(mob/living/L) + if(L.z in holder.our_planet.expected_z_levels) + var/turf/T = get_turf(L) + if(!T.is_outdoors()) + return // They're indoors, so no need to rain on them. + + // If they have an open umbrella, it'll guard from rain + var/obj/item/melee/umbrella/U = L.get_active_hand() + if(!istype(U) || !U.open) + U = L.get_inactive_hand() + + if(istype(U) && U.open) + if(show_message) + to_chat(L, span_notice("Rain showers loudly onto your umbrella!")) + return + + + L.water_act(2) + if(show_message) + to_chat(L, effect_message) /datum/weather/virgo4/storm/process_effects() ..() - for(var/mob/living/L as anything in living_mob_list) - if(L.z in holder.our_planet.expected_z_levels) - var/turf/T = get_turf(L) - if(!T.is_outdoors()) - continue // They're indoors, so no need to rain on them. - - // If they have an open umbrella, it'll guard from rain - var/obj/item/melee/umbrella/U = L.get_active_hand() - if(!istype(U) || !U.open) - U = L.get_inactive_hand() - - if(istype(U) && U.open) - if(show_message) - to_chat(L, span_notice("Rain showers loudly onto your umbrella!")) - continue - - - L.water_act(2) - if(show_message) - to_chat(L, effect_message) - handle_lightning() // This gets called to do lightning periodically. @@ -370,41 +370,40 @@ var/datum/planet/virgo4/planet_virgo4 = null "An intense chill is felt, and chunks of ice start to fall from the sky, towards you." ) imminent_transition_message = "Small bits of ice are falling from the sky, growing larger by the second. Hail is starting, get to cover!" + effect_flags = HAS_PLANET_EFFECT | EFFECT_ONLY_HUMANS -/datum/weather/virgo4/hail/process_effects() - ..() - for(var/mob/living/carbon/H as anything in human_mob_list) - if(H.z in holder.our_planet.expected_z_levels) - var/turf/T = get_turf(H) - if(!T.is_outdoors()) - continue // They're indoors, so no need to pelt them with ice. +/datum/weather/virgo4/hail/planet_effect(mob/living/carbon/H) + if(H.z in holder.our_planet.expected_z_levels) + var/turf/T = get_turf(H) + if(!T.is_outdoors()) + return // They're indoors, so no need to pelt them with ice. - // If they have an open umbrella, it'll guard from hail - var/obj/item/melee/umbrella/U = H.get_active_hand() - if(!istype(U) || !U.open) - U = H.get_inactive_hand() + // If they have an open umbrella, it'll guard from hail + var/obj/item/melee/umbrella/U = H.get_active_hand() + if(!istype(U) || !U.open) + U = H.get_inactive_hand() - if(istype(U) && U.open) - if(show_message) - to_chat(H, span_notice("Hail patters onto your umbrella.")) - continue - - var/target_zone = pick(BP_ALL) - var/amount_blocked = H.run_armor_check(target_zone, "melee") - var/amount_soaked = H.get_armor_soak(target_zone, "melee") - - var/damage = rand(1,3) - - if(amount_blocked >= 30) - continue // No need to apply damage. Hardhats are 30. They should probably protect you from hail on your head. - //Voidsuits are likewise 40, and riot, 80. Clothes are all less than 30. - - if(amount_soaked >= damage) - continue // No need to apply damage. - - H.apply_damage(damage, BRUTE, target_zone, amount_blocked, amount_soaked) + if(istype(U) && U.open) if(show_message) - to_chat(H, effect_message) + to_chat(H, span_notice("Hail patters onto your umbrella.")) + return + + var/target_zone = pick(BP_ALL) + var/amount_blocked = H.run_armor_check(target_zone, "melee") + var/amount_soaked = H.get_armor_soak(target_zone, "melee") + + var/damage = rand(1,3) + + if(amount_blocked >= 30) + return // No need to apply damage. Hardhats are 30. They should probably protect you from hail on your head. + //Voidsuits are likewise 40, and riot, 80. Clothes are all less than 30. + + if(amount_soaked >= damage) + return // No need to apply damage. + + H.apply_damage(damage, BRUTE, target_zone, amount_blocked, amount_soaked) + if(show_message) + to_chat(H, effect_message) /datum/weather/virgo4/fog name = "fog" @@ -490,16 +489,15 @@ var/datum/planet/virgo4/planet_virgo4 = null // Lets recycle. outdoor_sounds_type = /datum/looping_sound/weather/outside_blizzard indoor_sounds_type = /datum/looping_sound/weather/inside_blizzard + effect_flags = HAS_PLANET_EFFECT | EFFECT_ONLY_LIVING -/datum/weather/virgo4/ash_storm/process_effects() - ..() - for(var/mob/living/L as anything in living_mob_list) - if(L.z in holder.our_planet.expected_z_levels) - var/turf/T = get_turf(L) - if(!T.is_outdoors()) - continue // They're indoors, so no need to burn them with ash. +/datum/weather/virgo4/ash_storm/planet_effect(mob/living/L) + if(L.z in holder.our_planet.expected_z_levels) + var/turf/T = get_turf(L) + if(!T.is_outdoors()) + return // They're indoors, so no need to burn them with ash. - L.inflict_heat_damage(rand(1, 3)) + L.inflict_heat_damage(rand(1, 3)) //A non-lethal variant of the ash_storm. Stays on indefinitely. /datum/weather/virgo4/ash_storm_safe @@ -550,17 +548,16 @@ var/datum/planet/virgo4/planet_virgo4 = null // How much radiation is bursted onto a random tile near a mob. var/fallout_rad_low = RAD_LEVEL_HIGH var/fallout_rad_high = RAD_LEVEL_VERY_HIGH + effect_flags = HAS_PLANET_EFFECT | EFFECT_ONLY_LIVING -/datum/weather/virgo4/fallout/process_effects() - ..() - for(var/mob/living/L as anything in living_mob_list) - if(L.z in holder.our_planet.expected_z_levels) - irradiate_nearby_turf(L) - var/turf/T = get_turf(L) - if(!T.is_outdoors()) - continue // They're indoors, so no need to irradiate them with fallout. +/datum/weather/virgo4/fallout/planet_effect(mob/living/L) + if(L.z in holder.our_planet.expected_z_levels) + irradiate_nearby_turf(L) + var/turf/T = get_turf(L) + if(!T.is_outdoors()) + return // They're indoors, so no need to irradiate them with fallout. - L.rad_act(rand(direct_rad_low, direct_rad_high)) + L.rad_act(rand(direct_rad_low, direct_rad_high)) // This makes random tiles near people radioactive for awhile. // Tiles far away from people are left alone, for performance. diff --git a/code/modules/planet/weather.dm b/code/modules/planet/weather.dm index 45dd62b12e..275ca72eaa 100644 --- a/code/modules/planet/weather.dm +++ b/code/modules/planet/weather.dm @@ -202,6 +202,7 @@ var/datum/looping_sound/indoor_sounds = null var/outdoor_sounds_type = null var/indoor_sounds_type = null + var/effect_flags = NONE /datum/weather/New() if(outdoor_sounds_type) @@ -215,6 +216,29 @@ if(world.time >= last_message + message_delay) last_message = world.time // Reset the timer show_message = TRUE // Tell the rest of the process that we need to make a message + if(effect_flags & HAS_PLANET_EFFECT) + if(effect_flags & EFFECT_ALL_MOBS) + for(var/mob/M as anything in mob_list) + if(M.is_incorporeal() && !(effect_flags & EFFECT_ALWAYS_HITS)) + continue + planet_effect(M) + if(effect_flags & EFFECT_ONLY_LIVING) + for(var/mob/living/L as anything in living_mob_list) + if(L.is_incorporeal() && !(effect_flags & EFFECT_ALWAYS_HITS)) + continue + planet_effect(L) + if(effect_flags & EFFECT_ONLY_HUMANS) + for(var/mob/living/carbon/H as anything in human_mob_list) + if(H.is_incorporeal() && !(effect_flags & EFFECT_ALWAYS_HITS)) + continue + planet_effect(H) + if(effect_flags & EFFECT_ONLY_ROBOTS) + for(var/mob/living/silicon/R as anything in silicon_mob_list) + if(R.is_incorporeal() && !(effect_flags & EFFECT_ALWAYS_HITS)) + continue + planet_effect(R) + +/datum/weather/proc/planet_effect(mob/living/L) return /datum/weather/proc/process_sounds() diff --git a/code/modules/xenoarcheaology/anomaly_container.dm b/code/modules/xenoarcheaology/anomaly_container.dm index 68a85661dd..cb75abafde 100644 --- a/code/modules/xenoarcheaology/anomaly_container.dm +++ b/code/modules/xenoarcheaology/anomaly_container.dm @@ -50,6 +50,6 @@ . = ..() if(istype(over_object)) - if(!QDELETED(src) && istype(loc, /turf) && is_anomalous() && Adjacent(over_object) && CanMouseDrop(over_object, usr)) + if(!QDELETED(src) && isturf(loc) && is_anomalous() && Adjacent(over_object) && CanMouseDrop(over_object, usr)) Bumped(usr) over_object.contain(src) diff --git a/prof.dll b/prof.dll index 4721a5c187..f32fe6607c 100644 Binary files a/prof.dll and b/prof.dll differ diff --git a/vorestation.dme b/vorestation.dme index 4ad3e5a162..ae67017d20 100644 --- a/vorestation.dme +++ b/vorestation.dme @@ -170,6 +170,7 @@ #include "code\__defines\vore_prefs.dm" #include "code\__defines\vote.dm" #include "code\__defines\vv.dm" +#include "code\__defines\weather.dm" #include "code\__defines\webhooks.dm" #include "code\__defines\wiki.dm" #include "code\__defines\wires.dm"