Files
VOREStation/code/game/objects/items/weapons/ecigs.dm
T
Cameron Lennox d5849910e5 Begin clickcode attack_self fix (#18797)
* Begin clickcode attack_self fix

Begins the work to make everything call back to parent for attack_self so that signals are sacred.

* Makes MORE things call the attack_self() parent

Yes, I could make special_handling a var on obj/item HOWEVER i want it to be specific so it can be tracked down later and ONLY the objects that use it can be refactored instead of sitting there literally forever and it just becoming 'a thing'.

* Finishes making the rest of attack_self call parent.

As mentioned, things such as 'specialty_goggles' 'special_handling' and the such are only there to help with attack_self until the attack_self is recoded for those items.

* begone foul demon

* some more cleanup

* These

* GOD this was annoying

* yeh

* Fix this

* fLARES

* Thesee too

* toys!

* Even more!

* More fixes

* Even more

* rest of em

* these too

* Update syndie.dm

* hardref clear

* Update code/game/gamemodes/nuclear/pinpointer.dm

* Update code/game/objects/effects/mines.dm

* Update code/game/objects/items/blueprints_vr.dm

* Update code/game/objects/items/blueprints_vr.dm

* Update code/game/objects/items/contraband_vr.dm

* Update code/game/objects/items/crayons.dm

* Update code/game/objects/items/crayons.dm

* Update code/game/objects/items/gunbox.dm

* Update code/game/objects/items/gunbox.dm

* Update code/game/objects/items/gunbox_vr.dm

* Update code/game/objects/items/gunbox_vr.dm

* Update code/game/objects/items/weapons/gift_wrappaper.dm

* Update code/game/objects/items/crayons.dm

* Update code/game/objects/items/crayons.dm

* Update code/game/objects/items/gunbox.dm

* these too

* Update maintpanel_stack.dm

* angry warning

* Fixes packaged snacks.

Fixes improper var default.

* Special handling for these

* proper poly types

* Fixes magclaws

Makes the 'features' it had just part  of base magboots that can be adjusted via varswap.

* Fixes jackets

Fixes https://github.com/VOREStation/VOREStation/issues/18941

* Small bugfix

Makes p_Theyre properly capitialize
Makes examine show proper wording

* Update gift_wrappaper.dm
2025-12-29 13:21:10 -05:00

266 lines
11 KiB
Plaintext

/obj/item/clothing/mask/smokable/ecig
name = DEVELOPER_WARNING_NAME // "electronic cigarette"
desc = "For the modern approach to smoking."
icon = 'icons/obj/ecig.dmi'
var/active = 0
//var/obj/item/cell/ec_cell = /obj/item/cell/device
var/cartridge_type = /obj/item/reagent_containers/ecig_cartridge/med_nicotine
var/obj/item/reagent_containers/ecig_cartridge/ec_cartridge
w_class = ITEMSIZE_TINY
slot_flags = SLOT_EARS | SLOT_MASK
attack_verb = list("attacked", "poked", "battered")
body_parts_covered = 0
var/brightness_on = 1
chem_volume = 0 //ecig has no storage on its own but has reagent container created by parent obj
item_state = "ecigoff"
is_pipe = TRUE //to avoid a runtime in examine()
var/icon_off
var/icon_empty
var/ecig_colors = list(null, COLOR_DARK_GRAY, COLOR_RED_GRAY, COLOR_BLUE_GRAY, COLOR_GREEN_GRAY, COLOR_PURPLE_GRAY)
/obj/item/clothing/mask/smokable/ecig/Initialize(mapload)
. = ..()
ec_cartridge = new cartridge_type(src)
/obj/item/clothing/mask/smokable/ecig/examine(mob/user)
. = ..()
if(active)
. += span_notice("It is turned on.")
else
. += span_notice("It is turned off.")
if(Adjacent(user))
if(ec_cartridge)
if(!ec_cartridge.reagents?.total_volume)
. += span_notice("Its cartridge is empty!")
else if (ec_cartridge.reagents.total_volume <= ec_cartridge.volume * 0.25)
. += span_notice("Its cartridge is almost empty!")
else if (ec_cartridge.reagents.total_volume <= ec_cartridge.volume * 0.66)
. += span_notice("Its cartridge is half full!")
else if (ec_cartridge.reagents.total_volume <= ec_cartridge.volume * 0.90)
. += span_notice("Its cartridge is almost full!")
else
. += span_notice("Its cartridge is full!")
else
. += span_notice("It has no cartridge.")
/obj/item/clothing/mask/smokable/ecig/simple
name = "simple electronic cigarette"
desc = "A cheap Lucky 1337 electronic cigarette, styled like a traditional cigarette."
description_fluff = "Produced by the Ward-Takahashi Corporation on behalf of the Lucky Stars cigarette brand, the 1337 is the e-cig of choice for teenage wastrels across the core worlds. Due to a total lack of safety features, this model is banned on most interstellar flights."
icon_state = "ccigoff"
icon_off = "ccigoff"
icon_empty = "ccigoff"
icon_on = "ccigon"
/obj/item/clothing/mask/smokable/ecig/util
name = "electronic cigarette"
desc = "A popular utilitarian model electronic cigarette, the ONI-55. Comes in a variety of colors."
description_fluff = "Ward-Takahashi's flagship brand of e-cig is a popular fashion accessory in certain circles where open flames are prohibited. Custom casings are sold for almost as much as the device itself, and are practically impossible to DIY."
icon_state = "ecigoff1"
icon_off = "ecigoff1"
icon_empty = "ecigoff1"
icon_on = "ecigon"
/obj/item/clothing/mask/smokable/ecig/util/Initialize(mapload)
. = ..()
color = pick(ecig_colors)
/obj/item/clothing/mask/smokable/ecig/deluxe
name = "deluxe electronic cigarette"
desc = "A premium model eGavana MK3 electronic cigarette, shaped like a cigar."
description_fluff = "The eGavana is a product of Morpheus Cyberkinetics, and comes standard with additional jacks that allow cyborgs and positronics to experience a simulation of soothing artificial oil residues entering their lungs. It's a pretty good cig for meatbags, too."
icon_state = "pcigoff1"
icon_off = "pcigoff1"
icon_empty = "pcigoff2"
icon_on = "pcigon"
/obj/item/clothing/mask/smokable/ecig/process()
if(ishuman(loc))
var/mob/living/carbon/human/C = loc
if (src == C.wear_mask && C.check_has_mouth()) // if it's in the human/monkey mouth, transfer reagents to the mob
if (!active || !ec_cartridge || !ec_cartridge.reagents.total_volume)//no cartridge
to_chat(C, span_notice("[src] turns off."))
active=0//autodisable the cigarette
STOP_PROCESSING(SSobj, src)
update_icon()
return
ec_cartridge.reagents.trans_to_mob(C, REM, CHEM_INGEST, 0.4) // Most of it is not inhaled... balance reasons.
/obj/item/clothing/mask/smokable/ecig/update_icon()
if (active)
item_state = icon_on
icon_state = icon_on
set_light(brightness_on)
else if (ec_cartridge)
set_light(0)
item_state = icon_off
icon_state = icon_off
else
icon_state = icon_empty
item_state = icon_empty
set_light(0)
if(ismob(loc))
var/mob/living/M = loc
M.update_inv_wear_mask(0)
M.update_inv_l_hand(0)
M.update_inv_r_hand(1)
/obj/item/clothing/mask/smokable/ecig/attackby(var/obj/item/I, var/mob/user as mob)
if(istype(I, /obj/item/reagent_containers/ecig_cartridge))
if (ec_cartridge)//can't add second one
to_chat(user, span_notice("A cartridge has already been installed."))
else//fits in new one
user.remove_from_mob(I)
I.forceMove(src)//I.loc=src
ec_cartridge = I
update_icon()
to_chat(user, span_notice("You insert [I] into [src]."))
/obj/item/clothing/mask/smokable/ecig/attack_self(mob/user)
. = ..(user)
if(.)
return TRUE
if(active)
active = FALSE
STOP_PROCESSING(SSobj, src)
to_chat(user, span_notice("You turn off \the [src]. "))
update_icon()
else
if(!ec_cartridge)
to_chat(user, span_notice("You can't use it with no cartridge installed!."))
return
active = TRUE
START_PROCESSING(SSobj, src)
to_chat(user, span_notice("You turn on \the [src]. "))
update_icon()
/obj/item/clothing/mask/smokable/ecig/attack_hand(mob/user as mob)//eject cartridge
if(user.get_inactive_hand() == src)//if being hold
if (ec_cartridge)
active=0
user.put_in_hands(ec_cartridge)
to_chat(user, span_notice("You eject [ec_cartridge] from \the [src]."))
ec_cartridge = null
update_icon()
else
..()
/obj/item/reagent_containers/ecig_cartridge
name = "tobacco flavour cartridge"
desc = "A small metal cartridge, used with electronic cigarettes, which contains an atomizing coil and a solution to be atomized."
w_class = ITEMSIZE_TINY
icon = 'icons/obj/ecig.dmi'
icon_state = "ecartridge"
matter = list(MAT_STEEL = 50, MAT_GLASS = 10)
volume = 20
flags = OPENCONTAINER
max_transfer_amount = null
/obj/item/reagent_containers/ecig_cartridge/examine(mob/user as mob)//to see how much left
. = ..()
. += "The cartridge has [reagents.total_volume] units of liquid remaining."
//flavours
/obj/item/reagent_containers/ecig_cartridge/blank
name = "ecigarette cartridge"
desc = "A small metal cartridge which contains an atomizing coil."
/obj/item/reagent_containers/ecig_cartridge/blanknico
name = "flavorless nicotine cartridge"
desc = "A small metal cartridge which contains an atomizing coil and a solution to be atomized. The label says you can add whatever flavoring agents you want."
/obj/item/reagent_containers/ecig_cartridge/blanknico/Initialize(mapload)
. = ..()
reagents.add_reagent(REAGENT_ID_NICOTINE, 5)
reagents.add_reagent(REAGENT_ID_WATER, 10)
/obj/item/reagent_containers/ecig_cartridge/med_nicotine
name = "tobacco flavour cartridge"
desc = "A small metal cartridge which contains an atomizing coil and a solution to be atomized. The label says its tobacco flavored."
/obj/item/reagent_containers/ecig_cartridge/med_nicotine/Initialize(mapload)
. = ..()
reagents.add_reagent(REAGENT_ID_NICOTINE, 5)
reagents.add_reagent(REAGENT_ID_WATER, 15)
/obj/item/reagent_containers/ecig_cartridge/high_nicotine
name = "high nicotine tobacco flavour cartridge"
desc = "A small metal cartridge which contains an atomizing coil and a solution to be atomized. The label says its tobacco flavored, with extra nicotine."
/obj/item/reagent_containers/ecig_cartridge/high_nicotine/Initialize(mapload)
. = ..()
reagents.add_reagent(REAGENT_ID_NICOTINE, 10)
reagents.add_reagent(REAGENT_ID_WATER, 10)
/obj/item/reagent_containers/ecig_cartridge/orange
name = "orange flavour cartridge"
desc = "A small metal cartridge which contains an atomizing coil and a solution to be atomized. The label says its orange flavored."
/obj/item/reagent_containers/ecig_cartridge/orange/Initialize(mapload)
. = ..()
reagents.add_reagent(REAGENT_ID_NICOTINE, 5)
reagents.add_reagent(REAGENT_ID_WATER, 10)
reagents.add_reagent(REAGENT_ID_ORANGEJUICE, 5)
/obj/item/reagent_containers/ecig_cartridge/mint
name = "mint flavour cartridge"
desc = "A small metal cartridge which contains an atomizing coil and a solution to be atomized. The label says its mint flavored."
/obj/item/reagent_containers/ecig_cartridge/mint/Initialize(mapload)
. = ..()
reagents.add_reagent(REAGENT_ID_NICOTINE, 5)
reagents.add_reagent(REAGENT_ID_WATER, 10)
reagents.add_reagent(REAGENT_ID_MENTHOL, 5)
/obj/item/reagent_containers/ecig_cartridge/watermelon
name = "watermelon flavour cartridge"
desc = "A small metal cartridge which contains an atomizing coil and a solution to be atomized. The label says its watermelon flavored."
/obj/item/reagent_containers/ecig_cartridge/watermelon/Initialize(mapload)
. = ..()
reagents.add_reagent(REAGENT_ID_NICOTINE, 5)
reagents.add_reagent(REAGENT_ID_WATER, 10)
reagents.add_reagent(REAGENT_ID_WATERMELONJUICE, 5)
/obj/item/reagent_containers/ecig_cartridge/grape
name = "grape flavour cartridge"
desc = "A small metal cartridge which contains an atomizing coil and a solution to be atomized. The label says its grape flavored."
/obj/item/reagent_containers/ecig_cartridge/grape/Initialize(mapload)
. = ..()
reagents.add_reagent(REAGENT_ID_NICOTINE, 5)
reagents.add_reagent(REAGENT_ID_WATER, 10)
reagents.add_reagent(REAGENT_ID_GRAPEJUICE, 5)
/obj/item/reagent_containers/ecig_cartridge/lemonlime
name = "lemon-lime flavour cartridge"
desc = "A small metal cartridge which contains an atomizing coil and a solution to be atomized. The label says its lemon-lime flavored."
/obj/item/reagent_containers/ecig_cartridge/lemonlime/Initialize(mapload)
. = ..()
reagents.add_reagent(REAGENT_ID_NICOTINE, 5)
reagents.add_reagent(REAGENT_ID_WATER, 10)
reagents.add_reagent(REAGENT_ID_LEMONLIME, 5)
/obj/item/reagent_containers/ecig_cartridge/coffee
name = "coffee flavour cartridge"
desc = "A small metal cartridge which contains an atomizing coil and a solution to be atomized. The label says its coffee flavored."
/obj/item/reagent_containers/ecig_cartridge/coffee/Initialize(mapload)
. = ..()
reagents.add_reagent(REAGENT_ID_NICOTINE, 5)
reagents.add_reagent(REAGENT_ID_WATER, 10)
reagents.add_reagent(REAGENT_ID_COFFEE, 5)
/*
/obj/item/reagent_containers/ecig_cartridge/cannabis
name = "herb flavour cartridge"
desc = "A small metal cartridge which contains an atomizing coil and a solution to be atomized. The label seems to be suspiciously scuffed off..."
/obj/item/reagent_containers/ecig_cartridge/cannabis/Initialize(mapload)
. = ..()
reagents.add_reagent(REAGENT_ID_NICOTINE, 5)
reagents.add_reagent(REAGENT_ID_WATER, 10)
reagents.add_reagent("cannabis", 5)
*/