|
17 | 17 | var/mask_type = /obj/item/clothing/mask/breath/emergency |
18 | 18 | var/icon_state_open = "emerg_open" |
19 | 19 | var/icon_state_closed = "emerg" |
20 | | - var/icon_state_active // TODO implement |
| 20 | + var/icon_state_active |
21 | 21 |
|
22 | 22 | power_channel = ENVIRON |
23 | 23 | idle_power_usage = 10 |
|
136 | 136 | return |
137 | 137 | return 1 |
138 | 138 |
|
| 139 | +/obj/machinery/oxygen_pump/on_update_icon() |
| 140 | + if(stat & MAINT) |
| 141 | + icon_state = icon_state_open |
| 142 | + else if(icon_state_active && use_power == POWER_USE_ACTIVE) // the base type doesn't have an active state |
| 143 | + icon_state = icon_state_active |
| 144 | + else |
| 145 | + icon_state = icon_state_closed |
| 146 | + |
139 | 147 | /obj/machinery/oxygen_pump/attackby(obj/item/used_item, mob/user) |
140 | 148 | if(IS_SCREWDRIVER(used_item)) |
141 | 149 | stat ^= MAINT |
142 | 150 | user.visible_message(SPAN_NOTICE("\The [user] [stat & MAINT ? "opens" : "closes"] \the [src]."), SPAN_NOTICE("You [stat & MAINT ? "open" : "close"] \the [src].")) |
143 | | - if(stat & MAINT) |
144 | | - icon_state = icon_state_open |
145 | | - if(!stat) |
146 | | - icon_state = icon_state_closed |
| 151 | + queue_icon_update() |
147 | 152 | return TRUE |
148 | | - if(istype(used_item, /obj/item/tank) && (stat & MAINT)) |
| 153 | + if(istype(used_item, /obj/item/tank)) |
| 154 | + if(!(stat & MAINT)) |
| 155 | + to_chat(user, SPAN_WARNING("Please open the maintenance hatch first.")) |
| 156 | + return TRUE |
149 | 157 | if(tank) |
150 | 158 | to_chat(user, SPAN_WARNING("\The [src] already has a tank installed!")) |
151 | 159 | return TRUE |
|
155 | 163 | user.visible_message(SPAN_NOTICE("\The [user] installs \the [tank] into \the [src]."), SPAN_NOTICE("You install \the [tank] into \the [src].")) |
156 | 164 | src.add_fingerprint(user) |
157 | 165 | return TRUE |
158 | | - if(istype(used_item, /obj/item/tank) && !stat) |
159 | | - to_chat(user, SPAN_WARNING("Please open the maintenance hatch first.")) |
160 | | - return TRUE |
161 | 166 | return FALSE // TODO: should this be a parent call? do we want this to be (de)constructable? |
162 | 167 |
|
163 | 168 | /obj/machinery/oxygen_pump/get_examine_strings(mob/user, distance, infix, suffix) |
|
0 commit comments