From ff4ef6a1f565b7dfc01be8d1c23e3e49635bb1ec Mon Sep 17 00:00:00 2001 From: kevinz000 Date: Sun, 21 May 2017 21:58:11 -0700 Subject: [PATCH] reset --- code/__HELPERS/mobs.dm | 28 +- code/_onclick/item_attack.dm | 2 +- code/controllers/configuration.dm | 1862 ++++++++--------- code/controllers/subsystem/server_maint.dm | 1 - code/controllers/subsystem/spacedrift.dm | 2 +- code/game/gamemodes/antag_spawner.dm | 12 +- code/game/machinery/computer/cloning.dm | 1004 ++++----- code/game/machinery/computer/robot.dm | 344 +-- code/game/machinery/recycler.dm | 420 ++-- code/game/machinery/suit_storage_unit.dm | 776 +++---- code/game/objects/effects/portals.dm | 138 +- code/game/objects/items/devices/PDA/radio.dm | 4 +- code/game/objects/items/devices/powersink.dm | 290 +-- .../objects/items/devices/radio/beacon.dm | 4 +- .../objects/items/devices/radio/headset.dm | 22 +- .../objects/items/devices/radio/intercom.dm | 4 +- .../objects/items/devices/transfer_valve.dm | 422 ++-- .../objects/items/weapons/dna_injector.dm | 8 +- .../objects/items/weapons/grenades/grenade.dm | 36 +- .../items/weapons/implants/implantchair.dm | 378 ++-- .../items/weapons/storage/uplink_kits.dm | 608 +++--- .../objects/items/weapons/tanks/tank_types.dm | 4 +- code/game/objects/items/weapons/weaponry.dm | 1106 +++++----- code/game/objects/structures/bedsheet_bin.dm | 632 +++--- .../crates_lockers/closets/secure/security.dm | 566 ++--- code/game/objects/structures/mineral_doors.dm | 442 ++-- code/modules/admin/verbs/randomverbs.dm | 6 +- code/modules/assembly/timer.dm | 230 +- .../atmospherics/machinery/portable/pump.dm | 282 +-- code/modules/jobs/job_types/job.dm | 2 - code/modules/mapping/ruins.dm | 186 +- .../modules/mob/dead/new_player/new_player.dm | 11 +- code/modules/mob/inventory.dm | 4 +- .../mob/living/carbon/human/inventory.dm | 490 ++--- .../carbon/human/species_types/golems.dm | 1396 ++++++------ .../carbon/human/species_types/zombies.dm | 100 +- .../mob/living/simple_animal/friendly/cat.dm | 548 ++--- code/modules/paperwork/clipboard.dm | 244 +-- code/modules/paperwork/folders.dm | 18 +- code/modules/power/gravitygenerator.dm | 24 +- code/modules/power/singularity/emitter.dm | 986 ++++----- .../particle_accelerator/particle_control.dm | 656 +++--- code/modules/projectiles/ammunition/energy.dm | 1 + .../modules/projectiles/projectile/bullets.dm | 54 +- code/modules/projectiles/projectile/energy.dm | 2 + .../chemistry/reagents/food_reagents.dm | 0 .../reagents/reagent_containers/glass.dm | 0 .../reagents/reagent_containers/spray.dm | 478 ++--- code/modules/shuttle/ferry.dm | 66 +- icons/emoji.dmi | Bin tgstation.dme | 25 +- tools/tgstation-server/Start Server.bat | 44 +- 52 files changed, 7490 insertions(+), 7478 deletions(-) mode change 100644 => 100755 code/game/objects/items/weapons/tanks/tank_types.dm mode change 100755 => 100644 code/modules/reagents/chemistry/reagents/food_reagents.dm mode change 100755 => 100644 code/modules/reagents/reagent_containers/glass.dm mode change 100755 => 100644 icons/emoji.dmi diff --git a/code/__HELPERS/mobs.dm b/code/__HELPERS/mobs.dm index 6a4ec3456e..43b657dd9c 100644 --- a/code/__HELPERS/mobs.dm +++ b/code/__HELPERS/mobs.dm @@ -340,20 +340,20 @@ Proc for attack log creation, because really why not qdel(progbar) -//some additional checks as a callback for for do_afters that want to break on losing health or on the mob taking action -/mob/proc/break_do_after_checks(list/checked_health, check_clicks) - if(check_clicks && next_move > world.time) - return FALSE - return TRUE - -//pass a list in the format list("health" = mob's health var) to check health during this -/mob/living/break_do_after_checks(list/checked_health, check_clicks) - if(islist(checked_health)) - if(health < checked_health["health"]) - return FALSE - checked_health["health"] = health - return ..() - +//some additional checks as a callback for for do_afters that want to break on losing health or on the mob taking action +/mob/proc/break_do_after_checks(list/checked_health, check_clicks) + if(check_clicks && next_move > world.time) + return FALSE + return TRUE + +//pass a list in the format list("health" = mob's health var) to check health during this +/mob/living/break_do_after_checks(list/checked_health, check_clicks) + if(islist(checked_health)) + if(health < checked_health["health"]) + return FALSE + checked_health["health"] = health + return ..() + /proc/do_after(mob/user, delay, needhand = 1, atom/target = null, progress = 1, datum/callback/extra_checks = null) if(!user) return 0 diff --git a/code/_onclick/item_attack.dm b/code/_onclick/item_attack.dm index 09bdd44e6a..24f6559dd6 100644 --- a/code/_onclick/item_attack.dm +++ b/code/_onclick/item_attack.dm @@ -28,7 +28,7 @@ if(sharpness) to_chat(user, "You begin to butcher [src]...") playsound(loc, 'sound/weapons/slice.ogg', 50, 1, -1) - if(do_mob(user, src, 80/sharpness) && Adjacent(I)) + if(do_mob(user, src, 80/sharpness) && Adjacent(I)) harvest(user) return 1 return I.attack(src, user) diff --git a/code/controllers/configuration.dm b/code/controllers/configuration.dm index e808b03ac7..e9bdeca880 100644 --- a/code/controllers/configuration.dm +++ b/code/controllers/configuration.dm @@ -1,931 +1,931 @@ -//Configuraton defines //TODO: Move all yes/no switches into bitflags - -//Used by jobs_have_maint_access -#define ASSISTANTS_HAVE_MAINT_ACCESS 1 -#define SECURITY_HAS_MAINT_ACCESS 2 -#define EVERYONE_HAS_MAINT_ACCESS 4 - -/datum/configuration/can_vv_get(var_name) - var/static/list/banned_gets = list("autoadmin", "autoadmin_rank") - if (var_name in banned_gets) - return FALSE - return ..() - -/datum/configuration/vv_edit_var(var_name, var_value) - var/static/list/banned_edits = list("cross_address", "cross_allowed", "autoadmin", "autoadmin_rank") - if(var_name in banned_edits) - return FALSE - return ..() - -/datum/configuration - var/name = "Configuration" // datum name - - var/autoadmin = 0 - var/autoadmin_rank = "Game Admin" - - var/server_name = null // server name (the name of the game window) - var/server_sql_name = null // short form server name used for the DB - var/station_name = null // station name (the name of the station in-game) - var/lobby_countdown = 120 // In between round countdown. - var/round_end_countdown = 25 // Post round murder death kill countdown - var/hub = 0 - - var/log_ooc = 0 // log OOC channel - var/log_access = 0 // log login/logout - var/log_say = 0 // log client say - var/log_admin = 0 // log admin actions - var/log_game = 0 // log game events - var/log_vote = 0 // log voting - var/log_whisper = 0 // log client whisper - var/log_prayer = 0 // log prayers - var/log_law = 0 // log lawchanges - var/log_emote = 0 // log emotes - var/log_attack = 0 // log attack messages - var/log_adminchat = 0 // log admin chat messages - var/log_pda = 0 // log pda messages - var/log_twitter = 0 // log certain expliotable parrots and other such fun things in a JSON file of twitter valid phrases. - var/log_world_topic = 0 // log all world.Topic() calls - var/sql_enabled = 0 // for sql switching - var/allow_admin_ooccolor = 0 // Allows admins with relevant permissions to have their own ooc colour - var/allow_vote_restart = 0 // allow votes to restart - var/allow_vote_mode = 0 // allow votes to change mode - var/vote_delay = 6000 // minimum time between voting sessions (deciseconds, 10 minute default) - var/vote_period = 600 // length of voting period (deciseconds, default 1 minute) - var/vote_no_default = 0 // vote does not default to nochange/norestart (tbi) - var/vote_no_dead = 0 // dead people can't vote (tbi) - var/del_new_on_log = 1 // del's new players if they log before they spawn in - var/allow_Metadata = 0 // Metadata is supported. - var/popup_admin_pm = 0 //adminPMs to non-admins show in a pop-up 'reply' window when set to 1. - var/fps = 20 - var/allow_holidays = 0 //toggles whether holiday-specific content should be used - var/tick_limit_mc_init = TICK_LIMIT_MC_INIT_DEFAULT //SSinitialization throttling - - var/hostedby = null - var/respawn = 1 - var/guest_jobban = 1 - var/usewhitelist = 0 - var/inactivity_period = 3000 //time in ds until a player is considered inactive - var/afk_period = 6000 //time in ds until a player is considered afk and kickable - var/kick_inactive = FALSE //force disconnect for inactive players - var/load_jobs_from_txt = 0 - var/automute_on = 0 //enables automuting/spam prevention - var/minimal_access_threshold = 0 //If the number of players is larger than this threshold, minimal access will be turned on. - var/jobs_have_minimal_access = 0 //determines whether jobs use minimal access or expanded access. - var/jobs_have_maint_access = 0 //Who gets maint access? See defines above. - var/sec_start_brig = 0 //makes sec start in brig or dept sec posts - - var/server - var/banappeals - var/wikiurl = "http://www.tgstation13.org/wiki" // Default wiki link. - var/forumurl = "http://tgstation13.org/phpBB/index.php" //default forums - var/rulesurl = "http://www.tgstation13.org/wiki/Rules" // default rules - var/githuburl = "https://www.github.com/tgstation/-tg-station" //default github - var/githubrepoid - - var/forbid_singulo_possession = 0 - var/useircbot = 0 - - var/check_randomizer = 0 - - var/allow_panic_bunker_bounce = 0 //Send new players somewhere else - var/panic_server_name = "somewhere else" - var/panic_address = "byond://" //Reconnect a player this linked server if this server isn't accepting new players - - //IP Intel vars - var/ipintel_email - var/ipintel_rating_bad = 1 - var/ipintel_save_good = 12 - var/ipintel_save_bad = 1 - var/ipintel_domain = "check.getipintel.net" - - var/admin_legacy_system = 0 //Defines whether the server uses the legacy admin system with admins.txt or the SQL system. Config option in config.txt - var/ban_legacy_system = 0 //Defines whether the server uses the legacy banning system with the files in /data or the SQL system. Config option in config.txt - var/use_age_restriction_for_jobs = 0 //Do jobs use account age restrictions? --requires database - var/use_account_age_for_jobs = 0 //Uses the time they made the account for the job restriction stuff. New player joining alerts should be unaffected. - var/see_own_notes = 0 //Can players see their own admin notes (read-only)? Config option in config.txt - - //Population cap vars - var/soft_popcap = 0 - var/hard_popcap = 0 - var/extreme_popcap = 0 - var/soft_popcap_message = "Be warned that the server is currently serving a high number of users, consider using alternative game servers." - var/hard_popcap_message = "The server is currently serving a high number of users, You cannot currently join. You may wait for the number of living crew to decline, observe, or find alternative servers." - var/extreme_popcap_message = "The server is currently serving a high number of users, find alternative servers." - - //game_options.txt configs - var/force_random_names = 0 - var/list/mode_names = list() - var/list/modes = list() // allowed modes - var/list/votable_modes = list() // votable modes - var/list/probabilities = list() // relative probability of each mode - var/list/min_pop = list() // overrides for acceptible player counts in a mode - var/list/max_pop = list() - - var/humans_need_surnames = 0 - var/allow_ai = 0 // allow ai job - var/forbid_secborg = 0 // disallow secborg module to be chosen. - var/forbid_peaceborg = 0 - var/panic_bunker = 0 // prevents new people it hasn't seen before from connecting - var/notify_new_player_age = 0 // how long do we notify admins of a new player - var/notify_new_player_account_age = 0 // how long do we notify admins of a new byond account - var/irc_first_connection_alert = 0 // do we notify the irc channel when somebody is connecting for the first time? - - var/traitor_scaling_coeff = 6 //how much does the amount of players get divided by to determine traitors - var/changeling_scaling_coeff = 6 //how much does the amount of players get divided by to determine changelings - var/security_scaling_coeff = 8 //how much does the amount of players get divided by to determine open security officer positions - var/abductor_scaling_coeff = 15 //how many players per abductor team - - var/traitor_objectives_amount = 2 - var/protect_roles_from_antagonist = 0 //If security and such can be traitor/cult/other - var/protect_assistant_from_antagonist = 0 //If assistants can be traitor/cult/other - var/enforce_human_authority = 0 //If non-human species are barred from joining as a head of staff - var/allow_latejoin_antagonists = 0 // If late-joining players can be traitor/changeling - var/list/continuous = list() // which roundtypes continue if all antagonists die - var/list/midround_antag = list() // which roundtypes use the midround antagonist system - var/midround_antag_time_check = 60 // How late (in minutes) you want the midround antag system to stay on, setting this to 0 will disable the system - var/midround_antag_life_check = 0.7 // A ratio of how many people need to be alive in order for the round not to immediately end in midround antagonist - var/shuttle_refuel_delay = 12000 - var/show_game_type_odds = 0 //if set this allows players to see the odds of each roundtype on the get revision screen - var/mutant_races = 0 //players can choose their mutant race before joining the game - var/list/roundstart_races = list() //races you can play as from the get go. If left undefined the game's roundstart var for species is used - var/mutant_humans = 0 //players can pick mutant bodyparts for humans before joining the game - - var/no_summon_guns //No - var/no_summon_magic //Fun - var/no_summon_events //Allowed - - var/intercept = 1 //Whether or not to send a communications intercept report roundstart. This may be overriden by gamemodes. - var/alert_desc_green = "All threats to the station have passed. Security may not have weapons visible, privacy laws are once again fully enforced." - var/alert_desc_blue_upto = "The station has received reliable information about possible hostile activity on the station. Security staff may have weapons visible, random searches are permitted." - var/alert_desc_blue_downto = "The immediate threat has passed. Security may no longer have weapons drawn at all times, but may continue to have them visible. Random searches are still allowed." - var/alert_desc_red_upto = "There is an immediate serious threat to the station. Security may have weapons unholstered at all times. Random searches are allowed and advised." - var/alert_desc_red_downto = "The station's destruction has been averted. There is still however an immediate serious threat to the station. Security may have weapons unholstered at all times, random searches are allowed and advised." - var/alert_desc_delta = "Destruction of the station is imminent. All crew are instructed to obey all instructions given by heads of staff. Any violations of these orders can be punished by death. This is not a drill." - - var/revival_pod_plants = FALSE - var/revival_cloning = FALSE - var/revival_brain_life = -1 - - var/rename_cyborg = 0 - var/ooc_during_round = 0 - var/emojis = 0 - - //Used for modifying movement speed for mobs. - //Unversal modifiers - var/run_speed = 0 - var/walk_speed = 0 - - //Mob specific modifiers. NOTE: These will affect different mob types in different ways - var/human_delay = 0 - var/robot_delay = 0 - var/monkey_delay = 0 - var/alien_delay = 0 - var/slime_delay = 0 - var/animal_delay = 0 - - var/gateway_delay = 18000 //How long the gateway takes before it activates. Default is half an hour. - var/ghost_interaction = 0 - - var/silent_ai = 0 - var/silent_borg = 0 - - var/damage_multiplier = 1 //Modifier for damage to all mobs. Impacts healing as well. - - var/allowwebclient = 0 - var/webclientmembersonly = 0 - - var/sandbox_autoclose = 0 // close the sandbox panel after spawning an item, potentially reducing griff - - var/default_laws = 0 //Controls what laws the AI spawns with. - var/silicon_max_law_amount = 12 - var/list/lawids = list() - - var/list/law_weights = list() - - var/assistant_cap = -1 - - var/starlight = 0 - var/generate_minimaps = 0 - var/grey_assistants = 0 - - var/lavaland_budget = 60 - var/space_budget = 16 - - var/aggressive_changelog = 0 - - var/reactionary_explosions = 0 //If we use reactionary explosions, explosions that react to walls and doors - - var/autoconvert_notes = 0 //if all connecting player's notes should attempt to be converted to the database - - var/announce_admin_logout = 0 - var/announce_admin_login = 0 - - var/list/datum/map_config/maplist = list() - var/datum/map_config/defaultmap = null - var/maprotation = 1 - var/maprotatechancedelta = 0.75 - var/allow_map_voting = TRUE - - // Enables random events mid-round when set to 1 - var/allow_random_events = 0 - - // Multipliers for random events minimal starting time and minimal players amounts - var/events_min_time_mul = 1 - var/events_min_players_mul = 1 - - // The object used for the clickable stat() button. - var/obj/effect/statclick/statclick - - var/client_warn_version = 0 - var/client_warn_message = "Your version of byond may have issues or be blocked from accessing this server in the future." - var/client_error_version = 0 - var/client_error_message = "Your version of byond is too old, may have issues, and is blocked from accessing this server." - - var/cross_name = "Other server" - var/cross_address = "byond://" - var/cross_allowed = FALSE - var/showircname = 0 - - var/list/gamemode_cache = null - - var/minutetopiclimit - var/secondtopiclimit - - var/error_cooldown = 600 // The "cooldown" time for each occurrence of a unique error - var/error_limit = 50 // How many occurrences before the next will silence them - var/error_silence_time = 6000 // How long a unique error will be silenced for - var/error_msg_delay = 50 // How long to wait between messaging admins about occurrences of a unique error - - var/arrivals_shuttle_dock_window = 55 //Time from when a player late joins on the arrivals shuttle to when the shuttle docks on the station - var/arrivals_shuttle_require_safe_latejoin = FALSE //Require the arrivals shuttle to be operational in order for latejoiners to join - - var/mice_roundstart = 10 // how many wire chewing rodents spawn at roundstart. - -/datum/configuration/New() - gamemode_cache = typecacheof(/datum/game_mode,TRUE) - for(var/T in gamemode_cache) - // I wish I didn't have to instance the game modes in order to look up - // their information, but it is the only way (at least that I know of). - var/datum/game_mode/M = new T() - - if(M.config_tag) - if(!(M.config_tag in modes)) // ensure each mode is added only once - GLOB.config_error_log << "Adding game mode [M.name] ([M.config_tag]) to configuration." - modes += M.config_tag - mode_names[M.config_tag] = M.name - probabilities[M.config_tag] = M.probability - if(M.votable) - votable_modes += M.config_tag - qdel(M) - votable_modes += "secret" - - Reload() - -/datum/configuration/proc/Reload() - load("config/config.txt") - load("config/game_options.txt","game_options") - loadsql("config/dbconfig.txt") - if (maprotation) - loadmaplist("config/maps.txt") - - // apply some settings from config.. - GLOB.abandon_allowed = respawn - -/datum/configuration/proc/load(filename, type = "config") //the type can also be game_options, in which case it uses a different switch. not making it separate to not copypaste code - Urist - var/list/Lines = world.file2list(filename) - - for(var/t in Lines) - if(!t) - continue - - t = trim(t) - if(length(t) == 0) - continue - else if(copytext(t, 1, 2) == "#") - continue - - var/pos = findtext(t, " ") - var/name = null - var/value = null - - if(pos) - name = lowertext(copytext(t, 1, pos)) - value = copytext(t, pos + 1) - else - name = lowertext(t) - - if(!name) - continue - - if(type == "config") - switch(name) - if("hub") - hub = 1 - if("admin_legacy_system") - admin_legacy_system = 1 - if("ban_legacy_system") - ban_legacy_system = 1 - if("use_age_restriction_for_jobs") - use_age_restriction_for_jobs = 1 - if("use_account_age_for_jobs") - use_account_age_for_jobs = 1 - if("lobby_countdown") - lobby_countdown = text2num(value) - if("round_end_countdown") - round_end_countdown = text2num(value) - if("log_ooc") - log_ooc = 1 - if("log_access") - log_access = 1 - if("log_say") - log_say = 1 - if("log_admin") - log_admin = 1 - if("log_prayer") - log_prayer = 1 - if("log_law") - log_law = 1 - if("log_game") - log_game = 1 - if("log_vote") - log_vote = 1 - if("log_whisper") - log_whisper = 1 - if("log_attack") - log_attack = 1 - if("log_emote") - log_emote = 1 - if("log_adminchat") - log_adminchat = 1 - if("log_pda") - log_pda = 1 - if("log_twitter") - log_twitter = 1 - if("log_world_topic") - log_world_topic = 1 - if("allow_admin_ooccolor") - allow_admin_ooccolor = 1 - if("allow_vote_restart") - allow_vote_restart = 1 - if("allow_vote_mode") - allow_vote_mode = 1 - if("no_dead_vote") - vote_no_dead = 1 - if("default_no_vote") - vote_no_default = 1 - if("vote_delay") - vote_delay = text2num(value) - if("vote_period") - vote_period = text2num(value) - if("norespawn") - respawn = 0 - if("servername") - server_name = value - if("serversqlname") - server_sql_name = value - if("stationname") - station_name = value - if("hostedby") - hostedby = value - if("server") - server = value - if("banappeals") - banappeals = value - if("wikiurl") - wikiurl = value - if("forumurl") - forumurl = value - if("rulesurl") - rulesurl = value - if("githuburl") - githuburl = value - if("githubrepoid") - githubrepoid = value - if("guest_jobban") - guest_jobban = 1 - if("guest_ban") - GLOB.guests_allowed = 0 - if("usewhitelist") - usewhitelist = TRUE - if("allow_metadata") - allow_Metadata = 1 - if("inactivity_period") - inactivity_period = text2num(value) * 10 //documented as seconds in config.txt - if("afk_period") - afk_period = text2num(value) * 10 // ^^^ - if("kick_inactive") - kick_inactive = TRUE - if("load_jobs_from_txt") - load_jobs_from_txt = 1 - if("forbid_singulo_possession") - forbid_singulo_possession = 1 - if("popup_admin_pm") - popup_admin_pm = 1 - if("allow_holidays") - allow_holidays = 1 - if("useircbot") - useircbot = 1 - if("ticklag") - var/ticklag = text2num(value) - if(ticklag > 0) - fps = 10 / ticklag - if("tick_limit_mc_init") - tick_limit_mc_init = text2num(value) - if("fps") - fps = text2num(value) - if("automute_on") - automute_on = 1 - if("comms_key") - global.comms_key = value - if(value != "default_pwd" && length(value) > 6) //It's the default value or less than 6 characters long, warn badmins - global.comms_allowed = 1 - if("cross_server_address") - cross_address = value - if(value != "byond:\\address:port") - cross_allowed = 1 - if("cross_comms_name") - cross_name = value - if("panic_server_name") - panic_server_name = value - if("panic_server_address") - panic_address = value - if(value != "byond:\\address:port") - allow_panic_bunker_bounce = 1 - if("medal_hub_address") - global.medal_hub = value - if("medal_hub_password") - global.medal_pass = value - if("show_irc_name") - showircname = 1 - if("see_own_notes") - see_own_notes = 1 - if("soft_popcap") - soft_popcap = text2num(value) - if("hard_popcap") - hard_popcap = text2num(value) - if("extreme_popcap") - extreme_popcap = text2num(value) - if("soft_popcap_message") - soft_popcap_message = value - if("hard_popcap_message") - hard_popcap_message = value - if("extreme_popcap_message") - extreme_popcap_message = value - if("panic_bunker") - panic_bunker = 1 - if("notify_new_player_age") - notify_new_player_age = text2num(value) - if("notify_new_player_account_age") - notify_new_player_account_age = text2num(value) - if("irc_first_connection_alert") - irc_first_connection_alert = 1 - if("check_randomizer") - check_randomizer = 1 - if("ipintel_email") - if (value != "ch@nge.me") - ipintel_email = value - if("ipintel_rating_bad") - ipintel_rating_bad = text2num(value) - if("ipintel_domain") - ipintel_domain = value - if("ipintel_save_good") - ipintel_save_good = text2num(value) - if("ipintel_save_bad") - ipintel_save_bad = text2num(value) - if("aggressive_changelog") - aggressive_changelog = 1 - if("autoconvert_notes") - autoconvert_notes = 1 - if("allow_webclient") - allowwebclient = 1 - if("webclient_only_byond_members") - webclientmembersonly = 1 - if("announce_admin_logout") - announce_admin_logout = 1 - if("announce_admin_login") - announce_admin_login = 1 - if("maprotation") - maprotation = 1 - if("allow_map_voting") - allow_map_voting = text2num(value) - if("maprotationchancedelta") - maprotatechancedelta = text2num(value) - if("autoadmin") - autoadmin = 1 - if(value) - autoadmin_rank = ckeyEx(value) - if("generate_minimaps") - generate_minimaps = 1 - if("client_warn_version") - client_warn_version = text2num(value) - if("client_warn_message") - client_warn_message = value - if("client_error_version") - client_error_version = text2num(value) - if("client_error_message") - client_error_message = value - if("minute_topic_limit") - minutetopiclimit = text2num(value) - if("second_topic_limit") - secondtopiclimit = text2num(value) - if("error_cooldown") - error_cooldown = text2num(value) - if("error_limit") - error_limit = text2num(value) - if("error_silence_time") - error_silence_time = text2num(value) - if("error_msg_delay") - error_msg_delay = text2num(value) - else - GLOB.config_error_log << "Unknown setting in configuration: '[name]'" - - else if(type == "game_options") - switch(name) - if("damage_multiplier") - damage_multiplier = text2num(value) - if("revival_pod_plants") - revival_pod_plants = TRUE - if("revival_cloning") - revival_cloning = TRUE - if("revival_brain_life") - revival_brain_life = text2num(value) - if("rename_cyborg") - rename_cyborg = 1 - if("ooc_during_round") - ooc_during_round = 1 - if("emojis") - emojis = 1 - if("run_delay") - run_speed = text2num(value) - if("walk_delay") - walk_speed = text2num(value) - if("human_delay") - human_delay = text2num(value) - if("robot_delay") - robot_delay = text2num(value) - if("monkey_delay") - monkey_delay = text2num(value) - if("alien_delay") - alien_delay = text2num(value) - if("slime_delay") - slime_delay = text2num(value) - if("animal_delay") - animal_delay = text2num(value) - if("alert_red_upto") - alert_desc_red_upto = value - if("alert_red_downto") - alert_desc_red_downto = value - if("alert_blue_downto") - alert_desc_blue_downto = value - if("alert_blue_upto") - alert_desc_blue_upto = value - if("alert_green") - alert_desc_green = value - if("alert_delta") - alert_desc_delta = value - if("no_intercept_report") - intercept = 0 - if("assistants_have_maint_access") - jobs_have_maint_access |= ASSISTANTS_HAVE_MAINT_ACCESS - if("security_has_maint_access") - jobs_have_maint_access |= SECURITY_HAS_MAINT_ACCESS - if("everyone_has_maint_access") - jobs_have_maint_access |= EVERYONE_HAS_MAINT_ACCESS - if("sec_start_brig") - sec_start_brig = 1 - if("gateway_delay") - gateway_delay = text2num(value) - if("continuous") - var/mode_name = lowertext(value) - if(mode_name in modes) - continuous[mode_name] = 1 - else - GLOB.config_error_log << "Unknown continuous configuration definition: [mode_name]." - if("midround_antag") - var/mode_name = lowertext(value) - if(mode_name in modes) - midround_antag[mode_name] = 1 - else - GLOB.config_error_log << "Unknown midround antagonist configuration definition: [mode_name]." - if("midround_antag_time_check") - midround_antag_time_check = text2num(value) - if("midround_antag_life_check") - midround_antag_life_check = text2num(value) - if("min_pop") - var/pop_pos = findtext(value, " ") - var/mode_name = null - var/mode_value = null - - if(pop_pos) - mode_name = lowertext(copytext(value, 1, pop_pos)) - mode_value = copytext(value, pop_pos + 1) - if(mode_name in modes) - min_pop[mode_name] = text2num(mode_value) - else - GLOB.config_error_log << "Unknown minimum population configuration definition: [mode_name]." - else - GLOB.config_error_log << "Incorrect minimum population configuration definition: [mode_name] [mode_value]." - if("max_pop") - var/pop_pos = findtext(value, " ") - var/mode_name = null - var/mode_value = null - - if(pop_pos) - mode_name = lowertext(copytext(value, 1, pop_pos)) - mode_value = copytext(value, pop_pos + 1) - if(mode_name in modes) - max_pop[mode_name] = text2num(mode_value) - else - GLOB.config_error_log << "Unknown maximum population configuration definition: [mode_name]." - else - GLOB.config_error_log << "Incorrect maximum population configuration definition: [mode_name] [mode_value]." - if("shuttle_refuel_delay") - shuttle_refuel_delay = text2num(value) - if("show_game_type_odds") - show_game_type_odds = 1 - if("ghost_interaction") - ghost_interaction = 1 - if("traitor_scaling_coeff") - traitor_scaling_coeff = text2num(value) - if("changeling_scaling_coeff") - changeling_scaling_coeff = text2num(value) - if("security_scaling_coeff") - security_scaling_coeff = text2num(value) - if("abductor_scaling_coeff") - abductor_scaling_coeff = text2num(value) - if("traitor_objectives_amount") - traitor_objectives_amount = text2num(value) - if("probability") - var/prob_pos = findtext(value, " ") - var/prob_name = null - var/prob_value = null - - if(prob_pos) - prob_name = lowertext(copytext(value, 1, prob_pos)) - prob_value = copytext(value, prob_pos + 1) - if(prob_name in modes) - probabilities[prob_name] = text2num(prob_value) - else - GLOB.config_error_log << "Unknown game mode probability configuration definition: [prob_name]." - else - GLOB.config_error_log << "Incorrect probability configuration definition: [prob_name] [prob_value]." - - if("protect_roles_from_antagonist") - protect_roles_from_antagonist = 1 - if("protect_assistant_from_antagonist") - protect_assistant_from_antagonist = 1 - if("enforce_human_authority") - enforce_human_authority = 1 - if("allow_latejoin_antagonists") - allow_latejoin_antagonists = 1 - if("allow_random_events") - allow_random_events = 1 - - if("events_min_time_mul") - events_min_time_mul = text2num(value) - if("events_min_players_mul") - events_min_players_mul = text2num(value) - - if("minimal_access_threshold") - minimal_access_threshold = text2num(value) - if("jobs_have_minimal_access") - jobs_have_minimal_access = 1 - if("humans_need_surnames") - humans_need_surnames = 1 - if("force_random_names") - force_random_names = 1 - if("allow_ai") - allow_ai = 1 - if("disable_secborg") - forbid_secborg = 1 - if("disable_peaceborg") - forbid_peaceborg = 1 - if("silent_ai") - silent_ai = 1 - if("silent_borg") - silent_borg = 1 - if("sandbox_autoclose") - sandbox_autoclose = 1 - if("default_laws") - default_laws = text2num(value) - if("random_laws") - var/law_id = lowertext(value) - lawids += law_id - if("law_weight") - // Value is in the form "LAWID,NUMBER" - var/list/L = splittext(value, ",") - if(L.len != 2) - GLOB.config_error_log << "Invalid LAW_WEIGHT: " + t - continue - var/lawid = L[1] - var/weight = text2num(L[2]) - law_weights[lawid] = weight - - if("silicon_max_law_amount") - silicon_max_law_amount = text2num(value) - if("join_with_mutant_race") - mutant_races = 1 - if("roundstart_races") - var/race_id = lowertext(value) - for(var/species_id in GLOB.species_list) - if(species_id == race_id) - roundstart_races += GLOB.species_list[species_id] - GLOB.roundstart_species[species_id] = GLOB.species_list[species_id] - if("join_with_mutant_humans") - mutant_humans = 1 - if("assistant_cap") - assistant_cap = text2num(value) - if("starlight") - starlight = 1 - if("grey_assistants") - grey_assistants = 1 - if("lavaland_budget") - lavaland_budget = text2num(value) - if("space_budget") - space_budget = text2num(value) - if("no_summon_guns") - no_summon_guns = 1 - if("no_summon_magic") - no_summon_magic = 1 - if("no_summon_events") - no_summon_events = 1 - if("reactionary_explosions") - reactionary_explosions = 1 - if("bombcap") - var/BombCap = text2num(value) - if (!BombCap) - continue - if (BombCap < 4) - BombCap = 4 - - GLOB.MAX_EX_DEVESTATION_RANGE = round(BombCap/4) - GLOB.MAX_EX_HEAVY_RANGE = round(BombCap/2) - GLOB.MAX_EX_LIGHT_RANGE = BombCap - GLOB.MAX_EX_FLASH_RANGE = BombCap - GLOB.MAX_EX_FLAME_RANGE = BombCap - if("arrivals_shuttle_dock_window") - arrivals_shuttle_dock_window = max(PARALLAX_LOOP_TIME, text2num(value)) - if("arrivals_shuttle_require_safe_latejoin") - arrivals_shuttle_require_safe_latejoin = TRUE - if("mice_roundstart") - mice_roundstart = text2num(value) - if ("mentor_mobname_only") - mentors_mobname_only = 1 - if ("mentor_legacy_system") - mentor_legacy_system = 1 - else - GLOB.config_error_log << "Unknown setting in configuration: '[name]'" - - fps = round(fps) - if(fps <= 0) - fps = initial(fps) - - -/datum/configuration/proc/loadmaplist(filename) - var/list/Lines = world.file2list(filename) - - var/datum/map_config/currentmap = null - for(var/t in Lines) - if(!t) - continue - - t = trim(t) - if(length(t) == 0) - continue - else if(copytext(t, 1, 2) == "#") - continue - - var/pos = findtext(t, " ") - var/command = null - var/data = null - - if(pos) - command = lowertext(copytext(t, 1, pos)) - data = copytext(t, pos + 1) - else - command = lowertext(t) - - if(!command) - continue - - if (!currentmap && command != "map") - continue - - switch (command) - if ("map") - currentmap = new ("_maps/[data].json") - if(currentmap.defaulted) - log_world("Failed to load map config for [data]!") - if ("minplayers","minplayer") - currentmap.config_min_users = text2num(data) - if ("maxplayers","maxplayer") - currentmap.config_max_users = text2num(data) - if ("weight","voteweight") - currentmap.voteweight = text2num(data) - if ("default","defaultmap") - defaultmap = currentmap - if ("endmap") - maplist[currentmap.map_name] = currentmap - currentmap = null - else - GLOB.config_error_log << "Unknown command in map vote config: '[command]'" - - -/datum/configuration/proc/loadsql(filename) - var/list/Lines = world.file2list(filename) - for(var/t in Lines) - if(!t) - continue - - t = trim(t) - if(length(t) == 0) - continue - else if(copytext(t, 1, 2) == "#") - continue - - var/pos = findtext(t, " ") - var/name = null - var/value = null - - if(pos) - name = lowertext(copytext(t, 1, pos)) - value = copytext(t, pos + 1) - else - name = lowertext(t) - - if(!name) - continue - - switch(name) - if("sql_enabled") - sql_enabled = 1 - if("address") - global.sqladdress = value - if("port") - global.sqlport = value - if("feedback_database") - global.sqlfdbkdb = value - if("feedback_login") - global.sqlfdbklogin = value - if("feedback_password") - global.sqlfdbkpass = value - if("feedback_tableprefix") - global.sqlfdbktableprefix = value - else - GLOB.config_error_log << "Unknown setting in configuration: '[name]'" - -/datum/configuration/proc/pick_mode(mode_name) - // I wish I didn't have to instance the game modes in order to look up - // their information, but it is the only way (at least that I know of). - for(var/T in gamemode_cache) - var/datum/game_mode/M = new T() - if(M.config_tag && M.config_tag == mode_name) - return M - qdel(M) - return new /datum/game_mode/extended() - -/datum/configuration/proc/get_runnable_modes() - var/list/datum/game_mode/runnable_modes = new - for(var/T in gamemode_cache) - var/datum/game_mode/M = new T() - //to_chat(world, "DEBUG: [T], tag=[M.config_tag], prob=[probabilities[M.config_tag]]") - if(!(M.config_tag in modes)) - qdel(M) - continue - if(probabilities[M.config_tag]<=0) - qdel(M) - continue - if(min_pop[M.config_tag]) - M.required_players = min_pop[M.config_tag] - if(max_pop[M.config_tag]) - M.maximum_players = max_pop[M.config_tag] - if(M.can_start()) - runnable_modes[M] = probabilities[M.config_tag] - //to_chat(world, "DEBUG: runnable_mode\[[runnable_modes.len]\] = [M.config_tag]") - return runnable_modes - -/datum/configuration/proc/get_runnable_midround_modes(crew) - var/list/datum/game_mode/runnable_modes = new - for(var/T in (gamemode_cache - SSticker.mode.type)) - var/datum/game_mode/M = new T() - if(!(M.config_tag in modes)) - qdel(M) - continue - if(probabilities[M.config_tag]<=0) - qdel(M) - continue - if(min_pop[M.config_tag]) - M.required_players = min_pop[M.config_tag] - if(max_pop[M.config_tag]) - M.maximum_players = max_pop[M.config_tag] - if(M.required_players <= crew) - if(M.maximum_players >= 0 && M.maximum_players < crew) - continue - runnable_modes[M] = probabilities[M.config_tag] - return runnable_modes - -/datum/configuration/proc/stat_entry() - if(!statclick) - statclick = new/obj/effect/statclick/debug(null, "Edit", src) - - stat("[name]:", statclick) +//Configuraton defines //TODO: Move all yes/no switches into bitflags + +//Used by jobs_have_maint_access +#define ASSISTANTS_HAVE_MAINT_ACCESS 1 +#define SECURITY_HAS_MAINT_ACCESS 2 +#define EVERYONE_HAS_MAINT_ACCESS 4 + +/datum/configuration/can_vv_get(var_name) + var/static/list/banned_gets = list("autoadmin", "autoadmin_rank") + if (var_name in banned_gets) + return FALSE + return ..() + +/datum/configuration/vv_edit_var(var_name, var_value) + var/static/list/banned_edits = list("cross_address", "cross_allowed", "autoadmin", "autoadmin_rank") + if(var_name in banned_edits) + return FALSE + return ..() + +/datum/configuration + var/name = "Configuration" // datum name + + var/autoadmin = 0 + var/autoadmin_rank = "Game Admin" + + var/server_name = null // server name (the name of the game window) + var/server_sql_name = null // short form server name used for the DB + var/station_name = null // station name (the name of the station in-game) + var/lobby_countdown = 120 // In between round countdown. + var/round_end_countdown = 25 // Post round murder death kill countdown + var/hub = 0 + + var/log_ooc = 0 // log OOC channel + var/log_access = 0 // log login/logout + var/log_say = 0 // log client say + var/log_admin = 0 // log admin actions + var/log_game = 0 // log game events + var/log_vote = 0 // log voting + var/log_whisper = 0 // log client whisper + var/log_prayer = 0 // log prayers + var/log_law = 0 // log lawchanges + var/log_emote = 0 // log emotes + var/log_attack = 0 // log attack messages + var/log_adminchat = 0 // log admin chat messages + var/log_pda = 0 // log pda messages + var/log_twitter = 0 // log certain expliotable parrots and other such fun things in a JSON file of twitter valid phrases. + var/log_world_topic = 0 // log all world.Topic() calls + var/sql_enabled = 0 // for sql switching + var/allow_admin_ooccolor = 0 // Allows admins with relevant permissions to have their own ooc colour + var/allow_vote_restart = 0 // allow votes to restart + var/allow_vote_mode = 0 // allow votes to change mode + var/vote_delay = 6000 // minimum time between voting sessions (deciseconds, 10 minute default) + var/vote_period = 600 // length of voting period (deciseconds, default 1 minute) + var/vote_no_default = 0 // vote does not default to nochange/norestart (tbi) + var/vote_no_dead = 0 // dead people can't vote (tbi) + var/del_new_on_log = 1 // del's new players if they log before they spawn in + var/allow_Metadata = 0 // Metadata is supported. + var/popup_admin_pm = 0 //adminPMs to non-admins show in a pop-up 'reply' window when set to 1. + var/fps = 20 + var/allow_holidays = 0 //toggles whether holiday-specific content should be used + var/tick_limit_mc_init = TICK_LIMIT_MC_INIT_DEFAULT //SSinitialization throttling + + var/hostedby = null + var/respawn = 1 + var/guest_jobban = 1 + var/usewhitelist = 0 + var/inactivity_period = 3000 //time in ds until a player is considered inactive + var/afk_period = 6000 //time in ds until a player is considered afk and kickable + var/kick_inactive = FALSE //force disconnect for inactive players + var/load_jobs_from_txt = 0 + var/automute_on = 0 //enables automuting/spam prevention + var/minimal_access_threshold = 0 //If the number of players is larger than this threshold, minimal access will be turned on. + var/jobs_have_minimal_access = 0 //determines whether jobs use minimal access or expanded access. + var/jobs_have_maint_access = 0 //Who gets maint access? See defines above. + var/sec_start_brig = 0 //makes sec start in brig or dept sec posts + + var/server + var/banappeals + var/wikiurl = "http://www.tgstation13.org/wiki" // Default wiki link. + var/forumurl = "http://tgstation13.org/phpBB/index.php" //default forums + var/rulesurl = "http://www.tgstation13.org/wiki/Rules" // default rules + var/githuburl = "https://www.github.com/tgstation/-tg-station" //default github + var/githubrepoid + + var/forbid_singulo_possession = 0 + var/useircbot = 0 + + var/check_randomizer = 0 + + var/allow_panic_bunker_bounce = 0 //Send new players somewhere else + var/panic_server_name = "somewhere else" + var/panic_address = "byond://" //Reconnect a player this linked server if this server isn't accepting new players + + //IP Intel vars + var/ipintel_email + var/ipintel_rating_bad = 1 + var/ipintel_save_good = 12 + var/ipintel_save_bad = 1 + var/ipintel_domain = "check.getipintel.net" + + var/admin_legacy_system = 0 //Defines whether the server uses the legacy admin system with admins.txt or the SQL system. Config option in config.txt + var/ban_legacy_system = 0 //Defines whether the server uses the legacy banning system with the files in /data or the SQL system. Config option in config.txt + var/use_age_restriction_for_jobs = 0 //Do jobs use account age restrictions? --requires database + var/use_account_age_for_jobs = 0 //Uses the time they made the account for the job restriction stuff. New player joining alerts should be unaffected. + var/see_own_notes = 0 //Can players see their own admin notes (read-only)? Config option in config.txt + + //Population cap vars + var/soft_popcap = 0 + var/hard_popcap = 0 + var/extreme_popcap = 0 + var/soft_popcap_message = "Be warned that the server is currently serving a high number of users, consider using alternative game servers." + var/hard_popcap_message = "The server is currently serving a high number of users, You cannot currently join. You may wait for the number of living crew to decline, observe, or find alternative servers." + var/extreme_popcap_message = "The server is currently serving a high number of users, find alternative servers." + + //game_options.txt configs + var/force_random_names = 0 + var/list/mode_names = list() + var/list/modes = list() // allowed modes + var/list/votable_modes = list() // votable modes + var/list/probabilities = list() // relative probability of each mode + var/list/min_pop = list() // overrides for acceptible player counts in a mode + var/list/max_pop = list() + + var/humans_need_surnames = 0 + var/allow_ai = 0 // allow ai job + var/forbid_secborg = 0 // disallow secborg module to be chosen. + var/forbid_peaceborg = 0 + var/panic_bunker = 0 // prevents new people it hasn't seen before from connecting + var/notify_new_player_age = 0 // how long do we notify admins of a new player + var/notify_new_player_account_age = 0 // how long do we notify admins of a new byond account + var/irc_first_connection_alert = 0 // do we notify the irc channel when somebody is connecting for the first time? + + var/traitor_scaling_coeff = 6 //how much does the amount of players get divided by to determine traitors + var/changeling_scaling_coeff = 6 //how much does the amount of players get divided by to determine changelings + var/security_scaling_coeff = 8 //how much does the amount of players get divided by to determine open security officer positions + var/abductor_scaling_coeff = 15 //how many players per abductor team + + var/traitor_objectives_amount = 2 + var/protect_roles_from_antagonist = 0 //If security and such can be traitor/cult/other + var/protect_assistant_from_antagonist = 0 //If assistants can be traitor/cult/other + var/enforce_human_authority = 0 //If non-human species are barred from joining as a head of staff + var/allow_latejoin_antagonists = 0 // If late-joining players can be traitor/changeling + var/list/continuous = list() // which roundtypes continue if all antagonists die + var/list/midround_antag = list() // which roundtypes use the midround antagonist system + var/midround_antag_time_check = 60 // How late (in minutes) you want the midround antag system to stay on, setting this to 0 will disable the system + var/midround_antag_life_check = 0.7 // A ratio of how many people need to be alive in order for the round not to immediately end in midround antagonist + var/shuttle_refuel_delay = 12000 + var/show_game_type_odds = 0 //if set this allows players to see the odds of each roundtype on the get revision screen + var/mutant_races = 0 //players can choose their mutant race before joining the game + var/list/roundstart_races = list() //races you can play as from the get go. If left undefined the game's roundstart var for species is used + var/mutant_humans = 0 //players can pick mutant bodyparts for humans before joining the game + + var/no_summon_guns //No + var/no_summon_magic //Fun + var/no_summon_events //Allowed + + var/intercept = 1 //Whether or not to send a communications intercept report roundstart. This may be overriden by gamemodes. + var/alert_desc_green = "All threats to the station have passed. Security may not have weapons visible, privacy laws are once again fully enforced." + var/alert_desc_blue_upto = "The station has received reliable information about possible hostile activity on the station. Security staff may have weapons visible, random searches are permitted." + var/alert_desc_blue_downto = "The immediate threat has passed. Security may no longer have weapons drawn at all times, but may continue to have them visible. Random searches are still allowed." + var/alert_desc_red_upto = "There is an immediate serious threat to the station. Security may have weapons unholstered at all times. Random searches are allowed and advised." + var/alert_desc_red_downto = "The station's destruction has been averted. There is still however an immediate serious threat to the station. Security may have weapons unholstered at all times, random searches are allowed and advised." + var/alert_desc_delta = "Destruction of the station is imminent. All crew are instructed to obey all instructions given by heads of staff. Any violations of these orders can be punished by death. This is not a drill." + + var/revival_pod_plants = FALSE + var/revival_cloning = FALSE + var/revival_brain_life = -1 + + var/rename_cyborg = 0 + var/ooc_during_round = 0 + var/emojis = 0 + + //Used for modifying movement speed for mobs. + //Unversal modifiers + var/run_speed = 0 + var/walk_speed = 0 + + //Mob specific modifiers. NOTE: These will affect different mob types in different ways + var/human_delay = 0 + var/robot_delay = 0 + var/monkey_delay = 0 + var/alien_delay = 0 + var/slime_delay = 0 + var/animal_delay = 0 + + var/gateway_delay = 18000 //How long the gateway takes before it activates. Default is half an hour. + var/ghost_interaction = 0 + + var/silent_ai = 0 + var/silent_borg = 0 + + var/damage_multiplier = 1 //Modifier for damage to all mobs. Impacts healing as well. + + var/allowwebclient = 0 + var/webclientmembersonly = 0 + + var/sandbox_autoclose = 0 // close the sandbox panel after spawning an item, potentially reducing griff + + var/default_laws = 0 //Controls what laws the AI spawns with. + var/silicon_max_law_amount = 12 + var/list/lawids = list() + + var/list/law_weights = list() + + var/assistant_cap = -1 + + var/starlight = 0 + var/generate_minimaps = 0 + var/grey_assistants = 0 + + var/lavaland_budget = 60 + var/space_budget = 16 + + var/aggressive_changelog = 0 + + var/reactionary_explosions = 0 //If we use reactionary explosions, explosions that react to walls and doors + + var/autoconvert_notes = 0 //if all connecting player's notes should attempt to be converted to the database + + var/announce_admin_logout = 0 + var/announce_admin_login = 0 + + var/list/datum/map_config/maplist = list() + var/datum/map_config/defaultmap = null + var/maprotation = 1 + var/maprotatechancedelta = 0.75 + var/allow_map_voting = TRUE + + // Enables random events mid-round when set to 1 + var/allow_random_events = 0 + + // Multipliers for random events minimal starting time and minimal players amounts + var/events_min_time_mul = 1 + var/events_min_players_mul = 1 + + // The object used for the clickable stat() button. + var/obj/effect/statclick/statclick + + var/client_warn_version = 0 + var/client_warn_message = "Your version of byond may have issues or be blocked from accessing this server in the future." + var/client_error_version = 0 + var/client_error_message = "Your version of byond is too old, may have issues, and is blocked from accessing this server." + + var/cross_name = "Other server" + var/cross_address = "byond://" + var/cross_allowed = FALSE + var/showircname = 0 + + var/list/gamemode_cache = null + + var/minutetopiclimit + var/secondtopiclimit + + var/error_cooldown = 600 // The "cooldown" time for each occurrence of a unique error + var/error_limit = 50 // How many occurrences before the next will silence them + var/error_silence_time = 6000 // How long a unique error will be silenced for + var/error_msg_delay = 50 // How long to wait between messaging admins about occurrences of a unique error + + var/arrivals_shuttle_dock_window = 55 //Time from when a player late joins on the arrivals shuttle to when the shuttle docks on the station + var/arrivals_shuttle_require_safe_latejoin = FALSE //Require the arrivals shuttle to be operational in order for latejoiners to join + + var/mice_roundstart = 10 // how many wire chewing rodents spawn at roundstart. + +/datum/configuration/New() + gamemode_cache = typecacheof(/datum/game_mode,TRUE) + for(var/T in gamemode_cache) + // I wish I didn't have to instance the game modes in order to look up + // their information, but it is the only way (at least that I know of). + var/datum/game_mode/M = new T() + + if(M.config_tag) + if(!(M.config_tag in modes)) // ensure each mode is added only once + GLOB.config_error_log << "Adding game mode [M.name] ([M.config_tag]) to configuration." + modes += M.config_tag + mode_names[M.config_tag] = M.name + probabilities[M.config_tag] = M.probability + if(M.votable) + votable_modes += M.config_tag + qdel(M) + votable_modes += "secret" + + Reload() + +/datum/configuration/proc/Reload() + load("config/config.txt") + load("config/game_options.txt","game_options") + loadsql("config/dbconfig.txt") + if (maprotation) + loadmaplist("config/maps.txt") + + // apply some settings from config.. + GLOB.abandon_allowed = respawn + +/datum/configuration/proc/load(filename, type = "config") //the type can also be game_options, in which case it uses a different switch. not making it separate to not copypaste code - Urist + var/list/Lines = world.file2list(filename) + + for(var/t in Lines) + if(!t) + continue + + t = trim(t) + if(length(t) == 0) + continue + else if(copytext(t, 1, 2) == "#") + continue + + var/pos = findtext(t, " ") + var/name = null + var/value = null + + if(pos) + name = lowertext(copytext(t, 1, pos)) + value = copytext(t, pos + 1) + else + name = lowertext(t) + + if(!name) + continue + + if(type == "config") + switch(name) + if("hub") + hub = 1 + if("admin_legacy_system") + admin_legacy_system = 1 + if("ban_legacy_system") + ban_legacy_system = 1 + if("use_age_restriction_for_jobs") + use_age_restriction_for_jobs = 1 + if("use_account_age_for_jobs") + use_account_age_for_jobs = 1 + if("lobby_countdown") + lobby_countdown = text2num(value) + if("round_end_countdown") + round_end_countdown = text2num(value) + if("log_ooc") + log_ooc = 1 + if("log_access") + log_access = 1 + if("log_say") + log_say = 1 + if("log_admin") + log_admin = 1 + if("log_prayer") + log_prayer = 1 + if("log_law") + log_law = 1 + if("log_game") + log_game = 1 + if("log_vote") + log_vote = 1 + if("log_whisper") + log_whisper = 1 + if("log_attack") + log_attack = 1 + if("log_emote") + log_emote = 1 + if("log_adminchat") + log_adminchat = 1 + if("log_pda") + log_pda = 1 + if("log_twitter") + log_twitter = 1 + if("log_world_topic") + log_world_topic = 1 + if("allow_admin_ooccolor") + allow_admin_ooccolor = 1 + if("allow_vote_restart") + allow_vote_restart = 1 + if("allow_vote_mode") + allow_vote_mode = 1 + if("no_dead_vote") + vote_no_dead = 1 + if("default_no_vote") + vote_no_default = 1 + if("vote_delay") + vote_delay = text2num(value) + if("vote_period") + vote_period = text2num(value) + if("norespawn") + respawn = 0 + if("servername") + server_name = value + if("serversqlname") + server_sql_name = value + if("stationname") + station_name = value + if("hostedby") + hostedby = value + if("server") + server = value + if("banappeals") + banappeals = value + if("wikiurl") + wikiurl = value + if("forumurl") + forumurl = value + if("rulesurl") + rulesurl = value + if("githuburl") + githuburl = value + if("githubrepoid") + githubrepoid = value + if("guest_jobban") + guest_jobban = 1 + if("guest_ban") + GLOB.guests_allowed = 0 + if("usewhitelist") + usewhitelist = TRUE + if("allow_metadata") + allow_Metadata = 1 + if("inactivity_period") + inactivity_period = text2num(value) * 10 //documented as seconds in config.txt + if("afk_period") + afk_period = text2num(value) * 10 // ^^^ + if("kick_inactive") + kick_inactive = TRUE + if("load_jobs_from_txt") + load_jobs_from_txt = 1 + if("forbid_singulo_possession") + forbid_singulo_possession = 1 + if("popup_admin_pm") + popup_admin_pm = 1 + if("allow_holidays") + allow_holidays = 1 + if("useircbot") + useircbot = 1 + if("ticklag") + var/ticklag = text2num(value) + if(ticklag > 0) + fps = 10 / ticklag + if("tick_limit_mc_init") + tick_limit_mc_init = text2num(value) + if("fps") + fps = text2num(value) + if("automute_on") + automute_on = 1 + if("comms_key") + global.comms_key = value + if(value != "default_pwd" && length(value) > 6) //It's the default value or less than 6 characters long, warn badmins + global.comms_allowed = 1 + if("cross_server_address") + cross_address = value + if(value != "byond:\\address:port") + cross_allowed = 1 + if("cross_comms_name") + cross_name = value + if("panic_server_name") + panic_server_name = value + if("panic_server_address") + panic_address = value + if(value != "byond:\\address:port") + allow_panic_bunker_bounce = 1 + if("medal_hub_address") + global.medal_hub = value + if("medal_hub_password") + global.medal_pass = value + if("show_irc_name") + showircname = 1 + if("see_own_notes") + see_own_notes = 1 + if("soft_popcap") + soft_popcap = text2num(value) + if("hard_popcap") + hard_popcap = text2num(value) + if("extreme_popcap") + extreme_popcap = text2num(value) + if("soft_popcap_message") + soft_popcap_message = value + if("hard_popcap_message") + hard_popcap_message = value + if("extreme_popcap_message") + extreme_popcap_message = value + if("panic_bunker") + panic_bunker = 1 + if("notify_new_player_age") + notify_new_player_age = text2num(value) + if("notify_new_player_account_age") + notify_new_player_account_age = text2num(value) + if("irc_first_connection_alert") + irc_first_connection_alert = 1 + if("check_randomizer") + check_randomizer = 1 + if("ipintel_email") + if (value != "ch@nge.me") + ipintel_email = value + if("ipintel_rating_bad") + ipintel_rating_bad = text2num(value) + if("ipintel_domain") + ipintel_domain = value + if("ipintel_save_good") + ipintel_save_good = text2num(value) + if("ipintel_save_bad") + ipintel_save_bad = text2num(value) + if("aggressive_changelog") + aggressive_changelog = 1 + if("autoconvert_notes") + autoconvert_notes = 1 + if("allow_webclient") + allowwebclient = 1 + if("webclient_only_byond_members") + webclientmembersonly = 1 + if("announce_admin_logout") + announce_admin_logout = 1 + if("announce_admin_login") + announce_admin_login = 1 + if("maprotation") + maprotation = 1 + if("allow_map_voting") + allow_map_voting = text2num(value) + if("maprotationchancedelta") + maprotatechancedelta = text2num(value) + if("autoadmin") + autoadmin = 1 + if(value) + autoadmin_rank = ckeyEx(value) + if("generate_minimaps") + generate_minimaps = 1 + if("client_warn_version") + client_warn_version = text2num(value) + if("client_warn_message") + client_warn_message = value + if("client_error_version") + client_error_version = text2num(value) + if("client_error_message") + client_error_message = value + if("minute_topic_limit") + minutetopiclimit = text2num(value) + if("second_topic_limit") + secondtopiclimit = text2num(value) + if("error_cooldown") + error_cooldown = text2num(value) + if("error_limit") + error_limit = text2num(value) + if("error_silence_time") + error_silence_time = text2num(value) + if("error_msg_delay") + error_msg_delay = text2num(value) + else + GLOB.config_error_log << "Unknown setting in configuration: '[name]'" + + else if(type == "game_options") + switch(name) + if("damage_multiplier") + damage_multiplier = text2num(value) + if("revival_pod_plants") + revival_pod_plants = TRUE + if("revival_cloning") + revival_cloning = TRUE + if("revival_brain_life") + revival_brain_life = text2num(value) + if("rename_cyborg") + rename_cyborg = 1 + if("ooc_during_round") + ooc_during_round = 1 + if("emojis") + emojis = 1 + if("run_delay") + run_speed = text2num(value) + if("walk_delay") + walk_speed = text2num(value) + if("human_delay") + human_delay = text2num(value) + if("robot_delay") + robot_delay = text2num(value) + if("monkey_delay") + monkey_delay = text2num(value) + if("alien_delay") + alien_delay = text2num(value) + if("slime_delay") + slime_delay = text2num(value) + if("animal_delay") + animal_delay = text2num(value) + if("alert_red_upto") + alert_desc_red_upto = value + if("alert_red_downto") + alert_desc_red_downto = value + if("alert_blue_downto") + alert_desc_blue_downto = value + if("alert_blue_upto") + alert_desc_blue_upto = value + if("alert_green") + alert_desc_green = value + if("alert_delta") + alert_desc_delta = value + if("no_intercept_report") + intercept = 0 + if("assistants_have_maint_access") + jobs_have_maint_access |= ASSISTANTS_HAVE_MAINT_ACCESS + if("security_has_maint_access") + jobs_have_maint_access |= SECURITY_HAS_MAINT_ACCESS + if("everyone_has_maint_access") + jobs_have_maint_access |= EVERYONE_HAS_MAINT_ACCESS + if("sec_start_brig") + sec_start_brig = 1 + if("gateway_delay") + gateway_delay = text2num(value) + if("continuous") + var/mode_name = lowertext(value) + if(mode_name in modes) + continuous[mode_name] = 1 + else + GLOB.config_error_log << "Unknown continuous configuration definition: [mode_name]." + if("midround_antag") + var/mode_name = lowertext(value) + if(mode_name in modes) + midround_antag[mode_name] = 1 + else + GLOB.config_error_log << "Unknown midround antagonist configuration definition: [mode_name]." + if("midround_antag_time_check") + midround_antag_time_check = text2num(value) + if("midround_antag_life_check") + midround_antag_life_check = text2num(value) + if("min_pop") + var/pop_pos = findtext(value, " ") + var/mode_name = null + var/mode_value = null + + if(pop_pos) + mode_name = lowertext(copytext(value, 1, pop_pos)) + mode_value = copytext(value, pop_pos + 1) + if(mode_name in modes) + min_pop[mode_name] = text2num(mode_value) + else + GLOB.config_error_log << "Unknown minimum population configuration definition: [mode_name]." + else + GLOB.config_error_log << "Incorrect minimum population configuration definition: [mode_name] [mode_value]." + if("max_pop") + var/pop_pos = findtext(value, " ") + var/mode_name = null + var/mode_value = null + + if(pop_pos) + mode_name = lowertext(copytext(value, 1, pop_pos)) + mode_value = copytext(value, pop_pos + 1) + if(mode_name in modes) + max_pop[mode_name] = text2num(mode_value) + else + GLOB.config_error_log << "Unknown maximum population configuration definition: [mode_name]." + else + GLOB.config_error_log << "Incorrect maximum population configuration definition: [mode_name] [mode_value]." + if("shuttle_refuel_delay") + shuttle_refuel_delay = text2num(value) + if("show_game_type_odds") + show_game_type_odds = 1 + if("ghost_interaction") + ghost_interaction = 1 + if("traitor_scaling_coeff") + traitor_scaling_coeff = text2num(value) + if("changeling_scaling_coeff") + changeling_scaling_coeff = text2num(value) + if("security_scaling_coeff") + security_scaling_coeff = text2num(value) + if("abductor_scaling_coeff") + abductor_scaling_coeff = text2num(value) + if("traitor_objectives_amount") + traitor_objectives_amount = text2num(value) + if("probability") + var/prob_pos = findtext(value, " ") + var/prob_name = null + var/prob_value = null + + if(prob_pos) + prob_name = lowertext(copytext(value, 1, prob_pos)) + prob_value = copytext(value, prob_pos + 1) + if(prob_name in modes) + probabilities[prob_name] = text2num(prob_value) + else + GLOB.config_error_log << "Unknown game mode probability configuration definition: [prob_name]." + else + GLOB.config_error_log << "Incorrect probability configuration definition: [prob_name] [prob_value]." + + if("protect_roles_from_antagonist") + protect_roles_from_antagonist = 1 + if("protect_assistant_from_antagonist") + protect_assistant_from_antagonist = 1 + if("enforce_human_authority") + enforce_human_authority = 1 + if("allow_latejoin_antagonists") + allow_latejoin_antagonists = 1 + if("allow_random_events") + allow_random_events = 1 + + if("events_min_time_mul") + events_min_time_mul = text2num(value) + if("events_min_players_mul") + events_min_players_mul = text2num(value) + + if("minimal_access_threshold") + minimal_access_threshold = text2num(value) + if("jobs_have_minimal_access") + jobs_have_minimal_access = 1 + if("humans_need_surnames") + humans_need_surnames = 1 + if("force_random_names") + force_random_names = 1 + if("allow_ai") + allow_ai = 1 + if("disable_secborg") + forbid_secborg = 1 + if("disable_peaceborg") + forbid_peaceborg = 1 + if("silent_ai") + silent_ai = 1 + if("silent_borg") + silent_borg = 1 + if("sandbox_autoclose") + sandbox_autoclose = 1 + if("default_laws") + default_laws = text2num(value) + if("random_laws") + var/law_id = lowertext(value) + lawids += law_id + if("law_weight") + // Value is in the form "LAWID,NUMBER" + var/list/L = splittext(value, ",") + if(L.len != 2) + GLOB.config_error_log << "Invalid LAW_WEIGHT: " + t + continue + var/lawid = L[1] + var/weight = text2num(L[2]) + law_weights[lawid] = weight + + if("silicon_max_law_amount") + silicon_max_law_amount = text2num(value) + if("join_with_mutant_race") + mutant_races = 1 + if("roundstart_races") + var/race_id = lowertext(value) + for(var/species_id in GLOB.species_list) + if(species_id == race_id) + roundstart_races += GLOB.species_list[species_id] + GLOB.roundstart_species[species_id] = GLOB.species_list[species_id] + if("join_with_mutant_humans") + mutant_humans = 1 + if("assistant_cap") + assistant_cap = text2num(value) + if("starlight") + starlight = 1 + if("grey_assistants") + grey_assistants = 1 + if("lavaland_budget") + lavaland_budget = text2num(value) + if("space_budget") + space_budget = text2num(value) + if("no_summon_guns") + no_summon_guns = 1 + if("no_summon_magic") + no_summon_magic = 1 + if("no_summon_events") + no_summon_events = 1 + if("reactionary_explosions") + reactionary_explosions = 1 + if("bombcap") + var/BombCap = text2num(value) + if (!BombCap) + continue + if (BombCap < 4) + BombCap = 4 + + GLOB.MAX_EX_DEVESTATION_RANGE = round(BombCap/4) + GLOB.MAX_EX_HEAVY_RANGE = round(BombCap/2) + GLOB.MAX_EX_LIGHT_RANGE = BombCap + GLOB.MAX_EX_FLASH_RANGE = BombCap + GLOB.MAX_EX_FLAME_RANGE = BombCap + if("arrivals_shuttle_dock_window") + arrivals_shuttle_dock_window = max(PARALLAX_LOOP_TIME, text2num(value)) + if("arrivals_shuttle_require_safe_latejoin") + arrivals_shuttle_require_safe_latejoin = TRUE + if("mice_roundstart") + mice_roundstart = text2num(value) + if ("mentor_mobname_only") + mentors_mobname_only = 1 + if ("mentor_legacy_system") + mentor_legacy_system = 1 + else + GLOB.config_error_log << "Unknown setting in configuration: '[name]'" + + fps = round(fps) + if(fps <= 0) + fps = initial(fps) + + +/datum/configuration/proc/loadmaplist(filename) + var/list/Lines = world.file2list(filename) + + var/datum/map_config/currentmap = null + for(var/t in Lines) + if(!t) + continue + + t = trim(t) + if(length(t) == 0) + continue + else if(copytext(t, 1, 2) == "#") + continue + + var/pos = findtext(t, " ") + var/command = null + var/data = null + + if(pos) + command = lowertext(copytext(t, 1, pos)) + data = copytext(t, pos + 1) + else + command = lowertext(t) + + if(!command) + continue + + if (!currentmap && command != "map") + continue + + switch (command) + if ("map") + currentmap = new ("_maps/[data].json") + if(currentmap.defaulted) + log_world("Failed to load map config for [data]!") + if ("minplayers","minplayer") + currentmap.config_min_users = text2num(data) + if ("maxplayers","maxplayer") + currentmap.config_max_users = text2num(data) + if ("weight","voteweight") + currentmap.voteweight = text2num(data) + if ("default","defaultmap") + defaultmap = currentmap + if ("endmap") + maplist[currentmap.map_name] = currentmap + currentmap = null + else + GLOB.config_error_log << "Unknown command in map vote config: '[command]'" + + +/datum/configuration/proc/loadsql(filename) + var/list/Lines = world.file2list(filename) + for(var/t in Lines) + if(!t) + continue + + t = trim(t) + if(length(t) == 0) + continue + else if(copytext(t, 1, 2) == "#") + continue + + var/pos = findtext(t, " ") + var/name = null + var/value = null + + if(pos) + name = lowertext(copytext(t, 1, pos)) + value = copytext(t, pos + 1) + else + name = lowertext(t) + + if(!name) + continue + + switch(name) + if("sql_enabled") + sql_enabled = 1 + if("address") + global.sqladdress = value + if("port") + global.sqlport = value + if("feedback_database") + global.sqlfdbkdb = value + if("feedback_login") + global.sqlfdbklogin = value + if("feedback_password") + global.sqlfdbkpass = value + if("feedback_tableprefix") + global.sqlfdbktableprefix = value + else + GLOB.config_error_log << "Unknown setting in configuration: '[name]'" + +/datum/configuration/proc/pick_mode(mode_name) + // I wish I didn't have to instance the game modes in order to look up + // their information, but it is the only way (at least that I know of). + for(var/T in gamemode_cache) + var/datum/game_mode/M = new T() + if(M.config_tag && M.config_tag == mode_name) + return M + qdel(M) + return new /datum/game_mode/extended() + +/datum/configuration/proc/get_runnable_modes() + var/list/datum/game_mode/runnable_modes = new + for(var/T in gamemode_cache) + var/datum/game_mode/M = new T() + //to_chat(world, "DEBUG: [T], tag=[M.config_tag], prob=[probabilities[M.config_tag]]") + if(!(M.config_tag in modes)) + qdel(M) + continue + if(probabilities[M.config_tag]<=0) + qdel(M) + continue + if(min_pop[M.config_tag]) + M.required_players = min_pop[M.config_tag] + if(max_pop[M.config_tag]) + M.maximum_players = max_pop[M.config_tag] + if(M.can_start()) + runnable_modes[M] = probabilities[M.config_tag] + //to_chat(world, "DEBUG: runnable_mode\[[runnable_modes.len]\] = [M.config_tag]") + return runnable_modes + +/datum/configuration/proc/get_runnable_midround_modes(crew) + var/list/datum/game_mode/runnable_modes = new + for(var/T in (gamemode_cache - SSticker.mode.type)) + var/datum/game_mode/M = new T() + if(!(M.config_tag in modes)) + qdel(M) + continue + if(probabilities[M.config_tag]<=0) + qdel(M) + continue + if(min_pop[M.config_tag]) + M.required_players = min_pop[M.config_tag] + if(max_pop[M.config_tag]) + M.maximum_players = max_pop[M.config_tag] + if(M.required_players <= crew) + if(M.maximum_players >= 0 && M.maximum_players < crew) + continue + runnable_modes[M] = probabilities[M.config_tag] + return runnable_modes + +/datum/configuration/proc/stat_entry() + if(!statclick) + statclick = new/obj/effect/statclick/debug(null, "Edit", src) + + stat("[name]:", statclick) diff --git a/code/controllers/subsystem/server_maint.dm b/code/controllers/subsystem/server_maint.dm index bed923ffe2..a0ca6a7b67 100644 --- a/code/controllers/subsystem/server_maint.dm +++ b/code/controllers/subsystem/server_maint.dm @@ -9,7 +9,6 @@ SUBSYSTEM_DEF(server_maint) var/list/currentrun /datum/controller/subsystem/server_maint/Initialize(timeofday) - reload_custom_roundstart_items_list() if (config.hub) world.visibility = 1 ..() diff --git a/code/controllers/subsystem/spacedrift.dm b/code/controllers/subsystem/spacedrift.dm index 3012abec3e..53e6c0cee1 100644 --- a/code/controllers/subsystem/spacedrift.dm +++ b/code/controllers/subsystem/spacedrift.dm @@ -3,7 +3,7 @@ SUBSYSTEM_DEF(spacedrift) priority = 30 wait = 5 flags = SS_NO_INIT|SS_KEEP_TIMING - runlevels = RUNLEVEL_GAME | RUNLEVEL_POSTGAME + runlevels = RUNLEVEL_GAME | RUNLEVEL_POSTGAME var/list/currentrun = list() var/list/processing = list() diff --git a/code/game/gamemodes/antag_spawner.dm b/code/game/gamemodes/antag_spawner.dm index da749b603a..fd2c58fc80 100644 --- a/code/game/gamemodes/antag_spawner.dm +++ b/code/game/gamemodes/antag_spawner.dm @@ -142,25 +142,25 @@ /obj/item/weapon/antag_spawner/nuke_ops/proc/check_usability(mob/user) if(used) to_chat(user, "[src] is out of power!") - return 0 + return FALSE if(!(user.mind in SSticker.mode.syndicates)) to_chat(user, "AUTHENTICATION FAILURE. ACCESS DENIED.") - return 0 + return FALSE if(user.z != ZLEVEL_CENTCOM) to_chat(user, "[src] is out of range! It can only be used at your base!") - return 0 - return 1 + return FALSE + return TRUE /obj/item/weapon/antag_spawner/nuke_ops/attack_self(mob/user) if(!(check_usability(user))) return to_chat(user, "You activate [src] and wait for confirmation.") - var/list/nuke_candidates = pollCandidatesForMob("Do you want to play as a syndicate [borg_to_spawn ? "[lowertext(borg_to_spawn)] cyborg":"operative"]?", ROLE_OPERATIVE, null, ROLE_OPERATIVE, 150, POLL_IGNORE_SYNDICATE, src) + var/list/nuke_candidates = pollGhostCandidates("Do you want to play as a syndicate [borg_to_spawn ? "[lowertext(borg_to_spawn)] cyborg":"operative"]?", ROLE_OPERATIVE, null, ROLE_OPERATIVE, 150, POLL_IGNORE_SYNDICATE) if(nuke_candidates.len) if(!(check_usability(user))) return - used = 1 + used = TRUE var/mob/dead/observer/theghost = pick(nuke_candidates) spawn_antag(theghost.client, get_turf(src), "syndieborg") do_sparks(4, TRUE, src) diff --git a/code/game/machinery/computer/cloning.dm b/code/game/machinery/computer/cloning.dm index 2d21b1aaf5..9e367d43b1 100644 --- a/code/game/machinery/computer/cloning.dm +++ b/code/game/machinery/computer/cloning.dm @@ -1,502 +1,502 @@ -/obj/machinery/computer/cloning - name = "cloning console" - desc = "Used to clone people and manage DNA." - icon_screen = "dna" - icon_keyboard = "med_key" - circuit = /obj/item/weapon/circuitboard/computer/cloning - req_access = list(GLOB.access_heads) //Only used for record deletion right now. - var/obj/machinery/dna_scannernew/scanner = null //Linked scanner. For scanning. - var/list/pods //Linked cloning pods - var/temp = "Inactive" - var/scantemp_ckey - var/scantemp = "Ready to Scan" - var/menu = 1 //Which menu screen to display - var/list/records = list() - var/datum/data/record/active_record = null - var/obj/item/weapon/disk/data/diskette = null //Mostly so the geneticist can steal everything. - var/loading = 0 // Nice loading text - var/autoprocess = 0 - - light_color = LIGHT_COLOR_BLUE - -/obj/machinery/computer/cloning/Initialize() - ..() - updatemodules(TRUE) - -/obj/machinery/computer/cloning/Destroy() - if(pods) - for(var/P in pods) - DetachCloner(P) - pods = null - return ..() - -/obj/machinery/computer/cloning/proc/GetAvailablePod(mind = null) - if(pods) - for(var/P in pods) - var/obj/machinery/clonepod/pod = P - if(pod.occupant && pod.clonemind == mind) - return null - if(pod.is_operational() && !(pod.occupant || pod.mess)) - return pod - -/obj/machinery/computer/cloning/proc/HasEfficientPod() - if(pods) - for(var/P in pods) - var/obj/machinery/clonepod/pod = P - if(pod.is_operational() && pod.efficiency > 5) - return TRUE - -/obj/machinery/computer/cloning/proc/GetAvailableEfficientPod(mind = null) - if(pods) - for(var/P in pods) - var/obj/machinery/clonepod/pod = P - if(pod.occupant && pod.clonemind == mind) - return pod - else if(!. && pod.is_operational() && !(pod.occupant || pod.mess) && pod.efficiency > 5) - . = pod - -/obj/machinery/computer/cloning/process() - if(!(scanner && LAZYLEN(pods) && autoprocess)) - return - - if(scanner.occupant && scanner.scan_level > 2) - scan_occupant(scanner.occupant) - - for(var/datum/data/record/R in records) - var/obj/machinery/clonepod/pod = GetAvailableEfficientPod(R.fields["mind"]) - - if(!pod) - return - - if(pod.occupant) - continue //how though? - - if(pod.growclone(R.fields["ckey"], R.fields["name"], R.fields["UI"], R.fields["SE"], R.fields["mind"], R.fields["mrace"], R.fields["features"], R.fields["factions"])) - records -= R - -/obj/machinery/computer/cloning/proc/updatemodules(findfirstcloner) - src.scanner = findscanner() - if(findfirstcloner && !LAZYLEN(pods)) - findcloner() - -/obj/machinery/computer/cloning/proc/findscanner() - var/obj/machinery/dna_scannernew/scannerf = null - - // Loop through every direction - for(dir in list(NORTH,EAST,SOUTH,WEST)) - - // Try to find a scanner in that direction - scannerf = locate(/obj/machinery/dna_scannernew, get_step(src, dir)) - - // If found and operational, return the scanner - if (!isnull(scannerf) && scannerf.is_operational()) - return scannerf - - // If no scanner was found, it will return null - return null - -/obj/machinery/computer/cloning/proc/findcloner() - var/obj/machinery/clonepod/podf = null - - for(dir in list(NORTH,EAST,SOUTH,WEST)) - - podf = locate(/obj/machinery/clonepod, get_step(src, dir)) - - if (!isnull(podf) && podf.is_operational()) - AttachCloner(podf) - -/obj/machinery/computer/cloning/proc/AttachCloner(obj/machinery/clonepod/pod) - if(!pod.connected) - pod.connected = src - LAZYADD(pods, pod) - -/obj/machinery/computer/cloning/proc/DetachCloner(obj/machinery/clonepod/pod) - pod.connected = null - LAZYREMOVE(pods, pod) - -/obj/machinery/computer/cloning/attackby(obj/item/W, mob/user, params) - if(istype(W, /obj/item/weapon/disk/data)) //INSERT SOME DISKETTES - if (!src.diskette) - if(!user.drop_item()) - return - W.loc = src - src.diskette = W - to_chat(user, "You insert [W].") - playsound(src, 'sound/machines/terminal_insert_disc.ogg', 50, 0) - src.updateUsrDialog() - else if(istype(W,/obj/item/device/multitool)) - var/obj/item/device/multitool/P = W - - if(istype(P.buffer, /obj/machinery/clonepod)) - if(get_area(P.buffer) != get_area(src)) - to_chat(user, "-% Cannot link machines across power zones. Buffer cleared %-") - P.buffer = null - return - to_chat(user, "-% Successfully linked [P.buffer] with [src] %-") - var/obj/machinery/clonepod/pod = P.buffer - if(pod.connected) - pod.connected.DetachCloner(pod) - AttachCloner(pod) - else - P.buffer = src - to_chat(user, "-% Successfully stored \ref[P.buffer] [P.buffer.name] in buffer %-") - return - else - return ..() - -/obj/machinery/computer/cloning/attack_hand(mob/user) - if(..()) - return - interact(user) - -/obj/machinery/computer/cloning/interact(mob/user) - user.set_machine(src) - add_fingerprint(user) - - if(..()) - return - - updatemodules(TRUE) - - var/dat = "" - dat += "Refresh" - - if(scanner && HasEfficientPod() && scanner.scan_level > 2) - if(!autoprocess) - dat += "Autoprocess" - else - dat += "Stop autoprocess" - else - dat += "Autoprocess" - dat += "

Cloning Pod Status

" - dat += "
[temp] 
" - - switch(src.menu) - if(1) - // Modules - if (isnull(src.scanner) || !LAZYLEN(pods)) - dat += "

Modules

" - //dat += "Reload Modules" - if (isnull(src.scanner)) - dat += "ERROR: No Scanner detected!
" - if (!LAZYLEN(pods)) - dat += "ERROR: No Pod detected
" - - // Scanner - if (!isnull(src.scanner)) - var/mob/living/scanner_occupant = get_mob_or_brainmob(scanner.occupant) - - dat += "

Scanner Functions

" - - dat += "
" - if(!scanner_occupant) - dat += "Scanner Unoccupied" - else if(loading) - dat += "[scanner_occupant] => Scanning..." - else - if(scanner_occupant.ckey != scantemp_ckey) - scantemp = "Ready to Scan" - scantemp_ckey = scanner_occupant.ckey - dat += "[scanner_occupant] => [scantemp]" - dat += "
" - - if(scanner_occupant) - dat += "Start Scan" - dat += "
[src.scanner.locked ? "Unlock Scanner" : "Lock Scanner"]" - else - dat += "Start Scan" - - // Database - dat += "

Database Functions

" - if (src.records.len && src.records.len > 0) - dat += "View Records ([src.records.len])
" - else - dat += "View Records (0)
" - if (src.diskette) - dat += "Eject Disk
" - - - - if(2) - dat += "

Current records

" - dat += "<< Back

" - for(var/datum/data/record/R in records) - dat += "

[R.fields["name"]]

Scan ID [R.fields["id"]] View Record" - if(3) - dat += "

Selected Record

" - dat += "<< Back
" - - if (!src.active_record) - dat += "Record not found." - else - dat += "

[src.active_record.fields["name"]]

" - dat += "Scan ID [src.active_record.fields["id"]] Clone
" - - var/obj/item/weapon/implant/health/H = locate(src.active_record.fields["imp"]) - - if ((H) && (istype(H))) - dat += "Health Implant Data:
[H.sensehealth()]

" - else - dat += "Unable to locate Health Implant.

" - - dat += "Unique Identifier:
[src.active_record.fields["UI"]]
" - dat += "Structural Enzymes:
[src.active_record.fields["SE"]]
" - - if(diskette && diskette.fields) - dat += "
" - dat += "

Inserted Disk

" - dat += "Contents: " - var/list/L = list() - if(diskette.fields["UI"]) - L += "Unique Identifier" - if(diskette.fields["UE"] && diskette.fields["name"] && diskette.fields["blood_type"]) - L += "Unique Enzymes" - if(diskette.fields["SE"]) - L += "Structural Enzymes" - dat += english_list(L, "Empty", " + ", " + ") - dat += "
Load from Disk" - - dat += "
Save to Disk" - dat += "
" - - dat += "Delete Record" - - if(4) - if (!src.active_record) - src.menu = 2 - dat = "[src.temp]
" - dat += "

Confirm Record Deletion

" - - dat += "Scan card to confirm.
" - dat += "Cancel" - - - var/datum/browser/popup = new(user, "cloning", "Cloning System Control") - popup.set_content(dat) - popup.set_title_image(user.browse_rsc_icon(src.icon, src.icon_state)) - popup.open() - -/obj/machinery/computer/cloning/Topic(href, href_list) - if(..()) - return - - if(loading) - return - - if(href_list["task"]) - switch(href_list["task"]) - if("autoprocess") - autoprocess = 1 - playsound(src, 'sound/machines/terminal_prompt_confirm.ogg', 50, 0) - if("stopautoprocess") - autoprocess = 0 - playsound(src, 'sound/machines/terminal_prompt_deny.ogg', 50, 0) - - else if ((href_list["scan"]) && !isnull(scanner) && scanner.is_operational()) - scantemp = "" - - loading = 1 - src.updateUsrDialog() - playsound(src, 'sound/machines/terminal_prompt.ogg', 50, 0) - say("Initiating scan...") - - spawn(20) - src.scan_occupant(scanner.occupant) - - loading = 0 - src.updateUsrDialog() - playsound(src, 'sound/machines/terminal_prompt_confirm.ogg', 50, 0) - - - //No locking an open scanner. - else if ((href_list["lock"]) && !isnull(scanner) && scanner.is_operational()) - if ((!scanner.locked) && (scanner.occupant)) - scanner.locked = 1 - playsound(src, 'sound/machines/terminal_prompt_deny.ogg', 50, 0) - else - scanner.locked = 0 - playsound(src, 'sound/machines/terminal_prompt_confirm.ogg', 50, 0) - - else if(href_list["view_rec"]) - playsound(src, "terminal_type", 25, 0) - src.active_record = find_record("id", href_list["view_rec"], records) - if(active_record) - if(!active_record.fields["ckey"]) - records -= active_record - active_record = null - src.temp = "Record Corrupt" - else - src.menu = 3 - else - src.temp = "Record missing." - - else if (href_list["del_rec"]) - if ((!src.active_record) || (src.menu < 3)) - return - if (src.menu == 3) //If we are viewing a record, confirm deletion - src.temp = "Delete record?" - src.menu = 4 - playsound(src, 'sound/machines/terminal_prompt.ogg', 50, 0) - - else if (src.menu == 4) - var/obj/item/weapon/card/id/C = usr.get_active_held_item() - if (istype(C)||istype(C, /obj/item/device/pda)) - if(src.check_access(C)) - src.temp = "[src.active_record.fields["name"]] => Record deleted." - src.records.Remove(active_record) - active_record = null - playsound(src, 'sound/machines/terminal_prompt_confirm.ogg', 50, 0) - src.menu = 2 - else - src.temp = "Access Denied." - playsound(src, 'sound/machines/terminal_prompt_deny.ogg', 50, 0) - - else if (href_list["disk"]) //Load or eject. - switch(href_list["disk"]) - if("load") - if (!diskette || !istype(diskette.fields) || !diskette.fields["name"] || !diskette.fields) - src.temp = "Load error." - src.updateUsrDialog() - playsound(src, 'sound/machines/terminal_prompt_deny.ogg', 50, 0) - return - if (!src.active_record) - src.temp = "Record error." - src.menu = 1 - src.updateUsrDialog() - playsound(src, 'sound/machines/terminal_prompt_deny.ogg', 50, 0) - return - - for(var/key in diskette.fields) - src.active_record.fields[key] = diskette.fields[key] - src.temp = "Load successful." - playsound(src, 'sound/machines/terminal_prompt_confirm.ogg', 50, 0) - - if("eject") - if(src.diskette) - src.diskette.loc = src.loc - src.diskette = null - playsound(src, 'sound/machines/terminal_insert_disc.ogg', 50, 0) - if("save") - if(!diskette || diskette.read_only || !active_record || !active_record.fields) - src.temp = "Save error." - src.updateUsrDialog() - playsound(src, 'sound/machines/terminal_prompt_deny.ogg', 50, 0) - return - - diskette.fields = active_record.fields.Copy() - diskette.name = "data disk - '[src.diskette.fields["name"]]'" - src.temp = "Save successful." - playsound(src, 'sound/machines/terminal_prompt_confirm.ogg', 50, 0) - - else if (href_list["refresh"]) - src.updateUsrDialog() - playsound(src, "terminal_type", 25, 0) - - else if (href_list["clone"]) - var/datum/data/record/C = find_record("id", href_list["clone"], records) - //Look for that player! They better be dead! - if(C) - var/obj/machinery/clonepod/pod = GetAvailablePod() - //Can't clone without someone to clone. Or a pod. Or if the pod is busy. Or full of gibs. - if(!LAZYLEN(pods)) - temp = "No Clonepods detected." - playsound(src, 'sound/machines/terminal_prompt_deny.ogg', 50, 0) - else if(!pod) - temp = "No Clonepods available." - playsound(src, 'sound/machines/terminal_prompt_deny.ogg', 50, 0) - else if(!config.revival_cloning) - temp = "Unable to initiate cloning cycle." - playsound(src, 'sound/machines/terminal_prompt_deny.ogg', 50, 0) - else if(pod.occupant) - temp = "Cloning cycle already in progress." - playsound(src, 'sound/machines/terminal_prompt_deny.ogg', 50, 0) - else if(pod.growclone(C.fields["ckey"], C.fields["name"], C.fields["UI"], C.fields["SE"], C.fields["mind"], C.fields["mrace"], C.fields["features"], C.fields["factions"])) - temp = "[C.fields["name"]] => Cloning cycle in progress..." - playsound(src, 'sound/machines/terminal_prompt_confirm.ogg', 50, 0) - records.Remove(C) - if(active_record == C) - active_record = null - menu = 1 - else - temp = "[C.fields["name"]] => Initialisation failure." - playsound(src, 'sound/machines/terminal_prompt_deny.ogg', 50, 0) - - else - temp = "Data corruption." - playsound(src, 'sound/machines/terminal_prompt_deny.ogg', 50, 0) - - else if (href_list["menu"]) - src.menu = text2num(href_list["menu"]) - playsound(src, "terminal_type", 25, 0) - - src.add_fingerprint(usr) - src.updateUsrDialog() - return - -/obj/machinery/computer/cloning/proc/scan_occupant(occupant) - var/mob/living/mob_occupant = get_mob_or_brainmob(occupant) - var/datum/dna/dna - if(iscarbon(mob_occupant)) - var/mob/living/carbon/C = mob_occupant - dna = C.has_dna() - if(istype(mob_occupant, /mob/living/brain)) - var/mob/living/brain/B = mob_occupant - dna = B.stored_dna - - if(!istype(dna)) - scantemp = "Unable to locate valid genetic data." - playsound(src, 'sound/machines/terminal_prompt_deny.ogg', 50, 0) - return - if(mob_occupant.suiciding || mob_occupant.hellbound) - scantemp = "Subject's brain is not responding to scanning stimuli." - playsound(src, 'sound/machines/terminal_prompt_deny.ogg', 50, 0) - return - if((mob_occupant.disabilities & NOCLONE) && (src.scanner.scan_level < 2)) - scantemp = "Subject no longer contains the fundamental materials required to create a living clone." - playsound(src, 'sound/machines/terminal_alert.ogg', 50, 0) - return - if ((!mob_occupant.ckey) || (!mob_occupant.client)) - scantemp = "Mental interface failure." - playsound(src, 'sound/machines/terminal_prompt_deny.ogg', 50, 0) - return - if (find_record("ckey", mob_occupant.ckey, records)) - scantemp = "Subject already in database." - playsound(src, 'sound/machines/terminal_prompt_deny.ogg', 50, 0) - return - - var/datum/data/record/R = new() - if(dna.species) - // We store the instance rather than the path, because some - // species (abductors, slimepeople) store state in their - // species datums - R.fields["mrace"] = dna.species - else - var/datum/species/rando_race = pick(config.roundstart_races) - R.fields["mrace"] = rando_race.type - - R.fields["ckey"] = mob_occupant.ckey - R.fields["name"] = mob_occupant.real_name - R.fields["id"] = copytext(md5(mob_occupant.real_name), 2, 6) - R.fields["UE"] = dna.unique_enzymes - R.fields["UI"] = dna.uni_identity - R.fields["SE"] = dna.struc_enzymes - R.fields["blood_type"] = dna.blood_type - R.fields["features"] = dna.features - R.fields["factions"] = mob_occupant.faction - - if (!isnull(mob_occupant.mind)) //Save that mind so traitors can continue traitoring after cloning. - R.fields["mind"] = "\ref[mob_occupant.mind]" - - //Add an implant if needed - var/obj/item/weapon/implant/health/imp - for(var/obj/item/weapon/implant/health/HI in mob_occupant.implants) - imp = HI - break - if(!imp) - imp = new /obj/item/weapon/implant/health(mob_occupant) - imp.implant(mob_occupant) - R.fields["imp"] = "\ref[imp]" - - src.records += R - scantemp = "Subject successfully scanned." - playsound(src, 'sound/machines/terminal_prompt_confirm.ogg', 50, 0) +/obj/machinery/computer/cloning + name = "cloning console" + desc = "Used to clone people and manage DNA." + icon_screen = "dna" + icon_keyboard = "med_key" + circuit = /obj/item/weapon/circuitboard/computer/cloning + req_access = list(GLOB.access_heads) //Only used for record deletion right now. + var/obj/machinery/dna_scannernew/scanner = null //Linked scanner. For scanning. + var/list/pods //Linked cloning pods + var/temp = "Inactive" + var/scantemp_ckey + var/scantemp = "Ready to Scan" + var/menu = 1 //Which menu screen to display + var/list/records = list() + var/datum/data/record/active_record = null + var/obj/item/weapon/disk/data/diskette = null //Mostly so the geneticist can steal everything. + var/loading = 0 // Nice loading text + var/autoprocess = 0 + + light_color = LIGHT_COLOR_BLUE + +/obj/machinery/computer/cloning/Initialize() + ..() + updatemodules(TRUE) + +/obj/machinery/computer/cloning/Destroy() + if(pods) + for(var/P in pods) + DetachCloner(P) + pods = null + return ..() + +/obj/machinery/computer/cloning/proc/GetAvailablePod(mind = null) + if(pods) + for(var/P in pods) + var/obj/machinery/clonepod/pod = P + if(pod.occupant && pod.clonemind == mind) + return null + if(pod.is_operational() && !(pod.occupant || pod.mess)) + return pod + +/obj/machinery/computer/cloning/proc/HasEfficientPod() + if(pods) + for(var/P in pods) + var/obj/machinery/clonepod/pod = P + if(pod.is_operational() && pod.efficiency > 5) + return TRUE + +/obj/machinery/computer/cloning/proc/GetAvailableEfficientPod(mind = null) + if(pods) + for(var/P in pods) + var/obj/machinery/clonepod/pod = P + if(pod.occupant && pod.clonemind == mind) + return pod + else if(!. && pod.is_operational() && !(pod.occupant || pod.mess) && pod.efficiency > 5) + . = pod + +/obj/machinery/computer/cloning/process() + if(!(scanner && LAZYLEN(pods) && autoprocess)) + return + + if(scanner.occupant && scanner.scan_level > 2) + scan_occupant(scanner.occupant) + + for(var/datum/data/record/R in records) + var/obj/machinery/clonepod/pod = GetAvailableEfficientPod(R.fields["mind"]) + + if(!pod) + return + + if(pod.occupant) + continue //how though? + + if(pod.growclone(R.fields["ckey"], R.fields["name"], R.fields["UI"], R.fields["SE"], R.fields["mind"], R.fields["mrace"], R.fields["features"], R.fields["factions"])) + records -= R + +/obj/machinery/computer/cloning/proc/updatemodules(findfirstcloner) + src.scanner = findscanner() + if(findfirstcloner && !LAZYLEN(pods)) + findcloner() + +/obj/machinery/computer/cloning/proc/findscanner() + var/obj/machinery/dna_scannernew/scannerf = null + + // Loop through every direction + for(dir in list(NORTH,EAST,SOUTH,WEST)) + + // Try to find a scanner in that direction + scannerf = locate(/obj/machinery/dna_scannernew, get_step(src, dir)) + + // If found and operational, return the scanner + if (!isnull(scannerf) && scannerf.is_operational()) + return scannerf + + // If no scanner was found, it will return null + return null + +/obj/machinery/computer/cloning/proc/findcloner() + var/obj/machinery/clonepod/podf = null + + for(dir in list(NORTH,EAST,SOUTH,WEST)) + + podf = locate(/obj/machinery/clonepod, get_step(src, dir)) + + if (!isnull(podf) && podf.is_operational()) + AttachCloner(podf) + +/obj/machinery/computer/cloning/proc/AttachCloner(obj/machinery/clonepod/pod) + if(!pod.connected) + pod.connected = src + LAZYADD(pods, pod) + +/obj/machinery/computer/cloning/proc/DetachCloner(obj/machinery/clonepod/pod) + pod.connected = null + LAZYREMOVE(pods, pod) + +/obj/machinery/computer/cloning/attackby(obj/item/W, mob/user, params) + if(istype(W, /obj/item/weapon/disk/data)) //INSERT SOME DISKETTES + if (!src.diskette) + if(!user.drop_item()) + return + W.loc = src + src.diskette = W + to_chat(user, "You insert [W].") + playsound(src, 'sound/machines/terminal_insert_disc.ogg', 50, 0) + src.updateUsrDialog() + else if(istype(W,/obj/item/device/multitool)) + var/obj/item/device/multitool/P = W + + if(istype(P.buffer, /obj/machinery/clonepod)) + if(get_area(P.buffer) != get_area(src)) + to_chat(user, "-% Cannot link machines across power zones. Buffer cleared %-") + P.buffer = null + return + to_chat(user, "-% Successfully linked [P.buffer] with [src] %-") + var/obj/machinery/clonepod/pod = P.buffer + if(pod.connected) + pod.connected.DetachCloner(pod) + AttachCloner(pod) + else + P.buffer = src + to_chat(user, "-% Successfully stored \ref[P.buffer] [P.buffer.name] in buffer %-") + return + else + return ..() + +/obj/machinery/computer/cloning/attack_hand(mob/user) + if(..()) + return + interact(user) + +/obj/machinery/computer/cloning/interact(mob/user) + user.set_machine(src) + add_fingerprint(user) + + if(..()) + return + + updatemodules(TRUE) + + var/dat = "" + dat += "Refresh" + + if(scanner && HasEfficientPod() && scanner.scan_level > 2) + if(!autoprocess) + dat += "Autoprocess" + else + dat += "Stop autoprocess" + else + dat += "Autoprocess" + dat += "

Cloning Pod Status

" + dat += "
[temp] 
" + + switch(src.menu) + if(1) + // Modules + if (isnull(src.scanner) || !LAZYLEN(pods)) + dat += "

Modules

" + //dat += "Reload Modules" + if (isnull(src.scanner)) + dat += "ERROR: No Scanner detected!
" + if (!LAZYLEN(pods)) + dat += "ERROR: No Pod detected
" + + // Scanner + if (!isnull(src.scanner)) + var/mob/living/scanner_occupant = get_mob_or_brainmob(scanner.occupant) + + dat += "

Scanner Functions

" + + dat += "
" + if(!scanner_occupant) + dat += "Scanner Unoccupied" + else if(loading) + dat += "[scanner_occupant] => Scanning..." + else + if(scanner_occupant.ckey != scantemp_ckey) + scantemp = "Ready to Scan" + scantemp_ckey = scanner_occupant.ckey + dat += "[scanner_occupant] => [scantemp]" + dat += "
" + + if(scanner_occupant) + dat += "Start Scan" + dat += "
[src.scanner.locked ? "Unlock Scanner" : "Lock Scanner"]" + else + dat += "Start Scan" + + // Database + dat += "

Database Functions

" + if (src.records.len && src.records.len > 0) + dat += "View Records ([src.records.len])
" + else + dat += "View Records (0)
" + if (src.diskette) + dat += "Eject Disk
" + + + + if(2) + dat += "

Current records

" + dat += "<< Back

" + for(var/datum/data/record/R in records) + dat += "

[R.fields["name"]]

Scan ID [R.fields["id"]] View Record" + if(3) + dat += "

Selected Record

" + dat += "<< Back
" + + if (!src.active_record) + dat += "Record not found." + else + dat += "

[src.active_record.fields["name"]]

" + dat += "Scan ID [src.active_record.fields["id"]] Clone
" + + var/obj/item/weapon/implant/health/H = locate(src.active_record.fields["imp"]) + + if ((H) && (istype(H))) + dat += "Health Implant Data:
[H.sensehealth()]

" + else + dat += "Unable to locate Health Implant.

" + + dat += "Unique Identifier:
[src.active_record.fields["UI"]]
" + dat += "Structural Enzymes:
[src.active_record.fields["SE"]]
" + + if(diskette && diskette.fields) + dat += "
" + dat += "

Inserted Disk

" + dat += "Contents: " + var/list/L = list() + if(diskette.fields["UI"]) + L += "Unique Identifier" + if(diskette.fields["UE"] && diskette.fields["name"] && diskette.fields["blood_type"]) + L += "Unique Enzymes" + if(diskette.fields["SE"]) + L += "Structural Enzymes" + dat += english_list(L, "Empty", " + ", " + ") + dat += "
Load from Disk" + + dat += "
Save to Disk" + dat += "
" + + dat += "Delete Record" + + if(4) + if (!src.active_record) + src.menu = 2 + dat = "[src.temp]
" + dat += "

Confirm Record Deletion

" + + dat += "Scan card to confirm.
" + dat += "Cancel" + + + var/datum/browser/popup = new(user, "cloning", "Cloning System Control") + popup.set_content(dat) + popup.set_title_image(user.browse_rsc_icon(src.icon, src.icon_state)) + popup.open() + +/obj/machinery/computer/cloning/Topic(href, href_list) + if(..()) + return + + if(loading) + return + + if(href_list["task"]) + switch(href_list["task"]) + if("autoprocess") + autoprocess = 1 + playsound(src, 'sound/machines/terminal_prompt_confirm.ogg', 50, 0) + if("stopautoprocess") + autoprocess = 0 + playsound(src, 'sound/machines/terminal_prompt_deny.ogg', 50, 0) + + else if ((href_list["scan"]) && !isnull(scanner) && scanner.is_operational()) + scantemp = "" + + loading = 1 + src.updateUsrDialog() + playsound(src, 'sound/machines/terminal_prompt.ogg', 50, 0) + say("Initiating scan...") + + spawn(20) + src.scan_occupant(scanner.occupant) + + loading = 0 + src.updateUsrDialog() + playsound(src, 'sound/machines/terminal_prompt_confirm.ogg', 50, 0) + + + //No locking an open scanner. + else if ((href_list["lock"]) && !isnull(scanner) && scanner.is_operational()) + if ((!scanner.locked) && (scanner.occupant)) + scanner.locked = 1 + playsound(src, 'sound/machines/terminal_prompt_deny.ogg', 50, 0) + else + scanner.locked = 0 + playsound(src, 'sound/machines/terminal_prompt_confirm.ogg', 50, 0) + + else if(href_list["view_rec"]) + playsound(src, "terminal_type", 25, 0) + src.active_record = find_record("id", href_list["view_rec"], records) + if(active_record) + if(!active_record.fields["ckey"]) + records -= active_record + active_record = null + src.temp = "Record Corrupt" + else + src.menu = 3 + else + src.temp = "Record missing." + + else if (href_list["del_rec"]) + if ((!src.active_record) || (src.menu < 3)) + return + if (src.menu == 3) //If we are viewing a record, confirm deletion + src.temp = "Delete record?" + src.menu = 4 + playsound(src, 'sound/machines/terminal_prompt.ogg', 50, 0) + + else if (src.menu == 4) + var/obj/item/weapon/card/id/C = usr.get_active_held_item() + if (istype(C)||istype(C, /obj/item/device/pda)) + if(src.check_access(C)) + src.temp = "[src.active_record.fields["name"]] => Record deleted." + src.records.Remove(active_record) + active_record = null + playsound(src, 'sound/machines/terminal_prompt_confirm.ogg', 50, 0) + src.menu = 2 + else + src.temp = "Access Denied." + playsound(src, 'sound/machines/terminal_prompt_deny.ogg', 50, 0) + + else if (href_list["disk"]) //Load or eject. + switch(href_list["disk"]) + if("load") + if (!diskette || !istype(diskette.fields) || !diskette.fields["name"] || !diskette.fields) + src.temp = "Load error." + src.updateUsrDialog() + playsound(src, 'sound/machines/terminal_prompt_deny.ogg', 50, 0) + return + if (!src.active_record) + src.temp = "Record error." + src.menu = 1 + src.updateUsrDialog() + playsound(src, 'sound/machines/terminal_prompt_deny.ogg', 50, 0) + return + + for(var/key in diskette.fields) + src.active_record.fields[key] = diskette.fields[key] + src.temp = "Load successful." + playsound(src, 'sound/machines/terminal_prompt_confirm.ogg', 50, 0) + + if("eject") + if(src.diskette) + src.diskette.loc = src.loc + src.diskette = null + playsound(src, 'sound/machines/terminal_insert_disc.ogg', 50, 0) + if("save") + if(!diskette || diskette.read_only || !active_record || !active_record.fields) + src.temp = "Save error." + src.updateUsrDialog() + playsound(src, 'sound/machines/terminal_prompt_deny.ogg', 50, 0) + return + + diskette.fields = active_record.fields.Copy() + diskette.name = "data disk - '[src.diskette.fields["name"]]'" + src.temp = "Save successful." + playsound(src, 'sound/machines/terminal_prompt_confirm.ogg', 50, 0) + + else if (href_list["refresh"]) + src.updateUsrDialog() + playsound(src, "terminal_type", 25, 0) + + else if (href_list["clone"]) + var/datum/data/record/C = find_record("id", href_list["clone"], records) + //Look for that player! They better be dead! + if(C) + var/obj/machinery/clonepod/pod = GetAvailablePod() + //Can't clone without someone to clone. Or a pod. Or if the pod is busy. Or full of gibs. + if(!LAZYLEN(pods)) + temp = "No Clonepods detected." + playsound(src, 'sound/machines/terminal_prompt_deny.ogg', 50, 0) + else if(!pod) + temp = "No Clonepods available." + playsound(src, 'sound/machines/terminal_prompt_deny.ogg', 50, 0) + else if(!config.revival_cloning) + temp = "Unable to initiate cloning cycle." + playsound(src, 'sound/machines/terminal_prompt_deny.ogg', 50, 0) + else if(pod.occupant) + temp = "Cloning cycle already in progress." + playsound(src, 'sound/machines/terminal_prompt_deny.ogg', 50, 0) + else if(pod.growclone(C.fields["ckey"], C.fields["name"], C.fields["UI"], C.fields["SE"], C.fields["mind"], C.fields["mrace"], C.fields["features"], C.fields["factions"])) + temp = "[C.fields["name"]] => Cloning cycle in progress..." + playsound(src, 'sound/machines/terminal_prompt_confirm.ogg', 50, 0) + records.Remove(C) + if(active_record == C) + active_record = null + menu = 1 + else + temp = "[C.fields["name"]] => Initialisation failure." + playsound(src, 'sound/machines/terminal_prompt_deny.ogg', 50, 0) + + else + temp = "Data corruption." + playsound(src, 'sound/machines/terminal_prompt_deny.ogg', 50, 0) + + else if (href_list["menu"]) + src.menu = text2num(href_list["menu"]) + playsound(src, "terminal_type", 25, 0) + + src.add_fingerprint(usr) + src.updateUsrDialog() + return + +/obj/machinery/computer/cloning/proc/scan_occupant(occupant) + var/mob/living/mob_occupant = get_mob_or_brainmob(occupant) + var/datum/dna/dna + if(iscarbon(mob_occupant)) + var/mob/living/carbon/C = mob_occupant + dna = C.has_dna() + if(istype(mob_occupant, /mob/living/brain)) + var/mob/living/brain/B = mob_occupant + dna = B.stored_dna + + if(!istype(dna)) + scantemp = "Unable to locate valid genetic data." + playsound(src, 'sound/machines/terminal_prompt_deny.ogg', 50, 0) + return + if(mob_occupant.suiciding || mob_occupant.hellbound) + scantemp = "Subject's brain is not responding to scanning stimuli." + playsound(src, 'sound/machines/terminal_prompt_deny.ogg', 50, 0) + return + if((mob_occupant.disabilities & NOCLONE) && (src.scanner.scan_level < 2)) + scantemp = "Subject no longer contains the fundamental materials required to create a living clone." + playsound(src, 'sound/machines/terminal_alert.ogg', 50, 0) + return + if ((!mob_occupant.ckey) || (!mob_occupant.client)) + scantemp = "Mental interface failure." + playsound(src, 'sound/machines/terminal_prompt_deny.ogg', 50, 0) + return + if (find_record("ckey", mob_occupant.ckey, records)) + scantemp = "Subject already in database." + playsound(src, 'sound/machines/terminal_prompt_deny.ogg', 50, 0) + return + + var/datum/data/record/R = new() + if(dna.species) + // We store the instance rather than the path, because some + // species (abductors, slimepeople) store state in their + // species datums + R.fields["mrace"] = dna.species + else + var/datum/species/rando_race = pick(config.roundstart_races) + R.fields["mrace"] = rando_race.type + + R.fields["ckey"] = mob_occupant.ckey + R.fields["name"] = mob_occupant.real_name + R.fields["id"] = copytext(md5(mob_occupant.real_name), 2, 6) + R.fields["UE"] = dna.unique_enzymes + R.fields["UI"] = dna.uni_identity + R.fields["SE"] = dna.struc_enzymes + R.fields["blood_type"] = dna.blood_type + R.fields["features"] = dna.features + R.fields["factions"] = mob_occupant.faction + + if (!isnull(mob_occupant.mind)) //Save that mind so traitors can continue traitoring after cloning. + R.fields["mind"] = "\ref[mob_occupant.mind]" + + //Add an implant if needed + var/obj/item/weapon/implant/health/imp + for(var/obj/item/weapon/implant/health/HI in mob_occupant.implants) + imp = HI + break + if(!imp) + imp = new /obj/item/weapon/implant/health(mob_occupant) + imp.implant(mob_occupant) + R.fields["imp"] = "\ref[imp]" + + src.records += R + scantemp = "Subject successfully scanned." + playsound(src, 'sound/machines/terminal_prompt_confirm.ogg', 50, 0) diff --git a/code/game/machinery/computer/robot.dm b/code/game/machinery/computer/robot.dm index 214163c739..79d6aa0b52 100644 --- a/code/game/machinery/computer/robot.dm +++ b/code/game/machinery/computer/robot.dm @@ -1,172 +1,172 @@ - - - -/obj/machinery/computer/robotics - name = "robotics control console" - desc = "Used to remotely lockdown or detonate linked Cyborgs." - icon_screen = "robot" - icon_keyboard = "rd_key" - req_access = list(GLOB.access_robotics) - circuit = /obj/item/weapon/circuitboard/computer/robotics - var/temp = null - - light_color = LIGHT_COLOR_PINK - -/obj/machinery/computer/robotics/proc/can_control(mob/user, mob/living/silicon/robot/R) - if(!istype(R)) - return 0 - if(isAI(user)) - if (R.connected_ai != user) - return 0 - if(iscyborg(user)) - if (R != user) - return 0 - if(R.scrambledcodes) - return 0 - return 1 - -/obj/machinery/computer/robotics/attack_hand(mob/user) - if(..()) - return - interact(user) - -/obj/machinery/computer/robotics/interact(mob/user) - if (src.z > 6) - to_chat(user, "Unable to establish a connection: \black You're too far away from the station!") - return - user.set_machine(src) - var/dat - var/robots = 0 - for(var/mob/living/silicon/robot/R in GLOB.mob_list) - if(!can_control(user, R)) - continue - robots++ - dat += "[R.name] |" - if(R.stat) - dat += " Not Responding |" - else if (!R.canmove) - dat += " Locked Down |" - else - dat += " Operating Normally |" - if (!R.canmove) - else if(R.cell) - dat += " Battery Installed ([R.cell.charge]/[R.cell.maxcharge]) |" - else - dat += " No Cell Installed |" - if(R.module) - dat += " Module Installed ([R.module.name]) |" - else - dat += " No Module Installed |" - if(R.connected_ai) - dat += " Slaved to [R.connected_ai.name] |" - else - dat += " Independent from AI |" - if(issilicon(user) || IsAdminGhost(user)) - if(is_servant_of_ratvar(user) && user != R) - dat += "(Convert) " - else if(((issilicon(user) && is_special_character(user)) || IsAdminGhost(user)) && !R.emagged && (user != R || R.syndicate)) - dat += "(Hack) " - dat += "([R.canmove ? "Lockdown" : "Release"]) " - dat += "(Destroy)" - dat += "
" - - if(!robots) - dat += "No Cyborg Units detected within access parameters." - dat += "
" - - var/drones = 0 - for(var/mob/living/simple_animal/drone/D in GLOB.mob_list) - if(D.hacked) - continue - drones++ - dat += "[D.name] |" - if(D.stat) - dat += " Not Responding |" - dat += "(Destroy)" - dat += "
" - - if(!drones) - dat += "No Drone Units detected within access parameters." - - var/datum/browser/popup = new(user, "computer", "Cyborg Control Console", 400, 500) - popup.set_content(dat) - popup.set_title_image(user.browse_rsc_icon(src.icon, src.icon_state)) - popup.open() - return - -/obj/machinery/computer/robotics/Topic(href, href_list) - if(..()) - return - - if (href_list["temp"]) - src.temp = null - - else if (href_list["killbot"]) - if(src.allowed(usr)) - var/mob/living/silicon/robot/R = locate(href_list["killbot"]) in GLOB.silicon_mobs - if(can_control(usr, R)) - var/choice = input("Are you certain you wish to detonate [R.name]?") in list("Confirm", "Abort") - if(choice == "Confirm" && can_control(usr, R) && !..()) - if(R.syndicate && R.emagged) - to_chat(R, "Extreme danger. Termination codes detected. Scrambling security codes and automatic AI unlink triggered.") - if(R.connected_ai) - to_chat(R.connected_ai, "

ALERT - Cyborg detonation detected: [R.name]
") - R.ResetSecurityCodes() - else - var/turf/T = get_turf(R) - message_admins("[ADMIN_LOOKUPFLW(usr)] detonated [key_name(R, R.client)][ADMIN_JMP(T)]!") - log_game("\[key_name(usr)] detonated [key_name(R)]!") - if(R.connected_ai) - to_chat(R.connected_ai, "

ALERT - Cyborg detonation detected: [R.name]
") - R.self_destruct() - else - to_chat(usr, "Access Denied.") - - else if (href_list["stopbot"]) - if(src.allowed(usr)) - var/mob/living/silicon/robot/R = locate(href_list["stopbot"]) in GLOB.silicon_mobs - if(can_control(usr, R)) - var/choice = input("Are you certain you wish to [R.canmove ? "lock down" : "release"] [R.name]?") in list("Confirm", "Abort") - if(choice == "Confirm" && can_control(usr, R) && !..()) - message_admins("[ADMIN_LOOKUPFLW(usr)] [R.canmove ? "locked down" : "released"] [key_name(R, R.client)][ADMIN_LOOKUPFLW(R)]!") - log_game("[key_name(usr)] [R.canmove ? "locked down" : "released"] [key_name(R)]!") - R.SetLockdown(!R.lockcharge) - to_chat(R, "[!R.lockcharge ? "Your lockdown has been lifted!" : "You have been locked down!"]") - if(R.connected_ai) - to_chat(R.connected_ai, "[!R.lockcharge ? "NOTICE - Cyborg lockdown lifted" : "ALERT - Cyborg lockdown detected"]: [R.name]
") - - else - to_chat(usr, "Access Denied.") - - else if (href_list["magbot"]) - if((issilicon(usr) && is_special_character(usr)) || IsAdminGhost(usr)) - var/mob/living/silicon/robot/R = locate(href_list["magbot"]) in GLOB.silicon_mobs - if(istype(R) && !R.emagged && ((R.syndicate && R == usr) || R.connected_ai == usr || IsAdminGhost(usr)) && !R.scrambledcodes && can_control(usr, R)) - log_game("[key_name(usr)] emagged [R.name] using robotic console!") - message_admins("[key_name_admin(usr)] emagged cyborg [key_name_admin(R)] using robotic console!") - R.SetEmagged(1) - if(is_special_character(R)) - R.verbs += /mob/living/silicon/robot/proc/ResetSecurityCodes - - else if(href_list["convert"]) - if(issilicon(usr) && is_special_character(usr)) - var/mob/living/silicon/robot/R = locate(href_list["convert"]) in GLOB.silicon_mobs - if(istype(R) && !is_servant_of_ratvar(R) && is_servant_of_ratvar(usr) && R.connected_ai == usr) - log_game("[key_name(usr)] converted [R.name] using robotic console!") - message_admins("[key_name_admin(usr)] converted cyborg [key_name_admin(R)] using robotic console!") - add_servant_of_ratvar(R) - - else if (href_list["killdrone"]) - if(src.allowed(usr)) - var/mob/living/simple_animal/drone/D = locate(href_list["killdrone"]) - if(D.hacked) - to_chat(usr, "ERROR: [D] is not responding to external commands.") - else - var/datum/effect_system/spark_spread/s = new /datum/effect_system/spark_spread - s.set_up(3, 1, D) - s.start() - D.visible_message("\the [D] self destructs!") - D.gib() - - src.updateUsrDialog() - return + + + +/obj/machinery/computer/robotics + name = "robotics control console" + desc = "Used to remotely lockdown or detonate linked Cyborgs." + icon_screen = "robot" + icon_keyboard = "rd_key" + req_access = list(GLOB.access_robotics) + circuit = /obj/item/weapon/circuitboard/computer/robotics + var/temp = null + + light_color = LIGHT_COLOR_PINK + +/obj/machinery/computer/robotics/proc/can_control(mob/user, mob/living/silicon/robot/R) + if(!istype(R)) + return 0 + if(isAI(user)) + if (R.connected_ai != user) + return 0 + if(iscyborg(user)) + if (R != user) + return 0 + if(R.scrambledcodes) + return 0 + return 1 + +/obj/machinery/computer/robotics/attack_hand(mob/user) + if(..()) + return + interact(user) + +/obj/machinery/computer/robotics/interact(mob/user) + if (src.z > 6) + to_chat(user, "Unable to establish a connection: \black You're too far away from the station!") + return + user.set_machine(src) + var/dat + var/robots = 0 + for(var/mob/living/silicon/robot/R in GLOB.mob_list) + if(!can_control(user, R)) + continue + robots++ + dat += "[R.name] |" + if(R.stat) + dat += " Not Responding |" + else if (!R.canmove) + dat += " Locked Down |" + else + dat += " Operating Normally |" + if (!R.canmove) + else if(R.cell) + dat += " Battery Installed ([R.cell.charge]/[R.cell.maxcharge]) |" + else + dat += " No Cell Installed |" + if(R.module) + dat += " Module Installed ([R.module.name]) |" + else + dat += " No Module Installed |" + if(R.connected_ai) + dat += " Slaved to [R.connected_ai.name] |" + else + dat += " Independent from AI |" + if(issilicon(user) || IsAdminGhost(user)) + if(is_servant_of_ratvar(user) && user != R) + dat += "(Convert) " + else if(((issilicon(user) && is_special_character(user)) || IsAdminGhost(user)) && !R.emagged && (user != R || R.syndicate)) + dat += "(Hack) " + dat += "([R.canmove ? "Lockdown" : "Release"]) " + dat += "(Destroy)" + dat += "
" + + if(!robots) + dat += "No Cyborg Units detected within access parameters." + dat += "
" + + var/drones = 0 + for(var/mob/living/simple_animal/drone/D in GLOB.mob_list) + if(D.hacked) + continue + drones++ + dat += "[D.name] |" + if(D.stat) + dat += " Not Responding |" + dat += "(Destroy)" + dat += "
" + + if(!drones) + dat += "No Drone Units detected within access parameters." + + var/datum/browser/popup = new(user, "computer", "Cyborg Control Console", 400, 500) + popup.set_content(dat) + popup.set_title_image(user.browse_rsc_icon(src.icon, src.icon_state)) + popup.open() + return + +/obj/machinery/computer/robotics/Topic(href, href_list) + if(..()) + return + + if (href_list["temp"]) + src.temp = null + + else if (href_list["killbot"]) + if(src.allowed(usr)) + var/mob/living/silicon/robot/R = locate(href_list["killbot"]) in GLOB.silicon_mobs + if(can_control(usr, R)) + var/choice = input("Are you certain you wish to detonate [R.name]?") in list("Confirm", "Abort") + if(choice == "Confirm" && can_control(usr, R) && !..()) + if(R.syndicate && R.emagged) + to_chat(R, "Extreme danger. Termination codes detected. Scrambling security codes and automatic AI unlink triggered.") + if(R.connected_ai) + to_chat(R.connected_ai, "

ALERT - Cyborg detonation detected: [R.name]
") + R.ResetSecurityCodes() + else + var/turf/T = get_turf(R) + message_admins("[ADMIN_LOOKUPFLW(usr)] detonated [key_name(R, R.client)][ADMIN_JMP(T)]!") + log_game("\[key_name(usr)] detonated [key_name(R)]!") + if(R.connected_ai) + to_chat(R.connected_ai, "

ALERT - Cyborg detonation detected: [R.name]
") + R.self_destruct() + else + to_chat(usr, "Access Denied.") + + else if (href_list["stopbot"]) + if(src.allowed(usr)) + var/mob/living/silicon/robot/R = locate(href_list["stopbot"]) in GLOB.silicon_mobs + if(can_control(usr, R)) + var/choice = input("Are you certain you wish to [R.canmove ? "lock down" : "release"] [R.name]?") in list("Confirm", "Abort") + if(choice == "Confirm" && can_control(usr, R) && !..()) + message_admins("[ADMIN_LOOKUPFLW(usr)] [R.canmove ? "locked down" : "released"] [key_name(R, R.client)][ADMIN_LOOKUPFLW(R)]!") + log_game("[key_name(usr)] [R.canmove ? "locked down" : "released"] [key_name(R)]!") + R.SetLockdown(!R.lockcharge) + to_chat(R, "[!R.lockcharge ? "Your lockdown has been lifted!" : "You have been locked down!"]") + if(R.connected_ai) + to_chat(R.connected_ai, "[!R.lockcharge ? "NOTICE - Cyborg lockdown lifted" : "ALERT - Cyborg lockdown detected"]: [R.name]
") + + else + to_chat(usr, "Access Denied.") + + else if (href_list["magbot"]) + if((issilicon(usr) && is_special_character(usr)) || IsAdminGhost(usr)) + var/mob/living/silicon/robot/R = locate(href_list["magbot"]) in GLOB.silicon_mobs + if(istype(R) && !R.emagged && ((R.syndicate && R == usr) || R.connected_ai == usr || IsAdminGhost(usr)) && !R.scrambledcodes && can_control(usr, R)) + log_game("[key_name(usr)] emagged [R.name] using robotic console!") + message_admins("[key_name_admin(usr)] emagged cyborg [key_name_admin(R)] using robotic console!") + R.SetEmagged(1) + if(is_special_character(R)) + R.verbs += /mob/living/silicon/robot/proc/ResetSecurityCodes + + else if(href_list["convert"]) + if(issilicon(usr) && is_special_character(usr)) + var/mob/living/silicon/robot/R = locate(href_list["convert"]) in GLOB.silicon_mobs + if(istype(R) && !is_servant_of_ratvar(R) && is_servant_of_ratvar(usr) && R.connected_ai == usr) + log_game("[key_name(usr)] converted [R.name] using robotic console!") + message_admins("[key_name_admin(usr)] converted cyborg [key_name_admin(R)] using robotic console!") + add_servant_of_ratvar(R) + + else if (href_list["killdrone"]) + if(src.allowed(usr)) + var/mob/living/simple_animal/drone/D = locate(href_list["killdrone"]) + if(D.hacked) + to_chat(usr, "ERROR: [D] is not responding to external commands.") + else + var/datum/effect_system/spark_spread/s = new /datum/effect_system/spark_spread + s.set_up(3, 1, D) + s.start() + D.visible_message("\the [D] self destructs!") + D.gib() + + src.updateUsrDialog() + return diff --git a/code/game/machinery/recycler.dm b/code/game/machinery/recycler.dm index e683b77097..fdeb6598e5 100644 --- a/code/game/machinery/recycler.dm +++ b/code/game/machinery/recycler.dm @@ -1,211 +1,211 @@ -#define SAFETY_COOLDOWN 100 - -/obj/machinery/recycler - name = "recycler" - desc = "A large crushing machine used to recycle small items inefficiently. There are lights on the side." - icon = 'icons/obj/recycling.dmi' - icon_state = "grinder-o0" - layer = ABOVE_ALL_MOB_LAYER // Overhead - anchored = 1 - density = 1 - var/safety_mode = FALSE // Temporarily stops machine if it detects a mob - var/icon_name = "grinder-o" - var/blood = 0 - var/eat_dir = WEST - var/amount_produced = 50 - var/datum/material_container/materials - var/crush_damage = 1000 - var/eat_victim_items = TRUE - var/item_recycle_sound = 'sound/items/Welder.ogg' - -/obj/machinery/recycler/New() - ..() - materials = new /datum/material_container(src, list(MAT_METAL, MAT_GLASS, MAT_PLASMA, MAT_SILVER, MAT_GOLD, MAT_DIAMOND, MAT_URANIUM, MAT_BANANIUM, MAT_TITANIUM)) - var/obj/item/weapon/circuitboard/machine/B = new /obj/item/weapon/circuitboard/machine/recycler(null) - B.apply_default_parts(src) - update_icon() - -/obj/item/weapon/circuitboard/machine/recycler - name = "Recycler (Machine Board)" - build_path = /obj/machinery/recycler - origin_tech = "programming=2;engineering=2" - req_components = list( - /obj/item/weapon/stock_parts/matter_bin = 1, - /obj/item/weapon/stock_parts/manipulator = 1) - -/obj/machinery/recycler/RefreshParts() - var/amt_made = 0 - var/mat_mod = 0 - for(var/obj/item/weapon/stock_parts/matter_bin/B in component_parts) - mat_mod = 2 * B.rating - mat_mod *= 50000 - for(var/obj/item/weapon/stock_parts/manipulator/M in component_parts) - amt_made = 12.5 * M.rating //% of materials salvaged - materials.max_amount = mat_mod - amount_produced = min(50, amt_made) + 50 - -/obj/machinery/recycler/examine(mob/user) - ..() - to_chat(user, "The power light is [(stat & NOPOWER) ? "off" : "on"].") - to_chat(user, "The safety-mode light is [safety_mode ? "on" : "off"].") - to_chat(user, "The safety-sensors status light is [emagged ? "off" : "on"].") - -/obj/machinery/recycler/power_change() - ..() - update_icon() - - -/obj/machinery/recycler/attackby(obj/item/I, mob/user, params) - if(default_deconstruction_screwdriver(user, "grinder-oOpen", "grinder-o0", I)) - return - - if(exchange_parts(user, I)) - return - - if(default_pry_open(I)) - return - - if(default_unfasten_wrench(user, I)) - return - - if(default_deconstruction_crowbar(I)) - return - return ..() - -/obj/machinery/recycler/emag_act(mob/user) - if(!emagged) - emagged = TRUE - if(safety_mode) - safety_mode = FALSE - update_icon() - playsound(src.loc, "sparks", 75, 1, -1) - to_chat(user, "You use the cryptographic sequencer on the [src.name].") - -/obj/machinery/recycler/update_icon() - ..() - var/is_powered = !(stat & (BROKEN|NOPOWER)) - if(safety_mode) - is_powered = FALSE - icon_state = icon_name + "[is_powered]" + "[(blood ? "bld" : "")]" // add the blood tag at the end - -// This is purely for admin possession !FUN!. -/obj/machinery/recycler/Bump(atom/movable/AM) - ..() - if(AM) - Bumped(AM) - - -/obj/machinery/recycler/Bumped(atom/movable/AM) - - if(stat & (BROKEN|NOPOWER)) - return - if(!anchored) - return - if(safety_mode) - return - - var/move_dir = get_dir(loc, AM.loc) - if(move_dir == eat_dir) - eat(AM) - -/obj/machinery/recycler/proc/eat(atom/AM0, sound=TRUE) - var/list/to_eat - if(istype(AM0, /obj/item)) - to_eat = AM0.GetAllContents() - else - to_eat = list(AM0) - - var/items_recycled = 0 - - for(var/i in to_eat) - var/atom/movable/AM = i - var/obj/item/bodypart/head/as_head = AM - var/obj/item/device/mmi/as_mmi = AM - var/brain_holder = istype(AM, /obj/item/organ/brain) || (istype(as_head) && as_head.brain) || (istype(as_mmi) && as_mmi.brain) || istype(AM, /mob/living/brain) - if(isliving(AM) || brain_holder) - if(emagged) - if(!brain_holder) - crush_living(AM) - else - emergency_stop(AM) - else if(istype(AM, /obj/item)) - recycle_item(AM) - items_recycled++ - else - playsound(src.loc, 'sound/machines/buzz-sigh.ogg', 50, 0) - AM.loc = src.loc - - if(items_recycled && sound) - playsound(src.loc, item_recycle_sound, 50, 1) - -/obj/machinery/recycler/proc/recycle_item(obj/item/I) - I.loc = src.loc - - var/material_amount = materials.get_item_material_amount(I) - if(!material_amount) - qdel(I) - return - materials.insert_item(I, multiplier = (amount_produced / 100)) - qdel(I) - materials.retrieve_all() - - -/obj/machinery/recycler/proc/emergency_stop(mob/living/L) - playsound(src.loc, 'sound/machines/buzz-sigh.ogg', 50, 0) - safety_mode = TRUE - update_icon() - L.loc = src.loc - addtimer(CALLBACK(src, .proc/reboot), SAFETY_COOLDOWN) - -/obj/machinery/recycler/proc/reboot() - playsound(src.loc, 'sound/machines/ping.ogg', 50, 0) - safety_mode = FALSE - update_icon() - -/obj/machinery/recycler/proc/crush_living(mob/living/L) - - L.loc = src.loc - - if(issilicon(L)) - playsound(src.loc, 'sound/items/Welder.ogg', 50, 1) - else - playsound(src.loc, 'sound/effects/splat.ogg', 50, 1) - - var/gib = TRUE - // By default, the emagged recycler will gib all non-carbons. (human simple animal mobs don't count) - if(iscarbon(L)) - gib = FALSE - if(L.stat == CONSCIOUS) - L.say("ARRRRRRRRRRRGH!!!") - add_mob_blood(L) - - if(!blood && !issilicon(L)) - blood = TRUE - update_icon() - - // Remove and recycle the equipped items - if(eat_victim_items) - for(var/obj/item/I in L.get_equipped_items()) - if(L.dropItemToGround(I)) - eat(I, sound=FALSE) - - // Instantly lie down, also go unconscious from the pain, before you die. - L.Paralyse(5) - - // For admin fun, var edit emagged to 2. - if(gib || emagged == 2) - L.gib() - else if(emagged == 1) - L.adjustBruteLoss(crush_damage) - -/obj/machinery/recycler/deathtrap - name = "dangerous old crusher" - emagged = TRUE - crush_damage = 120 - flags = NODECONSTRUCT - -/obj/item/weapon/paper/recycler - name = "paper - 'garbage duty instructions'" - info = "

New Assignment

You have been assigned to collect garbage from trash bins, located around the station. The crewmembers will put their trash into it and you will collect the said trash.

There is a recycling machine near your closet, inside maintenance; use it to recycle the trash for a small chance to get useful minerals. Then deliver these minerals to cargo or engineering. You are our last hope for a clean station, do not screw this up!" - +#define SAFETY_COOLDOWN 100 + +/obj/machinery/recycler + name = "recycler" + desc = "A large crushing machine used to recycle small items inefficiently. There are lights on the side." + icon = 'icons/obj/recycling.dmi' + icon_state = "grinder-o0" + layer = ABOVE_ALL_MOB_LAYER // Overhead + anchored = 1 + density = 1 + var/safety_mode = FALSE // Temporarily stops machine if it detects a mob + var/icon_name = "grinder-o" + var/blood = 0 + var/eat_dir = WEST + var/amount_produced = 50 + var/datum/material_container/materials + var/crush_damage = 1000 + var/eat_victim_items = TRUE + var/item_recycle_sound = 'sound/items/Welder.ogg' + +/obj/machinery/recycler/New() + ..() + materials = new /datum/material_container(src, list(MAT_METAL, MAT_GLASS, MAT_PLASMA, MAT_SILVER, MAT_GOLD, MAT_DIAMOND, MAT_URANIUM, MAT_BANANIUM, MAT_TITANIUM)) + var/obj/item/weapon/circuitboard/machine/B = new /obj/item/weapon/circuitboard/machine/recycler(null) + B.apply_default_parts(src) + update_icon() + +/obj/item/weapon/circuitboard/machine/recycler + name = "Recycler (Machine Board)" + build_path = /obj/machinery/recycler + origin_tech = "programming=2;engineering=2" + req_components = list( + /obj/item/weapon/stock_parts/matter_bin = 1, + /obj/item/weapon/stock_parts/manipulator = 1) + +/obj/machinery/recycler/RefreshParts() + var/amt_made = 0 + var/mat_mod = 0 + for(var/obj/item/weapon/stock_parts/matter_bin/B in component_parts) + mat_mod = 2 * B.rating + mat_mod *= 50000 + for(var/obj/item/weapon/stock_parts/manipulator/M in component_parts) + amt_made = 12.5 * M.rating //% of materials salvaged + materials.max_amount = mat_mod + amount_produced = min(50, amt_made) + 50 + +/obj/machinery/recycler/examine(mob/user) + ..() + to_chat(user, "The power light is [(stat & NOPOWER) ? "off" : "on"].") + to_chat(user, "The safety-mode light is [safety_mode ? "on" : "off"].") + to_chat(user, "The safety-sensors status light is [emagged ? "off" : "on"].") + +/obj/machinery/recycler/power_change() + ..() + update_icon() + + +/obj/machinery/recycler/attackby(obj/item/I, mob/user, params) + if(default_deconstruction_screwdriver(user, "grinder-oOpen", "grinder-o0", I)) + return + + if(exchange_parts(user, I)) + return + + if(default_pry_open(I)) + return + + if(default_unfasten_wrench(user, I)) + return + + if(default_deconstruction_crowbar(I)) + return + return ..() + +/obj/machinery/recycler/emag_act(mob/user) + if(!emagged) + emagged = TRUE + if(safety_mode) + safety_mode = FALSE + update_icon() + playsound(src.loc, "sparks", 75, 1, -1) + to_chat(user, "You use the cryptographic sequencer on the [src.name].") + +/obj/machinery/recycler/update_icon() + ..() + var/is_powered = !(stat & (BROKEN|NOPOWER)) + if(safety_mode) + is_powered = FALSE + icon_state = icon_name + "[is_powered]" + "[(blood ? "bld" : "")]" // add the blood tag at the end + +// This is purely for admin possession !FUN!. +/obj/machinery/recycler/Bump(atom/movable/AM) + ..() + if(AM) + Bumped(AM) + + +/obj/machinery/recycler/Bumped(atom/movable/AM) + + if(stat & (BROKEN|NOPOWER)) + return + if(!anchored) + return + if(safety_mode) + return + + var/move_dir = get_dir(loc, AM.loc) + if(move_dir == eat_dir) + eat(AM) + +/obj/machinery/recycler/proc/eat(atom/AM0, sound=TRUE) + var/list/to_eat + if(istype(AM0, /obj/item)) + to_eat = AM0.GetAllContents() + else + to_eat = list(AM0) + + var/items_recycled = 0 + + for(var/i in to_eat) + var/atom/movable/AM = i + var/obj/item/bodypart/head/as_head = AM + var/obj/item/device/mmi/as_mmi = AM + var/brain_holder = istype(AM, /obj/item/organ/brain) || (istype(as_head) && as_head.brain) || (istype(as_mmi) && as_mmi.brain) || istype(AM, /mob/living/brain) + if(isliving(AM) || brain_holder) + if(emagged) + if(!brain_holder) + crush_living(AM) + else + emergency_stop(AM) + else if(istype(AM, /obj/item)) + recycle_item(AM) + items_recycled++ + else + playsound(src.loc, 'sound/machines/buzz-sigh.ogg', 50, 0) + AM.loc = src.loc + + if(items_recycled && sound) + playsound(src.loc, item_recycle_sound, 50, 1) + +/obj/machinery/recycler/proc/recycle_item(obj/item/I) + I.loc = src.loc + + var/material_amount = materials.get_item_material_amount(I) + if(!material_amount) + qdel(I) + return + materials.insert_item(I, multiplier = (amount_produced / 100)) + qdel(I) + materials.retrieve_all() + + +/obj/machinery/recycler/proc/emergency_stop(mob/living/L) + playsound(src.loc, 'sound/machines/buzz-sigh.ogg', 50, 0) + safety_mode = TRUE + update_icon() + L.loc = src.loc + addtimer(CALLBACK(src, .proc/reboot), SAFETY_COOLDOWN) + +/obj/machinery/recycler/proc/reboot() + playsound(src.loc, 'sound/machines/ping.ogg', 50, 0) + safety_mode = FALSE + update_icon() + +/obj/machinery/recycler/proc/crush_living(mob/living/L) + + L.loc = src.loc + + if(issilicon(L)) + playsound(src.loc, 'sound/items/Welder.ogg', 50, 1) + else + playsound(src.loc, 'sound/effects/splat.ogg', 50, 1) + + var/gib = TRUE + // By default, the emagged recycler will gib all non-carbons. (human simple animal mobs don't count) + if(iscarbon(L)) + gib = FALSE + if(L.stat == CONSCIOUS) + L.say("ARRRRRRRRRRRGH!!!") + add_mob_blood(L) + + if(!blood && !issilicon(L)) + blood = TRUE + update_icon() + + // Remove and recycle the equipped items + if(eat_victim_items) + for(var/obj/item/I in L.get_equipped_items()) + if(L.dropItemToGround(I)) + eat(I, sound=FALSE) + + // Instantly lie down, also go unconscious from the pain, before you die. + L.Paralyse(5) + + // For admin fun, var edit emagged to 2. + if(gib || emagged == 2) + L.gib() + else if(emagged == 1) + L.adjustBruteLoss(crush_damage) + +/obj/machinery/recycler/deathtrap + name = "dangerous old crusher" + emagged = TRUE + crush_damage = 120 + flags = NODECONSTRUCT + +/obj/item/weapon/paper/recycler + name = "paper - 'garbage duty instructions'" + info = "

New Assignment

You have been assigned to collect garbage from trash bins, located around the station. The crewmembers will put their trash into it and you will collect the said trash.

There is a recycling machine near your closet, inside maintenance; use it to recycle the trash for a small chance to get useful minerals. Then deliver these minerals to cargo or engineering. You are our last hope for a clean station, do not screw this up!" + #undef SAFETY_COOLDOWN \ No newline at end of file diff --git a/code/game/machinery/suit_storage_unit.dm b/code/game/machinery/suit_storage_unit.dm index f64f761736..18d2a1b5bd 100644 --- a/code/game/machinery/suit_storage_unit.dm +++ b/code/game/machinery/suit_storage_unit.dm @@ -1,388 +1,388 @@ -// SUIT STORAGE UNIT ///////////////// -/obj/machinery/suit_storage_unit - name = "suit storage unit" - desc = "An industrial unit made to hold space suits. It comes with a built-in UV cauterization mechanism. A small warning label advises that organic matter should not be placed into the unit." - icon = 'icons/obj/suitstorage.dmi' - icon_state = "close" - anchored = 1 - density = 1 - obj_integrity = 250 - max_integrity = 250 - - var/obj/item/clothing/suit/space/suit = null - var/obj/item/clothing/head/helmet/space/helmet = null - var/obj/item/clothing/mask/mask = null - var/obj/item/storage = null - - var/suit_type = null - var/helmet_type = null - var/mask_type = null - var/storage_type = null - - state_open = FALSE - var/locked = FALSE - panel_open = FALSE - var/safeties = TRUE - - var/uv = FALSE - var/uv_super = FALSE - var/uv_cycles = 6 - -/obj/machinery/suit_storage_unit/standard_unit - suit_type = /obj/item/clothing/suit/space/eva - helmet_type = /obj/item/clothing/head/helmet/space/eva - mask_type = /obj/item/clothing/mask/breath - -/obj/machinery/suit_storage_unit/captain - suit_type = /obj/item/clothing/suit/space/hardsuit/captain - mask_type = /obj/item/clothing/mask/gas/sechailer - storage_type = /obj/item/weapon/tank/jetpack/oxygen/captain - -/obj/machinery/suit_storage_unit/engine - suit_type = /obj/item/clothing/suit/space/hardsuit/engine - mask_type = /obj/item/clothing/mask/breath - -/obj/machinery/suit_storage_unit/ce - suit_type = /obj/item/clothing/suit/space/hardsuit/engine/elite - mask_type = /obj/item/clothing/mask/breath - storage_type= /obj/item/clothing/shoes/magboots/advance - -/obj/machinery/suit_storage_unit/security - suit_type = /obj/item/clothing/suit/space/hardsuit/security - mask_type = /obj/item/clothing/mask/gas/sechailer - -/obj/machinery/suit_storage_unit/hos - suit_type = /obj/item/clothing/suit/space/hardsuit/security/hos - mask_type = /obj/item/clothing/mask/gas/sechailer - storage_type = /obj/item/weapon/tank/internals/oxygen - -/obj/machinery/suit_storage_unit/atmos - suit_type = /obj/item/clothing/suit/space/hardsuit/engine/atmos - mask_type = /obj/item/clothing/mask/gas - storage_type = /obj/item/weapon/watertank/atmos - -/obj/machinery/suit_storage_unit/mining - suit_type = /obj/item/clothing/suit/hooded/explorer - mask_type = /obj/item/clothing/mask/gas/explorer - -/obj/machinery/suit_storage_unit/mining/eva - suit_type = /obj/item/clothing/suit/space/hardsuit/mining - mask_type = /obj/item/clothing/mask/breath - -/obj/machinery/suit_storage_unit/cmo - suit_type = /obj/item/clothing/suit/space/hardsuit/medical - mask_type = /obj/item/clothing/mask/breath - -/obj/machinery/suit_storage_unit/rd - suit_type = /obj/item/clothing/suit/space/hardsuit/rd - mask_type = /obj/item/clothing/mask/breath - -/obj/machinery/suit_storage_unit/syndicate - suit_type = /obj/item/clothing/suit/space/hardsuit/syndi - mask_type = /obj/item/clothing/mask/gas/syndicate - storage_type = /obj/item/weapon/tank/jetpack/oxygen/harness - -/obj/machinery/suit_storage_unit/ert/command - suit_type = /obj/item/clothing/suit/space/hardsuit/ert - mask_type = /obj/item/clothing/mask/breath - storage_type = /obj/item/weapon/tank/internals/emergency_oxygen/double - -/obj/machinery/suit_storage_unit/ert/security - suit_type = /obj/item/clothing/suit/space/hardsuit/ert/sec - mask_type = /obj/item/clothing/mask/breath - storage_type = /obj/item/weapon/tank/internals/emergency_oxygen/double - -/obj/machinery/suit_storage_unit/ert/engineer - suit_type = /obj/item/clothing/suit/space/hardsuit/ert/engi - mask_type = /obj/item/clothing/mask/breath - storage_type = /obj/item/weapon/tank/internals/emergency_oxygen/double - -/obj/machinery/suit_storage_unit/ert/medical - suit_type = /obj/item/clothing/suit/space/hardsuit/ert/med - mask_type = /obj/item/clothing/mask/breath - storage_type = /obj/item/weapon/tank/internals/emergency_oxygen/double - -/obj/machinery/suit_storage_unit/New() - ..() - wires = new /datum/wires/suit_storage_unit(src) - if(suit_type) - suit = new suit_type(src) - if(helmet_type) - helmet = new helmet_type(src) - if(mask_type) - mask = new mask_type(src) - if(storage_type) - storage = new storage_type(src) - update_icon() - -/obj/machinery/suit_storage_unit/Destroy() - if(suit) - qdel(suit) - suit = null - if(helmet) - qdel(helmet) - helmet = null - if(mask) - qdel(mask) - mask = null - if(storage) - qdel(storage) - storage = null - return ..() - -/obj/machinery/suit_storage_unit/update_icon() - cut_overlays() - - if(uv) - if(uv_super) - add_overlay("super") - else if(occupant) - add_overlay("uvhuman") - else - add_overlay("uv") - else if(state_open) - if(stat & BROKEN) - add_overlay("broken") - else - add_overlay("open") - if(suit) - add_overlay("suit") - if(helmet) - add_overlay("helm") - if(storage) - add_overlay("storage") - else if(occupant) - add_overlay("human") - -/obj/machinery/suit_storage_unit/power_change() - ..() - if(!is_operational() && state_open) - open_machine() - dump_contents() - update_icon() - -/obj/machinery/suit_storage_unit/proc/dump_contents() - dropContents() - helmet = null - suit = null - mask = null - storage = null - occupant = null - -/obj/machinery/suit_storage_unit/deconstruct(disassembled = TRUE) - if(!(flags & NODECONSTRUCT)) - open_machine() - dump_contents() - new /obj/item/stack/sheet/metal (loc, 2) - qdel(src) - -/obj/machinery/suit_storage_unit/MouseDrop_T(atom/A, mob/user) - if(user.stat || user.lying || !Adjacent(user) || !Adjacent(A) || !isliving(A)) - return - var/mob/living/target = A - if(!state_open) - to_chat(user, "The unit's doors are shut!") - return - if(!is_operational()) - to_chat(user, "The unit is not operational!") - return - if(occupant || helmet || suit || storage) - to_chat(user, "It's too cluttered inside to fit in!") - return - - if(target == user) - user.visible_message("[user] starts squeezing into [src]!", "You start working your way into [src]...") - else - target.visible_message("[user] starts shoving [target] into [src]!", "[user] starts shoving you into [src]!") - - if(do_mob(user, target, 30)) - if(occupant || helmet || suit || storage) - return - if(target == user) - user.visible_message("[user] slips into [src] and closes the door behind them!", "You slip into [src]'s cramped space and shut its door.") - else - target.visible_message("[user] pushes [target] into [src] and shuts its door!", "[user] shoves you into [src] and shuts the door!") - close_machine(target) - add_fingerprint(user) - -/obj/machinery/suit_storage_unit/proc/cook() - if(uv_cycles) - uv_cycles-- - uv = TRUE - locked = TRUE - update_icon() - if(occupant) - var/mob/living/mob_occupant = occupant - if(uv_super) - mob_occupant.adjustFireLoss(rand(20, 36)) - else - mob_occupant.adjustFireLoss(rand(10, 16)) - mob_occupant.emote("scream") - addtimer(CALLBACK(src, .proc/cook), 50) - else - uv_cycles = initial(uv_cycles) - uv = FALSE - locked = FALSE - if(uv_super) - visible_message("[src]'s door creaks open with a loud whining noise. A cloud of foul black smoke escapes from its chamber.") - playsound(src, 'sound/machines/airlock_alien_prying.ogg', 50, 1) - helmet = null - qdel(helmet) - suit = null - qdel(suit) // Delete everything but the occupant. - mask = null - qdel(mask) - storage = null - qdel(storage) - // The wires get damaged too. - wires.cut_all() - else - if(!occupant) - visible_message("[src]'s door slides open. The glowing yellow lights dim to a gentle green.") - else - visible_message("[src]'s door slides open, barraging you with the nauseating smell of charred flesh.") - playsound(src, 'sound/machines/AirlockClose.ogg', 25, 1) - for(var/obj/item/I in src) //Scorches away blood and forensic evidence, although the SSU itself is unaffected - I.clean_blood() - I.fingerprints = list() - open_machine(FALSE) - if(occupant) - dump_contents() - -/obj/machinery/suit_storage_unit/proc/shock(mob/user, prb) - if(!prob(prb)) - var/datum/effect_system/spark_spread/s = new /datum/effect_system/spark_spread - s.set_up(5, 1, src) - s.start() - if(electrocute_mob(user, src, src, 1, TRUE)) - return 1 - -/obj/machinery/suit_storage_unit/relaymove(mob/user) - container_resist(user) - -/obj/machinery/suit_storage_unit/container_resist(mob/living/user) - add_fingerprint(user) - if(locked) - visible_message("You see [user] kicking against the doors of [src]!", "You start kicking against the doors...") - addtimer(CALLBACK(src, .proc/resist_open, user), 300) - else - open_machine() - dump_contents() - -/obj/machinery/suit_storage_unit/proc/resist_open(mob/user) - if(!state_open && occupant && (user in src) && user.stat == 0) // Check they're still here. - visible_message("You see [user] bursts out of [src]!", "You escape the cramped confines of [src]!") - open_machine() - -/obj/machinery/suit_storage_unit/attackby(obj/item/I, mob/user, params) - if(state_open && is_operational()) - if(istype(I, /obj/item/clothing/suit/space)) - if(suit) - to_chat(user, "The unit already contains a suit!.") - return - if(!user.drop_item()) - return - suit = I - else if(istype(I, /obj/item/clothing/head/helmet)) - if(helmet) - to_chat(user, "The unit already contains a helmet!") - return - if(!user.drop_item()) - return - helmet = I - else if(istype(I, /obj/item/clothing/mask)) - if(mask) - to_chat(user, "The unit already contains a mask!") - return - if(!user.drop_item()) - return - mask = I - else - if(storage) - to_chat(user, "The auxiliary storage compartment is full!") - return - if(!user.drop_item()) - return - storage = I - - I.loc = src - visible_message("[user] inserts [I] into [src]", "You load [I] into [src].") - update_icon() - return - - if(panel_open && is_wire_tool(I)) - wires.interact(user) - if(!state_open) - if(default_deconstruction_screwdriver(user, "panel", "close", I)) - return - if(default_pry_open(I)) - dump_contents() - return - - return ..() - -/obj/machinery/suit_storage_unit/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = 0, \ - datum/tgui/master_ui = null, datum/ui_state/state = GLOB.notcontained_state) - ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open) - if(!ui) - ui = new(user, src, ui_key, "suit_storage_unit", name, 400, 305, master_ui, state) - ui.open() - -/obj/machinery/suit_storage_unit/ui_data() - var/list/data = list() - data["locked"] = locked - data["open"] = state_open - data["safeties"] = safeties - data["uv_active"] = uv - data["uv_super"] = uv_super - if(helmet) - data["helmet"] = helmet.name - if(suit) - data["suit"] = suit.name - if(mask) - data["mask"] = mask.name - if(storage) - data["storage"] = storage.name - if(occupant) - data["occupied"] = 1 - return data - -/obj/machinery/suit_storage_unit/ui_act(action, params) - if(..() || uv) - return - switch(action) - if("door") - if(state_open) - close_machine() - else - open_machine(0) - if(occupant) - dump_contents() // Dump out contents if someone is in there. - . = TRUE - if("lock") - locked = !locked - . = TRUE - if("uv") - if(occupant && safeties) - return - else if(!helmet && !mask && !suit && !storage && !occupant) - return - else - if(occupant) - var/mob/living/mob_occupant = occupant - to_chat(mob_occupant, "[src]'s confines grow warm, then hot, then scorching. You're being burned [!mob_occupant.stat ? "alive" : "away"]!") - cook() - . = TRUE - if("dispense") - if(!state_open) - return - - var/static/list/valid_items = list("helmet", "suit", "mask", "storage") - var/item_name = params["item"] - if(item_name in valid_items) - var/obj/item/I = vars[item_name] - vars[item_name] = null - if(I) - I.forceMove(loc) - . = TRUE - update_icon() +// SUIT STORAGE UNIT ///////////////// +/obj/machinery/suit_storage_unit + name = "suit storage unit" + desc = "An industrial unit made to hold space suits. It comes with a built-in UV cauterization mechanism. A small warning label advises that organic matter should not be placed into the unit." + icon = 'icons/obj/suitstorage.dmi' + icon_state = "close" + anchored = 1 + density = 1 + obj_integrity = 250 + max_integrity = 250 + + var/obj/item/clothing/suit/space/suit = null + var/obj/item/clothing/head/helmet/space/helmet = null + var/obj/item/clothing/mask/mask = null + var/obj/item/storage = null + + var/suit_type = null + var/helmet_type = null + var/mask_type = null + var/storage_type = null + + state_open = FALSE + var/locked = FALSE + panel_open = FALSE + var/safeties = TRUE + + var/uv = FALSE + var/uv_super = FALSE + var/uv_cycles = 6 + +/obj/machinery/suit_storage_unit/standard_unit + suit_type = /obj/item/clothing/suit/space/eva + helmet_type = /obj/item/clothing/head/helmet/space/eva + mask_type = /obj/item/clothing/mask/breath + +/obj/machinery/suit_storage_unit/captain + suit_type = /obj/item/clothing/suit/space/hardsuit/captain + mask_type = /obj/item/clothing/mask/gas/sechailer + storage_type = /obj/item/weapon/tank/jetpack/oxygen/captain + +/obj/machinery/suit_storage_unit/engine + suit_type = /obj/item/clothing/suit/space/hardsuit/engine + mask_type = /obj/item/clothing/mask/breath + +/obj/machinery/suit_storage_unit/ce + suit_type = /obj/item/clothing/suit/space/hardsuit/engine/elite + mask_type = /obj/item/clothing/mask/breath + storage_type= /obj/item/clothing/shoes/magboots/advance + +/obj/machinery/suit_storage_unit/security + suit_type = /obj/item/clothing/suit/space/hardsuit/security + mask_type = /obj/item/clothing/mask/gas/sechailer + +/obj/machinery/suit_storage_unit/hos + suit_type = /obj/item/clothing/suit/space/hardsuit/security/hos + mask_type = /obj/item/clothing/mask/gas/sechailer + storage_type = /obj/item/weapon/tank/internals/oxygen + +/obj/machinery/suit_storage_unit/atmos + suit_type = /obj/item/clothing/suit/space/hardsuit/engine/atmos + mask_type = /obj/item/clothing/mask/gas + storage_type = /obj/item/weapon/watertank/atmos + +/obj/machinery/suit_storage_unit/mining + suit_type = /obj/item/clothing/suit/hooded/explorer + mask_type = /obj/item/clothing/mask/gas/explorer + +/obj/machinery/suit_storage_unit/mining/eva + suit_type = /obj/item/clothing/suit/space/hardsuit/mining + mask_type = /obj/item/clothing/mask/breath + +/obj/machinery/suit_storage_unit/cmo + suit_type = /obj/item/clothing/suit/space/hardsuit/medical + mask_type = /obj/item/clothing/mask/breath + +/obj/machinery/suit_storage_unit/rd + suit_type = /obj/item/clothing/suit/space/hardsuit/rd + mask_type = /obj/item/clothing/mask/breath + +/obj/machinery/suit_storage_unit/syndicate + suit_type = /obj/item/clothing/suit/space/hardsuit/syndi + mask_type = /obj/item/clothing/mask/gas/syndicate + storage_type = /obj/item/weapon/tank/jetpack/oxygen/harness + +/obj/machinery/suit_storage_unit/ert/command + suit_type = /obj/item/clothing/suit/space/hardsuit/ert + mask_type = /obj/item/clothing/mask/breath + storage_type = /obj/item/weapon/tank/internals/emergency_oxygen/double + +/obj/machinery/suit_storage_unit/ert/security + suit_type = /obj/item/clothing/suit/space/hardsuit/ert/sec + mask_type = /obj/item/clothing/mask/breath + storage_type = /obj/item/weapon/tank/internals/emergency_oxygen/double + +/obj/machinery/suit_storage_unit/ert/engineer + suit_type = /obj/item/clothing/suit/space/hardsuit/ert/engi + mask_type = /obj/item/clothing/mask/breath + storage_type = /obj/item/weapon/tank/internals/emergency_oxygen/double + +/obj/machinery/suit_storage_unit/ert/medical + suit_type = /obj/item/clothing/suit/space/hardsuit/ert/med + mask_type = /obj/item/clothing/mask/breath + storage_type = /obj/item/weapon/tank/internals/emergency_oxygen/double + +/obj/machinery/suit_storage_unit/New() + ..() + wires = new /datum/wires/suit_storage_unit(src) + if(suit_type) + suit = new suit_type(src) + if(helmet_type) + helmet = new helmet_type(src) + if(mask_type) + mask = new mask_type(src) + if(storage_type) + storage = new storage_type(src) + update_icon() + +/obj/machinery/suit_storage_unit/Destroy() + if(suit) + qdel(suit) + suit = null + if(helmet) + qdel(helmet) + helmet = null + if(mask) + qdel(mask) + mask = null + if(storage) + qdel(storage) + storage = null + return ..() + +/obj/machinery/suit_storage_unit/update_icon() + cut_overlays() + + if(uv) + if(uv_super) + add_overlay("super") + else if(occupant) + add_overlay("uvhuman") + else + add_overlay("uv") + else if(state_open) + if(stat & BROKEN) + add_overlay("broken") + else + add_overlay("open") + if(suit) + add_overlay("suit") + if(helmet) + add_overlay("helm") + if(storage) + add_overlay("storage") + else if(occupant) + add_overlay("human") + +/obj/machinery/suit_storage_unit/power_change() + ..() + if(!is_operational() && state_open) + open_machine() + dump_contents() + update_icon() + +/obj/machinery/suit_storage_unit/proc/dump_contents() + dropContents() + helmet = null + suit = null + mask = null + storage = null + occupant = null + +/obj/machinery/suit_storage_unit/deconstruct(disassembled = TRUE) + if(!(flags & NODECONSTRUCT)) + open_machine() + dump_contents() + new /obj/item/stack/sheet/metal (loc, 2) + qdel(src) + +/obj/machinery/suit_storage_unit/MouseDrop_T(atom/A, mob/user) + if(user.stat || user.lying || !Adjacent(user) || !Adjacent(A) || !isliving(A)) + return + var/mob/living/target = A + if(!state_open) + to_chat(user, "The unit's doors are shut!") + return + if(!is_operational()) + to_chat(user, "The unit is not operational!") + return + if(occupant || helmet || suit || storage) + to_chat(user, "It's too cluttered inside to fit in!") + return + + if(target == user) + user.visible_message("[user] starts squeezing into [src]!", "You start working your way into [src]...") + else + target.visible_message("[user] starts shoving [target] into [src]!", "[user] starts shoving you into [src]!") + + if(do_mob(user, target, 30)) + if(occupant || helmet || suit || storage) + return + if(target == user) + user.visible_message("[user] slips into [src] and closes the door behind them!", "You slip into [src]'s cramped space and shut its door.") + else + target.visible_message("[user] pushes [target] into [src] and shuts its door!", "[user] shoves you into [src] and shuts the door!") + close_machine(target) + add_fingerprint(user) + +/obj/machinery/suit_storage_unit/proc/cook() + if(uv_cycles) + uv_cycles-- + uv = TRUE + locked = TRUE + update_icon() + if(occupant) + var/mob/living/mob_occupant = occupant + if(uv_super) + mob_occupant.adjustFireLoss(rand(20, 36)) + else + mob_occupant.adjustFireLoss(rand(10, 16)) + mob_occupant.emote("scream") + addtimer(CALLBACK(src, .proc/cook), 50) + else + uv_cycles = initial(uv_cycles) + uv = FALSE + locked = FALSE + if(uv_super) + visible_message("[src]'s door creaks open with a loud whining noise. A cloud of foul black smoke escapes from its chamber.") + playsound(src, 'sound/machines/airlock_alien_prying.ogg', 50, 1) + helmet = null + qdel(helmet) + suit = null + qdel(suit) // Delete everything but the occupant. + mask = null + qdel(mask) + storage = null + qdel(storage) + // The wires get damaged too. + wires.cut_all() + else + if(!occupant) + visible_message("[src]'s door slides open. The glowing yellow lights dim to a gentle green.") + else + visible_message("[src]'s door slides open, barraging you with the nauseating smell of charred flesh.") + playsound(src, 'sound/machines/AirlockClose.ogg', 25, 1) + for(var/obj/item/I in src) //Scorches away blood and forensic evidence, although the SSU itself is unaffected + I.clean_blood() + I.fingerprints = list() + open_machine(FALSE) + if(occupant) + dump_contents() + +/obj/machinery/suit_storage_unit/proc/shock(mob/user, prb) + if(!prob(prb)) + var/datum/effect_system/spark_spread/s = new /datum/effect_system/spark_spread + s.set_up(5, 1, src) + s.start() + if(electrocute_mob(user, src, src, 1, TRUE)) + return 1 + +/obj/machinery/suit_storage_unit/relaymove(mob/user) + container_resist(user) + +/obj/machinery/suit_storage_unit/container_resist(mob/living/user) + add_fingerprint(user) + if(locked) + visible_message("You see [user] kicking against the doors of [src]!", "You start kicking against the doors...") + addtimer(CALLBACK(src, .proc/resist_open, user), 300) + else + open_machine() + dump_contents() + +/obj/machinery/suit_storage_unit/proc/resist_open(mob/user) + if(!state_open && occupant && (user in src) && user.stat == 0) // Check they're still here. + visible_message("You see [user] bursts out of [src]!", "You escape the cramped confines of [src]!") + open_machine() + +/obj/machinery/suit_storage_unit/attackby(obj/item/I, mob/user, params) + if(state_open && is_operational()) + if(istype(I, /obj/item/clothing/suit/space)) + if(suit) + to_chat(user, "The unit already contains a suit!.") + return + if(!user.drop_item()) + return + suit = I + else if(istype(I, /obj/item/clothing/head/helmet)) + if(helmet) + to_chat(user, "The unit already contains a helmet!") + return + if(!user.drop_item()) + return + helmet = I + else if(istype(I, /obj/item/clothing/mask)) + if(mask) + to_chat(user, "The unit already contains a mask!") + return + if(!user.drop_item()) + return + mask = I + else + if(storage) + to_chat(user, "The auxiliary storage compartment is full!") + return + if(!user.drop_item()) + return + storage = I + + I.loc = src + visible_message("[user] inserts [I] into [src]", "You load [I] into [src].") + update_icon() + return + + if(panel_open && is_wire_tool(I)) + wires.interact(user) + if(!state_open) + if(default_deconstruction_screwdriver(user, "panel", "close", I)) + return + if(default_pry_open(I)) + dump_contents() + return + + return ..() + +/obj/machinery/suit_storage_unit/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = 0, \ + datum/tgui/master_ui = null, datum/ui_state/state = GLOB.notcontained_state) + ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open) + if(!ui) + ui = new(user, src, ui_key, "suit_storage_unit", name, 400, 305, master_ui, state) + ui.open() + +/obj/machinery/suit_storage_unit/ui_data() + var/list/data = list() + data["locked"] = locked + data["open"] = state_open + data["safeties"] = safeties + data["uv_active"] = uv + data["uv_super"] = uv_super + if(helmet) + data["helmet"] = helmet.name + if(suit) + data["suit"] = suit.name + if(mask) + data["mask"] = mask.name + if(storage) + data["storage"] = storage.name + if(occupant) + data["occupied"] = 1 + return data + +/obj/machinery/suit_storage_unit/ui_act(action, params) + if(..() || uv) + return + switch(action) + if("door") + if(state_open) + close_machine() + else + open_machine(0) + if(occupant) + dump_contents() // Dump out contents if someone is in there. + . = TRUE + if("lock") + locked = !locked + . = TRUE + if("uv") + if(occupant && safeties) + return + else if(!helmet && !mask && !suit && !storage && !occupant) + return + else + if(occupant) + var/mob/living/mob_occupant = occupant + to_chat(mob_occupant, "[src]'s confines grow warm, then hot, then scorching. You're being burned [!mob_occupant.stat ? "alive" : "away"]!") + cook() + . = TRUE + if("dispense") + if(!state_open) + return + + var/static/list/valid_items = list("helmet", "suit", "mask", "storage") + var/item_name = params["item"] + if(item_name in valid_items) + var/obj/item/I = vars[item_name] + vars[item_name] = null + if(I) + I.forceMove(loc) + . = TRUE + update_icon() diff --git a/code/game/objects/effects/portals.dm b/code/game/objects/effects/portals.dm index 9e7dbe7fa9..7f66b0ab1a 100644 --- a/code/game/objects/effects/portals.dm +++ b/code/game/objects/effects/portals.dm @@ -1,69 +1,69 @@ - -/obj/effect/portal - name = "portal" - desc = "Looks unstable. Best to test it with the clown." - icon = 'icons/obj/stationobjs.dmi' - icon_state = "portal" - density = 1 - var/obj/item/target = null - var/creator = null - anchored = 1 - var/precision = 1 // how close to the portal you will teleport. 0 = on the portal, 1 = adjacent - var/mech_sized = FALSE - -/obj/effect/portal/Bumped(mob/M as mob|obj) - teleport(M) - -/obj/effect/portal/attack_tk(mob/user) - return - -/obj/effect/portal/attack_hand(mob/user) - if(Adjacent(user)) - teleport(user) - -/obj/effect/portal/attackby(obj/item/weapon/W, mob/user, params) - if(user && Adjacent(user)) - teleport(user) - -/obj/effect/portal/make_frozen_visual() - return - -/obj/effect/portal/New(loc, turf/target, creator=null, lifespan=300) - ..() - GLOB.portals += src - src.target = target - src.creator = creator - - var/area/A = get_area(target) - if(A && A.noteleport) // No point in persisting if the target is unreachable. - qdel(src) - return - if(lifespan > 0) - QDEL_IN(src, lifespan) - -/obj/effect/portal/Destroy() - GLOB.portals -= src - if(istype(creator, /obj/item/weapon/hand_tele)) - var/obj/item/weapon/hand_tele/O = creator - O.active_portals-- - else if(istype(creator, /obj/item/weapon/gun/energy/wormhole_projector)) - var/obj/item/weapon/gun/energy/wormhole_projector/P = creator - P.portal_destroyed(src) - creator = null - return ..() - -/obj/effect/portal/proc/teleport(atom/movable/M as mob|obj) - if(istype(M, /obj/effect)) //sparks don't teleport - return - if(M.anchored) - if(!(istype(M, /obj/mecha) && mech_sized)) - return - if (!( target )) - qdel(src) - return - if (istype(M, /atom/movable)) - if(ismegafauna(M)) - message_admins("[M] [ADMIN_FLW(M)] has teleported through [src].") - do_teleport(M, target, precision) ///You will appear adjacent to the beacon - - + +/obj/effect/portal + name = "portal" + desc = "Looks unstable. Best to test it with the clown." + icon = 'icons/obj/stationobjs.dmi' + icon_state = "portal" + density = 1 + var/obj/item/target = null + var/creator = null + anchored = 1 + var/precision = 1 // how close to the portal you will teleport. 0 = on the portal, 1 = adjacent + var/mech_sized = FALSE + +/obj/effect/portal/Bumped(mob/M as mob|obj) + teleport(M) + +/obj/effect/portal/attack_tk(mob/user) + return + +/obj/effect/portal/attack_hand(mob/user) + if(Adjacent(user)) + teleport(user) + +/obj/effect/portal/attackby(obj/item/weapon/W, mob/user, params) + if(user && Adjacent(user)) + teleport(user) + +/obj/effect/portal/make_frozen_visual() + return + +/obj/effect/portal/New(loc, turf/target, creator=null, lifespan=300) + ..() + GLOB.portals += src + src.target = target + src.creator = creator + + var/area/A = get_area(target) + if(A && A.noteleport) // No point in persisting if the target is unreachable. + qdel(src) + return + if(lifespan > 0) + QDEL_IN(src, lifespan) + +/obj/effect/portal/Destroy() + GLOB.portals -= src + if(istype(creator, /obj/item/weapon/hand_tele)) + var/obj/item/weapon/hand_tele/O = creator + O.active_portals-- + else if(istype(creator, /obj/item/weapon/gun/energy/wormhole_projector)) + var/obj/item/weapon/gun/energy/wormhole_projector/P = creator + P.portal_destroyed(src) + creator = null + return ..() + +/obj/effect/portal/proc/teleport(atom/movable/M as mob|obj) + if(istype(M, /obj/effect)) //sparks don't teleport + return + if(M.anchored) + if(!(istype(M, /obj/mecha) && mech_sized)) + return + if (!( target )) + qdel(src) + return + if (istype(M, /atom/movable)) + if(ismegafauna(M)) + message_admins("[M] [ADMIN_FLW(M)] has teleported through [src].") + do_teleport(M, target, precision) ///You will appear adjacent to the beacon + + diff --git a/code/game/objects/items/devices/PDA/radio.dm b/code/game/objects/items/devices/PDA/radio.dm index bfe86bc8ff..a83c6247f8 100644 --- a/code/game/objects/items/devices/PDA/radio.dm +++ b/code/game/objects/items/devices/PDA/radio.dm @@ -8,8 +8,8 @@ var/on = 0 //Are we currently active?? var/menu_message = "" -/obj/item/radio/integrated/Initialize() - . = ..() +/obj/item/radio/integrated/Initialize() + . = ..() if (istype(loc.loc, /obj/item/device/pda)) hostpda = loc.loc diff --git a/code/game/objects/items/devices/powersink.dm b/code/game/objects/items/devices/powersink.dm index fb70d77ff3..e03c85c09a 100644 --- a/code/game/objects/items/devices/powersink.dm +++ b/code/game/objects/items/devices/powersink.dm @@ -1,145 +1,145 @@ -// Powersink - used to drain station power - -/obj/item/device/powersink - desc = "A nulling power sink which drains energy from electrical systems." - name = "power sink" - icon_state = "powersink0" - item_state = "electronic" - w_class = WEIGHT_CLASS_BULKY - flags = CONDUCT - throwforce = 5 - throw_speed = 1 - throw_range = 2 - materials = list(MAT_METAL=750) - origin_tech = "powerstorage=5;syndicate=5" - var/drain_rate = 1600000 // amount of power to drain per tick - var/power_drained = 0 // has drained this much power - var/max_power = 1e10 // maximum power that can be drained before exploding - var/mode = 0 // 0 = off, 1=clamped (off), 2=operating - var/admins_warned = 0 // stop spam, only warn the admins once that we are about to boom - - var/const/DISCONNECTED = 0 - var/const/CLAMPED_OFF = 1 - var/const/OPERATING = 2 - - var/obj/structure/cable/attached // the attached cable - -/obj/item/device/powersink/update_icon() - icon_state = "powersink[mode == OPERATING]" - -/obj/item/device/powersink/proc/set_mode(value) - if(value == mode) - return - switch(value) - if(DISCONNECTED) - attached = null - if(mode == OPERATING) - STOP_PROCESSING(SSobj, src) - anchored = 0 - - if(CLAMPED_OFF) - if(!attached) - return - if(mode == OPERATING) - STOP_PROCESSING(SSobj, src) - anchored = 1 - - if(OPERATING) - if(!attached) - return - START_PROCESSING(SSobj, src) - anchored = 1 - - mode = value - update_icon() - set_light(0) - -/obj/item/device/powersink/attackby(obj/item/I, mob/user, params) - if(istype(I, /obj/item/weapon/screwdriver)) - if(mode == DISCONNECTED) - var/turf/T = loc - if(isturf(T) && !T.intact) - attached = locate() in T - if(!attached) - to_chat(user, "This device must be placed over an exposed, powered cable node!") - else - set_mode(CLAMPED_OFF) - user.visible_message( \ - "[user] attaches \the [src] to the cable.", \ - "You attach \the [src] to the cable.", - "You hear some wires being connected to something.") - else - to_chat(user, "This device must be placed over an exposed, powered cable node!") - else - set_mode(DISCONNECTED) - user.visible_message( \ - "[user] detaches \the [src] from the cable.", \ - "You detach \the [src] from the cable.", - "You hear some wires being disconnected from something.") - else - return ..() - -/obj/item/device/powersink/attack_paw() - return - -/obj/item/device/powersink/attack_ai() - return - -/obj/item/device/powersink/attack_hand(mob/user) - switch(mode) - if(DISCONNECTED) - ..() - - if(CLAMPED_OFF) - user.visible_message( \ - "[user] activates \the [src]!", \ - "You activate \the [src].", - "You hear a click.") - message_admins("Power sink activated by [ADMIN_LOOKUPFLW(user)] at [ADMIN_COORDJMP(src)]") - log_game("Power sink activated by [key_name(user)] at [COORD(src)]") - set_mode(OPERATING) - - if(OPERATING) - user.visible_message( \ - "[user] deactivates \the [src]!", \ - "You deactivate \the [src].", - "You hear a click.") - set_mode(CLAMPED_OFF) - -/obj/item/device/powersink/process() - if(!attached) - set_mode(DISCONNECTED) - return - - var/datum/powernet/PN = attached.powernet - if(PN) - set_light(5) - - // found a powernet, so drain up to max power from it - - var/drained = min ( drain_rate, PN.avail ) - PN.load += drained - power_drained += drained - - // if tried to drain more than available on powernet - // now look for APCs and drain their cells - if(drained < drain_rate) - for(var/obj/machinery/power/terminal/T in PN.nodes) - if(istype(T.master, /obj/machinery/power/apc)) - var/obj/machinery/power/apc/A = T.master - if(A.operating && A.cell) - A.cell.charge = max(0, A.cell.charge - 50) - power_drained += 50 - if(A.charging == 2) // If the cell was full - A.charging = 1 // It's no longer full - - if(power_drained > max_power * 0.98) - if (!admins_warned) - admins_warned = 1 - message_admins("Power sink at ([x],[y],[z] - JMP) is 95% full. Explosion imminent.") - playsound(src, 'sound/effects/screech.ogg', 100, 1, 1) - - if(power_drained >= max_power) - STOP_PROCESSING(SSobj, src) - explosion(src.loc, 4,8,16,32) - qdel(src) +// Powersink - used to drain station power + +/obj/item/device/powersink + desc = "A nulling power sink which drains energy from electrical systems." + name = "power sink" + icon_state = "powersink0" + item_state = "electronic" + w_class = WEIGHT_CLASS_BULKY + flags = CONDUCT + throwforce = 5 + throw_speed = 1 + throw_range = 2 + materials = list(MAT_METAL=750) + origin_tech = "powerstorage=5;syndicate=5" + var/drain_rate = 1600000 // amount of power to drain per tick + var/power_drained = 0 // has drained this much power + var/max_power = 1e10 // maximum power that can be drained before exploding + var/mode = 0 // 0 = off, 1=clamped (off), 2=operating + var/admins_warned = 0 // stop spam, only warn the admins once that we are about to boom + + var/const/DISCONNECTED = 0 + var/const/CLAMPED_OFF = 1 + var/const/OPERATING = 2 + + var/obj/structure/cable/attached // the attached cable + +/obj/item/device/powersink/update_icon() + icon_state = "powersink[mode == OPERATING]" + +/obj/item/device/powersink/proc/set_mode(value) + if(value == mode) + return + switch(value) + if(DISCONNECTED) + attached = null + if(mode == OPERATING) + STOP_PROCESSING(SSobj, src) + anchored = 0 + + if(CLAMPED_OFF) + if(!attached) + return + if(mode == OPERATING) + STOP_PROCESSING(SSobj, src) + anchored = 1 + + if(OPERATING) + if(!attached) + return + START_PROCESSING(SSobj, src) + anchored = 1 + + mode = value + update_icon() + set_light(0) + +/obj/item/device/powersink/attackby(obj/item/I, mob/user, params) + if(istype(I, /obj/item/weapon/screwdriver)) + if(mode == DISCONNECTED) + var/turf/T = loc + if(isturf(T) && !T.intact) + attached = locate() in T + if(!attached) + to_chat(user, "This device must be placed over an exposed, powered cable node!") + else + set_mode(CLAMPED_OFF) + user.visible_message( \ + "[user] attaches \the [src] to the cable.", \ + "You attach \the [src] to the cable.", + "You hear some wires being connected to something.") + else + to_chat(user, "This device must be placed over an exposed, powered cable node!") + else + set_mode(DISCONNECTED) + user.visible_message( \ + "[user] detaches \the [src] from the cable.", \ + "You detach \the [src] from the cable.", + "You hear some wires being disconnected from something.") + else + return ..() + +/obj/item/device/powersink/attack_paw() + return + +/obj/item/device/powersink/attack_ai() + return + +/obj/item/device/powersink/attack_hand(mob/user) + switch(mode) + if(DISCONNECTED) + ..() + + if(CLAMPED_OFF) + user.visible_message( \ + "[user] activates \the [src]!", \ + "You activate \the [src].", + "You hear a click.") + message_admins("Power sink activated by [ADMIN_LOOKUPFLW(user)] at [ADMIN_COORDJMP(src)]") + log_game("Power sink activated by [key_name(user)] at [COORD(src)]") + set_mode(OPERATING) + + if(OPERATING) + user.visible_message( \ + "[user] deactivates \the [src]!", \ + "You deactivate \the [src].", + "You hear a click.") + set_mode(CLAMPED_OFF) + +/obj/item/device/powersink/process() + if(!attached) + set_mode(DISCONNECTED) + return + + var/datum/powernet/PN = attached.powernet + if(PN) + set_light(5) + + // found a powernet, so drain up to max power from it + + var/drained = min ( drain_rate, PN.avail ) + PN.load += drained + power_drained += drained + + // if tried to drain more than available on powernet + // now look for APCs and drain their cells + if(drained < drain_rate) + for(var/obj/machinery/power/terminal/T in PN.nodes) + if(istype(T.master, /obj/machinery/power/apc)) + var/obj/machinery/power/apc/A = T.master + if(A.operating && A.cell) + A.cell.charge = max(0, A.cell.charge - 50) + power_drained += 50 + if(A.charging == 2) // If the cell was full + A.charging = 1 // It's no longer full + + if(power_drained > max_power * 0.98) + if (!admins_warned) + admins_warned = 1 + message_admins("Power sink at ([x],[y],[z] - JMP) is 95% full. Explosion imminent.") + playsound(src, 'sound/effects/screech.ogg', 100, 1, 1) + + if(power_drained >= max_power) + STOP_PROCESSING(SSobj, src) + explosion(src.loc, 4,8,16,32) + qdel(src) diff --git a/code/game/objects/items/devices/radio/beacon.dm b/code/game/objects/items/devices/radio/beacon.dm index 78cacb7281..5343e04f78 100644 --- a/code/game/objects/items/devices/radio/beacon.dm +++ b/code/game/objects/items/devices/radio/beacon.dm @@ -7,8 +7,8 @@ origin_tech = "bluespace=1" dog_fashion = null -/obj/item/device/radio/beacon/Initialize() - . = ..() +/obj/item/device/radio/beacon/Initialize() + . = ..() GLOB.teleportbeacons += src /obj/item/device/radio/beacon/Destroy() diff --git a/code/game/objects/items/devices/radio/headset.dm b/code/game/objects/items/devices/radio/headset.dm index 2a1397d519..e1be1ca01b 100644 --- a/code/game/objects/items/devices/radio/headset.dm +++ b/code/game/objects/items/devices/radio/headset.dm @@ -11,8 +11,8 @@ var/obj/item/device/encryptionkey/keyslot2 = null dog_fashion = null -/obj/item/device/radio/headset/Initialize() - . = ..() +/obj/item/device/radio/headset/Initialize() + . = ..() recalculateChannels() /obj/item/device/radio/headset/Destroy() @@ -47,21 +47,21 @@ item_state = "syndie_headset" /obj/item/device/radio/headset/syndicate/alt/Initialize(mapload) - . = ..() + . = ..() SET_SECONDARY_FLAG(src, BANG_PROTECT) /obj/item/device/radio/headset/syndicate/alt/leader name = "team leader headset" command = TRUE -/obj/item/device/radio/headset/syndicate/Initialize() - . = ..() +/obj/item/device/radio/headset/syndicate/Initialize() + . = ..() make_syndie() /obj/item/device/radio/headset/binary origin_tech = "syndicate=3" -/obj/item/device/radio/headset/binary/Initialize() - . = ..() +/obj/item/device/radio/headset/binary/Initialize() + . = ..() qdel(keyslot) keyslot = new /obj/item/device/encryptionkey/binary recalculateChannels() @@ -79,7 +79,7 @@ item_state = "sec_headset_alt" /obj/item/device/radio/headset/headset_sec/alt/Initialize(mapload) - . = ..() + . = ..() SET_SECONDARY_FLAG(src, BANG_PROTECT) /obj/item/device/radio/headset/headset_eng @@ -134,7 +134,7 @@ item_state = "com_headset_alt" /obj/item/device/radio/headset/heads/captain/alt/Initialize(mapload) - . = ..() + . = ..() SET_SECONDARY_FLAG(src, BANG_PROTECT) /obj/item/device/radio/headset/heads/rd @@ -156,7 +156,7 @@ item_state = "com_headset_alt" /obj/item/device/radio/headset/heads/hos/alt/Initialize(mapload) - . = ..() + . = ..() SET_SECONDARY_FLAG(src, BANG_PROTECT) /obj/item/device/radio/headset/heads/ce @@ -213,7 +213,7 @@ keyslot = null /obj/item/device/radio/headset/headset_cent/alt/Initialize(mapload) - . = ..() + . = ..() SET_SECONDARY_FLAG(src, BANG_PROTECT) /obj/item/device/radio/headset/ai diff --git a/code/game/objects/items/devices/radio/intercom.dm b/code/game/objects/items/devices/radio/intercom.dm index c975dbff20..a7dceaccf1 100644 --- a/code/game/objects/items/devices/radio/intercom.dm +++ b/code/game/objects/items/devices/radio/intercom.dm @@ -11,8 +11,8 @@ var/last_tick //used to delay the powercheck dog_fashion = null -/obj/item/device/radio/intercom/Initialize() - . = ..() +/obj/item/device/radio/intercom/Initialize() + . = ..() START_PROCESSING(SSobj, src) /obj/item/device/radio/intercom/Destroy() diff --git a/code/game/objects/items/devices/transfer_valve.dm b/code/game/objects/items/devices/transfer_valve.dm index 9296dd9e09..635338fe96 100644 --- a/code/game/objects/items/devices/transfer_valve.dm +++ b/code/game/objects/items/devices/transfer_valve.dm @@ -1,211 +1,211 @@ -/obj/item/device/transfer_valve - icon = 'icons/obj/assemblies.dmi' - name = "tank transfer valve" - icon_state = "valve_1" - item_state = "ttv" - desc = "Regulates the transfer of air between two tanks" - var/obj/item/weapon/tank/tank_one - var/obj/item/weapon/tank/tank_two - var/obj/item/device/attached_device - var/mob/attacher = null - var/valve_open = 0 - var/toggle = 1 - origin_tech = "materials=1;engineering=1" - -/obj/item/device/transfer_valve/IsAssemblyHolder() - return 1 - -/obj/item/device/transfer_valve/attackby(obj/item/item, mob/user, params) - if(istype(item, /obj/item/weapon/tank)) - if(tank_one && tank_two) - to_chat(user, "There are already two tanks attached, remove one first!") - return - - if(!tank_one) - if(!user.transferItemToLoc(item, src)) - return - tank_one = item - to_chat(user, "You attach the tank to the transfer valve.") - if(item.w_class > w_class) - w_class = item.w_class - else if(!tank_two) - if(!user.transferItemToLoc(item, src)) - return - tank_two = item - to_chat(user, "You attach the tank to the transfer valve.") - if(item.w_class > w_class) - w_class = item.w_class - - update_icon() -//TODO: Have this take an assemblyholder - else if(isassembly(item)) - var/obj/item/device/assembly/A = item - if(A.secured) - to_chat(user, "The device is secured.") - return - if(attached_device) - to_chat(user, "There is already a device attached to the valve, remove it first!") - return - if(!user.transferItemToLoc(item, src)) - return - attached_device = A - to_chat(user, "You attach the [item] to the valve controls and secure it.") - A.holder = src - A.toggle_secure() //this calls update_icon(), which calls update_icon() on the holder (i.e. the bomb). - - GLOB.bombers += "[key_name(user)] attached a [item] to a transfer valve." - message_admins("[key_name_admin(user)] attached a [item] to a transfer valve.") - log_game("[key_name_admin(user)] attached a [item] to a transfer valve.") - attacher = user - return - -/obj/item/device/transfer_valve/attack_self(mob/user) - user.set_machine(src) - var/dat = {" Valve properties: -
Attachment one: [tank_one] [tank_one ? "Remove" : ""] -
Attachment two: [tank_two] [tank_two ? "Remove" : ""] -
Valve attachment: [attached_device ? "[attached_device]" : "None"] [attached_device ? "Remove" : ""] -
Valve status: [ valve_open ? "Closed Open" : "Closed Open"]"} - - var/datum/browser/popup = new(user, "trans_valve", name) - popup.set_content(dat) - popup.open() - return - -/obj/item/device/transfer_valve/Topic(href, href_list) - ..() - if ( usr.stat || usr.restrained() ) - return - if (src.loc == usr) - if(tank_one && href_list["tankone"]) - split_gases() - valve_open = 0 - tank_one.loc = get_turf(src) - tank_one = null - update_icon() - if((!tank_two || tank_two.w_class < WEIGHT_CLASS_BULKY) && (w_class > WEIGHT_CLASS_NORMAL)) - w_class = WEIGHT_CLASS_NORMAL - else if(tank_two && href_list["tanktwo"]) - split_gases() - valve_open = 0 - tank_two.loc = get_turf(src) - tank_two = null - update_icon() - if((!tank_one || tank_one.w_class < WEIGHT_CLASS_BULKY) && (w_class > WEIGHT_CLASS_NORMAL)) - w_class = WEIGHT_CLASS_NORMAL - else if(href_list["open"]) - toggle_valve() - else if(attached_device) - if(href_list["rem_device"]) - attached_device.loc = get_turf(src) - attached_device:holder = null - attached_device = null - update_icon() - if(href_list["device"]) - attached_device.attack_self(usr) - - src.attack_self(usr) - src.add_fingerprint(usr) - return - return - -/obj/item/device/transfer_valve/proc/process_activation(obj/item/device/D) - if(toggle) - toggle = 0 - toggle_valve() - spawn(50) // To stop a signal being spammed from a proxy sensor constantly going off or whatever - toggle = 1 - -/obj/item/device/transfer_valve/update_icon() - cut_overlays() - underlays = null - - if(!tank_one && !tank_two && !attached_device) - icon_state = "valve_1" - return - icon_state = "valve" - - if(tank_one) - add_overlay("[tank_one.icon_state]") - if(tank_two) - var/icon/J = new(icon, icon_state = "[tank_two.icon_state]") - J.Shift(WEST, 13) - underlays += J - if(attached_device) - add_overlay("device") - -/obj/item/device/transfer_valve/proc/merge_gases() - tank_two.air_contents.volume += tank_one.air_contents.volume - var/datum/gas_mixture/temp - temp = tank_one.air_contents.remove_ratio(1) - tank_two.air_contents.merge(temp) - -/obj/item/device/transfer_valve/proc/split_gases() - if (!valve_open || !tank_one || !tank_two) - return - var/ratio1 = tank_one.air_contents.volume/tank_two.air_contents.volume - var/datum/gas_mixture/temp - temp = tank_two.air_contents.remove_ratio(ratio1) - 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/device/transfer_valve/proc/toggle_valve() - if(!valve_open && tank_one && tank_two) - valve_open = 1 - var/turf/bombturf = get_turf(src) - var/area/A = get_area(bombturf) - - var/attachment = "no device" - if(attached_device) - if(istype(attached_device, /obj/item/device/assembly/signaler)) - attachment = "[attached_device]" - else - attachment = attached_device - - var/attacher_name = "" - if(!attacher) - attacher_name = "Unknown" - else - attacher_name = "[key_name_admin(attacher)]" - - var/log_str1 = "Bomb valve opened in " - var/log_str2 = "with [attachment] attacher: [attacher_name]" - - var/log_attacher = "" - if(attacher) - log_attacher = "[ADMIN_QUE(attacher)] [ADMIN_FLW(attacher)]" - - var/mob/mob = get_mob_by_key(src.fingerprintslast) - var/last_touch_info = "" - if(mob) - last_touch_info = "[ADMIN_QUE(mob)] [ADMIN_FLW(mob)]" - - var/log_str3 = " Last touched by: [key_name_admin(mob)]" - - var/bomb_message = "[log_str1] [A.name][ADMIN_JMP(bombturf)] [log_str2][log_attacher] [log_str3][last_touch_info]" - - GLOB.bombers += bomb_message - - message_admins(bomb_message, 0, 1) - log_game("[log_str1] [A.name][COORD(bombturf)] [log_str2] [log_str3]") - merge_gases() - spawn(20) // In case one tank bursts - for (var/i=0,i<5,i++) - src.update_icon() - sleep(10) - src.update_icon() - - else if(valve_open && tank_one && tank_two) - split_gases() - valve_open = 0 - src.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 -/obj/item/device/transfer_valve/proc/c_state() - return +/obj/item/device/transfer_valve + icon = 'icons/obj/assemblies.dmi' + name = "tank transfer valve" + icon_state = "valve_1" + item_state = "ttv" + desc = "Regulates the transfer of air between two tanks" + var/obj/item/weapon/tank/tank_one + var/obj/item/weapon/tank/tank_two + var/obj/item/device/attached_device + var/mob/attacher = null + var/valve_open = 0 + var/toggle = 1 + origin_tech = "materials=1;engineering=1" + +/obj/item/device/transfer_valve/IsAssemblyHolder() + return 1 + +/obj/item/device/transfer_valve/attackby(obj/item/item, mob/user, params) + if(istype(item, /obj/item/weapon/tank)) + if(tank_one && tank_two) + to_chat(user, "There are already two tanks attached, remove one first!") + return + + if(!tank_one) + if(!user.transferItemToLoc(item, src)) + return + tank_one = item + to_chat(user, "You attach the tank to the transfer valve.") + if(item.w_class > w_class) + w_class = item.w_class + else if(!tank_two) + if(!user.transferItemToLoc(item, src)) + return + tank_two = item + to_chat(user, "You attach the tank to the transfer valve.") + if(item.w_class > w_class) + w_class = item.w_class + + update_icon() +//TODO: Have this take an assemblyholder + else if(isassembly(item)) + var/obj/item/device/assembly/A = item + if(A.secured) + to_chat(user, "The device is secured.") + return + if(attached_device) + to_chat(user, "There is already a device attached to the valve, remove it first!") + return + if(!user.transferItemToLoc(item, src)) + return + attached_device = A + to_chat(user, "You attach the [item] to the valve controls and secure it.") + A.holder = src + A.toggle_secure() //this calls update_icon(), which calls update_icon() on the holder (i.e. the bomb). + + GLOB.bombers += "[key_name(user)] attached a [item] to a transfer valve." + message_admins("[key_name_admin(user)] attached a [item] to a transfer valve.") + log_game("[key_name_admin(user)] attached a [item] to a transfer valve.") + attacher = user + return + +/obj/item/device/transfer_valve/attack_self(mob/user) + user.set_machine(src) + var/dat = {" Valve properties: +
Attachment one: [tank_one] [tank_one ? "Remove" : ""] +
Attachment two: [tank_two] [tank_two ? "Remove" : ""] +
Valve attachment: [attached_device ? "[attached_device]" : "None"] [attached_device ? "Remove" : ""] +
Valve status: [ valve_open ? "Closed Open" : "Closed Open"]"} + + var/datum/browser/popup = new(user, "trans_valve", name) + popup.set_content(dat) + popup.open() + return + +/obj/item/device/transfer_valve/Topic(href, href_list) + ..() + if ( usr.stat || usr.restrained() ) + return + if (src.loc == usr) + if(tank_one && href_list["tankone"]) + split_gases() + valve_open = 0 + tank_one.loc = get_turf(src) + tank_one = null + update_icon() + if((!tank_two || tank_two.w_class < WEIGHT_CLASS_BULKY) && (w_class > WEIGHT_CLASS_NORMAL)) + w_class = WEIGHT_CLASS_NORMAL + else if(tank_two && href_list["tanktwo"]) + split_gases() + valve_open = 0 + tank_two.loc = get_turf(src) + tank_two = null + update_icon() + if((!tank_one || tank_one.w_class < WEIGHT_CLASS_BULKY) && (w_class > WEIGHT_CLASS_NORMAL)) + w_class = WEIGHT_CLASS_NORMAL + else if(href_list["open"]) + toggle_valve() + else if(attached_device) + if(href_list["rem_device"]) + attached_device.loc = get_turf(src) + attached_device:holder = null + attached_device = null + update_icon() + if(href_list["device"]) + attached_device.attack_self(usr) + + src.attack_self(usr) + src.add_fingerprint(usr) + return + return + +/obj/item/device/transfer_valve/proc/process_activation(obj/item/device/D) + if(toggle) + toggle = 0 + toggle_valve() + spawn(50) // To stop a signal being spammed from a proxy sensor constantly going off or whatever + toggle = 1 + +/obj/item/device/transfer_valve/update_icon() + cut_overlays() + underlays = null + + if(!tank_one && !tank_two && !attached_device) + icon_state = "valve_1" + return + icon_state = "valve" + + if(tank_one) + add_overlay("[tank_one.icon_state]") + if(tank_two) + var/icon/J = new(icon, icon_state = "[tank_two.icon_state]") + J.Shift(WEST, 13) + underlays += J + if(attached_device) + add_overlay("device") + +/obj/item/device/transfer_valve/proc/merge_gases() + tank_two.air_contents.volume += tank_one.air_contents.volume + var/datum/gas_mixture/temp + temp = tank_one.air_contents.remove_ratio(1) + tank_two.air_contents.merge(temp) + +/obj/item/device/transfer_valve/proc/split_gases() + if (!valve_open || !tank_one || !tank_two) + return + var/ratio1 = tank_one.air_contents.volume/tank_two.air_contents.volume + var/datum/gas_mixture/temp + temp = tank_two.air_contents.remove_ratio(ratio1) + 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/device/transfer_valve/proc/toggle_valve() + if(!valve_open && tank_one && tank_two) + valve_open = 1 + var/turf/bombturf = get_turf(src) + var/area/A = get_area(bombturf) + + var/attachment = "no device" + if(attached_device) + if(istype(attached_device, /obj/item/device/assembly/signaler)) + attachment = "[attached_device]" + else + attachment = attached_device + + var/attacher_name = "" + if(!attacher) + attacher_name = "Unknown" + else + attacher_name = "[key_name_admin(attacher)]" + + var/log_str1 = "Bomb valve opened in " + var/log_str2 = "with [attachment] attacher: [attacher_name]" + + var/log_attacher = "" + if(attacher) + log_attacher = "[ADMIN_QUE(attacher)] [ADMIN_FLW(attacher)]" + + var/mob/mob = get_mob_by_key(src.fingerprintslast) + var/last_touch_info = "" + if(mob) + last_touch_info = "[ADMIN_QUE(mob)] [ADMIN_FLW(mob)]" + + var/log_str3 = " Last touched by: [key_name_admin(mob)]" + + var/bomb_message = "[log_str1] [A.name][ADMIN_JMP(bombturf)] [log_str2][log_attacher] [log_str3][last_touch_info]" + + GLOB.bombers += bomb_message + + message_admins(bomb_message, 0, 1) + log_game("[log_str1] [A.name][COORD(bombturf)] [log_str2] [log_str3]") + merge_gases() + spawn(20) // In case one tank bursts + for (var/i=0,i<5,i++) + src.update_icon() + sleep(10) + src.update_icon() + + else if(valve_open && tank_one && tank_two) + split_gases() + valve_open = 0 + src.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 +/obj/item/device/transfer_valve/proc/c_state() + return diff --git a/code/game/objects/items/weapons/dna_injector.dm b/code/game/objects/items/weapons/dna_injector.dm index f0fd4947f2..c50ef26b81 100644 --- a/code/game/objects/items/weapons/dna_injector.dm +++ b/code/game/objects/items/weapons/dna_injector.dm @@ -50,7 +50,7 @@ M.dna.uni_identity = merge_text(M.dna.uni_identity, fields["UI"]) M.updateappearance(mutations_overlay_update=1) log_attack(log_msg) - return TRUE + return TRUE /obj/item/weapon/dnainjector/attack(mob/target, mob/user) if(!user.IsAdvancedToolUser()) @@ -77,9 +77,9 @@ add_logs(user, target, "injected", src) - if(!inject(target, user)) //Now we actually do the heavy lifting. - to_chat(user, "It appears that [target] does not have compatible DNA.") - + if(!inject(target, user)) //Now we actually do the heavy lifting. + to_chat(user, "It appears that [target] does not have compatible DNA.") + used = 1 icon_state = "dnainjector0" desc += " This one is used up." diff --git a/code/game/objects/items/weapons/grenades/grenade.dm b/code/game/objects/items/weapons/grenades/grenade.dm index 81ccd127c8..a5f5eb6133 100644 --- a/code/game/objects/items/weapons/grenades/grenade.dm +++ b/code/game/objects/items/weapons/grenades/grenade.dm @@ -48,27 +48,27 @@ /obj/item/weapon/grenade/attack_self(mob/user) if(!active) if(clown_check(user)) - preprime(user) + preprime(user) if(iscarbon(user)) var/mob/living/carbon/C = user C.throw_mode_on() -/obj/item/weapon/grenade/proc/preprime(mob/user) - if(user) - to_chat(user, "You prime the [name]! [det_time/10] seconds!") - playsound(loc, 'sound/weapons/armbomb.ogg', 60, 1) - active = TRUE - icon_state = initial(icon_state) + "_active" - add_fingerprint(user) - var/turf/bombturf = get_turf(src) - var/area/A = get_area(bombturf) - if(user) - var/message = "[ADMIN_LOOKUPFLW(user)]) has primed a [name] for detonation at [ADMIN_COORDJMP(bombturf)]" - GLOB.bombers += message - message_admins(message) - log_game("[key_name(usr)] has primed a [name] for detonation at [A.name] [COORD(bombturf)].") - - addtimer(CALLBACK(src, .proc/prime), det_time) +/obj/item/weapon/grenade/proc/preprime(mob/user) + if(user) + to_chat(user, "You prime the [name]! [det_time/10] seconds!") + playsound(loc, 'sound/weapons/armbomb.ogg', 60, 1) + active = TRUE + icon_state = initial(icon_state) + "_active" + add_fingerprint(user) + var/turf/bombturf = get_turf(src) + var/area/A = get_area(bombturf) + if(user) + var/message = "[ADMIN_LOOKUPFLW(user)]) has primed a [name] for detonation at [ADMIN_COORDJMP(bombturf)]" + GLOB.bombers += message + message_admins(message) + log_game("[key_name(usr)] has primed a [name] for detonation at [A.name] [COORD(bombturf)].") + + addtimer(CALLBACK(src, .proc/prime), det_time) /obj/item/weapon/grenade/proc/prime() @@ -108,4 +108,4 @@ if(damage && attack_type == PROJECTILE_ATTACK && prob(15)) owner.visible_message("[attack_text] hits [owner]'s [src], setting it off! What a shot!") prime() - return 1 //It hit the grenade, not them + return 1 //It hit the grenade, not them diff --git a/code/game/objects/items/weapons/implants/implantchair.dm b/code/game/objects/items/weapons/implants/implantchair.dm index 2cc1e7824f..9d7516faac 100644 --- a/code/game/objects/items/weapons/implants/implantchair.dm +++ b/code/game/objects/items/weapons/implants/implantchair.dm @@ -1,189 +1,189 @@ -/obj/machinery/implantchair - name = "mindshield implanter" - desc = "Used to implant occupants with mindshield implants." - icon = 'icons/obj/machines/implantchair.dmi' - icon_state = "implantchair" - density = 1 - opacity = 0 - anchored = TRUE - - var/ready = TRUE - var/replenishing = FALSE - - var/ready_implants = 5 - var/max_implants = 5 - var/injection_cooldown = 600 - var/replenish_cooldown = 6000 - var/implant_type = /obj/item/weapon/implant/mindshield - var/auto_inject = FALSE - var/auto_replenish = TRUE - var/special = FALSE - var/special_name = "special function" - -/obj/machinery/implantchair/New() - ..() - open_machine() - update_icon() - - -/obj/machinery/implantchair/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = 0, \ - datum/tgui/master_ui = null, datum/ui_state/state = GLOB.notcontained_state) - - ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open) - if(!ui) - ui = new(user, src, ui_key, "implantchair", name, 375, 280, master_ui, state) - ui.open() - - -/obj/machinery/implantchair/ui_data() - var/list/data = list() - data["occupied"] = occupant ? 1 : 0 - data["open"] = state_open - - data["occupant"] = list() - if(occupant) - var/mob/living/mob_occupant = occupant - data["occupant"]["name"] = mob_occupant.name - data["occupant"]["stat"] = mob_occupant.stat - - data["special_name"] = special ? special_name : null - data["ready_implants"] = ready_implants - data["ready"] = ready - data["replenishing"] = replenishing - - return data - -/obj/machinery/implantchair/ui_act(action, params) - if(..()) - return - switch(action) - if("door") - if(state_open) - close_machine() - else - open_machine() - . = TRUE - if("implant") - implant(occupant,usr) - . = TRUE - -/obj/machinery/implantchair/proc/implant(mob/living/M,mob/user) - if (!istype(M)) - return - if(!ready_implants || !ready) - return - if(implant_action(M,user)) - ready_implants-- - if(!replenishing && auto_replenish) - replenishing = TRUE - addtimer(CALLBACK(src,"replenish"),replenish_cooldown) - if(injection_cooldown > 0) - ready = FALSE - addtimer(CALLBACK(src,"set_ready"),injection_cooldown) - else - playsound(get_turf(src), 'sound/machines/buzz-sigh.ogg', 25, 1) - update_icon() - -/obj/machinery/implantchair/proc/implant_action(mob/living/M) - var/obj/item/weapon/implant/I = new implant_type - if(I.implant(M)) - visible_message("[M] has been implanted by the [name].") - return 1 - -/obj/machinery/implantchair/update_icon() - icon_state = initial(icon_state) - if(state_open) - icon_state += "_open" - if(occupant) - icon_state += "_occupied" - if(ready) - add_overlay("ready") - else - cut_overlays() - -/obj/machinery/implantchair/proc/replenish() - if(ready_implants < max_implants) - ready_implants++ - if(ready_implants < max_implants) - addtimer(CALLBACK(src,"replenish"),replenish_cooldown) - else - replenishing = FALSE - -/obj/machinery/implantchair/proc/set_ready() - ready = TRUE - update_icon() - -/obj/machinery/implantchair/container_resist(mob/living/user) - if(state_open) - return - user.changeNext_move(CLICK_CD_BREAKOUT) - user.last_special = world.time + CLICK_CD_BREAKOUT - to_chat(user, "You lean on the back of [src] and start pushing the door open... (this will take about about a minute.)") - audible_message("You hear a metallic creaking from [src]!",hearing_distance = 2) - - if(do_after(user, 600, target = src)) - if(!user || user.stat != CONSCIOUS || user.loc != src || state_open) - return - visible_message("[user] successfully broke out of [src]!") - to_chat(user, "You successfully break out of [src]!") - open_machine() - -/obj/machinery/implantchair/relaymove(mob/user) - container_resist(user) - -/obj/machinery/implantchair/MouseDrop_T(mob/target, mob/user) - if(user.stat || user.lying || !Adjacent(user) || !user.Adjacent(target) || !isliving(target) || !user.IsAdvancedToolUser()) - return - close_machine(target) - -/obj/machinery/implantchair/close_machine(mob/living/user) - if((isnull(user) || istype(user)) && state_open) - ..(user) - if(auto_inject && ready && ready_implants > 0) - implant(user,null) - -/obj/machinery/implantchair/genepurge - name = "Genetic purifier" - desc = "Used to purge human genome of foreign influences" - special = TRUE - special_name = "Purge genome" - injection_cooldown = 0 - replenish_cooldown = 300 - -/obj/machinery/implantchair/genepurge/implant_action(mob/living/carbon/human/H,mob/user) - if(!istype(H)) - return 0 - H.set_species(/datum/species/human, 1)//lizards go home - purrbation_remove(H)//remove cats - H.dna.remove_all_mutations()//hulks out - return 1 - - -/obj/machinery/implantchair/brainwash - name = "Neural Imprinter" - desc = "Used to indoctrinate rehabilitate hardened recidivists." - special_name = "Imprint" - injection_cooldown = 3000 - auto_inject = FALSE - auto_replenish = FALSE - special = TRUE - var/objective = "Obey the law. Praise Nanotrasen." - var/custom = FALSE - -/obj/machinery/implantchair/brainwash/implant_action(mob/living/C,mob/user) - if(!istype(C) || !C.mind) // I don't know how this makes any sense for silicons but laws trump objectives anyway. - return 0 - if(custom) - if(!user || !user.Adjacent(src)) - return 0 - objective = stripped_input(usr,"What order do you want to imprint on [C]?","Enter the order","",120) - message_admins("[key_name_admin(user)] set brainwash machine objective to '[objective]'.") - log_game("[key_name_admin(user)] set brainwash machine objective to '[objective]'.") - var/datum/objective/custom_objective = new/datum/objective(objective) - custom_objective.owner = C.mind - C.mind.objectives += custom_objective - C.mind.announce_objectives() - message_admins("[key_name_admin(user)] brainwashed [key_name_admin(C)] with objective '[objective]'.") - log_game("[key_name_admin(user)] brainwashed [key_name_admin(C)] with objective '[objective]'.") - return 1 - +/obj/machinery/implantchair + name = "mindshield implanter" + desc = "Used to implant occupants with mindshield implants." + icon = 'icons/obj/machines/implantchair.dmi' + icon_state = "implantchair" + density = 1 + opacity = 0 + anchored = TRUE + + var/ready = TRUE + var/replenishing = FALSE + + var/ready_implants = 5 + var/max_implants = 5 + var/injection_cooldown = 600 + var/replenish_cooldown = 6000 + var/implant_type = /obj/item/weapon/implant/mindshield + var/auto_inject = FALSE + var/auto_replenish = TRUE + var/special = FALSE + var/special_name = "special function" + +/obj/machinery/implantchair/New() + ..() + open_machine() + update_icon() + + +/obj/machinery/implantchair/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = 0, \ + datum/tgui/master_ui = null, datum/ui_state/state = GLOB.notcontained_state) + + ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open) + if(!ui) + ui = new(user, src, ui_key, "implantchair", name, 375, 280, master_ui, state) + ui.open() + + +/obj/machinery/implantchair/ui_data() + var/list/data = list() + data["occupied"] = occupant ? 1 : 0 + data["open"] = state_open + + data["occupant"] = list() + if(occupant) + var/mob/living/mob_occupant = occupant + data["occupant"]["name"] = mob_occupant.name + data["occupant"]["stat"] = mob_occupant.stat + + data["special_name"] = special ? special_name : null + data["ready_implants"] = ready_implants + data["ready"] = ready + data["replenishing"] = replenishing + + return data + +/obj/machinery/implantchair/ui_act(action, params) + if(..()) + return + switch(action) + if("door") + if(state_open) + close_machine() + else + open_machine() + . = TRUE + if("implant") + implant(occupant,usr) + . = TRUE + +/obj/machinery/implantchair/proc/implant(mob/living/M,mob/user) + if (!istype(M)) + return + if(!ready_implants || !ready) + return + if(implant_action(M,user)) + ready_implants-- + if(!replenishing && auto_replenish) + replenishing = TRUE + addtimer(CALLBACK(src,"replenish"),replenish_cooldown) + if(injection_cooldown > 0) + ready = FALSE + addtimer(CALLBACK(src,"set_ready"),injection_cooldown) + else + playsound(get_turf(src), 'sound/machines/buzz-sigh.ogg', 25, 1) + update_icon() + +/obj/machinery/implantchair/proc/implant_action(mob/living/M) + var/obj/item/weapon/implant/I = new implant_type + if(I.implant(M)) + visible_message("[M] has been implanted by the [name].") + return 1 + +/obj/machinery/implantchair/update_icon() + icon_state = initial(icon_state) + if(state_open) + icon_state += "_open" + if(occupant) + icon_state += "_occupied" + if(ready) + add_overlay("ready") + else + cut_overlays() + +/obj/machinery/implantchair/proc/replenish() + if(ready_implants < max_implants) + ready_implants++ + if(ready_implants < max_implants) + addtimer(CALLBACK(src,"replenish"),replenish_cooldown) + else + replenishing = FALSE + +/obj/machinery/implantchair/proc/set_ready() + ready = TRUE + update_icon() + +/obj/machinery/implantchair/container_resist(mob/living/user) + if(state_open) + return + user.changeNext_move(CLICK_CD_BREAKOUT) + user.last_special = world.time + CLICK_CD_BREAKOUT + to_chat(user, "You lean on the back of [src] and start pushing the door open... (this will take about about a minute.)") + audible_message("You hear a metallic creaking from [src]!",hearing_distance = 2) + + if(do_after(user, 600, target = src)) + if(!user || user.stat != CONSCIOUS || user.loc != src || state_open) + return + visible_message("[user] successfully broke out of [src]!") + to_chat(user, "You successfully break out of [src]!") + open_machine() + +/obj/machinery/implantchair/relaymove(mob/user) + container_resist(user) + +/obj/machinery/implantchair/MouseDrop_T(mob/target, mob/user) + if(user.stat || user.lying || !Adjacent(user) || !user.Adjacent(target) || !isliving(target) || !user.IsAdvancedToolUser()) + return + close_machine(target) + +/obj/machinery/implantchair/close_machine(mob/living/user) + if((isnull(user) || istype(user)) && state_open) + ..(user) + if(auto_inject && ready && ready_implants > 0) + implant(user,null) + +/obj/machinery/implantchair/genepurge + name = "Genetic purifier" + desc = "Used to purge human genome of foreign influences" + special = TRUE + special_name = "Purge genome" + injection_cooldown = 0 + replenish_cooldown = 300 + +/obj/machinery/implantchair/genepurge/implant_action(mob/living/carbon/human/H,mob/user) + if(!istype(H)) + return 0 + H.set_species(/datum/species/human, 1)//lizards go home + purrbation_remove(H)//remove cats + H.dna.remove_all_mutations()//hulks out + return 1 + + +/obj/machinery/implantchair/brainwash + name = "Neural Imprinter" + desc = "Used to indoctrinate rehabilitate hardened recidivists." + special_name = "Imprint" + injection_cooldown = 3000 + auto_inject = FALSE + auto_replenish = FALSE + special = TRUE + var/objective = "Obey the law. Praise Nanotrasen." + var/custom = FALSE + +/obj/machinery/implantchair/brainwash/implant_action(mob/living/C,mob/user) + if(!istype(C) || !C.mind) // I don't know how this makes any sense for silicons but laws trump objectives anyway. + return 0 + if(custom) + if(!user || !user.Adjacent(src)) + return 0 + objective = stripped_input(usr,"What order do you want to imprint on [C]?","Enter the order","",120) + message_admins("[key_name_admin(user)] set brainwash machine objective to '[objective]'.") + log_game("[key_name_admin(user)] set brainwash machine objective to '[objective]'.") + var/datum/objective/custom_objective = new/datum/objective(objective) + custom_objective.owner = C.mind + C.mind.objectives += custom_objective + C.mind.announce_objectives() + message_admins("[key_name_admin(user)] brainwashed [key_name_admin(C)] with objective '[objective]'.") + log_game("[key_name_admin(user)] brainwashed [key_name_admin(C)] with objective '[objective]'.") + return 1 + diff --git a/code/game/objects/items/weapons/storage/uplink_kits.dm b/code/game/objects/items/weapons/storage/uplink_kits.dm index 1962fbd818..90e7d1be1a 100644 --- a/code/game/objects/items/weapons/storage/uplink_kits.dm +++ b/code/game/objects/items/weapons/storage/uplink_kits.dm @@ -1,305 +1,305 @@ -/obj/item/weapon/storage/box/syndicate - -/obj/item/weapon/storage/box/syndicate/PopulateContents() - switch (pickweight(list("bloodyspai" = 3, "stealth" = 2, "bond" = 2, "screwed" = 2, "sabotage" = 3, "guns" = 2, "murder" = 2, "implant" = 1, "hacker" = 3, "darklord" = 1, "sniper" = 1, "metaops" = 1, "ninja" = 1))) - if("bloodyspai") // 27 tc now this is more right - new /obj/item/clothing/under/chameleon(src) // 2 tc since it's not the full set - new /obj/item/clothing/mask/chameleon(src) // Goes with above - new /obj/item/weapon/card/id/syndicate(src) // 2 tc - new /obj/item/clothing/shoes/chameleon(src) // 2 tc - new /obj/item/device/camera_bug(src) // 1 tc - new /obj/item/device/multitool/ai_detect(src) // 1 tc - new /obj/item/device/encryptionkey/syndicate(src) // 2 tc - new /obj/item/weapon/reagent_containers/syringe/mulligan(src) // 4 tc - new /obj/item/weapon/switchblade(src) //I'll count this as 2 tc - new /obj/item/weapon/storage/fancy/cigarettes/cigpack_syndicate (src) // 2 tc this shit heals - new /obj/item/device/flashlight/emp(src) // 2 tc - new /obj/item/device/chameleon(src) // 7 tc - - if("stealth") // 31 tc - new /obj/item/weapon/gun/energy/kinetic_accelerator/crossbow(src) - new /obj/item/weapon/pen/sleepy(src) - new /obj/item/device/healthanalyzer/rad_laser(src) - new /obj/item/device/chameleon(src) - new /obj/item/weapon/soap/syndie(src) - new /obj/item/clothing/glasses/thermal/syndi(src) - - if("bond") // 29 tc - new /obj/item/weapon/gun/ballistic/automatic/pistol(src) - new /obj/item/weapon/suppressor(src) - new /obj/item/ammo_box/magazine/m10mm(src) - new /obj/item/ammo_box/magazine/m10mm(src) - new /obj/item/clothing/under/chameleon(src) - new /obj/item/weapon/card/id/syndicate(src) - new /obj/item/weapon/reagent_containers/syringe/stimulants(src) - - if("screwed") // 29 tc - new /obj/item/device/sbeacondrop/bomb(src) - new /obj/item/weapon/grenade/syndieminibomb(src) - new /obj/item/device/sbeacondrop/powersink(src) - new /obj/item/clothing/suit/space/syndicate/black/red(src) - new /obj/item/clothing/head/helmet/space/syndicate/black/red(src) - new /obj/item/device/encryptionkey/syndicate(src) - - if("guns") // 28 tc now - new /obj/item/weapon/gun/ballistic/revolver(src) - new /obj/item/ammo_box/a357(src) - new /obj/item/ammo_box/a357(src) - new /obj/item/weapon/card/emag(src) - new /obj/item/weapon/grenade/plastic/c4(src) - new /obj/item/clothing/gloves/color/latex/nitrile(src) - new /obj/item/clothing/mask/gas/clown_hat(src) - new /obj/item/clothing/under/suit_jacket/really_black(src) - - if("murder") // 28 tc now - new /obj/item/weapon/melee/energy/sword/saber(src) - new /obj/item/clothing/glasses/thermal/syndi(src) - new /obj/item/weapon/card/emag(src) - new /obj/item/clothing/shoes/chameleon(src) - new /obj/item/device/encryptionkey/syndicate(src) - new /obj/item/weapon/grenade/syndieminibomb(src) - - if("implant") // 55+ tc holy shit what the fuck this is a lottery disguised as fun boxes isn't it? - new /obj/item/weapon/implanter/freedom(src) - new /obj/item/weapon/implanter/uplink/precharged(src) - new /obj/item/weapon/implanter/emp(src) - new /obj/item/weapon/implanter/adrenalin(src) - new /obj/item/weapon/implanter/explosive(src) - new /obj/item/weapon/implanter/storage(src) - - if("hacker") // 26 tc - new /obj/item/weapon/aiModule/syndicate(src) - new /obj/item/weapon/card/emag(src) - new /obj/item/device/encryptionkey/binary(src) - new /obj/item/weapon/aiModule/toyAI(src) - new /obj/item/device/multitool/ai_detect(src) - - if("lordsingulo") // 24 tc - new /obj/item/device/sbeacondrop(src) - new /obj/item/clothing/suit/space/syndicate/black/red(src) - new /obj/item/clothing/head/helmet/space/syndicate/black/red(src) - new /obj/item/weapon/card/emag(src) - - if("sabotage") // 26 tc now - new /obj/item/weapon/grenade/plastic/c4 (src) - new /obj/item/weapon/grenade/plastic/c4 (src) - new /obj/item/device/doorCharge(src) - new /obj/item/device/doorCharge(src) - new /obj/item/device/camera_bug(src) - new /obj/item/device/sbeacondrop/powersink(src) - new /obj/item/weapon/cartridge/syndicate(src) - new /obj/item/weapon/storage/toolbox/syndicate(src) //To actually get to those places - new /obj/item/pizzabox/bomb - - if("darklord") //20 tc + tk + summon item close enough for now - new /obj/item/weapon/twohanded/dualsaber(src) - new /obj/item/weapon/dnainjector/telemut/darkbundle(src) - new /obj/item/clothing/suit/hooded/chaplain_hoodie(src) - new /obj/item/weapon/card/id/syndicate(src) - new /obj/item/clothing/shoes/chameleon(src) //because slipping while being a dark lord sucks - new /obj/item/weapon/spellbook/oneuse/summonitem(src) - - if("sniper") //This shit is unique so can't really balance it around tc, also no silencer because getting killed without ANY indicator on what killed you sucks - new /obj/item/weapon/gun/ballistic/automatic/sniper_rifle(src) // 12 tc - new /obj/item/ammo_box/magazine/sniper_rounds/penetrator(src) - new /obj/item/clothing/glasses/thermal/syndi(src) - new /obj/item/clothing/gloves/color/latex/nitrile(src) - new /obj/item/clothing/mask/gas/clown_hat(src) - new /obj/item/clothing/under/suit_jacket/really_black(src) - - if("metaops") // 30 tc - new /obj/item/clothing/suit/space/hardsuit/syndi(src) // 8 tc - new /obj/item/weapon/gun/ballistic/automatic/shotgun/bulldog/unrestricted(src) // 8 tc - new /obj/item/weapon/implanter/explosive(src) // 2 tc - new /obj/item/ammo_box/magazine/m12g/buckshot(src) // 2 tc - new /obj/item/ammo_box/magazine/m12g/buckshot(src) // 2 tc - new /obj/item/weapon/grenade/plastic/c4 (src) // 1 tc - new /obj/item/weapon/grenade/plastic/c4 (src) // 1 tc - new /obj/item/weapon/card/emag(src) // 6 tc - - if("ninja") // 33 tc worth - new /obj/item/weapon/katana(src) // Unique , hard to tell how much tc this is worth. 8 tc? - new /obj/item/weapon/implanter/adrenalin(src) // 8 tc - new /obj/item/weapon/throwing_star(src) // ~5 tc for all 6 - new /obj/item/weapon/throwing_star(src) - new /obj/item/weapon/throwing_star(src) - new /obj/item/weapon/throwing_star(src) - new /obj/item/weapon/throwing_star(src) - new /obj/item/weapon/throwing_star(src) - new /obj/item/weapon/storage/belt/chameleon(src) // Unique but worth at least 2 tc - new /obj/item/weapon/card/id/syndicate(src) // 2 tc - new /obj/item/device/chameleon(src) // 7 tc - -/obj/item/weapon/storage/box/syndie_kit - name = "box" - desc = "A sleek, sturdy box." - icon_state = "syndiebox" - illustration = "writing_syndie" - -/obj/item/weapon/storage/box/syndie_kit/imp_freedom - name = "boxed freedom implant (with injector)" - -/obj/item/weapon/storage/box/syndie_kit/imp_freedom/PopulateContents() - var/obj/item/weapon/implanter/O = new(src) - O.imp = new /obj/item/weapon/implant/freedom(O) - O.update_icon() - -/obj/item/weapon/storage/box/syndie_kit/imp_microbomb - name = "Microbomb Implant (with injector)" - -/obj/item/weapon/storage/box/syndie_kit/imp_microbomb/PopulateContents() - var/obj/item/weapon/implanter/O = new(src) - O.imp = new /obj/item/weapon/implant/explosive(O) - O.update_icon() - -/obj/item/weapon/storage/box/syndie_kit/imp_macrobomb - name = "Macrobomb Implant (with injector)" - -/obj/item/weapon/storage/box/syndie_kit/imp_macrobomb/PopulateContents() - var/obj/item/weapon/implanter/O = new(src) - O.imp = new /obj/item/weapon/implant/explosive/macro(O) - O.update_icon() - -/obj/item/weapon/storage/box/syndie_kit/imp_uplink - name = "boxed uplink implant (with injector)" - -/obj/item/weapon/storage/box/syndie_kit/imp_uplink/PopulateContents() - ..() - var/obj/item/weapon/implanter/O = new(src) - O.imp = new /obj/item/weapon/implant/uplink(O) - O.update_icon() - -/obj/item/weapon/storage/box/syndie_kit/bioterror - name = "bioterror syringe box" - -/obj/item/weapon/storage/box/syndie_kit/bioterror/PopulateContents() - for(var/i in 1 to 7) - new /obj/item/weapon/reagent_containers/syringe/bioterror(src) - -/obj/item/weapon/storage/box/syndie_kit/imp_adrenal - name = "boxed adrenal implant (with injector)" - -/obj/item/weapon/storage/box/syndie_kit/imp_adrenal/PopulateContents() - var/obj/item/weapon/implanter/O = new(src) - O.imp = new /obj/item/weapon/implant/adrenalin(O) - O.update_icon() - -/obj/item/weapon/storage/box/syndie_kit/imp_storage - name = "boxed storage implant (with injector)" - -/obj/item/weapon/storage/box/syndie_kit/imp_storage/PopulateContents() - new /obj/item/weapon/implanter/storage(src) - -/obj/item/weapon/storage/box/syndie_kit/space - name = "boxed space suit and helmet" - can_hold = list(/obj/item/clothing/suit/space/syndicate, /obj/item/clothing/head/helmet/space/syndicate) - max_w_class = WEIGHT_CLASS_NORMAL - -/obj/item/weapon/storage/box/syndie_kit/space/PopulateContents() - new /obj/item/clothing/suit/space/syndicate/black/red(src) // Black and red is so in right now - new /obj/item/clothing/head/helmet/space/syndicate/black/red(src) - -/obj/item/weapon/storage/box/syndie_kit/emp - name = "boxed EMP kit" - -/obj/item/weapon/storage/box/syndie_kit/emp/PopulateContents() - new /obj/item/weapon/grenade/empgrenade(src) - new /obj/item/weapon/grenade/empgrenade(src) - new /obj/item/weapon/grenade/empgrenade(src) - new /obj/item/weapon/grenade/empgrenade(src) - new /obj/item/weapon/grenade/empgrenade(src) - new /obj/item/weapon/implanter/emp(src) - -/obj/item/weapon/storage/box/syndie_kit/chemical - name = "boxed chemical kit" - storage_slots = 14 - -/obj/item/weapon/storage/box/syndie_kit/chemical/PopulateContents() - new /obj/item/weapon/reagent_containers/glass/bottle/polonium(src) - new /obj/item/weapon/reagent_containers/glass/bottle/venom(src) - new /obj/item/weapon/reagent_containers/glass/bottle/neurotoxin2(src) - new /obj/item/weapon/reagent_containers/glass/bottle/formaldehyde(src) - new /obj/item/weapon/reagent_containers/glass/bottle/spewium(src) - new /obj/item/weapon/reagent_containers/glass/bottle/cyanide(src) - new /obj/item/weapon/reagent_containers/glass/bottle/histamine(src) - new /obj/item/weapon/reagent_containers/glass/bottle/initropidril(src) - new /obj/item/weapon/reagent_containers/glass/bottle/pancuronium(src) - new /obj/item/weapon/reagent_containers/glass/bottle/sodium_thiopental(src) - new /obj/item/weapon/reagent_containers/glass/bottle/coniine(src) - new /obj/item/weapon/reagent_containers/glass/bottle/curare(src) - new /obj/item/weapon/reagent_containers/glass/bottle/amanitin(src) - new /obj/item/weapon/reagent_containers/syringe(src) - -/obj/item/weapon/storage/box/syndie_kit/nuke - name = "box" - -/obj/item/weapon/storage/box/syndie_kit/nuke/PopulateContents() - new /obj/item/weapon/screwdriver/nuke(src) - new /obj/item/nuke_core_container(src) - new /obj/item/weapon/paper/nuke_instructions(src) - -/obj/item/weapon/storage/box/syndie_kit/tuberculosisgrenade - name = "boxed virus grenade kit" - -/obj/item/weapon/storage/box/syndie_kit/tuberculosisgrenade/PopulateContents() - new /obj/item/weapon/grenade/chem_grenade/tuberculosis(src) - for(var/i in 1 to 5) - new /obj/item/weapon/reagent_containers/hypospray/medipen/tuberculosiscure(src) - new /obj/item/weapon/reagent_containers/syringe(src) - new /obj/item/weapon/reagent_containers/glass/bottle/tuberculosiscure(src) - -/obj/item/weapon/storage/box/syndie_kit/chameleon - name = "chameleon kit" - -/obj/item/weapon/storage/box/syndie_kit/chameleon/PopulateContents() - new /obj/item/clothing/under/chameleon(src) - new /obj/item/clothing/suit/chameleon(src) - new /obj/item/clothing/gloves/chameleon(src) - new /obj/item/clothing/shoes/chameleon(src) - new /obj/item/clothing/glasses/chameleon(src) - new /obj/item/clothing/head/chameleon(src) - new /obj/item/clothing/mask/chameleon(src) - new /obj/item/weapon/storage/backpack/chameleon(src) - new /obj/item/device/radio/headset/chameleon(src) - new /obj/item/weapon/stamp/chameleon(src) - new /obj/item/device/pda/chameleon(src) - new /obj/item/weapon/gun/energy/laser/chameleon(src) - -//5*(2*4) = 5*8 = 45, 45 damage if you hit one person with all 5 stars. -//Not counting the damage it will do while embedded (2*4 = 8, at 15% chance) -/obj/item/weapon/storage/box/syndie_kit/throwing_weapons/PopulateContents() - new /obj/item/weapon/throwing_star(src) - new /obj/item/weapon/throwing_star(src) - new /obj/item/weapon/throwing_star(src) - new /obj/item/weapon/throwing_star(src) - new /obj/item/weapon/throwing_star(src) - new /obj/item/weapon/restraints/legcuffs/bola/tactical(src) - new /obj/item/weapon/restraints/legcuffs/bola/tactical(src) - -/obj/item/weapon/storage/box/syndie_kit/cutouts/PopulateContents() - for(var/i in 1 to 3) - new/obj/item/cardboard_cutout/adaptive(src) - new/obj/item/toy/crayon/rainbow(src) - -/obj/item/weapon/storage/box/syndie_kit/romerol/PopulateContents() - new /obj/item/weapon/reagent_containers/glass/bottle/romerol(src) - new /obj/item/weapon/reagent_containers/syringe(src) - new /obj/item/weapon/reagent_containers/dropper(src) - -/obj/item/weapon/storage/box/syndie_kit/ez_clean/PopulateContents() - for(var/i in 1 to 3) - new/obj/item/weapon/grenade/chem_grenade/ez_clean(src) - -/obj/item/weapon/storage/box/hug/reverse_revolver/PopulateContents() - new /obj/item/weapon/gun/ballistic/revolver/reverse(src) - -/obj/item/weapon/storage/box/syndie_kit/mimery/PopulateContents() - new /obj/item/weapon/spellbook/oneuse/mimery_blockade(src) - new /obj/item/weapon/spellbook/oneuse/mimery_guns(src) - -/obj/item/weapon/storage/box/syndie_kit/holoparasite - name = "box" - -/obj/item/weapon/storage/box/syndie_kit/holoparasite/PopulateContents() - new /obj/item/weapon/guardiancreator/tech/choose/traitor(src) +/obj/item/weapon/storage/box/syndicate + +/obj/item/weapon/storage/box/syndicate/PopulateContents() + switch (pickweight(list("bloodyspai" = 3, "stealth" = 2, "bond" = 2, "screwed" = 2, "sabotage" = 3, "guns" = 2, "murder" = 2, "implant" = 1, "hacker" = 3, "darklord" = 1, "sniper" = 1, "metaops" = 1, "ninja" = 1))) + if("bloodyspai") // 27 tc now this is more right + new /obj/item/clothing/under/chameleon(src) // 2 tc since it's not the full set + new /obj/item/clothing/mask/chameleon(src) // Goes with above + new /obj/item/weapon/card/id/syndicate(src) // 2 tc + new /obj/item/clothing/shoes/chameleon(src) // 2 tc + new /obj/item/device/camera_bug(src) // 1 tc + new /obj/item/device/multitool/ai_detect(src) // 1 tc + new /obj/item/device/encryptionkey/syndicate(src) // 2 tc + new /obj/item/weapon/reagent_containers/syringe/mulligan(src) // 4 tc + new /obj/item/weapon/switchblade(src) //I'll count this as 2 tc + new /obj/item/weapon/storage/fancy/cigarettes/cigpack_syndicate (src) // 2 tc this shit heals + new /obj/item/device/flashlight/emp(src) // 2 tc + new /obj/item/device/chameleon(src) // 7 tc + + if("stealth") // 31 tc + new /obj/item/weapon/gun/energy/kinetic_accelerator/crossbow(src) + new /obj/item/weapon/pen/sleepy(src) + new /obj/item/device/healthanalyzer/rad_laser(src) + new /obj/item/device/chameleon(src) + new /obj/item/weapon/soap/syndie(src) + new /obj/item/clothing/glasses/thermal/syndi(src) + + if("bond") // 29 tc + new /obj/item/weapon/gun/ballistic/automatic/pistol(src) + new /obj/item/weapon/suppressor(src) + new /obj/item/ammo_box/magazine/m10mm(src) + new /obj/item/ammo_box/magazine/m10mm(src) + new /obj/item/clothing/under/chameleon(src) + new /obj/item/weapon/card/id/syndicate(src) + new /obj/item/weapon/reagent_containers/syringe/stimulants(src) + + if("screwed") // 29 tc + new /obj/item/device/sbeacondrop/bomb(src) + new /obj/item/weapon/grenade/syndieminibomb(src) + new /obj/item/device/sbeacondrop/powersink(src) + new /obj/item/clothing/suit/space/syndicate/black/red(src) + new /obj/item/clothing/head/helmet/space/syndicate/black/red(src) + new /obj/item/device/encryptionkey/syndicate(src) + + if("guns") // 28 tc now + new /obj/item/weapon/gun/ballistic/revolver(src) + new /obj/item/ammo_box/a357(src) + new /obj/item/ammo_box/a357(src) + new /obj/item/weapon/card/emag(src) + new /obj/item/weapon/grenade/plastic/c4(src) + new /obj/item/clothing/gloves/color/latex/nitrile(src) + new /obj/item/clothing/mask/gas/clown_hat(src) + new /obj/item/clothing/under/suit_jacket/really_black(src) + + if("murder") // 28 tc now + new /obj/item/weapon/melee/energy/sword/saber(src) + new /obj/item/clothing/glasses/thermal/syndi(src) + new /obj/item/weapon/card/emag(src) + new /obj/item/clothing/shoes/chameleon(src) + new /obj/item/device/encryptionkey/syndicate(src) + new /obj/item/weapon/grenade/syndieminibomb(src) + + if("implant") // 55+ tc holy shit what the fuck this is a lottery disguised as fun boxes isn't it? + new /obj/item/weapon/implanter/freedom(src) + new /obj/item/weapon/implanter/uplink/precharged(src) + new /obj/item/weapon/implanter/emp(src) + new /obj/item/weapon/implanter/adrenalin(src) + new /obj/item/weapon/implanter/explosive(src) + new /obj/item/weapon/implanter/storage(src) + + if("hacker") // 26 tc + new /obj/item/weapon/aiModule/syndicate(src) + new /obj/item/weapon/card/emag(src) + new /obj/item/device/encryptionkey/binary(src) + new /obj/item/weapon/aiModule/toyAI(src) + new /obj/item/device/multitool/ai_detect(src) + + if("lordsingulo") // 24 tc + new /obj/item/device/sbeacondrop(src) + new /obj/item/clothing/suit/space/syndicate/black/red(src) + new /obj/item/clothing/head/helmet/space/syndicate/black/red(src) + new /obj/item/weapon/card/emag(src) + + if("sabotage") // 26 tc now + new /obj/item/weapon/grenade/plastic/c4 (src) + new /obj/item/weapon/grenade/plastic/c4 (src) + new /obj/item/device/doorCharge(src) + new /obj/item/device/doorCharge(src) + new /obj/item/device/camera_bug(src) + new /obj/item/device/sbeacondrop/powersink(src) + new /obj/item/weapon/cartridge/syndicate(src) + new /obj/item/weapon/storage/toolbox/syndicate(src) //To actually get to those places + new /obj/item/pizzabox/bomb + + if("darklord") //20 tc + tk + summon item close enough for now + new /obj/item/weapon/twohanded/dualsaber(src) + new /obj/item/weapon/dnainjector/telemut/darkbundle(src) + new /obj/item/clothing/suit/hooded/chaplain_hoodie(src) + new /obj/item/weapon/card/id/syndicate(src) + new /obj/item/clothing/shoes/chameleon(src) //because slipping while being a dark lord sucks + new /obj/item/weapon/spellbook/oneuse/summonitem(src) + + if("sniper") //This shit is unique so can't really balance it around tc, also no silencer because getting killed without ANY indicator on what killed you sucks + new /obj/item/weapon/gun/ballistic/automatic/sniper_rifle(src) // 12 tc + new /obj/item/ammo_box/magazine/sniper_rounds/penetrator(src) + new /obj/item/clothing/glasses/thermal/syndi(src) + new /obj/item/clothing/gloves/color/latex/nitrile(src) + new /obj/item/clothing/mask/gas/clown_hat(src) + new /obj/item/clothing/under/suit_jacket/really_black(src) + + if("metaops") // 30 tc + new /obj/item/clothing/suit/space/hardsuit/syndi(src) // 8 tc + new /obj/item/weapon/gun/ballistic/automatic/shotgun/bulldog/unrestricted(src) // 8 tc + new /obj/item/weapon/implanter/explosive(src) // 2 tc + new /obj/item/ammo_box/magazine/m12g/buckshot(src) // 2 tc + new /obj/item/ammo_box/magazine/m12g/buckshot(src) // 2 tc + new /obj/item/weapon/grenade/plastic/c4 (src) // 1 tc + new /obj/item/weapon/grenade/plastic/c4 (src) // 1 tc + new /obj/item/weapon/card/emag(src) // 6 tc + + if("ninja") // 33 tc worth + new /obj/item/weapon/katana(src) // Unique , hard to tell how much tc this is worth. 8 tc? + new /obj/item/weapon/implanter/adrenalin(src) // 8 tc + new /obj/item/weapon/throwing_star(src) // ~5 tc for all 6 + new /obj/item/weapon/throwing_star(src) + new /obj/item/weapon/throwing_star(src) + new /obj/item/weapon/throwing_star(src) + new /obj/item/weapon/throwing_star(src) + new /obj/item/weapon/throwing_star(src) + new /obj/item/weapon/storage/belt/chameleon(src) // Unique but worth at least 2 tc + new /obj/item/weapon/card/id/syndicate(src) // 2 tc + new /obj/item/device/chameleon(src) // 7 tc + +/obj/item/weapon/storage/box/syndie_kit + name = "box" + desc = "A sleek, sturdy box." + icon_state = "syndiebox" + illustration = "writing_syndie" + +/obj/item/weapon/storage/box/syndie_kit/imp_freedom + name = "boxed freedom implant (with injector)" + +/obj/item/weapon/storage/box/syndie_kit/imp_freedom/PopulateContents() + var/obj/item/weapon/implanter/O = new(src) + O.imp = new /obj/item/weapon/implant/freedom(O) + O.update_icon() + +/obj/item/weapon/storage/box/syndie_kit/imp_microbomb + name = "Microbomb Implant (with injector)" + +/obj/item/weapon/storage/box/syndie_kit/imp_microbomb/PopulateContents() + var/obj/item/weapon/implanter/O = new(src) + O.imp = new /obj/item/weapon/implant/explosive(O) + O.update_icon() + +/obj/item/weapon/storage/box/syndie_kit/imp_macrobomb + name = "Macrobomb Implant (with injector)" + +/obj/item/weapon/storage/box/syndie_kit/imp_macrobomb/PopulateContents() + var/obj/item/weapon/implanter/O = new(src) + O.imp = new /obj/item/weapon/implant/explosive/macro(O) + O.update_icon() + +/obj/item/weapon/storage/box/syndie_kit/imp_uplink + name = "boxed uplink implant (with injector)" + +/obj/item/weapon/storage/box/syndie_kit/imp_uplink/PopulateContents() + ..() + var/obj/item/weapon/implanter/O = new(src) + O.imp = new /obj/item/weapon/implant/uplink(O) + O.update_icon() + +/obj/item/weapon/storage/box/syndie_kit/bioterror + name = "bioterror syringe box" + +/obj/item/weapon/storage/box/syndie_kit/bioterror/PopulateContents() + for(var/i in 1 to 7) + new /obj/item/weapon/reagent_containers/syringe/bioterror(src) + +/obj/item/weapon/storage/box/syndie_kit/imp_adrenal + name = "boxed adrenal implant (with injector)" + +/obj/item/weapon/storage/box/syndie_kit/imp_adrenal/PopulateContents() + var/obj/item/weapon/implanter/O = new(src) + O.imp = new /obj/item/weapon/implant/adrenalin(O) + O.update_icon() + +/obj/item/weapon/storage/box/syndie_kit/imp_storage + name = "boxed storage implant (with injector)" + +/obj/item/weapon/storage/box/syndie_kit/imp_storage/PopulateContents() + new /obj/item/weapon/implanter/storage(src) + +/obj/item/weapon/storage/box/syndie_kit/space + name = "boxed space suit and helmet" + can_hold = list(/obj/item/clothing/suit/space/syndicate, /obj/item/clothing/head/helmet/space/syndicate) + max_w_class = WEIGHT_CLASS_NORMAL + +/obj/item/weapon/storage/box/syndie_kit/space/PopulateContents() + new /obj/item/clothing/suit/space/syndicate/black/red(src) // Black and red is so in right now + new /obj/item/clothing/head/helmet/space/syndicate/black/red(src) + +/obj/item/weapon/storage/box/syndie_kit/emp + name = "boxed EMP kit" + +/obj/item/weapon/storage/box/syndie_kit/emp/PopulateContents() + new /obj/item/weapon/grenade/empgrenade(src) + new /obj/item/weapon/grenade/empgrenade(src) + new /obj/item/weapon/grenade/empgrenade(src) + new /obj/item/weapon/grenade/empgrenade(src) + new /obj/item/weapon/grenade/empgrenade(src) + new /obj/item/weapon/implanter/emp(src) + +/obj/item/weapon/storage/box/syndie_kit/chemical + name = "boxed chemical kit" + storage_slots = 14 + +/obj/item/weapon/storage/box/syndie_kit/chemical/PopulateContents() + new /obj/item/weapon/reagent_containers/glass/bottle/polonium(src) + new /obj/item/weapon/reagent_containers/glass/bottle/venom(src) + new /obj/item/weapon/reagent_containers/glass/bottle/neurotoxin2(src) + new /obj/item/weapon/reagent_containers/glass/bottle/formaldehyde(src) + new /obj/item/weapon/reagent_containers/glass/bottle/spewium(src) + new /obj/item/weapon/reagent_containers/glass/bottle/cyanide(src) + new /obj/item/weapon/reagent_containers/glass/bottle/histamine(src) + new /obj/item/weapon/reagent_containers/glass/bottle/initropidril(src) + new /obj/item/weapon/reagent_containers/glass/bottle/pancuronium(src) + new /obj/item/weapon/reagent_containers/glass/bottle/sodium_thiopental(src) + new /obj/item/weapon/reagent_containers/glass/bottle/coniine(src) + new /obj/item/weapon/reagent_containers/glass/bottle/curare(src) + new /obj/item/weapon/reagent_containers/glass/bottle/amanitin(src) + new /obj/item/weapon/reagent_containers/syringe(src) + +/obj/item/weapon/storage/box/syndie_kit/nuke + name = "box" + +/obj/item/weapon/storage/box/syndie_kit/nuke/PopulateContents() + new /obj/item/weapon/screwdriver/nuke(src) + new /obj/item/nuke_core_container(src) + new /obj/item/weapon/paper/nuke_instructions(src) + +/obj/item/weapon/storage/box/syndie_kit/tuberculosisgrenade + name = "boxed virus grenade kit" + +/obj/item/weapon/storage/box/syndie_kit/tuberculosisgrenade/PopulateContents() + new /obj/item/weapon/grenade/chem_grenade/tuberculosis(src) + for(var/i in 1 to 5) + new /obj/item/weapon/reagent_containers/hypospray/medipen/tuberculosiscure(src) + new /obj/item/weapon/reagent_containers/syringe(src) + new /obj/item/weapon/reagent_containers/glass/bottle/tuberculosiscure(src) + +/obj/item/weapon/storage/box/syndie_kit/chameleon + name = "chameleon kit" + +/obj/item/weapon/storage/box/syndie_kit/chameleon/PopulateContents() + new /obj/item/clothing/under/chameleon(src) + new /obj/item/clothing/suit/chameleon(src) + new /obj/item/clothing/gloves/chameleon(src) + new /obj/item/clothing/shoes/chameleon(src) + new /obj/item/clothing/glasses/chameleon(src) + new /obj/item/clothing/head/chameleon(src) + new /obj/item/clothing/mask/chameleon(src) + new /obj/item/weapon/storage/backpack/chameleon(src) + new /obj/item/device/radio/headset/chameleon(src) + new /obj/item/weapon/stamp/chameleon(src) + new /obj/item/device/pda/chameleon(src) + new /obj/item/weapon/gun/energy/laser/chameleon(src) + +//5*(2*4) = 5*8 = 45, 45 damage if you hit one person with all 5 stars. +//Not counting the damage it will do while embedded (2*4 = 8, at 15% chance) +/obj/item/weapon/storage/box/syndie_kit/throwing_weapons/PopulateContents() + new /obj/item/weapon/throwing_star(src) + new /obj/item/weapon/throwing_star(src) + new /obj/item/weapon/throwing_star(src) + new /obj/item/weapon/throwing_star(src) + new /obj/item/weapon/throwing_star(src) + new /obj/item/weapon/restraints/legcuffs/bola/tactical(src) + new /obj/item/weapon/restraints/legcuffs/bola/tactical(src) + +/obj/item/weapon/storage/box/syndie_kit/cutouts/PopulateContents() + for(var/i in 1 to 3) + new/obj/item/cardboard_cutout/adaptive(src) + new/obj/item/toy/crayon/rainbow(src) + +/obj/item/weapon/storage/box/syndie_kit/romerol/PopulateContents() + new /obj/item/weapon/reagent_containers/glass/bottle/romerol(src) + new /obj/item/weapon/reagent_containers/syringe(src) + new /obj/item/weapon/reagent_containers/dropper(src) + +/obj/item/weapon/storage/box/syndie_kit/ez_clean/PopulateContents() + for(var/i in 1 to 3) + new/obj/item/weapon/grenade/chem_grenade/ez_clean(src) + +/obj/item/weapon/storage/box/hug/reverse_revolver/PopulateContents() + new /obj/item/weapon/gun/ballistic/revolver/reverse(src) + +/obj/item/weapon/storage/box/syndie_kit/mimery/PopulateContents() + new /obj/item/weapon/spellbook/oneuse/mimery_blockade(src) + new /obj/item/weapon/spellbook/oneuse/mimery_guns(src) + +/obj/item/weapon/storage/box/syndie_kit/holoparasite + name = "box" + +/obj/item/weapon/storage/box/syndie_kit/holoparasite/PopulateContents() + new /obj/item/weapon/guardiancreator/tech/choose/traitor(src) new /obj/item/weapon/paper/guardian(src) \ No newline at end of file diff --git a/code/game/objects/items/weapons/tanks/tank_types.dm b/code/game/objects/items/weapons/tanks/tank_types.dm old mode 100644 new mode 100755 index 97548b97d6..4ffa4a9b89 --- a/code/game/objects/items/weapons/tanks/tank_types.dm +++ b/code/game/objects/items/weapons/tanks/tank_types.dm @@ -140,8 +140,8 @@ item_state = "plasmaman_tank_belt" slot_flags = SLOT_BELT force = 5 - volume = 3 - w_class = WEIGHT_CLASS_SMALL //thanks i forgot this + volume = 3 + w_class = WEIGHT_CLASS_SMALL //thanks i forgot this /obj/item/weapon/tank/internals/plasmaman/belt/full/New() ..() diff --git a/code/game/objects/items/weapons/weaponry.dm b/code/game/objects/items/weapons/weaponry.dm index 71e7c0e566..084ac19f63 100644 --- a/code/game/objects/items/weapons/weaponry.dm +++ b/code/game/objects/items/weapons/weaponry.dm @@ -1,553 +1,553 @@ -/obj/item/weapon - -/obj/item/weapon/banhammer - desc = "A banhammer" - name = "banhammer" - icon = 'icons/obj/items.dmi' - icon_state = "toyhammer" - slot_flags = SLOT_BELT - throwforce = 0 - w_class = WEIGHT_CLASS_TINY - throw_speed = 3 - throw_range = 7 - attack_verb = list("banned") - obj_integrity = 200 - max_integrity = 200 - armor = list(melee = 0, bullet = 0, laser = 0, energy = 0, bomb = 0, bio = 0, rad = 0, fire = 100, acid = 70) - resistance_flags = FIRE_PROOF - -/obj/item/weapon/banhammer/suicide_act(mob/user) - user.visible_message("[user] is hitting [user.p_them()]self with [src]! It looks like [user.p_theyre()] trying to ban [user.p_them()]self from life.") - return (BRUTELOSS|FIRELOSS|TOXLOSS|OXYLOSS) - -/obj/item/weapon/banhammer/attack(mob/M, mob/user) - to_chat(M, " You have been banned FOR NO REISIN by [user]") - to_chat(user, "You have BANNED [M]") - playsound(loc, 'sound/effects/adminhelp.ogg', 15) //keep it at 15% volume so people don't jump out of their skin too much - -/obj/item/weapon/sord - name = "\improper SORD" - desc = "This thing is so unspeakably shitty you are having a hard time even holding it." - icon_state = "sord" - item_state = "sord" - slot_flags = SLOT_BELT - force = 2 - throwforce = 1 - w_class = WEIGHT_CLASS_NORMAL - hitsound = 'sound/weapons/bladeslice.ogg' - attack_verb = list("attacked", "slashed", "stabbed", "sliced", "torn", "ripped", "diced", "cut") - -/obj/item/weapon/sord/suicide_act(mob/user) - user.visible_message("[user] is trying to impale [user.p_them()]self with [src]! It might be a suicide attempt if it weren't so shitty.", \ - "You try to impale yourself with [src], but it's USELESS...") - return SHAME - -/obj/item/weapon/claymore - name = "claymore" - desc = "What are you standing around staring at this for? Get to killing!" - icon_state = "claymore" - item_state = "claymore" - hitsound = 'sound/weapons/bladeslice.ogg' - flags = CONDUCT - slot_flags = SLOT_BELT | SLOT_BACK - force = 40 - throwforce = 10 - w_class = WEIGHT_CLASS_NORMAL - attack_verb = list("attacked", "slashed", "stabbed", "sliced", "torn", "ripped", "diced", "cut") - block_chance = 50 - sharpness = IS_SHARP - obj_integrity = 200 - max_integrity = 200 - armor = list(melee = 0, bullet = 0, laser = 0, energy = 0, bomb = 0, bio = 0, rad = 0, fire = 100, acid = 50) - resistance_flags = FIRE_PROOF - -/obj/item/weapon/claymore/suicide_act(mob/user) - user.visible_message("[user] is falling on [src]! It looks like [user.p_theyre()] trying to commit suicide!") - return(BRUTELOSS) - -/obj/item/weapon/claymore/highlander //ALL COMMENTS MADE REGARDING THIS SWORD MUST BE MADE IN ALL CAPS - desc = "THERE CAN BE ONLY ONE, AND IT WILL BE YOU!!!\nActivate it in your hand to point to the nearest victim." - flags = CONDUCT | NODROP | DROPDEL - slot_flags = null - block_chance = 0 //RNG WON'T HELP YOU NOW, PANSY - luminosity = 3 - attack_verb = list("brutalized", "eviscerated", "disemboweled", "hacked", "carved", "cleaved") //ONLY THE MOST VISCERAL ATTACK VERBS - var/notches = 0 //HOW MANY PEOPLE HAVE BEEN SLAIN WITH THIS BLADE - var/obj/item/weapon/disk/nuclear/nuke_disk //OUR STORED NUKE DISK - -/obj/item/weapon/claymore/highlander/New() - ..() - START_PROCESSING(SSobj, src) - -/obj/item/weapon/claymore/highlander/Destroy() - if(nuke_disk) - nuke_disk.forceMove(get_turf(src)) - nuke_disk.visible_message("The nuke disk is vulnerable!") - nuke_disk = null - STOP_PROCESSING(SSobj, src) - return ..() - -/obj/item/weapon/claymore/highlander/process() - if(ishuman(loc)) - var/mob/living/carbon/human/H = loc - loc.layer = LARGE_MOB_LAYER //NO HIDING BEHIND PLANTS FOR YOU, DICKWEED (HA GET IT, BECAUSE WEEDS ARE PLANTS) - H.bleedsuppress = TRUE //AND WE WON'T BLEED OUT LIKE COWARDS - else - if(!admin_spawned) - qdel(src) - - -/obj/item/weapon/claymore/highlander/pickup(mob/living/user) - to_chat(user, "The power of Scotland protects you! You are shielded from all stuns and knockdowns.") - user.add_stun_absorption("highlander", INFINITY, 1, " is protected by the power of Scotland!", "The power of Scotland absorbs the stun!", " is protected by the power of Scotland!") - user.status_flags += IGNORESLOWDOWN - -/obj/item/weapon/claymore/highlander/dropped(mob/living/user) - user.status_flags -= IGNORESLOWDOWN - qdel(src) //If this ever happens, it's because you lost an arm - -/obj/item/weapon/claymore/highlander/examine(mob/user) - ..() - to_chat(user, "It has [!notches ? "nothing" : "[notches] notches"] scratched into the blade.") - if(nuke_disk) - to_chat(user, "It's holding the nuke disk!") - -/obj/item/weapon/claymore/highlander/attack(mob/living/target, mob/living/user) - . = ..() - if(target && target.stat == DEAD && target.mind && target.mind.special_role == "highlander") - user.fully_heal() //STEAL THE LIFE OF OUR FALLEN FOES - add_notch(user) - target.visible_message("[target] crumbles to dust beneath [user]'s blows!", "As you fall, your body crumbles to dust!") - target.dust() - -/obj/item/weapon/claymore/highlander/attack_self(mob/living/user) - var/closest_victim - var/closest_distance = 255 - for(var/mob/living/carbon/human/H in GLOB.player_list - user) - if(H.client && H.mind.special_role == "highlander" && (!closest_victim || get_dist(user, closest_victim) < closest_distance)) - closest_victim = H - if(!closest_victim) - to_chat(user, "[src] thrums for a moment and falls dark. Perhaps there's nobody nearby.") - return - to_chat(user, "[src] thrums and points to the [dir2text(get_dir(user, closest_victim))].") - -/obj/item/weapon/claymore/highlander/IsReflect() - return 1 //YOU THINK YOUR PUNY LASERS CAN STOP ME? - -/obj/item/weapon/claymore/highlander/proc/add_notch(mob/living/user) //DYNAMIC CLAYMORE PROGRESSION SYSTEM - THIS IS THE FUTURE - notches++ - force++ - var/new_name = name - switch(notches) - if(1) - to_chat(user, "Your first kill - hopefully one of many. You scratch a notch into [src]'s blade.") - to_chat(user, "You feel your fallen foe's soul entering your blade, restoring your wounds!") - new_name = "notched claymore" - if(2) - to_chat(user, "Another falls before you. Another soul fuses with your own. Another notch in the blade.") - new_name = "double-notched claymore" - add_atom_colour(rgb(255, 235, 235), ADMIN_COLOUR_PRIORITY) - if(3) - to_chat(user, "You're beginning to relish the thrill of battle.") - new_name = "triple-notched claymore" - add_atom_colour(rgb(255, 215, 215), ADMIN_COLOUR_PRIORITY) - if(4) - to_chat(user, "You've lost count of how many you've killed.") - new_name = "many-notched claymore" - add_atom_colour(rgb(255, 195, 195), ADMIN_COLOUR_PRIORITY) - if(5) - to_chat(user, "Five voices now echo in your mind, cheering the slaughter.") - new_name = "battle-tested claymore" - add_atom_colour(rgb(255, 175, 175), ADMIN_COLOUR_PRIORITY) - if(6) - to_chat(user, "Is this what the vikings felt like? Visions of glory fill your head as you slay your sixth foe.") - new_name = "battle-scarred claymore" - add_atom_colour(rgb(255, 155, 155), ADMIN_COLOUR_PRIORITY) - if(7) - to_chat(user, "Kill. Butcher. Conquer.") - new_name = "vicious claymore" - add_atom_colour(rgb(255, 135, 135), ADMIN_COLOUR_PRIORITY) - if(8) - to_chat(user, "IT NEVER GETS OLD. THE SCREAMING. THE BLOOD AS IT SPRAYS ACROSS YOUR FACE.") - new_name = "bloodthirsty claymore" - add_atom_colour(rgb(255, 115, 115), ADMIN_COLOUR_PRIORITY) - if(9) - to_chat(user, "ANOTHER ONE FALLS TO YOUR BLOWS. ANOTHER WEAKLING UNFIT TO LIVE.") - new_name = "gore-stained claymore" - add_atom_colour(rgb(255, 95, 95), ADMIN_COLOUR_PRIORITY) - if(10) - user.visible_message("[user]'s eyes light up with a vengeful fire!", \ - "YOU FEEL THE POWER OF VALHALLA FLOWING THROUGH YOU! THERE CAN BE ONLY ONE!!!") - user.update_icons() - new_name = "GORE-DRENCHED CLAYMORE OF [pick("THE WHIMSICAL SLAUGHTER", "A THOUSAND SLAUGHTERED CATTLE", "GLORY AND VALHALLA", "ANNIHILATION", "OBLITERATION")]" - icon_state = "claymore_valhalla" - item_state = "cultblade" - remove_atom_colour(ADMIN_COLOUR_PRIORITY) - - name = new_name - playsound(user, 'sound/items/Screwdriver2.ogg', 50, 1) - -/obj/item/weapon/katana - name = "katana" - desc = "Woefully underpowered in D20" - icon_state = "katana" - item_state = "katana" - flags = CONDUCT - slot_flags = SLOT_BELT | SLOT_BACK - force = 40 - throwforce = 10 - w_class = WEIGHT_CLASS_NORMAL - hitsound = 'sound/weapons/bladeslice.ogg' - attack_verb = list("attacked", "slashed", "stabbed", "sliced", "torn", "ripped", "diced", "cut") - block_chance = 50 - sharpness = IS_SHARP - obj_integrity = 200 - max_integrity = 200 - armor = list(melee = 0, bullet = 0, laser = 0, energy = 0, bomb = 0, bio = 0, rad = 0, fire = 100, acid = 50) - resistance_flags = FIRE_PROOF - -/obj/item/weapon/katana/cursed - slot_flags = null - -/obj/item/weapon/katana/suicide_act(mob/user) - user.visible_message("[user] is slitting [user.p_their()] stomach open with [src]! It looks like [user.p_theyre()] trying to commit seppuku!") - return(BRUTELOSS) - -/obj/item/weapon/wirerod - name = "wired rod" - desc = "A rod with some wire wrapped around the top. It'd be easy to attach something to the top bit." - icon_state = "wiredrod" - item_state = "rods" - flags = CONDUCT - force = 9 - throwforce = 10 - w_class = WEIGHT_CLASS_NORMAL - materials = list(MAT_METAL=1150, MAT_GLASS=75) - attack_verb = list("hit", "bludgeoned", "whacked", "bonked") - -/obj/item/weapon/wirerod/attackby(obj/item/I, mob/user, params) - if(istype(I, /obj/item/weapon/shard)) - var/obj/item/weapon/twohanded/spear/S = new /obj/item/weapon/twohanded/spear - - remove_item_from_storage(user) - qdel(I) - qdel(src) - - user.put_in_hands(S) - to_chat(user, "You fasten the glass shard to the top of the rod with the cable.") - - else if(istype(I, /obj/item/device/assembly/igniter) && !(I.flags & NODROP)) - var/obj/item/weapon/melee/baton/cattleprod/P = new /obj/item/weapon/melee/baton/cattleprod - - remove_item_from_storage(user) - - to_chat(user, "You fasten [I] to the top of the rod with the cable.") - - qdel(I) - qdel(src) - - user.put_in_hands(P) - else - return ..() - - -/obj/item/weapon/throwing_star - name = "throwing star" - desc = "An ancient weapon still used to this day due to it's ease of lodging itself into victim's body parts" - icon_state = "throwingstar" - item_state = "eshield0" - force = 2 - throwforce = 20 //This is never used on mobs since this has a 100% embed chance. - throw_speed = 4 - embedded_pain_multiplier = 4 - w_class = WEIGHT_CLASS_SMALL - embed_chance = 100 - embedded_fall_chance = 0 //Hahaha! - sharpness = IS_SHARP - materials = list(MAT_METAL=500, MAT_GLASS=500) - resistance_flags = FIRE_PROOF - - -/obj/item/weapon/switchblade - name = "switchblade" - icon_state = "switchblade" - desc = "A sharp, concealable, spring-loaded knife." - flags = CONDUCT - force = 3 - w_class = WEIGHT_CLASS_SMALL - throwforce = 5 - throw_speed = 3 - throw_range = 6 - materials = list(MAT_METAL=12000) - origin_tech = "engineering=3;combat=2" - hitsound = 'sound/weapons/Genhit.ogg' - attack_verb = list("stubbed", "poked") - resistance_flags = FIRE_PROOF - var/extended = 0 - -/obj/item/weapon/switchblade/attack_self(mob/user) - extended = !extended - playsound(src.loc, 'sound/weapons/batonextend.ogg', 50, 1) - if(extended) - force = 20 - w_class = WEIGHT_CLASS_NORMAL - throwforce = 23 - icon_state = "switchblade_ext" - attack_verb = list("slashed", "stabbed", "sliced", "torn", "ripped", "diced", "cut") - hitsound = 'sound/weapons/bladeslice.ogg' - sharpness = IS_SHARP - else - force = 3 - w_class = WEIGHT_CLASS_SMALL - throwforce = 5 - icon_state = "switchblade" - attack_verb = list("stubbed", "poked") - hitsound = 'sound/weapons/Genhit.ogg' - sharpness = IS_BLUNT - -/obj/item/weapon/switchblade/suicide_act(mob/user) - user.visible_message("[user] is slitting [user.p_their()] own throat with [src]! It looks like [user.p_theyre()] trying to commit suicide!") - return (BRUTELOSS) - -/obj/item/weapon/phone - name = "red phone" - desc = "Should anything ever go wrong..." - icon = 'icons/obj/items.dmi' - icon_state = "red_phone" - force = 3 - throwforce = 2 - throw_speed = 3 - throw_range = 4 - w_class = WEIGHT_CLASS_SMALL - attack_verb = list("called", "rang") - hitsound = 'sound/weapons/ring.ogg' - -/obj/item/weapon/phone/suicide_act(mob/user) - if(locate(/obj/structure/chair/stool) in user.loc) - user.visible_message("[user] begins to tie a noose with [src]'s cord! It looks like [user.p_theyre()] trying to commit suicide!") - else - user.visible_message("[user] is strangling [user.p_them()]self with [src]'s cord! It looks like [user.p_theyre()] trying to commit suicide!") - return(OXYLOSS) - -/obj/item/weapon/cane - name = "cane" - desc = "A cane used by a true gentleman. Or a clown." - icon = 'icons/obj/weapons.dmi' - icon_state = "cane" - item_state = "stick" - force = 5 - throwforce = 5 - w_class = WEIGHT_CLASS_SMALL - materials = list(MAT_METAL=50) - attack_verb = list("bludgeoned", "whacked", "disciplined", "thrashed") - -/obj/item/weapon/staff - name = "wizard staff" - desc = "Apparently a staff used by the wizard." - icon = 'icons/obj/wizard.dmi' - icon_state = "staff" - force = 3 - throwforce = 5 - throw_speed = 2 - throw_range = 5 - w_class = WEIGHT_CLASS_SMALL - armour_penetration = 100 - attack_verb = list("bludgeoned", "whacked", "disciplined") - resistance_flags = FLAMMABLE - -/obj/item/weapon/staff/broom - name = "broom" - desc = "Used for sweeping, and flying into the night while cackling. Black cat not included." - icon = 'icons/obj/wizard.dmi' - icon_state = "broom" - resistance_flags = FLAMMABLE - -/obj/item/weapon/staff/stick - name = "stick" - desc = "A great tool to drag someone else's drinks across the bar." - icon = 'icons/obj/weapons.dmi' - icon_state = "stick" - item_state = "stick" - force = 3 - throwforce = 5 - throw_speed = 2 - throw_range = 5 - w_class = WEIGHT_CLASS_SMALL - -/obj/item/weapon/ectoplasm - name = "ectoplasm" - desc = "spooky" - gender = PLURAL - icon = 'icons/obj/wizard.dmi' - icon_state = "ectoplasm" - -/obj/item/weapon/ectoplasm/suicide_act(mob/user) - user.visible_message("[user] is inhaling [src]! It looks like [user.p_theyre()] trying to visit the astral plane.") - return (OXYLOSS) - -/obj/item/weapon/mounted_chainsaw - name = "mounted chainsaw" - desc = "A chainsaw that has replaced your arm." - icon_state = "chainsaw_on" - item_state = "mounted_chainsaw" - flags = NODROP | ABSTRACT | DROPDEL - w_class = WEIGHT_CLASS_HUGE - force = 21 - throwforce = 0 - throw_range = 0 - throw_speed = 0 - sharpness = IS_SHARP - attack_verb = list("sawed", "torn", "cut", "chopped", "diced") - hitsound = 'sound/weapons/chainsawhit.ogg' - -/obj/item/weapon/mounted_chainsaw/Destroy() - var/obj/item/bodypart/part - new /obj/item/weapon/twohanded/required/chainsaw(get_turf(src)) - if(iscarbon(loc)) - var/mob/living/carbon/holder = loc - var/index = holder.get_held_index_of_item(src) - if(index) - part = holder.hand_bodyparts[index] - . = ..() - if(part) - part.drop_limb() - -/obj/item/weapon/statuebust - name = "bust" - desc = "A priceless ancient marble bust, the kind that belongs in a museum." //or you can hit people with it - icon = 'icons/obj/statue.dmi' - icon_state = "bust" - force = 15 - throwforce = 10 - throw_speed = 5 - throw_range = 2 - attack_verb = list("busted") - -/obj/item/weapon/tailclub - name = "tail club" - desc = "For the beating to death of lizards with their own tails." - icon_state = "tailclub" - force = 14 - throwforce = 1 // why are you throwing a club do you even weapon - throw_speed = 1 - throw_range = 1 - attack_verb = list("clubbed", "bludgeoned") - -/obj/item/weapon/melee/chainofcommand/tailwhip - name = "liz o' nine tails" - desc = "A whip fashioned from the severed tails of lizards." - icon_state = "tailwhip" - origin_tech = "engineering=3;combat=3;biotech=3" - needs_permit = 0 - -/obj/item/weapon/melee/skateboard - name = "skateboard" - desc = "A skateboard. It can be placed on its wheels and ridden, or used as a strong weapon." - icon_state = "skateboard" - item_state = "skateboard" - force = 12 - throwforce = 4 - w_class = WEIGHT_CLASS_HUGE - attack_verb = list("smacked", "whacked", "slammed", "smashed") - -/obj/item/weapon/melee/skateboard/attack_self(mob/user) - new /obj/vehicle/scooter/skateboard(get_turf(user)) - qdel(src) - -/obj/item/weapon/melee/baseball_bat - name = "baseball bat" - desc = "There ain't a skull in the league that can withstand a swatter." - icon = 'icons/obj/items.dmi' - icon_state = "baseball_bat" - item_state = "baseball_bat" - force = 10 - throwforce = 12 - attack_verb = list("beat", "smacked") - w_class = WEIGHT_CLASS_HUGE - var/homerun_ready = 0 - var/homerun_able = 0 - -/obj/item/weapon/melee/baseball_bat/homerun - name = "home run bat" - desc = "This thing looks dangerous... Dangerously good at baseball, that is." - homerun_able = 1 - -/obj/item/weapon/melee/baseball_bat/attack_self(mob/user) - if(!homerun_able) - ..() - return - if(homerun_ready) - to_chat(user, "You're already ready to do a home run!") - ..() - return - to_chat(user, "You begin gathering strength...") - playsound(get_turf(src), 'sound/magic/lightning_chargeup.ogg', 65, 1) - if(do_after(user, 90, target = src)) - to_chat(user, "You gather power! Time for a home run!") - homerun_ready = 1 - ..() - -/obj/item/weapon/melee/baseball_bat/attack(mob/living/target, mob/living/user) - . = ..() - var/atom/throw_target = get_edge_target_turf(target, user.dir) - if(homerun_ready) - user.visible_message("It's a home run!") - target.throw_at(throw_target, rand(8,10), 14, user) - target.ex_act(2) - playsound(get_turf(src), 'sound/weapons/HOMERUN.ogg', 100, 1) - homerun_ready = 0 - return - else if(!target.anchored) - target.throw_at(throw_target, rand(1,2), 7, user) - -/obj/item/weapon/melee/baseball_bat/ablative - name = "metal baseball bat" - desc = "This bat is made of highly reflective, highly armored material." - icon_state = "baseball_bat_metal" - item_state = "baseball_bat_metal" - force = 12 - throwforce = 15 - -/obj/item/weapon/melee/baseball_bat/ablative/IsReflect()//some day this will reflect thrown items instead of lasers - var/picksound = rand(1,2) - var/turf = get_turf(src) - if(picksound == 1) - playsound(turf, 'sound/weapons/effects/batreflect1.ogg', 50, 1) - if(picksound == 2) - playsound(turf, 'sound/weapons/effects/batreflect2.ogg', 50, 1) - return 1 - -/obj/item/weapon/melee/flyswatter - name = "Flyswatter" - desc = "Useful for killing insects of all sizes." - icon = 'icons/obj/weapons.dmi' - icon_state = "flyswatter" - item_state = "flyswatter" - force = 1 - throwforce = 1 - attack_verb = list("swatted", "smacked") - hitsound = 'sound/effects/snap.ogg' - w_class = WEIGHT_CLASS_SMALL - //Things in this list will be instantly splatted. Flyman weakness is handled in the flyman species weakness proc. - var/list/strong_against - -/obj/item/weapon/melee/flyswatter/New() - ..() - strong_against = typecacheof(list( - /mob/living/simple_animal/hostile/poison/bees/, - /mob/living/simple_animal/butterfly, - /mob/living/simple_animal/cockroach, - /obj/item/queen_bee - )) - - -/obj/item/weapon/melee/flyswatter/afterattack(atom/target, mob/user, proximity_flag) - if(proximity_flag) - if(is_type_in_typecache(target, strong_against)) - new /obj/effect/decal/cleanable/deadcockroach(get_turf(target)) - to_chat(user, "You easily splat the [target].") - if(istype(target, /mob/living/)) - var/mob/living/bug = target - bug.death(1) - else - qdel(target) +/obj/item/weapon + +/obj/item/weapon/banhammer + desc = "A banhammer" + name = "banhammer" + icon = 'icons/obj/items.dmi' + icon_state = "toyhammer" + slot_flags = SLOT_BELT + throwforce = 0 + w_class = WEIGHT_CLASS_TINY + throw_speed = 3 + throw_range = 7 + attack_verb = list("banned") + obj_integrity = 200 + max_integrity = 200 + armor = list(melee = 0, bullet = 0, laser = 0, energy = 0, bomb = 0, bio = 0, rad = 0, fire = 100, acid = 70) + resistance_flags = FIRE_PROOF + +/obj/item/weapon/banhammer/suicide_act(mob/user) + user.visible_message("[user] is hitting [user.p_them()]self with [src]! It looks like [user.p_theyre()] trying to ban [user.p_them()]self from life.") + return (BRUTELOSS|FIRELOSS|TOXLOSS|OXYLOSS) + +/obj/item/weapon/banhammer/attack(mob/M, mob/user) + to_chat(M, " You have been banned FOR NO REISIN by [user]") + to_chat(user, "You have BANNED [M]") + playsound(loc, 'sound/effects/adminhelp.ogg', 15) //keep it at 15% volume so people don't jump out of their skin too much + +/obj/item/weapon/sord + name = "\improper SORD" + desc = "This thing is so unspeakably shitty you are having a hard time even holding it." + icon_state = "sord" + item_state = "sord" + slot_flags = SLOT_BELT + force = 2 + throwforce = 1 + w_class = WEIGHT_CLASS_NORMAL + hitsound = 'sound/weapons/bladeslice.ogg' + attack_verb = list("attacked", "slashed", "stabbed", "sliced", "torn", "ripped", "diced", "cut") + +/obj/item/weapon/sord/suicide_act(mob/user) + user.visible_message("[user] is trying to impale [user.p_them()]self with [src]! It might be a suicide attempt if it weren't so shitty.", \ + "You try to impale yourself with [src], but it's USELESS...") + return SHAME + +/obj/item/weapon/claymore + name = "claymore" + desc = "What are you standing around staring at this for? Get to killing!" + icon_state = "claymore" + item_state = "claymore" + hitsound = 'sound/weapons/bladeslice.ogg' + flags = CONDUCT + slot_flags = SLOT_BELT | SLOT_BACK + force = 40 + throwforce = 10 + w_class = WEIGHT_CLASS_NORMAL + attack_verb = list("attacked", "slashed", "stabbed", "sliced", "torn", "ripped", "diced", "cut") + block_chance = 50 + sharpness = IS_SHARP + obj_integrity = 200 + max_integrity = 200 + armor = list(melee = 0, bullet = 0, laser = 0, energy = 0, bomb = 0, bio = 0, rad = 0, fire = 100, acid = 50) + resistance_flags = FIRE_PROOF + +/obj/item/weapon/claymore/suicide_act(mob/user) + user.visible_message("[user] is falling on [src]! It looks like [user.p_theyre()] trying to commit suicide!") + return(BRUTELOSS) + +/obj/item/weapon/claymore/highlander //ALL COMMENTS MADE REGARDING THIS SWORD MUST BE MADE IN ALL CAPS + desc = "THERE CAN BE ONLY ONE, AND IT WILL BE YOU!!!\nActivate it in your hand to point to the nearest victim." + flags = CONDUCT | NODROP | DROPDEL + slot_flags = null + block_chance = 0 //RNG WON'T HELP YOU NOW, PANSY + luminosity = 3 + attack_verb = list("brutalized", "eviscerated", "disemboweled", "hacked", "carved", "cleaved") //ONLY THE MOST VISCERAL ATTACK VERBS + var/notches = 0 //HOW MANY PEOPLE HAVE BEEN SLAIN WITH THIS BLADE + var/obj/item/weapon/disk/nuclear/nuke_disk //OUR STORED NUKE DISK + +/obj/item/weapon/claymore/highlander/New() + ..() + START_PROCESSING(SSobj, src) + +/obj/item/weapon/claymore/highlander/Destroy() + if(nuke_disk) + nuke_disk.forceMove(get_turf(src)) + nuke_disk.visible_message("The nuke disk is vulnerable!") + nuke_disk = null + STOP_PROCESSING(SSobj, src) + return ..() + +/obj/item/weapon/claymore/highlander/process() + if(ishuman(loc)) + var/mob/living/carbon/human/H = loc + loc.layer = LARGE_MOB_LAYER //NO HIDING BEHIND PLANTS FOR YOU, DICKWEED (HA GET IT, BECAUSE WEEDS ARE PLANTS) + H.bleedsuppress = TRUE //AND WE WON'T BLEED OUT LIKE COWARDS + else + if(!admin_spawned) + qdel(src) + + +/obj/item/weapon/claymore/highlander/pickup(mob/living/user) + to_chat(user, "The power of Scotland protects you! You are shielded from all stuns and knockdowns.") + user.add_stun_absorption("highlander", INFINITY, 1, " is protected by the power of Scotland!", "The power of Scotland absorbs the stun!", " is protected by the power of Scotland!") + user.status_flags += IGNORESLOWDOWN + +/obj/item/weapon/claymore/highlander/dropped(mob/living/user) + user.status_flags -= IGNORESLOWDOWN + qdel(src) //If this ever happens, it's because you lost an arm + +/obj/item/weapon/claymore/highlander/examine(mob/user) + ..() + to_chat(user, "It has [!notches ? "nothing" : "[notches] notches"] scratched into the blade.") + if(nuke_disk) + to_chat(user, "It's holding the nuke disk!") + +/obj/item/weapon/claymore/highlander/attack(mob/living/target, mob/living/user) + . = ..() + if(target && target.stat == DEAD && target.mind && target.mind.special_role == "highlander") + user.fully_heal() //STEAL THE LIFE OF OUR FALLEN FOES + add_notch(user) + target.visible_message("[target] crumbles to dust beneath [user]'s blows!", "As you fall, your body crumbles to dust!") + target.dust() + +/obj/item/weapon/claymore/highlander/attack_self(mob/living/user) + var/closest_victim + var/closest_distance = 255 + for(var/mob/living/carbon/human/H in GLOB.player_list - user) + if(H.client && H.mind.special_role == "highlander" && (!closest_victim || get_dist(user, closest_victim) < closest_distance)) + closest_victim = H + if(!closest_victim) + to_chat(user, "[src] thrums for a moment and falls dark. Perhaps there's nobody nearby.") + return + to_chat(user, "[src] thrums and points to the [dir2text(get_dir(user, closest_victim))].") + +/obj/item/weapon/claymore/highlander/IsReflect() + return 1 //YOU THINK YOUR PUNY LASERS CAN STOP ME? + +/obj/item/weapon/claymore/highlander/proc/add_notch(mob/living/user) //DYNAMIC CLAYMORE PROGRESSION SYSTEM - THIS IS THE FUTURE + notches++ + force++ + var/new_name = name + switch(notches) + if(1) + to_chat(user, "Your first kill - hopefully one of many. You scratch a notch into [src]'s blade.") + to_chat(user, "You feel your fallen foe's soul entering your blade, restoring your wounds!") + new_name = "notched claymore" + if(2) + to_chat(user, "Another falls before you. Another soul fuses with your own. Another notch in the blade.") + new_name = "double-notched claymore" + add_atom_colour(rgb(255, 235, 235), ADMIN_COLOUR_PRIORITY) + if(3) + to_chat(user, "You're beginning to relish the thrill of battle.") + new_name = "triple-notched claymore" + add_atom_colour(rgb(255, 215, 215), ADMIN_COLOUR_PRIORITY) + if(4) + to_chat(user, "You've lost count of how many you've killed.") + new_name = "many-notched claymore" + add_atom_colour(rgb(255, 195, 195), ADMIN_COLOUR_PRIORITY) + if(5) + to_chat(user, "Five voices now echo in your mind, cheering the slaughter.") + new_name = "battle-tested claymore" + add_atom_colour(rgb(255, 175, 175), ADMIN_COLOUR_PRIORITY) + if(6) + to_chat(user, "Is this what the vikings felt like? Visions of glory fill your head as you slay your sixth foe.") + new_name = "battle-scarred claymore" + add_atom_colour(rgb(255, 155, 155), ADMIN_COLOUR_PRIORITY) + if(7) + to_chat(user, "Kill. Butcher. Conquer.") + new_name = "vicious claymore" + add_atom_colour(rgb(255, 135, 135), ADMIN_COLOUR_PRIORITY) + if(8) + to_chat(user, "IT NEVER GETS OLD. THE SCREAMING. THE BLOOD AS IT SPRAYS ACROSS YOUR FACE.") + new_name = "bloodthirsty claymore" + add_atom_colour(rgb(255, 115, 115), ADMIN_COLOUR_PRIORITY) + if(9) + to_chat(user, "ANOTHER ONE FALLS TO YOUR BLOWS. ANOTHER WEAKLING UNFIT TO LIVE.") + new_name = "gore-stained claymore" + add_atom_colour(rgb(255, 95, 95), ADMIN_COLOUR_PRIORITY) + if(10) + user.visible_message("[user]'s eyes light up with a vengeful fire!", \ + "YOU FEEL THE POWER OF VALHALLA FLOWING THROUGH YOU! THERE CAN BE ONLY ONE!!!") + user.update_icons() + new_name = "GORE-DRENCHED CLAYMORE OF [pick("THE WHIMSICAL SLAUGHTER", "A THOUSAND SLAUGHTERED CATTLE", "GLORY AND VALHALLA", "ANNIHILATION", "OBLITERATION")]" + icon_state = "claymore_valhalla" + item_state = "cultblade" + remove_atom_colour(ADMIN_COLOUR_PRIORITY) + + name = new_name + playsound(user, 'sound/items/Screwdriver2.ogg', 50, 1) + +/obj/item/weapon/katana + name = "katana" + desc = "Woefully underpowered in D20" + icon_state = "katana" + item_state = "katana" + flags = CONDUCT + slot_flags = SLOT_BELT | SLOT_BACK + force = 40 + throwforce = 10 + w_class = WEIGHT_CLASS_NORMAL + hitsound = 'sound/weapons/bladeslice.ogg' + attack_verb = list("attacked", "slashed", "stabbed", "sliced", "torn", "ripped", "diced", "cut") + block_chance = 50 + sharpness = IS_SHARP + obj_integrity = 200 + max_integrity = 200 + armor = list(melee = 0, bullet = 0, laser = 0, energy = 0, bomb = 0, bio = 0, rad = 0, fire = 100, acid = 50) + resistance_flags = FIRE_PROOF + +/obj/item/weapon/katana/cursed + slot_flags = null + +/obj/item/weapon/katana/suicide_act(mob/user) + user.visible_message("[user] is slitting [user.p_their()] stomach open with [src]! It looks like [user.p_theyre()] trying to commit seppuku!") + return(BRUTELOSS) + +/obj/item/weapon/wirerod + name = "wired rod" + desc = "A rod with some wire wrapped around the top. It'd be easy to attach something to the top bit." + icon_state = "wiredrod" + item_state = "rods" + flags = CONDUCT + force = 9 + throwforce = 10 + w_class = WEIGHT_CLASS_NORMAL + materials = list(MAT_METAL=1150, MAT_GLASS=75) + attack_verb = list("hit", "bludgeoned", "whacked", "bonked") + +/obj/item/weapon/wirerod/attackby(obj/item/I, mob/user, params) + if(istype(I, /obj/item/weapon/shard)) + var/obj/item/weapon/twohanded/spear/S = new /obj/item/weapon/twohanded/spear + + remove_item_from_storage(user) + qdel(I) + qdel(src) + + user.put_in_hands(S) + to_chat(user, "You fasten the glass shard to the top of the rod with the cable.") + + else if(istype(I, /obj/item/device/assembly/igniter) && !(I.flags & NODROP)) + var/obj/item/weapon/melee/baton/cattleprod/P = new /obj/item/weapon/melee/baton/cattleprod + + remove_item_from_storage(user) + + to_chat(user, "You fasten [I] to the top of the rod with the cable.") + + qdel(I) + qdel(src) + + user.put_in_hands(P) + else + return ..() + + +/obj/item/weapon/throwing_star + name = "throwing star" + desc = "An ancient weapon still used to this day due to it's ease of lodging itself into victim's body parts" + icon_state = "throwingstar" + item_state = "eshield0" + force = 2 + throwforce = 20 //This is never used on mobs since this has a 100% embed chance. + throw_speed = 4 + embedded_pain_multiplier = 4 + w_class = WEIGHT_CLASS_SMALL + embed_chance = 100 + embedded_fall_chance = 0 //Hahaha! + sharpness = IS_SHARP + materials = list(MAT_METAL=500, MAT_GLASS=500) + resistance_flags = FIRE_PROOF + + +/obj/item/weapon/switchblade + name = "switchblade" + icon_state = "switchblade" + desc = "A sharp, concealable, spring-loaded knife." + flags = CONDUCT + force = 3 + w_class = WEIGHT_CLASS_SMALL + throwforce = 5 + throw_speed = 3 + throw_range = 6 + materials = list(MAT_METAL=12000) + origin_tech = "engineering=3;combat=2" + hitsound = 'sound/weapons/Genhit.ogg' + attack_verb = list("stubbed", "poked") + resistance_flags = FIRE_PROOF + var/extended = 0 + +/obj/item/weapon/switchblade/attack_self(mob/user) + extended = !extended + playsound(src.loc, 'sound/weapons/batonextend.ogg', 50, 1) + if(extended) + force = 20 + w_class = WEIGHT_CLASS_NORMAL + throwforce = 23 + icon_state = "switchblade_ext" + attack_verb = list("slashed", "stabbed", "sliced", "torn", "ripped", "diced", "cut") + hitsound = 'sound/weapons/bladeslice.ogg' + sharpness = IS_SHARP + else + force = 3 + w_class = WEIGHT_CLASS_SMALL + throwforce = 5 + icon_state = "switchblade" + attack_verb = list("stubbed", "poked") + hitsound = 'sound/weapons/Genhit.ogg' + sharpness = IS_BLUNT + +/obj/item/weapon/switchblade/suicide_act(mob/user) + user.visible_message("[user] is slitting [user.p_their()] own throat with [src]! It looks like [user.p_theyre()] trying to commit suicide!") + return (BRUTELOSS) + +/obj/item/weapon/phone + name = "red phone" + desc = "Should anything ever go wrong..." + icon = 'icons/obj/items.dmi' + icon_state = "red_phone" + force = 3 + throwforce = 2 + throw_speed = 3 + throw_range = 4 + w_class = WEIGHT_CLASS_SMALL + attack_verb = list("called", "rang") + hitsound = 'sound/weapons/ring.ogg' + +/obj/item/weapon/phone/suicide_act(mob/user) + if(locate(/obj/structure/chair/stool) in user.loc) + user.visible_message("[user] begins to tie a noose with [src]'s cord! It looks like [user.p_theyre()] trying to commit suicide!") + else + user.visible_message("[user] is strangling [user.p_them()]self with [src]'s cord! It looks like [user.p_theyre()] trying to commit suicide!") + return(OXYLOSS) + +/obj/item/weapon/cane + name = "cane" + desc = "A cane used by a true gentleman. Or a clown." + icon = 'icons/obj/weapons.dmi' + icon_state = "cane" + item_state = "stick" + force = 5 + throwforce = 5 + w_class = WEIGHT_CLASS_SMALL + materials = list(MAT_METAL=50) + attack_verb = list("bludgeoned", "whacked", "disciplined", "thrashed") + +/obj/item/weapon/staff + name = "wizard staff" + desc = "Apparently a staff used by the wizard." + icon = 'icons/obj/wizard.dmi' + icon_state = "staff" + force = 3 + throwforce = 5 + throw_speed = 2 + throw_range = 5 + w_class = WEIGHT_CLASS_SMALL + armour_penetration = 100 + attack_verb = list("bludgeoned", "whacked", "disciplined") + resistance_flags = FLAMMABLE + +/obj/item/weapon/staff/broom + name = "broom" + desc = "Used for sweeping, and flying into the night while cackling. Black cat not included." + icon = 'icons/obj/wizard.dmi' + icon_state = "broom" + resistance_flags = FLAMMABLE + +/obj/item/weapon/staff/stick + name = "stick" + desc = "A great tool to drag someone else's drinks across the bar." + icon = 'icons/obj/weapons.dmi' + icon_state = "stick" + item_state = "stick" + force = 3 + throwforce = 5 + throw_speed = 2 + throw_range = 5 + w_class = WEIGHT_CLASS_SMALL + +/obj/item/weapon/ectoplasm + name = "ectoplasm" + desc = "spooky" + gender = PLURAL + icon = 'icons/obj/wizard.dmi' + icon_state = "ectoplasm" + +/obj/item/weapon/ectoplasm/suicide_act(mob/user) + user.visible_message("[user] is inhaling [src]! It looks like [user.p_theyre()] trying to visit the astral plane.") + return (OXYLOSS) + +/obj/item/weapon/mounted_chainsaw + name = "mounted chainsaw" + desc = "A chainsaw that has replaced your arm." + icon_state = "chainsaw_on" + item_state = "mounted_chainsaw" + flags = NODROP | ABSTRACT | DROPDEL + w_class = WEIGHT_CLASS_HUGE + force = 21 + throwforce = 0 + throw_range = 0 + throw_speed = 0 + sharpness = IS_SHARP + attack_verb = list("sawed", "torn", "cut", "chopped", "diced") + hitsound = 'sound/weapons/chainsawhit.ogg' + +/obj/item/weapon/mounted_chainsaw/Destroy() + var/obj/item/bodypart/part + new /obj/item/weapon/twohanded/required/chainsaw(get_turf(src)) + if(iscarbon(loc)) + var/mob/living/carbon/holder = loc + var/index = holder.get_held_index_of_item(src) + if(index) + part = holder.hand_bodyparts[index] + . = ..() + if(part) + part.drop_limb() + +/obj/item/weapon/statuebust + name = "bust" + desc = "A priceless ancient marble bust, the kind that belongs in a museum." //or you can hit people with it + icon = 'icons/obj/statue.dmi' + icon_state = "bust" + force = 15 + throwforce = 10 + throw_speed = 5 + throw_range = 2 + attack_verb = list("busted") + +/obj/item/weapon/tailclub + name = "tail club" + desc = "For the beating to death of lizards with their own tails." + icon_state = "tailclub" + force = 14 + throwforce = 1 // why are you throwing a club do you even weapon + throw_speed = 1 + throw_range = 1 + attack_verb = list("clubbed", "bludgeoned") + +/obj/item/weapon/melee/chainofcommand/tailwhip + name = "liz o' nine tails" + desc = "A whip fashioned from the severed tails of lizards." + icon_state = "tailwhip" + origin_tech = "engineering=3;combat=3;biotech=3" + needs_permit = 0 + +/obj/item/weapon/melee/skateboard + name = "skateboard" + desc = "A skateboard. It can be placed on its wheels and ridden, or used as a strong weapon." + icon_state = "skateboard" + item_state = "skateboard" + force = 12 + throwforce = 4 + w_class = WEIGHT_CLASS_HUGE + attack_verb = list("smacked", "whacked", "slammed", "smashed") + +/obj/item/weapon/melee/skateboard/attack_self(mob/user) + new /obj/vehicle/scooter/skateboard(get_turf(user)) + qdel(src) + +/obj/item/weapon/melee/baseball_bat + name = "baseball bat" + desc = "There ain't a skull in the league that can withstand a swatter." + icon = 'icons/obj/items.dmi' + icon_state = "baseball_bat" + item_state = "baseball_bat" + force = 10 + throwforce = 12 + attack_verb = list("beat", "smacked") + w_class = WEIGHT_CLASS_HUGE + var/homerun_ready = 0 + var/homerun_able = 0 + +/obj/item/weapon/melee/baseball_bat/homerun + name = "home run bat" + desc = "This thing looks dangerous... Dangerously good at baseball, that is." + homerun_able = 1 + +/obj/item/weapon/melee/baseball_bat/attack_self(mob/user) + if(!homerun_able) + ..() + return + if(homerun_ready) + to_chat(user, "You're already ready to do a home run!") + ..() + return + to_chat(user, "You begin gathering strength...") + playsound(get_turf(src), 'sound/magic/lightning_chargeup.ogg', 65, 1) + if(do_after(user, 90, target = src)) + to_chat(user, "You gather power! Time for a home run!") + homerun_ready = 1 + ..() + +/obj/item/weapon/melee/baseball_bat/attack(mob/living/target, mob/living/user) + . = ..() + var/atom/throw_target = get_edge_target_turf(target, user.dir) + if(homerun_ready) + user.visible_message("It's a home run!") + target.throw_at(throw_target, rand(8,10), 14, user) + target.ex_act(2) + playsound(get_turf(src), 'sound/weapons/HOMERUN.ogg', 100, 1) + homerun_ready = 0 + return + else if(!target.anchored) + target.throw_at(throw_target, rand(1,2), 7, user) + +/obj/item/weapon/melee/baseball_bat/ablative + name = "metal baseball bat" + desc = "This bat is made of highly reflective, highly armored material." + icon_state = "baseball_bat_metal" + item_state = "baseball_bat_metal" + force = 12 + throwforce = 15 + +/obj/item/weapon/melee/baseball_bat/ablative/IsReflect()//some day this will reflect thrown items instead of lasers + var/picksound = rand(1,2) + var/turf = get_turf(src) + if(picksound == 1) + playsound(turf, 'sound/weapons/effects/batreflect1.ogg', 50, 1) + if(picksound == 2) + playsound(turf, 'sound/weapons/effects/batreflect2.ogg', 50, 1) + return 1 + +/obj/item/weapon/melee/flyswatter + name = "Flyswatter" + desc = "Useful for killing insects of all sizes." + icon = 'icons/obj/weapons.dmi' + icon_state = "flyswatter" + item_state = "flyswatter" + force = 1 + throwforce = 1 + attack_verb = list("swatted", "smacked") + hitsound = 'sound/effects/snap.ogg' + w_class = WEIGHT_CLASS_SMALL + //Things in this list will be instantly splatted. Flyman weakness is handled in the flyman species weakness proc. + var/list/strong_against + +/obj/item/weapon/melee/flyswatter/New() + ..() + strong_against = typecacheof(list( + /mob/living/simple_animal/hostile/poison/bees/, + /mob/living/simple_animal/butterfly, + /mob/living/simple_animal/cockroach, + /obj/item/queen_bee + )) + + +/obj/item/weapon/melee/flyswatter/afterattack(atom/target, mob/user, proximity_flag) + if(proximity_flag) + if(is_type_in_typecache(target, strong_against)) + new /obj/effect/decal/cleanable/deadcockroach(get_turf(target)) + to_chat(user, "You easily splat the [target].") + if(istype(target, /mob/living/)) + var/mob/living/bug = target + bug.death(1) + else + qdel(target) diff --git a/code/game/objects/structures/bedsheet_bin.dm b/code/game/objects/structures/bedsheet_bin.dm index e3aed96516..36730239ea 100644 --- a/code/game/objects/structures/bedsheet_bin.dm +++ b/code/game/objects/structures/bedsheet_bin.dm @@ -1,316 +1,316 @@ -/* -CONTAINS: -BEDSHEETS -LINEN BINS -*/ - -/obj/item/weapon/bedsheet - name = "bedsheet" - desc = "A surprisingly soft linen bedsheet." - icon = 'icons/obj/bedsheets.dmi' - icon_state = "sheetwhite" - item_state = "bedsheet" - slot_flags = SLOT_NECK - layer = MOB_LAYER - throwforce = 0 - throw_speed = 1 - throw_range = 2 - w_class = WEIGHT_CLASS_TINY - item_color = "white" - resistance_flags = FLAMMABLE - - dog_fashion = /datum/dog_fashion/head/ghost - -/obj/item/weapon/bedsheet/attack(mob/living/M, mob/user) - if(!attempt_initiate_surgery(src, M, user)) - ..() - -/obj/item/weapon/bedsheet/attack_self(mob/user) - user.drop_item() - if(layer == initial(layer)) - layer = ABOVE_MOB_LAYER - to_chat(user, "You cover yourself with [src].") - else - layer = initial(layer) - to_chat(user, "You smooth [src] out beneath you.") - add_fingerprint(user) - return - -/obj/item/weapon/bedsheet/attackby(obj/item/I, mob/user, params) - if(istype(I, /obj/item/weapon/wirecutters) || I.is_sharp()) - var/obj/item/stack/sheet/cloth/C = new (get_turf(src), 3) - transfer_fingerprints_to(C) - C.add_fingerprint(user) - qdel(src) - to_chat(user, "You tear [src] up.") - else - return ..() - -/obj/item/weapon/bedsheet/blue - icon_state = "sheetblue" - item_color = "blue" - -/obj/item/weapon/bedsheet/green - icon_state = "sheetgreen" - item_color = "green" - -/obj/item/weapon/bedsheet/orange - icon_state = "sheetorange" - item_color = "orange" - -/obj/item/weapon/bedsheet/purple - icon_state = "sheetpurple" - item_color = "purple" - -/obj/item/weapon/bedsheet/patriot - name = "patriotic bedsheet" - desc = "You've never felt more free than when sleeping on this." - icon_state = "sheetUSA" - item_color = "sheetUSA" - -/obj/item/weapon/bedsheet/rainbow - name = "rainbow bedsheet" - desc = "A multicolored blanket. It's actually several different sheets cut up and sewn together." - icon_state = "sheetrainbow" - item_color = "rainbow" - -/obj/item/weapon/bedsheet/red - icon_state = "sheetred" - item_color = "red" - -/obj/item/weapon/bedsheet/yellow - icon_state = "sheetyellow" - item_color = "yellow" - -/obj/item/weapon/bedsheet/mime - name = "mime's blanket" - desc = "A very soothing striped blanket. All the noise just seems to fade out when you're under the covers in this." - icon_state = "sheetmime" - item_color = "mime" - -/obj/item/weapon/bedsheet/clown - name = "clown's blanket" - desc = "A rainbow blanket with a clown mask woven in. It smells faintly of bananas." - icon_state = "sheetclown" - item_color = "clown" - -/obj/item/weapon/bedsheet/captain - name = "captain's bedsheet" - desc = "It has a Nanotrasen symbol on it, and was woven with a revolutionary new kind of thread guaranteed to have 0.01% permeability for most non-chemical substances, popular among most modern captains." - icon_state = "sheetcaptain" - item_color = "captain" - -/obj/item/weapon/bedsheet/rd - name = "research director's bedsheet" - desc = "It appears to have a beaker emblem, and is made out of fire-resistant material, although it probably won't protect you in the event of fires you're familiar with every day." - icon_state = "sheetrd" - item_color = "director" - -// for Free Golems. -/obj/item/weapon/bedsheet/rd/royal_cape - name = "Royal Cape of the Liberator" - desc = "Majestic." - -/obj/item/weapon/bedsheet/medical - name = "medical blanket" - desc = "It's a sterilized* blanket commonly used in the Medbay. *Sterilization is voided if a virologist is present onboard the station." - icon_state = "sheetmedical" - item_color = "medical" - -/obj/item/weapon/bedsheet/cmo - name = "chief medical officer's bedsheet" - desc = "It's a sterilized blanket that has a cross emblem. There's some cat fur on it, likely from Runtime." - icon_state = "sheetcmo" - item_color = "cmo" - -/obj/item/weapon/bedsheet/hos - name = "head of security's bedsheet" - desc = "It is decorated with a shield emblem. While crime doesn't sleep, you do, but you are still THE LAW!" - icon_state = "sheethos" - item_color = "hosred" - -/obj/item/weapon/bedsheet/hop - name = "head of personnel's bedsheet" - desc = "It is decorated with a key emblem. For those rare moments when you can rest and cuddle with Ian without someone screaming for you over the radio." - icon_state = "sheethop" - item_color = "hop" - -/obj/item/weapon/bedsheet/ce - name = "chief engineer's bedsheet" - desc = "It is decorated with a wrench emblem. It's highly reflective and stain resistant, so you don't need to worry about ruining it with oil." - icon_state = "sheetce" - item_color = "chief" - -/obj/item/weapon/bedsheet/qm - name = "quartermaster's bedsheet" - desc = "It is decorated with a crate emblem in silver lining. It's rather tough, and just the thing to lie on after a hard day of pushing paper." - icon_state = "sheetqm" - item_color = "qm" - -/obj/item/weapon/bedsheet/brown - icon_state = "sheetbrown" - item_color = "cargo" - -/obj/item/weapon/bedsheet/black - icon_state = "sheetblack" - item_color = "black" - -/obj/item/weapon/bedsheet/centcom - name = "\improper Centcom bedsheet" - desc = "Woven with advanced nanothread for warmth as well as being very decorated, essential for all officials." - icon_state = "sheetcentcom" - item_color = "centcom" - -/obj/item/weapon/bedsheet/syndie - name = "syndicate bedsheet" - desc = "It has a syndicate emblem and it has an aura of evil." - icon_state = "sheetsyndie" - item_color = "syndie" - -/obj/item/weapon/bedsheet/cult - name = "cultist's bedsheet" - desc = "You might dream of Nar'Sie if you sleep with this. It seems rather tattered and glows of an eldritch presence." - icon_state = "sheetcult" - item_color = "cult" - -/obj/item/weapon/bedsheet/wiz - name = "wizard's bedsheet" - desc = "A special fabric enchanted with magic so you can have an enchanted night. It even glows!" - icon_state = "sheetwiz" - item_color = "wiz" - -/obj/item/weapon/bedsheet/nanotrasen - name = "nanotrasen bedsheet" - desc = "It has the Nanotrasen logo on it and has an aura of duty." - icon_state = "sheetNT" - item_color = "nanotrasen" - -/obj/item/weapon/bedsheet/ian - icon_state = "sheetian" - item_color = "ian" - - -/obj/item/weapon/bedsheet/random - icon_state = "sheetrainbow" - item_color = "rainbow" - name = "random bedsheet" - desc = "If you're reading this description ingame, something has gone wrong! Honk!" - -/obj/item/weapon/bedsheet/random/New() - var/obj/item/weapon/bedsheet/B = pick(subtypesof(/obj/item/weapon/bedsheet) - /obj/item/weapon/bedsheet/random) - name = initial(B.name) - desc = initial(B.desc) - icon_state = initial(B.icon_state) - item_state = initial(B.item_state) - item_color = initial(B.item_color) - -/obj/structure/bedsheetbin - name = "linen bin" - desc = "It looks rather cosy." - icon = 'icons/obj/structures.dmi' - icon_state = "linenbin-full" - anchored = 1 - resistance_flags = FLAMMABLE - obj_integrity = 70 - max_integrity = 70 - var/amount = 10 - var/list/sheets = list() - var/obj/item/hidden = null - - -/obj/structure/bedsheetbin/examine(mob/user) - ..() - if(amount < 1) - to_chat(user, "There are no bed sheets in the bin.") - else if(amount == 1) - to_chat(user, "There is one bed sheet in the bin.") - else - to_chat(user, "There are [amount] bed sheets in the bin.") - - -/obj/structure/bedsheetbin/update_icon() - switch(amount) - if(0) - icon_state = "linenbin-empty" - if(1 to 5) - icon_state = "linenbin-half" - else - icon_state = "linenbin-full" - -/obj/structure/bedsheetbin/fire_act(exposed_temperature, exposed_volume) - if(amount) - amount = 0 - update_icon() - ..() - -/obj/structure/bedsheetbin/attackby(obj/item/I, mob/user, params) - if(istype(I, /obj/item/weapon/bedsheet)) - if(!user.drop_item()) - return - I.loc = src - sheets.Add(I) - amount++ - to_chat(user, "You put [I] in [src].") - update_icon() - else if(amount && !hidden && I.w_class < WEIGHT_CLASS_BULKY) //make sure there's sheets to hide it among, make sure nothing else is hidden in there. - if(!user.drop_item()) - to_chat(user, "\The [I] is stuck to your hand, you cannot hide it among the sheets!") - return - I.loc = src - hidden = I - to_chat(user, "You hide [I] among the sheets.") - - - -/obj/structure/bedsheetbin/attack_paw(mob/user) - return attack_hand(user) - - -/obj/structure/bedsheetbin/attack_hand(mob/user) - if(user.lying) - return - if(amount >= 1) - amount-- - - var/obj/item/weapon/bedsheet/B - if(sheets.len > 0) - B = sheets[sheets.len] - sheets.Remove(B) - - else - B = new /obj/item/weapon/bedsheet(loc) - - B.loc = user.loc - user.put_in_hands(B) - to_chat(user, "You take [B] out of [src].") - update_icon() - - if(hidden) - hidden.loc = user.loc - to_chat(user, "[hidden] falls out of [B]!") - hidden = null - - - add_fingerprint(user) -/obj/structure/bedsheetbin/attack_tk(mob/user) - if(amount >= 1) - amount-- - - var/obj/item/weapon/bedsheet/B - if(sheets.len > 0) - B = sheets[sheets.len] - sheets.Remove(B) - - else - B = new /obj/item/weapon/bedsheet(loc) - - B.loc = loc - to_chat(user, "You telekinetically remove [B] from [src].") - update_icon() - - if(hidden) - hidden.loc = loc - hidden = null - - - add_fingerprint(user) +/* +CONTAINS: +BEDSHEETS +LINEN BINS +*/ + +/obj/item/weapon/bedsheet + name = "bedsheet" + desc = "A surprisingly soft linen bedsheet." + icon = 'icons/obj/bedsheets.dmi' + icon_state = "sheetwhite" + item_state = "bedsheet" + slot_flags = SLOT_NECK + layer = MOB_LAYER + throwforce = 0 + throw_speed = 1 + throw_range = 2 + w_class = WEIGHT_CLASS_TINY + item_color = "white" + resistance_flags = FLAMMABLE + + dog_fashion = /datum/dog_fashion/head/ghost + +/obj/item/weapon/bedsheet/attack(mob/living/M, mob/user) + if(!attempt_initiate_surgery(src, M, user)) + ..() + +/obj/item/weapon/bedsheet/attack_self(mob/user) + user.drop_item() + if(layer == initial(layer)) + layer = ABOVE_MOB_LAYER + to_chat(user, "You cover yourself with [src].") + else + layer = initial(layer) + to_chat(user, "You smooth [src] out beneath you.") + add_fingerprint(user) + return + +/obj/item/weapon/bedsheet/attackby(obj/item/I, mob/user, params) + if(istype(I, /obj/item/weapon/wirecutters) || I.is_sharp()) + var/obj/item/stack/sheet/cloth/C = new (get_turf(src), 3) + transfer_fingerprints_to(C) + C.add_fingerprint(user) + qdel(src) + to_chat(user, "You tear [src] up.") + else + return ..() + +/obj/item/weapon/bedsheet/blue + icon_state = "sheetblue" + item_color = "blue" + +/obj/item/weapon/bedsheet/green + icon_state = "sheetgreen" + item_color = "green" + +/obj/item/weapon/bedsheet/orange + icon_state = "sheetorange" + item_color = "orange" + +/obj/item/weapon/bedsheet/purple + icon_state = "sheetpurple" + item_color = "purple" + +/obj/item/weapon/bedsheet/patriot + name = "patriotic bedsheet" + desc = "You've never felt more free than when sleeping on this." + icon_state = "sheetUSA" + item_color = "sheetUSA" + +/obj/item/weapon/bedsheet/rainbow + name = "rainbow bedsheet" + desc = "A multicolored blanket. It's actually several different sheets cut up and sewn together." + icon_state = "sheetrainbow" + item_color = "rainbow" + +/obj/item/weapon/bedsheet/red + icon_state = "sheetred" + item_color = "red" + +/obj/item/weapon/bedsheet/yellow + icon_state = "sheetyellow" + item_color = "yellow" + +/obj/item/weapon/bedsheet/mime + name = "mime's blanket" + desc = "A very soothing striped blanket. All the noise just seems to fade out when you're under the covers in this." + icon_state = "sheetmime" + item_color = "mime" + +/obj/item/weapon/bedsheet/clown + name = "clown's blanket" + desc = "A rainbow blanket with a clown mask woven in. It smells faintly of bananas." + icon_state = "sheetclown" + item_color = "clown" + +/obj/item/weapon/bedsheet/captain + name = "captain's bedsheet" + desc = "It has a Nanotrasen symbol on it, and was woven with a revolutionary new kind of thread guaranteed to have 0.01% permeability for most non-chemical substances, popular among most modern captains." + icon_state = "sheetcaptain" + item_color = "captain" + +/obj/item/weapon/bedsheet/rd + name = "research director's bedsheet" + desc = "It appears to have a beaker emblem, and is made out of fire-resistant material, although it probably won't protect you in the event of fires you're familiar with every day." + icon_state = "sheetrd" + item_color = "director" + +// for Free Golems. +/obj/item/weapon/bedsheet/rd/royal_cape + name = "Royal Cape of the Liberator" + desc = "Majestic." + +/obj/item/weapon/bedsheet/medical + name = "medical blanket" + desc = "It's a sterilized* blanket commonly used in the Medbay. *Sterilization is voided if a virologist is present onboard the station." + icon_state = "sheetmedical" + item_color = "medical" + +/obj/item/weapon/bedsheet/cmo + name = "chief medical officer's bedsheet" + desc = "It's a sterilized blanket that has a cross emblem. There's some cat fur on it, likely from Runtime." + icon_state = "sheetcmo" + item_color = "cmo" + +/obj/item/weapon/bedsheet/hos + name = "head of security's bedsheet" + desc = "It is decorated with a shield emblem. While crime doesn't sleep, you do, but you are still THE LAW!" + icon_state = "sheethos" + item_color = "hosred" + +/obj/item/weapon/bedsheet/hop + name = "head of personnel's bedsheet" + desc = "It is decorated with a key emblem. For those rare moments when you can rest and cuddle with Ian without someone screaming for you over the radio." + icon_state = "sheethop" + item_color = "hop" + +/obj/item/weapon/bedsheet/ce + name = "chief engineer's bedsheet" + desc = "It is decorated with a wrench emblem. It's highly reflective and stain resistant, so you don't need to worry about ruining it with oil." + icon_state = "sheetce" + item_color = "chief" + +/obj/item/weapon/bedsheet/qm + name = "quartermaster's bedsheet" + desc = "It is decorated with a crate emblem in silver lining. It's rather tough, and just the thing to lie on after a hard day of pushing paper." + icon_state = "sheetqm" + item_color = "qm" + +/obj/item/weapon/bedsheet/brown + icon_state = "sheetbrown" + item_color = "cargo" + +/obj/item/weapon/bedsheet/black + icon_state = "sheetblack" + item_color = "black" + +/obj/item/weapon/bedsheet/centcom + name = "\improper Centcom bedsheet" + desc = "Woven with advanced nanothread for warmth as well as being very decorated, essential for all officials." + icon_state = "sheetcentcom" + item_color = "centcom" + +/obj/item/weapon/bedsheet/syndie + name = "syndicate bedsheet" + desc = "It has a syndicate emblem and it has an aura of evil." + icon_state = "sheetsyndie" + item_color = "syndie" + +/obj/item/weapon/bedsheet/cult + name = "cultist's bedsheet" + desc = "You might dream of Nar'Sie if you sleep with this. It seems rather tattered and glows of an eldritch presence." + icon_state = "sheetcult" + item_color = "cult" + +/obj/item/weapon/bedsheet/wiz + name = "wizard's bedsheet" + desc = "A special fabric enchanted with magic so you can have an enchanted night. It even glows!" + icon_state = "sheetwiz" + item_color = "wiz" + +/obj/item/weapon/bedsheet/nanotrasen + name = "nanotrasen bedsheet" + desc = "It has the Nanotrasen logo on it and has an aura of duty." + icon_state = "sheetNT" + item_color = "nanotrasen" + +/obj/item/weapon/bedsheet/ian + icon_state = "sheetian" + item_color = "ian" + + +/obj/item/weapon/bedsheet/random + icon_state = "sheetrainbow" + item_color = "rainbow" + name = "random bedsheet" + desc = "If you're reading this description ingame, something has gone wrong! Honk!" + +/obj/item/weapon/bedsheet/random/New() + var/obj/item/weapon/bedsheet/B = pick(subtypesof(/obj/item/weapon/bedsheet) - /obj/item/weapon/bedsheet/random) + name = initial(B.name) + desc = initial(B.desc) + icon_state = initial(B.icon_state) + item_state = initial(B.item_state) + item_color = initial(B.item_color) + +/obj/structure/bedsheetbin + name = "linen bin" + desc = "It looks rather cosy." + icon = 'icons/obj/structures.dmi' + icon_state = "linenbin-full" + anchored = 1 + resistance_flags = FLAMMABLE + obj_integrity = 70 + max_integrity = 70 + var/amount = 10 + var/list/sheets = list() + var/obj/item/hidden = null + + +/obj/structure/bedsheetbin/examine(mob/user) + ..() + if(amount < 1) + to_chat(user, "There are no bed sheets in the bin.") + else if(amount == 1) + to_chat(user, "There is one bed sheet in the bin.") + else + to_chat(user, "There are [amount] bed sheets in the bin.") + + +/obj/structure/bedsheetbin/update_icon() + switch(amount) + if(0) + icon_state = "linenbin-empty" + if(1 to 5) + icon_state = "linenbin-half" + else + icon_state = "linenbin-full" + +/obj/structure/bedsheetbin/fire_act(exposed_temperature, exposed_volume) + if(amount) + amount = 0 + update_icon() + ..() + +/obj/structure/bedsheetbin/attackby(obj/item/I, mob/user, params) + if(istype(I, /obj/item/weapon/bedsheet)) + if(!user.drop_item()) + return + I.loc = src + sheets.Add(I) + amount++ + to_chat(user, "You put [I] in [src].") + update_icon() + else if(amount && !hidden && I.w_class < WEIGHT_CLASS_BULKY) //make sure there's sheets to hide it among, make sure nothing else is hidden in there. + if(!user.drop_item()) + to_chat(user, "\The [I] is stuck to your hand, you cannot hide it among the sheets!") + return + I.loc = src + hidden = I + to_chat(user, "You hide [I] among the sheets.") + + + +/obj/structure/bedsheetbin/attack_paw(mob/user) + return attack_hand(user) + + +/obj/structure/bedsheetbin/attack_hand(mob/user) + if(user.lying) + return + if(amount >= 1) + amount-- + + var/obj/item/weapon/bedsheet/B + if(sheets.len > 0) + B = sheets[sheets.len] + sheets.Remove(B) + + else + B = new /obj/item/weapon/bedsheet(loc) + + B.loc = user.loc + user.put_in_hands(B) + to_chat(user, "You take [B] out of [src].") + update_icon() + + if(hidden) + hidden.loc = user.loc + to_chat(user, "[hidden] falls out of [B]!") + hidden = null + + + add_fingerprint(user) +/obj/structure/bedsheetbin/attack_tk(mob/user) + if(amount >= 1) + amount-- + + var/obj/item/weapon/bedsheet/B + if(sheets.len > 0) + B = sheets[sheets.len] + sheets.Remove(B) + + else + B = new /obj/item/weapon/bedsheet(loc) + + B.loc = loc + to_chat(user, "You telekinetically remove [B] from [src].") + update_icon() + + if(hidden) + hidden.loc = loc + hidden = null + + + add_fingerprint(user) diff --git a/code/game/objects/structures/crates_lockers/closets/secure/security.dm b/code/game/objects/structures/crates_lockers/closets/secure/security.dm index eb66e9c9b0..98a52994e9 100644 --- a/code/game/objects/structures/crates_lockers/closets/secure/security.dm +++ b/code/game/objects/structures/crates_lockers/closets/secure/security.dm @@ -1,283 +1,283 @@ -/obj/structure/closet/secure_closet/captains - name = "\proper captain's locker" - req_access = list(GLOB.access_captain) - icon_state = "cap" - -/obj/structure/closet/secure_closet/captains/PopulateContents() - ..() - new /obj/item/clothing/suit/hooded/wintercoat/captain(src) - if(prob(50)) - new /obj/item/weapon/storage/backpack/captain(src) - else - new /obj/item/weapon/storage/backpack/satchel/cap(src) - new /obj/item/clothing/neck/cloak/cap(src) - new /obj/item/weapon/storage/daki(src) - new /obj/item/weapon/storage/backpack/dufflebag/captain(src) - new /obj/item/clothing/head/crown/fancy(src) - new /obj/item/clothing/suit/captunic(src) - new /obj/item/clothing/under/captainparade(src) - new /obj/item/clothing/head/caphat/parade(src) - new /obj/item/clothing/under/rank/captain(src) - new /obj/item/clothing/suit/armor/vest/capcarapace/alt(src) - new /obj/item/weapon/cartridge/captain(src) - new /obj/item/clothing/shoes/sneakers/brown(src) - new /obj/item/weapon/storage/box/silver_ids(src) - new /obj/item/device/radio/headset/heads/captain/alt(src) - new /obj/item/device/radio/headset/heads/captain(src) - new /obj/item/clothing/glasses/sunglasses/gar/supergar(src) - new /obj/item/clothing/gloves/color/captain(src) - new /obj/item/weapon/restraints/handcuffs/cable/zipties(src) - new /obj/item/weapon/storage/belt/sabre(src) - new /obj/item/weapon/gun/energy/e_gun(src) - new /obj/item/weapon/door_remote/captain(src) - -/obj/structure/closet/secure_closet/hop - name = "\proper head of personnel's locker" - req_access = list(GLOB.access_hop) - icon_state = "hop" - -/obj/structure/closet/secure_closet/hop/PopulateContents() - ..() - new /obj/item/clothing/neck/cloak/hop(src) - new /obj/item/clothing/under/rank/head_of_personnel(src) - new /obj/item/clothing/head/hopcap(src) - new /obj/item/weapon/cartridge/hop(src) - new /obj/item/device/radio/headset/heads/hop(src) - new /obj/item/clothing/shoes/sneakers/brown(src) - new /obj/item/weapon/storage/box/ids(src) - new /obj/item/weapon/storage/box/ids(src) - new /obj/item/device/megaphone/command(src) - new /obj/item/clothing/suit/armor/vest/alt(src) - new /obj/item/device/assembly/flash/handheld(src) - new /obj/item/clothing/glasses/sunglasses(src) - new /obj/item/weapon/restraints/handcuffs/cable/zipties(src) - new /obj/item/weapon/gun/energy/e_gun(src) - new /obj/item/clothing/neck/petcollar(src) - new /obj/item/weapon/door_remote/civillian(src) - -/obj/structure/closet/secure_closet/hos - name = "\proper head of security's locker" - req_access = list(GLOB.access_hos) - icon_state = "hos" - -/obj/structure/closet/secure_closet/hos/PopulateContents() - ..() - new /obj/item/clothing/neck/cloak/hos(src) - new /obj/item/weapon/cartridge/hos(src) - new /obj/item/device/radio/headset/heads/hos(src) - new /obj/item/clothing/under/hosparadefem(src) - new /obj/item/clothing/under/hosparademale(src) - new /obj/item/clothing/suit/armor/vest/leather(src) - new /obj/item/clothing/suit/armor/hos(src) - new /obj/item/clothing/under/rank/head_of_security/alt(src) - new /obj/item/clothing/head/HoS(src) - new /obj/item/clothing/glasses/hud/security/sunglasses/eyepatch(src) - new /obj/item/clothing/glasses/hud/security/sunglasses/gars/supergars(src) - new /obj/item/device/megaphone/sec(src) - new /obj/item/weapon/holosign_creator/security(src) - new /obj/item/weapon/storage/lockbox/loyalty(src) - new /obj/item/clothing/mask/gas/sechailer/swat(src) - new /obj/item/weapon/storage/box/flashbangs(src) - new /obj/item/weapon/shield/riot/tele(src) - new /obj/item/weapon/storage/belt/security/full(src) - new /obj/item/weapon/gun/energy/e_gun/hos(src) - new /obj/item/device/flashlight/seclite(src) - new /obj/item/weapon/pinpointer(src) - -/obj/structure/closet/secure_closet/warden - name = "\proper warden's locker" - req_access = list(GLOB.access_armory) - icon_state = "warden" - -/obj/structure/closet/secure_closet/warden/PopulateContents() - ..() - new /obj/item/device/radio/headset/headset_sec(src) - new /obj/item/clothing/suit/armor/vest/warden(src) - new /obj/item/clothing/head/warden(src) - new /obj/item/clothing/head/beret/sec/navywarden(src) - new /obj/item/clothing/suit/armor/vest/warden/alt(src) - new /obj/item/clothing/under/rank/warden/navyblue(src) - new /obj/item/clothing/glasses/hud/security/sunglasses(src) - new /obj/item/weapon/holosign_creator/security(src) - new /obj/item/clothing/mask/gas/sechailer(src) - new /obj/item/weapon/storage/box/zipties(src) - new /obj/item/weapon/storage/box/flashbangs(src) - new /obj/item/weapon/storage/belt/security/full(src) - new /obj/item/device/flashlight/seclite(src) - new /obj/item/clothing/gloves/krav_maga/sec(src) - new /obj/item/weapon/door_remote/head_of_security(src) - new /obj/item/weapon/gun/ballistic/shotgun/automatic/dual_tube(src) - -/obj/structure/closet/secure_closet/security - name = "security officer's locker" - req_access = list(GLOB.access_security) - icon_state = "sec" - -/obj/structure/closet/secure_closet/security/PopulateContents() - ..() - new /obj/item/clothing/suit/armor/vest(src) - new /obj/item/clothing/head/helmet/sec(src) - new /obj/item/device/radio/headset/headset_sec(src) - new /obj/item/device/radio/headset/headset_sec/alt(src) - new /obj/item/clothing/glasses/hud/security/sunglasses(src) - new /obj/item/device/flashlight/seclite(src) - -/obj/structure/closet/secure_closet/security/sec - -/obj/structure/closet/secure_closet/security/sec/PopulateContents() - ..() - new /obj/item/weapon/storage/belt/security/full(src) - -/obj/structure/closet/secure_closet/security/cargo - -/obj/structure/closet/secure_closet/security/cargo/PopulateContents() - ..() - new /obj/item/clothing/tie/armband/cargo(src) - new /obj/item/device/encryptionkey/headset_cargo(src) - -/obj/structure/closet/secure_closet/security/engine - -/obj/structure/closet/secure_closet/security/engine/PopulateContents() - ..() - new /obj/item/clothing/tie/armband/engine(src) - new /obj/item/device/encryptionkey/headset_eng(src) - -/obj/structure/closet/secure_closet/security/science - -/obj/structure/closet/secure_closet/security/science/PopulateContents() - ..() - new /obj/item/clothing/tie/armband/science(src) - new /obj/item/device/encryptionkey/headset_sci(src) - -/obj/structure/closet/secure_closet/security/med - -/obj/structure/closet/secure_closet/security/med/PopulateContents() - ..() - new /obj/item/clothing/tie/armband/medblue(src) - new /obj/item/device/encryptionkey/headset_med(src) - -/obj/structure/closet/secure_closet/detective - name = "\proper detective's cabinet" - req_access = list(GLOB.access_forensics_lockers) - icon_state = "cabinet" - resistance_flags = FLAMMABLE - obj_integrity = 70 - max_integrity = 70 - -/obj/structure/closet/secure_closet/detective/PopulateContents() - ..() - new /obj/item/clothing/under/rank/det(src) - new /obj/item/clothing/suit/det_suit(src) - new /obj/item/clothing/head/det_hat(src) - new /obj/item/clothing/gloves/color/black(src) - new /obj/item/clothing/under/rank/det/grey(src) - new /obj/item/clothing/tie/waistcoat(src) - new /obj/item/clothing/suit/det_suit/grey(src) - new /obj/item/clothing/head/fedora(src) - new /obj/item/clothing/shoes/laceup(src) - new /obj/item/weapon/storage/box/evidence(src) - new /obj/item/device/radio/headset/headset_sec(src) - new /obj/item/device/detective_scanner(src) - new /obj/item/device/flashlight/seclite(src) - new /obj/item/weapon/holosign_creator/security(src) - new /obj/item/weapon/reagent_containers/spray/pepper(src) - new /obj/item/clothing/suit/armor/vest/det_suit(src) - new /obj/item/weapon/storage/belt/holster/full(src) - -/obj/structure/closet/secure_closet/injection - name = "lethal injections" - req_access = list(GLOB.access_hos) - -/obj/structure/closet/secure_closet/injection/PopulateContents() - ..() - for(var/i in 1 to 5) - new /obj/item/weapon/reagent_containers/syringe/lethal/execution(src) - -/obj/structure/closet/secure_closet/brig - name = "brig locker" - req_access = list(GLOB.access_brig) - anchored = 1 - var/id = null - -/obj/structure/closet/secure_closet/brig/PopulateContents() - ..() - new /obj/item/clothing/under/rank/prisoner( src ) - new /obj/item/clothing/shoes/sneakers/orange( src ) - -/obj/structure/closet/secure_closet/courtroom - name = "courtroom locker" - req_access = list(GLOB.access_court) - -/obj/structure/closet/secure_closet/courtroom/PopulateContents() - ..() - new /obj/item/clothing/shoes/sneakers/brown(src) - for(var/i in 1 to 3) - new /obj/item/weapon/paper/Court (src) - new /obj/item/weapon/pen (src) - new /obj/item/clothing/suit/judgerobe (src) - new /obj/item/clothing/head/powdered_wig (src) - new /obj/item/weapon/storage/briefcase(src) - -/obj/structure/closet/secure_closet/armory1 - name = "armory armor locker" - req_access = list(GLOB.access_armory) - icon_state = "armory" - -/obj/structure/closet/secure_closet/armory1/PopulateContents() - ..() - new /obj/item/clothing/suit/armor/laserproof(src) - for(var/i in 1 to 3) - new /obj/item/clothing/suit/armor/riot(src) - for(var/i in 1 to 3) - new /obj/item/clothing/head/helmet/riot(src) - for(var/i in 1 to 3) - new /obj/item/weapon/shield/riot(src) - -/obj/structure/closet/secure_closet/armory2 - name = "armory ballistics locker" - req_access = list(GLOB.access_armory) - icon_state = "armory" - -/obj/structure/closet/secure_closet/armory2/PopulateContents() - ..() - new /obj/item/weapon/storage/box/firingpins(src) - for(var/i in 1 to 3) - new /obj/item/weapon/storage/box/rubbershot(src) - for(var/i in 1 to 3) - new /obj/item/weapon/gun/ballistic/shotgun/riot(src) - -/obj/structure/closet/secure_closet/armory3 - name = "armory energy gun locker" - req_access = list(GLOB.access_armory) - icon_state = "armory" - -/obj/structure/closet/secure_closet/armory3/PopulateContents() - ..() - new /obj/item/weapon/storage/box/firingpins(src) - new /obj/item/weapon/gun/energy/ionrifle(src) - for(var/i in 1 to 3) - new /obj/item/weapon/gun/energy/e_gun(src) - for(var/i in 1 to 3) - new /obj/item/weapon/gun/energy/laser(src) - -/obj/structure/closet/secure_closet/tac - name = "armory tac locker" - req_access = list(GLOB.access_armory) - icon_state = "tac" - -/obj/structure/closet/secure_closet/tac/PopulateContents() - ..() - new /obj/item/weapon/gun/ballistic/automatic/wt550(src) - new /obj/item/clothing/head/helmet/alt(src) - new /obj/item/clothing/mask/gas/sechailer(src) - new /obj/item/clothing/suit/armor/bulletproof(src) - -/obj/structure/closet/secure_closet/lethalshots - name = "shotgun lethal rounds" - req_access = list(GLOB.access_armory) - icon_state = "tac" - -/obj/structure/closet/secure_closet/lethalshots/PopulateContents() - ..() - for(var/i in 1 to 3) - new /obj/item/weapon/storage/box/lethalshot(src) +/obj/structure/closet/secure_closet/captains + name = "\proper captain's locker" + req_access = list(GLOB.access_captain) + icon_state = "cap" + +/obj/structure/closet/secure_closet/captains/PopulateContents() + ..() + new /obj/item/clothing/suit/hooded/wintercoat/captain(src) + if(prob(50)) + new /obj/item/weapon/storage/backpack/captain(src) + else + new /obj/item/weapon/storage/backpack/satchel/cap(src) + new /obj/item/clothing/neck/cloak/cap(src) + new /obj/item/weapon/storage/daki(src) + new /obj/item/weapon/storage/backpack/dufflebag/captain(src) + new /obj/item/clothing/head/crown/fancy(src) + new /obj/item/clothing/suit/captunic(src) + new /obj/item/clothing/under/captainparade(src) + new /obj/item/clothing/head/caphat/parade(src) + new /obj/item/clothing/under/rank/captain(src) + new /obj/item/clothing/suit/armor/vest/capcarapace/alt(src) + new /obj/item/weapon/cartridge/captain(src) + new /obj/item/clothing/shoes/sneakers/brown(src) + new /obj/item/weapon/storage/box/silver_ids(src) + new /obj/item/device/radio/headset/heads/captain/alt(src) + new /obj/item/device/radio/headset/heads/captain(src) + new /obj/item/clothing/glasses/sunglasses/gar/supergar(src) + new /obj/item/clothing/gloves/color/captain(src) + new /obj/item/weapon/restraints/handcuffs/cable/zipties(src) + new /obj/item/weapon/storage/belt/sabre(src) + new /obj/item/weapon/gun/energy/e_gun(src) + new /obj/item/weapon/door_remote/captain(src) + +/obj/structure/closet/secure_closet/hop + name = "\proper head of personnel's locker" + req_access = list(GLOB.access_hop) + icon_state = "hop" + +/obj/structure/closet/secure_closet/hop/PopulateContents() + ..() + new /obj/item/clothing/neck/cloak/hop(src) + new /obj/item/clothing/under/rank/head_of_personnel(src) + new /obj/item/clothing/head/hopcap(src) + new /obj/item/weapon/cartridge/hop(src) + new /obj/item/device/radio/headset/heads/hop(src) + new /obj/item/clothing/shoes/sneakers/brown(src) + new /obj/item/weapon/storage/box/ids(src) + new /obj/item/weapon/storage/box/ids(src) + new /obj/item/device/megaphone/command(src) + new /obj/item/clothing/suit/armor/vest/alt(src) + new /obj/item/device/assembly/flash/handheld(src) + new /obj/item/clothing/glasses/sunglasses(src) + new /obj/item/weapon/restraints/handcuffs/cable/zipties(src) + new /obj/item/weapon/gun/energy/e_gun(src) + new /obj/item/clothing/neck/petcollar(src) + new /obj/item/weapon/door_remote/civillian(src) + +/obj/structure/closet/secure_closet/hos + name = "\proper head of security's locker" + req_access = list(GLOB.access_hos) + icon_state = "hos" + +/obj/structure/closet/secure_closet/hos/PopulateContents() + ..() + new /obj/item/clothing/neck/cloak/hos(src) + new /obj/item/weapon/cartridge/hos(src) + new /obj/item/device/radio/headset/heads/hos(src) + new /obj/item/clothing/under/hosparadefem(src) + new /obj/item/clothing/under/hosparademale(src) + new /obj/item/clothing/suit/armor/vest/leather(src) + new /obj/item/clothing/suit/armor/hos(src) + new /obj/item/clothing/under/rank/head_of_security/alt(src) + new /obj/item/clothing/head/HoS(src) + new /obj/item/clothing/glasses/hud/security/sunglasses/eyepatch(src) + new /obj/item/clothing/glasses/hud/security/sunglasses/gars/supergars(src) + new /obj/item/device/megaphone/sec(src) + new /obj/item/weapon/holosign_creator/security(src) + new /obj/item/weapon/storage/lockbox/loyalty(src) + new /obj/item/clothing/mask/gas/sechailer/swat(src) + new /obj/item/weapon/storage/box/flashbangs(src) + new /obj/item/weapon/shield/riot/tele(src) + new /obj/item/weapon/storage/belt/security/full(src) + new /obj/item/weapon/gun/energy/e_gun/hos(src) + new /obj/item/device/flashlight/seclite(src) + new /obj/item/weapon/pinpointer(src) + +/obj/structure/closet/secure_closet/warden + name = "\proper warden's locker" + req_access = list(GLOB.access_armory) + icon_state = "warden" + +/obj/structure/closet/secure_closet/warden/PopulateContents() + ..() + new /obj/item/device/radio/headset/headset_sec(src) + new /obj/item/clothing/suit/armor/vest/warden(src) + new /obj/item/clothing/head/warden(src) + new /obj/item/clothing/head/beret/sec/navywarden(src) + new /obj/item/clothing/suit/armor/vest/warden/alt(src) + new /obj/item/clothing/under/rank/warden/navyblue(src) + new /obj/item/clothing/glasses/hud/security/sunglasses(src) + new /obj/item/weapon/holosign_creator/security(src) + new /obj/item/clothing/mask/gas/sechailer(src) + new /obj/item/weapon/storage/box/zipties(src) + new /obj/item/weapon/storage/box/flashbangs(src) + new /obj/item/weapon/storage/belt/security/full(src) + new /obj/item/device/flashlight/seclite(src) + new /obj/item/clothing/gloves/krav_maga/sec(src) + new /obj/item/weapon/door_remote/head_of_security(src) + new /obj/item/weapon/gun/ballistic/shotgun/automatic/dual_tube(src) + +/obj/structure/closet/secure_closet/security + name = "security officer's locker" + req_access = list(GLOB.access_security) + icon_state = "sec" + +/obj/structure/closet/secure_closet/security/PopulateContents() + ..() + new /obj/item/clothing/suit/armor/vest(src) + new /obj/item/clothing/head/helmet/sec(src) + new /obj/item/device/radio/headset/headset_sec(src) + new /obj/item/device/radio/headset/headset_sec/alt(src) + new /obj/item/clothing/glasses/hud/security/sunglasses(src) + new /obj/item/device/flashlight/seclite(src) + +/obj/structure/closet/secure_closet/security/sec + +/obj/structure/closet/secure_closet/security/sec/PopulateContents() + ..() + new /obj/item/weapon/storage/belt/security/full(src) + +/obj/structure/closet/secure_closet/security/cargo + +/obj/structure/closet/secure_closet/security/cargo/PopulateContents() + ..() + new /obj/item/clothing/tie/armband/cargo(src) + new /obj/item/device/encryptionkey/headset_cargo(src) + +/obj/structure/closet/secure_closet/security/engine + +/obj/structure/closet/secure_closet/security/engine/PopulateContents() + ..() + new /obj/item/clothing/tie/armband/engine(src) + new /obj/item/device/encryptionkey/headset_eng(src) + +/obj/structure/closet/secure_closet/security/science + +/obj/structure/closet/secure_closet/security/science/PopulateContents() + ..() + new /obj/item/clothing/tie/armband/science(src) + new /obj/item/device/encryptionkey/headset_sci(src) + +/obj/structure/closet/secure_closet/security/med + +/obj/structure/closet/secure_closet/security/med/PopulateContents() + ..() + new /obj/item/clothing/tie/armband/medblue(src) + new /obj/item/device/encryptionkey/headset_med(src) + +/obj/structure/closet/secure_closet/detective + name = "\proper detective's cabinet" + req_access = list(GLOB.access_forensics_lockers) + icon_state = "cabinet" + resistance_flags = FLAMMABLE + obj_integrity = 70 + max_integrity = 70 + +/obj/structure/closet/secure_closet/detective/PopulateContents() + ..() + new /obj/item/clothing/under/rank/det(src) + new /obj/item/clothing/suit/det_suit(src) + new /obj/item/clothing/head/det_hat(src) + new /obj/item/clothing/gloves/color/black(src) + new /obj/item/clothing/under/rank/det/grey(src) + new /obj/item/clothing/tie/waistcoat(src) + new /obj/item/clothing/suit/det_suit/grey(src) + new /obj/item/clothing/head/fedora(src) + new /obj/item/clothing/shoes/laceup(src) + new /obj/item/weapon/storage/box/evidence(src) + new /obj/item/device/radio/headset/headset_sec(src) + new /obj/item/device/detective_scanner(src) + new /obj/item/device/flashlight/seclite(src) + new /obj/item/weapon/holosign_creator/security(src) + new /obj/item/weapon/reagent_containers/spray/pepper(src) + new /obj/item/clothing/suit/armor/vest/det_suit(src) + new /obj/item/weapon/storage/belt/holster/full(src) + +/obj/structure/closet/secure_closet/injection + name = "lethal injections" + req_access = list(GLOB.access_hos) + +/obj/structure/closet/secure_closet/injection/PopulateContents() + ..() + for(var/i in 1 to 5) + new /obj/item/weapon/reagent_containers/syringe/lethal/execution(src) + +/obj/structure/closet/secure_closet/brig + name = "brig locker" + req_access = list(GLOB.access_brig) + anchored = 1 + var/id = null + +/obj/structure/closet/secure_closet/brig/PopulateContents() + ..() + new /obj/item/clothing/under/rank/prisoner( src ) + new /obj/item/clothing/shoes/sneakers/orange( src ) + +/obj/structure/closet/secure_closet/courtroom + name = "courtroom locker" + req_access = list(GLOB.access_court) + +/obj/structure/closet/secure_closet/courtroom/PopulateContents() + ..() + new /obj/item/clothing/shoes/sneakers/brown(src) + for(var/i in 1 to 3) + new /obj/item/weapon/paper/Court (src) + new /obj/item/weapon/pen (src) + new /obj/item/clothing/suit/judgerobe (src) + new /obj/item/clothing/head/powdered_wig (src) + new /obj/item/weapon/storage/briefcase(src) + +/obj/structure/closet/secure_closet/armory1 + name = "armory armor locker" + req_access = list(GLOB.access_armory) + icon_state = "armory" + +/obj/structure/closet/secure_closet/armory1/PopulateContents() + ..() + new /obj/item/clothing/suit/armor/laserproof(src) + for(var/i in 1 to 3) + new /obj/item/clothing/suit/armor/riot(src) + for(var/i in 1 to 3) + new /obj/item/clothing/head/helmet/riot(src) + for(var/i in 1 to 3) + new /obj/item/weapon/shield/riot(src) + +/obj/structure/closet/secure_closet/armory2 + name = "armory ballistics locker" + req_access = list(GLOB.access_armory) + icon_state = "armory" + +/obj/structure/closet/secure_closet/armory2/PopulateContents() + ..() + new /obj/item/weapon/storage/box/firingpins(src) + for(var/i in 1 to 3) + new /obj/item/weapon/storage/box/rubbershot(src) + for(var/i in 1 to 3) + new /obj/item/weapon/gun/ballistic/shotgun/riot(src) + +/obj/structure/closet/secure_closet/armory3 + name = "armory energy gun locker" + req_access = list(GLOB.access_armory) + icon_state = "armory" + +/obj/structure/closet/secure_closet/armory3/PopulateContents() + ..() + new /obj/item/weapon/storage/box/firingpins(src) + new /obj/item/weapon/gun/energy/ionrifle(src) + for(var/i in 1 to 3) + new /obj/item/weapon/gun/energy/e_gun(src) + for(var/i in 1 to 3) + new /obj/item/weapon/gun/energy/laser(src) + +/obj/structure/closet/secure_closet/tac + name = "armory tac locker" + req_access = list(GLOB.access_armory) + icon_state = "tac" + +/obj/structure/closet/secure_closet/tac/PopulateContents() + ..() + new /obj/item/weapon/gun/ballistic/automatic/wt550(src) + new /obj/item/clothing/head/helmet/alt(src) + new /obj/item/clothing/mask/gas/sechailer(src) + new /obj/item/clothing/suit/armor/bulletproof(src) + +/obj/structure/closet/secure_closet/lethalshots + name = "shotgun lethal rounds" + req_access = list(GLOB.access_armory) + icon_state = "tac" + +/obj/structure/closet/secure_closet/lethalshots/PopulateContents() + ..() + for(var/i in 1 to 3) + new /obj/item/weapon/storage/box/lethalshot(src) diff --git a/code/game/objects/structures/mineral_doors.dm b/code/game/objects/structures/mineral_doors.dm index ada75846e7..4c57c55e6a 100644 --- a/code/game/objects/structures/mineral_doors.dm +++ b/code/game/objects/structures/mineral_doors.dm @@ -1,221 +1,221 @@ -//NOT using the existing /obj/machinery/door type, since that has some complications on its own, mainly based on its -//machineryness - -/obj/structure/mineral_door - name = "metal door" - density = 1 - anchored = 1 - opacity = 1 - - icon = 'icons/obj/doors/mineral_doors.dmi' - icon_state = "metal" - - var/initial_state - var/state = 0 //closed, 1 == open - var/isSwitchingStates = 0 - var/close_delay = -1 //-1 if does not auto close. - obj_integrity = 200 - max_integrity = 200 - armor = list(melee = 10, bullet = 0, laser = 0, energy = 100, bomb = 10, bio = 100, rad = 100, fire = 50, acid = 50) - var/sheetType = /obj/item/stack/sheet/metal - var/sheetAmount = 7 - var/openSound = 'sound/effects/stonedoor_openclose.ogg' - var/closeSound = 'sound/effects/stonedoor_openclose.ogg' - CanAtmosPass = ATMOS_PASS_DENSITY - -/obj/structure/mineral_door/New(location) - ..() - initial_state = icon_state - air_update_turf(1) - -/obj/structure/mineral_door/Destroy() - density = 0 - air_update_turf(1) - return ..() - -/obj/structure/mineral_door/Move() - var/turf/T = loc - ..() - move_update_air(T) - -/obj/structure/mineral_door/Bumped(atom/user) - ..() - if(!state) - return TryToSwitchState(user) - -/obj/structure/mineral_door/attack_ai(mob/user) //those aren't machinery, they're just big fucking slabs of a mineral - if(isAI(user)) //so the AI can't open it - return - else if(iscyborg(user)) //but cyborgs can - if(get_dist(user,src) <= 1) //not remotely though - return TryToSwitchState(user) - -/obj/structure/mineral_door/attack_paw(mob/user) - return TryToSwitchState(user) - -/obj/structure/mineral_door/attack_hand(mob/user) - return TryToSwitchState(user) - -/obj/structure/mineral_door/CanPass(atom/movable/mover, turf/target, height=0) - if(istype(mover, /obj/effect/beam)) - return !opacity - return !density - -/obj/structure/mineral_door/proc/TryToSwitchState(atom/user) - if(isSwitchingStates) - return - if(isliving(user)) - var/mob/living/M = user - if(world.time - M.last_bumped <= 60) - return //NOTE do we really need that? - if(M.client) - if(iscarbon(M)) - var/mob/living/carbon/C = M - if(!C.handcuffed) - SwitchState() - else - SwitchState() - else if(istype(user, /obj/mecha)) - SwitchState() - -/obj/structure/mineral_door/proc/SwitchState() - if(state) - Close() - else - Open() - -/obj/structure/mineral_door/proc/Open() - isSwitchingStates = 1 - playsound(loc, openSound, 100, 1) - flick("[initial_state]opening",src) - sleep(10) - density = 0 - opacity = 0 - state = 1 - air_update_turf(1) - update_icon() - isSwitchingStates = 0 - - if(close_delay != -1) - addtimer(CALLBACK(src, .proc/Close), close_delay) - -/obj/structure/mineral_door/proc/Close() - if(isSwitchingStates || state != 1) - return - var/turf/T = get_turf(src) - for(var/mob/living/L in T) - return - isSwitchingStates = 1 - playsound(loc, closeSound, 100, 1) - flick("[initial_state]closing",src) - sleep(10) - density = 1 - opacity = 1 - state = 0 - air_update_turf(1) - update_icon() - isSwitchingStates = 0 - -/obj/structure/mineral_door/update_icon() - if(state) - icon_state = "[initial_state]open" - else - icon_state = initial_state - -/obj/structure/mineral_door/attackby(obj/item/weapon/W, mob/user, params) - if(istype(W,/obj/item/weapon/pickaxe)) - var/obj/item/weapon/pickaxe/digTool = W - to_chat(user, "You start digging the [name]...") - if(do_after(user,digTool.digspeed*(1+round(max_integrity*0.01)), target = src) && src) - to_chat(user, "You finish digging.") - deconstruct(TRUE) - else if(user.a_intent != INTENT_HARM) - attack_hand(user) - else - return ..() - -/obj/structure/mineral_door/deconstruct(disassembled = TRUE) - var/turf/T = get_turf(src) - if(disassembled) - new sheetType(T, sheetAmount) - else - new sheetType(T, max(sheetAmount - 2, 1)) - qdel(src) - -/obj/structure/mineral_door/iron - name = "iron door" - obj_integrity = 300 - max_integrity = 300 - -/obj/structure/mineral_door/silver - name = "silver door" - icon_state = "silver" - sheetType = /obj/item/stack/sheet/mineral/silver - obj_integrity = 300 - max_integrity = 300 - -/obj/structure/mineral_door/gold - name = "gold door" - icon_state = "gold" - sheetType = /obj/item/stack/sheet/mineral/gold - -/obj/structure/mineral_door/uranium - name = "uranium door" - icon_state = "uranium" - sheetType = /obj/item/stack/sheet/mineral/uranium - obj_integrity = 300 - max_integrity = 300 - light_range = 2 - -/obj/structure/mineral_door/sandstone - name = "sandstone door" - icon_state = "sandstone" - sheetType = /obj/item/stack/sheet/mineral/sandstone - obj_integrity = 100 - max_integrity = 100 - -/obj/structure/mineral_door/transparent - opacity = 0 - -/obj/structure/mineral_door/transparent/Close() - ..() - opacity = 0 - -/obj/structure/mineral_door/transparent/plasma - name = "plasma door" - icon_state = "plasma" - sheetType = /obj/item/stack/sheet/mineral/plasma - -/obj/structure/mineral_door/transparent/plasma/attackby(obj/item/weapon/W, mob/user, params) - if(W.is_hot()) - var/turf/T = get_turf(src) - message_admins("Plasma mineral door ignited by [ADMIN_LOOKUPFLW(user)] in [ADMIN_COORDJMP(T)]",0,1) - log_game("Plasma mineral door ignited by [key_name(user)] in [COORD(T)]") - TemperatureAct() - else - return ..() - -/obj/structure/mineral_door/transparent/plasma/temperature_expose(datum/gas_mixture/air, exposed_temperature, exposed_volume) - if(exposed_temperature > 300) - TemperatureAct() - -/obj/structure/mineral_door/transparent/plasma/proc/TemperatureAct() - atmos_spawn_air("plasma=500;TEMP=1000") - deconstruct(FALSE) - -/obj/structure/mineral_door/transparent/diamond - name = "diamond door" - icon_state = "diamond" - sheetType = /obj/item/stack/sheet/mineral/diamond - obj_integrity = 1000 - max_integrity = 1000 - -/obj/structure/mineral_door/wood - name = "wood door" - icon_state = "wood" - openSound = 'sound/effects/doorcreaky.ogg' - closeSound = 'sound/effects/doorcreaky.ogg' - sheetType = /obj/item/stack/sheet/mineral/wood - resistance_flags = FLAMMABLE - obj_integrity = 200 - max_integrity = 200 +//NOT using the existing /obj/machinery/door type, since that has some complications on its own, mainly based on its +//machineryness + +/obj/structure/mineral_door + name = "metal door" + density = 1 + anchored = 1 + opacity = 1 + + icon = 'icons/obj/doors/mineral_doors.dmi' + icon_state = "metal" + + var/initial_state + var/state = 0 //closed, 1 == open + var/isSwitchingStates = 0 + var/close_delay = -1 //-1 if does not auto close. + obj_integrity = 200 + max_integrity = 200 + armor = list(melee = 10, bullet = 0, laser = 0, energy = 100, bomb = 10, bio = 100, rad = 100, fire = 50, acid = 50) + var/sheetType = /obj/item/stack/sheet/metal + var/sheetAmount = 7 + var/openSound = 'sound/effects/stonedoor_openclose.ogg' + var/closeSound = 'sound/effects/stonedoor_openclose.ogg' + CanAtmosPass = ATMOS_PASS_DENSITY + +/obj/structure/mineral_door/New(location) + ..() + initial_state = icon_state + air_update_turf(1) + +/obj/structure/mineral_door/Destroy() + density = 0 + air_update_turf(1) + return ..() + +/obj/structure/mineral_door/Move() + var/turf/T = loc + ..() + move_update_air(T) + +/obj/structure/mineral_door/Bumped(atom/user) + ..() + if(!state) + return TryToSwitchState(user) + +/obj/structure/mineral_door/attack_ai(mob/user) //those aren't machinery, they're just big fucking slabs of a mineral + if(isAI(user)) //so the AI can't open it + return + else if(iscyborg(user)) //but cyborgs can + if(get_dist(user,src) <= 1) //not remotely though + return TryToSwitchState(user) + +/obj/structure/mineral_door/attack_paw(mob/user) + return TryToSwitchState(user) + +/obj/structure/mineral_door/attack_hand(mob/user) + return TryToSwitchState(user) + +/obj/structure/mineral_door/CanPass(atom/movable/mover, turf/target, height=0) + if(istype(mover, /obj/effect/beam)) + return !opacity + return !density + +/obj/structure/mineral_door/proc/TryToSwitchState(atom/user) + if(isSwitchingStates) + return + if(isliving(user)) + var/mob/living/M = user + if(world.time - M.last_bumped <= 60) + return //NOTE do we really need that? + if(M.client) + if(iscarbon(M)) + var/mob/living/carbon/C = M + if(!C.handcuffed) + SwitchState() + else + SwitchState() + else if(istype(user, /obj/mecha)) + SwitchState() + +/obj/structure/mineral_door/proc/SwitchState() + if(state) + Close() + else + Open() + +/obj/structure/mineral_door/proc/Open() + isSwitchingStates = 1 + playsound(loc, openSound, 100, 1) + flick("[initial_state]opening",src) + sleep(10) + density = 0 + opacity = 0 + state = 1 + air_update_turf(1) + update_icon() + isSwitchingStates = 0 + + if(close_delay != -1) + addtimer(CALLBACK(src, .proc/Close), close_delay) + +/obj/structure/mineral_door/proc/Close() + if(isSwitchingStates || state != 1) + return + var/turf/T = get_turf(src) + for(var/mob/living/L in T) + return + isSwitchingStates = 1 + playsound(loc, closeSound, 100, 1) + flick("[initial_state]closing",src) + sleep(10) + density = 1 + opacity = 1 + state = 0 + air_update_turf(1) + update_icon() + isSwitchingStates = 0 + +/obj/structure/mineral_door/update_icon() + if(state) + icon_state = "[initial_state]open" + else + icon_state = initial_state + +/obj/structure/mineral_door/attackby(obj/item/weapon/W, mob/user, params) + if(istype(W,/obj/item/weapon/pickaxe)) + var/obj/item/weapon/pickaxe/digTool = W + to_chat(user, "You start digging the [name]...") + if(do_after(user,digTool.digspeed*(1+round(max_integrity*0.01)), target = src) && src) + to_chat(user, "You finish digging.") + deconstruct(TRUE) + else if(user.a_intent != INTENT_HARM) + attack_hand(user) + else + return ..() + +/obj/structure/mineral_door/deconstruct(disassembled = TRUE) + var/turf/T = get_turf(src) + if(disassembled) + new sheetType(T, sheetAmount) + else + new sheetType(T, max(sheetAmount - 2, 1)) + qdel(src) + +/obj/structure/mineral_door/iron + name = "iron door" + obj_integrity = 300 + max_integrity = 300 + +/obj/structure/mineral_door/silver + name = "silver door" + icon_state = "silver" + sheetType = /obj/item/stack/sheet/mineral/silver + obj_integrity = 300 + max_integrity = 300 + +/obj/structure/mineral_door/gold + name = "gold door" + icon_state = "gold" + sheetType = /obj/item/stack/sheet/mineral/gold + +/obj/structure/mineral_door/uranium + name = "uranium door" + icon_state = "uranium" + sheetType = /obj/item/stack/sheet/mineral/uranium + obj_integrity = 300 + max_integrity = 300 + light_range = 2 + +/obj/structure/mineral_door/sandstone + name = "sandstone door" + icon_state = "sandstone" + sheetType = /obj/item/stack/sheet/mineral/sandstone + obj_integrity = 100 + max_integrity = 100 + +/obj/structure/mineral_door/transparent + opacity = 0 + +/obj/structure/mineral_door/transparent/Close() + ..() + opacity = 0 + +/obj/structure/mineral_door/transparent/plasma + name = "plasma door" + icon_state = "plasma" + sheetType = /obj/item/stack/sheet/mineral/plasma + +/obj/structure/mineral_door/transparent/plasma/attackby(obj/item/weapon/W, mob/user, params) + if(W.is_hot()) + var/turf/T = get_turf(src) + message_admins("Plasma mineral door ignited by [ADMIN_LOOKUPFLW(user)] in [ADMIN_COORDJMP(T)]",0,1) + log_game("Plasma mineral door ignited by [key_name(user)] in [COORD(T)]") + TemperatureAct() + else + return ..() + +/obj/structure/mineral_door/transparent/plasma/temperature_expose(datum/gas_mixture/air, exposed_temperature, exposed_volume) + if(exposed_temperature > 300) + TemperatureAct() + +/obj/structure/mineral_door/transparent/plasma/proc/TemperatureAct() + atmos_spawn_air("plasma=500;TEMP=1000") + deconstruct(FALSE) + +/obj/structure/mineral_door/transparent/diamond + name = "diamond door" + icon_state = "diamond" + sheetType = /obj/item/stack/sheet/mineral/diamond + obj_integrity = 1000 + max_integrity = 1000 + +/obj/structure/mineral_door/wood + name = "wood door" + icon_state = "wood" + openSound = 'sound/effects/doorcreaky.ogg' + closeSound = 'sound/effects/doorcreaky.ogg' + sheetType = /obj/item/stack/sheet/mineral/wood + resistance_flags = FLAMMABLE + obj_integrity = 200 + max_integrity = 200 diff --git a/code/modules/admin/verbs/randomverbs.dm b/code/modules/admin/verbs/randomverbs.dm index 6ead5a263e..b82d1f65e2 100644 --- a/code/modules/admin/verbs/randomverbs.dm +++ b/code/modules/admin/verbs/randomverbs.dm @@ -387,8 +387,8 @@ Traitors and the like can also be revived with the previous role mostly intact. for(var/obj/effect/landmark/L in GLOB.landmarks_list) if(L.name=="carpspawn") ninja_spawn += L - var/datum/antagonist/ninja/ninjadatum = new_character.mind.has_antag_datum(ANTAG_DATUM_NINJA) - ninjadatum.equip_space_ninja() + var/datum/antagonist/ninja/ninjadatum = new_character.mind.has_antag_datum(ANTAG_DATUM_NINJA) + ninjadatum.equip_space_ninja() if(ninja_spawn.len) var/obj/effect/landmark/ninja_spawn_here = pick(ninja_spawn) new_character.loc = ninja_spawn_here.loc @@ -586,7 +586,7 @@ Traitors and the like can also be revived with the previous role mostly intact. empulse(O, heavy, light) log_admin("[key_name(usr)] created an EM Pulse ([heavy],[light]) at ([O.x],[O.y],[O.z])") - message_admins("[key_name_admin(usr)] created an EM Pulse ([heavy],[light]) at ([O.x],[O.y],[O.z])") + message_admins("[key_name_admin(usr)] created an EM Pulse ([heavy],[light]) at ([O.x],[O.y],[O.z])") SSblackbox.add_details("admin_verb","EM Pulse") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! return diff --git a/code/modules/assembly/timer.dm b/code/modules/assembly/timer.dm index 44c77bb19a..d8c6427477 100644 --- a/code/modules/assembly/timer.dm +++ b/code/modules/assembly/timer.dm @@ -1,115 +1,115 @@ -/obj/item/device/assembly/timer - name = "timer" - desc = "Used to time things. Works well with contraptions which has to count down. Tick tock." - icon_state = "timer" - materials = list(MAT_METAL=500, MAT_GLASS=50) - origin_tech = "magnets=1;engineering=1" - attachable = 1 - - var/timing = 0 - var/time = 5 - var/saved_time = 5 - var/loop = 0 - - -/obj/item/device/assembly/timer/New() - ..() - START_PROCESSING(SSobj, src) - -/obj/item/device/assembly/timer/describe() - if(timing) - return "The timer is counting down from [time]!" - return "The timer is set for [time] seconds." - - -/obj/item/device/assembly/timer/activate() - if(!..()) - return 0//Cooldown check - timing = !timing - update_icon() - return 1 - - -/obj/item/device/assembly/timer/toggle_secure() - secured = !secured - if(secured) - START_PROCESSING(SSobj, src) - else - timing = 0 - STOP_PROCESSING(SSobj, src) - update_icon() - return secured - - -/obj/item/device/assembly/timer/proc/timer_end() - if(!secured || next_activate > world.time) - return FALSE - pulse(0) - audible_message("\icon[src] *beep* *beep*", null, 3) - if(loop) - timing = 1 - update_icon() - - -/obj/item/device/assembly/timer/process() - if(timing) - time-- - if(time <= 0) - timing = 0 - timer_end() - time = saved_time - - -/obj/item/device/assembly/timer/update_icon() - cut_overlays() - attached_overlays = list() - if(timing) - add_overlay("timer_timing") - attached_overlays += "timer_timing" - if(holder) - holder.update_icon() - - -/obj/item/device/assembly/timer/interact(mob/user)//TODO: Have this use the wires - if(is_secured(user)) - var/second = time % 60 - var/minute = (time - second) / 60 - var/dat = "Timing Unit\n[(timing ? "Timing" : "Not Timing")] [minute]:[second]\n- - + +\n" - dat += "

Stop repeating" : "1'>Set to repeat")]" - dat += "

Refresh" - dat += "

Close" - var/datum/browser/popup = new(user, "timer", name) - popup.set_content(dat) - popup.open() - - -/obj/item/device/assembly/timer/Topic(href, href_list) - ..() - if(usr.incapacitated() || !in_range(loc, usr)) - usr << browse(null, "window=timer") - onclose(usr, "timer") - return - - if(href_list["time"]) - timing = text2num(href_list["time"]) - if(timing && istype(holder, /obj/item/device/transfer_valve)) - var/timer_message = "[ADMIN_LOOKUPFLW(usr)] activated [src] attachment on [holder]." - message_admins(timer_message) - GLOB.bombers += timer_message - log_game("[key_name(usr)] activated [src] attachment on [holder]") - update_icon() - if(href_list["repeat"]) - loop = text2num(href_list["repeat"]) - - if(href_list["tp"]) - var/tp = text2num(href_list["tp"]) - time += tp - time = min(max(round(time), 1), 600) - saved_time = time - - if(href_list["close"]) - usr << browse(null, "window=timer") - return - - if(usr) - attack_self(usr) +/obj/item/device/assembly/timer + name = "timer" + desc = "Used to time things. Works well with contraptions which has to count down. Tick tock." + icon_state = "timer" + materials = list(MAT_METAL=500, MAT_GLASS=50) + origin_tech = "magnets=1;engineering=1" + attachable = 1 + + var/timing = 0 + var/time = 5 + var/saved_time = 5 + var/loop = 0 + + +/obj/item/device/assembly/timer/New() + ..() + START_PROCESSING(SSobj, src) + +/obj/item/device/assembly/timer/describe() + if(timing) + return "The timer is counting down from [time]!" + return "The timer is set for [time] seconds." + + +/obj/item/device/assembly/timer/activate() + if(!..()) + return 0//Cooldown check + timing = !timing + update_icon() + return 1 + + +/obj/item/device/assembly/timer/toggle_secure() + secured = !secured + if(secured) + START_PROCESSING(SSobj, src) + else + timing = 0 + STOP_PROCESSING(SSobj, src) + update_icon() + return secured + + +/obj/item/device/assembly/timer/proc/timer_end() + if(!secured || next_activate > world.time) + return FALSE + pulse(0) + audible_message("\icon[src] *beep* *beep*", null, 3) + if(loop) + timing = 1 + update_icon() + + +/obj/item/device/assembly/timer/process() + if(timing) + time-- + if(time <= 0) + timing = 0 + timer_end() + time = saved_time + + +/obj/item/device/assembly/timer/update_icon() + cut_overlays() + attached_overlays = list() + if(timing) + add_overlay("timer_timing") + attached_overlays += "timer_timing" + if(holder) + holder.update_icon() + + +/obj/item/device/assembly/timer/interact(mob/user)//TODO: Have this use the wires + if(is_secured(user)) + var/second = time % 60 + var/minute = (time - second) / 60 + var/dat = "Timing Unit\n[(timing ? "Timing" : "Not Timing")] [minute]:[second]\n- - + +\n" + dat += "

Stop repeating" : "1'>Set to repeat")]" + dat += "

Refresh" + dat += "

Close" + var/datum/browser/popup = new(user, "timer", name) + popup.set_content(dat) + popup.open() + + +/obj/item/device/assembly/timer/Topic(href, href_list) + ..() + if(usr.incapacitated() || !in_range(loc, usr)) + usr << browse(null, "window=timer") + onclose(usr, "timer") + return + + if(href_list["time"]) + timing = text2num(href_list["time"]) + if(timing && istype(holder, /obj/item/device/transfer_valve)) + var/timer_message = "[ADMIN_LOOKUPFLW(usr)] activated [src] attachment on [holder]." + message_admins(timer_message) + GLOB.bombers += timer_message + log_game("[key_name(usr)] activated [src] attachment on [holder]") + update_icon() + if(href_list["repeat"]) + loop = text2num(href_list["repeat"]) + + if(href_list["tp"]) + var/tp = text2num(href_list["tp"]) + time += tp + time = min(max(round(time), 1), 600) + saved_time = time + + if(href_list["close"]) + usr << browse(null, "window=timer") + return + + if(usr) + attack_self(usr) diff --git a/code/modules/atmospherics/machinery/portable/pump.dm b/code/modules/atmospherics/machinery/portable/pump.dm index 376e907ab6..16c786c044 100644 --- a/code/modules/atmospherics/machinery/portable/pump.dm +++ b/code/modules/atmospherics/machinery/portable/pump.dm @@ -1,142 +1,142 @@ -#define PUMP_OUT "out" -#define PUMP_IN "in" -#define PUMP_MAX_PRESSURE (ONE_ATMOSPHERE * 30) -#define PUMP_MIN_PRESSURE (ONE_ATMOSPHERE / 10) -#define PUMP_DEFAULT_PRESSURE (ONE_ATMOSPHERE) - -/obj/machinery/portable_atmospherics/pump - name = "portable air pump" - icon_state = "psiphon:0" - density = 1 - - var/on = FALSE - var/direction = PUMP_OUT - var/obj/machinery/atmospherics/components/binary/pump/pump - - volume = 1000 - -/obj/machinery/portable_atmospherics/pump/Initialize() - ..() - pump = new(src, FALSE) - pump.on = TRUE - pump.stat = 0 - pump.build_network() - -/obj/machinery/portable_atmospherics/pump/Destroy() - var/turf/T = get_turf(src) - T.assume_air(air_contents) - air_update_turf() - qdel(pump) - pump = null - return ..() - -/obj/machinery/portable_atmospherics/pump/update_icon() - icon_state = "psiphon:[on]" - - cut_overlays() - if(holding) - add_overlay("siphon-open") - if(connected_port) - add_overlay("siphon-connector") - -/obj/machinery/portable_atmospherics/pump/process_atmos() - ..() - if(!on) - pump.AIR1 = null - pump.AIR2 = null - return - - var/turf/T = get_turf(src) - if(direction == PUMP_OUT) // Hook up the internal pump. - pump.AIR1 = holding ? holding.air_contents : air_contents - pump.AIR2 = holding ? air_contents : T.return_air() - else - pump.AIR1 = holding ? air_contents : T.return_air() - pump.AIR2 = holding ? holding.air_contents : air_contents - - pump.process_atmos() // Pump gas. - if(!holding) - air_update_turf() // Update the environment if needed. - -/obj/machinery/portable_atmospherics/pump/emp_act(severity) - if(is_operational()) - if(prob(50 / severity)) - on = !on - if(prob(100 / severity)) - direction = PUMP_OUT - pump.target_pressure = rand(0, 100 * ONE_ATMOSPHERE) - update_icon() - ..() - - -/obj/machinery/portable_atmospherics/pump/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = 0, \ - datum/tgui/master_ui = null, datum/ui_state/state = GLOB.physical_state) - ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open) - if(!ui) - ui = new(user, src, ui_key, "portable_pump", name, 420, 415, master_ui, state) - ui.open() - -/obj/machinery/portable_atmospherics/pump/ui_data() - var/data = list() - data["on"] = on - data["direction"] = direction - data["connected"] = connected_port ? 1 : 0 - data["pressure"] = round(air_contents.return_pressure() ? air_contents.return_pressure() : 0) - data["target_pressure"] = round(pump.target_pressure ? pump.target_pressure : 0) - data["default_pressure"] = round(PUMP_DEFAULT_PRESSURE) - data["min_pressure"] = round(PUMP_MIN_PRESSURE) - data["max_pressure"] = round(PUMP_MAX_PRESSURE) - - if(holding) - data["holding"] = list() - data["holding"]["name"] = holding.name - data["holding"]["pressure"] = round(holding.air_contents.return_pressure()) - return data - -/obj/machinery/portable_atmospherics/pump/ui_act(action, params) - if(..()) - return - switch(action) - if("power") - on = !on - if(on && !holding) - var/plasma = air_contents.gases["plasma"] - var/n2o = air_contents.gases["n2o"] - if(n2o || plasma) - var/area/A = get_area(src) - message_admins("[ADMIN_LOOKUPFLW(usr)] turned on a pump that contains [n2o ? "N2O" : ""][n2o && plasma ? " & " : ""][plasma ? "Plasma" : ""] at [A][ADMIN_JMP(src)]") - log_admin("[key_name(usr)] turned on a pump that contains [n2o ? "N2O" : ""][n2o && plasma ? " & " : ""][plasma ? "Plasma" : ""] at [A][COORD(src)]") - . = TRUE - if("direction") - if(direction == PUMP_OUT) - direction = PUMP_IN - else - direction = PUMP_OUT - . = TRUE - if("pressure") - var/pressure = params["pressure"] - if(pressure == "reset") - pressure = PUMP_DEFAULT_PRESSURE - . = TRUE - else if(pressure == "min") - pressure = PUMP_MIN_PRESSURE - . = TRUE - else if(pressure == "max") - pressure = PUMP_MAX_PRESSURE - . = TRUE - else if(pressure == "input") - pressure = input("New release pressure ([PUMP_MIN_PRESSURE]-[PUMP_MAX_PRESSURE] kPa):", name, pump.target_pressure) as num|null - if(!isnull(pressure) && !..()) - . = TRUE - else if(text2num(pressure) != null) - pressure = text2num(pressure) - . = TRUE - if(.) - pump.target_pressure = Clamp(round(pressure), PUMP_MIN_PRESSURE, PUMP_MAX_PRESSURE) - investigate_log("was set to [pump.target_pressure] kPa by [key_name(usr)].", "atmos") - if("eject") - if(holding) - holding.loc = get_turf(src) - holding = null - . = TRUE +#define PUMP_OUT "out" +#define PUMP_IN "in" +#define PUMP_MAX_PRESSURE (ONE_ATMOSPHERE * 30) +#define PUMP_MIN_PRESSURE (ONE_ATMOSPHERE / 10) +#define PUMP_DEFAULT_PRESSURE (ONE_ATMOSPHERE) + +/obj/machinery/portable_atmospherics/pump + name = "portable air pump" + icon_state = "psiphon:0" + density = 1 + + var/on = FALSE + var/direction = PUMP_OUT + var/obj/machinery/atmospherics/components/binary/pump/pump + + volume = 1000 + +/obj/machinery/portable_atmospherics/pump/Initialize() + ..() + pump = new(src, FALSE) + pump.on = TRUE + pump.stat = 0 + pump.build_network() + +/obj/machinery/portable_atmospherics/pump/Destroy() + var/turf/T = get_turf(src) + T.assume_air(air_contents) + air_update_turf() + qdel(pump) + pump = null + return ..() + +/obj/machinery/portable_atmospherics/pump/update_icon() + icon_state = "psiphon:[on]" + + cut_overlays() + if(holding) + add_overlay("siphon-open") + if(connected_port) + add_overlay("siphon-connector") + +/obj/machinery/portable_atmospherics/pump/process_atmos() + ..() + if(!on) + pump.AIR1 = null + pump.AIR2 = null + return + + var/turf/T = get_turf(src) + if(direction == PUMP_OUT) // Hook up the internal pump. + pump.AIR1 = holding ? holding.air_contents : air_contents + pump.AIR2 = holding ? air_contents : T.return_air() + else + pump.AIR1 = holding ? air_contents : T.return_air() + pump.AIR2 = holding ? holding.air_contents : air_contents + + pump.process_atmos() // Pump gas. + if(!holding) + air_update_turf() // Update the environment if needed. + +/obj/machinery/portable_atmospherics/pump/emp_act(severity) + if(is_operational()) + if(prob(50 / severity)) + on = !on + if(prob(100 / severity)) + direction = PUMP_OUT + pump.target_pressure = rand(0, 100 * ONE_ATMOSPHERE) + update_icon() + ..() + + +/obj/machinery/portable_atmospherics/pump/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = 0, \ + datum/tgui/master_ui = null, datum/ui_state/state = GLOB.physical_state) + ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open) + if(!ui) + ui = new(user, src, ui_key, "portable_pump", name, 420, 415, master_ui, state) + ui.open() + +/obj/machinery/portable_atmospherics/pump/ui_data() + var/data = list() + data["on"] = on + data["direction"] = direction + data["connected"] = connected_port ? 1 : 0 + data["pressure"] = round(air_contents.return_pressure() ? air_contents.return_pressure() : 0) + data["target_pressure"] = round(pump.target_pressure ? pump.target_pressure : 0) + data["default_pressure"] = round(PUMP_DEFAULT_PRESSURE) + data["min_pressure"] = round(PUMP_MIN_PRESSURE) + data["max_pressure"] = round(PUMP_MAX_PRESSURE) + + if(holding) + data["holding"] = list() + data["holding"]["name"] = holding.name + data["holding"]["pressure"] = round(holding.air_contents.return_pressure()) + return data + +/obj/machinery/portable_atmospherics/pump/ui_act(action, params) + if(..()) + return + switch(action) + if("power") + on = !on + if(on && !holding) + var/plasma = air_contents.gases["plasma"] + var/n2o = air_contents.gases["n2o"] + if(n2o || plasma) + var/area/A = get_area(src) + message_admins("[ADMIN_LOOKUPFLW(usr)] turned on a pump that contains [n2o ? "N2O" : ""][n2o && plasma ? " & " : ""][plasma ? "Plasma" : ""] at [A][ADMIN_JMP(src)]") + log_admin("[key_name(usr)] turned on a pump that contains [n2o ? "N2O" : ""][n2o && plasma ? " & " : ""][plasma ? "Plasma" : ""] at [A][COORD(src)]") + . = TRUE + if("direction") + if(direction == PUMP_OUT) + direction = PUMP_IN + else + direction = PUMP_OUT + . = TRUE + if("pressure") + var/pressure = params["pressure"] + if(pressure == "reset") + pressure = PUMP_DEFAULT_PRESSURE + . = TRUE + else if(pressure == "min") + pressure = PUMP_MIN_PRESSURE + . = TRUE + else if(pressure == "max") + pressure = PUMP_MAX_PRESSURE + . = TRUE + else if(pressure == "input") + pressure = input("New release pressure ([PUMP_MIN_PRESSURE]-[PUMP_MAX_PRESSURE] kPa):", name, pump.target_pressure) as num|null + if(!isnull(pressure) && !..()) + . = TRUE + else if(text2num(pressure) != null) + pressure = text2num(pressure) + . = TRUE + if(.) + pump.target_pressure = Clamp(round(pressure), PUMP_MIN_PRESSURE, PUMP_MAX_PRESSURE) + investigate_log("was set to [pump.target_pressure] kPa by [key_name(usr)].", "atmos") + if("eject") + if(holding) + holding.loc = get_turf(src) + holding = null + . = TRUE update_icon() \ No newline at end of file diff --git a/code/modules/jobs/job_types/job.dm b/code/modules/jobs/job_types/job.dm index 9b5876c239..4d5d4eb80c 100644 --- a/code/modules/jobs/job_types/job.dm +++ b/code/modules/jobs/job_types/job.dm @@ -75,8 +75,6 @@ H.dna.features["ears"] = "None" H.regenerate_icons() - handle_roundstart_items(H) - /datum/job/proc/get_access() if(!config) //Needed for robots. return src.minimal_access.Copy() diff --git a/code/modules/mapping/ruins.dm b/code/modules/mapping/ruins.dm index a5d07591b5..f4824a96a2 100644 --- a/code/modules/mapping/ruins.dm +++ b/code/modules/mapping/ruins.dm @@ -1,93 +1,93 @@ - - -/proc/seedRuins(list/z_levels = null, budget = 0, whitelist = /area/space, list/potentialRuins) - if(!z_levels || !z_levels.len) - WARNING("No Z levels provided - Not generating ruins") - return - - for(var/zl in z_levels) - var/turf/T = locate(1, 1, zl) - if(!T) - WARNING("Z level [zl] does not exist - Not generating ruins") - return - - var/overall_sanity = 100 - var/list/ruins = potentialRuins.Copy() - - while(budget > 0 && overall_sanity > 0) - // Pick a ruin - var/datum/map_template/ruin/ruin = null - if(ruins && ruins.len) - ruin = ruins[pick(ruins)] - else - log_world("Ruin loader had no ruins to pick from with [budget] left to spend.") - break - // Can we afford it - if(ruin.cost > budget) - overall_sanity-- - continue - // If so, try to place it - var/sanity = 100 - // And if we can't fit it anywhere, give up, try again - - while(sanity > 0) - sanity-- - var/width_border = TRANSITIONEDGE + SPACERUIN_MAP_EDGE_PAD + round(ruin.width / 2) - var/height_border = TRANSITIONEDGE + SPACERUIN_MAP_EDGE_PAD + round(ruin.height / 2) - var/z_level = pick(z_levels) - var/turf/T = locate(rand(width_border, world.maxx - width_border), rand(height_border, world.maxy - height_border), z_level) - var/valid = TRUE - - for(var/turf/check in ruin.get_affected_turfs(T,1)) - var/area/new_area = get_area(check) - if(!(istype(new_area, whitelist))) - valid = FALSE - break - - if(!valid) - continue - - log_world("Ruin \"[ruin.name]\" placed at ([T.x], [T.y], [T.z])") - - var/obj/effect/ruin_loader/R = new /obj/effect/ruin_loader(T) - R.Load(ruins,ruin) - budget -= ruin.cost - if(!ruin.allow_duplicates) - ruins -= ruin.name - break - - if(!overall_sanity) - log_world("Ruin loader gave up with [budget] left to spend.") - - -/obj/effect/ruin_loader - name = "random ruin" - icon = 'icons/obj/weapons.dmi' - icon_state = "syndballoon" - invisibility = 0 - -/obj/effect/ruin_loader/proc/Load(list/potentialRuins, datum/map_template/template) - var/list/possible_ruins = list() - for(var/A in potentialRuins) - var/datum/map_template/T = potentialRuins[A] - if(!T.loaded) - possible_ruins += T - if(!template && possible_ruins.len) - template = safepick(possible_ruins) - if(!template) - return FALSE - var/turf/central_turf = get_turf(src) - for(var/i in template.get_affected_turfs(central_turf, 1)) - var/turf/T = i - for(var/mob/living/simple_animal/monster in T) - qdel(monster) - for(var/obj/structure/flora/ash/plant in T) - qdel(plant) - template.load(central_turf,centered = TRUE) - template.loaded++ - var/datum/map_template/ruin = template - if(istype(ruin)) - new /obj/effect/landmark/ruin(central_turf, ruin) - - qdel(src) - return TRUE + + +/proc/seedRuins(list/z_levels = null, budget = 0, whitelist = /area/space, list/potentialRuins) + if(!z_levels || !z_levels.len) + WARNING("No Z levels provided - Not generating ruins") + return + + for(var/zl in z_levels) + var/turf/T = locate(1, 1, zl) + if(!T) + WARNING("Z level [zl] does not exist - Not generating ruins") + return + + var/overall_sanity = 100 + var/list/ruins = potentialRuins.Copy() + + while(budget > 0 && overall_sanity > 0) + // Pick a ruin + var/datum/map_template/ruin/ruin = null + if(ruins && ruins.len) + ruin = ruins[pick(ruins)] + else + log_world("Ruin loader had no ruins to pick from with [budget] left to spend.") + break + // Can we afford it + if(ruin.cost > budget) + overall_sanity-- + continue + // If so, try to place it + var/sanity = 100 + // And if we can't fit it anywhere, give up, try again + + while(sanity > 0) + sanity-- + var/width_border = TRANSITIONEDGE + SPACERUIN_MAP_EDGE_PAD + round(ruin.width / 2) + var/height_border = TRANSITIONEDGE + SPACERUIN_MAP_EDGE_PAD + round(ruin.height / 2) + var/z_level = pick(z_levels) + var/turf/T = locate(rand(width_border, world.maxx - width_border), rand(height_border, world.maxy - height_border), z_level) + var/valid = TRUE + + for(var/turf/check in ruin.get_affected_turfs(T,1)) + var/area/new_area = get_area(check) + if(!(istype(new_area, whitelist))) + valid = FALSE + break + + if(!valid) + continue + + log_world("Ruin \"[ruin.name]\" placed at ([T.x], [T.y], [T.z])") + + var/obj/effect/ruin_loader/R = new /obj/effect/ruin_loader(T) + R.Load(ruins,ruin) + budget -= ruin.cost + if(!ruin.allow_duplicates) + ruins -= ruin.name + break + + if(!overall_sanity) + log_world("Ruin loader gave up with [budget] left to spend.") + + +/obj/effect/ruin_loader + name = "random ruin" + icon = 'icons/obj/weapons.dmi' + icon_state = "syndballoon" + invisibility = 0 + +/obj/effect/ruin_loader/proc/Load(list/potentialRuins, datum/map_template/template) + var/list/possible_ruins = list() + for(var/A in potentialRuins) + var/datum/map_template/T = potentialRuins[A] + if(!T.loaded) + possible_ruins += T + if(!template && possible_ruins.len) + template = safepick(possible_ruins) + if(!template) + return FALSE + var/turf/central_turf = get_turf(src) + for(var/i in template.get_affected_turfs(central_turf, 1)) + var/turf/T = i + for(var/mob/living/simple_animal/monster in T) + qdel(monster) + for(var/obj/structure/flora/ash/plant in T) + qdel(plant) + template.load(central_turf,centered = TRUE) + template.loaded++ + var/datum/map_template/ruin = template + if(istype(ruin)) + new /obj/effect/landmark/ruin(central_turf, ruin) + + qdel(src) + return TRUE diff --git a/code/modules/mob/dead/new_player/new_player.dm b/code/modules/mob/dead/new_player/new_player.dm index c22418cbd6..e3943d07e6 100644 --- a/code/modules/mob/dead/new_player/new_player.dm +++ b/code/modules/mob/dead/new_player/new_player.dm @@ -24,10 +24,10 @@ loc = pick(GLOB.newplayer_start) else loc = locate(1,1,1) - . = ..() - -/mob/dead/new_player/prepare_huds() - return + . = ..() + +/mob/dead/new_player/prepare_huds() + return /mob/dead/new_player/proc/new_player_panel() @@ -146,7 +146,7 @@ return 1 if(href_list["late_join"]) - if(!SSticker || !SSticker.IsRoundInProgress()) + if(!SSticker || !SSticker.IsRoundInProgress()) to_chat(usr, "The round is either not ready, or has already finished...") return @@ -371,7 +371,6 @@ if(SHUTTLE_CALL) if(SSshuttle.emergency.timeLeft(1) > initial(SSshuttle.emergencyCallTime)*0.5) SSticker.mode.make_antag_chance(humanc) - handle_roundstart_items(character) qdel(src) /mob/dead/new_player/proc/AddEmploymentContract(mob/living/carbon/human/employee) diff --git a/code/modules/mob/inventory.dm b/code/modules/mob/inventory.dm index 4a650ae165..2c3b8bdbd4 100644 --- a/code/modules/mob/inventory.dm +++ b/code/modules/mob/inventory.dm @@ -354,8 +354,8 @@ dropItemToGround(I) drop_all_held_items() -/obj/item/proc/equip_to_best_slot(var/mob/M, override_held_check = FALSE) - if((src != M.get_active_held_item()) && !override_held_check) +/obj/item/proc/equip_to_best_slot(var/mob/M) + if(src != M.get_active_held_item()) to_chat(M, "You are not holding anything to equip!") return FALSE diff --git a/code/modules/mob/living/carbon/human/inventory.dm b/code/modules/mob/living/carbon/human/inventory.dm index 1b5518008e..21e1a5648e 100644 --- a/code/modules/mob/living/carbon/human/inventory.dm +++ b/code/modules/mob/living/carbon/human/inventory.dm @@ -1,245 +1,245 @@ -/mob/living/carbon/human/can_equip(obj/item/I, slot, disable_warning = 0) - return dna.species.can_equip(I, slot, disable_warning, src) - -// Return the item currently in the slot ID -/mob/living/carbon/human/get_item_by_slot(slot_id) - switch(slot_id) - if(slot_back) - return back - if(slot_wear_mask) - return wear_mask - if(slot_neck) - return wear_neck - if(slot_handcuffed) - return handcuffed - if(slot_legcuffed) - return legcuffed - if(slot_belt) - return belt - if(slot_wear_id) - return wear_id - if(slot_ears) - return ears - if(slot_glasses) - return glasses - if(slot_gloves) - return gloves - if(slot_head) - return head - if(slot_shoes) - return shoes - if(slot_wear_suit) - return wear_suit - if(slot_w_uniform) - return w_uniform - if(slot_l_store) - return l_store - if(slot_r_store) - return r_store - if(slot_s_store) - return s_store - return null - -/mob/living/carbon/human/proc/get_all_slots() - . = get_head_slots() | get_body_slots() - -/mob/living/carbon/human/proc/get_body_slots() - return list( - back, - s_store, - handcuffed, - legcuffed, - wear_suit, - gloves, - shoes, - belt, - wear_id, - l_store, - r_store, - w_uniform - ) - -/mob/living/carbon/human/proc/get_head_slots() - return list( - head, - wear_mask, - glasses, - ears, - ) - -/mob/living/carbon/human/proc/get_storage_slots() - return list( - back, - belt, - l_store, - r_store, - s_store, - ) - -//This is an UNSAFE proc. Use mob_can_equip() before calling this one! Or rather use equip_to_slot_if_possible() or advanced_equip_to_slot_if_possible() -/mob/living/carbon/human/equip_to_slot(obj/item/I, slot) - if(!..()) //a check failed or the item has already found its slot - return - - var/not_handled = FALSE //Added in case we make this type path deeper one day - switch(slot) - if(slot_belt) - belt = I - update_inv_belt() - if(slot_wear_id) - wear_id = I - sec_hud_set_ID() - update_inv_wear_id() - if(slot_ears) - ears = I - update_inv_ears() - if(slot_glasses) - glasses = I - var/obj/item/clothing/glasses/G = I - if(G.glass_colour_type) - update_glasses_color(G, 1) - if(G.tint) - update_tint() - if(G.vision_correction) - clear_fullscreen("nearsighted") - if(G.vision_flags || G.darkness_view || G.invis_override || G.invis_view || !isnull(G.lighting_alpha)) - update_sight() - update_inv_glasses() - if(slot_gloves) - gloves = I - update_inv_gloves() - if(slot_shoes) - shoes = I - update_inv_shoes() - if(slot_wear_suit) - wear_suit = I - if(I.flags_inv & HIDEJUMPSUIT) - update_inv_w_uniform() - if(wear_suit.breakouttime) //when equipping a straightjacket - stop_pulling() //can't pull if restrained - update_action_buttons_icon() //certain action buttons will no longer be usable. - update_inv_wear_suit() - if(slot_w_uniform) - w_uniform = I - update_suit_sensors() - update_inv_w_uniform() - if(slot_l_store) - l_store = I - update_inv_pockets() - if(slot_r_store) - r_store = I - update_inv_pockets() - if(slot_s_store) - s_store = I - update_inv_s_store() - else - to_chat(src, "You are trying to equip this item to an unsupported inventory slot. Report this to a coder!") - - //Item is handled and in slot, valid to call callback, for this proc should always be true - if(!not_handled) - I.equipped(src, slot) - - return not_handled //For future deeper overrides - -/mob/living/carbon/human/doUnEquip(obj/item/I, force, newloc, no_move, invdrop = TRUE) - var/index = get_held_index_of_item(I) - . = ..() //See mob.dm for an explanation on this and some rage about people copypasting instead of calling ..() like they should. - if(!. || !I) - return - if(index && dna.species.mutanthands) - put_in_hand(new dna.species.mutanthands(), index) - if(I == wear_suit) - if(s_store && invdrop) - dropItemToGround(s_store, TRUE) //It makes no sense for your suit storage to stay on you if you drop your suit. - if(wear_suit.breakouttime) //when unequipping a straightjacket - update_action_buttons_icon() //certain action buttons may be usable again. - wear_suit = null - if(I.flags_inv & HIDEJUMPSUIT) - update_inv_w_uniform() - update_inv_wear_suit() - else if(I == w_uniform) - if(invdrop) - if(r_store) - dropItemToGround(r_store, TRUE) //Again, makes sense for pockets to drop. - if(l_store) - dropItemToGround(l_store, TRUE) - if(wear_id) - dropItemToGround(wear_id) - if(belt) - dropItemToGround(belt) - w_uniform = null - update_suit_sensors() - update_inv_w_uniform(invdrop) - else if(I == gloves) - gloves = null - update_inv_gloves() - else if(I == glasses) - glasses = null - var/obj/item/clothing/glasses/G = I - if(G.glass_colour_type) - update_glasses_color(G, 0) - if(G.tint) - update_tint() - if(G.vision_correction) - if(disabilities & NEARSIGHT) - overlay_fullscreen("nearsighted", /obj/screen/fullscreen/impaired, 1) - if(G.vision_flags || G.darkness_view || G.invis_override || G.invis_view || !isnull(G.lighting_alpha)) - update_sight() - update_inv_glasses() - else if(I == ears) - ears = null - update_inv_ears() - else if(I == shoes) - shoes = null - update_inv_shoes() - else if(I == belt) - belt = null - update_inv_belt() - else if(I == wear_id) - wear_id = null - sec_hud_set_ID() - update_inv_wear_id() - else if(I == r_store) - r_store = null - update_inv_pockets() - else if(I == l_store) - l_store = null - update_inv_pockets() - else if(I == s_store) - s_store = null - update_inv_s_store() - -/mob/living/carbon/human/wear_mask_update(obj/item/clothing/C, toggle_off = 1) - if((C.flags_inv & (HIDEHAIR|HIDEFACIALHAIR)) || (initial(C.flags_inv) & (HIDEHAIR|HIDEFACIALHAIR))) - update_hair() - if(toggle_off && internal && !getorganslot("breathing_tube")) - update_internals_hud_icon(0) - internal = null - if(C.flags_inv & HIDEEYES) - update_inv_glasses() - sec_hud_set_security_status() - ..() - -/mob/living/carbon/human/head_update(obj/item/I, forced) - if((I.flags_inv & (HIDEHAIR|HIDEFACIALHAIR)) || forced) - update_hair() - if(I.flags_inv & HIDEEYES || forced) - update_inv_glasses() - if(I.flags_inv & HIDEEARS || forced) - update_body() - sec_hud_set_security_status() - ..() - -/mob/living/carbon/human/proc/equipOutfit(outfit, visualsOnly = FALSE) - var/datum/outfit/O = null - - if(ispath(outfit)) - O = new outfit - else - O = outfit - if(!istype(O)) - return 0 - if(!O) - return 0 - - return O.equip(src, visualsOnly) +/mob/living/carbon/human/can_equip(obj/item/I, slot, disable_warning = 0) + return dna.species.can_equip(I, slot, disable_warning, src) + +// Return the item currently in the slot ID +/mob/living/carbon/human/get_item_by_slot(slot_id) + switch(slot_id) + if(slot_back) + return back + if(slot_wear_mask) + return wear_mask + if(slot_neck) + return wear_neck + if(slot_handcuffed) + return handcuffed + if(slot_legcuffed) + return legcuffed + if(slot_belt) + return belt + if(slot_wear_id) + return wear_id + if(slot_ears) + return ears + if(slot_glasses) + return glasses + if(slot_gloves) + return gloves + if(slot_head) + return head + if(slot_shoes) + return shoes + if(slot_wear_suit) + return wear_suit + if(slot_w_uniform) + return w_uniform + if(slot_l_store) + return l_store + if(slot_r_store) + return r_store + if(slot_s_store) + return s_store + return null + +/mob/living/carbon/human/proc/get_all_slots() + . = get_head_slots() | get_body_slots() + +/mob/living/carbon/human/proc/get_body_slots() + return list( + back, + s_store, + handcuffed, + legcuffed, + wear_suit, + gloves, + shoes, + belt, + wear_id, + l_store, + r_store, + w_uniform + ) + +/mob/living/carbon/human/proc/get_head_slots() + return list( + head, + wear_mask, + glasses, + ears, + ) + +/mob/living/carbon/human/proc/get_storage_slots() + return list( + back, + belt, + l_store, + r_store, + s_store, + ) + +//This is an UNSAFE proc. Use mob_can_equip() before calling this one! Or rather use equip_to_slot_if_possible() or advanced_equip_to_slot_if_possible() +/mob/living/carbon/human/equip_to_slot(obj/item/I, slot) + if(!..()) //a check failed or the item has already found its slot + return + + var/not_handled = FALSE //Added in case we make this type path deeper one day + switch(slot) + if(slot_belt) + belt = I + update_inv_belt() + if(slot_wear_id) + wear_id = I + sec_hud_set_ID() + update_inv_wear_id() + if(slot_ears) + ears = I + update_inv_ears() + if(slot_glasses) + glasses = I + var/obj/item/clothing/glasses/G = I + if(G.glass_colour_type) + update_glasses_color(G, 1) + if(G.tint) + update_tint() + if(G.vision_correction) + clear_fullscreen("nearsighted") + if(G.vision_flags || G.darkness_view || G.invis_override || G.invis_view || !isnull(G.lighting_alpha)) + update_sight() + update_inv_glasses() + if(slot_gloves) + gloves = I + update_inv_gloves() + if(slot_shoes) + shoes = I + update_inv_shoes() + if(slot_wear_suit) + wear_suit = I + if(I.flags_inv & HIDEJUMPSUIT) + update_inv_w_uniform() + if(wear_suit.breakouttime) //when equipping a straightjacket + stop_pulling() //can't pull if restrained + update_action_buttons_icon() //certain action buttons will no longer be usable. + update_inv_wear_suit() + if(slot_w_uniform) + w_uniform = I + update_suit_sensors() + update_inv_w_uniform() + if(slot_l_store) + l_store = I + update_inv_pockets() + if(slot_r_store) + r_store = I + update_inv_pockets() + if(slot_s_store) + s_store = I + update_inv_s_store() + else + to_chat(src, "You are trying to equip this item to an unsupported inventory slot. Report this to a coder!") + + //Item is handled and in slot, valid to call callback, for this proc should always be true + if(!not_handled) + I.equipped(src, slot) + + return not_handled //For future deeper overrides + +/mob/living/carbon/human/doUnEquip(obj/item/I, force, newloc, no_move, invdrop = TRUE) + var/index = get_held_index_of_item(I) + . = ..() //See mob.dm for an explanation on this and some rage about people copypasting instead of calling ..() like they should. + if(!. || !I) + return + if(index && dna.species.mutanthands) + put_in_hand(new dna.species.mutanthands(), index) + if(I == wear_suit) + if(s_store && invdrop) + dropItemToGround(s_store, TRUE) //It makes no sense for your suit storage to stay on you if you drop your suit. + if(wear_suit.breakouttime) //when unequipping a straightjacket + update_action_buttons_icon() //certain action buttons may be usable again. + wear_suit = null + if(I.flags_inv & HIDEJUMPSUIT) + update_inv_w_uniform() + update_inv_wear_suit() + else if(I == w_uniform) + if(invdrop) + if(r_store) + dropItemToGround(r_store, TRUE) //Again, makes sense for pockets to drop. + if(l_store) + dropItemToGround(l_store, TRUE) + if(wear_id) + dropItemToGround(wear_id) + if(belt) + dropItemToGround(belt) + w_uniform = null + update_suit_sensors() + update_inv_w_uniform(invdrop) + else if(I == gloves) + gloves = null + update_inv_gloves() + else if(I == glasses) + glasses = null + var/obj/item/clothing/glasses/G = I + if(G.glass_colour_type) + update_glasses_color(G, 0) + if(G.tint) + update_tint() + if(G.vision_correction) + if(disabilities & NEARSIGHT) + overlay_fullscreen("nearsighted", /obj/screen/fullscreen/impaired, 1) + if(G.vision_flags || G.darkness_view || G.invis_override || G.invis_view || !isnull(G.lighting_alpha)) + update_sight() + update_inv_glasses() + else if(I == ears) + ears = null + update_inv_ears() + else if(I == shoes) + shoes = null + update_inv_shoes() + else if(I == belt) + belt = null + update_inv_belt() + else if(I == wear_id) + wear_id = null + sec_hud_set_ID() + update_inv_wear_id() + else if(I == r_store) + r_store = null + update_inv_pockets() + else if(I == l_store) + l_store = null + update_inv_pockets() + else if(I == s_store) + s_store = null + update_inv_s_store() + +/mob/living/carbon/human/wear_mask_update(obj/item/clothing/C, toggle_off = 1) + if((C.flags_inv & (HIDEHAIR|HIDEFACIALHAIR)) || (initial(C.flags_inv) & (HIDEHAIR|HIDEFACIALHAIR))) + update_hair() + if(toggle_off && internal && !getorganslot("breathing_tube")) + update_internals_hud_icon(0) + internal = null + if(C.flags_inv & HIDEEYES) + update_inv_glasses() + sec_hud_set_security_status() + ..() + +/mob/living/carbon/human/head_update(obj/item/I, forced) + if((I.flags_inv & (HIDEHAIR|HIDEFACIALHAIR)) || forced) + update_hair() + if(I.flags_inv & HIDEEYES || forced) + update_inv_glasses() + if(I.flags_inv & HIDEEARS || forced) + update_body() + sec_hud_set_security_status() + ..() + +/mob/living/carbon/human/proc/equipOutfit(outfit, visualsOnly = FALSE) + var/datum/outfit/O = null + + if(ispath(outfit)) + O = new outfit + else + O = outfit + if(!istype(O)) + return 0 + if(!O) + return 0 + + return O.equip(src, visualsOnly) diff --git a/code/modules/mob/living/carbon/human/species_types/golems.dm b/code/modules/mob/living/carbon/human/species_types/golems.dm index af24d7b6c4..aba76f570a 100644 --- a/code/modules/mob/living/carbon/human/species_types/golems.dm +++ b/code/modules/mob/living/carbon/human/species_types/golems.dm @@ -1,699 +1,699 @@ -/datum/species/golem - // Animated beings of stone. They have increased defenses, and do not need to breathe. They're also slow as fuuuck. - name = "Golem" - id = "iron golem" - species_traits = list(NOBREATH,RESISTHOT,RESISTCOLD,RESISTPRESSURE,NOFIRE,NOGUNS,NOBLOOD,RADIMMUNE,VIRUSIMMUNE,PIERCEIMMUNE,NODISMEMBER,MUTCOLORS,NO_UNDERWEAR) - mutant_organs = list(/obj/item/organ/adamantine_resonator) - speedmod = 2 - armor = 55 - siemens_coeff = 0 - punchdamagelow = 5 - punchdamagehigh = 14 - punchstunthreshold = 11 //about 40% chance to stun - no_equip = list(slot_wear_mask, slot_wear_suit, slot_gloves, slot_shoes, slot_w_uniform, slot_s_store) - nojumpsuit = 1 - sexes = 1 - damage_overlay_type = "" - meat = /obj/item/weapon/reagent_containers/food/snacks/meat/slab/human/mutant/golem - // To prevent golem subtypes from overwhelming the odds when random species - // changes, only the Random Golem type can be chosen - blacklisted = TRUE - dangerous_existence = TRUE - limbs_id = "golem" - fixed_mut_color = "aaa" - var/info_text = "As an Iron Golem, you don't have any special traits." - - var/prefix = "Iron" - var/list/special_names - var/human_surname_chance = 3 - var/special_name_chance = 5 - -/datum/species/golem/random_name(gender,unique,lastname) - var/golem_surname = pick(GLOB.golem_names) - // 3% chance that our golem has a human surname, because - // cultural contamination - if(prob(human_surname_chance)) - golem_surname = pick(GLOB.last_names) - else if(special_names && special_names.len && prob(special_name_chance)) - golem_surname = pick(special_names) - - var/golem_name = "[prefix] [golem_surname]" - return golem_name - -/datum/species/golem/random - name = "Random Golem" - blacklisted = FALSE - dangerous_existence = FALSE - -/datum/species/golem/random/on_species_gain(mob/living/carbon/C, datum/species/old_species) - ..() - var/list/golem_types = typesof(/datum/species/golem) - src.type - var/datum/species/golem/golem_type = pick(golem_types) - var/mob/living/carbon/human/H = C - H.set_species(golem_type) - to_chat(H, "[initial(golem_type.info_text)]") - -/datum/species/golem/adamantine - name = "Adamantine Golem" - id = "adamantine golem" - meat = /obj/item/weapon/reagent_containers/food/snacks/meat/slab/human/mutant/golem/adamantine - mutant_organs = list(/obj/item/organ/adamantine_resonator, /obj/item/organ/vocal_cords/adamantine) - fixed_mut_color = "4ed" - info_text = "As an Adamantine Golem, you possess special vocal cords allowing you to \"resonate\" messages to all golems." - prefix = "Adamantine" - -//The suicide bombers of golemkind -/datum/species/golem/plasma - name = "Plasma Golem" - id = "plasma golem" - fixed_mut_color = "a3d" - meat = /obj/item/weapon/ore/plasma - //Can burn and takes damage from heat - species_traits = list(NOBREATH,RESISTCOLD,RESISTPRESSURE,NOGUNS,NOBLOOD,RADIMMUNE,VIRUSIMMUNE,PIERCEIMMUNE,NODISMEMBER,MUTCOLORS,NO_UNDERWEAR) - info_text = "As a Plasma Golem, you burn easily. Be careful, if you get hot enough while burning, you'll blow up!" - heatmod = 0 //fine until they blow up - prefix = "Plasma" - special_names = list("Flood","Fire","Bar","Man") - var/boom_warning = FALSE - var/datum/action/innate/ignite/ignite - -/datum/species/golem/plasma/spec_life(mob/living/carbon/human/H) - if(H.bodytemperature > 750) - if(!boom_warning && H.on_fire) - to_chat(H, "You feel like you could blow up at any moment!") - boom_warning = TRUE - else - if(boom_warning) - to_chat(H, "You feel more stable.") - boom_warning = FALSE - - if(H.bodytemperature > 850 && H.on_fire && prob(25)) - explosion(get_turf(H),1,2,4,flame_range = 5) - if(H) - H.gib() - if(H.fire_stacks < 2) //flammable - H.adjust_fire_stacks(1) - ..() - -/datum/species/golem/plasma/on_species_gain(mob/living/carbon/C, datum/species/old_species) - ..() - if(ishuman(C)) - ignite = new - ignite.Grant(C) - -/datum/species/golem/plasma/on_species_loss(mob/living/carbon/C) - if(ignite) - ignite.Remove(C) - ..() - -/datum/action/innate/ignite - name = "Ignite" - desc = "Set yourself aflame, bringing yourself closer to exploding!" - check_flags = AB_CHECK_CONSCIOUS - button_icon_state = "sacredflame" - -/datum/action/innate/ignite/Activate() - if(ishuman(owner)) - var/mob/living/carbon/human/H = owner - if(H.fire_stacks) - to_chat(owner, "You ignite yourself!") - else - to_chat(owner, "You try ignite yourself, but fail!") - H.IgniteMob() //firestacks are already there passively - -//Harder to hurt -/datum/species/golem/diamond - name = "Diamond Golem" - id = "diamond golem" - fixed_mut_color = "0ff" - armor = 70 //up from 55 - meat = /obj/item/weapon/ore/diamond - info_text = "As a Diamond Golem, you are more resistant than the average golem." - prefix = "Diamond" - special_names = list("Back") - -//Faster but softer and less armoured -/datum/species/golem/gold - name = "Gold Golem" - id = "gold golem" - fixed_mut_color = "cc0" - speedmod = 1 - armor = 25 //down from 55 - meat = /obj/item/weapon/ore/gold - info_text = "As a Gold Golem, you are faster but less resistant than the average golem." - prefix = "Golden" - -//Heavier, thus higher chance of stunning when punching -/datum/species/golem/silver - name = "Silver Golem" - id = "silver golem" - fixed_mut_color = "ddd" - punchstunthreshold = 9 //60% chance, from 40% - meat = /obj/item/weapon/ore/silver - info_text = "As a Silver Golem, your attacks are heavier and have a higher chance of stunning." - prefix = "Silver" - special_names = list("Surfer", "Chariot", "Lining") - -//Harder to stun, deals more damage, but it's even slower -/datum/species/golem/plasteel - name = "Plasteel Golem" - id = "plasteel golem" - fixed_mut_color = "bbb" - stunmod = 0.40 - punchdamagelow = 12 - punchdamagehigh = 21 - punchstunthreshold = 18 //still 40% stun chance - speedmod = 4 //pretty fucking slow - meat = /obj/item/weapon/ore/iron - info_text = "As a Plasteel Golem, you are slower, but harder to stun, and hit very hard when punching." - attack_verb = "smash" - attack_sound = 'sound/effects/meteorimpact.ogg' //hits pretty hard - prefix = "Plasteel" - -//Immune to ash storms -/datum/species/golem/titanium - name = "Titanium Golem" - id = "titanium golem" - fixed_mut_color = "fff" - meat = /obj/item/weapon/ore/titanium - info_text = "As a Titanium Golem, you are immune to ash storms, and slightly more resistant to burn damage." - burnmod = 0.9 - prefix = "Titanium" - -/datum/species/golem/titanium/on_species_gain(mob/living/carbon/C, datum/species/old_species) - . = ..() - C.weather_immunities |= "ash" - -/datum/species/golem/titanium/on_species_loss(mob/living/carbon/C) - . = ..() - C.weather_immunities -= "ash" - -//Immune to ash storms and lava -/datum/species/golem/plastitanium - name = "Plastitanium Golem" - id = "plastitanium golem" - fixed_mut_color = "888" - meat = /obj/item/weapon/ore/titanium - info_text = "As a Plastitanium Golem, you are immune to both ash storms and lava, and slightly more resistant to burn damage." - burnmod = 0.8 - prefix = "Plastitanium" - -/datum/species/golem/plastitanium/on_species_gain(mob/living/carbon/C, datum/species/old_species) - . = ..() - C.weather_immunities |= "lava" - C.weather_immunities |= "ash" - -/datum/species/golem/plastitanium/on_species_loss(mob/living/carbon/C) - . = ..() - C.weather_immunities -= "ash" - C.weather_immunities -= "lava" - -//Fast and regenerates... but can only speak like an abductor -/datum/species/golem/alloy - name = "Alien Alloy Golem" - id = "alloy golem" - fixed_mut_color = "333" - meat = /obj/item/stack/sheet/mineral/abductor - mutanttongue = /obj/item/organ/tongue/abductor - speedmod = 1 //faster - info_text = "As an Alloy Golem, you are made of advanced alien materials: you are faster and regenerate over time. You are, however, only able to be heard by other alloy golems." - prefix = "Alien" - special_names = list("Outsider", "Technology", "Watcher", "Stranger") //ominous and unknown - -//Regenerates because self-repairing super-advanced alien tech -/datum/species/golem/alloy/spec_life(mob/living/carbon/human/H) - if(H.stat == DEAD) - return - H.heal_overall_damage(2,2) - H.adjustToxLoss(-2) - H.adjustOxyLoss(-2) - -//Since this will usually be created from a collaboration between podpeople and free golems, wood golems are a mix between the two races -/datum/species/golem/wood - name = "Wood Golem" - id = "wood golem" - fixed_mut_color = "49311c" - meat = /obj/item/stack/sheet/mineral/wood - //Can burn and take damage from heat - species_traits = list(NOBREATH,RESISTCOLD,RESISTPRESSURE,NOGUNS,NOBLOOD,RADIMMUNE,VIRUSIMMUNE,PIERCEIMMUNE,NODISMEMBER,MUTCOLORS,NO_UNDERWEAR) - armor = 30 - burnmod = 1.25 - heatmod = 1.5 - info_text = "As a Wooden Golem, you have plant-like traits: you take damage from extreme temperatures, can be set on fire, and have lower armor than a normal golem. You regenerate when in the light and wither in the darkness." - prefix = "Wooden" - special_names = list("Tomato", "Potato", "Broccoli", "Carrot", "Ambrosia", "Pumpkin", "Ivy", "Kudzu", "Banana", "Moss", "Flower", "Bloom", "Root", "Bark", "Glowshroom", "Petal", "Leaf", "Venus", "Sprout","Cocoa", "Strawberry", "Citrus", "Oak", "Cactus", "Pepper", "Juniper") - human_surname_chance = 0 - special_name_chance = 100 - -/datum/species/golem/wood/on_species_gain(mob/living/carbon/C, datum/species/old_species) - . = ..() - C.faction |= "plants" - C.faction |= "vines" - -/datum/species/golem/wood/on_species_loss(mob/living/carbon/C) - . = ..() - C.faction -= "plants" - C.faction -= "vines" - -/datum/species/golem/wood/spec_life(mob/living/carbon/human/H) - if(H.stat == DEAD) - return - var/light_amount = 0 //how much light there is in the place, affects receiving nutrition and healing - if(isturf(H.loc)) //else, there's considered to be no light - var/turf/T = H.loc - light_amount = min(1,T.get_lumcount()) - 0.5 - H.nutrition += light_amount * 10 - if(H.nutrition > NUTRITION_LEVEL_FULL) - H.nutrition = NUTRITION_LEVEL_FULL - if(light_amount > 0.2) //if there's enough light, heal - H.heal_overall_damage(1,1) - H.adjustToxLoss(-1) - H.adjustOxyLoss(-1) - - if(H.nutrition < NUTRITION_LEVEL_STARVING + 50) - H.take_overall_damage(2,0) - -/datum/species/golem/wood/handle_chemicals(datum/reagent/chem, mob/living/carbon/human/H) - if(chem.id == "plantbgone") - H.adjustToxLoss(3) - H.reagents.remove_reagent(chem.id, REAGENTS_METABOLISM) - return 1 - -//Radioactive -/datum/species/golem/uranium - name = "Uranium Golem" - id = "uranium golem" - fixed_mut_color = "7f0" - meat = /obj/item/weapon/ore/uranium - info_text = "As an Uranium Golem, you emit radiation pulses every once in a while. It won't harm fellow golems, but organic lifeforms will be affected." - - var/last_event = 0 - var/active = null - prefix = "Uranium" - -/datum/species/golem/uranium/spec_life(mob/living/carbon/human/H) - if(!active) - if(world.time > last_event+30) - active = 1 - radiation_pulse(get_turf(H), 3, 3, 5, 0) - last_event = world.time - active = null - ..() - -//Immune to physical bullets and resistant to brute, but very vulnerable to burn damage. Dusts on death. -/datum/species/golem/sand - name = "Sand Golem" - id = "sand golem" - fixed_mut_color = "ffdc8f" - meat = /obj/item/weapon/ore/glass //this is sand - armor = 0 - burnmod = 3 //melts easily - brutemod = 0.25 - info_text = "As a Sand Golem, you are immune to physical bullets and take very little brute damage, but are extremely vulnerable to burn damage. You will also turn to sand when dying, preventing any form of recovery." - attack_sound = 'sound/effects/shovel_dig.ogg' - prefix = "Sand" - -/datum/species/golem/sand/spec_death(gibbed, mob/living/carbon/human/H) - H.visible_message("[H] turns into a pile of sand!") - for(var/obj/item/W in H) - H.dropItemToGround(W) - for(var/i=1, i <= rand(3,5), i++) - new /obj/item/weapon/ore/glass(get_turf(H)) - qdel(H) - -/datum/species/golem/sand/bullet_act(obj/item/projectile/P, mob/living/carbon/human/H) - if(!(P.original == H && P.firer == H)) - if(P.flag == "bullet" || P.flag == "bomb") - playsound(H, 'sound/effects/shovel_dig.ogg', 70, 1) - H.visible_message("The [P.name] sinks harmlessly in [H]'s sandy body!", \ - "The [P.name] sinks harmlessly in [H]'s sandy body!") - return 2 - return 0 - -//Reflects lasers and resistant to burn damage, but very vulnerable to brute damage. Shatters on death. -/datum/species/golem/glass - name = "Glass Golem" - id = "glass golem" - fixed_mut_color = "5a96b4aa" //transparent body - meat = /obj/item/weapon/shard - armor = 0 - brutemod = 3 //very fragile - burnmod = 0.25 - info_text = "As a Glass Golem, you reflect lasers and energy weapons, and are very resistant to burn damage, but you are extremely vulnerable to brute damage. On death, you'll shatter beyond any hope of recovery." - attack_sound = 'sound/effects/Glassbr2.ogg' - prefix = "Glass" - -/datum/species/golem/glass/spec_death(gibbed, mob/living/carbon/human/H) - playsound(H, "shatter", 70, 1) - H.visible_message("[H] shatters!") - for(var/obj/item/W in H) - H.dropItemToGround(W) - for(var/i=1, i <= rand(3,5), i++) - new /obj/item/weapon/shard(get_turf(H)) - qdel(H) - -/datum/species/golem/glass/bullet_act(obj/item/projectile/P, mob/living/carbon/human/H) - if(!(P.original == H && P.firer == H)) //self-shots don't reflect - if(P.flag == "laser" || P.flag == "energy") - H.visible_message("The [P.name] gets reflected by [H]'s glass skin!", \ - "The [P.name] gets reflected by [H]'s glass skin!") - if(P.starting) - var/new_x = P.starting.x + pick(0, 0, 0, 0, 0, -1, 1, -2, 2) - var/new_y = P.starting.y + pick(0, 0, 0, 0, 0, -1, 1, -2, 2) - var/turf/curloc = get_turf(H) - - // redirect the projectile - P.original = locate(new_x, new_y, P.z) - P.starting = curloc - P.current = curloc - P.firer = H - P.yo = new_y - curloc.y - P.xo = new_x - curloc.x - P.Angle = null - return -1 - return 0 - -//Teleports when hit or when it wants to -/datum/species/golem/bluespace - name = "Bluespace Golem" - id = "bluespace golem" - fixed_mut_color = "33f" - meat = /obj/item/weapon/ore/bluespace_crystal - info_text = "As a Bluespace Golem, are spatially unstable: you will teleport when hit, and you can teleport manually at a long distance." - attack_verb = "bluespace punch" - attack_sound = 'sound/effects/phasein.ogg' - prefix = "Bluespace" - special_names = list("Crystal", "Polycrystal") - - var/datum/action/innate/unstable_teleport/unstable_teleport - var/teleport_cooldown = 100 - var/last_teleport = 0 - -/datum/species/golem/bluespace/proc/reactive_teleport(mob/living/carbon/human/H) - H.visible_message("[H] teleports!", "You destabilize and teleport!") - new /obj/effect/particle_effect/sparks(get_turf(H)) - playsound(get_turf(H), "sparks", 50, 1) - do_teleport(H, get_turf(H), 6, asoundin = 'sound/weapons/emitter2.ogg') - last_teleport = world.time - -/datum/species/golem/bluespace/spec_hitby(atom/movable/AM, mob/living/carbon/human/H) - ..() - var/obj/item/I - if(istype(AM, /obj/item)) - I = AM - if(I.thrownby == H) //No throwing stuff at yourself to trigger the teleport - return 0 - else - reactive_teleport(H) - -/datum/species/golem/bluespace/spec_attack_hand(mob/living/carbon/human/M, mob/living/carbon/human/H, datum/martial_art/attacker_style = M.martial_art) - ..() - if(world.time > last_teleport + teleport_cooldown && M != H && M.a_intent != INTENT_HELP) - reactive_teleport(H) - -/datum/species/golem/bluespace/spec_attacked_by(obj/item/I, mob/living/user, obj/item/bodypart/affecting, intent, mob/living/carbon/human/H) - ..() - if(world.time > last_teleport + teleport_cooldown && user != H) - reactive_teleport(H) - -/datum/species/golem/bluespace/on_hit(obj/item/projectile/P, mob/living/carbon/human/H) - ..() - if(world.time > last_teleport + teleport_cooldown) - reactive_teleport(H) - -/datum/species/golem/bluespace/on_species_gain(mob/living/carbon/C, datum/species/old_species) - ..() - if(ishuman(C)) - unstable_teleport = new - unstable_teleport.Grant(C) - -/datum/species/golem/bluespace/on_species_loss(mob/living/carbon/C) - if(unstable_teleport) - unstable_teleport.Remove(C) - ..() - -/datum/action/innate/unstable_teleport - name = "Unstable Teleport" - check_flags = AB_CHECK_CONSCIOUS - button_icon_state = "jaunt" - var/cooldown = 150 - var/last_teleport = 0 - -/datum/action/innate/unstable_teleport/IsAvailable() - if(..()) - if(world.time > last_teleport + cooldown) - return 1 - return 0 - -/datum/action/innate/unstable_teleport/Activate() - var/mob/living/carbon/human/H = owner - H.visible_message("[H] starts vibrating!", "You start charging your bluespace core...") - playsound(get_turf(H), 'sound/weapons/flash.ogg', 25, 1) - addtimer(CALLBACK(src, .proc/teleport, H), 15) - -/datum/action/innate/unstable_teleport/proc/teleport(mob/living/carbon/human/H) - H.visible_message("[H] disappears in a shower of sparks!", "You teleport!") - var/datum/effect_system/spark_spread/spark_system = new /datum/effect_system/spark_spread - spark_system.set_up(10, 0, src) - spark_system.attach(H) - spark_system.start() - do_teleport(H, get_turf(H), 12, asoundin = 'sound/weapons/emitter2.ogg') - last_teleport = world.time - UpdateButtonIcon() //action icon looks unavailable - sleep(cooldown + 5) - UpdateButtonIcon() //action icon looks available again - - -//honk -/datum/species/golem/bananium - name = "Bananium Golem" - id = "bananium golem" - fixed_mut_color = "ff0" - say_mod = "honks" - punchdamagelow = 0 - punchdamagehigh = 1 - punchstunthreshold = 2 //Harmless and can't stun - meat = /obj/item/weapon/ore/bananium - info_text = "As a Bananium Golem, you are made for pranking. Your body emits natural honks, and you cannot hurt people when punching them. Your skin also emits bananas when damaged." - attack_verb = "honk" - attack_sound = 'sound/items/AirHorn2.ogg' - prefix = "Bananium" - - var/last_honk = 0 - var/honkooldown = 0 - var/last_banana = 0 - var/banana_cooldown = 100 - var/active = null - -/datum/species/golem/bananium/random_name(gender,unique,lastname) - var/clown_name = pick(GLOB.clown_names) - var/golem_name = "[uppertext(clown_name)]" - return golem_name - -/datum/species/golem/bananium/spec_attack_hand(mob/living/carbon/human/M, mob/living/carbon/human/H, datum/martial_art/attacker_style = M.martial_art) - ..() - if(world.time > last_banana + banana_cooldown && M != H && M.a_intent != INTENT_HELP) - new/obj/item/weapon/grown/bananapeel/specialpeel(get_turf(H)) - last_banana = world.time - -/datum/species/golem/bananium/spec_attacked_by(obj/item/I, mob/living/user, obj/item/bodypart/affecting, intent, mob/living/carbon/human/H) - ..() - if(world.time > last_banana + banana_cooldown && user != H) - new/obj/item/weapon/grown/bananapeel/specialpeel(get_turf(H)) - last_banana = world.time - -/datum/species/golem/bananium/on_hit(obj/item/projectile/P, mob/living/carbon/human/H) - ..() - if(world.time > last_banana + banana_cooldown) - new/obj/item/weapon/grown/bananapeel/specialpeel(get_turf(H)) - last_banana = world.time - -/datum/species/golem/bananium/spec_hitby(atom/movable/AM, mob/living/carbon/human/H) - ..() - var/obj/item/I - if(istype(AM, /obj/item)) - I = AM - if(I.thrownby == H) //No throwing stuff at yourself to make bananas - return 0 - else - new/obj/item/weapon/grown/bananapeel/specialpeel(get_turf(H)) - last_banana = world.time - -/datum/species/golem/bananium/spec_life(mob/living/carbon/human/H) - if(!active) - if(world.time > last_honk + honkooldown) - active = 1 - playsound(get_turf(H), 'sound/items/bikehorn.ogg', 50, 1) - last_honk = world.time - honkooldown = rand(20, 80) - active = null - ..() - -/datum/species/golem/bananium/spec_death(gibbed, mob/living/carbon/human/H) - playsound(get_turf(H), 'sound/misc/sadtrombone.ogg', 70, 0) - -/datum/species/golem/bananium/get_spans() - return list(SPAN_CLOWN) - - -/datum/species/golem/runic - name = "Runic Golem" - id = "runic golem" - limbs_id = "cultgolem" - sexes = FALSE - info_text = "As a Runic Golem, you possess eldritch powers granted by the Elder God Nar'Sie." - species_traits = list(NOBREATH,RESISTHOT,RESISTCOLD,RESISTPRESSURE,NOFIRE,NOGUNS,NOBLOOD,RADIMMUNE,VIRUSIMMUNE,PIERCEIMMUNE,NODISMEMBER,NO_UNDERWEAR) //no mutcolors - prefix = "Runic" - - var/obj/effect/proc_holder/spell/targeted/ethereal_jaunt/shift/golem/phase_shift - var/obj/effect/proc_holder/spell/targeted/abyssal_gaze/abyssal_gaze - var/obj/effect/proc_holder/spell/targeted/dominate/dominate - -/datum/species/golem/runic/random_name(gender,unique,lastname) - var/edgy_first_name = pick("Razor","Blood","Dark","Evil","Cold","Pale","Black","Silent","Chaos","Deadly") - var/edgy_last_name = pick("Edge","Night","Death","Razor","Blade","Steel","Calamity","Twilight","Shadow","Nightmare") //dammit Razor Razor - var/golem_name = "[edgy_first_name] [edgy_last_name]" - return golem_name - -/datum/species/golem/runic/on_species_gain(mob/living/carbon/C, datum/species/old_species) - . = ..() - C.faction |= "cult" - phase_shift = new - C.AddSpell(phase_shift) - abyssal_gaze = new - C.AddSpell(abyssal_gaze) - dominate = new - C.AddSpell(dominate) - -/datum/species/golem/runic/on_species_loss(mob/living/carbon/C) - . = ..() - C.faction -= "cult" - if(phase_shift) - C.RemoveSpell(phase_shift) - if(abyssal_gaze) - C.RemoveSpell(abyssal_gaze) - if(dominate) - C.RemoveSpell(dominate) - -/datum/species/golem/runic/handle_chemicals(datum/reagent/chem, mob/living/carbon/human/H) - if(chem.id == "holywater") - H.adjustFireLoss(4) - H.reagents.remove_reagent(chem.id, REAGENTS_METABOLISM) - - if(chem.id == "unholywater") - H.adjustBruteLoss(-4) - H.adjustFireLoss(-4) - H.reagents.remove_reagent(chem.id, REAGENTS_METABOLISM) - -/datum/species/golem/cloth - name = "Cloth Golem" - id = "cloth golem" - limbs_id = "clothgolem" - sexes = FALSE - info_text = "As a Cloth Golem, you are able to reform yourself after death, provided your remains aren't burned or destroyed. You are, of course, very flammable." - species_traits = list(NOBREATH,RESISTCOLD,RESISTPRESSURE,NOGUNS,NOBLOOD,RADIMMUNE,VIRUSIMMUNE,PIERCEIMMUNE,NODISMEMBER,NO_UNDERWEAR) //no mutcolors, and can burn - armor = 15 //feels no pain, but not too resistant - burnmod = 2 // don't get burned - speedmod = 1 // not as heavy as stone - punchdamagelow = 4 - punchstunthreshold = 7 - punchdamagehigh = 8 // not as heavy as stone - prefix = "Cloth" - -/datum/species/golem/cloth/random_name(gender,unique,lastname) - var/pharaoh_name = pick("Neferkare", "Hudjefa", "Khufu", "Mentuhotep", "Ahmose", "Amenhotep", "Thutmose", "Hatshepsut", "Tutankhamun", "Ramses", "Seti", \ - "Merenptah", "Djer", "Semerkhet", "Nynetjer", "Khafre", "Pepi", "Intef", "Ay") //yes, Ay was an actual pharaoh - var/golem_name = "[pharaoh_name] \Roman[rand(1,99)]" - return golem_name - -/datum/species/golem/cloth/spec_life(mob/living/carbon/human/H) - if(H.fire_stacks < 1) - H.adjust_fire_stacks(1) //always prone to burning - ..() - -/datum/species/golem/cloth/spec_death(gibbed, mob/living/carbon/human/H) - if(gibbed) - return - if(H.on_fire) - H.visible_message("[H] burns into ash!") - H.dust(just_ash = TRUE) - return - - H.visible_message("[H] falls apart into a pile of bandages!") - new /obj/structure/cloth_pile(get_turf(H), H) - ..() - -/obj/structure/cloth_pile - name = "pile of bandages" - desc = "It emits a strange aura, as if there was still life within it..." - obj_integrity = 50 - max_integrity = 50 - armor = list(melee = 90, bullet = 90, laser = 25, energy = 80, bomb = 50, bio = 100, fire = -50, acid = -50) - icon = 'icons/obj/items.dmi' - icon_state = "pile_bandages" - resistance_flags = FLAMMABLE - - var/revive_time = 900 - var/mob/living/carbon/human/cloth_golem - -/obj/structure/cloth_pile/Initialize(mapload, mob/living/carbon/human/H) - if(!QDELETED(H) && is_species(H, /datum/species/golem/cloth)) - H.unequip_everything() - H.forceMove(src) - cloth_golem = H - to_chat(cloth_golem, "You start gathering your life energy, preparing to rise again...") - addtimer(CALLBACK(src, .proc/revive), revive_time) - else - qdel(src) - -/obj/structure/cloth_pile/Destroy() - if(cloth_golem) - QDEL_NULL(cloth_golem) - return ..() - -/obj/structure/cloth_pile/burn() - visible_message("[src] burns into ash!") - new /obj/effect/decal/cleanable/ash(get_turf(src)) - ..() - -/obj/structure/cloth_pile/proc/revive() - if(QDELETED(src) || QDELETED(cloth_golem)) //QDELETED also checks for null, so if no cloth golem is set this won't runtime - return - if(cloth_golem.suiciding || cloth_golem.disabilities & NOCLONE) - QDEL_NULL(cloth_golem) - return - - invisibility = INVISIBILITY_MAXIMUM //disappear before the animation - new /obj/effect/overlay/temp/mummy_animation(get_turf(src)) - if(cloth_golem.revive(full_heal = TRUE, admin_revive = TRUE)) - cloth_golem.grab_ghost() //won't pull if it's a suicide - sleep(20) - cloth_golem.forceMove(get_turf(src)) - cloth_golem.visible_message("[src] rises and reforms into [cloth_golem]!","You reform into yourself!") - cloth_golem = null - qdel(src) - -/obj/structure/cloth_pile/attackby(obj/item/weapon/P, mob/living/carbon/human/user, params) - . = ..() - - if(resistance_flags & ON_FIRE) - return - - if(P.is_hot()) - visible_message("[src] bursts into flames!") - fire_act() - -/datum/species/golem/plastic - name = "Plastic" - id = "plastic golem" - prefix = "Plastic" - fixed_mut_color = "fff" - info_text = "As a Plastic Golem, you are capable of ventcrawling, and passing through plastic flaps." - -/datum/species/golem/plastic/on_species_gain(mob/living/carbon/C, datum/species/old_species) - . = ..() - C.ventcrawler = VENTCRAWLER_NUDE - -/datum/species/golem/plastic/on_species_loss(mob/living/carbon/C) - . = ..() +/datum/species/golem + // Animated beings of stone. They have increased defenses, and do not need to breathe. They're also slow as fuuuck. + name = "Golem" + id = "iron golem" + species_traits = list(NOBREATH,RESISTHOT,RESISTCOLD,RESISTPRESSURE,NOFIRE,NOGUNS,NOBLOOD,RADIMMUNE,VIRUSIMMUNE,PIERCEIMMUNE,NODISMEMBER,MUTCOLORS,NO_UNDERWEAR) + mutant_organs = list(/obj/item/organ/adamantine_resonator) + speedmod = 2 + armor = 55 + siemens_coeff = 0 + punchdamagelow = 5 + punchdamagehigh = 14 + punchstunthreshold = 11 //about 40% chance to stun + no_equip = list(slot_wear_mask, slot_wear_suit, slot_gloves, slot_shoes, slot_w_uniform, slot_s_store) + nojumpsuit = 1 + sexes = 1 + damage_overlay_type = "" + meat = /obj/item/weapon/reagent_containers/food/snacks/meat/slab/human/mutant/golem + // To prevent golem subtypes from overwhelming the odds when random species + // changes, only the Random Golem type can be chosen + blacklisted = TRUE + dangerous_existence = TRUE + limbs_id = "golem" + fixed_mut_color = "aaa" + var/info_text = "As an Iron Golem, you don't have any special traits." + + var/prefix = "Iron" + var/list/special_names + var/human_surname_chance = 3 + var/special_name_chance = 5 + +/datum/species/golem/random_name(gender,unique,lastname) + var/golem_surname = pick(GLOB.golem_names) + // 3% chance that our golem has a human surname, because + // cultural contamination + if(prob(human_surname_chance)) + golem_surname = pick(GLOB.last_names) + else if(special_names && special_names.len && prob(special_name_chance)) + golem_surname = pick(special_names) + + var/golem_name = "[prefix] [golem_surname]" + return golem_name + +/datum/species/golem/random + name = "Random Golem" + blacklisted = FALSE + dangerous_existence = FALSE + +/datum/species/golem/random/on_species_gain(mob/living/carbon/C, datum/species/old_species) + ..() + var/list/golem_types = typesof(/datum/species/golem) - src.type + var/datum/species/golem/golem_type = pick(golem_types) + var/mob/living/carbon/human/H = C + H.set_species(golem_type) + to_chat(H, "[initial(golem_type.info_text)]") + +/datum/species/golem/adamantine + name = "Adamantine Golem" + id = "adamantine golem" + meat = /obj/item/weapon/reagent_containers/food/snacks/meat/slab/human/mutant/golem/adamantine + mutant_organs = list(/obj/item/organ/adamantine_resonator, /obj/item/organ/vocal_cords/adamantine) + fixed_mut_color = "4ed" + info_text = "As an Adamantine Golem, you possess special vocal cords allowing you to \"resonate\" messages to all golems." + prefix = "Adamantine" + +//The suicide bombers of golemkind +/datum/species/golem/plasma + name = "Plasma Golem" + id = "plasma golem" + fixed_mut_color = "a3d" + meat = /obj/item/weapon/ore/plasma + //Can burn and takes damage from heat + species_traits = list(NOBREATH,RESISTCOLD,RESISTPRESSURE,NOGUNS,NOBLOOD,RADIMMUNE,VIRUSIMMUNE,PIERCEIMMUNE,NODISMEMBER,MUTCOLORS,NO_UNDERWEAR) + info_text = "As a Plasma Golem, you burn easily. Be careful, if you get hot enough while burning, you'll blow up!" + heatmod = 0 //fine until they blow up + prefix = "Plasma" + special_names = list("Flood","Fire","Bar","Man") + var/boom_warning = FALSE + var/datum/action/innate/ignite/ignite + +/datum/species/golem/plasma/spec_life(mob/living/carbon/human/H) + if(H.bodytemperature > 750) + if(!boom_warning && H.on_fire) + to_chat(H, "You feel like you could blow up at any moment!") + boom_warning = TRUE + else + if(boom_warning) + to_chat(H, "You feel more stable.") + boom_warning = FALSE + + if(H.bodytemperature > 850 && H.on_fire && prob(25)) + explosion(get_turf(H),1,2,4,flame_range = 5) + if(H) + H.gib() + if(H.fire_stacks < 2) //flammable + H.adjust_fire_stacks(1) + ..() + +/datum/species/golem/plasma/on_species_gain(mob/living/carbon/C, datum/species/old_species) + ..() + if(ishuman(C)) + ignite = new + ignite.Grant(C) + +/datum/species/golem/plasma/on_species_loss(mob/living/carbon/C) + if(ignite) + ignite.Remove(C) + ..() + +/datum/action/innate/ignite + name = "Ignite" + desc = "Set yourself aflame, bringing yourself closer to exploding!" + check_flags = AB_CHECK_CONSCIOUS + button_icon_state = "sacredflame" + +/datum/action/innate/ignite/Activate() + if(ishuman(owner)) + var/mob/living/carbon/human/H = owner + if(H.fire_stacks) + to_chat(owner, "You ignite yourself!") + else + to_chat(owner, "You try ignite yourself, but fail!") + H.IgniteMob() //firestacks are already there passively + +//Harder to hurt +/datum/species/golem/diamond + name = "Diamond Golem" + id = "diamond golem" + fixed_mut_color = "0ff" + armor = 70 //up from 55 + meat = /obj/item/weapon/ore/diamond + info_text = "As a Diamond Golem, you are more resistant than the average golem." + prefix = "Diamond" + special_names = list("Back") + +//Faster but softer and less armoured +/datum/species/golem/gold + name = "Gold Golem" + id = "gold golem" + fixed_mut_color = "cc0" + speedmod = 1 + armor = 25 //down from 55 + meat = /obj/item/weapon/ore/gold + info_text = "As a Gold Golem, you are faster but less resistant than the average golem." + prefix = "Golden" + +//Heavier, thus higher chance of stunning when punching +/datum/species/golem/silver + name = "Silver Golem" + id = "silver golem" + fixed_mut_color = "ddd" + punchstunthreshold = 9 //60% chance, from 40% + meat = /obj/item/weapon/ore/silver + info_text = "As a Silver Golem, your attacks are heavier and have a higher chance of stunning." + prefix = "Silver" + special_names = list("Surfer", "Chariot", "Lining") + +//Harder to stun, deals more damage, but it's even slower +/datum/species/golem/plasteel + name = "Plasteel Golem" + id = "plasteel golem" + fixed_mut_color = "bbb" + stunmod = 0.40 + punchdamagelow = 12 + punchdamagehigh = 21 + punchstunthreshold = 18 //still 40% stun chance + speedmod = 4 //pretty fucking slow + meat = /obj/item/weapon/ore/iron + info_text = "As a Plasteel Golem, you are slower, but harder to stun, and hit very hard when punching." + attack_verb = "smash" + attack_sound = 'sound/effects/meteorimpact.ogg' //hits pretty hard + prefix = "Plasteel" + +//Immune to ash storms +/datum/species/golem/titanium + name = "Titanium Golem" + id = "titanium golem" + fixed_mut_color = "fff" + meat = /obj/item/weapon/ore/titanium + info_text = "As a Titanium Golem, you are immune to ash storms, and slightly more resistant to burn damage." + burnmod = 0.9 + prefix = "Titanium" + +/datum/species/golem/titanium/on_species_gain(mob/living/carbon/C, datum/species/old_species) + . = ..() + C.weather_immunities |= "ash" + +/datum/species/golem/titanium/on_species_loss(mob/living/carbon/C) + . = ..() + C.weather_immunities -= "ash" + +//Immune to ash storms and lava +/datum/species/golem/plastitanium + name = "Plastitanium Golem" + id = "plastitanium golem" + fixed_mut_color = "888" + meat = /obj/item/weapon/ore/titanium + info_text = "As a Plastitanium Golem, you are immune to both ash storms and lava, and slightly more resistant to burn damage." + burnmod = 0.8 + prefix = "Plastitanium" + +/datum/species/golem/plastitanium/on_species_gain(mob/living/carbon/C, datum/species/old_species) + . = ..() + C.weather_immunities |= "lava" + C.weather_immunities |= "ash" + +/datum/species/golem/plastitanium/on_species_loss(mob/living/carbon/C) + . = ..() + C.weather_immunities -= "ash" + C.weather_immunities -= "lava" + +//Fast and regenerates... but can only speak like an abductor +/datum/species/golem/alloy + name = "Alien Alloy Golem" + id = "alloy golem" + fixed_mut_color = "333" + meat = /obj/item/stack/sheet/mineral/abductor + mutanttongue = /obj/item/organ/tongue/abductor + speedmod = 1 //faster + info_text = "As an Alloy Golem, you are made of advanced alien materials: you are faster and regenerate over time. You are, however, only able to be heard by other alloy golems." + prefix = "Alien" + special_names = list("Outsider", "Technology", "Watcher", "Stranger") //ominous and unknown + +//Regenerates because self-repairing super-advanced alien tech +/datum/species/golem/alloy/spec_life(mob/living/carbon/human/H) + if(H.stat == DEAD) + return + H.heal_overall_damage(2,2) + H.adjustToxLoss(-2) + H.adjustOxyLoss(-2) + +//Since this will usually be created from a collaboration between podpeople and free golems, wood golems are a mix between the two races +/datum/species/golem/wood + name = "Wood Golem" + id = "wood golem" + fixed_mut_color = "49311c" + meat = /obj/item/stack/sheet/mineral/wood + //Can burn and take damage from heat + species_traits = list(NOBREATH,RESISTCOLD,RESISTPRESSURE,NOGUNS,NOBLOOD,RADIMMUNE,VIRUSIMMUNE,PIERCEIMMUNE,NODISMEMBER,MUTCOLORS,NO_UNDERWEAR) + armor = 30 + burnmod = 1.25 + heatmod = 1.5 + info_text = "As a Wooden Golem, you have plant-like traits: you take damage from extreme temperatures, can be set on fire, and have lower armor than a normal golem. You regenerate when in the light and wither in the darkness." + prefix = "Wooden" + special_names = list("Tomato", "Potato", "Broccoli", "Carrot", "Ambrosia", "Pumpkin", "Ivy", "Kudzu", "Banana", "Moss", "Flower", "Bloom", "Root", "Bark", "Glowshroom", "Petal", "Leaf", "Venus", "Sprout","Cocoa", "Strawberry", "Citrus", "Oak", "Cactus", "Pepper", "Juniper") + human_surname_chance = 0 + special_name_chance = 100 + +/datum/species/golem/wood/on_species_gain(mob/living/carbon/C, datum/species/old_species) + . = ..() + C.faction |= "plants" + C.faction |= "vines" + +/datum/species/golem/wood/on_species_loss(mob/living/carbon/C) + . = ..() + C.faction -= "plants" + C.faction -= "vines" + +/datum/species/golem/wood/spec_life(mob/living/carbon/human/H) + if(H.stat == DEAD) + return + var/light_amount = 0 //how much light there is in the place, affects receiving nutrition and healing + if(isturf(H.loc)) //else, there's considered to be no light + var/turf/T = H.loc + light_amount = min(1,T.get_lumcount()) - 0.5 + H.nutrition += light_amount * 10 + if(H.nutrition > NUTRITION_LEVEL_FULL) + H.nutrition = NUTRITION_LEVEL_FULL + if(light_amount > 0.2) //if there's enough light, heal + H.heal_overall_damage(1,1) + H.adjustToxLoss(-1) + H.adjustOxyLoss(-1) + + if(H.nutrition < NUTRITION_LEVEL_STARVING + 50) + H.take_overall_damage(2,0) + +/datum/species/golem/wood/handle_chemicals(datum/reagent/chem, mob/living/carbon/human/H) + if(chem.id == "plantbgone") + H.adjustToxLoss(3) + H.reagents.remove_reagent(chem.id, REAGENTS_METABOLISM) + return 1 + +//Radioactive +/datum/species/golem/uranium + name = "Uranium Golem" + id = "uranium golem" + fixed_mut_color = "7f0" + meat = /obj/item/weapon/ore/uranium + info_text = "As an Uranium Golem, you emit radiation pulses every once in a while. It won't harm fellow golems, but organic lifeforms will be affected." + + var/last_event = 0 + var/active = null + prefix = "Uranium" + +/datum/species/golem/uranium/spec_life(mob/living/carbon/human/H) + if(!active) + if(world.time > last_event+30) + active = 1 + radiation_pulse(get_turf(H), 3, 3, 5, 0) + last_event = world.time + active = null + ..() + +//Immune to physical bullets and resistant to brute, but very vulnerable to burn damage. Dusts on death. +/datum/species/golem/sand + name = "Sand Golem" + id = "sand golem" + fixed_mut_color = "ffdc8f" + meat = /obj/item/weapon/ore/glass //this is sand + armor = 0 + burnmod = 3 //melts easily + brutemod = 0.25 + info_text = "As a Sand Golem, you are immune to physical bullets and take very little brute damage, but are extremely vulnerable to burn damage. You will also turn to sand when dying, preventing any form of recovery." + attack_sound = 'sound/effects/shovel_dig.ogg' + prefix = "Sand" + +/datum/species/golem/sand/spec_death(gibbed, mob/living/carbon/human/H) + H.visible_message("[H] turns into a pile of sand!") + for(var/obj/item/W in H) + H.dropItemToGround(W) + for(var/i=1, i <= rand(3,5), i++) + new /obj/item/weapon/ore/glass(get_turf(H)) + qdel(H) + +/datum/species/golem/sand/bullet_act(obj/item/projectile/P, mob/living/carbon/human/H) + if(!(P.original == H && P.firer == H)) + if(P.flag == "bullet" || P.flag == "bomb") + playsound(H, 'sound/effects/shovel_dig.ogg', 70, 1) + H.visible_message("The [P.name] sinks harmlessly in [H]'s sandy body!", \ + "The [P.name] sinks harmlessly in [H]'s sandy body!") + return 2 + return 0 + +//Reflects lasers and resistant to burn damage, but very vulnerable to brute damage. Shatters on death. +/datum/species/golem/glass + name = "Glass Golem" + id = "glass golem" + fixed_mut_color = "5a96b4aa" //transparent body + meat = /obj/item/weapon/shard + armor = 0 + brutemod = 3 //very fragile + burnmod = 0.25 + info_text = "As a Glass Golem, you reflect lasers and energy weapons, and are very resistant to burn damage, but you are extremely vulnerable to brute damage. On death, you'll shatter beyond any hope of recovery." + attack_sound = 'sound/effects/Glassbr2.ogg' + prefix = "Glass" + +/datum/species/golem/glass/spec_death(gibbed, mob/living/carbon/human/H) + playsound(H, "shatter", 70, 1) + H.visible_message("[H] shatters!") + for(var/obj/item/W in H) + H.dropItemToGround(W) + for(var/i=1, i <= rand(3,5), i++) + new /obj/item/weapon/shard(get_turf(H)) + qdel(H) + +/datum/species/golem/glass/bullet_act(obj/item/projectile/P, mob/living/carbon/human/H) + if(!(P.original == H && P.firer == H)) //self-shots don't reflect + if(P.flag == "laser" || P.flag == "energy") + H.visible_message("The [P.name] gets reflected by [H]'s glass skin!", \ + "The [P.name] gets reflected by [H]'s glass skin!") + if(P.starting) + var/new_x = P.starting.x + pick(0, 0, 0, 0, 0, -1, 1, -2, 2) + var/new_y = P.starting.y + pick(0, 0, 0, 0, 0, -1, 1, -2, 2) + var/turf/curloc = get_turf(H) + + // redirect the projectile + P.original = locate(new_x, new_y, P.z) + P.starting = curloc + P.current = curloc + P.firer = H + P.yo = new_y - curloc.y + P.xo = new_x - curloc.x + P.Angle = null + return -1 + return 0 + +//Teleports when hit or when it wants to +/datum/species/golem/bluespace + name = "Bluespace Golem" + id = "bluespace golem" + fixed_mut_color = "33f" + meat = /obj/item/weapon/ore/bluespace_crystal + info_text = "As a Bluespace Golem, are spatially unstable: you will teleport when hit, and you can teleport manually at a long distance." + attack_verb = "bluespace punch" + attack_sound = 'sound/effects/phasein.ogg' + prefix = "Bluespace" + special_names = list("Crystal", "Polycrystal") + + var/datum/action/innate/unstable_teleport/unstable_teleport + var/teleport_cooldown = 100 + var/last_teleport = 0 + +/datum/species/golem/bluespace/proc/reactive_teleport(mob/living/carbon/human/H) + H.visible_message("[H] teleports!", "You destabilize and teleport!") + new /obj/effect/particle_effect/sparks(get_turf(H)) + playsound(get_turf(H), "sparks", 50, 1) + do_teleport(H, get_turf(H), 6, asoundin = 'sound/weapons/emitter2.ogg') + last_teleport = world.time + +/datum/species/golem/bluespace/spec_hitby(atom/movable/AM, mob/living/carbon/human/H) + ..() + var/obj/item/I + if(istype(AM, /obj/item)) + I = AM + if(I.thrownby == H) //No throwing stuff at yourself to trigger the teleport + return 0 + else + reactive_teleport(H) + +/datum/species/golem/bluespace/spec_attack_hand(mob/living/carbon/human/M, mob/living/carbon/human/H, datum/martial_art/attacker_style = M.martial_art) + ..() + if(world.time > last_teleport + teleport_cooldown && M != H && M.a_intent != INTENT_HELP) + reactive_teleport(H) + +/datum/species/golem/bluespace/spec_attacked_by(obj/item/I, mob/living/user, obj/item/bodypart/affecting, intent, mob/living/carbon/human/H) + ..() + if(world.time > last_teleport + teleport_cooldown && user != H) + reactive_teleport(H) + +/datum/species/golem/bluespace/on_hit(obj/item/projectile/P, mob/living/carbon/human/H) + ..() + if(world.time > last_teleport + teleport_cooldown) + reactive_teleport(H) + +/datum/species/golem/bluespace/on_species_gain(mob/living/carbon/C, datum/species/old_species) + ..() + if(ishuman(C)) + unstable_teleport = new + unstable_teleport.Grant(C) + +/datum/species/golem/bluespace/on_species_loss(mob/living/carbon/C) + if(unstable_teleport) + unstable_teleport.Remove(C) + ..() + +/datum/action/innate/unstable_teleport + name = "Unstable Teleport" + check_flags = AB_CHECK_CONSCIOUS + button_icon_state = "jaunt" + var/cooldown = 150 + var/last_teleport = 0 + +/datum/action/innate/unstable_teleport/IsAvailable() + if(..()) + if(world.time > last_teleport + cooldown) + return 1 + return 0 + +/datum/action/innate/unstable_teleport/Activate() + var/mob/living/carbon/human/H = owner + H.visible_message("[H] starts vibrating!", "You start charging your bluespace core...") + playsound(get_turf(H), 'sound/weapons/flash.ogg', 25, 1) + addtimer(CALLBACK(src, .proc/teleport, H), 15) + +/datum/action/innate/unstable_teleport/proc/teleport(mob/living/carbon/human/H) + H.visible_message("[H] disappears in a shower of sparks!", "You teleport!") + var/datum/effect_system/spark_spread/spark_system = new /datum/effect_system/spark_spread + spark_system.set_up(10, 0, src) + spark_system.attach(H) + spark_system.start() + do_teleport(H, get_turf(H), 12, asoundin = 'sound/weapons/emitter2.ogg') + last_teleport = world.time + UpdateButtonIcon() //action icon looks unavailable + sleep(cooldown + 5) + UpdateButtonIcon() //action icon looks available again + + +//honk +/datum/species/golem/bananium + name = "Bananium Golem" + id = "bananium golem" + fixed_mut_color = "ff0" + say_mod = "honks" + punchdamagelow = 0 + punchdamagehigh = 1 + punchstunthreshold = 2 //Harmless and can't stun + meat = /obj/item/weapon/ore/bananium + info_text = "As a Bananium Golem, you are made for pranking. Your body emits natural honks, and you cannot hurt people when punching them. Your skin also emits bananas when damaged." + attack_verb = "honk" + attack_sound = 'sound/items/AirHorn2.ogg' + prefix = "Bananium" + + var/last_honk = 0 + var/honkooldown = 0 + var/last_banana = 0 + var/banana_cooldown = 100 + var/active = null + +/datum/species/golem/bananium/random_name(gender,unique,lastname) + var/clown_name = pick(GLOB.clown_names) + var/golem_name = "[uppertext(clown_name)]" + return golem_name + +/datum/species/golem/bananium/spec_attack_hand(mob/living/carbon/human/M, mob/living/carbon/human/H, datum/martial_art/attacker_style = M.martial_art) + ..() + if(world.time > last_banana + banana_cooldown && M != H && M.a_intent != INTENT_HELP) + new/obj/item/weapon/grown/bananapeel/specialpeel(get_turf(H)) + last_banana = world.time + +/datum/species/golem/bananium/spec_attacked_by(obj/item/I, mob/living/user, obj/item/bodypart/affecting, intent, mob/living/carbon/human/H) + ..() + if(world.time > last_banana + banana_cooldown && user != H) + new/obj/item/weapon/grown/bananapeel/specialpeel(get_turf(H)) + last_banana = world.time + +/datum/species/golem/bananium/on_hit(obj/item/projectile/P, mob/living/carbon/human/H) + ..() + if(world.time > last_banana + banana_cooldown) + new/obj/item/weapon/grown/bananapeel/specialpeel(get_turf(H)) + last_banana = world.time + +/datum/species/golem/bananium/spec_hitby(atom/movable/AM, mob/living/carbon/human/H) + ..() + var/obj/item/I + if(istype(AM, /obj/item)) + I = AM + if(I.thrownby == H) //No throwing stuff at yourself to make bananas + return 0 + else + new/obj/item/weapon/grown/bananapeel/specialpeel(get_turf(H)) + last_banana = world.time + +/datum/species/golem/bananium/spec_life(mob/living/carbon/human/H) + if(!active) + if(world.time > last_honk + honkooldown) + active = 1 + playsound(get_turf(H), 'sound/items/bikehorn.ogg', 50, 1) + last_honk = world.time + honkooldown = rand(20, 80) + active = null + ..() + +/datum/species/golem/bananium/spec_death(gibbed, mob/living/carbon/human/H) + playsound(get_turf(H), 'sound/misc/sadtrombone.ogg', 70, 0) + +/datum/species/golem/bananium/get_spans() + return list(SPAN_CLOWN) + + +/datum/species/golem/runic + name = "Runic Golem" + id = "runic golem" + limbs_id = "cultgolem" + sexes = FALSE + info_text = "As a Runic Golem, you possess eldritch powers granted by the Elder God Nar'Sie." + species_traits = list(NOBREATH,RESISTHOT,RESISTCOLD,RESISTPRESSURE,NOFIRE,NOGUNS,NOBLOOD,RADIMMUNE,VIRUSIMMUNE,PIERCEIMMUNE,NODISMEMBER,NO_UNDERWEAR) //no mutcolors + prefix = "Runic" + + var/obj/effect/proc_holder/spell/targeted/ethereal_jaunt/shift/golem/phase_shift + var/obj/effect/proc_holder/spell/targeted/abyssal_gaze/abyssal_gaze + var/obj/effect/proc_holder/spell/targeted/dominate/dominate + +/datum/species/golem/runic/random_name(gender,unique,lastname) + var/edgy_first_name = pick("Razor","Blood","Dark","Evil","Cold","Pale","Black","Silent","Chaos","Deadly") + var/edgy_last_name = pick("Edge","Night","Death","Razor","Blade","Steel","Calamity","Twilight","Shadow","Nightmare") //dammit Razor Razor + var/golem_name = "[edgy_first_name] [edgy_last_name]" + return golem_name + +/datum/species/golem/runic/on_species_gain(mob/living/carbon/C, datum/species/old_species) + . = ..() + C.faction |= "cult" + phase_shift = new + C.AddSpell(phase_shift) + abyssal_gaze = new + C.AddSpell(abyssal_gaze) + dominate = new + C.AddSpell(dominate) + +/datum/species/golem/runic/on_species_loss(mob/living/carbon/C) + . = ..() + C.faction -= "cult" + if(phase_shift) + C.RemoveSpell(phase_shift) + if(abyssal_gaze) + C.RemoveSpell(abyssal_gaze) + if(dominate) + C.RemoveSpell(dominate) + +/datum/species/golem/runic/handle_chemicals(datum/reagent/chem, mob/living/carbon/human/H) + if(chem.id == "holywater") + H.adjustFireLoss(4) + H.reagents.remove_reagent(chem.id, REAGENTS_METABOLISM) + + if(chem.id == "unholywater") + H.adjustBruteLoss(-4) + H.adjustFireLoss(-4) + H.reagents.remove_reagent(chem.id, REAGENTS_METABOLISM) + +/datum/species/golem/cloth + name = "Cloth Golem" + id = "cloth golem" + limbs_id = "clothgolem" + sexes = FALSE + info_text = "As a Cloth Golem, you are able to reform yourself after death, provided your remains aren't burned or destroyed. You are, of course, very flammable." + species_traits = list(NOBREATH,RESISTCOLD,RESISTPRESSURE,NOGUNS,NOBLOOD,RADIMMUNE,VIRUSIMMUNE,PIERCEIMMUNE,NODISMEMBER,NO_UNDERWEAR) //no mutcolors, and can burn + armor = 15 //feels no pain, but not too resistant + burnmod = 2 // don't get burned + speedmod = 1 // not as heavy as stone + punchdamagelow = 4 + punchstunthreshold = 7 + punchdamagehigh = 8 // not as heavy as stone + prefix = "Cloth" + +/datum/species/golem/cloth/random_name(gender,unique,lastname) + var/pharaoh_name = pick("Neferkare", "Hudjefa", "Khufu", "Mentuhotep", "Ahmose", "Amenhotep", "Thutmose", "Hatshepsut", "Tutankhamun", "Ramses", "Seti", \ + "Merenptah", "Djer", "Semerkhet", "Nynetjer", "Khafre", "Pepi", "Intef", "Ay") //yes, Ay was an actual pharaoh + var/golem_name = "[pharaoh_name] \Roman[rand(1,99)]" + return golem_name + +/datum/species/golem/cloth/spec_life(mob/living/carbon/human/H) + if(H.fire_stacks < 1) + H.adjust_fire_stacks(1) //always prone to burning + ..() + +/datum/species/golem/cloth/spec_death(gibbed, mob/living/carbon/human/H) + if(gibbed) + return + if(H.on_fire) + H.visible_message("[H] burns into ash!") + H.dust(just_ash = TRUE) + return + + H.visible_message("[H] falls apart into a pile of bandages!") + new /obj/structure/cloth_pile(get_turf(H), H) + ..() + +/obj/structure/cloth_pile + name = "pile of bandages" + desc = "It emits a strange aura, as if there was still life within it..." + obj_integrity = 50 + max_integrity = 50 + armor = list(melee = 90, bullet = 90, laser = 25, energy = 80, bomb = 50, bio = 100, fire = -50, acid = -50) + icon = 'icons/obj/items.dmi' + icon_state = "pile_bandages" + resistance_flags = FLAMMABLE + + var/revive_time = 900 + var/mob/living/carbon/human/cloth_golem + +/obj/structure/cloth_pile/Initialize(mapload, mob/living/carbon/human/H) + if(!QDELETED(H) && is_species(H, /datum/species/golem/cloth)) + H.unequip_everything() + H.forceMove(src) + cloth_golem = H + to_chat(cloth_golem, "You start gathering your life energy, preparing to rise again...") + addtimer(CALLBACK(src, .proc/revive), revive_time) + else + qdel(src) + +/obj/structure/cloth_pile/Destroy() + if(cloth_golem) + QDEL_NULL(cloth_golem) + return ..() + +/obj/structure/cloth_pile/burn() + visible_message("[src] burns into ash!") + new /obj/effect/decal/cleanable/ash(get_turf(src)) + ..() + +/obj/structure/cloth_pile/proc/revive() + if(QDELETED(src) || QDELETED(cloth_golem)) //QDELETED also checks for null, so if no cloth golem is set this won't runtime + return + if(cloth_golem.suiciding || cloth_golem.disabilities & NOCLONE) + QDEL_NULL(cloth_golem) + return + + invisibility = INVISIBILITY_MAXIMUM //disappear before the animation + new /obj/effect/overlay/temp/mummy_animation(get_turf(src)) + if(cloth_golem.revive(full_heal = TRUE, admin_revive = TRUE)) + cloth_golem.grab_ghost() //won't pull if it's a suicide + sleep(20) + cloth_golem.forceMove(get_turf(src)) + cloth_golem.visible_message("[src] rises and reforms into [cloth_golem]!","You reform into yourself!") + cloth_golem = null + qdel(src) + +/obj/structure/cloth_pile/attackby(obj/item/weapon/P, mob/living/carbon/human/user, params) + . = ..() + + if(resistance_flags & ON_FIRE) + return + + if(P.is_hot()) + visible_message("[src] bursts into flames!") + fire_act() + +/datum/species/golem/plastic + name = "Plastic" + id = "plastic golem" + prefix = "Plastic" + fixed_mut_color = "fff" + info_text = "As a Plastic Golem, you are capable of ventcrawling, and passing through plastic flaps." + +/datum/species/golem/plastic/on_species_gain(mob/living/carbon/C, datum/species/old_species) + . = ..() + C.ventcrawler = VENTCRAWLER_NUDE + +/datum/species/golem/plastic/on_species_loss(mob/living/carbon/C) + . = ..() C.ventcrawler = initial(C.ventcrawler) \ No newline at end of file diff --git a/code/modules/mob/living/carbon/human/species_types/zombies.dm b/code/modules/mob/living/carbon/human/species_types/zombies.dm index fd64850882..239d901e5c 100644 --- a/code/modules/mob/living/carbon/human/species_types/zombies.dm +++ b/code/modules/mob/living/carbon/human/species_types/zombies.dm @@ -1,50 +1,50 @@ -/datum/species/zombie - // 1spooky - name = "High Functioning Zombie" - id = "zombie" - say_mod = "moans" - sexes = 0 - blacklisted = 1 - meat = /obj/item/weapon/reagent_containers/food/snacks/meat/slab/human/mutant/zombie - species_traits = list(NOBREATH,RESISTCOLD,RESISTPRESSURE,NOBLOOD,RADIMMUNE,NOZOMBIE,EASYDISMEMBER,EASYLIMBATTACHMENT) - mutant_organs = list(/obj/item/organ/tongue/zombie) - -/datum/species/zombie/infectious - name = "Infectious Zombie" - id = "memezombies" - limbs_id = "zombie" - mutanthands = /obj/item/zombie_hand - no_equip = list(slot_wear_mask, slot_head) - armor = 20 // 120 damage to KO a zombie, which kills it - speedmod = 2 - mutanteyes = /obj/item/organ/eyes/night_vision/zombie - -/datum/species/zombie/infectious/spec_life(mob/living/carbon/C) - . = ..() - C.a_intent = INTENT_HARM // THE SUFFERING MUST FLOW - if(C.InCritical()) - C.death() - // Zombies only move around when not in crit, they instantly - // succumb otherwise, and will standup again soon - -/datum/species/zombie/infectious/on_species_gain(mob/living/carbon/C, datum/species/old_species) - . = ..() - - // Deal with the source of this zombie corruption - // Infection organ needs to be handled separately from mutant_organs - // because it persists through species transitions - var/obj/item/organ/zombie_infection/infection - infection = C.getorganslot("zombie_infection") - if(!infection) - infection = new() - infection.Insert(C) - - -// Your skin falls off -/datum/species/krokodil_addict - name = "Human" - id = "goofzombies" - limbs_id = "zombie" //They look like zombies - sexes = 0 - meat = /obj/item/weapon/reagent_containers/food/snacks/meat/slab/human/mutant/zombie - mutant_organs = list(/obj/item/organ/tongue/zombie) +/datum/species/zombie + // 1spooky + name = "High Functioning Zombie" + id = "zombie" + say_mod = "moans" + sexes = 0 + blacklisted = 1 + meat = /obj/item/weapon/reagent_containers/food/snacks/meat/slab/human/mutant/zombie + species_traits = list(NOBREATH,RESISTCOLD,RESISTPRESSURE,NOBLOOD,RADIMMUNE,NOZOMBIE,EASYDISMEMBER,EASYLIMBATTACHMENT) + mutant_organs = list(/obj/item/organ/tongue/zombie) + +/datum/species/zombie/infectious + name = "Infectious Zombie" + id = "memezombies" + limbs_id = "zombie" + mutanthands = /obj/item/zombie_hand + no_equip = list(slot_wear_mask, slot_head) + armor = 20 // 120 damage to KO a zombie, which kills it + speedmod = 2 + mutanteyes = /obj/item/organ/eyes/night_vision/zombie + +/datum/species/zombie/infectious/spec_life(mob/living/carbon/C) + . = ..() + C.a_intent = INTENT_HARM // THE SUFFERING MUST FLOW + if(C.InCritical()) + C.death() + // Zombies only move around when not in crit, they instantly + // succumb otherwise, and will standup again soon + +/datum/species/zombie/infectious/on_species_gain(mob/living/carbon/C, datum/species/old_species) + . = ..() + + // Deal with the source of this zombie corruption + // Infection organ needs to be handled separately from mutant_organs + // because it persists through species transitions + var/obj/item/organ/zombie_infection/infection + infection = C.getorganslot("zombie_infection") + if(!infection) + infection = new() + infection.Insert(C) + + +// Your skin falls off +/datum/species/krokodil_addict + name = "Human" + id = "goofzombies" + limbs_id = "zombie" //They look like zombies + sexes = 0 + meat = /obj/item/weapon/reagent_containers/food/snacks/meat/slab/human/mutant/zombie + mutant_organs = list(/obj/item/organ/tongue/zombie) diff --git a/code/modules/mob/living/simple_animal/friendly/cat.dm b/code/modules/mob/living/simple_animal/friendly/cat.dm index 6de5fe8836..159aec35af 100644 --- a/code/modules/mob/living/simple_animal/friendly/cat.dm +++ b/code/modules/mob/living/simple_animal/friendly/cat.dm @@ -1,274 +1,274 @@ -//Cat -/mob/living/simple_animal/pet/cat - name = "cat" - desc = "Kitty!!" - icon = 'icons/mob/pets.dmi' - icon_state = "cat2" - icon_living = "cat2" - icon_dead = "cat2_dead" - gender = MALE - speak = list("Meow!", "Esp!", "Purr!", "HSSSSS") - speak_emote = list("purrs", "meows") - emote_hear = list("meows", "mews") - emote_see = list("shakes its head", "shivers") - speak_chance = 1 - turns_per_move = 5 - see_in_dark = 6 - ventcrawler = VENTCRAWLER_ALWAYS - pass_flags = PASSTABLE - mob_size = MOB_SIZE_SMALL - minbodytemp = 200 - maxbodytemp = 400 - unsuitable_atmos_damage = 1 - animal_species = /mob/living/simple_animal/pet/cat - childtype = list(/mob/living/simple_animal/pet/cat/kitten) - butcher_results = list(/obj/item/weapon/reagent_containers/food/snacks/meat/slab = 2) - response_help = "pets" - response_disarm = "gently pushes aside" - response_harm = "kicks" - var/turns_since_scan = 0 - var/mob/living/simple_animal/mouse/movement_target - gold_core_spawnable = 2 - devourable = TRUE - -/mob/living/simple_animal/pet/cat/Initialize() - ..() - verbs += /mob/living/proc/lay_down - -/mob/living/simple_animal/pet/cat/update_canmove() - ..() - if(client) - if (resting) - icon_state = "[icon_living]_rest" - else - icon_state = "[icon_living]" - - -/mob/living/simple_animal/pet/cat/space - name = "space cat" - desc = "It's a cat... in space!" - icon_state = "spacecat" - icon_living = "spacecat" - icon_dead = "spacecat_dead" - unsuitable_atmos_damage = 0 - minbodytemp = TCMB - maxbodytemp = T0C + 40 - -/mob/living/simple_animal/pet/cat/original - name = "Batsy" - desc = "The product of alien DNA and bored geneticists." - gender = FEMALE - icon_state = "original" - icon_living = "original" - icon_dead = "original_dead" - -/mob/living/simple_animal/pet/cat/kitten - name = "kitten" - desc = "D'aaawwww." - icon_state = "kitten" - icon_living = "kitten" - icon_dead = "kitten_dead" - density = 0 - pass_flags = PASSMOB - mob_size = MOB_SIZE_SMALL - -//RUNTIME IS ALIVE! SQUEEEEEEEE~ -/mob/living/simple_animal/pet/cat/Runtime - name = "Runtime" - desc = "GCAT" - icon_state = "cat" - icon_living = "cat" - icon_dead = "cat_dead" - gender = FEMALE - gold_core_spawnable = 0 - var/list/family = list()//var restored from savefile, has count of each child type - var/list/children = list()//Actual mob instances of children - var/cats_deployed = 0 - var/memory_saved = 0 - -/mob/living/simple_animal/pet/cat/Runtime/Initialize() - if(prob(5)) - icon_state = "original" - icon_living = "original" - icon_dead = "original_dead" - Read_Memory() - ..() - -/mob/living/simple_animal/pet/cat/Runtime/Life() - if(!cats_deployed && SSticker.current_state >= GAME_STATE_SETTING_UP) - Deploy_The_Cats() - if(!stat && SSticker.current_state == GAME_STATE_FINISHED && !memory_saved) - Write_Memory() - ..() - -/mob/living/simple_animal/pet/cat/Runtime/make_babies() - var/mob/baby = ..() - if(baby) - children += baby - return baby - -/mob/living/simple_animal/pet/cat/Runtime/death() - if(!memory_saved) - Write_Memory(1) - ..() - -/mob/living/simple_animal/pet/cat/Runtime/proc/Read_Memory() - var/savefile/S = new /savefile("data/npc_saves/Runtime.sav") - S["family"] >> family - - if(isnull(family)) - family = list() - -/mob/living/simple_animal/pet/cat/Runtime/proc/Write_Memory(dead) - var/savefile/S = new /savefile("data/npc_saves/Runtime.sav") - family = list() - if(!dead) - for(var/mob/living/simple_animal/pet/cat/kitten/C in children) - if(istype(C,type) || C.stat || !C.z || !C.butcher_results) //That last one is a work around for hologram cats - continue - if(C.type in family) - family[C.type] += 1 - else - family[C.type] = 1 - S["family"] << family - memory_saved = 1 - -/mob/living/simple_animal/pet/cat/Runtime/proc/Deploy_The_Cats() - cats_deployed = 1 - for(var/cat_type in family) - if(family[cat_type] > 0) - for(var/i in 1 to min(family[cat_type],100)) //Limits to about 500 cats, you wouldn't think this would be needed (BUT IT IS) - new cat_type(loc) - -/mob/living/simple_animal/pet/cat/Proc - name = "Proc" - gender = MALE - gold_core_spawnable = 0 - -/mob/living/simple_animal/pet/cat/Life() - if(!stat && !buckled && !client) - if(prob(1)) - emote("me", 1, pick("stretches out for a belly rub.", "wags its tail.", "lies down.")) - icon_state = "[icon_living]_rest" - resting = 1 - update_canmove() - else if (prob(1)) - emote("me", 1, pick("sits down.", "crouches on its hind legs.", "looks alert.")) - icon_state = "[icon_living]_sit" - resting = 1 - update_canmove() - else if (prob(1)) - if (resting) - emote("me", 1, pick("gets up and meows.", "walks around.", "stops resting.")) - icon_state = "[icon_living]" - resting = 0 - update_canmove() - else - emote("me", 1, pick("grooms its fur.", "twitches its whiskers.", "shakes out its coat.")) - - //MICE! - if((src.loc) && isturf(src.loc)) - if(!stat && !resting && !buckled) - for(var/mob/living/simple_animal/mouse/M in view(1,src)) - if(!M.stat && Adjacent(M)) - emote("me", 1, "splats \the [M]!") - M.splat() - movement_target = null - stop_automated_movement = 0 - break - for(var/obj/item/toy/cattoy/T in view(1,src)) - if (T.cooldown < (world.time - 400)) - emote("me", 1, "bats \the [T] around with its paw!") - T.cooldown = world.time - - ..() - - make_babies() - - if(!stat && !resting && !buckled) - turns_since_scan++ - if(turns_since_scan > 5) - walk_to(src,0) - turns_since_scan = 0 - if((movement_target) && !(isturf(movement_target.loc) || ishuman(movement_target.loc) )) - movement_target = null - stop_automated_movement = 0 - if( !movement_target || !(movement_target.loc in oview(src, 3)) ) - movement_target = null - stop_automated_movement = 0 - for(var/mob/living/simple_animal/mouse/snack in oview(src,3)) - if(isturf(snack.loc) && !snack.stat) - movement_target = snack - break - if(movement_target) - stop_automated_movement = 1 - walk_to(src,movement_target,0,3) - -/mob/living/simple_animal/pet/cat/attack_hand(mob/living/carbon/human/M) - . = ..() - switch(M.a_intent) - if("help") - wuv(1, M) - if("harm") - wuv(-1, M) - -/mob/living/simple_animal/pet/cat/proc/wuv(change, mob/M) - if(change) - if(change > 0) - if(M && stat != DEAD) - new /obj/effect/overlay/temp/heart(loc) - emote("me", 1, "purrs!") - else - if(M && stat != DEAD) - emote("me", 1, "hisses!") - -/mob/living/simple_animal/pet/cat/cak //I told you I'd do it, Remie - name = "Keeki" - desc = "It's a cat made out of cake." - icon_state = "cak" - icon_living = "cak" - icon_dead = "cak_dead" - health = 50 - maxHealth = 50 - gender = FEMALE - harm_intent_damage = 10 - butcher_results = list(/obj/item/organ/brain = 1, /obj/item/organ/heart = 1, /obj/item/weapon/reagent_containers/food/snacks/cakeslice/birthday = 3, \ - /obj/item/weapon/reagent_containers/food/snacks/meat/slab = 2) - response_harm = "takes a bite out of" - attacked_sound = 'sound/items/eatfood.ogg' - deathmessage = "loses its false life and collapses!" - death_sound = "bodyfall" - -/mob/living/simple_animal/pet/cat/cak/CheckParts(list/parts) - ..() - var/obj/item/organ/brain/B = locate(/obj/item/organ/brain) in contents - if(!B || !B.brainmob || !B.brainmob.mind) - return - B.brainmob.mind.transfer_to(src) - to_chat(src, "You are a cak! You're a harmless cat/cake hybrid that everyone loves. People can take bites out of you if they're hungry, but you regenerate health \ - so quickly that it generally doesn't matter. You're remarkably resilient to any damage besides this and it's hard for you to really die at all. You should go around and bring happiness and \ - free cake to the station!") - var/new_name = stripped_input(src, "Enter your name, or press \"Cancel\" to stick with Keeki.", "Name Change") - if(new_name) - to_chat(src, "Your name is now \"new_name\"!") - name = new_name - -/mob/living/simple_animal/pet/cat/cak/Life() - ..() - if(stat) - return - if(health < maxHealth) - adjustBruteLoss(-8) //Fast life regen - for(var/obj/item/weapon/reagent_containers/food/snacks/donut/D in range(1, src)) //Frosts nearby donuts! - if(D.icon_state != "donut2") - D.name = "frosted donut" - D.icon_state = "donut2" - D.reagents.add_reagent("sprinkles", 2) - D.bonus_reagents = list("sprinkles" = 2, "sugar" = 1) - D.filling_color = "#FF69B4" - -/mob/living/simple_animal/pet/cat/cak/attack_hand(mob/living/L) - ..() - if(L.a_intent == INTENT_HARM && L.reagents && !stat) - L.reagents.add_reagent("nutriment", 0.4) - L.reagents.add_reagent("vitamin", 0.4) +//Cat +/mob/living/simple_animal/pet/cat + name = "cat" + desc = "Kitty!!" + icon = 'icons/mob/pets.dmi' + icon_state = "cat2" + icon_living = "cat2" + icon_dead = "cat2_dead" + gender = MALE + speak = list("Meow!", "Esp!", "Purr!", "HSSSSS") + speak_emote = list("purrs", "meows") + emote_hear = list("meows", "mews") + emote_see = list("shakes its head", "shivers") + speak_chance = 1 + turns_per_move = 5 + see_in_dark = 6 + ventcrawler = VENTCRAWLER_ALWAYS + pass_flags = PASSTABLE + mob_size = MOB_SIZE_SMALL + minbodytemp = 200 + maxbodytemp = 400 + unsuitable_atmos_damage = 1 + animal_species = /mob/living/simple_animal/pet/cat + childtype = list(/mob/living/simple_animal/pet/cat/kitten) + butcher_results = list(/obj/item/weapon/reagent_containers/food/snacks/meat/slab = 2) + response_help = "pets" + response_disarm = "gently pushes aside" + response_harm = "kicks" + var/turns_since_scan = 0 + var/mob/living/simple_animal/mouse/movement_target + gold_core_spawnable = 2 + devourable = TRUE + +/mob/living/simple_animal/pet/cat/Initialize() + ..() + verbs += /mob/living/proc/lay_down + +/mob/living/simple_animal/pet/cat/update_canmove() + ..() + if(client) + if (resting) + icon_state = "[icon_living]_rest" + else + icon_state = "[icon_living]" + + +/mob/living/simple_animal/pet/cat/space + name = "space cat" + desc = "It's a cat... in space!" + icon_state = "spacecat" + icon_living = "spacecat" + icon_dead = "spacecat_dead" + unsuitable_atmos_damage = 0 + minbodytemp = TCMB + maxbodytemp = T0C + 40 + +/mob/living/simple_animal/pet/cat/original + name = "Batsy" + desc = "The product of alien DNA and bored geneticists." + gender = FEMALE + icon_state = "original" + icon_living = "original" + icon_dead = "original_dead" + +/mob/living/simple_animal/pet/cat/kitten + name = "kitten" + desc = "D'aaawwww." + icon_state = "kitten" + icon_living = "kitten" + icon_dead = "kitten_dead" + density = 0 + pass_flags = PASSMOB + mob_size = MOB_SIZE_SMALL + +//RUNTIME IS ALIVE! SQUEEEEEEEE~ +/mob/living/simple_animal/pet/cat/Runtime + name = "Runtime" + desc = "GCAT" + icon_state = "cat" + icon_living = "cat" + icon_dead = "cat_dead" + gender = FEMALE + gold_core_spawnable = 0 + var/list/family = list()//var restored from savefile, has count of each child type + var/list/children = list()//Actual mob instances of children + var/cats_deployed = 0 + var/memory_saved = 0 + +/mob/living/simple_animal/pet/cat/Runtime/Initialize() + if(prob(5)) + icon_state = "original" + icon_living = "original" + icon_dead = "original_dead" + Read_Memory() + ..() + +/mob/living/simple_animal/pet/cat/Runtime/Life() + if(!cats_deployed && SSticker.current_state >= GAME_STATE_SETTING_UP) + Deploy_The_Cats() + if(!stat && SSticker.current_state == GAME_STATE_FINISHED && !memory_saved) + Write_Memory() + ..() + +/mob/living/simple_animal/pet/cat/Runtime/make_babies() + var/mob/baby = ..() + if(baby) + children += baby + return baby + +/mob/living/simple_animal/pet/cat/Runtime/death() + if(!memory_saved) + Write_Memory(1) + ..() + +/mob/living/simple_animal/pet/cat/Runtime/proc/Read_Memory() + var/savefile/S = new /savefile("data/npc_saves/Runtime.sav") + S["family"] >> family + + if(isnull(family)) + family = list() + +/mob/living/simple_animal/pet/cat/Runtime/proc/Write_Memory(dead) + var/savefile/S = new /savefile("data/npc_saves/Runtime.sav") + family = list() + if(!dead) + for(var/mob/living/simple_animal/pet/cat/kitten/C in children) + if(istype(C,type) || C.stat || !C.z || !C.butcher_results) //That last one is a work around for hologram cats + continue + if(C.type in family) + family[C.type] += 1 + else + family[C.type] = 1 + S["family"] << family + memory_saved = 1 + +/mob/living/simple_animal/pet/cat/Runtime/proc/Deploy_The_Cats() + cats_deployed = 1 + for(var/cat_type in family) + if(family[cat_type] > 0) + for(var/i in 1 to min(family[cat_type],100)) //Limits to about 500 cats, you wouldn't think this would be needed (BUT IT IS) + new cat_type(loc) + +/mob/living/simple_animal/pet/cat/Proc + name = "Proc" + gender = MALE + gold_core_spawnable = 0 + +/mob/living/simple_animal/pet/cat/Life() + if(!stat && !buckled && !client) + if(prob(1)) + emote("me", 1, pick("stretches out for a belly rub.", "wags its tail.", "lies down.")) + icon_state = "[icon_living]_rest" + resting = 1 + update_canmove() + else if (prob(1)) + emote("me", 1, pick("sits down.", "crouches on its hind legs.", "looks alert.")) + icon_state = "[icon_living]_sit" + resting = 1 + update_canmove() + else if (prob(1)) + if (resting) + emote("me", 1, pick("gets up and meows.", "walks around.", "stops resting.")) + icon_state = "[icon_living]" + resting = 0 + update_canmove() + else + emote("me", 1, pick("grooms its fur.", "twitches its whiskers.", "shakes out its coat.")) + + //MICE! + if((src.loc) && isturf(src.loc)) + if(!stat && !resting && !buckled) + for(var/mob/living/simple_animal/mouse/M in view(1,src)) + if(!M.stat && Adjacent(M)) + emote("me", 1, "splats \the [M]!") + M.splat() + movement_target = null + stop_automated_movement = 0 + break + for(var/obj/item/toy/cattoy/T in view(1,src)) + if (T.cooldown < (world.time - 400)) + emote("me", 1, "bats \the [T] around with its paw!") + T.cooldown = world.time + + ..() + + make_babies() + + if(!stat && !resting && !buckled) + turns_since_scan++ + if(turns_since_scan > 5) + walk_to(src,0) + turns_since_scan = 0 + if((movement_target) && !(isturf(movement_target.loc) || ishuman(movement_target.loc) )) + movement_target = null + stop_automated_movement = 0 + if( !movement_target || !(movement_target.loc in oview(src, 3)) ) + movement_target = null + stop_automated_movement = 0 + for(var/mob/living/simple_animal/mouse/snack in oview(src,3)) + if(isturf(snack.loc) && !snack.stat) + movement_target = snack + break + if(movement_target) + stop_automated_movement = 1 + walk_to(src,movement_target,0,3) + +/mob/living/simple_animal/pet/cat/attack_hand(mob/living/carbon/human/M) + . = ..() + switch(M.a_intent) + if("help") + wuv(1, M) + if("harm") + wuv(-1, M) + +/mob/living/simple_animal/pet/cat/proc/wuv(change, mob/M) + if(change) + if(change > 0) + if(M && stat != DEAD) + new /obj/effect/overlay/temp/heart(loc) + emote("me", 1, "purrs!") + else + if(M && stat != DEAD) + emote("me", 1, "hisses!") + +/mob/living/simple_animal/pet/cat/cak //I told you I'd do it, Remie + name = "Keeki" + desc = "It's a cat made out of cake." + icon_state = "cak" + icon_living = "cak" + icon_dead = "cak_dead" + health = 50 + maxHealth = 50 + gender = FEMALE + harm_intent_damage = 10 + butcher_results = list(/obj/item/organ/brain = 1, /obj/item/organ/heart = 1, /obj/item/weapon/reagent_containers/food/snacks/cakeslice/birthday = 3, \ + /obj/item/weapon/reagent_containers/food/snacks/meat/slab = 2) + response_harm = "takes a bite out of" + attacked_sound = 'sound/items/eatfood.ogg' + deathmessage = "loses its false life and collapses!" + death_sound = "bodyfall" + +/mob/living/simple_animal/pet/cat/cak/CheckParts(list/parts) + ..() + var/obj/item/organ/brain/B = locate(/obj/item/organ/brain) in contents + if(!B || !B.brainmob || !B.brainmob.mind) + return + B.brainmob.mind.transfer_to(src) + to_chat(src, "You are a cak! You're a harmless cat/cake hybrid that everyone loves. People can take bites out of you if they're hungry, but you regenerate health \ + so quickly that it generally doesn't matter. You're remarkably resilient to any damage besides this and it's hard for you to really die at all. You should go around and bring happiness and \ + free cake to the station!") + var/new_name = stripped_input(src, "Enter your name, or press \"Cancel\" to stick with Keeki.", "Name Change") + if(new_name) + to_chat(src, "Your name is now \"new_name\"!") + name = new_name + +/mob/living/simple_animal/pet/cat/cak/Life() + ..() + if(stat) + return + if(health < maxHealth) + adjustBruteLoss(-8) //Fast life regen + for(var/obj/item/weapon/reagent_containers/food/snacks/donut/D in range(1, src)) //Frosts nearby donuts! + if(D.icon_state != "donut2") + D.name = "frosted donut" + D.icon_state = "donut2" + D.reagents.add_reagent("sprinkles", 2) + D.bonus_reagents = list("sprinkles" = 2, "sugar" = 1) + D.filling_color = "#FF69B4" + +/mob/living/simple_animal/pet/cat/cak/attack_hand(mob/living/L) + ..() + if(L.a_intent == INTENT_HARM && L.reagents && !stat) + L.reagents.add_reagent("nutriment", 0.4) + L.reagents.add_reagent("vitamin", 0.4) diff --git a/code/modules/paperwork/clipboard.dm b/code/modules/paperwork/clipboard.dm index 3c92be3888..ca2bcd3ba2 100644 --- a/code/modules/paperwork/clipboard.dm +++ b/code/modules/paperwork/clipboard.dm @@ -1,122 +1,122 @@ -/obj/item/weapon/clipboard - name = "clipboard" - icon = 'icons/obj/bureaucracy.dmi' - icon_state = "clipboard" - item_state = "clipboard" - throwforce = 0 - w_class = WEIGHT_CLASS_SMALL - throw_speed = 3 - throw_range = 7 - var/obj/item/weapon/pen/haspen //The stored pen. - var/obj/item/weapon/paper/toppaper //The topmost piece of paper. - slot_flags = SLOT_BELT - resistance_flags = FLAMMABLE - -/obj/item/weapon/clipboard/Initialize() - update_icon() - . = ..() - -/obj/item/weapon/clipboard/Destroy() - QDEL_NULL(haspen) - QDEL_NULL(toppaper) //let movable/Destroy handle the rest - return ..() - -/obj/item/weapon/clipboard/update_icon() - cut_overlays() - if(toppaper) - add_overlay(toppaper.icon_state) - copy_overlays(toppaper) - if(haspen) - add_overlay("clipboard_pen") - add_overlay("clipboard_over") - - -/obj/item/weapon/clipboard/attackby(obj/item/weapon/W, mob/user, params) - if(istype(W, /obj/item/weapon/paper)) - if(!user.transferItemToLoc(W, src)) - return - toppaper = W - to_chat(user, "You clip the paper onto \the [src].") - update_icon() - else if(toppaper) - toppaper.attackby(user.get_active_held_item(), user) - update_icon() - - -/obj/item/weapon/clipboard/attack_self(mob/user) - var/dat = "Clipboard" - if(haspen) - dat += "Remove Pen

" - else - dat += "Add Pen

" - - //The topmost paper. You can't organise contents directly in byond, so this is what we're stuck with. -Pete - if(toppaper) - var/obj/item/weapon/paper/P = toppaper - dat += "Write Remove - [P.name]

" - - for(P in src) - if(P == toppaper) - continue - dat += "Write Remove Move to top - [P.name]
" - user << browse(dat, "window=clipboard") - onclose(user, "clipboard") - add_fingerprint(usr) - - -/obj/item/weapon/clipboard/Topic(href, href_list) - ..() - if(usr.stat || usr.restrained()) - return - - if(usr.contents.Find(src)) - - if(href_list["pen"]) - if(haspen) - haspen.loc = usr.loc - usr.put_in_hands(haspen) - haspen = null - - if(href_list["addpen"]) - if(!haspen) - var/obj/item/held = usr.get_active_held_item() - if(istype(held, /obj/item/weapon/pen)) - var/obj/item/weapon/pen/W = held - if(!usr.transferItemToLoc(W, src)) - return - haspen = W - to_chat(usr, "You slot [W] into [src].") - - if(href_list["write"]) - var/obj/item/P = locate(href_list["write"]) - if(istype(P) && P.loc == src) - if(usr.get_active_held_item()) - P.attackby(usr.get_active_held_item(), usr) - - if(href_list["remove"]) - var/obj/item/P = locate(href_list["remove"]) - if(istype(P) && P.loc == src) - P.loc = usr.loc - usr.put_in_hands(P) - if(P == toppaper) - toppaper = null - var/obj/item/weapon/paper/newtop = locate(/obj/item/weapon/paper) in src - if(newtop && (newtop != P)) - toppaper = newtop - else - toppaper = null - - if(href_list["read"]) - var/obj/item/weapon/paper/P = locate(href_list["read"]) - if(istype(P) && P.loc == src) - usr.examinate(P) - - if(href_list["top"]) - var/obj/item/P = locate(href_list["top"]) - if(istype(P) && P.loc == src) - toppaper = P - to_chat(usr, "You move [P.name] to the top.") - - //Update everything - attack_self(usr) - update_icon() +/obj/item/weapon/clipboard + name = "clipboard" + icon = 'icons/obj/bureaucracy.dmi' + icon_state = "clipboard" + item_state = "clipboard" + throwforce = 0 + w_class = WEIGHT_CLASS_SMALL + throw_speed = 3 + throw_range = 7 + var/obj/item/weapon/pen/haspen //The stored pen. + var/obj/item/weapon/paper/toppaper //The topmost piece of paper. + slot_flags = SLOT_BELT + resistance_flags = FLAMMABLE + +/obj/item/weapon/clipboard/Initialize() + update_icon() + . = ..() + +/obj/item/weapon/clipboard/Destroy() + QDEL_NULL(haspen) + QDEL_NULL(toppaper) //let movable/Destroy handle the rest + return ..() + +/obj/item/weapon/clipboard/update_icon() + cut_overlays() + if(toppaper) + add_overlay(toppaper.icon_state) + copy_overlays(toppaper) + if(haspen) + add_overlay("clipboard_pen") + add_overlay("clipboard_over") + + +/obj/item/weapon/clipboard/attackby(obj/item/weapon/W, mob/user, params) + if(istype(W, /obj/item/weapon/paper)) + if(!user.transferItemToLoc(W, src)) + return + toppaper = W + to_chat(user, "You clip the paper onto \the [src].") + update_icon() + else if(toppaper) + toppaper.attackby(user.get_active_held_item(), user) + update_icon() + + +/obj/item/weapon/clipboard/attack_self(mob/user) + var/dat = "Clipboard" + if(haspen) + dat += "Remove Pen

" + else + dat += "Add Pen

" + + //The topmost paper. You can't organise contents directly in byond, so this is what we're stuck with. -Pete + if(toppaper) + var/obj/item/weapon/paper/P = toppaper + dat += "Write Remove - [P.name]

" + + for(P in src) + if(P == toppaper) + continue + dat += "Write Remove Move to top - [P.name]
" + user << browse(dat, "window=clipboard") + onclose(user, "clipboard") + add_fingerprint(usr) + + +/obj/item/weapon/clipboard/Topic(href, href_list) + ..() + if(usr.stat || usr.restrained()) + return + + if(usr.contents.Find(src)) + + if(href_list["pen"]) + if(haspen) + haspen.loc = usr.loc + usr.put_in_hands(haspen) + haspen = null + + if(href_list["addpen"]) + if(!haspen) + var/obj/item/held = usr.get_active_held_item() + if(istype(held, /obj/item/weapon/pen)) + var/obj/item/weapon/pen/W = held + if(!usr.transferItemToLoc(W, src)) + return + haspen = W + to_chat(usr, "You slot [W] into [src].") + + if(href_list["write"]) + var/obj/item/P = locate(href_list["write"]) + if(istype(P) && P.loc == src) + if(usr.get_active_held_item()) + P.attackby(usr.get_active_held_item(), usr) + + if(href_list["remove"]) + var/obj/item/P = locate(href_list["remove"]) + if(istype(P) && P.loc == src) + P.loc = usr.loc + usr.put_in_hands(P) + if(P == toppaper) + toppaper = null + var/obj/item/weapon/paper/newtop = locate(/obj/item/weapon/paper) in src + if(newtop && (newtop != P)) + toppaper = newtop + else + toppaper = null + + if(href_list["read"]) + var/obj/item/weapon/paper/P = locate(href_list["read"]) + if(istype(P) && P.loc == src) + usr.examinate(P) + + if(href_list["top"]) + var/obj/item/P = locate(href_list["top"]) + if(istype(P) && P.loc == src) + toppaper = P + to_chat(usr, "You move [P.name] to the top.") + + //Update everything + attack_self(usr) + update_icon() diff --git a/code/modules/paperwork/folders.dm b/code/modules/paperwork/folders.dm index c83d53bf3f..f98cb5d0e9 100644 --- a/code/modules/paperwork/folders.dm +++ b/code/modules/paperwork/folders.dm @@ -78,8 +78,8 @@ name = "folder- 'TOP SECRET'" desc = "A folder stamped \"Top Secret - Property of Nanotrasen Corporation. Unauthorized distribution is punishable by death.\"" -/obj/item/weapon/folder/documents/Initialize() - . = ..() +/obj/item/weapon/folder/documents/Initialize() + . = ..() new /obj/item/documents/nanotrasen(src) update_icon() @@ -91,20 +91,20 @@ /obj/item/weapon/folder/syndicate/red icon_state = "folder_sred" -/obj/item/weapon/folder/syndicate/red/Initialize() - . = ..() +/obj/item/weapon/folder/syndicate/red/Initialize() + . = ..() new /obj/item/documents/syndicate/red(src) update_icon() /obj/item/weapon/folder/syndicate/blue icon_state = "folder_sblue" -/obj/item/weapon/folder/syndicate/blue/Initialize() - . = ..() +/obj/item/weapon/folder/syndicate/blue/Initialize() + . = ..() new /obj/item/documents/syndicate/blue(src) update_icon() -/obj/item/weapon/folder/syndicate/mining/Initialize() - . = ..() +/obj/item/weapon/folder/syndicate/mining/Initialize() + . = ..() new /obj/item/documents/syndicate/mining(src) - update_icon() + update_icon() diff --git a/code/modules/power/gravitygenerator.dm b/code/modules/power/gravitygenerator.dm index 3517757de5..a1d544c2e4 100644 --- a/code/modules/power/gravitygenerator.dm +++ b/code/modules/power/gravitygenerator.dm @@ -20,7 +20,7 @@ GLOBAL_LIST_EMPTY(gravity_generators) // We will keep track of this by adding ne /obj/machinery/gravity_generator name = "gravitational generator" - desc = "A device which produces a graviton field when set up." + desc = "A device which produces a graviton field when set up." icon = 'icons/obj/machines/gravity_generator.dmi' anchored = 1 density = 1 @@ -304,17 +304,17 @@ GLOBAL_LIST_EMPTY(gravity_generators) // We will keep track of this by adding ne // Sound the alert if gravity was just enabled or disabled. var/alert = 0 var/area/A = get_area(src) - if(SSticker.IsRoundInProgress()) - if(on) // If we turned on and the game is live. - if(gravity_in_level() == 0) - alert = 1 - investigate_log("was brought online and is now producing gravity for this level.", "gravity") - message_admins("The gravity generator was brought online [A][ADMIN_COORDJMP(src)]") - else - if(gravity_in_level() == 1) - alert = 1 - investigate_log("was brought offline and there is now no gravity for this level.", "gravity") - message_admins("The gravity generator was brought offline with no backup generator. [A][ADMIN_COORDJMP(src)]") + if(SSticker.IsRoundInProgress()) + if(on) // If we turned on and the game is live. + if(gravity_in_level() == 0) + alert = 1 + investigate_log("was brought online and is now producing gravity for this level.", "gravity") + message_admins("The gravity generator was brought online [A][ADMIN_COORDJMP(src)]") + else + if(gravity_in_level() == 1) + alert = 1 + investigate_log("was brought offline and there is now no gravity for this level.", "gravity") + message_admins("The gravity generator was brought offline with no backup generator. [A][ADMIN_COORDJMP(src)]") update_icon() update_list() diff --git a/code/modules/power/singularity/emitter.dm b/code/modules/power/singularity/emitter.dm index b7a298d6b3..9d37173c9f 100644 --- a/code/modules/power/singularity/emitter.dm +++ b/code/modules/power/singularity/emitter.dm @@ -1,493 +1,493 @@ -/obj/machinery/power/emitter - name = "Emitter" - desc = "A heavy duty industrial laser.\nAlt-click to rotate it clockwise." - icon = 'icons/obj/singularity.dmi' - icon_state = "emitter" - var/icon_state_on = "emitter_+a" - anchored = 0 - density = 1 - req_access = list(GLOB.access_engine_equip) - - // The following 3 vars are mostly for the prototype - var/manual = FALSE - var/charge = 0 - var/atom/target = null - - use_power = 0 - idle_power_usage = 10 - active_power_usage = 300 - - var/active = 0 - var/powered = 0 - var/fire_delay = 100 - var/maximum_fire_delay = 100 - var/minimum_fire_delay = 20 - var/last_shot = 0 - var/shot_number = 0 - var/state = 0 - var/locked = 0 - - var/projectile_type = /obj/item/projectile/beam/emitter - - var/projectile_sound = 'sound/weapons/emitter.ogg' - - var/datum/effect_system/spark_spread/sparks - -/obj/machinery/power/emitter/New() - ..() - var/obj/item/weapon/circuitboard/machine/B = new /obj/item/weapon/circuitboard/machine/emitter(null) - B.apply_default_parts(src) - RefreshParts() - wires = new /datum/wires/emitter(src) - -/obj/item/weapon/circuitboard/machine/emitter - name = "Emitter (Machine Board)" - build_path = /obj/machinery/power/emitter - origin_tech = "programming=3;powerstorage=4;engineering=4" - req_components = list( - /obj/item/weapon/stock_parts/micro_laser = 1, - /obj/item/weapon/stock_parts/manipulator = 1) - -/obj/machinery/power/emitter/RefreshParts() - var/max_firedelay = 120 - var/firedelay = 120 - var/min_firedelay = 24 - var/power_usage = 350 - for(var/obj/item/weapon/stock_parts/micro_laser/L in component_parts) - max_firedelay -= 20 * L.rating - min_firedelay -= 4 * L.rating - firedelay -= 20 * L.rating - maximum_fire_delay = max_firedelay - minimum_fire_delay = min_firedelay - fire_delay = firedelay - for(var/obj/item/weapon/stock_parts/manipulator/M in component_parts) - power_usage -= 50 * M.rating - active_power_usage = power_usage - -/obj/machinery/power/emitter/verb/rotate() - set name = "Rotate" - set category = "Object" - set src in oview(1) - - if(usr.stat || !usr.canmove || usr.restrained()) - return - if (src.anchored) - to_chat(usr, "It is fastened to the floor!") - return 0 - src.setDir(turn(src.dir, 270)) - return 1 - -/obj/machinery/power/emitter/AltClick(mob/user) - ..() - if(user.incapacitated()) - to_chat(user, "You can't do that right now!") - return - if(!in_range(src, user)) - return - else - rotate() - -/obj/machinery/power/emitter/Initialize() - . = ..() - if(state == 2 && anchored) - connect_to_network() - - sparks = new - sparks.attach(src) - sparks.set_up(5, TRUE, src) - -/obj/machinery/power/emitter/Destroy() - if(SSticker && SSticker.IsRoundInProgress()) - message_admins("Emitter deleted at ([x],[y],[z] - JMP)",0,1) - log_game("Emitter deleted at ([x],[y],[z])") - investigate_log("deleted at ([x],[y],[z]) at [get_area(src)]","singulo") - QDEL_NULL(sparks) - return ..() - -/obj/machinery/power/emitter/update_icon() - if (active && powernet && avail(active_power_usage)) - icon_state = icon_state_on - else - icon_state = initial(icon_state) - - -/obj/machinery/power/emitter/attack_hand(mob/user) - src.add_fingerprint(user) - if(state == 2) - if(!powernet) - to_chat(user, "The emitter isn't connected to a wire!") - return 1 - if(!src.locked) - if(src.active==1) - src.active = 0 - to_chat(user, "You turn off \the [src].") - message_admins("Emitter turned off by [ADMIN_LOOKUPFLW(user)] in [ADMIN_COORDJMP(src)]",0,1) - log_game("Emitter turned off by [key_name(user)] in [COORD(src)]") - investigate_log("turned off by [key_name(user)] at [get_area(src)]","singulo") - else - src.active = 1 - to_chat(user, "You turn on \the [src].") - src.shot_number = 0 - src.fire_delay = maximum_fire_delay - investigate_log("turned on by [key_name(user)] at [get_area(src)]","singulo") - update_icon() - else - to_chat(user, "The controls are locked!") - else - to_chat(user, "The [src] needs to be firmly secured to the floor first!") - return 1 - -/obj/machinery/power/emitter/attack_animal(mob/living/simple_animal/M) - if(ismegafauna(M) && anchored) - state = 0 - anchored = FALSE - M.visible_message("[M] rips [src] free from its moorings!") - else - ..() - if(!anchored) - step(src, get_dir(M, src)) - - -/obj/machinery/power/emitter/emp_act(severity)//Emitters are hardened but still might have issues -// add_load(1000) -/* if((severity == 1)&&prob(1)&&prob(1)) - if(src.active) - src.active = 0 - src.use_power = 1 */ - return 1 - - -/obj/machinery/power/emitter/process() - if(stat & (BROKEN)) - return - if(src.state != 2 || (!powernet && active_power_usage)) - src.active = 0 - update_icon() - return - if(src.active == 1) - if(!active_power_usage || avail(active_power_usage)) - add_load(active_power_usage) - if(!powered) - powered = 1 - update_icon() - investigate_log("regained power and turned on at [get_area(src)]","singulo") - else - if(powered) - powered = 0 - update_icon() - investigate_log("lost power and turned off at [get_area(src)]","singulo") - log_game("Emitter lost power in ([x],[y],[z])") - return - if(charge <=80) - charge+=5 - if(!check_delay() || manual == TRUE) - return FALSE - fire_beam(target) - -/obj/machinery/power/emitter/proc/check_delay() - if((src.last_shot + src.fire_delay) <= world.time) - return TRUE - return FALSE - -/obj/machinery/power/emitter/proc/fire_beam_pulse() - if(!check_delay()) - return FALSE - if(state != 2) - return FALSE - if(avail(active_power_usage)) - add_load(active_power_usage) - fire_beam() - -/obj/machinery/power/emitter/proc/fire_beam(atom/targeted_atom, mob/user) - var/turf/targets_from = get_turf(src) - if(targeted_atom && (targeted_atom == user || targeted_atom == targets_from || targeted_atom == src)) - return - var/obj/item/projectile/P = new projectile_type(targets_from) - playsound(src.loc, projectile_sound, 50, 1) - if(prob(35)) - sparks.start() - switch(dir) - if(NORTH) - P.yo = 20 - P.xo = 0 - if(NORTHEAST) - P.yo = 20 - P.xo = 20 - if(EAST) - P.yo = 0 - P.xo = 20 - if(SOUTHEAST) - P.yo = -20 - P.xo = 20 - if(WEST) - P.yo = 0 - P.xo = -20 - if(SOUTHWEST) - P.yo = -20 - P.xo = -20 - if(NORTHWEST) - P.yo = 20 - P.xo = -20 - else // Any other - P.yo = -20 - P.xo = 0 - if(target) - P.yo = targeted_atom.y - targets_from.y - P.xo = targeted_atom.x - targets_from.x - P.current = targets_from - P.starting = targets_from - P.firer = src - P.original = targeted_atom - if(!manual) - last_shot = world.time - if(shot_number < 3) - fire_delay = 20 - shot_number ++ - else - fire_delay = rand(minimum_fire_delay,maximum_fire_delay) - shot_number = 0 - if(!target) - P.setDir(src.dir) - P.starting = loc - else - if(QDELETED(target)) - target = null - P.fire() - return P - -/obj/machinery/power/emitter/can_be_unfasten_wrench(mob/user, silent) - if(state == EM_WELDED) - if(!silent) - to_chat(user, "[src] is welded to the floor!") - return FAILED_UNFASTEN - return ..() - -/obj/machinery/power/emitter/default_unfasten_wrench(mob/user, obj/item/weapon/wrench/W, time = 20) - . = ..() - if(. == SUCCESSFUL_UNFASTEN) - if(anchored) - state = EM_SECURED - else - state = EM_UNSECURED - -/obj/machinery/power/emitter/attackby(obj/item/W, mob/user, params) - if(istype(W, /obj/item/weapon/wrench)) - if(active) - to_chat(user, "Turn \the [src] off first!") - return - default_unfasten_wrench(user, W, 0) - return - - if(istype(W, /obj/item/weapon/weldingtool)) - var/obj/item/weapon/weldingtool/WT = W - if(active) - to_chat(user, "Turn \the [src] off first.") - return - switch(state) - if(EM_UNSECURED) - to_chat(user, "The [src.name] needs to be wrenched to the floor!") - if(EM_SECURED) - if(WT.remove_fuel(0,user)) - playsound(loc, WT.usesound, 50, 1) - user.visible_message("[user.name] starts to weld the [name] to the floor.", \ - "You start to weld \the [src] to the floor...", \ - "You hear welding.") - if(do_after(user,20*W.toolspeed, target = src) && WT.isOn()) - state = EM_WELDED - to_chat(user, "You weld \the [src] to the floor.") - connect_to_network() - if(EM_WELDED) - if(WT.remove_fuel(0,user)) - playsound(loc, WT.usesound, 50, 1) - user.visible_message("[user.name] starts to cut the [name] free from the floor.", \ - "You start to cut \the [src] free from the floor...", \ - "You hear welding.") - if(do_after(user,20*W.toolspeed, target = src) && WT.isOn()) - state = EM_SECURED - to_chat(user, "You cut \the [src] free from the floor.") - disconnect_from_network() - return - - if(W.GetID()) - if(emagged) - to_chat(user, "The lock seems to be broken!") - return - if(allowed(user)) - if(active) - locked = !locked - to_chat(user, "You [src.locked ? "lock" : "unlock"] the controls.") - else - to_chat(user, "The controls can only be locked when \the [src] is online!") - else - to_chat(user, "Access denied.") - return - - if(is_wire_tool(W) && panel_open) - wires.interact(user) - return - - if(default_deconstruction_screwdriver(user, "emitter_open", "emitter", W)) - return - - if(exchange_parts(user, W)) - return - - if(default_pry_open(W)) - return - - if(default_deconstruction_crowbar(W)) - return - - return ..() - -/obj/machinery/power/emitter/emag_act(mob/user) - if(!emagged) - locked = 0 - emagged = 1 - if(user) - user.visible_message("[user.name] emags the [src.name].","You short out the lock.") - - -/obj/machinery/power/emitter/prototype - name = "Prototype Emitter" - icon = 'icons/obj/turrets.dmi' - icon_state = "protoemitter" - icon_state_on = "protoemitter_+a" - can_buckle = TRUE - buckle_lying = 0 - var/view_range = 12 - var/datum/action/innate/protoemitter/firing/auto - -//BUCKLE HOOKS - -/obj/machinery/power/emitter/prototype/unbuckle_mob(mob/living/buckled_mob,force = 0) - playsound(src,'sound/mecha/mechmove01.ogg', 50, 1) - manual = FALSE - for(var/obj/item/I in buckled_mob.held_items) - if(istype(I, /obj/item/weapon/turret_control)) - qdel(I) - if(istype(buckled_mob)) - buckled_mob.pixel_x = 0 - buckled_mob.pixel_y = 0 - if(buckled_mob.client) - buckled_mob.client.change_view(world.view) - auto.Remove(buckled_mob) - . = ..() - -/obj/machinery/power/emitter/prototype/user_buckle_mob(mob/living/M, mob/living/carbon/user) - if(user.incapacitated() || !istype(user)) - return - for(var/atom/movable/A in get_turf(src)) - if(A.density && (A != src && A != M)) - return - M.forceMove(get_turf(src)) - ..() - playsound(src,'sound/mecha/mechmove01.ogg', 50, 1) - M.pixel_y = 14 - layer = 4.1 - if(M.client) - M.client.change_view(view_range) - if(!auto) - auto = new() - auto.Grant(M, src) - -/datum/action/innate/protoemitter - check_flags = AB_CHECK_RESTRAINED | AB_CHECK_STUNNED | AB_CHECK_CONSCIOUS - var/obj/machinery/power/emitter/prototype/PE - var/mob/living/carbon/U - - -/datum/action/innate/protoemitter/Grant(mob/living/carbon/L, obj/machinery/power/emitter/prototype/proto) - PE = proto - U = L - . = ..() - -/datum/action/innate/protoemitter/firing - name = "Switch to Manual Firing" - desc = "The emitter will only fire on your command and at your designated target" - button_icon_state = "mech_zoom_on" - -/datum/action/innate/protoemitter/firing/Activate() - if(PE.manual) - playsound(PE,'sound/mecha/mechmove01.ogg', 50, 1) - PE.manual = FALSE - name = "Switch to Manual Firing" - desc = "The emitter will only fire on your command and at your designated target" - button_icon_state = "mech_zoom_on" - for(var/obj/item/I in U.held_items) - if(istype(I, /obj/item/weapon/turret_control)) - qdel(I) - UpdateButtonIcon() - return - else - playsound(PE,'sound/mecha/mechmove01.ogg', 50, 1) - name = "Switch to Automatic Firing" - desc = "Emitters will switch to periodic firing at your last target" - button_icon_state = "mech_zoom_off" - PE.manual = TRUE - for(var/V in U.held_items) - var/obj/item/I = V - if(istype(I)) - if(U.dropItemToGround(I)) - var/obj/item/weapon/turret_control/TC = new /obj/item/weapon/turret_control() - U.put_in_hands(TC) - else //Entries in the list should only ever be items or null, so if it's not an item, we can assume it's an empty hand - var/obj/item/weapon/turret_control/TC = new /obj/item/weapon/turret_control() - U.put_in_hands(TC) - UpdateButtonIcon() - - -/obj/item/weapon/turret_control - name = "turret controls" - icon_state = "offhand" - w_class = WEIGHT_CLASS_HUGE - flags = ABSTRACT | NODROP - resistance_flags = FIRE_PROOF | UNACIDABLE | ACID_PROOF | NOBLUDGEON - var/delay = 0 - -/obj/item/weapon/turret_control/afterattack(atom/targeted_atom, mob/user) - ..() - var/obj/machinery/power/emitter/E = user.buckled - E.setDir(get_dir(E,targeted_atom)) - user.setDir(E.dir) - switch(E.dir) - if(NORTH) - E.layer = 3.9 - user.pixel_x = 0 - user.pixel_y = -14 - if(NORTHEAST) - E.layer = 3.9 - user.pixel_x = -8 - user.pixel_y = -12 - if(EAST) - E.layer = 4.1 - user.pixel_x = -14 - user.pixel_y = 0 - if(SOUTHEAST) - E.layer = 3.9 - user.pixel_x = -8 - user.pixel_y = 12 - if(SOUTH) - E.layer = 4.1 - user.pixel_x = 0 - user.pixel_y = 14 - if(SOUTHWEST) - E.layer = 3.9 - user.pixel_x = 8 - user.pixel_y = 12 - if(WEST) - E.layer = 4.1 - user.pixel_x = 14 - user.pixel_y = 0 - if(NORTHWEST) - E.layer = 3.9 - user.pixel_x = 8 - user.pixel_y = -12 - - if(E.charge >= 10 && world.time > delay) - E.charge -= 10 - E.target = targeted_atom - E.fire_beam(targeted_atom, user) - delay = world.time + 10 - else if (E.charge < 10) - playsound(get_turf(user),'sound/machines/buzz-sigh.ogg', 50, 1) +/obj/machinery/power/emitter + name = "Emitter" + desc = "A heavy duty industrial laser.\nAlt-click to rotate it clockwise." + icon = 'icons/obj/singularity.dmi' + icon_state = "emitter" + var/icon_state_on = "emitter_+a" + anchored = 0 + density = 1 + req_access = list(GLOB.access_engine_equip) + + // The following 3 vars are mostly for the prototype + var/manual = FALSE + var/charge = 0 + var/atom/target = null + + use_power = 0 + idle_power_usage = 10 + active_power_usage = 300 + + var/active = 0 + var/powered = 0 + var/fire_delay = 100 + var/maximum_fire_delay = 100 + var/minimum_fire_delay = 20 + var/last_shot = 0 + var/shot_number = 0 + var/state = 0 + var/locked = 0 + + var/projectile_type = /obj/item/projectile/beam/emitter + + var/projectile_sound = 'sound/weapons/emitter.ogg' + + var/datum/effect_system/spark_spread/sparks + +/obj/machinery/power/emitter/New() + ..() + var/obj/item/weapon/circuitboard/machine/B = new /obj/item/weapon/circuitboard/machine/emitter(null) + B.apply_default_parts(src) + RefreshParts() + wires = new /datum/wires/emitter(src) + +/obj/item/weapon/circuitboard/machine/emitter + name = "Emitter (Machine Board)" + build_path = /obj/machinery/power/emitter + origin_tech = "programming=3;powerstorage=4;engineering=4" + req_components = list( + /obj/item/weapon/stock_parts/micro_laser = 1, + /obj/item/weapon/stock_parts/manipulator = 1) + +/obj/machinery/power/emitter/RefreshParts() + var/max_firedelay = 120 + var/firedelay = 120 + var/min_firedelay = 24 + var/power_usage = 350 + for(var/obj/item/weapon/stock_parts/micro_laser/L in component_parts) + max_firedelay -= 20 * L.rating + min_firedelay -= 4 * L.rating + firedelay -= 20 * L.rating + maximum_fire_delay = max_firedelay + minimum_fire_delay = min_firedelay + fire_delay = firedelay + for(var/obj/item/weapon/stock_parts/manipulator/M in component_parts) + power_usage -= 50 * M.rating + active_power_usage = power_usage + +/obj/machinery/power/emitter/verb/rotate() + set name = "Rotate" + set category = "Object" + set src in oview(1) + + if(usr.stat || !usr.canmove || usr.restrained()) + return + if (src.anchored) + to_chat(usr, "It is fastened to the floor!") + return 0 + src.setDir(turn(src.dir, 270)) + return 1 + +/obj/machinery/power/emitter/AltClick(mob/user) + ..() + if(user.incapacitated()) + to_chat(user, "You can't do that right now!") + return + if(!in_range(src, user)) + return + else + rotate() + +/obj/machinery/power/emitter/Initialize() + . = ..() + if(state == 2 && anchored) + connect_to_network() + + sparks = new + sparks.attach(src) + sparks.set_up(5, TRUE, src) + +/obj/machinery/power/emitter/Destroy() + if(SSticker && SSticker.IsRoundInProgress()) + message_admins("Emitter deleted at ([x],[y],[z] - JMP)",0,1) + log_game("Emitter deleted at ([x],[y],[z])") + investigate_log("deleted at ([x],[y],[z]) at [get_area(src)]","singulo") + QDEL_NULL(sparks) + return ..() + +/obj/machinery/power/emitter/update_icon() + if (active && powernet && avail(active_power_usage)) + icon_state = icon_state_on + else + icon_state = initial(icon_state) + + +/obj/machinery/power/emitter/attack_hand(mob/user) + src.add_fingerprint(user) + if(state == 2) + if(!powernet) + to_chat(user, "The emitter isn't connected to a wire!") + return 1 + if(!src.locked) + if(src.active==1) + src.active = 0 + to_chat(user, "You turn off \the [src].") + message_admins("Emitter turned off by [ADMIN_LOOKUPFLW(user)] in [ADMIN_COORDJMP(src)]",0,1) + log_game("Emitter turned off by [key_name(user)] in [COORD(src)]") + investigate_log("turned off by [key_name(user)] at [get_area(src)]","singulo") + else + src.active = 1 + to_chat(user, "You turn on \the [src].") + src.shot_number = 0 + src.fire_delay = maximum_fire_delay + investigate_log("turned on by [key_name(user)] at [get_area(src)]","singulo") + update_icon() + else + to_chat(user, "The controls are locked!") + else + to_chat(user, "The [src] needs to be firmly secured to the floor first!") + return 1 + +/obj/machinery/power/emitter/attack_animal(mob/living/simple_animal/M) + if(ismegafauna(M) && anchored) + state = 0 + anchored = FALSE + M.visible_message("[M] rips [src] free from its moorings!") + else + ..() + if(!anchored) + step(src, get_dir(M, src)) + + +/obj/machinery/power/emitter/emp_act(severity)//Emitters are hardened but still might have issues +// add_load(1000) +/* if((severity == 1)&&prob(1)&&prob(1)) + if(src.active) + src.active = 0 + src.use_power = 1 */ + return 1 + + +/obj/machinery/power/emitter/process() + if(stat & (BROKEN)) + return + if(src.state != 2 || (!powernet && active_power_usage)) + src.active = 0 + update_icon() + return + if(src.active == 1) + if(!active_power_usage || avail(active_power_usage)) + add_load(active_power_usage) + if(!powered) + powered = 1 + update_icon() + investigate_log("regained power and turned on at [get_area(src)]","singulo") + else + if(powered) + powered = 0 + update_icon() + investigate_log("lost power and turned off at [get_area(src)]","singulo") + log_game("Emitter lost power in ([x],[y],[z])") + return + if(charge <=80) + charge+=5 + if(!check_delay() || manual == TRUE) + return FALSE + fire_beam(target) + +/obj/machinery/power/emitter/proc/check_delay() + if((src.last_shot + src.fire_delay) <= world.time) + return TRUE + return FALSE + +/obj/machinery/power/emitter/proc/fire_beam_pulse() + if(!check_delay()) + return FALSE + if(state != 2) + return FALSE + if(avail(active_power_usage)) + add_load(active_power_usage) + fire_beam() + +/obj/machinery/power/emitter/proc/fire_beam(atom/targeted_atom, mob/user) + var/turf/targets_from = get_turf(src) + if(targeted_atom && (targeted_atom == user || targeted_atom == targets_from || targeted_atom == src)) + return + var/obj/item/projectile/P = new projectile_type(targets_from) + playsound(src.loc, projectile_sound, 50, 1) + if(prob(35)) + sparks.start() + switch(dir) + if(NORTH) + P.yo = 20 + P.xo = 0 + if(NORTHEAST) + P.yo = 20 + P.xo = 20 + if(EAST) + P.yo = 0 + P.xo = 20 + if(SOUTHEAST) + P.yo = -20 + P.xo = 20 + if(WEST) + P.yo = 0 + P.xo = -20 + if(SOUTHWEST) + P.yo = -20 + P.xo = -20 + if(NORTHWEST) + P.yo = 20 + P.xo = -20 + else // Any other + P.yo = -20 + P.xo = 0 + if(target) + P.yo = targeted_atom.y - targets_from.y + P.xo = targeted_atom.x - targets_from.x + P.current = targets_from + P.starting = targets_from + P.firer = src + P.original = targeted_atom + if(!manual) + last_shot = world.time + if(shot_number < 3) + fire_delay = 20 + shot_number ++ + else + fire_delay = rand(minimum_fire_delay,maximum_fire_delay) + shot_number = 0 + if(!target) + P.setDir(src.dir) + P.starting = loc + else + if(QDELETED(target)) + target = null + P.fire() + return P + +/obj/machinery/power/emitter/can_be_unfasten_wrench(mob/user, silent) + if(state == EM_WELDED) + if(!silent) + to_chat(user, "[src] is welded to the floor!") + return FAILED_UNFASTEN + return ..() + +/obj/machinery/power/emitter/default_unfasten_wrench(mob/user, obj/item/weapon/wrench/W, time = 20) + . = ..() + if(. == SUCCESSFUL_UNFASTEN) + if(anchored) + state = EM_SECURED + else + state = EM_UNSECURED + +/obj/machinery/power/emitter/attackby(obj/item/W, mob/user, params) + if(istype(W, /obj/item/weapon/wrench)) + if(active) + to_chat(user, "Turn \the [src] off first!") + return + default_unfasten_wrench(user, W, 0) + return + + if(istype(W, /obj/item/weapon/weldingtool)) + var/obj/item/weapon/weldingtool/WT = W + if(active) + to_chat(user, "Turn \the [src] off first.") + return + switch(state) + if(EM_UNSECURED) + to_chat(user, "The [src.name] needs to be wrenched to the floor!") + if(EM_SECURED) + if(WT.remove_fuel(0,user)) + playsound(loc, WT.usesound, 50, 1) + user.visible_message("[user.name] starts to weld the [name] to the floor.", \ + "You start to weld \the [src] to the floor...", \ + "You hear welding.") + if(do_after(user,20*W.toolspeed, target = src) && WT.isOn()) + state = EM_WELDED + to_chat(user, "You weld \the [src] to the floor.") + connect_to_network() + if(EM_WELDED) + if(WT.remove_fuel(0,user)) + playsound(loc, WT.usesound, 50, 1) + user.visible_message("[user.name] starts to cut the [name] free from the floor.", \ + "You start to cut \the [src] free from the floor...", \ + "You hear welding.") + if(do_after(user,20*W.toolspeed, target = src) && WT.isOn()) + state = EM_SECURED + to_chat(user, "You cut \the [src] free from the floor.") + disconnect_from_network() + return + + if(W.GetID()) + if(emagged) + to_chat(user, "The lock seems to be broken!") + return + if(allowed(user)) + if(active) + locked = !locked + to_chat(user, "You [src.locked ? "lock" : "unlock"] the controls.") + else + to_chat(user, "The controls can only be locked when \the [src] is online!") + else + to_chat(user, "Access denied.") + return + + if(is_wire_tool(W) && panel_open) + wires.interact(user) + return + + if(default_deconstruction_screwdriver(user, "emitter_open", "emitter", W)) + return + + if(exchange_parts(user, W)) + return + + if(default_pry_open(W)) + return + + if(default_deconstruction_crowbar(W)) + return + + return ..() + +/obj/machinery/power/emitter/emag_act(mob/user) + if(!emagged) + locked = 0 + emagged = 1 + if(user) + user.visible_message("[user.name] emags the [src.name].","You short out the lock.") + + +/obj/machinery/power/emitter/prototype + name = "Prototype Emitter" + icon = 'icons/obj/turrets.dmi' + icon_state = "protoemitter" + icon_state_on = "protoemitter_+a" + can_buckle = TRUE + buckle_lying = 0 + var/view_range = 12 + var/datum/action/innate/protoemitter/firing/auto + +//BUCKLE HOOKS + +/obj/machinery/power/emitter/prototype/unbuckle_mob(mob/living/buckled_mob,force = 0) + playsound(src,'sound/mecha/mechmove01.ogg', 50, 1) + manual = FALSE + for(var/obj/item/I in buckled_mob.held_items) + if(istype(I, /obj/item/weapon/turret_control)) + qdel(I) + if(istype(buckled_mob)) + buckled_mob.pixel_x = 0 + buckled_mob.pixel_y = 0 + if(buckled_mob.client) + buckled_mob.client.change_view(world.view) + auto.Remove(buckled_mob) + . = ..() + +/obj/machinery/power/emitter/prototype/user_buckle_mob(mob/living/M, mob/living/carbon/user) + if(user.incapacitated() || !istype(user)) + return + for(var/atom/movable/A in get_turf(src)) + if(A.density && (A != src && A != M)) + return + M.forceMove(get_turf(src)) + ..() + playsound(src,'sound/mecha/mechmove01.ogg', 50, 1) + M.pixel_y = 14 + layer = 4.1 + if(M.client) + M.client.change_view(view_range) + if(!auto) + auto = new() + auto.Grant(M, src) + +/datum/action/innate/protoemitter + check_flags = AB_CHECK_RESTRAINED | AB_CHECK_STUNNED | AB_CHECK_CONSCIOUS + var/obj/machinery/power/emitter/prototype/PE + var/mob/living/carbon/U + + +/datum/action/innate/protoemitter/Grant(mob/living/carbon/L, obj/machinery/power/emitter/prototype/proto) + PE = proto + U = L + . = ..() + +/datum/action/innate/protoemitter/firing + name = "Switch to Manual Firing" + desc = "The emitter will only fire on your command and at your designated target" + button_icon_state = "mech_zoom_on" + +/datum/action/innate/protoemitter/firing/Activate() + if(PE.manual) + playsound(PE,'sound/mecha/mechmove01.ogg', 50, 1) + PE.manual = FALSE + name = "Switch to Manual Firing" + desc = "The emitter will only fire on your command and at your designated target" + button_icon_state = "mech_zoom_on" + for(var/obj/item/I in U.held_items) + if(istype(I, /obj/item/weapon/turret_control)) + qdel(I) + UpdateButtonIcon() + return + else + playsound(PE,'sound/mecha/mechmove01.ogg', 50, 1) + name = "Switch to Automatic Firing" + desc = "Emitters will switch to periodic firing at your last target" + button_icon_state = "mech_zoom_off" + PE.manual = TRUE + for(var/V in U.held_items) + var/obj/item/I = V + if(istype(I)) + if(U.dropItemToGround(I)) + var/obj/item/weapon/turret_control/TC = new /obj/item/weapon/turret_control() + U.put_in_hands(TC) + else //Entries in the list should only ever be items or null, so if it's not an item, we can assume it's an empty hand + var/obj/item/weapon/turret_control/TC = new /obj/item/weapon/turret_control() + U.put_in_hands(TC) + UpdateButtonIcon() + + +/obj/item/weapon/turret_control + name = "turret controls" + icon_state = "offhand" + w_class = WEIGHT_CLASS_HUGE + flags = ABSTRACT | NODROP + resistance_flags = FIRE_PROOF | UNACIDABLE | ACID_PROOF | NOBLUDGEON + var/delay = 0 + +/obj/item/weapon/turret_control/afterattack(atom/targeted_atom, mob/user) + ..() + var/obj/machinery/power/emitter/E = user.buckled + E.setDir(get_dir(E,targeted_atom)) + user.setDir(E.dir) + switch(E.dir) + if(NORTH) + E.layer = 3.9 + user.pixel_x = 0 + user.pixel_y = -14 + if(NORTHEAST) + E.layer = 3.9 + user.pixel_x = -8 + user.pixel_y = -12 + if(EAST) + E.layer = 4.1 + user.pixel_x = -14 + user.pixel_y = 0 + if(SOUTHEAST) + E.layer = 3.9 + user.pixel_x = -8 + user.pixel_y = 12 + if(SOUTH) + E.layer = 4.1 + user.pixel_x = 0 + user.pixel_y = 14 + if(SOUTHWEST) + E.layer = 3.9 + user.pixel_x = 8 + user.pixel_y = 12 + if(WEST) + E.layer = 4.1 + user.pixel_x = 14 + user.pixel_y = 0 + if(NORTHWEST) + E.layer = 3.9 + user.pixel_x = 8 + user.pixel_y = -12 + + if(E.charge >= 10 && world.time > delay) + E.charge -= 10 + E.target = targeted_atom + E.fire_beam(targeted_atom, user) + delay = world.time + 10 + else if (E.charge < 10) + playsound(get_turf(user),'sound/machines/buzz-sigh.ogg', 50, 1) diff --git a/code/modules/power/singularity/particle_accelerator/particle_control.dm b/code/modules/power/singularity/particle_accelerator/particle_control.dm index 2045cb380c..136f9162cf 100644 --- a/code/modules/power/singularity/particle_accelerator/particle_control.dm +++ b/code/modules/power/singularity/particle_accelerator/particle_control.dm @@ -1,328 +1,328 @@ -/obj/machinery/particle_accelerator/control_box - name = "Particle Accelerator Control Console" - desc = "This controls the density of the particles." - icon = 'icons/obj/machines/particle_accelerator.dmi' - icon_state = "control_box" - anchored = 0 - density = 1 - use_power = 0 - idle_power_usage = 500 - active_power_usage = 10000 - dir = NORTH - var/strength_upper_limit = 2 - var/interface_control = 1 - var/list/obj/structure/particle_accelerator/connected_parts - var/assembled = 0 - var/construction_state = PA_CONSTRUCTION_UNSECURED - var/active = 0 - var/strength = 0 - var/powered = 0 - mouse_opacity = 2 - -/obj/machinery/particle_accelerator/control_box/New() - wires = new /datum/wires/particle_accelerator/control_box(src) - connected_parts = list() - ..() - -/obj/machinery/particle_accelerator/control_box/Destroy() - if(active) - toggle_power() - for(var/CP in connected_parts) - var/obj/structure/particle_accelerator/part = CP - part.master = null - connected_parts.Cut() - qdel(wires) - wires = null - return ..() - -/obj/machinery/particle_accelerator/control_box/attack_hand(mob/user) - if(construction_state == PA_CONSTRUCTION_COMPLETE) - interact(user) - else if(construction_state == PA_CONSTRUCTION_PANEL_OPEN) - wires.interact(user) - -/obj/machinery/particle_accelerator/control_box/proc/update_state() - if(construction_state < PA_CONSTRUCTION_COMPLETE) - use_power = 0 - assembled = 0 - active = 0 - for(var/CP in connected_parts) - var/obj/structure/particle_accelerator/part = CP - part.strength = null - part.powered = 0 - part.update_icon() - connected_parts.Cut() - return - if(!part_scan()) - use_power = 1 - active = 0 - connected_parts.Cut() - -/obj/machinery/particle_accelerator/control_box/update_icon() - if(active) - icon_state = "control_boxp1" - else - if(use_power) - if(assembled) - icon_state = "control_boxp" - else - icon_state = "ucontrol_boxp" - else - switch(construction_state) - if(PA_CONSTRUCTION_UNSECURED, PA_CONSTRUCTION_UNWIRED) - icon_state = "control_box" - if(PA_CONSTRUCTION_PANEL_OPEN) - icon_state = "control_boxw" - else - icon_state = "control_boxc" - -/obj/machinery/particle_accelerator/control_box/Topic(href, href_list) - if(..()) - return - - if(!interface_control) - to_chat(usr, "ERROR: Request timed out. Check wire contacts.") - return - - if(href_list["close"]) - usr << browse(null, "window=pacontrol") - usr.unset_machine() - return - if(href_list["togglep"]) - if(!wires.is_cut(WIRE_POWER)) - toggle_power() - - else if(href_list["scan"]) - part_scan() - - else if(href_list["strengthup"]) - if(!wires.is_cut(WIRE_STRENGTH)) - add_strength() - - else if(href_list["strengthdown"]) - if(!wires.is_cut(WIRE_STRENGTH)) - remove_strength() - - updateDialog() - update_icon() - -/obj/machinery/particle_accelerator/control_box/proc/strength_change() - for(var/CP in connected_parts) - var/obj/structure/particle_accelerator/part = CP - part.strength = strength - part.update_icon() - -/obj/machinery/particle_accelerator/control_box/proc/add_strength(s) - if(assembled && (strength < strength_upper_limit)) - strength++ - strength_change() - - message_admins("PA Control Computer increased to [strength] by [ADMIN_LOOKUPFLW(usr)] in [ADMIN_COORDJMP(src)]",0,1) - log_game("PA Control Computer increased to [strength] by [key_name(usr)] in [COORD(src)]") - investigate_log("increased to [strength] by [key_name(usr)]","singulo") - - -/obj/machinery/particle_accelerator/control_box/proc/remove_strength(s) - if(assembled && (strength > 0)) - strength-- - strength_change() - - message_admins("PA Control Computer decreased to [strength] by [ADMIN_LOOKUPFLW(usr)] in [ADMIN_COORDJMP(src)]",0,1) - log_game("PA Control Computer decreased to [strength] by [key_name(usr)] in [COORD(src)]") - investigate_log("decreased to [strength] by [key_name(usr)]","singulo") - - -/obj/machinery/particle_accelerator/control_box/power_change() - ..() - if(stat & NOPOWER) - active = 0 - use_power = 0 - else if(!stat && construction_state == PA_CONSTRUCTION_COMPLETE) - use_power = 1 - -/obj/machinery/particle_accelerator/control_box/process() - if(active) - //a part is missing! - if(connected_parts.len < 6) - investigate_log("lost a connected part; It powered down.","singulo") - toggle_power() - update_icon() - return - //emit some particles - for(var/obj/structure/particle_accelerator/particle_emitter/PE in connected_parts) - PE.emit_particle(strength) - -/obj/machinery/particle_accelerator/control_box/proc/part_scan() - var/ldir = turn(dir,-90) - var/rdir = turn(dir,90) - var/odir = turn(dir,180) - var/turf/T = loc - - assembled = 0 - critical_machine = FALSE - - var/obj/structure/particle_accelerator/fuel_chamber/F = locate() in orange(1,src) - if(!F) - return 0 - - setDir(F.dir) - connected_parts.Cut() - - T = get_step(T,rdir) - if(!check_part(T,/obj/structure/particle_accelerator/fuel_chamber)) - return 0 - T = get_step(T,odir) - if(!check_part(T,/obj/structure/particle_accelerator/end_cap)) - return 0 - T = get_step(T,dir) - T = get_step(T,dir) - if(!check_part(T,/obj/structure/particle_accelerator/power_box)) - return 0 - T = get_step(T,dir) - if(!check_part(T,/obj/structure/particle_accelerator/particle_emitter/center)) - return 0 - T = get_step(T,ldir) - if(!check_part(T,/obj/structure/particle_accelerator/particle_emitter/left)) - return 0 - T = get_step(T,rdir) - T = get_step(T,rdir) - if(!check_part(T,/obj/structure/particle_accelerator/particle_emitter/right)) - return 0 - - assembled = 1 - critical_machine = TRUE //Only counts if the PA is actually assembled. - return 1 - -/obj/machinery/particle_accelerator/control_box/proc/check_part(turf/T, type) - var/obj/structure/particle_accelerator/PA = locate(/obj/structure/particle_accelerator) in T - if(istype(PA, type) && (PA.construction_state == PA_CONSTRUCTION_COMPLETE)) - if(PA.connect_master(src)) - connected_parts.Add(PA) - return 1 - return 0 - - -/obj/machinery/particle_accelerator/control_box/proc/toggle_power() - active = !active - investigate_log("turned [active?"ON":"OFF"] by [usr ? key_name(usr) : "outside forces"]","singulo") - message_admins("PA Control Computer turned [active ?"ON":"OFF"] by [usr ? key_name_admin(usr) : "outside forces"](?) (FLW) in ([x],[y],[z] - JMP)",0,1) - log_game("PA Control Computer turned [active ?"ON":"OFF"] by [usr ? "[key_name(usr)]" : "outside forces"] in ([x],[y],[z])") - if(active) - use_power = 2 - for(var/CP in connected_parts) - var/obj/structure/particle_accelerator/part = CP - part.strength = strength - part.powered = 1 - part.update_icon() - else - use_power = 1 - for(var/CP in connected_parts) - var/obj/structure/particle_accelerator/part = CP - part.strength = null - part.powered = 0 - part.update_icon() - return 1 - - -/obj/machinery/particle_accelerator/control_box/interact(mob/user) - if((get_dist(src, user) > 1) || (stat & (BROKEN|NOPOWER))) - if(!issilicon(user)) - user.unset_machine() - user << browse(null, "window=pacontrol") - return - user.set_machine(src) - - var/dat = "" - dat += "Close

" - dat += "

Status

" - if(!assembled) - dat += "Unable to detect all parts!
" - dat += "Run Scan

" - else - dat += "All parts in place.

" - dat += "Power:" - if(active) - dat += "On
" - else - dat += "Off
" - dat += "Toggle Power

" - dat += "Particle Strength: [strength] " - dat += "--|++

" - - var/datum/browser/popup = new(user, "pacontrol", name, 420, 300) - popup.set_content(dat) - popup.set_title_image(user.browse_rsc_icon(icon, icon_state)) - popup.open() - -/obj/machinery/particle_accelerator/control_box/examine(mob/user) - ..() - switch(construction_state) - if(PA_CONSTRUCTION_UNSECURED) - to_chat(user, "Looks like it's not attached to the flooring") - if(PA_CONSTRUCTION_UNWIRED) - to_chat(user, "It is missing some cables") - if(PA_CONSTRUCTION_PANEL_OPEN) - to_chat(user, "The panel is open") - - -/obj/machinery/particle_accelerator/control_box/attackby(obj/item/W, mob/user, params) - var/did_something = FALSE - - switch(construction_state) - if(PA_CONSTRUCTION_UNSECURED) - if(istype(W, /obj/item/weapon/wrench) && !isinspace()) - playsound(loc, W.usesound, 75, 1) - anchored = 1 - user.visible_message("[user.name] secures the [name] to the floor.", \ - "You secure the external bolts.") - construction_state = PA_CONSTRUCTION_UNWIRED - did_something = TRUE - if(PA_CONSTRUCTION_UNWIRED) - if(istype(W, /obj/item/weapon/wrench)) - playsound(loc, W.usesound, 75, 1) - anchored = 0 - user.visible_message("[user.name] detaches the [name] from the floor.", \ - "You remove the external bolts.") - construction_state = PA_CONSTRUCTION_UNSECURED - did_something = TRUE - else if(istype(W, /obj/item/stack/cable_coil)) - var/obj/item/stack/cable_coil/CC = W - if(CC.use(1)) - user.visible_message("[user.name] adds wires to the [name].", \ - "You add some wires.") - construction_state = PA_CONSTRUCTION_PANEL_OPEN - did_something = TRUE - if(PA_CONSTRUCTION_PANEL_OPEN) - if(istype(W, /obj/item/weapon/wirecutters))//TODO:Shock user if its on? - user.visible_message("[user.name] removes some wires from the [name].", \ - "You remove some wires.") - construction_state = PA_CONSTRUCTION_UNWIRED - did_something = TRUE - else if(istype(W, /obj/item/weapon/screwdriver)) - user.visible_message("[user.name] closes the [name]'s access panel.", \ - "You close the access panel.") - construction_state = PA_CONSTRUCTION_COMPLETE - did_something = TRUE - if(PA_CONSTRUCTION_COMPLETE) - if(istype(W, /obj/item/weapon/screwdriver)) - user.visible_message("[user.name] opens the [name]'s access panel.", \ - "You open the access panel.") - construction_state = PA_CONSTRUCTION_PANEL_OPEN - did_something = TRUE - - if(did_something) - user.changeNext_move(CLICK_CD_MELEE) - update_state() - update_icon() - return - - ..() - -/obj/machinery/particle_accelerator/control_box/blob_act(obj/structure/blob/B) - if(prob(50)) - qdel(src) - -#undef PA_CONSTRUCTION_UNSECURED -#undef PA_CONSTRUCTION_UNWIRED -#undef PA_CONSTRUCTION_PANEL_OPEN -#undef PA_CONSTRUCTION_COMPLETE +/obj/machinery/particle_accelerator/control_box + name = "Particle Accelerator Control Console" + desc = "This controls the density of the particles." + icon = 'icons/obj/machines/particle_accelerator.dmi' + icon_state = "control_box" + anchored = 0 + density = 1 + use_power = 0 + idle_power_usage = 500 + active_power_usage = 10000 + dir = NORTH + var/strength_upper_limit = 2 + var/interface_control = 1 + var/list/obj/structure/particle_accelerator/connected_parts + var/assembled = 0 + var/construction_state = PA_CONSTRUCTION_UNSECURED + var/active = 0 + var/strength = 0 + var/powered = 0 + mouse_opacity = 2 + +/obj/machinery/particle_accelerator/control_box/New() + wires = new /datum/wires/particle_accelerator/control_box(src) + connected_parts = list() + ..() + +/obj/machinery/particle_accelerator/control_box/Destroy() + if(active) + toggle_power() + for(var/CP in connected_parts) + var/obj/structure/particle_accelerator/part = CP + part.master = null + connected_parts.Cut() + qdel(wires) + wires = null + return ..() + +/obj/machinery/particle_accelerator/control_box/attack_hand(mob/user) + if(construction_state == PA_CONSTRUCTION_COMPLETE) + interact(user) + else if(construction_state == PA_CONSTRUCTION_PANEL_OPEN) + wires.interact(user) + +/obj/machinery/particle_accelerator/control_box/proc/update_state() + if(construction_state < PA_CONSTRUCTION_COMPLETE) + use_power = 0 + assembled = 0 + active = 0 + for(var/CP in connected_parts) + var/obj/structure/particle_accelerator/part = CP + part.strength = null + part.powered = 0 + part.update_icon() + connected_parts.Cut() + return + if(!part_scan()) + use_power = 1 + active = 0 + connected_parts.Cut() + +/obj/machinery/particle_accelerator/control_box/update_icon() + if(active) + icon_state = "control_boxp1" + else + if(use_power) + if(assembled) + icon_state = "control_boxp" + else + icon_state = "ucontrol_boxp" + else + switch(construction_state) + if(PA_CONSTRUCTION_UNSECURED, PA_CONSTRUCTION_UNWIRED) + icon_state = "control_box" + if(PA_CONSTRUCTION_PANEL_OPEN) + icon_state = "control_boxw" + else + icon_state = "control_boxc" + +/obj/machinery/particle_accelerator/control_box/Topic(href, href_list) + if(..()) + return + + if(!interface_control) + to_chat(usr, "ERROR: Request timed out. Check wire contacts.") + return + + if(href_list["close"]) + usr << browse(null, "window=pacontrol") + usr.unset_machine() + return + if(href_list["togglep"]) + if(!wires.is_cut(WIRE_POWER)) + toggle_power() + + else if(href_list["scan"]) + part_scan() + + else if(href_list["strengthup"]) + if(!wires.is_cut(WIRE_STRENGTH)) + add_strength() + + else if(href_list["strengthdown"]) + if(!wires.is_cut(WIRE_STRENGTH)) + remove_strength() + + updateDialog() + update_icon() + +/obj/machinery/particle_accelerator/control_box/proc/strength_change() + for(var/CP in connected_parts) + var/obj/structure/particle_accelerator/part = CP + part.strength = strength + part.update_icon() + +/obj/machinery/particle_accelerator/control_box/proc/add_strength(s) + if(assembled && (strength < strength_upper_limit)) + strength++ + strength_change() + + message_admins("PA Control Computer increased to [strength] by [ADMIN_LOOKUPFLW(usr)] in [ADMIN_COORDJMP(src)]",0,1) + log_game("PA Control Computer increased to [strength] by [key_name(usr)] in [COORD(src)]") + investigate_log("increased to [strength] by [key_name(usr)]","singulo") + + +/obj/machinery/particle_accelerator/control_box/proc/remove_strength(s) + if(assembled && (strength > 0)) + strength-- + strength_change() + + message_admins("PA Control Computer decreased to [strength] by [ADMIN_LOOKUPFLW(usr)] in [ADMIN_COORDJMP(src)]",0,1) + log_game("PA Control Computer decreased to [strength] by [key_name(usr)] in [COORD(src)]") + investigate_log("decreased to [strength] by [key_name(usr)]","singulo") + + +/obj/machinery/particle_accelerator/control_box/power_change() + ..() + if(stat & NOPOWER) + active = 0 + use_power = 0 + else if(!stat && construction_state == PA_CONSTRUCTION_COMPLETE) + use_power = 1 + +/obj/machinery/particle_accelerator/control_box/process() + if(active) + //a part is missing! + if(connected_parts.len < 6) + investigate_log("lost a connected part; It powered down.","singulo") + toggle_power() + update_icon() + return + //emit some particles + for(var/obj/structure/particle_accelerator/particle_emitter/PE in connected_parts) + PE.emit_particle(strength) + +/obj/machinery/particle_accelerator/control_box/proc/part_scan() + var/ldir = turn(dir,-90) + var/rdir = turn(dir,90) + var/odir = turn(dir,180) + var/turf/T = loc + + assembled = 0 + critical_machine = FALSE + + var/obj/structure/particle_accelerator/fuel_chamber/F = locate() in orange(1,src) + if(!F) + return 0 + + setDir(F.dir) + connected_parts.Cut() + + T = get_step(T,rdir) + if(!check_part(T,/obj/structure/particle_accelerator/fuel_chamber)) + return 0 + T = get_step(T,odir) + if(!check_part(T,/obj/structure/particle_accelerator/end_cap)) + return 0 + T = get_step(T,dir) + T = get_step(T,dir) + if(!check_part(T,/obj/structure/particle_accelerator/power_box)) + return 0 + T = get_step(T,dir) + if(!check_part(T,/obj/structure/particle_accelerator/particle_emitter/center)) + return 0 + T = get_step(T,ldir) + if(!check_part(T,/obj/structure/particle_accelerator/particle_emitter/left)) + return 0 + T = get_step(T,rdir) + T = get_step(T,rdir) + if(!check_part(T,/obj/structure/particle_accelerator/particle_emitter/right)) + return 0 + + assembled = 1 + critical_machine = TRUE //Only counts if the PA is actually assembled. + return 1 + +/obj/machinery/particle_accelerator/control_box/proc/check_part(turf/T, type) + var/obj/structure/particle_accelerator/PA = locate(/obj/structure/particle_accelerator) in T + if(istype(PA, type) && (PA.construction_state == PA_CONSTRUCTION_COMPLETE)) + if(PA.connect_master(src)) + connected_parts.Add(PA) + return 1 + return 0 + + +/obj/machinery/particle_accelerator/control_box/proc/toggle_power() + active = !active + investigate_log("turned [active?"ON":"OFF"] by [usr ? key_name(usr) : "outside forces"]","singulo") + message_admins("PA Control Computer turned [active ?"ON":"OFF"] by [usr ? key_name_admin(usr) : "outside forces"](?) (FLW) in ([x],[y],[z] - JMP)",0,1) + log_game("PA Control Computer turned [active ?"ON":"OFF"] by [usr ? "[key_name(usr)]" : "outside forces"] in ([x],[y],[z])") + if(active) + use_power = 2 + for(var/CP in connected_parts) + var/obj/structure/particle_accelerator/part = CP + part.strength = strength + part.powered = 1 + part.update_icon() + else + use_power = 1 + for(var/CP in connected_parts) + var/obj/structure/particle_accelerator/part = CP + part.strength = null + part.powered = 0 + part.update_icon() + return 1 + + +/obj/machinery/particle_accelerator/control_box/interact(mob/user) + if((get_dist(src, user) > 1) || (stat & (BROKEN|NOPOWER))) + if(!issilicon(user)) + user.unset_machine() + user << browse(null, "window=pacontrol") + return + user.set_machine(src) + + var/dat = "" + dat += "Close

" + dat += "

Status

" + if(!assembled) + dat += "Unable to detect all parts!
" + dat += "Run Scan

" + else + dat += "All parts in place.

" + dat += "Power:" + if(active) + dat += "On
" + else + dat += "Off
" + dat += "Toggle Power

" + dat += "Particle Strength: [strength] " + dat += "--|++

" + + var/datum/browser/popup = new(user, "pacontrol", name, 420, 300) + popup.set_content(dat) + popup.set_title_image(user.browse_rsc_icon(icon, icon_state)) + popup.open() + +/obj/machinery/particle_accelerator/control_box/examine(mob/user) + ..() + switch(construction_state) + if(PA_CONSTRUCTION_UNSECURED) + to_chat(user, "Looks like it's not attached to the flooring") + if(PA_CONSTRUCTION_UNWIRED) + to_chat(user, "It is missing some cables") + if(PA_CONSTRUCTION_PANEL_OPEN) + to_chat(user, "The panel is open") + + +/obj/machinery/particle_accelerator/control_box/attackby(obj/item/W, mob/user, params) + var/did_something = FALSE + + switch(construction_state) + if(PA_CONSTRUCTION_UNSECURED) + if(istype(W, /obj/item/weapon/wrench) && !isinspace()) + playsound(loc, W.usesound, 75, 1) + anchored = 1 + user.visible_message("[user.name] secures the [name] to the floor.", \ + "You secure the external bolts.") + construction_state = PA_CONSTRUCTION_UNWIRED + did_something = TRUE + if(PA_CONSTRUCTION_UNWIRED) + if(istype(W, /obj/item/weapon/wrench)) + playsound(loc, W.usesound, 75, 1) + anchored = 0 + user.visible_message("[user.name] detaches the [name] from the floor.", \ + "You remove the external bolts.") + construction_state = PA_CONSTRUCTION_UNSECURED + did_something = TRUE + else if(istype(W, /obj/item/stack/cable_coil)) + var/obj/item/stack/cable_coil/CC = W + if(CC.use(1)) + user.visible_message("[user.name] adds wires to the [name].", \ + "You add some wires.") + construction_state = PA_CONSTRUCTION_PANEL_OPEN + did_something = TRUE + if(PA_CONSTRUCTION_PANEL_OPEN) + if(istype(W, /obj/item/weapon/wirecutters))//TODO:Shock user if its on? + user.visible_message("[user.name] removes some wires from the [name].", \ + "You remove some wires.") + construction_state = PA_CONSTRUCTION_UNWIRED + did_something = TRUE + else if(istype(W, /obj/item/weapon/screwdriver)) + user.visible_message("[user.name] closes the [name]'s access panel.", \ + "You close the access panel.") + construction_state = PA_CONSTRUCTION_COMPLETE + did_something = TRUE + if(PA_CONSTRUCTION_COMPLETE) + if(istype(W, /obj/item/weapon/screwdriver)) + user.visible_message("[user.name] opens the [name]'s access panel.", \ + "You open the access panel.") + construction_state = PA_CONSTRUCTION_PANEL_OPEN + did_something = TRUE + + if(did_something) + user.changeNext_move(CLICK_CD_MELEE) + update_state() + update_icon() + return + + ..() + +/obj/machinery/particle_accelerator/control_box/blob_act(obj/structure/blob/B) + if(prob(50)) + qdel(src) + +#undef PA_CONSTRUCTION_UNSECURED +#undef PA_CONSTRUCTION_UNWIRED +#undef PA_CONSTRUCTION_PANEL_OPEN +#undef PA_CONSTRUCTION_COMPLETE diff --git a/code/modules/projectiles/ammunition/energy.dm b/code/modules/projectiles/ammunition/energy.dm index bf695cffed..ba4770ebba 100644 --- a/code/modules/projectiles/ammunition/energy.dm +++ b/code/modules/projectiles/ammunition/energy.dm @@ -9,6 +9,7 @@ firing_effect_type = /obj/effect/overlay/temp/dir_setting/firing_effect/energy /obj/item/ammo_casing/energy/chameleon + projectile_type = /obj/item/projectile/energy/chameleon e_cost = 0 var/list/projectile_vars = list() diff --git a/code/modules/projectiles/projectile/bullets.dm b/code/modules/projectiles/projectile/bullets.dm index 4e85ee3299..cceb77bee1 100644 --- a/code/modules/projectiles/projectile/bullets.dm +++ b/code/modules/projectiles/projectile/bullets.dm @@ -190,7 +190,7 @@ name = "dart" icon_state = "cbbolt" damage = 6 - var/piercing = FALSE + var/piercing = FALSE /obj/item/projectile/bullet/dart/New() ..() @@ -201,15 +201,15 @@ if(iscarbon(target)) var/mob/living/carbon/M = target if(blocked != 100) // not completely blocked - if(M.can_inject(null, FALSE, def_zone, piercing)) // Pass the hit zone to see if it can inject by whether it hit the head or the body. + if(M.can_inject(null, FALSE, def_zone, piercing)) // Pass the hit zone to see if it can inject by whether it hit the head or the body. ..() reagents.reaction(M, INJECT) reagents.trans_to(M, reagents.total_volume) - return TRUE + return TRUE else blocked = 100 - target.visible_message("\The [src] was deflected!", \ - "You were protected against \the [src]!") + target.visible_message("\The [src] was deflected!", \ + "You were protected against \the [src]!") ..(target, blocked) reagents.set_reacting(TRUE) @@ -240,28 +240,28 @@ nodamage = 1 . = ..() // Execute the rest of the code. -/obj/item/projectile/bullet/dnainjector - name = "\improper DNA injector" - icon_state = "syringeproj" - var/obj/item/weapon/dnainjector/injector - -/obj/item/projectile/bullet/dnainjector/on_hit(atom/target, blocked = 0) - if(iscarbon(target)) - var/mob/living/carbon/M = target - if(blocked != 100) - if(M.can_inject(null, FALSE, def_zone, FALSE)) - if(injector.inject(M, firer)) - QDEL_NULL(injector) - return TRUE - else - blocked = 100 - target.visible_message("\The [src] was deflected!", \ - "You were protected against \the [src]!") - return ..() - -/obj/item/projectile/bullet/dnainjector/Destroy() - QDEL_NULL(injector) - return ..() +/obj/item/projectile/bullet/dnainjector + name = "\improper DNA injector" + icon_state = "syringeproj" + var/obj/item/weapon/dnainjector/injector + +/obj/item/projectile/bullet/dnainjector/on_hit(atom/target, blocked = 0) + if(iscarbon(target)) + var/mob/living/carbon/M = target + if(blocked != 100) + if(M.can_inject(null, FALSE, def_zone, FALSE)) + if(injector.inject(M, firer)) + QDEL_NULL(injector) + return TRUE + else + blocked = 100 + target.visible_message("\The [src] was deflected!", \ + "You were protected against \the [src]!") + return ..() + +/obj/item/projectile/bullet/dnainjector/Destroy() + QDEL_NULL(injector) + return ..() //// SNIPER BULLETS diff --git a/code/modules/projectiles/projectile/energy.dm b/code/modules/projectiles/projectile/energy.dm index 974ea935f2..cfa7727186 100644 --- a/code/modules/projectiles/projectile/energy.dm +++ b/code/modules/projectiles/projectile/energy.dm @@ -5,6 +5,8 @@ damage_type = BURN flag = "energy" +/obj/item/projectile/energy/chameleon + nodamage = TRUE /obj/item/projectile/energy/electrode name = "electrode" diff --git a/code/modules/reagents/chemistry/reagents/food_reagents.dm b/code/modules/reagents/chemistry/reagents/food_reagents.dm old mode 100755 new mode 100644 diff --git a/code/modules/reagents/reagent_containers/glass.dm b/code/modules/reagents/reagent_containers/glass.dm old mode 100755 new mode 100644 diff --git a/code/modules/reagents/reagent_containers/spray.dm b/code/modules/reagents/reagent_containers/spray.dm index df8f7927c0..cc38a44ffc 100644 --- a/code/modules/reagents/reagent_containers/spray.dm +++ b/code/modules/reagents/reagent_containers/spray.dm @@ -1,239 +1,239 @@ -/obj/item/weapon/reagent_containers/spray - name = "spray bottle" - desc = "A spray bottle, with an unscrewable top." - icon = 'icons/obj/janitor.dmi' - icon_state = "cleaner" - item_state = "cleaner" - flags = NOBLUDGEON - container_type = OPENCONTAINER - slot_flags = SLOT_BELT - throwforce = 0 - w_class = WEIGHT_CLASS_SMALL - throw_speed = 3 - throw_range = 7 - var/stream_mode = 0 //whether we use the more focused mode - var/current_range = 3 //the range of tiles the sprayer will reach. - var/spray_range = 3 //the range of tiles the sprayer will reach when in spray mode. - var/stream_range = 1 //the range of tiles the sprayer will reach when in stream mode. - var/stream_amount = 10 //the amount of reagents transfered when in stream mode. - amount_per_transfer_from_this = 5 - volume = 250 - possible_transfer_amounts = list(5,10,15,20,25,30,50,100) - - -/obj/item/weapon/reagent_containers/spray/afterattack(atom/A as mob|obj, mob/user) - if(istype(A, /obj/structure/sink) || istype(A, /obj/structure/janitorialcart) || istype(A, /obj/machinery/hydroponics)) - return - - if(istype(A, /obj/structure/reagent_dispensers) && get_dist(src,A) <= 1) //this block copypasted from reagent_containers/glass, for lack of a better solution - if(!A.reagents.total_volume && A.reagents) - to_chat(user, "\The [A] is empty.") - return - - if(reagents.total_volume >= reagents.maximum_volume) - to_chat(user, "\The [src] is full.") - return - - var/trans = A.reagents.trans_to(src, 50) //transfer 50u , using the spray's transfer amount would take too long to refill - to_chat(user, "You fill \the [src] with [trans] units of the contents of \the [A].") - return - - if(reagents.total_volume < amount_per_transfer_from_this) - to_chat(user, "\The [src] is empty!") - return - - spray(A) - - playsound(src.loc, 'sound/effects/spray2.ogg', 50, 1, -6) - user.changeNext_move(CLICK_CD_RANGE*2) - user.newtonian_move(get_dir(A, user)) - var/turf/T = get_turf(src) - var/area/area = get_area(src) - if(reagents.has_reagent("sacid")) - message_admins("[ADMIN_LOOKUPFLW(user)] fired sulphuric acid from \a [src] at [area] [ADMIN_COORDJMP(T)].") - log_game("[key_name(user)] fired sulphuric acid from \a [src] at [area] ([T.x], [T.y], [T.z]).") - if(reagents.has_reagent("facid")) - message_admins("[ADMIN_LOOKUPFLW(user)] fired Fluacid from \a [src] at [area] [ADMIN_COORDJMP(T)].") - log_game("[key_name(user)] fired Fluacid from \a [src] at [area] [COORD(T)].") - if(reagents.has_reagent("lube")) - message_admins("[ADMIN_LOOKUPFLW(user)] fired Space lube from \a [src] at [area] [ADMIN_COORDJMP(T)].") - log_game("[key_name(user)] fired Space lube from \a [src] at [area] [COORD(T)].") - return - - -/obj/item/weapon/reagent_containers/spray/proc/spray(atom/A) - var/range = max(min(current_range, get_dist(src, A)), 1) - var/obj/effect/decal/chempuff/D = new /obj/effect/decal/chempuff(get_turf(src)) - D.create_reagents(amount_per_transfer_from_this) - var/puff_reagent_left = range //how many turf, mob or dense objet we can react with before we consider the chem puff consumed - if(stream_mode) - reagents.trans_to(D, amount_per_transfer_from_this) - puff_reagent_left = 1 - else - reagents.trans_to(D, amount_per_transfer_from_this, 1/range) - D.color = mix_color_from_reagents(D.reagents.reagent_list) - var/wait_step = max(round(2+3/range), 2) - spawn(0) - var/range_left = range - for(var/i=0, i 0 && (!stream_mode || !range_left)) - D.reagents.reaction(get_turf(D), VAPOR) - puff_reagent_left -= 1 - - if(puff_reagent_left <= 0) // we used all the puff so we delete it. - qdel(D) - return - qdel(D) - -/obj/item/weapon/reagent_containers/spray/attack_self(mob/user) - stream_mode = !stream_mode - if(stream_mode) - amount_per_transfer_from_this = stream_amount - current_range = stream_range - else - amount_per_transfer_from_this = initial(amount_per_transfer_from_this) - current_range = spray_range - to_chat(user, "You switch the nozzle setting to [stream_mode ? "\"stream\"":"\"spray\""]. You'll now use [amount_per_transfer_from_this] units per use.") - -/obj/item/weapon/reagent_containers/spray/verb/empty() - set name = "Empty Spray Bottle" - set category = "Object" - set src in usr - if(usr.incapacitated()) - return - if (alert(usr, "Are you sure you want to empty that?", "Empty Bottle:", "Yes", "No") != "Yes") - return - if(isturf(usr.loc) && src.loc == usr) - to_chat(usr, "You empty \the [src] onto the floor.") - reagents.reaction(usr.loc) - src.reagents.clear_reagents() - -//space cleaner -/obj/item/weapon/reagent_containers/spray/cleaner - name = "space cleaner" - desc = "BLAM!-brand non-foaming space cleaner!" - list_reagents = list("cleaner" = 250) - -//spray tan -/obj/item/weapon/reagent_containers/spray/spraytan - name = "spray tan" - volume = 50 - desc = "Gyaro brand spray tan. Do not spray near eyes or other orifices." - list_reagents = list("spraytan" = 50) - - -/obj/item/weapon/reagent_containers/spray/medical - name = "medical spray" - icon = 'icons/obj/chemical.dmi' - icon_state = "medspray" - volume = 100 - - -/obj/item/weapon/reagent_containers/spray/medical/sterilizer - name = "sterilizer spray" - desc = "Spray bottle loaded with non-toxic sterilizer. Useful in preparation for surgery." - list_reagents = list("sterilizine" = 100) - - -//pepperspray -/obj/item/weapon/reagent_containers/spray/pepper - name = "pepperspray" - desc = "Manufactured by UhangInc, used to blind and down an opponent quickly." - icon = 'icons/obj/weapons.dmi' - icon_state = "pepperspray" - item_state = "pepperspray" - volume = 40 - stream_range = 4 - amount_per_transfer_from_this = 5 - list_reagents = list("condensedcapsaicin" = 40) - -// Fix pepperspraying yourself -/obj/item/weapon/reagent_containers/spray/pepper/afterattack(atom/A as mob|obj, mob/user) - if (A.loc == user) - return - ..() - -//water flower -/obj/item/weapon/reagent_containers/spray/waterflower - name = "water flower" - desc = "A seemingly innocent sunflower...with a twist." - icon = 'icons/obj/hydroponics/harvest.dmi' - icon_state = "sunflower" - item_state = "sunflower" - amount_per_transfer_from_this = 1 - volume = 10 - list_reagents = list("water" = 10) - -/obj/item/weapon/reagent_containers/spray/waterflower/attack_self(mob/user) //Don't allow changing how much the flower sprays - return - -//chemsprayer -/obj/item/weapon/reagent_containers/spray/chemsprayer - name = "chem sprayer" - desc = "A utility used to spray large amounts of reagents in a given area." - icon = 'icons/obj/guns/projectile.dmi' - icon_state = "chemsprayer" - item_state = "chemsprayer" - throwforce = 0 - w_class = WEIGHT_CLASS_NORMAL - stream_mode = 1 - current_range = 7 - spray_range = 4 - stream_range = 7 - amount_per_transfer_from_this = 10 - volume = 600 - origin_tech = "combat=3;materials=3;engineering=3" - -/obj/item/weapon/reagent_containers/spray/chemsprayer/afterattack(atom/A as mob|obj, mob/user) - // Make it so the bioterror spray doesn't spray yourself when you click your inventory items - if (A.loc == user) - return - ..() - -/obj/item/weapon/reagent_containers/spray/chemsprayer/spray(atom/A) - var/direction = get_dir(src, A) - var/turf/T = get_turf(A) - var/turf/T1 = get_step(T,turn(direction, 90)) - var/turf/T2 = get_step(T,turn(direction, -90)) - var/list/the_targets = list(T,T1,T2) - - for(var/i=1, i<=3, i++) // intialize sprays - if(reagents.total_volume < 1) - return - ..(the_targets[i]) - -/obj/item/weapon/reagent_containers/spray/chemsprayer/bioterror - list_reagents = list("sodium_thiopental" = 100, "coniine" = 100, "venom" = 100, "condensedcapsaicin" = 100, "initropidril" = 100, "polonium" = 100) - -// Plant-B-Gone -/obj/item/weapon/reagent_containers/spray/plantbgone // -- Skie - name = "Plant-B-Gone" - desc = "Kills those pesky weeds!" - icon = 'icons/obj/hydroponics/equipment.dmi' - icon_state = "plantbgone" - item_state = "plantbgone" - volume = 100 - list_reagents = list("plantbgone" = 100) +/obj/item/weapon/reagent_containers/spray + name = "spray bottle" + desc = "A spray bottle, with an unscrewable top." + icon = 'icons/obj/janitor.dmi' + icon_state = "cleaner" + item_state = "cleaner" + flags = NOBLUDGEON + container_type = OPENCONTAINER + slot_flags = SLOT_BELT + throwforce = 0 + w_class = WEIGHT_CLASS_SMALL + throw_speed = 3 + throw_range = 7 + var/stream_mode = 0 //whether we use the more focused mode + var/current_range = 3 //the range of tiles the sprayer will reach. + var/spray_range = 3 //the range of tiles the sprayer will reach when in spray mode. + var/stream_range = 1 //the range of tiles the sprayer will reach when in stream mode. + var/stream_amount = 10 //the amount of reagents transfered when in stream mode. + amount_per_transfer_from_this = 5 + volume = 250 + possible_transfer_amounts = list(5,10,15,20,25,30,50,100) + + +/obj/item/weapon/reagent_containers/spray/afterattack(atom/A as mob|obj, mob/user) + if(istype(A, /obj/structure/sink) || istype(A, /obj/structure/janitorialcart) || istype(A, /obj/machinery/hydroponics)) + return + + if(istype(A, /obj/structure/reagent_dispensers) && get_dist(src,A) <= 1) //this block copypasted from reagent_containers/glass, for lack of a better solution + if(!A.reagents.total_volume && A.reagents) + to_chat(user, "\The [A] is empty.") + return + + if(reagents.total_volume >= reagents.maximum_volume) + to_chat(user, "\The [src] is full.") + return + + var/trans = A.reagents.trans_to(src, 50) //transfer 50u , using the spray's transfer amount would take too long to refill + to_chat(user, "You fill \the [src] with [trans] units of the contents of \the [A].") + return + + if(reagents.total_volume < amount_per_transfer_from_this) + to_chat(user, "\The [src] is empty!") + return + + spray(A) + + playsound(src.loc, 'sound/effects/spray2.ogg', 50, 1, -6) + user.changeNext_move(CLICK_CD_RANGE*2) + user.newtonian_move(get_dir(A, user)) + var/turf/T = get_turf(src) + var/area/area = get_area(src) + if(reagents.has_reagent("sacid")) + message_admins("[ADMIN_LOOKUPFLW(user)] fired sulphuric acid from \a [src] at [area] [ADMIN_COORDJMP(T)].") + log_game("[key_name(user)] fired sulphuric acid from \a [src] at [area] ([T.x], [T.y], [T.z]).") + if(reagents.has_reagent("facid")) + message_admins("[ADMIN_LOOKUPFLW(user)] fired Fluacid from \a [src] at [area] [ADMIN_COORDJMP(T)].") + log_game("[key_name(user)] fired Fluacid from \a [src] at [area] [COORD(T)].") + if(reagents.has_reagent("lube")) + message_admins("[ADMIN_LOOKUPFLW(user)] fired Space lube from \a [src] at [area] [ADMIN_COORDJMP(T)].") + log_game("[key_name(user)] fired Space lube from \a [src] at [area] [COORD(T)].") + return + + +/obj/item/weapon/reagent_containers/spray/proc/spray(atom/A) + var/range = max(min(current_range, get_dist(src, A)), 1) + var/obj/effect/decal/chempuff/D = new /obj/effect/decal/chempuff(get_turf(src)) + D.create_reagents(amount_per_transfer_from_this) + var/puff_reagent_left = range //how many turf, mob or dense objet we can react with before we consider the chem puff consumed + if(stream_mode) + reagents.trans_to(D, amount_per_transfer_from_this) + puff_reagent_left = 1 + else + reagents.trans_to(D, amount_per_transfer_from_this, 1/range) + D.color = mix_color_from_reagents(D.reagents.reagent_list) + var/wait_step = max(round(2+3/range), 2) + spawn(0) + var/range_left = range + for(var/i=0, i 0 && (!stream_mode || !range_left)) + D.reagents.reaction(get_turf(D), VAPOR) + puff_reagent_left -= 1 + + if(puff_reagent_left <= 0) // we used all the puff so we delete it. + qdel(D) + return + qdel(D) + +/obj/item/weapon/reagent_containers/spray/attack_self(mob/user) + stream_mode = !stream_mode + if(stream_mode) + amount_per_transfer_from_this = stream_amount + current_range = stream_range + else + amount_per_transfer_from_this = initial(amount_per_transfer_from_this) + current_range = spray_range + to_chat(user, "You switch the nozzle setting to [stream_mode ? "\"stream\"":"\"spray\""]. You'll now use [amount_per_transfer_from_this] units per use.") + +/obj/item/weapon/reagent_containers/spray/verb/empty() + set name = "Empty Spray Bottle" + set category = "Object" + set src in usr + if(usr.incapacitated()) + return + if (alert(usr, "Are you sure you want to empty that?", "Empty Bottle:", "Yes", "No") != "Yes") + return + if(isturf(usr.loc) && src.loc == usr) + to_chat(usr, "You empty \the [src] onto the floor.") + reagents.reaction(usr.loc) + src.reagents.clear_reagents() + +//space cleaner +/obj/item/weapon/reagent_containers/spray/cleaner + name = "space cleaner" + desc = "BLAM!-brand non-foaming space cleaner!" + list_reagents = list("cleaner" = 250) + +//spray tan +/obj/item/weapon/reagent_containers/spray/spraytan + name = "spray tan" + volume = 50 + desc = "Gyaro brand spray tan. Do not spray near eyes or other orifices." + list_reagents = list("spraytan" = 50) + + +/obj/item/weapon/reagent_containers/spray/medical + name = "medical spray" + icon = 'icons/obj/chemical.dmi' + icon_state = "medspray" + volume = 100 + + +/obj/item/weapon/reagent_containers/spray/medical/sterilizer + name = "sterilizer spray" + desc = "Spray bottle loaded with non-toxic sterilizer. Useful in preparation for surgery." + list_reagents = list("sterilizine" = 100) + + +//pepperspray +/obj/item/weapon/reagent_containers/spray/pepper + name = "pepperspray" + desc = "Manufactured by UhangInc, used to blind and down an opponent quickly." + icon = 'icons/obj/weapons.dmi' + icon_state = "pepperspray" + item_state = "pepperspray" + volume = 40 + stream_range = 4 + amount_per_transfer_from_this = 5 + list_reagents = list("condensedcapsaicin" = 40) + +// Fix pepperspraying yourself +/obj/item/weapon/reagent_containers/spray/pepper/afterattack(atom/A as mob|obj, mob/user) + if (A.loc == user) + return + ..() + +//water flower +/obj/item/weapon/reagent_containers/spray/waterflower + name = "water flower" + desc = "A seemingly innocent sunflower...with a twist." + icon = 'icons/obj/hydroponics/harvest.dmi' + icon_state = "sunflower" + item_state = "sunflower" + amount_per_transfer_from_this = 1 + volume = 10 + list_reagents = list("water" = 10) + +/obj/item/weapon/reagent_containers/spray/waterflower/attack_self(mob/user) //Don't allow changing how much the flower sprays + return + +//chemsprayer +/obj/item/weapon/reagent_containers/spray/chemsprayer + name = "chem sprayer" + desc = "A utility used to spray large amounts of reagents in a given area." + icon = 'icons/obj/guns/projectile.dmi' + icon_state = "chemsprayer" + item_state = "chemsprayer" + throwforce = 0 + w_class = WEIGHT_CLASS_NORMAL + stream_mode = 1 + current_range = 7 + spray_range = 4 + stream_range = 7 + amount_per_transfer_from_this = 10 + volume = 600 + origin_tech = "combat=3;materials=3;engineering=3" + +/obj/item/weapon/reagent_containers/spray/chemsprayer/afterattack(atom/A as mob|obj, mob/user) + // Make it so the bioterror spray doesn't spray yourself when you click your inventory items + if (A.loc == user) + return + ..() + +/obj/item/weapon/reagent_containers/spray/chemsprayer/spray(atom/A) + var/direction = get_dir(src, A) + var/turf/T = get_turf(A) + var/turf/T1 = get_step(T,turn(direction, 90)) + var/turf/T2 = get_step(T,turn(direction, -90)) + var/list/the_targets = list(T,T1,T2) + + for(var/i=1, i<=3, i++) // intialize sprays + if(reagents.total_volume < 1) + return + ..(the_targets[i]) + +/obj/item/weapon/reagent_containers/spray/chemsprayer/bioterror + list_reagents = list("sodium_thiopental" = 100, "coniine" = 100, "venom" = 100, "condensedcapsaicin" = 100, "initropidril" = 100, "polonium" = 100) + +// Plant-B-Gone +/obj/item/weapon/reagent_containers/spray/plantbgone // -- Skie + name = "Plant-B-Gone" + desc = "Kills those pesky weeds!" + icon = 'icons/obj/hydroponics/equipment.dmi' + icon_state = "plantbgone" + item_state = "plantbgone" + volume = 100 + list_reagents = list("plantbgone" = 100) diff --git a/code/modules/shuttle/ferry.dm b/code/modules/shuttle/ferry.dm index a5226abd58..8368fd58e5 100644 --- a/code/modules/shuttle/ferry.dm +++ b/code/modules/shuttle/ferry.dm @@ -1,33 +1,33 @@ -/obj/machinery/computer/shuttle/ferry - name = "transport ferry console" - circuit = /obj/item/weapon/circuitboard/computer/ferry - shuttleId = "ferry" - possible_destinations = "ferry_home;ferry_away" - req_access = list(GLOB.access_cent_general) - - var/aiControlDisabled = 1 - -/obj/machinery/computer/shuttle/ferry/proc/canAIControl(mob/user) - return ((aiControlDisabled != 1)); - -/obj/machinery/computer/shuttle/ferry/attack_ai(mob/user) - if(!src.canAIControl(user)) - return - -/obj/machinery/computer/shuttle/ferry/request - name = "ferry console" - circuit = /obj/item/weapon/circuitboard/computer/ferry/request - var/last_request //prevents spamming admins - var/cooldown = 600 - possible_destinations = "ferry_home;ferry_away" - req_access = list(GLOB.access_cent_general) - resistance_flags = INDESTRUCTIBLE | LAVA_PROOF | FIRE_PROOF | ACID_PROOF - -/obj/machinery/computer/shuttle/ferry/request/Topic(href, href_list) - ..() - if(href_list["request"]) - if(last_request && (last_request + cooldown > world.time)) - return - last_request = world.time - to_chat(usr, "Your request has been recieved by Centcom.") - to_chat(GLOB.admins, "FERRY: [ADMIN_LOOKUPFLW(usr)] (Move Ferry) is requesting to move the transport ferry to Centcom.") +/obj/machinery/computer/shuttle/ferry + name = "transport ferry console" + circuit = /obj/item/weapon/circuitboard/computer/ferry + shuttleId = "ferry" + possible_destinations = "ferry_home;ferry_away" + req_access = list(GLOB.access_cent_general) + + var/aiControlDisabled = 1 + +/obj/machinery/computer/shuttle/ferry/proc/canAIControl(mob/user) + return ((aiControlDisabled != 1)); + +/obj/machinery/computer/shuttle/ferry/attack_ai(mob/user) + if(!src.canAIControl(user)) + return + +/obj/machinery/computer/shuttle/ferry/request + name = "ferry console" + circuit = /obj/item/weapon/circuitboard/computer/ferry/request + var/last_request //prevents spamming admins + var/cooldown = 600 + possible_destinations = "ferry_home;ferry_away" + req_access = list(GLOB.access_cent_general) + resistance_flags = INDESTRUCTIBLE | LAVA_PROOF | FIRE_PROOF | ACID_PROOF + +/obj/machinery/computer/shuttle/ferry/request/Topic(href, href_list) + ..() + if(href_list["request"]) + if(last_request && (last_request + cooldown > world.time)) + return + last_request = world.time + to_chat(usr, "Your request has been recieved by Centcom.") + to_chat(GLOB.admins, "FERRY: [ADMIN_LOOKUPFLW(usr)] (Move Ferry) is requesting to move the transport ferry to Centcom.") diff --git a/icons/emoji.dmi b/icons/emoji.dmi old mode 100755 new mode 100644 diff --git a/tgstation.dme b/tgstation.dme index 83c004c29e..ad998e8286 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -33,6 +33,7 @@ #include "code\__DEFINES\combat.dm" #include "code\__DEFINES\construction.dm" #include "code\__DEFINES\contracts.dm" +#include "code\__DEFINES\cult.dm" #include "code\__DEFINES\DNA.dm" #include "code\__DEFINES\events.dm" #include "code\__DEFINES\flags.dm" @@ -167,9 +168,6 @@ #include "code\citadel\cit_uniforms.dm" #include "code\citadel\cit_vendors.dm" #include "code\citadel\dogborgstuff.dm" -#include "code\citadel\custom_loadout\custom_items.dm" -#include "code\citadel\custom_loadout\load_to_mob.dm" -#include "code\citadel\custom_loadout\read_from_file.dm" #include "code\citadel\organs\breasts.dm" #include "code\citadel\organs\eggsack.dm" #include "code\citadel\organs\genitals.dm" @@ -199,12 +197,14 @@ #include "code\controllers\subsystem\dbcore.dm" #include "code\controllers\subsystem\disease.dm" #include "code\controllers\subsystem\events.dm" +#include "code\controllers\subsystem\fields.dm" #include "code\controllers\subsystem\fire_burning.dm" #include "code\controllers\subsystem\garbage.dm" #include "code\controllers\subsystem\icon_smooth.dm" #include "code\controllers\subsystem\inbounds.dm" #include "code\controllers\subsystem\ipintel.dm" #include "code\controllers\subsystem\job.dm" +#include "code\controllers\subsystem\language.dm" #include "code\controllers\subsystem\lighting.dm" #include "code\controllers\subsystem\machines.dm" #include "code\controllers\subsystem\mapping.dm" @@ -266,6 +266,7 @@ #include "code\datums\antagonists\antag_datum.dm" #include "code\datums\antagonists\datum_clockcult.dm" #include "code\datums\antagonists\datum_cult.dm" +#include "code\datums\antagonists\ninja.dm" #include "code\datums\diseases\_disease.dm" #include "code\datums\diseases\_MobProcs.dm" #include "code\datums\diseases\anxiety.dm" @@ -470,7 +471,9 @@ #include "code\game\gamemodes\cult\cult_items.dm" #include "code\game\gamemodes\cult\cult_structures.dm" #include "code\game\gamemodes\cult\ritual.dm" +#include "code\game\gamemodes\cult\rune_spawn_action.dm" #include "code\game\gamemodes\cult\runes.dm" +#include "code\game\gamemodes\cult\supply.dm" #include "code\game\gamemodes\cult\talisman.dm" #include "code\game\gamemodes\devil\devil.dm" #include "code\game\gamemodes\devil\devil_game_mode.dm" @@ -556,6 +559,7 @@ #include "code\game\machinery\hologram.dm" #include "code\game\machinery\igniter.dm" #include "code\game\machinery\iv_drip.dm" +#include "code\game\machinery\launch_pad.dm" #include "code\game\machinery\lightswitch.dm" #include "code\game\machinery\limbgrower.dm" #include "code\game\machinery\machinery.dm" @@ -604,6 +608,7 @@ #include "code\game\machinery\computer\crew.dm" #include "code\game\machinery\computer\dna_console.dm" #include "code\game\machinery\computer\gulag_teleporter.dm" +#include "code\game\machinery\computer\launchpad_control.dm" #include "code\game\machinery\computer\law.dm" #include "code\game\machinery\computer\medical.dm" #include "code\game\machinery\computer\message.dm" @@ -726,6 +731,10 @@ #include "code\game\objects\effects\spawners\structure.dm" #include "code\game\objects\effects\spawners\vaultspawner.dm" #include "code\game\objects\effects\spawners\xeno_egg_delivery.dm" +#include "code\game\objects\effects\temporary_visuals\clockcult.dm" +#include "code\game\objects\effects\temporary_visuals\cult.dm" +#include "code\game\objects\effects\temporary_visuals\miscellaneous.dm" +#include "code\game\objects\effects\temporary_visuals\temporary_visual.dm" #include "code\game\objects\items\apc_frame.dm" #include "code\game\objects\items\blueprints.dm" #include "code\game\objects\items\body_egg.dm" @@ -809,7 +818,6 @@ #include "code\game\objects\items\weapons\defib.dm" #include "code\game\objects\items\weapons\dice.dm" #include "code\game\objects\items\weapons\dna_injector.dm" -#include "code\game\objects\items\weapons\explosives.dm" #include "code\game\objects\items\weapons\extinguisher.dm" #include "code\game\objects\items\weapons\flamethrower.dm" #include "code\game\objects\items\weapons\gift.dm" @@ -1304,6 +1312,9 @@ #include "code\modules\events\wizard\rpgloot.dm" #include "code\modules\events\wizard\shuffle.dm" #include "code\modules\events\wizard\summons.dm" +#include "code\modules\fields\fields.dm" +#include "code\modules\fields\peaceborg_dampener.dm" +#include "code\modules\fields\turf_objects.dm" #include "code\modules\flufftext\Dreaming.dm" #include "code\modules\flufftext\Hallucination.dm" #include "code\modules\flufftext\TextFilters.dm" @@ -1426,12 +1437,15 @@ #include "code\modules\jobs\job_types\security.dm" #include "code\modules\jobs\job_types\silicon.dm" #include "code\modules\language\common.dm" +#include "code\modules\language\draconic.dm" #include "code\modules\language\drone.dm" #include "code\modules\language\language.dm" +#include "code\modules\language\language_holder.dm" #include "code\modules\language\language_menu.dm" #include "code\modules\language\machine.dm" #include "code\modules\language\monkey.dm" -#include "code\modules\language\ratvar.dm" +#include "code\modules\language\narsian.dm" +#include "code\modules\language\ratvarian.dm" #include "code\modules\language\slime.dm" #include "code\modules\language\swarmer.dm" #include "code\modules\language\xenocommon.dm" @@ -1803,7 +1817,6 @@ #include "code\modules\modular_computers\NTNet\NTNet_relay.dm" #include "code\modules\modular_computers\NTNet\NTNRC\conversation.dm" #include "code\modules\ninja\__ninjaDefines.dm" -#include "code\modules\ninja\admin_ninja_verbs.dm" #include "code\modules\ninja\energy_katana.dm" #include "code\modules\ninja\ninja_event.dm" #include "code\modules\ninja\Ninja_Readme.dm" diff --git a/tools/tgstation-server/Start Server.bat b/tools/tgstation-server/Start Server.bat index 0312a22a5c..80efb9444b 100644 --- a/tools/tgstation-server/Start Server.bat +++ b/tools/tgstation-server/Start Server.bat @@ -3,37 +3,37 @@ call config.bat call bin\findbyond.bat -echo Welcome to the start server watch dog script, This will start the server and make sure it stays running. To continue, press any key or wait 30 seconds. -timeout 30 +echo Welcome to the start server watch dog script, This will start the server and make sure it stays running. To continue, press any key or wait 30 seconds. +timeout 30 if not exist gamedata\data\logs\runtimes mkdir gamedata\data\logs\runtimes\ -@call python bot\nudge.py "WATCHDOG" "Watch Dog online. Starting server" >nul 2>nul +@call python bot\nudge.py "WATCHDOG" "Watch Dog online. Starting server" >nul 2>nul :START - + call bin\getcurdate.bat - -call bin\getunixtime.bat UNIXTIME - -echo %UNIXTIME% - -set STARTTIME=%UNIXTIME% - + +call bin\getunixtime.bat UNIXTIME + +echo %UNIXTIME% + +set STARTTIME=%UNIXTIME% + cls echo Watch Dog. echo Server Running. Watching for server exits. -start /WAIT /ABOVENORMAL "" dreamdaemon.exe gamefolder\%PROJECTNAME%.dmb -port %PORT% -trusted -close -public -verbose +start /WAIT /ABOVENORMAL "" dreamdaemon.exe gamefolder\%PROJECTNAME%.dmb -port %PORT% -trusted -close -public -verbose cls - -call bin\getunixtime.bat UNIXTIME - -SET /A Result=%UNIXTIME% - %STARTTIME% -SET /A Result=180 - (%Result%/3) -if %Result% LSS 0 set /A Result=0 - + +call bin\getunixtime.bat UNIXTIME + +SET /A Result=%UNIXTIME% - %STARTTIME% +SET /A Result=180 - (%Result%/3) +if %Result% LSS 0 set /A Result=0 + echo Watch Dog. -echo Server exit detected. Restarting in %Result% seconds. -@python bot\nudge.py "WATCHDOG" "Server exit detected. Restarting server in %Result% seconds." >nul 2>nul -timeout %Result% +echo Server exit detected. Restarting in %Result% seconds. +@python bot\nudge.py "WATCHDOG" "Server exit detected. Restarting server in %Result% seconds." >nul 2>nul +timeout %Result% goto :START