ID:154675
 
mob/player
verb
enrage()
set category = "skills"
if(usr.frozen == 1)
usr << "<font color=red size = 1>You are already doing something!"
return
switch(input("How much do you want to enrage?","testing") in list("1","2","3","4"))

if("1")
if(usr.blue == 1)
Blue_Trans1()
if(usr.red == 1)
red_Trans1()
// etc etc..

I'm trying to figure out a way to set what a player can choose from in the set list based on what race they are. So for example if the person is a blue race they will see 1,2,3 and if they are a red race they can see 4,5,6 options in the list.
you can alter the list you use for input() prior to the switch statement. e.g.

var/l[]
if( race == "monster" )
l = list( "Choice1", "Choice2", "Choice3" )

else if( race == "antelope" )
l = list( "Choice99", "Choice8" )

// and then:

input(blablahblah) as anything in l
In response to Metamorphman
Metamorphman wrote:
you can alter the list you use for input() prior to the switch statement. e.g.

> var/l[]
> if( race == "monster" )
> l = list( "Choice1", "Choice2", "Choice3" )
>
> else if( race == "antelope" )
> l = list( "Choice99", "Choice8" )
>
> // and then:
>
> input(blablahblah) as anything in l
>

I am a visual learner and I am having trouble understanding what you are trying to show. If you could please tidy up your code or edit my original with yours, I showed you I would greatly appreciate it thanks.
In response to Dbgtsuperfreak
He means:
mob/player
verb
enrage()
set category = "skills"
if(usr.frozen == 1)
usr << "<font color=red size = 1>You are already doing something!"
return
var/L = list()
if(usr.blue == 1)
L = list("1","2","3")
else if(usr.red == 1)
L = list("4","5","6")
switch(input("How much do you want to enrage?","testing") in list(L))

if("1")
if(usr.blue == 1)
Blue_Trans1()
if(usr.red == 1)
Goku_Trans1()
In response to Prf X
I have this implemented with correct indentation and 0 errors/warnings and my different races are not seeing the different lists when the enrage command is called.
In response to Dbgtsuperfreak
mob/player
verb
enrage()
set category = "skills"
if(usr.frozen == 1)
usr << "<font color=red size = 1>You are already doing something!"
return
var/list/L = New()
if(usr.blue == 1)
L += "1"
L += "2"
L += "3"
else if(usr.red == 1)
L += "4"
L += "5"
L += "6"
switch(input("How much do you want to enrage?","testing") in list(L))

if("1")
if(usr.blue == 1)
Blue_Trans1()
if(usr.red == 1)
Goku_Trans1()


That should work.
In response to Unwanted4Murder
Unwanted4Murder using this method the transform command isn't even working anymore. No errors but it isn't working at all when clicked.
In response to Dbgtsuperfreak
mob/player
verb
enrage()
set category = "skills"
if(usr.frozen == 1)
usr << "<font color=red size = 1>You are already doing something!"
return
var/list/L = new()
if(usr.blue == 1)
L += "1"
L += "2"
L += "3"
else if(usr.red == 1)
L += "4"
L += "5"
L += "6"
switch(input("How much do you want to enrage?","testing") in L)

if("1")
if(usr.blue == 1)
Blue_Trans1()
if(usr.red == 1)
Goku_Trans1()


I didn't even bother testing something so simple, hence why it didn't work. If you have problems, don't just wait for someone to fix it for you, then just blindly copy and paste... figure it out for yourself.
In response to Unwanted4Murder
I found the simple mistakes you made in that original code after the fact I posted.Thanks for your help though.