From e68ce8721fecb53d4d0b474e61cc9cddfe61fee0 Mon Sep 17 00:00:00 2001 From: "noisomehollow@lycos.com" Date: Sun, 22 May 2011 23:48:29 +0000 Subject: [PATCH] #Finished the respawn_character proc. Use it to quickly bring a player back into the game with their previous character if they were gibbed/deleted. If you want them to make a new character, kick them out and let them rejoin. Can also be used to quickly enter the game by admins and the like. It's fairly robust so you can read the code to find out what it does (and does not). #Added a locked list to datacore in order to track character spawn, particularly for respawn_character(). May be useful in the future. #Added a proc to randomize appearance for any human mob, randomize_appearance_for(mob). It will not take into account gender as you will have to provide it. Names and so on are also randomized but that can be overwritten in the code following. #Added AI holopads around the station. To use as the AI: click on the pad to center view on it. Click again to activate the hologram. Move it with the directional keys. You can still interact with objects normally. To remove it, either move it too far out or click the pad again. Use robot talk to directly speak through the holopad (and only the holopad, unlike regular robot speak). Could be added on to (like different images for different AIs) but it's basically finished. #Fixed a bugged message on changeling transformation sting. It will no longer give away your identity. #Made law datum a silicon define. var/datum/ai_laws/laws. #A few more ninja adjustments. Added a new view mode for the ninja mask, allowing to see special roles and a few other things. git-svn-id: http://tgstation13.googlecode.com/svn/trunk@1608 316c924e-a436-60f5-8080-3fe189b3f50e --- code/defines/mob/living/silicon/ai.dm | 1 - code/defines/mob/living/silicon/hologram.dm | 9 - code/defines/mob/living/silicon/robot.dm | 3 - code/defines/mob/living/silicon/silicon.dm | 3 +- code/defines/mob/mob.dm | 14 +- code/defines/obj.dm | 8 +- code/defines/obj/clothing/mask.dm | 2 +- code/defines/obj/clothing/shoes.dm | 2 +- code/defines/obj/clothing/suit.dm | 30 +- code/defines/obj/machinery.dm | 8 +- code/defines/procs/helpers.dm | 4 +- .../gamemodes/changeling/changeling_powers.dm | 2 +- code/game/gamemodes/extra/ninja_abilities.dm | 53 +- code/game/gamemodes/extra/ninja_equipment.dm | 264 +- code/game/gamemodes/extra/space_ninja.dm | 31 +- .../game/gamemodes/malfunction/malfunction.dm | 2 +- code/game/machinery/computer/AIcore.dm | 4 +- code/game/machinery/computer/aifixer.dm | 14 +- code/game/machinery/computer/computer.dm | 27 +- code/game/machinery/hologram.dm | 240 +- code/game/machinery/recharger.dm | 2 +- code/game/mecha/mecha.dm | 6 +- code/game/objects/alien/weeds.dm | 4 - code/game/objects/devices/aicard.dm | 16 +- code/game/objects/devices/taperecorder.dm | 6 +- code/modules/admin/admin.dm | 4 +- code/modules/admin/verbs/randomverbs.dm | 175 +- code/modules/admin/verbs/striketeam.dm | 11 +- code/modules/mob/living/carbon/brain/brain.dm | 2 - code/modules/mob/living/carbon/human/death.dm | 2 +- code/modules/mob/living/carbon/human/human.dm | 2535 ++- code/modules/mob/living/carbon/human/life.dm | 564 +- code/modules/mob/living/carbon/human/say.dm | 2 - code/modules/mob/living/silicon/ai/ai.dm | 6 +- code/modules/mob/living/silicon/ai/laws.dm | 54 +- code/modules/mob/living/silicon/ai/move.dm | 8 +- .../living/silicon/aihologram/aihologram.dm | 47 - .../mob/living/silicon/aihologram/death.dm | 4 - .../mob/living/silicon/aihologram/emote.dm | 454 - .../mob/living/silicon/aihologram/examine.dm | 5 - .../mob/living/silicon/aihologram/hud.dm | 10 - .../mob/living/silicon/aihologram/laws.dm | 25 - .../mob/living/silicon/aihologram/login.dm | 10 - .../mob/living/silicon/aihologram/say.dm | 16 - code/modules/mob/living/silicon/robot/laws.dm | 4 +- .../modules/mob/living/silicon/robot/robot.dm | 4 +- code/modules/mob/living/silicon/say.dm | 48 +- code/modules/mob/new_player/new_player.dm | 46 +- code/modules/mob/new_player/preferences.dm | 360 +- code/modules/power/apc.dm | 2 +- code/modules/power/cell.dm | 2 +- code/modules/power/smes.dm | 2 +- icons/mob/hud.dmi | Bin 1753 -> 2451 bytes icons/obj/decals.dmi | Bin 17764 -> 17775 bytes maps/tgstation.2.0.7.dmm | 16104 ++++++++-------- tgstation.dme | 10 - 56 files changed, 10456 insertions(+), 10815 deletions(-) delete mode 100644 code/defines/mob/living/silicon/hologram.dm delete mode 100644 code/modules/mob/living/silicon/aihologram/aihologram.dm delete mode 100644 code/modules/mob/living/silicon/aihologram/death.dm delete mode 100644 code/modules/mob/living/silicon/aihologram/emote.dm delete mode 100644 code/modules/mob/living/silicon/aihologram/examine.dm delete mode 100644 code/modules/mob/living/silicon/aihologram/hud.dm delete mode 100644 code/modules/mob/living/silicon/aihologram/laws.dm delete mode 100644 code/modules/mob/living/silicon/aihologram/login.dm delete mode 100644 code/modules/mob/living/silicon/aihologram/say.dm diff --git a/code/defines/mob/living/silicon/ai.dm b/code/defines/mob/living/silicon/ai.dm index c4a3b045b47..44b4cea8401 100644 --- a/code/defines/mob/living/silicon/ai.dm +++ b/code/defines/mob/living/silicon/ai.dm @@ -9,7 +9,6 @@ var/obj/machinery/camera/current = null var/list/connected_robots = list() var/aiRestorePowerRoutine = 0 - var/datum/ai_laws/laws_object = null //var/list/laws = list() var/alarms = list("Motion"=list(), "Fire"=list(), "Atmosphere"=list(), "Power"=list()) var/viewalerts = 0 diff --git a/code/defines/mob/living/silicon/hologram.dm b/code/defines/mob/living/silicon/hologram.dm deleted file mode 100644 index 52621a3e4c8..00000000000 --- a/code/defines/mob/living/silicon/hologram.dm +++ /dev/null @@ -1,9 +0,0 @@ -/mob/living/silicon/aihologram - name = "AI hologram projection" - voice_name = "synthesized voice" - icon = 'mob.dmi'// - icon_state = "ai-holo" - density = 0 - incorporeal_move = 1 - var/mob/living/silicon/ai/parent_ai = null - var/datum/ai_laws/ailaws = null \ No newline at end of file diff --git a/code/defines/mob/living/silicon/robot.dm b/code/defines/mob/living/silicon/robot.dm index 222dcbf6603..a6db4ed99f3 100644 --- a/code/defines/mob/living/silicon/robot.dm +++ b/code/defines/mob/living/silicon/robot.dm @@ -18,7 +18,6 @@ var/obj/screen/inv2 = null var/obj/screen/inv3 = null - //3 Modules can be activated at any one time. var/obj/item/weapon/robot_module/module = null var/module_active = null @@ -26,7 +25,6 @@ var/module_state_2 = null var/module_state_3 = null - var/obj/item/device/radio/radio = null var/mob/living/silicon/ai/connected_ai = null var/obj/item/weapon/cell/cell = null @@ -53,6 +51,5 @@ var/killswitch_time = 60 var/weapon_lock = 0 var/weaponlock_time = 120 - var/datum/ai_laws/laws = null //Making it so borgs can have laws when there isn't an AI. var/lawupdate = 1 //Cyborgs will sync their laws with their AI by default var/lockcharge //Used when locking down a borg to preserve cell charge diff --git a/code/defines/mob/living/silicon/silicon.dm b/code/defines/mob/living/silicon/silicon.dm index 6a6529bd252..691b5d4651c 100644 --- a/code/defines/mob/living/silicon/silicon.dm +++ b/code/defines/mob/living/silicon/silicon.dm @@ -1,4 +1,5 @@ /mob/living/silicon gender = NEUTER robot_talk_understand = 1 - var/syndicate = 0 \ No newline at end of file + var/syndicate = 0 + var/datum/ai_laws/laws = null//Now... THEY ALL CAN ALL HAVE LAWS \ No newline at end of file diff --git a/code/defines/mob/mob.dm b/code/defines/mob/mob.dm index 1d8e0ad6aaf..0f9d728919d 100644 --- a/code/defines/mob/mob.dm +++ b/code/defines/mob/mob.dm @@ -27,8 +27,8 @@ // var/list/obj/hallucination/hallucinations = list() - Not used at all - Skie /*A bunch of this stuff really needs to go under their own defines instead of being globally attached to mob. - A variable should only be globally attached to turfs/objects/whatever, when they are in fact needed as such. - The current method unnecessarily clusters up the variable list, especially for humans. + A variable should only be globally attached to turfs/objects/whatever, when it is in fact needed as such. + The current method unnecessarily clusters up the variable list, especially for humans (although rearranging won't really clean it up a lot but the difference will be noticable for other mobs). I'll make some notes on where certain variable defines should probably go. Changing this around would probably require a good look-over the pre-existing code. */ @@ -102,11 +102,11 @@ var/m_intent = "run"//Living var/lastDblClick = 0 var/lastKnownIP = null - var/obj/stool/buckled = null//Living, unless you can buckle silicons. - var/obj/item/weapon/handcuffs/handcuffed = null//Living, unless you can cuff silicons. + var/obj/stool/buckled = null//Living + var/obj/item/weapon/handcuffs/handcuffed = null//Living var/obj/item/l_hand = null//Living var/obj/item/r_hand = null//Living - var/obj/item/weapon/back = null//Human + var/obj/item/weapon/back = null//Human/Monkey var/obj/item/weapon/tank/internal = null//Human/Monkey var/obj/item/weapon/storage/s_active = null//Carbon var/obj/item/clothing/mask/wear_mask = null//Carbon @@ -114,11 +114,11 @@ var/r_ch_cou = 0 var/r_Tourette = 0//Carbon var/cloneloss = 0//Carbon - var/seer = 0 //for cult//Carbon + var/seer = 0 //for cult//Carbon, probably Human var/miming = null //checks if the guy is a mime//Human var/silent = null //Can't talk. Value goes down every life proc.//Human - var/muted = null //Can't talk in any way shape or form (Even OOC or emote). An admin punishment//Human + var/muted = null //Can't talk in any way shape or form (Even OOC or emote). An admin punishment var/obj/hud/hud_used = null diff --git a/code/defines/obj.dm b/code/defines/obj.dm index ece37a89dcd..425d6592286 100644 --- a/code/defines/obj.dm +++ b/code/defines/obj.dm @@ -148,9 +148,11 @@ /obj/datacore name = "datacore" - var/list/medical = list( ) - var/list/general = list( ) - var/list/security = list( ) + var/medical[] = list() + var/general[] = list() + var/security[] = list() + //This list tracks characters spawned in the world and cannot be modified in-game. Currently referenced by respawn_character(). + var/locked[] = list() /obj/equip_e name = "equip e" diff --git a/code/defines/obj/clothing/mask.dm b/code/defines/obj/clothing/mask.dm index e604f61f024..63cdd5fe2e8 100644 --- a/code/defines/obj/clothing/mask.dm +++ b/code/defines/obj/clothing/mask.dm @@ -82,7 +82,7 @@ name = "gas mask" desc = "A close-fitting mask that can filter some environmental toxins or be connected to an air supply." icon_state = "gas_mask" - var/mode = 1// 1=Night Vision |2=Thermal |3=Meson + var/mode = 0// 0==Scouter | 1==Night Vision | 2==Thermal | 3==Meson var/voice = "Unknown" var/vchange = 0//This didn't do anything before. It now checks if the mask has special functions/N diff --git a/code/defines/obj/clothing/shoes.dm b/code/defines/obj/clothing/shoes.dm index bc1fdb19b40..73bf674cbf7 100644 --- a/code/defines/obj/clothing/shoes.dm +++ b/code/defines/obj/clothing/shoes.dm @@ -33,7 +33,7 @@ /obj/item/clothing/shoes/space_ninja name = "ninja shoes" - desc = "A pair of running shoes, excellent for running and even better for smashing skulls." + desc = "A pair of running shoes. Excellent for running and even better for smashing skulls." icon_state = "s-ninja" slowdown = 0 protective_temperature = 700 diff --git a/code/defines/obj/clothing/suit.dm b/code/defines/obj/clothing/suit.dm index 215a821777a..139475f8672 100644 --- a/code/defines/obj/clothing/suit.dm +++ b/code/defines/obj/clothing/suit.dm @@ -386,7 +386,7 @@ item_state = "void" desc = "A high tech, NASA Centcom branch designed, dark red Space suit. Used for AI satellite maintenance." allowed = list(/obj/item/weapon/gun/energy,/obj/item/weapon/tank/emergency_oxygen) - slowdown = 1.3 + slowdown = 1.5 /obj/item/clothing/suit/space/space_ninja name = "ninja suit" @@ -399,25 +399,34 @@ armor = list(melee = 60, bullet = 50, laser = 30, taser = 15, bomb = 30, bio = 30, rad = 30) var + //Important parts of the suit. mob/living/carbon/affecting = null//The wearer. obj/item/weapon/cell/cell//Starts out with a high-capacity cell using New(). datum/effects/system/spark_spread/spark_system//To create sparks. - initialize = 0//Suit starts off. - coold = 0//If the suit is on cooldown. Can be used to attach different cooldowns to abilities. Ticks down every second based on suit ntick(). + //Other articles of ninja gear worn together, used to easily reference them after initializing. + obj/item/clothing/head/helmet/space/space_ninja/n_hood + obj/item/clothing/shoes/space_ninja/n_shoes + obj/item/clothing/gloves/space_ninja/n_gloves + + //Main function variables. + s_initialized = 0//Suit starts off. + s_coold = 0//If the suit is on cooldown. Can be used to attach different cooldowns to abilities. Ticks down every second based on suit ntick(). spideros = 0//Mode of SpiderOS. This can change so I won't bother listing the modes here (0 is hub). Check ninja_equipment.dm for how it all works. - active = 0//Stealth off. - unlock = 0//To unlock Kamikaze. + s_active = 0//Stealth off. + k_unlock = 0//To unlock Kamikaze. kamikaze = 0//Kamikaze on or off. - sbombs = 10.0//Number of starting ninja smoke bombs. - aboost = 3.0//Number of adrenaline boosters. - transfera = 20//How much reagent is transferred when injecting. + //Ability function variables. + s_bombs = 10.0//Number of starting ninja smoke bombs. + a_boost = 3.0//Number of adrenaline boosters. + a_transfer = 20//How much reagent is transferred when injecting. - mob/living/silicon/AI = null//If there is an AI inside the suit. Paths to target. + //Onboard AI related variables. + mob/living/silicon/AI//If there is an AI inside the suit. Paths to target. obj/overlay/hologram//Is the AI hologram on or off? Visible only to the wearer of the suit. This works by attaching an image to a blank overlay. flush = 0//If an AI purge is in progress. - control = 1//If in control of the suit. + s_control = 1//If in control of the suit. /obj/item/clothing/suit/space/pirate name = "pirate coat" @@ -429,7 +438,6 @@ slowdown = 0 armor = list(melee = 60, bullet = 50, laser = 30, taser = 15, bomb = 30, bio = 30, rad = 30) - /obj/item/clothing/suit/captunic name = "captain's parade tunic" icon_state = "captunic" diff --git a/code/defines/obj/machinery.dm b/code/defines/obj/machinery.dm index c44928de1d2..9f79572b5e7 100644 --- a/code/defines/obj/machinery.dm +++ b/code/defines/obj/machinery.dm @@ -588,11 +588,13 @@ /obj/machinery/holopad name = "holopad" - desc = "A floor-mounted device for projecting AI holograms." + desc = "A floor-mounted device for projecting a holographic image. It will activate remotely." icon_state = "holopad0" anchored = 1 - var/state = "off" - var/slave_holo = null use_power = 1 idle_power_usage = 5 active_power_usage = 100 + + var + obj/overlay/hologram//The projection itself. If there is one, the instrument is on, off otherwise. + mob/living/silicon/ai/master//Which AI, if any, is controlling the object? Only one AI may control a hologram at any time. diff --git a/code/defines/procs/helpers.dm b/code/defines/procs/helpers.dm index e195ba3da53..ebbdf538cb1 100644 --- a/code/defines/procs/helpers.dm +++ b/code/defines/procs/helpers.dm @@ -368,7 +368,7 @@ //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(var/turf/start as turf,var/turf/end as turf)//N +/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 @@ -382,7 +382,7 @@ 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) +/proc/get_teleport_loc(turf/location,mob/target,distance = 1, density = 0, errorx = 0, errory = 0, eoffsetx = 0, 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. diff --git a/code/game/gamemodes/changeling/changeling_powers.dm b/code/game/gamemodes/changeling/changeling_powers.dm index 03250411aff..b3a8135954a 100644 --- a/code/game/gamemodes/changeling/changeling_powers.dm +++ b/code/game/gamemodes/changeling/changeling_powers.dm @@ -538,7 +538,7 @@ usr << "\blue We stealthily sting [T]." - T.visible_message(text("\red [usr] transforms!")) + T.visible_message(text("\red [T] transforms!")) T.dna = usr.absorbed_dna[S] T.real_name = S diff --git a/code/game/gamemodes/extra/ninja_abilities.dm b/code/game/gamemodes/extra/ninja_abilities.dm index 44a4c9002ae..e2cb156e799 100644 --- a/code/game/gamemodes/extra/ninja_abilities.dm +++ b/code/game/gamemodes/extra/ninja_abilities.dm @@ -12,8 +12,8 @@ They should, as I have made every effort for that to be the case. In the case that they are not, I imagine the game will run-time error like crazy. */ -//Cooldown ticks off each second based on the suit recharge proc, in seconds. Default of 1 seconds. Some abilities have no cool down. -/obj/item/clothing/suit/space/space_ninja/proc/ninjacost(var/C = 0,var/X = 0) +//s_cooldown ticks off each second based on the suit recharge proc, in seconds. Default of 1 seconds. Some abilities have no cool down. +/obj/item/clothing/suit/space/space_ninja/proc/ninjacost(C = 0,X = 0) var/mob/living/carbon/human/U = affecting if( (U.stat||U.incorporeal_move)&&X!=3 )//Will not return if user is using an adrenaline booster since you can use them when stat==1. U << "\red You must be conscious and solid to do this."//It's not a problem of stat==2 since the ninja will explode anyway if they die. @@ -23,18 +23,18 @@ In the case that they are not, I imagine the game will run-time error like crazy return 1 switch(X) if(1) - if(active) + if(s_active) U << "\red You must deactivate the CLOAK-tech device prior to using this ability." return 1 if(2) - if(sbombs<=0) + if(s_bombs<=0) U << "\red There are no more smoke bombs remaining." return 1 if(3) - if(aboost<=0) + if(a_boost<=0) U << "\red You do not have any more adrenaline boosters." return 1 - return (coold)//Returns the value of the variable which counts down to zero. + return (s_coold)//Returns the value of the variable which counts down to zero. //Smoke //Summons smoke in radius of user. @@ -47,13 +47,13 @@ In the case that they are not, I imagine the game will run-time error like crazy if(!ninjacost(,2)) var/mob/living/carbon/human/U = affecting - U << "\blue There are [sbombs] smoke bombs remaining." + U << "\blue There are [s_bombs] smoke bombs remaining." var/datum/effects/system/bad_smoke_spread/smoke = new /datum/effects/system/bad_smoke_spread() smoke.set_up(10, 0, U.loc) smoke.start() playsound(U.loc, 'bamf.ogg', 50, 2) - sbombs-- - coold = 1 + s_bombs-- + s_coold = 1 return //9-10 Tile Teleport @@ -90,7 +90,7 @@ In the case that they are not, I imagine the game will run-time error like crazy spawn(0) destination.kill_creatures(U)//Any living mobs in teleport area are gibbed. Check turf procs for how it does it. - coold = 1 + s_coold = 1 cell.charge-=(C*10) else U << "\red The VOID-shift device is malfunctioning, teleportation failed." @@ -98,7 +98,7 @@ In the case that they are not, I imagine the game will run-time error like crazy //Right Click Teleport //Right click to teleport somewhere, almost exactly like admin jump to turf. -/obj/item/clothing/suit/space/space_ninja/proc/ninjashift(var/turf/T in oview()) +/obj/item/clothing/suit/space/space_ninja/proc/ninjashift(turf/T in oview()) set name = "Phase Shift (20E)" set desc = "Utilizes the internal VOID-shift device to rapidly transit to a destination in view." set category = null//So it does not show up on the panel but can still be right-clicked. @@ -129,7 +129,7 @@ In the case that they are not, I imagine the game will run-time error like crazy spawn(0)//Any living mobs in teleport area are gibbed. T.kill_creatures(U) - coold = 1 + s_coold = 1 cell.charge-=(C*10) else U << "\red You cannot teleport into solid walls or from solid matter" @@ -148,7 +148,7 @@ In the case that they are not, I imagine the game will run-time error like crazy var/mob/living/carbon/human/U = affecting playsound(U.loc, 'EMPulse.ogg', 60, 2) empulse(U, 4, 6) //Procs sure are nice. Slightly weaker than wizard's disable tch. - coold = 2 + s_coold = 2 cell.charge-=(C*10) return @@ -181,7 +181,7 @@ In the case that they are not, I imagine the game will run-time error like crazy U.put_in_inactive_hand(W) spark_system.start() playsound(U.loc, "sparks", 50, 1) - coold = 1 + s_coold = 1 return //Shoot Ninja Stars @@ -222,7 +222,7 @@ In the case that they are not, I imagine the game will run-time error like crazy //Energy Net //Allows the ninja to capture people, I guess. //Must right click on a mob to activate. -/obj/item/clothing/suit/space/space_ninja/proc/ninjanet(var/mob/living/carbon/M in oview())//Only living carbon mobs. +/obj/item/clothing/suit/space/space_ninja/proc/ninjanet(mob/living/carbon/M in oview())//Only living carbon mobs. set name = "Energy Net (20E)" set desc = "Captures a fallen opponent in a net of energy. Will teleport them to a holding facility after 30 seconds." set category = null @@ -230,10 +230,13 @@ In the case that they are not, I imagine the game will run-time error like crazy var/C = 200 if(!ninjacost(C)&&iscarbon(M)) - if(!locate(/obj/effects/energy_net) in M.loc)//Check if they are already being affected by an energy net. - var/mob/living/carbon/human/U = affecting - if(M.client)//Monkeys without a client can still step_to() and bypass the net. Also, netting inactive people is lame. + var/mob/living/carbon/human/U = affecting + if(M.client)//Monkeys without a client can still step_to() and bypass the net. Also, netting inactive people is lame. + if(!locate(/obj/effects/energy_net) in M.loc)//Check if they are already being affected by an energy net. for(var/turf/T in getline(U.loc, M.loc)) + if(T.density)//Don't want them shooting nets through walls. It's kind of cheesy. + U << "You may not use an energy net through solid obstacles!" + return if(T==U.loc||T==M.loc) continue spawn(0) anim(T,M,'projectiles.dmi',"energy",,,get_dir_to(U.loc,M.loc)) @@ -249,7 +252,9 @@ In the case that they are not, I imagine the game will run-time error like crazy E.process(M) cell.charge-=(C*10) else - U << "They will bring no honor to your Clan!" + U << "They are already trapped inside an energy net." + else + U << "They will bring no honor to your Clan!" return //Adrenaline Boost @@ -272,10 +277,10 @@ In the case that they are not, I imagine the game will run-time error like crazy U.say(pick("A CORNERED FOX IS MORE DANGEROUS THAN A JACKAL!","HURT ME MOOORRREEE!","IMPRESSIVE!")) spawn(70) reagents.reaction(U, 2) - reagents.trans_id_to(U, "radium", transfera) + reagents.trans_id_to(U, "radium", a_transfer) U << "\red You are beginning to feel the after-effects of the injection." - aboost-- - coold = 3 + a_boost-- + s_coold = 3 return @@ -334,7 +339,7 @@ Allows to gib up to five squares in a straight line. Seriously.*/ playsound(U.loc, 'Deconstruct.ogg', 50, 1) playsound(U.loc, "sparks", 50, 1) anim(U.loc,U,'mob.dmi',,"phasein") - coold = 1 + s_coold = 1 else U << "\red The VOID-shift device is malfunctioning, teleportation failed." return @@ -406,7 +411,7 @@ Allows to gib up to five squares in a straight line. Seriously.*/ playsound(U.loc, 'Deconstruct.ogg', 50, 1) playsound(U.loc, "sparks", 50, 1) anim(U.loc,U,'mob.dmi',,"phasein") - coold = 1 + s_coold = 1 else U << "\red The VOID-shift device is malfunctioning, teleportation failed." else diff --git a/code/game/gamemodes/extra/ninja_equipment.dm b/code/game/gamemodes/extra/ninja_equipment.dm index 65663f03cfa..60d487a3407 100644 --- a/code/game/gamemodes/extra/ninja_equipment.dm +++ b/code/game/gamemodes/extra/ninja_equipment.dm @@ -45,7 +45,7 @@ ________________________________________________________________________________ /obj/item/clothing/suit/space/space_ninja/attackby(var/obj/item/device/aicard/aicard_temp as obj, U as mob)//When the suit is attacked by an AI card. if(istype(aicard_temp, /obj/item/device/aicard))//If it's actually an AI card. - if(control) + if(s_control) aicard_temp.transfer_ai("NINJASUIT","AICARD",src,U) else U << "\red ERROR: \black Remote access channel disabled." @@ -54,9 +54,10 @@ ________________________________________________________________________________ /obj/item/clothing/suit/space/space_ninja/proc/ntick(var/mob/living/carbon/human/U as mob) set background = 1 - spawn while(initialize&&cell.charge>=0)//Suit on and has power. - if(!initialize) return//When turned off the proc stops. - if(coold) coold--//Checks for ability cooldown. + spawn while(cell.charge>=0)//Runs in the background while the suit is initialized. + if(affecting.monkeyizing) terminate()//Kills the suit and attached objects. + if(!s_initialized) return//When turned off the proc stops. + if(s_coold) s_coold--//Checks for ability s_cooldown. var/A = 5//Energy cost each tick. if(!kamikaze) if(istype(U.get_active_hand(), /obj/item/weapon/blade))//Sword check. @@ -68,7 +69,7 @@ ________________________________________________________________________________ U.swap_hand()//swap hand U.drop_item()//drop sword else A += 20 - if(active) + if(s_active) A += 25 else if(prob(25)) @@ -76,17 +77,23 @@ ________________________________________________________________________________ A = 200 cell.charge-=A 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) + s_active=0 + if(cell.charge<=0) if(kamikaze) U.say("I DIE TO LIVE AGAIN!") U << browse(null, "window=spideros")//Just in case. U.death() return cell.charge=0 - active=0 + s_active=0 sleep(10)//Checks every second. +/obj/item/clothing/suit/space/space_ninja/proc/terminate() +//Simply deletes all the attachments and self. + del(n_hood) + del(n_gloves) + del(n_shoes) + del(src) /obj/item/clothing/suit/space/space_ninja/proc/init() set name = "Initialize Suit" @@ -94,7 +101,7 @@ ________________________________________________________________________________ set category = "Ninja Equip" var/mob/living/carbon/human/U = loc - if(U.mind&&U.mind.special_role=="Space Ninja"&&U:wear_suit==src&&!initialize) + if(U.mind&&U.mind.special_role=="Space Ninja"&&U:wear_suit==src&&!s_initialized) verbs -= /obj/item/clothing/suit/space/space_ninja/proc/init U << "\blue Now initializing..." sleep(40) @@ -112,10 +119,16 @@ ________________________________________________________________________________ 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 + + n_hood = U.head + n_hood.canremove=0 + n_shoes = U.shoes + n_shoes.canremove=0 + n_shoes.slowdown-- + n_gloves = U.gloves + n_gloves.canremove=0 canremove=0 + sleep(40) U << "\blue Extending neural-net interface...\nNow monitoring brain wave pattern..." sleep(40) @@ -141,17 +154,16 @@ ________________________________________________________________________________ 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 - U.gloves.verbs += /obj/item/clothing/gloves/space_ninja/proc/toggled + n_gloves.verbs += /obj/item/clothing/gloves/space_ninja/proc/drain_wire + n_gloves.verbs += /obj/item/clothing/gloves/space_ninja/proc/toggled affecting=U - U.shoes:slowdown-- ntick(U) else 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) + else if(s_initialized) U << "\red The suit is already functioning." else U << "\red You cannot use this function at this time." @@ -165,7 +177,7 @@ ________________________________________________________________________________ if(affecting!=loc) return var/mob/living/carbon/human/U = affecting - if(!initialize) + if(!s_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") @@ -187,8 +199,8 @@ ________________________________________________________________________________ U << "\blue Primary system status: OFFLINE.\nBackup system status: OFFLINE." sleep(40) U << "\blue VOID-shift device status: OFFLINE.\nCLOAK-tech device status: OFFLINE." - if(active)//Shutdowns stealth. - active=0 + if(s_active)//Shutdowns stealth. + s_active=!s_active sleep(40) if(U.stat||U.health<=0) U << "\red FATAL ERROR: 412--GG##&77 BRAIN WAV3 PATT$RN RED\nI-I-INITIATING S-SELf DeStrCuCCCT%$#@@!!$^#!..." @@ -204,32 +216,35 @@ ________________________________________________________________________________ sleep(40) U << "\blue Disengaging neural-net interface...\greenSuccess\blue." sleep(40) - 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:slowdown++ - if(istype(U.gloves, /obj/item/clothing/gloves/space_ninja)) - U.gloves.icon_state = "s-ninja" - U.gloves.item_state = "s-ninja" - U.gloves:canremove=1 - U.gloves:candrain=0 - U.gloves:draining=0 - U.gloves.verbs -= /obj/item/clothing/gloves/space_ninja/proc/drain_wire - U.gloves.verbs -= /obj/item/clothing/gloves/space_ninja/proc/toggled + + if(n_hood) + n_hood.canremove=1 + if(n_shoes) + n_shoes.canremove=1 + n_shoes.slowdown++ + if(n_gloves) + n_gloves.icon_state = "s-ninja" + n_gloves.item_state = "s-ninja" + n_gloves.canremove=1 + n_gloves.candrain=0 + n_gloves.draining=0 + n_gloves.verbs -= /obj/item/clothing/gloves/space_ninja/proc/drain_wire + n_gloves.verbs -= /obj/item/clothing/gloves/space_ninja/proc/toggled + canremove=1 + s_initialized=0 + affecting=null + slowdown=1 + verbs += /obj/item/clothing/suit/space/space_ninja/proc/init icon_state = "s-ninja" U.update_clothing() + if(istype(U.get_active_hand(), /obj/item/weapon/blade))//Sword check. U.drop_item() if(istype(U.get_inactive_hand(), /obj/item/weapon/blade)) U.swap_hand() U.drop_item() - canremove=1 + U << "\blue Unsecuring external locking mechanism...\nNeural-net abolished.\nOperation status: FINISHED." - verbs += /obj/item/clothing/suit/space/space_ninja/proc/init - initialize=0 - affecting=null - slowdown=1 return /obj/item/clothing/suit/space/space_ninja/proc/spideros() @@ -252,14 +267,14 @@ ________________________________________________________________________________ dat += "
" dat += " Current Time: [round(world.time / 36000)+12]:[(world.time / 600 % 60) < 10 ? add_zero(world.time / 600 % 60, 1) : world.time / 600 % 60]
" dat += " Battery Life: [round(cell.charge/100)]%
" - dat += " Smoke Bombs: [sbombs]
" + dat += " Smoke Bombs: [s_bombs]
" dat += "
" switch(spideros) if(0) dat += "

Available Functions:

" dat += "