home *** CD-ROM | disk | FTP | other *** search
- 0 constant ENEMTYPE ( 0=normal 1=erratic flying 2=smooth flying )
- 0 constant ENEMRANGE ( 0=max attack range, 7=only when touching player )
-
- robodata mxrobo b/robo * -1 fill ( clear data to zeros )
-
- : waitthenhunt
- begin
- 10 sentryorhunt
- 0 until ;
-
- : randompatrol
- begin
- 2 randomwalk
- intflag robostat@ if -1 huntflag robostat! trackdown then
- 0 until ;
-
- : staystanding
- begin
- 10 standandshoot
- 0 until
- ;
-
- ' waitthenhunt constant 'nopatrol
- ' randompatrol constant 'randompatrol
- ' staystanding constant 'staystanding
-
- ( 0 constant rbqk ( quickness of a robot )
- ( 1 constant rbt1 ( temporary storage spot )
- ( 2 constant rbsp ( speed of a robot )
- ( 6 constant rbht ( mx hit pts *256 + current hit points )
- ( 7 constant rbgn ( gun strength* 256 + gun skill )
- ( 8 constant rbql ( unused * 256 + quality of guard in general )
- ( 9 constant rbal ( current alertness of guard * 256 with fractional part )
-
- ( [orders#] -- [] Sets a guards orders to 0=sentry then hunt )
- ( 1=random patrol then hunt )
- ( 2=stand and shoot w/o walking )
- : getorders ?dup if
- 1 = if 'randompatrol else 'staystanding then
- else 'nopatrol
- then rstrt robo[]! ;
-
- ( [quickness value] -- [] set this guard's quickness to value 1 thru 6 )
- : setspeed 1 max 6 min 256 * rbtmp robo[]! ;
-
- ( [hitpts] -- [] Set this guard's hitpts to value 1 through 63 )
- : sethitpts 1 max 63 min 256 * rbht rbparm! ;
-
- ( [gun skill] [gun strength] -- [] Set guard's gun power and accuracy )
- ( !!!!!!!!! note this word takes *2* values! )
- : setgun 1 max 31 min 256 * + rbgn rbparm! ;
-
- ( [alertness value] -- [] Set this guard's initial alertness value 10-127 )
- : setalert 10 max 127 min 256 * rbal rbparm! ;
-
- ( [quality] -- [] Set the guard's quality to value from 0 thru 3 )
- ( !!!!!! strange: 0=dumb 1=avg 2=great 3=vegetable )
- : setqual 0 max 3 min rbql rbparm@ $ff00 and or rbql rbparm! ;
-
- ( [rangecode] -- [] Set the guard's attack range to value from 0 thru 7 )
- ( 0=max range, 7 = only when touching player )
- : setrange 0 max 7 min 8 << rbql rbparm@ $ff and or rbql rbparm! ;
-
- : setdefaults
- 'nopatrol rstrt robo[]!
- ENEMTYPE rbtyp rbparm!
- ENEMRANGE setrange
- 3 256 * rbtmp robo[]!
- 0 rbt1 rbparm!
- 230 rbtmp 4 + robo[]!
- 4 256 * rbht rbparm!
- 64 256 * 16 + rbgn rbparm!
- 0 setqual
- 50 256 * 0 + rbal rbparm!
- ;
-
- ( [guard#] -- [] Make this guard# the current guard for setting params )
- : setguard# b/robo * curoboff !
- setdefaults ;
-