diff --git a/code/modules/events/spacevine.dm b/code/modules/events/spacevine.dm index 10c9092230..c94c1773e2 100644 --- a/code/modules/events/spacevine.dm +++ b/code/modules/events/spacevine.dm @@ -22,9 +22,7 @@ if(turfs.len) //Pick a turf to spawn at if we can var/turf/T = pick(turfs) - new /datum/spacevine_controller(T, pick(subtypesof(/datum/spacevine_mutation)), rand(30,100), rand(5,10), src) //spawn a controller at turf with randomized stats and a single random mutation - - + new /datum/spacevine_controller(T, pick(subtypesof(/datum/spacevine_mutation)), rand(10,100), rand(5,10), src) //spawn a controller at turf with randomized stats and a single random mutation /datum/spacevine_mutation @@ -174,8 +172,8 @@ var/datum/gas_mixture/GM = T.air if(!GM.gases[/datum/gas/oxygen]) return - GM.gases[/datum/gas/oxygen] = max(GM.gases[/datum/gas/oxygen] - severity * holder.energy, 0) - GAS_GARBAGE_COLLECT(GM.gases) + GM.gases[/datum/gas/oxygen][MOLES] = max(GM.gases[/datum/gas/oxygen][MOLES] - severity * holder.energy, 0) + GM.garbage_collect() /datum/spacevine_mutation/nitro_eater name = "nitrogen consuming" @@ -189,8 +187,8 @@ var/datum/gas_mixture/GM = T.air if(!GM.gases[/datum/gas/nitrogen]) return - GM.gases[/datum/gas/nitrogen] = max(GM.gases[/datum/gas/nitrogen] - severity * holder.energy, 0) - GAS_GARBAGE_COLLECT(GM.gases) + GM.gases[/datum/gas/nitrogen][MOLES] = max(GM.gases[/datum/gas/nitrogen][MOLES] - severity * holder.energy, 0) + GM.garbage_collect() /datum/spacevine_mutation/carbondioxide_eater name = "CO2 consuming" @@ -204,8 +202,8 @@ var/datum/gas_mixture/GM = T.air if(!GM.gases[/datum/gas/carbon_dioxide]) return - GM.gases[/datum/gas/carbon_dioxide] = max(GM.gases[/datum/gas/carbon_dioxide] - severity * holder.energy, 0) - GAS_GARBAGE_COLLECT(GM.gases) + GM.gases[/datum/gas/carbon_dioxide][MOLES] = max(GM.gases[/datum/gas/carbon_dioxide][MOLES] - severity * holder.energy, 0) + GM.garbage_collect() /datum/spacevine_mutation/plasma_eater name = "toxins consuming" @@ -219,8 +217,8 @@ var/datum/gas_mixture/GM = T.air if(!GM.gases[/datum/gas/plasma]) return - GM.gases[/datum/gas/plasma] = max(GM.gases[/datum/gas/plasma] - severity * holder.energy, 0) - GAS_GARBAGE_COLLECT(GM.gases) + GM.gases[/datum/gas/plasma][MOLES] = max(GM.gases[/datum/gas/plasma][MOLES] - severity * holder.energy, 0) + GM.garbage_collect() /datum/spacevine_mutation/thorns name = "thorny" @@ -229,13 +227,13 @@ quality = NEGATIVE /datum/spacevine_mutation/thorns/on_cross(obj/structure/spacevine/holder, mob/living/crosser) - if(prob(severity) && istype(crosser) && !isvineimmune(holder)) + if(prob(severity) && istype(crosser) && !isvineimmune(crosser)) var/mob/living/M = crosser M.adjustBruteLoss(5) to_chat(M, "You cut yourself on the thorny vines.") /datum/spacevine_mutation/thorns/on_hit(obj/structure/spacevine/holder, mob/living/hitter, obj/item/I, expected_damage) - if(prob(severity) && istype(hitter) && !isvineimmune(holder)) + if(prob(severity) && istype(hitter) && !isvineimmune(hitter)) var/mob/living/M = hitter M.adjustBruteLoss(5) to_chat(M, "You cut yourself on the thorny vines.") @@ -253,7 +251,7 @@ holder.obj_integrity = holder.max_integrity /datum/spacevine_mutation/woodening/on_hit(obj/structure/spacevine/holder, mob/living/hitter, obj/item/I, expected_damage) - if(I.get_sharpness()) + if(I?.get_sharpness()) . = expected_damage * 0.5 else . = expected_damage @@ -346,16 +344,17 @@ switch(damage_type) if(BRUTE) if(damage_amount) - playsound(src, 'sound/weapons/slash.ogg', 50, 1) + playsound(src, 'sound/weapons/slash.ogg', 50, TRUE) else - playsound(src, 'sound/weapons/tap.ogg', 50, 1) + playsound(src, 'sound/weapons/tap.ogg', 50, TRUE) if(BURN) - playsound(src.loc, 'sound/items/welder.ogg', 100, 1) + playsound(src.loc, 'sound/items/welder.ogg', 100, TRUE) -/obj/structure/spacevine/Crossed(mob/crosser) - if(isliving(crosser)) - for(var/datum/spacevine_mutation/SM in mutations) - SM.on_cross(src, crosser) +/obj/structure/spacevine/Crossed(atom/movable/AM) + if(!isliving(AM)) + return + for(var/datum/spacevine_mutation/SM in mutations) + SM.on_cross(src, AM) //ATTACK HAND IGNORING PARENT RETURN VALUE /obj/structure/spacevine/attack_hand(mob/user) @@ -380,10 +379,12 @@ var/list/vine_mutations_list var/mutativeness = 1 -/datum/spacevine_controller/New(turf/location, list/muts, potency, production) +/datum/spacevine_controller/New(turf/location, list/muts, potency, production, datum/round_event/event = null) vines = list() growth_queue = list() - spawn_spacevine_piece(location, null, muts) + var/obj/structure/spacevine/SV = spawn_spacevine_piece(location, null, muts) + if (event) + event.announce_to_ghosts(SV) START_PROCESSING(SSobj, src) vine_mutations_list = list() init_subtypes(/datum/spacevine_mutation/, vine_mutations_list) @@ -430,6 +431,7 @@ for(var/datum/spacevine_mutation/SM in SV.mutations) SM.on_birth(SV) location.Entered(SV) + return SV /datum/spacevine_controller/proc/VineDestroyed(obj/structure/spacevine/S) S.master = null @@ -532,15 +534,14 @@ if(!override) qdel(src) -/obj/structure/spacevine/CanPass(atom/movable/mover, turf/target) +/obj/structure/spacevine/CanAllowThrough(atom/movable/mover, turf/target) + . = ..() if(isvineimmune(mover)) - . = TRUE - else - . = ..() + return TRUE /proc/isvineimmune(atom/A) - . = FALSE if(isliving(A)) var/mob/living/M = A if(("vines" in M.faction) || ("plants" in M.faction)) - . = TRUE + return TRUE + return FALSE