cotton stack pull

This commit is contained in:
Hatterhat
2021-01-17 01:42:32 -06:00
parent 1df2257e61
commit cb1ef2d8ba
+9 -11
View File
@@ -32,18 +32,16 @@
var/cotton_type = /obj/item/stack/sheet/cotton
var/cotton_name = "raw cotton"
/obj/item/grown/cotton/attack_self(mob/user)
/obj/item/grown/cotton/attack_self(mob/user, recursive)
user.show_message("<span class='notice'>You pull some [cotton_name] out of the [name]!</span>", MSG_VISUAL)
var/seed_modifier = 0
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/ST in user.loc)
if(ST != cotton && istype(ST, cotton_type) && ST.amount < ST.max_amount)
ST.attackby(cotton, user)
if(cotton.amount > old_cotton_amount)
to_chat(user, "<span class='notice'>You add the newly-formed [cotton_name] to the stack. It now contains [cotton.amount] [cotton_name].</span>")
var/cottonAmt = 1 + round(seed.potency / 25) // cotton inhand we're holding
for(var/obj/item/grown/cotton/ctn in user.loc) // cotton on the floor
if(ctn.type != type)
continue
cottonAmt += 1 + round(ctn.seed.potency / 25)
qdel(ctn)
new cotton_type(user.drop_location(), cottonAmt)
// above code stolen from grass
qdel(src)
//reinforced mutated variant