diff --git a/code/__HELPERS/_lists.dm b/code/__HELPERS/_lists.dm index d7bf37b8e200..8c9e3a10430d 100644 --- a/code/__HELPERS/_lists.dm +++ b/code/__HELPERS/_lists.dm @@ -392,7 +392,7 @@ **/ /proc/list_clear_nulls(list/list_to_clear) return (list_to_clear.RemoveAll(null) > 0) - + /* * Returns list containing all the entries from first list that are not present in second. @@ -435,22 +435,19 @@ * B would have a 30% chance of being picked, * C would have a 10% chance of being picked, * and D would have a 0% chance of being picked. - * You should only pass integers in. */ -/proc/pick_weight(list/list_to_pick) +/proc/pick_weight(list/list_to_pick) // monkestation edit: port superior pick_weight impl var/total = 0 var/item for(item in list_to_pick) - if(!list_to_pick[item]) - list_to_pick[item] = 0 + if(isnull(list_to_pick[item])) + stack_trace("weighted_pick given null weight: [json_encode(list_to_pick)]") total += list_to_pick[item] - - total = rand(1, total) + total = rand() * total for(item in list_to_pick) total -= list_to_pick[item] - if(total <= 0 && list_to_pick[item]) + if(total <= 0) return item - return null #endif diff --git a/code/modules/antagonists/brother/brother.dm b/code/modules/antagonists/brother/brother.dm index 7054a1cc6887..ba43f49f272a 100644 --- a/code/modules/antagonists/brother/brother.dm +++ b/code/modules/antagonists/brother/brother.dm @@ -49,11 +49,12 @@ return ..() /datum/antagonist/brother/proc/on_mob_successful_flashed_carbon(mob/living/source, mob/living/carbon/flashed, obj/item/assembly/flash/flash) - SIGNAL_HANDLER + /* SIGNAL_HANDLER */ // monkestation edit: allow used of is_banned_from if (flashed.stat == DEAD) return + if (flashed.stat != CONSCIOUS) flashed.balloon_alert(source, "unconscious!") return @@ -62,6 +63,12 @@ flashed.balloon_alert(source, "[flashed.p_their()] mind is vacant!") return + // monkestation edit: allow people to opt-out of BB + if(!(ROLE_BROTHER in flashed.client?.prefs?.be_special) || is_banned_from(flashed.ckey, list(ROLE_BROTHER, ROLE_SYNDICATE))) + flashed.balloon_alert(source, "unwilling to play role!") + return + // monkestation end + for(var/datum/objective/brother_objective as anything in source.mind.get_all_objectives()) // If the objective has a target, are we flashing them? if(flashed == brother_objective.target?.current) diff --git a/html/changelogs/AutoChangeLog-pr-2134.yml b/html/changelogs/AutoChangeLog-pr-2134.yml new file mode 100644 index 000000000000..ba83d406a996 --- /dev/null +++ b/html/changelogs/AutoChangeLog-pr-2134.yml @@ -0,0 +1,4 @@ +author: "Absolucy" +delete-after: True +changes: + - qol: "Blood Brothers can now only convert people who have BB enabled in their prefs. Failing to convert will give an appropriate feedback message (and the failed convert won't notice anything other than a normal flashing)." \ No newline at end of file diff --git a/monkestation/code/modules/clothing/shoes/clown.dm b/monkestation/code/modules/clothing/shoes/clown.dm index fc78311da038..2e7aa2f28a27 100644 --- a/monkestation/code/modules/clothing/shoes/clown.dm +++ b/monkestation/code/modules/clothing/shoes/clown.dm @@ -20,7 +20,7 @@ desc = "A court jester's shoes, updated with modern squeaking technology." icon_state = "jester_shoes" icon = 'icons/obj/clothing/shoes.dmi' - squeak_sound = list('monkestation/sound/effects/clown_jingle1.ogg'=1, 'monkestation/sound/effects/clown_jingle2.ogg') //jingHONK jinglHONK jHONKgle jiHONKgle + squeak_sound = list('monkestation/sound/effects/clown_jingle1.ogg'=1, 'monkestation/sound/effects/clown_jingle2.ogg'=1) //jingHONK jinglHONK jHONKgle jiHONKgle /obj/item/clothing/shoes/clown_shoes/harlequin_boots name = "harlequin boots" @@ -29,4 +29,4 @@ icon_state = "harlequin_boots" worn_icon = 'monkestation/icons/mob/clothing/feet.dmi' worn_icon_state = "harlequin_boots" - squeak_sound = list('monkestation/sound/effects/clown_jingle1.ogg'=1, 'monkestation/sound/effects/clown_jingle2.ogg') \ No newline at end of file + squeak_sound = list('monkestation/sound/effects/clown_jingle1.ogg'=1, 'monkestation/sound/effects/clown_jingle2.ogg'=1) diff --git a/monkestation/code/modules/smithing/oozelings/body/organs.dm b/monkestation/code/modules/smithing/oozelings/body/organs.dm index be2c7bd315cb..655253a0ae00 100644 --- a/monkestation/code/modules/smithing/oozelings/body/organs.dm +++ b/monkestation/code/modules/smithing/oozelings/body/organs.dm @@ -106,7 +106,7 @@ RegisterSignal(organ_owner, COMSIG_MOB_STATCHANGE, PROC_REF(on_stat_change)) /obj/item/organ/internal/brain/slime/proc/colorize() - if(owner && isoozeling(owner)) + if(isoozeling(owner)) core_color = owner.dna.features["mcolor"] add_atom_colour(core_color, FIXED_COLOUR_PRIORITY) @@ -120,9 +120,7 @@ /obj/item/organ/internal/brain/slime/proc/enable_coredeath() coredeath = TRUE - if(owner) - if(owner.stat != DEAD) - return + if(owner?.stat == DEAD) addtimer(CALLBACK(src, PROC_REF(core_ejection), owner), 0) /////// @@ -132,7 +130,7 @@ /obj/item/organ/internal/brain/slime/proc/core_ejection(mob/living/carbon/human/victim, new_stat, turf/loc_override) if(core_ejected || !coredeath) return - if(!stored_dna) + if(QDELETED(stored_dna)) stored_dna = new victim.dna.copy_dna(stored_dna) @@ -140,12 +138,10 @@ victim.visible_message(span_warning("[victim]'s body completely dissolves, collapsing outwards!"), span_notice("Your body completely dissolves, collapsing outwards!"), span_notice("You hear liquid splattering.")) var/turf/death_turf = get_turf(victim) - var/list/items = list() - items |= victim.get_equipped_items(TRUE) - for(var/atom/movable/I as anything in items) - victim.dropItemToGround(I) - stored_items |= I - I.forceMove(src) + for(var/atom/movable/item as anything in victim.get_equipped_items(include_pockets = TRUE)) + victim.dropItemToGround(item) + stored_items |= item + item.forceMove(src) if(victim.get_organ_slot(ORGAN_SLOT_BRAIN) == src) Remove(victim) @@ -175,6 +171,7 @@ target_bloodsucker.bloodsucker_blood_volume -= target_bloodsucker.max_blood_volume * 0.15 rebuilt = FALSE + victim.transfer_observers_to(src) Remove(victim) qdel(victim) @@ -221,7 +218,7 @@ /obj/item/organ/internal/brain/slime/proc/drop_items_to_ground(turf/turf) for(var/atom/movable/item as anything in stored_items) item.forceMove(turf) - stored_items -= item + stored_items.Cut() /obj/item/organ/internal/brain/slime/proc/rebuild_body(mob/user) if(rebuilt) @@ -234,7 +231,7 @@ qdel(GetComponent(/datum/component/gps)) //we have the plasma. we can rebuild them. - brainmob.mind.grab_ghost() + brainmob?.mind?.grab_ghost() if(isnull(brainmob)) user?.balloon_alert(user, "This brain is not a viable candidate for repair!") return TRUE @@ -267,13 +264,14 @@ forceMove(new_body) Insert(new_body) for(var/obj/item/bodypart as anything in new_body.bodyparts) - if(!istype(bodypart, /obj/item/bodypart/chest)) - qdel(bodypart) + if(istype(bodypart, /obj/item/bodypart/chest)) continue + qdel(bodypart) new_body.visible_message(span_warning("[new_body]'s torso \"forms\" from [new_body.p_their()] core, yet to form the rest.")) to_chat(owner, span_purple("Your torso fully forms out of your core, yet to form the rest.")) brainmob?.mind?.transfer_to(new_body) new_body.grab_ghost() + transfer_observers_to(new_body) drop_items_to_ground(new_body.drop_location())