mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-27 23:27:34 +01:00
[MIRROR] fix filtering clown/mime plasmaman air (#7303)
* fix filtering clown/mime plasmaman air (#60388) * fix filtering clown/mime plasmaman air * rclickj * better way * starting_filter_type * fixes and changes * fix filtering clown/mime plasmaman air Co-authored-by: Ghilker <42839747+Ghilker@users.noreply.github.com>
This commit is contained in:
@@ -14,14 +14,17 @@
|
||||
var/max_filters = 1
|
||||
///List to keep track of each filter
|
||||
var/list/gas_filters
|
||||
///Type of filter that spawns on roundstart
|
||||
var/starting_filter_type = /obj/item/gas_filter
|
||||
|
||||
/obj/item/clothing/mask/gas/Initialize()
|
||||
. = ..()
|
||||
if(!max_filters)
|
||||
if(!max_filters || !starting_filter_type)
|
||||
return
|
||||
|
||||
for(var/i in 1 to max_filters)
|
||||
var/obj/item/gas_filter/filter = new(src)
|
||||
LAZYADD(gas_filters, filter)
|
||||
var/obj/item/gas_filter/inserted_filter = new starting_filter_type(src)
|
||||
LAZYADD(gas_filters, inserted_filter)
|
||||
has_filter = TRUE
|
||||
|
||||
/obj/item/clothing/mask/gas/Destroy()
|
||||
@@ -35,17 +38,29 @@
|
||||
if(LAZYLEN(gas_filters) > 0)
|
||||
. += "<span class='notice'>Currently there [LAZYLEN(gas_filters) == 1 ? "is" : "are"] [LAZYLEN(gas_filters)] filter\s with [get_filter_durability()]% durability.</span>"
|
||||
|
||||
/obj/item/clothing/mask/gas/attackby(obj/item/filter, mob/user)
|
||||
if(!istype(filter, /obj/item/gas_filter))
|
||||
/obj/item/clothing/mask/gas/attackby(obj/item/tool, mob/user)
|
||||
if(!istype(tool, /obj/item/gas_filter))
|
||||
return ..()
|
||||
if(LAZYLEN(gas_filters) >= max_filters)
|
||||
return ..()
|
||||
if(!user.transferItemToLoc(filter, src))
|
||||
if(!user.transferItemToLoc(tool, src))
|
||||
return ..()
|
||||
LAZYADD(gas_filters, filter)
|
||||
LAZYADD(gas_filters, tool)
|
||||
has_filter = TRUE
|
||||
return TRUE
|
||||
|
||||
/obj/item/clothing/mask/gas/attackby_secondary(obj/item/weapon, mob/user, params)
|
||||
if(!has_filter || !max_filters)
|
||||
return ..()
|
||||
for(var/i in 1 to max_filters)
|
||||
var/obj/item/gas_filter/filter = locate() in src
|
||||
if(!filter)
|
||||
continue
|
||||
user.transferItemToLoc(filter, user.loc)
|
||||
LAZYREMOVE(gas_filters, filter)
|
||||
if(LAZYLEN(gas_filters) <= 0)
|
||||
has_filter = FALSE
|
||||
|
||||
///Check _masks.dm for this one
|
||||
/obj/item/clothing/mask/gas/consume_filter(datum/gas_mixture/breath)
|
||||
if(LAZYLEN(gas_filters) <= 0 || max_filters == 0)
|
||||
@@ -147,6 +162,9 @@
|
||||
species_exception = list(/datum/species/golem/bananium)
|
||||
var/list/clownmask_designs = list()
|
||||
|
||||
/obj/item/clothing/mask/gas/clown_hat/plasmaman
|
||||
starting_filter_type = /obj/item/gas_filter/plasmaman
|
||||
|
||||
/obj/item/clothing/mask/gas/clown_hat/Initialize(mapload)
|
||||
.=..()
|
||||
clownmask_designs = list(
|
||||
@@ -203,6 +221,9 @@
|
||||
species_exception = list(/datum/species/golem)
|
||||
var/list/mimemask_designs = list()
|
||||
|
||||
/obj/item/clothing/mask/gas/mime/plasmaman
|
||||
starting_filter_type = /obj/item/gas_filter/plasmaman
|
||||
|
||||
/obj/item/clothing/mask/gas/mime/Initialize(mapload)
|
||||
.=..()
|
||||
mimemask_designs = list(
|
||||
|
||||
@@ -167,7 +167,7 @@
|
||||
uniform = /obj/item/clothing/under/plasmaman/mime
|
||||
gloves = /obj/item/clothing/gloves/color/plasmaman/white
|
||||
head = /obj/item/clothing/head/helmet/space/plasmaman/mime
|
||||
mask = /obj/item/clothing/mask/gas/mime
|
||||
mask = /obj/item/clothing/mask/gas/mime/plasmaman
|
||||
|
||||
/datum/outfit/plasmaman/clown
|
||||
name = "Clown Plasmaman"
|
||||
@@ -175,7 +175,7 @@
|
||||
uniform = /obj/item/clothing/under/plasmaman/clown
|
||||
gloves = /obj/item/clothing/gloves/color/plasmaman/clown
|
||||
head = /obj/item/clothing/head/helmet/space/plasmaman/clown
|
||||
mask = /obj/item/clothing/mask/gas/clown_hat
|
||||
mask = /obj/item/clothing/mask/gas/clown_hat/plasmaman
|
||||
|
||||
/datum/outfit/plasmaman/captain
|
||||
name = "Captain Plasmaman"
|
||||
@@ -269,4 +269,4 @@
|
||||
uniform = /obj/item/clothing/under/plasmaman/clown
|
||||
gloves = /obj/item/clothing/gloves/color/plasmaman/clown
|
||||
head = /obj/item/clothing/head/helmet/space/plasmaman/clown
|
||||
mask = /obj/item/clothing/mask/gas/clown_hat
|
||||
mask = /obj/item/clothing/mask/gas/clown_hat/plasmaman
|
||||
|
||||
Reference in New Issue
Block a user