-
-
Notifications
You must be signed in to change notification settings - Fork 990
/
abilities.cfg
918 lines (790 loc) · 26.2 KB
/
abilities.cfg
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
#textdomain wesnoth-help
# These are all direct clones of the mainline healing abilities, except that
# they are set to exclude units suffering from dehydration. Dehydration is only
# delayed by healers, so they must not actually heal a dehydrated unit any
# hitpoints.
#
# The ability macros go into wesnoth textdomain since the strings are identical
# to their core counterparts, but the special notes belong to wesnoth-utbs.
#define UTBS_ABILITY_HEALS
[heals]
value=4
id=healing
affect_allies=yes
name= _ "heals +4"
female_name= _ "female^heals +4"
description= _ "Allows the unit to heal adjacent allied units at the beginning of our turn.
A unit cared for by this healer may heal up to 4 HP per turn, or stop poison from taking effect for that turn.
A poisoned unit cannot be cured of its poison by a healer, and must seek the care of a village or a unit that can cure."
affect_self=no
poison=slowed
[affect_adjacent]
[filter]
[not]
status=dehydration_slowed_by_healer
[/not]
[/filter]
[/affect_adjacent]
[/heals]
#enddef
#define UTBS_ABILITY_EXTRA_HEAL
[heals]
value=8
id=healing
affect_allies=yes
name= _ "heals +8"
female_name= _ "female^heals +8"
description= _ "This unit combines herbal remedies with magic to heal units more quickly than is normally possible on the battlefield.
A unit cared for by this healer may heal up to 8 HP per turn, or stop poison from taking effect for that turn.
A poisoned unit cannot be cured of its poison by a healer, and must seek the care of a village or a unit that can cure."
affect_self=no
poison=slowed
[affect_adjacent]
[filter]
[not]
status=dehydration_slowed_by_healer
[/not]
[/filter]
[/affect_adjacent]
[/heals]
#enddef
#define UTBS_ABILITY_CURES
{ABILITY_UNPOISON}
{UTBS_ABILITY_EXTRA_HEAL}
#enddef
#textdomain wesnoth-utbs
#define NOTE_UTBS_HEALS
[special_note]
note=_"This unit is capable of basic healing and slowing dehydration."
[/special_note]
#enddef
#define NOTE_UTBS_CURES
[special_note]
note=_"This unit is capable of healing those around it, slowing dehydration, and curing them of poison."
[/special_note]
#enddef
#define NOTE_ETHEREAL
[special_note]
note=_"SPECIAL_NOTE^This unit is able to move through solid stone walls."
[/special_note]
#enddef
# This is the Teaching ability owned by Garak
#define ABILITY_TEACHING
[dummy]
id=teaching
name= _ "teaching"
female_name= _ "female^teaching"
description= _ "At the start of every turn, this unit redistributes its experience points to all the units of the same side adjacent to it. If no suitable unit is adjacent, its experience just goes back to zero."
[/dummy]
#enddef
#define WEAPON_SPECIAL_SHOCK
# Canned definition of the Shock ability to be included in a
# [specials] clause.
[attacks]
id=shock
name= _ "shock"
description= _ "When this attack is used on offense, the opponent will retaliate with one less strike than normally, to a minimum of one strike."
sub=1
active_on=offense
apply_to=opponent
[filter_base_value]
greater_than=1
[/filter_base_value]
[/attacks]
#enddef
#define FORMATION ID GREATER_THAN COUNT
[chance_to_hit]
id={ID}
apply_to=opponent
sub=10
[filter_base_value]
greater_than_equal_to={GREATER_THAN}
[/filter_base_value]
[filter_self]
[filter_adjacent]
is_enemy=no
count={COUNT}
ability=formation
[/filter_adjacent]
[/filter_self]
[/chance_to_hit]
#enddef
#define ABILITY_FORMATION
[dummy]
id=formation
name= _ "formation"
female_name= _ "female^formation"
description= _ "This unit gains a +10% bonus to defense when another unit with the same ability is adjacent to it. However, this cannot raise the unit’s defense above 70%."
[filter]
[filter_adjacent]
ability=formation
is_enemy=no
count=1-5
[/filter_adjacent]
[/filter]
[/dummy]
{FORMATION formation1 40 1-5}
{FORMATION formation2 50 2-5}
{FORMATION formation3 60 3-5}
{FORMATION formation4 70 4-5}
{FORMATION formation5 80 5}
#enddef
#define ABILITY_DISENGAGE
[dummy]
id=disengage
name= _ "disengage"
female_name= _ "female^disengage"
description= _ "If this unit doesn’t move before attacking, it will retain its movement points after the attack."
[/dummy]
#enddef
#define WEAPON_SPECIAL_DAZE
[dummy]
id=daze
name= _ "daze"
description= _ "When hit with this attack, an enemy suffers a 10% penalty both to their defense and chance to hit for one turn. Other specials that affect chance to hit (e.g. magical and marksman) take precedence over this special.
Magical attacks will still have a 70% chance to hit.
Marksman attacks are only affected if the chance to hit is greater than 60%."
[/dummy]
#enddef
#define ABILITY_DISTRACT
[skirmisher]
id=distract
name= _ "distract"
female_name= _ "female^distract"
description= _ "This unit negates enemy Zones of Control around itself for allied units (but not for itself)."
affect_self=no
affect_allies=yes
[affect_adjacent]
[/affect_adjacent]
[/skirmisher]
#enddef
#define ABILITY_SUPPORT
[dummy]
id=support
name= _ "support"
female_name= _ "female^support"
description= _ "The upkeep costs of adjacent friendly units are lowered by 1."
[/dummy]
#enddef
#define NOTE_SHOCK
[special_note]
note=_"This unit’s melee attack can overwhelm the defenses of enemies, preventing them from retaliating as effectively."
[/special_note]
#enddef
#define NOTE_FORMATION
[special_note]
note=_"Groups of units of this type are able to shield each other in combat."
[/special_note]
#enddef
#define NOTE_DISENGAGE
[special_note]
note=_"This unit can move either before or after attacking."
[/special_note]
#enddef
#define NOTE_DAZE
[special_note]
note=_"This unit can daze its enemies, reducing their accuracy and defense until they end a turn."
[/special_note]
#enddef
#define NOTE_DISTRACT
[special_note]
note=_"This unit is capable of distracting opponents, allowing allied units to trespass their Zones of Control and move unhindered around them."
[/special_note]
#enddef
#define ABILITY_DISENGAGE_EVENTS
[event]
name=attack end
first_time_only=no
[filter]
ability=disengage
[not]
[filter_wml]
moves=$this_unit.max_moves
[/filter_wml]
[/not]
[/filter]
{VARIABLE unit.moves 0}
[unstore_unit]
variable=unit
find_vacant=no
[/unstore_unit]
[/event]
#enddef
#define WEAPON_SPECIAL_DAZE_EVENTS
[event]
id=weapon_special_daze_event_1
name=unit placed
first_time_only=no
[filter]
[not]
[has_attack]
special_id=enemy_dazed
[/has_attack]
[/not]
[/filter]
[object]
silent=yes
[filter]
x,y=$x1,$y1
[/filter]
[effect]
apply_to=attack
[not]
special_id=magical
[/not]
[not]
special_id=marksman
[/not]
[not]
special_id=enemy_dazed
[/not]
[set_specials]
mode=append
[chance_to_hit]
id=enemy_dazed
name=""
description=""
add=10
[filter_opponent]
[filter_wml]
[status]
dazed=yes
[/status]
[/filter_wml]
[/filter_opponent]
[/chance_to_hit]
[/set_specials]
[/effect]
[effect]
apply_to=attack
special_id=marksman
[and]
special_type=poison
[/and]
[not]
special_id=enemy_dazed
[/not]
# Note: instead of simply appending, we have to use replace and
# put marksman last because the +10% from daze must be applied
# first; the other way around, the base value would already be
# potentially modified by marksman
[set_specials]
mode=replace
[chance_to_hit]
id=enemy_dazed
name=""
description=""
add=10
active_on=offense
[filter_base_value]
greater_than_equal_to=60
[/filter_base_value]
[filter_opponent]
[filter_wml]
[status]
dazed=yes
[/status]
[/filter_wml]
[/filter_opponent]
[/chance_to_hit]
{WEAPON_SPECIAL_MARKSMAN}
{WEAPON_SPECIAL_POISON}
[chance_to_hit]
id=enemy_dazed_marksman_defense
name=""
description=""
add=10
active_on=defense
[filter_opponent]
[filter_wml]
[status]
dazed=yes
[/status]
[/filter_wml]
[/filter_opponent]
[/chance_to_hit]
[/set_specials]
[/effect]
[effect]
apply_to=attack
special_id=marksman
[not]
special_type=poison
[/not]
[not]
special_id=enemy_dazed
[/not]
# Note: instead of simply appending, we have to use replace and
# put marksman last because the +10% from daze must be applied
# first; the other way around, the base value would already be
# potentially modified by marksman
[set_specials]
mode=replace
[chance_to_hit]
id=enemy_dazed
name=""
description=""
add=10
active_on=offense
[filter_base_value]
greater_than_equal_to=60
[/filter_base_value]
[filter_opponent]
[filter_wml]
[status]
dazed=yes
[/status]
[/filter_wml]
[/filter_opponent]
[/chance_to_hit]
{WEAPON_SPECIAL_MARKSMAN}
[chance_to_hit]
id=enemy_dazed_marksman_defense
name=""
description=""
add=10
active_on=defense
[filter_opponent]
[filter_wml]
[status]
dazed=yes
[/status]
[/filter_wml]
[/filter_opponent]
[/chance_to_hit]
[/set_specials]
[/effect]
[/object]
[/event]
[event]
id=weapon_special_daze_event_2
name=attacker hits
first_time_only=no
[filter_attack]
special=daze
[/filter_attack]
[filter_second]
[not]
[filter_wml]
[status]
dazed=yes
[/status]
[/filter_wml]
[/not]
[/filter_second]
{VARIABLE second_unit.status.dazed yes}
[unstore_unit]
variable=second_unit
find_vacant=no
text= _ "dazed"
female_text = _ "female^dazed"
red,green,blue=196,196,128
[/unstore_unit]
[object]
silent=yes
[filter]
x,y=$x2,$y2
[/filter]
[effect]
apply_to=attack
[not]
special_id=magical
[/not]
[not]
special_id=marksman
[/not]
[not]
special_id=self_dazed
[/not]
[set_specials]
mode=append
[chance_to_hit]
id=self_dazed
name=""
description=""
sub=10
[filter_self]
[filter_wml]
[status]
dazed=yes
[/status]
[/filter_wml]
[/filter_self]
[/chance_to_hit]
[/set_specials]
[/effect]
[effect]
apply_to=attack
special_id=marksman
[and]
special_type=poison
[/and]
[not]
special_id=self_dazed
[/not]
[set_specials]
mode=replace
[chance_to_hit]
id=self_dazed
name=""
description=""
sub=10
active_on=offense
[filter_base_value]
greater_than_equal_to=70
[/filter_base_value]
[filter_self]
[filter_wml]
[status]
dazed=yes
[/status]
[/filter_wml]
[/filter_self]
[/chance_to_hit]
{WEAPON_SPECIAL_MARKSMAN}
{WEAPON_SPECIAL_POISON}
[chance_to_hit]
id=self_dazed_marksman_defense
name=""
description=""
sub=10
active_on=defense
[filter_self]
[filter_wml]
[status]
dazed=yes
[/status]
[/filter_wml]
[/filter_self]
[/chance_to_hit]
[/set_specials]
[/effect]
[effect]
apply_to=attack
special_id=marksman
[not]
special_type=poison
[/not]
[not]
special_id=self_dazed
[/not]
[set_specials]
mode=replace
[chance_to_hit]
id=self_dazed
name=""
description=""
sub=10
active_on=offense
[filter_base_value]
greater_than_equal_to=70
[/filter_base_value]
[filter_self]
[filter_wml]
[status]
dazed=yes
[/status]
[/filter_wml]
[/filter_self]
[/chance_to_hit]
{WEAPON_SPECIAL_MARKSMAN}
[chance_to_hit]
id=self_dazed_marksman_defense
name=""
description=""
sub=10
active_on=defense
[filter_self]
[filter_wml]
[status]
dazed=yes
[/status]
[/filter_wml]
[/filter_self]
[/chance_to_hit]
[/set_specials]
[/effect]
[/object]
[/event]
[event]
id=weapon_special_daze_event_3
name=side turn
first_time_only=no
[event]
name=side turn
delayed_variable_substitution=no
#{DEBUG_MSG "side $|side_number turn started, clearing daze from side $side_number units"}
[modify_unit]
[filter]
side=$side_number
[filter_wml]
[status]
dazed=yes
[/status]
[/filter_wml]
[/filter]
[status]
dazed=no
[/status]
[/modify_unit]
[/event]
[/event]
#enddef
#define ABILITY_SUPPORT_EVENTS
[event]
name=unit placed
first_time_only=no
[filter]
side=1
[not]
level=0
[/not]
[filter_wml]
upkeep=full
[/filter_wml]
[filter_adjacent]
ability=support
[/filter_adjacent]
[/filter]
{VARIABLE unit.variables.original_upkeep $unit.upkeep}
{VARIABLE unit.variables.upkeep_supported yes}
{VARIABLE unit.upkeep "$($unit.level - 1)"}
[unstore_unit]
variable=unit
find_vacant=no
fire_event=no
[/unstore_unit]
[/event]
[event]
name=set_support_upkeep
first_time_only=no
[foreach]
array=update_support_units
variable=support_unit
[do]
[if]
[have_unit]
x,y=$support_unit.x,$support_unit.y
[not]
level=0
[/not]
[filter_wml]
upkeep=full
[/filter_wml]
[filter_adjacent]
ability=support
[/filter_adjacent]
[/have_unit]
[then]
{VARIABLE support_unit.variables.original_upkeep $support_unit.upkeep}
{VARIABLE support_unit.variables.upkeep_supported yes}
{VARIABLE support_unit.upkeep "$($support_unit.level - 1)"}
[/then]
[else]
[if]
[have_unit]
x,y=$support_unit.x,$support_unit.y
[not]
level=0
[/not]
[filter_wml]
[variables]
upkeep_supported=yes
[/variables]
[/filter_wml]
[not]
[filter_adjacent]
ability=support
[/filter_adjacent]
[/not]
[/have_unit]
[then]
{VARIABLE support_unit.upkeep $support_unit.variables.original_upkeep}
{VARIABLE support_unit.variables.upkeep_supported no}
[/then]
[else]
[continue][/continue]
[/else]
[/if]
[/else]
[/if]
[unstore_unit]
variable=support_unit
find_vacant=no
fire_event=no
[/unstore_unit]
[/do]
[/foreach]
[/event]
[event]
name=moveto
first_time_only=no
[filter]
side=1
ability=support
[/filter]
[store_unit]
[filter]
[filter_wml]
upkeep=full
[/filter_wml]
[filter_adjacent]
x,y=$x1,$y1
[/filter_adjacent]
[or]
[filter_wml]
[variables]
upkeep_supported=yes
[/variables]
[/filter_wml]
[filter_location]
[filter_adjacent_location]
x,y=$x2,$y2
[/filter_adjacent_location]
[/filter_location]
[/or]
[/filter]
kill=no
variable=update_support_units
[/store_unit]
[fire_event]
name=set_support_upkeep
[/fire_event]
{CLEAR_VARIABLE update_support_units}
[on_undo]
[store_unit]
[filter]
[filter_wml]
upkeep=full
[/filter_wml]
[filter_location]
[filter_adjacent_location]
x,y=$x2,$y2
[/filter_adjacent_location]
[/filter_location]
[or]
[filter_wml]
[variables]
upkeep_supported=yes
[/variables]
[/filter_wml]
[filter_location]
[filter_adjacent_location]
x,y=$x1,$y1
[/filter_adjacent_location]
[/filter_location]
[/or]
[/filter]
kill=no
variable=update_support_units
[/store_unit]
[fire_event]
name=set_support_upkeep
[/fire_event]
{CLEAR_VARIABLE update_support_units}
[/on_undo]
[allow_undo]
[/allow_undo]
[/event]
[event]
name=moveto
first_time_only=no
[filter]
side=1
[not]
ability=support
[/not]
[and]
[filter_wml]
upkeep=full
[/filter_wml]
[filter_adjacent]
side=1
ability=support
[/filter_adjacent]
[or]
[filter_wml]
[variables]
upkeep_supported=yes
[/variables]
[/filter_wml]
[not]
[filter_adjacent]
side=1
ability=support
[/filter_adjacent]
[/not]
[/or]
[/and]
[/filter]
[store_unit]
[filter]
x,y=$x1,$y1
[/filter]
kill=no
variable=update_support_units
[/store_unit]
[fire_event]
name=set_support_upkeep
[/fire_event]
{CLEAR_VARIABLE update_support_units}
[on_undo]
[store_unit]
[filter]
x,y=$x2,$y2
[/filter]
kill=no
variable=update_support_units
[/store_unit]
[fire_event]
name=set_support_upkeep
[/fire_event]
{CLEAR_VARIABLE update_support_units}
[/on_undo]
[allow_undo]
[/allow_undo]
[/event]
[event]
name=die,post advance
first_time_only=no
[filter]
side=1
ability=support
[/filter]
[store_unit]
[filter]
side=1
[filter_adjacent]
x,y=$x1,$y1
[/filter_adjacent]
[/filter]
kill=no
variable=update_support_units
[/store_unit]
[fire_event]
name=set_support_upkeep
[/fire_event]
{CLEAR_VARIABLE update_support_units}
[/event]
[event]
name=post advance
first_time_only=no
[filter]
side=1
[filter_adjacent]
ability=support
[/filter_adjacent]
[/filter]
[store_unit]
[filter]
x,y=$x1,$y1
[/filter]
kill=no
variable=update_support_units
[/store_unit]
[fire_event]
name=set_support_upkeep
[/fire_event]
{CLEAR_VARIABLE update_support_units}
[/event]
#enddef