ID:168978
 
I'm trying to make a verb that makes you type in the answer to a question.

If the person gets it wrong they go back to the same answer.
But if they get it right they get what ever the answer was.

Any suggestions?

Well this is what I started to make.Can anyone make it better?

mob
proc
summon()
var/answer = input("What is your wish?") as text
if("Power")
src.power += 50
if("power")
src.power += 50
if("POWER")
src.power += 50
if("KI")
src.ki += 50
if("ki")
src.ki += 50
if("Ki")
src.ki+= 50
else
usr.summon()
SSED/verb
Summon_Shenron()
usr.summon()
atom/movable/var
power = 0
ki = 0
mob
proc
summon()
var/answer = input("What is your wish?") as text
// patch the reply
answer = uppertext(answer)
// all done
switch(answer)
if("POWER")
src.power += 50
if("KI")
src.ki += 50
else
src << "wooooo" // dont ask ^_^
spawn(1) summon()
SSED/verb
Summon_Shenron()
usr.summon()

you could also use a alert if theres 3 or less answers
var/answer = alert(src,"What is your wish?","Shenron","Power","Ki","Dont wish")

you could change the input to a list
var/answer = input(src,"What is your wish?","Shenron") in list("Power","Ki","Not sure right now")
In response to Zmadpeter
Thanks Zmadpeter!