Skip to content

Commit

Permalink
Port can opening from /vg/ (tgstation#28936)
Browse files Browse the repository at this point in the history
* Create drinks.dm

* Update drinks.dm

* Delete drinks.dm

* Update drinks.dm

* PORT SOUNDS FROM /vg/

* POP!

* nope

* Update drinks.dm

* Update drinks.dm

* why was attack_self there twice?

* Update drinks.dm

* Update drinks.dm

* GLOB GLOB GLOB

* Update sound.dm

* Update drinks.dm

* Update drinks.dm

* Update drinks.dm

* Update drinks.dm

* Lid is NOT soda specific, right?
  • Loading branch information
MoreRobustThanYou authored and Cyberboss committed Jun 30, 2017
1 parent 4f5e7cc commit a0e6b52
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 1 deletion.
2 changes: 2 additions & 0 deletions code/game/sound.dm
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,8 @@
'sound/machines/terminal_button07.ogg', 'sound/machines/terminal_button08.ogg')
if ("desceration")
soundin = pick('sound/misc/desceration-01.ogg', 'sound/misc/desceration-02.ogg', 'sound/misc/desceration-03.ogg')
if ("can_open")
soundin = pick('sound/effects/can_open1.ogg', 'sound/effects/can_open2.ogg', 'sound/effects/can_open3.ogg')
return soundin

/proc/playsound_global(file, repeat=0, wait, channel, volume)
Expand Down
28 changes: 27 additions & 1 deletion code/modules/food_and_drinks/drinks/drinks.dm
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@

if(!canconsume(M, user))
return 0

if (!is_open_container())
to_chat(user, "<span class='warning'>[src]'s lid hasn't been opened!</span>")
return 0

if(M == user)
to_chat(M, "<span class='notice'>You swallow a gulp of [src].</span>")
Expand All @@ -50,6 +54,10 @@
/obj/item/weapon/reagent_containers/food/drinks/afterattack(obj/target, mob/user , proximity)
if(!proximity) return
if(istype(target, /obj/structure/reagent_dispensers)) //A dispenser. Transfer FROM it TO us.

if (!is_open_container())
to_chat(user, "<span class='warning'>[target]'s tab isn't open!</span>")
return

if(!target.reagents.total_volume)
to_chat(user, "<span class='warning'>[target] is empty.</span>")
Expand Down Expand Up @@ -87,11 +95,17 @@
to_chat(user, "<span class='notice'>You heat [src] with [I].</span>")
reagents.handle_reactions()
..()






////////////////////////////////////////////////////////////////////////////////
/// Drinks. END
////////////////////////////////////////////////////////////////////////////////


/obj/item/weapon/reagent_containers/food/drinks/trophy
name = "pewter cup"
desc = "Everyone gets a trophy."
Expand Down Expand Up @@ -312,7 +326,9 @@

/obj/item/weapon/reagent_containers/food/drinks/soda_cans
name = "soda can"

container_type = 0
spillable = FALSE

/obj/item/weapon/reagent_containers/food/drinks/soda_cans/attack(mob/M, mob/user)
if(M == user && !src.reagents.total_volume && user.a_intent == INTENT_HARM && user.zone_selected == "head")
user.visible_message("<span class='warning'>[user] crushes the can of [src] on [user.p_their()] forehead!</span>", "<span class='notice'>You crush the can of [src] on your forehead.</span>")
Expand All @@ -321,6 +337,16 @@
crushed_can.icon_state = icon_state
qdel(src)
..()


/obj/item/weapon/reagent_containers/food/drinks/soda_cans/attack_self(mob/user)
if(!is_open_container())
to_chat(user, "You pull back the tab of \the [src] with a satisfying pop.") //Ahhhhhhhh
container_type = OPENCONTAINER
playsound(src, "can_open", 50, 1)
spillable = TRUE
return
return ..()

/obj/item/weapon/reagent_containers/food/drinks/soda_cans/cola
name = "Space Cola"
Expand Down
Binary file added sound/effects/can_open1.ogg
Binary file not shown.
Binary file added sound/effects/can_open2.ogg
Binary file not shown.
Binary file added sound/effects/can_open3.ogg
Binary file not shown.

0 comments on commit a0e6b52

Please sign in to comment.