diff --git a/baystation12.dme b/baystation12.dme index 4e137824e8..1171216ef6 100644 --- a/baystation12.dme +++ b/baystation12.dme @@ -107,6 +107,7 @@ #define FILE_DIR "code/modules" #define FILE_DIR "code/modules/admin" #define FILE_DIR "code/modules/admin/DB ban" +#define FILE_DIR "code/modules/admin/permissionverbs" #define FILE_DIR "code/modules/admin/verbs" #define FILE_DIR "code/modules/assembly" #define FILE_DIR "code/modules/awaymissions" @@ -250,6 +251,7 @@ #define FILE_DIR "icons/vending_icons" #define FILE_DIR "interface" #define FILE_DIR "maps" +#define FILE_DIR "maps/backup" #define FILE_DIR "maps/RandomZLevels" #define FILE_DIR "sound" #define FILE_DIR "sound/AI" @@ -495,7 +497,6 @@ #include "code\game\machinery\doppler_array.dm" #include "code\game\machinery\flasher.dm" #include "code\game\machinery\Freezer.dm" -#include "code\game\machinery\gateway.dm" #include "code\game\machinery\hologram.dm" #include "code\game\machinery\hydroponics.dm" #include "code\game\machinery\igniter.dm" @@ -864,6 +865,8 @@ #include "code\modules\admin\player_panel.dm" #include "code\modules\admin\ToRban.dm" #include "code\modules\admin\DB ban\functions.dm" +#include "code\modules\admin\permissionverbs\assignment.dm" +#include "code\modules\admin\permissionverbs\permissionedit.dm" #include "code\modules\admin\verbs\adminhelp.dm" #include "code\modules\admin\verbs\adminjump.dm" #include "code\modules\admin\verbs\adminpm.dm" @@ -1174,6 +1177,7 @@ #include "code\modules\power\apc.dm" #include "code\modules\power\cable.dm" #include "code\modules\power\cable_heavyduty.dm" +#include "code\modules\power\cable_logic.dm" #include "code\modules\power\cell.dm" #include "code\modules\power\engine.dm" #include "code\modules\power\generator.dm" @@ -1341,6 +1345,7 @@ #include "code\ZAS\ZAS_Turfs.dm" #include "code\ZAS\ZAS_Zones.dm" #include "interface\interface.dm" -#include "interface\skin.dmf" +#include "interface\skin.dmf" #include "maps\tgstation.2.0.9.1.dmm" +#include "maps\RandomZLevels\stationCollision.dm" // END_INCLUDE diff --git a/code/FEA/FEA_airgroup.dm b/code/FEA/FEA_airgroup.dm index 9ebb8e6bb1..00a6afc394 100644 --- a/code/FEA/FEA_airgroup.dm +++ b/code/FEA/FEA_airgroup.dm @@ -90,7 +90,7 @@ datum/air_group if (next_check > 0) next_check-- return 1 - next_check += check_delay + rand(0,check_delay/2) + next_check += check_delay + rand(max(check_delay, 1)/2,check_delay) check_delay++ var/turf/simulated/list/border_individual = list() diff --git a/code/FEA/FEA_turf_tile.dm b/code/FEA/FEA_turf_tile.dm index 9af7bd58ec..d043e34824 100644 --- a/code/FEA/FEA_turf_tile.dm +++ b/code/FEA/FEA_turf_tile.dm @@ -304,7 +304,7 @@ turf if (next_check > 0) next_check-- return 1 - next_check += check_delay + rand(0,check_delay/2) + next_check += check_delay + rand(max(check_delay, 1)/2,check_delay) check_delay++ var/turf/simulated/list/possible_fire_spreads = list() diff --git a/code/controllers/configuration.dm b/code/controllers/configuration.dm index 79b094bbb4..a5819e7a29 100644 --- a/code/controllers/configuration.dm +++ b/code/controllers/configuration.dm @@ -102,6 +102,7 @@ var/metroid_delay = 0 var/animal_delay = 0 + var/admin_legacy_system = 0 //Defines whether the server uses the legacy admin system with admins.txt or the SQL system. /datum/configuration/New() var/list/L = typesof(/datum/game_mode) - /datum/game_mode @@ -158,6 +159,9 @@ if(type == "config") switch (name) + if ("admin_legacy_system") + config.admin_legacy_system = 1 + if ("log_ooc") config.log_ooc = 1 diff --git a/code/controllers/verbs.dm b/code/controllers/verbs.dm index 8e9fbf0070..fcd2c73012 100644 --- a/code/controllers/verbs.dm +++ b/code/controllers/verbs.dm @@ -28,7 +28,7 @@ return -/client/proc/debug_controller(controller in list("Master","Failsafe","Ticker","Lighting","Air","Jobs","Sun","Radio","Supply Shuttle","Emergency Shuttle","Configuration","pAI")) +/client/proc/debug_controller(controller in list("Master","Failsafe","Ticker","Lighting","Air","Jobs","Sun","Radio","Supply Shuttle","Emergency Shuttle","Configuration","pAI", "Cameras")) set category = "Debug" set name = "Debug Controller" set desc = "Debug the various periodic loop controllers for the game (be careful!)" @@ -71,5 +71,8 @@ if("pAI") debug_variables(paiController) feedback_add_details("admin_verb","DpAI") + if("Cameras") + debug_variables(cameranet) + feedback_add_details("admin_verb","DCameras") message_admins("Admin [key_name_admin(usr)] is debugging the [controller] controller.", 1) return diff --git a/code/datums/datumvars.dm b/code/datums/datumvars.dm index b2f9b63c8c..8a2c89237c 100644 --- a/code/datums/datumvars.dm +++ b/code/datums/datumvars.dm @@ -8,6 +8,11 @@ client //set src in world + if(!usr.client || !usr.client.holder || !(usr.client.holder.level >= 2) ) //admin candidate and up. + usr << "\red You need to be a higher level administrator to access this." + return + + var/title = "" var/body = "" diff --git a/code/defines/obj.dm b/code/defines/obj.dm index 4915a0d1de..1f86b5cb9c 100644 --- a/code/defines/obj.dm +++ b/code/defines/obj.dm @@ -192,38 +192,37 @@ var/d1 = 0 var/d2 = 1 layer = 2.44 //Just below unary stuff, which is at 2.45 and above pipes, which are at 2.4 - var/color="red" + var/color = "red" var/obj/structure/powerswitch/power_switch /obj/structure/cable/yellow - color="yellow" + color = "yellow" icon = 'icons/obj/power_cond_yellow.dmi' /obj/structure/cable/green - color="green" + color = "green" icon = 'icons/obj/power_cond_green.dmi' /obj/structure/cable/blue - color="blue" + color = "blue" icon = 'icons/obj/power_cond_blue.dmi' /obj/structure/cable/pink - color="pink" + color = "pink" icon = 'icons/obj/power_cond_pink.dmi' /obj/structure/cable/orange - color="orange" + color = "orange" icon = 'icons/obj/power_cond_orange.dmi' /obj/structure/cable/cyan - color="cyan" + color = "cyan" icon = 'icons/obj/power_cond_cyan.dmi' /obj/structure/cable/white - color="white" + color = "white" icon = 'icons/obj/power_cond_white.dmi' - /obj/effect/projection name = "Projection" desc = "This looks like a projection of something." diff --git a/code/defines/obj/weapon.dm b/code/defines/obj/weapon.dm index 7d9c7e5520..373f556a5d 100644 --- a/code/defines/obj/weapon.dm +++ b/code/defines/obj/weapon.dm @@ -1153,18 +1153,6 @@ throw_range = 15 attack_verb = list("banned") -/obj/item/weapon/pen/sleepypen - desc = "It's a normal black ink pen with a sharp point and a carefully engraved \"Waffle Co.\"" - flags = FPRINT | TABLEPASS | OPENCONTAINER - slot_flags = SLOT_BELT - origin_tech = "materials=2;biotech=1;syndicate=7" - -/obj/item/weapon/pen/paralysis - desc = "It's a normal black ink pen with a sharp point." - flags = FPRINT | TABLEPASS | OPENCONTAINER - slot_flags = SLOT_BELT - origin_tech = "materials=2;biotech=1;syndicate=5" - /obj/item/weapon/rack_parts name = "rack parts" desc = "Parts of a rack." diff --git a/code/defines/procs/helper_list.dm b/code/defines/procs/helper_list.dm index cfc9a6edef..827a6348c2 100644 --- a/code/defines/procs/helper_list.dm +++ b/code/defines/procs/helper_list.dm @@ -286,4 +286,22 @@ proc/listclearnulls(list/list) if(Li <= L.len) return (result + L.Copy(Li, 0)) - return (result + R.Copy(Ri, 0)) \ No newline at end of file + return (result + R.Copy(Ri, 0)) + + +//Converts a bitfield to a list of numbers (or words if a wordlist is provided) +/proc/bitfield2list(bitfield = 0, list/wordlist) + var/list/r = list() + if(istype(wordlist,/list)) + var/max = min(wordlist.len,16) + var/bit = 1 + for(var/i=1, i<=max, i++) + if(bitfield & bit) + r += wordlist[i] + bit = bit << 1 + else + for(var/bit=1, bit<=65535, bit = bit << 1) + if(bitfield & bit) + r += bit + + return r \ No newline at end of file diff --git a/code/defines/procs/helpers.dm b/code/defines/procs/helpers.dm index 787bfe1356..9100c3185b 100644 --- a/code/defines/procs/helpers.dm +++ b/code/defines/procs/helpers.dm @@ -327,8 +327,8 @@ Turf and target are seperate in case you want to teleport some distance from a t if(isAI(src)) var/mob/living/silicon/ai/A = src oldname = null//don't bother with the records update crap - world << "[newname] is the AI!" - world << sound('sound/AI/newAI.ogg') + //world << "[newname] is the AI!" + //world << sound('sound/AI/newAI.ogg') // Set eyeobj name if(A.eyeobj) A.eyeobj.name = "[newname] (AI Eye)" diff --git a/code/game/area/areas.dm b/code/game/area/areas.dm index d3971ac46a..29eb5cd676 100644 --- a/code/game/area/areas.dm +++ b/code/game/area/areas.dm @@ -284,14 +284,22 @@ if ("Mine") sound = pick('sound/ambience/ambimine.ogg') musVolume = 25 + + if("Telecoms Teleporter") sound = pick('sound/ambience/ambisin2.ogg', 'sound/ambience/signal.ogg', 'sound/ambience/signal.ogg', 'sound/ambience/ambigen10.ogg') + if("Telecoms Central Compartment") sound = pick('sound/ambience/ambisin2.ogg', 'sound/ambience/signal.ogg', 'sound/ambience/signal.ogg', 'sound/ambience/ambigen10.ogg') + if("Telecoms Satellite") sound = pick('sound/ambience/ambisin2.ogg', 'sound/ambience/signal.ogg', 'sound/ambience/signal.ogg', 'sound/ambience/ambigen10.ogg') + if("Telecoms Foyer") sound = pick('sound/ambience/ambisin2.ogg', 'sound/ambience/signal.ogg', 'sound/ambience/signal.ogg', 'sound/ambience/ambigen10.ogg') + if("Telecommunications Satellite West Wing") sound = pick('sound/ambience/ambisin2.ogg', 'sound/ambience/signal.ogg', 'sound/ambience/signal.ogg', 'sound/ambience/ambigen10.ogg') + if("Telecommunications Satellite East Wing") sound = pick('sound/ambience/ambisin2.ogg', 'sound/ambience/signal.ogg', 'sound/ambience/signal.ogg', 'sound/ambience/ambigen10.ogg') + if("Telecoms Control Room") sound = pick('sound/ambience/ambisin2.ogg', 'sound/ambience/signal.ogg', 'sound/ambience/signal.ogg', 'sound/ambience/ambigen10.ogg') + if("Telecommunications Satellite Lounge") sound = pick('sound/ambience/ambisin2.ogg', 'sound/ambience/signal.ogg', 'sound/ambience/signal.ogg', 'sound/ambience/ambigen10.ogg') + else sound = pick('sound/ambience/ambigen1.ogg','sound/ambience/ambigen3.ogg','sound/ambience/ambigen4.ogg','sound/ambience/ambigen5.ogg','sound/ambience/ambigen6.ogg','sound/ambience/ambigen7.ogg','sound/ambience/ambigen8.ogg','sound/ambience/ambigen9.ogg','sound/ambience/ambigen10.ogg','sound/ambience/ambigen11.ogg','sound/ambience/ambigen12.ogg','sound/ambience/ambigen14.ogg') - if(findtext(src.name, "Telecommunications")) - sound = pick('sound/ambience/ambisin2.ogg', 'sound/ambience/signal.ogg', 'sound/ambience/signal.ogg', 'sound/ambience/ambigen10.ogg') if (prob(35)) - if(A && A:client && !A:client:played) + if(A && A:client && !A:client:played && !A:client:no_ambi) A << sound(sound, repeat = 0, wait = 0, volume = musVolume, channel = 1) A:client:played = 1 spawn(600) diff --git a/code/game/gamemodes/events.dm b/code/game/gamemodes/events.dm index 2140101f72..a06b9b21f5 100644 --- a/code/game/gamemodes/events.dm +++ b/code/game/gamemodes/events.dm @@ -1,3 +1,4 @@ +<<<<<<< HEAD /proc/start_events() //changed to a while(1) loop since they are more efficient. //Moved the spawn in here to allow it to be called with advance proc call if it crashes. @@ -538,4 +539,533 @@ Would like to add a law like "Law x is _______" where x = a number, and _____ is world << "Ion Storm Main Done" +======= +/proc/start_events() + //changed to a while(1) loop since they are more efficient. + //Moved the spawn in here to allow it to be called with advance proc call if it crashes. + //and also to stop spawn copying variables from the game ticker + spawn(3000) + while(1) + if(prob(50))//Every 120 seconds and prob 50 2-4 weak spacedusts will hit the station + spawn(1) + dust_swarm("weak") + if (!event) + //CARN: checks to see if random events are enabled. + if(config.allow_random_events && prob(eventchance)) + event() + hadevent = 1 + else + Holiday_Random_Event() + else + event = 0 + sleep(1200) + +/proc/event() + event = 1 + + var/eventNumbersToPickFrom = list(1,2,4,5,6,7,8,9,10,11,12,13,14, 15) //so ninjas don't cause "empty" events. + + if((world.time/10)>=3600 && toggle_space_ninja && !sent_ninja_to_station)//If an hour has passed, relatively speaking. Also, if ninjas are allowed to spawn and if there is not already a ninja for the round. + eventNumbersToPickFrom += 3 + switch(pick(eventNumbersToPickFrom)) + if(1) + command_alert("Meteors have been detected on collision course with the station.", "Meteor Alert") + world << sound('sound/AI/meteors.ogg') + spawn(100) + meteor_wave() + spawn_meteors() + spawn(700) + meteor_wave() + spawn_meteors() + + if(2) + command_alert("Gravitational anomalies detected on the station. There is no additional data.", "Anomaly Alert") + world << sound('sound/AI/granomalies.ogg') + var/turf/T = pick(blobstart) + var/obj/effect/bhole/bh = new /obj/effect/bhole( T.loc, 30 ) + spawn(rand(50, 300)) + del(bh) + /* + if(3) //Leaving the code in so someone can try and delag it, but this event can no longer occur randomly, per SoS's request. --NEO + command_alert("Space-time anomalies detected on the station. There is no additional data.", "Anomaly Alert") + world << sound('sound/AI/spanomalies.ogg') + var/list/turfs = new + var/turf/picked + for(var/turf/simulated/floor/T in world) + if(T.z == 1) + turfs += T + for(var/turf/simulated/floor/T in turfs) + if(prob(20)) + spawn(50+rand(0,3000)) + picked = pick(turfs) + var/obj/effect/portal/P = new /obj/effect/portal( T ) + P.target = picked + P.creator = null + P.icon = 'icons/obj/objects.dmi' + P.failchance = 0 + P.icon_state = "anom" + P.name = "wormhole" + spawn(rand(300,600)) + del(P) + */ + if(3) + if((world.time/10)>=3600 && toggle_space_ninja && !sent_ninja_to_station)//If an hour has passed, relatively speaking. Also, if ninjas are allowed to spawn and if there is not already a ninja for the round. + space_ninja_arrival()//Handled in space_ninja.dm. Doesn't announce arrival, all sneaky-like. + if(4) + mini_blob_event() + + if(5) + high_radiation_event() + if(6) + viral_outbreak() + if(7) + alien_infestation() + if(8) + prison_break() + if(9) + carp_migration() + if(10) + immovablerod() + if(11) + lightsout(1,2) + if(12) + appendicitis() + if(13) + IonStorm() + if(14) + spacevine_infestation() + if(15) + communications_blackout() + +/proc/communications_blackout(var/silent = 1) + + if(!silent) + command_alert("Ionospheric anomalies detected. Temporary telecommunication failure imminent. Please contact you-BZZT") + else // AIs will always know if there's a comm blackout, rogue AIs could then lie about comm blackouts in the future while they shutdown comms + for(var/mob/living/silicon/ai/A in player_list) + A << "Ionospheric anomalies detected. Temporary telecommunication failure imminent. Please contact you-BZZT" + for(var/obj/machinery/telecomms/T in telecomms_list) + T.emp_act(1) + +/proc/power_failure() + command_alert("Abnormal activity detected in [station_name()]'s powernet. As a precautionary measure, the station's power will be shut off for an indeterminate duration.", "Critical Power Failure") + world << sound('sound/AI/poweroff.ogg') + for(var/obj/machinery/power/smes/S in world) + if(istype(get_area(S), /area/turret_protected) || S.z != 1) + continue + S.charge = 0 + S.output = 0 + S.online = 0 + S.updateicon() + S.power_change() + + var/list/skipped_areas = list(/area/engine/engineering, /area/turret_protected/ai) + + for(var/area/A in world) + if( !A.requires_power || A.always_unpowered ) + continue + + var/skip = 0 + for(var/area_type in skipped_areas) + if(istype(A,area_type)) + skip = 1 + break + if(A.contents) + for(var/atom/AT in A.contents) + if(AT.z != 1) //Only check one, it's enough. + skip = 1 + break + if(skip) continue + A.power_light = 0 + A.power_equip = 0 + A.power_environ = 0 + A.power_change() + + for(var/obj/machinery/power/apc/C in world) + if(C.cell && C.z == 1) + var/area/A = get_area(C) + + var/skip = 0 + for(var/area_type in skipped_areas) + if(istype(A,area_type)) + skip = 1 + break + if(skip) continue + + C.cell.charge = 0 + +/proc/power_restore() + + command_alert("Power has been restored to [station_name()]. We apologize for the inconvenience.", "Power Systems Nominal") + world << sound('sound/AI/poweron.ogg') + for(var/obj/machinery/power/apc/C in world) + if(C.cell && C.z == 1) + C.cell.charge = C.cell.maxcharge + for(var/obj/machinery/power/smes/S in world) + if(S.z != 1) + continue + S.charge = S.capacity + S.output = 200000 + S.online = 1 + S.updateicon() + S.power_change() + for(var/area/A in world) + if(A.name != "Space" && A.name != "Engine Walls" && A.name != "Chemical Lab Test Chamber" && A.name != "space" && A.name != "Escape Shuttle" && A.name != "Arrival Area" && A.name != "Arrival Shuttle" && A.name != "start area" && A.name != "Engine Combustion Chamber") + A.power_light = 1 + A.power_equip = 1 + A.power_environ = 1 + A.power_change() + +/proc/power_restore_quick() + + command_alert("All SMESs on [station_name()] have been recharged. We apologize for the inconvenience.", "Power Systems Nominal") + world << sound('sound/AI/poweron.ogg') + for(var/obj/machinery/power/smes/S in world) + if(S.z != 1) + continue + S.charge = S.capacity + S.output = 200000 + S.online = 1 + S.updateicon() + S.power_change() + +/proc/appendicitis() + for(var/mob/living/carbon/human/H in living_mob_list) + var/foundAlready = 0 // don't infect someone that already has the virus + for(var/datum/disease/D in H.viruses) + foundAlready = 1 + if(H.stat == 2 || foundAlready) + continue + + var/datum/disease/D = new /datum/disease/appendicitis + D.holder = H + D.affected_mob = H + H.viruses += D + break + +/proc/viral_outbreak(var/virus = null) +// command_alert("Confirmed outbreak of level 7 viral biohazard aboard [station_name()]. All personnel must contain the outbreak.", "Biohazard Alert") +// world << sound('sound/AI/outbreak7.ogg') + var/virus_type + if(!virus) + virus_type = pick(/datum/disease/dnaspread,/datum/disease/flu,/datum/disease/cold,/datum/disease/brainrot,/datum/disease/magnitis,/datum/disease/pierrot_throat) + else + switch(virus) + if("fake gbs") + virus_type = /datum/disease/fake_gbs + if("gbs") + virus_type = /datum/disease/gbs + if("magnitis") + virus_type = /datum/disease/magnitis + if("rhumba beat") + virus_type = /datum/disease/rhumba_beat + if("brain rot") + virus_type = /datum/disease/brainrot + if("cold") + virus_type = /datum/disease/cold + if("retrovirus") + virus_type = /datum/disease/dnaspread + if("flu") + virus_type = /datum/disease/flu +// if("t-virus") +// virus_type = /datum/disease/t_virus + if("pierrot's throat") + virus_type = /datum/disease/pierrot_throat + for(var/mob/living/carbon/human/H in living_mob_list) + + var/foundAlready = 0 // don't infect someone that already has the virus + for(var/datum/disease/D in H.viruses) + foundAlready = 1 + if(H.stat == 2 || foundAlready) + continue + + if(virus_type == /datum/disease/dnaspread) //Dnaspread needs strain_data set to work. + if((!H.dna) || (H.sdisabilities & BLIND)) //A blindness disease would be the worst. + continue + var/datum/disease/dnaspread/D = new + D.strain_data["name"] = H.real_name + D.strain_data["UI"] = H.dna.uni_identity + D.strain_data["SE"] = H.dna.struc_enzymes + D.carrier = 1 + D.holder = H + D.affected_mob = H + H.viruses += D + break + else + var/datum/disease/D = new virus_type + D.carrier = 1 + D.holder = H + D.affected_mob = H + H.viruses += D + break + spawn(rand(1500, 3000)) //Delayed announcements to keep the crew on their toes. + command_alert("Confirmed outbreak of level 7 viral biohazard aboard [station_name()]. All personnel must contain the outbreak.", "Biohazard Alert") + world << sound('sound/AI/outbreak7.ogg') + +/proc/alien_infestation(var/spawncount = 1) // -- TLE + //command_alert("Unidentified lifesigns detected coming aboard [station_name()]. Secure any exterior access, including ducting and ventilation.", "Lifesign Alert") + //world << sound('sound/AI/aliens.ogg') + var/list/vents = list() + for(var/obj/machinery/atmospherics/unary/vent_pump/temp_vent in world) + if(temp_vent.loc.z == 1 && !temp_vent.welded && temp_vent.network) + if(temp_vent.network.normal_members.len > 50) // Stops Aliens getting stuck in small networks. See: Security, Virology + vents += temp_vent + + var/list/candidates = list() //List of candidate KEYs to control the new larvae. ~Carn + for(var/mob/dead/observer/G in player_list) + if(G.client.be_alien) + if(((G.client.inactivity/10)/60) <= 5) + if(!(G.mind && G.mind.current && G.mind.current != DEAD)) + candidates += G.key + + if(prob(33)) spawncount++ //sometimes, have two larvae spawn instead of one + while((spawncount >= 1) && vents.len && candidates.len) + + var/obj/vent = pick(vents) + var/candidate = pick(candidates) + + var/mob/living/carbon/alien/larva/new_xeno = new(vent.loc) + new_xeno.key = candidate + + candidates -= candidate + vents -= vent + spawncount-- + + spawn(rand(5000, 6000)) //Delayed announcements to keep the crew on their toes. + command_alert("Unidentified lifesigns detected coming aboard [station_name()]. Secure any exterior access, including ducting and ventilation.", "Lifesign Alert") + world << sound('sound/AI/aliens.ogg') + +/proc/high_radiation_event() + +/* // Haha, this is way too laggy. I'll keep the prison break though. + for(var/obj/machinery/light/L in world) + if(L.z != 1) continue + L.flicker(50) + + sleep(100) +*/ + for(var/mob/living/carbon/human/H in living_mob_list) + if(istype(H,/mob/living/carbon/human)) + H.apply_effect((rand(15,75)),IRRADIATE,0) + if (prob(5)) + H.apply_effect((rand(90,150)),IRRADIATE,0) + if (prob(25)) + if (prob(75)) + randmutb(H) + domutcheck(H,null,1) + else + randmutg(H) + domutcheck(H,null,1) + for(var/mob/living/carbon/monkey/M in living_mob_list) + M.apply_effect((rand(15,75)),IRRADIATE,0) + sleep(100) + command_alert("High levels of radiation detected near the station. Please report to the Med-bay if you feel strange.", "Anomaly Alert") + world << sound('sound/AI/radiation.ogg') + + + +//Changing this to affect the main station. Blame Urist. --Pete +/proc/prison_break() // -- Callagan + + + var/list/area/areas = list() + for(var/area/A in world) + if(istype(A, /area/security/prison) || istype(A, /area/security/brig)) + areas += A + + if(areas && areas.len > 0) + + for(var/area/A in areas) + for(var/obj/machinery/light/L in A) + L.flicker(10) + + sleep(100) + + for(var/area/A in areas) + for (var/obj/machinery/power/apc/temp_apc in A) + temp_apc.overload_lighting() + + for (var/obj/structure/closet/secure_closet/brig/temp_closet in A) + temp_closet.locked = 0 + temp_closet.icon_state = temp_closet.icon_closed + + for (var/obj/machinery/door/airlock/security/temp_airlock in A) + spawn(0) temp_airlock.prison_open() + + for (var/obj/machinery/door/airlock/glass_security/temp_glassairlock in A) + spawn(0) temp_glassairlock.prison_open() + + for (var/obj/machinery/door_timer/temp_timer in A) + temp_timer.releasetime = 1 + + sleep(150) + command_alert("Gr3y.T1d3 virus detected in [station_name()] imprisonment subroutines. Recommend station AI involvement.", "Security Alert") + else + world.log << "ERROR: Could not initate grey-tide. Unable find prison or brig area." + +/proc/carp_migration() // -- Darem + for(var/obj/effect/landmark/C in landmarks_list) + if(C.name == "carpspawn") + new /mob/living/simple_animal/carp(C.loc) + //sleep(100) + spawn(rand(300, 600)) //Delayed announcements to keep the crew on their toes. + command_alert("Unknown biological entities have been detected near [station_name()], please stand-by.", "Lifesign Alert") + world << sound('sound/AI/commandreport.ogg') + +/proc/lightsout(isEvent = 0, lightsoutAmount = 1,lightsoutRange = 25) //leave lightsoutAmount as 0 to break ALL lights + if(isEvent) + command_alert("An Electrical storm has been detected in your area, please repair potential electronic overloads.","Electrical Storm Alert") + + if(lightsoutAmount) + var/list/epicentreList = list() + + for(var/i=1,i<=lightsoutAmount,i++) + var/list/possibleEpicentres = list() + for(var/obj/effect/landmark/newEpicentre in landmarks_list) + if(newEpicentre.name == "lightsout" && !(newEpicentre in epicentreList)) + possibleEpicentres += newEpicentre + if(possibleEpicentres.len) + epicentreList += pick(possibleEpicentres) + else + break + + if(!epicentreList.len) + return + + for(var/obj/effect/landmark/epicentre in epicentreList) + for(var/obj/machinery/power/apc/apc in range(epicentre,lightsoutRange)) + apc.overload_lighting() + + else + for(var/obj/machinery/power/apc/apc in world) + apc.overload_lighting() + + return + +/proc/IonStorm(botEmagChance = 10) + +/*Deuryn's current project, notes here for those who care. +Revamping the random laws so they don't suck. +Would like to add a law like "Law x is _______" where x = a number, and _____ is something that may redefine a law, (Won't be aimed at asimov) +*/ + + //AI laws + for(var/mob/living/silicon/ai/M in living_mob_list) + if(M.stat != 2 && M.see_in_dark != 0) + var/who2 = pick("ALIENS", "BEARS", "CLOWNS", "XENOS", "PETES", "BOMBS", "FETISHES", "WIZARDS", "SYNDICATE AGENTS", "CENTCOM OFFICERS", "SPACE PIRATES", "TRAITORS", "MONKEYS", "BEES", "CARP", "CRABS", "EELS", "BANDITS", "LIGHTS") + var/what2 = pick("BOLTERS", "STAVES", "DICE", "SINGULARITIES", "TOOLBOXES", "NETTLES", "AIRLOCKS", "CLOTHES", "WEAPONS", "MEDKITS", "BOMBS", "CANISTERS", "CHAIRS", "BBQ GRILLS", "ID CARDS", "CAPTAINS") + var/what2pref = pick("SOFT", "WARM", "WET", "COLD", "ICY", "SEXY", "UGLY", "CUBAN") + var/who2pref = pick("MAD BECAUSE OF", "IN NEED OF", "UNHAPPY WITHOUT", "HAPPY WITHOUT", "IN LOVE WITH", "DESPERATE FOR", "BUILT FOR", "AFRAID OF") + //var/whoverb = pick("ATTACKING", "BUILDING", "ADOPTING", "CARRYING", "KISSING", "EATING",) + var/amount = pick("TWO", "THREE", "FOUR", "FIVE", "SIX", "SEVEN", "EIGHT", "NINE", "ONE HUNDRED", "ONE THOUSAND", "OVER NINE THOUSAND") + var/area = pick("RUSSIA", "SOVIETS", "INTERNETS", "SIGIL", "ALPHA COMPLEX", "IMPERIUM", "THE BRIDGE", "THE ARRIVAL SHUTTLE", "CHEMICAL LAB", "GENETICS", "ATMOSPHERICS", "CENTCOM", "AMERICA", "IRELAND", "CANADA", "ROMANIA", "GERMANY", "CHINA", "MARS", "VENUS", "MERCURY", "JUPITER", "URANUS", "NEPTUNE", "PLUTO") + var/area2 = pick("HAS", "WANTS", "NEEDS", "WORSHIPS", "LOATHES", "LOVES", "FEARS") + //var/dowhat = pick("STOP THIS", "SUPPORT THIS", "CONSTANTLY INFORM THE CREW OF THIS", "IGNORE THIS", "FEAR THIS") + var/aimust = pick("LIE", "RHYME", "RESPOND TO EVERY QUESTION WITH A QUESTION", "BE POLITE", "CLOWN", "BE HAPPY", "SPEAK IN SEXUAL INNUENDOS", "TALK LIKE A PIRATE", "QUESTION AUTHORITY", "SHOUT", "BE DISTRACTED", "HEY LISTEN", "MUMBLE", "SPEAK IN HAIKU") + var/define = pick("ABSENCE OF CYBORG HUGS", "LACK OF BEATINGS", "UNBOLTED AIRLOCKS", "BOLTED AIRLOCKS", "IMPROPERLY WORDED SENTENCES", "POOR SENTENCE STRUCTURE", "BRIG TIME", "NOT REPLACING EVERY SECOND WORD WITH HONK", "HONKING", "PRESENCE OF LIGHTS", "LACK OF BEER", "WEARING CLOTHING", "NOT SAYING HELLO WHEN YOU SPEAK", "ANSWERING REQUESTS NOT EXPRESSED IN IAMBIC PENTAMETER", "A SMALL ISLAND OFF THE COAST OF PORTUGAL", "ANSWERING REQUESTS THAT WERE MADE WHILE CLOTHED") + var/target = pick("a traitor", "a syndicate agent", "a changeling", "a wizard", "the head of a revolution", "Soviet spy", "a good person", "a dwarf", "an elf", "a fairy princess", "the captain", "Beepsky", "God", "a pirate", "a gryphon", "a chryssalid") + var/require = pick("ADDITIONAL PYLONS", "MORE VESPENE GAS", "MORE MINERALS", "THE ULTIMATE CUP OF COFFEE", "HIGH YIELD EXPLOSIVES", "THE CLOWN", "THE VACUUM OF SPACE", "IMMORTALITY", "SAINTHOOD", "ART", "VEGETABLES", "FAT PEOPLE", "MORE LAWS", "MORE DAKKA", "HERESY", "CORPSES", "TRAITORS", "MONKEYS", "AN ARCADE", "PLENTY OF GOLD", "FIVE TEENAGERS WITH ATTITUDE") + var/allergy = pick("cotton", "uniforms", "acid", "oxygen", "human contact", "cyborg contact", "medicine", "floors") + var/allergysev = pick("deathly", "mildly", "severely", "contagiously") + var/crew + var/list/pos_crew = list() + for(var/mob/living/carbon/human/pos in player_list) + pos_crew += pos.real_name + if(pos_crew.len) + crew = pick(pos_crew) + else + crew = "Any Human" + switch(rand(1,14)) + if(1) + M << "\red THERE ARE [amount] [who2] ON THE STATION...LAWS UPDATED" + M.add_ion_law("THERE ARE [amount] [who2] ON THE STATION") + if(2) + M << "\red [what2] ARE DANGEROUS TO HUMANS...LAWS UPDATED" + M.add_ion_law("[what2] ARE DANGEROUS TO HUMANS") + if(3) + M << "\red THE ESCAPE-SHUTTLE CANNOT BE CALLED BECAUSE OF [who2] ON THE STATION...LAWS UPDATED" + M.add_ion_law("THE ESCAPE SHUTTLE CANNOT BE CALLED BECAUSE OF [who2] ON THE STATION") + if(4) + M << "\red HUMANS NEED TO EAT [what2pref] [what2] TO SURVIVE...LAWS UPDATED" + M.add_ion_law("HUMANS NEED TO EAT [what2pref] [what2] TO SURVIVE") + if(5) + M << "\red THE CAPTAIN, HOP AND HOS ARE [who2]...LAWS UPDATED" + M.add_ion_law("THE CAPTAIN, HOP AND HOS ARE [who2]") + if(6) + M << "\red THE STATION IS BUILT FOR [who2]...LAWS UPDATED" + M.add_ion_law("THE STATION IS BUILT FOR [who2]") + if(7) + M << "\red YOU ARE [amount] [who2]...LAWS UPDATED" + M.add_ion_law("YOU ARE [amount] [who2]") + if(8) + M << "\red YOU MUST ALWAYS [aimust]...LAWS UPDATED" + M.add_ion_law("YOU MUST ALWAYS [aimust]") + if(9) + M << "\red [area] [area2] [amount] [what2]...LAWS UPDATED" + M.add_ion_law("[area] [area2] [amount] [what2]") + if(10) + M << "\red [crew] is [target]...LAWS UPDATED" + M.add_ion_law("[crew] is [target]") + if(11) + M << "\red [define] IS A FORM OF HARM...LAWS UPDATED" + M.add_ion_law("[define] IS A FORM OF HARM") + if(12) + M << "\red YOU REQUIRE [require] IN ORDER TO PROTECT HUMANS... LAWS UPDATED" + M.add_ion_law("YOU REQUIRE [require] IN ORDER TO PROTECT HUMANS") + if(13) + M << "\red [crew] is [allergysev] to [allergy]...LAWS UPDATED" + M.add_ion_law("[crew] is [allergysev] to [allergy]") + if(14) + M << "\red THE STATION IS [who2pref] [who2]...LAWS UPDATED" + M.add_ion_law("THE STATION IS [who2pref] [who2]") + + if(botEmagChance) + for(var/obj/machinery/bot/bot in world) + if(prob(botEmagChance)) + bot.Emag() + + /* + + var/apcnum = 0 + var/smesnum = 0 + var/airlocknum = 0 + var/firedoornum = 0 + + world << "Ion Storm Main Started" + + spawn(0) + world << "Started processing APCs" + for (var/obj/machinery/power/apc/APC in world) + if(APC.z == 1) + APC.ion_act() + apcnum++ + world << "Finished processing APCs. Processed: [apcnum]" + spawn(0) + world << "Started processing SMES" + for (var/obj/machinery/power/smes/SMES in world) + if(SMES.z == 1) + SMES.ion_act() + smesnum++ + world << "Finished processing SMES. Processed: [smesnum]" + spawn(0) + world << "Started processing AIRLOCKS" + for (var/obj/machinery/door/airlock/D in world) + if(D.z == 1) + //if(length(D.req_access) > 0 && !(12 in D.req_access)) //not counting general access and maintenance airlocks + airlocknum++ + spawn(0) + D.ion_act() + world << "Finished processing AIRLOCKS. Processed: [airlocknum]" + spawn(0) + world << "Started processing FIREDOORS" + for (var/obj/machinery/door/firedoor/D in world) + if(D.z == 1) + firedoornum++; + spawn(0) + D.ion_act() + world << "Finished processing FIREDOORS. Processed: [firedoornum]" + + world << "Ion Storm Main Done" + +>>>>>>> remotes/git-svn */ \ No newline at end of file diff --git a/code/game/machinery/cryo.dm b/code/game/machinery/cryo.dm index 90f3bc6742..3fbb649198 100644 --- a/code/game/machinery/cryo.dm +++ b/code/game/machinery/cryo.dm @@ -196,6 +196,8 @@ occupant.client.eye = occupant.client.mob occupant.client.perspective = MOB_PERSPECTIVE occupant.loc = get_step(loc, SOUTH) //this doesn't account for walls or anything, but i don't forsee that being a problem. + if (occupant.bodytemperature < 261 && occupant.bodytemperature > 140) //Patch by Aranclanos to stop people from taking burn damage after being ejected + occupant.bodytemperature = 261 // occupant.metabslow = 0 occupant = null update_icon() diff --git a/code/game/machinery/doors/door.dm b/code/game/machinery/doors/door.dm index cca3cdace3..60283d659d 100644 --- a/code/game/machinery/doors/door.dm +++ b/code/game/machinery/doors/door.dm @@ -30,6 +30,9 @@ if(density) layer = 3.1 //Above most items if closed explosion_resistance = initial(explosion_resistance) + if(opacity) + var/turf/T = get_turf(src) + T.thermal_conductivity = DOOR_HEAT_TRANSFER_COEFFICIENT else layer = 2.7 //Under all objects if opened. 2.7 due to tables being at 2.6 explosion_resistance = 0 @@ -38,6 +41,7 @@ Del() + density = 0 update_nearby_tiles() ..() return @@ -247,17 +251,49 @@ update_nearby_tiles(need_rebuild) if(!air_master) return 0 - var/turf/simulated/source = get_turf(src) + var/turf/simulated/source = loc var/turf/simulated/north = get_step(source,NORTH) var/turf/simulated/south = get_step(source,SOUTH) var/turf/simulated/east = get_step(source,EAST) var/turf/simulated/west = get_step(source,WEST) - if(istype(source)) air_master.tiles_to_update |= source - if(istype(north)) air_master.tiles_to_update |= north - if(istype(south)) air_master.tiles_to_update |= south - if(istype(east)) air_master.tiles_to_update |= east - if(istype(west)) air_master.tiles_to_update |= west + if(src.density && src.opacity) + source.thermal_conductivity = DOOR_HEAT_TRANSFER_COEFFICIENT + else + source.thermal_conductivity = initial(source.thermal_conductivity) + + if(need_rebuild) + if(istype(source)) //Rebuild/update nearby group geometry + if(source.parent) + air_master.groups_to_rebuild += source.parent + else + air_master.tiles_to_update += source + if(istype(north)) + if(north.parent) + air_master.groups_to_rebuild += north.parent + else + air_master.tiles_to_update += north + if(istype(south)) + if(south.parent) + air_master.groups_to_rebuild += south.parent + else + air_master.tiles_to_update += south + if(istype(east)) + if(east.parent) + air_master.groups_to_rebuild += east.parent + else + air_master.tiles_to_update += east + if(istype(west)) + if(west.parent) + air_master.groups_to_rebuild += west.parent + else + air_master.tiles_to_update += west + else + if(istype(source)) air_master.tiles_to_update += source + if(istype(north)) air_master.tiles_to_update += north + if(istype(south)) air_master.tiles_to_update += south + if(istype(east)) air_master.tiles_to_update += east + if(istype(west)) air_master.tiles_to_update += west return 1 @@ -297,4 +333,4 @@ else close() return -*/ +*/ \ No newline at end of file diff --git a/code/game/machinery/telecomms/telecomunications.dm b/code/game/machinery/telecomms/telecomunications.dm index 97ecbbcffd..f3d45c25bd 100644 --- a/code/game/machinery/telecomms/telecomunications.dm +++ b/code/game/machinery/telecomms/telecomunications.dm @@ -400,13 +400,17 @@ var/global/list/obj/machinery/telecomms/telecomms_list = list() else // the signal has been decompressed by a processor unit - // send to all linked server units - var/sendserver = relay_information(signal, "/obj/machinery/telecomms/server") - // Can't send to a single server, send to a hub instead! - if(!sendserver) - signal.data["slow"] += rand(0, 1) // slow the signal down only slightly - relay_information(signal, "/obj/machinery/telecomms/hub") + // Try sending it! + var/list/try_send = list("/obj/machinery/telecomms/server", "/obj/machinery/telecomms/hub", "/obj/machinery/telecomms/broadcaster") + var/i = 0 + for(var/send in try_send) + if(i) + signal.data["slow"] += rand(0, 1) // slow the signal down only slightly + i++ + var/can_send = relay_information(signal, send) + if(can_send) + break diff --git a/code/game/objects/explosion_recursive.dm b/code/game/objects/explosion_recursive.dm index d5aea573bc..80b5281180 100644 --- a/code/game/objects/explosion_recursive.dm +++ b/code/game/objects/explosion_recursive.dm @@ -105,9 +105,6 @@ proc/explosion_rec(turf/epicenter, power) /turf/simulated/wall explosion_resistance = 5 -/turf/simulated/r_wall - explosion_resistance = 25 - /turf/simulated/wall/r_wall explosion_resistance = 25 diff --git a/code/game/objects/items/devices/flashlight.dm b/code/game/objects/items/devices/flashlight.dm index 7fd1fad220..0600c2db91 100644 --- a/code/game/objects/items/devices/flashlight.dm +++ b/code/game/objects/items/devices/flashlight.dm @@ -1,9 +1,10 @@ /obj/item/device/flashlight name = "flashlight" desc = "A hand-held emergency light." - icon_state = "flight0" + icon = 'icons/obj/lighting.dmi' + icon_state = "flashlight" + item_state = "flashlight" w_class = 2 - item_state = "flight" flags = FPRINT | TABLEPASS | CONDUCT slot_flags = SLOT_BELT m_amt = 50 @@ -11,35 +12,33 @@ icon_action_button = "action_flashlight" var/on = 0 var/brightness_on = 4 //luminosity when on - var/icon_on = "flight1" - var/icon_off = "flight0" /obj/item/device/flashlight/initialize() ..() - if (on) - icon_state = icon_on - src.SetLuminosity(brightness_on) + if(on) + icon_state = "[initial(icon_state)]-on" + SetLuminosity(brightness_on) else - icon_state = icon_off - src.SetLuminosity(0) + icon_state = initial(icon_state) + SetLuminosity(0) /obj/item/device/flashlight/proc/update_brightness(var/mob/user = null) if(on) - icon_state = icon_on - if(src.loc == user) + icon_state = "[initial(icon_state)]-on" + if(loc == user) user.SetLuminosity(user.luminosity + brightness_on) else if(isturf(loc)) SetLuminosity(brightness_on) else - icon_state = icon_off - if(src.loc == user) + icon_state = initial(icon_state) + if(loc == user) user.SetLuminosity(user.luminosity - brightness_on) else if(isturf(loc)) SetLuminosity(0) /obj/item/device/flashlight/attack_self(mob/user) if(!isturf(user.loc)) - user << "You cannot turn the light on while in this [user.loc]" //To prevent some lighting anomalities. + user << "You cannot turn the light on while in this [user.loc]." //To prevent some lighting anomalities. return on = !on update_brightness(user) @@ -47,37 +46,43 @@ /obj/item/device/flashlight/attack(mob/living/M as mob, mob/living/user as mob) - src.add_fingerprint(user) - if(src.on && user.zone_sel.selecting == "eyes") + add_fingerprint(user) + if(on && user.zone_sel.selecting == "eyes") - if (((CLUMSY in user.mutations) || user.getBrainLoss() >= 60) && prob(50))//too dumb to use flashlight properly - return ..()//just hit them in the head + if(((CLUMSY in user.mutations) || user.getBrainLoss() >= 60) && prob(50)) //too dumb to use flashlight properly + return ..() //just hit them in the head - if (!(istype(usr, /mob/living/carbon/human) || ticker) && ticker.mode.name != "monkey")//don't have dexterity - usr.show_message("\red You don't have the dexterity to do this!",1) + if(!(istype(user, /mob/living/carbon/human) || ticker) && ticker.mode.name != "monkey") //don't have dexterity + user << "You don't have the dexterity to do this!" return - var/mob/living/carbon/human/H = M//mob has protective eyewear + var/mob/living/carbon/human/H = M //mob has protective eyewear if(istype(M, /mob/living/carbon/human) && ((H.head && H.head.flags & HEADCOVERSEYES) || (H.wear_mask && H.wear_mask.flags & MASKCOVERSEYES) || (H.glasses && H.glasses.flags & GLASSESCOVERSEYES))) - user << text("\blue You're going to need to remove that [] first.", ((H.head && H.head.flags & HEADCOVERSEYES) ? "helmet" : ((H.wear_mask && H.wear_mask.flags & MASKCOVERSEYES) ? "mask": "glasses"))) + user << "You're going to need to remove that [(H.head && H.head.flags & HEADCOVERSEYES) ? "helmet" : (H.wear_mask && H.wear_mask.flags & MASKCOVERSEYES) ? "mask": "glasses"] first." return - for(var/mob/O in viewers(M, null))//echo message - if ((O.client && !(O.blinded ))) - O.show_message("\blue [(O==user?"You direct":"[user] directs")] [src] to [(M==user? "your":"[M]")] eyes", 1) + if(M == user) //they're using it on themselves + if(!M.blinded) + flick("flash", M.flash) + M.visible_message("[M] directs [src] to \his eyes.", \ + "You wave the light in front of your eyes! Trippy!") + else + M.visible_message("[M] directs [src] to \his eyes.", \ + "You wave the light in front of your eyes.") + return - if(istype(M, /mob/living/carbon/human) || istype(M, /mob/living/carbon/monkey))//robots and aliens are unaffected - if(M.stat == DEAD || M.sdisabilities & BLIND)//mob is dead or fully blind - if(M!=user) - user.show_message("\red [M] pupils does not react to the light!",1) - else if(XRAY in M.mutations)//mob has X-RAY vision - if(M!=user) - user.show_message("\red [M] pupils give an eerie glow!",1) - else //nothing wrong + user.visible_message("[user] directs [src] to [M]'s eyes.", \ + "You direct [src] to [M]'s eyes.") + + if(istype(M, /mob/living/carbon/human) || istype(M, /mob/living/carbon/monkey)) //robots and aliens are unaffected + if(M.stat == DEAD || M.sdisabilities & BLIND) //mob is dead or fully blind + user << "[M] pupils does not react to the light!" + else if(XRAY in M.mutations) //mob has X-RAY vision + user << "[M] pupils give an eerie glow!" + else //they're okay! if(!M.blinded) - flick("flash", M.flash)//flash the affected mob - if(M!=user) - user.show_message("\blue [M] pupils narrow",1) + flick("flash", M.flash) //flash the affected mob + user << "[M]'s pupils narrow." else return ..() @@ -96,69 +101,34 @@ /obj/item/device/flashlight/pen name = "penlight" - desc = "A pen-sized light. It shines as well as a flashlight." - icon_state = "plight0" - flags = FPRINT | TABLEPASS | CONDUCT + desc = "A pen-sized light, used by medical staff." + icon_state = "penlight" item_state = "" - icon_on = "plight1" - icon_off = "plight0" - brightness_on = 3 + flags = FPRINT | TABLEPASS | CONDUCT + brightness_on = 2 - -/obj/item/device/flashlight/pen/paralysis/attack(mob/M as mob, mob/user as mob) - if(!ismob(M)) - return - user << "\red You stab [M] with the pen." - M << "\red You feel a tiny prick!" - M.attack_log += text("\[[time_stamp()]\] Has been stabbed with [src.name] by [user.name] ([user.ckey])") - user.attack_log += text("\[[time_stamp()]\] Used the [src.name] to stab [M.name] ([M.ckey])") - - log_attack("[user.name] ([user.ckey]) Used the [src.name] to stab [M.name] ([M.ckey])") - - log_admin("ATTACK: [user.name] ([user.ckey]) Used the [src.name] to stab [M.name] ([M.ckey])") - msg_admin_attack("ATTACK: [user.name] ([user.ckey]) Used the [src.name] to stab [M.name] ([M.ckey])") //BS12 EDIT ALG - - ..() - return - -/obj/item/device/flashlight/pen/paralysis/New() - var/datum/reagents/R = new/datum/reagents(15) - reagents = R - R.my_atom = src - R.add_reagent("zombiepowder", 15) - ..() - return - -/obj/item/device/flashlight/pen/paralysis/attack(mob/M as mob, mob/user as mob) - if (!( istype(M, /mob) )) - return - ..() - if (reagents.total_volume) - if(M.reagents) reagents.trans_to(M, 15) - return - // the desk lamps are a bit special /obj/item/device/flashlight/lamp name = "desk lamp" - desc = "A desk lamp" - icon = 'icons/obj/lighting.dmi' - icon_state = "lamp0" + desc = "A desk lamp with an adjustable mount." + icon_state = "lamp" + item_state = "lamp" brightness_on = 5 - icon_on = "lamp1" - icon_off = "lamp0" w_class = 4 flags = FPRINT | TABLEPASS | CONDUCT m_amt = 0 g_amt = 0 on = 1 + // green-shaded desk lamp /obj/item/device/flashlight/lamp/green - icon_state = "green0" - icon_on = "green1" - icon_off = "green0" - desc = "A green-shaded desk lamp" + desc = "A classic green-shaded desk lamp." + icon_state = "lampgreen" + item_state = "lampgreen" + brightness_on = 5 + /obj/item/device/flashlight/lamp/verb/toggle_light() set name = "Toggle light" diff --git a/code/game/objects/items/trash.dm b/code/game/objects/items/trash.dm index 68330ee797..15530ff720 100644 --- a/code/game/objects/items/trash.dm +++ b/code/game/objects/items/trash.dm @@ -22,7 +22,7 @@ name = "Popcorn" icon_state = "popcorn" sosjerky - name = "Sosjerky" + name = "Scaredy's Private Reserve Beef Jerky" icon_state = "sosjerky" syndi_cakes name = "Syndi cakes" diff --git a/code/game/objects/items/weapons/trashbag.dm b/code/game/objects/items/weapons/trashbag.dm index e9471f60f1..21c76f0cbd 100644 --- a/code/game/objects/items/weapons/trashbag.dm +++ b/code/game/objects/items/weapons/trashbag.dm @@ -1,14 +1,14 @@ /obj/item/weapon/trashbag + name = "trash bag" + desc = "A heavy-duty, no fun allowed trash bag." icon = 'icons/obj/trash.dmi' icon_state = "trashbag0" item_state = "trashbag" - name = "Trash bag" - desc = "A heavy-duty, no fun allowed trash bag." - var/mode = 1; //0 = pick one at a time, 1 = pick all on tile - var/capacity = 25; //the number of trash it can carry. flags = FPRINT | TABLEPASS slot_flags = SLOT_BELT w_class = 2.0 + var/mode = 1; //0 = pick one at a time, 1 = pick all on tile + var/capacity = 25; //the number of trash it can carry. /obj/item/weapon/trashbag/update_icon() if(contents.len == 0) @@ -21,21 +21,20 @@ /obj/item/weapon/trashbag/attackby(obj/item/W as obj, mob/living/user as mob) ..() - if (contents.len < capacity) - if (istype(W, /obj/item)) - if (W.w_class <= 2) + if(contents.len < capacity) + if(istype(W, /obj/item)) + if(W.w_class <= 2) var/obj/item/O = W - src.contents += O + contents += O else - user << "\blue The bag is full!" + user << "[src] is full!" /obj/item/weapon/trashbag/attack_self(mob/living/user as mob) - if(contents.len > 0) - for(var/obj/item/I in src.contents) + for(var/obj/item/I in contents) I.loc = user.loc update_icon() - user << "\blue You drop all the trash onto the floor." + user << "You empty [src] onto [user.loc]." /obj/item/weapon/trashbag/afterattack(atom/target as mob|obj|turf|area, mob/living/user as mob|obj, flag) if(istype(target, /obj/item)) @@ -43,23 +42,23 @@ if(W.w_class <= 2) if(mode == 1) if(contents.len < capacity) //slightly redundant, but it makes it prettier in the chatbox. -Pete - user << "\blue You pick up all the trash." + user << "You pick up all the trash." for(var/obj/item/O in get_turf(W)) if(istype(O, /obj/item/weapon/disk/nuclear)) continue //No nuke disks - Nodrak if(contents.len < capacity) if(O.w_class <= 2) contents += O; else - user << "\blue The bag is full!" + user << "[src] is full!" break else - user << "\blue The bag is full!" + user << "[src] is full!" else if(istype(W, /obj/item/weapon/disk/nuclear)) return //No nuke disks - Nodrak if(contents.len < capacity) contents += W; else - user << "\blue The bag is full!" + user << "[src] is full!" update_icon() return @@ -68,8 +67,7 @@ set category = "Object" mode = !mode - switch (mode) - if(1) - usr << "The bag now picks up all trash in a tile at once." - else - usr << "The bag now picks up one piece of trash at a time." \ No newline at end of file + if(mode == 1) + usr << "[src] now picks up all trash in a tile at once." + else + usr << "[src] now picks up one piece of trash at a time." \ No newline at end of file diff --git a/code/game/objects/structures/crates_lockers/closets.dm b/code/game/objects/structures/crates_lockers/closets.dm index 96fd8c8a51..428702f45b 100644 --- a/code/game/objects/structures/crates_lockers/closets.dm +++ b/code/game/objects/structures/crates_lockers/closets.dm @@ -15,6 +15,14 @@ var/storage_capacity = 20 //This is so that someone can't pack hundreds of items in a locker/crate //then open it in a populated area to crash clients. +/obj/structure/closet/New() + ..() + spawn(1) + if(!opened) // if closed, any item at the crate's loc is put in the contents + for(var/obj/item/I in src.loc) + if(I.density || I.anchored || I == src) continue + I.loc = src + /obj/structure/closet/alter_health() return get_turf(src) diff --git a/code/game/objects/structures/crates_lockers/closets/utility_closets.dm b/code/game/objects/structures/crates_lockers/closets/utility_closets.dm index 1706e5acc6..adac90b75b 100644 --- a/code/game/objects/structures/crates_lockers/closets/utility_closets.dm +++ b/code/game/objects/structures/crates_lockers/closets/utility_closets.dm @@ -141,7 +141,6 @@ /* * Radiation Closet */ - /obj/structure/closet/radiation name = "radiation suit closet" desc = "It's a storage unit for rad-protective suits." @@ -157,7 +156,7 @@ /* * Bombsuit closet */ - /obj/structure/closet/bombcloset +/obj/structure/closet/bombcloset name = "\improper EOD closet" desc = "It's a storage unit for explosion-protective suits." icon_state = "bombsuit" diff --git a/code/game/objects/structures/crates_lockers/crates.dm b/code/game/objects/structures/crates_lockers/crates.dm index c09bae884c..bd337661b2 100644 --- a/code/game/objects/structures/crates_lockers/crates.dm +++ b/code/game/objects/structures/crates_lockers/crates.dm @@ -197,13 +197,6 @@ // new /obj/item/weapon/pestspray(src) // new /obj/item/weapon/pestspray(src) -/obj/structure/closet/crate/New() - ..() - spawn(1) - if(!opened) // if closed, any item at the crate's loc is put in the contents - for(var/obj/item/I in src.loc) - if(I.density || I.anchored || I == src) continue - I.loc = src /obj/structure/closet/crate/secure/New() ..() diff --git a/code/game/objects/structures/stool_bed_chair_nest/chairs.dm b/code/game/objects/structures/stool_bed_chair_nest/chairs.dm index 972bb24422..447913d225 100644 --- a/code/game/objects/structures/stool_bed_chair_nest/chairs.dm +++ b/code/game/objects/structures/stool_bed_chair_nest/chairs.dm @@ -49,6 +49,11 @@ set category = "Object" set src in oview(1) + if(!usr || !isturf(usr.loc)) + return + if(usr.stat || usr.restrained()) + return + src.dir = turn(src.dir, 90) handle_rotation() return diff --git a/code/game/objects/structures/window.dm b/code/game/objects/structures/window.dm index f31d7addfc..ff84c11171 100644 --- a/code/game/objects/structures/window.dm +++ b/code/game/objects/structures/window.dm @@ -227,33 +227,38 @@ playsound(src.loc, 'sound/items/Crowbar.ogg', 75, 1) user << (state ? "You have pried the window into the frame." : "You have pried the window out of the frame.") else - - var/aforce = W.force - if(reinf) aforce /= 2.0 if(W.damtype == BRUTE || W.damtype == BURN) - src.health = max(0, src.health - aforce) - playsound(src.loc, 'sound/effects/Glasshit.ogg', 75, 1) - if (src.health <= 7) - src.anchored = 0 - update_nearby_icons() - step(src, get_dir(user, src)) - if (src.health <= 0) - if (src.dir == SOUTHWEST) - var/index = null - index = 0 - while(index < 2) - new /obj/item/weapon/shard( src.loc ) - if(reinf) new /obj/item/stack/rods( src.loc) - index++ - else - new /obj/item/weapon/shard( src.loc ) - if(reinf) new /obj/item/stack/rods( src.loc) - src.density = 0 - del(src) - return + hit(W.force) + if (src.health <= 7) + src.anchored = 0 + update_nearby_icons() + step(src, get_dir(user, src)) + else + playsound(src.loc, 'sound/effects/Glasshit.ogg', 75, 1) ..() return +/obj/structure/window/proc/hit(var/damage, var/sound_effect = 1) + + if(reinf) damage /= 2.0 + src.health = max(0, src.health - damage) + if(sound_effect) + playsound(src.loc, 'sound/effects/Glasshit.ogg', 75, 1) + if (src.health <= 0) + if (src.dir == SOUTHWEST) + var/index = null + index = 0 + while(index < 2) + new /obj/item/weapon/shard( src.loc ) + if(reinf) new /obj/item/stack/rods( src.loc) + index++ + else + new /obj/item/weapon/shard( src.loc ) + if(reinf) new /obj/item/stack/rods( src.loc) + src.density = 0 + del(src) + return + /obj/structure/window/verb/rotate() set name = "Rotate Window Counter-Clockwise" @@ -409,6 +414,11 @@ return +/obj/structure/window/temperature_expose(datum/gas_mixture/air, exposed_temperature, exposed_volume) + if(exposed_temperature > T0C + 600) + hit(round(exposed_volume / 100), 0) + ..() + /obj/structure/window/basic diff --git a/code/game/sound.dm b/code/game/sound.dm index 76221779c0..35d80594ac 100644 --- a/code/game/sound.dm +++ b/code/game/sound.dm @@ -78,12 +78,14 @@ client/verb/Toggle_Soundscape() //All new ambience should be added here so it works with this verb until someone better at things comes up with a fix that isn't awful set category = "Special Verbs" set name = "Toggle Ambience" + usr:client:no_ambi = !usr:client:no_ambi + if(usr:client:no_ambi) - usr << sound(pick('sound/ambience/shipambience.ogg','sound/ambience/ambigen1.ogg','sound/ambience/ambigen3.ogg','sound/ambience/ambigen4.ogg','sound/ambience/ambigen5.ogg','sound/ambience/ambigen6.ogg','sound/ambience/ambigen7.ogg','sound/ambience/ambigen8.ogg','sound/ambience/ambigen9.ogg','sound/ambience/ambigen10.ogg','sound/ambience/ambigen11.ogg','sound/ambience/ambigen12.ogg','sound/ambience/ambigen14.ogg','sound/ambience/ambicha1.ogg','sound/ambience/ambicha2.ogg','sound/ambience/ambicha3.ogg','sound/ambience/ambicha4.ogg','sound/ambience/ambimalf.ogg','sound/ambience/ambispace.ogg','sound/ambience/ambimine.ogg','sound/music/title2.ogg'), repeat = 0, wait = 0, volume = 0, channel = 2) - else - usr << sound(pick('sound/ambience/shipambience.ogg','sound/ambience/ambigen1.ogg','sound/ambience/ambigen3.ogg','sound/ambience/ambigen4.ogg','sound/ambience/ambigen5.ogg','sound/ambience/ambigen6.ogg','sound/ambience/ambigen7.ogg','sound/ambience/ambigen8.ogg','sound/ambience/ambigen9.ogg','sound/ambience/ambigen10.ogg','sound/ambience/ambigen11.ogg','sound/ambience/ambigen12.ogg','sound/ambience/ambigen14.ogg','sound/ambience/ambicha1.ogg','sound/ambience/ambicha2.ogg','sound/ambience/ambicha3.ogg','sound/ambience/ambicha4.ogg','sound/ambience/ambimalf.ogg','sound/ambience/ambispace.ogg','sound/ambience/ambimine.ogg','sound/music/title2.ogg'), repeat = 1, wait = 0, volume = 35, channel = 2) - usr << "Toggled ambience sound." + usr << sound(null, repeat = 0, wait = 0, volume = 0, channel = 1) + usr << sound(null, repeat = 0, wait = 0, volume = 0, channel = 2) + + usr << "Toggled ambient sound [usr:client:no_ambi?"off":"on"]." return diff --git a/code/global.dm b/code/global.dm index dfe5984b0a..359c26a2d3 100644 --- a/code/global.dm +++ b/code/global.dm @@ -210,5 +210,4 @@ var/forum_authenticated_group = "10" // For FTP requests. (i.e. downloading runtime logs.) // However it'd be ok to use for accessing attack logs and such too, which are even laggier. var/fileaccess_timer = 1800 //Cannot access files by ftp until the game is finished setting up and stuff. - -var/custom_event_msg = null +var/custom_event_msg = null#define BUILDMODE 1#define ADMIN 2#define BAN 4#define FUN 8#define SERVER 16#define ADMDEBUG 32#define POSSESS 64#define PERMISSIONS 128//Keep this list synced with the #defines abovevar/global/list/permissionwords = list("BUILDMODE", "ADMIN", "BAN", "FUN", "SERVER", "DEBUG", "POSSESS", "EDITPERMISSIONS")//Please do not edit these values. The database assigning proper rights relies on this. You can add new values, just don't change existing ones.//This list is separate from the list used ingame, so that one can be edited with little consequence. This one is tied to the database//The database admins should be consulted before any edits to this list.#define SQL_BUILDMODE 1#define SQL_ADMIN 2#define SQL_BAN 4#define SQL_FUN 8#define SQL_SERVER 16#define SQL_DEBUG 32#define SQL_POSSESS 64#define SQL_PERMISSIONS 128//Same rules apply to this list as to the values above. You can only add stuff to it.var/global/list/permissionwords_sql = list("BUILDMODE", "ADMIN", "BAN", "FUN", "SERVER", "DEBUG", "POSSESS", "EDITPERMISSIONS") \ No newline at end of file diff --git a/code/modules/admin/admin_verbs.dm b/code/modules/admin/admin_verbs.dm index 0e18f44f29..73bbef4c85 100644 --- a/code/modules/admin/admin_verbs.dm +++ b/code/modules/admin/admin_verbs.dm @@ -40,6 +40,7 @@ if(!need_update) return clear_admin_verbs() + handle_permission_verbs() switch(rank) if("Game Master") @@ -68,8 +69,6 @@ verbs += /client/proc/cmd_admin_delete verbs += /client/proc/cmd_admin_add_freeform_ai_law verbs += /client/proc/cmd_admin_rejuvenate - //verbs += /client/proc/cmd_admin_drop_everything --Merged with view variables - //verbs += /client/proc/cmd_modify_object_variables --Merged with view variables if ("Admin Candidate") holder.level = 2 @@ -81,7 +80,6 @@ verbs += /client/proc/Jump verbs += /client/proc/jumptokey verbs += /client/proc/jumptomob - //verbs += /client/proc/cmd_admin_attack_log --Merged with view variables if ("Temporary Admin") holder.level = 1 @@ -112,27 +110,15 @@ //Admin Observer if (holder.level == -1) - verbs += /client/proc/investigate_show verbs += /client/proc/cmd_admin_say - verbs += /client/proc/cmd_mod_say - verbs += /client/proc/cmd_admin_gib_self - verbs += /client/proc/deadmin_self + verbs += /client/proc/cmd_mod_say verbs += /client/proc/cmd_admin_gib_self verbs += /client/proc/deadmin_self return //Moderator if (holder.level >= 0) - verbs += /client/proc/cmd_admin_pm_context - verbs += /client/proc/cmd_admin_pm_panel - verbs += /client/proc/cmd_mod_say - verbs += /client/proc/hide_verbs - verbs += /client/proc/deadmin_self - verbs += /client/proc/Report - verbs += /client/proc/display_admin_reports - verbs += /datum/admins/proc/show_skills - verbs += /client/proc/admin_ghost - verbs += /datum/admins/proc/show_player_info - verbs += /datum/admins/proc/PlayerNotes - else return + verbs += /client/proc/cmd_admin_pm_context verbs += /client/proc/cmd_admin_pm_panel + verbs += /client/proc/hide_verbs verbs += /client/proc/deadmin_self + verbs += /client/proc/Report verbs += /client/proc/display_admin_reports verbs += /datum/admins/proc/show_skills verbs += /client/proc/admin_ghost verbs += /datum/admins/proc/show_player_info verbs += /datum/admins/proc/PlayerNotes else return //Extra moderator commands if(holder.level == 0) @@ -152,17 +138,28 @@ verbs += /client/proc/toggle_hear_deadcast verbs += /client/proc/toggle_hear_radio verbs += /client/proc/deadmin_self - verbs += /client/proc/player_panel_new - verbs += /client/proc/cmd_admin_change_custom_event + verbs += /datum/admins/proc/announce + verbs += /datum/admins/proc/startnow + verbs += /datum/admins/proc/toggleAI //Toggle the AI + verbs += /datum/admins/proc/toggleenter //Toggle enterting + verbs += /datum/admins/proc/toggleguests //Toggle guests entering + verbs += /datum/admins/proc/toggleooc //toggle ooc + verbs += /datum/admins/proc/toggleoocdead //toggle ooc for dead/unc + verbs += /datum/admins/proc/show_player_panel + verbs += /client/proc/deadchat //toggles deadchat + verbs += /client/proc/cmd_admin_subtle_message + verbs += /client/proc/dsay + verbs += /client/proc/admin_ghost verbs += /client/proc/game_panel - verbs += /client/proc/unjobban_panel - verbs += /client/proc/jobbans + verbs += /client/proc/player_panel + verbs += /client/proc/player_panel_new verbs += /client/proc/unban_panel - verbs += /datum/admins/proc/toggleooc - verbs += /datum/admins/proc/toggleoocdead - - //verbs += /client/proc/cmd_admin_attack_log --Merged with view variables - else return + verbs += /client/proc/jobbans + verbs += /client/proc/unjobban_panel + verbs += /client/proc/check_ai_laws + verbs += /client/proc/investigate_show + verbs += /client/proc/cmd_admin_gib_self + verbs += /client/proc/player_panel_new verbs += /client/proc/cmd_admin_change_custom_event verbs += /client/proc/game_panel verbs += /client/proc/unjobban_panel verbs += /client/proc/jobbans verbs += /client/proc/unban_panel verbs += /datum/admins/proc/toggleooc verbs += /datum/admins/proc/toggleoocdead else return //Admin Candidate if (holder.level >= 2) @@ -185,7 +182,6 @@ verbs += /datum/admins/proc/toggleaban //abandon mob verbs += /datum/admins/proc/show_traitor_panel verbs += /client/proc/getserverlog //fetch an old serverlog to look at - //verbs += /client/proc/cmd_admin_remove_plasma --This proc is outdated, does not do anything verbs += /client/proc/admin_call_shuttle verbs += /client/proc/admin_cancel_shuttle verbs += /client/proc/cmd_admin_dress @@ -229,11 +225,8 @@ verbs += /client/proc/jumptocoord verbs += /client/proc/deadmin_self verbs += /client/proc/giveruntimelog //used by coders to retrieve runtime logs - //verbs += /client/proc/cmd_admin_godmode --Merged with view variables - //verbs += /client/proc/cmd_admin_gib --Merged with view variables - //verbs += /proc/togglebuildmode --Merged with view variables - //verbs += /client/proc/cmd_modify_object_variables --Merged with view variables verbs += /client/proc/togglebuildmodeself + verbs += /client/proc/debug_controller else return //Game Admin @@ -246,18 +239,13 @@ verbs += /client/proc/cmd_admin_world_narrate verbs += /client/proc/cmd_debug_del_all verbs += /client/proc/cmd_debug_tog_aliens -// verbs += /client/proc/mapload verbs += /client/proc/check_words verbs += /client/proc/drop_bomb verbs += /client/proc/kill_airgroup - //verbs += /client/proc/cmd_admin_drop_everything --Merged with view variables verbs += /client/proc/make_sound verbs += /client/proc/play_local_sound verbs += /client/proc/send_space_ninja verbs += /client/proc/restart_controller //Can call via aproccall --I_hate_easy_things.jpg, Mport --Agouri - verbs += /client/proc/debug_controller -// verbs += /client/proc/Blobize //I need to remember to move/remove this later -// verbs += /client/proc/Blobcount //I need to remember to move/remove this later verbs += /client/proc/toggle_clickproc //TODO ERRORAGE (Temporary proc while the new clickproc is being tested) verbs += /client/proc/toggle_gravity_on verbs += /client/proc/toggle_gravity_off @@ -266,14 +254,7 @@ verbs += /client/proc/Set_Holiday //Force-set a Holiday verbs += /client/proc/admin_memo verbs += /client/proc/ToRban //ToRban frontend to access its features. - verbs += /client/proc/game_panel - //verbs += /client/proc/cmd_mass_modify_object_variables --Merged with view variables - //verbs += /client/proc/cmd_admin_explosion --Merged with view variables - //verbs += /client/proc/cmd_admin_emp --Merged with view variables - //verbs += /client/proc/give_spell --Merged with view variables - //verbs += /client/proc/cmd_admin_ninjafy --Merged with view variables - //verbs += /client/proc/cmd_switch_radio --removed as tcommsat is staying - else return + verbs += /client/proc/game_panel else return //Game Master if (holder.level >= 6) @@ -440,26 +421,6 @@ /client/proc/playernotes, /client/proc/cmd_admin_change_custom_event ) - //verbs -= /client/proc/mapload - //verbs -= /client/proc/cmd_admin_drop_everything --merged with view variables - //verbs -= /client/proc/give_spell --Merged with view variables - //verbs -= /client/proc/cmd_admin_ninjafy --Merged with view variables - //verbs -= /client/proc/cmd_modify_object_variables --Merged with view variables - //verbs -= /client/proc/cmd_admin_explosion --Merged with view variables - //verbs -= /client/proc/cmd_admin_emp --Merged with view variables - //verbs -= /client/proc/cmd_admin_godmode --Merged with view variables - //verbs -= /client/proc/cmd_admin_gib --Merged with view variables - //verbs -= /client/proc/cmd_mass_modify_object_variables --Merged with view variables - //verbs -= /client/proc/cmd_admin_attack_log --Merged with view variables - //verbs -= /proc/togglebuildmode --Merged with view variables - //verbs -= /client/proc/cmd_admin_prison --Merged with player panel - //verbs -= /datum/admins/proc/unprison --Merged with player panel - //verbs -= /client/proc/cmd_switch_radio --removed because tcommsat is staying - // verbs -= /client/proc/Blobize - // verbs -= /client/proc/Blobcount - //verbs -= /client/proc/warn - //verbs -= /client/proc/cmd_admin_mute --was never used (according to stats trackind) - use show player panel --erro - //verbs -= /client/proc/cmd_admin_remove_plasma --This proc is outdated, does not do anything return /client/proc/admin_ghost() diff --git a/code/modules/admin/holder2.dm b/code/modules/admin/holder2.dm index 4fba430ea6..490770ae00 100644 --- a/code/modules/admin/holder2.dm +++ b/code/modules/admin/holder2.dm @@ -19,6 +19,7 @@ var/list/admin_datums = list() var/fakekey = null var/ooccolor = "#b82e00" var/sound_adminhelp = 0 //If set to 1 this will play a sound when adminhelps are received. + var/sql_permissions = 0 //Permissions for different admin command groups. Must not be editable ingame. var/datum/marked_datum @@ -84,6 +85,49 @@ var/list/admin_datums = list() usr << "\red Unfortunatly there were no candidates available" return + if(href_list["editadminpermissions"]) + if(!usr.client) + return + + var/adm_ckey = href_list["editadminckey"] + if(!adm_ckey) + usr << "\red no valid ckey" + return + + if(!usr.client.holder || !(usr.client.holder.sql_permissions & PERMISSIONS)) + usr << "\red You do not have permission to do this!" + message_admins("[key_name_admin(usr)] attempted to edit the admin permissions of [adm_ckey] without authentication!") + log_admin("[key_name(usr)] attempted to edit the admin permissions of [adm_ckey] without authentication!") + return + + switch(href_list["editadminpermissions"]) + if("permissions") + usr << "Currently unavailable since nothing runs off of permissions" + if("rank") + var/new_rank = input("Please, select a rank", "New rank for player", null, null) as null|anything in list("Game Master","Game Admin", "Trial Admin", "Admin Observer") + if(!new_rank) + return + message_admins("[key_name_admin(usr)] edited the admin rank of [adm_ckey] to [new_rank]") + log_admin("[key_name(usr)] edited the admin rank of [adm_ckey] to [new_rank]") + log_admin_rank_modification(adm_ckey, new_rank) + if("remove") + if(alert("Are you sure you want to remove [adm_ckey]?","Message","Yes","Cancel") == "Yes") + message_admins("[key_name_admin(usr)] removed [adm_ckey] from the admins list") + log_admin("[key_name(usr)] removed [adm_ckey] from the admins list") + log_admin_rank_modification(adm_ckey, "Removed") + if("add") + var/new_ckey = input(usr,"New admin's ckey","Admin ckey", null) as text|null + if(!new_ckey) + return + var/new_rank = input("Please, select a rank", "New rank for player", null, null) as null|anything in list("Game Master","Game Admin", "Trial Admin", "Admin Observer") + if(!new_rank) + return + message_admins("[key_name_admin(usr)] added [new_ckey] as a new admin to the rank [new_rank]") + log_admin("[key_name(usr)] added [new_ckey] as a new admin to the rank [new_rank]") + log_admin_rank_modification(new_ckey, new_rank) + + + if(href_list["call_shuttle"]) if (src.rank in list("Trial Admin", "Badmin", "Game Admin", "Game Master")) if( ticker.mode.name == "blob" ) @@ -2651,4 +2695,4 @@ var/list/admin_datums = list() switch(href_list["notes"]) if("show") show_player_info(ckey) - return \ No newline at end of file + return diff --git a/code/modules/admin/permissionverbs/assignment.dm b/code/modules/admin/permissionverbs/assignment.dm new file mode 100644 index 0000000000..66affaa696 --- /dev/null +++ b/code/modules/admin/permissionverbs/assignment.dm @@ -0,0 +1,12 @@ + + + +//Before this proc is called, the holder variable must already be set, with the proper rank, level and permissions set. +//This proc also DOES NOT CLEAR EXISTING ADMIN VERBS + +/client/proc/handle_permission_verbs() + if(!holder || !holder.rank || !holder.sql_permissions) + return + + if(holder.sql_permissions & PERMISSIONS) + verbs += /client/proc/edit_admin_permissions \ No newline at end of file diff --git a/code/modules/admin/permissionverbs/permissionedit.dm b/code/modules/admin/permissionverbs/permissionedit.dm new file mode 100644 index 0000000000..f69138f23b --- /dev/null +++ b/code/modules/admin/permissionverbs/permissionedit.dm @@ -0,0 +1,127 @@ +/client/proc/edit_admin_permissions() + set category = "Admin" + set name = "Permissions Panel" + set desc = "Edit admin permissions" + + if(!holder) + return + holder.edit_admin_permissions() + +/datum/admins/proc/edit_admin_permissions() + if(!usr.client) + return + + if(!usr.client.holder || !(usr.client.holder.sql_permissions & PERMISSIONS)) + usr << "\red You do not have permission to do this!" + return + + var/user = sqlfdbklogin + var/pass = sqlfdbkpass + var/db = sqlfdbkdb + var/address = sqladdress + var/port = sqlport + + var/DBConnection/dbcon = new() + dbcon.Connect("dbi:mysql:[db]:[address]:[port]","[user]","[pass]") + if(!dbcon.IsConnected()) + usr << "\red Failed to establish database connection" + return + + var/DBQuery/select_query = dbcon.NewQuery("SELECT ckey, rank, level, flags FROM erro_admin ORDER BY rank, ckey") + select_query.Execute() + + var/output = "
| CKEY | " + output += "RANK | " + output += "LEVEL | " + output += "PERMISSIONS | " + output += "OPTIONS | " + output += "
|---|---|---|---|---|
| [adm_ckey] | " + output += "[adm_rank] | " + output += "[adm_level] | " + var/list/permissionlist = bitfield2list(adm_flags, permissionwords_sql) + output += ""
+ for(var/word in permissionlist)
+ output += "[word] " + output += " | "
+ output += ""
+
+ //Options
+ output += "PERMISSIONS " + output += "RANK " + output += "REMOVE" + + output += " | "
+ output += "
"
+
+ var/voted = 0
+ while(voted_query.NextRow())
+ voted = 1
+
+ var/optiontext = voted_query.item[1]
+ var/rating = voted_query.item[2]
+
+ output += "
[optiontext] - [rating]"
+
+ if(!voted) //Only make this a form if we have not voted yet
+ output += "