5 from quest
import checkSaveValue
27 """Returns two strings, the first is the text for the node, the second is
29 text, choices, sprite, motext =
getAllNewInfo(conversation, ref)
33 """Gets the node in the conversation corresponding to \'ref\'"""
34 for node
in conversation:
35 if node.split(
'^')[0].
split(
'|')[0] == ref:
37 raise RuntimeError(
"Node with reference \'%s\' not found in conversation."%ref)
40 """Gets the preconditions for the conversation."""
48 """Retrieves the suitable text and choices, as well as the sprite and
59 use = default.split(
'|')
62 return use[1], use[2], use[3], use[4]
65 """Retrieves the initial starting objects required for the CFixer class.
66 This is the starting text, choices, and preconditions. text and choices
67 are both strings, but the preconditions returned may be a list."""
72 return text, whenclicked, sprite, motext, name, precon
75 """Takes a string representing the condition, and returns whether it is
77 if type(condition) != str:
78 raise TypeError(
"The condition is not a valid type.")
79 elif condition ==
str():
81 elif condition[0] ==
'#':
83 exec condition[1:]
in tempd
84 print "Custom condition code, returning: " +
str(tempd[
"result"])
85 return tempd[
"result"]
87 con = condition.split(
'#')
88 print "Checking \'%s : %s\'"%(con[0],con[1])
89 print "Returning: " +
str(
checkSaveValue(VS.getCurrentPlayer(),con[0],int(con[1])))
93 """Takes a list of conditions, and evaluates them."""
94 for cond
in conditions:
104 return "Node2|#a==2^#b==1|\"Aar! This ale is mighty fine. You there, walk the plank!\"|choices|sprite|mouseover^#b==2|\"Land Ahoy!\"|\"bases/fixers/no.spr\"~\"bases/fixers/iso_decline.py\"~\"F Off!\"^\"bases/fixers/yes.spr\"~\"bases/fixers/iso_accept.py\"~\"Sure!\"|sprite|mouseover"
107 return [
"Node2^#b==1|\"Aar! This ale is mighty fine. You there, walk the plank!\"|choices^#b==2|\"Land Ahoy!\"|choices",
"Root|#a==2^#b==1|\"Aar! This RootBeer is mighty fine. You are scummvm.\"|choices|sprite|mouseover^#b==2|\"Land AhoyRoot!\"|choices2|sprite2|mouseover2"]