Merge branch 'master' into upstream-merge-26965

This commit is contained in:
LetterJay
2017-06-19 15:39:01 -05:00
committed by GitHub
423 changed files with 304918 additions and 166801 deletions
@@ -9,8 +9,9 @@
idle_power_usage = 40
interact_offline = 1
resistance_flags = FIRE_PROOF | ACID_PROOF
var/energy = 100
var/max_energy = 100
var/cell_type = /obj/item/weapon/stock_parts/cell/high
var/obj/item/weapon/stock_parts/cell/cell
var/powerefficiency = 0.01
var/amount = 30
var/recharged = 0
var/recharge_delay = 5
@@ -54,6 +55,7 @@
/obj/machinery/chem_dispenser/Initialize()
. = ..()
cell = new cell_type
recharge()
dispensable_reagents = sortList(dispensable_reagents)
@@ -66,11 +68,8 @@
recharged -= 1
/obj/machinery/chem_dispenser/proc/recharge()
if(stat & (BROKEN|NOPOWER)) return
var/addenergy = 1
var/oldenergy = energy
energy = min(energy + addenergy, max_energy)
if(energy != oldenergy)
var/usedpower = cell.give( 1 / powerefficiency) //Should always be a gain of one on the UI.
if(usedpower)
use_power(2500)
/obj/machinery/chem_dispenser/emag_act(mob/user)
@@ -106,8 +105,8 @@
/obj/machinery/chem_dispenser/ui_data()
var/data = list()
data["amount"] = amount
data["energy"] = energy
data["maxEnergy"] = max_energy
data["energy"] = cell.charge ? cell.charge * powerefficiency : "0" //To prevent NaN in the UI.
data["maxEnergy"] = cell.maxcharge * powerefficiency
data["isBeakerLoaded"] = beaker ? 1 : 0
var beakerContents[0]
@@ -149,10 +148,10 @@
if(beaker && dispensable_reagents.Find(reagent))
var/datum/reagents/R = beaker.reagents
var/free = R.maximum_volume - R.total_volume
var/actual = min(amount, energy * 10, free)
var/actual = min(amount, (cell.charge * powerefficiency)*10, free)
R.add_reagent(reagent, actual)
energy = max(energy - actual / 10, 0)
cell.use((actual / 10) / powerefficiency)
. = TRUE
if("remove")
var/amount = text2num(params["amount"])
@@ -189,15 +188,36 @@
add_overlay(beaker_overlay)
else if(user.a_intent != INTENT_HARM && !istype(I, /obj/item/weapon/card/emag))
to_chat(user, "<span class='warning'>You can't load \the [I] into the machine!</span>")
return ..()
else
return ..()
/obj/machinery/chem_dispenser/get_cell()
return cell
/obj/machinery/chem_dispenser/emp_act(severity)
var/list/datum/reagents/R = list()
var/total = min(rand(7,15), Floor(cell.charge*powerefficiency))
var/datum/reagents/Q = new(total*10)
if(beaker && beaker.reagents)
R += beaker.reagents
for(var/i in 1 to total)
Q.add_reagent(pick(dispensable_reagents), 10)
R += Q
chem_splash(get_turf(src), 3, R)
if(beaker && beaker.reagents)
beaker.reagents.remove_all()
cell.use(total/powerefficiency)
cell.emp_act()
visible_message("<span class='danger'> The [src] malfunctions, spraying chemicals everywhere!</span>")
..()
/obj/machinery/chem_dispenser/constructable
name = "portable chem dispenser"
icon = 'icons/obj/chemical.dmi'
icon_state = "minidispenser"
energy = 10
max_energy = 10
powerefficiency = 0.001
amount = 5
recharge_delay = 30
dispensable_reagents = list()
@@ -263,16 +283,13 @@
/obj/machinery/chem_dispenser/constructable/RefreshParts()
var/time = 0
var/temp_energy = 0
var/i
for(var/obj/item/weapon/stock_parts/cell/P in component_parts)
cell = P
for(var/obj/item/weapon/stock_parts/matter_bin/M in component_parts)
temp_energy += M.rating
temp_energy--
max_energy = temp_energy * 5 //max energy = (bin1.rating + bin2.rating - 1) * 5, 5 on lowest 25 on highest
time += M.rating
for(var/obj/item/weapon/stock_parts/capacitor/C in component_parts)
time += C.rating
for(var/obj/item/weapon/stock_parts/cell/P in component_parts)
time += round(P.maxcharge, 10000) / 10000
recharge_delay /= time/2 //delay between recharges, double the usual time on lowest 50% less than usual on highest
for(var/obj/item/weapon/stock_parts/manipulator/M in component_parts)
for(i=1, i<=M.rating, i++)
@@ -532,6 +532,44 @@
color = "#DFDFDF"
taste_description = "mayonnaise"
/datum/reagent/consumable/tearjuice
name = "Tear Juice"
id = "tearjuice"
description = "A blinding substance extracted from certain onions."
color = "#c0c9a0"
taste_description = "bitterness"
/datum/reagent/consumable/tearjuice/reaction_mob(mob/living/M, method=TOUCH, reac_volume)
if(!istype(M))
return
var/unprotected = FALSE
switch(method)
if(INGEST)
unprotected = TRUE
if(INJECT)
unprotected = FALSE
else //Touch or vapor
if(!M.is_mouth_covered() && !M.is_eyes_covered())
unprotected = TRUE
if(unprotected)
if(!M.getorganslot("eye_sight")) //can't blind somebody with no eyes
to_chat(M, "<span class = 'notice'>Your eye sockets feel wet.</span>")
else
if(!M.eye_blurry)
to_chat(M, "<span class = 'warning'>Tears well up in your eyes!</span>")
M.blind_eyes(2)
M.blur_eyes(5)
..()
/datum/reagent/consumable/tearjuice/on_mob_life(mob/living/M)
..()
if(M.eye_blurry) //Don't worsen vision if it was otherwise fine
M.blur_eyes(4)
if(prob(10))
to_chat(M, "<span class = 'warning'>Your eyes sting!</span>")
M.blind_eyes(2)
////Lavaland Flora Reagents////
@@ -613,9 +613,8 @@
/datum/reagent/toxin/amanitin/on_mob_delete(mob/living/M)
var/toxdamage = current_cycle*3*REM
M.log_message("has taken [toxdamage] toxin damage from amanitin toxin", INDIVIDUAL_ATTACK_LOG)
M.adjustToxLoss(toxdamage)
if(M)
add_logs(M, get_turf(M), "has taken [toxdamage] toxin damage from amanitin toxin")
..()
/datum/reagent/toxin/lipolicide
@@ -663,7 +662,7 @@
.=..()
if(current_cycle >=11 && prob(min(50,current_cycle)) && ishuman(M))
var/mob/living/carbon/human/H = M
H.vomit(lost_nutrition = 10, blood = prob(10), stun = prob(50), distance = rand(0,4), message = TRUE, toxic = prob(30))
H.vomit(10, prob(10), prob(50), rand(0,4), TRUE, prob(30))
for(var/datum/reagent/toxin/R in M.reagents.reagent_list)
if(R != src)
H.reagents.remove_reagent(R.id,1)
@@ -673,7 +672,7 @@
if(current_cycle >=33 && prob(15) && ishuman(M))
var/mob/living/carbon/human/H = M
H.spew_organ()
H.vomit(lost_nutrition = 0, blood = 1, stun = 1, distance = 4)
H.vomit(0, TRUE, TRUE, 4)
to_chat(H, "<span class='userdanger'>You feel something lumpy come up as you vomit.</span>")
/datum/reagent/toxin/curare
@@ -371,7 +371,7 @@
name = "Mix Virus 10"
id = "mixvirus10"
required_reagents = list("uraniumvirusfood" = 5)
required_reagents = list("uraniumvirusfood" = 1)
level_min = 6
level_max = 7
@@ -379,7 +379,7 @@
name = "Mix Virus 11"
id = "mixvirus11"
required_reagents = list("uraniumplasmavirusfood_unstable" = 5)
required_reagents = list("uraniumplasmavirusfood_unstable" = 1)
level_min = 7
level_max = 7
@@ -387,7 +387,7 @@
name = "Mix Virus 12"
id = "mixvirus12"
required_reagents = list("uraniumplasmavirusfood_stable" = 5)
required_reagents = list("uraniumplasmavirusfood_stable" = 1)
level_min = 8
level_max = 8
@@ -11,8 +11,8 @@
var/roundstart = 0
var/self_delay = 0 //pills are instant, this is because patches inheret their aplication from pills
/obj/item/weapon/reagent_containers/pill/Initialize()
. = ..()
/obj/item/weapon/reagent_containers/pill/Initialize()
. = ..()
if(!icon_state)
icon_state = "pill[rand(1,20)]"
if(reagents.total_volume && roundstart)
@@ -142,3 +142,10 @@
icon_state = "pill18"
list_reagents = list("insulin" = 50)
roundstart = 1
/obj/item/weapon/reagent_containers/pill/shadowtoxin
name = "black pill"
desc = "I wouldn't eat this if I were you."
icon_state = "pill9"
color = "#454545"
list_reagents = list("shadowmutationtoxin" = 1)
+2 -2
View File
@@ -55,7 +55,7 @@
/obj/structure/reagent_dispensers/watertank/high
name = "high-capacity water tank"
desc = "A highly-pressurized water tank made to hold gargantuan amounts of water.."
desc = "A highly pressurized water tank made to hold gargantuan amounts of water."
icon_state = "water_high" //I was gonna clean my room...
tank_volume = 100000
@@ -107,7 +107,7 @@
reagents.trans_to(W, W.max_fuel)
user.visible_message("<span class='notice'>[user] refills [user.p_their()] [W.name].</span>", "<span class='notice'>You refill [W].</span>")
playsound(src, 'sound/effects/refill.ogg', 50, 1)
update_icon()
W.update_icon()
else
user.visible_message("<span class='warning'>[user] catastrophically fails at refilling [user.p_their()] [W.name]!</span>", "<span class='userdanger'>That was stupid of you.</span>")
var/message_admins = "[key_name_admin(user)] triggered a fueltank explosion via welding tool."