diff --git a/code/datums/mind.dm b/code/datums/mind.dm index dafbd5c7c5..ac81e6daf9 100644 --- a/code/datums/mind.dm +++ b/code/datums/mind.dm @@ -276,6 +276,7 @@ datum/mind var/datum/game_mode/current_mode = ticker.mode switch (href_list["traitorize"]) if ("headrev") + current_mode.equip_traitor(current,1) current_mode:equip_revolutionary(current) //find first headrev for(var/datum/mind/rev_mind in current_mode:head_revolutionaries) diff --git a/code/defines/procs/gamehelpers.dm b/code/defines/procs/gamehelpers.dm index a1399e103d..76037e811f 100644 --- a/code/defines/procs/gamehelpers.dm +++ b/code/defines/procs/gamehelpers.dm @@ -18,7 +18,6 @@ return 0 /proc/get_area_name(N) //get area by it's name - for(var/area/A in world) if(A.name == N) return A diff --git a/code/defines/procs/helpers.dm b/code/defines/procs/helpers.dm index bb6d681c39..f38a654341 100644 --- a/code/defines/procs/helpers.dm +++ b/code/defines/procs/helpers.dm @@ -381,6 +381,97 @@ return direction_f +//Returns location. Returns null if no location was found. +/proc/get_teleport_loc(var/turf/location as turf,var/mob/target as mob,var/distance = 1, var/density = 0, var/errorx = 0, var/errory = 0, var/eoffsetx = 0, var/eoffsety = 0) +//Location where the teleport begins, target that will teleport, distance to go, density checking 0/1(yes/no). +//Random error in tile placement x, error in tile placement y, and block offset. +//Block offset tells the proc how to place the box. Behind teleport location, relative to starting location, forward, etc. +//Negative values for offset are accepted, think of it in relation to North, -x is west, -y is south. Error defaults to positive. +//Turf and target are seperate in case you want to teleport some distance from a turf the target is not standing on or something. + + var/dirx = 0//Generic location finding variable. + var/diry = 0 + + var/xoffset = 0//Generic counter for offset location. + var/yoffset = 0 + + var/b1xerror = 0//Generic placing for point A in box. The lower left. + var/b1yerror = 0 + var/b2xerror = 0//Generic placing for point B in box. The upper right. + var/b2yerror = 0 + + errorx = abs(errorx)//Error should never be negative. + errory = abs(errory) + //var/errorxy = round((errorx+errory)/2)//Used for diagonal boxes. + + switch(target.dir)//This can be done through equations but switch is the simpler method. And works fast to boot. + //Directs on what values need modifying. + if(1)//North + diry+=distance + yoffset+=eoffsety + xoffset+=eoffsetx + b1xerror-=errorx + b1yerror-=errory + b2xerror+=errorx + b2yerror+=errory + if(2)//South + diry-=distance + yoffset-=eoffsety + xoffset+=eoffsetx + b1xerror-=errorx + b1yerror-=errory + b2xerror+=errorx + b2yerror+=errory + if(4)//East + dirx+=distance + yoffset+=eoffsetx//Flipped. + xoffset+=eoffsety + b1xerror-=errory//Flipped. + b1yerror-=errorx + b2xerror+=errory + b2yerror+=errorx + if(8)//West + dirx-=distance + yoffset-=eoffsetx//Flipped. + xoffset+=eoffsety + b1xerror-=errory//Flipped. + b1yerror-=errorx + b2xerror+=errory + b2yerror+=errorx + + var/turf/destination=locate(location.x+dirx,location.y+diry,location.z) + + if(destination)//If there is a destination. + if(errorx||errory)//If errorx or y were specified. + var/destination_list[] = list()//To add turfs to list. + //destination_list = new() + /*This will draw a block around the target turf, given what the error is. + Specifying the values above will basically draw a different sort of block. + If the values are the same, it will be a square. If they are different, it will be a rectengle. + In either case, it will center based on offset. Offset is position from center. + Offset always calculates in relation to direction faced. In other words, depending on the direction of the teleport, + the offset should remain positioned in relation to destination.*/ + + var/turf/center = locate((destination.x+xoffset),(destination.y+yoffset),location.z)//So now, find the new center. + + //Now to find a box from center location and make that our destination. + for(var/turf/T in block(locate(center.x+b1xerror,center.y+b1yerror,location.z), locate(center.x+b2xerror,center.y+b2yerror,location.z) )) + if(density&&T.density) continue//If density was specified. + if(T.x>world.maxx || T.x<1) continue//Don't want them to teleport off the map. + if(T.y>world.maxy || T.y<1) continue + destination_list += T + if(destination_list.len) + destination = pick(destination_list) + else return + + else//Same deal here. + if(density&&destination.density) return + if(destination.x>world.maxx || destination.x<1) return + if(destination.y>world.maxy || destination.y<1) return + else return + + return destination + /proc/angle2text(var/degree) return dir2text(angle2dir(degree)) diff --git a/code/defines/procs/syndicate_name.dm b/code/defines/procs/syndicate_name.dm index fe7303e803..7cc2add806 100644 --- a/code/defines/procs/syndicate_name.dm +++ b/code/defines/procs/syndicate_name.dm @@ -29,6 +29,7 @@ var/syndicate_name = null return name //This is referenced in equip_traitor() so it's fairly easy to remove if needed. +//Added this to traitor AIs. var/syndicate_code_phrase//Code phrase for traitors. var/syndicate_code_response//Code response for traitors. diff --git a/code/game/gamemodes/extra/ninja_abilities.dm b/code/game/gamemodes/extra/ninja_abilities.dm index 28176c41b8..60edd9360f 100644 --- a/code/game/gamemodes/extra/ninja_abilities.dm +++ b/code/game/gamemodes/extra/ninja_abilities.dm @@ -66,60 +66,20 @@ In the case that they are not, I imagine the game will run-time error like crazy var/C = 100 if(!ninjacost(C,1)) var/obj/item/clothing/suit/space/space_ninja/S = src:wear_suit - var/list/turfs = new/list() - var/turf/picked - var/turf/mobloc = get_turf(loc) - var/safety = 0 - var/locx - var/locy - switch(dir)//Gets rectengular range for target. - if(NORTH) - locx = mobloc.x - locy = (mobloc.y+9) - for(var/turf/T in block(locate(locx-3,locy-1,loc.z), locate(locx+3,locy+1,loc.z) )) - if(T.density) continue - if(T.x>world.maxx || T.x<1) continue - if(T.y>world.maxy || T.y<1) continue - turfs += T - if(SOUTH) - locx = mobloc.x - locy = (mobloc.y-9) - for(var/turf/T in block(locate(locx-3,locy-1,loc.z), locate(locx+3,locy+1,loc.z) )) - if(T.density) continue - if(T.x>world.maxx || T.x<1) continue - if(T.y>world.maxy || T.y<1) continue - turfs += T - if(EAST) - locy = mobloc.y - locx = (mobloc.x+9) - for(var/turf/T in block(locate(locx-1,locy-3,loc.z), locate(locx+1,locy+3,loc.z) )) - if(T.density) continue - if(T.x>world.maxx || T.x<1) continue - if(T.y>world.maxy || T.y<1) continue - turfs += T - if(WEST) - locy = mobloc.y - locx = (mobloc.x-9) - for(var/turf/T in block(locate(locx-1,locy-3,loc.z), locate(locx+1,locy+3,loc.z) )) - if(T.density) continue - if(T.x>world.maxx || T.x<1) continue - if(T.y>world.maxy || T.y<1) continue - turfs += T - else safety = 1 - - if(turfs.len&&!safety)//Cancels the teleportation if no valid turf is found. Usually when teleporting near map edge. - picked = pick(turfs) + var/turf/destination = get_teleport_loc(loc,src,9,1,3,1,0,1) + var/turf/mobloc = get_turf(loc)//To make sure that certain things work properly below. + if(destination&&istype(mobloc, /turf)) spawn(0) playsound(loc, "sparks", 50, 1) anim(mobloc,src,'mob.dmi',,"phaseout") if(istype(get_active_hand(),/obj/item/weapon/grab))//Handles grabbed persons. var/obj/item/weapon/grab/G = get_active_hand() - G.affecting.loc = locate(picked.x+rand(-1,1),picked.y+rand(-1,1),picked.z)//variation of position. + G.affecting.loc = locate(destination.x+rand(-1,1),destination.y+rand(-1,1),destination.z)//variation of position. if(istype(get_inactive_hand(),/obj/item/weapon/grab)) var/obj/item/weapon/grab/G = get_inactive_hand() - G.affecting.loc = locate(picked.x+rand(-1,1),picked.y+rand(-1,1),picked.z)//variation of position. - loc = picked + G.affecting.loc = locate(destination.x+rand(-1,1),destination.y+rand(-1,1),destination.z)//variation of position. + loc = destination spawn(0) S.spark_system.start() @@ -127,20 +87,8 @@ In the case that they are not, I imagine the game will run-time error like crazy playsound(loc, "sparks", 50, 1) anim(loc,src,'mob.dmi',,"phasein") - spawn(0)//Any living mobs in teleport area are gibbed. Added some more types. - for(var/mob/living/M in picked) - if(M==src) continue - spawn(0) - M.gib() - for(var/obj/mecha/M in picked) - spawn(0) - M.take_damage(100, "brute") - for(var/obj/alien/facehugger/M in picked)//These really need to be mobs. - spawn(0) - M.death() - for(var/obj/livestock/M in picked) - spawn(0) - M.gib() + spawn(0) + destination.kill_creatures(src)//Any living mobs in teleport area are gibbed. Check turf procs for how it does it. S.coold = 1 S.cell.charge-=(C*10) else @@ -157,8 +105,8 @@ In the case that they are not, I imagine the game will run-time error like crazy var/C = 200 if(!ninjacost(C,1)) var/obj/item/clothing/suit/space/space_ninja/S = src:wear_suit - if(!T.density) - var/turf/mobloc = get_turf(loc) + var/turf/mobloc = get_turf(loc)//To make sure that certain things work properly below. + if(!T.density&&istype(mobloc, /turf)) spawn(0) playsound(loc, 'sparks4.ogg', 50, 1) anim(mobloc,src,'mob.dmi',,"phaseout") @@ -178,23 +126,11 @@ In the case that they are not, I imagine the game will run-time error like crazy anim(loc,src,'mob.dmi',,"phasein") spawn(0)//Any living mobs in teleport area are gibbed. - for(var/mob/living/M in T) - if(M==src) continue - spawn(0) - M.gib() - for(var/obj/mecha/M in T) - spawn(0) - M.take_damage(100, "brute") - for(var/obj/alien/facehugger/M in T)//These really need to be mobs. - spawn(0) - M.death() - for(var/obj/livestock/M in T) - spawn(0) - M.gib() + T.kill_creatures(src) S.coold = 1 S.cell.charge-=(C*10) else - src << "\red You cannot teleport into solid walls." + src << "\red You cannot teleport into solid walls or from solid matter" return //EMP Pulse @@ -289,7 +225,7 @@ In the case that they are not, I imagine the game will run-time error like crazy var/C = 200 if(!ninjacost(C)) - if(!locate(/obj/effects/energy_net) in M.loc.contents)//Check if they are already being affected by an energy net. + if(!locate(/obj/effects/energy_net) in M.loc)//Check if they are already being affected by an energy net. if(M.client)//Monkeys without a client can still step_to() and bypass the net. Also, netting inactive people is lame. for(var/turf/T in getline(loc, M.loc)) if(T==loc||T==M.loc) continue @@ -347,7 +283,7 @@ In the case that they are not, I imagine the game will run-time error like crazy set desc = "Combines the VOID-shift and CLOAK-tech devices to freely move between solid matter. Toggle on or off." set category = "Ninja Ability" - if(!usr.incorporeal_move) + if(!incorporeal_move) incorporeal_move = 2 density = 0 src << "\blue You will now phase through solid matter." @@ -366,61 +302,23 @@ Allows to gib up to five squares in a straight line. Seriously.*/ if(!ninjacost()) var/obj/item/clothing/suit/space/space_ninja/S = src:wear_suit - var/locx - var/locy - var/turf/mobloc = get_turf(loc) - var/safety = 0 - - switch(dir) - if(NORTH) - locx = mobloc.x - locy = (mobloc.y+5) - if(locy>world.maxy) - safety = 1 - if(SOUTH) - locx = mobloc.x - locy = (mobloc.y-5) - if(locy<1) - safety = 1 - if(EAST) - locy = mobloc.y - locx = (mobloc.x+5) - if(locx>world.maxx) - safety = 1 - if(WEST) - locy = mobloc.y - locx = (mobloc.x-5) - if(locx<1) - safety = 1 - else safety = 1 - if(!safety)//Cancels the teleportation if no valid turf is found. Usually when teleporting near map edge. + var/turf/destination = get_teleport_loc(loc,src,5) + var/turf/mobloc = get_turf(loc)//To make sure that certain things work properly below. + if(destination&&istype(mobloc, /turf)) say("Ai Satsugai!") - var/turf/picked = locate(locx,locy,mobloc.z) spawn(0) playsound(loc, "sparks", 50, 1) anim(mobloc,src,'mob.dmi',,"phaseout") spawn(0) - for(var/turf/T in getline(mobloc, picked)) + for(var/turf/T in getline(mobloc, destination)) spawn(0) - for(var/mob/living/M in T) - if(M==src) continue - spawn(0) - M.gib() - for(var/obj/mecha/M in T) - spawn(0) - M.take_damage(100, "brute") - for(var/obj/alien/facehugger/M in T)//These really need to be mobs. - spawn(0) - M.death() - for(var/obj/livestock/M in T) - spawn(0) - M.gib() - if(T==mobloc||T==picked) continue + T.kill_creatures(src) + if(T==mobloc||T==destination) continue spawn(0) anim(T,src,'mob.dmi',,"phasein") - loc = picked + loc = destination spawn(0) S.spark_system.start() @@ -474,8 +372,7 @@ Allows to gib up to five squares in a straight line. Seriously.*/ if(locx>world.maxx) safety = 1 else safety=1 - - if(!safety) + if(!safety&&istype(mobloc, /turf)) say("Kumo no Shinkiro!") var/turf/picked = locate(locx,locy,mobloc.z) spawn(0) @@ -504,4 +401,4 @@ Allows to gib up to five squares in a straight line. Seriously.*/ src << "\red The VOID-shift device is malfunctioning, teleportation failed." else src << "\red There are no targets in view." - return \ No newline at end of file + return diff --git a/code/game/gamemodes/extra/ninja_equipment.dm b/code/game/gamemodes/extra/ninja_equipment.dm index 6fb525f443..a134dc7661 100644 --- a/code/game/gamemodes/extra/ninja_equipment.dm +++ b/code/game/gamemodes/extra/ninja_equipment.dm @@ -35,6 +35,7 @@ ________________________________________________________________________________ /obj/item/clothing/suit/space/space_ninja/proc/killai(var/mob/living/silicon/ai/A as mob) A << "\red Self-destruct protocol dete-- *bzzzzz*" A << browse(null, "window=hack spideros") + AI = null A.death()//Kill A.ghostize()//Turn into ghost del(AI) @@ -73,7 +74,7 @@ ________________________________________________________________________________ U.bruteloss += 1 A = 200 cell.charge-=A - if(U.stat)//If the ninja falls down, they can still try and jaunt away or shift kill their opponent. + if(U.stat)//If the ninja gets paralyzed, they can still try and jaunt away (since they can adrenaline boost and then jaunt). active=0 if(cell.charge<0) if(kamikaze) @@ -91,7 +92,7 @@ ________________________________________________________________________________ set desc = "Initializes the suit for field operation." set category = "Ninja Equip" - var/mob/living/carbon/human/U = usr + var/mob/living/carbon/human/U = loc if(U.mind&&U.mind.special_role=="Space Ninja"&&U:wear_suit==src&&!initialize) verbs -= /obj/item/clothing/suit/space/space_ninja/proc/init U << "\blue Now initializing..." @@ -110,18 +111,18 @@ ________________________________________________________________________________ U << "\red ERROR: 110223 UNABLE TO LOCATE HAND GEAR\nABORTING..." return U << "\blue Securing external locking mechanism...\nNeural-net established." - U.head:canremove=0 - U.shoes:canremove=0 - U.gloves:canremove=0 + U.head.canremove=0 + U.shoes.canremove=0 + U.gloves.canremove=0 canremove=0 sleep(40) U << "\blue Extending neural-net interface...\nNow monitoring brain wave pattern..." sleep(40) if(U.stat==2||U.health<=0) U << "\red FATAL ERROR: 344--93#&&21 BRAIN WAV3 PATT$RN RED\nA-A-AB0RTING..." - U.head:canremove=1 - U.shoes:canremove=1 - U.gloves:canremove=1 + U.head.canremove=1 + U.shoes.canremove=1 + U.gloves.canremove=1 canremove=1 verbs += /obj/item/clothing/suit/space/space_ninja/proc/init return @@ -136,22 +137,7 @@ ________________________________________________________________________________ U << "\blue Primary system status: ONLINE.\nBackup system status: ONLINE.\nCurrent energy capacity: [cell.charge]." sleep(40) U << "\blue All systems operational. Welcome to SpiderOS, [U.real_name]." - U.verbs += /mob/proc/ninjashift - U.verbs += /mob/proc/ninjajaunt - U.verbs += /mob/proc/ninjasmoke - U.verbs += /mob/proc/ninjaboost - U.verbs += /mob/proc/ninjapulse - U.verbs += /mob/proc/ninjablade - U.verbs += /mob/proc/ninjastar - U.verbs += /mob/proc/ninjanet - U.mind.special_verbs += /mob/proc/ninjashift - U.mind.special_verbs += /mob/proc/ninjajaunt - U.mind.special_verbs += /mob/proc/ninjasmoke - U.mind.special_verbs += /mob/proc/ninjaboost - U.mind.special_verbs += /mob/proc/ninjapulse - U.mind.special_verbs += /mob/proc/ninjablade - U.mind.special_verbs += /mob/proc/ninjastar - U.mind.special_verbs += /mob/proc/ninjanet + U.grant_ninja_verbs() verbs += /obj/item/clothing/suit/space/space_ninja/proc/deinit verbs += /obj/item/clothing/suit/space/space_ninja/proc/spideros U.gloves.verbs += /obj/item/clothing/gloves/space_ninja/proc/drain_wire @@ -162,14 +148,14 @@ ________________________________________________________________________________ U.shoes:slowdown-- ntick(U) else - if(usr.mind&&usr.mind.special_role=="Space Ninja") - usr << "\red You do not understand how this suit functions." - else if(usr:wear_suit!=src) - usr << "\red You must be wearing the suit to use this function." + if(U.mind&&U.mind.special_role!="Space Ninja") + U << "\red You do not understand how this suit functions." + else if(U.wear_suit!=src) + U << "\red You must be wearing the suit to use this function." else if(initialize) - usr << "\red The suit is already functioning." + U << "\red The suit is already functioning." else - usr << "\red You cannot use this function at this time." + U << "\red You cannot use this function at this time." return /obj/item/clothing/suit/space/space_ninja/proc/deinit() @@ -177,45 +163,27 @@ ________________________________________________________________________________ set desc = "Begins procedure to remove the suit." set category = "Ninja Equip" + if(affecting!=loc) + return + var/mob/living/carbon/human/U = affecting if(!initialize) - usr << "\red The suit is not initialized." + U << "\red The suit is not initialized." return if(alert("Are you certain you wish to remove the suit? This will take time and remove all abilities.",,"Yes","No")=="No") return - var/mob/living/carbon/human/U = affecting verbs -= /obj/item/clothing/suit/space/space_ninja/proc/deinit U << "\blue Now de-initializing..." if(kamikaze) U << "\blue Disengaging mode...\n\blackCODE NAME: \red KAMIKAZE" - U.verbs -= /mob/proc/ninjaslayer - U.verbs -= /mob/proc/ninjawalk - U.verbs -= /mob/proc/ninjamirage - U.mind.special_verbs -= /mob/proc/ninjaslayer - U.mind.special_verbs -= /mob/proc/ninjawalk - U.mind.special_verbs -= /mob/proc/ninjamirage + U.remove_kamikaze_verbs() kamikaze = 0 unlock = 0 U.incorporeal_move = 0 U.density = 1 spideros = 0 sleep(40) - U.verbs -= /mob/proc/ninjashift - U.verbs -= /mob/proc/ninjajaunt - U.verbs -= /mob/proc/ninjasmoke - U.verbs -= /mob/proc/ninjaboost - U.verbs -= /mob/proc/ninjapulse - U.verbs -= /mob/proc/ninjablade - U.verbs -= /mob/proc/ninjastar - U.verbs -= /mob/proc/ninjanet - U.mind.special_verbs -= /mob/proc/ninjashift - U.mind.special_verbs -= /mob/proc/ninjajaunt - U.mind.special_verbs -= /mob/proc/ninjasmoke - U.mind.special_verbs -= /mob/proc/ninjaboost - U.mind.special_verbs -= /mob/proc/ninjapulse - U.mind.special_verbs -= /mob/proc/ninjablade - U.mind.special_verbs -= /mob/proc/ninjastar - U.mind.special_verbs -= /mob/proc/ninjanet + U.remove_ninja_verbs() U << "\blue Logging off, [U:real_name]. Shutting down SpiderOS." verbs -= /obj/item/clothing/suit/space/space_ninja/proc/spideros sleep(40) @@ -233,8 +201,6 @@ ________________________________________________________________________________ U << "\red #2#" spawn(30) U << "\red #1#: G00DBYE" - if(AI) - killai(AI) U.gib() return U << "\blue Disconnecting neural-net interface...\greenSuccess\blue." @@ -244,7 +210,7 @@ ________________________________________________________________________________ if(istype(U.head, /obj/item/clothing/head/helmet/space/space_ninja)) U.head.canremove=1 if(istype(U.shoes, /obj/item/clothing/shoes/space_ninja)) - U.shoes:canremove=1 + U.shoes.canremove=1 U.shoes:slowdown++ if(istype(U.gloves, /obj/item/clothing/gloves/space_ninja)) U.gloves.icon_state = "s-ninja" @@ -419,7 +385,7 @@ ________________________________________________________________________________ var/laws dat += "

AI Control:

" var/mob/living/silicon/ai/A = AI - if(AI)//If an AI exists, in case it gets purged. + if(AI)//If an AI exists, in case it gets purged while on this screen. dat += "Stored AI: [A.name]
" dat += "System integrity: [(A.health+100)/2]%
" @@ -591,22 +557,7 @@ ________________________________________________________________________________ U.gloves.verbs -= /obj/item/clothing/gloves/space_ninja/proc/drain_wire U.gloves.verbs -= /obj/item/clothing/gloves/space_ninja/proc/toggled U.update_clothing() - U.verbs -= /mob/proc/ninjashift - U.verbs -= /mob/proc/ninjajaunt - U.verbs -= /mob/proc/ninjapulse - U.verbs -= /mob/proc/ninjastar - U.verbs -= /mob/proc/ninjanet - U.mind.special_verbs -= /mob/proc/ninjashift - U.mind.special_verbs -= /mob/proc/ninjajaunt - U.mind.special_verbs -= /mob/proc/ninjapulse - U.mind.special_verbs -= /mob/proc/ninjastar - U.mind.special_verbs -= /mob/proc/ninjanet - U.verbs += /mob/proc/ninjaslayer - U.verbs += /mob/proc/ninjawalk - U.verbs += /mob/proc/ninjamirage - U.mind.special_verbs += /mob/proc/ninjaslayer - U.mind.special_verbs += /mob/proc/ninjawalk - U.mind.special_verbs += /mob/proc/ninjamirage + U.grant_kamikaze_verbs() U.ninjablade() message_admins("\blue [U.key] used KAMIKAZE mode.", 1) else @@ -728,17 +679,17 @@ ________________________________________________________________________________ spideros()//Refreshes the screen by calling it again (which replaces current screen with new screen). else//If they are not in control. - var/mob/living/silicon/ai/AI = usr + var/mob/living/silicon/ai/A = AI //While AI has control, the person can't take off the suit so checking here would be moot. if(isnull(src))//If they AI dies/suit destroyed. - AI << browse(null, "window=hack spideros") + A << browse(null, "window=hack spideros") return - var/obj/proc_holder/ai_hack_ninja/ninja_spideros = locate() in AI//What is the object granting access to proc? Find it. + var/obj/proc_holder/ai_hack_ninja/ninja_spideros = locate() in A//What is the object granting access to proc? Find it. switch(href_list["choice"]) if("Close") - AI << browse(null, "window=hack spideros") + A << browse(null, "window=hack spideros") return if("Refresh")//Refresh, goes to the end of the proc. if("Return")//Return @@ -753,7 +704,7 @@ ________________________________________________________________________________ U.electrocute_act(damage, src,0.1,1)//The last argument is a safety for the human proc that checks for gloves. cell.charge -= damage else - AI << "\red ERROR: \black Not enough energy remaining." + A << "\red ERROR: \black Not enough energy remaining." if("0")//Menus are numbers, see note above. 0 is the hub. spideros=0 if("1")//Begin normal menus 1-9. @@ -769,13 +720,13 @@ ________________________________________________________________________________ var/t = input(U, "Please enter untraceable message.") as text t = copytext(sanitize(t), 1, MAX_MESSAGE_LEN) if(!t||affecting!=U||!initialize)//Wow, another one of these. Man... - AI << browse(null, "window=hack spideros") + A << browse(null, "window=hack spideros") return if(isnull(P)||P.toff)//So it doesn't freak out if the object no-longer exists. - AI << "\red Error: unable to deliver message." + A << "\red Error: unable to deliver message." ninja_spideros.Click() return - P.tnote += "← From [AI]:
[t]
"//Oh ai, u so silly + P.tnote += "← From [A]:
[t]
"//Oh ai, u so silly if (!P.silent) playsound(P.loc, 'twobeep.ogg', 50, 1) for (var/mob/O in hearers(3, P.loc)) @@ -783,54 +734,54 @@ ________________________________________________________________________________ P.overlays = null P.overlays += image('pda.dmi', "pda-r") if("Unlock Kamikaze") - AI << "\red ERROR: \black TARANTULA.v.4.77.12 encryption algorithm detected. Unable to decrypt archive. \n Aborting..." + A << "\red ERROR: \black TARANTULA.v.4.77.12 encryption algorithm detected. Unable to decrypt archive. \n Aborting..." if("Dylovene") if(!reagents.get_reagent_amount("anti_toxin")) - AI << "\red Error: the suit cannot perform this function. Out of dylovene." + A << "\red Error: the suit cannot perform this function. Out of dylovene." else reagents.reaction(U, 2) reagents.trans_id_to(U, "anti_toxin", transfera) - AI << "Injecting..." + A << "Injecting..." U << "You feel a tiny prick and a sudden rush of liquid in to your veins." if("Dexalin Plus") if(!reagents.get_reagent_amount("dexalinp")) - AI << "\red Error: the suit cannot perform this function. Out of dexalinp." + A << "\red Error: the suit cannot perform this function. Out of dexalinp." else reagents.reaction(U, 2) reagents.trans_id_to(U, "dexalinp", transfera) - AI << "Injecting..." + A << "Injecting..." U << "You feel a tiny prick and a sudden rush of liquid in to your veins." if("Tricordazine") if(!reagents.get_reagent_amount("tricordrazine")) - AI << "\red Error: the suit cannot perform this function. Out of tricordrazine." + A << "\red Error: the suit cannot perform this function. Out of tricordrazine." else reagents.reaction(U, 2) reagents.trans_id_to(U, "tricordrazine", transfera) - AI << "Injecting..." + A << "Injecting..." U << "You feel a tiny prick and a sudden rush of liquid in to your veins." if("Spacelin") if(!reagents.get_reagent_amount("spaceacillin")) - AI << "\red Error: the suit cannot perform this function. Out of spaceacillin." + A << "\red Error: the suit cannot perform this function. Out of spaceacillin." else reagents.reaction(U, 2) reagents.trans_id_to(U, "spaceacillin", transfera) - AI << "Injecting..." + A << "Injecting..." U << "You feel a tiny prick and a sudden rush of liquid in to your veins." if("Radium") if((reagents.get_reagent_amount("radium"))<=60)//Special case. If there are only 60 radium units left. - AI << "\red Error: the suit cannot perform this function. Out of radium." + A << "\red Error: the suit cannot perform this function. Out of radium." else reagents.reaction(U, 2) reagents.trans_id_to(U, "radium", transfera) - AI << "Injecting..." + A << "Injecting..." U << "You feel a tiny prick and a sudden rush of liquid in to your veins." if("Nutriment") if(!reagents.get_reagent_amount("nutriment")) - AI << "\red Error: the suit cannot perform this function. Out of nutriment." + A << "\red Error: the suit cannot perform this function. Out of nutriment." else reagents.reaction(U, 2) reagents.trans_id_to(U, "nutriment", 5) - AI << "Injecting..." + A << "Injecting..." U << "You feel a tiny prick and a sudden rush of substance in to your veins." ninja_spideros.Click()//Calls spideros for AI. return @@ -839,19 +790,20 @@ ________________________________________________________________________________ set src in view() ..() if(initialize) + var/mob/living/carbon/human/U = affecting if(control) - usr << "All systems operational. Current energy capacity: [cell.charge]." + U << "All systems operational. Current energy capacity: [cell.charge]." if(!kamikaze) if(active) - usr << "The CLOAK-tech device is active." + U << "The CLOAK-tech device is active." else - usr << "The CLOAK-tech device is inactive." + U << "The CLOAK-tech device is inactive." else - usr << "\red KAMIKAZE MODE ENGAGED!" - usr << "There are [sbombs] smoke bombs remaining." - usr << "There are [aboost] adrenaline boosters remaining." + U << "\red KAMIKAZE MODE ENGAGED!" + U << "There are [sbombs] smoke bombs remaining." + U << "There are [aboost] adrenaline boosters remaining." else - usr << "ERR0R DATAA NoT FOUND 3RROR" + U << "ERR0R DATAA NoT FOUND 3RROR" //GLOVES=================================== @@ -859,12 +811,14 @@ ________________________________________________________________________________ set name = "Toggle Interaction" set desc = "Toggles special interaction on or off." set category = "Ninja Equip" + + var/mob/living/carbon/human/U = loc if(!candrain) candrain=1 - usr << "You enable special interaction." + U << "You enable special interaction." else candrain=0 - usr << "You disable special interaction." + U << "You disable special interaction." //DRAINING PROCS START=================================== @@ -874,7 +828,7 @@ ________________________________________________________________________________ set category = "Ninja Equip" var/obj/cable/attached - var/mob/living/carbon/human/U = usr + var/mob/living/carbon/human/U = loc if(candrain&&!draining) var/turf/T = U.loc if(isturf(T) && T.is_plating()) @@ -891,7 +845,7 @@ ________________________________________________________________________________ /obj/item/clothing/gloves/space_ninja/proc/drain(var/target_type as text, var/target, var/obj/suit, var/obj/gloves) //Var Initialize - var/mob/living/carbon/human/U = usr + var/mob/living/carbon/human/U = loc var/obj/item/clothing/suit/space/space_ninja/S = suit var/obj/item/clothing/gloves/space_ninja/G = gloves @@ -1114,10 +1068,11 @@ ________________________________________________________________________________ set src in view() ..() if(!canremove) + var/mob/living/carbon/human/U = loc if(candrain) - usr << "The energy drain mechanism is: active." + U << "The energy drain mechanism is: active." else - usr << "The energy drain mechanism is: inactive." + U << "The energy drain mechanism is: inactive." //MASK=================================== @@ -1129,6 +1084,8 @@ ________________________________________________________________________________ set name = "Toggle Voice" set desc = "Toggles the voice synthesizer on or off." set category = "Ninja Equip" + + var/mob/U = loc//Can't toggle voice when you're not wearing the mask. var/vchange = (alert("Would you like to synthesize a new name or turn off the voice synthesizer?",,"New Name","Turn Off")) if(vchange=="New Name") var/chance = rand(1,100) @@ -1152,20 +1109,20 @@ ________________________________________________________________________________ if(91 to 100)//Small chance of an existing crew name. var/list/names = new() for(var/mob/living/carbon/human/M in world) - if(M==usr||!M.client||!M.real_name) continue + if(M==U||!M.client||!M.real_name) continue names.Add(M) if(!names.len) voice = "Cuban Pete"//Smallest chance to be the man. else var/mob/picked = pick(names) voice = picked.real_name - usr << "You are now mimicking [voice]." + U << "You are now mimicking [voice]." else if(voice!="Unknown") - usr << "You deactivate the voice synthesizer." + U << "You deactivate the voice synthesizer." voice = "Unknown" else - usr << "The voice synthesizer is already deactivated." + U << "The voice synthesizer is already deactivated." return /obj/item/clothing/mask/gas/voice/space_ninja/proc/switchm() @@ -1173,24 +1130,27 @@ ________________________________________________________________________________ set desc = "Switches between Night Vision, Meson, or Thermal vision modes." set category = "Ninja Equip" //Have to reset these manually since life.dm is retarded like that. Go figure. + //This will only work for humans since only they have the appropriate code for the mask. + var/mob/U = loc switch(mode) if(1) mode=2 - usr.see_in_dark = 2 - usr << "Switching mode to Thermal Scanner." + U.see_in_dark = 2 + U << "Switching mode to Thermal Scanner." if(2) mode=3 - usr.see_invisible = 0 - usr.sight &= ~SEE_MOBS - usr << "Switching mode to Meson Scanner." + U.see_invisible = 0 + U.sight &= ~SEE_MOBS + U << "Switching mode to Meson Scanner." if(3) mode=1 - usr.sight &= ~SEE_TURFS - usr << "Switching mode to Night Vision." + U.sight &= ~SEE_TURFS + U << "Switching mode to Night Vision." /obj/item/clothing/mask/gas/voice/space_ninja/examine() set src in view() ..() + var/mode = "Night Vision" var/voice = "inactive" switch(mode) @@ -1204,7 +1164,7 @@ ________________________________________________________________________________ voice = "inactive" else voice = "active" - usr << "[mode] is active." + usr << "[mode] is active."//Leaving usr here since it may be on the floor or on a person. usr << "Voice mimicking algorithm is set to [voice]." //ENERGY NET=================================== @@ -1229,7 +1189,7 @@ The sprite for the net is kind of ugly but I couldn't come up with a better one. anchored = 1//Can't drag/grab. var/health = 25//How much health it has. var/mob/living/affecting = null//Who it is currently affecting, if anyone. - var/mob/living/master = null//Who shot the net. Will let this person know if net was successful or failed. + var/mob/living/master = null//Who shot web. Will let this person know if the net was successful or failed. /obj/effects/energy_net/proc/healthcheck() if(health <=0) @@ -1351,6 +1311,7 @@ The sprite for the net is kind of ugly but I couldn't come up with a better one. anim(M.loc,M,'mob.dmi',,"phaseout") M.loc = pick(prisonwarp)//Throw mob in prison. + density = 0//Make the net pass-through. invisibility = 101//Make the net invisible so all the animations can play out. health = INFINITY//Make the net invincible so that an explosion/something else won't kill it while, spawn() is running. diff --git a/code/game/gamemodes/extra/space_ninja.dm b/code/game/gamemodes/extra/space_ninja.dm index 2ffd3343ed..8f27be79d9 100644 --- a/code/game/gamemodes/extra/space_ninja.dm +++ b/code/game/gamemodes/extra/space_ninja.dm @@ -9,18 +9,18 @@ ________________________________________________________________________________ /client/proc/space_ninja() set category = "Fun" set name = "Spawn Space Ninja" - set desc = "Spawns a space ninja for when you need a teenager with attitude." - if(!src.authenticated || !src.holder) + set desc = "Spawns a space ninja for when you need a teenager with an attitude." + if(!authenticated || !holder) src << "Only administrators may use this command." return - if(!ticker.mode)//Apparently, this doesn't actually prevent anything. Huh + if(!ticker.mode) alert("The game hasn't started yet!") return if(alert("Are you sure you want to send in a space ninja?",,"Yes","No")=="No") return TRYAGAIN - var/input = input(usr, "Please specify which mission the space ninja shall undertake.", "Specify Mission", "") + var/input = input(src, "Please specify which mission the space ninja shall undertake.", "Specify Mission", "") if(!input) goto TRYAGAIN @@ -38,12 +38,12 @@ ________________________________________________________________________________ new_ninja.create_ninja() - var/admin_name = src//In case admins want to spawn themselves as ninjas. Badmins + var/admin_name = src var/mob/dead/observer/G var/list/candidates = list() for(G in world) - if(G.client) + if(G.client&&!G.client.holder) if(((G.client.inactivity/10)/60) <= 5) candidates.Add(G) if(candidates.len) @@ -65,7 +65,7 @@ ________________________________________________________________________________ message_admins("\blue [admin_name] has spawned [new_ninja.key] as a Space Ninja. Hide yo children!", 1) log_admin("[admin_name] used Spawn Space Ninja.") -mob/proc/create_ninja() +/mob/proc/create_ninja() var/mob/living/carbon/human/new_ninja = src var/ninja_title = pick(ninja_titles) var/ninja_name = pick(ninja_names) @@ -93,6 +93,82 @@ mob/proc/create_ninja() new_ninja.equip_if_possible(new /obj/item/weapon/plastique(new_ninja), new_ninja.slot_l_store) new_ninja.equip_if_possible(new /obj/item/weapon/tank/emergency_oxygen(new_ninja), new_ninja.slot_s_store) +/mob/proc/grant_ninja_verbs() + verbs += /mob/proc/ninjashift + verbs += /mob/proc/ninjajaunt + verbs += /mob/proc/ninjasmoke + verbs += /mob/proc/ninjaboost + verbs += /mob/proc/ninjapulse + verbs += /mob/proc/ninjablade + verbs += /mob/proc/ninjastar + verbs += /mob/proc/ninjanet + mind.special_verbs += /mob/proc/ninjashift + mind.special_verbs += /mob/proc/ninjajaunt + mind.special_verbs += /mob/proc/ninjasmoke + mind.special_verbs += /mob/proc/ninjaboost + mind.special_verbs += /mob/proc/ninjapulse + mind.special_verbs += /mob/proc/ninjablade + mind.special_verbs += /mob/proc/ninjastar + mind.special_verbs += /mob/proc/ninjanet + return + +/mob/proc/remove_ninja_verbs() + verbs -= /mob/proc/ninjashift + verbs -= /mob/proc/ninjajaunt + verbs -= /mob/proc/ninjasmoke + verbs -= /mob/proc/ninjaboost + verbs -= /mob/proc/ninjapulse + verbs -= /mob/proc/ninjablade + verbs -= /mob/proc/ninjastar + verbs -= /mob/proc/ninjanet + mind.special_verbs -= /mob/proc/ninjashift + mind.special_verbs -= /mob/proc/ninjajaunt + mind.special_verbs -= /mob/proc/ninjasmoke + mind.special_verbs -= /mob/proc/ninjaboost + mind.special_verbs -= /mob/proc/ninjapulse + mind.special_verbs -= /mob/proc/ninjablade + mind.special_verbs -= /mob/proc/ninjastar + mind.special_verbs -= /mob/proc/ninjanet + return + +/mob/proc/grant_kamikaze_verbs() + verbs -= /mob/proc/ninjashift + verbs -= /mob/proc/ninjajaunt + verbs -= /mob/proc/ninjapulse + verbs -= /mob/proc/ninjastar + verbs -= /mob/proc/ninjanet + mind.special_verbs -= /mob/proc/ninjashift + mind.special_verbs -= /mob/proc/ninjajaunt + mind.special_verbs -= /mob/proc/ninjapulse + mind.special_verbs -= /mob/proc/ninjastar + mind.special_verbs -= /mob/proc/ninjanet + verbs += /mob/proc/ninjaslayer + verbs += /mob/proc/ninjawalk + verbs += /mob/proc/ninjamirage + mind.special_verbs += /mob/proc/ninjaslayer + mind.special_verbs += /mob/proc/ninjawalk + mind.special_verbs += /mob/proc/ninjamirage + return + +/mob/proc/remove_kamikaze_verbs() + verbs += /mob/proc/ninjashift + verbs += /mob/proc/ninjajaunt + verbs += /mob/proc/ninjapulse + verbs += /mob/proc/ninjastar + verbs += /mob/proc/ninjanet + mind.special_verbs += /mob/proc/ninjashift + mind.special_verbs += /mob/proc/ninjajaunt + mind.special_verbs += /mob/proc/ninjapulse + mind.special_verbs += /mob/proc/ninjastar + mind.special_verbs += /mob/proc/ninjanet + verbs -= /mob/proc/ninjaslayer + verbs -= /mob/proc/ninjawalk + verbs -= /mob/proc/ninjamirage + mind.special_verbs -= /mob/proc/ninjaslayer + mind.special_verbs -= /mob/proc/ninjawalk + mind.special_verbs -= /mob/proc/ninjamirage + return + //AI COUNTER HACKING=================================== //I've tried a lot of stuff but adding verbs to the AI while inside an object, inside another object, did not want to work properly. @@ -236,6 +312,9 @@ mob/proc/create_ninja() A << browse(dat,"window=hack spideros;size=400x444;border=1;can_resize=0;can_close=0;can_minimize=0") + + + //DEBUG=================================== /* diff --git a/code/game/gamemodes/game_mode.dm b/code/game/gamemodes/game_mode.dm index 389f095837..57a0f834cd 100644 --- a/code/game/gamemodes/game_mode.dm +++ b/code/game/gamemodes/game_mode.dm @@ -56,7 +56,9 @@ /datum/game_mode/proc/send_intercept() -/datum/game_mode/proc/equip_traitor(mob/living/carbon/human/traitor_mob) +/*Added a safety check for traitor keywords. +Rev-heads won't get them. Can be expanded otherwise.*/ +/datum/game_mode/proc/equip_traitor(mob/living/carbon/human/traitor_mob, var/safety = 0) if (!istype(traitor_mob)) return if (traitor_mob.mind) @@ -132,16 +134,17 @@ traitor_mob << "The Syndicate have cunningly disguised a Syndicate Uplink as your [R.name] [loc]. Simply enter the code \"[pda_pass]\" into the ringtone select to unlock its hidden features." traitor_mob.mind.store_memory("Uplink Passcode: [pda_pass] ([R.name] [loc]).") //Begin code phrase. - traitor_mob << "The Syndicate provided you with the following information on how to identify other agents:" - if(prob(80)) - traitor_mob << "\red Code Phrase: \black [syndicate_code_phrase]" - traitor_mob.mind.store_memory("Code Phrase: [syndicate_code_phrase]") - else - traitor_mob << "Unfortunetly, the Syndicate did not provide you with a code phrase." - if(prob(80)) - traitor_mob << "\red Code Response: \black [syndicate_code_response]" - traitor_mob.mind.store_memory("Code Response: [syndicate_code_response]") - else - traitor_mob << "Unfortunetly, the Syndicate did not provide you with a code response." - traitor_mob << "Use the code words in the order provided, during regular conversation, to identify other agents. Proceed with caution, however, as everyone is a potential foe." + if(!safety)//If they are not a rev. Can be added on to. + traitor_mob << "The Syndicate provided you with the following information on how to identify other agents:" + if(prob(80)) + traitor_mob << "\red Code Phrase: \black [syndicate_code_phrase]" + traitor_mob.mind.store_memory("Code Phrase: [syndicate_code_phrase]") + else + traitor_mob << "Unfortunetly, the Syndicate did not provide you with a code phrase." + if(prob(80)) + traitor_mob << "\red Code Response: \black [syndicate_code_response]" + traitor_mob.mind.store_memory("Code Response: [syndicate_code_response]") + else + traitor_mob << "Unfortunetly, the Syndicate did not provide you with a code response." + traitor_mob << "Use the code words in the order provided, during regular conversation, to identify other agents. Proceed with caution, however, as everyone is a potential foe." //End code phrase. \ No newline at end of file diff --git a/code/game/gamemodes/revolution/revolution.dm b/code/game/gamemodes/revolution/revolution.dm index 59de7f4aac..60cfadba31 100644 --- a/code/game/gamemodes/revolution/revolution.dm +++ b/code/game/gamemodes/revolution/revolution.dm @@ -58,7 +58,7 @@ rev_obj.find_target_by_role(head_mind.assigned_role) rev_mind.objectives += rev_obj - equip_traitor(rev_mind.current) //changing how revs get assigned their uplink so they can get PDA uplinks. --NEO + equip_traitor(rev_mind.current, 1) //changing how revs get assigned their uplink so they can get PDA uplinks. --NEO equip_revolutionary(rev_mind.current) update_rev_icons_added(rev_mind) diff --git a/code/game/gamemodes/traitor/traitor.dm b/code/game/gamemodes/traitor/traitor.dm index 5bec324c71..7cfff9993f 100644 --- a/code/game/gamemodes/traitor/traitor.dm +++ b/code/game/gamemodes/traitor/traitor.dm @@ -190,6 +190,21 @@ killer:set_zeroth_law(law) killer << "New law: 0. [law]" + //Begin code phrase. + killer << "The Syndicate provided you with the following information on how to identify their agents:" + if(prob(80)) + killer << "\red Code Phrase: \black [syndicate_code_phrase]" + killer.mind.store_memory("Code Phrase: [syndicate_code_phrase]") + else + killer << "Unfortunetly, the Syndicate did not provide you with a code phrase." + if(prob(80)) + killer << "\red Code Response: \black [syndicate_code_response]" + killer.mind.store_memory("Code Response: [syndicate_code_response]") + else + killer << "Unfortunetly, the Syndicate did not provide you with a code response." + killer << "Use the code words in the order provided, during regular conversation, to identify other agents. Proceed with caution, however, as everyone is a potential foe." + //End code phrase. + /datum/game_mode/traitor/proc/get_mob_list() var/list/mobs = list() for(var/mob/living/player in world) diff --git a/code/game/jobs/jobprocs.dm b/code/game/jobs/jobprocs.dm index de222e552e..dce01554be 100644 --- a/code/game/jobs/jobprocs.dm +++ b/code/game/jobs/jobprocs.dm @@ -281,26 +281,37 @@ // src.see_invisible = 15 -- Doesn't work as see_invisible is reset every world cycle. -- Skie //The two procs below allow the Chaplain to choose their religion. All it really does is change their bible. spawn(0) - var/religion_name = "Imperium" - var/new_religion = input(src, "You are the Chaplain. Would you like to change your religion? Default is the Imperial Cult.", "Name change", religion_name) + var/religion_name = "Christianity" + var/new_religion = input(src, "You are the Chaplain. Would you like to change your religion? Default is Christianity, in SPACE.", "Name change", religion_name) - if ((length(new_religion) == 0) || (new_religion == "Imperium")) + if ((length(new_religion) == 0) || (new_religion == "Christianity")) new_religion = religion_name if (new_religion) if (length(new_religion) >= 26) new_religion = copytext(new_religion, 1, 26) new_religion = dd_replacetext(new_religion, ">", "'") - if(new_religion == "Imperium") - B.name = "Uplifting Primer" - else - B.name = "The Holy Book of [new_religion]" + switch(new_religion) + if("Christianity") + B.name = pick("The Holy Bible","The Dead Sea Scrolls") + if("Satanism") + B.name = pick("The Unholy Bible","The Necronomicon") + if("Islam") + B.name = "Quaran" + if("Scientology") + B.name = pick("The Biography of L. Ron Hubbard","Dianetics") + if("Chaos") + B.name = "Space Station 13: The Musical" + if("Imperium") + B.name = "Uplifting Primer" + else + B.name = "The Holy Book of [new_religion]" spawn(1) - var/deity_name = "Emperor" - var/new_deity = input(src, "Would you like to change your deity? Default is the God Emperor of Mankind.", "Name change", deity_name) + var/deity_name = "Space Jesus" + var/new_deity = input(src, "Would you like to change your deity? Default is Space Jesus.", "Name change", deity_name) - if ( (length(new_deity) == 0) || (new_deity == "God Emperor of Mankind") ) + if ( (length(new_deity) == 0) || (new_deity == "Space Jesus") ) new_deity = deity_name if(new_deity) diff --git a/code/game/turf.dm b/code/game/turf.dm index 730027c01d..6d187218c7 100644 --- a/code/game/turf.dm +++ b/code/game/turf.dm @@ -1204,4 +1204,20 @@ turf/simulated/floor/proc/update_icon() else new /turf/simulated/floor/vault(locate(i,j,z),type) - del(src) \ No newline at end of file + del(src) + +/turf/proc/kill_creatures(mob/U = null)//Will kill people/creatures and damage mechs./N +//Useful to batch-add creatures to the list. + for(var/mob/living/M in src) + if(M==U) continue//Will not harm U. Since null != M, can be excluded to kill everyone. + spawn(0) + M.gib() + for(var/obj/mecha/M in src)//Mecha are not gibbed but are damaged. + spawn(0) + M.take_damage(100, "brute") + for(var/obj/alien/facehugger/M in src)//These really need to be mobs. + spawn(0) + M.death() + for(var/obj/livestock/M in src) + spawn(0) + M.gib() \ No newline at end of file diff --git a/code/modules/admin/admin.dm b/code/modules/admin/admin.dm index 5a5fec603d..a4d333d90b 100644 --- a/code/modules/admin/admin.dm +++ b/code/modules/admin/admin.dm @@ -2095,6 +2095,22 @@ var/showadminmessages = 1 M:set_zeroth_law(law) for(var/mob/living/silicon/O in world) O << "New law: 0. [law]" + + //Begin code phrase. + M << "The Syndicate provided you with the following information on how to identify their agents:" + if(prob(80)) + M << "\red Code Phrase: \black [syndicate_code_phrase]" + M.mind.store_memory("Code Phrase: [syndicate_code_phrase]") + else + M << "Unfortunetly, the Syndicate did not provide you with a code phrase." + if(prob(80)) + M << "\red Code Response: \black [syndicate_code_response]" + M.mind.store_memory("Code Response: [syndicate_code_response]") + else + M << "Unfortunetly, the Syndicate did not provide you with a code response." + M << "Use the code words in the order provided, during regular conversation, to identify their agents. Proceed with caution, however, as everyone is a potential foe." + //End code phrase. + if(mode) log_admin("[key_name(usr)] has made [key_name(M)] a traitor.") message_admins("\blue [key_name_admin(usr)] has made [key_name_admin(M)] a traitor. Objective is: [objective]", 1) diff --git a/code/modules/power/singularity/field_generator.dm b/code/modules/power/singularity/field_generator.dm index 244700ecd0..80b84c9cf3 100644 --- a/code/modules/power/singularity/field_generator.dm +++ b/code/modules/power/singularity/field_generator.dm @@ -1,22 +1,34 @@ +/* +field_generator power level display + The icon used for the field_generator need to have 'num_power_levels' number of icon states + named 'Field_Gen +p[num]' where 'num' ranges from 1 to 'num_power_levels' + + The power level is displayed using overlays. The current displayed power level is stored in 'powerlevel'. + The overlay in use and the powerlevel variable must be kept in sync. A powerlevel equal to 0 means that + no power level overlay is currently in the overlays list. + -Aygar +*/ + #define field_generator_max_power 250 /obj/machinery/field_generator name = "Field Generator" desc = "A large thermal battery that projects a high amount of energy when powered." - icon = 'singularity.dmi' + icon = 'field_generator.dmi' icon_state = "Field_Gen" anchored = 0 density = 1 req_access = list(access_engine) use_power = 0 var + const/num_power_levels = 15 // Total number of power level icon has Varedit_start = 0 Varpower = 0 active = 0 - power = 20 + power = 20 // Current amount of power state = 0 warming_up = 0 - powerlevel = 0 + powerlevel = 0 // Current Power level in overlays list list/obj/machinery/containment_field/fields list/obj/machinery/field_generator/connected_gens clean_up = 0 @@ -24,20 +36,33 @@ update_icon() if (!active) - icon_state = "Field_Gen" - return - var/level = 3 - switch (power) - if(0 to 60) - level = 1 - if(61 to 220) - level = 2 - if(221 to INFINITY) - level = 3 - level = min(level,warming_up) + //Set icon_state has not been set, set to "Field_Gen" + if (icon_state != "Field_Gen") + icon_state = "Field_Gen" + warming_up = 0 + else + //If necessary update icon_state to correct value + if (warming_up && icon_state != "Field_Gen +a[warming_up]") + icon_state = "Field_Gen +a[warming_up]" + + // Power level indicator + // Scale % power to % num_power_levels and truncate value + var/level = round(num_power_levels * power / field_generator_max_power) + // Clamp between 0 and num_power_levels for out of range power values + level = between(0, level, num_power_levels) + + // Do nothing unless new level is diffrent the powerlevel if (powerlevel!=level) + // If old power overlay exists remove it + if (powerlevel) + // Remove old powerlevel overlay from overlays + overlays -= "Field_Gen +p[powerlevel]" + powerlevel = level - icon_state = "Field_Gen +a[powerlevel]" + + // If new power level exists add it to overlays + if (powerlevel) + overlays += "Field_Gen +p[powerlevel]" New() @@ -48,17 +73,19 @@ process() - if(src.Varedit_start == 1) - if(src.active == 0) - src.active = 1 - src.state = 2 - src.power = field_generator_max_power - src.anchored = 1 - src.warming_up = 3 + if(Varedit_start == 1) + if(active == 0) + active = 1 + state = 2 + power = field_generator_max_power + anchored = 1 + warming_up = 3 turn_on() Varedit_start = 0 - if(src.active == 2) - calc_power() + if(src.active == 2) + calc_power() + else + update_icon() return @@ -170,16 +197,15 @@ proc turn_off() - src.active = 0 + active = 0 spawn(1) src.cleanup() update_icon() turn_on() - src.active = 1 + active = 1 warming_up = 1 - powerlevel = 0 spawn(1) while (warming_up<3 && active) sleep(50) diff --git a/icons/obj/machines/field_generator.dmi b/icons/obj/machines/field_generator.dmi new file mode 100644 index 0000000000..506656fee8 Binary files /dev/null and b/icons/obj/machines/field_generator.dmi differ diff --git a/tgstation.dme b/tgstation.dme index 302564413d..2f784f9d69 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -448,7 +448,6 @@ #include "code\game\mecha\combat\gygax.dm" #include "code\game\mecha\combat\honker.dm" #include "code\game\mecha\combat\marauder.dm" -#include "code\game\mecha\combat\phazon.dm" #include "code\game\mecha\equipment\mecha_equipment.dm" #include "code\game\mecha\equipment\tools\tools.dm" #include "code\game\mecha\equipment\weapons\weapons.dm"