-+-+-+-+-+-+-+-+ START OF PART 4 -+-+-+-+-+-+-+-+ X statistic('KICKOFF: ',2); X dir := not(dir); Xend; X Xprocedure handlerunback; Xbegin X old_where := where; X if (mestart) then begin X if ((where > 100) or (where < 0)) then begin X if (where > 100) then X where := 80 X else X where := 20; X restore(old_where); X place(where); X comment('TOUCHBACK!'); X end else begin X if (not(interception)) and (not(fumble)) then begin X comment('RUNBACK!'); X stat := rbbase + rnd(20); X end else if (fumble) then begin X stat := rnd(15); X end else if (interception) then begin X case (rnd(100)) of X 1..30 : stat := 0; X 31..70 : stat := rnd(20); X 71..100 : stat := rnd(100); X end; X end; X `20 X if (dir) then X where := where + stat X else X where := where - stat; X moveball(old_where,where); X statistic('RUNBACK: ',3); X X (* are we in end zone? *) X X if (((dir) and (where >= 100)) or (not(dir) and (where <= 0))) then X score := 7; X end; X sendplay; X receiveplay; X end else begin X receiveplay; X sendplay; X if ((where > 100) or (where < 0)) then begin X where := you.pos; X restore(old_where); X place(where); X comment('TOUCHBACK!'); X end else begin X if (not(interception)) and (not(fumble)) then comment('RUNBACK!'); X where := you.pos; X stat := you.gained; X score := you.score; X moveball(old_where, where); X stat := you.gained; X statistic('RUNBACK: ',3); X end; X end; X down := 1; X ydstogo := 10; Xend; X Xprocedure perform; Xbegin X timer(rnd(25)+20); X runplay; X if (interception) or (fumble) then handlerunback; X handlescore; X handletime; X handledown; X statcard; X if (not(gameover)) then begin X teamlight; X printscore; X end; X info(''); Xend; X Xprocedure kickoff; Xbegin X timer(10+rnd(10)); X comment('KICKOFF!'); X handlekickoff; X arrow; X handlerunback; X handletime; X statcard; X if (not(gameover)) then begin X teamlight; X printscore; X end; X info(''); Xend; X Xprocedure kick; Xbegin X timer(10+rnd(10)); X handlekick; X handlescore; `7B If score does not equal zero turnover happens here V `7D X handletime; X if (score = 0) then turnover; X statcard; X if (not(gameover)) then begin X teamlight; X printscore; X end; X info(''); Xend; X Xprocedure punt; Xbegin X timer(10+rnd(10)); X comment('PUNT!'); X handlepunt; X handlerunback; X handletime; X if (not(newhalf)) then turnover; X statcard; X if (not(gameover)) then begin X teamlight; X printscore; X end; X info(''); Xend; X Xbegin X $setpri(,,4,); X quarter := 1; X down := 1; X gtime := gametime; X ydstogo := 10; X initiate; X create_screen; X where := 35; X old_where := 35; X timer(0); X statcard; X repeat X score := 0; (* let's make sure no score will carry over! *) X interception := false; X fumble := false; X newhalf := false; X newquarter := false; X gameover := false; X if (dokickoff) then begin X lib$wait(2.0); X kickoff; X end; X if (mestart) then begin X repeat X menu_select(1,myform); X menu_select(2,myact); X if not offenformflags`5Bmyform, myact`5D then X message('You can''t choose that play in such formation! '); X until offenformflags`5Bmyform, myact`5D; X comment(' '); X sendplay; X receiveplay; X if (myact = op_punt) then X punt X else if (myact = op_kick) then X kick X else X perform; X end else begin X receiveplay; X info('Offensive formation: '); X info(of_table`5Byou.formation`5D); X repeat X menu_select(3,myform); X menu_select(4,myact); X if not defformflags`5Bmyform, myact`5D then X message('You can''t choose that play from that formation! '); X until defformflags`5Bmyform, myact`5D; X comment(' '); X sendplay; X info(''); X if (you.play = op_punt) then X punt X else if (you.play = op_kick) then X kick X else`20 X perform; X end; X until (gameover); X finitiate; X winner; Xend. X`7B X**************************************************************************** V**** X* `20 V * X* Program: MASLIB_FOOTBALL V * X* Co-Author: Xiaomu Zeng V * X* BITNET: MASWINDY@UBVMS V * X* Internet: maswindy@ubvms.cc.buffalo.edu V * X* Co-Author: William W. Brennessel V * X* BITNET: MASMUMMY@UBVMS V * X* Internet: masmummy@ubvms.cc.buffalo.edu V * X* `20 V * X* This program was created for personal use, and may be copied and altered V * X* under the condition that the authors are not responsible for any problem Vs * X* that may occur. Comments and criticisms are always welcome. V * X* `20 V * X**************************************************************************** V**** X`7D $ CALL UNPACK FOOTBALL.PAS;1 122011343 $ create 'f' X.facility football,1 X X.severity severe X ABSENT "Other player has not entered game within timeout period" X BADRECORD "Bad record left by other player - please reenter game" X BADUSER "Username does not exist in the rights database" X GHOSTED "Other player seems to have ghosted" X LONELY "Football should be played with someone other than yourself" X NOTSPAWN "Football must be run in a spawned process" X PLAYING "Other player is currently engaged in another game" X.end $ CALL UNPACK FOOTMSG.MSG;1 654703206 $ create 'f' X1 Hail_Brent XThis formation is designed to get any eligible receiver downfield and Xstretch the defense to an extreme. It consists of no runningbacks, and Xfive wide receivers on the line. X1 Fireball XThis formation consists of four wide receivers and a single runningback. XThis is commonly used for run and shoot situations. X1 Red_Gun XThe Red Gun has three wide receivers on the line, a single back in the Xbackfield, and a tight end for blocking and/or receiving. X1 Troll_Front XTwo tight ends line up on one side of the offensive line, either to Xblock for the runningback or to protect the quarterback. There are Xtwo wide receivers also on the line. X1 Hammer_Form XThree tight ends line up front and form a tough offensive line. There is Xone wide receiver and one runningback as well. X1 Led_Pipe XThis is the formation where the defense hopes they took some aspirin before Xplaying. There are four tight ends on the line and a runningback in the Xbackfield ready to punish anyone who stands in their way. Quarterbacks Xhave been also known to run screen pass from this formation with great Xsuccess. X1 Punt_Formation XThis formation serves to protect the punter so he may get the punt off. X1 Kick_Formation XThis formation serves to protect the kicker so he may get the kick off. $ CALL UNPACK OFORMS.HLP;1 673331777 $ create 'f' X1 PlayAction_Pass XThe quarterback fakes a handoff to the runningback, then drops back Xlooking for a pass downfield. A successful play is when the runningback Xdraws the linebackers away, giving the quarterback time to find his man. XThis play works well against run blitzes and reaction defenses. X1 PowerRun_Inside XThe quarterback hands the ball off to the runningback, who runs between Xthe tackles in search of daylight. Provided the offensive line blasts Xa hole in the defense, this play is good for short yardage situations. X1 Power_Sweep XThe offense moves as a unit towards the outside, forcing blocks that allow Xthe runningback to turn the corner and explode into the secondary. This Xplay works well against drop-back defenses, but can be stuffed by a good Xblitz. X1 Screen_Pass XLinemen release defenders while the quarterback dumps the pass off to the Xrunningback. Then the linemen proceed downfield to block for the back as Xhe scrambles his way into the secondary. This play is optimum offense Xagainst the blitz. X1 Deep_Pass XThe quarterback gets to test his strength and accuracy as he lobs the long Xbomb down the field. This is a difficult play due to the precision Xrequired for completion. X1 Crossing_Pass XThe receivers drop underneath the coverage and look to the quarterback for Xshort to medium yardage. The pattern takes time to develop, but is quite Xeffective against most pass coverages. However, the offensive line must Xmake sure the pass rush does not get to the quarterback first. X1 Counter_Gap XOne side of the offensive line pulls to the other side, overloading the Xline of scrimmage, and blasting a path for the runningback to move through. XThis play is very powerful against a balanced defensive front. However, Xan aggresive defensive play can cut this play short in the backfield. X1 Punt XThe punt is an excellent idea for 4th down situations outside of field Xgoal range, except when points are needed desperately. X1 Kick XThe kick is an attempt at the 3-point field goal. Be aware that distance Xcan affect the ball's chance of sailing through the uprights. $ CALL UNPACK OPLAYS.HLP;1 1040999443 $ create 'f' Xconst X puntbase = 35; X kickbase = 45; X fgbase = 30; X rbbase = 10; X boothfile = '$1$DUA12:`5BTEMP.MASMUMMY`5DFOOTBALL.BOOTH'; X helplib = '$1$DUA12:`5BTEMP.MASMUMMY`5DFOOTBALL.HLB'; X gametime = 1500; X Xtype X $word = `5BWORD`5D -32768..32767; X $byte = `5BBYTE`5D -128..127; X $uword = `5BWORD`5D 0..65535; X $uquad = `5BQUAD,UNSAFE`5D record X long_1 : unsigned; X long_2 : unsigned; X end; X unsafe_file = `5Bunsafe`5D file of char; X ptr_to_fab = `5Efab$type; X ptr_to_rab = `5Erab$type; X ident = packed array `5B1..12`5D of char; X varstr = varying `5B10`5D of char; X datetime = packed array `5B1..23`5D of char; X istring = varying `5B1024`5D of char; X fifstr = packed array `5B1..15`5D of char; X vartwe = varying `5B20`5D of char; X X players = record X userid : `5Bkey(0)`5D ident; `7B The username of the player `7D X pid : unsigned; `7B Process ID `7D X formation : integer; `7B The formation `7D X play : integer; `7B The play action `7D X count : integer; `7B Determines who is to receive informa Vtion `7D X time : integer; `7B Actual time in game `7D X pos : integer; `7B Absolute position on field (1-100) ` V7D X city : fifstr; `7B Team's city `7D X name : fifstr; `7B Team's name `7D X gained : integer; `7B Actual number of yards gained `7D X ydstogo : integer; `7B Yards to go for first down `7D X quarter : integer; `7B Quarter `7D X down : integer; `7B Down `7D X score : integer; `7B Score (non accumlative) `7D X dokickoff : boolean; `7B Do kickoff `7D X iswaiting : boolean; `7B If player is waiting for another `7D X first : boolean; `7B Who received first `7D X dir : boolean; `7B Direction of play on field `7D X intercepted : boolean; `7B Interception `7D X fumble : boolean; `7B Fumble `7D`20 X end; X X playlist = file of players; X Xvar X rmsstatus : unsigned := 1; X huddle : integer := 1; X ksz : $byte := 12; `7B All key sizes are 12 `7D X usz,rsz : $word := 92; `7B The recordsize of the playerfile `7D X ubf,kbf,rbf : $uword; X playfile : playlist; X me,you : players; X disp : array `5B1..10`5D of unsigned; X paste,keyb : unsigned; X alen : $uword; X playstr : vartwe; X i,j,k,l,old_where,where,who,xlen,stat,wait : integer := 0; X myform,myact,quarter,gtime,down,ydstogo,score : integer := 0; X myscore,yourscore : integer := 0; X dir,dokickoff,istarted : boolean := true; X gameover,newhalf,newquarter,mestart,fumble,interception, X passing, running : boolean := false; X football_ghosted,football_absent,football_playing, X football_badrecord,football_notspawn,football_lonely, X football_baduser : `5Bexternal`5D unsigned; X X X`5Bexternal`5D Xfunction pas$fab(var f : unsafe_file) : ptr_to_fab; extern; X X`5Bexternal`5D Xfunction pas$rab(var f : unsafe_file) : ptr_to_rab; extern; X Xfunction rms_open (var fab : fab$type; X var rab : rab$type; X var f : playlist) : unsigned; Xbegin X fab.fab$l_fop := fab$m_cif; X rab.rab$l_fab := iaddress(fab); X rmsstatus := $create(fab); X if (odd(rmsstatus)) then X rmsstatus := $connect(rab); X rms_open := rmsstatus; Xend; X Xfunction rms_put(var rab: rab$type) : unsigned; Xbegin X rab.rab$b_rac := rab$c_key; X rab.rab$b_tmo := 10; `7B timeout period of 10 seconds ` V7D X rab.rab$w_rsz := rsz; `7B record size `7D X rab.rab$l_rbf := rbf; `7B address of the record buffer ` V7D X rab.rab$l_rop := rab$m_tmo + rab$m_wat + rab$m_uif; X rms_put := $put(rab); `7B write the new record `7D Xend; X Xfunction rms_get(var rab: rab$type; lock: boolean) : unsigned; Xbegin X rab.rab$b_rac := rab$c_key; `7B keyed access `7D X rab.rab$b_ksz := ksz; `7B size of the key `7D X rab.rab$l_kbf := kbf; `7B address of the key buffer `7 VD X rab.rab$w_usz := usz; `7B size of the record `7D X rab.rab$b_tmo := 10; `7B timeout period of 10 seconds V `7D X rab.rab$l_ubf := ubf; `7B address of the record buffer V `7D X if (lock) then X rab.rab$l_rop := rab$m_tmo + rab$m_wat X else X rab.rab$l_rop := rab$m_tmo + rab$m_wat + rab$m_nlk; +-+-+-+-+-+-+-+- END OF PART 4 +-+-+-+-+-+-+-+-