The Gameplay Rountines -- Sasanka Chalivendra


AllDone PROC NEAR
;author: Sasanka Chalivendra
;inputs: players
;outputs: gamedone
;purpose: to see if everyone else except the humans are dead

 


GetAttackers PROC NEAR
;author: Sasanka Chalivendra
;inputs: ax = x position
; bx = y position
;outputs: cl = number of players attacking (ax,bx)
;
;purpose: to determine if someone is attacking a square

 


UpdateMe PROC NEAR
;author: Sasanka Chalivendra
;inputs: My_num, My_x, My_y, My_angle, firing, att_x, att_y
;ouputs: players array
;purpose: update my information in the player array

 

ComputeDamage PROC NEAR
;author: Sasanka Chalivendra
;inputs: players
;outputs: players
;purpose: compute combat damage and adjust life totals

 

 

UninstTimer PROC NEAR
;author: Sasanka Chalivendra
;outputs: none
;purpose: restores the dos handler for keyboard
; save registers

 

instTimer PROC NEAR
; author: Sasanka Chalivendra
; inputs: none
; outputs: oldTimer
; purpose: install my Timer Handler
instTimer ENDP

 

TimerHandler PROC FAR
;author: Sasanka Chalivendra
;inputs: UseOld
;outputs: TimeOver
;purpose: a timer for 1/36 of a sec
TimerHandler ENDP

 

KbdInstall PROC NEAR
;author: Sasanka Chalivendra
;inputs: none
;outputs: oldKbdV
;purpose: to install my Keyboard Handler
KbdInstall ENDP

 

KbdUnInstall PROC NEAR
;author: Sasanka Chalivendra
;inputs: oldKbdV
;outputs: none
;purpose: restore the orignal DOS handler
KbdUnInstall ENDP

 

KbdHandler PROC FAR
;author: Sasanka Chalivendra
;inputs: none
;outputs: Pause_flag, Key_flags
;purpose: read key presses from the keyboard and
; process them
KbdHandler ENDP


CheckSquare PROC NEAR
;author: Sasanka Chalivendra
;inputs: ax = x position; bx = y position
;outputs: cf = 1 if square unoccupied, cf = 0 for occupied
; di = id if square occupied by another char or player else di =0
;purpose: To check if a square is already being occupied
CheckSquare ENDP

 

ProcessCommand PROC NEAR
;author: Sasanka Chalivendra
;inputs: Ddx, Ddy, Dangle, in_reverse, firing
;oupts: My_x, My_y, My_angle, att_x, att_y, My_life
;purpse: processes the commands from keyboard
; and computes combat damage
ProcessCommand ENDP

 

CalcCommand PROC NEAR
;author: Sasanka Chalivendra
;inputs: Flags_copy
;ouputs: Ddx, Ddy, Dangle, in_reverse, firing
;purpose: Calculate how the players changes
; their positon and angle by
; looking at the keys pressed
CalcCommand ENDP

 

CheckCloseness PROC NEAR
;author: Sasanka Chalivendra
;inputs: ax = x coordinate bx = y coordinate
;outputs: carry flag set if square are far enough apart, CF=0 otherwise
;purpse: to make sure no one gets too close to each other
CheckCloseness ENDP

 

NewPlayer PROC NEAR
;author: Sasanka Chalivendra
;inputs: al = index to make player at
; ah = type of new player
;outputs: player array
; carry flag set if error
;purpose: make a new player at default location
NewPlayer ENDP

 

InitPlayers PROC NEAR
;author: Sasanka Chalivendra
;inputs: none
;outputs: Players array
;purpose: initalize all the players
InitPlayers ENDP

 

UpdateMap PROC NEAR
;author: Sasanka Chalivendra
;inputs: players
;outputs: World2
;purpose: To save changes in the World array
; which is the interface to the graphics
UpdateMap ENDP

 

DebugMap PROC NEAR
;author: Sasanka Chalivendra
;purpose: debug ...
DebugMap ENDP