Merge branch 'dev' of https://github.com/Baystation12/Baystation12 into docking-update

This commit is contained in:
mwerezak
2015-04-03 15:14:44 -04:00
25 changed files with 747 additions and 673 deletions

View File

@@ -29,8 +29,6 @@
if (source.total_moles < MINIMUM_MOLES_TO_PUMP) //if we cant transfer enough gas just stop to avoid further processing
return -1
//var/source_moles_initial = source.total_moles
if (isnull(transfer_moles))
transfer_moles = source.total_moles
else
@@ -69,6 +67,40 @@
return power_draw
//Gas 'pumping' proc for the case where the gas flow is passive and driven entirely by pressure differences (but still one-way).
/proc/pump_gas_passive(var/obj/machinery/M, var/datum/gas_mixture/source, var/datum/gas_mixture/sink, var/transfer_moles = null)
if (source.total_moles < MINIMUM_MOLES_TO_PUMP) //if we cant transfer enough gas just stop to avoid further processing
return -1
if (isnull(transfer_moles))
transfer_moles = source.total_moles
else
transfer_moles = min(source.total_moles, transfer_moles)
var/equalize_moles = calculate_equalize_moles(source, sink)
transfer_moles = min(transfer_moles, equalize_moles)
if (transfer_moles < MINIMUM_MOLES_TO_PUMP) //if we cant transfer enough gas just stop to avoid further processing
return -1
//Update flow rate meter
if (istype(M, /obj/machinery/atmospherics))
var/obj/machinery/atmospherics/A = M
A.last_flow_rate = (transfer_moles/source.total_moles)*source.volume //group_multiplier gets divided out here
if (A.debug)
A.visible_message("[A]: moles transferred = [transfer_moles] mol")
if (istype(M, /obj/machinery/portable_atmospherics))
var/obj/machinery/portable_atmospherics/P = M
P.last_flow_rate = (transfer_moles/source.total_moles)*source.volume //group_multiplier gets divided out here
var/datum/gas_mixture/removed = source.remove(transfer_moles)
if(!removed) //Just in case
return -1
sink.merge(removed)
return 0
//Generalized gas scrubbing proc.
//Selectively moves specified gasses one gas_mixture to another and returns the amount of power needed (assuming 1 second), or -1 if no gas was filtered.
//filtering - A list of gasids to be scrubbed from source
@@ -392,12 +424,25 @@
return specific_power
//Calculates the APPROXIMATE amount of moles that would need to be transferred to change the pressure of sink by pressure_delta
//If set, sink_volume_mod adjusts the effective output volume used in the calculation. This is useful when the output gas_mixture is
//If set, sink_volume_mod adjusts the effective output volume used in the calculation. This is useful when the output gas_mixture is
//part of a pipenetwork, and so it's volume isn't representative of the actual volume since the gas will be shared across the pipenetwork when it processes.
/proc/calculate_transfer_moles(datum/gas_mixture/source, datum/gas_mixture/sink, var/pressure_delta, var/sink_volume_mod=0)
//Make the approximation that the sink temperature is unchanged after transferring gas
var/air_temperature = (sink.temperature > 0)? sink.temperature : source.temperature
var/output_volume = (sink.volume * sink.group_multiplier) + sink_volume_mod
//get the number of moles that would have to be transfered to bring sink to the target pressure
return pressure_delta*output_volume/(air_temperature * R_IDEAL_GAS_EQUATION)
return pressure_delta*output_volume/(air_temperature * R_IDEAL_GAS_EQUATION)
//Calculates the APPROXIMATE amount of moles that would need to be transferred to bring source and sink to the same pressure
/proc/calculate_equalize_moles(datum/gas_mixture/source, datum/gas_mixture/sink)
if(source.temperature == 0) return 0
//Make the approximation that the sink temperature is unchanged after transferring gas
var/source_volume = source.volume * source.group_multiplier
var/sink_volume = sink.volume * sink.group_multiplier
var/source_pressure = source.return_pressure()
var/sink_pressure = sink.return_pressure()
return (source_pressure - sink_pressure)/(R_IDEAL_GAS_EQUATION * (source.temperature/source_volume + sink.temperature/sink_volume))

View File

@@ -80,7 +80,7 @@
transfer_moles = min(transfer_moles, calculate_transfer_moles(air1, air2, pressure_delta, (network2)? network2.volume : 0))
//pump_gas() will return a negative number if no flow occurred
returnval = pump_gas(src, air1, air2, transfer_moles, available_power=0) //available_power=0 means we only move gas if it would flow naturally
returnval = pump_gas_passive(src, air1, air2, transfer_moles)
if (returnval >= 0)
if(network1)

View File

@@ -54,8 +54,8 @@
. = 1
if(fruit && fruit.len)
var/list/checklist = list()
for(var/fruittype in fruit) // I do not trust Copy().
checklist[fruittype] = fruit[fruittype]
// You should trust Copy().
checklist = fruit.Copy()
for(var/obj/item/weapon/reagent_containers/food/snacks/grown/G in container)
if(!G.seed || !G.seed.kitchen_tag || isnull(checklist[G.seed.kitchen_tag]))
continue
@@ -73,15 +73,15 @@
. = 1
if (items && items.len)
var/list/checklist = list()
for(var/item_type in items)
checklist |= item_type //Still don't trust Copy().
checklist = items.Copy() // You should really trust Copy
for(var/obj/O in container)
if(istype(O,/obj/item/weapon/reagent_containers/food/snacks/grown))
continue // Fruit is handled in check_fruit().
var/found = 0
for(var/item_type in checklist)
for(var/i = 1; i < checklist.len+1; i++)
var/item_type = checklist[i]
if (istype(O,item_type))
checklist-=item_type
checklist.Cut(i, i+1)
found = 1
break
if (!found)

View File

@@ -8,6 +8,7 @@
var/valve_open = 0
var/release_pressure = ONE_ATMOSPHERE
var/release_flow_rate = ATMOS_DEFAULT_VOLUME_PUMP //in L/s
var/canister_color = "yellow"
var/can_label = 1
@@ -193,21 +194,15 @@ update_flag
environment = loc.return_air()
var/env_pressure = environment.return_pressure()
var/pressure_delta = min(release_pressure - env_pressure, (air_contents.return_pressure() - env_pressure)/2)
//Can not have a pressure delta that would cause environment pressure > tank pressure
var/pressure_delta = release_pressure - env_pressure
var/transfer_moles = 0
if((air_contents.temperature > 0) && (pressure_delta > 0))
transfer_moles = pressure_delta*environment.volume/(air_contents.temperature * R_IDEAL_GAS_EQUATION)
var/transfer_moles = calculate_transfer_moles(air_contents, environment, pressure_delta)
transfer_moles = min(transfer_moles, (release_flow_rate/air_contents.volume)*air_contents.total_moles) //flow rate limit
//Actually transfer the gas
var/datum/gas_mixture/removed = air_contents.remove(transfer_moles)
if(holding)
environment.merge(removed)
else
loc.assume_air(removed)
src.update_icon()
var/returnval = pump_gas_passive(src, air_contents, environment, transfer_moles)
if(returnval >= 0)
src.update_icon()
if(air_contents.return_pressure() < 1)
can_label = 1

View File

@@ -187,6 +187,11 @@
anchored = 1
state = 20//So it doesn't interact based on the above. Not really necessary.
/obj/structure/AIcore/deactivated/Del()
if(src in empty_playable_ai_cores)
empty_playable_ai_cores -= src
..()
/obj/structure/AIcore/deactivated/proc/load_ai(var/mob/living/silicon/ai/transfer, var/obj/item/device/aicard/card, var/mob/user)
if(!istype(transfer) || locate(/mob/living/silicon/ai) in src)

View File

@@ -869,7 +869,8 @@ var/list/admin_verbs_mentor = list(
var/job = input("Please select job slot to free", "Free job slot") as null|anything in jobs
if (job)
job_master.FreeRole(job)
return
message_admins("A job slot for [job] has been opened by [key_name_admin(usr)]")
return
/client/proc/toggleattacklogs()
set name = "Toggle Attack Log Messages"

View File

@@ -134,18 +134,18 @@
verbs |= /obj/item/weapon/rig/proc/toggle_chest
for(var/obj/item/piece in list(gloves,helmet,boots,chest))
if(!piece)
if(!istype(piece))
continue
piece.canremove = 0
piece.name = "[suit_type] [initial(piece.name)]"
piece.desc = "It seems to be part of a [src.name]."
piece.icon_state = "[initial(icon_state)]"
piece.armor = armor.Copy()
piece.min_cold_protection_temperature = min_cold_protection_temperature
piece.max_heat_protection_temperature = max_heat_protection_temperature
piece.siemens_coefficient = siemens_coefficient
piece.permeability_coefficient = permeability_coefficient
piece.unacidable = unacidable
if(islist(armor)) piece.armor = armor.Copy()
update_icon(1)
@@ -631,14 +631,15 @@
use_obj.loc = src
else if (deploy_mode != ONLY_RETRACT)
if(check_slot)
if(check_slot != use_obj)
H << "<span class='danger'>You are unable to deploy \the [piece] as \the [check_slot] [check_slot.gender == PLURAL ? "are" : "is"] in the way.</span>"
return
if(check_slot && check_slot != use_obj)
H << "<span class='danger'>You are unable to deploy \the [piece] as \the [check_slot] [check_slot.gender == PLURAL ? "are" : "is"] in the way.</span>"
return
else
H << "<font color='blue'><b>Your [use_obj.name] [use_obj.gender == PLURAL ? "deploy" : "deploys"] swiftly.</b></span>"
use_obj.loc = H
H.equip_to_slot(use_obj, equip_to)
if(!H.equip_to_slot_if_possible(use_obj, equip_to, 0))
use_obj.loc = src
else
H << "<font color='blue'><b>Your [use_obj.name] [use_obj.gender == PLURAL ? "deploy" : "deploys"] swiftly.</b></span>"
if(piece == "helmet" && helmet)
helmet.update_light(H)

View File

@@ -59,20 +59,10 @@ var/global/list/severity_to_string = list(EVENT_LEVEL_MUNDANE = "Mundane", EVENT
var/list/possible_events = list()
for(var/datum/event_meta/EM in available_events)
var/event_weight = EM.get_weight(active_with_role)
if(EM.enabled && event_weight)
var/event_weight = get_weight(EM, active_with_role)
if(event_weight)
possible_events[EM] = event_weight
for(var/event_meta in last_event_time) if(possible_events[event_meta])
var/time_passed = world.time - event_last_fired[event_meta]
var/weight_modifier = max(0, (config.expected_round_length - time_passed) / 300)
var/new_weight = max(possible_events[event_meta] - weight_modifier, 0)
if(new_weight)
possible_events[event_meta] = new_weight
else
possible_events -= event_meta
if(possible_events.len == 0)
return null
@@ -81,6 +71,19 @@ var/global/list/severity_to_string = list(EVENT_LEVEL_MUNDANE = "Mundane", EVENT
available_events -= picked_event
return picked_event
/datum/event_container/proc/get_weight(var/datum/event_meta/EM, var/list/active_with_role)
if(!EM.enabled)
return 0
var/weight = EM.get_weight(active_with_role)
var/last_time = last_event_time[EM]
if(last_time)
var/time_passed = world.time - last_time
var/weight_modifier = max(0, round((config.expected_round_length - time_passed) / 300))
weight = weight - weight_modifier
return weight
/datum/event_container/proc/set_event_delay()
// If the next event time has not yet been set and we have a custom first time start
if(next_event_time == 0 && config.event_first_run[severity])

View File

@@ -89,6 +89,7 @@
html += "<h2>Available [severity_to_string[selected_event_container.severity]] Events (queued & running events will not be displayed)</h2>"
html += "<table[table_options]>"
html += "<tr><td[row_options2]>Name </td><td>Weight </td><td>MinWeight </td><td>MaxWeight </td><td>OneShot </td><td>Enabled </td><td><span class='alert'>CurrWeight </span></td><td>Remove</td></tr>"
var/list/active_with_role = number_active_with_role()
for(var/datum/event_meta/EM in selected_event_container.available_events)
html += "<tr>"
html += "<td>[EM.name]</td>"
@@ -97,7 +98,7 @@
html += "<td>[EM.max_weight]</td>"
html += "<td><A align='right' href='?src=\ref[src];toggle_oneshot=\ref[EM]'>[EM.one_shot]</A></td>"
html += "<td><A align='right' href='?src=\ref[src];toggle_enabled=\ref[EM]'>[EM.enabled]</A></td>"
html += "<td><span class='alert'>[EM.get_weight(number_active_with_role())]</span></td>"
html += "<td><span class='alert'>[selected_event_container.get_weight(EM, active_with_role)]</span></td>"
html += "<td><A align='right' href='?src=\ref[src];remove=\ref[EM];EC=\ref[selected_event_container]'>Remove</A></td>"
html += "</tr>"
html += "</table>"

View File

@@ -35,6 +35,11 @@
die_off()
return 0
for(var/obj/effect/effect/smoke/chem/smoke in view(1, src))
if(smoke.reagents.has_reagent("plantbgone"))
die_off()
return
// Handle life.
var/turf/simulated/T = get_turf(src)
if(istype(T))

View File

@@ -98,22 +98,22 @@
// Beneficial reagents also have values for modifying yield_mod and mut_mod (in that order).
var/global/list/beneficial_reagents = list(
"beer" = list( -0.05, 0, 0 ),
"fluorine" = list( -2, 0, 0 ),
"chlorine" = list( -1, 0, 0 ),
"phosphorus" = list( -0.75, 0, 0 ),
"sodawater" = list( 0.1, 0, 0 ),
"sacid" = list( -1, 0, 0 ),
"pacid" = list( -2, 0, 0 ),
"plantbgone" = list( -2, 0, 0.2 ),
"cryoxadone" = list( 3, 0, 0 ),
"ammonia" = list( 0.5, 0, 0 ),
"diethylamine" = list( 1, 0, 0 ),
"nutriment" = list( 0.5, 0.1, 0 ),
"radium" = list( -1.5, 0, 0.2 ),
"adminordrazine" = list( 1, 1, 1 ),
"robustharvest" = list( 0, 0.2, 0 ),
"left4zed" = list( 0, 0, 0.2 )
"beer" = list( -0.05, 0, 0 ),
"fluorine" = list( -2, 0, 0 ),
"chlorine" = list( -1, 0, 0 ),
"phosphorus" = list( -0.75, 0, 0 ),
"sodawater" = list( 0.1, 0, 0 ),
"sacid" = list( -1, 0, 0 ),
"pacid" = list( -2, 0, 0 ),
"plantbgone" = list( -2, 0, 0.2),
"cryoxadone" = list( 3, 0, 0 ),
"ammonia" = list( 0.5, 0, 0 ),
"diethylamine" = list( 1, 0, 0 ),
"nutriment" = list( 0.5, 0.1, 0 ),
"radium" = list( -1.5, 0, 0.2),
"adminordrazine" = list( 1, 1, 1 ),
"robustharvest" = list( 0, 0.2, 0 ),
"left4zed" = list( 0, 0, 0.2)
)
// Mutagen list specifies minimum value for the mutation to take place, rather

View File

@@ -1,5 +1,10 @@
/obj/machinery/portable_atmospherics/hydroponics/process()
// Handle nearby smoke if any.
for(var/obj/effect/effect/smoke/chem/smoke in view(1, src))
if(smoke.reagents.total_volume)
smoke.reagents.copy_to(src, 5)
//Do this even if we're not ready for a plant cycle.
process_reagents()

View File

@@ -227,7 +227,7 @@
chance = !hand ? 40 : 20
if (prob(chance))
visible_message("<spawn class=danger>[src]'s [W] goes off during struggle!")
visible_message("<span class='danger'>[src]'s [W] goes off during struggle!</span>")
var/list/turfs = list()
for(var/turf/T in view())
turfs += T

View File

@@ -192,10 +192,11 @@ This saves us from having to call add_fingerprint() any time something is put in
//This is an UNSAFE proc. Use mob_can_equip() before calling this one! Or rather use equip_to_slot_if_possible() or advanced_equip_to_slot_if_possible()
//set redraw_mob to 0 if you don't wish the hud to be updated - if you're doing it manually in your own proc.
/mob/living/carbon/human/equip_to_slot(obj/item/W as obj, slot, redraw_mob = 1)
if(!slot) return
if(!istype(W)) return
if(!has_organ_for_slot(slot)) return
if(!species || !species.hud || !(slot in species.hud.equip_slots)) return
W.loc = src
switch(slot)
if(slot_back)
@@ -314,7 +315,7 @@ This saves us from having to call add_fingerprint() any time something is put in
W.layer = 20
return
return 1
/*
MouseDrop human inventory menu

View File

@@ -92,6 +92,7 @@
if(health < 1)
death()
return
if(health > maxHealth)
health = maxHealth

View File

@@ -167,11 +167,19 @@
playsound(user, fire_sound, 10, 1)
else
playsound(user, fire_sound, 50, 1)
user.visible_message(
"<span class='danger'>[user] fires [src][pointblank ? " point blank at [target]":""][reflex ? " by reflex":""]!</span>",
"<span class='warning'>You fire [src][reflex ? "by reflex":""]!</span>",
"You hear a [fire_sound_text]!"
)
if(reflex)
user.visible_message(
"<span class='reflex_shoot'><b>[user] fires [src][pointblank ? " point blank at [target]":""] by reflex!<b></span>",
"<span class='reflex_shoot'>You fire [src] by reflex]!</span>",
"You hear a [fire_sound_text]!"
)
else
user.visible_message(
"<span class='danger'>[user] fires [src][pointblank ? " point blank at [target]":""]!</span>",
"<span class='warning'>You fire [src]!</span>",
"You hear a [fire_sound_text]!"
)
if(recoil)
spawn()

View File

@@ -2,7 +2,7 @@
name = "temperature gun"
icon_state = "freezegun"
fire_sound = 'sound/weapons/pulse3.ogg'
desc = "A gun that changes temperatures."
desc = "A gun that changes temperatures. It has a small label on the side, 'More extreme temperatures will cost more charge!'"
var/temperature = T20C
var/current_temperature = T20C
charge_cost = 100
@@ -10,7 +10,7 @@
slot_flags = SLOT_BELT|SLOT_BACK
projectile_type = /obj/item/projectile/temp
cell_type = /obj/item/weapon/cell/crap
cell_type = /obj/item/weapon/cell/high
/obj/item/weapon/gun/energy/temperature/New()

View File

@@ -62,7 +62,7 @@
/obj/item/weapon/gun/projectile/automatic/sts35/update_icon()
..()
icon_state = (ammo_magazine)? "arifle-0" : "arifle"
icon_state = (ammo_magazine)? "arifle" : "arifle-empty"
update_held_icon()
/obj/item/weapon/gun/projectile/automatic/wt550

View File

@@ -779,6 +779,9 @@
continue
var/remaining_volume = beaker.reagents.maximum_volume - beaker.reagents.total_volume
if(remaining_volume <= 0)
break
if(sheet_reagents[O.type])
var/obj/item/stack/stack = O
if(istype(stack))
@@ -788,10 +791,11 @@
beaker.reagents.add_reagent(sheet_reagents[stack.type], (amount_to_take*REAGENTS_PER_SHEET))
continue
O.reagents.trans_to(beaker, min(O.reagents.total_volume, remaining_volume))
if(O.reagents.total_volume == 0)
remove_object(O)
if (beaker.reagents.total_volume >= beaker.reagents.maximum_volume)
break
if(O.reagents)
O.reagents.trans_to(beaker, min(O.reagents.total_volume, remaining_volume))
if(O.reagents.total_volume == 0)
remove_object(O)
if (beaker.reagents.total_volume >= beaker.reagents.maximum_volume)
break
#undef REAGENTS_PER_SHEET

View File

@@ -1849,12 +1849,9 @@ datum
var/obj/effect/alien/weeds/alien_weeds = O
alien_weeds.health -= rand(15,35) // Kills alien weeds pretty fast
alien_weeds.healthcheck()
else if(istype(O,/obj/effect/plant)) //even a small amount is enough to kill it
del(O)
else if(istype(O,/obj/effect/plant))
if(prob(50))
var/obj/effect/plant/plant = O
plant.die_off()
var/obj/effect/plant/plant = O
plant.die_off()
else if(istype(O,/obj/machinery/portable_atmospherics/hydroponics))
var/obj/machinery/portable_atmospherics/hydroponics/tray = O

View File

@@ -78,6 +78,8 @@ h1.alert, h2.alert {color: #000000;}
.alium {color: #00ff00;}
.cult {color: #800080; font-weight: bold; font-style: italic;}
.reflex_shoot {color: #000099; font-style: italic;}
/* Languages */
.alien {color: #543354;}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 27 KiB

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 29 KiB

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 48 KiB

After

Width:  |  Height:  |  Size: 48 KiB

File diff suppressed because it is too large Load Diff