Merge pull request #14076 from Hatterhat/cotton-stack-pull
pulling cotton (or durathread) while standing on a pile of cotton (or durathread) picks all of them
This commit is contained in:
@@ -34,16 +34,14 @@
|
||||
|
||||
/obj/item/grown/cotton/attack_self(mob/user)
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user