Merge branch 'dev' into ofBeesAndHoney

Conflicts:
	code/modules/materials/material_recipes.dm
This commit is contained in:
Kelenius
2015-08-14 16:55:21 +03:00
132 changed files with 1981 additions and 1371 deletions

View File

@@ -292,9 +292,15 @@
return trans_to_obj(target, amount, multiplier, copy)
return 0
//Using this in case we want to differentiate splashing an atom from transferring reagents to it later down the road.
//For now it just calls trans_to.
/datum/reagents/proc/splash(var/atom/target, var/amount = 1, var/multiplier = 1, var/copy = 0)
//Splashing reagents is messier than trans_to, the target's loc gets some of the reagents as well.
/datum/reagents/proc/splash(var/atom/target, var/amount = 1, var/multiplier = 1, var/copy = 0, var/min_spill=0, var/max_spill=60)
var/spill = 0
if(!isturf(target) && target.loc)
spill = amount*(rand(min_spill, max_spill)/100)
amount -= spill
if(spill)
splash(target.loc, spill, multiplier, copy, min_spill, max_spill)
trans_to(target, amount, multiplier, copy)
/datum/reagents/proc/trans_id_to(var/atom/target, var/id, var/amount = 1)

View File

@@ -112,6 +112,19 @@
M.resistances += data
return
// pure concentrated antibodies
/datum/reagent/antibodies
data = list("antibodies"=list())
name = "Antibodies"
id = "antibodies"
reagent_state = LIQUID
color = "#0050F0"
/datum/reagent/antibodies/affect_blood(var/mob/living/carbon/M, var/alien, var/removed)
if(src.data)
M.antibodies |= src.data["antibodies"]
..()
#define WATER_LATENT_HEAT 19000 // How much heat is removed when applied to a hot turf, in J/unit (19000 makes 120 u of water roughly equivalent to 4L)
/datum/reagent/water
name = "Water"
@@ -145,7 +158,7 @@
environment.add_thermal_energy(-removed_heat)
if (prob(5))
T.visible_message("<span class='warning'>The water sizzles as it lands on \the [T]!</span>")
else if(volume >= 10)
if(T.wet >= 1)
return

View File

@@ -65,7 +65,7 @@
return
else
trans = reagents.splash(target, amount_per_transfer_from_this) //sprinkling reagents on generic non-mobs
trans = reagents.trans_to(target, amount_per_transfer_from_this) //sprinkling reagents on generic non-mobs
user << "<span class='notice'>You transfer [trans] units of the solution.</span>"
else // Taking from something

View File

@@ -1,43 +1,12 @@
/obj/item/weapon/reagent_containers/food/drinks/cans
volume = 40 //just over one and a half cups
amount_per_transfer_from_this = 5
flags = 0
attack_self(mob/user as mob)
if (!is_open_container())
playsound(loc,'sound/effects/canopen.ogg', rand(10,50), 1)
user << "<span class='notice'>You open the drink with an audible pop!</span>"
flags |= OPENCONTAINER
else
return
attack(mob/M as mob, mob/user as mob, def_zone)
if(!is_open_container())
user << "<span class='notice'>You need to open the drink!</span>"
return
return ..()
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())
user << "<span class='notice'>You need to open the drink!</span>"
return
else if(target.is_open_container()) //Something like a glass. Player probably wants to transfer TO it.
if(!is_open_container())
user << "<span class='notice'>You need to open the drink!</span>"
return
return ..()
flags = 0 //starts closed
//DRINKS
/obj/item/weapon/reagent_containers/food/drinks/cans/cola
name = "Space Cola"
name = "\improper Space Cola"
desc = "Cola. in space."
icon_state = "cola"
center_of_mass = list("x"=16, "y"=10)
@@ -46,7 +15,7 @@
reagents.add_reagent("cola", 30)
/obj/item/weapon/reagent_containers/food/drinks/cans/waterbottle
name = "Bottled Water"
name = "bottled water"
desc = "Introduced to the vending machines by Skrellian request, this water comes straight from the Martian poles."
icon_state = "waterbottle"
center_of_mass = list("x"=15, "y"=8)
@@ -54,28 +23,8 @@
..()
reagents.add_reagent("water", 30)
/obj/item/weapon/reagent_containers/food/drinks/cans/beer
name = "Space Beer"
desc = "Contains only water, malt and hops."
icon_state = "beer"
center_of_mass = list("x"=16, "y"=12)
New()
..()
reagents.add_reagent("beer", 30)
/obj/item/weapon/reagent_containers/food/drinks/cans/ale
name = "Magm-Ale"
desc = "A true dorf's drink of choice."
icon_state = "alebottle"
item_state = "beer"
center_of_mass = list("x"=16, "y"=10)
New()
..()
reagents.add_reagent("ale", 30)
/obj/item/weapon/reagent_containers/food/drinks/cans/space_mountain_wind
name = "Space Mountain Wind"
name = "\improper Space Mountain Wind"
desc = "Blows right through you like a space wind."
icon_state = "space_mountain_wind"
center_of_mass = list("x"=16, "y"=10)
@@ -84,7 +33,7 @@
reagents.add_reagent("spacemountainwind", 30)
/obj/item/weapon/reagent_containers/food/drinks/cans/thirteenloko
name = "Thirteen Loko"
name = "\improper 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"
center_of_mass = list("x"=16, "y"=8)
@@ -93,7 +42,7 @@
reagents.add_reagent("thirteenloko", 30)
/obj/item/weapon/reagent_containers/food/drinks/cans/dr_gibb
name = "Dr. Gibb"
name = "\improper Dr. Gibb"
desc = "A delicious mixture of 42 different flavors."
icon_state = "dr_gibb"
center_of_mass = list("x"=16, "y"=10)
@@ -102,7 +51,7 @@
reagents.add_reagent("dr_gibb", 30)
/obj/item/weapon/reagent_containers/food/drinks/cans/starkist
name = "Star-kist"
name = "\improper Star-kist"
desc = "The taste of a star in liquid form. And, a bit of tuna...?"
icon_state = "starkist"
center_of_mass = list("x"=16, "y"=10)
@@ -111,7 +60,7 @@
reagents.add_reagent("brownstar", 30)
/obj/item/weapon/reagent_containers/food/drinks/cans/space_up
name = "Space-Up"
name = "\improper Space-Up"
desc = "Tastes like a hull breach in your mouth."
icon_state = "space-up"
center_of_mass = list("x"=16, "y"=10)
@@ -120,7 +69,7 @@
reagents.add_reagent("space_up", 30)
/obj/item/weapon/reagent_containers/food/drinks/cans/lemon_lime
name = "Lemon-Lime"
name = "\improper Lemon-Lime"
desc = "You wanted ORANGE. It gave you Lemon Lime."
icon_state = "lemon-lime"
center_of_mass = list("x"=16, "y"=10)
@@ -129,7 +78,7 @@
reagents.add_reagent("lemon_lime", 30)
/obj/item/weapon/reagent_containers/food/drinks/cans/iced_tea
name = "Vrisk Serket Iced Tea"
name = "\improper Vrisk Serket Iced Tea"
desc = "That sweet, refreshing southern earthy flavor. That's where it's from, right? South Earth?"
icon_state = "ice_tea_can"
center_of_mass = list("x"=16, "y"=10)
@@ -138,7 +87,7 @@
reagents.add_reagent("icetea", 30)
/obj/item/weapon/reagent_containers/food/drinks/cans/grape_juice
name = "Grapel Juice"
name = "\improper Grapel Juice"
desc = "500 pages of rules of how to appropriately enter into a combat with this juice!"
icon_state = "purple_can"
center_of_mass = list("x"=16, "y"=10)
@@ -147,7 +96,7 @@
reagents.add_reagent("grapejuice", 30)
/obj/item/weapon/reagent_containers/food/drinks/cans/tonic
name = "T-Borg's Tonic Water"
name = "\improper T-Borg's Tonic Water"
desc = "Quinine tastes funny, but at least it'll keep that Space Malaria away."
icon_state = "tonic"
center_of_mass = list("x"=16, "y"=10)
@@ -156,7 +105,7 @@
reagents.add_reagent("tonic", 50)
/obj/item/weapon/reagent_containers/food/drinks/cans/sodawater
name = "Soda Water"
name = "soda water"
desc = "A can of soda water. Still water's more refreshing cousin."
icon_state = "sodawater"
center_of_mass = list("x"=16, "y"=10)

View File

@@ -14,12 +14,18 @@
return
attack_self(mob/user as mob)
return
if(!is_open_container())
open(user)
attack(mob/M as mob, mob/user as mob, def_zone)
if(standard_feed_mob(user, M))
proc/open(mob/user)
playsound(loc,'sound/effects/canopen.ogg', rand(10,50), 1)
user << "<span class='notice'>You open [src] with an audible pop!</span>"
flags |= OPENCONTAINER
attack(mob/M as mob, mob/user as mob, def_zone)
if(standard_feed_mob(user, M))
return
return 0
afterattack(obj/target, mob/user, proximity)
@@ -29,7 +35,24 @@
return
if(standard_pour_into(user, target))
return
return ..()
standard_feed_mob(var/mob/user, var/mob/target)
if(!is_open_container())
user << "<span class='notice'>You need to open [src]!</span>"
return 1
return ..()
standard_dispenser_refill(var/mob/user, var/obj/structure/reagent_dispensers/target)
if(!is_open_container())
user << "<span class='notice'>You need to open [src]!</span>"
return 1
return ..()
standard_pour_into(var/mob/user, var/atom/target)
if(!is_open_container())
user << "<span class='notice'>You need to open [src]!</span>"
return 1
return ..()
self_feed_message(var/mob/user)

View File

@@ -4,19 +4,51 @@
/obj/item/weapon/reagent_containers/food/drinks/bottle
amount_per_transfer_from_this = 10
volume = 120
volume = 100
item_state = "broken_beer" //Generic held-item sprite until unique ones are made.
var/const/duration = 13 //Directly relates to the 'weaken' duration. Lowered by armor (i.e. helmets)
force = 5
var/smash_duration = 5 //Directly relates to the 'weaken' duration. Lowered by armor (i.e. helmets)
var/isGlass = 1 //Whether the 'bottle' is made of glass or not so that milk cartons dont shatter when someone gets hit by it
var/obj/item/weapon/reagent_containers/glass/rag/rag = null
var/rag_underlay = "rag"
/obj/item/weapon/reagent_containers/food/drinks/bottle/proc/smash(mob/living/target as mob, mob/living/user as mob)
/obj/item/weapon/reagent_containers/food/drinks/bottle/Destroy()
rag = null
..()
//when thrown on impact, bottles smash and spill their contents
/obj/item/weapon/reagent_containers/food/drinks/bottle/throw_impact(atom/hit_atom, var/speed)
..()
var/mob/M = thrower
if(isGlass && istype(M) && M.a_intent == I_HURT)
var/throw_dist = get_dist(throw_source, loc)
if(speed >= throw_speed && smash_check(throw_dist)) //not as reliable as smashing directly
if(reagents)
hit_atom.visible_message("<span class='notice'>The contents of the [src] splash all over [hit_atom]!</span>")
reagents.splash(hit_atom, reagents.total_volume)
src.smash(loc, hit_atom)
/obj/item/weapon/reagent_containers/food/drinks/bottle/proc/smash_check(var/distance)
if(!isGlass || !smash_duration)
return 0
var/list/chance_table = list(90, 90, 85, 85, 60, 35, 15) //starting from distance 0
var/idx = max(distance + 1, 1) //since list indices start at 1
if(idx > chance_table.len)
return 0
return prob(chance_table[idx])
/obj/item/weapon/reagent_containers/food/drinks/bottle/proc/smash(var/newloc, atom/against = null)
if(ismob(loc))
var/mob/M = loc
M.drop_from_inventory(src)
//Creates a shattering noise and replaces the bottle with a broken_bottle
user.drop_item()
var/obj/item/weapon/broken_bottle/B = new /obj/item/weapon/broken_bottle(user.loc)
user.put_in_active_hand(B)
var/obj/item/weapon/broken_bottle/B = new /obj/item/weapon/broken_bottle(newloc)
if(prob(33))
new/obj/item/weapon/material/shard(target.loc) // Create a glass shard at the target's location!
new/obj/item/weapon/material/shard(newloc) // Create a glass shard at the target's location!
B.icon_state = src.icon_state
var/icon/I = new('icons/obj/drinks.dmi', src.icon_state)
@@ -24,23 +56,68 @@
I.SwapColor(rgb(255, 0, 220, 255), rgb(0, 0, 0, 0))
B.icon = I
if(rag && rag.on_fire && isliving(against))
rag.forceMove(loc)
var/mob/living/L = against
L.IgniteMob()
playsound(src, "shatter", 70, 1)
user.put_in_active_hand(B)
src.transfer_fingerprints_to(B)
qdel(src)
return B
/obj/item/weapon/reagent_containers/food/drinks/bottle/attackby(obj/item/W, mob/user)
if(!rag && istype(W, /obj/item/weapon/reagent_containers/glass/rag))
insert_rag(W, user)
return
if(rag && istype(W, /obj/item/weapon/flame))
rag.attackby(W, user)
return
..()
/obj/item/weapon/reagent_containers/food/drinks/bottle/attack_self(mob/user)
if(rag)
remove_rag(user)
else
..()
/obj/item/weapon/reagent_containers/food/drinks/bottle/proc/insert_rag(obj/item/weapon/reagent_containers/glass/rag/R, mob/user)
if(!isGlass || rag) return
if(user.unEquip(R))
user << "<span class='notice'>You stuff [R] into [src].</span>"
rag = R
rag.forceMove(src)
flags &= ~OPENCONTAINER
update_icon()
/obj/item/weapon/reagent_containers/food/drinks/bottle/proc/remove_rag(mob/user)
if(!rag) return
user.put_in_hands(rag)
rag = null
flags |= (initial(flags) & OPENCONTAINER)
update_icon()
/obj/item/weapon/reagent_containers/food/drinks/bottle/open(mob/user)
if(rag) return
..()
/obj/item/weapon/reagent_containers/food/drinks/bottle/update_icon()
underlays.Cut()
if(rag)
var/underlay_image = image(icon='icons/obj/drinks.dmi', icon_state=rag.on_fire? "[rag_underlay]_lit" : rag_underlay)
underlays += underlay_image
copy_light(rag)
else
set_light(0)
/obj/item/weapon/reagent_containers/food/drinks/bottle/attack(mob/living/target as mob, mob/living/user as mob)
if(!target)
return
if(user.a_intent != I_HURT || !isGlass)
return ..()
force = 15 //Smashing bottles over someoen's head hurts.
var/obj/item/organ/external/affecting = user.zone_sel.selecting //Find what the player is aiming at
var/armor_block = 0 //Get the target's armour values for normal attack damage.
@@ -48,13 +125,16 @@
//Calculating duration and calculating damage.
armor_block = target.run_armor_check(affecting, "melee")
armor_duration = duration + force - target.getarmor(affecting, "melee")
//force will counteract armour, but will never increase duration
armor_duration = smash_duration + min(0, force - target.getarmor(affecting, "melee") + 10)
//Apply the damage!
target.apply_damage(force, BRUTE, affecting, armor_block, sharp=0)
// You are going to knock someone out for longer if they are not wearing a helmet.
if(affecting == "head" && istype(target, /mob/living/carbon/))
var/do_smash = smash_check(1) //won't always break on the first hit
if(affecting == "head" && istype(target, /mob/living/carbon/) && do_smash)
//Display an attack message.
for(var/mob/O in viewers(user, null))
@@ -62,8 +142,7 @@
else O.show_message(text("\red <B>[target] hit \himself with a bottle of [src.name] on the head!</B>"), 1)
//Weaken the target for the duration that we calculated and divide it by 5.
if(armor_duration)
target.apply_effect(min(armor_duration, 10) , WEAKEN, armor_block) // Never weaken more than a flash!
target.apply_effect(min(armor_duration, 5) , WEAKEN, armor_block) // Never weaken more than a flash!
else
//Default attack message and don't weaken the target.
for(var/mob/O in viewers(user, null))
@@ -75,13 +154,15 @@
target.attack_log += text("\[[time_stamp()]\] <font color='orange'>Has been smashed with a bottle by [user.name] ([user.ckey])</font>")
msg_admin_attack("[user.name] ([user.ckey]) attacked [target.name] ([target.ckey]) with a bottle. (INTENT: [uppertext(user.a_intent)]) (<A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[user.x];Y=[user.y];Z=[user.z]'>JMP</a>)")
//The reagents in the bottle splash all over the target, thanks for the idea Nodrak
if(reagents)
user.visible_message("<span class='notice'>The contents of the [src] splash all over [target]!</span>")
reagents.splash(target, reagents.total_volume)
if(do_smash)
//The reagents in the bottle splash all over the target, thanks for the idea Nodrak
if(reagents)
user.visible_message("<span class='notice'>The contents of the [src] splash all over [target]!</span>")
reagents.splash(target, reagents.total_volume)
//Finally, smash the bottle. This kills (qdel) the bottle.
src.smash(target, user)
//Finally, smash the bottle. This kills (qdel) the bottle.
var/obj/item/weapon/broken_bottle/B = src.smash(target.loc, target)
user.put_in_active_hand(B)
return
@@ -92,8 +173,8 @@
desc = "A bottle with a sharp broken bottom."
icon = 'icons/obj/drinks.dmi'
icon_state = "broken_bottle"
force = 9.0
throwforce = 5.0
force = 9
throwforce = 5
throw_speed = 3
throw_range = 5
item_state = "beer"
@@ -314,3 +395,31 @@
New()
..()
reagents.add_reagent("limejuice", 100)
//Small bottles
/obj/item/weapon/reagent_containers/food/drinks/bottle/small
volume = 50
smash_duration = 1
flags = 0 //starts closed
rag_underlay = "rag_small"
/obj/item/weapon/reagent_containers/food/drinks/bottle/small/beer
name = "space beer"
desc = "Contains only water, malt and hops."
icon_state = "beer"
center_of_mass = list("x"=16, "y"=12)
New()
..()
reagents.add_reagent("beer", 30)
/obj/item/weapon/reagent_containers/food/drinks/bottle/small/ale
name = "\improper Magm-Ale"
desc = "A true dorf's drink of choice."
icon_state = "alebottle"
item_state = "beer"
center_of_mass = list("x"=16, "y"=10)
New()
..()
reagents.add_reagent("ale", 30)

View File

@@ -463,6 +463,7 @@
desc = "An egg!"
icon_state = "egg"
filling_color = "#FDFFD1"
volume = 10
/obj/item/weapon/reagent_containers/food/snacks/egg/New()
..()