Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix cigarettes and tendrils #1490

Merged
merged 2 commits into from
Mar 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 18 additions & 22 deletions code/game/objects/items/cigs_lighters.dm
Original file line number Diff line number Diff line change
Expand Up @@ -219,22 +219,27 @@ CIGARETTE PACKETS ARE IN FANCY.DM
if(!lighting_text)
return ..()

var/mob/living/carbon/carbuser = user

if(!istype(carbuser))
carbuser = null

if(!reagents.has_reagent(/datum/reagent/oxygen)) //cigarettes need oxygen
var/datum/gas_mixture/air = return_air()
if(!air || !air.has_gas(/datum/gas/oxygen, 1) || !carbuser?.can_breathe_helmet()) //or oxygen on a tile to burn
to_chat(user, span_notice("Your [name] needs a source of oxygen to burn."))
return ..()
if(!check_oxygen(user)) //cigarettes need oxygen
balloon_alert(user, "no air!")
return ..()

if(smoketime > 0)
light(lighting_text)
else
to_chat(user, span_warning("There is nothing to smoke!"))

/// Checks that we have enough air to smoke
/obj/item/clothing/mask/cigarette/proc/check_oxygen(mob/user)
if (reagents.has_reagent(/datum/reagent/oxygen))
return TRUE
var/datum/gas_mixture/air = return_air()
if (!isnull(air) && air.has_gas(/datum/gas/oxygen, 1))
return TRUE
if (!iscarbon(user))
return FALSE
var/mob/living/carbon/the_smoker = user
return the_smoker.can_breathe_helmet()

/obj/item/clothing/mask/cigarette/afterattack(obj/item/reagent_containers/cup/glass, mob/user, proximity)
. = ..()
if(!proximity || lit) //can't dip if cigarette is lit (it will heat the reagents in the glass instead)
Expand Down Expand Up @@ -370,18 +375,9 @@ CIGARETTE PACKETS ARE IN FANCY.DM
var/turf/location = get_turf(src)
user?.ignite_mob()

var/mob/living/carbon/carbuser
if(user)
carbuser = user

if(carbuser && !istype(carbuser))
carbuser = null

if(!reagents.has_reagent(/datum/reagent/oxygen)) //cigarettes need oxygen
var/datum/gas_mixture/air = return_air()
if(!air || !air.has_gas(/datum/gas/oxygen, 1) || !carbuser?.can_breathe_helmet()) //or oxygen on a tile to burn
extinguish()
return
if(!check_oxygen(user))
extinguish()
return

location.pollute_turf(pollution_type, 5, POLLUTION_PASSIVE_EMITTER_CAP)

Expand Down
4 changes: 4 additions & 0 deletions code/game/objects/structures/spawner.dm
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,12 @@
. += span_notice("It looks like you could probably scan and tag it with a <b>[scanner_descriptor]</b>.")

/obj/structure/spawner/attackby(obj/item/item, mob/user, params)
. = ..()
if(.)
return TRUE
if(scanner_taggable && is_type_in_list(item, scanner_types))
gps_tag(user)
return TRUE

/// Tag the spawner, prefixing its GPS entry with an identifier - or giving it one, if nonexistent.
/obj/structure/spawner/proc/gps_tag(mob/user)
Expand Down
Loading