diff --git a/code/modules/events/ninja.dm b/code/modules/events/ninja.dm index 961a2d771d9..074064631bf 100644 --- a/code/modules/events/ninja.dm +++ b/code/modules/events/ninja.dm @@ -587,295 +587,6 @@ ________________________________________________________________________________ s_control = 1 -//=======//OLD & UNUSED//=======// - -/* - -Deprecated. get_dir() does the same thing. Still a nice proc. -Returns direction that the mob or whomever should be facing in relation to the target. -This proc does not grant absolute direction and is mostly useful for 8dir sprite positioning. -I personally used it with getline() to great effect. -/proc/get_dir_to(turf/start,turf/end)//N - var/xdiff = start.x - end.x//The sign is important. - var/ydiff = start.y - end.y - - var/direction_x = xdiff<1 ? 4:8//East - west - var/direction_y = ydiff<1 ? 1:2//North - south - var/direction_xy = xdiff==0 ? -4:0//If x is the same, subtract 4. - var/direction_yx = ydiff==0 ? -1:0//If y is the same, subtract 1. - var/direction_f = direction_x+direction_y+direction_xy+direction_yx//Finally direction tally. - direction_f = direction_f==0 ? 1:direction_f//If direction is 0(same spot), return north. Otherwise, direction. - - return direction_f - -Alternative and inferior method of calculating spideros. -var/temp = num2text(spideros) -var/return_to = copytext(temp, 1, (length(temp)))//length has to be to the length of the thing because by default it's length+1 -spideros = text2num(return_to)//Maximum length here is 6. Use (return_to, X) to specify larger strings if needed. - -//Old way of draining from wire. -/obj/item/clothing/gloves/space_ninja/proc/drain_wire() - set name = "Drain From Wire" - set desc = "Drain energy directly from an exposed wire." - set category = "Ninja Equip" - - var/obj/structure/cable/attached - var/mob/living/carbon/human/U = loc - if(candrain&&!draining) - var/turf/T = U.loc - if(isturf(T) && istype(T, /turf/simulated/floor/plating) - attached = locate() in T - if(!attached) - U << "\red Warning: no exposed cable available." - else - U << "\blue Connecting to wire, stand still..." - if(do_after(U,50)&&!isnull(attached)) - drain("WIRE",attached,U:wear_suit,src) - else - U << "\red Procedure interrupted. Protocol terminated." - return - -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. -This was the best work-around I could come up with at the time. Uses objects to then display to panel, based on the object spell system. -Can be added on to pretty easily. - -BYOND fixed the verb bugs so this is no longer necessary. I prefer verb panels. - -/obj/item/clothing/suit/space/space_ninja/proc/grant_AI_verbs() - var/obj/effect/proc_holder/ai_return_control/A_C = new(AI) - var/obj/effect/proc_holder/ai_hack_ninja/B_C = new(AI) - var/obj/effect/proc_holder/ai_instruction/C_C = new(AI) - new/obj/effect/proc_holder/ai_holo_clear(AI) - AI.proc_holder_list += A_C - AI.proc_holder_list += B_C - AI.proc_holder_list += C_C - - s_control = 0 - -/obj/item/clothing/suit/space/space_ninja/proc/remove_AI_verbs() - var/obj/effect/proc_holder/ai_return_control/A_C = locate() in AI - var/obj/effect/proc_holder/ai_hack_ninja/B_C = locate() in AI - var/obj/effect/proc_holder/ai_instruction/C_C = locate() in AI - var/obj/effect/proc_holder/ai_holo_clear/D_C = locate() in AI - qdel(A_C) - qdel(B_C) - qdel(C_C) - qdel(D_C) - AI.proc_holder_list = list() - verbs += /obj/item/clothing/suit/space/space_ninja/proc/deinit - verbs += /obj/item/clothing/suit/space/space_ninja/proc/spideros - verbs += /obj/item/clothing/suit/space/space_ninja/proc/stealth - - s_control = 1 - -//Workaround -/obj/effect/proc_holder/ai_holo_clear - name = "Clear Hologram" - desc = "Stops projecting the current holographic image." - panel = "AI Ninja Equip" - density = 0 - opacity = 0 - - -/obj/effect/proc_holder/ai_holo_clear/Click() - var/obj/item/clothing/suit/space/space_ninja/S = loc.loc//This is so stupid but makes sure certain things work. AI.SUIT - qdel(S.hologram.i_attached) - qdel(S.hologram) - var/obj/effect/proc_holder/ai_holo_clear/D_C = locate() in S.AI - S.AI.proc_holder_list -= D_C - return - -/obj/effect/proc_holder/ai_instruction//Let's the AI know what they can do. - name = "Instructions" - desc = "Displays a list of helpful information." - panel = "AI Ninja Equip" - density = 0 - opacity = 0 - -/obj/effect/proc_holder/ai_instruction/Click() - loc << "The menu you are seeing will contain other commands if they become available.\nRight click a nearby turf to display an AI Hologram. It will only be visible to you and your host. You can move it freely using normal movement keys--it will disappear if placed too far away." - -/obj/effect/proc_holder/ai_hack_ninja//Generic proc holder to make sure the two verbs below work propely. - name = "Hack SpiderOS" - desc = "Hack directly into the Black Widow(tm) neuro-interface." - panel = "AI Ninja Equip" - density = 0 - opacity = 0 - -/obj/effect/proc_holder/ai_hack_ninja/Click()//When you click on it. - var/obj/item/clothing/suit/space/space_ninja/S = loc.loc - S.hack_spideros() - return - -/obj/effect/proc_holder/ai_return_control - name = "Relinquish Control" - desc = "Return control to the user." - panel = "AI Ninja Equip" - density = 0 - opacity = 0 - -/obj/effect/proc_holder/ai_return_control/Click() - var/mob/living/silicon/ai/A = loc - var/obj/item/clothing/suit/space/space_ninja/S = A.loc - A << browse(null, "window=hack spideros")//Close window - A << "You have seized your hacking attempt. [S.affecting] has regained control." - S.affecting << "UPDATE: [A.real_name] has ceased hacking attempt. All systems clear." - S.remove_AI_verbs() - return -*/ - -//=======//DEBUG//=======// -/* -/obj/item/clothing/suit/space/space_ninja/proc/display_verb_procs() -//DEBUG -//Does nothing at the moment. I am trying to see if it's possible to mess around with verbs as variables. - //for(var/P in verbs) -// if(P.set.name) -// usr << "[P.set.name], path: [P]" - return - - -Most of these are at various points of incomplete. - -/mob/verb/grant_object_panel() - set name = "Grant AI Ninja Verbs Debug" - set category = "Ninja Debug" - var/obj/effect/proc_holder/ai_return_control/A_C = new(src) - var/obj/effect/proc_holder/ai_hack_ninja/B_C = new(src) - usr:proc_holder_list += A_C - usr:proc_holder_list += B_C - -mob/verb/remove_object_panel() - set name = "Remove AI Ninja Verbs Debug" - set category = "Ninja Debug" - var/obj/effect/proc_holder/ai_return_control/A = locate() in src - var/obj/effect/proc_holder/ai_hack_ninja/B = locate() in src - usr:proc_holder_list -= A - usr:proc_holder_list -= B - qdel(A)//First. - qdel(B)//Second, to keep the proc going. - return - -/client/verb/grant_verb_ninja_debug1(var/mob/M in view()) - set name = "Grant AI Ninja Verbs Debug" - set category = "Ninja Debug" - - M.verbs += /mob/living/silicon/ai/verb/ninja_return_control - M.verbs += /mob/living/silicon/ai/verb/ninja_spideros - return - -/client/verb/grant_verb_ninja_debug2(var/mob/living/carbon/human/M in view()) - set name = "Grant Back Ninja Verbs" - set category = "Ninja Debug" - - M.wear_suit.verbs += /obj/item/clothing/suit/space/space_ninja/proc/deinit - M.wear_suit.verbs += /obj/item/clothing/suit/space/space_ninja/proc/spideros - return - -/obj/proc/grant_verb_ninja_debug3(var/mob/living/silicon/ai/A as mob) - set name = "Grant AI Ninja Verbs" - set category = "null" - set hidden = 1 - A.verbs -= /obj/item/clothing/suit/space/space_ninja/proc/deinit - A.verbs -= /obj/item/clothing/suit/space/space_ninja/proc/spideros - return - -/mob/verb/get_dir_to_target(var/mob/M in oview()) - set name = "Get Direction to Target" - set category = "Ninja Debug" - - world << "DIR: [get_dir_to(src.loc,M.loc)]" - return -// -/mob/verb/kill_self_debug() - set name = "DEBUG Kill Self" - set category = "Ninja Debug" - - src:death() - -/client/verb/switch_client_debug() - set name = "DEBUG Switch Client" - set category = "Ninja Debug" - - mob = mob:loc:loc - -/mob/verb/possess_mob(var/mob/M in oview()) - set name = "DEBUG Possess Mob" - set category = "Ninja Debug" - - client.mob = M - -/client/verb/switcharoo(var/mob/M in oview()) - set name = "DEBUG Switch to AI" - set category = "Ninja Debug" - - var/mob/last_mob = mob - mob = M - last_mob:wear_suit:AI:key = key -// -/client/verb/ninjaget(var/mob/M in oview()) - set name = "DEBUG Ninja GET" - set category = "Ninja Debug" - - mob = M - M.gib() - space_ninja() - -/mob/verb/set_debug_ninja_target() - set name = "Set Debug Target" - set category = "Ninja Debug" - - ninja_debug_target = src//The target is you, brohime. - world << "Target: [src]" - -/mob/verb/hack_spideros_debug() - set name = "Debug Hack Spider OS" - set category = "Ninja Debug" - - var/mob/living/silicon/ai/A = loc:AI - if(A) - if(!A.key) - A.client.mob = loc:affecting - else - loc:affecting:client:mob = A - return - -//Tests the net and what it does. -/mob/verb/ninjanet_debug() - set name = "Energy Net Debug" - set category = "Ninja Debug" - - var/obj/effect/energy_net/E = new /obj/effect/energy_net(loc) - E.layer = layer+1//To have it appear one layer above the mob. - stunned = 10//So they are stunned initially but conscious. - anchored = 1//Anchors them so they can't move. - E.affecting = src - spawn(0)//Parallel processing. - E.process(src) - return - -I made this as a test for a possible ninja ability (or perhaps more) for a certain mob to see hallucinations. -The thing here is that these guys have to be coded to do stuff as they are simply images that you can't even click on. -That is why you attached them to objects. -/mob/verb/TestNinjaShadow() - set name = "Test Ninja Ability" - set category = "Ninja Debug" - - if(client) - var/safety = 4 - for(var/turf/T in oview(5)) - if(prob(20)) - var/current_clone = image('icons/mob/mob.dmi',T,"s-ninja") - safety-- - spawn(0) - src << current_clone - spawn(300) - qdel(current_clone) - spawn while(!isnull(current_clone)) - step_to(current_clone,src,1) - sleep(5) - if(safety<=0) break - return */ //Alternate ninja speech replacement. /*This text is hilarious but also absolutely retarded.