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

Ports vape [w/ fixes] #90

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
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
1 change: 1 addition & 0 deletions code/game/machinery/vending.dm
Original file line number Diff line number Diff line change
Expand Up @@ -783,6 +783,7 @@ IF YOU MODIFY THE PRODUCTS LIST OF A MACHINE, MAKE SURE TO UPDATE ITS RESUPPLY C
/obj/item/weapon/storage/fancy/cigarettes/cigpack_midori = 3,
/obj/item/weapon/storage/box/matches = 10,
/obj/item/weapon/lighter/greyscale = 4,
/obj/item/clothing/mask/vape = 3,
/obj/item/weapon/storage/fancy/rollingpapers = 5)
contraband = list(/obj/item/weapon/lighter = 3)
premium = list(/obj/item/weapon/storage/fancy/cigarettes/cigpack_robustgold = 3, \
Expand Down
184 changes: 184 additions & 0 deletions code/game/objects/items/weapons/cigs_lighters.dm
Original file line number Diff line number Diff line change
Expand Up @@ -574,3 +574,187 @@ CIGARETTE PACKETS ARE IN FANCY.DM
user << "<span class='warning'>You need to dry this first!</span>"
else
..()

///////////////
//VAPE NATION//
///////////////
/obj/item/clothing/mask/vape
name = "e-cigarette"
desc = "A classy and highly sophisticated electronic cigarette, for classy and dignified gentlemen. A warning label reads \"Warning: do not fill with flamable materials!\""//<<< i'd vape to that.
icon = 'icons/obj/clothing/masks.dmi'
icon_state = null
item_state = null
var/chem_volume = 100
var/vapetime = 0 //this so it won't puff out clouds every tick
var/screw = FALSE //Vape is opened by screwdriver
var/super = FALSE //Power has been increased with a multitool
var/emagged = FALSE

/obj/item/clothing/mask/vape/suicide_act(mob/user)
user.visible_message("<span class='suicide'>Oh no, [user] is trying to eat the [name]! You can't do that!</span>")
playsound(user.loc,'sound/items/eatfood.ogg', 50, 1)
return (TOXLOSS|OXYLOSS)

/obj/item/clothing/mask/vape/New(loc, var/param_color = null)
..()
create_reagents(chem_volume)
reagents.set_reacting(FALSE) // so it doesn't react until you light it
reagents.add_reagent("nicotine", 50)
if(!icon_state)
if(!param_color)
param_color = pick("red","blue","black","white","green","purple","yellow","orange")
icon_state = "[param_color]_vape"
item_state = "[param_color]_vape"

//The reagent thing was here
/obj/item/clothing/mask/vape/attackby(obj/item/O, mob/user, params)
if(istype(O, /obj/item/weapon/screwdriver))
if(!screw)
screw = TRUE
flags |= OPENCONTAINER
user << "<span class='notice'>You open the cap on the [name].</span>"
if(emagged)
var/image/I = (image(icon, "vapeopen_high"))
overlays += I
else if(super)
var/image/I = (image(icon, "vapeopen_med"))
overlays += I
else
var/image/I = (image(icon, "vapeopen_low"))
overlays += I
else
screw = FALSE
flags &= ~OPENCONTAINER
user << "<span class='notice'>You close the cap on the [name].</span>"
cut_overlays()

if(istype(O, /obj/item/device/multitool))
if(screw && !emagged)//also kinky
if(!super)
cut_overlays()
super = TRUE
user << "<span class='notice'>You increase the voltage in the [name].</span>"
var/image/I = (image(icon, "vapeopen_med"))
overlays += I
else
cut_overlays()
super = FALSE
user << "<span class='notice'>You decrease the voltage in the [name].</span>"
var/image/I = (image(icon, "vapeopen_low"))
overlays += I

if(screw && emagged)
user << "<span class='notice'>The [name] can't be modified!</span>"


/obj/item/clothing/mask/vape/emag_act(mob/user)
if(screw)
if(!emagged)
cut_overlays()
emagged = TRUE
super = FALSE
user << "<span class='warning'>You maximize the voltage in the [name]!</span>"
var/image/I = (image(icon, "vapeopen_high"))
overlays += I
var/datum/effect_system/spark_spread/sp = new /datum/effect_system/spark_spread //for effect
sp.set_up(5, 1, src)
sp.start()
else
user << "<span class='warning'>The [name] is already emagged!</span>"
else
user << "<span class='notice'>You need to open the cap to do that!</span>"

/obj/item/clothing/mask/vape/attack_self(mob/user)
if(reagents.total_volume > 0)
user << "<span class='notice'>You empty [src] of all reagents.</span>"
reagents.clear_reagents()
return

/obj/item/clothing/mask/vape/equipped(mob/user, slot)
if(slot == slot_wear_mask)
if(!screw)
user << "<span class='notice'>You start ripping fat vapes with [src].</span>"
reagents.set_reacting(TRUE) // allowing reagents to react after being lit
START_PROCESSING(SSobj, src)
else //it will not start if the vape is opened.
user << "<span class='warning'>You need to close the cap first!</span>"

/obj/item/clothing/mask/vape/dropped(mob/user)
var/mob/living/carbon/C = user
if(C.get_item_by_slot(slot_wear_mask) == src)
reagents.set_reacting(FALSE)
STOP_PROCESSING(SSobj, src)

/obj/item/clothing/mask/vape/proc/hand_reagents()//had to rename to avoid duplicate error
if(reagents && reagents.total_volume)
if(iscarbon(loc))
var/mob/living/carbon/C = loc
if (src == C.wear_mask)
if(prob(35))
reagents.reaction(C, INGEST, 0.2)
reagents.trans_to(C, REAGENTS_METABOLISM)
if(reagents.get_reagent_amount("welding_fuel"))
//HOT STUFF
C.fire_stacks = 2
C.IgniteMob()
if(reagents.get_reagent_amount("plasma")) // the plasma explodes when exposed to fire
var/datum/effect_system/reagents_explosion/e = new()
e.set_up(round(reagents.get_reagent_amount("plasma") / 2.5, 1), get_turf(src), 0, 0)
e.start()
if(ismob(loc))
var/mob/M = loc
M.unEquip(src, 1)
qdel(src)
return


/obj/item/clothing/mask/vape/process()
var/mob/living/M = loc

if(isliving(loc))
M.IgniteMob()

vapetime++

if(!reagents.total_volume)
if(ismob(loc))
M << "<span class='notice'>The [name] is empty!</span>"
STOP_PROCESSING(SSobj, src)
//it's reusable so it won't unequip when empty
return
//open flame removed because vapes are a closed system, they wont light anything on fire

if(super && vapetime > 3)//Time to start puffing those fat vapes, yo.
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isn't 3 a bit too low?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's about 8 seconds.

var/datum/effect_system/smoke_spread/chem/s = new
s.set_up(reagents, 0, loc, silent=TRUE)
s.start()
vapetime = 0
if(prob(0.5))//Chance added to super vape pens too
playsound(get_turf(src), 'sound/effects/pop_expl.ogg', 50, 0)
M.apply_damage(15, BURN, "head") //Less damage
M.unEquip(src, 1)
M.Weaken(15, 1, 0)
var/datum/effect_system/spark_spread/sp = new /datum/effect_system/spark_spread
sp.set_up(5, 1, src)
sp.start()
M << "<span class='userdanger'>The [name] suddenly explodes in your mouth!</span>"
qdel(src)

if(emagged && vapetime > 3)
var/datum/effect_system/smoke_spread/chem/s = new
s.set_up(reagents, 3, loc, silent=TRUE)
s.start()
vapetime = 0
if(prob(2))//small chance for the vape to break and deal damage if it's emagged
playsound(get_turf(src), 'sound/effects/pop_expl.ogg', 50, 0)
M.apply_damage(20, BURN, "head")
M.unEquip(src, 1)
M.Weaken(15, 1, 0)
var/datum/effect_system/spark_spread/sp = new /datum/effect_system/spark_spread
sp.set_up(5, 1, src)
sp.start()
M << "<span class='userdanger'>The [name] suddenly explodes in your mouth!</span>"
qdel(src)

if(reagents && reagents.total_volume)
hand_reagents()
Binary file modified icons/mob/mask.dmi
Binary file not shown.
Binary file modified icons/obj/clothing/masks.dmi
Binary file not shown.
Binary file added sound/effects/pop_expl.ogg
Binary file not shown.