Stealth Library

by Jemai1
A simple stealth library which effectively handles invisibility and visibility of icons to selected players.
ID:121596
 
Keywords: library, stealth
It has been a problem on how to make atoms invisible to some and not to others.

My first attempt to make this possible was to make an image that holds the icon and overlays of an atom. Then, make the icon and overlays null. Finally, show the image datum to selected players.

It works. However, flick() never worked on images.

On this rainy day, upon paying attention to the override var of images, I realized that I should reverse the process. Instead of using images for visibility, I could use it for invisibility. Really.

This stealth library is the product of that simple idea.
Now, flick() can be used without worries.

Try it out and please give comments and suggestions.

Library features:
// - Effectively handles invisibility/visibility of atoms.*
mob/proc
Hide()
src.stealth(1)
Appear()
src.stealth(0)

// - Lets developers choose who can see what.
mob
Detect(atom/atom)
if( atom == src )
return TRUE
else
return FALSE

// - Icons, overlays and flick() friendly
mob/verb
Cloak_of_Invisibility()
if( !src.hidden() )
overlays += /obj/cloak
Hide()
flick("smirk",src)
view(5,src) << "[src] vanished!"
else
Appear()
overlays -= /obj/cloak
flick("bleh",src)
view(5,src) << "[src]: Surprise!"

*Invisibility is only icon related. Mouse opacity, invisibility of verbs and other factors are not affected.

Demo (included in the library) screenshots:




You should make a library on how you made the click to move/attack in that naruto game demo.
Rockeyx2 wrote:
You should make a library on how you made the click to move/attack in that naruto game demo.

It'll be a challenge to make click-move fully customizable and compatible for all map formats and movement systems. I'll see what I can do once I return from school.

Any comments/suggestions regarding my stealth library?
Just got home. It seems that I'm bad at advertising. :\
Bad advertising? You posted it in the right spot except no one has had time to look at what you've made.
Rockeyx2 wrote:
Bad advertising? You posted it in the right spot except no one has had time to look at what you've made.

That's a good way to put it.

Off topic: If you would be using the click to move/attack thingy, what features would you like it to have?

Edit: Stopped working on the click to move/attack. Gotta focus on other things.