diff --git a/code/modules/hydroponics/grown/cotton.dm b/code/modules/hydroponics/grown/cotton.dm index 89a3431af243..c3b4732592e4 100644 --- a/code/modules/hydroponics/grown/cotton.dm +++ b/code/modules/hydroponics/grown/cotton.dm @@ -34,27 +34,15 @@ var/cotton_name = "raw cotton" /obj/item/grown/cotton/attack_self(mob/user) - user.show_message(span_notice("You pull some [cotton_name] out of the [name]!"), MSG_VISUAL) - var/seed_modifier = 0 + var/cotton_count = 1 if(seed) - seed_modifier = round(seed.potency / 25) - var/obj/item/stack/cotton = new cotton_type(user.loc, 1 + seed_modifier) - var/old_cotton_amount = cotton.amount - for(var/obj/item/stack/potential_stack in user.loc) - if(QDELETED(potential_stack)) - continue - if(potential_stack == cotton) - continue - if(!istype(potential_stack, cotton_type)) - continue - if(potential_stack.amount >= potential_stack.max_amount) - continue - potential_stack.attackby(cotton, user) + cotton_count += round(seed.potency / 25) - if(cotton.amount > old_cotton_amount) - to_chat(user, span_notice("You add the newly-formed [cotton_name] to the stack. It now contains [cotton.amount] [cotton_name].")) + user.balloon_alert(user, "pulled [cotton_count] piece\s") + new cotton_type(user.drop_location(), cotton_count) qdel(src) + //reinforced mutated variant /obj/item/seeds/cotton/durathread name = "pack of durathread seeds" diff --git a/code/modules/hydroponics/grown/towercap.dm b/code/modules/hydroponics/grown/towercap.dm index bc46dd77e557..37585395603c 100644 --- a/code/modules/hydroponics/grown/towercap.dm +++ b/code/modules/hydroponics/grown/towercap.dm @@ -78,33 +78,29 @@ return NONE -/obj/item/grown/log/attackby(obj/item/W, mob/user, params) - if(W.get_sharpness()) - user.show_message(span_notice("You make [plank_name] out of \the [src]!"), MSG_VISUAL) - var/seed_modifier = 0 +/obj/item/grown/log/attackby(obj/item/attacking_item, mob/user, params) + if(attacking_item.get_sharpness()) + var/plank_count = 1 if(seed) - seed_modifier = round(seed.potency / 25) - var/obj/item/stack/plank = new plank_type(user.loc, 1 + seed_modifier, FALSE) - var/old_plank_amount = plank.amount - for (var/obj/item/stack/ST in user.loc) - if (ST != plank && istype(ST, plank_type) && ST.amount < ST.max_amount) - ST.attackby(plank, user) //we try to transfer all old unfinished stacks to the new stack we created. - if (plank.amount > old_plank_amount) - to_chat(user, span_notice("You add the newly-formed [plank_name] to the stack. It now contains [plank.amount] [plank_name].")) + plank_count += round(seed.potency / 25) + + user.balloon_alert(user, "made [plank_count] [plank_name]") + new plank_type(user.drop_location(), plank_count) qdel(src) + return - if(CheckAccepted(W)) - var/obj/item/food/grown/leaf = W + if(CheckAccepted(attacking_item)) + var/obj/item/food/grown/leaf = attacking_item if(HAS_TRAIT(leaf, TRAIT_DRIED)) - user.show_message(span_notice("You wrap \the [W] around the log, turning it into a torch!")) - var/obj/item/flashlight/flare/torch/T = new /obj/item/flashlight/flare/torch(user.loc) - usr.dropItemToGround(W) - usr.put_in_active_hand(T) + user.balloon_alert(user, "torch crafted") + var/obj/item/flashlight/flare/torch/new_torch = new /obj/item/flashlight/flare/torch(user.drop_location()) + user.dropItemToGround(attacking_item) + user.put_in_active_hand(new_torch) qdel(leaf) qdel(src) return else - to_chat(usr, span_warning("You must dry this first!")) + balloon_alert(user, "dry it first!") else return ..()