home *** CD-ROM | disk | FTP | other *** search
- #include "tank.def.v"
-
- vehicle tank {
- instance tank
- offset 1300 920 0
- /* offset -20 -20 0 */
-
- brain {
- state 0 { /* looking for a target */
- action left
- link 1 { threatfar }
- }
- state 1 { /* found a target, go for it */
- action accel
- action shoot
- link 2 { collision }
- link 0 { !threatfar }
- }
- state 2 { /* almost hit something */
- action starttimer
- action stop
- link 4 { always }
- }
- state 4 { /* back off */
- action decel
- /* link 5 { collision } */
- link 6 { !counting }
- }
- state 5 { /* hit something while backing off */
- action stop
- link 0 { always }
- }
- state 6 { /* drive around a bit */
- action stop
- action starttimer
- link 7 { always }
- }
- state 7 {
- action accel
- link 0 { !counting }
- link 8 { maybe } /* pick one of 8 or 9 */
- link 9 { always }
- }
- state 8 {
- action left
- link 7 { always }
- }
- state 9 {
- action right
- link 7 { always }
- }
- }
- #if 0
- brain {
- state 0 { /* accel a bit */
- action accel
- link 1 { always }
- }
- state 1 { /* looking */
- action left
- link 0 { !moving }
- link 3 { underfire }
- link 2 { threatfar !ammolow }
- }
- state 2 { /* got target! */
- action shoot
- action accel
- link 3 { underfire }
- link 1 { !threatfar }
- }
- state 3 { /* starting to run */
- action starttimer
- link 4 { always }
- }
- state 4 { /* running */
- action accel
- link 1 { !counting }
- }
- }
- #endif
- }
-
-