Merge branch 'master' of https://github.com/Citadel-Station-13/Citadel-Station-13 into Ghommie-cit698
This commit is contained in:
+2
-2
@@ -192,7 +192,7 @@
|
||||
reagents = new()
|
||||
reagents.reagent_list.Add(A)
|
||||
reagents.conditional_update()
|
||||
else if(ismovableatom(A))
|
||||
else if(ismovable(A))
|
||||
var/atom/movable/M = A
|
||||
if(isliving(M.loc))
|
||||
var/mob/living/L = M.loc
|
||||
@@ -692,7 +692,7 @@
|
||||
/atom/vv_get_dropdown()
|
||||
. = ..()
|
||||
VV_DROPDOWN_OPTION("", "---------")
|
||||
if(!ismovableatom(src))
|
||||
if(!ismovable(src))
|
||||
var/turf/curturf = get_turf(src)
|
||||
if(curturf)
|
||||
. += "<option value='?_src_=holder;[HrefToken()];adminplayerobservecoodjump=1;X=[curturf.x];Y=[curturf.y];Z=[curturf.z]'>Jump To</option>"
|
||||
|
||||
@@ -68,7 +68,7 @@
|
||||
if(vs.plane == EMISSIVE_BLOCKER_PLANE)
|
||||
SSvis_overlays.remove_vis_overlay(src, list(vs))
|
||||
break
|
||||
SSvis_overlays.add_vis_overlay(src, icon, icon_state, EMISSIVE_BLOCKER_LAYER, EMISSIVE_BLOCKER_PLANE)
|
||||
SSvis_overlays.add_vis_overlay(src, icon, icon_state, EMISSIVE_BLOCKER_LAYER, EMISSIVE_BLOCKER_PLANE, dir)
|
||||
|
||||
/atom/movable/proc/can_zFall(turf/source, levels = 1, turf/target, direction)
|
||||
if(!direction)
|
||||
@@ -251,8 +251,13 @@
|
||||
|
||||
/atom/movable/proc/throw_impact(atom/hit_atom, datum/thrownthing/throwingdatum)
|
||||
set waitfor = 0
|
||||
SEND_SIGNAL(src, COMSIG_MOVABLE_IMPACT, hit_atom, throwingdatum)
|
||||
return hit_atom.hitby(src, throwingdatum=throwingdatum)
|
||||
var/hitpush = TRUE
|
||||
var/impact_signal = SEND_SIGNAL(src, COMSIG_MOVABLE_IMPACT, hit_atom, throwingdatum)
|
||||
if(impact_signal & COMPONENT_MOVABLE_IMPACT_FLIP_HITPUSH)
|
||||
hitpush = FALSE // hacky, tie this to something else or a proper workaround later
|
||||
|
||||
if(impact_signal & ~COMPONENT_MOVABLE_IMPACT_NEVERMIND) // in case a signal interceptor broke or deleted the thing before we could process our hit
|
||||
return hit_atom.hitby(src, throwingdatum = throwingdatum, hitpush = hitpush)
|
||||
|
||||
/atom/movable/hitby(atom/movable/AM, skipcatch, hitpush = TRUE, blocked, datum/thrownthing/throwingdatum)
|
||||
if(!anchored && hitpush && (!throwingdatum || (throwingdatum.force >= (move_resist * MOVE_FORCE_PUSH_RATIO))))
|
||||
|
||||
@@ -53,7 +53,7 @@
|
||||
restricted_jobs += "Assistant"
|
||||
|
||||
// Set number of Vamps
|
||||
recommended_enemies = CLAMP(round(num_players()/10), 1, 6);
|
||||
recommended_enemies = clamp(round(num_players()/10), 1, 6);
|
||||
|
||||
// Select Antags
|
||||
for(var/i = 0, i < recommended_enemies, i++)
|
||||
@@ -195,7 +195,7 @@
|
||||
return FALSE
|
||||
if(target.stat > UNCONSCIOUS)
|
||||
return FALSE
|
||||
|
||||
|
||||
// Check Overdose: Am I even addicted to blood? Do I even have any in me?
|
||||
//if (!target.reagents.addiction_list || !target.reagents.reagent_list)
|
||||
//message_admins("DEBUG2: can_make_vassal() Abort: No reagents")
|
||||
|
||||
@@ -40,8 +40,10 @@ GLOBAL_VAR_INIT(dynamic_stacking_limit, 90)
|
||||
GLOBAL_LIST_EMPTY(dynamic_forced_roundstart_ruleset)
|
||||
// Forced threat level, setting this to zero or higher forces the roundstart threat to the value.
|
||||
GLOBAL_VAR_INIT(dynamic_forced_threat_level, -1)
|
||||
|
||||
// Storyteller picked by the voting.
|
||||
GLOBAL_VAR_INIT(dynamic_storyteller_type, /datum/dynamic_storyteller/classic)
|
||||
// Storyteller forced by admins during voting--will be used instead of above.
|
||||
GLOBAL_VAR_INIT(dynamic_forced_storyteller, null)
|
||||
|
||||
/datum/game_mode/dynamic
|
||||
name = "dynamic mode"
|
||||
@@ -164,7 +166,7 @@ GLOBAL_VAR_INIT(dynamic_storyteller_type, /datum/dynamic_storyteller/classic)
|
||||
|
||||
dat += "Current threat: <b>[threat]</b> <a href='?src=\ref[src];[HrefToken()];adjustthreat=1'>\[Adjust\]</A> <a href='?src=\ref[src];[HrefToken()];threatlog=1'>\[View Log\]</a><br/>"
|
||||
dat += "<br/>"
|
||||
dat += "Storyteller: <b>[storyteller.name]</b><br/>"
|
||||
dat += "Storyteller: <a href='?src=\ref[src];[HrefToken()];change_storyteller=1'><b>[storyteller.name]</b></a> <br/>"
|
||||
dat += "Parameters: centre = [GLOB.dynamic_curve_centre] ; width = [GLOB.dynamic_curve_width].<br/>"
|
||||
dat += "<i>On average, <b>[peaceful_percentage]</b>% of the rounds are more peaceful.</i><br/>"
|
||||
dat += "Forced extended: <a href='?src=\ref[src];[HrefToken()];forced_extended=1'><b>[GLOB.dynamic_forced_extended ? "On" : "Off"]</b></a><br/>"
|
||||
@@ -222,6 +224,15 @@ GLOBAL_VAR_INIT(dynamic_storyteller_type, /datum/dynamic_storyteller/classic)
|
||||
show_threatlog(usr)
|
||||
else if (href_list["stacking_limit"])
|
||||
GLOB.dynamic_stacking_limit = input(usr,"Change the threat limit at which round-endings rulesets will start to stack.", "Change stacking limit", null) as num
|
||||
else if (href_list["change_storyteller"])
|
||||
var/list/choices = list()
|
||||
for(var/T in config.storyteller_cache)
|
||||
var/datum/dynamic_storyteller/S = T
|
||||
choices[initial(S.name)] = T
|
||||
var/selected_storyteller = choices[input("Select storyteller:", "Storyteller", storyteller.name) as null|anything in choices]
|
||||
storyteller = new selected_storyteller
|
||||
storyteller.on_start()
|
||||
message_admins("[key_name(usr)] changed the storyteller to [storyteller].", 1)
|
||||
|
||||
admin_panel() // Refreshes the window
|
||||
|
||||
@@ -243,7 +254,7 @@ GLOBAL_VAR_INIT(dynamic_storyteller_type, /datum/dynamic_storyteller/classic)
|
||||
/datum/game_mode/dynamic/send_intercept()
|
||||
. = "<b><i>Central Command Status Summary</i></b><hr>"
|
||||
switch(round(threat_level))
|
||||
if(0 to 20)
|
||||
if(-INFINITY to 20)
|
||||
. += "<b>Peaceful Waypoint</b></center><BR>"
|
||||
. += "Your station orbits deep within controlled, core-sector systems and serves as a waypoint for routine traffic through Nanotrasen's trade empire. Due to the combination of high security, interstellar traffic, and low strategic value, it makes any direct threat of violence unlikely. Your primary enemies will be incompetence and bored crewmen: try to organize team-building events to keep staffers interested and productive. However, even deep in our territory there may be subversive elements, especially for such a high-value target as your station. Keep an eye out, but don't expect much trouble."
|
||||
set_security_level(SEC_LEVEL_GREEN)
|
||||
@@ -275,7 +286,7 @@ GLOBAL_VAR_INIT(dynamic_storyteller_type, /datum/dynamic_storyteller/classic)
|
||||
. += "<b>Black Orbit</b></center><BR>"
|
||||
. += "As part of a mandatory security protocol, we are required to inform you that as a result of your orbital pattern directly behind an astrological body (oriented from our nearest observatory), your station will be under decreased monitoring and support. It is anticipated that your extreme location and decreased surveillance could pose security risks. Avoid unnecessary risks and attempt to keep your station in one piece."
|
||||
set_security_level(SEC_LEVEL_AMBER)
|
||||
if(96 to 100)
|
||||
if(96 to INFINITY)
|
||||
. += "<b>Impending Doom</b></center><BR>"
|
||||
. += "Your station is somehow in the middle of hostile territory, in clear view of any enemy of the corporation. Your likelihood to survive is low, and station destruction is expected and almost inevitable. Secure any sensitive material and neutralize any enemy you will come across. It is important that you at least try to maintain the station.<BR>"
|
||||
. += "Good luck."
|
||||
@@ -346,6 +357,8 @@ GLOBAL_VAR_INIT(dynamic_storyteller_type, /datum/dynamic_storyteller/classic)
|
||||
SSblackbox.record_feedback("tally","dynamic_threat",peaceful_percentage,"Percent of same-vote rounds that are more peaceful")
|
||||
|
||||
/datum/game_mode/dynamic/can_start()
|
||||
if(GLOB.dynamic_forced_storyteller)
|
||||
GLOB.dynamic_storyteller_type = GLOB.dynamic_forced_storyteller
|
||||
storyteller = new GLOB.dynamic_storyteller_type // this is where all the initialization happens
|
||||
storyteller.on_start()
|
||||
SSblackbox.record_feedback("text","dynamic_storyteller",1,storyteller.name)
|
||||
@@ -441,6 +454,8 @@ GLOBAL_VAR_INIT(dynamic_storyteller_type, /datum/dynamic_storyteller/classic)
|
||||
if(!drafted_rules.len)
|
||||
message_admins("Not enough threat level for roundstart antags!")
|
||||
log_game("DYNAMIC: Not enough threat level for roundstart antags!")
|
||||
midround_injection_cooldown = round((midround_injection_cooldown + world.time) / 2, 1)
|
||||
latejoin_injection_cooldown = round((latejoin_injection_cooldown + world.time) / 2, 1)
|
||||
var/indice_pop = min(10,round(roundstart_pop_ready/pop_per_requirement)+1)
|
||||
extra_rulesets_amount = 0
|
||||
if (GLOB.dynamic_classic_secret)
|
||||
@@ -721,7 +736,8 @@ GLOBAL_VAR_INIT(dynamic_storyteller_type, /datum/dynamic_storyteller/classic)
|
||||
if (O.started_as_observer) // Observers
|
||||
current_players[CURRENT_OBSERVERS].Add(M)
|
||||
continue
|
||||
current_players[CURRENT_DEAD_PLAYERS].Add(M) // Players who actually died (and admins who ghosted, would be nice to avoid counting them somehow)
|
||||
if(!M.voluntary_ghosted)
|
||||
current_players[CURRENT_DEAD_PLAYERS].Add(M) // Players who actually died (and admins who ghosted, would be nice to avoid counting them somehow)
|
||||
threat = storyteller.calculate_threat() + added_threat
|
||||
if(threat_average_weight)
|
||||
var/cur_sample_weight = world.time - last_threat_sample_time
|
||||
@@ -823,3 +839,11 @@ GLOBAL_VAR_INIT(dynamic_storyteller_type, /datum/dynamic_storyteller/classic)
|
||||
return RULE_OF_THREE(40, 20, x) + 50
|
||||
if (20 to INFINITY)
|
||||
return rand(90, 100)
|
||||
|
||||
/datum/game_mode/dynamic/ghost_info()
|
||||
. = list()
|
||||
. += "Current threat: [threat]"
|
||||
. += "Target threat: [threat_level]"
|
||||
. += "Storyteller: <b>[storyteller.name]</b><br/>"
|
||||
. += "Parameters: centre = [GLOB.dynamic_curve_centre] ; width = [GLOB.dynamic_curve_width].<br/>"
|
||||
. += "<i>On average, <b>[peaceful_percentage]</b>% of the rounds are more peaceful.</i><br/>"
|
||||
|
||||
@@ -105,7 +105,7 @@
|
||||
if (M.mind && M.mind.assigned_role && (M.mind.assigned_role in enemy_roles) && (!(M in candidates) || (M.mind.assigned_role in restricted_roles)))
|
||||
job_check++ // Checking for "enemies" (such as sec officers). To be counters, they must either not be candidates to that rule, or have a job that restricts them from it
|
||||
|
||||
var/threat = CLAMP(round(mode.threat_level/10),1,10)
|
||||
var/threat = clamp(round(mode.threat_level/10),1,10)
|
||||
if (job_check < required_enemies[threat])
|
||||
SSblackbox.record_feedback("tally","dynamic",1,"Times rulesets rejected due to not enough enemy roles")
|
||||
return FALSE
|
||||
@@ -671,7 +671,7 @@
|
||||
message_admins("[ADMIN_LOOKUPFLW(Ninja)] has been made into a ninja by dynamic.")
|
||||
log_game("[key_name(Ninja)] was spawned as a ninja by dynamic.")
|
||||
return Ninja
|
||||
|
||||
|
||||
/datum/dynamic_ruleset/midround/from_ghosts/ninja/finish_setup(mob/new_character, index)
|
||||
return
|
||||
|
||||
|
||||
@@ -789,7 +789,7 @@
|
||||
if (prob(meteorminutes/2))
|
||||
wavetype = GLOB.meteors_catastrophic
|
||||
|
||||
var/ramp_up_final = CLAMP(round(meteorminutes/rampupdelta), 1, 10)
|
||||
var/ramp_up_final = clamp(round(meteorminutes/rampupdelta), 1, 10)
|
||||
|
||||
spawn_meteors(ramp_up_final, wavetype)
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
WAROPS_ALWAYS_ALLOWED: Can always do warops, regardless of threat level.
|
||||
USE_PREF_WEIGHTS: Will use peoples' preferences to change the threat centre.
|
||||
FORCE_IF_WON: If this mode won the vote, forces it
|
||||
USE_PREV_ROUND_WEIGHTS: Changes its threat centre based on the average chaos of previous rounds.
|
||||
USE_PREV_ROUND_WEIGHTS: Changes its threat centre based on the average chaos of previous rounds.
|
||||
*/
|
||||
var/flags = 0
|
||||
var/dead_player_weight = 1 // How much dead players matter for threat calculation
|
||||
@@ -22,11 +22,11 @@
|
||||
var/datum/game_mode/dynamic/mode = null // Cached as soon as it's made, by dynamic.
|
||||
|
||||
/**
|
||||
Property weights are:
|
||||
Property weights are:
|
||||
"story_potential" -- essentially how many different ways the antag can be played.
|
||||
"trust" -- How much it makes the crew trust each other. Negative values means they're suspicious. Team antags are like this.
|
||||
"chaos" -- How chaotic it makes the round. Has some overlap with "valid" and somewhat contradicts "extended".
|
||||
"valid" -- How likely the non-antag-enemy crew are to get involved, e.g. nukies encouraging the warden to
|
||||
"valid" -- How likely the non-antag-enemy crew are to get involved, e.g. nukies encouraging the warden to
|
||||
let everyone into the armory, wizard moving around and being a nuisance, nightmare busting lights.
|
||||
"extended" -- How much the antag is conducive to a long round. Nukies and cults are bad for this; Wizard is less bad; and so on.
|
||||
"conversion" -- Basically a bool. Conversion antags, well, convert. It's its own class for a good reason.
|
||||
@@ -34,13 +34,13 @@ Property weights are:
|
||||
|
||||
/datum/dynamic_storyteller/proc/start_injection_cooldowns()
|
||||
var/latejoin_injection_cooldown_middle = 0.5*(GLOB.dynamic_first_latejoin_delay_max + GLOB.dynamic_first_latejoin_delay_min)
|
||||
mode.latejoin_injection_cooldown = round(CLAMP(EXP_DISTRIBUTION(latejoin_injection_cooldown_middle), GLOB.dynamic_first_latejoin_delay_min, GLOB.dynamic_first_latejoin_delay_max)) + world.time
|
||||
mode.latejoin_injection_cooldown = round(clamp(EXP_DISTRIBUTION(latejoin_injection_cooldown_middle), GLOB.dynamic_first_latejoin_delay_min, GLOB.dynamic_first_latejoin_delay_max)) + world.time
|
||||
|
||||
var/midround_injection_cooldown_middle = 0.5*(GLOB.dynamic_first_midround_delay_min + GLOB.dynamic_first_midround_delay_max)
|
||||
mode.midround_injection_cooldown = round(CLAMP(EXP_DISTRIBUTION(midround_injection_cooldown_middle), GLOB.dynamic_first_midround_delay_min, GLOB.dynamic_first_midround_delay_max)) + world.time
|
||||
|
||||
mode.midround_injection_cooldown = round(clamp(EXP_DISTRIBUTION(midround_injection_cooldown_middle), GLOB.dynamic_first_midround_delay_min, GLOB.dynamic_first_midround_delay_max)) + world.time
|
||||
|
||||
var/event_injection_cooldown_middle = 0.5*(GLOB.dynamic_event_delay_max + GLOB.dynamic_event_delay_min)
|
||||
mode.event_injection_cooldown = (round(CLAMP(EXP_DISTRIBUTION(event_injection_cooldown_middle), GLOB.dynamic_event_delay_min, GLOB.dynamic_event_delay_max)) + world.time)
|
||||
mode.event_injection_cooldown = (round(clamp(EXP_DISTRIBUTION(event_injection_cooldown_middle), GLOB.dynamic_event_delay_min, GLOB.dynamic_event_delay_max)) + world.time)
|
||||
|
||||
/datum/dynamic_storyteller/proc/calculate_threat()
|
||||
var/threat = 0
|
||||
@@ -99,15 +99,15 @@ Property weights are:
|
||||
|
||||
/datum/dynamic_storyteller/proc/get_midround_cooldown()
|
||||
var/midround_injection_cooldown_middle = 0.5*(GLOB.dynamic_midround_delay_max + GLOB.dynamic_midround_delay_min)
|
||||
return round(CLAMP(EXP_DISTRIBUTION(midround_injection_cooldown_middle), GLOB.dynamic_midround_delay_min, GLOB.dynamic_midround_delay_max))
|
||||
return round(clamp(EXP_DISTRIBUTION(midround_injection_cooldown_middle), GLOB.dynamic_midround_delay_min, GLOB.dynamic_midround_delay_max))
|
||||
|
||||
/datum/dynamic_storyteller/proc/get_event_cooldown()
|
||||
var/event_injection_cooldown_middle = 0.5*(GLOB.dynamic_event_delay_max + GLOB.dynamic_event_delay_min)
|
||||
return round(CLAMP(EXP_DISTRIBUTION(event_injection_cooldown_middle), GLOB.dynamic_event_delay_min, GLOB.dynamic_event_delay_max))
|
||||
return round(clamp(EXP_DISTRIBUTION(event_injection_cooldown_middle), GLOB.dynamic_event_delay_min, GLOB.dynamic_event_delay_max))
|
||||
|
||||
/datum/dynamic_storyteller/proc/get_latejoin_cooldown()
|
||||
var/latejoin_injection_cooldown_middle = 0.5*(GLOB.dynamic_latejoin_delay_max + GLOB.dynamic_latejoin_delay_min)
|
||||
return round(CLAMP(EXP_DISTRIBUTION(latejoin_injection_cooldown_middle), GLOB.dynamic_latejoin_delay_min, GLOB.dynamic_latejoin_delay_max))
|
||||
return round(clamp(EXP_DISTRIBUTION(latejoin_injection_cooldown_middle), GLOB.dynamic_latejoin_delay_min, GLOB.dynamic_latejoin_delay_max))
|
||||
|
||||
/datum/dynamic_storyteller/proc/get_injection_chance(dry_run = FALSE)
|
||||
if(mode.forced_injection)
|
||||
@@ -115,7 +115,7 @@ Property weights are:
|
||||
return 100
|
||||
var/threat_perc = mode.threat/mode.threat_level
|
||||
|
||||
return round(max(0,100*(1-(threat_perc*threat_perc*threat_perc))))
|
||||
return clamp(round(100*(1-(threat_perc*threat_perc))**2,1),0,100)
|
||||
|
||||
/datum/dynamic_storyteller/proc/roundstart_draft()
|
||||
var/list/drafted_rules = list()
|
||||
@@ -144,7 +144,7 @@ Property weights are:
|
||||
if(!(rule.flags & MINOR_RULESET)) // makes the traitor rulesets always possible anyway
|
||||
var/cost_difference = abs(rule.cost-(mode.threat_level-mode.threat))
|
||||
/* Basically, the closer the cost is to the current threat-level-away-from-threat, the more likely it is to
|
||||
pick this particular ruleset.
|
||||
pick this particular ruleset.
|
||||
Let's use a toy example: there's 60 threat level and 10 threat spent.
|
||||
We want to pick a ruleset that's close to that, so we run the below equation, on two rulesets.
|
||||
Ruleset 1 has 30 cost, ruleset 2 has 5 cost.
|
||||
@@ -152,7 +152,7 @@ Property weights are:
|
||||
is 2.26 times as likely to be picked, all other things considered.
|
||||
Of course, we don't want it to GUARANTEE the closest, that's no fun, so it's just a weight.
|
||||
*/
|
||||
threat_weight = 1-abs(1-LOGISTIC_FUNCTION(2,0.05,cost_difference,0))
|
||||
threat_weight = abs(1-abs(1-LOGISTIC_FUNCTION(2,0.05,cost_difference,0)))
|
||||
if (rule.ready())
|
||||
var/property_weight = 0
|
||||
for(var/property in property_weights)
|
||||
@@ -209,10 +209,10 @@ Property weights are:
|
||||
weight = 1
|
||||
event_frequency_lower = 2 MINUTES
|
||||
event_frequency_upper = 10 MINUTES
|
||||
flags = WAROPS_ALWAYS_ALLOWED
|
||||
min_players = 40
|
||||
flags = WAROPS_ALWAYS_ALLOWED | FORCE_IF_WON
|
||||
min_players = 30
|
||||
var/refund_cooldown = 0
|
||||
|
||||
|
||||
/datum/dynamic_storyteller/chaotic/do_process()
|
||||
if(refund_cooldown < world.time)
|
||||
mode.create_threat(20)
|
||||
@@ -221,7 +221,7 @@ Property weights are:
|
||||
|
||||
/datum/dynamic_storyteller/chaotic/get_midround_cooldown()
|
||||
return ..() / 4
|
||||
|
||||
|
||||
/datum/dynamic_storyteller/chaotic/get_latejoin_cooldown()
|
||||
return ..() / 4
|
||||
|
||||
@@ -232,7 +232,7 @@ Property weights are:
|
||||
curve_centre = 2
|
||||
curve_width = 1.5
|
||||
weight = 2
|
||||
min_players = 30
|
||||
min_players = 20
|
||||
flags = WAROPS_ALWAYS_ALLOWED | USE_PREV_ROUND_WEIGHTS
|
||||
property_weights = list("valid" = 3, "trust" = 5)
|
||||
|
||||
@@ -331,7 +331,7 @@ Property weights are:
|
||||
/datum/dynamic_storyteller/story/calculate_threat()
|
||||
var/current_time = (world.time / SSautotransfer.targettime)*180
|
||||
mode.threat_level = round(mode.initial_threat_level*(sin(current_time)+0.25),0.1)
|
||||
..()
|
||||
return ..()
|
||||
|
||||
/datum/dynamic_storyteller/classic
|
||||
name = "Classic"
|
||||
@@ -358,7 +358,7 @@ Property weights are:
|
||||
flags = NO_ASSASSIN | FORCE_IF_WON
|
||||
weight = 1
|
||||
dead_player_weight = 5
|
||||
property_weights = list("extended" = 2, "chaos" = -1, "valid" = -1, "story_potential" = 1, "conversion" = -10)
|
||||
property_weights = list("extended" = 2, "chaos" = -1, "valid" = -1, "conversion" = -10)
|
||||
|
||||
/datum/dynamic_storyteller/no_antag
|
||||
name = "Extended"
|
||||
|
||||
@@ -604,3 +604,7 @@
|
||||
/// Mode specific admin panel.
|
||||
/datum/game_mode/proc/admin_panel()
|
||||
return
|
||||
|
||||
/// Mode specific info for ghost game_info
|
||||
/datum/game_mode/proc/ghost_info()
|
||||
return
|
||||
|
||||
@@ -229,7 +229,7 @@
|
||||
if(!was_stranded)
|
||||
priority_announce("All hostile activity within station systems has ceased.","Network Alert")
|
||||
|
||||
if(get_security_level() == "delta")
|
||||
if(NUM2SECLEVEL(GLOB.security_level) == "delta")
|
||||
set_security_level("red")
|
||||
|
||||
SSshuttle.clearHostileEnvironment(src)
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
if (prob(meteorminutes/2))
|
||||
wavetype = GLOB.meteors_catastrophic
|
||||
|
||||
var/ramp_up_final = CLAMP(round(meteorminutes/rampupdelta), 1, 10)
|
||||
var/ramp_up_final = clamp(round(meteorminutes/rampupdelta), 1, 10)
|
||||
|
||||
spawn_meteors(ramp_up_final, wavetype)
|
||||
|
||||
|
||||
@@ -70,7 +70,7 @@
|
||||
/datum/game_mode/revolution/post_setup()
|
||||
var/list/heads = SSjob.get_living_heads()
|
||||
var/list/sec = SSjob.get_living_sec()
|
||||
var/weighted_score = CLAMP(round(heads.len - ((3 - sec.len) / 3)), 1, max_headrevs)
|
||||
var/weighted_score = clamp(round(heads.len - ((3 - sec.len) / 3)), 1, max_headrevs)
|
||||
|
||||
for(var/datum/mind/rev_mind in headrev_candidates) //People with return to lobby may still be in the lobby. Let's pick someone else in that case.
|
||||
if(isnewplayer(rev_mind.current))
|
||||
|
||||
@@ -28,11 +28,11 @@
|
||||
var/prod_coeff = 1
|
||||
|
||||
var/datum/design/being_built
|
||||
var/datum/techweb/stored_research
|
||||
var/list/datum/design/matching_designs
|
||||
var/selected_category
|
||||
var/screen = 1
|
||||
|
||||
var/datum/techweb/stored_research = /datum/techweb/specialized/autounlocking/autolathe
|
||||
var/list/categories = list(
|
||||
"Tools",
|
||||
"Electronics",
|
||||
@@ -45,9 +45,7 @@
|
||||
"Dinnerware",
|
||||
"Imported"
|
||||
)
|
||||
|
||||
/obj/machinery/autolathe/Initialize()
|
||||
var/static/list/allowed_types = list(
|
||||
var/list/allowed_materials = list(
|
||||
/datum/material/iron,
|
||||
/datum/material/glass,
|
||||
/datum/material/gold,
|
||||
@@ -63,10 +61,12 @@
|
||||
/datum/material/adamantine,
|
||||
/datum/material/mythril
|
||||
)
|
||||
AddComponent(/datum/component/material_container, allowed_types, _show_on_examine=TRUE, _after_insert=CALLBACK(src, .proc/AfterMaterialInsert))
|
||||
|
||||
/obj/machinery/autolathe/Initialize()
|
||||
AddComponent(/datum/component/material_container, allowed_materials, _show_on_examine=TRUE, _after_insert=CALLBACK(src, .proc/AfterMaterialInsert))
|
||||
. = ..()
|
||||
wires = new /datum/wires/autolathe(src)
|
||||
stored_research = new /datum/techweb/specialized/autounlocking/autolathe
|
||||
stored_research = new stored_research
|
||||
matching_designs = list()
|
||||
|
||||
/obj/machinery/autolathe/Destroy()
|
||||
@@ -91,7 +91,7 @@
|
||||
if(AUTOLATHE_SEARCH_MENU)
|
||||
dat = search_win(user)
|
||||
|
||||
var/datum/browser/popup = new(user, "autolathe", name, 400, 500)
|
||||
var/datum/browser/popup = new(user, name, name, 400, 500)
|
||||
popup.set_content(dat)
|
||||
popup.open()
|
||||
|
||||
@@ -169,7 +169,7 @@
|
||||
|
||||
var/multiplier = text2num(href_list["multiplier"])
|
||||
var/is_stack = ispath(being_built.build_path, /obj/item/stack)
|
||||
multiplier = CLAMP(multiplier,1,50)
|
||||
multiplier = clamp(multiplier,1,50)
|
||||
|
||||
/////////////////
|
||||
|
||||
@@ -439,8 +439,32 @@
|
||||
desc = "An autolathe reprogrammed with security protocols to prevent hacking."
|
||||
hackable = FALSE
|
||||
circuit = /obj/item/circuitboard/machine/autolathe/secure
|
||||
stored_research = /datum/techweb/specialized/autounlocking/autolathe/public
|
||||
|
||||
//Called when the object is constructed by an autolathe
|
||||
//Has a reference to the autolathe so you can do !!FUN!! things with hacked lathes
|
||||
/obj/item/proc/autolathe_crafted(obj/machinery/autolathe/A)
|
||||
return
|
||||
/obj/machinery/autolathe/toy
|
||||
name = "autoylathe"
|
||||
desc = "It produces toys using plastic, metal and glass."
|
||||
circuit = /obj/item/circuitboard/machine/autolathe/toy
|
||||
|
||||
stored_research = /datum/techweb/specialized/autounlocking/autolathe/toy
|
||||
categories = list(
|
||||
"Toys",
|
||||
"Figurines",
|
||||
"Pistols",
|
||||
"Rifles",
|
||||
"Heavy",
|
||||
"Melee",
|
||||
"Armor",
|
||||
"Adult",
|
||||
"Misc",
|
||||
"Imported"
|
||||
)
|
||||
allowed_materials = list(
|
||||
/datum/material/iron,
|
||||
/datum/material/glass,
|
||||
/datum/material/plastic
|
||||
)
|
||||
|
||||
/obj/machinery/autolathe/toy/hacked/Initialize()
|
||||
. = ..()
|
||||
adjust_hacked(TRUE)
|
||||
|
||||
@@ -69,7 +69,7 @@
|
||||
for(var/obj/item/stock_parts/manipulator/P in component_parts)
|
||||
speed_coeff += (P.rating / 2)
|
||||
speed_coeff = max(1, speed_coeff)
|
||||
heal_level = CLAMP((efficiency * 10) + 10, MINIMUM_HEAL_LEVEL, 100)
|
||||
heal_level = clamp((efficiency * 10) + 10, MINIMUM_HEAL_LEVEL, 100)
|
||||
|
||||
//The return of data disks?? Just for transferring between genetics machine/cloning machine.
|
||||
//TO-DO: Make the genetics machine accept them.
|
||||
|
||||
@@ -150,7 +150,7 @@
|
||||
return
|
||||
log_activity("changed greater than charge filter to \"[new_filter]\"")
|
||||
if(new_filter)
|
||||
new_filter = CLAMP(new_filter, 0, 100)
|
||||
new_filter = clamp(new_filter, 0, 100)
|
||||
playsound(src, 'sound/machines/terminal_prompt_confirm.ogg', 50, 0)
|
||||
result_filters["Charge Above"] = new_filter
|
||||
if(href_list["below_filter"])
|
||||
@@ -160,7 +160,7 @@
|
||||
return
|
||||
log_activity("changed lesser than charge filter to \"[new_filter]\"")
|
||||
if(new_filter)
|
||||
new_filter = CLAMP(new_filter, 0, 100)
|
||||
new_filter = clamp(new_filter, 0, 100)
|
||||
playsound(src, 'sound/machines/terminal_prompt_confirm.ogg', 50, 0)
|
||||
result_filters["Charge Below"] = new_filter
|
||||
if(href_list["access_filter"])
|
||||
|
||||
@@ -308,12 +308,12 @@
|
||||
var/new_rows = input(user, "How many rows do you want? (Minimum: 4, Maximum: 30)", "Minesweeper Rows") as null|num
|
||||
if(!new_rows || !user.canUseTopic(src, !hasSiliconAccessInArea(user)))
|
||||
return FALSE
|
||||
new_rows = CLAMP(new_rows + 1, 4, 30)
|
||||
new_rows = clamp(new_rows + 1, 4, 30)
|
||||
playsound(loc, 'sound/arcade/minesweeper_menuselect.ogg', 50, 0, extrarange = -3, falloff = 10)
|
||||
var/new_columns = input(user, "How many columns do you want? (Minimum: 4, Maximum: 50)", "Minesweeper Squares") as null|num
|
||||
if(!new_columns || !user.canUseTopic(src, !hasSiliconAccessInArea(user)))
|
||||
return FALSE
|
||||
new_columns = CLAMP(new_columns + 1, 4, 50)
|
||||
new_columns = clamp(new_columns + 1, 4, 50)
|
||||
playsound(loc, 'sound/arcade/minesweeper_menuselect.ogg', 50, 0, extrarange = -3, falloff = 10)
|
||||
var/grid_area = (new_rows - 1) * (new_columns - 1)
|
||||
var/lower_limit = round(grid_area*0.156)
|
||||
@@ -324,7 +324,7 @@
|
||||
playsound(loc, 'sound/arcade/minesweeper_menuselect.ogg', 50, 0, extrarange = -3, falloff = 10)
|
||||
rows = new_rows
|
||||
columns = new_columns
|
||||
mine_limit = CLAMP(new_mine_limit, lower_limit, upper_limit)
|
||||
mine_limit = clamp(new_mine_limit, lower_limit, upper_limit)
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/computer/arcade/minesweeper/proc/make_mines(var/reset_everything)
|
||||
|
||||
@@ -296,7 +296,7 @@ GLOBAL_LIST_EMPTY(atmos_air_controllers)
|
||||
if("rate")
|
||||
var/target = text2num(params["rate"])
|
||||
if(!isnull(target))
|
||||
target = CLAMP(target, 0, MAX_TRANSFER_RATE)
|
||||
target = clamp(target, 0, MAX_TRANSFER_RATE)
|
||||
signal.data += list("tag" = input_tag, "set_volume_rate" = target)
|
||||
. = TRUE
|
||||
if("output")
|
||||
@@ -305,7 +305,7 @@ GLOBAL_LIST_EMPTY(atmos_air_controllers)
|
||||
if("pressure")
|
||||
var/target = text2num(params["pressure"])
|
||||
if(!isnull(target))
|
||||
target = CLAMP(target, 0, MAX_OUTPUT_PRESSURE)
|
||||
target = clamp(target, 0, MAX_OUTPUT_PRESSURE)
|
||||
signal.data += list("tag" = output_tag, "set_internal_pressure" = target)
|
||||
. = TRUE
|
||||
radio_connection.post_signal(src, signal, filter = RADIO_ATMOSIA)
|
||||
|
||||
@@ -111,7 +111,7 @@
|
||||
to_chat(usr, "<span class='notice'>Authorization confirmed. Modifying security level.</span>")
|
||||
playsound(src, 'sound/machines/terminal_prompt_confirm.ogg', 50, 0)
|
||||
//Only notify people if an actual change happened
|
||||
var/security_level = get_security_level()
|
||||
var/security_level = NUM2SECLEVEL(GLOB.security_level)
|
||||
log_game("[key_name(usr)] has changed the security level to [security_level] with [src] at [AREACOORD(usr)].")
|
||||
message_admins("[ADMIN_LOOKUPFLW(usr)] has changed the security level to [security_level] with [src] at [AREACOORD(usr)].")
|
||||
deadchat_broadcast("<span class='deadsay'><span class='name'>[usr.real_name]</span> has changed the security level to [security_level] with [src] at <span class='name'>[get_area_name(usr, TRUE)]</span>.</span>", usr)
|
||||
@@ -404,7 +404,7 @@
|
||||
security_level_cd = world.time + 15 SECONDS
|
||||
if(GLOB.security_level != old_level)
|
||||
//Only notify people if an actual change happened
|
||||
var/security_level = get_security_level()
|
||||
var/security_level = NUM2SECLEVEL(GLOB.security_level)
|
||||
log_game("[key_name(usr)] has changed the security level to [security_level] from [src] at [AREACOORD(usr)].")
|
||||
message_admins("[ADMIN_LOOKUPFLW(usr)] has changed the security level to [security_level] from [src] at [AREACOORD(usr)].")
|
||||
deadchat_broadcast("<span class='deadsay'><span class='name'>[usr.real_name]</span> has changed the security level to [security_level] from [src] at [get_area_name(usr, TRUE)].</span>", usr)
|
||||
@@ -555,7 +555,7 @@
|
||||
dat += " <A HREF='?src=[REF(src)];operation=setstat;statdisp=alert;alert=biohazard'>Biohazard</A> \]<BR><HR>"
|
||||
playsound(src, 'sound/machines/terminal_prompt_confirm.ogg', 50, 0)
|
||||
if(STATE_ALERT_LEVEL)
|
||||
dat += "Current alert level: [get_security_level()]<BR>"
|
||||
dat += "Current alert level: [NUM2SECLEVEL(GLOB.security_level)]<BR>"
|
||||
if(GLOB.security_level == SEC_LEVEL_DELTA)
|
||||
dat += "<font color='red'><b>The self-destruct mechanism is active. Find a way to deactivate the mechanism to lower the alert level or evacuate.</b></font>"
|
||||
else
|
||||
@@ -563,8 +563,8 @@
|
||||
dat += "<A HREF='?src=[REF(src)];operation=securitylevel;newalertlevel=[SEC_LEVEL_BLUE]'>Blue</A><BR>"
|
||||
dat += "<A HREF='?src=[REF(src)];operation=securitylevel;newalertlevel=[SEC_LEVEL_GREEN]'>Green</A>"
|
||||
if(STATE_CONFIRM_LEVEL)
|
||||
dat += "Current alert level: [get_security_level()]<BR>"
|
||||
dat += "Confirm the change to: [num2seclevel(tmp_alertlevel)]<BR>"
|
||||
dat += "Current alert level: [NUM2SECLEVEL(GLOB.security_level)]<BR>"
|
||||
dat += "Confirm the change to: [NUM2SECLEVEL(tmp_alertlevel)]<BR>"
|
||||
dat += "<A HREF='?src=[REF(src)];operation=swipeidseclevel'>Swipe ID</A> to confirm change.<BR>"
|
||||
if(STATE_TOGGLE_EMERGENCY)
|
||||
playsound(src, 'sound/machines/terminal_prompt.ogg', 50, 0)
|
||||
@@ -696,7 +696,7 @@
|
||||
dat += " <A HREF='?src=[REF(src)];operation=setstat;statdisp=alert;alert=biohazard'>Biohazard</A> \]<BR><HR>"
|
||||
|
||||
if(STATE_ALERT_LEVEL)
|
||||
dat += "Current alert level: [get_security_level()]<BR>"
|
||||
dat += "Current alert level: [NUM2SECLEVEL(GLOB.security_level)]<BR>"
|
||||
if(GLOB.security_level == SEC_LEVEL_DELTA)
|
||||
dat += "<font color='red'><b>The self-destruct mechanism is active. Find a way to deactivate the mechanism to lower the alert level or evacuate.</b></font>"
|
||||
else
|
||||
|
||||
@@ -604,13 +604,13 @@
|
||||
if("setbufferlabel")
|
||||
var/text = sanitize(input(usr, "Input a new label:", "Input a Text", null) as text|null)
|
||||
if(num && text)
|
||||
num = CLAMP(num, 1, NUMBER_OF_BUFFERS)
|
||||
num = clamp(num, 1, NUMBER_OF_BUFFERS)
|
||||
var/list/buffer_slot = buffer[num]
|
||||
if(istype(buffer_slot))
|
||||
buffer_slot["label"] = text
|
||||
if("setbuffer")
|
||||
if(num && viable_occupant)
|
||||
num = CLAMP(num, 1, NUMBER_OF_BUFFERS)
|
||||
num = clamp(num, 1, NUMBER_OF_BUFFERS)
|
||||
buffer[num] = list(
|
||||
"label"="Buffer[num]:[viable_occupant.real_name]",
|
||||
"UI"=viable_occupant.dna.uni_identity,
|
||||
@@ -620,7 +620,7 @@
|
||||
)
|
||||
if("clearbuffer")
|
||||
if(num)
|
||||
num = CLAMP(num, 1, NUMBER_OF_BUFFERS)
|
||||
num = clamp(num, 1, NUMBER_OF_BUFFERS)
|
||||
var/list/buffer_slot = buffer[num]
|
||||
if(istype(buffer_slot))
|
||||
buffer_slot.Cut()
|
||||
@@ -635,7 +635,7 @@
|
||||
apply_buffer(SCANNER_ACTION_MIXED,num)
|
||||
if("injector")
|
||||
if(num && injectorready < world.time)
|
||||
num = CLAMP(num, 1, NUMBER_OF_BUFFERS)
|
||||
num = clamp(num, 1, NUMBER_OF_BUFFERS)
|
||||
var/list/buffer_slot = buffer[num]
|
||||
if(istype(buffer_slot))
|
||||
var/obj/item/dnainjector/timed/I
|
||||
@@ -662,11 +662,11 @@
|
||||
injectorready = world.time + INJECTOR_TIMEOUT
|
||||
if("loaddisk")
|
||||
if(num && diskette && diskette.fields)
|
||||
num = CLAMP(num, 1, NUMBER_OF_BUFFERS)
|
||||
num = clamp(num, 1, NUMBER_OF_BUFFERS)
|
||||
buffer[num] = diskette.fields.Copy()
|
||||
if("savedisk")
|
||||
if(num && diskette && !diskette.read_only)
|
||||
num = CLAMP(num, 1, NUMBER_OF_BUFFERS)
|
||||
num = clamp(num, 1, NUMBER_OF_BUFFERS)
|
||||
var/list/buffer_slot = buffer[num]
|
||||
if(istype(buffer_slot))
|
||||
diskette.name = "data disk \[[buffer_slot["label"]]\]"
|
||||
@@ -953,7 +953,7 @@
|
||||
return viable_occupant
|
||||
|
||||
/obj/machinery/computer/scan_consolenew/proc/apply_buffer(action,buffer_num)
|
||||
buffer_num = CLAMP(buffer_num, 1, NUMBER_OF_BUFFERS)
|
||||
buffer_num = clamp(buffer_num, 1, NUMBER_OF_BUFFERS)
|
||||
var/list/buffer_slot = buffer[buffer_num]
|
||||
var/mob/living/carbon/viable_occupant = get_viable_occupant()
|
||||
if(istype(buffer_slot))
|
||||
|
||||
@@ -97,7 +97,7 @@
|
||||
return
|
||||
if(!new_goal)
|
||||
new_goal = default_goal
|
||||
contained_id.goal = CLAMP(new_goal, 0, 1000) //maximum 1000 points
|
||||
contained_id.goal = clamp(new_goal, 0, 1000) //maximum 1000 points
|
||||
return TRUE
|
||||
if("toggle_open")
|
||||
if(teleporter.locked)
|
||||
|
||||
@@ -405,7 +405,7 @@
|
||||
|
||||
// Ghost and delete the mob.
|
||||
if(!mob_occupant.get_ghost(1))
|
||||
mob_occupant.ghostize(FALSE, penalize = TRUE)
|
||||
mob_occupant.ghostize(FALSE, penalize = TRUE, voluntary = TRUE)
|
||||
|
||||
QDEL_NULL(occupant)
|
||||
for(var/I in cryo_items) //only "CRYO_DESTROY_LATER" atoms are left)
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
|
||||
to_chat(user, "<span class='notice'>You begin repairing [src]...</span>")
|
||||
if(I.use_tool(src, user, 40, volume=40))
|
||||
obj_integrity = CLAMP(obj_integrity + 20, 0, max_integrity)
|
||||
obj_integrity = clamp(obj_integrity + 20, 0, max_integrity)
|
||||
else
|
||||
return ..()
|
||||
|
||||
|
||||
@@ -135,7 +135,7 @@
|
||||
. /= 10
|
||||
|
||||
/obj/machinery/door_timer/proc/set_timer(value)
|
||||
var/new_time = CLAMP(value,0,MAX_TIMER)
|
||||
var/new_time = clamp(value,0,MAX_TIMER)
|
||||
. = new_time == timer_duration //return 1 on no change
|
||||
timer_duration = new_time
|
||||
|
||||
|
||||
@@ -68,9 +68,9 @@
|
||||
if(teleporting)
|
||||
return
|
||||
if(!isnull(x))
|
||||
x_offset = CLAMP(x, -range, range)
|
||||
x_offset = clamp(x, -range, range)
|
||||
if(!isnull(y))
|
||||
y_offset = CLAMP(y, -range, range)
|
||||
y_offset = clamp(y, -range, range)
|
||||
|
||||
/obj/machinery/launchpad/proc/doteleport(mob/user, sending)
|
||||
if(teleporting)
|
||||
|
||||
@@ -55,9 +55,9 @@
|
||||
new /obj/item/pipe_meter(loc)
|
||||
wait = world.time + 15
|
||||
if(href_list["layer_up"])
|
||||
piping_layer = CLAMP(++piping_layer, PIPING_LAYER_MIN, PIPING_LAYER_MAX)
|
||||
piping_layer = clamp(++piping_layer, PIPING_LAYER_MIN, PIPING_LAYER_MAX)
|
||||
if(href_list["layer_down"])
|
||||
piping_layer = CLAMP(--piping_layer, PIPING_LAYER_MIN, PIPING_LAYER_MAX)
|
||||
piping_layer = clamp(--piping_layer, PIPING_LAYER_MIN, PIPING_LAYER_MAX)
|
||||
return
|
||||
|
||||
/obj/machinery/pipedispenser/attackby(obj/item/W, mob/user, params)
|
||||
|
||||
@@ -270,7 +270,7 @@
|
||||
use_stored_power(50)
|
||||
|
||||
/obj/machinery/shieldwallgen/proc/use_stored_power(amount)
|
||||
power = CLAMP(power - amount, 0, maximum_stored_power)
|
||||
power = clamp(power - amount, 0, maximum_stored_power)
|
||||
update_activity()
|
||||
|
||||
/obj/machinery/shieldwallgen/proc/update_activity()
|
||||
|
||||
@@ -127,7 +127,7 @@
|
||||
settableTemperatureRange = cap * 30
|
||||
efficiency = (cap + 1) * 10000
|
||||
|
||||
targetTemperature = CLAMP(targetTemperature,
|
||||
targetTemperature = clamp(targetTemperature,
|
||||
max(settableTemperatureMedian - settableTemperatureRange, TCMB),
|
||||
settableTemperatureMedian + settableTemperatureRange)
|
||||
|
||||
@@ -230,7 +230,7 @@
|
||||
target= text2num(target) + T0C
|
||||
. = TRUE
|
||||
if(.)
|
||||
targetTemperature = CLAMP(round(target),
|
||||
targetTemperature = clamp(round(target),
|
||||
max(settableTemperatureMedian - settableTemperatureRange, TCMB),
|
||||
settableTemperatureMedian + settableTemperatureRange)
|
||||
if("eject")
|
||||
|
||||
@@ -195,7 +195,7 @@
|
||||
/obj/machinery/syndicatebomb/proc/settings(mob/user)
|
||||
var/new_timer = input(user, "Please set the timer.", "Timer", "[timer_set]") as num
|
||||
if(in_range(src, user) && isliving(user)) //No running off and setting bombs from across the station
|
||||
timer_set = CLAMP(new_timer, minimum_timer, maximum_timer)
|
||||
timer_set = clamp(new_timer, minimum_timer, maximum_timer)
|
||||
loc.visible_message("<span class='notice'>[icon2html(src, viewers(src))] timer set for [timer_set] seconds.</span>")
|
||||
if(alert(user,"Would you like to start the countdown now?",,"Yes","No") == "Yes" && in_range(src, user) && isliving(user))
|
||||
if(defused || active)
|
||||
|
||||
@@ -70,7 +70,7 @@
|
||||
com.target = null
|
||||
visible_message("<span class='alert'>Cannot authenticate locked on coordinates. Please reinstate coordinate matrix.</span>")
|
||||
return
|
||||
if (ismovableatom(M))
|
||||
if (ismovable(M))
|
||||
if(do_teleport(M, com.target, channel = TELEPORT_CHANNEL_BLUESPACE))
|
||||
use_power(5000)
|
||||
|
||||
|
||||
@@ -1,415 +0,0 @@
|
||||
#define AUTOYLATHE_MAIN_MENU 1
|
||||
#define AUTOYLATHE_CATEGORY_MENU 2
|
||||
#define AUTOYLATHE_SEARCH_MENU 3
|
||||
|
||||
/obj/machinery/autoylathe
|
||||
name = "autoylathe"
|
||||
desc = "It produces toys using plastic, metal and glass."
|
||||
icon_state = "autolathe"
|
||||
density = TRUE
|
||||
use_power = IDLE_POWER_USE
|
||||
idle_power_usage = 10
|
||||
active_power_usage = 100
|
||||
circuit = /obj/item/circuitboard/machine/autoylathe
|
||||
layer = BELOW_OBJ_LAYER
|
||||
|
||||
var/operating = FALSE
|
||||
var/list/L = list()
|
||||
var/list/LL = list()
|
||||
var/hacked = FALSE
|
||||
var/disabled = 0
|
||||
var/shocked = FALSE
|
||||
var/hack_wire
|
||||
var/disable_wire
|
||||
var/shock_wire
|
||||
|
||||
var/busy = FALSE
|
||||
var/prod_coeff = 1
|
||||
|
||||
var/datum/design/being_built
|
||||
var/datum/techweb/stored_research
|
||||
var/list/datum/design/matching_designs
|
||||
var/selected_category
|
||||
var/screen = 1
|
||||
|
||||
var/list/categories = list(
|
||||
"Toys",
|
||||
"Figurines",
|
||||
"Pistols",
|
||||
"Rifles",
|
||||
"Heavy",
|
||||
"Melee",
|
||||
"Armor",
|
||||
"Adult",
|
||||
"Misc",
|
||||
"Imported"
|
||||
)
|
||||
|
||||
/obj/machinery/autoylathe/Initialize()
|
||||
var/static/list/allowed_materials = list(
|
||||
/datum/material/iron,
|
||||
/datum/material/glass,
|
||||
/datum/material/plastic
|
||||
)
|
||||
AddComponent(/datum/component/material_container, allowed_materials, 0, TRUE, null, null, CALLBACK(src, .proc/AfterMaterialInsert))
|
||||
. = ..()
|
||||
|
||||
wires = new /datum/wires/autoylathe(src)
|
||||
stored_research = new /datum/techweb/specialized/autounlocking/autoylathe
|
||||
matching_designs = list()
|
||||
|
||||
/obj/machinery/autoylathe/Destroy()
|
||||
QDEL_NULL(wires)
|
||||
return ..()
|
||||
|
||||
/obj/machinery/autoylathe/ui_interact(mob/user)
|
||||
. = ..()
|
||||
if(!is_operational())
|
||||
return
|
||||
|
||||
if(shocked && !(stat & NOPOWER))
|
||||
shock(user,50)
|
||||
|
||||
var/dat
|
||||
|
||||
switch(screen)
|
||||
if(AUTOYLATHE_MAIN_MENU)
|
||||
dat = main_win(user)
|
||||
if(AUTOYLATHE_CATEGORY_MENU)
|
||||
dat = category_win(user,selected_category)
|
||||
if(AUTOYLATHE_SEARCH_MENU)
|
||||
dat = search_win(user)
|
||||
|
||||
var/datum/browser/popup = new(user, "Autoylathe", name, 400, 500)
|
||||
popup.set_content(dat)
|
||||
popup.open()
|
||||
|
||||
/obj/machinery/autoylathe/on_deconstruction()
|
||||
var/datum/component/material_container/materials = GetComponent(/datum/component/material_container)
|
||||
materials.retrieve_all()
|
||||
|
||||
/obj/machinery/autoylathe/attackby(obj/item/O, mob/user, params)
|
||||
if (busy)
|
||||
to_chat(user, "<span class=\"alert\">The autoylathe is busy. Please wait for completion of previous operation.</span>")
|
||||
return TRUE
|
||||
|
||||
if(default_deconstruction_screwdriver(user, "autolathe_t", "autolathe", O))
|
||||
updateUsrDialog()
|
||||
return TRUE
|
||||
|
||||
if(default_deconstruction_crowbar(O))
|
||||
return TRUE
|
||||
|
||||
if(panel_open && is_wire_tool(O))
|
||||
wires.interact(user)
|
||||
return TRUE
|
||||
|
||||
if(user.a_intent == INTENT_HARM) //so we can hit the machine
|
||||
return ..()
|
||||
|
||||
if(stat)
|
||||
return TRUE
|
||||
|
||||
if(istype(O, /obj/item/disk/design_disk))
|
||||
user.visible_message("[user] begins to load \the [O] in \the [src]...",
|
||||
"You begin to load a design from \the [O]...",
|
||||
"You hear the chatter of a floppy drive.")
|
||||
busy = TRUE
|
||||
var/obj/item/disk/design_disk/D = O
|
||||
if(do_after(user, 14.4, target = src))
|
||||
for(var/B in D.blueprints)
|
||||
if(B)
|
||||
stored_research.add_design(B)
|
||||
busy = FALSE
|
||||
return TRUE
|
||||
|
||||
return ..()
|
||||
|
||||
/obj/machinery/autoylathe/proc/AfterMaterialInsert(obj/item/item_inserted, id_inserted, amount_inserted)
|
||||
if(item_inserted.custom_materials?.len && item_inserted.custom_materials[SSmaterials.GetMaterialRef(/datum/material/glass)])
|
||||
flick("autolathe_r",src)//plays glass insertion animation by default otherwise
|
||||
else
|
||||
flick("autolathe_o",src)//plays metal insertion animation
|
||||
|
||||
use_power(min(1000, amount_inserted / 100))
|
||||
updateUsrDialog()
|
||||
|
||||
/obj/machinery/autoylathe/Topic(href, href_list)
|
||||
if(..())
|
||||
return
|
||||
if (!busy)
|
||||
if(href_list["menu"])
|
||||
screen = text2num(href_list["menu"])
|
||||
updateUsrDialog()
|
||||
|
||||
if(href_list["category"])
|
||||
selected_category = href_list["category"]
|
||||
updateUsrDialog()
|
||||
|
||||
if(href_list["make"])
|
||||
|
||||
/////////////////
|
||||
//href protection
|
||||
being_built = stored_research.isDesignResearchedID(href_list["make"])
|
||||
if(!being_built)
|
||||
return
|
||||
|
||||
var/multiplier = text2num(href_list["multiplier"])
|
||||
var/is_stack = ispath(being_built.build_path, /obj/item/stack)
|
||||
multiplier = CLAMP(multiplier,1,50)
|
||||
|
||||
/////////////////
|
||||
|
||||
var/coeff = (is_stack ? 1 : prod_coeff) //stacks are unaffected by production coefficient
|
||||
var/total_amount = 0
|
||||
for(var/MAT in being_built.materials)
|
||||
total_amount += being_built.materials[MAT]
|
||||
var/power = max(2000, (total_amount)*multiplier/5) //Change this to use all materials
|
||||
|
||||
var/datum/component/material_container/materials = GetComponent(/datum/component/material_container)
|
||||
|
||||
var/list/materials_used = list()
|
||||
var/list/custom_materials = list() //These will apply their material effect, This should usually only be one.
|
||||
|
||||
for(var/MAT in being_built.materials)
|
||||
var/datum/material/used_material = MAT
|
||||
var/amount_needed = being_built.materials[MAT] * coeff * multiplier
|
||||
if(istext(used_material)) //This means its a category
|
||||
var/list/list_to_show = list()
|
||||
for(var/i in SSmaterials.materials_by_category[used_material])
|
||||
if(materials.materials[i] > 0)
|
||||
list_to_show += i
|
||||
|
||||
used_material = input("Choose [used_material]", "Custom Material") as null|anything in list_to_show
|
||||
if(!used_material)
|
||||
return //Didn't pick any material, so you can't build shit either.
|
||||
custom_materials[used_material] += amount_needed
|
||||
|
||||
materials_used[used_material] = amount_needed
|
||||
|
||||
if(materials.has_materials(materials_used))
|
||||
busy = TRUE
|
||||
use_power(power)
|
||||
icon_state = "autolathe_n"
|
||||
var/time = is_stack ? 32 : 32*coeff*multiplier
|
||||
addtimer(CALLBACK(src, .proc/make_item, power, materials_used, custom_materials, multiplier, coeff, is_stack), time)
|
||||
else
|
||||
to_chat(usr, "<span class=\"alert\">Not enough materials for this operation.</span>")
|
||||
|
||||
if(href_list["search"])
|
||||
matching_designs.Cut()
|
||||
|
||||
for(var/v in stored_research.researched_designs)
|
||||
var/datum/design/D = SSresearch.techweb_design_by_id(v)
|
||||
if(findtext(D.name,href_list["to_search"]))
|
||||
matching_designs.Add(D)
|
||||
updateUsrDialog()
|
||||
else
|
||||
to_chat(usr, "<span class=\"alert\">The autoylathe is busy. Please wait for completion of previous operation.</span>")
|
||||
|
||||
updateUsrDialog()
|
||||
|
||||
return
|
||||
|
||||
/obj/machinery/autoylathe/proc/make_item(power, list/materials_used, list/picked_materials, multiplier, coeff, is_stack)
|
||||
var/datum/component/material_container/materials = GetComponent(/datum/component/material_container)
|
||||
var/atom/A = drop_location()
|
||||
use_power(power)
|
||||
materials.use_materials(materials_used)
|
||||
|
||||
if(is_stack)
|
||||
var/obj/item/stack/N = new being_built.build_path(A, multiplier)
|
||||
N.update_icon()
|
||||
N.autoylathe_crafted(src)
|
||||
else
|
||||
for(var/i=1, i<=multiplier, i++)
|
||||
var/obj/item/new_item = new being_built.build_path(A)
|
||||
new_item.autoylathe_crafted(src)
|
||||
if(length(picked_materials))
|
||||
new_item.set_custom_materials(picked_materials, 1 / multiplier) //Ensure we get the non multiplied amount
|
||||
icon_state = "autolathe"
|
||||
busy = FALSE
|
||||
updateDialog()
|
||||
|
||||
/obj/machinery/autoylathe/RefreshParts()
|
||||
var/T = 0
|
||||
for(var/obj/item/stock_parts/matter_bin/MB in component_parts)
|
||||
T += MB.rating*75000
|
||||
var/datum/component/material_container/materials = GetComponent(/datum/component/material_container)
|
||||
materials.max_amount = T
|
||||
T=1.2
|
||||
for(var/obj/item/stock_parts/manipulator/M in component_parts)
|
||||
T -= M.rating*0.2
|
||||
prod_coeff = CLAMP(T,1,0) // Coeff going 1 -> 0,8 -> 0,6 -> 0,4
|
||||
|
||||
/obj/machinery/autoylathe/proc/main_win(mob/user)
|
||||
var/dat = "<div class='statusDisplay'><h3>Autoylathe Menu:</h3><br>"
|
||||
dat += materials_printout()
|
||||
|
||||
dat += "<form name='search' action='?src=[REF(src)]'>\
|
||||
<input type='hidden' name='src' value='[REF(src)]'>\
|
||||
<input type='hidden' name='search' value='to_search'>\
|
||||
<input type='hidden' name='menu' value='[AUTOYLATHE_SEARCH_MENU]'>\
|
||||
<input type='text' name='to_search'>\
|
||||
<input type='submit' value='Search'>\
|
||||
</form><hr>"
|
||||
|
||||
var/line_length = 1
|
||||
dat += "<table style='width:100%' align='center'><tr>"
|
||||
|
||||
for(var/C in categories)
|
||||
if(line_length > 2)
|
||||
dat += "</tr><tr>"
|
||||
line_length = 1
|
||||
|
||||
dat += "<td><A href='?src=[REF(src)];category=[C];menu=[AUTOYLATHE_CATEGORY_MENU]'>[C]</A></td>"
|
||||
line_length++
|
||||
|
||||
dat += "</tr></table></div>"
|
||||
return dat
|
||||
|
||||
/obj/machinery/autoylathe/proc/category_win(mob/user,selected_category)
|
||||
var/dat = "<A href='?src=[REF(src)];menu=[AUTOYLATHE_MAIN_MENU]'>Return to main menu</A>"
|
||||
dat += "<div class='statusDisplay'><h3>Browsing [selected_category]:</h3><br>"
|
||||
dat += materials_printout()
|
||||
|
||||
for(var/v in stored_research.researched_designs)
|
||||
var/datum/design/D = SSresearch.techweb_design_by_id(v)
|
||||
if(!(selected_category in D.category))
|
||||
continue
|
||||
|
||||
if(disabled || !can_build(D))
|
||||
dat += "<span class='linkOff'>[D.name]</span>"
|
||||
else
|
||||
dat += "<a href='?src=[REF(src)];make=[D.id];multiplier=1'>[D.name]</a>"
|
||||
|
||||
if(ispath(D.build_path, /obj/item/stack))
|
||||
var/datum/component/material_container/materials = GetComponent(/datum/component/material_container)
|
||||
var/max_multiplier
|
||||
for(var/datum/material/mat in D.materials)
|
||||
max_multiplier = min(D.maxstack, round(materials.get_material_amount(mat)/D.materials[mat]))
|
||||
if (max_multiplier>10 && !disabled)
|
||||
dat += " <a href='?src=[REF(src)];make=[D.id];multiplier=10'>x10</a>"
|
||||
if (max_multiplier>25 && !disabled)
|
||||
dat += " <a href='?src=[REF(src)];make=[D.id];multiplier=25'>x25</a>"
|
||||
if(max_multiplier > 0 && !disabled)
|
||||
dat += " <a href='?src=[REF(src)];make=[D.id];multiplier=[max_multiplier]'>x[max_multiplier]</a>"
|
||||
else
|
||||
if(!disabled && can_build(D, 5))
|
||||
dat += " <a href='?src=[REF(src)];make=[D.id];multiplier=5'>x5</a>"
|
||||
if(!disabled && can_build(D, 10))
|
||||
dat += " <a href='?src=[REF(src)];make=[D.id];multiplier=10'>x10</a>"
|
||||
|
||||
dat += "[get_design_cost(D)]<br>"
|
||||
|
||||
dat += "</div>"
|
||||
return dat
|
||||
|
||||
/obj/machinery/autoylathe/proc/search_win(mob/user)
|
||||
var/dat = "<A href='?src=[REF(src)];menu=[AUTOYLATHE_MAIN_MENU]'>Return to main menu</A>"
|
||||
dat += "<div class='statusDisplay'><h3>Search results:</h3><br>"
|
||||
dat += materials_printout()
|
||||
|
||||
for(var/v in matching_designs)
|
||||
var/datum/design/D = v
|
||||
if(disabled || !can_build(D))
|
||||
dat += "<span class='linkOff'>[D.name]</span>"
|
||||
else
|
||||
dat += "<a href='?src=[REF(src)];make=[D.id];multiplier=1'>[D.name]</a>"
|
||||
|
||||
if(ispath(D.build_path, /obj/item/stack))
|
||||
var/datum/component/material_container/materials = GetComponent(/datum/component/material_container)
|
||||
var/max_multiplier
|
||||
for(var/datum/material/mat in D.materials)
|
||||
max_multiplier = min(D.maxstack, round(materials.get_material_amount(mat)/D.materials[mat]))
|
||||
if (max_multiplier>10 && !disabled)
|
||||
dat += " <a href='?src=[REF(src)];make=[D.id];multiplier=10'>x10</a>"
|
||||
if (max_multiplier>25 && !disabled)
|
||||
dat += " <a href='?src=[REF(src)];make=[D.id];multiplier=25'>x25</a>"
|
||||
if(max_multiplier > 0 && !disabled)
|
||||
dat += " <a href='?src=[REF(src)];make=[D.id];multiplier=[max_multiplier]'>x[max_multiplier]</a>"
|
||||
|
||||
dat += "[get_design_cost(D)]<br>"
|
||||
|
||||
dat += "</div>"
|
||||
return dat
|
||||
|
||||
/obj/machinery/autoylathe/proc/materials_printout()
|
||||
var/datum/component/material_container/materials = GetComponent(/datum/component/material_container)
|
||||
var/dat = "<b>Total amount:</b> [materials.total_amount] / [materials.max_amount] cm<sup>3</sup><br>"
|
||||
for(var/mat_id in materials.materials)
|
||||
var/datum/material/M = mat_id
|
||||
var/mineral_amount = materials.materials[mat_id]
|
||||
if(mineral_amount > 0)
|
||||
dat += "<b>[M.name] amount:</b> [mineral_amount] cm<sup>3</sup><br>"
|
||||
return dat
|
||||
|
||||
/obj/machinery/autoylathe/proc/can_build(datum/design/D, amount = 1)
|
||||
if(D.make_reagents.len)
|
||||
return FALSE
|
||||
|
||||
var/coeff = (ispath(D.build_path, /obj/item/stack) ? 1 : prod_coeff)
|
||||
|
||||
var/list/required_materials = list()
|
||||
|
||||
for(var/i in D.materials)
|
||||
required_materials[i] = D.materials[i] * coeff * amount
|
||||
|
||||
var/datum/component/material_container/materials = GetComponent(/datum/component/material_container)
|
||||
|
||||
return materials.has_materials(required_materials)
|
||||
|
||||
/obj/machinery/autoylathe/proc/get_design_cost(datum/design/D)
|
||||
var/coeff = (ispath(D.build_path, /obj/item/stack) ? 1 : prod_coeff)
|
||||
var/dat
|
||||
for(var/i in D.materials)
|
||||
if(istext(i)) //Category handling
|
||||
dat += "[D.materials[i] * coeff] [i]"
|
||||
else
|
||||
var/datum/material/M = i
|
||||
dat += "[D.materials[i] * coeff] [M.name] "
|
||||
return dat
|
||||
|
||||
/obj/machinery/autoylathe/proc/reset(wire)
|
||||
switch(wire)
|
||||
if(WIRE_HACK)
|
||||
if(!wires.is_cut(wire))
|
||||
adjust_hacked(FALSE)
|
||||
if(WIRE_SHOCK)
|
||||
if(!wires.is_cut(wire))
|
||||
shocked = FALSE
|
||||
if(WIRE_DISABLE)
|
||||
if(!wires.is_cut(wire))
|
||||
disabled = FALSE
|
||||
|
||||
/obj/machinery/autoylathe/proc/shock(mob/user, prb)
|
||||
if(stat & (BROKEN|NOPOWER)) // unpowered, no shock
|
||||
return FALSE
|
||||
if(!prob(prb))
|
||||
return FALSE
|
||||
var/datum/effect_system/spark_spread/s = new /datum/effect_system/spark_spread
|
||||
s.set_up(5, 1, src)
|
||||
s.start()
|
||||
if (electrocute_mob(user, get_area(src), src, 0.7, TRUE))
|
||||
return TRUE
|
||||
else
|
||||
return FALSE
|
||||
|
||||
/obj/machinery/autoylathe/proc/adjust_hacked(state)
|
||||
hacked = state
|
||||
for(var/id in SSresearch.techweb_designs)
|
||||
var/datum/design/D = SSresearch.techweb_designs[id]
|
||||
if((D.build_type & AUTOYLATHE) && ("hacked" in D.category))
|
||||
if(hacked)
|
||||
stored_research.add_design(D)
|
||||
else
|
||||
stored_research.remove_design(D)
|
||||
|
||||
/obj/machinery/autoylathe/hacked/Initialize()
|
||||
. = ..()
|
||||
adjust_hacked(TRUE)
|
||||
|
||||
//Called when the object is constructed by an autoylathe
|
||||
//Has a reference to the autoylathe so you can do !!FUN!! things with hacked lathes
|
||||
/obj/item/proc/autoylathe_crafted(obj/machinery/autoylathe/A)
|
||||
return
|
||||
@@ -484,7 +484,7 @@
|
||||
|
||||
/obj/item/punching_glove/throw_impact(atom/hit_atom, datum/thrownthing/throwingdatum)
|
||||
if(!..())
|
||||
if(ismovableatom(hit_atom))
|
||||
if(ismovable(hit_atom))
|
||||
var/atom/movable/AM = hit_atom
|
||||
AM.safe_throw_at(get_edge_target_turf(AM,get_dir(src, AM)), 7, 2)
|
||||
qdel(src)
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
var/processing_queue = 0
|
||||
var/screen = "main"
|
||||
var/temp
|
||||
var/offstation_security_levels = TRUE
|
||||
var/list/part_sets = list(
|
||||
"Cyborg",
|
||||
"Ripley",
|
||||
@@ -72,6 +73,8 @@
|
||||
for(var/obj/item/stock_parts/manipulator/Ml in component_parts)
|
||||
T += Ml.rating
|
||||
time_coeff = round(initial(time_coeff) - (initial(time_coeff)*(T))/5,0.01)
|
||||
var/obj/item/circuitboard/machine/mechfab/C = circuit
|
||||
offstation_security_levels = C.offstation_security_levels
|
||||
|
||||
/obj/machinery/mecha_part_fabricator/examine(mob/user)
|
||||
. = ..()
|
||||
@@ -106,13 +109,27 @@
|
||||
if(!(set_name in D.category))
|
||||
continue
|
||||
output += "<div class='part'>[output_part_info(D)]<br>\["
|
||||
if(check_resources(D))
|
||||
if(check_clearance(D) && check_resources(D))
|
||||
output += "<a href='?src=[REF(src)];part=[D.id]'>Build</a> | "
|
||||
output += "<a href='?src=[REF(src)];add_to_queue=[D.id]'>Add to queue</a>\]\[<a href='?src=[REF(src)];part_desc=[D.id]'>?</a>\]</div>"
|
||||
return output
|
||||
|
||||
/obj/machinery/mecha_part_fabricator/proc/check_clearance(datum/design/D)
|
||||
if(!(obj_flags & EMAGGED) && (offstation_security_levels || is_station_level(z)) && !ISINRANGE(GLOB.security_level, D.min_security_level, D.max_security_level))
|
||||
return FALSE
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/mecha_part_fabricator/proc/output_part_info(datum/design/D)
|
||||
var/output = "[initial(D.name)] (Cost: [output_part_cost(D)]) [get_construction_time_w_coeff(D)/10]sec"
|
||||
var/clearance = !(obj_flags & EMAGGED) && (offstation_security_levels || is_station_level(z))
|
||||
var/sec_text = ""
|
||||
if(clearance && (D.min_security_level > SEC_LEVEL_GREEN || D.max_security_level < SEC_LEVEL_DELTA))
|
||||
sec_text = " (Allowed security levels: "
|
||||
for(var/n in D.min_security_level to D.max_security_level)
|
||||
sec_text += NUM2SECLEVEL(n)
|
||||
if(n + 1 <= D.max_security_level)
|
||||
sec_text += ", "
|
||||
sec_text += ") "
|
||||
var/output = "[initial(D.name)] (Cost: [output_part_cost(D)]) [sec_text][get_construction_time_w_coeff(D)/10]sec"
|
||||
return output
|
||||
|
||||
/obj/machinery/mecha_part_fabricator/proc/output_part_cost(datum/design/D)
|
||||
@@ -216,6 +233,11 @@
|
||||
while(D)
|
||||
if(stat&(NOPOWER|BROKEN))
|
||||
return FALSE
|
||||
if(!check_clearance(D))
|
||||
say("Security level not met. Queue processing stopped.")
|
||||
temp = {"<span class='alert'>Security level not met to build next part.</span><br>
|
||||
<a href='?src=[REF(src)];process_queue=1'>Try again</a> | <a href='?src=[REF(src)];clear_temp=1'>Return</a><a>"}
|
||||
return FALSE
|
||||
if(!check_resources(D))
|
||||
say("Not enough resources. Queue processing stopped.")
|
||||
temp = {"<span class='alert'>Not enough resources to build next part.</span><br>
|
||||
@@ -236,7 +258,7 @@
|
||||
for(var/datum/design/D in queue)
|
||||
i++
|
||||
var/obj/part = D.build_path
|
||||
output += "<li[!check_resources(D)?" style='color: #f00;'":null]>"
|
||||
output += "<li[(!check_clearance(D) ||!check_resources(D))?" style='color: #f00;'":null]>"
|
||||
output += initial(part.name) + " - "
|
||||
output += "[i>1?"<a href='?src=[REF(src)];queue_move=-1;index=[i]' class='arrow'>↑</a>":null] "
|
||||
output += "[i<queue.len?"<a href='?src=[REF(src)];queue_move=+1;index=[i]' class='arrow'>↓</a>":null] "
|
||||
@@ -440,3 +462,7 @@
|
||||
return FALSE
|
||||
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/mecha_part_fabricator/offstation
|
||||
offstation_security_levels = FALSE
|
||||
circuit = /obj/item/circuitboard/machine/mechfab/offstation
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
target = get_turf(src)
|
||||
|
||||
if(acid_amt)
|
||||
acid_level = min( (CLAMP(round(acid_amt, 1), 0, INFINITY)) *acid_pwr, 12000) //capped so the acid effect doesn't last a half hour on the floor.
|
||||
acid_level = min( (clamp(round(acid_amt, 1), 0, INFINITY)) *acid_pwr, 12000) //capped so the acid effect doesn't last a half hour on the floor.
|
||||
|
||||
//handle APCs and newscasters and stuff nicely
|
||||
pixel_x = target.pixel_x + rand(-4,4)
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
move_resist = INFINITY
|
||||
obj_flags = 0
|
||||
|
||||
vis_flags = NONE
|
||||
vis_flags = VIS_INHERIT_PLANE
|
||||
|
||||
/obj/effect/take_damage(damage_amount, damage_type = BRUTE, damage_flag = 0, sound_effect = 1, attack_dir)
|
||||
return
|
||||
|
||||
@@ -170,7 +170,7 @@
|
||||
if(!victim.client || !istype(victim))
|
||||
return
|
||||
to_chat(victim, "<span class='notice'>You feel fast!</span>")
|
||||
victim.add_movespeed_modifier(MOVESPEED_ID_YELLOW_ORB, update=TRUE, priority=100, multiplicative_slowdown=-2, blacklisted_movetypes=(FLYING|FLOATING))
|
||||
victim.add_movespeed_modifier(/datum/movespeed_modifier/yellow_orb)
|
||||
sleep(duration)
|
||||
victim.remove_movespeed_modifier(MOVESPEED_ID_YELLOW_ORB)
|
||||
victim.remove_movespeed_modifier(/datum/movespeed_modifier/yellow_orb)
|
||||
to_chat(victim, "<span class='notice'>You slow down.</span>")
|
||||
|
||||
@@ -49,5 +49,6 @@
|
||||
/obj/effect/overlay/vis
|
||||
mouse_opacity = MOUSE_OPACITY_TRANSPARENT
|
||||
anchored = TRUE
|
||||
vis_flags = NONE
|
||||
var/unused = 0 //When detected to be unused it gets set to world.time, after a while it gets removed
|
||||
var/cache_expiration = 2 MINUTES // overlays which go unused for 2 minutes get cleaned up
|
||||
|
||||
@@ -521,7 +521,7 @@
|
||||
/obj/item/gun/ballistic/automatic/toy/pistol = 5,
|
||||
/obj/item/firing_pin = 5,
|
||||
/obj/item/grenade/empgrenade = 15,
|
||||
/obj/item/clothing/gloves/combat = 10,
|
||||
/obj/item/clothing/gloves/tackler/combat/insulated = 10,
|
||||
/obj/item/clothing/shoes/sneakers/noslip = 10
|
||||
)
|
||||
|
||||
|
||||
@@ -52,7 +52,7 @@
|
||||
var/list/affecting = list()
|
||||
|
||||
/obj/effect/step_trigger/thrower/Trigger(atom/A)
|
||||
if(!A || !ismovableatom(A))
|
||||
if(!A || !ismovable(A))
|
||||
return
|
||||
var/atom/movable/AM = A
|
||||
var/curtiles = 0
|
||||
|
||||
@@ -392,7 +392,8 @@ GLOBAL_VAR_INIT(rpg_loot_items, FALSE)
|
||||
if(item_flags & DROPDEL)
|
||||
qdel(src)
|
||||
item_flags &= ~IN_INVENTORY
|
||||
SEND_SIGNAL(src, COMSIG_ITEM_DROPPED,user)
|
||||
if(SEND_SIGNAL(src, COMSIG_ITEM_DROPPED,user) & COMPONENT_DROPPED_RELOCATION)
|
||||
. = ITEM_RELOCATED_BY_DROPPED
|
||||
user.update_equipment_speed_mods()
|
||||
|
||||
// called just as an item is picked up (loc is not yet changed)
|
||||
@@ -433,11 +434,12 @@ GLOBAL_VAR_INIT(rpg_loot_items, FALSE)
|
||||
// for items that can be placed in multiple slots
|
||||
// note this isn't called during the initial dressing of a player
|
||||
/obj/item/proc/equipped(mob/user, slot)
|
||||
SEND_SIGNAL(src, COMSIG_ITEM_EQUIPPED, user, slot)
|
||||
for(var/X in actions)
|
||||
var/datum/action/A = X
|
||||
if(item_action_slot_check(slot, user, A)) //some items only give their actions buttons when in a specific slot.
|
||||
A.Grant(user)
|
||||
. = SEND_SIGNAL(src, COMSIG_ITEM_EQUIPPED, user, slot)
|
||||
if(!(. & COMPONENT_NO_GRANT_ACTIONS))
|
||||
for(var/X in actions)
|
||||
var/datum/action/A = X
|
||||
if(item_action_slot_check(slot, user, A)) //some items only give their actions buttons when in a specific slot.
|
||||
A.Grant(user)
|
||||
item_flags |= IN_INVENTORY
|
||||
user.update_equipment_speed_mods()
|
||||
|
||||
@@ -896,3 +898,11 @@ GLOBAL_VAR_INIT(rpg_loot_items, FALSE)
|
||||
. = ..()
|
||||
if(var_name == NAMEOF(src, slowdown))
|
||||
set_slowdown(var_value) //don't care if it's a duplicate edit as slowdown'll be set, do it anyways to force normal behavior.
|
||||
|
||||
//Called when the object is constructed by an autolathe
|
||||
//Has a reference to the autolathe so you can do !!FUN!! things with hacked lathes
|
||||
/obj/item/proc/autolathe_crafted(obj/machinery/autolathe/A)
|
||||
return
|
||||
|
||||
/obj/item/proc/rnd_crafted(obj/machinery/rnd/production/P)
|
||||
return
|
||||
|
||||
@@ -258,6 +258,8 @@ update_label("John Doe", "Clowny")
|
||||
chameleon_action.chameleon_type = /obj/item/card/id
|
||||
chameleon_action.chameleon_name = "ID Card"
|
||||
chameleon_action.initialize_disguises()
|
||||
if(!anyone)
|
||||
AddComponent(/datum/component/identification/syndicate, ID_COMPONENT_DEL_ON_IDENTIFY, ID_COMPONENT_EFFECT_NO_ACTIONS, NONE) //no deconstructive analyzer usage.
|
||||
|
||||
/obj/item/card/id/syndicate/afterattack(obj/item/O, mob/user, proximity)
|
||||
if(!proximity)
|
||||
|
||||
@@ -193,7 +193,7 @@
|
||||
|
||||
/obj/effect/chrono_field/update_icon()
|
||||
var/ttk_frame = 1 - (tickstokill / initial(tickstokill))
|
||||
ttk_frame = CLAMP(CEILING(ttk_frame * CHRONO_FRAME_COUNT, 1), 1, CHRONO_FRAME_COUNT)
|
||||
ttk_frame = clamp(CEILING(ttk_frame * CHRONO_FRAME_COUNT, 1), 1, CHRONO_FRAME_COUNT)
|
||||
if(ttk_frame != RPpos)
|
||||
RPpos = ttk_frame
|
||||
mob_underlay.icon_state = "frame[RPpos]"
|
||||
|
||||
@@ -308,6 +308,13 @@
|
||||
/obj/item/stock_parts/manipulator = 1,
|
||||
/obj/item/stock_parts/micro_laser = 1,
|
||||
/obj/item/stack/sheet/glass = 1)
|
||||
var/offstation_security_levels = TRUE
|
||||
|
||||
/obj/item/circuitboard/machine/mechfab/offstation
|
||||
offstation_security_levels = FALSE
|
||||
|
||||
/obj/item/circuitboard/machine/mechfab/rnd_crafted(obj/machinery/rnd/production/P)
|
||||
offstation_security_levels = P.offstation_security_levels
|
||||
|
||||
/obj/item/circuitboard/machine/cryo_tube
|
||||
name = "Cryotube (Machine Board)"
|
||||
@@ -759,6 +766,13 @@
|
||||
/obj/item/stock_parts/matter_bin = 1,
|
||||
/obj/item/stock_parts/manipulator = 1,
|
||||
/obj/item/reagent_containers/glass/beaker = 2)
|
||||
var/offstation_security_levels = TRUE
|
||||
|
||||
/obj/item/circuitboard/machine/circuit_imprinter/offstation
|
||||
offstation_security_levels = FALSE
|
||||
|
||||
/obj/item/circuitboard/machine/mechfab/rnd_crafted(obj/machinery/rnd/production/P)
|
||||
offstation_security_levels = P.offstation_security_levels
|
||||
|
||||
/obj/item/circuitboard/machine/circuit_imprinter/department
|
||||
name = "Departmental Circuit Imprinter (Machine Board)"
|
||||
@@ -804,7 +818,7 @@
|
||||
var/new_cloud = input("Set the public nanite chamber's Cloud ID (1-100).", "Cloud ID", cloud_id) as num|null
|
||||
if(new_cloud == null)
|
||||
return
|
||||
cloud_id = CLAMP(round(new_cloud, 1), 1, 100)
|
||||
cloud_id = clamp(round(new_cloud, 1), 1, 100)
|
||||
|
||||
/obj/item/circuitboard/machine/public_nanite_chamber/examine(mob/user)
|
||||
. = ..()
|
||||
@@ -832,6 +846,13 @@
|
||||
/obj/item/stock_parts/matter_bin = 2,
|
||||
/obj/item/stock_parts/manipulator = 2,
|
||||
/obj/item/reagent_containers/glass/beaker = 2)
|
||||
var/offstation_security_levels = TRUE
|
||||
|
||||
/obj/item/circuitboard/machine/protolathe/offstation
|
||||
offstation_security_levels = FALSE
|
||||
|
||||
/obj/item/circuitboard/machine/protolathe/rnd_crafted(obj/machinery/rnd/production/P)
|
||||
offstation_security_levels = P.offstation_security_levels
|
||||
|
||||
/obj/item/circuitboard/machine/protolathe/department
|
||||
name = "Departmental Protolathe (Machine Board)"
|
||||
@@ -1033,9 +1054,9 @@
|
||||
build_path = /obj/machinery/vending/kink
|
||||
req_components = list(/obj/item/vending_refill/kink = 1)
|
||||
|
||||
/obj/item/circuitboard/machine/autoylathe
|
||||
/obj/item/circuitboard/machine/autolathe/toy
|
||||
name = "Autoylathe (Machine Board)"
|
||||
build_path = /obj/machinery/autoylathe
|
||||
build_path = /obj/machinery/autolathe/toy
|
||||
req_components = list(
|
||||
/obj/item/stock_parts/matter_bin = 3,
|
||||
/obj/item/stock_parts/manipulator = 1,
|
||||
|
||||
@@ -59,7 +59,7 @@
|
||||
|
||||
var/edible = TRUE // That doesn't mean eating it is a good idea
|
||||
|
||||
var/list/reagent_contents = list(/datum/reagent/consumable/nutriment = 1)
|
||||
var/list/reagent_contents = list(/datum/reagent/consumable/nutriment = 0.1)
|
||||
// If the user can toggle the colour, a la vanilla spraycan
|
||||
var/can_change_colour = FALSE
|
||||
|
||||
@@ -346,8 +346,8 @@
|
||||
var/clicky
|
||||
|
||||
if(click_params && click_params["icon-x"] && click_params["icon-y"])
|
||||
clickx = CLAMP(text2num(click_params["icon-x"]) - 16, -(world.icon_size/2), world.icon_size/2)
|
||||
clicky = CLAMP(text2num(click_params["icon-y"]) - 16, -(world.icon_size/2), world.icon_size/2)
|
||||
clickx = clamp(text2num(click_params["icon-x"]) - 16, -(world.icon_size/2), world.icon_size/2)
|
||||
clicky = clamp(text2num(click_params["icon-y"]) - 16, -(world.icon_size/2), world.icon_size/2)
|
||||
|
||||
if(!instant)
|
||||
to_chat(user, "<span class='notice'>You start drawing a [temp] on the [target.name]...</span>")
|
||||
@@ -487,56 +487,56 @@
|
||||
icon_state = "crayonred"
|
||||
paint_color = "#DA0000"
|
||||
crayon_color = "red"
|
||||
reagent_contents = list(/datum/reagent/consumable/nutriment = 1, /datum/reagent/colorful_reagent/crayonpowder/red = 1)
|
||||
reagent_contents = list(/datum/reagent/consumable/nutriment = 0.1, /datum/reagent/colorful_reagent/crayonpowder/red = 0.9)
|
||||
dye_color = DYE_RED
|
||||
|
||||
/obj/item/toy/crayon/orange
|
||||
icon_state = "crayonorange"
|
||||
paint_color = "#FF9300"
|
||||
crayon_color = "orange"
|
||||
reagent_contents = list(/datum/reagent/consumable/nutriment = 1, /datum/reagent/colorful_reagent/crayonpowder/orange = 1)
|
||||
reagent_contents = list(/datum/reagent/consumable/nutriment = 0.1, /datum/reagent/colorful_reagent/crayonpowder/orange = 0.9)
|
||||
dye_color = DYE_ORANGE
|
||||
|
||||
/obj/item/toy/crayon/yellow
|
||||
icon_state = "crayonyellow"
|
||||
paint_color = "#FFF200"
|
||||
crayon_color = "yellow"
|
||||
reagent_contents = list(/datum/reagent/consumable/nutriment = 1, /datum/reagent/colorful_reagent/crayonpowder/yellow = 1)
|
||||
reagent_contents = list(/datum/reagent/consumable/nutriment = 0.1, /datum/reagent/colorful_reagent/crayonpowder/yellow = 0.9)
|
||||
dye_color = DYE_YELLOW
|
||||
|
||||
/obj/item/toy/crayon/green
|
||||
icon_state = "crayongreen"
|
||||
paint_color = "#A8E61D"
|
||||
crayon_color = "green"
|
||||
reagent_contents = list(/datum/reagent/consumable/nutriment = 1, /datum/reagent/colorful_reagent/crayonpowder/green = 1)
|
||||
reagent_contents = list(/datum/reagent/consumable/nutriment = 0.1, /datum/reagent/colorful_reagent/crayonpowder/green = 0.9)
|
||||
dye_color = DYE_GREEN
|
||||
|
||||
/obj/item/toy/crayon/blue
|
||||
icon_state = "crayonblue"
|
||||
paint_color = "#00B7EF"
|
||||
crayon_color = "blue"
|
||||
reagent_contents = list(/datum/reagent/consumable/nutriment = 1, /datum/reagent/colorful_reagent/crayonpowder/blue = 1)
|
||||
reagent_contents = list(/datum/reagent/consumable/nutriment = 0.1, /datum/reagent/colorful_reagent/crayonpowder/blue = 0.9)
|
||||
dye_color = DYE_BLUE
|
||||
|
||||
/obj/item/toy/crayon/purple
|
||||
icon_state = "crayonpurple"
|
||||
paint_color = "#DA00FF"
|
||||
crayon_color = "purple"
|
||||
reagent_contents = list(/datum/reagent/consumable/nutriment = 1, /datum/reagent/colorful_reagent/crayonpowder/purple = 1)
|
||||
reagent_contents = list(/datum/reagent/consumable/nutriment = 0.1, /datum/reagent/colorful_reagent/crayonpowder/purple = 0.9)
|
||||
dye_color = DYE_PURPLE
|
||||
|
||||
/obj/item/toy/crayon/black
|
||||
icon_state = "crayonblack"
|
||||
paint_color = "#1C1C1C" //Not completely black because total black looks bad. So Mostly Black.
|
||||
crayon_color = "black"
|
||||
reagent_contents = list(/datum/reagent/consumable/nutriment = 1, /datum/reagent/colorful_reagent/crayonpowder/black = 1)
|
||||
reagent_contents = list(/datum/reagent/consumable/nutriment = 0.1, /datum/reagent/colorful_reagent/crayonpowder/black = 0.9)
|
||||
dye_color = DYE_BLACK
|
||||
|
||||
/obj/item/toy/crayon/white
|
||||
icon_state = "crayonwhite"
|
||||
paint_color = "#FFFFFF"
|
||||
crayon_color = "white"
|
||||
reagent_contents = list(/datum/reagent/consumable/nutriment = 1, /datum/reagent/colorful_reagent/crayonpowder/white = 1)
|
||||
reagent_contents = list(/datum/reagent/consumable/nutriment = 0.1, /datum/reagent/colorful_reagent/crayonpowder/white = 0.9)
|
||||
dye_color = DYE_WHITE
|
||||
|
||||
/obj/item/toy/crayon/mime
|
||||
@@ -544,7 +544,7 @@
|
||||
desc = "A very sad-looking crayon."
|
||||
paint_color = "#FFFFFF"
|
||||
crayon_color = "mime"
|
||||
reagent_contents = list(/datum/reagent/consumable/nutriment = 1, /datum/reagent/colorful_reagent/crayonpowder/invisible = 1)
|
||||
reagent_contents = list(/datum/reagent/consumable/nutriment = 0.1, /datum/reagent/colorful_reagent/crayonpowder/invisible = 0.9)
|
||||
charges = -1
|
||||
dye_color = DYE_MIME
|
||||
|
||||
@@ -552,10 +552,9 @@
|
||||
icon_state = "crayonrainbow"
|
||||
paint_color = "#FFF000"
|
||||
crayon_color = "rainbow"
|
||||
reagent_contents = list(/datum/reagent/consumable/nutriment = 1, /datum/reagent/colorful_reagent = 1)
|
||||
reagent_contents = list(/datum/reagent/consumable/nutriment = 0.1, /datum/reagent/colorful_reagent = 0.9)
|
||||
drawtype = RANDOM_ANY // just the default starter.
|
||||
dye_color = DYE_RAINBOW
|
||||
|
||||
charges = -1
|
||||
|
||||
/obj/item/toy/crayon/rainbow/afterattack(atom/target, mob/user, proximity, params)
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
var/new_duration = input(user, "Set the duration (5-300):", "Desynchronizer", duration / 10) as null|num
|
||||
if(new_duration)
|
||||
new_duration = new_duration SECONDS
|
||||
new_duration = CLAMP(new_duration, 50, max_duration)
|
||||
new_duration = clamp(new_duration, 50, max_duration)
|
||||
duration = new_duration
|
||||
to_chat(user, "<span class='notice'>You set the duration to [DisplayTimeText(duration)].</span>")
|
||||
return TRUE
|
||||
|
||||
@@ -75,7 +75,7 @@ GLOBAL_LIST_EMPTY(GPS_list)
|
||||
if(!ui)
|
||||
// Variable window height, depending on how many GPS units there are
|
||||
// to show, clamped to relatively safe range.
|
||||
var/gps_window_height = CLAMP(325 + GLOB.GPS_list.len * 14, 325, 700)
|
||||
var/gps_window_height = clamp(325 + GLOB.GPS_list.len * 14, 325, 700)
|
||||
ui = new(user, src, ui_key, "gps", "Global Positioning System", 470, gps_window_height, master_ui, state) //width, height
|
||||
ui.open()
|
||||
|
||||
|
||||
@@ -171,7 +171,7 @@
|
||||
|
||||
// Negative numbers will subtract
|
||||
/obj/item/lightreplacer/proc/AddUses(amount = 1)
|
||||
uses = CLAMP(uses + amount, 0, max_uses)
|
||||
uses = clamp(uses + amount, 0, max_uses)
|
||||
|
||||
/obj/item/lightreplacer/proc/AddShards(amount = 1, user)
|
||||
bulb_shards += amount
|
||||
|
||||
@@ -81,7 +81,7 @@
|
||||
if(!usr.canUseTopic(src, BE_CLOSE))
|
||||
return
|
||||
new_code = round(new_code)
|
||||
new_code = CLAMP(new_code, 1, 100)
|
||||
new_code = clamp(new_code, 1, 100)
|
||||
code = new_code
|
||||
|
||||
if(href_list["set"] == "power")
|
||||
|
||||
@@ -232,7 +232,7 @@ effective or pretty fucking useless.
|
||||
charge = max(0,charge - 25)//Quick decrease in light
|
||||
else
|
||||
charge = min(max_charge,charge + 50) //Charge in the dark
|
||||
animate(user,alpha = CLAMP(255 - charge,0,255),time = 10)
|
||||
animate(user,alpha = clamp(255 - charge,0,255),time = 10)
|
||||
|
||||
|
||||
/obj/item/jammer
|
||||
|
||||
@@ -170,7 +170,7 @@
|
||||
/obj/item/dice/proc/diceroll(mob/user)
|
||||
result = roll(sides)
|
||||
if(rigged && result != rigged)
|
||||
if(prob(CLAMP(1/(sides - 1) * 100, 25, 80)))
|
||||
if(prob(clamp(1/(sides - 1) * 100, 25, 80)))
|
||||
result = rigged
|
||||
var/fake_result = roll(sides)//Daredevil isn't as good as he used to be
|
||||
var/comment = ""
|
||||
|
||||
@@ -57,6 +57,35 @@
|
||||
on_reading_finished(user)
|
||||
reading = FALSE
|
||||
return TRUE
|
||||
///TRAITS///
|
||||
|
||||
/obj/item/book/granter/trait
|
||||
var/granted_trait
|
||||
var/traitname = "being cool"
|
||||
|
||||
/obj/item/book/granter/trait/already_known(mob/user)
|
||||
if(!granted_trait)
|
||||
return TRUE
|
||||
if(HAS_TRAIT(user, granted_trait))
|
||||
to_chat(user, "<span class ='notice'>You already have all the insight you need about [traitname].")
|
||||
return TRUE
|
||||
return FALSE
|
||||
|
||||
/obj/item/book/granter/trait/on_reading_start(mob/user)
|
||||
to_chat(user, "<span class='notice'>You start reading about [traitname]...</span>")
|
||||
|
||||
/obj/item/book/granter/trait/on_reading_finished(mob/user)
|
||||
to_chat(user, "<span class='notice'>You feel like you've got a good handle on [traitname]!</span>")
|
||||
ADD_TRAIT(user, granted_trait, BOOK_TRAIT)
|
||||
|
||||
/obj/item/book/granter/trait/rifleman
|
||||
name = "\proper the Neo-Russian Rifleman\'s Primer"
|
||||
desc = "A book with stains of vodka and...blood? The back is hard to read, but says something about bolt-actions. Or pump-actions. Both, maybe."
|
||||
oneuse = FALSE
|
||||
granted_trait = TRAIT_FAST_PUMP
|
||||
traitname = "riflery"
|
||||
icon_state = "book1"
|
||||
remarks = list("One smooth motion...", "Palm the bolt...", "Push up, rotate back, push forward, down...", "Don't slap yourself with the bolt...", "Wait, what's this about pumping?", "Who just scribbled \"Z\" and \"LMB\" on this page?")
|
||||
|
||||
///ACTION BUTTONS///
|
||||
|
||||
|
||||
@@ -94,7 +94,7 @@
|
||||
return
|
||||
var/newtime = input(usr, "Please set the timer.", "Timer", 10) as num
|
||||
if(user.get_active_held_item() == src)
|
||||
newtime = CLAMP(newtime, 10, 60000)
|
||||
newtime = clamp(newtime, 10, 60000)
|
||||
det_time = newtime
|
||||
to_chat(user, "Timer set for [det_time] seconds.")
|
||||
|
||||
|
||||
@@ -197,9 +197,9 @@
|
||||
/obj/item/his_grace/proc/adjust_bloodthirst(amt)
|
||||
prev_bloodthirst = bloodthirst
|
||||
if(prev_bloodthirst < HIS_GRACE_CONSUME_OWNER && !ascended)
|
||||
bloodthirst = CLAMP(bloodthirst + amt, HIS_GRACE_SATIATED, HIS_GRACE_CONSUME_OWNER)
|
||||
bloodthirst = clamp(bloodthirst + amt, HIS_GRACE_SATIATED, HIS_GRACE_CONSUME_OWNER)
|
||||
else if(!ascended)
|
||||
bloodthirst = CLAMP(bloodthirst + amt, HIS_GRACE_CONSUME_OWNER, HIS_GRACE_FALL_ASLEEP)
|
||||
bloodthirst = clamp(bloodthirst + amt, HIS_GRACE_CONSUME_OWNER, HIS_GRACE_FALL_ASLEEP)
|
||||
update_stats()
|
||||
|
||||
/obj/item/his_grace/proc/update_stats()
|
||||
|
||||
@@ -239,19 +239,29 @@
|
||||
if(user.mind && (user.mind.isholy) && !reskinned)
|
||||
reskin_holy_weapon(user)
|
||||
|
||||
/**
|
||||
* reskin_holy_weapon: Shows a user a list of all available nullrod reskins and based on his choice replaces the nullrod with the reskinned version
|
||||
*
|
||||
* Arguments:
|
||||
* * M The mob choosing a nullrod reskin
|
||||
*/
|
||||
/obj/item/nullrod/proc/reskin_holy_weapon(mob/living/L)
|
||||
if(GLOB.holy_weapon_type)
|
||||
return
|
||||
var/obj/item/holy_weapon
|
||||
var/list/holy_weapons_list = subtypesof(/obj/item/nullrod) + list(HOLY_WEAPONS)
|
||||
var/list/display_names = list()
|
||||
var/list/nullrod_icons = list()
|
||||
for(var/V in holy_weapons_list)
|
||||
var/obj/item/nullrod/rodtype = V
|
||||
if (initial(rodtype.chaplain_spawnable))
|
||||
display_names[initial(rodtype.name)] = rodtype
|
||||
nullrod_icons += list(initial(rodtype.name) = image(icon = initial(rodtype.icon), icon_state = initial(rodtype.icon_state)))
|
||||
|
||||
var/choice = input(L, "What theme would you like for your holy weapon?","Holy Weapon Theme") as null|anything in display_names
|
||||
if(QDELETED(src) || !choice || !in_range(L, src) || !CHECK_MOBILITY(L, MOBILITY_USE) || reskinned)
|
||||
nullrod_icons = sortList(nullrod_icons)
|
||||
|
||||
var/choice = show_radial_menu(L, src , nullrod_icons, custom_check = CALLBACK(src, .proc/check_menu, L), radius = 42, require_near = TRUE)
|
||||
if(!choice || !check_menu(L))
|
||||
return
|
||||
|
||||
var/A = display_names[choice] // This needs to be on a separate var as list member access is not allowed for new
|
||||
@@ -266,6 +276,21 @@
|
||||
qdel(src)
|
||||
L.put_in_active_hand(holy_weapon)
|
||||
|
||||
/**
|
||||
* check_menu: Checks if we are allowed to interact with a radial menu
|
||||
*
|
||||
* Arguments:
|
||||
* * user The mob interacting with a menu
|
||||
*/
|
||||
/obj/item/nullrod/proc/check_menu(mob/user)
|
||||
if(!istype(user))
|
||||
return FALSE
|
||||
if(QDELETED(src) || reskinned)
|
||||
return FALSE
|
||||
if(user.incapacitated() || !user.is_holding(src))
|
||||
return FALSE
|
||||
return TRUE
|
||||
|
||||
/obj/item/nullrod/proc/jedi_spin(mob/living/user)
|
||||
for(var/i in list(NORTH,SOUTH,EAST,WEST,EAST,SOUTH,NORTH,SOUTH,EAST,WEST,EAST,SOUTH))
|
||||
user.setDir(i)
|
||||
|
||||
@@ -74,7 +74,7 @@
|
||||
L.SetAllImmobility(0)
|
||||
L.SetSleeping(0)
|
||||
L.SetUnconscious(0)
|
||||
L.reagents.add_reagent(/datum/reagent/medicine/muscle_stimulant, CLAMP(5 - L.reagents.get_reagent_amount(/datum/reagent/medicine/muscle_stimulant), 0, 5)) //If you don't have legs or get bola'd, tough luck!
|
||||
L.reagents.add_reagent(/datum/reagent/medicine/muscle_stimulant, clamp(5 - L.reagents.get_reagent_amount(/datum/reagent/medicine/muscle_stimulant), 0, 5)) //If you don't have legs or get bola'd, tough luck!
|
||||
colorize(L)
|
||||
|
||||
/obj/item/hot_potato/examine(mob/user)
|
||||
|
||||
@@ -201,8 +201,8 @@
|
||||
return target
|
||||
var/x_o = (target.x - starting.x)
|
||||
var/y_o = (target.y - starting.y)
|
||||
var/new_x = CLAMP((starting.x + (x_o * range_multiplier)), 0, world.maxx)
|
||||
var/new_y = CLAMP((starting.y + (y_o * range_multiplier)), 0, world.maxy)
|
||||
var/new_x = clamp((starting.x + (x_o * range_multiplier)), 0, world.maxx)
|
||||
var/new_y = clamp((starting.y + (y_o * range_multiplier)), 0, world.maxy)
|
||||
var/turf/newtarget = locate(new_x, new_y, starting.z)
|
||||
return newtarget
|
||||
|
||||
|
||||
@@ -649,7 +649,7 @@
|
||||
continue
|
||||
usage += projectile_tick_speed_ecost
|
||||
usage += (tracked[I] * projectile_damage_tick_ecost_coefficient)
|
||||
energy = CLAMP(energy - usage, 0, maxenergy)
|
||||
energy = clamp(energy - usage, 0, maxenergy)
|
||||
if(energy <= 0)
|
||||
deactivate_field()
|
||||
visible_message("<span class='warning'>[src] blinks \"ENERGY DEPLETED\".</span>")
|
||||
@@ -659,7 +659,7 @@
|
||||
if(iscyborg(host.loc))
|
||||
host = host.loc
|
||||
else
|
||||
energy = CLAMP(energy + energy_recharge, 0, maxenergy)
|
||||
energy = clamp(energy + energy_recharge, 0, maxenergy)
|
||||
return
|
||||
if(host.cell && (host.cell.charge >= (host.cell.maxcharge * cyborg_cell_critical_percentage)) && (energy < maxenergy))
|
||||
host.cell.use(energy_recharge*energy_recharge_cyborg_drain_coefficient)
|
||||
|
||||
@@ -35,14 +35,14 @@
|
||||
if(TH.force_wielded > initial(TH.force_wielded))
|
||||
to_chat(user, "<span class='warning'>[TH] has already been refined before. It cannot be sharpened further!</span>")
|
||||
return
|
||||
TH.force_wielded = CLAMP(TH.force_wielded + increment, 0, max)//wieldforce is increased since normal force wont stay
|
||||
TH.force_wielded = clamp(TH.force_wielded + increment, 0, max)//wieldforce is increased since normal force wont stay
|
||||
if(I.force > initial(I.force))
|
||||
to_chat(user, "<span class='warning'>[I] has already been refined before. It cannot be sharpened further!</span>")
|
||||
return
|
||||
user.visible_message("<span class='notice'>[user] sharpens [I] with [src]!</span>", "<span class='notice'>You sharpen [I], making it much more deadly than before.</span>")
|
||||
I.sharpness = IS_SHARP_ACCURATE
|
||||
I.force = CLAMP(I.force + increment, 0, max)
|
||||
I.throwforce = CLAMP(I.throwforce + increment, 0, max)
|
||||
I.force = clamp(I.force + increment, 0, max)
|
||||
I.throwforce = clamp(I.throwforce + increment, 0, max)
|
||||
I.name = "[prefix] [I.name]"
|
||||
name = "worn out [name]"
|
||||
desc = "[desc] At least, it used to."
|
||||
|
||||
@@ -33,11 +33,11 @@
|
||||
return TRUE
|
||||
|
||||
/obj/item/shield/alt_pre_attack(atom/A, mob/living/user, params)
|
||||
user_shieldbash(user, A, user.a_intent != INTENT_HARM)
|
||||
user_shieldbash(user, A, user.a_intent == INTENT_HARM)
|
||||
return TRUE
|
||||
|
||||
/obj/item/shield/altafterattack(atom/target, mob/user, proximity_flag, click_parameters)
|
||||
user_shieldbash(user, target, user.a_intent != INTENT_HARM)
|
||||
user_shieldbash(user, target, user.a_intent == INTENT_HARM)
|
||||
return TRUE
|
||||
|
||||
/obj/item/shield/proc/do_shieldbash_effect(mob/living/user, dir, harmful)
|
||||
@@ -52,13 +52,13 @@
|
||||
px = 12
|
||||
if(WEST)
|
||||
px = -12
|
||||
var/oldpx = user.pixel_x
|
||||
var/oldpy = user.pixel_y
|
||||
animate(user, pixel_x = px, pixel_y = py, time = 3, easing = SINE_EASING | EASE_OUT, flags = ANIMATION_END_NOW)
|
||||
animate(user, pixel_x = oldpx, pixel_y = oldpy, time = 3)
|
||||
user.visible_message("<span class='warning'>[user] [harmful? "charges forwards with" : "sweeps"] [src]!</span>")
|
||||
var/obj/effect/temp_visual/dir_setting/shield_bash/effect = new(user.loc, dir)
|
||||
animate(effect, alpha = 0, pixel_x = px + 4, pixel_y = py + 4, time = 3)
|
||||
effect.pixel_x = user.pixel_x - 32 //96x96 effect, -32.
|
||||
effect.pixel_y = user.pixel_y - 32
|
||||
user.visible_message("<span class='warning'>[user] [harmful? "charges forwards with" : "sweeps"] [src]!</span>")
|
||||
animate(user, pixel_x = px, pixel_y = py, time = 3, easing = SINE_EASING | EASE_OUT, flags = ANIMATION_PARALLEL | ANIMATION_RELATIVE)
|
||||
animate(user, pixel_x = -px, pixel_y = -py, time = 3, flags = ANIMATION_RELATIVE)
|
||||
animate(effect, alpha = 0, pixel_x = px * 1.5, pixel_y = py * 1.5, time = 3, flags = ANIMATION_PARALLEL | ANIMATION_RELATIVE)
|
||||
|
||||
/obj/item/shield/proc/bash_target(mob/living/user, mob/living/target, bashdir, harmful)
|
||||
if(!(target.status_flags & CANKNOCKDOWN) || HAS_TRAIT(src, TRAIT_STUNIMMUNE)) // should probably add stun absorption check at some point I guess..
|
||||
@@ -76,7 +76,7 @@
|
||||
"<span class='warning'>[user] shoves you with [src]!</span>")
|
||||
for(var/i in 1 to harmful? shieldbash_knockback : shieldbash_push_distance)
|
||||
var/turf/new_turf = get_step(target, bashdir)
|
||||
var/mob/living/carbon/human/H = locate() in new_turf
|
||||
var/mob/living/carbon/human/H = locate() in (new_turf.contents - target)
|
||||
if(H && harmful)
|
||||
H.visible_message("<span class='warning'>[target] is sent crashing into [H]!</span>",
|
||||
"<span class='userdanger'>[target] is sent crashing into you!</span>")
|
||||
@@ -110,10 +110,14 @@
|
||||
if(!(shield_flags & SHIELD_CAN_BASH))
|
||||
to_chat(user, "<span class='warning'>[src] can't be used to shield bash!</span>")
|
||||
return FALSE
|
||||
if(!CHECK_MOBILITY(user, MOBILITY_STAND))
|
||||
to_chat(user, "<span class='warning'>You can't bash with [src] while on the ground!</span>")
|
||||
return FALSE
|
||||
if(world.time < last_shieldbash + shieldbash_cooldown)
|
||||
to_chat(user, "<span class='warning'>You can't bash with [src] again so soon!</span>")
|
||||
return FALSE
|
||||
if(isliving(target)) //GROUND SLAAAM
|
||||
var/mob/living/livingtarget = target //only access after an isliving check!
|
||||
if(isliving(target) && !CHECK_MOBILITY(livingtarget, MOBILITY_STAND)) //GROUND SLAAAM
|
||||
if(!(shield_flags & SHIELD_BASH_GROUND_SLAM))
|
||||
to_chat(user, "<span class='warning'>You can't ground slam with [src]!</span>")
|
||||
return FALSE
|
||||
@@ -122,7 +126,7 @@
|
||||
playsound(src, harmful? "swing_hit" : 'sound/weapons/thudswoosh.ogg', 75, 1)
|
||||
last_shieldbash = world.time
|
||||
user.adjustStaminaLossBuffered(shieldbash_stamcost)
|
||||
return 1
|
||||
return TRUE
|
||||
// Directional sweep!
|
||||
last_shieldbash = world.time
|
||||
user.adjustStaminaLossBuffered(shieldbash_stamcost)
|
||||
@@ -164,11 +168,12 @@
|
||||
attack_verb = list("shoved", "bashed")
|
||||
var/cooldown = 0 //shield bash cooldown. based on world.time
|
||||
var/repair_material = /obj/item/stack/sheet/mineral/titanium
|
||||
var/can_shatter = TRUE
|
||||
shield_flags = SHIELD_FLAGS_DEFAULT | SHIELD_TRANSPARENT
|
||||
max_integrity = 75
|
||||
|
||||
/obj/item/shield/run_block(mob/living/owner, atom/object, damage, attack_text, attack_type, armour_penetration, mob/attacker, def_zone, final_block_chance, list/block_return)
|
||||
if(ismovableatom(object))
|
||||
if(ismovable(object))
|
||||
var/atom/movable/AM = object
|
||||
if(CHECK_BITFIELD(shield_flags, SHIELD_TRANSPARENT) && (AM.pass_flags & PASSGLASS))
|
||||
return BLOCK_NONE
|
||||
@@ -213,7 +218,7 @@
|
||||
new /obj/item/shard((get_turf(src)))
|
||||
|
||||
/obj/item/shield/riot/on_shield_block(mob/living/owner, atom/object, damage, attack_text, attack_type, armour_penetration, mob/attacker, def_zone, final_block_chance, list/block_return)
|
||||
if(obj_integrity <= damage)
|
||||
if(can_shatter && (obj_integrity <= damage))
|
||||
var/turf/T = get_turf(owner)
|
||||
T.visible_message("<span class='warning'>[attack_text] destroys [src]!</span>")
|
||||
shatter(owner)
|
||||
@@ -324,7 +329,6 @@ obj/item/shield/riot/bullet_proof
|
||||
armor = list("melee" = 25, "bullet" = 25, "laser" = 5, "energy" = 0, "bomb" = 30, "bio" = 0, "rad" = 0, "fire" = 70, "acid" = 80)
|
||||
lefthand_file = 'icons/mob/inhands/equipment/shields_lefthand.dmi'
|
||||
righthand_file = 'icons/mob/inhands/equipment/shields_righthand.dmi'
|
||||
icon = 'icons/obj/items_and_weapons.dmi'
|
||||
item_state = "metal"
|
||||
icon_state = "makeshift_shield"
|
||||
custom_materials = list(/datum/material/iron = 18000)
|
||||
@@ -340,7 +344,6 @@ obj/item/shield/riot/bullet_proof
|
||||
armor = list("melee" = 95, "bullet" = 95, "laser" = 75, "energy" = 60, "bomb" = 90, "bio" = 90, "rad" = 0, "fire" = 90, "acid" = 10) //Armor for the item, dosnt transfer to user
|
||||
item_state = "metal"
|
||||
icon_state = "metal"
|
||||
icon = 'icons/obj/items_and_weapons.dmi'
|
||||
block_chance = 75 //1/4 shots will hit*
|
||||
force = 16
|
||||
slowdown = 2
|
||||
@@ -356,20 +359,47 @@ obj/item/shield/riot/bullet_proof
|
||||
block_chance = 50
|
||||
|
||||
/obj/item/shield/riot/implant
|
||||
name = "riot tower shield"
|
||||
desc = "A massive shield that can block a lot of attacks and can take a lot of abuse before breaking." //It cant break unless it is removed from the implant
|
||||
name = "telescoping shield implant"
|
||||
desc = "A compact, arm-mounted telescopic shield. While nigh-indestructible when powered by a host user, it will eventually overload from damage. Recharges while inside its implant."
|
||||
item_state = "metal"
|
||||
icon_state = "metal"
|
||||
block_chance = 30 //May be big but hard to move around to block.
|
||||
block_chance = 50
|
||||
slowdown = 1
|
||||
shield_flags = SHIELD_FLAGS_DEFAULT
|
||||
max_integrity = 60
|
||||
obj_integrity = 60
|
||||
can_shatter = FALSE
|
||||
item_flags = SLOWS_WHILE_IN_HAND
|
||||
var/recharge_timerid
|
||||
var/recharge_delay = 15 SECONDS
|
||||
|
||||
/obj/item/shield/riot/implant/run_block(mob/living/owner, atom/object, damage, attack_text, attack_type, armour_penetration, mob/attacker, def_zone, final_block_chance, list/block_return)
|
||||
if(attack_type & ATTACK_TYPE_PROJECTILE)
|
||||
final_block_chance = 60 //Massive shield
|
||||
return ..()
|
||||
/// Entirely overriden take_damage. This shouldn't exist outside of an implant (other than maybe christmas).
|
||||
/obj/item/shield/riot/implant/take_damage(damage_amount, damage_type = BRUTE, damage_flag = 0, sound_effect = 1, attack_dir, armour_penetration = 0)
|
||||
obj_integrity -= damage_amount
|
||||
if(obj_integrity < 0)
|
||||
obj_integrity = 0
|
||||
if(obj_integrity == 0)
|
||||
if(ismob(loc))
|
||||
var/mob/living/L = loc
|
||||
playsound(src, 'sound/effects/glassbr3.ogg', 100)
|
||||
L.visible_message("<span class='boldwarning'>[src] overloads from the damage sustained!</span>")
|
||||
L.dropItemToGround(src) //implant component catch hook will grab it.
|
||||
|
||||
/obj/item/shield/riot/implant/Moved()
|
||||
. = ..()
|
||||
if(istype(loc, /obj/item/organ/cyberimp/arm/shield))
|
||||
recharge_timerid = addtimer(CALLBACK(src, .proc/recharge), recharge_delay, flags = TIMER_STOPPABLE)
|
||||
else //extending
|
||||
if(recharge_timerid)
|
||||
deltimer(recharge_timerid)
|
||||
recharge_timerid = null
|
||||
|
||||
/obj/item/shield/riot/implant/proc/recharge()
|
||||
if(obj_integrity == max_integrity)
|
||||
return
|
||||
obj_integrity = max_integrity
|
||||
if(ismob(loc.loc)) //cyberimplant.user
|
||||
to_chat(loc, "<span class='notice'>[src] has recharged its reinforcement matrix and is ready for use!</span>")
|
||||
|
||||
/obj/item/shield/energy
|
||||
name = "energy combat shield"
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
|
||||
/obj/item/twohanded/singularityhammer/proc/vortex(turf/pull, mob/wielder)
|
||||
for(var/atom/X in orange(5,pull))
|
||||
if(ismovableatom(X))
|
||||
if(ismovable(X))
|
||||
var/atom/movable/A = X
|
||||
if(A == wielder)
|
||||
continue
|
||||
|
||||
@@ -100,6 +100,7 @@
|
||||
if(!H.bleedsuppress && H.bleed_rate) //so you can't stack bleed suppression
|
||||
H.suppress_bloodloss(stop_bleeding)
|
||||
to_chat(user, "<span class='notice'>You stop the bleeding of [M]!</span>")
|
||||
H.adjustBruteLoss(-(heal_brute))
|
||||
return TRUE
|
||||
to_chat(user, "<span class='notice'>You can not use \the [src] on [M]!</span>")
|
||||
|
||||
@@ -127,6 +128,12 @@
|
||||
stop_bleeding = 900
|
||||
heal_brute = 0
|
||||
|
||||
/obj/item/stack/medical/gauze/adv
|
||||
name = "sterilized medical gauze"
|
||||
desc = "A roll of elastic sterilized cloth that is extremely effective at stopping bleeding, heals minor wounds and cleans them."
|
||||
singular_name = "sterilized medical gauze"
|
||||
self_delay = 5
|
||||
|
||||
/obj/item/stack/medical/gauze/cyborg
|
||||
custom_materials = null
|
||||
is_cyborg = 1
|
||||
|
||||
@@ -71,9 +71,9 @@
|
||||
|
||||
/obj/item/stack/proc/update_weight()
|
||||
if(amount <= (max_amount * (1/3)))
|
||||
w_class = CLAMP(full_w_class-2, WEIGHT_CLASS_TINY, full_w_class)
|
||||
w_class = clamp(full_w_class-2, WEIGHT_CLASS_TINY, full_w_class)
|
||||
else if (amount <= (max_amount * (2/3)))
|
||||
w_class = CLAMP(full_w_class-1, WEIGHT_CLASS_TINY, full_w_class)
|
||||
w_class = clamp(full_w_class-1, WEIGHT_CLASS_TINY, full_w_class)
|
||||
else
|
||||
w_class = full_w_class
|
||||
|
||||
|
||||
@@ -412,7 +412,7 @@
|
||||
STR.max_combined_w_class = 200
|
||||
STR.max_items = 25
|
||||
STR.insert_preposition = "in"
|
||||
STR.can_hold = typecacheof(list(/obj/item/slime_extract, /obj/item/reagent_containers/syringe, /obj/item/reagent_containers/glass/beaker, /obj/item/reagent_containers/glass/bottle, /obj/item/reagent_containers/blood, /obj/item/reagent_containers/hypospray/medipen, /obj/item/reagent_containers/food/snacks/deadmouse, /obj/item/reagent_containers/food/snacks/monkeycube, /obj/item/organ, /obj/item/reagent_containers/food/snacks/meat/slab, /obj/item/bodypart))
|
||||
STR.can_hold = typecacheof(list(/obj/item/slime_extract, /obj/item/reagent_containers/syringe, /obj/item/reagent_containers/glass/beaker, /obj/item/reagent_containers/glass/bottle, /obj/item/reagent_containers/blood, /obj/item/reagent_containers/hypospray/medipen, /obj/item/reagent_containers/food/snacks/deadmouse, /obj/item/reagent_containers/food/snacks/cube, /obj/item/organ, /obj/item/reagent_containers/food/snacks/meat/slab, /obj/item/bodypart))
|
||||
STR.cant_hold = typecacheof(list(/obj/item/organ/brain, /obj/item/organ/liver/cybernetic, /obj/item/organ/heart/cybernetic, /obj/item/organ/lungs/cybernetic, /obj/item/organ/tongue/cybernetic, /obj/item/organ/ears/cybernetic, /obj/item/organ/eyes/robotic, /obj/item/organ/cyberimp))
|
||||
|
||||
/obj/item/storage/bag/bio/holding
|
||||
|
||||
@@ -695,7 +695,10 @@
|
||||
/obj/item/gun/ballistic/revolver,
|
||||
/obj/item/ammo_box,
|
||||
/obj/item/toy/gun,
|
||||
/obj/item/gun/energy/e_gun/mini
|
||||
/obj/item/gun/energy/e_gun/mini,
|
||||
/obj/item/gun/ballistic/automatic/magrifle/pistol,
|
||||
/obj/item/gun/energy/disabler,
|
||||
/obj/item/gun/energy/taser
|
||||
))
|
||||
|
||||
/obj/item/storage/belt/holster/full/PopulateContents()
|
||||
|
||||
@@ -454,11 +454,11 @@
|
||||
. = ..()
|
||||
var/datum/component/storage/STR = GetComponent(/datum/component/storage)
|
||||
STR.max_items = 7
|
||||
STR.can_hold = typecacheof(list(/obj/item/reagent_containers/food/snacks/monkeycube))
|
||||
STR.can_hold = typecacheof(list(/obj/item/reagent_containers/food/snacks/cube/monkey))
|
||||
|
||||
/obj/item/storage/box/monkeycubes/PopulateContents()
|
||||
for(var/i in 1 to 5)
|
||||
new /obj/item/reagent_containers/food/snacks/monkeycube(src)
|
||||
new /obj/item/reagent_containers/food/snacks/cube/monkey(src)
|
||||
|
||||
/obj/item/storage/box/ids
|
||||
name = "box of spare IDs"
|
||||
@@ -1117,9 +1117,9 @@
|
||||
desc = "A box containing a gift for worthy golems."
|
||||
|
||||
/obj/item/storage/box/rndboards/PopulateContents()
|
||||
new /obj/item/circuitboard/machine/protolathe(src)
|
||||
new /obj/item/circuitboard/machine/protolathe/offstation(src)
|
||||
new /obj/item/circuitboard/machine/destructive_analyzer(src)
|
||||
new /obj/item/circuitboard/machine/circuit_imprinter(src)
|
||||
new /obj/item/circuitboard/machine/circuit_imprinter/offstation(src)
|
||||
new /obj/item/circuitboard/computer/rdconsole(src)
|
||||
|
||||
/obj/item/storage/box/silver_sulf
|
||||
|
||||
@@ -138,7 +138,7 @@ GLOBAL_LIST_EMPTY(rubber_toolbox_icons)
|
||||
new /obj/item/crowbar/red(src)
|
||||
new /obj/item/wirecutters(src, "red")
|
||||
new /obj/item/multitool(src)
|
||||
new /obj/item/clothing/gloves/combat(src)
|
||||
new /obj/item/clothing/gloves/tackler/combat/insulated(src)
|
||||
|
||||
/obj/item/storage/toolbox/drone
|
||||
name = "mechanical toolbox"
|
||||
@@ -311,7 +311,7 @@ GLOBAL_LIST_EMPTY(rubber_toolbox_icons)
|
||||
new /obj/item/crowbar/red(src)
|
||||
new /obj/item/wirecutters(src, "red")
|
||||
new /obj/item/multitool/ai_detect(src)
|
||||
new /obj/item/clothing/gloves/combat(src)
|
||||
new /obj/item/clothing/gloves/tackler/combat/insulated(src)
|
||||
|
||||
/obj/item/storage/toolbox/gold_real/ComponentInitialize()
|
||||
. = ..()
|
||||
|
||||
@@ -294,18 +294,18 @@
|
||||
name = "chameleon kit"
|
||||
|
||||
/obj/item/storage/box/syndie_kit/chameleon/PopulateContents()
|
||||
new /obj/item/clothing/under/chameleon(src)
|
||||
new /obj/item/clothing/suit/chameleon(src)
|
||||
new /obj/item/clothing/gloves/chameleon(src)
|
||||
new /obj/item/clothing/shoes/chameleon(src)
|
||||
new /obj/item/clothing/glasses/chameleon(src)
|
||||
new /obj/item/clothing/head/chameleon(src)
|
||||
new /obj/item/clothing/mask/chameleon(src)
|
||||
new /obj/item/storage/backpack/chameleon(src)
|
||||
new /obj/item/radio/headset/chameleon(src)
|
||||
new /obj/item/stamp/chameleon(src)
|
||||
new /obj/item/pda/chameleon(src)
|
||||
new /obj/item/clothing/neck/cloak/chameleon(src)
|
||||
new /obj/item/clothing/under/chameleon/syndicate(src)
|
||||
new /obj/item/clothing/suit/chameleon/syndicate(src)
|
||||
new /obj/item/clothing/gloves/chameleon/insulated/syndicate(src)
|
||||
new /obj/item/clothing/shoes/chameleon/syndicate(src)
|
||||
new /obj/item/clothing/glasses/chameleon/syndicate(src)
|
||||
new /obj/item/clothing/head/chameleon/syndicate(src)
|
||||
new /obj/item/clothing/mask/chameleon/syndicate(src)
|
||||
new /obj/item/storage/backpack/chameleon/syndicate(src)
|
||||
new /obj/item/radio/headset/chameleon/syndicate(src)
|
||||
new /obj/item/stamp/chameleon/syndicate(src)
|
||||
new /obj/item/pda/chameleon/syndicate(src)
|
||||
new /obj/item/clothing/neck/cloak/chameleon/syndicate(src)
|
||||
|
||||
//5*(2*4) = 5*8 = 45, 45 damage if you hit one person with all 5 stars.
|
||||
//Not counting the damage it will do while embedded (2*4 = 8, at 15% chance)
|
||||
@@ -501,3 +501,13 @@
|
||||
new item2(src)
|
||||
new item3(src)
|
||||
new /obj/item/paper/contractor_guide(src) //Paper guide
|
||||
|
||||
/obj/item/storage/box/syndie_kit/northstar
|
||||
|
||||
/obj/item/storage/box/syndie_kit/northstar/PopulateContents()
|
||||
new /obj/item/clothing/gloves/fingerless/pugilist/rapid(src)
|
||||
new /obj/item/clothing/accessory/padding(src)
|
||||
new /obj/item/clothing/under/chameleon(src)
|
||||
new /obj/item/storage/fancy/cigarettes/cigpack_syndicate(src)
|
||||
new /obj/item/lighter(src)
|
||||
|
||||
|
||||
@@ -52,7 +52,7 @@
|
||||
ion_trail.start()
|
||||
RegisterSignal(user, COMSIG_MOVABLE_MOVED, .proc/move_react)
|
||||
if(full_speed)
|
||||
user.add_movespeed_modifier(MOVESPEED_ID_JETPACK, priority=100, multiplicative_slowdown=-2, movetypes=FLOATING, conflict=MOVE_CONFLICT_JETPACK)
|
||||
user.add_movespeed_modifier(/datum/movespeed_modifier/jetpack/fullspeed)
|
||||
|
||||
/obj/item/tank/jetpack/proc/turn_off(mob/user)
|
||||
on = FALSE
|
||||
@@ -60,7 +60,7 @@
|
||||
icon_state = initial(icon_state)
|
||||
ion_trail.stop()
|
||||
UnregisterSignal(user, COMSIG_MOVABLE_MOVED)
|
||||
user.remove_movespeed_modifier(MOVESPEED_ID_JETPACK)
|
||||
user.remove_movespeed_modifier(/datum/movespeed_modifier/jetpack/fullspeed)
|
||||
|
||||
/obj/item/tank/jetpack/proc/move_react(mob/user)
|
||||
allow_thrust(0.01, user)
|
||||
|
||||
@@ -204,7 +204,7 @@
|
||||
pressure = text2num(pressure)
|
||||
. = TRUE
|
||||
if(.)
|
||||
distribute_pressure = CLAMP(round(pressure), TANK_MIN_RELEASE_PRESSURE, TANK_MAX_RELEASE_PRESSURE)
|
||||
distribute_pressure = clamp(round(pressure), TANK_MIN_RELEASE_PRESSURE, TANK_MAX_RELEASE_PRESSURE)
|
||||
|
||||
/obj/item/tank/remove_air(amount)
|
||||
return air_contents.remove(amount)
|
||||
|
||||
@@ -256,7 +256,7 @@
|
||||
. = ..()
|
||||
if(!sliver)
|
||||
return
|
||||
if(proximity && ismovableatom(O) && O != sliver)
|
||||
if(proximity && ismovable(O) && O != sliver)
|
||||
Consume(O, user)
|
||||
|
||||
/obj/item/hemostat/supermatter/throw_impact(atom/hit_atom, datum/thrownthing/throwingdatum) // no instakill supermatter javelins
|
||||
|
||||
@@ -303,7 +303,6 @@ for further reading, please see: https://github.com/tgstation/tgstation/pull/301
|
||||
custom_materials = list(/datum/material/iron=500, /datum/material/glass=500)
|
||||
resistance_flags = FIRE_PROOF
|
||||
|
||||
|
||||
/obj/item/switchblade
|
||||
name = "switchblade"
|
||||
icon_state = "switchblade"
|
||||
@@ -639,6 +638,7 @@ for further reading, please see: https://github.com/tgstation/tgstation/pull/301
|
||||
w_class = WEIGHT_CLASS_SMALL
|
||||
//Things in this list will be instantly splatted. Flyman weakness is handled in the flyman species weakness proc.
|
||||
var/list/strong_against
|
||||
var/list/spider_panic
|
||||
|
||||
/obj/item/melee/flyswatter/Initialize()
|
||||
. = ..()
|
||||
@@ -648,7 +648,10 @@ for further reading, please see: https://github.com/tgstation/tgstation/pull/301
|
||||
/mob/living/simple_animal/cockroach,
|
||||
/obj/item/queen_bee
|
||||
))
|
||||
|
||||
spider_panic = typecacheof(list(
|
||||
/mob/living/simple_animal/banana_spider,
|
||||
/mob/living/simple_animal/hostile/poison/giant_spider,
|
||||
))
|
||||
|
||||
/obj/item/melee/flyswatter/afterattack(atom/target, mob/user, proximity_flag)
|
||||
. = ..()
|
||||
@@ -659,6 +662,11 @@ for further reading, please see: https://github.com/tgstation/tgstation/pull/301
|
||||
if(istype(target, /mob/living/))
|
||||
var/mob/living/bug = target
|
||||
bug.death(1)
|
||||
if(is_type_in_typecache(target, spider_panic))
|
||||
to_chat(user, "<span class='warning'>You easily land a critical blow on the [target].</span>")
|
||||
if(istype(target, /mob/living/))
|
||||
var/mob/living/bug = target
|
||||
bug.adjustBruteLoss(-35) //What kinda mad man would go into melee with a spider?!
|
||||
else
|
||||
qdel(target)
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
if(damage_flag)
|
||||
armor_protection = armor.getRating(damage_flag)
|
||||
if(armor_protection) //Only apply weak-against-armor/hollowpoint effects if there actually IS armor.
|
||||
armor_protection = CLAMP(armor_protection - armour_penetration, 0, 100)
|
||||
armor_protection = clamp(armor_protection - armour_penetration, 0, 100)
|
||||
return round(damage_amount * (100 - armor_protection)*0.01, DAMAGE_PRECISION)
|
||||
|
||||
//the sound played when the obj is damaged.
|
||||
@@ -213,7 +213,7 @@ GLOBAL_DATUM_INIT(acid_overlay, /mutable_appearance, mutable_appearance('icons/e
|
||||
if(T.intact && level == 1) //fire can't damage things hidden below the floor.
|
||||
return
|
||||
if(exposed_temperature && !(resistance_flags & FIRE_PROOF))
|
||||
take_damage(CLAMP(0.02 * exposed_temperature, 0, 20), BURN, "fire", 0)
|
||||
take_damage(clamp(0.02 * exposed_temperature, 0, 20), BURN, "fire", 0)
|
||||
if(!(resistance_flags & ON_FIRE) && (resistance_flags & FLAMMABLE))
|
||||
resistance_flags |= ON_FIRE
|
||||
SSfire_burning.processing[src] = src
|
||||
@@ -244,7 +244,7 @@ GLOBAL_DATUM_INIT(acid_overlay, /mutable_appearance, mutable_appearance('icons/e
|
||||
if(has_buckled_mobs())
|
||||
for(var/m in buckled_mobs)
|
||||
var/mob/living/buckled_mob = m
|
||||
buckled_mob.electrocute_act((CLAMP(round(strength/400), 10, 90) + rand(-5, 5)), src, flags = SHOCK_TESLA)
|
||||
buckled_mob.electrocute_act((clamp(round(strength/400), 10, 90) + rand(-5, 5)), src, flags = SHOCK_TESLA)
|
||||
|
||||
/obj/proc/reset_shocked()
|
||||
obj_flags &= ~BEING_SHOCKED
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
var/crit_fail = FALSE
|
||||
animate_movement = 2
|
||||
speech_span = SPAN_ROBOT
|
||||
vis_flags = VIS_INHERIT_PLANE //when this be added to vis_contents of something it inherit something.plane, important for visualisation of obj in openspace.
|
||||
var/obj_flags = CAN_BE_HIT
|
||||
var/set_obj_flags // ONLY FOR MAPPING: Sets flags from a string list, handled in Initialize. Usage: set_obj_flags = "EMAGGED;!CAN_BE_HIT" to set EMAGGED and clear CAN_BE_HIT.
|
||||
|
||||
|
||||
@@ -505,7 +505,7 @@
|
||||
/obj/structure/closet/container_resist(mob/living/user)
|
||||
if(opened)
|
||||
return
|
||||
if(ismovableatom(loc))
|
||||
if(ismovable(loc))
|
||||
user.changeNext_move(CLICK_CD_BREAKOUT)
|
||||
user.last_special = world.time + CLICK_CD_BREAKOUT
|
||||
var/atom/movable/AM = loc
|
||||
|
||||
@@ -37,8 +37,8 @@
|
||||
..()
|
||||
new /obj/item/clothing/glasses/eyepatch(src)
|
||||
new /obj/item/clothing/glasses/sunglasses(src)
|
||||
new /obj/item/clothing/gloves/combat(src)
|
||||
new /obj/item/clothing/gloves/combat(src)
|
||||
new /obj/item/clothing/gloves/tackler/combat(src)
|
||||
new /obj/item/clothing/gloves/tackler/combat(src)
|
||||
new /obj/item/clothing/head/helmet/swat(src)
|
||||
new /obj/item/clothing/head/helmet/swat(src)
|
||||
new /obj/item/clothing/mask/gas/sechailer/swat(src)
|
||||
|
||||
@@ -77,6 +77,7 @@
|
||||
new /obj/item/clothing/mask/gas(src)
|
||||
new /obj/item/clothing/glasses/meson/engine(src)
|
||||
new /obj/item/storage/box/emptysandbags(src)
|
||||
new /obj/item/cartridge/engineering(src)
|
||||
|
||||
/obj/structure/closet/secure_closet/atmospherics
|
||||
name = "\proper atmospheric technician's locker"
|
||||
@@ -97,6 +98,7 @@
|
||||
new /obj/item/clothing/head/hardhat/atmos(src)
|
||||
new /obj/item/clothing/glasses/meson/engine/tray(src)
|
||||
new /obj/item/extinguisher/advanced(src)
|
||||
new /obj/item/cartridge/atmos(src)
|
||||
|
||||
/*
|
||||
* Empty lockers
|
||||
|
||||
@@ -130,7 +130,7 @@
|
||||
if(burn_time_remaining() < MAXIMUM_BURN_TIMER)
|
||||
flame_expiry_timer = world.time + MAXIMUM_BURN_TIMER
|
||||
else
|
||||
fuel_added = CLAMP(fuel_added + amount, 0, MAXIMUM_BURN_TIMER)
|
||||
fuel_added = clamp(fuel_added + amount, 0, MAXIMUM_BURN_TIMER)
|
||||
|
||||
/obj/structure/fireplace/proc/burn_time_remaining()
|
||||
if(lit)
|
||||
|
||||
@@ -453,7 +453,7 @@
|
||||
name = "Syndicate Operative Empty"
|
||||
uniform = /obj/item/clothing/under/syndicate
|
||||
shoes = /obj/item/clothing/shoes/combat
|
||||
gloves = /obj/item/clothing/gloves/combat
|
||||
gloves = /obj/item/clothing/gloves/tackler/combat/insulated
|
||||
ears = /obj/item/radio/headset/syndicate/alt
|
||||
back = /obj/item/storage/backpack
|
||||
implants = list(/obj/item/implant/weapons_auth)
|
||||
|
||||
@@ -294,7 +294,7 @@
|
||||
|
||||
/obj/structure/girder/CanAStarPass(ID, dir, caller)
|
||||
. = !density
|
||||
if(ismovableatom(caller))
|
||||
if(ismovable(caller))
|
||||
var/atom/movable/mover = caller
|
||||
. = . || (mover.pass_flags & PASSGRILLE)
|
||||
|
||||
|
||||
@@ -129,7 +129,7 @@
|
||||
|
||||
/obj/structure/grille/CanAStarPass(ID, dir, caller)
|
||||
. = !density
|
||||
if(ismovableatom(caller))
|
||||
if(ismovable(caller))
|
||||
var/atom/movable/mover = caller
|
||||
. = . || (mover.pass_flags & PASSGRILLE)
|
||||
|
||||
|
||||
@@ -159,7 +159,7 @@
|
||||
|
||||
if(H.dna.species.use_skintones)
|
||||
var/list/choices = GLOB.skin_tones
|
||||
if(CONFIG_GET(number/allow_custom_skintones))
|
||||
if(CONFIG_GET(flag/allow_custom_skintones))
|
||||
choices += "custom"
|
||||
var/new_s_tone = input(H, "Choose your skin tone:", "Race change") as null|anything in choices
|
||||
if(new_s_tone)
|
||||
|
||||
@@ -333,7 +333,7 @@ GLOBAL_LIST_EMPTY(crematoriums)
|
||||
to_chat(user, "<span class='warning'>That's not connected to anything!</span>")
|
||||
|
||||
/obj/structure/tray/MouseDrop_T(atom/movable/O as mob|obj, mob/user)
|
||||
if(!ismovableatom(O) || O.anchored || !Adjacent(user) || !user.Adjacent(O) || O.loc == user)
|
||||
if(!ismovable(O) || O.anchored || !Adjacent(user) || !user.Adjacent(O) || O.loc == user)
|
||||
return
|
||||
if(!ismob(O))
|
||||
if(!istype(O, /obj/structure/closet/body_bag))
|
||||
@@ -375,6 +375,6 @@ GLOBAL_LIST_EMPTY(crematoriums)
|
||||
|
||||
/obj/structure/tray/m_tray/CanAStarPass(ID, dir, caller)
|
||||
. = !density
|
||||
if(ismovableatom(caller))
|
||||
if(ismovable(caller))
|
||||
var/atom/movable/mover = caller
|
||||
. = . || (mover.pass_flags & PASSTABLE)
|
||||
|
||||
@@ -103,7 +103,7 @@
|
||||
|
||||
/obj/structure/table/CanAStarPass(ID, dir, caller)
|
||||
. = !density
|
||||
if(ismovableatom(caller))
|
||||
if(ismovable(caller))
|
||||
var/atom/movable/mover = caller
|
||||
. = . || (mover.pass_flags & PASSTABLE)
|
||||
|
||||
@@ -175,8 +175,8 @@
|
||||
if(!click_params || !click_params["icon-x"] || !click_params["icon-y"])
|
||||
return
|
||||
//Clamp it so that the icon never moves more than 16 pixels in either direction (thus leaving the table turf)
|
||||
I.pixel_x = CLAMP(text2num(click_params["icon-x"]) - 16, -(world.icon_size/2), world.icon_size/2)
|
||||
I.pixel_y = CLAMP(text2num(click_params["icon-y"]) - 16, -(world.icon_size/2), world.icon_size/2)
|
||||
I.pixel_x = clamp(text2num(click_params["icon-x"]) - 16, -(world.icon_size/2), world.icon_size/2)
|
||||
I.pixel_y = clamp(text2num(click_params["icon-y"]) - 16, -(world.icon_size/2), world.icon_size/2)
|
||||
return 1
|
||||
else
|
||||
return ..()
|
||||
@@ -610,7 +610,7 @@
|
||||
|
||||
/obj/structure/rack/CanAStarPass(ID, dir, caller)
|
||||
. = !density
|
||||
if(ismovableatom(caller))
|
||||
if(ismovable(caller))
|
||||
var/atom/movable/mover = caller
|
||||
. = . || (mover.pass_flags & PASSTABLE)
|
||||
|
||||
|
||||
@@ -256,9 +256,9 @@ GLOBAL_LIST_INIT(blacklisted_automated_baseturfs, typecacheof(list(
|
||||
if(depth)
|
||||
var/list/target_baseturfs
|
||||
if(length(copytarget.baseturfs))
|
||||
// with default inputs this would be Copy(CLAMP(2, -INFINITY, baseturfs.len))
|
||||
// with default inputs this would be Copy(clamp(2, -INFINITY, baseturfs.len))
|
||||
// Don't forget a lower index is lower in the baseturfs stack, the bottom is baseturfs[1]
|
||||
target_baseturfs = copytarget.baseturfs.Copy(CLAMP(1 + ignore_bottom, 1 + copytarget.baseturfs.len - depth, copytarget.baseturfs.len))
|
||||
target_baseturfs = copytarget.baseturfs.Copy(clamp(1 + ignore_bottom, 1 + copytarget.baseturfs.len - depth, copytarget.baseturfs.len))
|
||||
else if(!ignore_bottom)
|
||||
target_baseturfs = list(copytarget.baseturfs)
|
||||
if(target_baseturfs)
|
||||
|
||||
@@ -1,7 +1,20 @@
|
||||
GLOBAL_DATUM_INIT(openspace_backdrop_one_for_all, /atom/movable/openspace_backdrop, new)
|
||||
|
||||
/atom/movable/openspace_backdrop
|
||||
name = "openspace_backdrop"
|
||||
|
||||
anchored = TRUE
|
||||
|
||||
icon = 'icons/turf/floors.dmi'
|
||||
icon_state = "grey"
|
||||
plane = OPENSPACE_BACKDROP_PLANE
|
||||
mouse_opacity = MOUSE_OPACITY_TRANSPARENT
|
||||
layer = SPLASHSCREEN_LAYER
|
||||
|
||||
/turf/open/openspace
|
||||
name = "open space"
|
||||
desc = "Watch your step!"
|
||||
icon_state = "grey"
|
||||
icon_state = "transparent"
|
||||
baseturfs = /turf/open/openspace
|
||||
CanAtmosPassVertical = ATMOS_PASS_YES
|
||||
//mouse_opacity = MOUSE_OPACITY_TRANSPARENT
|
||||
@@ -14,8 +27,9 @@
|
||||
|
||||
/turf/open/openspace/Initialize() // handle plane and layer here so that they don't cover other obs/turfs in Dream Maker
|
||||
. = ..()
|
||||
plane = FLOOR_OPENSPACE_PLANE
|
||||
plane = OPENSPACE_PLANE
|
||||
layer = OPENSPACE_LAYER
|
||||
vis_contents += GLOB.openspace_backdrop_one_for_all //Special grey square for projecting backdrop darkness filter on it.
|
||||
return INITIALIZE_HINT_LATELOAD
|
||||
|
||||
/turf/open/openspace/LateInitialize()
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
/turf
|
||||
icon = 'icons/turf/floors.dmi'
|
||||
level = 1
|
||||
vis_flags = VIS_INHERIT_PLANE|VIS_INHERIT_ID //when this be added to vis_contents of something it inherit something.plane and be associatet with something on clicking,
|
||||
//important for visualisation of turf in openspace and interraction with openspace that show you turf.
|
||||
|
||||
var/intact = 1
|
||||
|
||||
@@ -441,7 +443,7 @@
|
||||
for(var/V in contents)
|
||||
var/atom/A = V
|
||||
if(!QDELETED(A) && A.level >= affecting_level)
|
||||
if(ismovableatom(A))
|
||||
if(ismovable(A))
|
||||
var/atom/movable/AM = A
|
||||
if(!AM.ex_check(explosion_id))
|
||||
continue
|
||||
|
||||
+2
-4
@@ -10,9 +10,7 @@ GLOBAL_LIST(topic_status_cache)
|
||||
/world/New()
|
||||
enable_debugger()
|
||||
|
||||
#if DM_VERSION >= 513 && DM_BUILD >= 1506
|
||||
world.Profile(PROFILE_START)
|
||||
#endif
|
||||
|
||||
log_world("World loaded at [TIME_STAMP("hh:mm:ss", FALSE)]!")
|
||||
|
||||
@@ -300,8 +298,8 @@ GLOBAL_LIST(topic_status_cache)
|
||||
if(SSmapping.config) // this just stops the runtime, honk.
|
||||
features += "[SSmapping.config.map_name]" //CIT CHANGE - makes the hub entry display the current map
|
||||
|
||||
if(get_security_level())//CIT CHANGE - makes the hub entry show the security level
|
||||
features += "[get_security_level()] alert"
|
||||
if(NUM2SECLEVEL(GLOB.security_level))//CIT CHANGE - makes the hub entry show the security level
|
||||
features += "[NUM2SECLEVEL(GLOB.security_level)] alert"
|
||||
|
||||
if (n > 1)
|
||||
features += "~[n] players"
|
||||
|
||||
Reference in New Issue
Block a user