Added old sources; initial commit.
This commit is contained in:
@@ -0,0 +1,53 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
|
||||
<pack>
|
||||
<!-- the most basic ai structure -->
|
||||
<driver name="basic">
|
||||
<task id="_begin"></task>
|
||||
<check for="can_fire" id="can_fire"></check>
|
||||
<task if="can_fire" id="fire"></task>
|
||||
<task id="fly"></task>
|
||||
<task id="avoid"></task>
|
||||
<task id="turn"></task>
|
||||
<task id="_end"></task>
|
||||
</driver>
|
||||
|
||||
<!-- -->
|
||||
<driver name="basic_ship" extends="basic">
|
||||
<check replace="can_fire">
|
||||
<fn str="CAN_SHOOT" />
|
||||
<gun num="0" />
|
||||
<spare str="ENEMY" />
|
||||
</check>
|
||||
|
||||
<!-- Needs replace -->
|
||||
<task replace="fire"></task>
|
||||
|
||||
<!-- Needs replace -->
|
||||
<task replace="fly"></task>
|
||||
|
||||
<task replace="avoid">
|
||||
<fn str="AVOID" />
|
||||
<avoid str="NATURAL,SHOT_GOOD,SHOT_BAD,ENEMY,MINE" />
|
||||
</task>
|
||||
|
||||
<task replace="turn">
|
||||
<fn str="TURN_TO" />
|
||||
<dir coord="MOVE_DIR" />
|
||||
</task>
|
||||
</driver>
|
||||
|
||||
|
||||
<driver name="basic_saucer" extends="basic_ship">
|
||||
|
||||
<!-- Needs replace -->
|
||||
<task replace="fire"></task>
|
||||
|
||||
<task replace="turn">
|
||||
<fn str="ROTATE" />
|
||||
<add num="3" />
|
||||
<random_dir bool="true"/>
|
||||
</task>
|
||||
</driver>
|
||||
|
||||
</pack>
|
||||
@@ -0,0 +1,41 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
|
||||
<pack>
|
||||
<driver name="bird" extends="basic_ship">
|
||||
|
||||
<check for="in_zone" id="ck1" after="can_fire">
|
||||
<fn str="IS_IN_RECT" />
|
||||
<x range="-20:20" />
|
||||
<z range="-20:30" />
|
||||
</check>
|
||||
|
||||
<task replace="fire" if="can_fire&in_zone">
|
||||
<fn str="SHOOT" />
|
||||
<count range="1" />
|
||||
<gap_group num="0.6" />
|
||||
<gun num="0" />
|
||||
</task>
|
||||
|
||||
<task replace="fly">
|
||||
<fn str="FLY_TO_RECT" />
|
||||
<x range="-4-4"/>
|
||||
<z range="15-25"/>
|
||||
<weight num="30" />
|
||||
</task>
|
||||
|
||||
|
||||
<task replace="turn">
|
||||
<fn str="TURN_TO" />
|
||||
<dir coord="PLAYER_DIR" />
|
||||
</task>
|
||||
|
||||
<task replace="avoid">
|
||||
<fn str="AVOID" />
|
||||
<avoid str="NATURAL,SHOT_GOOD,SHOT_BAD,ENEMY,MINE" />
|
||||
<range num="4" />
|
||||
<weight num="4" />
|
||||
<square bool="true" />
|
||||
</task>
|
||||
|
||||
</driver>
|
||||
</pack>
|
||||
@@ -0,0 +1,81 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
|
||||
<pack>
|
||||
|
||||
<driver name="burger" extends="basic_saucer">
|
||||
<task replace="fire">
|
||||
<fn str="SHOOT" />
|
||||
<count range="2:4" />
|
||||
<gap_shot num="0.07" />
|
||||
<gap_group range="2:4" />
|
||||
<gun num="0" />
|
||||
</task>
|
||||
|
||||
<task replace="avoid">
|
||||
<fn str="AVOID" />
|
||||
<avoid str="NATURAL,SHOT_GOOD,ENEMY,MINE" />
|
||||
<weight num="1" />
|
||||
</task>
|
||||
|
||||
<task replace="fly">
|
||||
<fn str="FLY_TO_POINT" />
|
||||
<target coord="PLAYER_POS" />
|
||||
</task>
|
||||
</driver>
|
||||
|
||||
|
||||
<driver name="burger_zone" extends="burger">
|
||||
<task replace="fly">
|
||||
<fn str="FLY_TO_RECT" />
|
||||
<x range="-10:10" />
|
||||
<z range="25:40" />
|
||||
<weight num="60" />
|
||||
</task>
|
||||
</driver>
|
||||
|
||||
<driver name="burger_zone_mad" extends="burger_zone">
|
||||
<task replace="fire">
|
||||
<fn str="SHOOT" />
|
||||
<count range="15-25" />
|
||||
<gap_shot num="0.08" />
|
||||
<gap_group range="1:5" />
|
||||
<gun num="0" />
|
||||
</task>
|
||||
</driver>
|
||||
|
||||
<driver name="burger_mad" extends="burger_zone">
|
||||
<task replace="fire">
|
||||
<fn str="SHOOT" />
|
||||
<count range="15-25" />
|
||||
<gap_shot num="0.08" />
|
||||
<gap_group range="2:5" />
|
||||
<gun num="0" />
|
||||
</task>
|
||||
</driver>
|
||||
|
||||
<driver name="burger_king" extends="basic_saucer">
|
||||
|
||||
<check for="in_zone" id="ck1">
|
||||
<fn str="IS_IN_RECT" />
|
||||
<x range="-20:20" />
|
||||
<z range="-5:70" />
|
||||
</check>
|
||||
|
||||
<task replace="fire" if="in_zone">
|
||||
<fn str="SHOOT" />
|
||||
<count range="10:20" />
|
||||
<bullets range="3:5" />
|
||||
<gap_group num="1" />
|
||||
<gap_shot num="0.02" />
|
||||
<gun num="0" /> <!--range="0-1" -->
|
||||
</task>
|
||||
|
||||
<task replace="fly">
|
||||
<fn str="FLY_TO_RECT" />
|
||||
<x range="-10:10" />
|
||||
<z range="20:40" />
|
||||
<weight num="10" />
|
||||
</task>
|
||||
</driver>
|
||||
|
||||
</pack>
|
||||
@@ -0,0 +1,73 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
|
||||
<pack>
|
||||
<driver name="cube_snake">
|
||||
|
||||
<check for="in_zone">
|
||||
<fn str="IS_IN_RECT" />
|
||||
<x range="-20:20" />
|
||||
<z range="-20:60" />
|
||||
</check>
|
||||
|
||||
<check for="fire">
|
||||
<fn str="CAN_SHOOT" />
|
||||
<gun num="0" />
|
||||
<spare str="ENEMY" />
|
||||
<!-- ignore_formation bool="true" /-->
|
||||
</check>
|
||||
|
||||
<task if="fire*in_zone">
|
||||
<fn str="SHOOT" />
|
||||
<count range="1:3" />
|
||||
<gap_group range="0.5:2.5" />
|
||||
<gap_shot num="0.09" />
|
||||
<gun num="0" />
|
||||
</task>
|
||||
|
||||
<task>
|
||||
<fn str="TURN_TO" />
|
||||
<dir coord="MOVE_DIR" />
|
||||
</task>
|
||||
|
||||
|
||||
<!-- SNAKE CODE -->
|
||||
<check for="is_leader">
|
||||
<fn str="IS_LEADER" />
|
||||
</check>
|
||||
|
||||
<check for="is_tail">
|
||||
<fn str="IS_TAIL" />
|
||||
</check>
|
||||
|
||||
<task if="is_leader">
|
||||
<fn str="FLY_TO_RECT" />
|
||||
<x range="-10:10" />
|
||||
<z range="25:35" />
|
||||
<weight num="5" />
|
||||
</task>
|
||||
|
||||
<task if="!is_leader">
|
||||
<fn str="FLY_TO_POINT" />
|
||||
<target coord="LEADER_POS" />
|
||||
<weight num="10" />
|
||||
</task>
|
||||
|
||||
<task if="!is_leader">
|
||||
<fn str="KEEP_DISTANCE" />
|
||||
<from coord="LEADER_POS" />
|
||||
<dist range="1.5:2" />
|
||||
</task>
|
||||
|
||||
|
||||
<task if="is_leader">
|
||||
<fn str="AVOID" />
|
||||
<avoid str="ENEMY,MINE,PLAYER,NATURAL,SHOT_GOOD" />
|
||||
<weight num="1.5" />
|
||||
<range num="5" />
|
||||
<ignore_formation bool="true" />
|
||||
</task>
|
||||
|
||||
<!-- END OF SNAKE CODE -->
|
||||
|
||||
</driver>
|
||||
</pack>
|
||||
@@ -0,0 +1,340 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
|
||||
<!-- This file shows all that can be done in a driver. -->
|
||||
|
||||
<!-- The root tag "pack" can contain multiple "driver" tags, but nothing else -->
|
||||
<pack>
|
||||
|
||||
<!-- Here we declare a driver -->
|
||||
<driver name="driver1">
|
||||
|
||||
|
||||
<!-- TASKS AND CHECKS -->
|
||||
|
||||
<!--
|
||||
|
||||
Inside a driver, there can be various task and check statements.
|
||||
[Checks] test something in the drone's environment, and saves the result as a true/false flag.
|
||||
[Tasks] perform some actual operation - shoot, steer, rotate and similar.
|
||||
|
||||
Tasks can be contitioned by the results of Checks.
|
||||
|
||||
There is a list of all existing tasks and checks lower - here for the sake of simplicity
|
||||
we will use FAKE tasks and checks.
|
||||
-->
|
||||
|
||||
|
||||
<!-- the result of a "check" is stored to a flag whose name you declare here -->
|
||||
<check id="ck" for="flag_name">
|
||||
<!-- some stuff here -->
|
||||
</check>
|
||||
|
||||
|
||||
<!--
|
||||
task executes only if the given flag is true.
|
||||
Use | as OR, & as AND, and brakcets to group the flags.
|
||||
|
||||
Example:
|
||||
if="((A|B)&(C|D))|E"
|
||||
if="canShoot"
|
||||
-->
|
||||
<task id="ts" if="flag_name">
|
||||
<!-- some stuff here -->
|
||||
</check>
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- TASK CONTENTS -->
|
||||
|
||||
<task id="fakeTask">
|
||||
|
||||
<!-- name of the function used to perform this check or task -->
|
||||
<fn str="NAME_OF_THE__FUNCTION" />
|
||||
|
||||
<!-- here come arguments for the function -->
|
||||
<argname argtype="argvalue" />
|
||||
|
||||
<!--
|
||||
Most tasks and checks take several arguments.
|
||||
|
||||
Table of argument types:
|
||||
|
||||
str -> "A string value."
|
||||
|
||||
num -> Number, integer "12" or float "8.751"
|
||||
(also work for numbers: int, float, double)
|
||||
|
||||
bool -> Boolean.
|
||||
Allowed values are "true", "false", "0", "1", "yes", "no"
|
||||
|
||||
range -> numeric range
|
||||
format: "MIN:MAX", eg. "-13:15.5" or "3:5"
|
||||
Use RANGE in place of NUM to make it generate random number from range.
|
||||
That can be used for all task functions.
|
||||
|
||||
coord -> a coordinate, or a vector
|
||||
format: "X_COORD;Z_COORD"
|
||||
This is because the Sector's scene is flat, all is at Y=0
|
||||
You can use both integer and float numbers.
|
||||
|
||||
Coord has one special feature: MAGIC VALUES!
|
||||
If you declare the argument as coord, but stuff it with a "magic" string value,
|
||||
it will become a dynamic coordinate, always returning calculated value of the
|
||||
"magic" coordinate. Example: coord="MOVE_DIR"
|
||||
|
||||
Magic values:
|
||||
PLAYER_POS - player's current position
|
||||
PLAYER_MOTION - player's current motion vector
|
||||
|
||||
POS - current position
|
||||
MOTION - current motion vector of this ship
|
||||
|
||||
MOVE_DIR - same as MOTION
|
||||
PLAYER_DIR - vector towards player ship
|
||||
|
||||
-->
|
||||
|
||||
<!-- real-life examples -->
|
||||
<dir coord="PLAYER_DIR" />
|
||||
<fn str="FLY_TO_RECT" />
|
||||
<gap_shot num="3" />
|
||||
<gap_group range="3:5" />
|
||||
<hello str="world" />
|
||||
|
||||
</task>
|
||||
|
||||
</driver>
|
||||
|
||||
|
||||
|
||||
<!-- INHERITANCE -->
|
||||
|
||||
<!--
|
||||
|
||||
Drivers can be extended, their tasks and checks overriden.
|
||||
|
||||
Replacing task does not need to define the "if" and "for", unless you want
|
||||
to replace their value with your own.
|
||||
|
||||
It's illegal to extend driver not defined yet. If your drivers are spread
|
||||
among multiple files, make sure they are properly ordered in the manifest file.
|
||||
|
||||
-->
|
||||
|
||||
<driver name="base_driver">
|
||||
|
||||
<!--
|
||||
"id" attribute of Task or Check contains an unique identifier of the task.
|
||||
"id" is not required, but in case you want to extend your driver it is neccesary.
|
||||
|
||||
Task with empty contents will be considered as abstract = do-nothing task.
|
||||
-->
|
||||
|
||||
<!-- here come some abstract tasks (will do nothing if not overriden) -->
|
||||
<check for="flag1" id="myCheck"></check>
|
||||
<task if="flag1" id="myTask"></task>
|
||||
|
||||
<!-- Rotate task, implemented here - but can be overriden too. -->
|
||||
<task id="rotateTask">
|
||||
<fn str="ROTATE" />
|
||||
<add num="-3" />
|
||||
</task>
|
||||
|
||||
</driver>
|
||||
|
||||
<!-- here is a driver extending "base_driver" -->
|
||||
<driver name="droid" extends="base_driver">
|
||||
|
||||
<!-- this task will replace entirely a task "myTask" from "base_driver" -->
|
||||
<!-- note that here we dont need to define the "if" condition - it's inherited. -->
|
||||
<task replace="myTask">
|
||||
<fn str="SHOOT" />
|
||||
<count range="1" />
|
||||
<gap_group range="3" />
|
||||
<gun num="0" />
|
||||
</task>
|
||||
|
||||
<!-- how to add new tasks -->
|
||||
|
||||
<!-- this task is added newly, and is placed right after "rotateTask" from "base_driver" -->
|
||||
<task id="steer" after="rotateTask">
|
||||
<!-- something here -->
|
||||
</task>
|
||||
|
||||
<!-- here we want to put this before "myCheck" -->
|
||||
<task id="aim" before="myCheck">
|
||||
<!-- something here -->
|
||||
</task>
|
||||
|
||||
<!-- note: before and after keywords work in all tasks, not only when extending -->
|
||||
|
||||
</driver>
|
||||
|
||||
|
||||
|
||||
<!-- LIST OF ALL TASKS AND CHECKS -->
|
||||
|
||||
<!-- Asterisk * indicates optional arguments. -->
|
||||
|
||||
<driver name="library">
|
||||
|
||||
<!-- Steer towards given coordinate -->
|
||||
<task>
|
||||
<fn str="FLY_TO_POINT" />
|
||||
|
||||
<target coord="0;0" /> <!-- the target coordinate; exact coord or magic word, eg. PLAYER_POS -->
|
||||
<weight num="1" /> <!-- * how fast to change direction (default 1) - can be float. -->
|
||||
|
||||
<!-- if you do not define "target", you can use these: -->
|
||||
<!-- target will be set to random coord in between, and preserved in memory -->
|
||||
<x range="-3:3" />
|
||||
<z range="5:10" />
|
||||
|
||||
</task>
|
||||
|
||||
|
||||
|
||||
<!-- Steer towards given rectangular zone -->
|
||||
<task>
|
||||
<fn str="FLY_TO_RECT" />
|
||||
|
||||
<x range="-3:3" /> <!-- The rectangular zone is defined by it's MIN and MAX coord - it is axis-aligned. -->
|
||||
<z range="5:10" />
|
||||
|
||||
<weight num="1" /> <!-- * how fast to change direction (default 1) - can be float. -->
|
||||
</task>
|
||||
|
||||
|
||||
|
||||
<!--
|
||||
Homming missile AI
|
||||
Locks to one particular enemy it selects, and then navigates to crash into it.
|
||||
Should be used together with AVOID task
|
||||
-->
|
||||
<task>
|
||||
<fn str="FOLLOW_TARGET" />
|
||||
|
||||
<target str="PLAYER,NATURAL" /> <!-- List of allowed targets (PLAYER, NATURAL, ENEMY, SHOT_GOOD, SHOT_BAD, POWERUP etc.) -->
|
||||
<range num="60" /> <!-- * radar radius - zone from which the targets can be chosen -->
|
||||
</task>
|
||||
|
||||
|
||||
|
||||
<!--
|
||||
Magnetic missile AI
|
||||
When gets close to a suitable enemy, flies towards it as if attracted by a magnet.
|
||||
-->
|
||||
<task>
|
||||
<fn str="MAGNET" />
|
||||
|
||||
<target str="PLAYER,NATURAL" /> <!-- List of allowed targets (PLAYER, NATURAL, ENEMY, SHOT_GOOD, SHOT_BAD, POWERUP etc.) -->
|
||||
<range num="15" /> <!-- * radar radius - zone from which the targets can be chosen -->
|
||||
<weight num="1" /> <!-- * how fast to change direction (default 1) - can be float. -->
|
||||
</task>
|
||||
|
||||
|
||||
|
||||
<!-- Avoid enemies and obstacles -->
|
||||
<task>
|
||||
<fn str="AVOID" />
|
||||
|
||||
<range num="3" /> <!-- * max distance of obstacle to notice it (counted from surface of collider) -->
|
||||
<weight num="1" /> <!-- * steering weight (default 1) -->
|
||||
<square bool="false" /> <!-- * if enabled, the strength grows with proximity by square -->
|
||||
<avoid str="NATURAL,SHOT_GOOD,SHOT_BAD,ENEMY" />
|
||||
</task>
|
||||
|
||||
|
||||
|
||||
<!-- Add angle to rotation -->
|
||||
<task>
|
||||
<fn str="ROTATE" />
|
||||
|
||||
<add num="3" /> <!-- degrees to add -->
|
||||
<random_dir bool="true" /> <!-- * direction is random (CW, CWW) - chosen when first run; default=false -->
|
||||
</task>
|
||||
|
||||
|
||||
|
||||
<!-- Rotate to direction -->
|
||||
<task>
|
||||
<fn str="TURN_TO" />
|
||||
|
||||
<dir coord="MOVE_DIR" /> <!-- vector X;Z, or "magic" keywords MOVE_DIR, PLAYER_DIR -->
|
||||
</task>
|
||||
|
||||
|
||||
|
||||
<!--
|
||||
Shoot a gun
|
||||
|
||||
This task allows two types of operation:
|
||||
X------X------X------X--- ...
|
||||
X-X-X------X-X-X------X-X-X--- ...
|
||||
(times are in seconds)
|
||||
-->
|
||||
<task>
|
||||
<fn str="SHOOT" />
|
||||
|
||||
<count num="3" /> <!-- number of shots in a group -->
|
||||
<gap_shot num="0.07" /> <!-- * gap between two shots in a group (optional if count=0) -->
|
||||
<gap_group num="3" /> <!-- gap between two groups -->
|
||||
|
||||
<gun num="0" /> <!-- * gun index, telling the drone which gun to fire -->
|
||||
</task>
|
||||
|
||||
|
||||
|
||||
<!-- Heal - in given interval adds health points to the drone's health meter -->
|
||||
<task>
|
||||
<fn str="HEAL" />
|
||||
|
||||
<gap num="1" /> <!-- gap (sec) betwen healings -->
|
||||
<add num="5" /> <!-- health points to add -->
|
||||
<percent bool="true" /> <!-- indicates that "heal" is in % of max health -->
|
||||
</task>
|
||||
|
||||
<!-- ### CHECKS ### -->
|
||||
|
||||
<!--
|
||||
Check: can shoot in direction?
|
||||
You can use this to make sure your shots won't hit an allied ship.
|
||||
-->
|
||||
<check for="x">
|
||||
<fn str="CAN_SHOOT" />
|
||||
|
||||
<spare str="ENEMY" /> <!-- list of entity types to spare (the allied entities) -->
|
||||
<gun num="0" /> <!-- * index of the gun probed -->
|
||||
</check>
|
||||
|
||||
|
||||
|
||||
<!-- Check: is drone in a rectangular zone? -->
|
||||
<check for="x">
|
||||
<fn str="IS_IN_RECT" />
|
||||
|
||||
<!-- The rectangular zone is defined by it's MIN and MAX coord - it is axis-aligned. -->
|
||||
<x range="-3:3" />
|
||||
<z range="5:10" />
|
||||
</check>
|
||||
|
||||
|
||||
|
||||
<!-- Check: is this ship a leader of the formation? -->
|
||||
<check for="x"/>
|
||||
<fn str="IS_LEADER" />
|
||||
</check>
|
||||
|
||||
|
||||
|
||||
<!-- Check: is this ship a tail = last ship of the formation? -->
|
||||
<check for="x"/>
|
||||
<fn str="IS_TAIL" />
|
||||
</check>
|
||||
|
||||
</driver>
|
||||
|
||||
<!-- that's all, now you can start inventing your own AIs! -->
|
||||
|
||||
</pack>
|
||||
@@ -0,0 +1,38 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
|
||||
<pack>
|
||||
<driver name="falcon" extends="basic_ship">
|
||||
|
||||
<check for="in_zone" id="ck1" after="can_fire">
|
||||
<fn str="IS_IN_RECT" />
|
||||
<x range="-20:20" />
|
||||
<z range="-5:45" />
|
||||
</check>
|
||||
|
||||
<task replace="fire" if="can_fire&in_zone">
|
||||
<fn str="SHOOT" />
|
||||
<count range="6:15" />
|
||||
<gap_shot num="0.07" />
|
||||
<gap_group range="2:4" />
|
||||
<gun num="0" />
|
||||
</task>
|
||||
|
||||
<task replace="fly">
|
||||
<fn str="FLY_TO_RECT" />
|
||||
<x range="-10-10" />
|
||||
<z range="25:40" />
|
||||
<weight num="10" />
|
||||
</task>
|
||||
|
||||
<task replace="turn" if="!in_zone">
|
||||
<fn str="TURN_TO" />
|
||||
<dir coord="MOVE_DIR" />
|
||||
</task>
|
||||
|
||||
<task after="turn" if="in_zone">
|
||||
<fn str="TURN_TO" />
|
||||
<dir coord="PLAYER_DIR" />
|
||||
</task>
|
||||
|
||||
</driver>
|
||||
</pack>
|
||||
@@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
|
||||
<pack>
|
||||
<driver name="fighter" extends="basic_ship">
|
||||
|
||||
<task replace="fly">
|
||||
<fn str="FLY_TO_POINT" />
|
||||
<target coord="PLAYER_POS" />
|
||||
</task>
|
||||
|
||||
<task replace="fire">
|
||||
<fn str="SHOOT" />
|
||||
<count num="1" />
|
||||
<gap_group num="3" />
|
||||
<gun num="0" />
|
||||
</task>
|
||||
|
||||
</driver>
|
||||
</pack>
|
||||
@@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
|
||||
<manifest>
|
||||
|
||||
<!-- This file indicates the loading order of all the sibling files. -->
|
||||
|
||||
<drivers>
|
||||
<file>base.xml</file>
|
||||
<file>burger.xml</file>
|
||||
<file>fighter.xml</file>
|
||||
<file>falcon.xml</file>
|
||||
<file>bird.xml</file>
|
||||
<file>shark.xml</file>
|
||||
<file>cube.xml</file>
|
||||
<file>powerup.xml</file>
|
||||
<file>mine.xml</file>
|
||||
</drivers>
|
||||
|
||||
</manifest>
|
||||
@@ -0,0 +1,15 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
|
||||
<pack>
|
||||
|
||||
<driver name="mine">
|
||||
|
||||
<task>
|
||||
<fn str="ROTATE" />
|
||||
<add num="3" />
|
||||
<random_dir bool="true" />
|
||||
</task>
|
||||
|
||||
</driver>
|
||||
|
||||
</pack>
|
||||
@@ -0,0 +1,78 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
|
||||
<pack>
|
||||
|
||||
<driver name="powerup_shield">
|
||||
|
||||
<check for="fly">
|
||||
<fn str="IS_IN_RECT" />
|
||||
<x range="-30;30" />
|
||||
<z range="0;100" />
|
||||
</check>
|
||||
|
||||
<task>
|
||||
<fn str="ROTATE" />
|
||||
<add num="3" />
|
||||
<random_dir bool="true" />
|
||||
</task>
|
||||
|
||||
<task if="fly">
|
||||
<fn str="FLY_TO_RECT" />
|
||||
<x range="-2;2" />
|
||||
<z range="3;6" />
|
||||
<weight num="0.5" />
|
||||
</task>
|
||||
|
||||
<task>
|
||||
<fn str="MAGNET" />
|
||||
<range num="5" />
|
||||
<weight num="0.3" />
|
||||
<target str="PLAYER" />
|
||||
</task>
|
||||
|
||||
<task>
|
||||
<fn str="AVOID" />
|
||||
<range num="3" />
|
||||
<weight num="0.2" />
|
||||
<avoid str="NATURAL,ENEMY,MINE" />
|
||||
</task>
|
||||
|
||||
</driver>
|
||||
|
||||
<driver name="powerup_artifact">
|
||||
|
||||
<check for="fly">
|
||||
<fn str="IS_IN_RECT" />
|
||||
<x range="-30;30" />
|
||||
<z range="0;100" />
|
||||
</check>
|
||||
|
||||
<task>
|
||||
<fn str="ROTATE" />
|
||||
<add num="2.5" />
|
||||
<random_dir bool="true" />
|
||||
</task>
|
||||
|
||||
<task if="fly">
|
||||
<fn str="FLY_TO_RECT" />
|
||||
<x range="-2;2" />
|
||||
<z range="3;8" />
|
||||
<weight num="0.5" />
|
||||
</task>
|
||||
|
||||
<task>
|
||||
<fn str="MAGNET" />
|
||||
<range num="20" />
|
||||
<weight num="0.6" />
|
||||
<target str="PLAYER" />
|
||||
</task>
|
||||
|
||||
<task>
|
||||
<fn str="AVOID" />
|
||||
<range num="3" />
|
||||
<weight num="0.2" />
|
||||
<avoid str="NATURAL,ENEMY,MINE" />
|
||||
</task>
|
||||
|
||||
</driver>
|
||||
</pack>
|
||||
@@ -0,0 +1,61 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
|
||||
<pack>
|
||||
<driver name="shark" extends="basic_ship">
|
||||
|
||||
<check for="in_zone1" id="ck1" after="can_fire">
|
||||
<fn str="IS_IN_RECT" />
|
||||
<x range="-20:20" />
|
||||
<z range="-5:60" />
|
||||
</check>
|
||||
|
||||
<check for="in_zone2" id="ck2" after="ck1">
|
||||
<fn str="IS_IN_RECT" />
|
||||
<x range="-20:20" />
|
||||
<z range="-5:80" />
|
||||
</check>
|
||||
|
||||
<task replace="fire" if="can_fire*in_zone1">
|
||||
<fn str="SHOOT" />
|
||||
<count range="4:8" />
|
||||
<bullets range="3:5" />
|
||||
<gap_group num="1.5" />
|
||||
<gap_shot num="0.02" />
|
||||
<gun num="0" /> <!--range="0-1" -->
|
||||
</task>
|
||||
|
||||
<task replace="avoid">
|
||||
<fn str="AVOID" />
|
||||
<avoid str="NATURAL,SHOT_GOOD,SHOT_BAD,ENEMY,MINE" />
|
||||
<weight num="1.7" />
|
||||
</task>
|
||||
|
||||
<task replace="fly">
|
||||
<fn str="FLY_TO_RECT" />
|
||||
<x range="-5-5" />
|
||||
<z range="18:34" />
|
||||
<weight num="30" />
|
||||
</task>
|
||||
|
||||
<task replace="turn" if="!in_zone1">
|
||||
<fn str="TURN_TO" />
|
||||
<dir coord="MOVE_DIR" />
|
||||
</task>
|
||||
|
||||
<task id="t1" after="turn" if="in_zone1">
|
||||
<fn str="TURN_TO" />
|
||||
<dir coord="PLAYER_DIR" />
|
||||
</task>
|
||||
|
||||
<!-- <TASK AFTER="T1" ID="T2" IF="IN_ZONE"> -->
|
||||
<!-- <FN STR="SET_SPEED"/> -->
|
||||
<!-- <SPEED NUM="0.5"/> -->
|
||||
<!-- </TASK> -->
|
||||
|
||||
<!-- <task after="t2" if="!in_zone"> -->
|
||||
<!-- <fn str="SET_SPEED"/> -->
|
||||
<!-- <speed num="1"/> -->
|
||||
<!-- </task> -->
|
||||
|
||||
</driver>
|
||||
</pack>
|
||||
Reference in New Issue
Block a user