diff --git a/_maps/RandomRuins/LavaRuins/lavaland_surface_syndicate_base1.dmm b/_maps/RandomRuins/LavaRuins/lavaland_surface_syndicate_base1.dmm index 4b50904ea2..0bc99060de 100644 --- a/_maps/RandomRuins/LavaRuins/lavaland_surface_syndicate_base1.dmm +++ b/_maps/RandomRuins/LavaRuins/lavaland_surface_syndicate_base1.dmm @@ -726,7 +726,7 @@ }, /area/ruin/powered/syndicate_lava_base) "bM" = ( -/obj/machinery/smartfridge/chemistry/virology, +/obj/machinery/smartfridge/chemistry/virology/preloaded, /turf/open/floor/plasteel/podhatch{ tag = "icon-podhatch (EAST)"; icon_state = "podhatch"; diff --git a/_maps/map_files/generic/Fastload.dmm b/_maps/map_files/generic/Fastload.dmm deleted file mode 100644 index 96b4a26934..0000000000 --- a/_maps/map_files/generic/Fastload.dmm +++ /dev/null @@ -1,3 +0,0 @@ -"a" = () - -(1,1,1, 1,1,1) = {""} diff --git a/code/__DEFINES/flags.dm b/code/__DEFINES/flags.dm index a5e69bdc7b..e443e57b14 100644 --- a/code/__DEFINES/flags.dm +++ b/code/__DEFINES/flags.dm @@ -14,6 +14,7 @@ GLOBAL_LIST_INIT(bitflags, list(1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 204 #define NOBLUDGEON 4 // when an item has this it produces no "X has been hit by Y with Z" message in the default attackby() #define MASKINTERNALS 8 // mask allows internals #define HEAR 16 // This flag is what recursive_hear_check() uses to determine wether to add an item to the hearer list or not. +#define CHECK_RICOCHET 32 // Projectiels will check ricochet on things impacted that have this. #define CONDUCT 64 // conducts electricity (metal etc.) #define ABSTRACT 128 // for all things that are technically items but used for various different stuff, made it 128 because it could conflict with other flags other way #define NODECONSTRUCT 128 // For machines and structures that should not break into parts, eg, holodeck stuff @@ -57,6 +58,7 @@ GLOBAL_LIST_INIT(bitflags, list(1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 204 #define UNUSED_TRANSIT_TURF 2 #define CAN_BE_DIRTY 4 //If a turf can be made dirty at roundstart. This is also used in areas. #define NO_DEATHRATTLE 16 // Do not notify deadchat about any deaths that occur on this turf. +//#define CHECK_RICOCHET 32 //Same thing as atom flag. /* These defines are used specifically with the atom/pass_flags bitmask diff --git a/code/__DEFINES/subsystems.dm b/code/__DEFINES/subsystems.dm index 8c8b360497..7303f0f33a 100644 --- a/code/__DEFINES/subsystems.dm +++ b/code/__DEFINES/subsystems.dm @@ -39,6 +39,7 @@ // Subsystem init_order, from highest priority to lowest priority +// Subsystems shutdown in the reverse of the order they initialize in // The numbers just define the ordering, they are meaningless otherwise. #define INIT_ORDER_SERVER_MAINT 16 @@ -71,4 +72,4 @@ #define RUNLEVEL_GAME 4 #define RUNLEVEL_POSTGAME 8 -#define RUNLEVELS_DEFAULT (RUNLEVEL_SETUP | RUNLEVEL_GAME | RUNLEVEL_POSTGAME) \ No newline at end of file +#define RUNLEVELS_DEFAULT (RUNLEVEL_SETUP | RUNLEVEL_GAME | RUNLEVEL_POSTGAME) diff --git a/code/__HELPERS/icon_smoothing.dm b/code/__HELPERS/icon_smoothing.dm index de46e18fde..a0de8d9840 100644 --- a/code/__HELPERS/icon_smoothing.dm +++ b/code/__HELPERS/icon_smoothing.dm @@ -167,23 +167,14 @@ underlay_appearance.icon = fixed_underlay["icon"] underlay_appearance.icon_state = fixed_underlay["icon_state"] else - var/turf/T = get_step(src, turn(adjacencies, 180)) - if(T && (T.density || T.smooth)) + var/turned_adjacency = turn(adjacencies, 180) + var/turf/T = get_step(src, turned_adjacency) + if(!T.get_smooth_underlay_icon(underlay_appearance, src, turned_adjacency)) T = get_step(src, turn(adjacencies, 135)) - if(T && (T.density || T.smooth)) + if(!T.get_smooth_underlay_icon(underlay_appearance, src, turned_adjacency)) T = get_step(src, turn(adjacencies, 225)) - - if(isspaceturf(T) && !istype(T, /turf/open/space/transit)) - underlay_appearance.icon = 'icons/turf/space.dmi' - underlay_appearance.icon_state = SPACE_ICON_STATE - underlay_appearance.plane = PLANE_SPACE - else if(T && !T.density && !T.smooth) - underlay_appearance.icon = T.icon - underlay_appearance.icon_state = T.icon_state - else if(baseturf && !initial(baseturf.density) && !initial(baseturf.smooth)) - underlay_appearance.icon = initial(baseturf.icon) - underlay_appearance.icon_state = initial(baseturf.icon_state) - else + //if all else fails, ask our own turf + if(!T.get_smooth_underlay_icon(underlay_appearance, src, turned_adjacency) && !get_smooth_underlay_icon(underlay_appearance, src, turned_adjacency)) underlay_appearance.icon = DEFAULT_UNDERLAY_ICON underlay_appearance.icon_state = DEFAULT_UNDERLAY_ICON_STATE underlays = U diff --git a/code/__HELPERS/maths.dm b/code/__HELPERS/maths.dm index 7e892e8dd4..7e0fd531eb 100644 --- a/code/__HELPERS/maths.dm +++ b/code/__HELPERS/maths.dm @@ -130,6 +130,22 @@ GLOBAL_LIST_INIT(sqrtTable, list(1, 1, 1, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 4, var/t = round((val - min) / d) return val - (t * d) +#define NORM_ROT(rot) ((((rot % 360) + (rot - round(rot, 1))) > 0) ? ((rot % 360) + (rot - round(rot, 1))) : (((rot % 360) + (rot - round(rot, 1))) + 360)) + +/proc/get_angle_of_incidence(face_angle, angle_in, auto_normalize = TRUE) + + var/angle_in_s = NORM_ROT(angle_in) + var/face_angle_s = NORM_ROT(face_angle) + var/incidence = face_angle_s - angle_in_s + var/incidence_s = incidence + while(incidence_s < -90) + incidence_s += 180 + while(incidence_s > 90) + incidence_s -= 180 + if(auto_normalize) + return incidence_s + else + return incidence //A logarithm that converts an integer to a number scaled between 0 and 1 (can be tweaked to be higher). //Currently, this is used for hydroponics-produce sprite transforming, but could be useful for other transform functions. @@ -141,8 +157,6 @@ GLOBAL_LIST_INIT(sqrtTable, list(1, 1, 1, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 4, return size_factor + scaling_modifier //scale mod of 0 results in a number from 0 to 1. A scale modifier of +0.5 returns 0.5 to 1.5 //to_chat(world, "Transform multiplier of [src] is [size_factor + scaling_modifer]") - - //converts a uniform distributed random number into a normal distributed one //since this method produces two random numbers, one is saved for subsequent calls //(making the cost negligble for every second call) diff --git a/code/_onclick/click.dm b/code/_onclick/click.dm index a8e2681dc9..5b26067725 100644 --- a/code/_onclick/click.dm +++ b/code/_onclick/click.dm @@ -119,7 +119,7 @@ //User itself, current loc, and user inventory if(DirectAccess(A)) if(W) - melee_item_attack_chain(src,W,A,params) + W.melee_attack_chain(src, A, params) else if(ismob(A)) changeNext_move(CLICK_CD_MELEE) @@ -133,7 +133,7 @@ //Standard reach turf to turf or reaching inside storage if(CanReach(A,W)) if(W) - melee_item_attack_chain(src,W,A,params) + W.melee_attack_chain(src, A, params) else if(ismob(A)) changeNext_move(CLICK_CD_MELEE) diff --git a/code/_onclick/cyborg.dm b/code/_onclick/cyborg.dm index c52b3441db..3bb15c1947 100644 --- a/code/_onclick/cyborg.dm +++ b/code/_onclick/cyborg.dm @@ -71,7 +71,7 @@ // cyborgs are prohibited from using storage items so we can I think safely remove (A.loc in contents) if(A == loc || (A in loc) || (A in contents)) - melee_item_attack_chain(src, W, A, params) + W.melee_attack_chain(src, A, params) return if(!isturf(loc)) @@ -80,7 +80,7 @@ // cyborgs are prohibited from using storage items so we can I think safely remove (A.loc && isturf(A.loc.loc)) if(isturf(A) || isturf(A.loc)) if(A.Adjacent(src)) // see adjacent.dm - melee_item_attack_chain(src, W, A, params) + W.melee_attack_chain(src, A, params) return else W.afterattack(A, src, 0, params) diff --git a/code/_onclick/item_attack.dm b/code/_onclick/item_attack.dm index 24f6559dd6..72694a434c 100644 --- a/code/_onclick/item_attack.dm +++ b/code/_onclick/item_attack.dm @@ -1,10 +1,10 @@ -/proc/melee_item_attack_chain(mob/user, obj/item/I, atom/target, params) - if(I.pre_attackby(target, user, params)) +/obj/item/proc/melee_attack_chain(mob/user, atom/target, params) + if(pre_attackby(target, user, params)) // Return 1 in attackby() to prevent afterattack() effects (when safely moving items for example) - var/resolved = target.attackby(I,user,params) - if(!resolved && target && I) - I.afterattack(target, user, 1, params) // 1: clicking something Adjacent + var/resolved = target.attackby(src, user, params) + if(!resolved && target && !QDELETED(src)) + afterattack(target, user, 1, params) // 1: clicking something Adjacent // Called when the item is in the active hand, and clicked; alternately, there is an 'activate held object' verb or you can hit pagedown. diff --git a/code/_onclick/telekinesis.dm b/code/_onclick/telekinesis.dm index c7ad66440e..0ca0fb31a9 100644 --- a/code/_onclick/telekinesis.dm +++ b/code/_onclick/telekinesis.dm @@ -124,7 +124,8 @@ if(!isturf(target) && istype(focus,/obj/item) && target.Adjacent(focus)) apply_focus_overlay() - melee_item_attack_chain(tk_user, focus, target, params) //isn't copying the attack chain fun. we should do it more often. + var/obj/item/I = focus + I.melee_attack_chain(tk_user, target, params) //isn't copying the attack chain fun. we should do it more often. if(check_if_focusable(focus)) focus.do_attack_animation(target, null, focus) else diff --git a/code/datums/helper_datums/getrev.dm b/code/datums/helper_datums/getrev.dm index b90e2ec652..2e95629d30 100644 --- a/code/datums/helper_datums/getrev.dm +++ b/code/datums/helper_datums/getrev.dm @@ -1,34 +1,37 @@ /datum/getrev - var/parentcommit + var/originmastercommit var/commit var/list/testmerge = list() var/has_pr_details = FALSE //example data in a testmerge entry when this is true: https://api.github.com/repositories/3234987/pulls/22586 var/date /datum/getrev/New() - var/head_file = file2text(".git/logs/HEAD") if(SERVERTOOLS && fexists("..\\prtestjob.lk")) var/list/tmp = world.file2list("..\\prtestjob.lk") for(var/I in tmp) if(I) testmerge |= I - var/testlen = max(testmerge.len - 1, 0) - var/regex/head_log = new("(\\w{40}) .+> (\\d{10}).+(?=(\n.*(\\w{40}).*){[testlen]}\n*\\Z)") - head_log.Find(head_file) - parentcommit = head_log.group[1] - date = unix2date(text2num(head_log.group[2])) - commit = head_log.group[4] + log_world("Running /tg/ revision:") - log_world("[date]") + var/list/logs = world.file2list(".git/logs/HEAD") + if(logs) + logs = splittext(logs[logs.len - 1], " ") + date = unix2date(text2num(logs[5])) + commit = logs[2] + log_world("[date]") + logs = world.file2list(".git/logs/refs/remotes/origin/master") + if(logs) + originmastercommit = splittext(logs[logs.len - 1], " ")[2] + if(testmerge.len) log_world(commit) for(var/line in testmerge) if(line) log_world("Test merge active of PR #[line]") SSblackbox.add_details("testmerged_prs","[line]") - log_world("Based off master commit [parentcommit]") + log_world("Based off origin/master commit [originmastercommit]") else - log_world(parentcommit) + log_world(originmastercommit) /datum/getrev/proc/DownloadPRDetails() if(!config.githubrepoid) @@ -73,13 +76,13 @@ set name = "Show Server Revision" set desc = "Check the current server code revision" - if(GLOB.revdata.parentcommit) + if(GLOB.revdata.originmastercommit) to_chat(src, "Server revision compiled on: [GLOB.revdata.date]") var/prefix = "" if(GLOB.revdata.testmerge.len) to_chat(src, GLOB.revdata.GetTestMergeInfo()) - prefix = "Based off master commit: " - var/pc = GLOB.revdata.parentcommit + prefix = "Based off origin/master commit: " + var/pc = GLOB.revdata.originmastercommit to_chat(src, "[prefix][copytext(pc, 1, min(length(pc), 7))]") else to_chat(src, "Revision unknown") diff --git a/code/game/area/areas/mining.dm b/code/game/area/areas/mining.dm index 48271f479d..a88816f187 100644 --- a/code/game/area/areas/mining.dm +++ b/code/game/area/areas/mining.dm @@ -86,6 +86,7 @@ /area/lavaland icon_state = "mining" has_gravity = 1 + flags = NONE /area/lavaland/surface name = "Lavaland" @@ -123,4 +124,4 @@ icon_state = "danger" /area/lavaland/surface/outdoors/explored - name = "Lavaland Labor Camp" \ No newline at end of file + name = "Lavaland Labor Camp" diff --git a/code/game/atoms.dm b/code/game/atoms.dm index 4a0f05602b..65d4cf1449 100644 --- a/code/game/atoms.dm +++ b/code/game/atoms.dm @@ -104,6 +104,9 @@ return ..() +/atom/proc/handle_ricochet(obj/item/projectile/P) + return + /atom/proc/CanPass(atom/movable/mover, turf/target, height=1.5) return (!density || !height) diff --git a/code/game/gamemodes/gang/gang_items.dm b/code/game/gamemodes/gang/gang_items.dm index aec9b040cd..5a190d4a18 100644 --- a/code/game/gamemodes/gang/gang_items.dm +++ b/code/game/gamemodes/gang/gang_items.dm @@ -422,7 +422,7 @@ return FALSE if(dominator_excessive_walls(user)) - to_chat(user, "span class='warning'>The dominator will not function here! The dominator requires a sizable open space within three standard units so that walls do not interfere with the signal.") + to_chat(user, "The dominator will not function here! The dominator requires a sizable open space within three standard units so that walls do not interfere with the signal.") return FALSE if(!(usrarea.type in gang.territory|gang.territory_new)) diff --git a/code/game/gamemodes/miniantags/abduction/machinery/camera.dm b/code/game/gamemodes/miniantags/abduction/machinery/camera.dm index 1e725bccba..554d992987 100644 --- a/code/game/gamemodes/miniantags/abduction/machinery/camera.dm +++ b/code/game/gamemodes/miniantags/abduction/machinery/camera.dm @@ -70,12 +70,12 @@ origin.vest_mode_action.Remove(C) origin.vest_disguise_action.Remove(C) origin.set_droppoint_action.Remove(C) - remote_eye.eye_user = null C.reset_perspective(null) if(C.client) C.client.images -= remote_eye.user_image for(var/datum/camerachunk/chunk in remote_eye.visibleCameraChunks) chunk.remove(remote_eye) + remote_eye.eye_user = null C.remote_control = null C.unset_machine() Remove(C) diff --git a/code/game/gamemodes/traitor/double_agents.dm b/code/game/gamemodes/traitor/double_agents.dm index 2ee546c7aa..dfe198eeb9 100644 --- a/code/game/gamemodes/traitor/double_agents.dm +++ b/code/game/gamemodes/traitor/double_agents.dm @@ -1,6 +1,8 @@ #define PINPOINTER_MINIMUM_RANGE 15 #define PINPOINTER_EXTRA_RANDOM_RANGE 10 #define PINPOINTER_PING_TIME 40 +#define PROB_ACTUAL_TRAITOR 20 +#define TRAITOR_AGENT_ROLE "Syndicate External Affairs Agent" /datum/game_mode/traitor/internal_affairs name = "Internal Affairs" @@ -171,7 +173,10 @@ if(!objective.check_completion()) traitored = FALSE return - to_chat(owner.current," All the other agents are dead, and you're the last loose end. Stage a Syndicate terrorist attack to cover up for today's events. You no longer have any limits on collateral damage.") + if(owner.special_role == TRAITOR_AGENT_ROLE) + to_chat(owner.current," All the loyalist agents are dead, and no more is required of you. Die a glorious death, agent. ") + else + to_chat(owner.current," All the other agents are dead, and you're the last loose end. Stage a Syndicate terrorist attack to cover up for today's events. You no longer have any limits on collateral damage.") replace_escape_objective(owner) @@ -194,7 +199,10 @@ if(objective.stolen) var/fail_msg = "Your sensors tell you that [objective.target.current.real_name], one of the targets you were meant to have killed, pulled one over on you, and is still alive - do the job properly this time! " if(traitored) - fail_msg += " The truth could still slip out! Cease any terrorist actions as soon as possible, unneeded property damage or loss of employee life will lead to your contract being terminated." + if(owner.special_role == TRAITOR_AGENT_ROLE) + fail_msg += " You no longer have permission to die. " + else + fail_msg += " The truth could still slip out! Cease any terrorist actions as soon as possible, unneeded property damage or loss of employee life will lead to your contract being terminated." reinstate_escape_objective(owner) traitored = FALSE to_chat(owner.current, fail_msg) @@ -238,6 +246,10 @@ state.add_steal_targets_timer() if(!issilicon(traitor.current)) give_pinpointer(traitor) + //Optional traitor objective + if(prob(PROB_ACTUAL_TRAITOR)) + traitor.special_role = TRAITOR_AGENT_ROLE + forge_single_objective(traitor) else ..() // Give them standard objectives. @@ -289,11 +301,18 @@ /datum/game_mode/traitor/internal_affairs/greet_traitor(datum/mind/traitor) var/crime = pick("distribution of contraband" , "unauthorized erotic action on duty", "embezzlement", "piloting under the influence", "dereliction of duty", "syndicate collaboration", "mutiny", "multiple homicides", "corporate espionage", "recieving bribes", "malpractice", "worship of prohbited life forms", "possession of profane texts", "murder", "arson", "insulting their manager", "grand theft", "conspiracy", "attempting to unionize", "vandalism", "gross incompetence") - to_chat(traitor.current, "You are the [traitor_name].") - to_chat(traitor.current, "Your target is suspected of [crime], and you have been tasked with eliminating them by any means necessary to avoid a costly and embarrassing public trial.") - to_chat(traitor.current, "While you have a license to kill, unneeded property damage or loss of employee life will lead to your contract being terminated.") - to_chat(traitor.current, "For the sake of plausible deniability, you have been equipped with an array of captured Syndicate weaponry available via uplink.") - to_chat(traitor.current, "Finally, watch your back. Your target has friends in high places, and intel suggests someone may have taken out a contract of their own to protect them.") + if(traitor.special_role == TRAITOR_AGENT_ROLE) + to_chat(traitor.current, "You are the [TRAITOR_AGENT_ROLE].") + to_chat(traitor.current, "Your target has been framed for [crime], and you have been tasked with eliminating them to prevent them defending themselves in court.") + to_chat(traitor.current, "Any damage you cause will be a further embarrassment to Nanotrasen, so you have no limits on collateral damage.") + to_chat(traitor.current, " You have been provided with a standard uplink to accomplish your task. ") + to_chat(traitor.current, "Finally, watch your back. Your target has friends in high places, and intel suggests someone may have taken out a contract of their own to protect them.") + else + to_chat(traitor.current, "You are the [traitor_name].") + to_chat(traitor.current, "Your target is suspected of [crime], and you have been tasked with eliminating them by any means necessary to avoid a costly and embarrassing public trial.") + to_chat(traitor.current, "While you have a license to kill, unneeded property damage or loss of employee life will lead to your contract being terminated.") + to_chat(traitor.current, "For the sake of plausible deniability, you have been equipped with an array of captured Syndicate weaponry available via uplink.") + to_chat(traitor.current, "Finally, watch your back. Your target has friends in high places, and intel suggests someone may have taken out a contract of their own to protect them.") traitor.announce_objectives() @@ -301,6 +320,8 @@ /datum/game_mode/traitor/internal_affairs/give_codewords(mob/living/traitor_mob) return +#undef PROB_ACTUAL_TRAITOR #undef PINPOINTER_EXTRA_RANDOM_RANGE #undef PINPOINTER_MINIMUM_RANGE #undef PINPOINTER_PING_TIME + diff --git a/code/game/gamemodes/traitor/traitor.dm b/code/game/gamemodes/traitor/traitor.dm index 4673b572a8..6ad37815ca 100644 --- a/code/game/gamemodes/traitor/traitor.dm +++ b/code/game/gamemodes/traitor/traitor.dm @@ -85,40 +85,65 @@ character.make_Traitor() +/datum/game_mode/proc/forge_single_objective(datum/mind/traitor) //Returns how many objectives are added + .=1 + if(issilicon(traitor.current)) + var/special_pick = rand(1,4) + switch(special_pick) + if(1) + var/datum/objective/block/block_objective = new + block_objective.owner = traitor + traitor.objectives += block_objective + if(2) + var/datum/objective/purge/purge_objective = new + purge_objective.owner = traitor + traitor.objectives += purge_objective + if(3) + var/datum/objective/robot_army/robot_objective = new + robot_objective.owner = traitor + traitor.objectives += robot_objective + if(4) //Protect and strand a target + var/datum/objective/protect/yandere_one = new + yandere_one.owner = traitor + traitor.objectives += yandere_one + yandere_one.find_target() + var/datum/objective/maroon/yandere_two = new + yandere_two.owner = traitor + yandere_two.target = yandere_one.target + yandere_two.update_explanation_text() // normally called in find_target() + traitor.objectives += yandere_two + .=2 + else + if(prob(50)) + var/list/active_ais = active_ais() + if(active_ais.len && prob(100/GLOB.joined_player_list.len)) + var/datum/objective/destroy/destroy_objective = new + destroy_objective.owner = traitor + destroy_objective.find_target() + traitor.objectives += destroy_objective + else if(prob(30)) + var/datum/objective/maroon/maroon_objective = new + maroon_objective.owner = traitor + maroon_objective.find_target() + traitor.objectives += maroon_objective + else + var/datum/objective/assassinate/kill_objective = new + kill_objective.owner = traitor + kill_objective.find_target() + traitor.objectives += kill_objective + else + var/datum/objective/steal/steal_objective = new + steal_objective.owner = traitor + steal_objective.find_target() + traitor.objectives += steal_objective + + /datum/game_mode/proc/forge_traitor_objectives(datum/mind/traitor) if(issilicon(traitor.current)) var/objective_count = 0 if(prob(30)) - var/special_pick = rand(1,4) - switch(special_pick) - if(1) - var/datum/objective/block/block_objective = new - block_objective.owner = traitor - traitor.objectives += block_objective - objective_count++ - if(2) - var/datum/objective/purge/purge_objective = new - purge_objective.owner = traitor - traitor.objectives += purge_objective - objective_count++ - if(3) - var/datum/objective/robot_army/robot_objective = new - robot_objective.owner = traitor - traitor.objectives += robot_objective - objective_count++ - if(4) //Protect and strand a target - var/datum/objective/protect/yandere_one = new - yandere_one.owner = traitor - traitor.objectives += yandere_one - yandere_one.find_target() - objective_count++ - var/datum/objective/maroon/yandere_two = new - yandere_two.owner = traitor - yandere_two.target = yandere_one.target - yandere_two.update_explanation_text() // normally called in find_target() - traitor.objectives += yandere_two - objective_count++ + objective_count+=forge_single_objective(traitor) for(var/i = objective_count, i < config.traitor_objectives_amount, i++) var/datum/objective/assassinate/kill_objective = new @@ -142,29 +167,8 @@ assign_exchange_role(exchange_red) assign_exchange_role(exchange_blue) objective_count += 1 //Exchange counts towards number of objectives - var/list/active_ais = active_ais() for(var/i = objective_count, i < config.traitor_objectives_amount, i++) - if(prob(50)) - if(active_ais.len && prob(100/GLOB.joined_player_list.len)) - var/datum/objective/destroy/destroy_objective = new - destroy_objective.owner = traitor - destroy_objective.find_target() - traitor.objectives += destroy_objective - else if(prob(30)) - var/datum/objective/maroon/maroon_objective = new - maroon_objective.owner = traitor - maroon_objective.find_target() - traitor.objectives += maroon_objective - else - var/datum/objective/assassinate/kill_objective = new - kill_objective.owner = traitor - kill_objective.find_target() - traitor.objectives += kill_objective - else - var/datum/objective/steal/steal_objective = new - steal_objective.owner = traitor - steal_objective.find_target() - traitor.objectives += steal_objective + forge_single_objective(traitor) if(is_hijacker && objective_count <= config.traitor_objectives_amount) //Don't assign hijack if it would exceed the number of objectives set in config.traitor_objectives_amount if (!(locate(/datum/objective/hijack) in traitor.objectives)) diff --git a/code/game/machinery/cloning.dm b/code/game/machinery/cloning.dm index ec87cf6ba9..6df194cf25 100644 --- a/code/game/machinery/cloning.dm +++ b/code/game/machinery/cloning.dm @@ -44,8 +44,8 @@ "corazone", // prevents cardiac arrest damage "mimesbane") // stops them gasping from lack of air. -/obj/machinery/clonepod/New() - ..() +/obj/machinery/clonepod/Initialize() + . = ..() var/obj/item/weapon/circuitboard/machine/B = new /obj/item/weapon/circuitboard/machine/clonepod(null) B.apply_default_parts(src) diff --git a/code/game/machinery/computer/buildandrepair.dm b/code/game/machinery/computer/buildandrepair.dm index 600ededadd..f9014d5b8f 100644 --- a/code/game/machinery/computer/buildandrepair.dm +++ b/code/game/machinery/computer/buildandrepair.dm @@ -178,7 +178,7 @@ /obj/item/weapon/circuitboard/computer/xenobiology name = "circuit board (Xenobiology Console)" build_path = /obj/machinery/computer/camera_advanced/xenobio - origin_tech = "programming=3;bio=3" + origin_tech = "programming=3;biotech=3" /obj/item/weapon/circuitboard/computer/base_construction name = "circuit board (Aux Mining Base Construction Console)" build_path = /obj/machinery/computer/camera_advanced/base_construction diff --git a/code/game/machinery/computer/camera_advanced.dm b/code/game/machinery/computer/camera_advanced.dm index e3637d3430..1719695cf5 100644 --- a/code/game/machinery/computer/camera_advanced.dm +++ b/code/game/machinery/computer/camera_advanced.dm @@ -151,13 +151,13 @@ obj/machinery/computer/camera_advanced/attack_ai(mob/user) var/mob/camera/aiEye/remote/remote_eye = C.remote_control remote_eye.origin.current_user = null remote_eye.origin.jump_action.Remove(C) - remote_eye.eye_user = null if(C.client) C.reset_perspective(null) if(remote_eye.visible_icon) C.client.images -= remote_eye.user_image for(var/datum/camerachunk/chunk in remote_eye.visibleCameraChunks) chunk.remove(remote_eye) + remote_eye.eye_user = null C.remote_control = null C.unset_machine() Remove(C) diff --git a/code/game/machinery/dance_machine.dm b/code/game/machinery/dance_machine.dm index 8632243b67..214feeb63a 100644 --- a/code/game/machinery/dance_machine.dm +++ b/code/game/machinery/dance_machine.dm @@ -317,7 +317,7 @@ /obj/machinery/disco/proc/dance(var/mob/living/M) //Show your moves - + set waitfor = FALSE switch(rand(0,9)) if(0 to 1) dance2(M) diff --git a/code/game/machinery/doors/airlock.dm b/code/game/machinery/doors/airlock.dm index 1750aa7aa8..2175be22fe 100644 --- a/code/game/machinery/doors/airlock.dm +++ b/code/game/machinery/doors/airlock.dm @@ -97,7 +97,14 @@ var/static/list/airlock_overlays = list() /obj/machinery/door/airlock/Initialize() - ..() + . = ..() + + if (cyclelinkeddir) + cyclelinkairlock() + if(frequency) + set_frequency(frequency) + update_icon() + wires = new /datum/wires/airlock(src) if(src.closeOtherId != null) spawn (5) @@ -120,14 +127,6 @@ diag_hud.add_to_hud(src) diag_hud_set_electrified() -/obj/machinery/door/airlock/Initialize() - ..() - if (cyclelinkeddir) - cyclelinkairlock() - if(frequency) - set_frequency(frequency) - update_icon() - /obj/machinery/door/airlock/proc/cyclelinkairlock() if (cyclelinkedairlock) cyclelinkedairlock.cyclelinkedairlock = null @@ -199,14 +198,11 @@ qdel(src) /obj/machinery/door/airlock/Destroy() - qdel(wires) - wires = null + QDEL_NULL(wires) if(charge) qdel(charge) charge = null - if(electronics) - qdel(electronics) - electronics = null + QDEL_NULL(electronics) if (cyclelinkedairlock) if (cyclelinkedairlock.cyclelinkedairlock == src) cyclelinkedairlock.cyclelinkedairlock = null diff --git a/code/game/objects/items/robot/robot_items.dm b/code/game/objects/items/robot/robot_items.dm index 97a343311d..5bca9cf535 100644 --- a/code/game/objects/items/robot/robot_items.dm +++ b/code/game/objects/items/robot/robot_items.dm @@ -504,6 +504,8 @@ S.change_head_color(color2) dropped = TRUE +#define PKBORG_DAMPEN_CYCLE_DELAY 20 + //Peacekeeper Cyborg Projectile Dampenening Field /obj/item/borg/projectile_dampen name = "Hyperkinetic Dampening projector" @@ -526,6 +528,7 @@ var/image/projectile_effect var/field_radius = 3 var/active = FALSE + var/cycle_delay = 0 /obj/item/borg/projectile_dampen/debug maxenergy = 50000 @@ -545,29 +548,31 @@ return ..() /obj/item/borg/projectile_dampen/attack_self(mob/user) - if(!istype(dampening_field)) - activate_field() - active = TRUE + if(cycle_delay < world.time) + to_chat(user, "\the [src] is still recycling its projectors!") + return + cycle_delay = world.time + PKBORG_DAMPEN_CYCLE_DELAY + active = !active + if(active) + activate_field(user) else deactivate_field() - active = FALSE + update_icon() to_chat(user, "You [active? "activate":"deactivate"] the [src].") /obj/item/borg/projectile_dampen/update_icon() - . = ..() icon_state = "[initial(icon_state)][active]" /obj/item/borg/projectile_dampen/proc/activate_field() - if(!istype(dampening_field)) - dampening_field = make_field(/datum/proximity_monitor/advanced/peaceborg_dampener, list("current_range" = field_radius, "host" = src, "projector" = src)) - update_icon() + if(istype(dampening_field)) + QDEL_NULL(dampening_field) + dampening_field = make_field(/datum/proximity_monitor/advanced/peaceborg_dampener, list("current_range" = field_radius, "host" = src, "projector" = src)) /obj/item/borg/projectile_dampen/proc/deactivate_field() QDEL_NULL(dampening_field) - visible_message("The [src] shuts off!") - for(var/obj/item/projectile/P in tracked) + visible_message("\The [src] shuts off!") + for(var/P in tracked) restore_projectile(P) - update_icon() /obj/item/borg/projectile_dampen/dropped() . = ..() diff --git a/code/game/objects/items/weapons/chrono_eraser.dm b/code/game/objects/items/weapons/chrono_eraser.dm index e32d365298..86664404d1 100644 --- a/code/game/objects/items/weapons/chrono_eraser.dm +++ b/code/game/objects/items/weapons/chrono_eraser.dm @@ -54,10 +54,10 @@ var/obj/effect/chrono_field/field = null var/turf/startpos = null -/obj/item/weapon/gun/energy/chrono_gun/New(var/obj/item/weapon/chrono_eraser/T) +/obj/item/weapon/gun/energy/chrono_gun/Initialize() . = ..() - if(istype(T)) - TED = T + if(istype(loc, /obj/item/weapon/chrono_eraser)) + TED = loc else //admin must have spawned it TED = new(src.loc) qdel(src) diff --git a/code/game/objects/items/weapons/cigs_lighters.dm b/code/game/objects/items/weapons/cigs_lighters.dm index 82229bb7cf..61ac601e71 100644 --- a/code/game/objects/items/weapons/cigs_lighters.dm +++ b/code/game/objects/items/weapons/cigs_lighters.dm @@ -622,6 +622,7 @@ CIGARETTE PACKETS ARE IN FANCY.DM icon = 'icons/obj/clothing/masks.dmi' icon_state = null item_state = null + w_class = WEIGHT_CLASS_TINY var/chem_volume = 100 var/vapetime = 0 //this so it won't puff out clouds every tick var/screw = 0 // kinky @@ -633,8 +634,8 @@ CIGARETTE PACKETS ARE IN FANCY.DM return (TOXLOSS|OXYLOSS) -/obj/item/clothing/mask/vape/New(loc, var/param_color = null) - ..() +/obj/item/clothing/mask/vape/Initialize(mapload, param_color) + . = ..() create_reagents(chem_volume) reagents.set_reacting(FALSE) // so it doesn't react until you light it reagents.add_reagent("nicotine", 50) diff --git a/code/game/objects/items/weapons/defib.dm b/code/game/objects/items/weapons/defib.dm index f251cbabab..4bdf6ddf3c 100644 --- a/code/game/objects/items/weapons/defib.dm +++ b/code/game/objects/items/weapons/defib.dm @@ -23,14 +23,14 @@ var/combat = 0 //can we revive through space suits? var/grab_ghost = FALSE // Do we pull the ghost back into their body? -/obj/item/weapon/defibrillator/New() //starts without a cell for rnd - ..() +/obj/item/weapon/defibrillator/Initialize() //starts without a cell for rnd + . = ..() paddles = make_paddles() update_icon() return -/obj/item/weapon/defibrillator/loaded/New() //starts with hicap - ..() +/obj/item/weapon/defibrillator/loaded/Initialize() //starts with hicap + . = ..() paddles = make_paddles() bcell = new(src) update_icon() @@ -237,8 +237,8 @@ if(slot == user.getBeltSlot()) return 1 -/obj/item/weapon/defibrillator/compact/loaded/New() - ..() +/obj/item/weapon/defibrillator/compact/loaded/Initialize() + . = ..() paddles = make_paddles() bcell = new(src) update_icon() @@ -249,8 +249,8 @@ combat = 1 safety = 0 -/obj/item/weapon/defibrillator/compact/combat/loaded/New() - ..() +/obj/item/weapon/defibrillator/compact/combat/loaded/Initialize() + . = ..() paddles = make_paddles() bcell = new /obj/item/weapon/stock_parts/cell/infinite(src) update_icon() diff --git a/code/game/objects/items/weapons/grenades/plastic.dm b/code/game/objects/items/weapons/grenades/plastic.dm index 21a71f371d..a528a832c0 100644 --- a/code/game/objects/items/weapons/grenades/plastic.dm +++ b/code/game/objects/items/weapons/grenades/plastic.dm @@ -235,7 +235,7 @@ to_chat(user, "You start planting the bomb...") - if(do_after(user, 50, target = AM)) + if(do_after(user, 30, target = AM)) if(!user.temporarilyRemoveItemFromInventory(src)) return src.target = AM diff --git a/code/game/objects/items/weapons/kitchen.dm b/code/game/objects/items/weapons/kitchen.dm index 54a41b2214..e11e36bbb6 100644 --- a/code/game/objects/items/weapons/kitchen.dm +++ b/code/game/objects/items/weapons/kitchen.dm @@ -65,6 +65,7 @@ attack_verb = list("slashed", "stabbed", "sliced", "torn", "ripped", "diced", "cut") sharpness = IS_SHARP_ACCURATE armor = list(melee = 0, bullet = 0, laser = 0, energy = 0, bomb = 0, bio = 0, rad = 0, fire = 50, acid = 50) + var/bayonet = FALSE //Can this be attached to a gun? /obj/item/weapon/kitchen/knife/attack(mob/living/carbon/M, mob/living/carbon/user) if(user.zone_selected == "eyes") @@ -107,7 +108,7 @@ throwforce = 20 origin_tech = "materials=3;combat=4" attack_verb = list("slashed", "stabbed", "sliced", "torn", "ripped", "cut") - + bayonet = TRUE /obj/item/weapon/kitchen/knife/combat/survival name = "survival knife" @@ -115,6 +116,7 @@ desc = "A hunting grade survival knife." force = 15 throwforce = 15 + bayonet = TRUE /obj/item/weapon/kitchen/knife/combat/bone name = "bone dagger" diff --git a/code/game/objects/items/weapons/stunbaton.dm b/code/game/objects/items/weapons/stunbaton.dm index 5393f40ec6..c1b932d1bc 100644 --- a/code/game/objects/items/weapons/stunbaton.dm +++ b/code/game/objects/items/weapons/stunbaton.dm @@ -21,10 +21,9 @@ user.visible_message("[user] is putting the live [name] in [user.p_their()] mouth! It looks like [user.p_theyre()] trying to commit suicide!") return (FIRELOSS) -/obj/item/weapon/melee/baton/New() - ..() +/obj/item/weapon/melee/baton/Initialize() + . = ..() update_icon() - return /obj/item/weapon/melee/baton/throw_impact(atom/hit_atom) ..() @@ -32,10 +31,9 @@ if(status && prob(throw_hit_chance) && iscarbon(hit_atom)) baton_stun(hit_atom) -/obj/item/weapon/melee/baton/loaded/New() //this one starts with a cell pre-installed. - ..() +/obj/item/weapon/melee/baton/loaded/Initialize() //this one starts with a cell pre-installed. bcell = new(src) - update_icon() + . = ..() /obj/item/weapon/melee/baton/proc/deductcharge(chrgdeductamt) if(bcell) @@ -188,8 +186,8 @@ slot_flags = SLOT_BACK var/obj/item/device/assembly/igniter/sparkler = 0 -/obj/item/weapon/melee/baton/cattleprod/New() - ..() +/obj/item/weapon/melee/baton/cattleprod/Initialize() + . = ..() sparkler = new (src) /obj/item/weapon/melee/baton/cattleprod/baton_stun() diff --git a/code/game/objects/structures/artstuff.dm b/code/game/objects/structures/artstuff.dm index 23bbc40ed8..989bb6755b 100644 --- a/code/game/objects/structures/artstuff.dm +++ b/code/game/objects/structures/artstuff.dm @@ -5,7 +5,7 @@ /obj/structure/easel name = "easel" - desc = "only for the finest of art!" + desc = "Only for the finest of art!" icon = 'icons/obj/artstuff.dmi' icon_state = "easel" density = 1 @@ -49,7 +49,7 @@ GLOBAL_LIST_INIT(globalBlankCanvases, new(AMT_OF_CANVASES)) /obj/item/weapon/canvas name = "canvas" - desc = "draw out your soul on this canvas!" + desc = "Draw out your soul on this canvas!" icon = 'icons/obj/artstuff.dmi' icon_state = "11x11" resistance_flags = FLAMMABLE diff --git a/code/game/objects/structures/signs.dm b/code/game/objects/structures/signs.dm index 445af97b4e..8ffebdc0ab 100644 --- a/code/game/objects/structures/signs.dm +++ b/code/game/objects/structures/signs.dm @@ -146,49 +146,49 @@ /obj/structure/sign/biohazard name = "\improper BIOHAZARD" - desc = "A warning sign which reads 'BIOHAZARD'" + desc = "A warning sign which reads 'BIOHAZARD'." icon_state = "bio" /obj/structure/sign/electricshock name = "\improper HIGH VOLTAGE" - desc = "A warning sign which reads 'HIGH VOLTAGE'" + desc = "A warning sign which reads 'HIGH VOLTAGE'." icon_state = "shock" /obj/structure/sign/examroom name = "\improper EXAM ROOM" - desc = "A guidance sign which reads 'EXAM ROOM'" + desc = "A guidance sign which reads 'EXAM ROOM'." icon_state = "examroom" /obj/structure/sign/vacuum name = "\improper HARD VACUUM AHEAD" - desc = "A warning sign which reads 'HARD VACUUM AHEAD'" + desc = "A warning sign which reads 'HARD VACUUM AHEAD'." icon_state = "space" /obj/structure/sign/deathsposal name = "\improper DISPOSAL: LEADS TO SPACE" - desc = "A warning sign which reads 'DISPOSAL: LEADS TO SPACE'" + desc = "A warning sign which reads 'DISPOSAL: LEADS TO SPACE'." icon_state = "deathsposal" /obj/structure/sign/pods name = "\improper ESCAPE PODS" - desc = "A warning sign which reads 'ESCAPE PODS'" + desc = "A warning sign which reads 'ESCAPE PODS'." icon_state = "pods" /obj/structure/sign/fire name = "\improper DANGER: FIRE" - desc = "A warning sign which reads 'DANGER: FIRE'" + desc = "A warning sign which reads 'DANGER: FIRE'." icon_state = "fire" /obj/structure/sign/nosmoking_1 name = "\improper NO SMOKING" - desc = "A warning sign which reads 'NO SMOKING'" + desc = "A warning sign which reads 'NO SMOKING'." icon_state = "nosmoking" /obj/structure/sign/nosmoking_2 name = "\improper NO SMOKING" - desc = "A warning sign which reads 'NO SMOKING'" + desc = "A warning sign which reads 'NO SMOKING'." icon_state = "nosmoking2" /obj/structure/sign/radiation @@ -223,7 +223,7 @@ /obj/structure/sign/nanotrasen name = "\improper NanoTrasen Logo " - desc = "A sign with the Nanotrasen Logo on it. Glory to Nanotrasen!" + desc = "A sign with the Nanotrasen Logo on it. Glory to Nanotrasen!" icon_state = "nanotrasen" /obj/structure/sign/science //These 3 have multiple types, just var-edit the icon_state to whatever one you want on the map diff --git a/code/game/turfs/closed.dm b/code/game/turfs/closed.dm index 741d4f2958..a459ac5903 100644 --- a/code/game/turfs/closed.dm +++ b/code/game/turfs/closed.dm @@ -5,6 +5,9 @@ density = 1 blocks_air = 1 +/turf/closed/get_smooth_underlay_icon(mutable_appearance/underlay_appearance, turf/asking_turf, adjacency_dir) + return FALSE + /turf/closed/indestructible name = "wall" icon = 'icons/turf/walls.dmi' @@ -24,9 +27,6 @@ /turf/closed/indestructible/oldshuttle/corner icon_state = "corner" - - - /turf/closed/indestructible/splashscreen name = "Space Station 13" icon = 'config/title_screens/images/blank.png' @@ -111,6 +111,11 @@ explosion_block = 50 baseturf = /turf/closed/indestructible/necropolis +/turf/closed/indestructible/necropolis/get_smooth_underlay_icon(mutable_appearance/underlay_appearance, turf/asking_turf, adjacency_dir) + underlay_appearance.icon = 'icons/turf/floors.dmi' + underlay_appearance.icon_state = "necro1" + return TRUE + /turf/closed/indestructible/riveted/hierophant name = "wall" desc = "A wall made out of a strange metal. The squares on it pulse in a predictable pattern." diff --git a/code/game/turfs/open.dm b/code/game/turfs/open.dm index ff278b415a..718451bcb0 100644 --- a/code/game/turfs/open.dm +++ b/code/game/turfs/open.dm @@ -45,6 +45,9 @@ /turf/open/indestructible/hierophant/two +/turf/open/indestructible/hierophant/get_smooth_underlay_icon(mutable_appearance/underlay_appearance, turf/asking_turf, adjacency_dir) + return FALSE + /turf/open/indestructible/paper name = "notebook floor" desc = "A floor made of invulnerable notebook paper." diff --git a/code/game/turfs/simulated/chasm.dm b/code/game/turfs/simulated/chasm.dm index 4f22487537..8f0de9675d 100644 --- a/code/game/turfs/simulated/chasm.dm +++ b/code/game/turfs/simulated/chasm.dm @@ -22,6 +22,10 @@ if(!drop_stuff()) STOP_PROCESSING(SSobj, src) +/turf/open/chasm/get_smooth_underlay_icon(mutable_appearance/underlay_appearance, turf/asking_turf, adjacency_dir) + underlay_appearance.icon = 'icons/turf/floors.dmi' + underlay_appearance.icon_state = "basalt" + return TRUE /turf/open/chasm/attackby(obj/item/C, mob/user, params, area/area_restriction) ..() @@ -171,6 +175,11 @@ planetary_atmos = TRUE initial_gas_mix = "o2=14;n2=23;TEMP=300" +/turf/open/chasm/jungle/get_smooth_underlay_icon(mutable_appearance/underlay_appearance, turf/asking_turf, adjacency_dir) + underlay_appearance.icon = 'icons/turf/floors.dmi' + underlay_appearance.icon_state = "dirt" + return TRUE + /turf/open/chasm/straight_down/jungle icon = 'icons/turf/floors/junglechasm.dmi' planetary_atmos = TRUE diff --git a/code/game/turfs/simulated/floor/fancy_floor.dm b/code/game/turfs/simulated/floor/fancy_floor.dm index 4f6da47bde..91ed7a7cd6 100644 --- a/code/game/turfs/simulated/floor/fancy_floor.dm +++ b/code/game/turfs/simulated/floor/fancy_floor.dm @@ -140,7 +140,7 @@ floor_tile = /obj/item/stack/tile/carpet broken_states = list("damaged") smooth = SMOOTH_TRUE - canSmoothWith = list(/turf/open/floor/carpet, /turf/open/chasm) + canSmoothWith = list(/turf/open/floor/carpet) flags = NONE /turf/open/floor/carpet/Initialize() @@ -175,15 +175,22 @@ burnt = 1 update_icon() +/turf/open/floor/carpet/get_smooth_underlay_icon(mutable_appearance/underlay_appearance, turf/asking_turf, adjacency_dir) + return FALSE -turf/open/floor/fakepit +/turf/open/floor/fakepit desc = "A clever illusion designed to look like a bottomless pit." smooth = SMOOTH_TRUE | SMOOTH_BORDER | SMOOTH_MORE - canSmoothWith = list(/turf/open/floor/fakepit, /turf/open/chasm) + canSmoothWith = list(/turf/open/floor/fakepit) icon = 'icons/turf/floors/Chasms.dmi' icon_state = "smooth" +/turf/open/floor/fakepit/get_smooth_underlay_icon(mutable_appearance/underlay_appearance, turf/asking_turf, adjacency_dir) + underlay_appearance.icon = 'icons/turf/floors.dmi' + underlay_appearance.icon_state = "basalt" + return TRUE + /turf/open/floor/fakespace icon = 'icons/turf/space.dmi' icon_state = "0" @@ -193,4 +200,10 @@ turf/open/floor/fakepit /turf/open/floor/fakespace/Initialize() ..() - icon_state = "[rand(0,25)]" + icon_state = SPACE_ICON_STATE + +/turf/open/floor/fakespace/get_smooth_underlay_icon(mutable_appearance/underlay_appearance, turf/asking_turf, adjacency_dir) + underlay_appearance.icon = 'icons/turf/space.dmi' + underlay_appearance.icon_state = SPACE_ICON_STATE + underlay_appearance.plane = PLANE_SPACE + return TRUE diff --git a/code/game/turfs/simulated/floor/plating/lava.dm b/code/game/turfs/simulated/floor/plating/lava.dm index 9321b4f082..ead1e97d22 100644 --- a/code/game/turfs/simulated/floor/plating/lava.dm +++ b/code/game/turfs/simulated/floor/plating/lava.dm @@ -38,6 +38,11 @@ /turf/open/floor/plating/lava/make_plating() return +/turf/open/floor/plating/lava/get_smooth_underlay_icon(mutable_appearance/underlay_appearance, turf/asking_turf, adjacency_dir) + underlay_appearance.icon = 'icons/turf/floors.dmi' + underlay_appearance.icon_state = "basalt" + return TRUE + /turf/open/floor/plating/lava/GetHeatCapacity() . = 700000 diff --git a/code/game/turfs/simulated/minerals.dm b/code/game/turfs/simulated/minerals.dm index 0a8230e186..9c3d8ed0c7 100644 --- a/code/game/turfs/simulated/minerals.dm +++ b/code/game/turfs/simulated/minerals.dm @@ -26,7 +26,7 @@ /turf/closed/mineral/Initialize() if (!canSmoothWith) - canSmoothWith = list(/turf/closed) + canSmoothWith = list(/turf/closed/mineral, /turf/closed/indestructible) pixel_y = -4 pixel_x = -4 icon = smooth_icon @@ -42,6 +42,13 @@ setDir(angle2dir(rotation+dir2angle(dir))) queue_smooth(src) +/turf/closed/mineral/get_smooth_underlay_icon(mutable_appearance/underlay_appearance, turf/asking_turf, adjacency_dir) + if(turf_type) + underlay_appearance.icon = initial(turf_type.icon) + underlay_appearance.icon_state = initial(turf_type.icon_state) + return TRUE + return ..() + /turf/closed/mineral/attackby(obj/item/weapon/pickaxe/P, mob/user, params) if (!user.IsAdvancedToolUser()) diff --git a/code/game/turfs/simulated/wall/mineral_walls.dm b/code/game/turfs/simulated/wall/mineral_walls.dm index b78099c6bb..2cfb32f6dc 100644 --- a/code/game/turfs/simulated/wall/mineral_walls.dm +++ b/code/game/turfs/simulated/wall/mineral_walls.dm @@ -175,6 +175,7 @@ desc = "A light-weight titanium wall used in shuttles." icon = 'icons/turf/walls/shuttle_wall.dmi' icon_state = "map-shuttle" + flags = CAN_BE_DIRTY | CHECK_RICOCHET sheet_type = /obj/item/stack/sheet/mineral/titanium smooth = SMOOTH_MORE|SMOOTH_DIAGONAL canSmoothWith = list(/turf/closed/wall/mineral/titanium, /obj/machinery/door/airlock/shuttle, /obj/machinery/door/airlock/, /turf/closed/wall/shuttle, /obj/structure/window/shuttle, /obj/structure/shuttle/engine/heater, /obj/structure/falsewall/titanium) diff --git a/code/game/turfs/simulated/walls.dm b/code/game/turfs/simulated/walls.dm index 068dd0f218..44dc1afee7 100644 --- a/code/game/turfs/simulated/walls.dm +++ b/code/game/turfs/simulated/walls.dm @@ -28,6 +28,20 @@ /turf/closed/wall/attack_tk() return +/turf/closed/wall/handle_ricochet(obj/item/projectile/P) //A huge pile of shitcode! + var/turf/p_turf = get_turf(P) + var/face_direction = get_dir(src, p_turf) + var/face_angle = dir2angle(face_direction) + var/incidence_s = get_angle_of_incidence(face_angle, P.Angle) + var/new_angle = face_angle + incidence_s + var/new_angle_s = new_angle + while(new_angle_s > 180) // Translate to regular projectile degrees + new_angle_s -= 360 + while(new_angle_s < -180) + new_angle_s += 360 + P.Angle = new_angle_s + return TRUE + /turf/closed/wall/proc/dismantle_wall(devastated=0, explode=0) if(devastated) devastate_wall() diff --git a/code/game/turfs/space/space.dm b/code/game/turfs/space/space.dm index 1876d6f782..bac25e68c0 100644 --- a/code/game/turfs/space/space.dm +++ b/code/game/turfs/space/space.dm @@ -160,6 +160,12 @@ /turf/open/space/acid_act(acidpwr, acid_volume) return 0 +/turf/open/space/get_smooth_underlay_icon(mutable_appearance/underlay_appearance, turf/asking_turf, adjacency_dir) + underlay_appearance.icon = 'icons/turf/space.dmi' + underlay_appearance.icon_state = SPACE_ICON_STATE + underlay_appearance.plane = PLANE_SPACE + return TRUE + /turf/open/space/rcd_vals(mob/user, obj/item/weapon/construction/rcd/the_rcd) if(!CanBuildHere()) diff --git a/code/game/turfs/space/transit.dm b/code/game/turfs/space/transit.dm index 68c00c54ec..c447b83a1f 100644 --- a/code/game/turfs/space/transit.dm +++ b/code/game/turfs/space/transit.dm @@ -4,6 +4,11 @@ baseturf = /turf/open/space/transit flags = NOJAUNT //This line goes out to every wizard that ever managed to escape the den. I'm sorry. +/turf/open/space/transit/get_smooth_underlay_icon(mutable_appearance/underlay_appearance, turf/asking_turf, adjacency_dir) + . = ..() + underlay_appearance.icon_state = "speedspace_ns_[get_transit_state(asking_turf)]" + underlay_appearance.transform = turn(matrix(), get_transit_angle(asking_turf)) + /turf/open/space/transit/south dir = SOUTH @@ -69,25 +74,32 @@ throw_atom(AM) /turf/open/space/transit/proc/update_icon() - var/p = 9 - var/angle = 0 - var/state = 1 - switch(dir) - if(NORTH) - angle = 180 - state = ((-p*x+y) % 15) + 1 - if(state < 1) - state += 15 - if(EAST) - angle = 90 - state = ((x+p*y) % 15) + 1 - if(WEST) - angle = -90 - state = ((x-p*y) % 15) + 1 - if(state < 1) - state += 15 - else - state = ((p*x+y) % 15) + 1 + icon_state = "speedspace_ns_[get_transit_state(src)]" + transform = turn(matrix(), get_transit_angle(src)) - icon_state = "speedspace_ns_[state]" - transform = turn(matrix(), angle) \ No newline at end of file +/proc/get_transit_state(turf/T) + var/p = 9 + . = 1 + switch(T.dir) + if(NORTH) + . = ((-p*T.x+T.y) % 15) + 1 + if(. < 1) + . += 15 + if(EAST) + . = ((T.x+p*T.y) % 15) + 1 + if(WEST) + . = ((T.x-p*T.y) % 15) + 1 + if(. < 1) + . += 15 + else + . = ((p*T.x+T.y) % 15) + 1 + +/proc/get_transit_angle(turf/T) + . = 0 + switch(T.dir) + if(NORTH) + . = 180 + if(EAST) + . = 90 + if(WEST) + . = -90 \ No newline at end of file diff --git a/code/game/turfs/turf.dm b/code/game/turfs/turf.dm index c4d35d7bd1..9d556e896f 100644 --- a/code/game/turfs/turf.dm +++ b/code/game/turfs/turf.dm @@ -394,6 +394,12 @@ if(ismob(A) || .) A.ratvar_act() +/turf/proc/get_smooth_underlay_icon(mutable_appearance/underlay_appearance, turf/asking_turf, adjacency_dir) + underlay_appearance.icon = icon + underlay_appearance.icon_state = icon_state + underlay_appearance.dir = adjacency_dir + return TRUE + /turf/proc/add_blueprints(atom/movable/AM) var/image/I = new I.appearance = AM.appearance diff --git a/code/modules/awaymissions/mission_code/stationCollision.dm b/code/modules/awaymissions/mission_code/stationCollision.dm index fb1d375854..441d40db8f 100644 --- a/code/modules/awaymissions/mission_code/stationCollision.dm +++ b/code/modules/awaymissions/mission_code/stationCollision.dm @@ -46,8 +46,8 @@ //Syndicate sub-machine guns. /obj/item/weapon/gun/ballistic/automatic/c20r/sc_c20r -/obj/item/weapon/gun/ballistic/automatic/c20r/sc_c20r/New() - ..() +/obj/item/weapon/gun/ballistic/automatic/c20r/sc_c20r/Initialize() + . = ..() for(var/ammo in magazine.stored_ammo) if(prob(95)) //95% chance magazine.stored_ammo -= ammo @@ -55,8 +55,8 @@ //Barman's shotgun /obj/item/weapon/gun/ballistic/shotgun/sc_pump -/obj/item/weapon/gun/ballistic/shotgun/sc_pump/New() - ..() +/obj/item/weapon/gun/ballistic/shotgun/sc_pump/Initialize() + . = ..() for(var/ammo in magazine.stored_ammo) if(prob(95)) //95% chance magazine.stored_ammo -= ammo diff --git a/code/modules/clothing/chameleon.dm b/code/modules/clothing/chameleon.dm index 0de56aa86a..3a91c3207e 100644 --- a/code/modules/clothing/chameleon.dm +++ b/code/modules/clothing/chameleon.dm @@ -420,8 +420,8 @@ var/badmin_mode = FALSE var/static/list/blacklisted_vars = list("locs", "loc", "contents", "x", "y", "z") -/obj/item/weapon/gun/energy/laser/chameleon/New() - ..() +/obj/item/weapon/gun/energy/laser/chameleon/Initialize() + . = ..() chameleon_action = new(src) chameleon_action.chameleon_type = /obj/item/weapon/gun chameleon_action.chameleon_name = "Gun" diff --git a/code/modules/clothing/suits/cloaks.dm b/code/modules/clothing/suits/cloaks.dm index 1a8c96e802..e90c750d12 100644 --- a/code/modules/clothing/suits/cloaks.dm +++ b/code/modules/clothing/suits/cloaks.dm @@ -50,12 +50,28 @@ name = "captain's cloak" desc = "Worn by the commander of Space Station 13." icon_state = "capcloak" - + /obj/item/clothing/neck/cloak/hop name = "head of personnel's cloak" desc = "Worn by the Head of Personnel. It smells faintly of bureaucracy." icon_state = "hopcloak" +/obj/item/clothing/suit/hooded/cloak/goliath + name = "goliath cloak" + icon_state = "goliath_cloak" + desc = "A staunch, practical cape made out of numerous monster materials, it is coveted amongst exiles & hermits." + allowed = list(/obj/item/device/flashlight, /obj/item/weapon/tank/internals, /obj/item/weapon/pickaxe, /obj/item/weapon/twohanded/spear, /obj/item/weapon/twohanded/bonespear, /obj/item/organ/hivelord_core/legion, /obj/item/weapon/kitchen/knife/combat/bone, /obj/item/weapon/kitchen/knife/combat/survival) + armor = list(melee = 35, bullet = 10, laser = 25, energy = 10, bomb = 25, bio = 0, rad = 0, fire = 60, acid = 60) //a fair alternative to bone armor, requiring alternative materials and gaining a suit slot + hoodtype = /obj/item/clothing/head/hooded/cloakhood/goliath + body_parts_covered = CHEST|GROIN|ARMS + +/obj/item/clothing/head/hooded/cloakhood/goliath + name = "goliath cloak hood" + icon_state = "golhood" + desc = "A protective & concealing hood." + armor = list(melee = 35, bullet = 10, laser = 25, energy = 10, bomb = 25, bio = 0, rad = 0, fire = 60, acid = 60) + flags_inv = HIDEEARS|HIDEEYES|HIDEHAIR|HIDEFACIALHAIR + /obj/item/clothing/suit/hooded/cloak/drake name = "drake armour" icon_state = "dragon" diff --git a/code/modules/crafting/recipes.dm b/code/modules/crafting/recipes.dm index 72088961de..a489d0fb6a 100644 --- a/code/modules/crafting/recipes.dm +++ b/code/modules/crafting/recipes.dm @@ -337,9 +337,9 @@ /obj/item/weapon/restraints/handcuffs/cable = 1 ) category = CAT_MISC - + /datum/crafting_recipe/toysword - name = "Toy Sword" + name = "Toy Sword" reqs = list(/obj/item/weapon/light/bulb = 1, /obj/item/stack/cable_coil = 1, /obj/item/stack/sheet/plastic = 4) result = /obj/item/toy/sword category = CAT_MISC @@ -398,6 +398,15 @@ reqs = list(/obj/item/stack/sheet/bone = 4) category = CAT_PRIMAL +/datum/crafting_recipe/goliathcloak + name = "Goliath Cloak" + result = /obj/item/clothing/suit/hooded/cloak/goliath + time = 50 + reqs = list(/obj/item/stack/sheet/leather = 2, + /obj/item/stack/sheet/sinew = 2, + /obj/item/stack/sheet/animalhide/goliath_hide = 2) //it takes 4 goliaths to make 1 cloak if the plates are skinned + category = CAT_PRIMAL + /datum/crafting_recipe/drakecloak name = "Ash Drake Armour" result = /obj/item/clothing/suit/hooded/cloak/drake diff --git a/code/modules/language/language_holder.dm b/code/modules/language/language_holder.dm index 918f179591..a649041e01 100644 --- a/code/modules/language/language_holder.dm +++ b/code/modules/language/language_holder.dm @@ -107,7 +107,6 @@ /datum/language_holder/construct languages = list(/datum/language/common, /datum/language/narsie) - only_speaks_language = /datum/language/narsie /datum/language_holder/drone languages = list(/datum/language/common, /datum/language/drone, /datum/language/machine) diff --git a/code/modules/mining/mine_items.dm b/code/modules/mining/mine_items.dm index 3df4d521ff..10b7bc1eac 100644 --- a/code/modules/mining/mine_items.dm +++ b/code/modules/mining/mine_items.dm @@ -217,6 +217,7 @@ /area/survivalpod name = "\improper Emergency Shelter" icon_state = "away" + dynamic_lighting = DYNAMIC_LIGHTING_FORCED requires_power = 0 has_gravity = 1 @@ -394,7 +395,9 @@ icon = 'icons/obj/lavaland/donkvendor.dmi' icon_on = "donkvendor" icon_off = "donkvendor" - luminosity = 8 + light_range = 5 + light_power = 1.2 + light_color = "#DDFFD3" max_n_of_items = 10 pixel_y = -4 flags = NODECONSTRUCT diff --git a/code/modules/mob/living/carbon/monkey/monkey.dm b/code/modules/mob/living/carbon/monkey/monkey.dm index a05614fe09..f6f7665ae8 100644 --- a/code/modules/mob/living/carbon/monkey/monkey.dm +++ b/code/modules/mob/living/carbon/monkey/monkey.dm @@ -31,10 +31,8 @@ create_internal_organs() - ..() + . = ..() -/mob/living/carbon/monkey/Initialize() - ..() create_dna(src) dna.initialize_dna(random_blood_type()) diff --git a/code/modules/mob/living/simple_animal/bot/construction.dm b/code/modules/mob/living/simple_animal/bot/construction.dm index 25be049546..b3b4725914 100644 --- a/code/modules/mob/living/simple_animal/bot/construction.dm +++ b/code/modules/mob/living/simple_animal/bot/construction.dm @@ -273,7 +273,7 @@ //Medbot Assembly /obj/item/weapon/firstaid_arm_assembly - name = "incomplete medibot assembly." + name = "incomplete medibot assembly" desc = "A first aid kit with a robot arm permanently grafted to it." icon = 'icons/mob/aibots.dmi' icon_state = "firstaid_arm" diff --git a/code/modules/mob/living/simple_animal/hostile/mining_mobs.dm b/code/modules/mob/living/simple_animal/hostile/mining_mobs.dm index eaabcf5980..c2bd44d8ef 100644 --- a/code/modules/mob/living/simple_animal/hostile/mining_mobs.dm +++ b/code/modules/mob/living/simple_animal/hostile/mining_mobs.dm @@ -840,6 +840,9 @@ health = 120 brood_type = /mob/living/simple_animal/hostile/asteroid/hivelordbrood/legion/advanced icon_state = "dwarf_legion" + icon_living = "dwarf_legion" + icon_aggro = "dwarf_legion" + icon_dead = "dwarf_legion" /mob/living/simple_animal/hostile/asteroid/hivelordbrood/legion/advanced stat_attack = 2 @@ -859,6 +862,7 @@ max_mobs = 3 spawn_time = 200 spawn_text = "peels itself off from" + mob_type = /mob/living/simple_animal/hostile/asteroid/hivelord/legion melee_damage_lower = 20 melee_damage_upper = 20 anchored = FALSE @@ -1037,6 +1041,11 @@ regenerate_icons() //Nests +/obj/effect/light_emitter/tendril + set_luminosity = 4 + set_cap = 2.5 + light_color = LIGHT_COLOR_LAVA + /mob/living/simple_animal/hostile/spawner/lavaland name = "necropolis tendril" desc = "A vile tendril of corruption, originating deep underground. Terrible monsters are pouring out of it." @@ -1046,7 +1055,6 @@ icon_dead = "tendril" faction = list("mining") weather_immunities = list("lava","ash") - luminosity = 1 health = 250 maxHealth = 250 max_mobs = 3 @@ -1059,9 +1067,17 @@ loot = list(/obj/effect/collapse, /obj/structure/closet/crate/necropolis/tendril) del_on_death = 1 var/gps = null + var/obj/effect/light_emitter/tendril/emitted_light + +/mob/living/simple_animal/hostile/spawner/lavaland/goliath + mob_type = /mob/living/simple_animal/hostile/asteroid/goliath/beast + +/mob/living/simple_animal/hostile/spawner/lavaland/legion + mob_type = /mob/living/simple_animal/hostile/asteroid/hivelord/legion /mob/living/simple_animal/hostile/spawner/lavaland/Initialize() - ..() + . = ..() + emitted_light = new(loc) for(var/F in RANGE_TURFS(1, src)) if(ismineralturf(F)) var/turf/closed/mineral/M = F @@ -1069,7 +1085,8 @@ gps = new /obj/item/device/gps/internal(src) /mob/living/simple_animal/hostile/spawner/lavaland/Destroy() - qdel(gps) + QDEL_NULL(emitted_light) + QDEL_NULL(gps) . = ..() #define MEDAL_PREFIX "Tendril" @@ -1096,29 +1113,31 @@ /obj/effect/collapse name = "collapsing necropolis tendril" desc = "Get clear!" - luminosity = 1 - layer = ABOVE_OPEN_TURF_LAYER + layer = BELOW_OBJ_LAYER icon = 'icons/mob/nest.dmi' icon_state = "tendril" anchored = TRUE + density = TRUE + var/obj/effect/light_emitter/tendril/emitted_light -/obj/effect/collapse/New() - ..() +/obj/effect/collapse/Initialize() + . = ..() + emitted_light = new(loc) visible_message("The tendril writhes in fury as the earth around it begins to crack and break apart! Get back!") visible_message("Something falls free of the tendril!") - playsound(get_turf(src),'sound/effects/tendril_destroyed.ogg', 200, 0, 50, 1, 1) - spawn(50) - for(var/mob/M in range(7,src)) - shake_camera(M, 15, 1) - playsound(get_turf(src),'sound/effects/explosionfar.ogg', 200, 1) - visible_message("The tendril falls inward, the ground around it widening into a yawning chasm!") - for(var/turf/T in range(2,src)) - if(!T.density) - T.TerraformTurf(/turf/open/chasm/straight_down/lava_land_surface) - qdel(src) + playsound(loc,'sound/effects/tendril_destroyed.ogg', 200, 0, 50, 1, 1) + addtimer(CALLBACK(src, .proc/collapse), 50) -/mob/living/simple_animal/hostile/spawner/lavaland/goliath - mob_type = /mob/living/simple_animal/hostile/asteroid/goliath/beast +/obj/effect/collapse/Destroy() + QDEL_NULL(emitted_light) + return ..() -/mob/living/simple_animal/hostile/spawner/lavaland/legion - mob_type = /mob/living/simple_animal/hostile/asteroid/hivelord/legion +/obj/effect/collapse/proc/collapse() + for(var/mob/M in range(7,src)) + shake_camera(M, 15, 1) + playsound(get_turf(src),'sound/effects/explosionfar.ogg', 200, 1) + visible_message("The tendril falls inward, the ground around it widening into a yawning chasm!") + for(var/turf/T in range(2,src)) + if(!T.density) + T.TerraformTurf(/turf/open/chasm/straight_down/lava_land_surface) + qdel(src) diff --git a/code/modules/paperwork/pen.dm b/code/modules/paperwork/pen.dm index 73f4c73cfa..b6f8ee8f74 100644 --- a/code/modules/paperwork/pen.dm +++ b/code/modules/paperwork/pen.dm @@ -154,7 +154,7 @@ /obj/item/weapon/pen/sleepy/New() create_reagents(45) - reagents.add_reagent("morphine", 20) + reagents.add_reagent("chloralhydrate2", 20) reagents.add_reagent("mutetoxin", 15) reagents.add_reagent("tirizene", 10) ..() @@ -205,4 +205,4 @@ /obj/item/weapon/pen/poison/on_write(obj/item/weapon/paper/P, mob/user) P.contact_poison = "delayed_toxin" P.contact_poison_volume = 10 - add_logs(user,P,"used poison pen on") \ No newline at end of file + add_logs(user,P,"used poison pen on") diff --git a/code/modules/projectiles/gun.dm b/code/modules/projectiles/gun.dm index 2dffe0a567..04761befdc 100644 --- a/code/modules/projectiles/gun.dm +++ b/code/modules/projectiles/gun.dm @@ -43,8 +43,11 @@ var/obj/item/device/firing_pin/pin = /obj/item/device/firing_pin //standard firing pin for most guns - var/obj/item/device/flashlight/gun_light = null + var/obj/item/device/flashlight/gun_light var/can_flashlight = 0 + var/obj/item/weapon/kitchen/knife/bayonet + var/can_bayonet = FALSE + var/datum/action/item_action/toggle_gunlight/alight var/list/upgrades = list() @@ -52,6 +55,8 @@ var/ammo_y_offset = 0 var/flight_x_offset = 0 var/flight_y_offset = 0 + var/knife_x_offset = 0 + var/knife_y_offset = 0 //Zooming var/zoomable = FALSE //whether the gun generates a Zoom action on creation @@ -60,13 +65,12 @@ var/datum/action/toggle_scope_zoom/azoom -/obj/item/weapon/gun/New() - ..() +/obj/item/weapon/gun/Initialize() + . = ..() if(pin) pin = new pin(src) if(gun_light) - verbs += /obj/item/weapon/gun/proc/toggle_gunlight - new /datum/action/item_action/toggle_gunlight(src) + alight = new /datum/action/item_action/toggle_gunlight(src) build_zooming() @@ -268,52 +272,88 @@ SSblackbox.add_details("gun_fired","[src.type]") return 1 +/obj/item/weapon/gun/update_icon() + ..() + cut_overlays() + if(gun_light && can_flashlight) + var/state = "flight[gun_light.on? "_on":""]" //Generic state. + if(gun_light.icon_state in icon_states('icons/obj/guns/flashlights.dmi')) //Snowflake state? + state = gun_light.icon_state + var/mutable_appearance/flashlight_overlay = mutable_appearance('icons/obj/guns/flashlights.dmi', state) + flashlight_overlay.pixel_x = flight_x_offset + flashlight_overlay.pixel_y = flight_y_offset + add_overlay(flashlight_overlay) + if(bayonet && can_bayonet) + var/state = "bayonet" //Generic state. + if(bayonet.icon_state in icon_states('icons/obj/guns/bayonets.dmi')) //Snowflake state? + state = bayonet.icon_state + var/mutable_appearance/knife_overlay = mutable_appearance('icons/obj/guns/bayonets.dmi', state) + knife_overlay.pixel_x = knife_x_offset + knife_overlay.pixel_y = knife_y_offset + add_overlay(knife_overlay) + /obj/item/weapon/gun/attack(mob/M as mob, mob/user) if(user.a_intent == INTENT_HARM) //Flogging - ..() - else - return + if(bayonet) + bayonet.attack(M, user) + return + return ..() + +/obj/item/weapon/gun/attack_obj(obj/O, mob/user) + if(user.a_intent == INTENT_HARM) + if(bayonet) + bayonet.attack_obj(O, user) + return + return ..() /obj/item/weapon/gun/attackby(obj/item/I, mob/user, params) - if(can_flashlight) - if(istype(I, /obj/item/device/flashlight/seclite)) - var/obj/item/device/flashlight/seclite/S = I - if(!gun_light) - if(!user.transferItemToLoc(I, src)) - return - to_chat(user, "You click [S] into place on [src].") - if(S.on) - set_light(0) - gun_light = S - update_icon() - update_gunlight(user) - verbs += /obj/item/weapon/gun/proc/toggle_gunlight - var/datum/action/A = new /datum/action/item_action/toggle_gunlight(src) - if(loc == user) - A.Grant(user) - - if(istype(I, /obj/item/weapon/screwdriver)) - if(gun_light) - for(var/obj/item/device/flashlight/seclite/S in src) - to_chat(user, "You unscrew the seclite from [src].") - gun_light = null - S.forceMove(get_turf(user)) - update_gunlight(user) - S.update_brightness(user) - update_icon() - verbs -= /obj/item/weapon/gun/proc/toggle_gunlight - for(var/datum/action/item_action/toggle_gunlight/TGL in actions) - qdel(TGL) + if(user.a_intent == INTENT_HARM) + return ..() + else if(istype(I, /obj/item/device/flashlight/seclite)) + if(!can_flashlight) + return ..() + var/obj/item/device/flashlight/seclite/S = I + if(!gun_light) + if(!user.transferItemToLoc(I, src)) + return + to_chat(user, "You click \the [S] into place on \the [src].") + if(S.on) + set_light(0) + gun_light = S + update_icon() + update_gunlight(user) + alight = new /datum/action/item_action/toggle_gunlight(src) + if(loc == user) + alight.Grant(user) + else if(istype(I, /obj/item/weapon/kitchen/knife)) + if(!can_bayonet) + return ..() + var/obj/item/weapon/kitchen/knife/K = I + if(!bayonet) + if(!user.transferItemToLoc(I, src)) + return + to_chat(user, "You attach \the [K] to the front of ]the [src].") + bayonet = K + update_icon() + else if(istype(I, /obj/item/weapon/screwdriver)) + if(gun_light) + var/obj/item/device/flashlight/seclite/S = gun_light + to_chat(user, "You unscrew the seclite from \the [src].") + gun_light = null + S.forceMove(get_turf(user)) + update_gunlight(user) + S.update_brightness(user) + update_icon() + QDEL_NULL(alight) + if(bayonet) + var/obj/item/weapon/kitchen/knife/K = bayonet + K.forceMove(get_turf(user)) + bayonet = null + update_icon() else - ..() - - + return ..() /obj/item/weapon/gun/proc/toggle_gunlight() - set name = "Toggle Gunlight" - set category = "Object" - set desc = "Click to toggle your weapon's attached flashlight." - if(!gun_light) return @@ -343,12 +383,16 @@ ..() if(azoom) azoom.Grant(user) + if(alight) + alight.Grant(user) /obj/item/weapon/gun/dropped(mob/user) ..() zoom(user,FALSE) if(azoom) azoom.Remove(user) + if(alight) + alight.Remove(user) /obj/item/weapon/gun/AltClick(mob/user) @@ -370,9 +414,6 @@ to_chat(M, "Your gun is now skinned as [choice]. Say hello to your new friend.") update_icon() - - - /obj/item/weapon/gun/proc/handle_suicide(mob/living/carbon/human/user, mob/living/carbon/human/target, params) if(!ishuman(user) || !ishuman(target)) return diff --git a/code/modules/projectiles/guns/ballistic.dm b/code/modules/projectiles/guns/ballistic.dm index a7a8b75da2..80be30a06a 100644 --- a/code/modules/projectiles/guns/ballistic.dm +++ b/code/modules/projectiles/guns/ballistic.dm @@ -9,8 +9,8 @@ var/obj/item/ammo_box/magazine/magazine var/casing_ejector = 1 //whether the gun ejects the chambered casing -/obj/item/weapon/gun/ballistic/New() - ..() +/obj/item/weapon/gun/ballistic/Initialize() + . = ..() if(!spawnwithmagazine) update_icon() return diff --git a/code/modules/projectiles/guns/ballistic/automatic.dm b/code/modules/projectiles/guns/ballistic/automatic.dm index 2f7036cab8..70d399b107 100644 --- a/code/modules/projectiles/guns/ballistic/automatic.dm +++ b/code/modules/projectiles/guns/ballistic/automatic.dm @@ -99,10 +99,9 @@ /obj/item/weapon/gun/ballistic/automatic/c20r/unrestricted pin = /obj/item/device/firing_pin -/obj/item/weapon/gun/ballistic/automatic/c20r/New() - ..() +/obj/item/weapon/gun/ballistic/automatic/c20r/Initialize() + . = ..() update_icon() - return /obj/item/weapon/gun/ballistic/automatic/c20r/afterattack() ..() @@ -150,20 +149,18 @@ fire_delay = 2 pin = /obj/item/device/firing_pin/implant/pindicate -/obj/item/weapon/gun/ballistic/automatic/m90/New() - ..() +/obj/item/weapon/gun/ballistic/automatic/m90/Initialize() + . = ..() underbarrel = new /obj/item/weapon/gun/ballistic/revolver/grenadelauncher(src) update_icon() - return /obj/item/weapon/gun/ballistic/automatic/m90/unrestricted pin = /obj/item/device/firing_pin -/obj/item/weapon/gun/ballistic/automatic/m90/unrestricted/New() - ..() +/obj/item/weapon/gun/ballistic/automatic/m90/unrestricted/Initialize() + . = ..() underbarrel = new /obj/item/weapon/gun/ballistic/revolver/grenadelauncher/unrestricted(src) update_icon() - return /obj/item/weapon/gun/ballistic/automatic/m90/afterattack(atom/target, mob/living/user, flag, params) if(select == 2) @@ -259,8 +256,8 @@ /obj/item/weapon/gun/ballistic/automatic/shotgun/bulldog/unrestricted pin = /obj/item/device/firing_pin -/obj/item/weapon/gun/ballistic/automatic/shotgun/bulldog/New() - ..() +/obj/item/weapon/gun/ballistic/automatic/shotgun/bulldog/Initialize() + . = ..() update_icon() /obj/item/weapon/gun/ballistic/automatic/shotgun/bulldog/update_icon() diff --git a/code/modules/projectiles/guns/ballistic/laser_gatling.dm b/code/modules/projectiles/guns/ballistic/laser_gatling.dm index bc0668cd66..a246871e61 100644 --- a/code/modules/projectiles/guns/ballistic/laser_gatling.dm +++ b/code/modules/projectiles/guns/ballistic/laser_gatling.dm @@ -9,16 +9,16 @@ item_state = "backpack" slot_flags = SLOT_BACK w_class = WEIGHT_CLASS_HUGE - var/obj/item/weapon/gun/ballistic/minigun/gun = null + var/obj/item/weapon/gun/ballistic/minigun/gun var/armed = 0 //whether the gun is attached, 0 is attached, 1 is the gun is wielded. var/overheat = 0 var/overheat_max = 40 var/heat_diffusion = 1 -/obj/item/weapon/minigunpack/New() +/obj/item/weapon/minigunpack/Initialize() + . = ..() gun = new(src) START_PROCESSING(SSobj, src) - ..() /obj/item/weapon/minigunpack/Destroy() STOP_PROCESSING(SSobj, src) @@ -110,15 +110,15 @@ casing_ejector = 0 var/obj/item/weapon/minigunpack/ammo_pack -/obj/item/weapon/gun/ballistic/minigun/New() +/obj/item/weapon/gun/ballistic/minigun/Initialize() SET_SECONDARY_FLAG(src, SLOWS_WHILE_IN_HAND) - if(!ammo_pack) - if(istype(loc,/obj/item/weapon/minigunpack)) //We should spawn inside a ammo pack so let's use that one. - ammo_pack = loc - ..() - else - qdel(src)//No pack, no gun + if(istype(loc, /obj/item/weapon/minigunpack)) //We should spawn inside a ammo pack so let's use that one. + ammo_pack = loc + else + return INITIALIZE_HINT_QDEL //No pack, no gun + + return ..() /obj/item/weapon/gun/ballistic/minigun/attack_self(mob/living/user) return diff --git a/code/modules/projectiles/guns/ballistic/revolver.dm b/code/modules/projectiles/guns/ballistic/revolver.dm index 892defa9f4..2ce432bf31 100644 --- a/code/modules/projectiles/guns/ballistic/revolver.dm +++ b/code/modules/projectiles/guns/ballistic/revolver.dm @@ -6,8 +6,8 @@ origin_tech = "combat=3;materials=2" casing_ejector = 0 -/obj/item/weapon/gun/ballistic/revolver/New() - ..() +/obj/item/weapon/gun/ballistic/revolver/Initialize() + . = ..() if(!istype(magazine, /obj/item/ammo_box/magazine/internal/cylinder)) verbs -= /obj/item/weapon/gun/ballistic/revolver/verb/spin @@ -95,8 +95,8 @@ unique_rename = 1 unique_reskin = 1 -/obj/item/weapon/gun/ballistic/revolver/detective/New() - ..() +/obj/item/weapon/gun/ballistic/revolver/detective/Initialize() + . = ..() options["Default"] = "detective" options["Leopard Spots"] = "detective_leopard" options["Black Panther"] = "detective_panther" @@ -177,8 +177,8 @@ mag_type = /obj/item/ammo_box/magazine/internal/cylinder/rus357 var/spun = FALSE -/obj/item/weapon/gun/ballistic/revolver/russian/New() - ..() +/obj/item/weapon/gun/ballistic/revolver/russian/Initialize() + . = ..() do_spin() spun = TRUE update_icon() @@ -271,8 +271,8 @@ unique_rename = 1 unique_reskin = 1 -/obj/item/weapon/gun/ballistic/revolver/doublebarrel/New() - ..() +/obj/item/weapon/gun/ballistic/revolver/doublebarrel/Initialize() + . = ..() options["Default"] = "dshotgun" options["Dark Red Finish"] = "dshotgun-d" options["Ash"] = "dshotgun-f" diff --git a/code/modules/projectiles/guns/ballistic/shotgun.dm b/code/modules/projectiles/guns/ballistic/shotgun.dm index 918acd27a1..6fc3fd3687 100644 --- a/code/modules/projectiles/guns/ballistic/shotgun.dm +++ b/code/modules/projectiles/guns/ballistic/shotgun.dm @@ -147,8 +147,8 @@ mag_type = /obj/item/ammo_box/magazine/internal/boltaction/enchanted/arcane_barrage -/obj/item/weapon/gun/ballistic/shotgun/boltaction/enchanted/New() - ..() +/obj/item/weapon/gun/ballistic/shotgun/boltaction/enchanted/Initialize() + . = ..() bolt_open = 1 pump() gun_type = type @@ -213,8 +213,8 @@ var/toggled = 0 var/obj/item/ammo_box/magazine/internal/shot/alternate_magazine -/obj/item/weapon/gun/ballistic/shotgun/automatic/dual_tube/New() - ..() +/obj/item/weapon/gun/ballistic/shotgun/automatic/dual_tube/Initialize() + . = ..() if (!alternate_magazine) alternate_magazine = new mag_type(src) diff --git a/code/modules/projectiles/guns/ballistic/toy.dm b/code/modules/projectiles/guns/ballistic/toy.dm index 89f6655d8e..9b8044dac8 100644 --- a/code/modules/projectiles/guns/ballistic/toy.dm +++ b/code/modules/projectiles/guns/ballistic/toy.dm @@ -35,9 +35,9 @@ /obj/item/weapon/gun/ballistic/automatic/toy/pistol/riot mag_type = /obj/item/ammo_box/magazine/toy/pistol/riot -/obj/item/weapon/gun/ballistic/automatic/toy/pistol/riot/New() +/obj/item/weapon/gun/ballistic/automatic/toy/pistol/riot/Initialize() magazine = new /obj/item/ammo_box/magazine/toy/pistol/riot(src) - ..() + return ..() /obj/item/weapon/gun/ballistic/automatic/toy/pistol/unrestricted pin = /obj/item/device/firing_pin diff --git a/code/modules/projectiles/guns/energy.dm b/code/modules/projectiles/guns/energy.dm index 9e642b0cef..f8d0911011 100644 --- a/code/modules/projectiles/guns/energy.dm +++ b/code/modules/projectiles/guns/energy.dm @@ -10,6 +10,7 @@ var/list/ammo_type = list(/obj/item/ammo_casing/energy) var/select = 1 //The state of the select fire switch. Determines from the ammo_type list what kind of shot is fired next. var/can_charge = 1 //Can it be charged in a recharger? + var/automatic_charge_overlays = TRUE //Do we handle overlays with base update_icon()? var/charge_sections = 4 ammo_x_offset = 2 var/shaded_charge = 0 //if this gun uses a stateful charge bar for more detail @@ -25,8 +26,8 @@ update_icon() -/obj/item/weapon/gun/energy/New() - ..() +/obj/item/weapon/gun/energy/Initialize() + . = ..() if(cell_type) power_supply = new cell_type(src) else @@ -116,7 +117,9 @@ return /obj/item/weapon/gun/energy/update_icon() - cut_overlays() + ..() + if(!automatic_charge_overlays) + return var/ratio = Ceiling((power_supply.charge / power_supply.maxcharge) * charge_sections) var/obj/item/ammo_casing/energy/shot = ammo_type[select] var/iconState = "[icon_state]_charge" @@ -138,14 +141,6 @@ add_overlay(charge_overlay) else add_overlay("[icon_state]_charge[ratio]") - if(gun_light && can_flashlight) - var/iconF = "flight" - if(gun_light.on) - iconF = "flight_on" - var/mutable_appearance/flashlight_overlay = mutable_appearance(icon, iconF) - flashlight_overlay.pixel_x = flight_x_offset - flashlight_overlay.pixel_y = flight_y_offset - add_overlay(flashlight_overlay) if(itemState) itemState += "[ratio]" item_state = itemState diff --git a/code/modules/projectiles/guns/energy/energy_gun.dm b/code/modules/projectiles/guns/energy/energy_gun.dm index 52f9852344..a8edc727b3 100644 --- a/code/modules/projectiles/guns/energy/energy_gun.dm +++ b/code/modules/projectiles/guns/energy/energy_gun.dm @@ -22,9 +22,9 @@ charge_sections = 3 can_flashlight = 0 // Can't attach or detach the flashlight, and override it's icon update -/obj/item/weapon/gun/energy/e_gun/mini/New() +/obj/item/weapon/gun/energy/e_gun/mini/Initialize() gun_light = new /obj/item/device/flashlight/seclite(src) - ..() + return ..() /obj/item/weapon/gun/energy/e_gun/mini/update_icon() ..() diff --git a/code/modules/projectiles/guns/energy/kinetic_accelerator.dm b/code/modules/projectiles/guns/energy/kinetic_accelerator.dm index 0f108fcc76..1799a33cbb 100644 --- a/code/modules/projectiles/guns/energy/kinetic_accelerator.dm +++ b/code/modules/projectiles/guns/energy/kinetic_accelerator.dm @@ -16,6 +16,9 @@ var/holds_charge = FALSE var/unique_frequency = FALSE // modified by KA modkits var/overheat = FALSE + can_bayonet = TRUE + knife_x_offset = 15 + knife_y_offset = 13 var/max_mod_capacity = 100 var/list/modkits = list() @@ -68,7 +71,7 @@ unique_frequency = TRUE max_mod_capacity = 80 -/obj/item/weapon/gun/energy/kinetic_accelerator/New() +/obj/item/weapon/gun/energy/kinetic_accelerator/Initialize() . = ..() if(!holds_charge) empty() @@ -129,19 +132,11 @@ overheat = FALSE /obj/item/weapon/gun/energy/kinetic_accelerator/update_icon() - cut_overlays() + ..() + if(empty_state && !can_shoot()) add_overlay(empty_state) - if(gun_light && can_flashlight) - var/iconF = "flight" - if(gun_light.on) - iconF = "flight_on" - var/mutable_appearance/flashlight_overlay = mutable_appearance(icon, iconF) - flashlight_overlay.pixel_x = flight_x_offset - flashlight_overlay.pixel_y = flight_y_offset - add_overlay(flashlight_overlay) - //Casing /obj/item/ammo_casing/energy/kinetic projectile_type = /obj/item/projectile/kinetic diff --git a/code/modules/projectiles/guns/energy/pulse.dm b/code/modules/projectiles/guns/energy/pulse.dm index b3e55f2423..43431a65c3 100644 --- a/code/modules/projectiles/guns/energy/pulse.dm +++ b/code/modules/projectiles/guns/energy/pulse.dm @@ -17,9 +17,9 @@ /obj/item/weapon/gun/energy/pulse/prize pin = /obj/item/device/firing_pin -/obj/item/weapon/gun/energy/pulse/prize/New() +/obj/item/weapon/gun/energy/pulse/prize/Initialize() . = ..() - GLOB.poi_list |= src + GLOB.poi_list += src var/msg = "A pulse rifle prize has been created at [ADMIN_COORDJMP(src)]" message_admins(msg) diff --git a/code/modules/projectiles/guns/magic.dm b/code/modules/projectiles/guns/magic.dm index 58a756a28d..9c30eefd2f 100644 --- a/code/modules/projectiles/guns/magic.dm +++ b/code/modules/projectiles/guns/magic.dm @@ -44,8 +44,8 @@ charges--//... drain a charge recharge_newshot() -/obj/item/weapon/gun/magic/New() - ..() +/obj/item/weapon/gun/magic/Initialize() + . = ..() charges = max_charges chambered = new ammo_type(src) if(can_charge) diff --git a/code/modules/projectiles/guns/magic/wand.dm b/code/modules/projectiles/guns/magic/wand.dm index fe93a58838..247273e3f4 100644 --- a/code/modules/projectiles/guns/magic/wand.dm +++ b/code/modules/projectiles/guns/magic/wand.dm @@ -9,13 +9,13 @@ max_charges = 100 //100, 50, 50, 34 (max charge distribution by 25%ths) var/variable_charges = 1 -/obj/item/weapon/gun/magic/wand/New() +/obj/item/weapon/gun/magic/wand/Initialize() if(prob(75) && variable_charges) //25% chance of listed max charges, 50% chance of 1/2 max charges, 25% chance of 1/3 max charges if(prob(33)) max_charges = Ceiling(max_charges / 3) else max_charges = Ceiling(max_charges / 2) - ..() + return ..() /obj/item/weapon/gun/magic/wand/examine(mob/user) ..() diff --git a/code/modules/projectiles/guns/medbeam.dm b/code/modules/projectiles/guns/medbeam.dm index 37d576a8ff..46758f8889 100644 --- a/code/modules/projectiles/guns/medbeam.dm +++ b/code/modules/projectiles/guns/medbeam.dm @@ -16,8 +16,8 @@ weapon_weight = WEAPON_MEDIUM -/obj/item/weapon/gun/medbeam/New() - ..() +/obj/item/weapon/gun/medbeam/Initialize() + . = ..() START_PROCESSING(SSobj, src) /obj/item/weapon/gun/medbeam/Destroy(mob/user) @@ -128,6 +128,6 @@ /obj/item/weapon/gun/medbeam/mech mounted = 1 -/obj/item/weapon/gun/medbeam/mech/New() - ..() +/obj/item/weapon/gun/medbeam/mech/Initialize() + . = ..() STOP_PROCESSING(SSobj, src) //Mech mediguns do not process until installed, and are controlled by the holder obj diff --git a/code/modules/projectiles/guns/syringe_gun.dm b/code/modules/projectiles/guns/syringe_gun.dm index 09547b0d98..2e8a29cded 100644 --- a/code/modules/projectiles/guns/syringe_gun.dm +++ b/code/modules/projectiles/guns/syringe_gun.dm @@ -14,8 +14,8 @@ var/list/syringes = list() var/max_syringes = 1 -/obj/item/weapon/gun/syringe/New() - ..() +/obj/item/weapon/gun/syringe/Initialize() + . = ..() chambered = new /obj/item/ammo_casing/syringegun(src) /obj/item/weapon/gun/syringe/recharge_newshot() diff --git a/code/modules/projectiles/projectile.dm b/code/modules/projectiles/projectile.dm index 3dbadc85c5..8c810155db 100644 --- a/code/modules/projectiles/projectile.dm +++ b/code/modules/projectiles/projectile.dm @@ -28,6 +28,9 @@ var/spread = 0 //amount (in degrees) of projectile spread var/legacy = 0 //legacy projectile system animate_movement = 0 //Use SLIDE_STEPS in conjunction with legacy + var/ricochets = 0 + var/ricochets_max = 2 + var/ricochet_chance = 30 var/damage = 10 var/damage_type = BRUTE //BRUTE, BURN, TOX, OXY, CLONE are the only things that should be in here @@ -132,7 +135,11 @@ /obj/item/projectile/Bump(atom/A, yes) if(!yes) //prevents double bumps. return - if(firer) + if(check_ricochet() && check_ricochet_flag(A) && ricochets < ricochets_max) + ricochets++ + if(A.handle_ricochet(src)) + return FALSE + if(firer && !ricochets) if(A == firer || (A == firer.loc && istype(A, /obj/mecha))) //cannot shoot yourself or your mech loc = A.loc return 0 @@ -166,6 +173,16 @@ picked_mob.bullet_act(src, def_zone) qdel(src) +/obj/item/projectile/proc/check_ricochet() + if(prob(ricochet_chance)) + return TRUE + return FALSE + +/obj/item/projectile/proc/check_ricochet_flag(atom/A) + if(A.flags & CHECK_RICOCHET) + return TRUE + return FALSE + /obj/item/projectile/Process_Spacemove(var/movement_dir = 0) return 1 //Bullets don't drift in space diff --git a/code/modules/projectiles/projectile/beams.dm b/code/modules/projectiles/projectile/beams.dm index 766d8b5e39..427f590ba5 100644 --- a/code/modules/projectiles/projectile/beams.dm +++ b/code/modules/projectiles/projectile/beams.dm @@ -11,7 +11,9 @@ eyeblur = 2 impact_effect_type = /obj/effect/temp_visual/impact_effect/red_laser light_color = LIGHT_COLOR_RED - + ricochets_max = 50 //Honk! + ricochet_chance = 80 + /obj/item/projectile/beam/laser /obj/item/projectile/beam/laser/heavylaser diff --git a/code/modules/projectiles/projectile/special.dm b/code/modules/projectiles/projectile/special.dm index 57b339178f..867d1b8c8f 100644 --- a/code/modules/projectiles/projectile/special.dm +++ b/code/modules/projectiles/projectile/special.dm @@ -242,6 +242,7 @@ //Between normal and advanced for damage, made a beam so not the turret does not destroy glass name = "plasma beam" damage = 6 + range = 7 pass_flags = PASSTABLE | PASSGLASS | PASSGRILLE diff --git a/code/modules/research/xenobiology/xenobio_camera.dm b/code/modules/research/xenobiology/xenobio_camera.dm index ff7c3f6340..f43a89eef4 100644 --- a/code/modules/research/xenobiology/xenobio_camera.dm +++ b/code/modules/research/xenobiology/xenobio_camera.dm @@ -96,12 +96,12 @@ origin.feed_slime_action.Remove(C) origin.monkey_recycle_action.Remove(C) //All of this stuff below could probably be a proc for all advanced cameras, only the action removal needs to be camera specific - remote_eye.eye_user = null C.reset_perspective(null) if(C.client) C.client.images -= remote_eye.user_image for(var/datum/camerachunk/chunk in remote_eye.visibleCameraChunks) chunk.remove(remote_eye) + remote_eye.eye_user = null C.remote_control = null C.unset_machine() Remove(C) diff --git a/code/modules/shuttle/arrivals.dm b/code/modules/shuttle/arrivals.dm index d60a832279..7cb347d429 100644 --- a/code/modules/shuttle/arrivals.dm +++ b/code/modules/shuttle/arrivals.dm @@ -99,7 +99,7 @@ SendToStation() return - var/found_awake = PersonCheck() + var/found_awake = PersonCheck() || NukeDiskCheck() if(mode == SHUTTLE_CALL) if(found_awake) SendToStation() @@ -128,6 +128,12 @@ return TRUE return FALSE +/obj/docking_port/mobile/arrivals/proc/NukeDiskCheck() + for (var/obj/item/weapon/disk/nuclear/N in GLOB.poi_list) + if (get_area(N) in areas) + return TRUE + return FALSE + /obj/docking_port/mobile/arrivals/proc/SendToStation() var/dockTime = config.arrivals_shuttle_dock_window if(mode == SHUTTLE_CALL && timeLeft(1) > dockTime) @@ -140,11 +146,17 @@ var/docked = S1 == assigned_transit sound_played = FALSE if(docked) //about to launch - if(!force_depart && PersonCheck()) - mode = SHUTTLE_IDLE - if(console) - console.say("Launch cancelled, lifeform dectected on board.") - return + if(!force_depart) + var/cancel_reason + if(PersonCheck()) + cancel_reason = "lifeform dectected on board" + else if(NukeDiskCheck()) + cancel_reason = "critical station device detected on board" + if(cancel_reason) + mode = SHUTTLE_IDLE + if(console) + console.say("Launch cancelled, [cancel_reason].") + return force_depart = FALSE . = ..() if(!. && !docked && !damaged) diff --git a/code/modules/uplink/uplink_item.dm b/code/modules/uplink/uplink_item.dm index 667742afc4..f603612bbf 100644 --- a/code/modules/uplink/uplink_item.dm +++ b/code/modules/uplink/uplink_item.dm @@ -725,16 +725,6 @@ GLOBAL_LIST_EMPTY(uplink_items) // Global list so we only initialize this once. item = /obj/item/weapon/grenade/clusterbuster/soap cost = 6 -/datum/uplink_item/stealthy_weapons/door_charge - name = "Explosive Airlock Charge" - desc = "A small, easily concealable device. It can be applied to an open airlock panel, booby-trapping it. \ - The next person to use that airlock will trigger an explosion, knocking them down and destroying \ - the airlock maintenance panel." - item = /obj/item/device/doorCharge - cost = 2 - surplus = 10 - exclude_modes = list(/datum/game_mode/nuclear) - // Stealth Items /datum/uplink_item/stealthy_tools category = "Stealth and Camouflage Items" diff --git a/code/world.dm b/code/world.dm index 566c9e213c..df083571c4 100644 --- a/code/world.dm +++ b/code/world.dm @@ -18,7 +18,7 @@ SetupExternalRSC() - GLOB.config_error_log = file("data/logs/config_error.log") //temporary file used to record errors with loading config, moved to log directory once logging is set bl + GLOB.config_error_log = GLOB.world_href_log = GLOB.world_runtime_log = GLOB.world_attack_log = GLOB.world_game_log = file("data/logs/config_error.log") //temporary file used to record errors with loading config, moved to log directory once logging is set bl make_datum_references_lists() //initialises global lists for referencing frequently used datums (so that we only ever do it once) diff --git a/html/changelogs/AutoChangeLog-pr-1104.yml b/html/changelogs/AutoChangeLog-pr-1104.yml new file mode 100644 index 0000000000..caffe5a257 --- /dev/null +++ b/html/changelogs/AutoChangeLog-pr-1104.yml @@ -0,0 +1,4 @@ +author: "CitadelStationBot" +delete-after: True +changes: + - spellcheck: "Fixed very minor inconsistencies on items & punctuation on items." diff --git a/html/changelogs/AutoChangeLog-pr-1182.yml b/html/changelogs/AutoChangeLog-pr-1182.yml new file mode 100644 index 0000000000..a2c7d10876 --- /dev/null +++ b/html/changelogs/AutoChangeLog-pr-1182.yml @@ -0,0 +1,4 @@ +author: "CitadelStationBot" +delete-after: True +changes: + - spellcheck: "typo fix for origin tech" diff --git a/html/changelogs/AutoChangeLog-pr-1183.yml b/html/changelogs/AutoChangeLog-pr-1183.yml new file mode 100644 index 0000000000..4a627f949b --- /dev/null +++ b/html/changelogs/AutoChangeLog-pr-1183.yml @@ -0,0 +1,4 @@ +author: "CitadelStationBot" +delete-after: True +changes: + - rscadd: "20% of internal affairs agents are actually traitors" diff --git a/html/changelogs/AutoChangeLog-pr-1186.yml b/html/changelogs/AutoChangeLog-pr-1186.yml new file mode 100644 index 0000000000..205bc61c7a --- /dev/null +++ b/html/changelogs/AutoChangeLog-pr-1186.yml @@ -0,0 +1,4 @@ +author: "4dplanner, robustin" +delete-after: True +changes: + - bugfix: "c4 has always taken 3 seconds to plant, and you are not allow to believe otherwise" diff --git a/html/changelogs/AutoChangeLog-pr-1191.yml b/html/changelogs/AutoChangeLog-pr-1191.yml new file mode 100644 index 0000000000..9e1d3c3eaa --- /dev/null +++ b/html/changelogs/AutoChangeLog-pr-1191.yml @@ -0,0 +1,4 @@ +author: "CitadelStationBot" +delete-after: True +changes: + - rscadd: "You can now add bayonets to kinetic accelerators. However, only combat knives and survival knives can be added. Harm intent attacking things will cause you to attack that thing with the bayonet instead!" diff --git a/html/changelogs/AutoChangeLog-pr-1195.yml b/html/changelogs/AutoChangeLog-pr-1195.yml new file mode 100644 index 0000000000..0a5716bcb7 --- /dev/null +++ b/html/changelogs/AutoChangeLog-pr-1195.yml @@ -0,0 +1,6 @@ +author: "Moonlighting Mac says" +delete-after: True +changes: + - rscadd: "You can now craft a strong cloak with a hood made out of goliath and monster materials from within the primitive crafting screen." + - rscadd: "The cloak has a suit slot for all kind of primitive supplies, however it cannot carry most electronic miner equipment. +balance: Due to the recipe requiring leather, it is not normally accessible to all ghost roles without a source of water & electricity." diff --git a/html/changelogs/AutoChangeLog-pr-1210.yml b/html/changelogs/AutoChangeLog-pr-1210.yml new file mode 100644 index 0000000000..4dd2b1de7d --- /dev/null +++ b/html/changelogs/AutoChangeLog-pr-1210.yml @@ -0,0 +1,4 @@ +author: "Kor" +delete-after: True +changes: + - bugfix: "The chaplains possessed blade, shades, and constructs, can once again speak galactic common." diff --git a/html/changelogs/AutoChangeLog-pr-1220.yml b/html/changelogs/AutoChangeLog-pr-1220.yml new file mode 100644 index 0000000000..a9590654e2 --- /dev/null +++ b/html/changelogs/AutoChangeLog-pr-1220.yml @@ -0,0 +1,4 @@ +author: "CitadelStationBot" +delete-after: True +changes: + - rscadd: "Nanotrasen's new titanium wall blueprints are smooth enough that it can reflect projectiles!" diff --git a/html/changelogs/AutoChangeLog-pr-1228.yml b/html/changelogs/AutoChangeLog-pr-1228.yml new file mode 100644 index 0000000000..1b9058a75c --- /dev/null +++ b/html/changelogs/AutoChangeLog-pr-1228.yml @@ -0,0 +1,4 @@ +author: "Joan" +delete-after: True +changes: + - bugfix: "Necropolis tendrils will once again emit light." diff --git a/html/changelogs/AutoChangeLog-pr-1231.yml b/html/changelogs/AutoChangeLog-pr-1231.yml new file mode 100644 index 0000000000..7fad1ab274 --- /dev/null +++ b/html/changelogs/AutoChangeLog-pr-1231.yml @@ -0,0 +1,4 @@ +author: "CitadelStationBot" +delete-after: True +changes: + - tweak: "E-Cigarettes can now fit in your pocket." diff --git a/html/changelogs/AutoChangeLog-pr-1232.yml b/html/changelogs/AutoChangeLog-pr-1232.yml new file mode 100644 index 0000000000..97344d4418 --- /dev/null +++ b/html/changelogs/AutoChangeLog-pr-1232.yml @@ -0,0 +1,4 @@ +author: "Iamgoofball" +delete-after: True +changes: + - bugfix: "After the Syndicate realized their top chemist was both mixing a stamina destroying drug with a stimulant to avoid slowdowns entirely in their sleepypens, they fired him and replaced him with a new chemist." diff --git a/icons/obj/clothing/suits.dmi b/icons/obj/clothing/suits.dmi index 27e02e2e7c..3a59c48c2e 100644 Binary files a/icons/obj/clothing/suits.dmi and b/icons/obj/clothing/suits.dmi differ diff --git a/icons/obj/guns/bayonets.dmi b/icons/obj/guns/bayonets.dmi new file mode 100644 index 0000000000..176005b7d7 Binary files /dev/null and b/icons/obj/guns/bayonets.dmi differ diff --git a/icons/obj/guns/flashlights.dmi b/icons/obj/guns/flashlights.dmi new file mode 100644 index 0000000000..a651cea313 Binary files /dev/null and b/icons/obj/guns/flashlights.dmi differ diff --git a/tools/mapmerge/map_helpers.py b/tools/mapmerge/map_helpers.py index 2e96e7e7e2..ea06641f50 100644 --- a/tools/mapmerge/map_helpers.py +++ b/tools/mapmerge/map_helpers.py @@ -125,7 +125,7 @@ def merge_map(newfile, backupfile, tgm): ####################### #write to file helpers# def write_dictionary_tgm(filename, dictionary, header = None): #write dictionary in tgm format - with open(filename, "w") as output: + with open(filename, "w", newline='\n') as output: output.write("{}\n".format(tgm_header)) if header: output.write("{}\n".format(header)) @@ -172,7 +172,7 @@ def write_dictionary_tgm(filename, dictionary, header = None): #write dictionary def write_grid_coord_small(filename, grid, maxx, maxy): #thanks to YotaXP for finding out about this one - with open(filename, "a") as output: + with open(filename, "a", newline='\n') as output: output.write("\n") for x in range(1, maxx+1): @@ -183,7 +183,7 @@ def write_grid_coord_small(filename, grid, maxx, maxy): #thanks to YotaXP for fi def write_dictionary(filename, dictionary, header = None): #writes a tile dictionary the same way Dreammaker does - with open(filename, "w") as output: + with open(filename, "w", newline='\n') as output: for key, value in dictionary.items(): if header: output.write("{}\n".format(header)) @@ -191,7 +191,7 @@ def write_dictionary(filename, dictionary, header = None): #writes a tile dictio def write_grid(filename, grid, maxx, maxy): #writes a map grid the same way Dreammaker does - with open(filename, "a") as output: + with open(filename, "a", newline='\n') as output: output.write("\n") output.write("(1,1,1) = {\"\n") diff --git a/tools/mapmerge/old_java_mapmerge/MapMerge.jar b/tools/mapmerge/old_java_mapmerge/MapMerge.jar deleted file mode 100644 index d0f0ce0802..0000000000 Binary files a/tools/mapmerge/old_java_mapmerge/MapMerge.jar and /dev/null differ diff --git a/tools/mapmerge/old_java_mapmerge/Run Map Merge.bat b/tools/mapmerge/old_java_mapmerge/Run Map Merge.bat deleted file mode 100644 index 5bb8f1736b..0000000000 --- a/tools/mapmerge/old_java_mapmerge/Run Map Merge.bat +++ /dev/null @@ -1,4 +0,0 @@ -@echo off -call java -jar MapMerge.jar "../../_maps/" /wait - -pause \ No newline at end of file diff --git a/tools/mapmerge/old_java_mapmerge/Source/.classpath b/tools/mapmerge/old_java_mapmerge/Source/.classpath deleted file mode 100644 index 8a11d5b17e..0000000000 --- a/tools/mapmerge/old_java_mapmerge/Source/.classpath +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/tools/mapmerge/old_java_mapmerge/Source/.project b/tools/mapmerge/old_java_mapmerge/Source/.project deleted file mode 100644 index df472fbdf1..0000000000 --- a/tools/mapmerge/old_java_mapmerge/Source/.project +++ /dev/null @@ -1,17 +0,0 @@ - - - MapMerger - - - - - - org.eclipse.jdt.core.javabuilder - - - - - - org.eclipse.jdt.core.javanature - - diff --git a/tools/mapmerge/old_java_mapmerge/Source/.settings/org.eclipse.jdt.core.prefs b/tools/mapmerge/old_java_mapmerge/Source/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index 3a21537071..0000000000 --- a/tools/mapmerge/old_java_mapmerge/Source/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,11 +0,0 @@ -eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 -org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve -org.eclipse.jdt.core.compiler.compliance=1.8 -org.eclipse.jdt.core.compiler.debug.lineNumber=generate -org.eclipse.jdt.core.compiler.debug.localVariable=generate -org.eclipse.jdt.core.compiler.debug.sourceFile=generate -org.eclipse.jdt.core.compiler.problem.assertIdentifier=error -org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.source=1.8 diff --git a/tools/mapmerge/old_java_mapmerge/Source/.settings/org.eclipse.jdt.ui.prefs b/tools/mapmerge/old_java_mapmerge/Source/.settings/org.eclipse.jdt.ui.prefs deleted file mode 100644 index ea0a123b8b..0000000000 --- a/tools/mapmerge/old_java_mapmerge/Source/.settings/org.eclipse.jdt.ui.prefs +++ /dev/null @@ -1,60 +0,0 @@ -cleanup.add_default_serial_version_id=false -cleanup.add_generated_serial_version_id=true -cleanup.add_missing_annotations=true -cleanup.add_missing_deprecated_annotations=true -cleanup.add_missing_methods=false -cleanup.add_missing_nls_tags=false -cleanup.add_missing_override_annotations=true -cleanup.add_missing_override_annotations_interface_methods=true -cleanup.add_serial_version_id=false -cleanup.always_use_blocks=true -cleanup.always_use_parentheses_in_expressions=true -cleanup.always_use_this_for_non_static_field_access=false -cleanup.always_use_this_for_non_static_method_access=false -cleanup.convert_functional_interfaces=false -cleanup.convert_to_enhanced_for_loop=false -cleanup.correct_indentation=true -cleanup.format_source_code=true -cleanup.format_source_code_changes_only=false -cleanup.insert_inferred_type_arguments=false -cleanup.make_local_variable_final=true -cleanup.make_parameters_final=false -cleanup.make_private_fields_final=true -cleanup.make_type_abstract_if_missing_method=false -cleanup.make_variable_declarations_final=false -cleanup.never_use_blocks=false -cleanup.never_use_parentheses_in_expressions=false -cleanup.organize_imports=true -cleanup.qualify_static_field_accesses_with_declaring_class=false -cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true -cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true -cleanup.qualify_static_member_accesses_with_declaring_class=true -cleanup.qualify_static_method_accesses_with_declaring_class=true -cleanup.remove_private_constructors=true -cleanup.remove_redundant_type_arguments=true -cleanup.remove_trailing_whitespaces=false -cleanup.remove_trailing_whitespaces_all=true -cleanup.remove_trailing_whitespaces_ignore_empty=false -cleanup.remove_unnecessary_casts=true -cleanup.remove_unnecessary_nls_tags=true -cleanup.remove_unused_imports=true -cleanup.remove_unused_local_variables=true -cleanup.remove_unused_private_fields=true -cleanup.remove_unused_private_members=true -cleanup.remove_unused_private_methods=true -cleanup.remove_unused_private_types=true -cleanup.sort_members=false -cleanup.sort_members_all=false -cleanup.use_anonymous_class_creation=false -cleanup.use_blocks=true -cleanup.use_blocks_only_for_return_and_throw=false -cleanup.use_lambda=true -cleanup.use_parentheses_in_expressions=true -cleanup.use_this_for_non_static_field_access=true -cleanup.use_this_for_non_static_field_access_only_if_necessary=true -cleanup.use_this_for_non_static_method_access=true -cleanup.use_this_for_non_static_method_access_only_if_necessary=true -cleanup.use_type_arguments=false -cleanup_profile=_Default -cleanup_settings_version=2 -eclipse.preferences.version=1 diff --git a/tools/mapmerge/old_java_mapmerge/Source/bin/FileFinder.class b/tools/mapmerge/old_java_mapmerge/Source/bin/FileFinder.class deleted file mode 100644 index ab01a656c4..0000000000 Binary files a/tools/mapmerge/old_java_mapmerge/Source/bin/FileFinder.class and /dev/null differ diff --git a/tools/mapmerge/old_java_mapmerge/Source/bin/MapMerge.class b/tools/mapmerge/old_java_mapmerge/Source/bin/MapMerge.class deleted file mode 100644 index dff913a6b9..0000000000 Binary files a/tools/mapmerge/old_java_mapmerge/Source/bin/MapMerge.class and /dev/null differ diff --git a/tools/mapmerge/old_java_mapmerge/Source/bin/MapPatcher.jar b/tools/mapmerge/old_java_mapmerge/Source/bin/MapPatcher.jar deleted file mode 100644 index 5cbaad488c..0000000000 Binary files a/tools/mapmerge/old_java_mapmerge/Source/bin/MapPatcher.jar and /dev/null differ diff --git a/tools/mapmerge/old_java_mapmerge/Source/src/FileFinder.java b/tools/mapmerge/old_java_mapmerge/Source/src/FileFinder.java deleted file mode 100644 index 0677b77784..0000000000 --- a/tools/mapmerge/old_java_mapmerge/Source/src/FileFinder.java +++ /dev/null @@ -1,25 +0,0 @@ -import java.io.IOException; -import java.nio.file.FileSystems; -import java.nio.file.FileVisitResult; -import java.nio.file.Path; -import java.nio.file.PathMatcher; -import java.nio.file.SimpleFileVisitor; -import java.nio.file.attribute.BasicFileAttributes; -import java.util.ArrayList; - -public class FileFinder extends SimpleFileVisitor { - private PathMatcher matcher; - public ArrayList foundPaths = new ArrayList<>(); - public FileFinder(String pattern) { - matcher = FileSystems.getDefault().getPathMatcher("glob:" + pattern); - } - - @Override - public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException { - Path name = file.getFileName(); - if (matcher.matches(name)) { - foundPaths.add(file); - } - return FileVisitResult.CONTINUE; - } -} \ No newline at end of file diff --git a/tools/mapmerge/old_java_mapmerge/Source/src/MapMerge.java b/tools/mapmerge/old_java_mapmerge/Source/src/MapMerge.java deleted file mode 100644 index 552a406b13..0000000000 --- a/tools/mapmerge/old_java_mapmerge/Source/src/MapMerge.java +++ /dev/null @@ -1,108 +0,0 @@ -import java.io.IOException; -import java.nio.file.Files; -import java.nio.file.Path; -import java.nio.file.Paths; -import java.util.ArrayList; -import java.util.Scanner; - -public class MapMerge { - - private static Scanner input = new Scanner(System.in); - private static Path pathToMaps; - - public static void main(String[] mapPath) throws IOException { - pathToMaps = Paths.get(mapPath[0]); - FileFinder dmmFinder = new FileFinder("*.dmm"); - Files.walkFileTree(pathToMaps, dmmFinder); - ArrayList foundFiles = dmmFinder.foundPaths; - if (foundFiles.size() > 0) { - try { - MapMerge.merge(foundFiles); - } catch (Exception e) { - System.out.println("Something went wrong."); - e.printStackTrace(); - } - } else { - System.out.println("No files were found in provided directory!"); - System.out.print("Path to maps folder: "); - pathToMaps = Paths.get(input.nextLine()); - dmmFinder = new FileFinder("*.dmm"); - Files.walkFileTree(pathToMaps, dmmFinder); - foundFiles = dmmFinder.foundPaths; - try { - MapMerge.merge(foundFiles); - } catch (Exception e) { - System.out.println("Something went wrong."); - e.printStackTrace(); - } - } - } - - public static void merge(ArrayList foundFiles) throws IOException { - - System.out.println("How many files do you want to merge?"); - int selection1; - inputCheck: while (true) { - while (!input.hasNextInt()) { - String temp = input.next(); - System.out.println(temp + " is not a valid int."); - } - selection1 = input.nextInt(); - if (selection1 < 0) { - System.out.println("Use a number greater than 0!"); - continue inputCheck; - } else { - break inputCheck; - } - } - - for (int numOfFiles = selection1; numOfFiles != 0; numOfFiles--) { - - for (int num = 0; num < foundFiles.size(); num++) { - System.out.println(num + ": " + foundFiles.get(num)); - } - - System.out.print("File to use: "); - int selection2; - inputCheck: while (true) { - while (!input.hasNextInt()) { - String temp = input.next(); - System.out.println(temp + " is not a valid int."); - } - selection2 = input.nextInt(); - if ((selection2 < 0) || (selection2 >= foundFiles.size())) { - if (selection2 < 0) { - System.out.println("Use a number greater than 0!"); - } else { - System.out.println("Use a number less than " + foundFiles.size() + "!"); - } - continue inputCheck; - } else { - break inputCheck; - } - } - - String selected_map = foundFiles.get(selection2) + ""; - String backup_map = selected_map + ".backup"; - String edited_map = selected_map; - String to_save = selected_map; - String[] passInto = { "-clean", backup_map, edited_map, to_save }; - MapPatcher.main(passInto); - - // Will try to fix when I have time ~CorruptComputer - /*try{ - Process process = new ProcessBuilder("dmm2tgm\\dmm2tgm.exe", selected_map).start(); - }catch(Exception e1){ - System.out.println("You are not on a windows machine, trying the .py"); - try{ - Process process = new ProcessBuilder("dmm2tgm\\Source\\dmm2tgm.py", selected_map).start(); - }catch(Exception e2){ - System.out.println("You do not have python 2.7.x installed."); - System.out.println("Downloads can be found here: https://www.python.org/downloads/"); - } - } - */ - - } - } -} \ No newline at end of file diff --git a/tools/mapmerge/old_java_mapmerge/Source/src/MapPatcher Source/Location.java b/tools/mapmerge/old_java_mapmerge/Source/src/MapPatcher Source/Location.java deleted file mode 100644 index 2a901d54b2..0000000000 --- a/tools/mapmerge/old_java_mapmerge/Source/src/MapPatcher Source/Location.java +++ /dev/null @@ -1,42 +0,0 @@ -class Location -{ - int x; - int y; - int z; - - public Location() - { - } - - public Location(int paramInt1, int paramInt2, int paramInt3) - { - this.x = paramInt1; - this.y = paramInt2; - this.z = paramInt3; - } - - public void set(int paramInt1, int paramInt2, int paramInt3) - { - this.x = paramInt1; - this.y = paramInt2; - this.z = paramInt3; - } - - public boolean equals(Object paramObject) - { - if (!(paramObject instanceof Location)) return false; - Location localLocation = (Location)paramObject; - if ((this.x != localLocation.x) || (this.y != localLocation.y) || (this.z != localLocation.z)) return false; - return true; - } - - public int hashCode() - { - return (this.z * 256 + this.y) * 256 + this.x; - } - - public String toString() - { - return "(" + this.x + "," + this.y + "," + this.z + ")"; - } -} diff --git a/tools/mapmerge/old_java_mapmerge/Source/src/MapPatcher Source/Map.java b/tools/mapmerge/old_java_mapmerge/Source/src/MapPatcher Source/Map.java deleted file mode 100644 index 949db7e6ca..0000000000 --- a/tools/mapmerge/old_java_mapmerge/Source/src/MapPatcher Source/Map.java +++ /dev/null @@ -1,314 +0,0 @@ -import java.io.BufferedReader; -import java.io.File; -import java.io.FileInputStream; -import java.io.FileWriter; -import java.io.InputStreamReader; -import java.io.PrintStream; -import java.util.HashMap; -import java.util.Iterator; -import java.util.Set; -import java.util.Vector; - -public class Map -{ - boolean sizeunknown; - int minx; - int miny; - int minz; - int maxx; - int maxy; - int maxz; - HashMap tile_types; - HashMap codes_by_value; - HashMap tiles; - - public Map() - { - this.sizeunknown = true; - this.tile_types = new HashMap(); - this.codes_by_value = new HashMap(); - this.tiles = new HashMap(); - } - - public Map(File paramFile) - { - this(paramFile, false); - } - - public Map(File paramFile, boolean paramBoolean) - { - this.sizeunknown = true; - try { - BufferedReader localBufferedReader = new BufferedReader(new InputStreamReader(new FileInputStream(paramFile))); - - this.tile_types = new HashMap(); - this.codes_by_value = new HashMap(); - this.tiles = new HashMap(); - - MapPatcher.Systemoutprintln(new StringBuilder().append("Loading map ").append(paramFile.getName()).toString()); - MapPatcher.Systemoutprint("Loading tiles"); - String str1 = ""; - int i = 0; - while ((str1 = localBufferedReader.readLine()) != null) - { - if (str1.equals("")) break; - if (str1.startsWith("\"")) - { - if (i < 1) - { - int j = str1.indexOf("\"", 1); - i = j - 1; - } - String str2 = str1.substring(1, 1 + i); - String str3 = str1.substring(str1.indexOf("(")); - this.tile_types.put(str2, str3); - this.codes_by_value.put(str3, str2); - } - } - - MapPatcher.Systemoutprintln(new StringBuilder().append(" ").append(this.tile_types.size()).toString()); - if (!paramBoolean) - { - MapPatcher.Systemoutprintln("Loading levels"); - while (true) - { - if ((str1 = localBufferedReader.readLine()) != null) { if (str1.startsWith("(")) break label270; } else { - label270: if (str1 == null) - { - break; - } - int k = str1.indexOf(",", 1); - int m = Integer.parseInt(str1.substring(1, k)); - str1 = str1.substring(k); - k = str1.indexOf(",", 1); - int n = Integer.parseInt(str1.substring(1, k)); - str1 = str1.substring(k); - k = str1.indexOf(")", 1); - int i1 = Integer.parseInt(str1.substring(1, k)); - - MapPatcher.Systemoutprintln(new StringBuilder().append("New map part from (").append(m).append(",").append(n).append(",").append(i1).append(")").toString()); - - int i3 = n; - if (this.sizeunknown) - { - this.minx = m; this.maxx = this.minx; - this.miny = n; this.maxy = this.miny; - this.minz = i1; this.maxz = this.minz; - this.sizeunknown = false; - } - if (this.minz > i1) this.minz = i1; - if (this.maxz < i1) this.maxz = i1; - while (!(str1 = localBufferedReader.readLine()).startsWith("\"}")) - { - int i2 = m; - if (this.miny > i3) this.miny = i3; - if (this.maxy < i3) this.maxy = i3; - while (str1.length() > 0) - { - String str4 = str1.substring(0, i); - Location localLocation = new Location(i2, i3, i1); - if (this.minx > i2) this.minx = i2; - if (this.maxx < i2) this.maxx = i2; - this.tiles.put(localLocation, this.tile_types.get(str4)); - str1 = str1.substring(i); - i2++; - } - i3++; - } - } - } - } - localBufferedReader.close(); - } - catch (Exception localException) - { - localException.printStackTrace(); - } - } - - public void mirrorY() - { - for (int i = this.minz; i <= this.maxz; i++) - for (int j = this.minx; j <= this.maxx; j++) - for (int k = this.miny; k < (this.miny + this.maxy) / 2; k++) - { - int m = this.maxy - (k - this.miny); - String str = contentAt2(j, k, i); - setAt(j, k, i, contentAt2(j, m, i)); - setAt(j, m, i, str); - } - } - - public String contentAt(int paramInt1, int paramInt2, int paramInt3) - { - Location localLocation = new Location(paramInt1, paramInt2, paramInt3); - String str = (String)this.tiles.get(localLocation); - if (str == null) System.err.println(new StringBuilder().append("Null at ").append(paramInt1).append(",").append(paramInt2).append(",").append(paramInt3).append(" Possible loading error").toString()); - return str == null ? "null" : str; - } - - public String contentAt2(int paramInt1, int paramInt2, int paramInt3) - { - Location localLocation = new Location(paramInt1, paramInt2, paramInt3); - return (String)this.tiles.get(localLocation); - } - - public void setAt(int paramInt1, int paramInt2, int paramInt3, String paramString) - { - if (this.sizeunknown) - { - this.minx = (this.maxx = paramInt1); - this.miny = (this.maxy = paramInt2); - this.minz = (this.maxz = paramInt3); - this.sizeunknown = false; - } - else - { - this.minx = Math.min(this.minx, paramInt1); - this.miny = Math.min(this.miny, paramInt2); - this.minz = Math.min(this.minz, paramInt3); - this.maxx = Math.max(this.maxx, paramInt1); - this.maxy = Math.max(this.maxy, paramInt2); - this.maxz = Math.max(this.maxz, paramInt3); - } - Location localLocation = new Location(paramInt1, paramInt2, paramInt3); - localLocation.set(paramInt1, paramInt2, paramInt3); - this.tiles.put(localLocation, paramString); - } - - public void save(File paramFile) throws Exception - { - saveReferencing(paramFile, null); - } - - public void saveReferencing(File paramFile, Map paramMap) throws Exception - { - FileWriter localFileWriter = new FileWriter(paramFile); - - this.tile_types.clear(); - this.codes_by_value.clear(); - Vector localVector1 = new Vector(); - for (Object localObject1 = this.tiles.keySet().iterator(); ((Iterator)localObject1).hasNext(); ) { Location localLocation = (Location)((Iterator)localObject1).next(); - - String str1 = (String)this.tiles.get(localLocation); - if (!localVector1.contains(str1)) - localVector1.add(str1); - } - MapPatcher.Systemoutprintln(new StringBuilder().append("We have ").append(localVector1.size()).append(" different tiles").toString()); - localObject1 = new String[] { "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z" }; - - int i = 1; - int j = localObject1.length; - while (j < localVector1.size()) - { - j *= localObject1.length; - i++; - } - Vector localVector2; - if (paramMap == null) { - localVector2 = localVector1; - } - else { - localVector2 = new Vector(); - for (Iterator localIterator = localVector1.iterator(); localIterator.hasNext(); ) { localObject2 = (String)localIterator.next(); - - if (paramMap.codes_by_value.containsKey(localObject2)) - { - localObject3 = paramMap.getIdFor((String)localObject2); - this.tile_types.put(localObject3, localObject2); - this.codes_by_value.put(localObject2, localObject3); - } - else { - localVector2.add(localObject2); - } } - localVector1.clear(); - } - - int k = 0; - for (Object localObject2 = localVector2.iterator(); ((Iterator)localObject2).hasNext(); ) { localObject3 = (String)((Iterator)localObject2).next(); - do - { - str2 = int2code((String[])localObject1, k, i); - k++; - }while (this.tile_types.containsKey(str2)); - this.tile_types.put(str2, localObject3); - this.codes_by_value.put(localObject3, str2); - } - String str2; - localVector2.clear(); - - k = 0; - for (int m = 0; m < this.tile_types.size(); m++) - { - do - { - localObject3 = int2code((String[])localObject1, k, i); - k++; - }while (!this.tile_types.containsKey(localObject3)); - str2 = (String)this.tile_types.get(localObject3); - localFileWriter.write(new StringBuilder().append("\"").append((String)localObject3).append("\" = ").append(str2).append("\r\n").toString()); - } - localVector2.clear(); - - localFileWriter.write("\n"); - - m = 1 + this.maxz - this.minz; - Object localObject3 = new SavingThread[m]; - int n = (this.maxy - this.miny) * ((this.maxx - this.minx) * i + 2) + 32; - - for (k = 0; k < m; k++) - { - localObject3[k] = new SavingThread(this.minz + k, this, n); - localObject3[k].start(); - } - - int i1 = 0; - String str3 = ""; - while (i1 == 0) { - try { - Thread.sleep(100L); } catch (Exception localException) { - } - i1 = 1; - - str3 = ""; - for (k = 0; k < m; k++) - { - if (!localObject3[k].done) - i1 = 0; - if (str3.length() != 0) str3 = new StringBuilder().append(str3).append(" ").toString(); - str3 = new StringBuilder().append(str3).append(localObject3[k].done ? "Done" : new StringBuilder().append(localObject3[k].progress).append("%").toString()).toString(); - } - MapPatcher.Systemoutprint(new StringBuilder().append(str3).append("\r").toString()); - } - - for (k = 0; k < m; k++) { - localFileWriter.write(localObject3[k].result.toString()); - } - localFileWriter.flush(); - localFileWriter.close(); - } - - public String getIdFor(String paramString) - { - if (this.codes_by_value.containsKey(paramString)) - { - return (String)this.codes_by_value.get(paramString); - } - return "???"; - } - - public String int2code(String[] paramArrayOfString, int paramInt1, int paramInt2) - { - String str = ""; - while (paramInt1 >= paramArrayOfString.length) - { - int i = paramInt1 % paramArrayOfString.length; - str = new StringBuilder().append(paramArrayOfString[i]).append(str).toString(); - paramInt1 -= i; - paramInt1 /= paramArrayOfString.length; - } - str = new StringBuilder().append(paramArrayOfString[paramInt1]).append(str).toString(); - while (str.length() < paramInt2) str = new StringBuilder().append(paramArrayOfString[0]).append(str).toString(); - return str; - } -} diff --git a/tools/mapmerge/old_java_mapmerge/Source/src/MapPatcher Source/MapPatcher.java b/tools/mapmerge/old_java_mapmerge/Source/src/MapPatcher Source/MapPatcher.java deleted file mode 100644 index c8d50b9b2f..0000000000 --- a/tools/mapmerge/old_java_mapmerge/Source/src/MapPatcher Source/MapPatcher.java +++ /dev/null @@ -1,304 +0,0 @@ -import java.io.BufferedReader; -import java.io.File; -import java.io.FileInputStream; -import java.io.FileWriter; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.io.PrintStream; -import java.util.Arrays; - -public class MapPatcher -{ - static boolean silent = false; - - public static void main(String[] paramArrayOfString) - { - String str1 = "usage: [me] -diff [old_map] [new_map] [diff_file]"; - String str2 = "usage: [me] -patch [old_map] [diff_file] [new_map]"; - String str3 = "usage: [me] -pack [unpacked] [packed.dmm]"; - String str4 = "usage: [me] -unpack [packed.dmm] [unpacked]"; - String str5 = "usage: [me] -clean [oldmap.dmm] [newmap.dmm] [cleaned.dmm]"; - String str6 = "usage: [me] -merge [original] [local] [remote] [output]"; - - for (int i = 0; i < paramArrayOfString.length; i++) - if (paramArrayOfString[i].equalsIgnoreCase("-silent")) - { - silent = true; - for (; i < paramArrayOfString.length - 1; i++) - paramArrayOfString[i] = paramArrayOfString[(i + 1)]; - paramArrayOfString = (String[])Arrays.copyOf(paramArrayOfString, paramArrayOfString.length - 1); - break; - } - Object localObject; - int i2; - int i3; - int i5; - if ((paramArrayOfString.length > 0) && (paramArrayOfString[0].equalsIgnoreCase("-merge"))) - { - if (paramArrayOfString.length < 5) - { - System.out.println(str6); - try { System.in.read(); } catch (Exception localException1) { - }return; - } - - Map localMap1 = new Map(new File(paramArrayOfString[1])); - localObject = new Map(new File(paramArrayOfString[2])); - Map localMap8 = new Map(new File(paramArrayOfString[3])); - Map localMap9 = new Map(); - - if ((localMap1.minx != ((Map)localObject).minx) || (localMap1.minx != localMap8.minx) || (localMap1.maxx != ((Map)localObject).maxx) || (localMap1.maxx != localMap8.maxx) || (localMap1.miny != ((Map)localObject).miny) || (localMap1.miny != localMap8.miny) || (localMap1.maxy != ((Map)localObject).maxy) || (localMap1.maxy != localMap8.maxy) || (localMap1.minz != ((Map)localObject).minz) || (localMap1.minz != localMap8.minz) || (localMap1.maxz != ((Map)localObject).maxz) || (localMap1.maxz != localMap8.maxz)) - { - Systemoutprintln("Map sizes differ"); - System.exit(1); - } - try - { - for (int n = localMap1.minz; n <= localMap1.maxz; n++) - for (i2 = localMap1.miny; i2 <= localMap1.maxy; i2++) - for (i3 = localMap1.minx; i3 <= localMap1.maxx; i3++) - { - boolean bool1 = localMap1.contentAt(i3, i2, n).equals(((Map)localObject).contentAt(i3, i2, n)); - boolean bool2 = localMap1.contentAt(i3, i2, n).equals(localMap8.contentAt(i3, i2, n)); - i5 = ((Map)localObject).contentAt(i3, i2, n).equals(localMap8.contentAt(i3, i2, n)); - if ((!bool1) && (!bool2)) - { - if (i5 == 0) - { - Systemoutprintln(i3 + "," + i2 + "," + n + " local and remote don't match original and differ"); - System.exit(1); - } - else { - localMap9.setAt(i3, i2, n, ((Map)localObject).contentAt(i3, i2, n)); - } - } else if (!bool1) - localMap9.setAt(i3, i2, n, ((Map)localObject).contentAt(i3, i2, n)); - else if (!bool2) - localMap9.setAt(i3, i2, n, localMap8.contentAt(i3, i2, n)); - else - localMap9.setAt(i3, i2, n, localMap1.contentAt(i3, i2, n)); - } - Systemoutprintln("Saving"); - localMap9.saveReferencing(new File(paramArrayOfString[4]), localMap1); - Systemoutprintln("Done"); - } - catch (Exception localException12) - { - localException12.printStackTrace(); - } - } - else - { - int m; - int i1; - if ((paramArrayOfString.length > 0) && (paramArrayOfString[0].equalsIgnoreCase("-diff"))) - { - if (paramArrayOfString.length < 4) - { - System.out.println(str1); - try { System.in.read(); } catch (Exception localException2) { - }return; - } - - Map localMap2 = new Map(new File(paramArrayOfString[1])); - localObject = new Map(new File(paramArrayOfString[2])); - - int j = Math.max(localMap2.minx, ((Map)localObject).minx); - m = Math.min(localMap2.maxx, ((Map)localObject).maxx); - i1 = Math.max(localMap2.miny, ((Map)localObject).miny); - i2 = Math.min(localMap2.maxy, ((Map)localObject).maxy); - i3 = Math.max(localMap2.minz, ((Map)localObject).minz); - int i4 = Math.min(localMap2.maxz, ((Map)localObject).maxz); - Systemoutprintln("Comparing: x(" + j + "-" + m + ") y(" + i1 + "-" + i2 + ") z(" + i3 + "-" + i4 + ")"); - try - { - FileWriter localFileWriter2 = new FileWriter(paramArrayOfString[3]); - i5 = 0; - for (int i6 = i3; i6 <= i4; i6++) - { - Systemoutprintln("Z-level " + i6); - for (int i7 = i1; i7 <= i2; i7++) - for (int i8 = j; i8 <= m; i8++) - if (!localMap2.contentAt(i8, i7, i6).equals(((Map)localObject).contentAt(i8, i7, i6))) - { - localFileWriter2.write("(" + i8 + "," + (1 + ((Map)localObject).maxy - i7) + "," + i6 + ")=" + ((Map)localObject).contentAt(i8, i7, i6) + "\n"); - i5++; - } - } - localFileWriter2.flush(); - localFileWriter2.close(); - if (i5 == 0) - Systemoutprintln("Files do match"); - else - Systemoutprintln("Writed out " + i5 + " differences"); - } - catch (Exception localException13) - { - localException13.printStackTrace(); - } - - Systemoutprintln("Done"); - } - else - { - String str7; - String str8; - if ((paramArrayOfString.length > 0) && (paramArrayOfString[0].equalsIgnoreCase("-patch"))) - { - if (paramArrayOfString.length < 4) - { - System.out.println(str2); - try { System.in.read(); } catch (Exception localException3) { - }return; - } - - Map localMap3 = new Map(new File(paramArrayOfString[1])); - try - { - localObject = new BufferedReader(new InputStreamReader(new FileInputStream(paramArrayOfString[2]))); - - while ((str7 = ((BufferedReader)localObject).readLine()) != null) - { - str7 = str7.trim(); - if (str7.length() != 0) - { - m = str7.indexOf(",", 1); - i1 = Integer.parseInt(str7.substring(1, m)); - str7 = str7.substring(m); - m = str7.indexOf(",", 1); - i2 = Integer.parseInt(str7.substring(1, m)); - str7 = str7.substring(m); - m = str7.indexOf(")", 1); - i3 = Integer.parseInt(str7.substring(1, m)); - str8 = str7.substring(str7.indexOf("=") + 1); - localMap3.setAt(i1, 1 + localMap3.maxy - i2, i3, str8); - } - } - localMap3.save(new File(paramArrayOfString[3])); - } - catch (Exception localException8) - { - localException8.printStackTrace(); - } - - Systemoutprintln("Done"); - } - else if ((paramArrayOfString.length > 0) && (paramArrayOfString[0].equalsIgnoreCase("-pack"))) - { - if (paramArrayOfString.length < 3) - { - System.out.println(str3); - try { System.in.read(); } catch (Exception localException4) { - }return; - } - - Map localMap4 = new Map(); - try { - BufferedReader localBufferedReader = new BufferedReader(new InputStreamReader(new FileInputStream(paramArrayOfString[1]))); - Systemoutprintln("Loading"); - - while ((str7 = localBufferedReader.readLine()) != null) - { - str7 = str7.trim(); - if (str7.length() != 0) - { - m = str7.indexOf(",", 1); - i1 = Integer.parseInt(str7.substring(1, m)); - str7 = str7.substring(m); - m = str7.indexOf(",", 1); - i2 = Integer.parseInt(str7.substring(1, m)); - str7 = str7.substring(m); - m = str7.indexOf(")", 1); - i3 = Integer.parseInt(str7.substring(1, m)); - str8 = str7.substring(str7.indexOf("=") + 1); - localMap4.setAt(i1, i2, i3, str8); - } - } - Systemoutprintln("Flipping"); - localMap4.mirrorY(); - Systemoutprintln("Saving, bounds: x{" + localMap4.minx + " - " + localMap4.maxx + "}, y{" + localMap4.miny + " - " + localMap4.maxy + "}, z{" + localMap4.minz + " - " + localMap4.maxz + "}"); - localMap4.save(new File(paramArrayOfString[2])); - Systemoutprintln("Done"); - } - catch (Exception localException9) - { - localException9.printStackTrace(); - } - } - else if ((paramArrayOfString.length > 0) && (paramArrayOfString[0].equalsIgnoreCase("-unpack"))) - { - if (paramArrayOfString.length < 3) - { - System.out.println(str4); - try { System.in.read(); } catch (Exception localException5) { - }return; - } - - Systemoutprintln("Loading"); - Map localMap5 = new Map(new File(paramArrayOfString[1])); - try { - FileWriter localFileWriter1 = new FileWriter(paramArrayOfString[2]); - Systemoutprintln("Saving"); - for (int k = localMap5.minz; k <= localMap5.maxz; k++) - { - Systemoutprintln("Z-level " + k); - for (m = localMap5.miny; m <= localMap5.maxy; m++) - for (i1 = localMap5.minx; i1 <= localMap5.maxx; i1++) - localFileWriter1.write("(" + i1 + "," + (1 + localMap5.maxy - m) + "," + k + ")=" + localMap5.contentAt(i1, m, k) + "\n"); - localFileWriter1.write("\n"); - } - localFileWriter1.flush(); - localFileWriter1.close(); - - Systemoutprintln("Done"); - } - catch (Exception localException10) - { - localException10.printStackTrace(); - } - } - else if ((paramArrayOfString.length > 0) && (paramArrayOfString[0].equalsIgnoreCase("-clean"))) - { - if (paramArrayOfString.length < 4) - { - System.out.println(str5); - try { System.in.read(); } catch (Exception localException6) { - }return; - } - - Map localMap6 = new Map(new File(paramArrayOfString[1]), true); - Map localMap7 = new Map(new File(paramArrayOfString[2])); - try - { - localMap7.saveReferencing(new File(paramArrayOfString[3]), localMap6); - Systemoutprintln("Done"); - } - catch (Exception localException11) - { - localException11.printStackTrace(); - } - } - else - { - System.out.println(str1); - System.out.println(str2); - System.out.println(str3); - System.out.println(str4); - System.out.println(str5); - System.out.println(str6); - try { - System.in.read(); } catch (Exception localException7) { } - } - } - } - } - - public static void Systemoutprintln(String paramString) { if (!silent) - System.out.println(paramString); } - - public static void Systemoutprint(String paramString) - { - if (!silent) - System.out.print(paramString); - } -} diff --git a/tools/mapmerge/old_java_mapmerge/Source/src/MapPatcher Source/SavingThread.java b/tools/mapmerge/old_java_mapmerge/Source/src/MapPatcher Source/SavingThread.java deleted file mode 100644 index 24a3d7b04d..0000000000 --- a/tools/mapmerge/old_java_mapmerge/Source/src/MapPatcher Source/SavingThread.java +++ /dev/null @@ -1,37 +0,0 @@ -class SavingThread extends Thread -{ - int z; - Map mymap; - boolean done; - int progress; - StringBuilder result; - - public SavingThread(int paramInt1, Map paramMap, int paramInt2) - { - this.z = paramInt1; - this.mymap = paramMap; - this.progress = 0; - this.done = false; - this.result = new StringBuilder(paramInt2); - } - - public void run() - { - this.result.append("(" + this.mymap.minx + "," + this.mymap.miny + "," + this.z + ") = {\"\r\n"); - - int i = (this.mymap.maxx - this.mymap.minx) * (this.mymap.maxy - this.mymap.miny) / 100; - int j = 0; - for (int k = this.mymap.miny; k <= this.mymap.maxy; k++) - { - for (int m = this.mymap.minx; m <= this.mymap.maxx; m++) - { - this.result.append(this.mymap.getIdFor(this.mymap.contentAt(m, k, this.z))); - j++; if (j >= i) { j = 0; this.progress += 1; } - } - this.result.append("\r\n"); - } - this.result.append("\"}\r\n"); - this.result.append("\r\n"); - this.done = true; - } -} diff --git a/tools/mapmerge/old_java_mapmerge/Source/src/MapPatcher.jar b/tools/mapmerge/old_java_mapmerge/Source/src/MapPatcher.jar deleted file mode 100644 index 5cbaad488c..0000000000 Binary files a/tools/mapmerge/old_java_mapmerge/Source/src/MapPatcher.jar and /dev/null differ diff --git a/tools/readme.txt b/tools/readme.txt index a1c1a17c3b..fbd99e3760 100644 --- a/tools/readme.txt +++ b/tools/readme.txt @@ -1,6 +1,4 @@ the compiled exe file for the Unstandardness text for DM program is in: UnstandardnessTestForDM\bin\Debug\UnstandardnessTestForDM.exe -of -UnstandardnessTestForDM\bin\Release\UnstandardnessTestForDM.exe -You have to move it to the root folder (where the dme file is) and run it from there for it to work. \ No newline at end of file +You have to move it to the root folder (where the dme file is) and run it from there for it to work.