-+-+-+-+-+-+-+-+ START OF PART 5 -+-+-+-+-+-+-+-+
X            update #3%\free #3%
X            pr::legal=1
X          else
X            m$="You are not authorized to respond from hyperspace, SCUM."
X          end if
X       else
X          if left$(m$,1)="r" or left$(m$,1)="R" then
X            m$="As you like it... You're doomed now."
X            t(i)::sintent=2
X            pr::legal=3
X          else
X            m$="Please Accept or Refuse boarding, this is your last chance."
X          end if
X       end if
X     end if
X     if pr::legal>2 then
X        m$="It's too late for words now, you're going to PAY with your life.
V."
X     end if
X     return
X
X
X
X     ! add a player to the current action file.  Note - this routine
X     ! returns with the action file locked (if rec found) An update on it sh
Vould
X     ! be done as soon as possible following return from this code.      `20
Xadd_player_to_action:
X     ! print "Adding player to action record"
X     new_action = 0
X     when error in
X       get #3%, key #0% eq name$(pr::planet), wait 60
X     use
X       if err=155 then
X         new_action = 1
X         ! no action record -> must create one`20
X         planetaction = name$(pr::planet)
X         for i=1 to maxships
X           t(i)::sintent=0\t(i)::player=0\t(i)::others(1)=0\t(i)::others(2)=
V0
X           t(i)::ship=0\t(i)::smissile = 0
X`09   t(i)::special=0
X         next i
X         noship = 0
X       else
X         continue 9000
X       end if
X     end when
X
X     i=next_ship
X     ! print "Adding into slot ";i
X     if i=200 then goto 9000 end if`09! action file capacity exceeded
X     if i > noship then
X       noship = i
X     end if
X     pr::shipnum = i
X     ! add record
X     t(i)::username=pr::username\t(i)::senergy=pr::energy
X     t(i)::smissile=pr::equip(13)\t(i)::sintent=0
X     t(i)::spos=pr::rpos\t(i)::player=2\t(i)::others(1)=0
X     t(i)::others(2)=0
X     t(i)::ship=pr::shiptype
X     ! cargo carried    cargo(1) is # of item, cargo(2) is amount
X     t(i)::cargo(1)=0\t(i)::cargo(2)=0
X     for a1=1 to ntcargo`09`09! determine primary cargo
X       if pr::cargo(a1)>t(i)::cargo(1) then
X         t(i)::cargo(1)=a1
X         t(i)::cargo(2)=pr::cargo(a1)
X       end if
X     next a1
X
X     ! far away thargs appear when someone jumps into a WZ.
X     if (pt::zone=1) and noship<140 then
X       b=int(pr::thargoid*rnd+3)
X     else`20
X       b=0
X     end if
X     where = int (50+50*rnd)
X     for a1=1 to b
X       if noship<150 then
X         noship=noship+1
X         t(noship)::ship=9
X         t(noship)::spos=int(5*rnd + where)
X         shipno=noship
X         gosub 3100
X         t(noship)::senergy=s(9)::menergy
X         t(noship)::smissile=s(9)::mmissile
X         t(noship)::username="TH"+str$(int(noship))
X       end if
X     next a1    `20
X     return
X    `20
Xdelete_player_from_action:
X     when error in
X       get #3, key #0% eq name$(oldplanet), wait 60
X     use
X       if err=155 then
X         ! print "Not in an old action record."
X`09 continue done_delete ! action record has disappeared
X       else
X       `09 continue 9000`09`09! can't handle error
X       end if
X     end when    `20
X     ! print "Deleted from old action record"
X     keep=0                     ! set keep if someone else there
X     for i=1 to maxships
X       if t(i)::player<>0 and t(i)::username<>pr::username then keep=1
X       end if
X       if t(i)::username=pr::username and (t(i)::player=1 or &
X`09`09`09`09`09  t(i)::player=2) then
X          t(i)::ship=-1
X`09  t(i)::sintent=-1
X          t(i)::username="GONE"
X          t(i)::player=0
X       end if
X     next i
X     if keep=1 then`09`09! save action record (other player present)
X       ! print "Saving the old action record"
X       update #3%
X       free #3%
X     else`09`09`09! trash action record
X       ! print "Trashing the old action record - no one else there."
X       delete #3%
X       free #3%
X     end if
Xdone_delete:
X     return
X`20
X1700 ! -------------------- Display Status Line ---------------
X     dpos=pr::rpos*2000\ddir=pr::direction\denergy=pr::energy\dfuel=pr::fuel
X     dmissiles=pr::equip(13)\dcredits=pr::credits\call display(3,)
X     cloak=pr::cloak\ lsj = pr::lsj\ecm = ecm_status%
X     return
X`20
X1800 ! ------------------------- Bank ---------------------------
X     if scanner_on=1 then call display(12,) end if
X     call display(4,)
X     if pt::tech<3 then
X        a$= "Banking facilities not available on "+edit$(pt::pname,128%)+"."
X        call display(23,a$)
X        return
X     end if
X     if revived$="OK" then
X`09a$= "The Bank is temporarily closed for restructuring."
X        call display(23,a$)
X`09return
X     end if
X`09call display(4,)
X        a$= "Welcome to the local branch of the Galactic Bank."
X`09call display(24,a$)
X        call display(24,"")
X        a$= "1) Request a Loan."
X`09call display(24,a$)
X        a$= "2) Repay a Loan."
X`09call display(24,a$)
X        a$= "3) ComLink credits transfer."
X`09call display(24,a$)
X        a$="Select option (0 to exit.)"
X`09call display(23,a$)`09
X1810    a$="OPTION> "
X        call display(1,a$)\a=val(a$)
X        select a
X          case 1
X`09    if loan_reject=1 then
X`09      a$= "You've already been rejected.  Get Out!"
X              call display(23,a$)
X`09      goto 1810
X`09    end if
X            a$="Enter amount to borrow> "\call display(1,a$)\a=val(a$)
X`09    if a<=0 then
X`09`09call display(33,"Cancelled.")
X`09`09goto 1810`20
X`09    end if
X`09    if a+int(a/2*rnd)>pr::credits*2 then goto reject end if
X`09    if pr::legal<>1 then goto reject end if
X`09    if pr::escapes>50 then goto reject end if
X`09    if pr::debt>0 then goto reject end if
X`09    pr::interest=20+int(10*rnd)
X`09    a$= "Congratulations - Your loan request has been approved."
X            call display(23,a$)
X`09    a$= "You are hereby loaned "+str$(a)+&
X`09`09" credits at a per jump interest"
X            call display(23,a$)
X`09    a$= "rate of "+str$(pr::interest)+ &
X`09`09"%.  The principal and interest are"
X            call display(23,a$)
X`09    a$= "due after 5 jumps."
X            call display(23,a$)
X`09    pr::due=pr::moves+5
X`09    pr::credits=pr::credits+a
X`09    gosub 1700
X`09    pr::debt=a
X`09    loan_reject = 1
X`09    goto 1810
Xreject:`09    a$= "We regret to inform you that we cannot approve your loan.
V"
X            call display(23,a$)
X`09    loan_reject=1
X`09  case 2
X`09    a$= "You owe "+str$(pr::debt)+" due in "+str$(pr::due-pr::moves)+ &
X`09`09" jumps."
X            call display(23,a$)
X`09    a$="Enter amount to repay> "\call display(1,a$)\a=val(a$)
X`09    if a<=0 or pr::credits-a < 0 then`20
X`09`09call display(33,"Cancelled.")
X`09`09goto 1810`20
X`09    end if
X`09    pr::credits=pr::credits-a
X`09    gosub 1700
X`09    pr::debt=pr::debt-a
X`09    a$= "Thank you for your payment."
X            call display(23,a$)
X`09    if pr::debt<0 then pr::debt=0 end if
X          case 3
X            if pr::moves<5 and super_user_mode%=0 then
X`09      a$= "As a new trader, you are not authorized to transfer credits."
X              call display(23,a$)
X            else
X`09      u$ = "Enter beneficiary of transfer> "
X              call display(1,u$)
X              u$=edit$(u$,32%)
X              if u$ = "" then
X`09        goto 1810
X`09      end if
X`09      if valid_id(u$) = 0 then
X`09        goto 1810
X              end if
X              a$= "Enter amount to be sent> "
X              call display(1,a$)
X              a=val(a$)
X              if a<0 or a>pr::credits-pr::debt then
X                call display(33,"Invalid amount.")
X                goto 1810
X              end if
X`09      if a>1000000 then
X`09`09call display(33,"Credit Transaction cannot be performed without Federa
Vtion approval.")
X`09`09goto 1810
X`09      end if
X              pr::credits=pr::credits-a
X              get #2%, key #0% eq pr::username, wait 60
X`09      op::credits=pr::credits
X              update #2%\free #2%
X              gosub 1700
X              sender$=pr::username
X              m$="%%mo"+u$+str$(int(a*9/10))+"."
X              a$= "Sending... Transaction charges: "+str$(int(a*1/10))
X              call display(23,a$)
X              gosub send_message
X            end if
X          case 0
X            goto 1850
X       end select
X     goto 1810
X1850 if scanner_on=1 then
X        new_smg=1
X        gosub 3000
X     end if
X     return
X
Xinit_equipment:
X     factor=1-(pt::tech*2)/100+(10-pt::population)/20
X     fuelprice=int(5-pt::tech/2+int(2*rnd))
X     for i=1 to 24
X       e(i)::eprice=-1
X     next i
X     if pt::tech>8 then
X       e(16)::eprice=int(15000*factor+2000*rnd)
X       e(23)::eprice=int(6000*factor+1000*rnd)
X       e(14)::eprice=int(60000*factor+6000*rnd)
X       e(18)::eprice=int(18000*factor+3000*rnd)
X     end if
X     if pt::tech=10 then
X       e(19)::eprice=int(40000*factor+2000*rnd)
X       e(15)::eprice=int(70000*factor+5000*rnd)
X       if rnd>.98 then e(22)::eprice=int(50000*factor+5000*rnd) end if
X     end if
X     if pt::tech>7 then
X       e(5)::eprice=int(8000*factor+1000*rnd)
X       e(6)::eprice=int(8000*factor+1000*rnd)
X       e(9)::eprice=int(5000*factor+500*rnd)
X       e(12)::eprice=800*factor
X       e(24)::eprice=int(4000*factor+1000*rnd)
X     end if
X     if pt::tech>3 then
X       e(3)::eprice=int(4000*factor+500*rnd)
X       e(4)::eprice=int(4000*factor+500*rnd)
X       e(7)::eprice=int(2000*factor+200*rnd)+int(1500+1000*rnd)*pr::escapes
X       e(11)::eprice=int(5000*factor+200*rnd)
X     end if
X     e(1)::eprice=int(500*factor+100*rnd)
X     e(2)::eprice=int(500*factor+100*rnd)
X     e(8)::eprice=int(800*factor+200*rnd)
X     e(10)::eprice=int(700*factor+100*rnd)
X     e(13)::eprice=50
X     shipsale=pt::tech+pt::population
X     for i=1 to ntships
X       s(i)::soldhere=0
X       if ((shipsale*rnd*rnd)>=s(i)::rarity) and (s(i)::rarity<9) then
X         s(i)::soldhere=1
X       end if
X       if i=9 and pt::zone<>4 then s(i)::soldhere=0 end if
X       if pt::zone=1 and i=12 and rnd>.5 then s(i)::soldhere=1 end if
X       s(i)::neg_cost = s(i)::cost
X       s(i)::temperature = -1
X     next i
X     return
X
X1900 ! ---------------------- Initialize Planet -------------------
X     gosub init_equipment
X     for i=1 to 10
X        c(i)::pprice=int(c(i)::tprice*(.7+rnd/2))
X        if pt::tech<c(i)::ttech then
X          c(i)::qtrade=-1
X        else
X          c(i)::qtrade=pt::population*10+int(50*rnd)
X        end if
X        if pt::zone=1 and c(i)::qtrade<>-1 then c(i)::qtrade=c(i)::qtrade*2+
V &
X           int(100*rnd)
X        end if
X        if pt::zone=4 and c(i)::qtrade<>-1 then c(i)::qtrade=c(i)::qtrade*3
X`09end if
X        if pt::zone=2 and c(i)::qtrade<>-1 then c(i)::qtrade=c(i)::qtrade+ &
X           int(30*rnd)
X`09end if
X      next i
X`20
X      if pt::trade=1 then c(1)::qtrade=c(1)::qtrade+50+ &
X         int(10*pt::population*rnd)
X      end if
X      if pt::trade=1 then c(9)::pprice=c(9)::pprice+int(10*rnd) end if
X      if pt::trade=3 then c(9)::pprice=c(9)::pprice-int(10*rnd) end if
X      if pt::trade=3 then c(9)::qtrade=c(9)::qtrade+int(50*rnd) end if
X      if pt::trade=5 then c(6)::pprice=c(6)::pprice+int(20*rnd) end if
X      if pt::tech>8 then c(8)::pprice=c(8)::pprice-int(15*rnd) end if
X      if pt::government=10 or pt::government=5 then c(7)::pprice= &
X         int(c(7)::pprice/2)
X      end if
X      if pt::population>7 then c(1)::pprice=c(1)::pprice+int(2*rnd+1) end if
X      if pt::tech<5 then c(6)::pprice=c(6)::pprice-int(10*rnd+5) end if
X      if pt::tech<5 then c(7)::pprice=c(7)::pprice-int(20*rnd) end if
X      if pt::tech>8 then c(7)::pprice=c(7)::pprice+int(50*rnd+10) end if
X      if pt::trade=10 then c(4)::pprice=int(c(4)::pprice/2) end if
X      if pt::tech>6 then c(5)::pprice=c(5)::pprice+int(10*rnd+6) end if
X      if pt::tech<4 then c(3)::pprice=c(3)::pprice-int(5*rnd+1) end if
X      if pt::law<5 then c(2)::pprice=c(2)::pprice+int(10*rnd+10) end if
X      if pt::trade<5 then c(1)::pprice=c(1)::pprice+int(2*rnd) end if
X      if pt::trade=2 then c(1)::pprice=c(1)::pprice+int(2*rnd) end if
X      if (pt::trade=6 and (c(2)::pprice>0)) then c(2)::pprice=c(2)::pprice-
V &
X         int(3*rnd)
X      end if
X      c(10)::pprice=int(50*rnd+50)
X      if c(3)::pprice=0 then c(3)::pprice=1 end if
X      if pt::zone=1 then
X        c(8)::pprice=c(8)::pprice*2+int(70*rnd+20)
X        c(9)::pprice=c(9)::pprice*3
X        c(6)::pprice=c(6)::pprice-int(60*rnd+50)
X      end if
X      ! set  base prices to initial current prices
X      for i=1 to ntcargo
X        c(i)::bprice = c(i)::pprice
X      next i
X      if pt::zone=4 then c(7)::pprice=int(c(7)::pprice/2) end if
X      if pt::zone=3 then c(10)::pprice=c(10)::pprice-int(10*rnd+5) end if
X      return
X`20
X2000 ! --------------------------------------------------------------
X     !                      Create New Galaxy
X     ! --------------------------------------------------------------
X     print "Please wait while I set off the Big Bang..."
X     close #1%
X     close #3%
X     when error in
X       kill "gal_disk:gal-planets2.dat"
X       kill "gal_disk:gal-action3.dat"
X       open "gal_disk:gal-planets2.dat" as file #1%, organization indexed fi
Vxed, &
X          allow modify, access modify, primary key pt::pname duplicates, &
X          map planetmap, contiguous, filesize 100
X       open "gal_disk:gal-action3.dat" as file #3%, organization indexed fix
Ved, &
X          allow modify, access modify, primary key planetaction, &
X          map actionmap, contiguous, filesize 100, extendsize 50
X     use
X       print "Insufficient Priv to initiate Big Bang - See your Game Manager
V."
X       continue 10000
X     end when
X     restore #1%
X     ! loop in which galaxy initialized
X     numplanets = 100      ! 100 planets standard galaxy size
X2030 for i=1 to numplanets
X        pt::pname=edit$(pnamegen(""),32%)
X        pt::zone=int(10*rnd+1)
X        pt::xp=int(60*rnd+1)+int(20*rnd+1)-40
X        if sqr(pt::xp`5E2+pt::yp`5E2)<5 then pt::zone=5
X        end if
X        pt::population=int(10*rnd+1)
X        if pt::zone=1 then pt::government=int(3*rnd)+8
X        end if
X        if pt::zone=2 then pt::government=int(4*rnd)+5
X        end if
X        if pt::zone=3 then
X           pt::government=int(10*rnd+1)
+-+-+-+-+-+-+-+-  END  OF PART 5 +-+-+-+-+-+-+-+-
