-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathraw-svo.dict.lua
16368 lines (14237 loc) · 443 KB
/
raw-svo.dict.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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
-- 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/>.
--[[
spriority: global async priority. In use when curing in sync mode.
aspriority: inter-balance sync priority. In use when curing in async mode.
isadvisable: determines if it is possible to cure this aff. some things that
block bals might not block a single aff
]]
$(
function basicdef(which, command, balanceless, gamename, undeffable)
if type (command) == "string" then
_put(string.format(which..[[ = {
]] .. (gamename and ("gamename = '"..gamename.."',") or "") .. [[
physical = {
%s = true,
aspriority = 0,
spriority = 0,
def = true,
]] .. (undeffable and ("undeffable = true, ") or "") .. [[
isadvisable = function ()
return (not defc.]]..which..[[ and ((sys.deffing and defdefup[defs.mode].]]..which..[[) or (conf.keepup and defkeepup[defs.mode].]]..which..[[)) and not codepaste.balanceful_defs_codepaste() and sys.canoutr and not affs.paralysis and not affs.prone%s) or false
end,
oncompleted = function ()
defences.got("]]..which..[[")
end,
action = "]]..command..[[",
onstart = function ()
send("]]..command..[[", conf.commandecho)
end
}
},]], balanceless and "balanceless_act" or "balanceful_act", not balanceless and "" or " and not doingaction'"..which.."'"))
else
_put(string.format(which..[[ = {
]] .. (gamename and ("gamename = '"..gamename.."',") or "") .. [[
physical = {
%s = true,
aspriority = 0,
spriority = 0,
def = true,
]] .. (undeffable and ("undeffable = true, ") or "") .. [[
isadvisable = function ()
return (((sys.deffing and defdefup[defs.mode].]]..which..[[ and not defc.]]..which..[[) or (conf.keepup and defkeepup[defs.mode].]]..which..[[ and not defc.]]..which..[[)) and not codepaste.balanceful_defs_codepaste() and sys.canoutr and not affs.paralysis and not affs.prone%s) or false
end,
oncompleted = function ()
defences.got("]]..which..[[")
end,
onstart = function ()
%s
end
}
},]], balanceless and "balanceless_act" or "balanceful_act",not balanceless and "" or " and not doingaction'"..which.."'",
(function(command)
local t = {}
for _, cmd in ipairs(command) do
t[#t+1] = "send('"..cmd.."', conf.commandecho)"
end
return table.concat(t, ";")
end)(command)))
end
end
)
local dict_balanceful = {}
local dict_balanceless = {}
-- defence shortlists
local dict_balanceful_def = {}
local dict_balanceless_def = {}
local dict_herb = {}
local dict_misc = {}
local dict_misc_def = {}
local dict_purgative = {}
local dict_salve_def = {}
local dict_smoke_def = {}
local codepaste = {}
local tekura_ability_isadvisable = function (new_stance)
return (
(
(
sys.deffing
and defdefup[defs.mode][new_stance]
and not defc[new_stance]
)
or (
conf.keepup
and defkeepup[defs.mode][new_stance]
and not defc[new_stance]
)
)
and me.path == "tekura"
and not codepaste.balanceful_defs_codepaste()
and not defc.riding
) or false
end
local shikudo_ability_isadvisable = function (new_form)
return (
(
(
sys.deffing
and defdefup[defs.mode][new_form]
and not defc[new_form]
)
or (
conf.keepup
and defkeepup[defs.mode][new_form]
and not defc[new_form]
)
)
and me.path == "shikudo"
and not codepaste.balanceful_defs_codepaste()
and not defc.riding
) or false
end
local tekura_stance_oncompleted = function (new_stance)
local stances = {
"horse",
"eagle",
"cat",
"bear",
"rat",
"scorpion",
"dragon"
}
for _, stance in ipairs(stances) do
defences.lost(stance)
end
defences.got(new_stance)
end
local shikudo_form_oncompleted = function (new_form)
local shikudo_forms = {
"tykonos",
"willow",
"rain",
"oak",
"gaital",
"maelstrom"
}
for _, form in ipairs(shikudo_forms) do
defences.lost(form)
end
defences.got(new_form)
end
-- used to check if we're writhing from something already
--impale stacks below other writhes
codepaste.writhe = function()
return (
not doingaction("curingtransfixed") and not doingaction("transfixed") and
not doingaction("curingimpale") and not doingaction("impale") and
not doingaction("curingbound") and not doingaction("bound") and
not doingaction("curingwebbed") and not doingaction("webbed") and
not doingaction("curingroped") and not doingaction("roped") and
not doingaction("curinghoisted") and not doingaction("hoisted") and
not doingaction("dragonflex"))
end
-- gives a warning if we're having too many reaves
codepaste.checkreavekill = function()
-- count up all humours, if three - warn of nearly, if four - warn of reaveability
local c = 0
if affs.cholerichumour then c = c + 1 end
if affs.melancholichumour then c = c + 1 end
if affs.phlegmatichumour then c = c + 1 end
if affs.sanguinehumour then c = c + 1 end
if c == 4 then
sk.warn "reavable"
elseif c == 3 then
sk.warn "nearlyreavable"
elseif c == 2 then
sk.warn "somewhatreavable"
end
end
codepaste.checkdismemberkill = function()
if not enabledclasses.sentinel then return end
if affs.bound and affs.impale then
sk.warn "dismemberable"
end
end
codepaste.badaeon = function()
-- if we're in a poor aeon situation, warn to gtfo
if not affs.aeon then return end
local c = 0
if affs.asthma then c = c + 1 end
if affs.stupidity then c = c + 1 end
if affs.voided then c = c + 1 end
if affs.asthma and affs.anorexia then c = c + 1 end
if c >= 1 then sk.warn "badaeon" end
end
codepaste.addrestobreakleg = function(aff, oldhp, tekura)
local leg = aff:find("right") and "right" or "left"
if not conf.aillusion or ((not oldhp or oldhp > stats.currenthealth) or paragraph_length >= 3 or (affs.recklessness and getStopWatchTime(affs[aff].sw) >= conf.ai_restoreckless))
or (sk.tremoloside and sk.tremoloside[leg]) -- accept it when it was a tremolo hit that set us up for a break as well
then
-- clear sk.tremoloside for the leg, so tremolo later on can know when it /didn't/ break a leg
if sk.tremoloside and sk.tremoloside[leg] then
sk.tremoloside[leg] = nil
end
if not tekura then
addaff(dict[aff])
else
if not sk.delaying_break then
sk.delaying_break = tempTimer(getNetworkLatency() + conf.tekura_delay, function() -- from the first hit, it's approximately getNetworkLatency() time until the second - add the conf.tekura_delay to allow for variation in ping
sk.delaying_break = nil
for _, aff in ipairs(sk.tekura_mangles) do
addaff(dict[aff])
end
sk.tekura_mangles = nil
make_gnomes_work()
end)
end
sk.tekura_mangles = sk.tekura_mangles or {}
sk.tekura_mangles[#sk.tekura_mangles+1] = aff
end
end
end
codepaste.addrestobreakarm = function(aff, oldhp, tekura)
if not conf.aillusion or ((not oldhp or oldhp > stats.currenthealth) or paragraph_length >= 3 or (affs.recklessness and getStopWatchTime(affs[aff].sw) >= conf.ai_restoreckless)) then
if not tekura then
addaff(dict[aff])
signals.after_lifevision_processing:unblock(cnrl.checkwarning)
signals.canoutr:emit()
else
if not sk.delaying_break then
sk.delaying_break = tempTimer(getNetworkLatency() + conf.tekura_delay, function() -- from the first hit, it's approximately getNetworkLatency() time until the second - add the conf.tekura_delay to allow for variation in ping
sk.delaying_break = nil
for _, aff in ipairs(sk.tekura_mangles) do
addaff(dict[aff])
end
sk.tekura_mangles = nil
signals.after_lifevision_processing:unblock(cnrl.checkwarning)
signals.canoutr:emit()
make_gnomes_work()
end)
end
sk.tekura_mangles = sk.tekura_mangles or {}
sk.tekura_mangles[#sk.tekura_mangles+1] = aff
end
end
end
codepaste.remove_focusable = function ()
if not affs.unknownmental then return end
affs.unknownmental.p.count = affs.unknownmental.p.count - 1
if affs.unknownmental.p.count <= 0 then
removeaff("unknownmental")
dict.unknownmental.count = 0
else
updateaffcount(dict.unknownmental)
end
end
-- keep argument is used when the aff is still on you
codepaste.remove_stackableaff = function (aff, keep)
if not affs[aff] then return end
dict[aff].count = dict[aff].count - 1
if keep and dict[aff].count <= 0 then dict[aff].count = 1 end
if dict[aff].count <= 0 then
removeaff(aff)
dict[aff].count = 0
else
updateaffcount(dict[aff])
end
end
-- -> boolean
-- returns true if we're using some non-standard cure - tree, restore, class skill...
codepaste.nonstdcure = function()
return (doingaction"touchtree" or doingaction"restore"
#if skills.venom then
or doingaction"shrugging"
#end
#if skills.healing then
or doingaction"usehealing"
#end
)
end
#if skills.metamorphosis then
codepaste.nonmorphdefs = function ()
for _, def in ipairs{"flame", "lyre", "nightsight", "rest", "resistance", "stealth", "temperance", "elusiveness"} do
if ((sys.deffing and defdefup[defs.mode][def]) or (not sys.deffing and conf.keepup and defkeepup[defs.mode][def])) and not defc[def] then return false end
end
-- local def = "vitality"
-- if ((sys.deffing and defdefup[defs.mode][def]) or (conf.keepup and defkeepup[defs.mode][def])) and not doingaction"cantvitality" then return false end
return true
end
#end
codepaste.smoke_elm_pipe = function()
if pipes.elm.id == 0 then sk.warn "noelmid" end
if not (pipes.elm.lit or pipes.elm.arty) then
sk.forcelight_elm = true
end
return (not (pipes.elm.id == 0) and
(pipes.elm.lit or pipes.elm.arty) and
not (pipes.elm.puffs == 0))
end
codepaste.smoke_valerian_pipe = function()
if pipes.valerian.id == 0 then sk.warn "novalerianid" end
if not (pipes.valerian.lit or pipes.valerian.arty) then
sk.forcelight_valerian = true
end
return (not (pipes.valerian.id == 0) and
(pipes.valerian.lit or pipes.valerian.arty) and
not (pipes.valerian.puffs == 0))
end
codepaste.smoke_skullcap_pipe = function()
if pipes.skullcap.id == 0 then sk.warn "noskullcapid" end
if not (pipes.skullcap.lit or pipes.skullcap.arty) then
sk.forcelight_skullcap = true
end
return (not (pipes.skullcap.id == 0) and
(pipes.skullcap.lit or pipes.skullcap.arty) and
not (pipes.skullcap.puffs == 0))
end
codepaste.balanceful_defs_codepaste = function()
for k,v in pairs(dict_balanceful_def) do
if doingaction(k) then return true end
end
end
-- adds the unknownany aff or increases the count by 1 or specified amount
codepaste.addunknownany = function(amount)
local count = dict.unknownany.count
addaff(dict.unknownany)
dict.unknownany.count = (count or 0) + (amount or 1)
updateaffcount(dict.unknownany)
end
sk.burns = {"ablaze", "severeburn", "extremeburn", "charredburn", "meltingburn"}
-- removes all burning afflictions except for the optional specified one
codepaste.remove_burns = function(skipaff)
local burns = deepcopy(sk.burns)
if skipaff then
table.remove(burns, table.index_of(burns, skipaff))
end
removeaff(burns)
end
sk.next_burn = function()
for i,v in ipairs(sk.burns) do
if affs[v] then return sk.burns[i+1] or sk.burns[#sk.burns] end
end
end
sk.current_burn = function()
for i,v in ipairs(sk.burns) do
if affs[v] then return v end
end
end
sk.previous_burn = function(howfar)
for i,v in ipairs(sk.burns) do
if affs[v] then return sk.burns[i-(howfar and howfar or 1)] or nil end
end
end
codepaste.serversideahealthmanaprio = function()
local healhealth_prio = svo.prio.getnumber("healhealth", "sip")
local healmana_prio = svo.prio.getnumber("healmana" , "sip")
-- swap using curing system commands as appropriate
-- setup special balance in cache mentioning which is first, so it is remembered
sk.priochangecache.special = sk.priochangecache.special or { healthormana = ""}
if healhealth_prio > healmana_prio and sk.priochangecache.special.healthormana ~= "health" then
sendcuring("priority health")
sk.priochangecache.special.healthormana = "health"
elseif healmana_prio > healhealth_prio and sk.priochangecache.special.healthormana ~= "mana" then
sendcuring("priority mana")
sk.priochangecache.special.healthormana = "mana"
end
end
--[[ dict is to NEVER be iterated over fully by prompt checks; so isadvisable functions can
typically expect not to check for the common things because pre-
filtering is done.
]]
dict = {
gamename = nil, -- (string) what serverside calls this by - names can be different as they were revealed years after Svof was made
onservereignore = nil, -- (function) a function which'll return true if this needs to be ignored serverside
healhealth = {
description = "heals health with health/vitality or moss/potash",
sip = {
name = false, --"healhealth_sip",
balance = false, --"sip",
action_name = false, --"healhealth"
aspriority = 0,
spriority = 0,
-- managed outside priority lists
irregular = true,
isadvisable = function ()
-- should healhealth be prioritised above health affs, don't apply if above healthaffsabove% and have an aff
local function shouldntsip()
local crackedribs = prio.getnumber("crackedribs", "sip")
local healhealth = prio.getnumber("healhealth", "sip")
local skullfractures = prio.getnumber("skullfractures", "sip")
local torntendons = prio.getnumber("torntendons", "sip")
local wristfractures = prio.getnumber("wristfractures", "sip")
if stats.hp >= conf.healthaffsabove and ((healhealth > crackedribs and affs.crackedribs) or (healhealth > skullfractures and affs.skullfractures) or (healhealth > torntendons and affs.torntendons) or (healhealth > wristfractures and affs.wristfractures)) then
return true
end
return false
end
#if not skills.kaido then
return ((stats.currenthealth < sys.siphealth or (sk.gettingfullstats and stats.currenthealth < stats.maxhealth)) and not actions.healhealth_sip and not shouldntsip())
#else
return ((stats.currenthealth < sys.siphealth or (sk.gettingfullstats and stats.currenthealth < stats.maxhealth)) and not actions.healhealth_sip and not shouldntsip() and
(defc.dragonform or -- sip health if we're in dragonform, can't use Kaido
not can_usemana() or -- or we don't have enough mana (should be an option). The downside of this is that we won't get mana back via sipping, only moss, the time to being able to transmute will approach slower than straight sipping mana
(affs.prone and not conf.transsipprone) or -- or we're prone and sipping while prone is off (better for bashing, not so for PK)
(conf.transmute ~= "replaceall" and conf.transmute ~= "replacehealth" and not doingaction"transmute") -- or we're not in a replacehealth/replaceall mode, so we can still sip
)
)
#end
end,
oncompleted = function ()
lostbal_sip()
end,
noeffect = function()
lostbal_sip()
end,
onprioswitch = function()
codepaste.serversideahealthmanaprio()
end,
sipcure = {"health", "vitality"},
onstart = function ()
sip(dict.healhealth.sip)
end
},
moss = {
aspriority = 0,
spriority = 0,
-- managed outside priority lists
irregular = true,
isadvisable = function ()
#if not skills.kaido then
return ((stats.currenthealth < sys.mosshealth) and (not doingaction ("healhealth") or (stats.currenthealth < (sys.mosshealth-600)))) or false
#else
return ((stats.currenthealth < sys.mosshealth) and (not doingaction ("healhealth") or (stats.currenthealth < (sys.mosshealth-600))) and (defc.dragonform or not can_usemana() or affs.prone or (conf.transmute ~= "replaceall" and not doingaction"transmute"))) or false
#end
end,
oncompleted = function ()
lostbal_moss()
end,
noeffect = function()
lostbal_moss()
end,
eatcure = {"irid", "potash"},
actions = {"eat moss", "eat irid", "eat potash"},
onstart = function ()
eat(dict.healhealth.moss)
end
},
},
healmana = {
description = "heals mana with mana/mentality or moss/potash",
sip = {
aspriority = 0,
spriority = 0,
-- managed outside priority lists
irregular = true,
isadvisable = function ()
return ((stats.currentmana < sys.sipmana or (sk.gettingfullstats and stats.currentmana < stats.maxmana)) and not doingaction ("healmana")) or false
end,
oncompleted = function ()
lostbal_sip()
end,
noeffect = function()
lostbal_sip()
end,
onprioswitch = function()
codepaste.serversideahealthmanaprio()
end,
sipcure = {"mana", "mentality"},
onstart = function ()
sip(dict.healmana.sip)
end
},
moss = {
aspriority = 0,
spriority = 0,
-- managed outside priority lists
irregular = true,
isadvisable = function ()
return ((stats.currentmana < sys.mossmana) and (not doingaction ("healmana") or (stats.currentmana < (sys.mossmana-600)))) or false
end,
oncompleted = function ()
lostbal_moss()
end,
noeffect = function()
lostbal_moss()
end,
eatcure = {"irid", "potash"},
actions = {"eat moss", "eat irid", "eat potash"},
onstart = function ()
eat(dict.healmana.moss)
end
},
},
skullfractures = {
count = 0,
sip = {
aspriority = 0,
spriority = 0,
isadvisable = function ()
return (affs.skullfractures and stats.hp >= conf.healthaffsabove) or false
end,
oncompleted = function ()
lostbal_sip()
-- two counts are cured if you're above 5
local howmany = dict.skullfractures.count
codepaste.remove_stackableaff("skullfractures", true)
if howmany > 5 then
codepaste.remove_stackableaff("skullfractures", true)
end
end,
cured = function()
lostbal_sip()
removeaff("skullfractures")
dict.skullfractures.count = 0
end,
fizzled = function ()
lostbal_sip()
empty.apply_health_head()
end,
noeffect = function ()
lostbal_sip()
end,
-- in case an unrecognised message is shown, don't error
empty = function()
end,
actions = {"apply health to head"},
onstart = function ()
send("apply health to head", conf.commandecho)
end
},
aff = {
oncompleted = function (number)
-- double kngiht affs from precision strikes
if sk.doubleknightaff then number = (number or 0) + 1 end
local count = dict.skullfractures.count
addaff(dict.skullfractures)
dict.skullfractures.count = (count or 0) + (number or 1)
if dict.skullfractures.count > 7 then
dict.skullfractures.count = 7
end
updateaffcount(dict.skullfractures)
end
},
gone = {
oncompleted = function ()
removeaff("skullfractures")
dict.skullfractures.count = 0
end,
general_cure = function(amount, dontkeep)
-- two counts are cured if you're above 5
local howmany = dict.skullfractures.count
for i = 1, (amount or 1) do
codepaste.remove_stackableaff("skullfractures", not dontkeep)
end
if howmany > 5 then
codepaste.remove_stackableaff("skullfractures", not dontkeep)
end
end,
general_cured = function(amount)
removeaff("skullfractures")
dict.skullfractures.count = 0
end,
}
},
crackedribs = {
count = 0,
sip = {
aspriority = 0,
spriority = 0,
isadvisable = function ()
return (affs.crackedribs and stats.hp >= conf.healthaffsabove) or false
end,
oncompleted = function ()
lostbal_sip()
-- two counts are cured if you're above 5
local howmany = dict.crackedribs.count
codepaste.remove_stackableaff("crackedribs", true)
if howmany > 5 then
codepaste.remove_stackableaff("crackedribs", true)
end
end,
cured = function()
lostbal_sip()
removeaff("crackedribs")
dict.crackedribs.count = 0
end,
fizzled = function ()
lostbal_sip()
empty.apply_health_torso()
end,
noeffect = function ()
lostbal_sip()
end,
-- in case an unrecognised message is shown, don't error
empty = function()
end,
actions = {"apply health to torso"},
onstart = function ()
send("apply health to torso", conf.commandecho)
end
},
aff = {
oncompleted = function (number)
-- double kngiht affs from precision strikes
if sk.doubleknightaff then number = (number or 0) + 1 end
local count = dict.crackedribs.count
addaff(dict.crackedribs)
dict.crackedribs.count = (count or 0) + (number or 1)
if dict.crackedribs.count > 7 then
dict.crackedribs.count = 7
end
updateaffcount(dict.crackedribs)
end
},
gone = {
oncompleted = function ()
removeaff("crackedribs")
dict.crackedribs.count = 0
end,
general_cure = function(amount, dontkeep)
-- two counts are cured if you're above 5
local howmany = dict.crackedribs.count
for i = 1, (amount or 1) do
codepaste.remove_stackableaff("crackedribs", not dontkeep)
end
if howmany > 5 then
codepaste.remove_stackableaff("crackedribs", not dontkeep)
end
end,
general_cured = function(amount)
removeaff("crackedribs")
dict.crackedribs.count = 0
end,
}
},
wristfractures = {
count = 0,
sip = {
aspriority = 0,
spriority = 0,
isadvisable = function ()
return (affs.wristfractures and stats.hp >= conf.healthaffsabove) or false
end,
oncompleted = function ()
lostbal_sip()
-- two counts are cured if you're above 5
local howmany = dict.wristfractures.count
codepaste.remove_stackableaff("wristfractures", true)
if howmany > 5 then
codepaste.remove_stackableaff("wristfractures", true)
end
end,
cured = function()
lostbal_sip()
removeaff("wristfractures")
dict.wristfractures.count = 0
end,
fizzled = function ()
lostbal_sip()
empty.apply_health_arms()
end,
noeffect = function ()
lostbal_sip()
end,
-- in case an unrecognised message is shown, don't error
empty = function()
end,
actions = {"apply health to arms"},
onstart = function ()
send("apply health to arms", conf.commandecho)
end
},
aff = {
oncompleted = function (number)
-- double kngiht affs from precision strikes
if sk.doubleknightaff then number = (number or 0) + 1 end
local count = dict.wristfractures.count
addaff(dict.wristfractures)
dict.wristfractures.count = (count or 0) + (number or 1)
if dict.wristfractures.count > 7 then
dict.wristfractures.count = 7
end
updateaffcount(dict.wristfractures)
end
},
gone = {
oncompleted = function ()
removeaff("wristfractures")
dict.wristfractures.count = 0
end,
general_cure = function(amount, dontkeep)
-- two counts are cured if you're above 5
local howmany = dict.wristfractures.count
for i = 1, (amount or 1) do
codepaste.remove_stackableaff("wristfractures", not dontkeep)
end
if howmany > 5 then
codepaste.remove_stackableaff("wristfractures", not dontkeep)
end
end,
general_cured = function(amount)
removeaff("wristfractures")
dict.wristfractures.count = 0
end,
}
},
torntendons = {
count = 0,
sip = {
aspriority = 0,
spriority = 0,
isadvisable = function ()
return (affs.torntendons and stats.hp >= conf.healthaffsabove) or false
end,
oncompleted = function ()
lostbal_sip()
-- two counts are cured if you're above 5
local howmany = dict.torntendons.count
codepaste.remove_stackableaff("torntendons", true)
if howmany > 5 then
codepaste.remove_stackableaff("torntendons", true)
end
end,
cured = function()
lostbal_sip()
removeaff("torntendons")
dict.torntendons.count = 0
end,
fizzled = function ()
lostbal_sip()
empty.apply_health_legs()
end,
noeffect = function ()
lostbal_sip()
end,
-- in case an unrecognised message is shown, don't error
empty = function()
end,
actions = {"apply health to legs"},
onstart = function ()
send("apply health to legs", conf.commandecho)
end
},
aff = {
oncompleted = function (number)
-- double kngiht affs from precision strikes
if sk.doubleknightaff then number = (number or 0) + 1 end
local count = dict.torntendons.count
addaff(dict.torntendons)
dict.torntendons.count = (count or 0) + (number or 1)
if dict.torntendons.count > 7 then
dict.torntendons.count = 7
end
updateaffcount(dict.torntendons)
end
},
gone = {
oncompleted = function ()
removeaff("torntendons")
dict.torntendons.count = 0
end,
general_cure = function(amount, dontkeep)
-- two counts are cured if you're above 5
local howmany = dict.torntendons.count
for i = 1, (amount or 1) do
codepaste.remove_stackableaff("torntendons", not dontkeep)
end
if howmany > 5 then
codepaste.remove_stackableaff("torntendons", not dontkeep)
end
end,
general_cured = function(amount)
removeaff("torntendons")
dict.torntendons.count = 0
end,
}
},
cholerichumour = {
gamename = "temperedcholeric",
herb = {
aspriority = 0,
spriority = 0,
isadvisable = function ()
return (affs.cholerichumour) or false
end,
-- this is called when you still have some left
oncompleted = function ()
lostbal_herb()
codepaste.remove_stackableaff("cholerichumour", true)
end,
empty = function()
empty.eat_ginger()
lostbal_herb()
end,
cured = function()
lostbal_herb()
removeaff("cholerichumour")
dict.cholerichumour.count = 0
end,
noeffect = function()
lostbal_herb()
end,
-- does damage based on humour count
inundated = function()
removeaff("cholerichumour")
dict.cholerichumour.count = 0
end,
eatcure = {"ginger", "antimony"},
onstart = function ()
eat(dict.cholerichumour.herb)
end
},
aff = {
oncompleted = function (number)
local count = dict.cholerichumour.count
addaff(dict.cholerichumour)
dict.cholerichumour.count = (count or 0) + (number or 1)
if dict.cholerichumour.count > 8 then
dict.cholerichumour.count = 8
end
updateaffcount(dict.cholerichumour)
end
},
gone = {
oncompleted = function ()
removeaff("cholerichumour")
dict.cholerichumour.count = 0
end
}
},
melancholichumour = {
gamename = "temperedmelancholic",
herb = {
aspriority = 0,
spriority = 0,
isadvisable = function ()
return (affs.melancholichumour) or false
end,
-- this is called when you still have some left
oncompleted = function ()
lostbal_herb()
codepaste.remove_stackableaff("melancholichumour", true)
end,
empty = function()
empty.eat_ginger()
lostbal_herb()
end,
cured = function()
lostbal_herb()
removeaff("melancholichumour")
dict.melancholichumour.count = 0
end,
noeffect = function()
lostbal_herb()
end,