/
githubmirror
/
vgstation13
Обзор
Документация
Войти
/
githubmirror
/
vgstation13
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
Bleeding-Edge
code/modules/paperwork/paper_pack.dm
97 строк
3 KB
west3436
Fire Rework (#35988)
14 май 2024, 15:43
Не верифицирован
14 май 2024, 15:43
434ac40
Код
Авторство
О чём код?
//like a stack, but for paper, and less useful except for my code - Comic //functions pretty much the same as a regular stack, but it can't be added to (to avoid having to store paper details) //mainly used for the blueprinter, but planning to nanopaper and paper bin functionality //TODO - Sprite this and add to paper bins /obj/item/weapon/paper_pack name = "paper pack" desc = "A pack of papers, secured by some red ribbon." icon = 'icons/obj/paper.dmi' icon_state = "pp_large" gender = NEUTER throwforce = 2 w_class = W_CLASS_MEDIUM w_type = RECYK_WOOD throw_range = 5 throw_speed = 1 layer = ABOVE_DOOR_LAYER pressure_resistance = 1 attack_verb = list("slaps", "baps", "whaps") flammable = TRUE var/amount = 0 var/maxamount = 20 var/papertype = /obj/item/weapon/paper var/pptype = "" /obj/item/weapon/paper_pack/New() ..() amount = 20 pixel_x = rand(-5, 3) * PIXEL_MULTIPLIER pixel_y = rand(-3, 5) * PIXEL_MULTIPLIER update_icon() /obj/item/weapon/paper_pack/attack_self() if(usr.loc) new papertype(usr.loc) usepaper(1) /obj/item/weapon/paper_pack/proc/usepaper(var/sheetcount = 0) var/usedpaper = 0 //tracks the actual paper removed if(sheetcount && sheetcount <= amount) usedpaper = sheetcount amount -= sheetcount if(sheetcount && sheetcount > amount) usedpaper = sheetcount - amount amount = 0 update_icon() return usedpaper /obj/item/weapon/paper_pack/update_icon() if(amount) if(amount>14) icon_state = "[pptype]pp_large" else if(amount>8) icon_state = "[pptype]pp_medium" else if(amount>0) icon_state = "[pptype]pp_small" name = "[pptype]paper pack" desc = "A pack of [pptype]papers, secured by some red ribbon." else new/obj/item/weapon/ribbon(get_turf(src)) qdel(src) /obj/item/weapon/paper_pack/examine(mob/user) ..() if(amount) to_chat(user, "<span class='info'>There are [amount] sheets in the pack.</span>") /obj/item/weapon/paper_pack/verb/ribbontie() set name = "Untie Paper Pack" set category = "Object" set src in usr if(amount <= 5) //lag protection and general nonsense avoidance. Could be reduced, but for now just lets you empty it (why you would do this, I don't know) for(var/i = 1; i <= amount; i++) new papertype(usr.loc) usepaper(amount) to_chat(usr, "<span class='notice'>You pick the ribbon knot and drop all the papers.</span>") else to_chat(usr, "<span class='warning'>You don't think it would be wise to drop this much paper.</span>") /obj/item/weapon/paper_pack/nano //now in flavours! papertype = /obj/item/weapon/paper/nano pptype = "nano" icon_state = "nanopp_large" /obj/item/weapon/ribbon //yay, pointless things name = "red ribbon" desc = "A red ribbon, normally used to tie things up." icon = 'icons/obj/paper.dmi' icon_state = "ribbon" gender = NEUTER slot_flags = SLOT_HEAD throwforce = 0 w_class = W_CLASS_TINY throw_range = 4 throw_speed = 1