|
|
DataMuseum.dkPresents historical artifacts from the history of: DKUUG/EUUG Conference tapes |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about DKUUG/EUUG Conference tapes Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - downloadIndex: T f
Length: 3878 (0xf26)
Types: TextFile
Names: »fighmv.f«
└─⟦b20c6495f⟧ Bits:30007238 EUUGD18: Wien-båndet, efterår 1987
└─⟦this⟧ »EUUGD18/General/Empire/fighmv.f«
subroutine fighmv
c
c This subroutine handles player's fighter moves
c
IMPLICIT INTEGER(A-Z)
include 'common.h'
C
logical fatal
do 2100 y = 1, limit ( 2 )
loc = 500 + y
if (movedflag(loc).ne.0) goto 2100
z6=rlmap(loc)
if (z6.eq.0) goto 2100
if ((mode.eq.1).and.(poschk(z6,'F').eq.0)) goto 2100
movedflag(loc)=1
z3=min(range(y),4)
if (z3.eq.0) z3=4
do 1900 iturn=1,z3
loc=500+y
z6=rlmap(loc)
if (z6.eq.0) goto 2100
ab=rmap(z6)
c
c Now check to see if fighter is in a city, if it is change the
c stasis number of the fighter to that specified by fipath(i)
c
if ( ab .ne. 'O' ) goto 300
comment if fighter not in city
do 100 i = 1, 70
100 if ( x ( i ) .eq. z6 ) goto 200
comment find city at z6
200 mycode(loc)=fipath(i)
comment change statis of fighter
c
c Check for fighters destroyed along with carrier or city
c
300 if ((ab.eq.'C').or.(ab.eq.'F').or.(ab.eq.'O')) goto 400
ptr = 0
call addstr ( 'Fighter # ', jnkbuf, ptr )
call addint ( y, jnkbuf, ptr )
call addstr ( ' destroyed', jnkbuf, ptr )
jnkbuf ( ptr + 1 ) = '\0'
call topmsg ( 3, jnkbuf )
call cflush
call delay(30)
goto 1700
400 z7 = z6
call stasis ( z6, loc )
500 if ( range ( y ) .ne. 0 ) goto 600
comment check for fuel
call head ( 'F', y, loc, z6, 1 )
call topmsg ( 3, 'Ran out of fuel and crashed' )
call cflush
call delay(30)
if (( ab .ne. 'C').and.(omap(z6).ne.'*')) rmap(z6)=omap(z6)
goto 1700
600 mycod=mycode(loc)
comment get my function code
if (mycod.eq.0) goto 1100
comment none, skip ahead
if ((mycod.lt.101).or.(mycod.gt.6108)) goto 1300
if (mycod.le.6000) goto 700
if (mycod.gt.6100) goto 800
goto 1300
700 z6=z6+iarrow(mov(z6,mycod)+1)
comment destination function
if ((range(y).eq.10).and.(idist(z6,mycod).le.10)) goto 902
goto 900
800 z6=z6+iarrow(mycod-6100+1)
comment directional functions
900 if (range(y).eq.10) goto 1000
902 if (order(z6).ne.0) goto 1000
ad=rmap(z6)
comment check new location
if ((ad.eq.'C').or.(ad.eq.'O')) goto 1300
if ((ad.eq.'+').or.(ad.eq.'.')) goto 1300
1000 z6=z7
1100 call sector(pmap(1))
call ltr(z6,iturn)
1200 call mve('F',mdate,y,loc,1,z6,z7,disas,z6-iadjst)
if (disas.eq.-2) goto 500
c
c Move evaluation
c
1300 ac=rmap(z6)
ao=omap(z6)
if (z6.eq.mycode(loc)) mycode(loc)=0
comment arrived at destination
if ((ac.ne.'O').and.(ac.ne.'C')) range(y)=range(y)-1
if (z7.eq.z6) goto 2000
comment didnt go anywhere, end move
if ((ab.ne.'C').and.(omap(z7).ne.'*')) rmap(z7)=omap(z7)
comment change prev loc
if (ao.eq.'*') goto 1400
comment check on cities
if (ac.eq.'C') goto 1500
comment landing on a carrier
if ((ac .ne. '.') .and. (ac .ne. '+')) goto 1800
comment attack any other units
rmap ( z6 ) = 'F'
comment normal move
rlmap ( loc ) = z6
goto 1900
1400 if (ac.ne.'O') goto 1600
comment is it my city?
1500 continue
comment landed in a city or carrier
if (mycode(loc) .ne. 0) goto 1313
call topmsg ( 3, 'Landing confirmed' )
call cflush
call delay(30)
1313 continue
mycode ( loc ) = 0
comment zero my function
rlmap(loc)=z6
range(y)=20
goto 2000
1600 if (.not.fatal(3)) goto 2200
comment ask about flying over enemy city
call topmsg ( 3, 'Fighter shot down' )
call cflush
call delay(30)
1700 rlmap ( loc ) = 0
goto 2000
c
c Attacking a unit
c
1800 if ((ac .lt. 'A') .or. (ac .gt. 'T')) goto 1314
if (.not.fatal(2)) goto 2200
1314 continue
h1=1
own1='F'
own2=ac
h2=30
call find(own2,z6,z8,h2)
call fght(z6,h1,h2,own1,own2)
call find(own2,z6,z8,h2)
if (h1.le.0) goto 1700
rmap(z6)='F'
rlmap(loc)=z6
if ((own2.ge.'a').and.(own2.le.'t')) call sonar(z6)
1900 call sensor(z6)
comment bottom of per turn loop
2000 call sensor(z6)
comment bottom of per unit loop
2100 continue
return
c
c Recover from fatal move
c
2200 z6 = z7
comment go back to old location
rmap(z6) = ab
comment restore map to previous
range(y) = range(y)+1
comment get your fuel back
goto 1200
end