PokeCoins_Keeper
icon_state = "24"
Click()
set src in oview(1)
if("[usr.key]" in Frozelist){return}
Frozelist.Add("[usr.key]")
var/list/List = list(new/PokeCoins_Rewards/Icons/Jedi_Icon,new/PokeCoins_Rewards/Icons/Unova_Ash_Icon,new/PokeCoins_Rewards/Icons/Professor_Oak_Icon,
new/PokeCoins_Rewards/Icons/Alternate_Blue_Icon,new/PokeCoins_Rewards/Icons/Alternate_Silver_Icon,new/PokeCoins_Rewards/Icons/Paul_Anime_Icon,
new/PokeCoins_Rewards/Icons/Madara_Icon,new/PokeCoins_Rewards/Icons/Black_Robe_Icon, new/PokeCoins_Rewards/Items/Lucky_Egg, new/PokeCoins_Rewards/Medicine/Iron,
new/PokeCoins_Rewards/Medicine/HP_Up, new/PokeCoins_Rewards/Medicine/Protein
)
List.Add("Cancel")
usr.Show_Text("PokeCoins Keeper: Welcome to the Pokemon Mart! You want to trade any PokeCoins for some prizes?")
var/PokeCoins_Rewards/Q = input(usr,"What will you like")in List
if(Q == "Cancel"){Frozelist.Remove("[usr.key]"); return}
if(usr.Money >= Q.Cost)
var/Option = input(usr, "[Q.name] costs [Q.Cost] PokeCoins, get it?")in list("Yes", "No")
if(Option == "Yes")
var/Number = input("How much [Q.name], [Q.Cost] PokeCoins?")as num
if(!Number ||Number <= 0){Frozelist.Remove("[usr.key]"); return}
var/Times = Number*Q.Cost
if(usr.PokeCoins >= Times)
usr.PokeCoins -= Times
var/i = 0
for(var/PokeCoins_Rewards/T in usr)
if(T.type == Q.type)
AddPrize(T, Number)
i ++
if(!i || i == 0)
var/PokeCoins_Rewards/I = new Q.type(usr)
AddPrize(I, Number)
usr.Show_Text("System: You exchanged [Times] PokeCoins for [Number] [Q.name]!")
Frozelist.Remove("[usr.key]"); return
else Frozelist.Remove("[usr.key]"); return
else Frozelist.Remove("[usr.key]"); return
Frozelist.Remove("[usr.key]"); return
Problem description:
How do I disable entering decimals as num??? Please help.
You can either just round the results:
You can also get the decimal value in a number by doing this:
You don't have to disable the entering of decimals, just make sure that the number is using positive integers only after input by either rounding, or yelling at the player if they entered a decimal value.