ID:142569
 
Code:
mob/verb
MakeKage(mob/M in world)
if(M.charvillage == "Hidden Leaf Village")
if(M.charrank == "Jounin")
if(M.kage == 0)
world << "[M] is now the Hokage."
M.kage = 1
M.charrank = "Hokage"
else
M << "You already a kage."
else
M << "Your not Jounin rank yet."
if(M.charvillage == "Hidden Sand Village")
if(M.charrank == "Jounin")
if(M.kage == 0)
world << "[M] is now the Kazekage."
M.kage = 1
M.charrank = "Kazekage"
else
M << "You already a kage."
else
M << "Your not Jounin rank yet."
if(M.charvillage == "Hidden Mist Village")
if(M.charrank == "Jounin")
if(M.kage == 0)
world << "[M] is now the Mizukage."
M.kage = 1
M.charrank = "Mizukage"
else
M << "You already a kage."
else
M << "Your not Jounin rank yet."
if(M.charvillage == "Hidden Rock Village")
if(M.charrank == "Jounin")
if(M.kage == 0)
world << "[M] is now the Tsuchikage."
M.kage = 1
M.charrank = "Tsuchikage"
else
M << "You already a kage."
else
M << "Your not Jounin rank yet."
if(M.charvillage == "Hidden Cloud Village")
if(M.charrank == "Jounin")
if(M.kage == 0)
world << "[M] is now the Raikage."
M.kage = 1
M.charrank = "Raikage"
else
M << "You already a kage."
else
M << "Your not Jounin rank yet."
else
M << "Your not in a village, that has kages."


Problem description:

everytime I use it, I get two messages. The "Your not in a village, that has kages." and "[M] is now [type of kage]....help please..
I don't normally respond to people who are building another freakin' anime game, but I couldn't help myself. Your code needs help, man!

Here, analyze this code. It does essentially the same thing as your code wants to be doing, only more efficiently and with wookies instead of hokey anime jibberish.

// This is a list of all villages which allow wookie promotions.
var/list/WookieVillages = list("Hidden Wookie Village")


// This is a player/admin verb which checks to see if the player is in a
// proper wookie village and attempts to promote them to a wookie master.
mob/verb/WookieSnappers(mob/M in world)
if(WookieVillages.Find(src.village))
M.MakeWookie()
else
src << "You are not in a proper wookie village."


// This proc promotes someone to a wookie master if they already have
// underwookie status and if they're not already a wookie master.
mob/proc/MakeWookie()
if(src.rank == "Underwookie")
if(!src.wookieship)
world << "[src] becomes a wookie master!"
src.wookieship = 1
src.rank = "Wookiemeister"
else
src << "You are already a wookie master!"
else
src << "You are not worthy of wookiemastership."
In response to Foomer
God forbid this guy copies your code.
He'll have Wookies in his Naruto game!
In response to Flame Sage
I'm not that special....lol I took the basis of the code and changed it to apply to mine. I'm not a complete noob anymore..
In response to Lundex
Apparently you are "that special", because you willingly chose not to have wookies in your game.
In response to Garthor
Not a big starwars fan..
In response to Foomer
Foomer wrote:
>   if(WookieVillages.Find(src.village))


Really ought to change that to the following:
    if(src.village in WookieVillages)

Not only is it simpler, but it also maintains functionality if some anime-kong decides to destroy the WookieVillages to emptiness (and hence nullified if you are a true Green Programmer/Jedi).

Hiead