[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:
committed by
Poojawa
parent
0b1f4a27da
commit
f624071766
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user