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

Weed update #5924

Closed
Closed
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
31 changes: 31 additions & 0 deletions code/game/objects/effects/effect_system/smoke.dm
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,33 @@
human_creature.temporary_slowdown = max(human_creature.temporary_slowdown, 4) //One tick every two second
human_creature.recalculate_move_delay = TRUE
return TRUE
//////////////////////////////////////
// WEED SMOKE
////////////////////////////////////

/obj/effect/particle_effect/smoke/weed
name = "Marijuana smoke"
smokeranking = SMOKE_RANK_HIGH
color = "#95d1ac"
opacity = FALSE
alpha = 75
var/xeno_affecting = TRUE

/obj/effect/particle_effect/smoke/weed/affect(mob/living/carbon/affected)
..()
if(ishuman(affected))
if (affected.internal && affected.wear_mask && (affected.wear_mask.flags_inventory & ALLOWINTERNALS))
return
else
affected.updatehealth()
if(prob(15) && (affected.coughedtime < world.time))
affected.coughedtime = 1
Copy link
Contributor

Choose a reason for hiding this comment

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

world.time will always be < 1
also use a COOLDOWN_ macro

affected.emote("cough")

affected.last_damage_data = cause_data

affected.druggy += 5


//////////////////////////////////////
// FLASHBANG SMOKE
Expand Down Expand Up @@ -633,6 +660,10 @@
/datum/effect_system/smoke_spread/cn20/xeno
smoke_type = /obj/effect/particle_effect/smoke/cn20/xeno

/datum/effect_system/smoke_spread/weed
smoke_type = /obj/effect/particle_effect/smoke/weed


// XENO SMOKES

/datum/effect_system/smoke_spread/xeno_acid
Expand Down
76 changes: 75 additions & 1 deletion code/game/objects/items/tools/flame_tools.dm
Original file line number Diff line number Diff line change
Expand Up @@ -432,17 +432,91 @@ CIGARETTE PACKETS ARE IN FANCY.DM
// WEED //
////////////
/obj/item/clothing/mask/cigarette/weed
name = "weed joint"
name = "\the weed joint"
icon_state = "blunt_off"
icon_on = "blunt_on"
icon_off = "blunt_off"
item_state = "blunt_on"
desc = "A rolled-up package of ambrosia vulgaris, aka space weed, in some smooth paper; you sure this is legal dude?"
chem_volume = 39
smoketime = 20 MINUTES
actions_types = list(/datum/action/item_action/hotbox)
var/puff_cooldown = 10 SECONDS
var/can_puff = TRUE
var/datum/effect_system/smoke_spread/smoke
Comment on lines +444 to +446
Copy link
Contributor

Choose a reason for hiding this comment

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

code doc

Copy link
Contributor

Choose a reason for hiding this comment

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

qdel_null on destroy


/obj/item/clothing/mask/cigarette/weed/Initialize()
. = ..()
reagents.add_reagent("space_drugs",15)
reagents.add_reagent("bicaridine", 8)
reagents.add_reagent("kelotane", 1)

/obj/item/clothing/mask/cigarette/weed/verb/puff()
set name = "Hotbox"
set desc = "Puff a fat cloud."
set category = "Smoke"
set src in usr
var/mob/living/carbon/human/smoker = usr
var/datum/effect_system/smoke_spread/smoke = new /datum/effect_system/smoke_spread/weed
Copy link
Contributor

Choose a reason for hiding this comment

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

why create a new var when smoke is already on the object?

if(!smoker || smoker.is_mob_incapacitated(TRUE))
return

if(smoker.wear_mask != src)
return

if(!can_puff)
to_chat(smoker,SPAN_NOTICE("Your lungs lack fresh air, chill man."))
Copy link
Contributor

Choose a reason for hiding this comment

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

add spacing between a comma and the next entry

return

if(icon_on == "blunt_off")
Copy link
Contributor

Choose a reason for hiding this comment

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

this is gross and you shouldn't be checking icon states to see if something is true/false

to_chat(smoker,SPAN_NOTICE("You need to light it up first."))
return

smoker.visible_message(SPAN_NOTICE("[src] takes a massive breath!"),\
Copy link
Contributor

Choose a reason for hiding this comment

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

src is a cigarette

SPAN_WARNING("You prepare for a massive cloud!"))

if(!do_after(smoker, 4 SECONDS, INTERRUPT_ALL, BUSY_ICON_FRIENDLY))
to_chat(smoker,SPAN_NOTICE("You fumble the puff!"))
smoker.emote("cough")
smoker.emote("gasp")
smoker.apply_damage(rand(5,10),OXYLOSS)
can_puff = FALSE
addtimer(VARSET_CALLBACK(src, can_puff, TRUE), puff_cooldown + 5 SECONDS)
return

smoker.visible_message(SPAN_BOLDNOTICE("[smoker] puffs a massive cloud from their [src]"))
smoke.set_up(rand(1,3), 0, get_turf(smoker),smoker.dir,5)
smoketime -= 4 MINUTES // Burns it a lot faster when
can_puff = FALSE
addtimer(VARSET_CALLBACK(src, can_puff, TRUE), puff_cooldown) // Need to take a breather before puffing
smoker.apply_damage(rand(1,10),OXYLOSS)
smoker.druggy += 50 // Awww yeah
smoker.make_jittery(40)

if(prob(10))
smoker.emote("cough")
smoke.start()

/datum/action/item_action/hotbox/New(mob/living/user, obj/item/holder)
..()
name = "Puff"
Copy link
Contributor

Choose a reason for hiding this comment

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

why are you setting this in New() instead of on the action?

button.name = name
button.overlays.Cut()
var/image/IMG = image('icons/mob/hud/actions_xeno.dmi', button, "shift_spit_acid_glob")
button.overlays += IMG
Comment on lines +505 to +506
Copy link
Contributor

Choose a reason for hiding this comment

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

can you not set this on the action itself?


/datum/action/item_action/hotbox/can_use_action()
var/mob/living/carbon/human/H = owner
PhantomEpicness marked this conversation as resolved.
Show resolved Hide resolved
if(istype(H) && !H.is_mob_incapacitated() && H.body_position == STANDING_UP && holder_item == H.wear_mask)
return TRUE

/datum/action/item_action/hotbox/action_activate()
var/obj/item/clothing/mask/cigarette/weed/weed = holder_item
if(!istype(weed))
return
weed.puff()


////////////
// CIGARS //
////////////
Expand Down
4 changes: 4 additions & 0 deletions code/game/objects/items/trash.dm
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,10 @@
desc = "A manky old cigar butt."
icon_state = "cigarbutt"

/obj/item/trash/bluntbutt
name = "roach"
desc = "Someone's been puffing some good kush."
icon_state = "bluntbutt"
////////////
///Dishes///
////////////
Expand Down
Binary file modified icons/mob/humans/onmob/items_lefthand_0.dmi
Binary file not shown.
Binary file modified icons/mob/humans/onmob/items_righthand_0.dmi
Binary file not shown.
Binary file modified icons/mob/humans/onmob/mask.dmi
Binary file not shown.
Binary file modified icons/obj/items/clothing/masks.dmi
Binary file not shown.
Loading