Merge remote-tracking branch 'upstream/master' into dev-freeze

Conflicts:
	code/modules/hydroponics/seed_datums.dm
	code/modules/hydroponics/trays/tray_apiary.dm
	code/modules/power/apc.dm
	code/setup.dm
This commit is contained in:
PsiOmega
2015-02-27 08:58:55 +01:00
13 changed files with 114 additions and 100 deletions

View File

@@ -49,9 +49,12 @@ rcd light flash thingy on matter drain
set category = "Malfunction" set category = "Malfunction"
set name = "Upgrade Turrets" set name = "Upgrade Turrets"
usr.verbs -= /client/proc/upgrade_turrets usr.verbs -= /client/proc/upgrade_turrets
for(var/obj/machinery/turret/turret in player_list) for(var/obj/machinery/porta_turret/turret in machines)
turret.health += 30 var/turf/T = get_turf(turret)
turret.shot_delay = 20 if(T.z in config.station_levels)
// Increase health by 37.5% of original max, decrease delays between shots to 66%
turret.health += initial(turret.health) * 3 / 8
turret.shot_delay = initial(turret.shot_delay) * 2 / 3
/datum/AI_Module/large/disable_rcd /datum/AI_Module/large/disable_rcd
module_name = "RCD disable" module_name = "RCD disable"

View File

@@ -20,26 +20,14 @@
throw_speed = 4 throw_speed = 4
throw_range = 20 throw_range = 20
/obj/item/device/taperecorder/hear_talk(mob/living/M as mob, msg, var/verb="says") /obj/item/device/taperecorder/hear_talk(mob/living/M as mob, msg, var/verb="says", datum/language/speaking=null)
if(recording) if(recording)
//var/ending = copytext(msg, length(msg)) timestamp += timerecorded
timestamp+= timerecorded
/* if(speaking)
if(M.stuttering) storedinfo += "\[[time2text(timerecorded*10,"mm:ss")]\] [M.name] [speaking.format_message_plain(msg, verb)]"
storedinfo += "\[[time2text(timerecorded*10,"mm:ss")]\] [M.name] stammers, \"[msg]\"" else
return storedinfo += "\[[time2text(timerecorded*10,"mm:ss")]\] [M.name] [verb], \"[msg]\""
if(M.getBrainLoss() >= 60)
storedinfo += "\[[time2text(timerecorded*10,"mm:ss")]\] [M.name] gibbers, \"[msg]\""
return
if(ending == "?")
storedinfo += "\[[time2text(timerecorded*10,"mm:ss")]\] [M.name] asks, \"[msg]\""
return
else if(ending == "!")
storedinfo += "\[[time2text(timerecorded*10,"mm:ss")]\] [M.name] exclaims, \"[msg]\""
return
*/
storedinfo += "\[[time2text(timerecorded*10,"mm:ss")]\] [M.name] [verb], \"[msg]\""
return
/obj/item/device/taperecorder/attackby(obj/item/weapon/W as obj, mob/user as mob) /obj/item/device/taperecorder/attackby(obj/item/weapon/W as obj, mob/user as mob)
..() ..()

View File

@@ -186,12 +186,13 @@ var/global/floorIsLava = 0
var/f = 1 var/f = 1
for(var/k in all_languages) for(var/k in all_languages)
var/datum/language/L = all_languages[k] var/datum/language/L = all_languages[k]
if(!f) body += " | " if(!(L.flags & INNATE))
else f = 0 if(!f) body += " | "
if(L in M.languages) else f = 0
body += "<a href='?src=\ref[src];toglang=\ref[M];lang=[html_encode(k)]' style='color:#006600'>[k]</a>" if(L in M.languages)
else body += "<a href='?src=\ref[src];toglang=\ref[M];lang=[html_encode(k)]' style='color:#006600'>[k]</a>"
body += "<a href='?src=\ref[src];toglang=\ref[M];lang=[html_encode(k)]' style='color:#ff0000'>[k]</a>" else
body += "<a href='?src=\ref[src];toglang=\ref[M];lang=[html_encode(k)]' style='color:#ff0000'>[k]</a>"
body += {"<br> body += {"<br>
</body></html> </body></html>

View File

@@ -3,7 +3,7 @@
//They can be healed with plastic or metal sheeting. //They can be healed with plastic or metal sheeting.
/datum/breach /datum/breach
var/class = 0 // Size. Lower is smaller. var/class = 0 // Size. Lower is smaller. Uses floating point values!
var/descriptor // 'gaping hole' etc. var/descriptor // 'gaping hole' etc.
var/damtype = BURN // Punctured or melted var/damtype = BURN // Punctured or melted
var/obj/item/clothing/suit/space/holder // Suit containing the list of breaches holding this instance. var/obj/item/clothing/suit/space/holder // Suit containing the list of breaches holding this instance.
@@ -12,8 +12,8 @@
var/can_breach = 1 // Set to 0 to disregard all breaching. var/can_breach = 1 // Set to 0 to disregard all breaching.
var/list/breaches = list() // Breach datum container. var/list/breaches = list() // Breach datum container.
var/resilience = 0.2 // Multiplier that turns damage into breach class. 1 is 100% of damage to breach, 0.1 is 10%. var/resilience = 0.2 // Multiplier that turns damage into breach class. 1 is 100% of damage to breach, 0.1 is 10%. 0.2 -> 50 brute/burn damage to cause 10 breach damage
var/breach_threshold = 3 // Min damage before a breach is possible. var/breach_threshold = 3 // Min damage before a breach is possible. Damage is subtracted by this amount, it determines the "hardness" of the suit.
var/damage = 0 // Current total damage var/damage = 0 // Current total damage
var/brute_damage = 0 // Specifically brute damage. var/brute_damage = 0 // Specifically brute damage.
var/burn_damage = 0 // Specifically burn damage. var/burn_damage = 0 // Specifically burn damage.
@@ -44,7 +44,7 @@ var/global/list/breach_burn_descriptors = list(
/datum/breach/proc/update_descriptor() /datum/breach/proc/update_descriptor()
//Sanity... //Sanity...
class = max(1,min(class,5)) class = between(1, round(class), 5)
//Apply the correct descriptor. //Apply the correct descriptor.
if(damtype == BURN) if(damtype == BURN)
descriptor = breach_burn_descriptors[class] descriptor = breach_burn_descriptors[class]
@@ -86,7 +86,10 @@ var/global/list/breach_burn_descriptors = list(
/obj/item/clothing/suit/space/proc/create_breaches(var/damtype, var/amount) /obj/item/clothing/suit/space/proc/create_breaches(var/damtype, var/amount)
if(!can_breach || !amount) amount -= src.breach_threshold
amount *= src.resilience
if(!can_breach || amount <= 0)
return return
if(!breaches) if(!breaches)
@@ -98,14 +101,14 @@ var/global/list/breach_burn_descriptors = list(
var/turf/T = get_turf(src) var/turf/T = get_turf(src)
if(!T) return if(!T) return
amount = amount * src.resilience
//Increase existing breaches. //Increase existing breaches.
for(var/datum/breach/existing in breaches) for(var/datum/breach/existing in breaches)
if(existing.damtype != damtype) if(existing.damtype != damtype)
continue continue
//keep in mind that 10 breach damage == full pressure loss.
//a breach can have at most 5 breach damage
if (existing.class < 5) if (existing.class < 5)
var/needs = 5 - existing.class var/needs = 5 - existing.class
if(amount < needs) if(amount < needs)

View File

@@ -686,11 +686,12 @@
/obj/item/weapon/rig/proc/malfunction() /obj/item/weapon/rig/proc/malfunction()
return 0 return 0
/obj/item/weapon/rig/emp_act(severity) /obj/item/weapon/rig/emp_act(severity_class)
malfunctioning += severity*10 //class 1 severity is the most severe, not least.
malfunctioning += round(30/severity_class)
if(malfunction_delay <= 0) if(malfunction_delay <= 0)
malfunction_delay = 20 malfunction_delay = 20
take_hit(severity*10,"electrical pulse") take_hit(round(30/severity_class),"electrical pulse")
/obj/item/weapon/rig/proc/shock(mob/user) /obj/item/weapon/rig/proc/shock(mob/user)
if (electrocute_mob(user, cell, src)) if (electrocute_mob(user, cell, src))
@@ -699,12 +700,14 @@
return 0 return 0
/obj/item/weapon/rig/proc/take_hit(damage,source) /obj/item/weapon/rig/proc/take_hit(damage,source)
if(!installed_modules.len) if(!installed_modules.len)
return return
if(!prob(max(0,(damage-(chest ? chest.breach_threshold : 0))))) //given that module damage is spread out across all modules, even this is probably not enough for emp to affect rigs much.
return if(source != "electrical pulse")
var/protection = chest? chest.breach_threshold : 0
if(!prob(max(0, damage - protection)))
return
var/list/valid_modules = list() var/list/valid_modules = list()
for(var/obj/item/rig_module/module in installed_modules) for(var/obj/item/rig_module/module in installed_modules)

View File

@@ -39,7 +39,9 @@
flags_inv = HIDEJUMPSUIT|HIDETAIL flags_inv = HIDEJUMPSUIT|HIDETAIL
flags = STOPPRESSUREDAMAGE | THICKMATERIAL | AIRTIGHT flags = STOPPRESSUREDAMAGE | THICKMATERIAL | AIRTIGHT
slowdown = 0 slowdown = 0
breach_threshold = 35 //With 0.2 resiliance, will reach 10 breach damage after 9 laser carbine blasts. Completely immune to smg hits.
breach_threshold = 28
resilience = 0.1
can_breach = 1 can_breach = 1
sprite_sheets = list("Tajara" = 'icons/mob/species/tajaran/suit.dmi',"Unathi" = 'icons/mob/species/unathi/suit.dmi') sprite_sheets = list("Tajara" = 'icons/mob/species/tajaran/suit.dmi',"Unathi" = 'icons/mob/species/unathi/suit.dmi')
supporting_limbs = list() supporting_limbs = list()

View File

@@ -48,6 +48,7 @@
) )
//Breach thresholds, should ideally be inherited by most (if not all) voidsuits. //Breach thresholds, should ideally be inherited by most (if not all) voidsuits.
//With 0.2 resiliance, will reach 10 breach damage after 3 laser carbine blasts or 8 smg hits.
breach_threshold = 18 breach_threshold = 18
can_breach = 1 can_breach = 1

View File

@@ -88,6 +88,9 @@
/datum/language/proc/format_message(message, verb) /datum/language/proc/format_message(message, verb)
return "[verb], <span class='message'><span class='[colour]'>\"[capitalize(message)]\"</span></span>" return "[verb], <span class='message'><span class='[colour]'>\"[capitalize(message)]\"</span></span>"
/datum/language/proc/format_message_plain(message, verb)
return "[verb], \"[capitalize(message)]\""
/datum/language/proc/format_message_radio(message, verb) /datum/language/proc/format_message_radio(message, verb)
return "[verb], <span class='[colour]'>\"[capitalize(message)]\"</span>" return "[verb], <span class='[colour]'>\"[capitalize(message)]\"</span>"
@@ -121,11 +124,14 @@
name = "Noise" name = "Noise"
desc = "Noises" desc = "Noises"
key = "" key = ""
flags = RESTRICTED|NONGLOBAL|INNATE|NO_TALK_MSG flags = RESTRICTED|NONGLOBAL|INNATE|NO_TALK_MSG|NO_STUTTER
/datum/language/noise/format_message(message, verb) /datum/language/noise/format_message(message, verb)
return "<span class='message'><span class='[colour]'>[message]</span></span>" return "<span class='message'><span class='[colour]'>[message]</span></span>"
/datum/language/noise/format_message_plain(message, verb)
return message
/datum/language/noise/format_message_radio(message, verb) /datum/language/noise/format_message_radio(message, verb)
return "<span class='[colour]'>[message]</span>" return "<span class='[colour]'>[message]</span>"
@@ -517,4 +523,4 @@
"ve", "wa", "all", "and", "are", "but", "ent", "era", "ere", "eve", "for", "had", "hat", "hen", "her", "hin", "ve", "wa", "all", "and", "are", "but", "ent", "era", "ere", "eve", "for", "had", "hat", "hen", "her", "hin",
"his", "ing", "ion", "ith", "not", "ome", "oul", "our", "sho", "ted", "ter", "tha", "the", "thi") "his", "ing", "ion", "ith", "not", "ome", "oul", "our", "sho", "ted", "ter", "tha", "the", "thi")
#undef SCRAMBLE_CACHE_LEN #undef SCRAMBLE_CACHE_LEN

View File

@@ -37,6 +37,8 @@
else else
message = copytext(message,3) message = copytext(message,3)
message = trim_left(message)
//parse the language code and consume it //parse the language code and consume it
var/datum/language/speaking = parse_language(message) var/datum/language/speaking = parse_language(message)
if(speaking) if(speaking)
@@ -62,10 +64,11 @@
message = trim(message) message = trim(message)
if(speech_problem_flag) if(speech_problem_flag)
var/list/handle_r = handle_speech_problems(message) if(!speaking || !(speaking.flags & NO_STUTTER))
message = handle_r[1] var/list/handle_r = handle_speech_problems(message)
verb = handle_r[2] message = handle_r[1]
speech_problem_flag = handle_r[3] verb = handle_r[2]
speech_problem_flag = handle_r[3]
if(!message || message == "") if(!message || message == "")
return return

View File

@@ -22,17 +22,18 @@ proc/toggle_move_stars(zlevel, direction)
if (moving_levels["zlevel"] != gen_dir) if (moving_levels["zlevel"] != gen_dir)
moving_levels["zlevel"] = gen_dir moving_levels["zlevel"] = gen_dir
for(var/turf/space/S in world) for(var/x = 1 to world.maxx)
if(S.z == zlevel) for(var/y = 1 to world.maxy)
spawn(0) spawn(0)
var/turf/T = S var/turf/space/T = locate(x,y,zlevel)
if(!gen_dir) if (T)
T.icon_state = "[((T.x + T.y) ^ ~(T.x * T.y) + T.z) % 25]" if(!gen_dir)
else T.icon_state = "[((T.x + T.y) ^ ~(T.x * T.y) + T.z) % 25]"
T.icon_state = "speedspace_[gen_dir]_[rand(1,15)]" else
for(var/atom/movable/AM in T) T.icon_state = "speedspace_[gen_dir]_[rand(1,15)]"
if (!AM.anchored) for(var/atom/movable/AM in T)
AM.throw_at(get_step(T,reverse_direction(direction)), 5, 1) if (!AM.anchored)
AM.throw_at(get_step(T,reverse_direction(direction)), 5, 1)
//list used to cache empty zlevels to avoid nedless map bloat //list used to cache empty zlevels to avoid nedless map bloat

View File

@@ -76,9 +76,9 @@
/obj/effect/map/ship/proc/decelerate() /obj/effect/map/ship/proc/decelerate()
if(!is_still() && can_burn()) if(!is_still() && can_burn())
if (speed[1]) if (speed[1])
adjust_speed(-SIGN(speed[1]) * min(get_acceleration(),speed[1]), 0) adjust_speed(-SIGN(speed[1]) * min(get_acceleration(),abs(speed[1])), 0)
if (speed[2]) if (speed[2])
adjust_speed(0, -SIGN(speed[2]) * min(get_acceleration(),speed[2])) adjust_speed(0, -SIGN(speed[2]) * min(get_acceleration(),abs(speed[2])))
last_burn = world.time last_burn = world.time
/obj/effect/map/ship/proc/accelerate(direction) /obj/effect/map/ship/proc/accelerate(direction)

View File

@@ -1148,44 +1148,9 @@
// Set channels depending on how much charge we have left // Set channels depending on how much charge we have left
update_channels()
// Allow the APC to operate as normal if the cell can charge
if(charging && longtermpower < 10)
longtermpower += 1
else if(longtermpower > -10)
longtermpower -= 2
if((cell.percent() > 30) || longtermpower > 0) // Put most likely at the top so we don't check it last, effeciency 101
if(autoflag != 3)
equipment = autoset(equipment, 1)
lighting = autoset(lighting, 1)
environ = autoset(environ, 1)
autoflag = 3
power_alarm.clearAlarm(loc, src)
else if((cell.percent() <= 30) && (cell.percent() > 15) && longtermpower < 0) // <30%, turn off equipment
if(autoflag != 2)
equipment = autoset(equipment, 2)
lighting = autoset(lighting, 1)
environ = autoset(environ, 1)
power_alarm.triggerAlarm(loc, src)
autoflag = 2
else if(cell.percent() <= 15) // <15%, turn off lighting & equipment
if((autoflag > 1 && longtermpower < 0) || (autoflag > 1 && longtermpower >= 0))
equipment = autoset(equipment, 2)
lighting = autoset(lighting, 2)
environ = autoset(environ, 1)
power_alarm.triggerAlarm(loc, src)
autoflag = 1
else // zero charge, turn all off
if(autoflag != 0)
equipment = autoset(equipment, 0)
lighting = autoset(lighting, 0)
environ = autoset(environ, 0)
power_alarm.triggerAlarm(loc, src)
autoflag = 0
// now trickle-charge the cell // now trickle-charge the cell
lastused_charging = 0 // Clear the variable for new use. lastused_charging = 0 // Clear the variable for new use.
if(src.attempt_charging()) if(src.attempt_charging())
if(excess > 0) // check to make sure we have enough to charge if(excess > 0) // check to make sure we have enough to charge
@@ -1222,7 +1187,6 @@
chargecount = 0 chargecount = 0
else // no cell, switch everything off else // no cell, switch everything off
charging = 0 charging = 0
chargecount = 0 chargecount = 0
equipment = autoset(equipment, 0) equipment = autoset(equipment, 0)
@@ -1232,13 +1196,48 @@
autoflag = 0 autoflag = 0
// update icon & area power if anything changed // update icon & area power if anything changed
if(last_lt != lighting || last_eq != equipment || last_en != environ) if(last_lt != lighting || last_eq != equipment || last_en != environ)
queue_icon_update() queue_icon_update()
update() update()
else if (last_ch != charging) else if (last_ch != charging)
queue_icon_update() queue_icon_update()
/obj/machinery/power/apc/proc/update_channels()
// Allow the APC to operate as normal if the cell can charge
if(charging && longtermpower < 10)
longtermpower += 1
else if(longtermpower > -10)
longtermpower -= 2
if((cell.percent() > 30) || longtermpower > 0) // Put most likely at the top so we don't check it last, effeciency 101
if(autoflag != 3)
equipment = autoset(equipment, 1)
lighting = autoset(lighting, 1)
environ = autoset(environ, 1)
autoflag = 3
power_alarm.clearAlarm(loc, src)
else if((cell.percent() <= 30) && (cell.percent() > 15) && longtermpower < 0) // <30%, turn off equipment
if(autoflag != 2)
equipment = autoset(equipment, 2)
lighting = autoset(lighting, 1)
environ = autoset(environ, 1)
power_alarm.triggerAlarm(loc, src)
autoflag = 2
else if(cell.percent() <= 15) // <15%, turn off lighting & equipment
if((autoflag > 1 && longtermpower < 0) || (autoflag > 1 && longtermpower >= 0))
equipment = autoset(equipment, 2)
lighting = autoset(lighting, 2)
environ = autoset(environ, 1)
power_alarm.triggerAlarm(loc, src)
autoflag = 1
else // zero charge, turn all off
if(autoflag != 0)
equipment = autoset(equipment, 0)
lighting = autoset(lighting, 0)
environ = autoset(environ, 0)
power_alarm.triggerAlarm(loc, src)
autoflag = 0
// val 0=off, 1=off(auto) 2=on 3=on(auto) // val 0=off, 1=off(auto) 2=on 3=on(auto)
// on 0=off, 1=on, 2=autooff // on 0=off, 1=on, 2=autooff
@@ -1266,12 +1265,15 @@ obj/machinery/power/apc/proc/autoset(var/val, var/on)
cell.emp_act(severity) cell.emp_act(severity)
if(occupier) if(occupier)
occupier.emp_act(severity) occupier.emp_act(severity)
lighting = 0 lighting = 0
equipment = 0 equipment = 0
environ = 0 environ = 0
update()
spawn(600) spawn(600)
equipment = 3 update_channels()
environ = 3 update()
..() ..()
/obj/machinery/power/apc/ex_act(severity) /obj/machinery/power/apc/ex_act(severity)

View File

@@ -631,6 +631,7 @@ var/list/be_special_flags = list(
#define NONGLOBAL 32 // Do not add to general languages list. #define NONGLOBAL 32 // Do not add to general languages list.
#define INNATE 64 // All mobs can be assumed to speak and understand this language. (audible emotes) #define INNATE 64 // All mobs can be assumed to speak and understand this language. (audible emotes)
#define NO_TALK_MSG 128 // Do not show the "\The [speaker] talks into \the [radio]" message #define NO_TALK_MSG 128 // Do not show the "\The [speaker] talks into \the [radio]" message
#define NO_STUTTER 256 // No stuttering, slurring, or other speech problems
//Flags for zone sleeping //Flags for zone sleeping
#define ZONE_ACTIVE 1 #define ZONE_ACTIVE 1