Use_Tps()
set category = "Channels"
switch(input("Where do you wish to use your TPs?","TPs")in list("Powerlevel","Ki","Ki Defense","Strength","Defense","Stamina","Exp","Cancel"))
if("Exp")
var/TP=input("How many TPs do you wish to use? [num2text(round(usr.tp),15)] TPs") as num
var/pl=20*TP
if(TP>usr.tp)
usr<<"<font color=white>TP Specialest</font> You don't have that many TPs!"
return
if(TP==0||TP==null||!TP)
return
while(TP==0||TP==null||!TP)
return
if(TP<0)
usr<<"<font color=white>TP Specialest:</font> You must enter a positive number!"
return
usr.powerlevel_max+=pl
usr.powerlevel+=pl
usr<<"<font color=white>TP Specialest:</font> You have gained [num2text(round(pl),15)] Exp!"
usr.tp-=TP
return
if("Stamina")
var/TP=input("How many TPs do you wish to use? [num2text(round(usr.tp),15)] TPs") as num
var/pl=TP/1.5
if(TP>usr.tp)
usr<<"<font color=white>TP Specialest:</font> You don't have that many TPs!"
return
if(TP==0||TP==null||!TP)
return
while(TP==0||TP==null||!TP)
return
if(TP<0)
usr<<"<font color=white>TP Specialest:</font> You must enter a positive number!"
return
usr.staminaleft_max+=pl
usr<<"<font color=white>TP Specialest:</font> You have gained [num2text(round(pl),15)] Stamina!"
usr.tp-=TP
return
if("Powerlevel")
var/TP=input("How many TPs do you wish to use? [num2text(round(usr.tp),15)] TPs") as num
var/pl=rand(400,500)*TP
if(TP>usr.tp)
usr<<"<font color=white>TP Specialest:</font> You don't have that many TPs!"
return
if(TP==0||TP==null||!TP)
return
while(TP==0||TP==null||!TP)
return
if(TP<0)
usr<<"<font color=white>TP Specialest:</font> You must enter a positive number!"
return
usr.powerlevel_max+=pl
usr.powerlevel+=pl
usr<<"<font color=white>TP Specialest:</font> You have gained [num2text(round(pl),15)] Powerlevel!"
usr.tp-=TP
return
if("Ki")
var/TP=input("How many TPs do you wish to use? [num2text(round(usr.tp),15)] TPs") as num
var/pl=rand(400,500)*TP
if(TP>usr.tp)
usr<<"<font color=white>TP Specialest:</font> You don't have that many TPs!"
return
if(TP==0||TP==null||!TP)
return
while(TP==0||TP==null||!TP)
return
if(TP<0)
usr<<"<font color=white>TP Specialest:</font> You must enter a positive number!"
return
usr.ki_max+=pl
usr.ki+=pl
usr<<"<font color=white>TP Specialest:</font> You have gained [num2text(round(pl),15)] Ki!"
usr.tp-=TP
return
if("Ki Defense")
var/TP = input ("How many TPs do you wish to use? [num2text(round(usr.tp),15)] TPs") as num
var/pl = rand(400,500) * TP
if(TP > usr.tp)
usr<<"<font color=white>TP Specialest:</font> You don't have that many TPs!"
return
if(TP == 0 || TP == null || !TP)
return
while(TP == 0 || TP == null || !TP)
return
if(TP < 0)
usr<<"<font color=white>TP Specialest:</font> You must enter a positive number!"
return
usr.kidefense_max += pl
usr.kidefense += pl
usr<<"<font color=white>TP Specialest:</font> You have gained [num2text(round(pl),15)] Ki Defense!"
usr.tp -= TP
return
if("Strength")
var/TP=input("How many TPs do you wish to use? [num2text(round(usr.tp),15)] TPs") as num
var/str=rand(80,100)*TP
if(TP>usr.tp)
usr<<"<font color=white>TP Specialest:</font> You don't have that many TPs!"
return
if(TP==0||TP==null||!TP)
return
while(TP==0||TP==null||!TP)
return
if(TP<0)
usr<<"<font color=white>TP Specialest:</font> You must enter a positive number!"
return
usr.strength+=str
usr.strength_max+=str
usr<<"<font color=white>TP Specialest:</font> You have gained [num2text(round(str),15)] Strength!"
usr.tp-=TP
return
if("Defense")
var/TP=input("How many TPs do you wish to use? [num2text(round(usr.tp),15)] TPs") as num
var/str=rand(80,100)*TP
if(TP>usr.tp)
usr<<"<font color=white>TP Specialest:</font> You don't have that many TPs!"
return
if(TP==0||TP==null||!TP)//this line has the error
return
while(TP==0||TP==null||!TP)
return
if(TP<0)
usr<<"<font color=white>TP Specialest:</font> You must enter a positive number!"
return
usr.defence+=str
usr.defence_max+=str
usr<<"<font color=white>TP Specialest:</font> You have gained [num2text(round(str),15)] Defense!"
usr.tp-=TP
return
if("Cancel")return
Problem description:
SagasReborn Codings\Options.dm:319:error: if: expected end of statement
(12 lines above the last line is where the error is
Also, golden rule in programming, whenever you're repeating large chunks of code, you're doing it wrong.