forked from freeciv/freeciv
-
Notifications
You must be signed in to change notification settings - Fork 0
/
README.actions
1477 lines (1332 loc) · 68.9 KB
/
README.actions
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
Actions
=======
An action is something a player can do to achieve something in the game.
It has properties like cost, chance of success and effects. Some of those
properties are configurable using effects and other rule set settings. To
learn how to change them read README.effects and the rule set files of
classic. An action enabler allows a player to do an action.
Generalized action enablers
===============================
Some actions have generalized action enablers. An action like that can have
zero, one or more action enablers defined for it in the ruleset. The player can
do the action only when at least one generalized action enabler says that the
action is enabled (and all its hard requirements are fulfilled). A ruleset
author can therefore disable an action by not defining any action enablers for
it in his ruleset.
A generalized action enabler lives in game.ruleset. It consists of the action it
enables and two requirement vectors. The first requirement vector, actor_reqs,
applies to the entity doing the action. The second, target_reqs, applies to its
target. If both requirement vectors are fulfilled the action is enabled as far
as the action enabler is concerned. Note that an action's hard requirements
still may make it impossible.
In some situations an action controlled by generalized action enablers may be
impossible because of limitations in Freeciv it self. Those limitations are
called hard requirements. The hard requirements of each action are documented
below in the section called "Actions and their hard coded requirements".
If the player don't have the knowledge required to find out if an action is
enabled or not the action is shown to the player in case it is possible. The
client will indicate the uncertainty to the player.
Should the player order a unit to do an illegal action the server will
inform the player that his unit was unable to perform the action. The actor
unit may also lose a ruleset configurable amount of move fragments.
Example
=======
[actionenabler_veil_the_threat_of_terror]
action = "Incite City"
actor_reqs =
{ "type", "name", "range", "present"
"DiplRel", "Has Casus Belli", "Local", TRUE
"DiplRel", "Provided Casus Belli", "Local", FALSE
"DiplRel", "Foreign", "Local", TRUE
}
[actionenabler_go_bind_your_sons_to_exile]
action = "Incite City"
actor_reqs =
{ "type", "name", "range", "present"
"Tech", "Flight", "Player", TRUE
"DiplRel", "Foreign", "Local", TRUE
}
target_reqs =
{ "type", "name", "range", "present"
"Tech", "Writing", "Player", False
}
Above are two action enablers. They both enable the action "Incite City". If
all the conditions of at least one of them are fulfilled it will be enabled.
No information is given to the player about what action enabler enabled an
action.
The first action enabler, actionenabler_veil_the_threat_of_terror, is
simple. It allows a player to incite a city if he has a reason to declare
war on its owner AND the cities owner don't have a reason to declare war on
him.
The second action enabler, actionenabler_go_bind_your_sons_to_exile, is more
complex. It allows a player that has Flight to bribe the cities of
civilizations that don't have Writing. The complexity is caused by the
requirement that the target don't know Writing. If the civilization of the
target city knows Writing or not may be unknown to the acting player. To
avoid this complexity a requirement that the acting player has an embassy to
the target cities civilization (and therefore knowledge about its techs) can
be added.
Requirement vector rules
========================
An action enabler has two requirement vectors that must be true at the same
time. This creates some corner cases you won't find with single requirement
vectors. The rules below tries to deal with them.
A "DiplRel" requirement with the range "Local" should always be put in the
actor requirements.
* A local DiplRel requirement can always be expressed as an actor
requirement.
* Only having to care about local DiplRel requirements in the actor
requirements allows the Freeciv code responsible for reasoning about
action enablers to be simpler and faster.
* If player A having a diplomatic relationship to player B implies that
player B has the same relationship to player A the relationship is
symmetric. Examples: "Foreign" and "War"
* Symmetric local DiplRel requirements can be moved directly from the
target requirement vector to the actor requirement vector.
* Asymmetric local DiplRel requirements must test for the same thing in
the opposite direction. Example: "Hosts embassy" -> "Has embassy"
Actions and Lua
===============
Lua has some integration with enabler controlled actions. This integration
allows both to implement (parts of) an action in Lua and to perform an
action from Lua.
The action started signals
==========================
Right before an action is executed, but after it is known to be legal, a
signal is emitted to Lua. It has access to the same information as the
server. It obviously don't have access to the result of the action since it
isn't done yet.
The signal's name starts with action_started_, then the actor kind, then
another _ and in the end the target kind. The signal that is emitted when a
unit performs an action on a city is therefore action_started_unit_city.
The signal has three parameters. The first parameter is the action that is
about to get started. The second is the actor. The third parameter is the
target. The parameters of action_started_unit_city is therefore action,
actor_unit and finally target city.
To get the rule name of an action, that is the name used in action enablers,
you can use the method rule_name(). To get a translated name that is nice to
show to players use name_translation().
Example 1
=========
The following Lua code will log all actions done by any unit to a city, to
another unit, to a unit stack, to a tile, to a tile's extras or to itself:
-- Returns a function that describes a tile target
function tile_desc_func_gen(kind, owner_getter)
return function (target)
local owner
if owner_getter(target) == nil then
owner = _("unowned")
else
owner = owner_getter(target).nation:name_translation()
end
return _("%s %s (%d, %d)"):format(owner, kind, target.x, target.y)
end
end
-- Describe the target based on its kind
target_describer = {
["individual cities"] = function (target)
return _("%s city %s (id: %d)"):format(
target.owner.nation:name_translation(), target.name, target.id)
end,
["individual units"] = function (target)
return _("%s %s (id: %d)"):format(
target.owner.nation:name_translation(),
target.utype:name_translation(), target.id)
end,
["unit stacks"] = function (target)
return _("unit stack at (%d, %d)"):format(target.x, target.y)
end,
["tiles"] = tile_desc_func_gen("tile", function (target)
return target.owner
end),
["tile extras"] = tile_desc_func_gen("tile extras", function (target)
return target:extra_owner(Nil)
end),
["itself"] = function (target) return "it self" end,
}
-- Log all performed actions
function action_started_callback(action, actor, target)
log.normal(_("%d: %s (rule name: %s) performed by %s %s (id: %d) on %s"),
game.current_turn(),
action:name_translation(),
action:rule_name(),
actor.owner.nation:name_translation(),
actor.utype:name_translation(),
actor.id,
target_describer[action:target_kind()](target))
end
signal.connect("action_started_unit_city", "action_started_callback")
signal.connect("action_started_unit_unit", "action_started_callback")
signal.connect("action_started_unit_units", "action_started_callback")
signal.connect("action_started_unit_tile", "action_started_callback")
signal.connect("action_started_unit_extras", "action_started_callback")
signal.connect("action_started_unit_self", "action_started_callback")
Example 2
=========
The following Lua code will make a player that poisons the population of
cities risk civil war:
function action_started_callback(action, actor, target)
if action:rule_name() == "Poison City" then
edit.civil_war(actor.owner, 5);
end
end
signal.connect("action_started_unit_city", "action_started_callback")
Forcing a unit to (try to) perform an action from Lua
=====================================================
A unit can be forced to try to perform an enabler controlled action from
Lua. The action is subject to the same rules as if the player ordered it
performed himself. This respects the ruleset rules about when an action is
enabled and what consequences performing the action has.
actor_unit:perform_action(action[, target[, sub_target]])
Units have a perform_action() method. This takes the action to perform as a
parameter. Depending on the action's target and sub target kind it may also
require a target parameter and a sub target parameter.
The action parameter is an action. You can use find.action(rule_name) to
get a reference to an action.
The target parameter is the target unit, city or - for unit stacks, tiles
and tile extras - tile the actor unit should perform the action to.
The sub_target parameter is the last part of the target "address" for
actions performed against a target and a sub target. It can be the name of
an extra, a Building_Type or a Tech_Type.
Examples:
=========
actor:perform_action(find.action("Disband Unit"))
actor:perform_action(find.action("Establish Embassy Stay"), target)
actor:perform_action(find.action("Targeted Sabotage City Escape"),
target, find.building_type("City Walls"))
actor:perform_action(find.action("Targeted Steal Tech Escape Expected"),
target, find.tech_type("Banking"))
actor:perform_action(find.action("Build Road"), target, "Road")
Actions and their hard requirements
===================================
Freeciv can only allow a player to perform an action when the action's hard
requirements are fulfilled. Some, but not all, hard requirements can be
expressed in an action enabler. Putting them there makes it clearer what the
rule actually is. Parts of Freeciv reasons about action enablers. Examples
are self contradicting rule detection and the help system. Including the
hard requirements rules in each enabler of its action is therefore
obligatory for some hard requirements. Those hard requirements are marked
with an exclamation mark (!).
Actions done by a unit against a city
=====================================
"Establish Embassy" - Establish a real embassy to the target player
* UI name can be set using ui_name_establish_embassy
* actor must be aware that the target exists
* actor can't have a real embassy to the target player (!)
* actor must be on the same tile as the target or on the tile next to it.
* target must be foreign. (!)
"Establish Embassy Stay" - Establish a real embassy to the target player
* UI name can be set using ui_name_establish_embassy
* spends the actor unit
* actor must be aware that the target exists
* actor can't have a real embassy to the target player (!)
* actor must be on the same tile as the target or on the tile next to it.
* target must be foreign. (!)
"Investigate City" - Look at the city dialog of a foreign city
* UI name can be set using ui_name_investigate_city
* actor must be aware that the target exists
* actor must be on the same tile as the target or on the tile next to it.
* target must be foreign. (!)
"Investigate City Spend Unit" - Look at the city dialog of a foreign city
* UI name can be set using ui_name_investigate_city
* spends the actor unit
* actor must be aware that the target exists
* actor must be on the same tile as the target or on the tile next to it.
* target must be foreign. (!)
"Sabotage City" - Destroy a building or the production in the target city.
* UI name can be set using ui_name_sabotage_city
* spends the actor unit
* actor must be aware that the target exists
* actor must be on the same tile as the target or on the tile next to it.
"Sabotage City Escape" - Destroy a building or the production in the target city.
* UI name can be set using ui_name_sabotage_city_escape
* actor must be aware that the target exists
* actor must be on the same tile as the target or on the tile next to it.
"Targeted Sabotage City" - Destroy a building in the target city.
* UI name can be set using ui_name_targeted_sabotage_city
* spends the actor unit
* actor must be aware that the target exists
* actor must be on the same tile as the target or on the tile next to it.
"Targeted Sabotage City Escape" - Destroy a building in the target city.
* UI name can be set using ui_name_targeted_sabotage_city_escape
* actor must be aware that the target exists
* actor must be on the same tile as the target or on the tile next to it.
"Sabotage City Production" - Sabotage the city's produciton.
* UI name can be set using ui_name_sabotage_city_production
* spends the actor unit
* actor must be aware that the target exists
* actor must be on the same tile as the target or on the tile next to it.
"Sabotage City Production Escape" - Sabotage the city's produciton.
* UI name can be set using ui_name_sabotage_city_production_escape
* actor must be aware that the target exists
* actor must be on the same tile as the target or on the tile next to it.
"Poison City" - Kill a citizen in the target city.
* UI name can be set using ui_name_poison_city
* spends the actor unit
* actor must be aware that the target exists
* actor must be on the same tile as the target or on the tile next to it.
"Poison City Escape" - Kill a citizen in the target city and escape.
* UI name can be set using ui_name_poison_city_escape
* actor must be aware that the target exists
* actor must be on the same tile as the target or on the tile next to it.
"Spread Plague" - Bio-terrorism. Infect the target city with an illness.
* UI name can be set using ui_name_spread_plague
* set if the actor unit is spent with spread_plague_actor_consuming_always
* may infect trade route connected cities if illness.illness_on is TRUE
* actor must be aware that the target exists
* actor must be on the same tile as the target or on the tile next to it.
"Steal Tech" - Steal a random tech from the targets owner.
* UI name can be set using ui_name_steal_tech
* spends the actor unit
* will always fail when the tech theft is expected. Tech theft is expected
when the number of previous tech thefts from the target city is above the
limit set by the "Stealings_Ignore" effect.
* actor must be aware that the target exists
* actor must be on the same tile as the target or on the tile next to it.
* target must be foreign. (!)
"Steal Tech Escape Expected" - Escape version of the above.
* UI name can be set using ui_name_steal_tech_escape
* more likely to fail when the tech theft is expected. Tech theft is
expected when the number of previous tech thefts from the target city is
above the limit set by the "Stealings_Ignore" effect.
* actor must be aware that the target exists
* actor must be on the same tile as the target or on the tile next to it.
* target must be foreign. (!)
"Targeted Steal Tech" - Steal a specific tech from the targets owner.
* UI name can be set using ui_name_targeted_steal_tech
* spends the actor unit
* will always fail when the tech theft is expected. Tech theft is expected
when the number of previous tech thefts from the target city is above the
limit set by the "Stealings_Ignore" effect.
* actor must be aware that the target exists
* actor must be on the same tile as the target or on the tile next to it.
* target must be foreign. (!)
"Targeted Steal Tech Escape Expected" - Escape version of the above.
* UI name can be set using ui_name_targeted_steal_tech_escape
* more likely to fail when the tech theft is expected. Tech theft is
expected when the number of previous tech thefts from the target city is
above the limit set by the "Stealings_Ignore" effect.
* actor must be aware that the target exists
* actor must be on the same tile as the target or on the tile next to it.
* target must be foreign. (!)
"Incite City" - Pay the target city to join the actors owners side.
* UI name can be set using ui_name_incite_city
* spends the actor unit
* actor must be aware that the target exists
* actor must be on the same tile as the target or on the tile next to it.
* target must be foreign. (!)
"Incite City Escape" - Pay the target city to join the actors owners side.
* UI name can be set using ui_name_incite_city_escape
* actor must be aware that the target exists
* actor must be on the same tile as the target or on the tile next to it.
* target must be foreign. (!)
"Steal Gold" - Steal some gold from the owner of the target city.
* UI name can be set using ui_name_steal_gold
* adjustable with the Max_Stolen_Gold_Pm effect and with the
Thiefs_Share_Pm effect
* spends the actor unit
* actor must be aware that the target exists
* the targets owner must have more than 0 gold.
* actor must be on the same tile as the target or on the tile next to it.
* target must be foreign. (!)
"Steal Gold Escape" - Steal some gold from the owner of the target city.
* UI name can be set using ui_name_steal_gold_escape
* adjustable with the Max_Stolen_Gold_Pm effect and with the
Thiefs_Share_Pm effect
* actor must be aware that the target exists
* the targets owner must have more than 0 gold.
* actor must be on the same tile as the target or on the tile next to it.
* target must be foreign. (!)
"Steal Maps" - Steal parts of the owner of the target city's map.
* UI name can be set using ui_name_steal_maps
* adjustable with the effect Maps_Stolen_Pct and the ruleset setting
steal_maps_reveals_all_cities
* spends the actor unit
* actor must be aware that the target exists
* actor must be on the same tile as the target or on the tile next to it.
* target must be foreign. (!)
"Steal Maps Escape" - Steal parts of the owner of the target city's map.
* UI name can be set using ui_name_steal_maps_escape
* adjustable with the effect Maps_Stolen_Pct and the ruleset setting
steal_maps_reveals_all_cities
* actor must be aware that the target exists
* actor must be on the same tile as the target or on the tile next to it.
* target must be foreign. (!)
"Spy Escape" - Just escape without doing anything else first.
* UI name can be set using ui_name_escape
* actor must be aware that the target exists
* actor must be on the same tile as the target or on the tile next to it.
* the actor player must have a city to escape to.
* target must be foreign. (!)
"Suitcase Nuke" - Cause a nuclear explosion in the target city.
* UI name can be set using ui_name_suitcase_nuke
* spends the actor unit
* actor must be aware that the target exists
* actor must be on the same tile as the target or on the tile next to it.
* Blast radius can be set with Nuke_Blast_Radius_1_Sq
"Suitcase Nuke Escape" - Cause a nuclear explosion in the target city.
* UI name can be set using ui_name_suitcase_nuke_escape
* actor must be aware that the target exists
* actor must be on the same tile as the target or on the tile next to it.
* Blast radius can be set with Nuke_Blast_Radius_1_Sq
"Destroy City" - Destroys the target city.
* UI name can be set using ui_name_destroy_city
* actor must be aware that the target exists
* actor must be on the same tile as the target or on the tile next to it.
"Establish Trade Route" - Establish a trade route to the target city.
* UI name can be set using ui_name_establish_trade_route
* actor must be aware that the target exists
* actor must be on the same tile as the target or on the tile next to it.
* actor must have a home city. (!)
* target must be foreign or trademindist tiles away from that home city.
* trade route type pct (see "Trade settings") can't be 0%.
* it is possible to establish a trade route between the cities as far as
the two cities them self are concerned. (Example: If one of the cities
can't have any trade routes at all it is impossible to establish a new
one.)
"Enter Marketplace" - Get a one time bounus without creating a trade route.
* UI name can be set using ui_name_enter_marketplace
* actor must be aware that the target exists
* any action listed in enter_marketplace_blocked_by must be impossible
* actor must be on the same tile as the target or on the tile next to it.
* actor must have a home city. (!)
* target must be foreign or trademindist tiles away from that home city.
* trade route type (see Trade settings) can't be 0%.
"Help Wonder" - Add the shields used to build the actor to the target city.
* UI name can be set using ui_name_help_wonder
* adjustable with the Unit_Shield_Value_Pct effect
* actor must be aware that the target exists
* actor must be on the same tile as the target unless
help_wonder_max_range allows it to be further away. (Default
help_wonder_max_range is 1)
* target city must need the extra shields to complete its production.
"Recycle Unit" - Add half the shields used to build the unit to target
* UI name can be set using ui_name_recycle_unit
* adjustable with the Unit_Shield_Value_Pct effect
* actor must be aware that the target exists
* "Help Wonder" must be impossible
* actor must be on the same tile as the target unless
recycle_unit_max_range allows it to be further away. (Default
recycle_unit_max_range is 1)
* target city must need the extra shields to complete its production.
"Join City" - Add the actor to the target city's population.
* UI name can be set using ui_name_join_city
* actor must be aware that the target exists
* actor must have population to add (set in pop_cost)
* actor must be on the same tile as the target or on the tile next to it.
* target city population must not become higher that the add_to_size_limit
setting permits.
* target must be able to grow to the size that adding the unit would
result in.
"Home City" - Set target city as the actor unit's new home city
* UI name can be set using ui_name_home_city
* actor must be aware that the target exists
* actor must be on the same tile as the target
* can't set existing home city as new home city
* target city has enough unused unit maintenance slots to support the actor
unit. (No problem if the actor unit spends 0 city slots)
"Upgrade Unit" - Upgrade the actor unit using the target's facilities.
* UI name can be set using ui_name_upgrade_unit.
* adjustable with the Unit_Shield_Value_Pct effect
* actor must be aware that the target exists
* actor must be on the same tile as the target.
* actor player must have enough gold to pay for the upgrade.
* actor unit must have a type to upgrade to (obsoleted_by).
* actor unit's upgraded form must be able to exist at its current
location.
* actor unit's upgraded form must have room for its current cargo.
* target player must be able to build the unit upgraded to
* target city must be domestic. (!)
"Airlift Unit" - Airlift actor unit to target city.
* UI name can be set using ui_name_airlift_unit
* max legal distance to the target can be set using airlift_max_range
* actor must be aware that the target exists
* the actor unit isn't transporting another unit (!)
* the actor unit isn't inside the target city
* the actor unit can exist in the target city (outside a transport)
* the actor unit is in a city (!)
* the city the actor unit is in
- is domestic or, if airliftingstyle permits it, allied
- has Airlift (see the Airlift effect and the airliftingstyle setting)
* the target city is domestic or, if airliftingstyle permits it, allied
* the target city has Airlift
"Conquer City" - Conquer the target city.
* UI name can be set using ui_name_conquer_city
* actor must be aware that the target exists
* any action listed in conquer_city_blocked_by must be impossible
* "Attack" must be impossible
* the actor unit must be on a tile next to the target.
* the actor player's nation can't be an animal barbarian. (!)
* the actor unit's current transport, if the actor unit is transported,
must be in a city or in a base native to the current transport if the
current transport's unit class has the Unreachable unit class flag and
the actor's unit type doesn't list the current transport's unit class in
disembarks.
* the actor unit doesn't have the "CoastStrict" unit type flag or the
target city is on or adjacent to a tile that doesn't have the
"UnsafeCoast" terrain flag.
* the actor unit can't be diplomatically forbidden from entering the tile
of the target city.
* the actor unit has the "CanOccupyCity" unit class flag (!)
* the actor can't have the "NonMil" unit type flag (!)
* the actor unit has at least one move fragment left (!)
* the actor's relationship to the target is War (!)
* actor unit must be able to exist outside of a transport at the target's
tile.
* the target must be foreign (!)
* the target city contains 0 units (!)
"Conquer City 2" - Conquer the target city.
* UI name can be set using ui_name_conquer_city_2
* any action listed in conquer_city_2_blocked_by must be impossible
* A copy of "Conquer City".
* See "Conquer City" for everything else.
"Conquer City 3" - Conquer the target city.
* UI name can be set using ui_name_conquer_city_3
* any action listed in conquer_city_3_blocked_by must be impossible
* A copy of "Conquer City".
* See "Conquer City" for everything else.
"Conquer City 4" - Conquer the target city.
* UI name can be set using ui_name_conquer_city_4
* any action listed in conquer_city_4_blocked_by must be impossible
* A copy of "Conquer City".
* See "Conquer City" for everything else.
"Surgical Strike Building" - Destroy a specific building.
* UI name can be set using ui_name_surgical_strike_building
* actor must be aware that the target exists
* the actor unit must be on a tile next to the target.
"Surgical Strike Production" - Destroy the city production.
* UI name can be set using ui_name_surgical_strike_production
* actor must be aware that the target exists
* the actor unit must be on a tile next to the target.
Actions done by a unit against another unit
===========================================
"Sabotage Unit" - Halve the target unit's hit points.
* UI name can be set using ui_name_sabotage_unit
* spends the actor unit
* actor must be on the same tile as the target or on the tile next to it.
* target must be visible for the actor.
"Sabotage Unit Escape" - Halve the target unit's hit points.
* UI name can be set using ui_name_sabotage_unit_escape
* actor must be on the same tile as the target or on the tile next to it.
* target must be visible for the actor.
"Bribe Unit" - Make the target unit join the actors owners side.
* UI name can be set using ui_name_bribe_unit
* forced actions after success can be set with
bribe_unit_post_success_forced_actions
* actor must be on the same tile as the target or on the tile next to it.
* target must be foreign. (!)
* target must be visible for the actor.
"Expel Unit" - Expel the target unit to its owner's capital.
* UI name can be set using ui_name_expel_unit
* actor must be on the same tile as the target or on the tile next to it.
* target must be visible for the actor.
* target's owner must have a capital
"Heal Unit" - Restore the target unit's health.
* UI name can be set using ui_name_heal_unit
* actor must be on the same tile as the target or on the tile next to it.
* the amount healed is set by the "Heal_Unit_Pct" effect.
* the target unit can't be at full health
* target must be visible for the actor.
"Heal Unit 2" - Restore the target unit's health.
* UI name can be set using ui_name_heal_unit_2
* actor must be on the same tile as the target or on the tile next to it.
* target must be visible for the actor.
* A copy of "Heal Unit"
"Transport Alight" - Exit target transport to same tile.
* UI name can be set using ui_name_transport_alight
* actor must be on the same tile as the target
* actor must be transported (!)
* actor must be on a livable tile (!)
* target must be transporting (!)
* target must be in a city or in a native base if the target's unit class
has the Unreachable unit class flag and the actor's unit type doesn't
list the target's unit class in disembarks.
* target must be visible for the actor.
"Transport Unload" - Unload the target unit to same tile.
* UI name can be set using ui_name_transport_unload
* actor must be on the same tile as the target
* actor must have a transport_cap greater than 0
* actor must be transporting (!)
* actor must be in a city or in a native base if the actor's unit class
has the Unreachable unit class flag and the target's unit type doesn't
list the actor's unit class in disembarks.
* target must be transported (!)
* target must be on a livable tile (!)
* target must be visible for the actor.
"Transport Load" - Load the target unit into the actor unit.
* UI name can be set using ui_name_transport_load
* actor must be on the same tile as the target
* actor must have a transport_cap greater than 0
* the actor unit must be domestic, allied or on the same team as the
target unit is. (!)
* actor must be in a city or in a base native to it if the actor's unit
class has the Unreachable unit class flag and the target's unit type
doesn't list the actor's unit class in the embarks field.
* the actor must be transporting fewer units than its unit type's
transport_cap field.
* the target unit can't currently be transported by the actor unit.
* the target unit's current transport, if the target unit is transported,
must be in a city or in a base native to the current transport if the
current transport's unit class has the Unreachable unit class flag and
the target's unit type doesn't list the current transport's unit class in
the disembarks field.
* the target's unit class must appear in the target unit type's cargo field.
* the target unit unit type must be different from the actor unit type
* the target unit or its (recursive) cargo, if it has cargo, must be unable
to transport itself, the actor unit or the actor unit's transporters.
See unit_transport_check()
* loading won't cause a situation with more than 5 recursive transports
* target must be visible to the actor.
"Transport Load 2" - Load the target unit into the actor unit.
* UI name can be set using ui_name_transport_load_2
* A copy of "Transport Load".
* See "Transport Load" for everything else.
"Transport Load 3" - Load the target unit into the actor unit.
* UI name can be set using ui_name_transport_load_3
* A copy of "Transport Load".
* See "Transport Load" for everything else.
"Transport Board" - Enter target transport on the same tile.
* UI name can be set using ui_name_transport_board
* the actor unit can't currently be transported by the target unit.
* the actor unit's current transport, if the actor unit is transported,
must be in a city or in a base native to the current transport if the
current transport's unit class has the Unreachable unit class flag and
the actor's unit type doesn't list the current transport's unit class in
the disembarks field.
* the actor's unit class must appear in the target unit type's cargo field.
* the actor unit unit type must be different from the target unit type
* the actor unit or its (recursive) cargo, if it has cargo, must be unable
to transport itself, the target unit or the target unit's transporters.
See unit_transport_check()
* boarding won't cause a situation with more than 5 recursive transports
* the target unit must be domestic, allied or on the same team as the
actor unit is. (!)
* target must be in a city or in a base native to it if the target's unit
class has the Unreachable unit class flag and the actor's unit type
doesn't list the target's unit class in the embarks field.
* the target must be transporting fewer units than its unit type's
transport_cap field.
* target must be visible to the actor.
"Transport Board 2" - Enter target transport on the same tile.
* UI name can be set using ui_name_transport_board_2
* A copy of "Transport Board".
* See "Transport Board" for everything else.
"Transport Board 3" - Enter target transport on the same tile.
* UI name can be set using ui_name_transport_board_3
* A copy of "Transport Board".
* See "Transport Board" for everything else.
"Transport Embark" - Enter target transport on a different tile.
* UI name can be set using ui_name_transport_embark
* the actor unit must be on a tile next to the target.
* the actor unit has at least one move fragment left (!)
* the actor unit can't currently be transported by the target unit.
* the actor unit's current transport, if the actor unit is transported,
must be in a city or in a base native to the current transport if the
current transport's unit class has the Unreachable unit class flag and
the actor's unit type doesn't list the current transport's unit class in
the disembarks field.
* the actor unit's type must be the target tile's terrain animal if the
player's nation is an animal barbarian.
* the actor unit can't be diplomatically forbidden from entering the target
tile.
* the actor unit doesn't have the "CoastStrict" unit type flag or the
target is on or adjacent to a tile that doesn't have the
"UnsafeCoast" terrain flag.
* actor unit must be able to move to the target tile.
* the actor's unit class must appear in the target unit type's cargo field.
* the actor unit unit type must be different from the target unit type
* the actor unit or its (recursive) cargo, if it has cargo, must be unable
to transport itself, the target unit or the target unit's transporters.
See unit_transport_check()
* boarding won't cause a situation with more than 5 recursive transports
* the target unit must be domestic, allied or on the same team as the
actor unit is. (!)
* target must be in a city or in a base native to it if the target's unit
class has the Unreachable unit class flag and the actor's unit type
doesn't list the target's unit class in the embarks field.
* the target must be transporting fewer units than its unit type's
transport_cap field.
* the target tile can't contain any city or units not allied to the actor
unit and all its cargo.
* target must be visible to the actor.
"Transport Embark 2" - Enter target transport on a different tile.
* UI name can be set using ui_name_transport_embark_2
* A copy of "Transport Embark".
* See "Transport Embark" for everything else.
"Transport Embark 3" - Enter target transport on a different tile.
* UI name can be set using ui_name_transport_embark_3
* A copy of "Transport Embark".
* See "Transport Embark" for everything else.
"Transport Embark 4" - Enter target transport on a different tile.
* UI name can be set using ui_name_transport_embark_4
* A copy of "Transport Embark".
* See "Transport Embark" for everything else.
Actions done by a unit against all units at a tile
==================================================
"Capture Units" - steal the target units.
* UI name can be set using ui_name_capture_units
* actor must be on a tile next to the target.
* target must be foreign. (!)
* target cannot be transporting other units. (!)
"Bombard" - bombard the units (and city) at the tile.
* UI name can be set using ui_name_bombard
* can't kill target units
* any action listed in bombard_blocked_by must be impossible
* actor must have a bombard_rate > 0
* actor must have an attack > 0
* actor must be on a tile next to the target or, if bombard_max_range
allows it, futher away.
* target owner must be at war with actor. (!)
"Bombard 2" - bombard the units (and city) at the tile.
* UI name can be set using ui_name_bombard_2
* can't kill target units
* any action listed in bombard_2_blocked_by must be impossible
* actor must be on a tile next to the target or, if bombard_2_max_range
allows it, futher away.
* A copy of "Bombard".
* See "Bombard" for everything else.
"Bombard 3" - bombard the units (and city) at the tile.
* UI name can be set using ui_name_bombard_3
* can't kill target units
* any action listed in bombard_3_blocked_by must be impossible
* actor must be on a tile next to the target or, if bombard_3_max_range
allows it, futher away.
* A copy of "Bombard".
* See "Bombard" for everything else.
"Bombard Lethal" - bombard the units (and city) at the tile.
* UI name can be set using ui_name_bombard_lethal
* can kill target units
* any action listed in bombard_lethal_blocked_by must be impossible
* actor must have a bombard_rate > 0
* actor must have an attack > 0
* actor must be on a tile next to the target or, if
bombard_lethal_max_range allows it, futher away.
* target owner must be at war with actor. (!)
"Attack"
* UI name can be set using ui_name_attack
* any action listed in attack_blocked_by must be impossible
* forced actions after success can be set with
attack_post_success_forced_actions
* the actor must be on the tile next to the target.
* the actor's attack must be above 0
* the actor can't have the "NonMil" unit type flag (!)
* the actor must be native to the target tile unless it has the
"AttackNonNative" unit class flag and not the "Only_Native_Attack" unit
type flag.
* the target tile has no non enemy units. (!)
* the target tile has no non enemy city.
* one or all (unreachableprotects) non transported units at the target
tile must be reachable. A unit is reachable if any of the following is
true:
- it doesn't have the "Unreachable" unit class flag
- it is listed in the actor unit's targets
- it is in a city
- it is on a tile with a native Extra
"Suicide Attack"
* UI name can be set using ui_name_suicide_attack
* spends the actor unit
* any action listed in suicide_attack_blocked_by must be impossible
* the actor must be on the tile next to the target.
* the actor's attack must be above 0
* the actor can't have the "NonMil" unit type flag (!)
* the actor must be native to the target tile unless it has the
"AttackNonNative" unit class flag and not the "Only_Native_Attack" unit
type flag.
* the target tile has no non enemy units. (!)
* the target tile has no non enemy city.
* one or all (unreachableprotects) non transported units at the target
tile must be reachable. A unit is reachable if any of the following is
true:
- it doesn't have the "Unreachable" unit class flag
- it is listed in the actor unit's targets
- it is in a city
- it is on a tile with a native Extra
"Wipe Units"
* UI name can be set using ui_name_wipe_units
* any action listed in wipe_units_blocked_by must be impossible
* forced actions after success can be set with
wipe_units_post_success_forced_actions
* the actor must be on the tile next to the target.
* the actor's attack must be above 0
* the actor can't have the "NonMil" unit type flag (!)
* the actor must be native to the target tile unless it has the
"AttackNonNative" unit class flag and not the "Only_Native_Attack" unit
type flag.
* the target tile has no non enemy units. (!)
* the target tile has no non enemy city.
* the target tile has no units with positive defense strength
* all units at the target tile must be reachable.
A unit is reachable if any of the following is true:
- it doesn't have the "Unreachable" unit class flag
- it is listed in the actor unit's targets
- it is in a city
- it is on a tile with a native Extra
"Nuke Units" - Detonate at the target unit stack. Cause a nuclear explosion.
* UI name can be set using ui_name_nuke_units
* set if the actor unit is spent with nuke_units_consuming_always
* any action listed in nuke_units_blocked_by must be impossible
* the range of legal distance between actor unit and target the actor units
must be between nuke_units_min_range and nuke_units_max_range
* the actor must be native to the target tile unless it has the
"AttackNonNative" unit class flag and not the "Only_Native_Attack" unit
type flag.
* one or all (unreachableprotects) non transported units at the target
tile must be reachable. A unit is reachable if any of the following is
true:
- it doesn't have the "Unreachable" unit class flag
- it is listed in the actor unit's targets
- it is in a city
- it is on a tile with a native Extra
* Blast radius can be set with Nuke_Blast_Radius_1_Sq
"Spy Attack" - trigger a diplomatic battle to eliminate tile defenders.
* UI name can be set using ui_name_spy_attack
* the actor must be on the tile next to the target.
* the target tile must have at least 1 diplomatic defender.
Actions done by a unit against a tile
=====================================
"Found City" - Found a city at the target tile.
* UI name can be set using ui_name_found_city
* set if the actor unit is spent with found_city_consuming_always
* city name must be legal
* the scenario setting prevent_new_cities must be false.
* actor must be on the same tile as the target.
* target must not have the NoCities terrain flag. (!)
* target must not be closer than citymindist to nearest city.
"Explode Nuclear" - Detonate at the target tile. Cause a nuclear explosion.
* UI name can be set using ui_name_explode_nuclear
* set if the actor unit is spent with explode_nuclear_consuming_always
* target kind can be changed with explode_nuclear_target_kind
* any action listed in explode_nuclear_blocked_by must be impossible
* the range of legal distance between actor unit and target the actor units
must be between explode_nuclear_min_range and explode_nuclear_max_range
* Blast radius can be set with Nuke_Blast_Radius_1_Sq
"Nuke City" - Detonate at the target tile. Cause a nuclear explosion.
* UI name can be set using ui_name_nuke_city
* set if the actor unit is spent with nuke_city_consuming_always
* target kind can be changed with nuke_city_target_kind
* any action listed in nuke_city_blocked_by must be impossible
* the range of legal distance between actor unit and target the actor units
must be between nuke_city_min_range and nuke_city_max_range
* Blast radius can be set with Nuke_Blast_Radius_1_Sq
"Paradrop Unit" - move the actor unit to the target tile.
* UI name can be set using ui_name_paradrop_unit
* kills the actor unit if the target tile has a terrain type the actor unit
can't exist on and - if paradrop_to_transport is set - it couldn't load
into a transport at the target tile.
* kills the actor unit if the target tile has a non-allied unit
* kills the actor unit if the target tile has a non-allied city
* the distance between actor and target is from 1 to paratroopers_range
* the actor unit hasn't paradropped this turn
* the actor unit isn't transporting another unit (!)
* the actor unit can't be diplomatically forbidden from entering the target
tile. (!)
* the target tile is known (doesn't have to be seen) by the actor
* if the target tile is seen:
- the actor unit must be able to exist outside a transport on the target
tile if the target tile doesn't have a visible transport the actor unit
is able to load into on landing
- the target tile can't contain a city belonging to a player the actor
has peace, cease-fire or armistice with.
- the target tile can't contain any seen unit belonging to a player the
actor player has peace, cease-fire or armistice with.
"Paradrop Unit Conquer" - move the actor unit to the target tile.
* UI name can be set using ui_name_paradrop_unit_conquer
* kills the actor unit if the target tile has a terrain type the actor unit
can't exist on and - if paradrop_to_transport is set - it couldn't load
into a transport at the target tile.
* kills the actor unit if the target tile has a non-allied unit
* can result in the conquest of the city at the target tile
if the target tile has a city
* can result in the conquest of the extras at the target tile if
one of the extras at the target tile claims territory and is native to
the actor unit.
* the distance between actor and target is from 1 to paratroopers_range
* the actor unit hasn't paradropped this turn
* the actor unit isn't transporting another unit (!)
* the actor unit can't be diplomatically forbidden from entering the target
tile. (!)
* the actor unit doesn't have the NonMil unit type flag unless the target
tile doesn't have a city. (!)
* the actor unit has the CanOccupyCity unit class flag unless the target
tile doesn't have a city. (!)
* the actor owner must be at war with the target owner unless the target
tile doesn't have a city. (!)
* the actor owner can't be an animal unless the target tile doesn't have a
city. (!)
* the target tile is foreign or unclaimed. (!)
* the target tile is known (doesn't have to be seen) by the actor
* if the target tile is seen:
- the actor unit must be able to exist outside a transport on the target
tile if the target tile doesn't have a visible transport the actor unit
is able to load into on landing
- the target tile can't contain a city belonging to a player the actor
has peace, cease-fire or armistice with.
- the target tile can't contain any seen unit belonging to a player the
actor player has peace, cease-fire or armistice with.
"Paradrop Unit Frighten" - move the actor unit to the target tile.
* UI name can be set using ui_name_paradrop_unit_frighten
* kills the actor unit if the target tile has a terrain type the actor unit
can't exist on and - if paradrop_to_transport is set - it couldn't load
into a transport at the target tile.
* kills the actor unit if the target tile has a non-allied unit
* kills the actor unit if the target tile has a non-allied city
* can result in hut frightening if
- the target tile has an extra with "Enter" in its rmcauses (a Hut)
- the target tile's Hut's rmreqs are fulfilled
* the distance between actor and target is from 1 to paratroopers_range
* the actor unit hasn't paradropped this turn
* the actor unit isn't transporting another unit (!)
* the actor unit can't be diplomatically forbidden from entering the target
tile. (!)
* the actor unit has the unit class flag "HutFrighten" (!)
* the target tile is known (doesn't have to be seen) by the actor
* if the target tile is seen:
- the actor unit must be able to exist outside a transport on the target
tile if the target tile doesn't have a visible transport the actor unit
is able to load into on landing
- the target tile can't contain a city belonging to a player the actor
has peace, cease-fire or armistice with.
- the target tile can't contain any seen unit belonging to a player the
actor player has peace, cease-fire or armistice with.
"Paradrop Unit Frighten Conquer" - move the actor unit to the target tile.
* UI name can be set using ui_name_paradrop_unit_frighten_conquer