Files
Bubberstation/code/modules/food&drinks/drinks/drinks.dm
phil235 81ce777ec2 - you now only see turfs when inside gas pipes.
- I renamed some vars of datum/hud to be more selfexplanatory
- Moved all datum/hud mob code into the hud folder.
- fixed alien's zone selection button not using the correct sprites.
- I removed the update_hud() proc (that needed to be removed).
- Fixed a typo in /mob/living/carbon/ContractDisease , using "internals" instead of "internal" (very different things)
- Fixed doTeleport() calling Entered() twice on the destination area.
- To reference a mob's selected zone, you now use a direct mob var ("H.zone_selected" instead of "H.zone_sel.selecting")
- mobs lose certain screen objects var ("healths", "zone_sel", "internals", etc) which are now vars of the mob's datum/hud instead.
- the Blind spell is now done via the blind mutation instead of the blind disabilities.
- Give to mobs a version of forceMove(), so the mob is always properly unbuckled, his pull stopped, his vision updated, etc.
- The "user" var of mob/camera/aiEye/remote is renamed to "eye_user" to avoid confusion.
- reset_view() is replaced by reset_perspective(). Now all changes to client.eye and client.perspective are done with this proc.
- I reworked /obj/machinery/computer/security code, changing camera is instantaneous now, as well as cancelling.
- I reworked /obj/machinery/computer/camera_advanced code as well.
- I changed /obj/item/mecha_parts/mecha_equipment/mining_scanner's meson view to be constant instead of by intermittent.
- Fixes not being able to use /obj/item/device/camera_bug while buckled.
- removed admin_forcemove() proc, admin force moving now uses forceMove() simply.
- Removed the client var "adminobs"
- Added var/vision_correction to glasses.
- Added a thermal_overload() proc for glasses, to remove copypasta in emp_act code.
- Remove the hal_crit mob var
- We no longer delete the mob's hud everytime he logs in.
- Added a stat == dead check in mob's metabolize() so we immediately stop metabolizing if one of the chem kills the mob.
- Being inside disposal bin lowers your vision, like wearing a welding helmet.
- removed the remote_view mob var.
- I changed advanced camera EYE, some fixes, removed unnecessary code when the eye moves, now the mob client eye properly follows the camera mob.
- fixes mob var "machine" not being nullified on logout.
- larva/death() was calling two "living_mob_list -= src"
- I made the Blind screen objects into a global_hud instead of giving one to each mob (like damage overlay).
- I untied tint and eye_blind, TINT_BLIND doesn't give you eye_blind=1.
- gave a visual overlay when inside locker (vimpaired)
- when inside disposal/gas pipes you get sight |= (BLIND|SEE_TURFS)
- glasses toggling updates (atmos meson toggle): DONE
- The new adjust procs serve to properly change eye_blind etc and call vision update procs when needed.
- I added an on_unset_machine() proc to handle perspective reset for camera consoles.
- I moved consequences of eye_check fail inside eye_check() procs themselves.
- I fixed vision updates being fucked by forceMove, especially pipe vision.
- I decided that damage overlay not appearing when dead.
- mob's hud_used is no longer deleted on each login()
- I refactored mob huds a bit, creating subtypes for each mob (/datum/hud/human)
- f12's hud toggling is now available to all mobs
- gave borgs a low_power_mode var so unpowered borg do not use stat= UNCONSCIOUS (which made things weird since you were unconscious but not blind)
- Fixed double Area entering when forced teleporting.
- I fixed larva pulling not being broken when cuffing them, and larva not seeing handcuff alert (and they can resist by clicking it)
- I removed pull updates from life() since it onyl checked for puller's incapacitation.
- I renamed camera/deactivate() to toggle_cam() to be more accurate.
- I fixed mmi brain being immortal (by removing the brain and putting it back)
- I simplified mmi brain emp damage.
2016-02-04 00:33:16 +01:00

298 lines
11 KiB
Plaintext

////////////////////////////////////////////////////////////////////////////////
/// Drinks.
////////////////////////////////////////////////////////////////////////////////
/obj/item/weapon/reagent_containers/food/drinks
name = "drink"
desc = "yummy"
icon = 'icons/obj/drinks.dmi'
icon_state = null
flags = OPENCONTAINER
var/gulp_size = 5 //This is now officially broken ... need to think of a nice way to fix it.
possible_transfer_amounts = list(5,10,15,20,25,30,50)
volume = 50
burn_state = FIRE_PROOF
/obj/item/weapon/reagent_containers/food/drinks/New()
..()
pixel_x = rand(-5, 5)
pixel_y = rand(-5, 5)
/obj/item/weapon/reagent_containers/food/drinks/on_reagent_change()
if (gulp_size < 5) gulp_size = 5
else gulp_size = max(round(reagents.total_volume / 5), 5)
/obj/item/weapon/reagent_containers/food/drinks/attack(mob/M, mob/user, def_zone)
if(!reagents || !reagents.total_volume)
user << "<span class='warning'>[src] is empty!</span>"
return 0
if(!canconsume(M, user))
return 0
if(M == user)
M << "<span class='notice'>You swallow a gulp of [src].</span>"
else
M.visible_message("<span class='danger'>[user] attempts to feed the contents of [src] to [M].</span>", "<span class='userdanger'>[user] attempts to feed the contents of [src] to [M].</span>")
if(!do_mob(user, M))
return
if(!reagents || !reagents.total_volume)
return // The drink might be empty after the delay, such as by spam-feeding
M.visible_message("<span class='danger'>[user] feeds the contents of [src] to [M].</span>", "<span class='userdanger'>[user] feeds the contents of [src] to [M].</span>")
add_logs(user, M, "fed", reagentlist(src))
var/fraction = min(gulp_size/reagents.total_volume, 1)
reagents.reaction(M, INGEST, fraction)
reagents.trans_to(M, gulp_size)
playsound(M.loc,'sound/items/drink.ogg', rand(10,50), 1)
return 1
/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(!target.reagents.total_volume)
user << "<span class='warning'>[target] is empty.</span>"
return
if(reagents.total_volume >= reagents.maximum_volume)
user << "<span class='warning'>[src] is full.</span>"
return
var/trans = target.reagents.trans_to(src, amount_per_transfer_from_this)
user << "<span class='notice'>You fill [src] with [trans] units of the contents of [target].</span>"
else if(target.is_open_container()) //Something like a glass. Player probably wants to transfer TO it.
if(!reagents.total_volume)
user << "<span class='warning'>[src] is empty.</span>"
return
if(target.reagents.total_volume >= target.reagents.maximum_volume)
user << "<span class='warning'>[target] is full.</span>"
return
var/refill = reagents.get_master_reagent_id()
var/trans = src.reagents.trans_to(target, amount_per_transfer_from_this)
user << "<span class='notice'>You transfer [trans] units of the solution to [target].</span>"
if(isrobot(user)) //Cyborg modules that include drinks automatically refill themselves, but drain the borg's cell
var/mob/living/silicon/robot/bro = user
bro.cell.use(30)
spawn(600)
reagents.add_reagent(refill, trans)
return
/obj/item/weapon/reagent_containers/food/drinks/attackby(obj/item/I, mob/user, params)
if(I.is_hot())
var/added_heat = (I.is_hot() / 100) //ishot returns a temperature
if(reagents)
reagents.chem_temp += added_heat
user << "<span class='notice'>You heat [src] with [I].</span>"
reagents.handle_reactions()
..()
////////////////////////////////////////////////////////////////////////////////
/// Drinks. END
////////////////////////////////////////////////////////////////////////////////
/obj/item/weapon/reagent_containers/food/drinks/golden_cup
desc = "A golden cup"
name = "golden cup"
icon_state = "golden_cup"
w_class = 4
force = 14
throwforce = 10
amount_per_transfer_from_this = 20
materials = list(MAT_GOLD=1000)
possible_transfer_amounts = list()
volume = 150
flags = CONDUCT | OPENCONTAINER
spillable = 1
/obj/item/weapon/reagent_containers/food/drinks/golden_cup/tournament_26_06_2011
desc = "A golden cup. It will be presented to a winner of tournament 26 june and name of the winner will be graved on it."
///////////////////////////////////////////////Drinks
//Notes by Darem: Drinks are simply containers that start preloaded. Unlike condiments, the contents can be ingested directly
// rather then having to add it to something else first. They should only contain liquids. They have a default container size of 50.
// Formatting is the same as food.
/obj/item/weapon/reagent_containers/food/drinks/coffee
name = "Robust Coffee"
desc = "Careful, the beverage you're about to enjoy is extremely hot."
icon_state = "coffee"
list_reagents = list("coffee" = 30)
spillable = 1
/obj/item/weapon/reagent_containers/food/drinks/ice
name = "Ice Cup"
desc = "Careful, cold ice, do not chew."
icon_state = "coffee"
list_reagents = list("ice" = 30)
spillable = 1
/obj/item/weapon/reagent_containers/food/drinks/mug/ // parent type is literally just so empty mug sprites are a thing
name = "mug"
desc = "A drink served in a classy mug."
icon_state = "tea"
item_state = "coffee"
spillable = 1
/obj/item/weapon/reagent_containers/food/drinks/mug/on_reagent_change()
if(reagents.total_volume)
icon_state = "tea"
else
icon_state = "tea_empty"
/obj/item/weapon/reagent_containers/food/drinks/mug/tea
name = "Duke Purple Tea"
desc = "An insult to Duke Purple is an insult to the Space Queen! Any proper gentleman will fight you, if you sully this tea."
list_reagents = list("tea" = 30)
/obj/item/weapon/reagent_containers/food/drinks/mug/coco
name = "Dutch Hot Coco"
desc = "Made in Space South America."
list_reagents = list("hot_coco" = 30, "sugar" = 5)
/obj/item/weapon/reagent_containers/food/drinks/dry_ramen
name = "Cup Ramen"
desc = "Just add 10ml of water, self heats! A taste that reminds you of your school years."
icon_state = "ramen"
list_reagents = list("dry_ramen" = 30)
/obj/item/weapon/reagent_containers/food/drinks/beer
name = "Space Beer"
desc = "Beer. In space."
icon_state = "beer"
list_reagents = list("beer" = 30)
/obj/item/weapon/reagent_containers/food/drinks/ale
name = "Magm-Ale"
desc = "A true dorf's drink of choice."
icon_state = "alebottle"
item_state = "beer"
list_reagents = list("ale" = 30)
/obj/item/weapon/reagent_containers/food/drinks/sillycup
name = "Paper Cup"
desc = "A paper water cup."
icon_state = "water_cup_e"
possible_transfer_amounts = list()
volume = 10
spillable = 1
/obj/item/weapon/reagent_containers/food/drinks/sillycup/on_reagent_change()
if(reagents.total_volume)
icon_state = "water_cup"
else
icon_state = "water_cup_e"
//////////////////////////drinkingglass and shaker//
//Note by Darem: This code handles the mixing of drinks. New drinks go in three places: In Chemistry-Reagents.dm (for the drink
// itself), in Chemistry-Recipes.dm (for the reaction that changes the components into the drink), and here (for the drinking glass
// icon states.
/obj/item/weapon/reagent_containers/food/drinks/shaker
name = "shaker"
desc = "A metal shaker to mix drinks in."
icon_state = "shaker"
amount_per_transfer_from_this = 10
volume = 100
/obj/item/weapon/reagent_containers/food/drinks/flask
name = "captain's flask"
desc = "A silver flask belonging to the captain."
icon_state = "flask"
materials = list(MAT_SILVER=500)
volume = 60
/obj/item/weapon/reagent_containers/food/drinks/flask/det
name = "detective's flask"
desc = "The detective's only true friend."
icon_state = "detflask"
materials = list(MAT_METAL=250)
list_reagents = list("whiskey" = 30)
/obj/item/weapon/reagent_containers/food/drinks/britcup
name = "cup"
desc = "A cup with the british flag emblazoned on it."
icon_state = "britcup"
volume = 30
spillable = 1
//////////////////////////soda_cans//
//These are in their own group to be used as IED's in /obj/item/weapon/grenade/ghettobomb.dm
/obj/item/weapon/reagent_containers/food/drinks/soda_cans
name = "soda can"
/obj/item/weapon/reagent_containers/food/drinks/soda_cans/attack(mob/M, mob/user)
if(M == user && !src.reagents.total_volume && user.a_intent == "harm" && user.zone_selected == "head")
user.visible_message("<span class='warning'>[user] crushes the can of [src] on \his forehead!</span>", "<span class='notice'>You crush the can of [src] on your forehead.</span>")
playsound(user.loc,'sound/weapons/pierce.ogg', rand(10,50), 1)
var/obj/item/trash/can/crushed_can = new /obj/item/trash/can(user.loc)
crushed_can.icon_state = icon_state
qdel(src)
..()
/obj/item/weapon/reagent_containers/food/drinks/soda_cans/cola
name = "Space Cola"
desc = "Cola. in space."
icon_state = "cola"
list_reagents = list("cola" = 30)
/obj/item/weapon/reagent_containers/food/drinks/soda_cans/tonic
name = "T-Borg's Tonic Water"
desc = "Quinine tastes funny, but at least it'll keep that Space Malaria away."
icon_state = "tonic"
list_reagents = list("tonic" = 50)
/obj/item/weapon/reagent_containers/food/drinks/soda_cans/sodawater
name = "Soda Water"
desc = "A can of soda water. Why not make a scotch and soda?"
icon_state = "sodawater"
list_reagents = list("sodawater" = 50)
/obj/item/weapon/reagent_containers/food/drinks/soda_cans/lemon_lime
name = "Orange Soda"
desc = "You wanted ORANGE. It gave you Lemon Lime."
icon_state = "lemon-lime"
list_reagents = list("lemon_lime" = 30)
/obj/item/weapon/reagent_containers/food/drinks/soda_cans/lemon_lime/New()
..()
name = "Lemon-Lime Soda"
/obj/item/weapon/reagent_containers/food/drinks/soda_cans/space_up
name = "Space-Up"
desc = "Tastes like a hull breach in your mouth."
icon_state = "space-up"
list_reagents = list("space_up" = 30)
/obj/item/weapon/reagent_containers/food/drinks/soda_cans/starkist
name = "Star-kist"
desc = "The taste of a star in liquid form. And, a bit of tuna...?"
icon_state = "starkist"
list_reagents = list("cola" = 15, "orangejuice" = 15)
/obj/item/weapon/reagent_containers/food/drinks/soda_cans/space_mountain_wind
name = "Space Mountain Wind"
desc = "Blows right through you like a space wind."
icon_state = "space_mountain_wind"
list_reagents = list("spacemountainwind" = 30)
/obj/item/weapon/reagent_containers/food/drinks/soda_cans/thirteenloko
name = "Thirteen Loko"
desc = "The CMO has advised crew members that consumption of Thirteen Loko may result in seizures, blindness, drunkeness, or even death. Please Drink Responsibly."
icon_state = "thirteen_loko"
list_reagents = list("thirteenloko" = 30)
/obj/item/weapon/reagent_containers/food/drinks/soda_cans/dr_gibb
name = "Dr. Gibb"
desc = "A delicious mixture of 42 different flavors."
icon_state = "dr_gibb"
list_reagents = list("dr_gibb" = 30)