In response to Jittai
Jittai wrote:
A lot of this code could be written so it's easier to modify later on (and easier to look at)... why is there a var per clan type and a clan var?

You should probably just indent the Click() proc to apply to all the clan turfs and refer to vars for description.

I'm.. Not sure what you mean.. ? If I indent the Click() proc on just one for them all(I hope you mean this):

Haku
Click()
switch(
Haku=1
usr<< "(message)"

If I did that, How would I add the next turf? And also, if I did that.. Then the Click() proc wouldn't even apply to the rest of the code...
Now keep in mind, I'm not the best coder..Everything I learned, I learned on my own, and I don't know everything... although I love learning news things about coding, I don't like learning them aggressively, so please be patience with me.

Why does it seem difficult?

obj/clans
var
// this is the variable that needs to change when the usr
// selects the clan
var_to_change
// this is the msg that shows once the usr selected the clan
enter_msg

Akimichi
name = "Akimichi"
desc = "We like manipulating our size."
var_to_change = "Akimichi"
enter_msg = "You have become an Akimichi, you can now expand your size."

Click()
switch(alert(usr, src.desc, , "Yes", "No"))
if("Yes")
usr.vars[src.var_to_change] = 1
usr.clan = src.name
usr << src.enter_msg
That is another way to do it. But from how I've been coding, and from what I'M used to.. That looks like a crazy funk of nuttiness and I have no idea how that could look more efficient. But for YOU and maybe some other people it might, It's just not what I like. I find that, the way I do it makes it click better in my head because it's right there with each other. All I have to do is scroll down and see, It's Akimichi clan, then see it's click able, then the switch statement and what variable changes and the message.. It's just how my brain is trained... And since your argument was about being able to see and modify it easier later on, I do believe I have a good system here... For me. Thankyou for everything though guys ^^.
If you ever have to modify the Click()'s you'd have to modify every single one when the only differences are the descriptions and which var it's adding.

I personally would not have a var per clan, especially when you have a "clan" var as well. You could also make the clan var a list and make it hold several text entries.
I really don't know what you mean...

    Akimichi
Click()
switch(alert(usr, Are you sure you want to have the ability of size manipulation,,Yes, No))
if(Yes)
usr.Akimichi=1
usr.Clan=Akimichi
usrYou can now manipulate your size!
usr.loc=locate(385,7,2)
if(No)
return

If I did it this way.. Or if I did it the way you suggest... I'd still have to do it for each and every clan.. They are their own individual turfs. If I had the var like
dm
objclans
var
this is the variable that needs to change when the usr
selects the clan
var_to_change
this is the msg that shows once the usr selected the clan
enter_msg
</dm>
This, or a var
Akimichi=1

like this, then I'd still have to put the name for each and every clan anyways..
In response to Kyubikitsune
I think that you are confused.
Think of it this way. Why do you have Akimichi=1 when you have Clan="Akimichi" ? Surely what ever you use to check for people's clans can be done with the clan var instead of having 40+ vars all applied to mobs.
OHHHH.. Well, Here's the thing, The Clan="Akimichi" is shown in the "Stats" tab to show the person with that clan, what clan they are. and the Akimichi=1 is so that when they train, They get the Akimichi jutsus and not some other clans jutsus. It's set up that way, because some organizations and/or villages change your Clan so incase that happens you can have your clan as whatever, EX: Clan="Anything" and still get Akimichi jutsus because Akimichi=1.
Also, Jutsus are like skills. For anyone that doesn't follow Naruto.
So, saying all that, "Clan" is not a hidden variable as much as a stat like Strength, or Health so that the usr knows what clan they are incase they play a bunch of bleach and wanna try Naruto for the first time and don't know what all the clans are.
You can have the behaviour you want with out having to keep adding more vars.

If you turn Clan into a list you can check if "Akimichi" is in Clan. As a list you can add "HideClan" to that list and check for it in some proc to hide the that stat from others.

So instead of:

var/Akimichi=1
var/Clan="Akimichi"
var/list/Clan = list("Akimichi")
//if("Akimichi" in Clan) //gain jutsus here


This alternative way you'd have much more flexibility and if you ever need to add a new clan you don't have to introduce a new var. It's not necessarily a big deal, but you have 20+ vars that never get used and still being saved on all your players. Never looked into the nuances of saves but I'd imagine less saved vars are better.
But that makes like... 10x more work..lol.
How so?

Instead of: if(Akimichi==1) you'd use if("Akimichi" in Clan) and you'd have no var/Akimichi at all.
But then I have to do that for 30 other clans. I don't see why having vars is such a bad thing lol. I mean it's only like what? 2 vars per clan? It's not that bad.
You could also use bitflags.
#define AKIMICHI (0 << 1)
#define INUZUKA (0 << 2)
//etc for each clan you want, add one to the second number for each bitflag you add.

mob
var/clans = 0

proc/join_clan(newclan as num)
clans |= newclan

proc/check_clan(someclan as num)
return clans & someclan //Returns 1 if you're in someclan, else returns 0

proc/leave_clan(badclan as num)
clans &= ~badclan


Example usage:

for(var/mob/M in world) //Makes everyone leave all clans and join Inuzuka
M.clans = 0
M.join_clan(INUZUKA)

if(check_clan(AKIMICHI)) //If they're in Akimichi
grow() //or whatever


The only problem I can see is adding messages for joining/leaving, which can be accomplished with the following called during join_clan()
/mob/proc/join_clan_message(clan as num)
var/message = "Something awful has gone wrong. Report this bug."
switch(clan)
if(AKIMICHI)
message = "You can now manipulate your size!"
if(INUZUKA)
message = "Some other message about what you can do!"
src << message
Page: 1 2