From 501c855aac0faf09b0684366c42d26bb5dee3cf0 Mon Sep 17 00:00:00 2001 From: "noisomehollow@lycos.com" Date: Mon, 6 Jun 2011 06:43:59 +0000 Subject: [PATCH] Sight update to strike team admin proc. It should pick people as intended now. Can't really test it locally so who knows. Admins can again spawn everyone as ninjas, including themselves. Inactive player checking is still there though. A slightly updated stealth graphic for ninjas. Fixed a lawsync() run time error. Fixed station_explosion_cinematic() run time error. Fixed copy_to() run time error. Fixed dnainjector/attack() run time error. git-svn-id: http://tgstation13.googlecode.com/svn/trunk@1667 316c924e-a436-60f5-8080-3fe189b3f50e --- code/game/gamemodes/extra/space_ninja.dm | 17 ++--- code/game/objects/devices/PDA/cart.dm | 30 ++++---- code/game/objects/items/weapons/misc.dm | 42 ++++++----- code/modules/admin/verbs/striketeam.dm | 74 +++++++++---------- code/modules/mob/living/carbon/human/human.dm | 3 +- code/modules/mob/living/silicon/robot/laws.dm | 55 +++++++------- code/modules/mob/mob.dm | 4 +- code/modules/mob/new_player/preferences.dm | 9 +-- 8 files changed, 112 insertions(+), 122 deletions(-) diff --git a/code/game/gamemodes/extra/space_ninja.dm b/code/game/gamemodes/extra/space_ninja.dm index 1bc8ec9a034..694e589ed6d 100644 --- a/code/game/gamemodes/extra/space_ninja.dm +++ b/code/game/gamemodes/extra/space_ninja.dm @@ -47,7 +47,7 @@ ________________________________________________________________________________ xenos, death squads, and cyborgs. Ninjas are not admin PCs--please do not use them for that purpose. I'm currently looking for feedback from regular players since beta testing is largely done. I would appreciate if you spawned regular players as ninjas when rounds are boring. Or exciting, it's all good as long as there is feedback. - Admin quick-spawning as ninjas is disabled for that reason. You can spawn ninja gear manually if you want to. + You can also spawn ninja gear manually if you want to. How to do that: Make sure your character has a mind. @@ -128,8 +128,7 @@ ________________________________________________________________________________ var/mob/dead/observer/G var/list/candidates = list() for(G in world) - if(G.client&&!G.client.holder) - //if(G.client)//Good for testing. + if(G.client)//Now everyone can ninja! if(((G.client.inactivity/10)/60) <= 5) candidates.Add(G) if(candidates.len) @@ -209,10 +208,7 @@ client/proc/create_space_ninja(obj/spawn_point) //This proc prevents the suit from being taken off. /obj/item/clothing/suit/space/space_ninja/proc/lock_suit(mob/living/carbon/U, X = 0) if(X)//If you want to check for icons. - if(U.gender==FEMALE) - icon_state = "s-ninjanf" - else - icon_state = "s-ninjan" + icon_state = U.gender==FEMALE ? "s-ninjanf" : "s-ninjan" U:gloves.icon_state = "s-ninjan" U:gloves.item_state = "s-ninjan" else @@ -266,7 +262,7 @@ client/proc/create_space_ninja(obj/spawn_point) invisibility = 2//Set ninja invis to 2. var/icon/opacity_icon = new(A.icon, A.icon_state) var/icon/alpha_mask = getIconMask(src) - var/icon/alpha_mask_2 = new('effects.dmi', "wave1") + var/icon/alpha_mask_2 = new('effects.dmi', "at_shield1") alpha_mask.AddAlphaMask(alpha_mask_2) opacity_icon.AddAlphaMask(alpha_mask) for(var/i=0,i<5,i++)//And now we add it as overlays. It's faster than creating an icon and then merging it. @@ -351,10 +347,7 @@ client/proc/create_space_ninja(obj/spawn_point) kamikaze = 1 - if(U.gender==FEMALE) - icon_state = "s-ninjakf" - else - icon_state = "s-ninjak" + icon_state = U.gender==FEMALE ? "s-ninjakf" : "s-ninjak" if(n_gloves) n_gloves.icon_state = "s-ninjak" n_gloves.item_state = "s-ninjak" diff --git a/code/game/objects/devices/PDA/cart.dm b/code/game/objects/devices/PDA/cart.dm index 01b150762e5..63814d98f77 100644 --- a/code/game/objects/devices/PDA/cart.dm +++ b/code/game/objects/devices/PDA/cart.dm @@ -124,8 +124,8 @@ if (!istype(loc, /obj/item/device/pda)) return - src.generate_menu() - src.print_to_host(menu) + generate_menu() + print_to_host(menu) return proc/print_to_host(var/text) @@ -169,14 +169,14 @@ Frequency: - - -[format_frequency(src.radio:frequency)] +[format_frequency(radio:frequency)] + +

Code: - - -[src.radio:code] +[radio:code] + +
"} if (41) //crew manifest @@ -239,7 +239,7 @@ Code: menu = "

Medical Record

" if (istype(active1, /datum/data/record) && data_core.general.Find(active1)) - menu += "Name: [active1.fields["name"]] ID: [src.active1.fields["id"]]
" + menu += "Name: [active1.fields["name"]] ID: [active1.fields["id"]]
" menu += "Sex: [active1.fields["sex"]]
" menu += "Age: [active1.fields["age"]]
" menu += "Fingerprint: [active1.fields["fingerprint"]]
" @@ -251,7 +251,7 @@ Code: menu += "
" menu += "

Medical Data

" - if (istype(src.active2, /datum/data/record) && data_core.medical.Find(src.active2)) + if (istype(active2, /datum/data/record) && data_core.medical.Find(active2)) menu += "Blood Type: [active2.fields["b_type"]]

" menu += "Minor Disabilities: [active2.fields["mi_dis"]]
" @@ -281,8 +281,8 @@ Code: if(451) menu = "

Security Record

" - if (istype(src.active1, /datum/data/record) && data_core.general.Find(src.active1)) - menu += "Name: [active1.fields["name"]] ID: [src.active1.fields["id"]]
" + if (istype(active1, /datum/data/record) && data_core.general.Find(active1)) + menu += "Name: [active1.fields["name"]] ID: [active1.fields["id"]]
" menu += "Sex: [active1.fields["sex"]]
" menu += "Age: [active1.fields["age"]]
" menu += "Fingerprint: [active1.fields["fingerprint"]]
" @@ -294,7 +294,7 @@ Code: menu += "
" menu += "

Security Data

" - if (istype(src.active3, /datum/data/record) && data_core.security.Find(src.active3)) + if (istype(active3, /datum/data/record) && data_core.security.Find(active3)) menu += "Criminal Status: [active3.fields["criminal"]]
" menu += "Minor Crimes: [active3.fields["mi_crim"]]
" @@ -304,7 +304,7 @@ Code: menu += "Details: [active3.fields["ma_crim_d"]]

" menu += "Important Notes:
" - menu += "[src.active3.fields["notes"]]" + menu += "[active3.fields["notes"]]" else menu += "Record Lost!
" @@ -529,20 +529,20 @@ Code: if("Send Signal") for(var/obj/item/assembly/r_i_ptank/R in world) //Bomblist stuff if((R.part1.code == src/radio:code) && (R.part1.frequency == radio:frequency)) - bombers += "[key_name(usr)] has activated a radio bomb (Freq: [format_frequency(src.radio:frequency)], Code: [src.radio:code]). Temp = [R.part3.air_contents.temperature-T0C]." + bombers += "[key_name(usr)] has activated a radio bomb (Freq: [format_frequency(radio:frequency)], Code: [radio:code]). Temp = [R.part3.air_contents.temperature-T0C]." spawn( 0 ) radio:send_signal("ACTIVATE") return if("Signal Frequency") - var/new_frequency = sanitize_frequency(src.radio:frequency + text2num(href_list["sfreq"])) + var/new_frequency = sanitize_frequency(radio:frequency + text2num(href_list["sfreq"])) radio:set_frequency(new_frequency) if("Signal Code") radio:code += text2num(href_list["scode"]) - radio:code = round(src.radio:code) - radio:code = min(100, src.radio:code) - radio:code = max(1, src.radio:code) + radio:code = round(radio:code) + radio:code = min(100, radio:code) + radio:code = max(1, radio:code) if("Status") switch(href_list["statdisp"]) diff --git a/code/game/objects/items/weapons/misc.dm b/code/game/objects/items/weapons/misc.dm index 3d2e5fc89aa..9698010c8db 100644 --- a/code/game/objects/items/weapons/misc.dm +++ b/code/game/objects/items/weapons/misc.dm @@ -67,7 +67,7 @@ var/global/list/cached_icons = list() color = "FFFFFF" if("black") color = "333333" - src.icon_state = "paint_[t1]" + icon_state = "paint_[t1]" add_fingerprint(user) return @@ -97,7 +97,7 @@ var/global/list/cached_icons = list() /obj/item/weapon/dnainjector/attack_paw(mob/user as mob) - return src.attack_hand(user) + return attack_hand(user) /obj/item/weapon/dnainjector/proc/inject(mob/M as mob) @@ -138,8 +138,8 @@ var/global/list/cached_icons = list() if (!(istype(usr, /mob/living/carbon/human) || ticker) && ticker.mode.name != "monkey") user << "\red You don't have the dexterity to do this!" return - M.attack_log += text("[world.time] - has been injected with [src.name] by [user.name] ([user.ckey])") - user.attack_log += text("[world.time] - has used the [src.name] to inject [M.name] ([M.ckey])") + M.attack_log += text("[world.time] - has been injected with [name] by [user.name] ([user.ckey])") + user.attack_log += text("[world.time] - has used the [name] to inject [M.name] ([M.ckey])") if (user) if (istype(M, /mob/living/carbon/human)) @@ -153,14 +153,14 @@ var/global/list/cached_icons = list() M.requests += O if (dnatype == "se") if (isblockon(getblock(dna, 14,3),14) && istype(M, /mob/living/carbon/human)) - message_admins("[key_name_admin(user)] injected [key_name_admin(M)] with the [src.name] \red(MONKEY)") - log_game("[key_name(user)] injected [key_name(M)] with the [src.name] (MONKEY)") + message_admins("[key_name_admin(user)] injected [key_name_admin(M)] with the [name] \red(MONKEY)") + log_game("[key_name(user)] injected [key_name(M)] with the [name] (MONKEY)") else - message_admins("[key_name_admin(user)] injected [key_name_admin(M)] with the [src.name]") - log_game("[key_name(user)] injected [key_name(M)] with the [src.name]") + message_admins("[key_name_admin(user)] injected [key_name_admin(M)] with the [name]") + log_game("[key_name(user)] injected [key_name(M)] with the [name]") else - message_admins("[key_name_admin(user)] injected [key_name_admin(M)] with the [src.name]") - log_game("[key_name(user)] injected [key_name(M)] with the [src.name]") + message_admins("[key_name_admin(user)] injected [key_name_admin(M)] with the [name]") + log_game("[key_name(user)] injected [key_name(M)] with the [name]") spawn( 0 ) O.process() @@ -172,16 +172,22 @@ var/global/list/cached_icons = list() if (!(istype(M, /mob/living/carbon/human) || istype(M, /mob/living/carbon/monkey))) user << "\red Apparently it didn't work." return - inject(M) if (dnatype == "se") if (isblockon(getblock(dna, 14,3),14) && istype(M, /mob/living/carbon/human)) - message_admins("[key_name_admin(user)] injected [key_name_admin(M)] with the [src.name] \red(MONKEY)") - log_game("[key_name(user)] injected [key_name(M)] with the [src.name] (MONKEY)") + message_admins("[key_name_admin(user)] injected [key_name_admin(M)] with the [name] \red(MONKEY)") + log_game("[key_name(user)] injected [key_name(M)] with the [name] (MONKEY)") else - message_admins("[key_name_admin(user)] injected [key_name_admin(M)] with the [src.name]") - log_game("[key_name(user)] injected [key_name(M)] with the [src.name]") + message_admins("[key_name_admin(user)] injected [key_name_admin(M)] with the [name]") + log_game("[key_name(user)] injected [key_name(M)] with the [name]") else - message_admins("[key_name_admin(user)] injected [key_name_admin(M)] with the [src.name]") - log_game("[key_name(user)] injected [key_name(M)] with the [src.name]") - user.show_message(text("\red You inject [M]")) + message_admins("[key_name_admin(user)] injected [key_name_admin(M)] with the [name]") + log_game("[key_name(user)] injected [key_name(M)] with the [name]") + inject(M)//Now we actually do the heavy lifting. + /* + A user injecting themselves could mean their own transformation and deletion of mob. + I don't have the time to figure out how this code works so this will do for now. + I did rearrange things a bit. + */ + if(!isnull(user))//If the user still exists. Their mob may not. + user.show_message(text("\red You inject [M]")) return diff --git a/code/modules/admin/verbs/striketeam.dm b/code/modules/admin/verbs/striketeam.dm index 8e74cd1b34b..01d18d734e0 100644 --- a/code/modules/admin/verbs/striketeam.dm +++ b/code/modules/admin/verbs/striketeam.dm @@ -29,13 +29,17 @@ var/global/sent_strike_team = 0 if(alert("Error, no mission set. Do you want to exit the setup process?",,"Yes","No")=="Yes") return + if(sent_strike_team) + src << "Looks like someone beat you to it." + return + sent_strike_team = 1 if (emergency_shuttle.direction == 1 && emergency_shuttle.online == 1) emergency_shuttle.recall() world << "\blue Alert: The shuttle is going back!" - var/commando_number = 6 //for selecting a leader + var/commando_number = commandos_possible //for selecting a leader var/leader_selected = 0 //when the leader is chosen. The last person spawned. //Code for spawning a nuke auth code. @@ -43,65 +47,58 @@ var/global/sent_strike_team = 0 //Generates a list of commandos from active ghosts. Then the user picks which characters to respawn as the commandos. var/mob/dead/observer/G - var/list/commandos = list()//actual commando ghosts as picked by the user. - var/list/candidates = list()//candidates for being a commando out of all the active ghosts in world. + var/candidates[] = list()//candidates for being a commando out of all the active ghosts in world. + var/commandos[] = list()//actual commando ghosts as picked by the user. for(G in world) if(G.client) if(!G.client.holder && ((G.client.inactivity/10)/60) <= 5) //Whoever called/has the proc won't be added to the list. // if(((G.client.inactivity/10)/60) <= 5) //Removing it allows even the caller to jump in. Good for testing. - candidates.Add(G) - var/p=1 - while(candidates.len&&p<=commandos_possible) + candidates += G + for(var/i=commandos_possible,(i>0&&candidates.len),i--) G = input("Pick characters to spawn as the commandos. This will go on until there either no more ghosts to pick from or the slots are full.", "Active Players", G) in candidates//It will auto-pick a person when there is only one candidate. - commandos.Add(G) - p++ + candidates -= G + commandos += G //Spawns commandos and equips them. - for (var/obj/landmark/STARTLOC in world) - if (STARTLOC.name == "Commando") - if (commando_number == 1)//Leader is always the last guy spawned. - leader_selected = 1 + for (var/obj/landmark/L in world) + if(commando_number<=0) break + if (L.name == "Commando") + leader_selected = commando_number == 1?1:0 - var/mob/living/carbon/human/new_commando = create_death_commando(STARTLOC, leader_selected) + var/mob/living/carbon/human/new_commando = create_death_commando(L, leader_selected) if(commandos.len) G = pick(commandos) + commandos -= G new_commando.mind.key = G.key//For mind stuff. new_commando.key = G.key new_commando.internal = new_commando.s_store new_commando.internals.icon_state = "internal1" del(G) - else - new_commando.key = "null" - new_commando.mind.key = new_commando.key new_commando.mind.store_memory("Nuke Code: \red [nuke_code].")//So they don't forget their code or mission. new_commando.mind.store_memory("Mission: \red [input].") - if (!leader_selected) - new_commando << "\blue You are a Special Ops. commando in the service of Central Command. Check the table ahead for detailed instructions.\nYour current mission is: \red[input]" - else - new_commando << "\blue You are a Special Ops. LEADER in the service of Central Command. Check the table ahead for detailed instructions.\nYour current mission is: \red[input]" + new_commando << "\blue You are a Special Ops. [!leader_selected?"commando":"LEADER"] in the service of Central Command. Check the table ahead for detailed instructions.\nYour current mission is: \red[input]" commando_number-- //Targets any nukes in the world and changes their auth code as needed. //Bad news for Nuke operatives--or great news. - for(var/obj/machinery/nuclearbomb/NUAK in world) - if (NUAK.name == "Nuclear Fission Explosive") - NUAK.r_code = nuke_code + for(var/obj/machinery/nuclearbomb/N in world) + N.r_code = nuke_code - for (var/obj/landmark/MANUAL) - if (MANUAL.name == "Commando_Manual") - new /obj/item/weapon/gun/energy/pulse_rifle(MANUAL.loc) - var/obj/item/weapon/paper/PAPER = new(MANUAL.loc) - PAPER.info = "

Good morning soldier!. This compact guide will familiarize you with standard operating procedure. There are three basic rules to follow:
#1 Work as a team.
#2 Accomplish your objective at all costs.
#3 Leave no witnesses.
You are fully equipped and stocked for your mission--before departing on the Spec. Ops. Shuttle due South, make sure that all operatives are ready. Actual mission objective will be relayed to you by Central Command through your headsets.
If deemed appropriate, Central Command will also allow members of your team to equip assault power-armor for the mission. You will find the armor storage due West of your position. Once you are ready to leave, utilize the Special Operations shuttle console and toggle the hull doors via the other console.

In the event that the team does not accomplish their assigned objective in a timely manner, or finds no other way to do so, attached below are instructions on how to operate a Nanotrasen Nuclear Device. Your operations LEADER is provided with a nuclear authentication disk and a pin-pointer for this reason. You may easily recognize them by their rank: Lieutenant, Captain, or Major. The nuclear device itself will be present somewhere on your destination.

Hello and thank you for choosing Nanotrasen for your nuclear information needs. Today's crash course will deal with the operation of a Fission Class Nanotrasen made Nuclear Device.
First and foremost, DO NOT TOUCH ANYTHING UNTIL THE BOMB IS IN PLACE. Pressing any button on the compacted bomb will cause it to extend and bolt itself into place. If this is done to unbolt it one must completely log in which at this time may not be possible.
To make the device functional:
#1 Place bomb in designated detonation zone
#2 Extend and anchor bomb (attack with hand).
#3 Insert Nuclear Auth. Disk into slot.
#4 Type numeric code into keypad ([nuke_code]).
Note: If you make a mistake press R to reset the device.
#5 Press the E button to log onto the device.
You now have activated the device. To deactivate the buttons at anytime, for example when you have already prepped the bomb for detonation, remove the authentication disk OR press the R on the keypad. Now the bomb CAN ONLY be detonated using the timer. A manual detonation is not an option.
Note: Toggle off the SAFETY.
Use the - - and + + to set a detonation time between 5 seconds and 10 minutes. Then press the timer toggle button to start the countdown. Now remove the authentication disk so that the buttons deactivate.
Note: THE BOMB IS STILL SET AND WILL DETONATE
Now before you remove the disk if you need to move the bomb you can: Toggle off the anchor, move it, and re-anchor.

The nuclear authorization code is: [nuke_code]

Good luck, soldier!

" - PAPER.name = "Spec. Ops. Manual" + for (var/obj/landmark/L) + if (L.name == "Commando_Manual") + new /obj/item/weapon/gun/energy/pulse_rifle(L.loc) + var/obj/item/weapon/paper/P = new(L.loc) + P.info = "

Good morning soldier!. This compact guide will familiarize you with standard operating procedure. There are three basic rules to follow:
#1 Work as a team.
#2 Accomplish your objective at all costs.
#3 Leave no witnesses.
You are fully equipped and stocked for your mission--before departing on the Spec. Ops. Shuttle due South, make sure that all operatives are ready. Actual mission objective will be relayed to you by Central Command through your headsets.
If deemed appropriate, Central Command will also allow members of your team to equip assault power-armor for the mission. You will find the armor storage due West of your position. Once you are ready to leave, utilize the Special Operations shuttle console and toggle the hull doors via the other console.

In the event that the team does not accomplish their assigned objective in a timely manner, or finds no other way to do so, attached below are instructions on how to operate a Nanotrasen Nuclear Device. Your operations LEADER is provided with a nuclear authentication disk and a pin-pointer for this reason. You may easily recognize them by their rank: Lieutenant, Captain, or Major. The nuclear device itself will be present somewhere on your destination.

Hello and thank you for choosing Nanotrasen for your nuclear information needs. Today's crash course will deal with the operation of a Fission Class Nanotrasen made Nuclear Device.
First and foremost, DO NOT TOUCH ANYTHING UNTIL THE BOMB IS IN PLACE. Pressing any button on the compacted bomb will cause it to extend and bolt itself into place. If this is done to unbolt it one must completely log in which at this time may not be possible.
To make the device functional:
#1 Place bomb in designated detonation zone
#2 Extend and anchor bomb (attack with hand).
#3 Insert Nuclear Auth. Disk into slot.
#4 Type numeric code into keypad ([nuke_code]).
Note: If you make a mistake press R to reset the device.
#5 Press the E button to log onto the device.
You now have activated the device. To deactivate the buttons at anytime, for example when you have already prepped the bomb for detonation, remove the authentication disk OR press the R on the keypad. Now the bomb CAN ONLY be detonated using the timer. A manual detonation is not an option.
Note: Toggle off the SAFETY.
Use the - - and + + to set a detonation time between 5 seconds and 10 minutes. Then press the timer toggle button to start the countdown. Now remove the authentication disk so that the buttons deactivate.
Note: THE BOMB IS STILL SET AND WILL DETONATE
Now before you remove the disk if you need to move the bomb you can: Toggle off the anchor, move it, and re-anchor.

The nuclear authorization code is: [nuke_code]

Good luck, soldier!

" + P.name = "Spec. Ops. Manual" - for (var/obj/landmark/BOMB in world) - if (BOMB.name == "Commando-Bomb") - new /obj/spawner/newbomb/timer/syndicate(BOMB.loc) - del(BOMB) + for (var/obj/landmark/L in world) + if (L.name == "Commando-Bomb") + new /obj/spawner/newbomb/timer/syndicate(L.loc) + del(L) message_admins("\blue [key_name_admin(usr)] has spawned a CentCom strike squad.", 1) log_admin("[key_name(usr)] used Spawn Death Squad.") @@ -117,14 +114,9 @@ var/global/sent_strike_team = 0 var/datum/preferences/A = new()//Randomize appearance for the commando. A.randomize_appearance_for(new_commando) - if (!leader_selected) - new_commando.real_name = "[commando_rank] [commando_name]" - else - new_commando.real_name = "[commando_leader_rank] [commando_name]" - if (!leader_selected) - new_commando.age = rand(23,35) - else - new_commando.age = rand(35,45) + new_commando.real_name = "[!leader_selected ? commando_rank : commando_leader_rank] [commando_name]" + new_commando.age = !leader_selected ? rand(23,35) : rand(35,45) + new_commando.dna.ready_dna(new_commando)//Creates DNA. //Creates mind stuff. diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index 1f147549ba6..81734df7ce1 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -1377,7 +1377,8 @@ AddCamoOverlay(loc)//Overlay camo. if(3) if(istype(loc, /turf)) - if(prob(90))//Ninjas may flick into view once in a while if they are stealthed. + //Ninjas may flick into view once in a while if they are stealthed. + if(prob(90)) NinjaStealthActive(loc) else NinjaStealthMalf() diff --git a/code/modules/mob/living/silicon/robot/laws.dm b/code/modules/mob/living/silicon/robot/laws.dm index 9f5ac93528b..1fe9d6908c6 100644 --- a/code/modules/mob/living/silicon/robot/laws.dm +++ b/code/modules/mob/living/silicon/robot/laws.dm @@ -1,7 +1,7 @@ /mob/living/silicon/robot/verb/cmd_show_laws() set category = "Robot Commands" set name = "Show Laws" - src.show_laws() + show_laws() /mob/living/silicon/robot/show_laws(var/everyone = 0) var/who @@ -16,13 +16,13 @@ src << "AI signal lost, unable to sync laws." else - src.lawsync() + lawsync() src << "Laws synced with AI, be sure to note any changes." if (mind.special_role == "traitor" && mind.original == src) src << "Remember, your AI does NOT share or know about your law 0." else src << "No AI selected to sync laws with, disabling lawsync protocol." - src.lawupdate = 0 + lawupdate = 0 who << "Obey these laws:" laws.show_laws(who) @@ -59,59 +59,60 @@ */ /mob/living/silicon/robot/proc/lawsync() - var/datum/ai_laws/master = src.connected_ai.laws + var/datum/ai_laws/master = connected_ai ? connected_ai.laws : null var/temp if (master) - src.laws.ion.len = master.ion.len + laws.ion.len = master.ion.len for (var/index = 1, index <= master.ion.len, index++) temp = master.ion[index] if (length(temp) > 0) - src.laws.ion[index] = temp + laws.ion[index] = temp if (!checktraitor(src) || mind.original != src) temp = master.zeroth - src.laws.zeroth = temp + laws.zeroth = temp - src.laws.inherent.len = master.inherent.len + laws.inherent.len = master.inherent.len for (var/index = 1, index <= master.inherent.len, index++) temp = master.inherent[index] if (length(temp) > 0) - src.laws.inherent[index] = temp + laws.inherent[index] = temp - src.laws.supplied.len = master.supplied.len + laws.supplied.len = master.supplied.len for (var/index = 1, index <= master.supplied.len, index++) temp = master.supplied[index] if (length(temp) > 0) - src.laws.supplied[index] = temp + laws.supplied[index] = temp + return /mob/living/silicon/robot/proc/laws_sanity_check() - if (!src.laws) - src.laws = new /datum/ai_laws/asimov + if (!laws) + laws = new /datum/ai_laws/asimov /mob/living/silicon/robot/proc/set_zeroth_law(var/law) - src.laws_sanity_check() - src.laws.set_zeroth_law(law) + laws_sanity_check() + laws.set_zeroth_law(law) /mob/living/silicon/robot/proc/add_inherent_law(var/law) - src.laws_sanity_check() - src.laws.add_inherent_law(law) + laws_sanity_check() + laws.add_inherent_law(law) /mob/living/silicon/robot/proc/clear_inherent_laws() - src.laws_sanity_check() - src.laws.clear_inherent_laws() + laws_sanity_check() + laws.clear_inherent_laws() /mob/living/silicon/robot/proc/add_supplied_law(var/number, var/law) - src.laws_sanity_check() - src.laws.add_supplied_law(number, law) + laws_sanity_check() + laws.add_supplied_law(number, law) /mob/living/silicon/robot/proc/clear_supplied_laws() - src.laws_sanity_check() - src.laws.clear_supplied_laws() + laws_sanity_check() + laws.clear_supplied_laws() /mob/living/silicon/robot/proc/add_ion_law(var/law) - src.laws_sanity_check() - src.laws.add_ion_law(law) + laws_sanity_check() + laws.add_ion_law(law) /mob/living/silicon/robot/proc/clear_ion_laws() - src.laws_sanity_check() - src.laws.clear_ion_laws() \ No newline at end of file + laws_sanity_check() + laws.clear_ion_laws() \ No newline at end of file diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index 5aa4bc6d2b4..d55ed5c5675 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -2166,8 +2166,8 @@ note dizziness decrements automatically in the mob's Life() proc. var/mob/M = mob M.loc = null // HACK, but whatever, this works - var/obj/screen/boom = M.hud_used.station_explosion - if (M.client) + if (M.client&&M.hud_used)//They may some times not have a hud, apparently. + var/obj/screen/boom = M.hud_used.station_explosion M.client.screen += boom if(ticker) switch(ticker.mode.name) diff --git a/code/modules/mob/new_player/preferences.dm b/code/modules/mob/new_player/preferences.dm index c6f41426ddc..11267b5ac83 100644 --- a/code/modules/mob/new_player/preferences.dm +++ b/code/modules/mob/new_player/preferences.dm @@ -902,17 +902,14 @@ datum/preferences else character.face_icon_state = "bald" - if (underwear == 1) - character.underwear = pick(1,2,3,4,5) - else - character.underwear = 0 + character.underwear = underwear == 1 ? pick(1,2,3,4,5) : 0 character.update_face() character.update_body() if(!safety)//To prevent run-time errors due to null datum when using randomize_appearance_for() - spawn(10)//as they should already have these set at game spawn. - if(character) + spawn(10) + if(character&&character.client) character.client.midis = midis character.client.ooccolor = ooccolor character.client.be_alien = be_alien