-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathraw-svo.valid.diag.lua
119 lines (103 loc) · 5.44 KB
/
raw-svo.valid.diag.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
-- Svof (c) 2011-2015 by Vadim Peretokin
-- Svof is licensed under a
-- Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
-- You should have received a copy of the license along with this
-- work. If not, see <http://creativecommons.org/licenses/by-nc-sa/4.0/>.
function valid.diagnose_start()
checkaction(dict.diag.physical)
if actions.diag_physical then
lifevision.add(actions.diag_physical.p)
elseif conf.aillusion then
setTriggerStayOpen("svo diag", 0)
moveCursor(0, getLineNumber()-1)
moveCursor(#getCurrentLine(), getLineNumber())
insertLink(" (i)", '', 'Ignored this diagnose because we aren\'t actually diagnosing right now (if this is godfeelings, don\'t mind me, then)')
moveCursorEnd()
-- necessary since the trigger itself lasts on the next line
prompttrigger("reset diag", function() sk.diag_list = {} end)
end
end
function valid.empty_diagnose()
checkaction(dict.diag.physical)
if actions.diag_physical then
lifevision.add(actions.diag_physical.p, nil, nil, 1)
valid.diagnose_end()
else
ignore_illusion("Ignoring this illusion because we weren't diagnosing right now.")
end
end
local whitelist = {}
whitelist.lovers, whitelist.retardation, whitelist.hoisted, whitelist.paradox = true, true, true, true
#if skills.metamorphosis then
whitelist.cantvitality = true
#end
#if skills.metamorphosis or skills.shindo or skills.kaido then
whitelist.cantmorph = true
#end
function valid.diagnose_end()
if sk.diag_list.godfeelings then sk.diag_list = {} setTriggerStayOpen("svo diag", 0) return end
-- clear ones we don't have
for affn, afft in pairs(affs) do
if not sk.diag_list[affn] and not whitelist[affn] then
#if DEBUG_diag then
debugf("removed %s, don't actually have it.", affn)
#end
if dict[affn].count then dict[affn].count = 0 end
removeaff(affn)
elseif not whitelist[affn] then -- if we do have the aff, remove from diag list, so we don't add it again
-- but update the current count!
if type(sk.diag_list[affn]) == "number" and dict[affn].count then
dict[affn].count = sk.diag_list[affn]
updateaffcount(dict[affn])
#if DEBUG_diag then
debugf("%s count updated to %d", affn, dict[affn].count)
#end
end
sk.diag_list[affn] = nil
end
end
-- add left over ones
for j,k in pairs(sk.diag_list) do
#if DEBUG_diag then
if not dict[j].aff then debugf("svo: invalid %s in diag end", j) end
#end
-- skip defs
if defc[j] == nil then
checkaction(dict[j].aff, true)
if type(k) == "number" and not dict[j].count then
for amount = 1, k do lifevision.add(actions[j .. "_aff"].p) end
elseif type(k) == "number" and dict[j].count then
lifevision.add(actions[j .. "_aff"].p, nil, k)
else
lifevision.add(actions[j .. "_aff"].p)
end
end
end
affsp = {} -- potential affs
sk.checkaeony()
signals.aeony:emit()
setTriggerStayOpen("svo diag", 0)
sk.diag_list = {}
end
#for i,j in ipairs({"ablaze", "severeburn", "extremeburn", "charredburn", "meltingburn", "addiction", "aeon", "agoraphobia", "anorexia", "asthma", "blackout", "bleeding", "bound", "burning", "claustrophobia", "clumsiness", "mildconcussion", "confusion", "crippledleftarm", "crippledleftleg", "crippledrightarm", "crippledrightleg", "darkshade", "deadening", "dementia", "disloyalty", "disrupt", "dissonance", "dizziness", "epilepsy", "fear", "galed", "generosity", "haemophilia", "hallucinations", "healthleech", "heartseed", "hellsight", "hypersomnia", "hypochondria", "icing", "illness", "impale", "impatience", "inlove", "inquisition", "itching", "justice", "laceratedthroat", "lethargy", "loneliness", "lovers", "madness", "mangledleftarm", "mangledleftleg", "mangledrightarm", "mangledrightleg", "masochism", "mildtrauma", "mutilatedleftarm", "mutilatedleftleg", "mutilatedrightarm", "mutilatedrightleg", "pacifism", "paralysis", "paranoia", "peace", "prone", "recklessness", "relapsing", "roped", "selarnia", "sensitivity", "seriousconcussion", "serioustrauma", "shyness", "slashedthroat", "slickness", "stun", "stupidity", "stuttering", "transfixed", "unknownany", "unknowncrippledarm", "unknowncrippledleg", "unknownmental", "vertigo", "voided", "voyria", "weakness", "webbed", "hamstring", "shivering", "frozen", "manaleech", "voyria", "slightfluid", "elevatedfluid", "highfluid", "seriousfluid", "criticalfluid", "godfeelings", "phlogistication", "vitrification", "corrupted", "stain", "rixil", "palpatar", "cadmus", "hecate", "ninkharsag", "spiritdisrupt", "airdisrupt", "firedisrupt", "earthdisrupt", "waterdisrupt", "hoisted", "swellskin", "pinshot", "hypothermia", "scalded", "dehydrated", "timeflux", "numbedleftarm", "numbedrightarm", "unconsciousness", "depression", "parasite", "retribution", "shadowmadness", "timeloop", "degenerate", "deteriorate", "hatred"}) do
function valid.diag_$(j)()
sk.diag_list.$(j) = true
if not affs.$(j) then
decho(getDefaultColor().."(new)")
else
decho(getDefaultColor().." ("..getStopWatchTime(affs.$(j).sw).."s)")
end
if ignore.$(j) then
decho(getDefaultColor().." (currently ignored)")
end
end
#end
-- afflictions with a count
#for _, aff in ipairs({"cholerichumour", "melancholichumour", "phlegmatichumour", "sanguinehumour", "bleeding", "skullfractures", "crackedribs", "wristfractures", "torntendons"}) do
function valid.diag_$(aff)(howmuch)
sk.diag_list.$(aff) = tonumber(howmuch)
if ignore.$(aff) then
echo(" (currently ignored)")
end
end
#end