Merge remote-tracking branch 'polaris-upstream/master' into polaris-sync-2018-01-09

# Conflicts:
#	code/game/objects/items/devices/communicator/UI.dm
#	code/game/objects/structures/flora.dm
#
This commit is contained in:
Leshana
2018-01-09 14:40:09 -05:00
59 changed files with 842 additions and 356 deletions
+4
View File
@@ -650,3 +650,7 @@ modules/mob/living/carbon/human/life.dm if you die, you will be zoomed out.
if(AStar(get_turf(us), get_turf(them), /turf/proc/AdjacentTurfsRangedSting, /turf/proc/Distance, max_nodes=25, max_node_depth=range))
return TRUE
return FALSE
// Check if an object should ignite others, like a lit lighter or candle.
/obj/item/proc/is_hot()
return FALSE
@@ -14,6 +14,7 @@
var/im_list_ui[0] //List of messages.
var/weather[0]
var/injection = null
var/modules_ui[0] //Home screen info.
//First we add other 'local' communicators.
@@ -70,8 +71,16 @@
//Weather reports.
for(var/datum/planet/planet in planet_controller.planets)
if(planet.weather_holder && planet.weather_holder.current_weather)
weather[++weather.len] = list("Planet" = planet.name, "Weather" = planet.weather_holder.current_weather.name, "Temperature" = (round(planet.weather_holder.temperature*1000)/1000),\
"High" = planet.weather_holder.current_weather.temp_high, "Low" = planet.weather_holder.current_weather.temp_low, "Wind" = "[planet.weather_holder.wind_speed]|[dir2text(planet.weather_holder.wind_dir)]")
var/list/W = list(
"Planet" = planet.name,
"Time" = planet.current_time.show_time("hh:mm"),
"Weather" = planet.weather_holder.current_weather.name,
"Temperature" = planet.weather_holder.temperature - T0C,
"High" = planet.weather_holder.current_weather.temp_high - T0C,
"Low" = planet.weather_holder.current_weather.temp_low - T0C)
weather[++weather.len] = W
injection = "<div>Test</div>"
//Modules for homescreen.
for(var/list/R in modules)
@@ -98,6 +107,8 @@
data["homeScreen"] = modules_ui
data["note"] = note // current notes
data["weather"] = weather
data["aircontents"] = src.analyze_air()
data["injection"] = injection
// update the ui if it exists, returns null if no ui is passed/found
ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
@@ -0,0 +1,27 @@
/obj/item/device/communicator/proc/analyze_air()
var/list/results = list()
var/turf/T = get_turf(src.loc)
if(!isnull(T))
var/datum/gas_mixture/environment = T.return_air()
var/pressure = environment.return_pressure()
var/total_moles = environment.total_moles
if (total_moles)
var/o2_level = environment.gas["oxygen"]/total_moles
var/n2_level = environment.gas["nitrogen"]/total_moles
var/co2_level = environment.gas["carbon_dioxide"]/total_moles
var/phoron_level = environment.gas["phoron"]/total_moles
var/unknown_level = 1-(o2_level+n2_level+co2_level+phoron_level)
results = list(
"pressure" = "[round(pressure,0.1)]",
"nitrogen" = "[round(n2_level*100,0.1)]",
"oxygen" = "[round(o2_level*100,0.1)]",
"carbon_dioxide" = "[round(co2_level*100,0.1)]",
"phoron" = "[round(phoron_level*100,0.01)]",
"other" = "[round(unknown_level, 0.01)]",
"temp" = "[round(environment.temperature-T0C,0.1)]",
"reading" = 1
)
if(isnull(results))
results = list("reading" = 0)
return results
@@ -16,16 +16,8 @@ CIGARETTE PACKETS ARE IN FANCY.DM
/obj/item/weapon/flame
var/lit = 0
/proc/isflamesource(A)
if(istype(A, /obj/item/weapon/weldingtool))
var/obj/item/weapon/weldingtool/WT = A
return (WT.isOn())
else if(istype(A, /obj/item/weapon/flame))
var/obj/item/weapon/flame/F = A
return (F.lit)
else if(istype(A, /obj/item/device/assembly/igniter))
return 1
return 0
/obj/item/weapon/flame/is_hot()
return lit
///////////
//MATCHES//
@@ -237,7 +229,7 @@ CIGARETTE PACKETS ARE IN FANCY.DM
/obj/item/clothing/mask/smokable/attackby(obj/item/weapon/W as obj, mob/user as mob)
..()
if(isflamesource(W))
if(W.is_hot())
var/text = matchmes
if(istype(W, /obj/item/weapon/flame/match))
text = matchmes
@@ -7,10 +7,10 @@
/obj/item/weapon/circuitboard/unary_atmos/construct(var/obj/machinery/atmospherics/unary/U)
//TODO: Move this stuff into the relevant constructor when pipe/construction.dm is cleaned up.
U.initialize()
U.atmos_init()
U.build_network()
if (U.node)
U.node.initialize()
U.node.atmos_init()
U.node.build_network()
/obj/item/weapon/circuitboard/unary_atmos/heater
+3
View File
@@ -629,6 +629,9 @@
user.disabilities &= ~NEARSIGHTED
return
/obj/item/weapon/weldingtool/is_hot()
return isOn()
/obj/item/weapon/weldingtool/largetank
name = "industrial welding tool"
desc = "A slightly larger welder with a larger tank."
+238
View File
@@ -0,0 +1,238 @@
/obj/structure/bonfire
name = "bonfire"
desc = "For grilling, broiling, charring, smoking, heating, roasting, toasting, simmering, searing, melting, and occasionally burning things."
icon = 'icons/obj/structures.dmi'
icon_state = "bonfire"
density = FALSE
anchored = TRUE
buckle_lying = FALSE
var/burning = FALSE
var/next_fuel_consumption = 0 // world.time of when next item in fuel list gets eatten to sustain the fire.
var/grill = FALSE
var/material/material
/obj/structure/bonfire/New(newloc, material_name)
..(newloc)
if(!material_name)
material_name = "wood"
material = get_material_by_name("[material_name]")
if(!material)
qdel(src)
return
color = material.icon_colour
// Blue wood.
/obj/structure/bonfire/sifwood/New(newloc, material_name)
..(newloc, "alien wood")
/obj/structure/bonfire/permanent/New(newloc, material_name)
..()
ignite()
/obj/structure/bonfire/permanent/sifwood/New(newloc, material_name)
..(newloc, "alien wood")
/obj/structure/bonfire/attackby(obj/item/W, mob/user)
if(istype(W, /obj/item/stack/rods) && !can_buckle && !grill)
var/obj/item/stack/rods/R = W
var/choice = input(user, "What would you like to construct?", "Bonfire") as null|anything in list("Stake","Grill")
switch(choice)
if("Stake")
R.use(1)
can_buckle = TRUE
buckle_require_restraints = TRUE
to_chat(user, "<span class='notice'>You add a rod to \the [src].</span>")
var/mutable_appearance/rod_underlay = mutable_appearance('icons/obj/structures.dmi', "bonfire_rod")
rod_underlay.pixel_y = 16
rod_underlay.appearance_flags = RESET_COLOR|PIXEL_SCALE|TILE_BOUND
underlays += rod_underlay
if("Grill")
R.use(1)
grill = TRUE
to_chat(user, "<span class='notice'>You add a grill to \the [src].</span>")
update_icon()
else
return ..()
else if(istype(W, /obj/item/stack/material/wood) || istype(W, /obj/item/stack/material/log) )
add_fuel(W, user)
else if(W.is_hot())
ignite()
else
return ..()
/obj/structure/bonfire/attack_hand(mob/user)
if(buckled_mob)
return ..()
if(get_fuel_amount())
remove_fuel(user)
else
dismantle(user)
/obj/structure/bonfire/proc/dismantle(mob/user)
if(!burning)
user.visible_message("[user] starts dismantling \the [src].", "You start dismantling \the [src].")
if(do_after(user, 5 SECONDS))
for(var/i = 1 to 5)
material.place_dismantled_product(get_turf(src))
user.visible_message("[user] dismantles down \the [src].", "You dismantle \the [src].")
qdel(src)
else
to_chat(user, "<span class='warning'>\The [src] is still burning. Extinguish it first if you want to dismantle it.</span>")
/obj/structure/bonfire/proc/get_fuel_amount()
var/F = 0
for(var/A in contents)
if(istype(A, /obj/item/stack/material/wood))
F += 0.5
if(istype(A, /obj/item/stack/material/log))
F += 1.0
return F
/obj/structure/bonfire/permanent/get_fuel_amount()
return 10
/obj/structure/bonfire/proc/remove_fuel(mob/user)
if(get_fuel_amount())
var/atom/movable/AM = pop(contents)
AM.forceMove(get_turf(src))
to_chat(user, "<span class='notice'>You take \the [AM] out of \the [src] before it has a chance to burn away.</span>")
update_icon()
/obj/structure/bonfire/permanent/remove_fuel(mob/user)
dismantle(user)
/obj/structure/bonfire/proc/add_fuel(atom/movable/new_fuel, mob/user)
if(get_fuel_amount() >= 10)
to_chat(user, "<span class='warning'>\The [src] already has enough fuel!</span>")
return FALSE
if(istype(new_fuel, /obj/item/stack/material/wood) || istype(new_fuel, /obj/item/stack/material/log) )
var/obj/item/stack/F = new_fuel
var/obj/item/stack/S = F.split(1)
if(S)
S.forceMove(src)
to_chat(user, "<span class='warning'>You add \the [new_fuel] to \the [src].</span>")
update_icon()
return TRUE
return FALSE
else
to_chat(user, "<span class='warning'>\The [src] needs raw wood to burn, \a [new_fuel] won't work.</span>")
return FALSE
/obj/structure/bonfire/permanent/add_fuel(mob/user)
to_chat(user, "<span class='warning'>\The [src] has plenty of fuel and doesn't need more fuel.</span>")
/obj/structure/bonfire/proc/consume_fuel(var/obj/item/stack/consumed_fuel)
if(!istype(consumed_fuel))
qdel(consumed_fuel) // Don't know, don't care.
return FALSE
if(istype(consumed_fuel, /obj/item/stack/material/log))
next_fuel_consumption = world.time + 2 MINUTES
qdel(consumed_fuel)
update_icon()
return TRUE
else if(istype(consumed_fuel, /obj/item/stack/material/wood)) // One log makes two planks of wood.
next_fuel_consumption = world.time + 1 MINUTE
qdel(consumed_fuel)
update_icon()
return TRUE
return FALSE
/obj/structure/bonfire/permanent/consume_fuel()
return TRUE
/obj/structure/bonfire/proc/check_oxygen()
var/datum/gas_mixture/G = loc.return_air()
if(G.gas["oxygen"] < 1)
return FALSE
return TRUE
/obj/structure/bonfire/proc/extinguish()
if(burning)
burning = FALSE
update_icon()
processing_objects -= src
visible_message("<span class='notice'>\The [src] stops burning.</span>")
/obj/structure/bonfire/proc/ignite()
if(!burning && get_fuel_amount())
burning = TRUE
update_icon()
processing_objects += src
visible_message("<span class='warning'>\The [src] starts burning!</span>")
/obj/structure/bonfire/proc/burn()
var/turf/current_location = get_turf(src)
current_location.hotspot_expose(1000, 500)
for(var/A in current_location)
if(A == src)
continue
if(isobj(A))
var/obj/O = A
O.fire_act(null, 1000, 500)
else if(isliving(A) && get_fuel_amount() > 4)
var/mob/living/L = A
L.adjust_fire_stacks(get_fuel_amount() / 4)
L.IgniteMob()
/obj/structure/bonfire/update_icon()
overlays.Cut()
if(burning)
var/state
switch(get_fuel_amount())
if(0 to 4)
state = "bonfire_warm"
if(5 to 10)
state = "bonfire_hot"
var/image/I = image(icon, state)
I.appearance_flags = RESET_COLOR
overlays += I
if(buckled_mob && get_fuel_amount() >= 5)
I = image(icon, "bonfire_intense")
I.pixel_y = 13
I.layer = MOB_LAYER + 0.1
I.appearance_flags = RESET_COLOR
overlays += I
var/light_strength = max(get_fuel_amount() / 2, 2)
set_light(light_strength, light_strength, "#FF9933")
else
set_light(0)
if(grill)
var/image/grille_image = image(icon, "bonfire_grill")
grille_image.appearance_flags = RESET_COLOR
overlays += grille_image
/obj/structure/bonfire/process()
if(!check_oxygen())
extinguish()
return
if(world.time >= next_fuel_consumption)
if(!consume_fuel(pop(contents)))
extinguish()
return
if(!grill)
burn()
/obj/structure/bonfire/fire_act(datum/gas_mixture/air, exposed_temperature, exposed_volume)
ignite()
/obj/structure/bonfire/water_act(amount)
if(prob(amount * 10))
extinguish()
/obj/structure/bonfire/post_buckle_mob(mob/living/M)
if(buckled_mob) // Just buckled someone
M.pixel_y += 13
else // Just unbuckled someone
M.pixel_y -= 13
update_icon()
+30 -2
View File
@@ -196,7 +196,9 @@
name = "unusual potted plant"
desc = "This is an unusual plant. It's bulbous ends emit a soft blue light."
icon_state = "plant-09"
set_light(l_range = 1, l_power = 0.5, l_color = "#0000FF")
light_range = 2
light_power = 1
light_color = "#33CCFF"
/obj/structure/flora/pottedplant/orientaltree
name = "potted oriental tree"
@@ -252,7 +254,9 @@
name = "subterranean potted plant"
desc = "This is a subterranean plant. It's bulbous ends glow faintly."
icon_state = "plant-20"
set_light(l_range = 1, l_power = 0.5, l_color = "#FF6633")
light_range = 2
light_power = 1
light_color = "#FF6633"
/obj/structure/flora/pottedplant/minitree
name = "potted tree"
@@ -289,6 +293,29 @@
desc = "This is a tiny well lit decorative christmas tree."
icon_state = "plant-xmas"
/obj/structure/flora/sif
icon = 'icons/obj/flora/sifflora.dmi'
/obj/structure/flora/sif/subterranean
name = "subterranean plant"
desc = "This is a subterranean plant. It's bulbous ends glow faintly."
icon_state = "glowplant"
light_range = 2
light_power = 1
light_color = "#FF6633"
/obj/structure/flora/sif/subterranean/initialize()
icon_state = "[initial(icon_state)][rand(1,2)]"
/obj/structure/flora/sif/eyes
name = "mysterious bulbs"
desc = "This is a mysterious looking plant. They kind of look like eyeballs. Creepy."
icon_state = "eyeplant"
/obj/structure/flora/sif/eyes/initialize()
icon_state = "[initial(icon_state)][rand(1,3)]"
// VOREStation Edit Start
//Pumpkins
/obj/structure/flora/pumpkin
name = "pumpkin"
@@ -327,3 +354,4 @@
/obj/structure/flora/pumpkin/carved/owo
desc = "A fat, freshly picked pumpkin. This one has a face carved into it! This one has large, round eyes and a squiggly, cat-like smiling mouth. Its pleasantly surprised expression seems to suggest that the pumpkin has noticed something about you."
icon_state = "decor-jackolantern-owo"
// VOREStation Edit End