From 9e080d555f1710773b2d4cb4bb9c60831534659e Mon Sep 17 00:00:00 2001 From: Miauw Date: Sat, 24 May 2014 17:45:36 +0200 Subject: [PATCH 1/3] Fixed #3077. Singularity now sucks small items instead of large ones. --- code/modules/power/singularity/singularity.dm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/modules/power/singularity/singularity.dm b/code/modules/power/singularity/singularity.dm index a0725f79ee5..ba71e63268b 100644 --- a/code/modules/power/singularity/singularity.dm +++ b/code/modules/power/singularity/singularity.dm @@ -231,9 +231,9 @@ var/global/list/uneatable = list( step_towards(H,src) if(current_size >= 5) - var/list/handlist = list(H.l_hand, H.r_hand) + var/list/handlist = get_both_hands() for(var/obj/item/hand in handlist) - if(prob(current_size * 5) && hand.w_class <= 2 && H.unEquip(hand)) + if(prob(current_size * 5) && hand.w_class >= 5 - round((current_size / 3)) && H.unEquip(hand)) step_towards(hand, src) H << "\The [src] pulls \the [hand] from your grip!" From 9ed94fcb78e582cd708ce5b5c4e471b90470194c Mon Sep 17 00:00:00 2001 From: Miauw Date: Sat, 24 May 2014 19:18:17 +0200 Subject: [PATCH 2/3] Makes this actually work properly. It's always harder than it looks. --- code/modules/power/singularity/singularity.dm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/code/modules/power/singularity/singularity.dm b/code/modules/power/singularity/singularity.dm index ba71e63268b..8ceae066f17 100644 --- a/code/modules/power/singularity/singularity.dm +++ b/code/modules/power/singularity/singularity.dm @@ -31,6 +31,7 @@ var/global/list/uneatable = list( var/target = null //its target. moves towards the target if it has one var/last_failed_movement = 0//Will not move in the same dir if it couldnt before, will help with the getting stuck on fields thing var/teleport_del = 0 + var/sizes_to_number = list("1" = 0, "3" = 1, "5" = 2, "7" = 3, "9" = 4) //so i dont have to mess around with weirdass formulas to get this done. var/last_warning /obj/machinery/singularity/New(loc, var/starting_energy = 50, var/temp = 0) @@ -231,9 +232,10 @@ var/global/list/uneatable = list( step_towards(H,src) if(current_size >= 5) - var/list/handlist = get_both_hands() + var/list/handlist = list(H.l_hand, H.r_hand) for(var/obj/item/hand in handlist) - if(prob(current_size * 5) && hand.w_class >= 5 - round((current_size / 3)) && H.unEquip(hand)) + if(prob(current_size * 5) && hand.w_class >= 5 - sizes_to_number["[current_size]"] && H.unEquip(hand)) + H.unEquip(hand) step_towards(hand, src) H << "\The [src] pulls \the [hand] from your grip!" From 75a0eadb375332d1aec268e25382984f4f93b3c6 Mon Sep 17 00:00:00 2001 From: Miauw Date: Thu, 19 Jun 2014 19:00:10 +0200 Subject: [PATCH 3/3] Removes an unneeded unEquip(). --- code/modules/power/singularity/singularity.dm | 1 - 1 file changed, 1 deletion(-) diff --git a/code/modules/power/singularity/singularity.dm b/code/modules/power/singularity/singularity.dm index 8ceae066f17..180053b72f2 100644 --- a/code/modules/power/singularity/singularity.dm +++ b/code/modules/power/singularity/singularity.dm @@ -235,7 +235,6 @@ var/global/list/uneatable = list( var/list/handlist = list(H.l_hand, H.r_hand) for(var/obj/item/hand in handlist) if(prob(current_size * 5) && hand.w_class >= 5 - sizes_to_number["[current_size]"] && H.unEquip(hand)) - H.unEquip(hand) step_towards(hand, src) H << "\The [src] pulls \the [hand] from your grip!"