Merge branch 'master' into movespeed_modifiers_take_two

This commit is contained in:
kevinz000
2020-02-21 01:38:09 -07:00
committed by GitHub
365 changed files with 4129 additions and 4231 deletions
+108
View File
@@ -0,0 +1,108 @@
# dmdoc
[DOCUMENTATION]: http://codedocs.tgstation13.org
[BYOND]: https://secure.byond.com/
[DMDOC]: https://github.com/SpaceManiac/SpacemanDMM/tree/master/src/dmdoc
[DMDOC] is a documentation generator for DreamMaker, the scripting language
of the [BYOND] game engine. It produces simple static HTML files based on
documented files, macros, types, procs, and vars.
We use **dmdoc** to generate [DOCUMENTATION] for our code, and that documentation
is automatically generated and built on every new commit to the master branch
This gives new developers a clickable reference [DOCUMENTATION] they can browse to better help
gain understanding of the /tg/station codebase structure and api reference.
## Documenting code on /tg/station
We use block comments to document procs and classes, and we use `///` line comments
when documenting individual variables.
It is required that all new code be covered with DMdoc code, according to the [Requirements](#Required)
We also require that when you touch older code, you must document the functions that you
have touched in the process of updating that code
### Required
A class *must* always be autodocumented, and all public functions *must* be documented
All class level defined variables *must* be documented
Internal functions *should* be documented, but may not be
A public function is any function that a developer might reasonably call while using
or interating with your object. Internal functions are helper functions that your
public functions rely on to implement logic
### Documenting a proc
When documenting a proc, we give a short one line description (as this is shown
next to the proc definition in the list of all procs for a type or global
namespace), then a longer paragraph which will be shown when the user clicks on
the proc to jump to it's definition
```
/**
* Short description of the proc
*
* Longer detailed paragraph about the proc
* including any relevant detail
* Arguments:
* * arg1 - Relevance of this argument
* * arg2 - Relevance of this argument
*/
```
### Documenting a class
We first give the name of the class as a header, this can be omitted if the name is
just going to be the typepath of the class, as dmdoc uses that by default
Then we give a short oneline description of the class
Finally we give a longer multi paragraph description of the class and it's details
```
/**
* # Classname (Can be omitted if it's just going to be the typepath)
*
* The short overview
*
* A longer
* paragraph of functionality about the class
* including any assumptions/special cases
*
*/
```
### Documenting a variable
Give a short explanation of what the variable is in the context of the class.
```
/// Type path of item to go in suit slot
var/suit = null
```
## Module level description of code
Modules are the best way to describe the structure/intent of a package of code
where you don't want to be tied to the formal layout of the class structure.
On /tg/station we do this by adding markdown files inside the `code` directory
that will also be rendered and added to the modules tree. The structure for
these is deliberately not defined, so you can be as freeform and as wheeling as
you would like.
[Here is a representative example of what you might write](http://codedocs.tgstation13.org/code/modules/keybindings/readme.html)
## Special variables
You can use certain special template variables in DM DOC comments and they will be expanded
```
[DEFINE_NAME] - Expands to a link to the define definition if documented
[/mob] - Expands to a link to the docs for the /mob class
[/mob/proc/Dizzy] - Expands to a link that will take you to the /mob class and anchor you to the dizzy proc docs
[/mob/var/stat] - Expands to a link that will take you to the /mob class and anchor you to the stat var docs
```
You can customise the link name by using `[link name][link shorthand].`
eg. `[see more about dizzy here] [/mob/proc/Dizzy]`
This is very useful to quickly link to other parts of the autodoc code to expand
upon a comment made, or reasoning about code
+1
View File
@@ -2,6 +2,7 @@
"map_name": "Kilo Station",
"map_path": "map_files/KiloStation",
"map_file": "KiloStation.dmm",
"space_ruin_levels": 4,
"shuttles": {
"emergency": "emergency_kilo",
"ferry": "ferry_kilo",
+1
View File
@@ -267,6 +267,7 @@
// /obj/item/clothing signals
#define COMSIG_SHOES_STEP_ACTION "shoes_step_action" //from base of obj/item/clothing/shoes/proc/step_action(): ()
#define COMSIG_SUIT_SPACE_TOGGLE "suit_space_toggle" //from base of /obj/item/clothing/suit/space/proc/toggle_spacesuit(): (obj/item/clothing/suit/space/suit)
// /obj/item/implant signals
#define COMSIG_IMPLANT_ACTIVATED "implant_activated" //from base of /obj/item/implant/proc/activate(): ()
+5 -9
View File
@@ -16,7 +16,7 @@
#define TICK_USAGE_TO_MS(starting_tickusage) (TICK_DELTA_TO_MS(TICK_USAGE_REAL - starting_tickusage))
#define PERCENT(val) (round((val)*100, 0.1))
#define CLAMP01(x) (CLAMP(x, 0, 1))
#define CLAMP01(x) (clamp(x, 0, 1))
//time of day but automatically adjusts to the server going into the next day within the same round.
//for when you need a reliable time number that doesn't depend on byond time.
@@ -30,18 +30,14 @@
// round() acts like floor(x, 1) by default but can't handle other values
#define FLOOR(x, y) ( round((x) / (y)) * (y) )
#define CLAMP(CLVALUE,CLMIN,CLMAX) clamp(CLVALUE, CLMIN, CLMAX)
// Similar to clamp but the bottom rolls around to the top and vice versa. min is inclusive, max is exclusive
#define WRAP(val, min, max) ( min == max ? min : (val) - (round(((val) - (min))/((max) - (min))) * ((max) - (min))) )
// Real modulus that handles decimals
#define MODULUS(x, y) ( (x) - (y) * round((x) / (y)) )
// Tangent
#define TAN(x) tan(x)
// Cotangent
#define COT(x) (1 / TAN(x))
#define COT(x) (1 / tan(x))
// Secant
#define SEC(x) (1 / cos(x))
@@ -179,8 +175,8 @@
while(pixel_y < -16)
pixel_y += 32
new_y--
new_x = CLAMP(new_x, 0, world.maxx)
new_y = CLAMP(new_y, 0, world.maxy)
new_x = clamp(new_x, 0, world.maxx)
new_y = clamp(new_y, 0, world.maxy)
return locate(new_x, new_y, starting.z)
// Returns a list where [1] is all x values and [2] is all y values that overlap between the given pair of rectangles
@@ -205,7 +201,7 @@
#define EXP_DISTRIBUTION(desired_mean) ( -(1/(1/desired_mean)) * log(rand(1, 1000) * 0.001) )
#define LORENTZ_DISTRIBUTION(x, s) ( s*TAN(TODEGREES(PI*(rand()-0.5))) + x )
#define LORENTZ_DISTRIBUTION(x, s) ( s*tan(TODEGREES(PI*(rand()-0.5))) + x )
#define LORENTZ_CUMULATIVE_DISTRIBUTION(x, y, s) ( (1/PI)*TORADIANS(arctan((x-y)/s)) + 1/2 )
#define RULE_OF_THREE(a, b, x) ((a*x)/b)
+1
View File
@@ -266,6 +266,7 @@ GLOBAL_LIST_INIT(pda_styles, sortList(list(MONO, VT, ORBITRON, SHARE)))
#define FIRST_DIAG_STEP 1
#define SECOND_DIAG_STEP 2
#define DEADCHAT_ANNOUNCEMENT "announcement"
#define DEADCHAT_ARRIVALRATTLE "arrivalrattle"
#define DEADCHAT_DEATHRATTLE "deathrattle"
#define DEADCHAT_LAWCHANGE "lawchange"
+4 -2
View File
@@ -4,11 +4,11 @@
//Bot defines, placed here so they can be read by other things!
#define BOT_STEP_DELAY 4 //Delay between movemements
#define BOT_STEP_MAX_RETRIES 5 //Maximum times a bot will retry to step from its position
#define BOT_STEP_MAX_RETRIES 5 //Maximum times a bot will retry to step from its position
#define DEFAULT_SCAN_RANGE 7 //default view range for finding targets.
//Mode defines
//Mode defines. If you add a new one make sure you update mode_name in /mob/living/simple_animal/bot
#define BOT_IDLE 0 // idle
#define BOT_HUNT 1 // found target, hunting
#define BOT_PREP_ARREST 2 // at target, preparing to arrest
@@ -27,6 +27,7 @@
#define BOT_NAV 15 // computing navigation
#define BOT_WAIT_FOR_NAV 16 // waiting for nav computation
#define BOT_NO_ROUTE 17 // no destination beacon found (or no route)
#define BOT_SHOWERSTANCE 18 // cleaning unhygienic humans
//Bot types
#define SEC_BOT (1<<0) // Secutritrons (Beepsky) and ED-209s
@@ -36,6 +37,7 @@
#define MED_BOT (1<<4) // Medibots
#define HONK_BOT (1<<5) // Honkbots & ED-Honks
#define FIRE_BOT (1<<6) // Firebots
#define HYGIENE_BOT (1<<7) // Hygienebots
//AI notification defines
#define NEW_BORG 1
+16
View File
@@ -1,6 +1,10 @@
// rust_g.dm - DM API for rust_g extension library
#define RUST_G "rust_g"
#define RUSTG_JOB_NO_RESULTS_YET "NO RESULTS YET"
#define RUSTG_JOB_NO_SUCH_JOB "NO SUCH JOB"
#define RUSTG_JOB_ERROR "JOB PANICKED"
#define rustg_dmi_strip_metadata(fname) call(RUST_G, "dmi_strip_metadata")(fname)
#define rustg_git_revparse(rev) call(RUST_G, "rg_git_revparse")(rev)
@@ -8,3 +12,15 @@
#define rustg_log_write(fname, text) call(RUST_G, "log_write")(fname, text)
/proc/rustg_log_close_all() return call(RUST_G, "log_close_all")()
// RUST-G defines & procs for HTTP component
#define RUSTG_HTTP_METHOD_GET "get"
#define RUSTG_HTTP_METHOD_POST "post"
#define RUSTG_HTTP_METHOD_PUT "put"
#define RUSTG_HTTP_METHOD_DELETE "delete"
#define RUSTG_HTTP_METHOD_PATCH "patch"
#define RUSTG_HTTP_METHOD_HEAD "head"
#define rustg_http_request_blocking(method, url, body, headers) call(RUST_G, "http_request_blocking")(method, url, body, headers)
#define rustg_http_request_async(method, url, body, headers) call(RUST_G, "http_request_async")(method, url, body, headers)
#define rustg_http_check_request(req_id) call(RUST_G, "http_check_request")(req_id)
+1
View File
@@ -157,6 +157,7 @@ Remember to update _globalvars/traits.dm if you're adding/removing/renaming trai
#define TRAIT_NOFLASH "noflash" //Makes you immune to flashes
#define TRAIT_XENO_IMMUNE "xeno_immune"//prevents xeno huggies implanting skeletons
#define TRAIT_NAIVE "naive"
#define TRAIT_GUNFLIP "gunflip"
//non-mob traits
#define TRAIT_PARALYSIS "paralysis" //Used for limb-based paralysis, where replacing the limb will fix it
+1 -1
View File
@@ -425,7 +425,7 @@ GLOBAL_LIST_EMPTY(species_list)
var/override = FALSE
if(M.client.holder && (chat_toggles & CHAT_DEAD))
override = TRUE
if(HAS_TRAIT(M, TRAIT_SIXTHSENSE))
if(HAS_TRAIT(M, TRAIT_SIXTHSENSE) && message_type == DEADCHAT_REGULAR)
override = TRUE
if(isnewplayer(M) && !override)
continue
+2 -2
View File
@@ -2,9 +2,9 @@
/proc/sanitize_frequency(frequency, free = FALSE)
frequency = round(frequency)
if(free)
. = CLAMP(frequency, MIN_FREE_FREQ, MAX_FREE_FREQ)
. = clamp(frequency, MIN_FREE_FREQ, MAX_FREE_FREQ)
else
. = CLAMP(frequency, MIN_FREQ, MAX_FREQ)
. = clamp(frequency, MIN_FREQ, MAX_FREQ)
if(!(. % 2)) // Ensure the last digit is an odd number
. += 1
+4 -3
View File
@@ -54,8 +54,9 @@
if(!GLOB.chemical_reactions_list)
return
for(var/reagent in GLOB.chemical_reactions_list)
for(var/datum/chemical_reaction/R in GLOB.chemical_reactions_list[reagent])
if(R.id == id)
for(var/R in GLOB.chemical_reactions_list[reagent])
var/datum/reac = R
if(reac.type == id)
return R
/proc/remove_chemical_reaction(datum/chemical_reaction/R)
@@ -66,7 +67,7 @@
//see build_chemical_reactions_list in holder.dm for explanations
/proc/add_chemical_reaction(datum/chemical_reaction/R)
if(!GLOB.chemical_reactions_list || !R.id || !R.required_reagents || !R.required_reagents.len)
if(!GLOB.chemical_reactions_list || !R.required_reagents || !R.required_reagents.len)
return
var/primary_reagent = R.required_reagents[1]
if(!GLOB.chemical_reactions_list[primary_reagent])
+4 -4
View File
@@ -850,8 +850,8 @@ GLOBAL_LIST_INIT(WALLITEMS_INVERSE, typecacheof(list(
tX = splittext(tX[1], ":")
tX = tX[1]
var/list/actual_view = getviewsize(C ? C.view : world.view)
tX = CLAMP(origin.x + text2num(tX) - round(actual_view[1] / 2) - 1, 1, world.maxx)
tY = CLAMP(origin.y + text2num(tY) - round(actual_view[2] / 2) - 1, 1, world.maxy)
tX = clamp(origin.x + text2num(tX) - round(actual_view[1] / 2) - 1, 1, world.maxx)
tY = clamp(origin.y + text2num(tY) - round(actual_view[2] / 2) - 1, 1, world.maxy)
return locate(tX, tY, tZ)
/proc/screen_loc2turf(text, turf/origin, client/C)
@@ -864,8 +864,8 @@ GLOBAL_LIST_INIT(WALLITEMS_INVERSE, typecacheof(list(
tX = text2num(tX[2])
tZ = origin.z
var/list/actual_view = getviewsize(C ? C.view : world.view)
tX = CLAMP(origin.x + round(actual_view[1] / 2) - tX, 1, world.maxx)
tY = CLAMP(origin.y + round(actual_view[2] / 2) - tY, 1, world.maxy)
tX = clamp(origin.x + round(actual_view[1] / 2) - tX, 1, world.maxx)
tY = clamp(origin.y + round(actual_view[2] / 2) - tY, 1, world.maxy)
return locate(tX, tY, tZ)
/proc/IsValidSrc(datum/D)
@@ -216,6 +216,7 @@ GLOBAL_LIST_INIT(uncommon_loot, list(//uncommon: useful items
list(//food
/obj/item/reagent_containers/food/snacks/canned/peaches/maint = 1,
/obj/item/storage/box/gum/happiness = 1,
/obj/item/storage/box/donkpockets = 1,
list(//Donk Varieties
/obj/item/storage/box/donkpockets/donkpocketspicy = 1,
+2
View File
@@ -42,6 +42,8 @@ GLOBAL_VAR(tgui_log)
GLOBAL_PROTECT(tgui_log)
GLOBAL_VAR(world_shuttle_log)
GLOBAL_PROTECT(world_shuttle_log)
GLOBAL_VAR(discord_api_log)
GLOBAL_PROTECT(discord_api_log)
GLOBAL_LIST_EMPTY(bombers)
GLOBAL_PROTECT(bombers)
+2 -1
View File
@@ -97,7 +97,8 @@ GLOBAL_LIST_INIT(traits_by_type, list(
"TRAIT_PASSTABLE" = TRAIT_PASSTABLE,
"TRAIT_NOFLASH" = TRAIT_NOFLASH,
"TRAIT_XENO_IMMUNE" = TRAIT_XENO_IMMUNE,
"TRAIT_NAIVE" = TRAIT_NAIVE
"TRAIT_NAIVE" = TRAIT_NAIVE,
"TRAIT_GUNFLIP" = TRAIT_GUNFLIP
),
/obj/item/bodypart = list(
"TRAIT_PARALYSIS" = TRAIT_PARALYSIS
+2 -2
View File
@@ -102,8 +102,8 @@
add_overlay(standard_background)
/obj/screen/movable/pic_in_pic/proc/set_view_size(width, height, do_refresh = TRUE)
width = CLAMP(width, 0, max_dimensions)
height = CLAMP(height, 0, max_dimensions)
width = clamp(width, 0, max_dimensions)
height = clamp(height, 0, max_dimensions)
src.width = width
src.height = height
+2 -2
View File
@@ -47,7 +47,7 @@
/obj/screen/plane_master/floor/backdrop(mob/mymob)
filters = list()
if(istype(mymob) && mymob.eye_blurry)
filters += GAUSSIAN_BLUR(CLAMP(mymob.eye_blurry*0.1,0.6,3))
filters += GAUSSIAN_BLUR(clamp(mymob.eye_blurry*0.1,0.6,3))
/obj/screen/plane_master/game_world
name = "game world plane master"
@@ -60,7 +60,7 @@
if(istype(mymob) && mymob.client && mymob.client.prefs && mymob.client.prefs.ambientocclusion)
filters += AMBIENT_OCCLUSION
if(istype(mymob) && mymob.eye_blurry)
filters += GAUSSIAN_BLUR(CLAMP(mymob.eye_blurry*0.1,0.6,3))
filters += GAUSSIAN_BLUR(clamp(mymob.eye_blurry*0.1,0.6,3))
/obj/screen/plane_master/lighting
name = "lighting plane master"
+2 -2
View File
@@ -129,9 +129,9 @@
/obj/item/proc/get_clamped_volume()
if(w_class)
if(force)
return CLAMP((force + w_class) * 4, 30, 100)// Add the item's force to its weight class and multiply by 4, then clamp the value between 30 and 100
return clamp((force + w_class) * 4, 30, 100)// Add the item's force to its weight class and multiply by 4, then clamp the value between 30 and 100
else
return CLAMP(w_class * 6, 10, 100) // Multiply the item's weight class by 6, then clamp the value between 10 and 100
return clamp(w_class * 6, 10, 100) // Multiply the item's weight class by 6, then clamp the value between 10 and 100
/mob/living/proc/send_item_attack_message(obj/item/I, mob/living/user, hit_area)
var/message_verb = "attacked"
@@ -98,7 +98,7 @@
return FALSE
var/temp = text2num(trim(str_val))
if(!isnull(temp))
config_entry_value = CLAMP(integer ? round(temp) : temp, min_val, max_val)
config_entry_value = clamp(integer ? round(temp) : temp, min_val, max_val)
if(config_entry_value != temp && !(datum_flags & DF_VAR_EDITED))
log_config("Changing [name] from [temp] to [config_entry_value]!")
return TRUE
@@ -484,3 +484,13 @@
/datum/config_entry/flag/reopen_roundstart_suicide_roles_command_report
/datum/config_entry/flag/auto_profile
// DISCORD ROLE STUFFS
// Using strings for everything because BYOND does not like numbers this big
/datum/config_entry/flag/enable_discord_autorole
/datum/config_entry/string/discord_token
/datum/config_entry/string/discord_guildid
/datum/config_entry/string/discord_roleid
+24 -7
View File
@@ -1,4 +1,4 @@
/*
/*
NOTES:
There is a DB table to track ckeys and associated discord IDs.
This system REQUIRES TGS, and will auto-disable if TGS is not present.
@@ -15,7 +15,7 @@ ROUNDSTART:
2] A ping is sent to the discord with the IDs of people who wished to be notified
3] The file is emptied
MIDROUND:
MIDROUND:
1] Someone usees the notify verb, it adds their discord ID to the list.
2] On fire, it will write that to the disk, as long as conditions above are correct
@@ -43,7 +43,7 @@ SUBSYSTEM_DEF(discord)
enabled = 1 // Allows other procs to use this (Account linking, etc)
else
can_fire = 0 // We dont want excess firing
return ..() // Cancel
return ..() // Cancel
try
people_to_notify = json_decode(file2text(notify_file))
@@ -57,18 +57,18 @@ SUBSYSTEM_DEF(discord)
send2chat("[notifymsg]", CONFIG_GET(string/chat_announce_new_game)) // Sends the message to the discord, using same config option as the roundstart notification
fdel(notify_file) // Deletes the file
return ..()
/datum/controller/subsystem/discord/fire()
if(!enabled)
return // Dont do shit if its disabled
if(notify_members == notify_members_cache)
return // Dont re-write the file
return // Dont re-write the file
// If we are all clear
write_notify_file()
/datum/controller/subsystem/discord/Shutdown()
write_notify_file() // Guaranteed force-write on server close
/datum/controller/subsystem/discord/proc/write_notify_file()
if(!enabled) // Dont do shit if its disabled
return
@@ -113,3 +113,20 @@ SUBSYSTEM_DEF(discord)
/datum/controller/subsystem/discord/proc/id_clean(input)
var/regex/num_only = regex("\[^0-9\]", "g")
return num_only.Replace(input, "")
/datum/controller/subsystem/discord/proc/grant_role(id)
// Ignore this shit if config isnt enabled for it
if(!CONFIG_GET(flag/enable_discord_autorole))
return
var/url = "https://discordapp.com/api/guilds/[CONFIG_GET(string/discord_guildid)]/members/[id]/roles/[CONFIG_GET(string/discord_roleid)]"
// Make the request
var/datum/http_request/req = new()
req.prepare(RUSTG_HTTP_METHOD_PUT, url, "", list("Authorization" = "Bot [CONFIG_GET(string/discord_token)]"))
req.begin_async()
UNTIL(req.is_complete())
var/datum/http_response/res = req.into_response()
WRITE_LOG(GLOB.discord_api_log, "PUT [url] returned [res.status_code] [res.body]")
+4 -5
View File
@@ -338,7 +338,7 @@ SUBSYSTEM_DEF(persistence)
var/datum/chemical_reaction/randomized/R = new randomized_type
var/loaded = FALSE
if(R.persistent && json)
var/list/recipe_data = json[R.id]
var/list/recipe_data = json[R.type]
if(recipe_data)
if(R.LoadOldRecipe(recipe_data) && (daysSince(R.created) <= R.persistence_period))
loaded = TRUE
@@ -354,9 +354,8 @@ SUBSYSTEM_DEF(persistence)
//asert globchems done
for(var/randomized_type in subtypesof(/datum/chemical_reaction/randomized))
var/datum/chemical_reaction/randomized/R = randomized_type
R = get_chemical_reaction(initial(R.id)) //ew, would be nice to add some simple tracking
if(R && R.persistent && R.id)
var/datum/chemical_reaction/randomized/R = get_chemical_reaction(randomized_type) //ew, would be nice to add some simple tracking
if(R && R.persistent)
var/recipe_data = list()
recipe_data["timestamp"] = R.created
recipe_data["required_reagents"] = R.required_reagents
@@ -365,7 +364,7 @@ SUBSYSTEM_DEF(persistence)
recipe_data["is_cold_recipe"] = R.is_cold_recipe
recipe_data["results"] = R.results
recipe_data["required_container"] = "[R.required_container]"
file_data["[R.id]"] = recipe_data
file_data["[R.type]"] = recipe_data
fdel(json_file)
WRITE_FILE(json_file, json_encode(file_data))
+2 -2
View File
@@ -235,7 +235,7 @@ SUBSYSTEM_DEF(shuttle)
var/area/A = get_area(user)
log_shuttle("[key_name(user)] has called the emergency shuttle.")
deadchat_broadcast(" has called the shuttle at <span class='name'>[A.name]</span>.", "<span class='name'>[user.real_name]</span>", user)
deadchat_broadcast(" has called the shuttle at <span class='name'>[A.name]</span>.", "<span class='name'>[user.real_name]</span>", user, message_type=DEADCHAT_ANNOUNCEMENT)
if(call_reason)
SSblackbox.record_feedback("text", "shuttle_reason", 1, "[call_reason]")
log_shuttle("Shuttle call reason: [call_reason]")
@@ -273,7 +273,7 @@ SUBSYSTEM_DEF(shuttle)
emergency.cancel(get_area(user))
log_shuttle("[key_name(user)] has recalled the shuttle.")
message_admins("[ADMIN_LOOKUPFLW(user)] has recalled the shuttle.")
deadchat_broadcast(" has recalled the shuttle from <span class='name'>[get_area_name(user, TRUE)]</span>.", "<span class='name'>[user.real_name]</span>", user)
deadchat_broadcast(" has recalled the shuttle from <span class='name'>[get_area_name(user, TRUE)]</span>.", "<span class='name'>[user.real_name]</span>", user, message_type=DEADCHAT_ANNOUNCEMENT)
return 1
/datum/controller/subsystem/shuttle/proc/canRecall()
+11
View File
@@ -277,11 +277,22 @@
icon_icon = 'icons/mob/actions/actions_spacesuit.dmi'
button_icon_state = "thermal_off"
/datum/action/item_action/toggle_spacesuit/New(Target)
. = ..()
RegisterSignal(target, COMSIG_SUIT_SPACE_TOGGLE, .proc/toggle)
/datum/action/item_action/toggle_spacesuit/Destroy()
UnregisterSignal(target, COMSIG_SUIT_SPACE_TOGGLE)
return ..()
/datum/action/item_action/toggle_spacesuit/Trigger()
var/obj/item/clothing/suit/space/suit = target
if(!istype(suit))
return
suit.toggle_spacesuit()
/// Toggle the action icon for the space suit thermal regulator
/datum/action/item_action/toggle_spacesuit/proc/toggle(obj/item/clothing/suit/space/suit)
button_icon_state = "thermal_[suit.thermal_on ? "on" : "off"]"
UpdateButtonIcon()
+2 -2
View File
@@ -55,7 +55,7 @@
log_combat(user, H, "starts slicing the throat of")
playsound(H.loc, butcher_sound, 50, TRUE, -1)
if(do_mob(user, H, CLAMP(500 / source.force, 30, 100)) && H.Adjacent(source))
if(do_mob(user, H, clamp(500 / source.force, 30, 100)) && H.Adjacent(source))
if(H.has_status_effect(/datum/status_effect/neck_slice))
user.show_message("<span class='warning'>[H]'s neck has already been already cut, you can't make the bleeding any worse!</span>", MSG_VISUAL, \
"<span class='warning'>Their neck has already been already cut, you can't make the bleeding any worse!</span>")
@@ -65,7 +65,7 @@
"<span class='userdanger'>[user] slits your throat...</span>")
log_combat(user, H, "finishes slicing the throat of")
H.apply_damage(source.force, BRUTE, BODY_ZONE_HEAD)
H.bleed_rate = CLAMP(H.bleed_rate + 20, 0, 30)
H.bleed_rate = clamp(H.bleed_rate + 20, 0, 30)
H.apply_status_effect(/datum/status_effect/neck_slice)
/datum/component/butchering/proc/Butcher(mob/living/butcher, mob/living/meat)
+1 -1
View File
@@ -54,7 +54,7 @@
/datum/fantasy_affix/pyromantic/apply(datum/component/fantasy/comp, newName)
var/obj/item/master = comp.parent
comp.appliedComponents += master.AddComponent(/datum/component/igniter, CLAMP(comp.quality, 1, 10))
comp.appliedComponents += master.AddComponent(/datum/component/igniter, clamp(comp.quality, 1, 10))
return "pyromantic [newName]"
/datum/fantasy_affix/vampiric
+1 -1
View File
@@ -88,7 +88,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()
+2 -2
View File
@@ -14,8 +14,8 @@
var/x = target.x
var/y = target.y
var/z = target.z
var/turf/southwest = locate(CLAMP(x - (direction & WEST ? range : 0), 1, world.maxx), CLAMP(y - (direction & SOUTH ? range : 0), 1, world.maxy), CLAMP(z, 1, world.maxz))
var/turf/northeast = locate(CLAMP(x + (direction & EAST ? range : 0), 1, world.maxx), CLAMP(y + (direction & NORTH ? range : 0), 1, world.maxy), CLAMP(z, 1, world.maxz))
var/turf/southwest = locate(clamp(x - (direction & WEST ? range : 0), 1, world.maxx), clamp(y - (direction & SOUTH ? range : 0), 1, world.maxy), clamp(z, 1, world.maxz))
var/turf/northeast = locate(clamp(x + (direction & EAST ? range : 0), 1, world.maxx), clamp(y + (direction & NORTH ? range : 0), 1, world.maxy), clamp(z, 1, world.maxz))
//holder.vis_contents += block(southwest, northeast) // This doesnt work because of beta bug memes
for(var/i in block(southwest, northeast))
holder.vis_contents += i
+5 -5
View File
@@ -176,7 +176,7 @@
return (nanite_volume > 0)
/datum/component/nanites/proc/adjust_nanites(datum/source, amount)
nanite_volume = CLAMP(nanite_volume + amount, 0, max_nanites)
nanite_volume = clamp(nanite_volume + amount, 0, max_nanites)
if(nanite_volume <= 0) //oops we ran out
qdel(src)
@@ -188,7 +188,7 @@
if(remove || stealth)
return //bye icon
var/nanite_percent = (nanite_volume / max_nanites) * 100
nanite_percent = CLAMP(CEILING(nanite_percent, 10), 10, 100)
nanite_percent = clamp(CEILING(nanite_percent, 10), 10, 100)
holder.icon_state = "nanites[nanite_percent]"
/datum/component/nanites/proc/on_emp(datum/source, severity)
@@ -250,13 +250,13 @@
return FALSE
/datum/component/nanites/proc/set_volume(datum/source, amount)
nanite_volume = CLAMP(amount, 0, max_nanites)
nanite_volume = clamp(amount, 0, max_nanites)
/datum/component/nanites/proc/set_max_volume(datum/source, amount)
max_nanites = max(1, max_nanites)
/datum/component/nanites/proc/set_cloud(datum/source, amount)
cloud_id = CLAMP(amount, 0, 100)
cloud_id = clamp(amount, 0, 100)
/datum/component/nanites/proc/set_cloud_sync(datum/source, method)
switch(method)
@@ -268,7 +268,7 @@
cloud_active = TRUE
/datum/component/nanites/proc/set_safety(datum/source, amount)
safety_threshold = CLAMP(amount, 0, max_nanites)
safety_threshold = clamp(amount, 0, max_nanites)
/datum/component/nanites/proc/set_regen(datum/source, amount)
regen_rate = amount
+2 -2
View File
@@ -335,8 +335,8 @@
numbered_contents = _process_numerical_display()
adjusted_contents = numbered_contents.len
var/columns = CLAMP(max_items, 1, screen_max_columns)
var/rows = CLAMP(CEILING(adjusted_contents / columns, 1), 1, screen_max_rows)
var/columns = clamp(max_items, 1, screen_max_columns)
var/rows = clamp(CEILING(adjusted_contents / columns, 1), 1, screen_max_rows)
standard_orient_objs(rows, columns, numbered_contents)
//This proc draws out the inventory and places the items on it. It uses the standard position.
+1 -1
View File
@@ -177,7 +177,7 @@
/datum/component/wet_floor/proc/_do_add_wet(type, duration_minimum, duration_add, duration_maximum)
var/time = 0
if(LAZYACCESS(time_left_list, "[type]"))
time = CLAMP(LAZYACCESS(time_left_list, "[type]") + duration_add, duration_minimum, duration_maximum)
time = clamp(LAZYACCESS(time_left_list, "[type]") + duration_add, duration_minimum, duration_maximum)
else
time = min(duration_minimum, duration_maximum)
LAZYSET(time_left_list, "[type]", time)
+1 -1
View File
@@ -43,7 +43,7 @@
addtimer(CALLBACK(src, .proc/charge), charge_rate)
/datum/action/innate/dash/proc/charge()
current_charges = CLAMP(current_charges + 1, 0, max_charges)
current_charges = clamp(current_charges + 1, 0, max_charges)
holder.update_action_buttons_icon()
if(recharge_sound)
playsound(dashing_item, recharge_sound, 50, TRUE)
+2 -2
View File
@@ -248,7 +248,7 @@
SetSpread(DISEASE_SPREAD_BLOOD)
permeability_mod = max(CEILING(0.4 * properties["transmittable"], 1), 1)
cure_chance = 15 - CLAMP(properties["resistance"], -5, 5) // can be between 10 and 20
cure_chance = 15 - clamp(properties["resistance"], -5, 5) // can be between 10 and 20
stage_prob = max(properties["stage_rate"], 2)
SetSeverity(properties["severity"])
GenerateCure(properties)
@@ -303,7 +303,7 @@
// Will generate a random cure, the more resistance the symptoms have, the harder the cure.
/datum/disease/advance/proc/GenerateCure()
if(properties && properties.len)
var/res = CLAMP(properties["resistance"] - (symptoms.len / 2), 1, advance_cures.len)
var/res = clamp(properties["resistance"] - (symptoms.len / 2), 1, advance_cures.len)
if(res == oldres)
return
cures = list(pick(advance_cures[res]))
+1 -1
View File
@@ -607,7 +607,7 @@
if(elligible_organs.len)
var/obj/item/organ/O = pick(elligible_organs)
O.Remove(src)
visible_message("<span class='danger'>[src] vomits up their [O.name]!</span>", "<span class='danger'>You vomit up your [O.name]") //no "vomit up your the heart"
visible_message("<span class='danger'>[src] vomits up their [O.name]!</span>", "<span class='danger'>You vomit up your [O.name]</span>") //no "vomit up your the heart"
O.forceMove(drop_location())
if(prob(20))
O.animate_atom_living()
+7 -7
View File
@@ -14,12 +14,12 @@ clamping the Knockback_Force value below. */
RegisterSignal(target, COMSIG_ITEM_AFTERATTACK, .proc/Item_SelfKnockback)
else if(isprojectile(target))
RegisterSignal(target, COMSIG_PROJECTILE_FIRE, .proc/Projectile_SelfKnockback)
else
else
return ELEMENT_INCOMPATIBLE
override_throw_val = throw_amount
override_speed_val = speed_amount
/datum/element/selfknockback/Detach(datum/source, force)
. = ..()
UnregisterSignal(source, list(COMSIG_ITEM_AFTERATTACK, COMSIG_PROJECTILE_FIRE))
@@ -40,8 +40,8 @@ clamping the Knockback_Force value below. */
if(isturf(attacktarget) && !attacktarget.density)
return
if(proximity_flag || (get_dist(attacktarget, usertarget) <= I.reach))
var/knockback_force = Get_Knockback_Force(CLAMP(CEILING((I.force / 10), 1), 1, 5))
var/knockback_speed = Get_Knockback_Speed(CLAMP(knockback_force, 1, 5))
var/knockback_force = Get_Knockback_Force(clamp(CEILING((I.force / 10), 1), 1, 5))
var/knockback_speed = Get_Knockback_Speed(clamp(knockback_force, 1, 5))
var/target_angle = Get_Angle(attacktarget, usertarget)
var/move_target = get_ranged_target_turf(usertarget, angle2dir(target_angle), knockback_force)
@@ -52,8 +52,8 @@ clamping the Knockback_Force value below. */
if(!P.firer)
return
var/knockback_force = Get_Knockback_Force(CLAMP(CEILING((P.damage / 10), 1), 1, 5))
var/knockback_speed = Get_Knockback_Speed(CLAMP(knockback_force, 1, 5))
var/knockback_force = Get_Knockback_Force(clamp(CEILING((P.damage / 10), 1), 1, 5))
var/knockback_speed = Get_Knockback_Speed(clamp(knockback_force, 1, 5))
var/atom/movable/knockback_target = P.firer
var/move_target = get_edge_target_turf(knockback_target, angle2dir(P.original_angle+180))
+3 -3
View File
@@ -121,14 +121,14 @@ GLOBAL_LIST_EMPTY(explosions)
if(dist <= round(max_range + world.view - 2, 1))
M.playsound_local(epicenter, null, 100, 1, frequency, falloff = 5, S = explosion_sound)
if(baseshakeamount > 0)
shake_camera(M, 25, CLAMP(baseshakeamount, 0, 10))
shake_camera(M, 25, clamp(baseshakeamount, 0, 10))
// You hear a far explosion if you're outside the blast radius. Small bombs shouldn't be heard all over the station.
else if(dist <= far_dist)
var/far_volume = CLAMP(far_dist, 30, 50) // Volume is based on explosion size and dist
var/far_volume = clamp(far_dist, 30, 50) // Volume is based on explosion size and dist
far_volume += (dist <= far_dist * 0.5 ? 50 : 0) // add 50 volume if the mob is pretty close to the explosion
M.playsound_local(epicenter, null, far_volume, 1, frequency, falloff = 5, S = far_explosion_sound)
if(baseshakeamount > 0)
shake_camera(M, 10, CLAMP(baseshakeamount*0.25, 0, 2.5))
shake_camera(M, 10, clamp(baseshakeamount*0.25, 0, 2.5))
EX_PREPROCESS_CHECK_TICK
//postpone processing for a bit
+74
View File
@@ -0,0 +1,74 @@
/datum/http_request
var/id
var/in_progress = FALSE
var/method
var/body
var/headers
var/url
var/_raw_response
/datum/http_request/proc/prepare(method, url, body = "", list/headers)
if (!length(headers))
headers = ""
else
headers = json_encode(headers)
src.method = method
src.url = url
src.body = body
src.headers = headers
/datum/http_request/proc/execute_blocking()
_raw_response = rustg_http_request_blocking(method, url, body, headers)
/datum/http_request/proc/begin_async()
if (in_progress)
CRASH("Attempted to re-use a request object.")
id = rustg_http_request_async(method, url, body, headers)
if (isnull(text2num(id)))
CRASH("Proc error: [id]")
_raw_response = "Proc error: [id]"
else
in_progress = TRUE
/datum/http_request/proc/is_complete()
if (isnull(id))
return TRUE
if (!in_progress)
return TRUE
var/r = rustg_http_check_request(id)
if (r == RUSTG_JOB_NO_RESULTS_YET)
return FALSE
else
_raw_response = r
in_progress = FALSE
return TRUE
/datum/http_request/proc/into_response()
var/datum/http_response/R = new()
try
var/list/L = json_decode(_raw_response)
R.status_code = L["status_code"]
R.headers = L["headers"]
R.body = L["body"]
catch
R.errored = TRUE
R.error = _raw_response
return R
/datum/http_response
var/status_code
var/body
var/list/headers
var/errored = FALSE
var/error
+1 -2
View File
@@ -6,8 +6,7 @@
return iscarbon(user.mob)
/datum/keybinding/carbon/toggle_throw_mode
hotkey_keys = list("R")
classic_keys = list("Southwest") // END
hotkey_keys = list("R", "Southwest") // END
name = "toggle_throw_mode"
full_name = "Toggle throw mode"
description = "Toggle throwing the current item or not."
+2 -9
View File
@@ -5,7 +5,6 @@
/datum/keybinding/mob/face_north
hotkey_keys = list("CtrlW", "CtrlNorth")
classic_keys = list("CtrlNorth")
name = "face_north"
full_name = "Face North"
description = ""
@@ -18,7 +17,6 @@
/datum/keybinding/mob/face_east
hotkey_keys = list("CtrlD", "CtrlEast")
classic_keys = list("CtrlEast")
name = "face_east"
full_name = "Face East"
description = ""
@@ -31,7 +29,6 @@
/datum/keybinding/mob/face_south
hotkey_keys = list("CtrlS", "CtrlSouth")
classic_keys = list("CtrlSouth")
name = "face_south"
full_name = "Face South"
description = ""
@@ -43,7 +40,6 @@
/datum/keybinding/mob/face_west
hotkey_keys = list("CtrlA", "CtrlWest")
classic_keys = list("CtrlWest")
name = "face_west"
full_name = "Face West"
description = ""
@@ -55,7 +51,6 @@
/datum/keybinding/mob/stop_pulling
hotkey_keys = list("H", "Delete")
classic_keys = list("Delete")
name = "stop_pulling"
full_name = "Stop pulling"
description = ""
@@ -91,8 +86,7 @@
return TRUE
/datum/keybinding/mob/swap_hands
hotkey_keys = list("X")
classic_keys = list("Northeast") // PAGEUP
hotkey_keys = list("X", "Northeast") // PAGEUP
name = "swap_hands"
full_name = "Swap hands"
description = ""
@@ -103,8 +97,7 @@
return TRUE
/datum/keybinding/mob/activate_inhand
hotkey_keys = list("Z")
classic_keys = list("Southeast") // PAGEDOWN
hotkey_keys = list("Z", "Southeast") // PAGEDOWN
name = "activate_inhand"
full_name = "Activate in-hand"
description = "Uses whatever item you have inhand"
-4
View File
@@ -4,28 +4,24 @@
/datum/keybinding/movement/north
hotkey_keys = list("W", "North")
classic_keys = list("North")
name = "North"
full_name = "Move North"
description = "Moves your character north"
/datum/keybinding/movement/south
hotkey_keys = list("S", "South")
classic_keys = list("South")
name = "South"
full_name = "Move South"
description = "Moves your character south"
/datum/keybinding/movement/west
hotkey_keys = list("A", "West")
classic_keys = list("West")
name = "West"
full_name = "Move West"
description = "Moves your character left"
/datum/keybinding/movement/east
hotkey_keys = list("D", "East")
classic_keys = list("East")
name = "East"
full_name = "Move East"
description = "Moves your character east"
+2 -2
View File
@@ -106,7 +106,7 @@
to_chat(A, "<span class='danger'>You pound [D] on the chest!</span>")
playsound(get_turf(A), 'sound/effects/hit_punch.ogg', 50, TRUE, -1)
if(D.losebreath <= 10)
D.losebreath = CLAMP(D.losebreath + 5, 0, 10)
D.losebreath = clamp(D.losebreath + 5, 0, 10)
D.adjustOxyLoss(10)
log_combat(A, D, "quickchoked")
return 1
@@ -118,7 +118,7 @@
playsound(get_turf(A), 'sound/effects/hit_punch.ogg', 50, TRUE, -1)
D.apply_damage(5, A.dna.species.attack_type)
if(D.silent <= 10)
D.silent = CLAMP(D.silent + 10, 0, 10)
D.silent = clamp(D.silent + 10, 0, 10)
log_combat(A, D, "neck chopped")
return 1
+2 -2
View File
@@ -11,7 +11,7 @@
description = "<span class='warning'>I hate that brand of cigarettes.</span>\n"
mood_change = -2
timeout = 6 MINUTES
/datum/mood_event/overdose
mood_change = -8
timeout = 5 MINUTES
@@ -44,7 +44,7 @@
description = "<span class='boldwarning'>[drug_name]! [drug_name]! [drug_name]!</span>\n"
/datum/mood_event/happiness_drug
description = "<span class='nicegreen'>I can't feel anything and I never want this to end.</span>\n"
description = "<span class='nicegreen'>Can't feel a thing...</span>\n"
mood_change = 50
/datum/mood_event/happiness_drug_good_od
+2 -2
View File
@@ -342,11 +342,11 @@
chems = new
chems.transfered = embedded_mob
chems.spikey = src
to_chat(fired_by, "<span class='notice'>Link established! Use the \"Transfer Chemicals\" ability to send your chemicals to the linked target!")
to_chat(fired_by, "<span class='notice'>Link established! Use the \"Transfer Chemicals\" ability to send your chemicals to the linked target!</span>")
chems.Grant(fired_by)
/obj/item/hardened_spike/chem/unembedded()
to_chat(fired_by, "<span class='warning'>Link lost!")
to_chat(fired_by, "<span class='warning'>Link lost!</span>")
QDEL_NULL(chems)
..()
+1 -1
View File
@@ -42,7 +42,7 @@
if (user.client)
user.client.images += bar
progress = CLAMP(progress, 0, goal)
progress = clamp(progress, 0, goal)
last_progress = progress
bar.icon_state = "prog_bar_[round(((progress / goal) * 100), 5)]"
if (!shown)
+16
View File
@@ -862,6 +862,22 @@
color = C
return
///Proc for being washed by a shower
/atom/proc/washed(var/atom/washer)
. = SEND_SIGNAL(src, COMSIG_COMPONENT_CLEAN_ACT, CLEAN_WEAK)
remove_atom_colour(WASHABLE_COLOUR_PRIORITY)
var/datum/component/radioactive/healthy_green_glow = GetComponent(/datum/component/radioactive)
if(!healthy_green_glow || QDELETED(healthy_green_glow))
return
var/strength = healthy_green_glow.strength
if(strength <= RAD_BACKGROUND_RADIATION)
qdel(healthy_green_glow)
return
healthy_green_glow.strength -= max(0, (healthy_green_glow.strength - (RAD_BACKGROUND_RADIATION * 2)) * 0.2)
/**
* call back when a var is edited on this atom
*
+4 -4
View File
@@ -290,10 +290,10 @@ GLOBAL_VAR_INIT(dynamic_forced_threat_level, -1)
generate_threat()
var/latejoin_injection_cooldown_middle = 0.5*(GLOB.dynamic_latejoin_delay_max + GLOB.dynamic_latejoin_delay_min)
latejoin_injection_cooldown = round(CLAMP(EXP_DISTRIBUTION(latejoin_injection_cooldown_middle), GLOB.dynamic_latejoin_delay_min, GLOB.dynamic_latejoin_delay_max)) + world.time
latejoin_injection_cooldown = round(clamp(EXP_DISTRIBUTION(latejoin_injection_cooldown_middle), GLOB.dynamic_latejoin_delay_min, GLOB.dynamic_latejoin_delay_max)) + world.time
var/midround_injection_cooldown_middle = 0.5*(GLOB.dynamic_midround_delay_max + GLOB.dynamic_midround_delay_min)
midround_injection_cooldown = round(CLAMP(EXP_DISTRIBUTION(midround_injection_cooldown_middle), GLOB.dynamic_midround_delay_min, GLOB.dynamic_midround_delay_max)) + world.time
midround_injection_cooldown = round(clamp(EXP_DISTRIBUTION(midround_injection_cooldown_middle), GLOB.dynamic_midround_delay_min, GLOB.dynamic_midround_delay_max)) + world.time
log_game("DYNAMIC: Dynamic Mode initialized with a Threat Level of... [threat_level]!")
return TRUE
@@ -624,7 +624,7 @@ GLOBAL_VAR_INIT(dynamic_forced_threat_level, -1)
// Somehow it managed to trigger midround multiple times so this was moved here.
// There is no way this should be able to trigger an injection twice now.
var/midround_injection_cooldown_middle = 0.5*(GLOB.dynamic_midround_delay_max + GLOB.dynamic_midround_delay_min)
midround_injection_cooldown = (round(CLAMP(EXP_DISTRIBUTION(midround_injection_cooldown_middle), GLOB.dynamic_midround_delay_min, GLOB.dynamic_midround_delay_max)) + world.time)
midround_injection_cooldown = (round(clamp(EXP_DISTRIBUTION(midround_injection_cooldown_middle), GLOB.dynamic_midround_delay_min, GLOB.dynamic_midround_delay_max)) + world.time)
// Time to inject some threat into the round
if(EMERGENCY_ESCAPED_OR_ENDGAMED) // Unless the shuttle is gone
@@ -753,7 +753,7 @@ GLOBAL_VAR_INIT(dynamic_forced_threat_level, -1)
if (drafted_rules.len > 0 && picking_midround_latejoin_rule(drafted_rules))
var/latejoin_injection_cooldown_middle = 0.5*(GLOB.dynamic_latejoin_delay_max + GLOB.dynamic_latejoin_delay_min)
latejoin_injection_cooldown = round(CLAMP(EXP_DISTRIBUTION(latejoin_injection_cooldown_middle), GLOB.dynamic_latejoin_delay_min, GLOB.dynamic_latejoin_delay_max)) + world.time
latejoin_injection_cooldown = round(clamp(EXP_DISTRIBUTION(latejoin_injection_cooldown_middle), GLOB.dynamic_latejoin_delay_min, GLOB.dynamic_latejoin_delay_max)) + world.time
/// Refund threat, but no more than threat_level.
/datum/game_mode/dynamic/proc/refund_threat(regain)
@@ -651,6 +651,6 @@
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)
+1 -1
View File
@@ -26,7 +26,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)
+6
View File
@@ -166,6 +166,12 @@
return 1
return 0
/datum/objective_item/steal/blackbox
name = "The Blackbox."
targetitem = /obj/item/blackbox
difficulty = 10
excludefromjob = list("Chief Engineer","Station Engineer","Atmospheric Technician")
//Unique Objectives
/datum/objective_item/unique/docs_red
name = "the \"Red\" secret documents."
+1 -1
View File
@@ -174,7 +174,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)
/////////////////
+2 -2
View File
@@ -152,7 +152,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, FALSE)
result_filters["Charge Above"] = new_filter
if(href_list["below_filter"])
@@ -162,7 +162,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, FALSE)
result_filters["Charge Below"] = new_filter
if(href_list["access_filter"])
@@ -307,7 +307,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")
@@ -316,7 +316,7 @@ GLOBAL_LIST_EMPTY(atmos_air_controllers)
if("pressure")
var/target = text2num(params["pressure"])
if(!isnull(target))
target = CLAMP(target, 0, 4500)
target = clamp(target, 0, 4500)
signal.data += list("tag" = output_tag, "set_internal_pressure" = target)
. = TRUE
radio_connection.post_signal(src, signal, filter = RADIO_ATMOSIA)
+10 -10
View File
@@ -109,7 +109,7 @@
var/security_level = get_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(" has changed the security level to [security_level] with [src] at <span class='name'>[get_area_name(usr, TRUE)]</span>.", "<span class='name'>[usr.real_name]</span>", usr)
deadchat_broadcast(" has changed the security level to [security_level] with [src] at <span class='name'>[get_area_name(usr, TRUE)]</span>.", "<span class='name'>[usr.real_name]</span>", usr, message_type=DEADCHAT_ANNOUNCEMENT)
tmp_alertlevel = 0
else
to_chat(usr, "<span class='warning'>You are not authorized to do this!</span>")
@@ -144,7 +144,7 @@
minor_announce(input, title = "Outgoing message to allied station")
usr.log_talk(input, LOG_SAY, tag="message to the other server")
message_admins("[ADMIN_LOOKUPFLW(usr)] has sent a message to the other server.")
deadchat_broadcast(" has sent an outgoing message to the other station(s).</span>", "<span class='bold'>[usr.real_name]", usr)
deadchat_broadcast(" has sent an outgoing message to the other station(s).</span>", "<span class='bold'>[usr.real_name]", usr, message_type=DEADCHAT_ANNOUNCEMENT)
CM.lastTimeUsed = world.time
if("purchase_menu")
@@ -250,13 +250,13 @@
make_maint_all_access()
log_game("[key_name(usr)] enabled emergency maintenance access.")
message_admins("[ADMIN_LOOKUPFLW(usr)] enabled emergency maintenance access.")
deadchat_broadcast(" enabled emergency maintenance access at <span class='name'>[get_area_name(usr, TRUE)]</span>.", "<span class='name'>[usr.real_name]</span>", usr)
deadchat_broadcast(" enabled emergency maintenance access at <span class='name'>[get_area_name(usr, TRUE)]</span>.", "<span class='name'>[usr.real_name]</span>", usr, message_type=DEADCHAT_ANNOUNCEMENT)
state = STATE_DEFAULT
if("disableemergency")
revoke_maint_all_access()
log_game("[key_name(usr)] disabled emergency maintenance access.")
message_admins("[ADMIN_LOOKUPFLW(usr)] disabled emergency maintenance access.")
deadchat_broadcast(" disabled emergency maintenance access at <span class='name'>[get_area_name(usr, TRUE)]</span>.", "<span class='name'>[usr.real_name]</span>", usr)
deadchat_broadcast(" disabled emergency maintenance access at <span class='name'>[get_area_name(usr, TRUE)]</span>.", "<span class='name'>[usr.real_name]</span>", usr, message_type=DEADCHAT_ANNOUNCEMENT)
state = STATE_DEFAULT
// Status display stuff
@@ -290,7 +290,7 @@
CentCom_announce(input, usr)
to_chat(usr, "<span class='notice'>Message transmitted to Central Command.</span>")
usr.log_talk(input, LOG_SAY, tag="CentCom announcement")
deadchat_broadcast(" has messaged CentCom, \"[input]\" at <span class='name'>[get_area_name(usr, TRUE)]</span>.", "<span class='name'>[usr.real_name]</span>", usr)
deadchat_broadcast(" has messaged CentCom, \"[input]\" at <span class='name'>[get_area_name(usr, TRUE)]</span>.", "<span class='name'>[usr.real_name]</span>", usr, message_type=DEADCHAT_ANNOUNCEMENT)
CM.lastTimeUsed = world.time
// OMG SYNDICATE ...LETTERHEAD
@@ -307,7 +307,7 @@
Syndicate_announce(input, usr)
to_chat(usr, "<span class='danger'>SYSERR @l(19833)of(transmit.dm): !@$ MESSAGE TRANSMITTED TO SYNDICATE COMMAND.</span>")
usr.log_talk(input, LOG_SAY, tag="Syndicate announcement")
deadchat_broadcast(" has messaged the Syndicate, \"[input]\" at <span class='name'>[get_area_name(usr, TRUE)]</span>.", "<span class='name'>[usr.real_name]</span>", usr)
deadchat_broadcast(" has messaged the Syndicate, \"[input]\" at <span class='name'>[get_area_name(usr, TRUE)]</span>.", "<span class='name'>[usr.real_name]</span>", usr, message_type=DEADCHAT_ANNOUNCEMENT)
CM.lastTimeUsed = world.time
if("RestoreBackup")
@@ -392,7 +392,7 @@
var/security_level = get_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(" has changed the security level to [security_level] from [src] at [get_area_name(usr, TRUE)].</span>", "<span class='name'>[usr.real_name]</span>", usr)
deadchat_broadcast(" has changed the security level to [security_level] from [src] at [get_area_name(usr, TRUE)].</span>", "<span class='name'>[usr.real_name]</span>", usr, message_type=DEADCHAT_ANNOUNCEMENT)
tmp_alertlevel = 0
aistate = STATE_DEFAULT
if("ai-changeseclevel")
@@ -403,13 +403,13 @@
make_maint_all_access()
log_game("[key_name(usr)] enabled emergency maintenance access.")
message_admins("[ADMIN_LOOKUPFLW(usr)] enabled emergency maintenance access.")
deadchat_broadcast(" enabled emergency maintenance access.</span>", "<span class='bold'>[usr.real_name]", usr)
deadchat_broadcast(" enabled emergency maintenance access.</span>", "<span class='bold'>[usr.real_name]", usr, message_type=DEADCHAT_ANNOUNCEMENT)
aistate = STATE_DEFAULT
if("ai-disableemergency")
revoke_maint_all_access()
log_game("[key_name(usr)] disabled emergency maintenance access.")
message_admins("[ADMIN_LOOKUPFLW(usr)] disabled emergency maintenance access.")
deadchat_broadcast(" disabled emergency maintenance access.</span>", "<span class='bold'>[usr.real_name]", usr)
deadchat_broadcast(" disabled emergency maintenance access.</span>", "<span class='bold'>[usr.real_name]", usr, message_type=DEADCHAT_ANNOUNCEMENT)
aistate = STATE_DEFAULT
updateUsrDialog()
@@ -715,7 +715,7 @@
else
input = user.treat_message(input) //Adds slurs and so on. Someone should make this use languages too.
SScommunications.make_announcement(user, is_silicon, input)
deadchat_broadcast(" made a priority announcement from <span class='name'>[get_area_name(usr, TRUE)]</span>.", "<span class='name'>[user.real_name]</span>", user)
deadchat_broadcast(" made a priority announcement from <span class='name'>[get_area_name(usr, TRUE)]</span>.", "<span class='name'>[user.real_name]</span>", user, message_type=DEADCHAT_ANNOUNCEMENT)
/obj/machinery/computer/communications/proc/post_status(command, data1, data2)
+7 -7
View File
@@ -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"]]\]"
@@ -955,7 +955,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)
+1 -1
View File
@@ -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 ..()
+1 -1
View File
@@ -138,7 +138,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
+7 -1
View File
@@ -452,7 +452,9 @@
return ..()
/obj/structure/firelock_frame/rcd_vals(mob/user, obj/item/construction/rcd/the_rcd)
if((constructionStep == CONSTRUCTION_NOCIRCUIT) && (the_rcd.upgrade & RCD_UPGRADE_SIMPLE_CIRCUITS))
if(the_rcd.mode == RCD_DECONSTRUCT)
return list("mode" = RCD_DECONSTRUCT, "delay" = 50, "cost" = 16)
else if((constructionStep == CONSTRUCTION_NOCIRCUIT) && (the_rcd.upgrade & RCD_UPGRADE_SIMPLE_CIRCUITS))
return list("mode" = RCD_UPGRADE_SIMPLE_CIRCUITS, "delay" = 20, "cost" = 1)
return FALSE
@@ -464,6 +466,10 @@
constructionStep = CONSTRUCTION_GUTTED
update_icon()
return TRUE
else if(RCD_DECONSTRUCT)
to_chat(user, "<span class='notice'>You deconstruct [src].</span>")
qdel(src)
return TRUE
return FALSE
/obj/structure/firelock_frame/heavy
+2 -2
View File
@@ -102,9 +102,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)
update_indicator()
/obj/machinery/launchpad/proc/doteleport(mob/user, sending)
+2 -2
View File
@@ -66,9 +66,9 @@
..()
/obj/machinery/medipen_refiller/plunger_act(obj/item/plunger/P, mob/living/user, reinforced)
to_chat(user, "<span class='notice'>You start furiously plunging [name].")
to_chat(user, "<span class='notice'>You start furiously plunging [name].</span>")
if(do_after(user, 30, target = src))
to_chat(user, "<span class='notice'>You finish plunging the [name].")
to_chat(user, "<span class='notice'>You finish plunging the [name].</span>")
reagents.reaction(get_turf(src), TOUCH)
reagents.clear_reagents()
+2 -2
View File
@@ -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)
+4 -4
View File
@@ -245,13 +245,13 @@ GLOBAL_LIST_EMPTY(req_console_ckey_departments)
to_department = GLOB.req_console_ckey_departments[to_department]
message = new_message
screen = REQ_SCREEN_AUTHENTICATE
priority = CLAMP(text2num(href_list["priority"]), REQ_NORMAL_MESSAGE_PRIORITY, REQ_EXTREME_MESSAGE_PRIORITY)
priority = clamp(text2num(href_list["priority"]), REQ_NORMAL_MESSAGE_PRIORITY, REQ_EXTREME_MESSAGE_PRIORITY)
if(href_list["writeAnnouncement"])
var/new_message = reject_bad_text(stripped_input(usr, "Write your message:", "Awaiting Input", "", MAX_MESSAGE_LEN))
if(new_message)
message = new_message
priority = CLAMP(text2num(href_list["priority"]) || REQ_NORMAL_MESSAGE_PRIORITY, REQ_NORMAL_MESSAGE_PRIORITY, REQ_EXTREME_MESSAGE_PRIORITY)
priority = clamp(text2num(href_list["priority"]) || REQ_NORMAL_MESSAGE_PRIORITY, REQ_NORMAL_MESSAGE_PRIORITY, REQ_EXTREME_MESSAGE_PRIORITY)
else
message = ""
announceAuth = FALSE
@@ -267,7 +267,7 @@ GLOBAL_LIST_EMPTY(req_console_ckey_departments)
GLOB.news_network.SubmitArticle(message, department, "Station Announcements", null)
usr.log_talk(message, LOG_SAY, tag="station announcement from [src]")
message_admins("[ADMIN_LOOKUPFLW(usr)] has made a station announcement from [src] at [AREACOORD(usr)].")
deadchat_broadcast(" made a station announcement from <span class='name'>[get_area_name(usr, TRUE)]</span>.", "<span class='name'>[usr.real_name]</span>", usr)
deadchat_broadcast(" made a station announcement from <span class='name'>[get_area_name(usr, TRUE)]</span>.", "<span class='name'>[usr.real_name]</span>", usr, message_type=DEADCHAT_ANNOUNCEMENT)
announceAuth = FALSE
message = ""
screen = REQ_SCREEN_MAIN
@@ -324,7 +324,7 @@ GLOBAL_LIST_EMPTY(req_console_ckey_departments)
//Handle screen switching
if(href_list["setScreen"])
var/set_screen = CLAMP(text2num(href_list["setScreen"]) || 0, REQ_SCREEN_MAIN, REQ_SCREEN_ANNOUNCE)
var/set_screen = clamp(text2num(href_list["setScreen"]) || 0, REQ_SCREEN_MAIN, REQ_SCREEN_ANNOUNCE)
switch(set_screen)
if(REQ_SCREEN_MAIN)
to_department = ""
+1 -1
View File
@@ -95,7 +95,7 @@
anchored = !anchored
. = TRUE
if("ChangeBetAmount")
chosen_bet_amount = CLAMP(text2num(params["amount"]), 10, 500)
chosen_bet_amount = clamp(text2num(params["amount"]), 10, 500)
. = TRUE
if("ChangeBetType")
chosen_bet_type = params["type"]
+1 -1
View File
@@ -216,7 +216,7 @@
. = TRUE
if("set_nanite_cloud")
var/new_cloud = text2num(params["new_cloud"])
nanite_cloud = CLAMP(round(new_cloud, 1), 1, 100)
nanite_cloud = clamp(round(new_cloud, 1), 1, 100)
. = TRUE
//Some species are not scannable, like abductors (too unknown), androids (too artificial) or skeletons (too magic)
if("set_target_species")
+2 -2
View File
@@ -131,7 +131,7 @@
settableTemperatureRange = cap * 30
efficiency = (cap + 1) * 10000
targetTemperature = CLAMP(targetTemperature,
targetTemperature = clamp(targetTemperature,
max(settableTemperatureMedian - settableTemperatureRange, TCMB),
settableTemperatureMedian + settableTemperatureRange)
@@ -234,7 +234,7 @@
target= text2num(target) + T0C
. = TRUE
if(.)
targetTemperature = CLAMP(round(target),
targetTemperature = clamp(round(target),
max(settableTemperatureMedian - settableTemperatureRange, TCMB),
settableTemperatureMedian + settableTemperatureRange)
if("eject")
+3 -3
View File
@@ -192,12 +192,12 @@
/obj/machinery/syndicatebomb/proc/settings(mob/user)
var/new_timer = input(user, "Please set the timer.", "Timer", "[timer_set]") as num|null
if (isnull(new_timer))
return
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(!active)
@@ -5,7 +5,7 @@
require the message server.
*/
// A decorational representation of SSblackbox, usually placed alongside the message server.
// A decorational representation of SSblackbox, usually placed alongside the message server. Also contains a traitor theft item.
/obj/machinery/blackbox_recorder
icon = 'icons/obj/stationobjs.dmi'
icon_state = "blackbox"
@@ -15,7 +15,60 @@
idle_power_usage = 10
active_power_usage = 100
armor = list("melee" = 25, "bullet" = 10, "laser" = 10, "energy" = 0, "bomb" = 0, "bio" = 0, "rad" = 0, "fire" = 50, "acid" = 70)
var/obj/item/stored
/obj/machinery/blackbox_recorder/Initialize()
. = ..()
stored = new /obj/item/blackbox(src)
/obj/machinery/blackbox_recorder/attack_hand(mob/living/user)
. = ..()
if(stored)
user.put_in_hands(stored)
stored = null
to_chat(user, "<span class='notice'>You remove the blackbox from [src]. The tapes stop spinning.</span>")
update_icon()
return
else
to_chat(user, "<span class='warning'>It seems that the blackbox is missing...</span>")
return
/obj/machinery/blackbox_recorder/attackby(obj/item/I, mob/living/user, params)
. = ..()
if(istype(I, /obj/item/blackbox))
if(HAS_TRAIT(I, TRAIT_NODROP) || !user.transferItemToLoc(I, src))
to_chat(user, "<span class='warning'>[I] is stuck to your hand!</span>")
return
user.visible_message("<span class='notice'>[user] clicks [I] into [src]!</span>", \
"<span class='notice'>You press the device into [src], and it clicks into place. The tapes begin spinning again.</span>")
playsound(src, 'sound/machines/click.ogg', 50, TRUE)
stored = I
update_icon()
return ..()
return ..()
/obj/machinery/blackbox_recorder/Destroy()
if(stored)
stored.forceMove(loc)
new /obj/effect/decal/cleanable/oil(loc)
return ..()
/obj/machinery/blackbox_recorder/update_icon()
. = ..()
if(!stored)
icon_state = "blackbox_b"
else
icon_state = "blackbox"
/obj/item/blackbox
name = "the blackbox"
desc = "A strange relic, capable of recording data on extradimensional vertices. It lives inside the blackbox recorder for safe keeping."
icon = 'icons/obj/stationobjs.dmi'
icon_state = "blackcube"
lefthand_file = 'icons/mob/inhands/items_lefthand.dmi'
righthand_file = 'icons/mob/inhands/items_righthand.dmi'
w_class = WEIGHT_CLASS_BULKY
resistance_flags = INDESTRUCTIBLE | LAVA_PROOF | FIRE_PROOF | ACID_PROOF
#define MESSAGE_SERVER_FUNCTIONING_MESSAGE "This is an automated message. The messaging system is functioning correctly."
@@ -95,7 +148,7 @@
/obj/machinery/telecomms/message_server/update_overlays()
. = ..()
if(calibrating)
. += "message_server_calibrate"
+1 -1
View File
@@ -65,7 +65,7 @@
/obj/machinery/mecha_part_fabricator/examine(mob/user)
. = ..()
if(in_range(user, src) || isobserver(user))
. += "<span class='notice'>The status display reads: Storing up to <b>[rmat.local_size]</b> material units.<br>Material consumption at <b>[component_coeff*100]%</b>.<br>Build time reduced by <b>[100-time_coeff*100]%</b>.<span>"
. += "<span class='notice'>The status display reads: Storing up to <b>[rmat.local_size]</b> material units.<br>Material consumption at <b>[component_coeff*100]%</b>.<br>Build time reduced by <b>[100-time_coeff*100]%</b>.</span>"
/obj/machinery/mecha_part_fabricator/emag_act()
if(obj_flags & EMAGGED)
File diff suppressed because it is too large Load Diff
@@ -100,6 +100,9 @@
S.blood_state = blood_state
update_icon()
H.update_inv_shoes()
/atom/effect/decal/cleanable/washed(atom/washer)
. = ..()
qdel(src)
/obj/effect/decal/cleanable/proc/can_bloodcrawl_in()
if((blood_state != BLOOD_STATE_OIL) && (blood_state != BLOOD_STATE_NOT_BLOODY))
+7 -2
View File
@@ -172,9 +172,12 @@
var/mutable_appearance/mob_underlay
var/preloaded = 0
var/RPpos = null
var/attached = TRUE //if the gun arg isn't included initially, then the chronofield will work without one
/obj/structure/chrono_field/Initialize(mapload, mob/living/target, obj/item/gun/energy/chrono_gun/G)
if(target && isliving(target) && G)
if(target && isliving(target))
if(!G)
attached = FALSE
target.forceMove(src)
captured = target
var/icon/mob_snapshot = getFlatIcon(target)
@@ -200,7 +203,7 @@
/obj/structure/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]"
@@ -234,6 +237,8 @@
else
gun = null
return .()
else if(!attached)
tickstokill--
else
tickstokill++
else
@@ -702,7 +702,7 @@
if(!new_cost || (loc != user))
to_chat(user, "<span class='warning'>You must hold the circuitboard to change its cost!</span>")
return
custom_cost = CLAMP(round(new_cost, 1), 10, 1000)
custom_cost = clamp(round(new_cost, 1), 10, 1000)
to_chat(user, "<span class='notice'>The cost is now set to [custom_cost].</span>")
/obj/item/circuitboard/machine/medical_kiosk/examine(mob/user)
@@ -883,7 +883,7 @@
if(!new_cloud || (loc != user))
to_chat(user, "<span class='warning'>You must hold the circuitboard to change its Cloud ID!</span>")
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)
. = ..()
+5
View File
@@ -80,6 +80,11 @@
cleanspeed = 3 //Only the truest of mind soul and body get one of these
uses = 301
/obj/item/soap/omega/suicide_act(mob/user)
user.visible_message("<span class='suicide'>[user] is using [src] to scrub themselves from the timeline! It looks like [user.p_theyre()] trying to commit suicide!</span>")
new /obj/structure/chrono_field(user.loc, user)
return MANUAL_SUICIDE
/obj/item/paper/fluff/stations/soap
name = "ancient janitorial poem"
desc = "An old paper that has passed many hands."
+1 -1
View File
@@ -210,7 +210,7 @@
bogdanoff = user
addtimer(CALLBACK(src, .proc/startLaunch), 100)
sound_to_playing_players('sound/items/dump_it.ogg', 20)
deadchat_broadcast("Protocol CRAB-17 has been activated. A space-coin market has been launched at the station!", turf_target = get_turf(src))
deadchat_broadcast("Protocol CRAB-17 has been activated. A space-coin market has been launched at the station!", turf_target = get_turf(src), message_type=DEADCHAT_ANNOUNCEMENT)
/obj/effect/dumpeetTarget/proc/startLaunch()
DF = new /obj/effect/dumpeetFall(drop_location())
+2 -2
View File
@@ -335,8 +335,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>")
@@ -38,7 +38,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>")
@@ -276,11 +276,7 @@
STOP_PROCESSING(SSobj, src)
/obj/item/flashlight/flare/ignition_effect(atom/A, mob/user)
if(fuel && on)
. = "<span class='notice'>[user] lights [A] with [src] like a real \
badass.</span>"
else
. = ""
. = fuel && on ? "<span class='notice'>[user] lights [A] with [src] like a real badass.</span>" : ""
/obj/item/flashlight/flare/proc/turn_off()
on = FALSE
@@ -114,6 +114,16 @@
icon_state = "[initial(icon_state)]"
update_icon()
/obj/item/instrument/piano_synth/headphones/spacepods
name = "nanotrasen space pods"
desc = "Flex your money, AND ignore what everyone else says, all at once!"
icon_state = "spacepods"
item_state = "spacepods"
slot_flags = ITEM_SLOT_EARS
strip_delay = 100 //air pods don't fall out
instrumentRange = 0 //you're paying for quality here
custom_premium_price = 1800
/obj/item/instrument/banjo
name = "banjo"
desc = "A 'Mura' brand banjo. It's pretty much just a drum with a neck and strings."
@@ -165,7 +165,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
@@ -70,11 +70,13 @@ effective or pretty fucking useless.
/obj/item/healthanalyzer/rad_laser
custom_materials = list(/datum/material/iron=400)
var/irradiate = 1
var/ui_x = 320
var/ui_y = 335
var/irradiate = TRUE
var/stealth = FALSE
var/used = FALSE // is it cooling down?
var/intensity = 10 // how much damage the radiation does
var/wavelength = 10 // time it takes for the radiation to kick in, in seconds
var/used = 0 // is it cooling down?
var/stealth = FALSE
/obj/item/healthanalyzer/rad_laser/attack(mob/living/M, mob/living/user)
if(!stealth || !irradiate)
@@ -83,8 +85,8 @@ effective or pretty fucking useless.
return
if(!used)
log_combat(user, M, "irradiated", src)
var/cooldown = GetCooldown()
used = 1
var/cooldown = get_cooldown()
used = TRUE
icon_state = "health1"
handle_cooldown(cooldown) // splits off to handle the cooldown while handling wavelength
to_chat(user, "<span class='warning'>Successfully irradiated [M].</span>")
@@ -98,78 +100,94 @@ effective or pretty fucking useless.
/obj/item/healthanalyzer/rad_laser/proc/handle_cooldown(cooldown)
spawn(cooldown)
used = 0
used = FALSE
icon_state = "health"
/obj/item/healthanalyzer/rad_laser/proc/get_cooldown()
return round(max(10, (stealth*30 + intensity*5 - wavelength/4)))
/obj/item/healthanalyzer/rad_laser/attack_self(mob/user)
interact(user)
/obj/item/healthanalyzer/rad_laser/proc/GetCooldown()
return round(max(10, (stealth*30 + intensity*5 - wavelength/4)))
/obj/item/healthanalyzer/rad_laser/interact(mob/user)
ui_interact(user)
/obj/item/healthanalyzer/rad_laser/ui_interact(mob/user)
. = ..()
/obj/item/healthanalyzer/rad_laser/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, \
datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state)
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
if(!ui)
ui = new(user, src, ui_key, "radioactive_microlaser", "Radioactive Microlaser", ui_x, ui_y, master_ui, state)
ui.open()
var/dat = "Irradiation: <A href='?src=[REF(src)];rad=1'>[irradiate ? "On" : "Off"]</A><br>"
dat += "Stealth Mode (NOTE: Deactivates automatically while Irradiation is off): <A href='?src=[REF(src)];stealthy=[TRUE]'>[stealth ? "On" : "Off"]</A><br>"
dat += "Scan Mode: <a href='?src=[REF(src)];mode=1'>"
if(!scanmode)
dat += "Scan Health"
else if(scanmode == 1)
dat += "Scan Reagents"
else
dat += "Disabled"
dat += "</a><br><br>"
/obj/item/healthanalyzer/rad_laser/ui_data(mob/user)
var/list/data = list()
data["irradiate"] = irradiate
data["stealth"] = stealth
data["scanmode"] = scanmode
data["intensity"] = intensity
data["wavelength"] = wavelength
data["on_cooldown"] = used
data["cooldown"] = DisplayTimeText(get_cooldown())
return data
dat += {"
Radiation Intensity:
<A href='?src=[REF(src)];radint=-5'>-</A><A href='?src=[REF(src)];radint=-1'>-</A>
[intensity]
<A href='?src=[REF(src)];radint=1'>+</A><A href='?src=[REF(src)];radint=5'>+</A><BR>
/obj/item/healthanalyzer/rad_laser/ui_act(action, params)
if(..())
return
Radiation Wavelength:
<A href='?src=[REF(src)];radwav=-5'>-</A><A href='?src=[REF(src)];radwav=-1'>-</A>
[(wavelength+(intensity*4))]
<A href='?src=[REF(src)];radwav=1'>+</A><A href='?src=[REF(src)];radwav=5'>+</A><BR>
Laser Cooldown: [DisplayTimeText(GetCooldown())]<BR>
"}
var/datum/browser/popup = new(user, "radlaser", "Radioactive Microlaser Interface", 400, 240)
popup.set_content(dat)
popup.open()
/obj/item/healthanalyzer/rad_laser/Topic(href, href_list)
if(!usr.canUseTopic(src))
return 1
usr.set_machine(src)
if(href_list["rad"])
irradiate = !irradiate
else if(href_list["stealthy"])
stealth = !stealth
else if(href_list["mode"])
scanmode += 1
if(scanmode > 2)
scanmode = 0
else if(href_list["radint"])
var/amount = text2num(href_list["radint"])
amount += intensity
intensity = max(1,(min(20,amount)))
else if(href_list["radwav"])
var/amount = text2num(href_list["radwav"])
amount += wavelength
wavelength = max(0,(min(120,amount)))
attack_self(usr)
add_fingerprint(usr)
return
switch(action)
if("irradiate")
irradiate = !irradiate
. = TRUE
if("stealth")
stealth = !stealth
. = TRUE
if("scanmode")
scanmode = !scanmode
. = TRUE
if("radintensity")
var/target = params["target"]
var/adjust = text2num(params["adjust"])
if(target == "input")
target = input("New output target (1-20):", name, intensity) as num|null
if(!isnull(target) && !..())
. = TRUE
else if(target == "min")
target = 1
. = TRUE
else if(target == "max")
target = 20
. = TRUE
else if(adjust)
target = intensity + adjust
. = TRUE
else if(text2num(target) != null)
target = text2num(target)
. = TRUE
if(.)
target = round(target)
intensity = clamp(target, 1, 20)
if("radwavelength")
var/target = params["target"]
var/adjust = text2num(params["adjust"])
if(target == "input")
target = input("New output target (0-120):", name, wavelength) as num|null
if(!isnull(target) && !..())
. = TRUE
else if(target == "min")
target = 0
. = TRUE
else if(target == "max")
target = 120
. = TRUE
else if(adjust)
target = wavelength + adjust
. = TRUE
else if(text2num(target) != null)
target = text2num(target)
. = TRUE
if(.)
target = round(target)
wavelength = clamp(target, 0, 120)
/obj/item/shadowcloak
name = "cloaker belt"
@@ -232,7 +250,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
@@ -7,12 +7,14 @@
righthand_file = 'icons/mob/inhands/weapons/bombs_righthand.dmi'
desc = "Regulates the transfer of air between two tanks."
w_class = WEIGHT_CLASS_BULKY
var/ui_x = 310
var/ui_y = 320
var/obj/item/tank/tank_one
var/obj/item/tank/tank_two
var/obj/item/assembly/attached_device
var/mob/attacher = null
var/valve_open = FALSE
var/toggle = 1
var/toggle = TRUE
/obj/item/transfer_valve/IsAssemblyHolder()
return TRUE
@@ -54,7 +56,7 @@
attacher = user
return
//Attached device memes
//These keep attached devices synced up, for example a TTV with a mouse trap being found in a bag so it's triggered, or moving the TTV with an infrared beam sensor to update the beam's direction.
/obj/item/transfer_valve/Move()
. = ..()
if(attached_device)
@@ -74,58 +76,14 @@
if(attached_device)
attached_device.Crossed(AM)
/obj/item/transfer_valve/attack_hand()//Triggers mousetraps
//Triggers mousetraps
/obj/item/transfer_valve/attack_hand()
. = ..()
if(.)
return
if(attached_device)
attached_device.attack_hand()
//These keep attached devices synced up, for example a TTV with a mouse trap being found in a bag so it's triggered, or moving the TTV with an infrared beam sensor to update the beam's direction.
/obj/item/transfer_valve/attack_self(mob/user)
user.set_machine(src)
var/dat = {"<B> Valve properties: </B>
<BR> <B> Attachment one:</B> [tank_one] [tank_one ? "<A href='?src=[REF(src)];tankone=1'>Remove</A>" : ""]
<BR> <B> Attachment two:</B> [tank_two] [tank_two ? "<A href='?src=[REF(src)];tanktwo=1'>Remove</A>" : ""]
<BR> <B> Valve attachment:</B> [attached_device ? "<A href='?src=[REF(src)];device=1'>[attached_device]</A>" : "None"] [attached_device ? "<A href='?src=[REF(src)];rem_device=1'>Remove</A>" : ""]
<BR> <B> Valve status: </B> [ valve_open ? "<A href='?src=[REF(src)];open=1'>Closed</A> <B>Open</B>" : "<B>Closed</B> <A href='?src=[REF(src)];open=1'>Open</A>"]"}
var/datum/browser/popup = new(user, "trans_valve", name)
popup.set_content(dat)
popup.open()
return
/obj/item/transfer_valve/Topic(href, href_list)
..()
if(!usr.canUseTopic(src, BE_CLOSE))
return
if(tank_one && href_list["tankone"])
split_gases()
valve_open = FALSE
tank_one.forceMove(drop_location())
tank_one = null
update_icon()
else if(tank_two && href_list["tanktwo"])
split_gases()
valve_open = FALSE
tank_two.forceMove(drop_location())
tank_two = null
update_icon()
else if(href_list["open"])
toggle_valve()
else if(attached_device)
if(href_list["rem_device"])
attached_device.on_detach()
attached_device = null
update_icon()
if(href_list["device"])
attached_device.attack_self(usr)
attack_self(usr)
add_fingerprint(usr)
/obj/item/transfer_valve/proc/process_activation(obj/item/D)
if(toggle)
toggle = FALSE
@@ -186,11 +144,10 @@
tank_one.air_contents.merge(temp)
tank_two.air_contents.volume -= tank_one.air_contents.volume
/*
/*
Exadv1: I know this isn't how it's going to work, but this was just to check
it explodes properly when it gets a signal (and it does).
*/
*/
/obj/item/transfer_valve/proc/toggle_valve()
if(!valve_open && tank_one && tank_two)
valve_open = TRUE
@@ -216,7 +173,6 @@
admin_bomber_message = " - Last touched by: [ADMIN_LOOKUPFLW(bomber)]"
bomber_message = " - Last touched by: [key_name_admin(bomber)]"
var/admin_bomb_message = "Bomb valve opened in [ADMIN_VERBOSEJMP(bombturf)][admin_attachment_message][admin_bomber_message]"
GLOB.bombers += admin_bomb_message
message_admins(admin_bomb_message)
@@ -230,8 +186,58 @@
split_gases()
valve_open = FALSE
update_icon()
// this doesn't do anything but the timer etc. expects it to be here
// eventually maybe have it update icon to show state (timer, prox etc.) like old bombs
/*
This doesn't do anything but the timer etc. expects it to be here
eventually maybe have it update icon to show state (timer, prox etc.) like old bombs
*/
/obj/item/transfer_valve/proc/c_state()
return
/obj/item/transfer_valve/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, \
datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state)
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
if(!ui)
ui = new(user, src, ui_key, "transfer_valve", name, ui_x, ui_y, master_ui, state)
ui.open()
/obj/item/transfer_valve/ui_data(mob/user)
var/list/data = list()
data["tank_one"] = tank_one
data["tank_two"] = tank_two
data["attached_device"] = attached_device
data["valve"] = valve_open
return data
/obj/item/transfer_valve/ui_act(action, params)
if(..())
return
switch(action)
if("tankone")
if(tank_one)
split_gases()
valve_open = FALSE
tank_one.forceMove(drop_location())
tank_one = null
. = TRUE
if("tanktwo")
if(tank_two)
split_gases()
valve_open = FALSE
tank_two.forceMove(drop_location())
tank_two = null
. = TRUE
if("toggle")
toggle_valve()
. = TRUE
if("device")
if(attached_device)
attached_device.attack_self(usr)
. = TRUE
if("remove_device")
if(attached_device)
attached_device.on_detach()
attached_device = null
. = TRUE
update_icon()
+1 -1
View File
@@ -189,7 +189,7 @@ obj/item/dice/d6/ebony
/obj/item/dice/proc/diceroll(mob/user)
result = roll(sides)
if(rigged != DICE_NOT_RIGGED && result != rigged_value)
if(rigged == DICE_BASICALLY_RIGGED && prob(CLAMP(1/(sides - 1) * 100, 25, 80)))
if(rigged == DICE_BASICALLY_RIGGED && prob(clamp(1/(sides - 1) * 100, 25, 80)))
result = rigged_value
else if(rigged == DICE_TOTALLY_RIGGED)
result = rigged_value
@@ -273,7 +273,7 @@
var/newspread = text2num(stripped_input(user, "Please enter a new spread amount", name))
if (newspread != null && user.canUseTopic(src, BE_CLOSE))
newspread = round(newspread)
unit_spread = CLAMP(newspread, 5, 100)
unit_spread = clamp(newspread, 5, 100)
to_chat(user, "<span class='notice'>You set the time release to [unit_spread] units per detonation.</span>")
if (newspread != unit_spread)
to_chat(user, "<span class='notice'>The new value is out of bounds. Minimum spread is 5 units, maximum is 100 units.</span>")
+2 -2
View File
@@ -89,12 +89,12 @@ obj/item/grenade/firecracker/wirecutter_act(mob/living/user, obj/item/I)
return
if(det_time)
det_time -= 10
to_chat(user, "<span class='notice'>You shorten the fuse of [src] with [I].")
to_chat(user, "<span class='notice'>You shorten the fuse of [src] with [I].</span>")
playsound(src, 'sound/items/wirecutter.ogg', 20, TRUE)
icon_state = initial(icon_state) + "_[det_time]"
update_icon()
else
to_chat(user, "<span class='danger'>You've already removed all of the fuse!")
to_chat(user, "<span class='danger'>You've already removed all of the fuse!</span>")
obj/item/grenade/firecracker/preprime(mob/user, delayoverride, msg = TRUE, volume = 80)
var/turf/T = get_turf(src)
+1 -1
View File
@@ -103,7 +103,7 @@
if(time != null)
if(time < 3)
time = 3
det_time = round(CLAMP(time * 10, 0, 50))
det_time = round(clamp(time * 10, 0, 50))
else
var/previous_time = det_time
switch(det_time)
+1 -1
View File
@@ -72,7 +72,7 @@
return
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.")
+2 -2
View File
@@ -196,9 +196,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()
+1 -1
View File
@@ -77,7 +77,7 @@
L.SetImmobilized(0)
L.SetParalyzed(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)
@@ -22,9 +22,10 @@
ADD_TRAIT(target, TRAIT_MINDSHIELD, "implant")
target.sec_hud_set_implants()
return TRUE
var/deconverted = FALSE
if(target.mind.has_antag_datum(/datum/antagonist/brainwashed))
target.mind.remove_antag_datum(/datum/antagonist/brainwashed)
deconverted = TRUE
if(target.mind.has_antag_datum(/datum/antagonist/rev/head)|| target.mind.unconvertable)
if(!silent)
@@ -35,6 +36,7 @@
var/datum/antagonist/rev/rev = target.mind.has_antag_datum(/datum/antagonist/rev)
if(rev)
deconverted = TRUE
rev.remove_revolutionary(FALSE, user)
if(!silent)
if(target.mind in SSticker.mode.cult)
@@ -43,6 +45,9 @@
to_chat(target, "<span class='notice'>You feel a sense of peace and security. You are now protected from brainwashing.</span>")
ADD_TRAIT(target, TRAIT_MINDSHIELD, "implant")
target.sec_hud_set_implants()
if(deconverted)
if(prob(1) || SSevents.holidays && SSevents.holidays[APRIL_FOOLS])
target.say("I'm out! I quit! Whose kidneys are these?", forced = "They're out! They quit! Whose kidneys do they have?")
return TRUE
return FALSE
+3 -3
View File
@@ -174,7 +174,7 @@
fire_items(T, user)
if(pressureSetting >= 3 && iscarbon(user))
var/mob/living/carbon/C = user
C.visible_message("<span class='warning'>[C] is thrown down by the force of the cannon!</span>", "<span class='userdanger'>[src] slams into your shoulder, knocking you down!")
C.visible_message("<span class='warning'>[C] is thrown down by the force of the cannon!</span>", "<span class='userdanger'>[src] slams into your shoulder, knocking you down!</span>")
C.Paralyze(60)
/obj/item/pneumatic_cannon/proc/fire_items(turf/target, mob/user)
@@ -212,8 +212,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
+6 -6
View File
@@ -390,7 +390,7 @@
var/obj/item/reagent_containers/food/snacks/L
switch(mode)
if(DISPENSE_LOLLIPOP_MODE)
L = new /obj/item/reagent_containers/food/snacks/lollipop(T)
L = new /obj/item/reagent_containers/food/snacks/chewable/lollipop(T)
if(DISPENSE_ICECREAM_MODE)
L = new /obj/item/reagent_containers/food/snacks/icecream(T)
var/obj/item/reagent_containers/food/snacks/icecream/I = L
@@ -517,13 +517,13 @@
name = "lollipop"
desc = "Oh noes! A fast-moving lollipop!"
icon_state = "lollipop_1"
ammo_type = /obj/item/reagent_containers/food/snacks/lollipop/cyborg
ammo_type = /obj/item/reagent_containers/food/snacks/chewable/lollipop/cyborg
var/color2 = rgb(0, 0, 0)
nodamage = TRUE
/obj/projectile/bullet/reusable/lollipop/Initialize()
. = ..()
var/obj/item/reagent_containers/food/snacks/lollipop/S = new ammo_type(src)
var/obj/item/reagent_containers/food/snacks/chewable/lollipop/S = new ammo_type(src)
color2 = S.headcolor
var/mutable_appearance/head = mutable_appearance('icons/obj/projectiles.dmi', "lollipop_2")
head.color = color2
@@ -532,7 +532,7 @@
/obj/projectile/bullet/reusable/lollipop/handle_drop()
if(!dropped)
var/turf/T = get_turf(src)
var/obj/item/reagent_containers/food/snacks/lollipop/S = new ammo_type(T)
var/obj/item/reagent_containers/food/snacks/chewable/lollipop/S = new ammo_type(T)
S.change_head_color(color2)
dropped = TRUE
@@ -653,7 +653,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>")
@@ -663,7 +663,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)
+3 -3
View File
@@ -35,15 +35,15 @@
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>")
playsound(src, 'sound/items/unsheath.ogg', 25, TRUE)
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."
+2 -2
View File
@@ -77,9 +77,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
+1 -26
View File
@@ -186,7 +186,7 @@
/obj/item/storage/belt/medical/paramedic/PopulateContents()
new /obj/item/sensor_device(src)
new /obj/item/flashlight/pen(src)
new /obj/item/pinpointer/crew/prox(src)
new /obj/item/stack/medical/gauze/twelve(src)
new /obj/item/reagent_containers/syringe(src)
new /obj/item/reagent_containers/glass/bottle/epinephrine(src)
@@ -564,31 +564,6 @@
/obj/item/ammo_casing/shotgun
))
/obj/item/storage/belt/holster
name = "shoulder holster"
desc = "A holster to carry a handgun and ammo. WARNING: Badasses only."
icon_state = "holster"
item_state = "holster"
alternate_worn_layer = UNDER_SUIT_LAYER
/obj/item/storage/belt/holster/ComponentInitialize()
. = ..()
var/datum/component/storage/STR = GetComponent(/datum/component/storage)
STR.max_items = 3
STR.max_w_class = WEIGHT_CLASS_NORMAL
STR.set_holdable(list(
/obj/item/gun/ballistic/automatic/pistol,
/obj/item/gun/ballistic/revolver,
/obj/item/ammo_box,
/obj/item/gun/energy/e_gun/mini
))
/obj/item/storage/belt/holster/full/PopulateContents()
var/static/items_inside = list(
/obj/item/gun/ballistic/revolver/detective = 1,
/obj/item/ammo_box/c38 = 2)
generate_items_inside(items_inside,src)
/obj/item/storage/belt/fannypack
name = "fannypack"
desc = "A dorky fannypack for keeping small items in."
+44
View File
@@ -1270,3 +1270,47 @@
/obj/item/storage/box/sparklers/PopulateContents()
for(var/i in 1 to 7)
new/obj/item/sparkler(src)
/obj/item/storage/box/gum
name = "bubblegum packet"
desc = "The packaging is entirely in japanese, apparently. You can't make out a single word of it."
icon_state = "bubblegum_generic"
illustration = null
foldable = null
custom_price = 120
/obj/item/storage/box/gum/ComponentInitialize()
. = ..()
var/datum/component/storage/STR = GetComponent(/datum/component/storage)
STR.set_holdable(list(/obj/item/storage/box/gum))
STR.max_items = 4
/obj/item/storage/box/gum/PopulateContents()
for(var/i in 1 to 4)
new/obj/item/reagent_containers/food/snacks/chewable/bubblegum(src)
/obj/item/storage/box/gum/nicotine
name = "nicotine gum packet"
desc = "Designed to help with nicotine addiction and oral fixation all at once without destroying your lungs in the process. Mint flavored!"
icon_state = "bubblegum_nicotine"
custom_premium_price = 275
/obj/item/storage/box/gum/nicotine/PopulateContents()
for(var/i in 1 to 4)
new/obj/item/reagent_containers/food/snacks/chewable/bubblegum/nicotine(src)
/obj/item/storage/box/gum/happiness
name = "HP+ gum packet"
desc = "A seemingly homemade packaging with an odd smell. It has a weird drawing of a smiling face sticking out its tongue."
icon_state = "bubblegum_happiness"
custom_price = 300
custom_premium_price = 300
/obj/item/storage/box/gum/happiness/Initialize()
. = ..()
if (prob(25))
desc += "You can faintly make out the word 'Hemopagopril' was once scribbled on it."
/obj/item/storage/box/gum/happiness/PopulateContents()
for(var/i in 1 to 4)
new/obj/item/reagent_containers/food/snacks/chewable/bubblegum/happiness(src)
@@ -435,14 +435,6 @@
for(var/i in 1 to 7)
new /obj/item/reagent_containers/pill/psicodine(src)
/obj/item/storage/pill_bottle/happiness
name = "happiness pill bottle"
desc = "The label is long gone, in its place an 'H' written with a marker."
/obj/item/storage/pill_bottle/happiness/PopulateContents()
for(var/i in 1 to 5)
new /obj/item/reagent_containers/pill/happiness(src)
/obj/item/storage/pill_bottle/penacid
name = "bottle of pentetic acid pills"
desc = "Contains pills to expunge radiation and toxins."
+119
View File
@@ -0,0 +1,119 @@
/obj/item/storage/belt/holster
name = "shoulder holster"
desc = "A rather plain but still badass looking holster with a single pouch that can hold a small firearm."
icon_state = "holster"
item_state = "holster"
alternate_worn_layer = UNDER_SUIT_LAYER
/obj/item/storage/belt/holster/equipped(mob/user, slot)
. = ..()
if(slot == ITEM_SLOT_BELT)
ADD_TRAIT(user, TRAIT_GUNFLIP, CLOTHING_TRAIT)
/obj/item/storage/belt/holster/dropped(mob/user)
. = ..()
REMOVE_TRAIT(user, TRAIT_GUNFLIP, CLOTHING_TRAIT)
/obj/item/storage/belt/holster/ComponentInitialize()
. = ..()
var/datum/component/storage/STR = GetComponent(/datum/component/storage)
STR.max_items = 1
STR.max_w_class = WEIGHT_CLASS_NORMAL
STR.set_holdable(list(
/obj/item/gun/ballistic/automatic/pistol,
/obj/item/gun/ballistic/revolver,
/obj/item/gun/energy/e_gun/mini,
/obj/item/gun/energy/disabler,
/obj/item/gun/energy/pulse/carbine,
/obj/item/gun/energy/dueling
))
/obj/item/storage/belt/holster/detective
name = "detective's holster"
desc = "A holster to carry a handgun and ammo. WARNING: Badasses only."
/obj/item/storage/belt/holster/detective/ComponentInitialize()
. = ..()
var/datum/component/storage/STR = GetComponent(/datum/component/storage)
STR.max_items = 3
STR.max_w_class = WEIGHT_CLASS_NORMAL
STR.set_holdable(list(
/obj/item/gun/ballistic/revolver,
/obj/item/ammo_box,
/obj/item/gun/energy/disabler,
/obj/item/gun/energy/dueling
))
/obj/item/storage/belt/holster/detective/full/PopulateContents()
var/static/items_inside = list(
/obj/item/gun/ballistic/revolver/detective = 1,
/obj/item/ammo_box/c38 = 2)
generate_items_inside(items_inside,src)
/obj/item/storage/belt/holster/chameleon
name = "syndicate holster"
desc = "A two pouched hip holster that uses chameleon technology to disguise itself and any guns in it."
icon_state = "syndicate_holster"
item_state = "syndicate_holster"
var/datum/action/item_action/chameleon/change/chameleon_action
/obj/item/storage/belt/holster/chameleon/Initialize()
. = ..()
chameleon_action = new(src)
chameleon_action.chameleon_type = /obj/item/storage/belt
chameleon_action.chameleon_name = "Belt"
chameleon_action.initialize_disguises()
/obj/item/storage/belt/chameleon/ComponentInitialize()
. = ..()
var/datum/component/storage/STR = GetComponent(/datum/component/storage)
STR.silent = TRUE
/obj/item/storage/belt/holster/chameleon/emp_act(severity)
. = ..()
if(. & EMP_PROTECT_SELF)
return
chameleon_action.emp_randomise()
/obj/item/storage/belt/holster/chameleon/broken/Initialize()
. = ..()
chameleon_action.emp_randomise(INFINITY)
/obj/item/storage/belt/holster/chameleon/ComponentInitialize()
. = ..()
var/datum/component/storage/STR = GetComponent(/datum/component/storage)
STR.max_items = 2
STR.max_w_class = WEIGHT_CLASS_NORMAL
STR.set_holdable(list(
/obj/item/gun/ballistic/automatic/pistol,
/obj/item/gun/ballistic/revolver,
/obj/item/gun/energy/e_gun/mini,
/obj/item/gun/energy/disabler,
/obj/item/gun/energy/pulse/carbine,
/obj/item/gun/energy/dueling
))
/obj/item/storage/belt/holster/nukie
name = "operative holster"
desc = "A deep shoulder holster capable of holding almost any form of ballistic weaponry."
icon_state = "syndicate_holster"
item_state = "syndicate_holster"
w_class = WEIGHT_CLASS_BULKY
/obj/item/storage/belt/holster/nukie/ComponentInitialize()
. = ..()
var/datum/component/storage/STR = GetComponent(/datum/component/storage)
STR.max_items = 2
STR.max_w_class = WEIGHT_CLASS_BULKY
STR.set_holdable(list(
/obj/item/gun/ballistic/automatic,
/obj/item/gun/ballistic/revolver,
/obj/item/gun/energy/e_gun/mini,
/obj/item/gun/energy/disabler,
/obj/item/gun/energy/pulse/carbine,
/obj/item/gun/energy/dueling,
/obj/item/gun/ballistic/shotgun,
/obj/item/gun/ballistic/rocketlauncher
))
+11 -7
View File
@@ -170,12 +170,14 @@
playsound(src, stun_sound, 75, TRUE, -1)
user.visible_message("<span class='danger'>[user] accidentally hits [user.p_them()]self with [src]!</span>", \
"<span class='userdanger'>You accidentally hit yourself with [src]!</span>")
user.Knockdown(stun_time*3)
user.Knockdown(stun_time*3) //should really be an equivalent to attack(user,user)
deductcharge(cell_hit_cost)
return
return TRUE
return FALSE
/obj/item/melee/baton/attack(mob/M, mob/living/carbon/human/user)
clumsy_check(user)
if(clumsy_check(user))
return FALSE
if(iscyborg(M))
..()
@@ -206,7 +208,8 @@
/obj/item/melee/baton/proc/baton_effect(mob/living/L, mob/user)
check_shields(L, user)
if(shields_blocked(L, user))
return FALSE
if(iscyborg(loc))
var/mob/living/silicon/robot/R = loc
if(!R || !R.cell || !R.cell.use(cell_hit_cost))
@@ -257,12 +260,13 @@
if (!(. & EMP_PROTECT_SELF))
deductcharge(1000 / severity)
/obj/item/melee/baton/proc/check_shields(mob/living/L, mob/user)
/obj/item/melee/baton/proc/shields_blocked(mob/living/L, mob/user)
if(ishuman(L))
var/mob/living/carbon/human/H = L
if(H.check_shields(src, 0, "[user]'s [name]", MELEE_ATTACK)) //No message; check_shields() handles that
playsound(L, 'sound/weapons/genhit.ogg', 50, TRUE)
return FALSE
playsound(H, 'sound/weapons/genhit.ogg', 50, TRUE)
return TRUE
return FALSE
//Makeshift stun baton. Replacement for stun gloves.
/obj/item/melee/baton/cattleprod
+2 -2
View File
@@ -190,7 +190,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)
@@ -212,7 +212,7 @@
return null
var/tank_pressure = air_contents.return_pressure()
var/actual_distribute_pressure = CLAMP(tank_pressure, 0, distribute_pressure)
var/actual_distribute_pressure = clamp(tank_pressure, 0, distribute_pressure)
var/moles_needed = actual_distribute_pressure*volume_to_return/(R_IDEAL_GAS_EQUATION*air_contents.temperature)
+3 -3
View File
@@ -33,7 +33,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, min(armor_protection, 0), 100)
armor_protection = clamp(armor_protection - armour_penetration, min(armor_protection, 0), 100)
return round(damage_amount * (100 - armor_protection)*0.01, DAMAGE_PRECISION)
///the sound played when the obj is damaged.
@@ -206,7 +206,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 & FIRE_PROOF))
resistance_flags |= ON_FIRE
SSfire_burning.processing[src] = src
@@ -242,7 +242,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

Some files were not shown because too many files have changed in this diff Show More