Add files via upload

master
aardlyworthit 6 years ago committed by GitHub
parent d9a2a07c6c
commit 29c39f990a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -330,8 +330,8 @@ function set_potential(name, line, args)
end end
function afford_instinct(trains, gold) function afford_instinct(trains, gold)
char_base = gmcp("char.worth") char_worth = gmcp("char.worth")
if my_trains >= trains and (char_base.gold + char_base.bank) >= gold then if my_trains >= trains and (char_worth.gold + char_worth.bank) >= gold then
return "white", "", " [", "lime", "", "OK", "white", "", "]" return "white", "", " [", "lime", "", "OK", "white", "", "]"
else else
return "white", "", " [", "red", "", "NOK", "white", "", "]" return "white", "", " [", "red", "", "NOK", "white", "", "]"
@ -347,6 +347,10 @@ function calculate_instinct()
else else
to = current + want to = current + want
end end
if to > #instinct then
ColourNote("orange", "", " >> ", "silver", "", "Invalid instinct cost parameters.")
return
end
if to <= current then if to <= current then
ColourNote("orange", "", " >> ", "silver", "", "Your ", "yellow", "", which_instinct, "silver", "", " instinct is already ", "yellow", "", current, "silver", "", "! Please try again.") ColourNote("orange", "", " >> ", "silver", "", "Your ", "yellow", "", which_instinct, "silver", "", " instinct is already ", "yellow", "", current, "silver", "", "! Please try again.")
return return
@ -363,8 +367,8 @@ function calculate_instinct()
end end
function afford_mastery(qp, gold) function afford_mastery(qp, gold)
char_base = gmcp("char.worth") char_worth = gmcp("char.worth")
if quest_points >= qp and (char_base.gold + char_base.bank) >= gold then if quest_points >= qp and (char_worth.gold + char_worth.bank) >= gold then
return "white", "", " [", "lime", "", "OK", "white", "", "]" return "white", "", " [", "lime", "", "OK", "white", "", "]"
else else
return "white", "", " [", "red", "", "NOK", "white", "", "]" return "white", "", " [", "red", "", "NOK", "white", "", "]"
@ -384,6 +388,10 @@ function calculate_mastery(name, line, args)
else else
to = current + want to = current + want
end end
if to > #mastery then
ColourNote("orange", "", " >> ", "silver", "", "Invalid mastery cost parameters.")
return
end
if to <= current then if to <= current then
ColourNote("orange", "", " >> ", "silver", "", "Your ", "yellow", "", which_mastery, "silver", "", " mastery is already ", "yellow", "", current, "silver", "", "! Please try again.") ColourNote("orange", "", " >> ", "silver", "", "Your ", "yellow", "", which_mastery, "silver", "", " mastery is already ", "yellow", "", current, "silver", "", "! Please try again.")
return return
@ -400,8 +408,8 @@ function calculate_mastery(name, line, args)
end end
function afford_potential(qp) function afford_potential(qp)
char_base = gmcp("char.worth") char_worth = gmcp("char.worth")
if quest_points >= qp then if tonumber(char_worth.qp) >= tonumber(qp) then
return "white", "", " [", "lime", "", "OK", "white", "", "]" return "white", "", " [", "lime", "", "OK", "white", "", "]"
else else
return "white", "", " [", "red", "", "NOK", "white", "", "]" return "white", "", " [", "red", "", "NOK", "white", "", "]"
@ -418,6 +426,10 @@ function calculate_potential()
else else
to = current + want to = current + want
end end
if to > #potential then
ColourNote("orange", "", " >> ", "silver", "", "Invalid potential cost parameters.")
return
end
if to <= current then if to <= current then
ColourNote("orange", "", " >> ", "silver", "", "Your ", "yellow", "", "Potential", "silver", "", " is already ", "yellow", "", current, "silver", "", "! Please try again.") ColourNote("orange", "", " >> ", "silver", "", "Your ", "yellow", "", "Potential", "silver", "", " is already ", "yellow", "", current, "silver", "", "! Please try again.")
return return

Loading…
Cancel
Save