You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
doc: Document API changes for nyan data API v0.6.0.
doc: Document API changes for ApplyEffect.
doc: Document API changes for Task nodes.
doc: Document API changes for Ranged property.
doc: Document API changes for NextCommand condition.
Copy file name to clipboardExpand all lines: doc/nyan/api_reference/reference_ability.md
+20-48Lines changed: 20 additions & 48 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -127,6 +127,26 @@ If the lock pool
127
127
128
128
the ability with this property cannot become active.
129
129
130
+
## ability.property.type.Ranged
131
+
132
+
```python
133
+
Ranged(AbilityProperty):
134
+
min_range : float
135
+
max_range : float
136
+
```
137
+
138
+
Abilities with this property can only be used within a specified range around the game entity. The property mostly affects abilities that are *targeted*, i.e. that are used on other game entities or locations in the game world.
139
+
140
+
If the target of the ability is another game entity and said game entity has a `Collision` ability, the range check factors in the `Hitbox` boundaries of the targeted game entity when calculating the distance.
141
+
142
+
Without this property, abilities behave as if `min_range` and `max_range` are `0.0`.
143
+
144
+
**min_range**
145
+
Minimum distance to the target of the ability.
146
+
147
+
**max_range**
148
+
Maximum distance to the target of the ability.
149
+
130
150
## ability.type.ActiveTransformTo
131
151
132
152
```python
@@ -327,16 +347,12 @@ Alters the abilities and modifiers of a game entity after the despawn condition
327
347
328
348
```python
329
349
DetectCloak(Ability):
330
-
range : float
331
350
allowed_types : set(children(GameEntityType))
332
351
blacklisted_entities : set(GameEntity)
333
352
```
334
353
335
354
Enables the game entity to decloak other game entities which use the `Cloak` ability.
336
355
337
-
**range**
338
-
Range around the game entity in which other game entities will be decloaked.
339
-
340
356
**allowed_types**
341
357
Whitelist of game entity types that can be decloaked.
342
358
@@ -543,17 +559,13 @@ Determines whether the resource spot is harvestable when it is created. If `True
543
559
544
560
```python
545
561
Herd(Ability):
546
-
range : float
547
562
strength : int
548
563
allowed_types : set(children(GameEntityType))
549
564
blacklisted_entities : set(GameEntity)
550
565
```
551
566
552
567
Allows a game entity to change the ownership of other game entities with the `Herdable` ability.
553
568
554
-
**range**
555
-
Minimum distance to a herdable game entity to make it change ownership.
556
-
557
569
**strength**
558
570
Comparison value for situations when the game entity competes with other game entities for a herdable. The game entity with the highest `strength` value will always be prefered, even if other game entities fulfill the condition set by `mode` in `Herdable` better.
559
571
@@ -787,38 +799,6 @@ RallyPoint(Ability):
787
799
788
800
Allows a game entity to set a rally point on the map. Game entities spawned by the `Create` ability or ejected from a container will move to the rally point location. The rally point can be placed on another game entity. In that case, the game entities moving there will try to use an appropriate ability on it.
789
801
790
-
## ability.type.RangedContinuousEffect
791
-
792
-
```python
793
-
RangedContinuousEffect(ApplyContinuousEffect):
794
-
min_range : int
795
-
max_range : int
796
-
```
797
-
798
-
Applies continuous effects on another game entity. This specialization of `ApplyContinuousEffect` allows ranged application.
799
-
800
-
**min_range**
801
-
Minimum distance to target.
802
-
803
-
**max_range**
804
-
Maximum distance to the target.
805
-
806
-
## ability.type.RangedDiscreteEffect
807
-
808
-
```python
809
-
RangedDiscreteEffect(ApplyDiscreteEffect):
810
-
min_range : int
811
-
max_range : int
812
-
```
813
-
814
-
Applies batches of discrete effects on another game entity. This specialization of `ApplyDiscreteEffect` allows ranged application.
815
-
816
-
**min_range**
817
-
Minimum distance to target.
818
-
819
-
**max_range**
820
-
Maximum distance to the target.
821
-
822
802
## ability.type.RegenerateAttribute
823
803
824
804
```python
@@ -966,8 +946,6 @@ ShootProjectile(Ability):
966
946
projectiles : orderedset(GameEntity)
967
947
min_projectiles : int
968
948
max_projectiles : int
969
-
min_range : int
970
-
max_range : int
971
949
reload_time : float
972
950
spawn_delay : float
973
951
projectile_delay : float
@@ -994,12 +972,6 @@ Minimum amount of projectiles spawned.
994
972
**max_projectiles**
995
973
Maximum amount of projectiles spawned.
996
974
997
-
**min_range**
998
-
Minimum distance to the targeted game entity.
999
-
1000
-
**max_range**
1001
-
Maximum distance to the targeted game entity.
1002
-
1003
975
**reload_time**
1004
976
Time until the ability can be used again in seconds. The timer starts after the *last* projectile has been fired.
@@ -54,32 +54,54 @@ Generalization object for conditions that can be used in `XORGate` nodes.
54
54
**node**
55
55
Node that is visited when the condition is true.
56
56
57
+
## util.activity.condition.type.AbilityUsable
58
+
59
+
```python
60
+
AbilityUsable(Condition):
61
+
ability : abstract(Ability)
62
+
```
63
+
64
+
Is true when an ability can be used by the game entity when the node is visited.
65
+
66
+
**ability**
67
+
Ability definition used for the usability check. This can reference a specific ability of the game entity or an abstract API object from the `engine.ability.type` namespace. If a specific ability is referenced, the ability must be assigned to the game entity **and** be enabled for the check to pass. If an API object is referenced, at least one ability of the same type must be enabled for the check to pass.
68
+
57
69
## util.activity.condition.type.CommandInQueue
58
70
59
71
```python
60
72
CommandInQueue(Condition):
61
73
pass
62
74
```
63
75
64
-
Is true when the command queue is not empty when the node is visited.
76
+
Is true when the game entity's command queue is not empty when the node is visited.
65
77
66
-
## util.activity.condition.type.NextCommandIdle
78
+
## util.activity.condition.type.NextCommand
67
79
68
80
```python
69
-
NextCommandIdle(Condition):
70
-
pass
81
+
NextCommand(Condition):
82
+
command : children(Command)
71
83
```
72
84
73
-
Is true when the next command in the queue is of type `Idle`.
85
+
Is true when the next command in the game entity's command queue is of a specific type.
74
86
75
-
## util.activity.condition.type.NextCommandMove
87
+
**command**
88
+
Command type checked by the condition.
89
+
90
+
## util.activity.condition.type.TargetInRange
76
91
77
92
```python
78
-
NextCommandMove(Condition):
79
-
pass
93
+
TargetInRange(Condition):
94
+
ability : abstract(Ability)
80
95
```
81
96
82
-
Is true when the next command in the queue is of type `Move`.
97
+
Is true when the target of the next command in the game entity's command queue is in range of an ability.
98
+
99
+
**ability**
100
+
Ability definition used for the range check.
101
+
102
+
This can reference a specific ability of the game entity or an abstract API object from the `engine.ability.type` namespace. If a specific ability is referenced, the ability must be assigned to the game entity and must be enabled. Otherwise, the range check fails. If an API object is referenced, the first active ability with the same type as the API object is executed.
103
+
104
+
If the ability has the property `Ranged`, the attributes of this property are utilized for the range check calculations. If the ability does not have a `Ranged` property, the condition is only true when the game entity is at the same position as the target.
83
105
84
106
## util.activity.event.Event
85
107
@@ -149,7 +171,7 @@ Next node in the activity graph.
149
171
**ability**
150
172
Ability that is executed.
151
173
152
-
This can reference a specific ability of the game entity or an abstract API object from the `engine.ability.type` namespace. If a specific ability is referenced, the ability must be assigned to the game entity and must not be disabled. Otherwise, the ability is not executed. If an API object is referenced, the first active ability with the same type as the API object is executed.
174
+
This can reference a specific ability of the game entity or an abstract API object from the `engine.ability.type` namespace. If a specific ability is referenced, the ability must be assigned to the game entity and must be enabled. Otherwise, the ability is not executed. If an API object is referenced, the first active ability with the same type as the API object is executed.
153
175
154
176
## util.activity.node.type.End
155
177
@@ -172,6 +194,22 @@ Start of an activity. Does nothing but pointing to the next node.
172
194
**next**
173
195
Next node in the activity graph.
174
196
197
+
## util.activity.node.type.Task
198
+
199
+
```python
200
+
Task(Node):
201
+
next : Node
202
+
task : children(Task)
203
+
```
204
+
205
+
Executes a task on the game entity when the node is visited.
206
+
207
+
**next**
208
+
Next node in the activity graph.
209
+
210
+
**task**
211
+
Task that is executed.
212
+
175
213
## util.activity.node.type.XOREventGate
176
214
177
215
```python
@@ -195,11 +233,84 @@ XORGate(Node):
195
233
Gateway that branches the activity graph depending on the result of conditional queries. Queries are executed immediately when the node is visited.
196
234
197
235
**next**
198
-
Mapping of conditional queries to the next node in the activity graph. The first query that evaluates to true is used to determine the next node. If no query evaluates to true, the `default` node is used.
236
+
Mapping of conditional queries to the next node in the activity graph. The first query that evaluates to true is used to determine the next node. If no query evaluates to true, the `default` node is used as fallback.
199
237
200
238
**default**
201
239
Default node that is used if no query evaluates to true.
202
240
241
+
## util.activity.node.type.XORSwitchGate
242
+
243
+
```python
244
+
XORSwitchGate(Node):
245
+
switch : children(SwitchCondition)
246
+
default : Node
247
+
```
248
+
249
+
Gateway that branches the activity graph depending on the value of a runtime parameter. In comparison to `XORGate`, only one conditional query is done based on the value (similar to the behaviour of a [switch statement](https://en.wikipedia.org/wiki/Switch_statement)). The query is executed immediately when the node is visited.
250
+
251
+
**switch**
252
+
Defines which runtime parameter is checked as well as the mapping of parameter value to the next node in the activity graph. If a value is encountered at query execution time that is not associated with a node, the `default` node is used as fallback.
253
+
254
+
**default**
255
+
Default node that is used if a value does not have an associated node.
256
+
257
+
## util.activity.switch_condition.SwitchCondition
258
+
259
+
```python
260
+
SwitchCondition(Object):
261
+
pass
262
+
```
263
+
264
+
Generalization object for conditions that can be used in `XORSwitchGate` nodes.
Switches branches based on the type of command that is in the queue of the game entity.
274
+
275
+
**next**
276
+
Mapping of command types to the next node in the activity graph.
277
+
278
+
## util.activity.task.Task
279
+
280
+
```python
281
+
Task(Object):
282
+
pass
283
+
```
284
+
285
+
Generalization object for tasks that can be used in `Task` nodes.
286
+
287
+
## util.activity.task.type.ClearCommandQueue
288
+
289
+
```python
290
+
ClearCommandQueue(Task):
291
+
pass
292
+
```
293
+
294
+
Clear the command queue of the game entity executing the activity.
295
+
296
+
## util.activity.task.type.MoveToTarget
297
+
298
+
```python
299
+
MoveToTarget(Task):
300
+
pass
301
+
```
302
+
303
+
Move to the current target of the game entity. The target may be a position or another game entity. If the game entity has no target at time of execution, the task is skipped.
304
+
305
+
## util.activity.task.type.PopCommandQueue
306
+
307
+
```python
308
+
PopCommandQueue(Task):
309
+
pass
310
+
```
311
+
312
+
Pop the front command from the command queue of the game entity executing the activity.
313
+
203
314
## util.animation_override.AnimationOverride
204
315
205
316
```python
@@ -420,6 +531,42 @@ The activation message that has to be typed into the chat console.
420
531
**changes**
421
532
Changes to API objects.
422
533
534
+
## util.command.Command
535
+
536
+
```python
537
+
Command(Object):
538
+
pass
539
+
```
540
+
541
+
Generalization object for commands of a game entity.
542
+
543
+
## util.command.type.ApplyEffect
544
+
545
+
```python
546
+
ApplyEffect(Command):
547
+
pass
548
+
```
549
+
550
+
Game entity command for using the `ApplyEffect` ability.
0 commit comments