[MIRROR] Ninja Refactor (#1037)

* Ninja Refactor

* Update antagonists.dm

* Delete antagonists.dm.rej

* Update antagonists.dm

* Update mind.dm

* Update mind.dm

* whatever, I fixed that cunt
This commit is contained in:
CitadelStationBot
2017-05-21 00:39:26 -05:00
committed by Poojawa
parent 0b1f4a27da
commit f624071766
25 changed files with 427 additions and 414 deletions
-2
View File
@@ -81,7 +81,6 @@ GLOBAL_LIST_INIT(admin_verbs_fun, list(
/client/proc/drop_dynex_bomb,
/client/proc/cinematic,
/client/proc/one_click_antag,
/client/proc/send_space_ninja,
/client/proc/cmd_admin_add_freeform_ai_law,
/client/proc/object_say,
/client/proc/toggle_random_events,
@@ -200,7 +199,6 @@ GLOBAL_LIST_INIT(admin_verbs_hideable, list(
/client/proc/get_dynex_power,
/client/proc/set_dynex_scale,
/client/proc/cinematic,
/client/proc/send_space_ninja,
/client/proc/cmd_admin_add_freeform_ai_law,
/client/proc/cmd_admin_create_centcom_report,
/client/proc/cmd_change_command_name,
+2 -3
View File
@@ -387,9 +387,8 @@ Traitors and the like can also be revived with the previous role mostly intact.
for(var/obj/effect/landmark/L in GLOB.landmarks_list)
if(L.name=="carpspawn")
ninja_spawn += L
new_character.equip_space_ninja()
new_character.internal = new_character.s_store
new_character.update_internals_hud_icon(1)
var/datum/antagonist/ninja/ninjadatum = new_character.mind.has_antag_datum(ANTAG_DATUM_NINJA)
ninjadatum.equip_space_ninja()
if(ninja_spawn.len)
var/obj/effect/landmark/ninja_spawn_here = pick(ninja_spawn)
new_character.loc = ninja_spawn_here.loc
-64
View File
@@ -1,64 +0,0 @@
/*
Contents:
- Admin procs that make ninjas
*/
//ADMIN CREATE NINJA (From Player)
/client/proc/cmd_admin_ninjafy(mob/living/carbon/human/H in GLOB.player_list)
set category = null
set name = "Make Space Ninja"
if (!SSticker.mode)
alert("Wait until the game starts")
return
if(!istype(H))
return
if(alert(src, "You sure?", "Confirm", "Yes", "No") != "Yes")
return
log_admin("[key_name(src)] turned [H.key] into a Space Ninja.")
H.mind = create_ninja_mind(H.key)
H.mind_initialize()
H.equip_space_ninja(1)
if(istype(H.wear_suit, /obj/item/clothing/suit/space/space_ninja))
H.wear_suit:randomize_param()
spawn(0)
H.wear_suit:ninitialize(10,H)
SSticker.mode.update_ninja_icons_added(H)
//ADMIN CREATE NINJA (From Ghost)
/client/proc/send_space_ninja()
set category = "Fun"
set name = "Spawn Space Ninja"
set desc = "Spawns a space ninja for when you need a teenager with attitude."
set popup_menu = 0
if(!holder)
to_chat(src, "Only administrators may use this command.")
return
if(!SSticker.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
var/client/C = input("Pick character to spawn as the Space Ninja", "Key", "") as null|anything in GLOB.clients
if(!C)
return
// passing FALSE means the event doesn't start immediately
var/datum/round_event/ghost_role/ninja/E = new(FALSE)
E.priority_candidates += C
E.processing = TRUE
message_admins("<span class='notice'>[key_name_admin(key)] has spawned [key_name_admin(C.key)] as a Space Ninja.</span>")
log_admin("[key] used Spawn Space Ninja.")
return
+3 -113
View File
@@ -63,98 +63,21 @@ Contents:
Mind.active = 1
//generate objectives - You'll generally get 6 objectives (Ninja is meant to be hardmode!)
var/list/possible_targets = list()
for(var/datum/mind/M in SSticker.minds)
if(M.current && M.current.stat != DEAD)
if(ishuman(M.current))
if(M.special_role)
possible_targets[M] = 0 //bad-guy
else if(M.assigned_role in GLOB.command_positions)
possible_targets[M] = 1 //good-guy
var/list/objectives = list(1,2,3,4)
while(give_objectives && Mind.objectives.len < 6)
switch(pick_n_take(objectives))
if(1) //research
var/datum/objective/download/O = new /datum/objective/download()
O.owner = Mind
O.gen_amount_goal()
Mind.objectives += O
if(2) //steal
var/datum/objective/steal/special/O = new /datum/objective/steal/special()
O.owner = Mind
Mind.objectives += O
if(3) //protect/kill
if(!possible_targets.len) continue
var/index = rand(1,possible_targets.len)
var/datum/mind/M = possible_targets[index]
var/is_bad_guy = possible_targets[M]
possible_targets.Cut(index,index+1)
if(is_bad_guy ^ helping_station) //kill (good-ninja + bad-guy or bad-ninja + good-guy)
var/datum/objective/assassinate/O = new /datum/objective/assassinate()
O.owner = Mind
O.target = M
O.explanation_text = "Slay \the [M.current.real_name], the [M.assigned_role]."
Mind.objectives += O
else //protect
var/datum/objective/protect/O = new /datum/objective/protect()
O.owner = Mind
O.target = M
O.explanation_text = "Protect \the [M.current.real_name], the [M.assigned_role], from harm."
Mind.objectives += O
if(4) //debrain/capture
if(!possible_targets.len) continue
var/selected = rand(1,possible_targets.len)
var/datum/mind/M = possible_targets[selected]
var/is_bad_guy = possible_targets[M]
possible_targets.Cut(selected,selected+1)
if(is_bad_guy ^ helping_station) //debrain (good-ninja + bad-guy or bad-ninja + good-guy)
var/datum/objective/debrain/O = new /datum/objective/debrain()
O.owner = Mind
O.target = M
O.explanation_text = "Steal the brain of [M.current.real_name]."
Mind.objectives += O
else //capture
var/datum/objective/capture/O = new /datum/objective/capture()
O.owner = Mind
O.gen_amount_goal()
Mind.objectives += O
else
break
//Add a survival objective since it's usually broad enough for any round type.
if(give_objectives)
var/datum/objective/O = new /datum/objective/survive()
O.owner = Mind
Mind.objectives += O
//add some RP-fluff
Mind.store_memory("I am an elite mercenary assassin of the mighty Spider Clan. A <font color='red'><B>SPACE NINJA</B></font>!")
Mind.store_memory("Surprise is my weapon. Shadows are my armor. Without them, I am nothing. (//initialize your suit by right clicking on it, to use abilities like stealth)!")
Mind.store_memory("Officially, [helping_station?"Nanotrasen":"The Syndicate"] are my employer.")
//spawn the ninja and assign the candidate
var/mob/living/carbon/human/Ninja = create_space_ninja(spawn_loc)
Mind.transfer_to(Ninja)
//initialise equipment
if(istype(Ninja.wear_suit,/obj/item/clothing/suit/space/space_ninja))
//Should be true but we have to check these things.
var/obj/item/clothing/suit/space/space_ninja/N = Ninja.wear_suit
N.randomize_param()
var/datum/antagonist/ninja/ninjadatum = add_ninja(Ninja)
ninjadatum.equip_space_ninja()
Ninja.internal = Ninja.s_store
Ninja.update_internals_hud_icon(1)
if(Ninja.mind != Mind) //something has gone wrong!
throw EXCEPTION("Ninja created with incorrect mind")
return
Ninja << sound('sound/effects/ninja_greeting.ogg') //so ninja you probably wouldn't even know if you were made one
SSticker.mode.update_ninja_icons_added(Ninja)
spawned_mobs += Ninja
message_admins("[key_name_admin(Ninja)] has been made into a ninja by an event.")
@@ -171,7 +94,6 @@ Contents:
A.real_name = "[pick(GLOB.ninja_titles)] [pick(GLOB.ninja_names)]"
A.copy_to(new_ninja)
new_ninja.dna.update_dna_identity()
new_ninja.equip_space_ninja()
return new_ninja
@@ -183,38 +105,6 @@ Contents:
return Mind
/mob/living/carbon/human/proc/equip_space_ninja(safety=0)//Safety in case you need to unequip stuff for existing characters.
if(safety)
qdel(w_uniform)
qdel(wear_suit)
qdel(wear_mask)
qdel(head)
qdel(shoes)
qdel(gloves)
var/obj/item/device/radio/R = new /obj/item/device/radio/headset(src)
var/obj/item/clothing/suit/space/space_ninja/theSuit = new(src)
var/obj/item/weapon/katana/energy/EK = new(src)
theSuit.energyKatana = EK
equip_to_slot_or_del(R, slot_ears)
equip_to_slot_or_del(new /obj/item/clothing/under/color/black(src), slot_w_uniform)
equip_to_slot_or_del(new /obj/item/clothing/shoes/space_ninja(src), slot_shoes)
equip_to_slot_or_del(theSuit, slot_wear_suit)
equip_to_slot_or_del(new /obj/item/clothing/gloves/space_ninja(src), slot_gloves)
equip_to_slot_or_del(new /obj/item/clothing/head/helmet/space/space_ninja(src), slot_head)
equip_to_slot_or_del(new /obj/item/clothing/mask/gas/space_ninja(src), slot_wear_mask)
equip_to_slot_or_del(new /obj/item/clothing/glasses/night(src), slot_glasses)
equip_to_slot_or_del(EK, slot_belt)
equip_to_slot_or_del(new /obj/item/device/flashlight(src), slot_r_store)
equip_to_slot_or_del(new /obj/item/weapon/grenade/plastic/x4(src), slot_l_store)
equip_to_slot_or_del(new /obj/item/weapon/tank/internals/emergency_oxygen(src), slot_s_store)
equip_to_slot_or_del(new /obj/item/weapon/tank/jetpack/carbondioxide(src), slot_back)
var/obj/item/weapon/implant/explosive/E = new/obj/item/weapon/implant/explosive(src)
E.implant(src)
return 1
/datum/game_mode/proc/update_ninja_icons_added(var/mob/living/carbon/human/ninja)
var/datum/atom_hud/antag/ninjahud = GLOB.huds[ANTAG_HUD_NINJA]
ninjahud.join_hud(ninja)
+6 -13
View File
@@ -58,30 +58,23 @@
A.add_fingerprint(H)
draining = 1
var/drained = A.ninjadrain_act(suit,H,src)
. = A.ninjadrain_act(suit,H,src)
draining = 0
if(isnum(drained)) //Numerical values of drained handle their feedback here, Alpha values handle it themselves (Research hacking)
if(drained)
to_chat(H, "<span class='notice'>Gained <B>[drained]</B> energy from \the [A].</span>")
if(isnum(.)) //Numerical values of drained handle their feedback here, Alpha values handle it themselves (Research hacking)
if(.)
to_chat(H, "<span class='notice'>Gained <B>[.]</B> energy from \the [A].</span>")
else
to_chat(H, "<span class='danger'>\The [A] has run dry of power, you must find another source!</span>")
else
drained = 0 //as to not cancel attack_hand()
return drained
. = 0 //as to not cancel attack_hand()
/obj/item/clothing/gloves/space_ninja/proc/toggled()
set name = "Toggle Interaction"
set desc = "Toggles special interaction on or off."
set category = "Ninja Equip"
/obj/item/clothing/gloves/space_ninja/proc/toggledrain()
var/mob/living/carbon/human/U = loc
to_chat(U, "You <b>[candrain?"disable":"enable"]</b> special interaction.")
candrain=!candrain
/obj/item/clothing/gloves/space_ninja/examine(mob/user)
..()
if(flags & NODROP)
@@ -1,12 +1,6 @@
//Wakes the user so they are able to do their thing. Also injects a decent dose of radium.
//Movement impairing would indicate drugs and the like.
/obj/item/clothing/suit/space/space_ninja/proc/ninjaboost()
set name = "Adrenaline Boost"
set desc = "Inject a secret chemical that will counteract all movement-impairing effect."
set category = "Ninja Ability"
set popup_menu = 0
if(!ninjacost(0,N_ADRENALINE))//Have to make sure stat is not counted for this ability.
var/mob/living/carbon/human/H = affecting
@@ -25,4 +19,3 @@
a_boost--
to_chat(H, "<span class='notice'>There are <B>[a_boost]</B> adrenaline boosts remaining.</span>")
s_coold = 3
return
@@ -26,4 +26,4 @@
if(!a_boost)
to_chat(H, "<span class='danger'>You do not have any more adrenaline boosters.</span>")
return 1
return (s_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.
@@ -2,14 +2,9 @@
//Disables nearby tech equipment.
/obj/item/clothing/suit/space/space_ninja/proc/ninjapulse()
set name = "EM Burst (25E)"
set desc = "Disable any nearby technology with a electro-magnetic pulse."
set category = "Ninja Ability"
set popup_menu = 0
if(!ninjacost(250,N_STEALTH_CANCEL))
var/mob/living/carbon/human/H = affecting
playsound(H.loc, 'sound/effects/EMPulse.ogg', 60, 2)
empulse(H, 4, 6) //Procs sure are nice. Slightly weaker than wizard's disable tch.
s_coold = 2
return
@@ -1,10 +1,6 @@
//Allows the ninja to kidnap people
/obj/item/clothing/suit/space/space_ninja/proc/ninjanet(mob/living/carbon/C 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
set src = usr.contents
if(!ninjacost(200,N_STEALTH_CANCEL) && iscarbon(C))
var/mob/living/carbon/human/H = affecting
@@ -26,4 +22,3 @@
to_chat(H, "<span class='warning'>[C.p_they(TRUE)] are already trapped inside an energy net!</span>")
else
to_chat(H, "<span class='warning'>[C.p_they(TRUE)] will bring no honor to your Clan!</span>")
return
@@ -2,10 +2,6 @@
//Smoke bomb
/obj/item/clothing/suit/space/space_ninja/proc/ninjasmoke()
set name = "Smoke Bomb"
set desc = "Blind your enemies momentarily with a well-placed smoke bomb."
set category = "Ninja Ability"
set popup_menu = 0//Will not see it when right clicking.
if(!ninjacost(0,N_SMOKE_BOMB))
var/mob/living/carbon/human/H = affecting
@@ -16,4 +12,3 @@
s_bombs--
to_chat(H, "<span class='notice'>There are <B>[s_bombs]</B> smoke bombs remaining.</span>")
s_coold = 1
return
@@ -2,11 +2,6 @@
//Creates a throwing star
/obj/item/clothing/suit/space/space_ninja/proc/ninjastar()
set name = "Create Throwing Stars (1E)"
set desc = "Creates some throwing stars"
set category = "Ninja Ability"
set popup_menu = 0
if(!ninjacost(10))
var/mob/living/carbon/human/H = affecting
var/obj/item/weapon/throwing_star/ninja/N = new(H)
@@ -21,7 +21,6 @@ Contents:
animate(U, alpha = 50,time = 15)
U.visible_message("<span class='warning'>[U.name] vanishes into thin air!</span>", \
"<span class='notice'>You are now mostly invisible to normal detection.</span>")
return
/obj/item/clothing/suit/space/space_ninja/proc/cancel_stealth()
@@ -38,12 +37,7 @@ Contents:
/obj/item/clothing/suit/space/space_ninja/proc/stealth()
set name = "Toggle Stealth"
set desc = "Utilize the internal CLOAK-tech device to activate or deactivate stealth-camo."
set category = "Ninja Equip"
if(!s_busy)
toggle_stealth()
else
to_chat(affecting, "<span class='danger'>Stealth does not appear to work!</span>")
@@ -1,10 +1,5 @@
/obj/item/clothing/suit/space/space_ninja/proc/ninja_sword_recall()
set name = "Recall Energy Katana (Variable Cost)"
set desc = "Teleports the Energy Katana linked to this suit to its wearer, cost based on distance."
set category = "Ninja Ability"
set popup_menu = 0
var/mob/living/carbon/human/H = affecting
var/cost = 0
@@ -42,4 +37,3 @@
else //Else just TP it to us.
energyKatana.returnToOwner(H,1)
@@ -16,16 +16,10 @@ Contents:
var/mob/living/victim = H.pulling
if(!victim.anchored)
victim.forceMove(locate(T.x+rand(-1,1),T.y+rand(-1,1),T.z))
return
//Jaunt
/obj/item/clothing/suit/space/space_ninja/proc/ninjajaunt()
set name = "Phase Jaunt (10E)"
set desc = "Utilizes the internal VOID-shift device to rapidly transit in direction facing."
set category = "Ninja Ability"
set popup_menu = 0
if(!ninjacost(100,N_STEALTH_CANCEL))
var/mob/living/carbon/human/H = affecting
var/turf/destination = get_teleport_loc(H.loc,H,9,1,3,1,0,1)
@@ -47,7 +41,6 @@ Contents:
s_coold = 1
else
to_chat(H, "<span class='danger'>The VOID-shift device is malfunctioning, <B>teleportation failed</B>.</span>")
return
//Right-Click teleport: It's basically admin "jump to turf"
@@ -76,6 +69,3 @@ Contents:
s_coold = 1
else
to_chat(H, "<span class='danger'>You cannot teleport into solid walls or from solid matter</span>")
return
+67 -32
View File
@@ -22,6 +22,8 @@ Contents:
armor = list(melee = 60, bullet = 50, laser = 30,energy = 15, bomb = 30, bio = 30, rad = 30, fire = 100, acid = 100)
strip_delay = 12
actions_types = list(/datum/action/item_action/initialize_ninja_suit, /datum/action/item_action/ninjajaunt, /datum/action/item_action/ninjasmoke, /datum/action/item_action/ninjaboost, /datum/action/item_action/ninjapulse, /datum/action/item_action/ninjastar, /datum/action/item_action/ninjanet, /datum/action/item_action/ninja_sword_recall, /datum/action/item_action/ninja_stealth, /datum/action/item_action/toggle_glove)
//Important parts of the suit.
var/mob/living/carbon/human/affecting = null
var/obj/item/weapon/stock_parts/cell/cell
@@ -57,7 +59,6 @@ Contents:
/obj/item/clothing/suit/space/space_ninja/New()
..()
verbs += /obj/item/clothing/suit/space/space_ninja/proc/init//suit initialize verb
//Spark Init
spark_system = new()
@@ -109,40 +110,38 @@ Contents:
//This proc prevents the suit from being taken off.
/obj/item/clothing/suit/space/space_ninja/proc/lock_suit(mob/living/carbon/human/H, checkIcons = 0)
/obj/item/clothing/suit/space/space_ninja/proc/lock_suit(mob/living/carbon/human/H)
if(!istype(H))
return 0
if(checkIcons)
icon_state = H.gender==FEMALE ? "s-ninjanf" : "s-ninjan"
H.gloves.icon_state = "s-ninjan"
H.gloves.item_state = "s-ninjan"
else
if(H.mind.special_role!="Space Ninja")
to_chat(H, "\red <B>fÄTaL ÈÈRRoR</B>: 382200-*#00CÖDE <B>RED</B>\nUNAU†HORIZED USÈ DETÈC†††eD\nCoMMÈNCING SUB-R0U†IN3 13...\nTÈRMInATING U-U-USÈR...")
H.gib()
return 0
if(!istype(H.head, /obj/item/clothing/head/helmet/space/space_ninja))
to_chat(H, "<span class='userdanger'>ERROR</span>: 100113 UNABLE TO LOCATE HEAD GEAR\nABORTING...")
return 0
if(!istype(H.shoes, /obj/item/clothing/shoes/space_ninja))
to_chat(H, "<span class='userdanger'>ERROR</span>: 122011 UNABLE TO LOCATE FOOT GEAR\nABORTING...")
return 0
if(!istype(H.gloves, /obj/item/clothing/gloves/space_ninja))
to_chat(H, "<span class='userdanger'>ERROR</span>: 110223 UNABLE TO LOCATE HAND GEAR\nABORTING...")
return 0
if(!is_ninja(H))
to_chat(H, "\red <B>fÄTaL ÈÈRRoR</B>: 382200-*#00CÖDE <B>RED</B>\nUNAU†HORIZED USÈ DETÈC†††eD\nCoMMÈNCING SUB-R0U†IN3 13...\nTÈRMInATING U-U-USÈR...")
H.gib()
return FALSE
if(!istype(H.head, /obj/item/clothing/head/helmet/space/space_ninja))
to_chat(H, "<span class='userdanger'>ERROR</span>: 100113 UNABLE TO LOCATE HEAD GEAR\nABORTING...")
return FALSE
if(!istype(H.shoes, /obj/item/clothing/shoes/space_ninja))
to_chat(H, "<span class='userdanger'>ERROR</span>: 122011 UNABLE TO LOCATE FOOT GEAR\nABORTING...")
return FALSE
if(!istype(H.gloves, /obj/item/clothing/gloves/space_ninja))
to_chat(H, "<span class='userdanger'>ERROR</span>: 110223 UNABLE TO LOCATE HAND GEAR\nABORTING...")
return FALSE
affecting = H
flags |= NODROP //colons make me go all |=
slowdown = FALSE
n_hood = H.head
n_hood.flags |= NODROP
n_shoes = H.shoes
n_shoes.flags |= NODROP
n_shoes.slowdown--
n_gloves = H.gloves
n_gloves.flags |= NODROP
return TRUE
affecting = H
flags |= NODROP //colons make me go all |=
slowdown = 0
n_hood = H.head
n_hood.flags |= NODROP
n_shoes = H.shoes
n_shoes.flags |= NODROP
n_shoes.slowdown--
n_gloves = H.gloves
n_gloves.flags |= NODROP
return 1
/obj/item/clothing/suit/space/space_ninja/proc/lockIcons(mob/living/carbon/human/H)
icon_state = H.gender==FEMALE ? "s-ninjanf" : "s-ninjan"
H.gloves.icon_state = "s-ninjan"
H.gloves.item_state = "s-ninjan"
//This proc allows the suit to be taken off.
@@ -172,3 +171,39 @@ Contents:
to_chat(user, "The CLOAK-tech device is <B>[s_active?"active":"inactive"]</B>.")
to_chat(user, "There are <B>[s_bombs]</B> smoke bomb\s remaining.")
to_chat(user, "There are <B>[a_boost]</B> adrenaline booster\s remaining.")
/obj/item/clothing/suit/space/space_ninja/ui_action_click(mob/user, action)
if(istype(action, /datum/action/item_action/initialize_ninja_suit))
toggle_on_off()
return TRUE
if(!s_initialized)
to_chat(user, "<span class='warning'><b>ERROR</b>: suit offline. Please activate suit.</span>")
return FALSE
if(istype(action, /datum/action/item_action/ninjajaunt))
ninjajaunt()
return TRUE
if(istype(action, /datum/action/item_action/ninjasmoke))
ninjasmoke()
return TRUE
if(istype(action, /datum/action/item_action/ninjaboost))
ninjaboost()
return TRUE
if(istype(action, /datum/action/item_action/ninjapulse))
ninjapulse()
return TRUE
if(istype(action, /datum/action/item_action/ninjastar))
ninjastar()
return TRUE
if(istype(action, /datum/action/item_action/ninjanet))
ninjanet()
return TRUE
if(istype(action, /datum/action/item_action/ninja_sword_recall))
ninja_sword_recall()
return TRUE
if(istype(action, /datum/action/item_action/ninja_stealth))
stealth()
return TRUE
if(istype(action, /datum/action/item_action/toggle_glove))
n_gloves.toggledrain()
return TRUE
return FALSE
+87 -91
View File
@@ -1,102 +1,98 @@
//Verbs link to procs because verb-like procs have a bug which prevents their use if the arguments are not readily referenced.
//^ Old coder words may be false these days, Not taking the risk for now.
/obj/item/clothing/suit/space/space_ninja/proc/init()
set name = "Initialize Suit"
set desc = "Initializes the suit for field operation."
set category = "Ninja Equip"
ninitialize()
/obj/item/clothing/suit/space/space_ninja/proc/deinit()
set name = "De-Initialize Suit"
set desc = "Begins procedure to remove the suit."
set category = "Ninja Equip"
if(!s_busy)
/obj/item/clothing/suit/space/space_ninja/proc/toggle_on_off()
if(s_busy)
to_chat(loc, "<span class='userdanger'>ERROR</span>: You cannot use this function at this time.")
return FALSE
if(s_initialized)
deinitialize()
else
to_chat(affecting, "<span class='danger'>The function did not trigger!</span>")
ninitialize()
. = TRUE
/obj/item/clothing/suit/space/space_ninja/proc/ninitialize(delay = s_delay, mob/living/carbon/human/U = loc)
if(U.mind && U.mind.assigned_role==U.mind.special_role && !s_initialized && !s_busy)//Shouldn't be busy... but anything is possible I guess.
s_busy = 1
for(var/i,i<7,i++)
switch(i)
if(0)
to_chat(U, "<span class='notice'>Now initializing...</span>")
if(1)
if(!lock_suit(U))//To lock the suit onto wearer.
break
to_chat(U, "<span class='notice'>Securing external locking mechanism...\nNeural-net established.</span>")
if(2)
to_chat(U, "<span class='notice'>Extending neural-net interface...\nNow monitoring brain wave pattern...</span>")
if(3)
if(U.stat==2||U.health<=0)
to_chat(U, "<span class='danger'><B>FĆAL �Rr�R</B>: 344--93#�&&21 BR��N |/|/aV� PATT$RN <B>RED</B>\nA-A-aB�rT�NG...</span>")
unlock_suit()
break
lock_suit(U,1)//Check for icons.
U.regenerate_icons()
to_chat(U, "<span class='notice'>Linking neural-net interface...\nPattern</span>\green <B>GREEN</B><span class='notice'>, continuing operation.</span>")
if(4)
to_chat(U, "<span class='notice'>VOID-shift device status: <B>ONLINE</B>.\nCLOAK-tech device status: <B>ONLINE</B>.</span>")
if(5)
to_chat(U, "<span class='notice'>Primary system status: <B>ONLINE</B>.\nBackup system status: <B>ONLINE</B>.\nCurrent energy capacity: <B>[cell.charge]</B>.</span>")
if(6)
to_chat(U, "<span class='notice'>All systems operational. Welcome to <B>SpiderOS</B>, [U.real_name].</span>")
grant_ninja_verbs()
grant_equip_verbs()
ntick()
sleep(delay)
s_busy = 0
else
if(!U.mind||U.mind.assigned_role!=U.mind.special_role)//Your run of the mill persons shouldn't know what it is. Or how to turn it on.
to_chat(U, "You do not understand how this suit functions. Where the heck did it even come from?")
else if(s_initialized)
to_chat(U, "<span class='danger'>The suit is already functioning.</span> Please report this bug.")
else
to_chat(U, "<span class='userdanger'>ERROR</span>: You cannot use this function at this time.")
return
if(!U.mind)
return //Not sure how this could happen.
if(!is_ninja(U))
to_chat(U, "You do not understand how this suit functions. Where the heck did it even come from?")
return
s_busy = TRUE
to_chat(U, "<span class='notice'>Now initializing...</span>")
addtimer(CALLBACK(src, .proc/ninitialize_two, delay, U), delay)
/obj/item/clothing/suit/space/space_ninja/proc/ninitialize_two(delay, mob/living/carbon/human/U)
if(!lock_suit(U))//To lock the suit onto wearer.
s_busy = FALSE
return
to_chat(U, "<span class='notice'>Securing external locking mechanism...\nNeural-net established.</span>")
addtimer(CALLBACK(src, .proc/ninitialize_three, delay, U), delay)
/obj/item/clothing/suit/space/space_ninja/proc/ninitialize_three(delay, mob/living/carbon/human/U)
to_chat(U, "<span class='notice'>Extending neural-net interface...\nNow monitoring brain wave pattern...</span>")
addtimer(CALLBACK(src, .proc/ninitialize_four, delay, U), delay)
/obj/item/clothing/suit/space/space_ninja/proc/ninitialize_four(delay, mob/living/carbon/human/U)
if(U.stat==2||U.health<=0)
to_chat(U, "<span class='danger'><B>FĆAL �Rr�R</B>: 344--93#�&&21 BR��N |/|/aV� PATT$RN <B>RED</B>\nA-A-aB�rT�NG...</span>")
unlock_suit()
return
lockIcons(U)//Check for icons.
U.regenerate_icons()
to_chat(U, "<span class='notice'>Linking neural-net interface...\nPattern</span>\green <B>GREEN</B><span class='notice'>, continuing operation.</span>")
addtimer(CALLBACK(src, .proc/ninitialize_five, delay, U), delay)
/obj/item/clothing/suit/space/space_ninja/proc/ninitialize_five(delay, mob/living/carbon/human/U)
to_chat(U, "<span class='notice'>VOID-shift device status: <B>ONLINE</B>.\nCLOAK-tech device status: <B>ONLINE</B>.</span>")
addtimer(CALLBACK(src, .proc/ninitialize_six, delay, U), delay)
/obj/item/clothing/suit/space/space_ninja/proc/ninitialize_six(delay, mob/living/carbon/human/U)
to_chat(U, "<span class='notice'>Primary system status: <B>ONLINE</B>.\nBackup system status: <B>ONLINE</B>.\nCurrent energy capacity: <B>[cell.charge]</B>.</span>")
addtimer(CALLBACK(src, .proc/ninitialize_seven, delay, U), delay)
/obj/item/clothing/suit/space/space_ninja/proc/ninitialize_seven(delay, mob/living/carbon/human/U)
to_chat(U, "<span class='notice'>All systems operational. Welcome to <B>SpiderOS</B>, [U.real_name].</span>")
grant_ninja_verbs()
grant_equip_verbs()
ntick()
s_busy = FALSE
/obj/item/clothing/suit/space/space_ninja/proc/deinitialize(delay = s_delay)
if(affecting==loc&&!s_busy)
if(affecting==loc)
var/mob/living/carbon/human/U = affecting
if(!s_initialized)
to_chat(U, "<span class='danger'>The suit is not initialized.</span> Please report this bug.")
return
if(alert("Are you certain you wish to remove the suit? This will take time and remove all abilities.",,"Yes","No")=="No")
return
if(s_busy)
to_chat(U, "<span class='userdanger'>ERROR</span>: You cannot use this function at this time.")
return
s_busy = 1
for(var/i = 0,i<7,i++)
switch(i)
if(0)
to_chat(U, "<span class='notice'>Now de-initializing...</span>")
spideros = 0//Spideros resets.
if(1)
to_chat(U, "<span class='notice'>Logging off, [U:real_name]. Shutting down <B>SpiderOS</B>.</span>")
remove_ninja_verbs()
if(2)
to_chat(U, "<span class='notice'>Primary system status: <B>OFFLINE</B>.\nBackup system status: <B>OFFLINE</B>.</span>")
if(3)
to_chat(U, "<span class='notice'>VOID-shift device status: <B>OFFLINE</B>.\nCLOAK-tech device status: <B>OFFLINE</B>.</span>")
cancel_stealth()//Shutdowns stealth.
if(4)
to_chat(U, "<span class='notice'>Disconnecting neural-net interface...</span>\green<B>Success</B><span class='notice'>.</span>")
if(5)
to_chat(U, "<span class='notice'>Disengaging neural-net interface...</span>\green<B>Success</B><span class='notice'>.</span>")
if(6)
to_chat(U, "<span class='notice'>Unsecuring external locking mechanism...\nNeural-net abolished.\nOperation status: <B>FINISHED</B>.</span>")
remove_equip_verbs()
unlock_suit()
U.regenerate_icons()
sleep(delay)
s_busy = 0
return
s_busy = TRUE
addtimer(CALLBACK(src, .proc/deinitialize_two, delay, U), delay)
/obj/item/clothing/suit/space/space_ninja/proc/deinitialize_two(delay, mob/living/carbon/human/U)
to_chat(U, "<span class='notice'>Now de-initializing...</span>")
spideros = 0//Spideros resets.
addtimer(CALLBACK(src, .proc/deinitialize_three, delay, U), delay)
/obj/item/clothing/suit/space/space_ninja/proc/deinitialize_three(delay, mob/living/carbon/human/U)
to_chat(U, "<span class='notice'>Logging off, [U:real_name]. Shutting down <B>SpiderOS</B>.</span>")
remove_ninja_verbs()
addtimer(CALLBACK(src, .proc/deinitialize_four, delay, U), delay)
/obj/item/clothing/suit/space/space_ninja/proc/deinitialize_four(delay, mob/living/carbon/human/U)
to_chat(U, "<span class='notice'>Primary system status: <B>OFFLINE</B>.\nBackup system status: <B>OFFLINE</B>.</span>")
addtimer(CALLBACK(src, .proc/deinitialize_five, delay, U), delay)
/obj/item/clothing/suit/space/space_ninja/proc/deinitialize_five(delay, mob/living/carbon/human/U)
to_chat(U, "<span class='notice'>VOID-shift device status: <B>OFFLINE</B>.\nCLOAK-tech device status: <B>OFFLINE</B>.</span>")
cancel_stealth()//Shutdowns stealth.
addtimer(CALLBACK(src, .proc/deinitialize_six, delay, U), delay)
/obj/item/clothing/suit/space/space_ninja/proc/deinitialize_six(delay, mob/living/carbon/human/U)
to_chat(U, "<span class='notice'>Disconnecting neural-net interface...</span>\green<B>Success</B><span class='notice'>.</span>")
addtimer(CALLBACK(src, .proc/deinitialize_seven, delay, U), delay)
/obj/item/clothing/suit/space/space_ninja/proc/deinitialize_seven(delay, mob/living/carbon/human/U)
to_chat(U, "<span class='notice'>Disengaging neural-net interface...</span>\green<B>Success</B><span class='notice'>.</span>")
addtimer(CALLBACK(src, .proc/deinitialize_eight, delay, U), delay)
/obj/item/clothing/suit/space/space_ninja/proc/deinitialize_eight(delay, mob/living/carbon/human/U)
to_chat(U, "<span class='notice'>Unsecuring external locking mechanism...\nNeural-net abolished.\nOperation status: <B>FINISHED</B>.</span>")
remove_equip_verbs()
U.regenerate_icons()
s_busy = FALSE
-2
View File
@@ -20,5 +20,3 @@
cancel_stealth()
sleep(10)//Checks every second.
+2 -22
View File
@@ -9,33 +9,20 @@ Contents:
*/
/obj/item/clothing/suit/space/space_ninja/proc/grant_equip_verbs()
verbs -= /obj/item/clothing/suit/space/space_ninja/proc/init
verbs += /obj/item/clothing/suit/space/space_ninja/proc/deinit
verbs += /obj/item/clothing/suit/space/space_ninja/proc/stealth
n_gloves.verbs += /obj/item/clothing/gloves/space_ninja/proc/toggled
n_gloves.verbs += /obj/item/clothing/gloves/space_ninja/proc/toggledrain
s_initialized = 1
/obj/item/clothing/suit/space/space_ninja/proc/remove_equip_verbs()
verbs += /obj/item/clothing/suit/space/space_ninja/proc/init
verbs -= /obj/item/clothing/suit/space/space_ninja/proc/deinit
verbs -= /obj/item/clothing/suit/space/space_ninja/proc/stealth
if(n_gloves)
n_gloves.verbs -= /obj/item/clothing/gloves/space_ninja/proc/toggled
n_gloves.verbs -= /obj/item/clothing/gloves/space_ninja/proc/toggledrain
s_initialized = 0
/obj/item/clothing/suit/space/space_ninja/proc/grant_ninja_verbs()
verbs += /obj/item/clothing/suit/space/space_ninja/proc/ninjashift
verbs += /obj/item/clothing/suit/space/space_ninja/proc/ninjajaunt
verbs += /obj/item/clothing/suit/space/space_ninja/proc/ninjasmoke
verbs += /obj/item/clothing/suit/space/space_ninja/proc/ninjaboost
verbs += /obj/item/clothing/suit/space/space_ninja/proc/ninjapulse
verbs += /obj/item/clothing/suit/space/space_ninja/proc/ninjastar
verbs += /obj/item/clothing/suit/space/space_ninja/proc/ninjanet
verbs += /obj/item/clothing/suit/space/space_ninja/proc/ninja_sword_recall
s_initialized=1
slowdown=0
@@ -43,10 +30,3 @@ Contents:
/obj/item/clothing/suit/space/space_ninja/proc/remove_ninja_verbs()
verbs -= /obj/item/clothing/suit/space/space_ninja/proc/ninjashift
verbs -= /obj/item/clothing/suit/space/space_ninja/proc/ninjajaunt
verbs -= /obj/item/clothing/suit/space/space_ninja/proc/ninjasmoke
verbs -= /obj/item/clothing/suit/space/space_ninja/proc/ninjaboost
verbs -= /obj/item/clothing/suit/space/space_ninja/proc/ninjapulse
verbs -= /obj/item/clothing/suit/space/space_ninja/proc/ninjastar
verbs -= /obj/item/clothing/suit/space/space_ninja/proc/ninjanet
verbs -= /obj/item/clothing/suit/space/space_ninja/proc/ninja_sword_recall