mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 18:22:39 +00:00
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:
@@ -49,9 +49,12 @@ rcd light flash thingy on matter drain
|
||||
set category = "Malfunction"
|
||||
set name = "Upgrade Turrets"
|
||||
usr.verbs -= /client/proc/upgrade_turrets
|
||||
for(var/obj/machinery/turret/turret in player_list)
|
||||
turret.health += 30
|
||||
turret.shot_delay = 20
|
||||
for(var/obj/machinery/porta_turret/turret in machines)
|
||||
var/turf/T = get_turf(turret)
|
||||
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
|
||||
module_name = "RCD disable"
|
||||
|
||||
@@ -20,26 +20,14 @@
|
||||
throw_speed = 4
|
||||
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)
|
||||
//var/ending = copytext(msg, length(msg))
|
||||
timestamp += timerecorded
|
||||
/*
|
||||
if(M.stuttering)
|
||||
storedinfo += "\[[time2text(timerecorded*10,"mm:ss")]\] [M.name] stammers, \"[msg]\""
|
||||
return
|
||||
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
|
||||
*/
|
||||
|
||||
if(speaking)
|
||||
storedinfo += "\[[time2text(timerecorded*10,"mm:ss")]\] [M.name] [speaking.format_message_plain(msg, verb)]"
|
||||
else
|
||||
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)
|
||||
..()
|
||||
|
||||
@@ -186,6 +186,7 @@ var/global/floorIsLava = 0
|
||||
var/f = 1
|
||||
for(var/k in all_languages)
|
||||
var/datum/language/L = all_languages[k]
|
||||
if(!(L.flags & INNATE))
|
||||
if(!f) body += " | "
|
||||
else f = 0
|
||||
if(L in M.languages)
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
//They can be healed with plastic or metal sheeting.
|
||||
|
||||
/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/damtype = BURN // Punctured or melted
|
||||
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/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/breach_threshold = 3 // Min damage before a breach is possible.
|
||||
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. Damage is subtracted by this amount, it determines the "hardness" of the suit.
|
||||
var/damage = 0 // Current total damage
|
||||
var/brute_damage = 0 // Specifically brute damage.
|
||||
var/burn_damage = 0 // Specifically burn damage.
|
||||
@@ -44,7 +44,7 @@ var/global/list/breach_burn_descriptors = list(
|
||||
/datum/breach/proc/update_descriptor()
|
||||
|
||||
//Sanity...
|
||||
class = max(1,min(class,5))
|
||||
class = between(1, round(class), 5)
|
||||
//Apply the correct descriptor.
|
||||
if(damtype == BURN)
|
||||
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)
|
||||
|
||||
if(!can_breach || !amount)
|
||||
amount -= src.breach_threshold
|
||||
amount *= src.resilience
|
||||
|
||||
if(!can_breach || amount <= 0)
|
||||
return
|
||||
|
||||
if(!breaches)
|
||||
@@ -98,14 +101,14 @@ var/global/list/breach_burn_descriptors = list(
|
||||
var/turf/T = get_turf(src)
|
||||
if(!T) return
|
||||
|
||||
amount = amount * src.resilience
|
||||
|
||||
//Increase existing breaches.
|
||||
for(var/datum/breach/existing in breaches)
|
||||
|
||||
if(existing.damtype != damtype)
|
||||
continue
|
||||
|
||||
//keep in mind that 10 breach damage == full pressure loss.
|
||||
//a breach can have at most 5 breach damage
|
||||
if (existing.class < 5)
|
||||
var/needs = 5 - existing.class
|
||||
if(amount < needs)
|
||||
|
||||
@@ -686,11 +686,12 @@
|
||||
/obj/item/weapon/rig/proc/malfunction()
|
||||
return 0
|
||||
|
||||
/obj/item/weapon/rig/emp_act(severity)
|
||||
malfunctioning += severity*10
|
||||
/obj/item/weapon/rig/emp_act(severity_class)
|
||||
//class 1 severity is the most severe, not least.
|
||||
malfunctioning += round(30/severity_class)
|
||||
if(malfunction_delay <= 0)
|
||||
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)
|
||||
if (electrocute_mob(user, cell, src))
|
||||
@@ -699,11 +700,13 @@
|
||||
return 0
|
||||
|
||||
/obj/item/weapon/rig/proc/take_hit(damage,source)
|
||||
|
||||
if(!installed_modules.len)
|
||||
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.
|
||||
if(source != "electrical pulse")
|
||||
var/protection = chest? chest.breach_threshold : 0
|
||||
if(!prob(max(0, damage - protection)))
|
||||
return
|
||||
|
||||
var/list/valid_modules = list()
|
||||
|
||||
@@ -39,7 +39,9 @@
|
||||
flags_inv = HIDEJUMPSUIT|HIDETAIL
|
||||
flags = STOPPRESSUREDAMAGE | THICKMATERIAL | AIRTIGHT
|
||||
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
|
||||
sprite_sheets = list("Tajara" = 'icons/mob/species/tajaran/suit.dmi',"Unathi" = 'icons/mob/species/unathi/suit.dmi')
|
||||
supporting_limbs = list()
|
||||
|
||||
@@ -48,6 +48,7 @@
|
||||
)
|
||||
|
||||
//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
|
||||
can_breach = 1
|
||||
|
||||
|
||||
@@ -88,6 +88,9 @@
|
||||
/datum/language/proc/format_message(message, verb)
|
||||
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)
|
||||
return "[verb], <span class='[colour]'>\"[capitalize(message)]\"</span>"
|
||||
|
||||
@@ -121,11 +124,14 @@
|
||||
name = "Noise"
|
||||
desc = "Noises"
|
||||
key = ""
|
||||
flags = RESTRICTED|NONGLOBAL|INNATE|NO_TALK_MSG
|
||||
flags = RESTRICTED|NONGLOBAL|INNATE|NO_TALK_MSG|NO_STUTTER
|
||||
|
||||
/datum/language/noise/format_message(message, verb)
|
||||
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)
|
||||
return "<span class='[colour]'>[message]</span>"
|
||||
|
||||
|
||||
@@ -37,6 +37,8 @@
|
||||
else
|
||||
message = copytext(message,3)
|
||||
|
||||
message = trim_left(message)
|
||||
|
||||
//parse the language code and consume it
|
||||
var/datum/language/speaking = parse_language(message)
|
||||
if(speaking)
|
||||
@@ -62,6 +64,7 @@
|
||||
message = trim(message)
|
||||
|
||||
if(speech_problem_flag)
|
||||
if(!speaking || !(speaking.flags & NO_STUTTER))
|
||||
var/list/handle_r = handle_speech_problems(message)
|
||||
message = handle_r[1]
|
||||
verb = handle_r[2]
|
||||
|
||||
@@ -22,10 +22,11 @@ proc/toggle_move_stars(zlevel, direction)
|
||||
|
||||
if (moving_levels["zlevel"] != gen_dir)
|
||||
moving_levels["zlevel"] = gen_dir
|
||||
for(var/turf/space/S in world)
|
||||
if(S.z == zlevel)
|
||||
for(var/x = 1 to world.maxx)
|
||||
for(var/y = 1 to world.maxy)
|
||||
spawn(0)
|
||||
var/turf/T = S
|
||||
var/turf/space/T = locate(x,y,zlevel)
|
||||
if (T)
|
||||
if(!gen_dir)
|
||||
T.icon_state = "[((T.x + T.y) ^ ~(T.x * T.y) + T.z) % 25]"
|
||||
else
|
||||
|
||||
@@ -76,9 +76,9 @@
|
||||
/obj/effect/map/ship/proc/decelerate()
|
||||
if(!is_still() && can_burn())
|
||||
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])
|
||||
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
|
||||
|
||||
/obj/effect/map/ship/proc/accelerate(direction)
|
||||
|
||||
@@ -1148,44 +1148,9 @@
|
||||
|
||||
|
||||
// Set channels depending on how much charge we have left
|
||||
|
||||
// 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
|
||||
update_channels()
|
||||
|
||||
// now trickle-charge the cell
|
||||
|
||||
lastused_charging = 0 // Clear the variable for new use.
|
||||
if(src.attempt_charging())
|
||||
if(excess > 0) // check to make sure we have enough to charge
|
||||
@@ -1222,7 +1187,6 @@
|
||||
chargecount = 0
|
||||
|
||||
else // no cell, switch everything off
|
||||
|
||||
charging = 0
|
||||
chargecount = 0
|
||||
equipment = autoset(equipment, 0)
|
||||
@@ -1232,13 +1196,48 @@
|
||||
autoflag = 0
|
||||
|
||||
// update icon & area power if anything changed
|
||||
|
||||
if(last_lt != lighting || last_eq != equipment || last_en != environ)
|
||||
queue_icon_update()
|
||||
update()
|
||||
else if (last_ch != charging)
|
||||
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)
|
||||
// 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)
|
||||
if(occupier)
|
||||
occupier.emp_act(severity)
|
||||
|
||||
lighting = 0
|
||||
equipment = 0
|
||||
environ = 0
|
||||
update()
|
||||
|
||||
spawn(600)
|
||||
equipment = 3
|
||||
environ = 3
|
||||
update_channels()
|
||||
update()
|
||||
..()
|
||||
|
||||
/obj/machinery/power/apc/ex_act(severity)
|
||||
|
||||
@@ -631,6 +631,7 @@ var/list/be_special_flags = 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 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
|
||||
#define ZONE_ACTIVE 1
|
||||
|
||||
Reference in New Issue
Block a user