I don't know if anyone would want to see it, but here is the punchout script that I have written up for Fabulous Las Vegas. If I remember correctly it is fully functional. It's pretty long and a little convoluted, I am sure that I could write one now that is much more streamlined and probably will make something to go along with sci1.1 which obviously, this is not. Looking at the date modified of the script file, this was last touched in 2006
/******************************************************************************/
// Punchout Version .21 //
/******************************************************************************/
// The Scripting for this interface is wholey based off of Pikachus cheap ass //
// battle mode. The graphics are intended to resemble Nintendo's 1987 release //
// Mike Tyson's Punchout. At this point several essentials seem to be semi- //
// present. Punch, Block, Dodge is functioning for both computer and player. //
// Three knockdowns per round as well as being saved by bell are functionning //
// along with the clicking of a standup button to get up from a knockdown. //
// There are three rounds each lasting approximately three minutes. //
// Both computer and player get back health after a knockdown and between //
// rounds, 5 after first knockdown, 2 after second and 5 between the rounds //
/******************************************************************************/
(include "sci.sh")(include "game.sh") (script 675)
/******************************************************************************/
(use "main")(use "controls")(use "cycle")(use "game")(use "obj")(use "inv")(use "feature")
//****************************************************************************//
// Create necesary local variables //
//****************************************************************************//
(local
started_up = FALSE // used solely to change cursor upon loading - see doit method
fights_won // used to determine opponent
PauseFight = TRUE // stop doit controls to allow changestate room to run
EnemyDown = FALSE // Is the computer knocked down
EnemyKnockedout = 0 // number of times computer has been knocked down per round
PlayerDown = FALSE // Is the player knocked down
PlayerKnockedout = 0 // number of times player has been knocked down per round
gettingUp // keeps track of clicks on stand button
PlayerState // Determines state of Action of player ie punch,block,etc
EnemyState // Determines state of Action of computer ie punch,block,etc
PlayerTimer // measures time of attacks,blocks,etc of player
PlayerAttack = 4 // the number of cycles it takes for a player attack to rach computer
PlayerHurt = 4 // the number of cycles player is reeling for
PlayerDodge = 4 // the number of cycles player is dodging for
PlayerBlock = 4 // the number of cycles player is blocking for
PlayerMissed = 4 // the number of cycles player is missing for
EnemyAttack = 6 // the number of cycles it takes for a computer attack to rach player
EnemyHurt = 4 // the number of cycles computer is reeling for
EnemyDodge = 4 // the number of cycles computer is dodging for
EnemyBlock = 4 // the number of cycles computer is blocking for
EnemyMissed = 6 // the number of cycles computer is missing for
EnemyTimer // measures time of attacks,blocks,etc of computer
round = 0 // current round, used to display chnagestates between rounds
minutiias = 3 // number of minutes for each round
countmin = 0 // Sets beginning minutes
countsec = 0 // Sets beginning seconds
milsec = 5 // cycles per second
countmilsec = 5 // Sets beginning miliseconds, (cycles per second)
PlayerHealth = 18 // Players starting Health
EnemyHealth = 18 // Computers starting Health
)
//****************************************************************************//
(instance public rm675 of Rm
(properties picture scriptNumber style 8)
(method (init)(super:init())
(send gGame:setSpeed(7)) // user can't access - reset to insure of playability
= fights_won (- gFightsPlayed (+ gFightsLost gFightsTied)) // sets fights_won
//****************************************************************************//
// initialise room specific views here //
//****************************************************************************//
(closeIcon:setPri(15)init()) // exit game icon, remove before release
(switch(fights_won) // determine opponent by the fights won
(default (TheEnemy:init()hide())) // NES Honda
)
(ThePlayer:init()hide()) // The players boxer
(standup:init()) // standup button
(dodgeright:init()) // dodge button
(dodgeleft:init()) // dodge button
(punch:init()) // punch button
(block:init()) // block button
(send (Prop:new()):view(675)loop(0)cel(4)posn(28 32)addToPic()) // image player
(send (Prop:new()):view(675)loop(0)cel(5)posn(292 32)addToPic())// image computer
// cheap ass health gauges
(enemyHealth1:init())(enemyHealth2:init())(enemyHealth3:init())(enemyHealth4:init())(enemyHealth5:init())(enemyHealth6:init())(enemyHealth7:init())(enemyHealth8:init())(enemyHealth9:init())
(enemyHealth10:init())(enemyHealth11:init())(enemyHealth12:init())(enemyHealth13:init())(enemyHealth14:init())(enemyHealth15:init())(enemyHealth16:init())(enemyHealth17:init())(enemyHealth18:init())
(playerHealth1:init())(playerHealth2:init())(playerHealth3:init())(playerHealth4:init())(playerHealth5:init())(playerHealth6:init())(playerHealth7:init())(playerHealth8:init())(playerHealth9:init())
(playerHealth10:init())(playerHealth11:init())(playerHealth12:init())(playerHealth13:init()) (playerHealth14:init())(playerHealth15:init())(playerHealth16:init())(playerHealth17:init())(playerHealth18:init())
(if(DoSound(sndSET_SOUND))(mute:setPri(15)cel (0)init())) // mute sound
(else(mute:setPri(15)cel (2)init())) // unmute sound
/******************************************************************************/
ParserControl()
(self:setScript(RoomScript))
) // end method
) // end instance
/******************************************************************************/
// Add in Rooms Views Instances //
/******************************************************************************/
(instance closeIcon of Prop(properties x 80 y 173 view 600 loop 2 cel 5))
(instance mute of Prop(properties x 176 y 16 view 650 loop 5 cel 0))
(instance standup of Prop(properties x 3000 y 167 view 675 loop 0 cel 7))
(instance block of Prop(properties x 290 y 185 view 675 loop 0 cel 3))
(instance punch of Prop(properties x 290 y 144 view 675 loop 0 cel 2))
(instance dodgeright of Prop(properties x 302 y 167 view 675 loop 0 cel 0))
(instance dodgeleft of Prop(properties x 277 y 167 view 675 loop 0 cel 1))
(instance TheEnemy of Act(properties view 675 loop 3 cel 0 x 160 y 165))
(instance ThePlayer of Act(properties view 675 loop 1 cel 0 x 160 y 175))
/******************************************************************************/
(instance RoomScript of Script
(properties)
(method (handleEvent pEvent)
(super:handleEvent(pEvent))
(if(==(send pEvent:type())evMOUSEBUTTON)
// Toggle Sound //
(if((> (send pEvent:x) (mute:nsLeft))and
(< (send pEvent:x) (mute:nsRight))and
(> (send pEvent:y) (mute:nsTop))and
(< (send pEvent:y) (mute:nsBottom)))ToggleSound())
(else
// programcontrol ? //
(if(== gProgramControl TRUE)(send pEvent:claimed(FALSE))Print(600 10))
(else
/******************************************************************************/
(if((> (send pEvent:x) (dodgeleft:nsLeft))and
(< (send pEvent:x) (dodgeleft:nsRight))and
(> (send pEvent:y) (dodgeleft:nsTop))and
(< (send pEvent:y) (dodgeleft:nsBottom)))
(if((== PlayerTimer 0) and (== PlayerState 0))
= PlayerState 4) //Go to the player Dodge left state
)
(else
/******************************************************************************/
(if((> (send pEvent:x) (dodgeright:nsLeft))and
(< (send pEvent:x) (dodgeright:nsRight))and
(> (send pEvent:y) (dodgeright:nsTop))and
(< (send pEvent:y) (dodgeright:nsBottom)))
(if((== PlayerTimer 0) and (== PlayerState 0))
= PlayerState 3) //Go to the Dodge right state
)
(else
/******************************************************************************/
(if((> (send pEvent:x) (block:nsLeft))and
(< (send pEvent:x) (block:nsRight))and
(> (send pEvent:y) (block:nsTop))and
(< (send pEvent:y) (block:nsBottom)))
(if((== PlayerTimer 0) and (== PlayerState 0))
= PlayerState 5) //block
)
(else
/******************************************************************************/
(if((> (send pEvent:x) (punch:nsLeft))and
(< (send pEvent:x) (punch:nsRight))and
(> (send pEvent:y) (punch:nsTop))and
(< (send pEvent:y) (punch:nsBottom)))
(if((== PlayerTimer 0) and (== PlayerState 0))
= PlayerState 1) //punch
)
(else
// standup //
(if((> (send pEvent:x) (standup:nsLeft))and
(< (send pEvent:x) (standup:nsRight))and
(> (send pEvent:y) (standup:nsTop))and
(< (send pEvent:y) (standup:nsBottom)))
= gettingUp ++gettingUp
(if(== gettingUp (* PlayerKnockedout 13))
= PlayerDown FALSE
= PauseFight FALSE
= PlayerState 0
= PlayerTimer 0
(ThePlayer:cel(0))
= gettingUp 0
(switch(PlayerKnockedout)
(case 1 // get back 5 health after first knockdown
= PlayerHealth 5
(playerHealth1:show())
(playerHealth2:show())
(playerHealth3:show())
(playerHealth4:show())
(playerHealth5:show())
)
(case 2 // get back 2 health after second knockdown
= PlayerHealth 2
(playerHealth1:show())
(playerHealth2:show())
)
)
)
)
(else
// close //
(if((> (send pEvent:x) (closeIcon:nsLeft))and
(< (send pEvent:x) (closeIcon:nsRight))and
(> (send pEvent:y) (closeIcon:nsTop))and
(< (send pEvent:y) (closeIcon:nsBottom)))
= gCurrentCursor 999
SetCursor(999 HaveMouse())
(if(not(DoSound(sndSET_SOUND)))(ToggleSound()))
UnLoad(rsSCRIPT scriptNumber)
(send gRoom:newRoom(3))
)
// //
/******************************************************************************/
)
)
)
)
)
)
)
)// end mouse button
)// end method
// //
(method (changeState newState)
= state newState
(switch (state)
(case 0
(switch(round)
(case 0 // Haven't started fight yet
++gFightsPlayed
Print("Ladies and gentlemen, Boys and girls. We are proud to welcome you to the "+
"Boxing spectacle of the hour. Slated for three rounds, at three minutes each, "+
"the three knockdown rule is in effect." #time 25)
= cycles 5)
(case 1 = cycles 1 // Beginning the first round of fights
)
(case 2 = cycles 1 // Beginning the second round of fights
(ThePlayer:cel(0))
(TheEnemy:cel(0))
Print ("Round 2")
= PlayerHealth (+ PlayerHealth 5)// give back player health between rounds
(if(> PlayerHealth 18) // If we gave too much,
= PlayerHealth 18 // drop it back to maximum
)
doPlayersHealth() // reset players health bar
= EnemyHealth (+ EnemyHealth 5) // give back enemy health between rounds
(if(> EnemyHealth 18) // If we gave too much,
= EnemyHealth 18 // drop it back to maximum
)
doEnemysHealth() // reset enemys health bar
)
(case 3 = cycles 1 // Begin the third round of fights
(ThePlayer:cel(0))
(TheEnemy:cel(0))
Print ("Round 3")
= PlayerHealth (+ PlayerHealth 5)// give back player health between rounds
(if(> PlayerHealth 18) // If we gave too much,
= PlayerHealth 18 // drop it back to maximum
)
doPlayersHealth() // reset players health bar
= EnemyHealth (+ EnemyHealth 5) // give back enemy health between rounds
(if(> EnemyHealth 18) // If we gave too much,
= EnemyHealth 18 // drop it back to maximum
)
doEnemysHealth() // reset enemys health bar
)
(case 4 // fight over
(if(< PlayerHealth EnemyHealth) // computer won
(TheEnemy:cel(7))
(ThePlayer:cel(8))
= cycles 15)
(else
(if(> PlayerHealth EnemyHealth)// player won
(TheEnemy:cel(8))
(ThePlayer:cel(7))
= cycles 15)
(else
(if(== PlayerHealth EnemyHealth)// tie
(TheEnemy:cel(0))
(ThePlayer:cel(0))
= cycles 15)
)
)
)
)// end round switch
)// end case 0
(case 1
(switch(round)
(case 0 // Haven't started fight yet
Print("You have both received your instructions in the locker rooms. "+
"I wanna see a clean fight here. Now come on out and touch gloves" #time 15)
(ThePlayer:show())
(TheEnemy:show())
= cycles 5)
(case 1 = cycles 1 // Beginning the first round of fights
= countmin minutiias
= countsec 0
= countmilsec milsec
(send gTheMusic:prevSignal(0)stop()number(675)loop(1)play())
)
(case 2 = cycles 1 // Begin the second round of fights
= countmin minutiias
= countsec 0
= countmilsec milsec
)
(case 3 = cycles 1 // Begin the third round of fights
= countmin minutiias
= countsec 0
= countmilsec milsec
)
(case 4 // fight over
(if(< PlayerHealth EnemyHealth)
Print("The computer stomped you")
++gFightsLost
)
(else
(if(> PlayerHealth EnemyHealth)
Print("Holy Crap, you won")
(send gEgo:get(INV_CONTRACT))
)
(else
(if(== PlayerHealth EnemyHealth)
Print("Not too bad, It's a tie match")
++gFightsTied
)
)
)
= gCurrentCursor 999
SetCursor(999 HaveMouse())
(send gTheMusic:prevSignal(0)fade())
= cycles 20) // Ends the fight
)// end round switch
)// end case 1
(case 2
(switch(round)
(case 0
++round
(RoomScript:changeState(0))// ends intro, start first round
)
(case 4
UnLoad (rsVIEW scriptNumber)
UnLoad (rsSOUND scriptNumber)
UnLoad (rsPIC scriptNumber)
UnLoad (rsSCRIPT scriptNumber)
(send gRoom:newRoom(3))
)
(default
(TheEnemy:show())
(ThePlayer:show())
Print("Fight!" #time 4)
= EnemyDown FALSE
= PlayerDown FALSE
= EnemyState 0
= PlayerState 0
= EnemyTimer 0
= PlayerTimer 0
= PauseFight FALSE
= PlayerKnockedout 0 // reset for 3 knockdown rule
= EnemyKnockedout 0 // reset for 3 knockdown rule
Writeround()
Writemin()
Writesec()
)
)
)// end case 2
) // end switch
) // end method
// //
(method (doit)
(super:doit())
/******************************************************************************/
// Handle the mute button displayed //
/******************************************************************************/
(if(DoSound(sndSET_SOUND))(mute:cel (0)))// sound on
(else(mute:cel (2))) // sound off
/******************************************************************************/
// Change Cursor to Hand //
/******************************************************************************/
(if(== started_up FALSE)
= gCurrentCursor 994
SetCursor(994 HaveMouse())
= started_up TRUE
)
/******************************************************************************/
// Handle the boxers interaction button displays //
/******************************************************************************/
(if (== PlayerDown TRUE)// If the player has been knoced down
(block:posn(3000 185)) // hide boxing controls
(punch:posn(3000 144)) // hide boxing controls
(dodgeright:posn(3000 167)) // hide boxing controls
(dodgeleft:posn(3000 167)) // hide boxing controls
(if(not(== PlayerKnockedout 3))// If it isn't the third time this round
(if(== PauseFight FALSE) // and the clock hasn't run out
(standup:posn(290 167)) // show stand up button
)
(else // if the clock does run out
(standup:posn(3000 167)) // hide stand up button
)
)
)
(else // If the player has NOT beenknocked down
(block:posn(290 185)) // show boxing controls
(punch:posn(290 144)) // show boxing controls
(dodgeright:posn(302 167)) // show boxing controls
(dodgeleft:posn(277 167)) // show boxing controls
(standup:posn(3000 167)) // hide stand up button
)
/******************************************************************************/
// Handle the Rounds Clock //
/******************************************************************************/
(if(== countmilsec 0)
(if(== countsec 0)
(if(== countmin 0) // all three timers reach 0
(if(== PauseFight FALSE) // if the fight isn't already paused
// * without this check, the doit method
// * maintains the changestate at state 0
(if((== PlayerDown TRUE) or (== EnemyDown TRUE))Print ("Saved by the Bell!"))
= EnemyState 0 // reset computer to waiting
= PlayerState 0 // reset player to waiting
= PlayerDown FALSE // player is not knocked down
= EnemyDown FALSE // computer is not knocked down
= round ++round // prepares rounds for the changestate
= PauseFight TRUE // turns off fighting states of doit
(RoomScript:changeState(0)) // sends to changestate for intermissions
)
)
(else // milsec and sec at 0 but not min
= countmin --countmin // so subtract one minute
= countsec 59 // changes the 0 to 60 to keep timer counting down
Writemin() // update minutes displayed
Writesec()
= countmilsec milsec // resets milsec to cycle delay
)
)
(else // milisec at 0 but not seconds
= countsec --countsec // so subtract one second
Writesec() // update seconds displayed
= countmilsec milsec // resets milsec to cycle delay
)
)
(if(== PauseFight FALSE) // if the fight isn't paused
= countmilsec --countmilsec // subtract one from milisec each cycle
/******************************************************************************/
// Handle the Players fighting state //
/******************************************************************************/
(switch(PlayerState)
(case 0) // Player Waiting, so do nothing
(case 1 // Player is Punching (click on punch button while state and timer=0
++ PlayerTimer // Increase the timer each cycle
(ThePlayer:cel(3)) // Change the players boxer to punching view
(if(== PlayerTimer PlayerAttack) // attack reaches the enemy
(switch(EnemyState) // check state of computer
(case 0 // Computer is just standing there
--EnemyHealth // subtract one from computers health
= EnemyState 2 // Set it's State to getting punched
= EnemyTimer 0 // Reset it's Timer
) // end computer waiting
(case 1 // Computer has started an attack, but not soon enough
--EnemyHealth // subtract one from computers health
= EnemyState 2 // Set it's State to getting punched
= EnemyTimer 0 // Reset it's Timer
) // end computer attacking
(case 2 ) // Computer already reeling, do nothing
(case 3 // computer dodged our punch
= PlayerState 6 // set it's state to missing
= PlayerTimer 0 // reset player timer
) // end computer dodge right
(case 4 // computer dodged our punch
= PlayerState 6 // set it's state to missing
= PlayerTimer 0 // reset player timer
) // end computer dodge left
(case 6 // computer has punched and missed
--EnemyHealth // subtract one from computers health
= EnemyState 2 // Set it's State to getting punched
= EnemyTimer 0 // Reset it's Timer
) // end computer missing
) // end enemystate switch
) // end if timer equals attack delay
(if(== PlayerTimer (+ PlayerAttack 2)) //two cycles after attack delay
= PlayerState 0 // reset player state
= PlayerTimer 0 // reset player timer
(ThePlayer:cel(0)) // reset players boxer to standing
)
) // end player attacking computer
(case 2 // Computer has managed to successfully punch us
++ PlayerTimer // Increase the timer each cycle
(ThePlayer:cel(4)) // Change players boxer to reeling view
(if(== PlayerTimer PlayerHurt) // players cycle delay for getting hurt
(if(> PlayerHealth 0) // if we have helth left
= PlayerState 0 // reset players state
= PlayerTimer 0 // reset player timer
(ThePlayer:cel(0)) // reset players boxer to standing
)
(else // otherwise we fall down
= PlayerDown TRUE // tells doit to bring up stand up button
++PlayerKnockedout // adds one to the times this round we have been knocked down
= PlayerState 7 // changes player state to waiting to get up
= PlayerTimer 0 // reset players timer
(ThePlayer:cel(8)) // drop player to the mat
)
)
) // end player getting punched
(case 3 //Player is Dodging to the left
++PlayerTimer // Increase the timer each cycle
(ThePlayer:cel(2)) // Change players boxer to dodging view
(if(== PlayerTimer PlayerDodge) // players cycle delay while dodging
= PlayerState 0 // reset players state
= PlayerTimer 0 // reset player timer
(ThePlayer:cel(0)) // reset players boxer to standing
)
) // end player dodging left
(case 4 //Player Dodging to the right
++PlayerTimer // Increase the timer each cycle
(ThePlayer:cel(1)) // Change players boxer to dodging view
(if(== PlayerTimer PlayerDodge) // players cycle delay while dodging
= PlayerState 0 // reset players state
= PlayerTimer 0 // reset player timer
(ThePlayer:cel(0)) // reset players boxer to standing
)
) // end player dodging right
(case 5 // Player is Blocking
++ PlayerTimer // Increase the timer each cycle
(ThePlayer:cel(5)) // Change players boxer to blocking view
(if(== PlayerTimer PlayerBlock) // players cycle delay while blocking
= PlayerState 0 // reset players state
= PlayerTimer 0 // reset player timer
(ThePlayer:cel(0)) // reset players boxer to standing
)
) // end player blocking
(case 6 // Player punched and Missed
++ PlayerTimer // Increase the timer each cycle
(ThePlayer:cel(6)) // Change players boxer to missing view
(if(== PlayerTimer PlayerMissed) // players cycle delay while missing
= PlayerState 0 // reset players state
= PlayerTimer 0 // reset player timer
(ThePlayer:cel(0)) // reset players boxer to standing
)
) // end player missed punch
(case 7 // Player has been knocked down by computer
(if (< PlayerKnockedout 3)
++ PlayerTimer // Increase the timer each cycle
(if(== PlayerTimer (* milsec 13))// cycle delay while ref counts to 10
= PauseFight TRUE // Turn off player states
= round 4 // set the fight over
(RoomScript:changeState(0)) // do final animations
)
)
(else // third knockdown this round
= PauseFight TRUE // Turn off player states
= round 4 // set the fight over
(RoomScript:changeState(0)) // do final animations
)
) // end player knocked down
) // end playerstate switch
//*****************************************************************************/
// Handle the Computers fighting state //
//*****************************************************************************/
(switch(EnemyState)
(case 0 // Computer is Waiting, need to check Players state for reaction
++ EnemyTimer // increase the timer each cycle
(switch(PlayerState) // based off of Players state
(case 1 // player is attacking: computer should block,dodge, or get punched
(switch(Random(0 5)) // 1,3,5 computer gets punched
(case 0 = EnemyState 3 = EnemyTimer 0)// computer dodges
(case 2 = EnemyState 5 = EnemyTimer 0)// computer blocks
(case 4 = EnemyState 4 = EnemyTimer 0)// computer dodges
)
)
(case 2 ) // player is reeling from a blow
(case 3 // player is dodging
= EnemyState 1
= EnemyTimer 0
(TheEnemy:cel(3))
)
(case 4 // player is dodging
= EnemyState 1
= EnemyTimer 0
(TheEnemy:cel(3))
)
(case 5 // player is blocking
(switch(Random(0 4))
(case 0 = EnemyState 1 = EnemyTimer 0 (TheEnemy:cel(3)))// attack
(case 1 = EnemyState 3 = EnemyTimer (Random(0 2)))// dodge
(case 2 = EnemyState 5 = EnemyTimer (Random(0 2)))// block
(case 3 = EnemyState 4 = EnemyTimer (Random(0 2)))// dodge
(case 4 = EnemyState 1 = EnemyTimer 0 (TheEnemy:cel(3)))// attack
)
)
(case 6 // player missed
= EnemyState 1
= EnemyTimer 0
(TheEnemy:cel(3))
)
(case 7 )// end case 4 // computer lost
(case 8 )// end case 5 // computer won
)
//****************************************************************************/
// Controls the computers Actions at different cycle intervals while waiting //
//****************************************************************************/
(switch(EnemyTimer)
(case 4 // enemy is waiting, and timer has reached 4
(switch(Random(0 3)) // 0,3 do nothing, timer continues
(case 1
= EnemyState 3 // dodge
= EnemyTimer 0
)
(case 2
= EnemyState 4 // dodge
= EnemyTimer 0
)
) // end random switch
) // end timer at 4
(case 8 // enemy is waiting, and timer has reached 8
(switch(Random(0 3)) // 1,2 do nothing, timer continues
(case 0
= EnemyState 1 // punch
(TheEnemy:cel(3))
= EnemyTimer 0
)
(case 3
= EnemyState 1 // punch
(TheEnemy:cel(3))
= EnemyTimer 0
)
)
) // end timer at 8
(case 12 // enemy is waiting, and timer has reached 12
= EnemyState 5 // block
= EnemyTimer 0
) // end timer at 12
)
) // end case 0 - computer waiting
// //
(case 1 // Computer is punching
++ EnemyTimer // Increase the timer each cycle
(if(== EnemyTimer EnemyAttack) // attack reaches the player
(switch(PlayerState) // check players state
(case 0 // player is just standing there
-- PlayerHealth
= PlayerState 2
= PlayerTimer 0
ShakeScreen(1)
)
(case 1 // player is punching, but not fast enough
-- PlayerHealth
= PlayerState 2
= PlayerTimer 0
ShakeScreen(1)
)
(case 3 // player is dodging, computer misses
= EnemyState 6
= EnemyTimer 0
(TheEnemy:cel(6))
)
(case 4 // player is dodging, computer misses
= EnemyState 6
= EnemyTimer 0
(TheEnemy:cel(6))
)
(case 6 // player has punched and missed
-- PlayerHealth
= PlayerState 2
= PlayerTimer 0
ShakeScreen(1)
)
)// end playerstates switch
)
(if(== EnemyTimer (+ EnemyAttack 1)) //Return to wait
= EnemyState 0
(TheEnemy:cel(0))
= EnemyTimer 0
)
)// end case 1 - computer punching
(case 2 //Being hurt...
++ EnemyTimer // Increase the timer each cycle
(TheEnemy:cel(4)) // Change computer to reeling view
(if(== EnemyTimer EnemyHurt) // computers cycle delay for getting hurt
(if(> EnemyHealth 0) // if computer has helth left
= EnemyState 0 // reset computers state
= EnemyTimer 0 // reset computer timer
(TheEnemy:cel(0)) // reset computers boxer to standing
)
(else // otherwise computer falls down
= EnemyDown TRUE // tells doit to bring up stand up button
++EnemyKnockedout // adds one to the times this round computer has been knocked down
(TheEnemy:cel(8)) // drop player to the mat
(if(<= EnemyKnockedout 2)
= PlayerState 0
= EnemyState 11 // getting up
= PlayerTimer 0
= EnemyTimer 0
)
(else
= PauseFight TRUE
= round 4
(RoomScript:changeState(0))
)
)
)
)// end case 2
(case 3 //Dodging to the left
(++ EnemyTimer)
(TheEnemy:cel(2))
(if(== EnemyTimer EnemyDodge)
(= EnemyState 0)
(= EnemyTimer 0)
(TheEnemy:cel(0))
)
)// end case 3
(case 4 //Dodging to the right
(++ EnemyTimer)
(TheEnemy:cel(1))
(if(== EnemyTimer EnemyDodge)
(= EnemyState 0)
(= EnemyTimer 0)
(TheEnemy:cel(0))
)
)// end case 4
(case 5 //Blocking
(++ EnemyTimer)
(TheEnemy:cel(5))
(if(== EnemyTimer EnemyBlock)
(= EnemyState 0)
(= EnemyTimer 0)
(TheEnemy:cel(0))
)
)// end case 5
(case 6 //Missing
(++ EnemyTimer)
(TheEnemy:cel(6))
(if(== EnemyTimer EnemyMissed)
(= EnemyState 0)
(= EnemyTimer 0)
(TheEnemy:cel(0))
)
)// end case 6
(case 7 )// end case 7
(case 8 )// end case 8
(case 11 // computer getting up
++ EnemyTimer
(if(== EnemyTimer 45)
= EnemyState 0
= EnemyTimer 0
(switch(EnemyKnockedout)
(case 1 = EnemyHealth 5
= EnemyDown FALSE
(enemyHealth1:show())
(enemyHealth2:show())
(enemyHealth3:show())
(enemyHealth4:show())
(enemyHealth5:show())
)
(case 2 = EnemyHealth 2
= EnemyDown FALSE
(enemyHealth1:show())
(enemyHealth2:show())
)
)
(TheEnemy:cel(0))
)
)// end case 11
)// end enemystate switch
) // ends if game isn't paused
/******************************************************************************/
// Nothing worth re-editing below this //
/******************************************************************************/
// control our cheap ass gauges
(if(== PlayerHealth 17)(playerHealth18:hide()))
(if(== PlayerHealth 16)(playerHealth17:hide()))
(if(== PlayerHealth 15)(playerHealth16:hide()))
(if(== PlayerHealth 14)(playerHealth15:hide()))
(if(== PlayerHealth 13)(playerHealth14:hide()))
(if(== PlayerHealth 12)(playerHealth13:hide()))
(if(== PlayerHealth 11)(playerHealth12:hide()))
(if(== PlayerHealth 10)(playerHealth11:hide()))
(if(== PlayerHealth 9)(playerHealth10:hide()))
(if(== PlayerHealth 8)(playerHealth9:hide()))
(if(== PlayerHealth 7)(playerHealth8:hide()))
(if(== PlayerHealth 6)(playerHealth7:hide()))
(if(== PlayerHealth 5)(playerHealth6:hide()))
(if(== PlayerHealth 4)(playerHealth5:hide()))
(if(== PlayerHealth 3)(playerHealth4:hide()))
(if(== PlayerHealth 2)(playerHealth3:hide()))
(if(== PlayerHealth 1)(playerHealth2:hide()))
(if(== PlayerHealth 0)(playerHealth1:hide()))
(if(== EnemyHealth 17)(enemyHealth18:hide()))
(if(== EnemyHealth 16)(enemyHealth17:hide()))
(if(== EnemyHealth 15)(enemyHealth16:hide()))
(if(== EnemyHealth 14)(enemyHealth15:hide()))
(if(== EnemyHealth 13)(enemyHealth14:hide()))
(if(== EnemyHealth 12)(enemyHealth13:hide()))
(if(== EnemyHealth 11)(enemyHealth12:hide()))
(if(== EnemyHealth 10)(enemyHealth11:hide()))
(if(== EnemyHealth 9)(enemyHealth10:hide()))
(if(== EnemyHealth 8)(enemyHealth9:hide()))
(if(== EnemyHealth 7)(enemyHealth8:hide()))
(if(== EnemyHealth 6)(enemyHealth7:hide()))
(if(== EnemyHealth 5)(enemyHealth6:hide()))
(if(== EnemyHealth 4)(enemyHealth5:hide()))
(if(== EnemyHealth 3)(enemyHealth4:hide()))
(if(== EnemyHealth 2)(enemyHealth3:hide()))
(if(== EnemyHealth 1)(enemyHealth2:hide()))
(if(== EnemyHealth 0)(enemyHealth1:hide()))
) // end method
) // end instance
/******************************************************************************/
(procedure public (ToggleSound) // mute, unmute
(var SOUND_OFF)
= SOUND_OFF DoSound(sndSET_SOUND)
= SOUND_OFF DoSound( sndSET_SOUND not(SOUND_OFF) )
)
/******************************************************************************/
(procedure public (Writemin) // display Minutes
(var textstring[50])
Format(@textstring "%2d" countmin)
Display(@textstring dsCOORD 144 8 dsCOLOR 00 dsFONT 4 dsBACKGROUND 15 dsWIDTH 10)
)
/******************************************************************************/
(procedure public (Writesec) // display Seconds
(var textstring[50])
(if(< countsec 0)
= countsec 0
)
Format(@textstring "%2d" countsec)
Display(@textstring dsCOORD 156 8 dsCOLOR 00 dsFONT 4 dsBACKGROUND 15 dsWIDTH 12)
)
/******************************************************************************/
(procedure public (Writeround) // display Round
(var textstring[50])
Format(@textstring "%2d" round)
Display(@textstring dsCOORD 168 17 dsCOLOR 04 dsFONT 4 dsBACKGROUND 15 dsWIDTH 10)
)
(procedure public (doEnemysHealth)
(if(== EnemyHealth 5)
(enemyHealth1:show())
(enemyHealth2:show())
(enemyHealth3:show())
(enemyHealth4:show())
(enemyHealth5:show()))
(if(== EnemyHealth 6)
(enemyHealth2:show())
(enemyHealth3:show())
(enemyHealth4:show())
(enemyHealth5:show())
(enemyHealth6:show()))
(if(== EnemyHealth 7)
(enemyHealth3:show())
(enemyHealth4:show())
(enemyHealth5:show())
(enemyHealth6:show())
(enemyHealth7:show()))
(if(== EnemyHealth 8)
(enemyHealth4:show())
(enemyHealth5:show())
(enemyHealth6:show())
(enemyHealth7:show())
(enemyHealth8:show()))
(if(== EnemyHealth 9)
(enemyHealth5:show())
(enemyHealth6:show())
(enemyHealth7:show())
(enemyHealth8:show())
(enemyHealth9:show()))
(if(== EnemyHealth 10)
(enemyHealth6:show())
(enemyHealth7:show())
(enemyHealth8:show())
(enemyHealth9:show())
(enemyHealth10:show()))
(if(== EnemyHealth 11)
(enemyHealth7:show())
(enemyHealth8:show())
(enemyHealth9:show())
(enemyHealth10:show())
(enemyHealth11:show()))
(if(== EnemyHealth 12)
(enemyHealth8:show())
(enemyHealth9:show())
(enemyHealth10:show())
(enemyHealth11:show())
(enemyHealth12:show()))
(if(== EnemyHealth 13)
(enemyHealth9:show())
(enemyHealth10:show())
(enemyHealth11:show())
(enemyHealth12:show())
(enemyHealth13:show()))
(if(== EnemyHealth 14)
(enemyHealth10:show())
(enemyHealth11:show())
(enemyHealth12:show())
(enemyHealth13:show())
(enemyHealth14:show()))
(if(== EnemyHealth 15)
(enemyHealth11:show())
(enemyHealth12:show())
(enemyHealth13:show())
(enemyHealth14:show())
(enemyHealth15:show()))
(if(== EnemyHealth 16)
(enemyHealth12:show())
(enemyHealth13:show())
(enemyHealth14:show())
(enemyHealth15:show())
(enemyHealth16:show()))
(if(== EnemyHealth 17)
(enemyHealth13:show())
(enemyHealth14:show())
(enemyHealth15:show())
(enemyHealth16:show())
(enemyHealth17:show()))
(if(== EnemyHealth 18)
(enemyHealth14:show())
(enemyHealth15:show())
(enemyHealth16:show())
(enemyHealth17:show())
(enemyHealth18:show()))
)
(procedure public (doPlayersHealth)
(if(== PlayerHealth 5)
(playerHealth1:show())
(playerHealth2:show())
(playerHealth3:show())
(playerHealth4:show())
(playerHealth5:show()))
(if(== PlayerHealth 6)
(playerHealth2:show())
(playerHealth3:show())
(playerHealth4:show())
(playerHealth5:show())
(playerHealth6:show()))
(if(== PlayerHealth 7)
(playerHealth3:show())
(playerHealth4:show())
(playerHealth5:show())
(playerHealth6:show())
(playerHealth7:show()))
(if(== PlayerHealth 8)
(playerHealth4:show())
(playerHealth5:show())
(playerHealth6:show())
(playerHealth7:show())
(playerHealth8:show()))
(if(== PlayerHealth 9)
(playerHealth5:show())
(playerHealth6:show())
(playerHealth7:show())
(playerHealth8:show())
(playerHealth9:show()))
(if(== PlayerHealth 10)
(playerHealth6:show())
(playerHealth7:show())
(playerHealth8:show())
(playerHealth9:show())
(playerHealth10:show()))
(if(== PlayerHealth 11)
(playerHealth7:show())
(playerHealth8:show())
(playerHealth9:show())
(playerHealth10:show())
(playerHealth11:show()))
(if(== PlayerHealth 12)
(playerHealth8:show())
(playerHealth9:show())
(playerHealth10:show())
(playerHealth11:show())
(playerHealth12:show()))
(if(== PlayerHealth 13)
(playerHealth9:show())
(playerHealth10:show())
(playerHealth11:show())
(playerHealth12:show())
(playerHealth13:show()))
(if(== PlayerHealth 14)
(playerHealth10:show())
(playerHealth11:show())
(playerHealth12:show())
(playerHealth13:show())
(playerHealth14:show()))
(if(== PlayerHealth 15)
(playerHealth11:show())
(playerHealth12:show())
(playerHealth13:show())
(playerHealth14:show())
(playerHealth15:show()))
(if(== PlayerHealth 16)
(playerHealth12:show())
(playerHealth13:show())
(playerHealth14:show())
(playerHealth15:show())
(playerHealth16:show()))
(if(== PlayerHealth 17)
(playerHealth13:show())
(playerHealth14:show())
(playerHealth15:show())
(playerHealth16:show())
(playerHealth17:show()))
(if(== PlayerHealth 18)
(playerHealth14:show())
(playerHealth15:show())
(playerHealth16:show())
(playerHealth17:show())
(playerHealth18:show()))
)
/******************************************************************************/
(instance playerHealth1 of Prop(properties view 675 loop 0 cel 6 x 67 y 19))
(instance playerHealth2 of Prop(properties view 675 loop 0 cel 6 x 71 y 19))
(instance playerHealth3 of Prop(properties view 675 loop 0 cel 6 x 75 y 19))
(instance playerHealth4 of Prop(properties view 675 loop 0 cel 6 x 79 y 19))
(instance playerHealth5 of Prop(properties view 675 loop 0 cel 6 x 83 y 19))
(instance playerHealth6 of Prop(properties view 675 loop 0 cel 6 x 87 y 19))
(instance playerHealth7 of Prop(properties view 675 loop 0 cel 6 x 91 y 19))
(instance playerHealth8 of Prop(properties view 675 loop 0 cel 6 x 95 y 19))
(instance playerHealth9 of Prop(properties view 675 loop 0 cel 6 x 99 y 19))
(instance playerHealth10 of Prop(properties view 675 loop 0 cel 6 x 103 y 19))
(instance playerHealth11 of Prop(properties view 675 loop 0 cel 6 x 107 y 19))
(instance playerHealth12 of Prop(properties view 675 loop 0 cel 6 x 111 y 19))
(instance playerHealth13 of Prop(properties view 675 loop 0 cel 6 x 115 y 19))
(instance playerHealth14 of Prop(properties view 675 loop 0 cel 6 x 119 y 19))
(instance playerHealth15 of Prop(properties view 675 loop 0 cel 6 x 123 y 19))
(instance playerHealth16 of Prop(properties view 675 loop 0 cel 6 x 127 y 19))
(instance playerHealth17 of Prop(properties view 675 loop 0 cel 6 x 131 y 19))
(instance playerHealth18 of Prop(properties view 675 loop 0 cel 6 x 135 y 19))
(instance enemyHealth1 of Prop(properties view 675 loop 0 cel 6 x 255 y 19))
(instance enemyHealth2 of Prop(properties view 675 loop 0 cel 6 x 251 y 19))
(instance enemyHealth3 of Prop(properties view 675 loop 0 cel 6 x 247 y 19))
(instance enemyHealth4 of Prop(properties view 675 loop 0 cel 6 x 243 y 19))
(instance enemyHealth5 of Prop(properties view 675 loop 0 cel 6 x 239 y 19))
(instance enemyHealth6 of Prop(properties view 675 loop 0 cel 6 x 235 y 19))
(instance enemyHealth7 of Prop(properties view 675 loop 0 cel 6 x 231 y 19))
(instance enemyHealth8 of Prop(properties view 675 loop 0 cel 6 x 227 y 19))
(instance enemyHealth9 of Prop(properties view 675 loop 0 cel 6 x 223 y 19))
(instance enemyHealth10 of Prop(properties view 675 loop 0 cel 6 x 219 y 19))
(instance enemyHealth11 of Prop(properties view 675 loop 0 cel 6 x 215 y 19))
(instance enemyHealth12 of Prop(properties view 675 loop 0 cel 6 x 211 y 19))
(instance enemyHealth13 of Prop(properties view 675 loop 0 cel 6 x 207 y 19))
(instance enemyHealth14 of Prop(properties view 675 loop 0 cel 6 x 203 y 19))
(instance enemyHealth15 of Prop(properties view 675 loop 0 cel 6 x 199 y 19))
(instance enemyHealth16 of Prop(properties view 675 loop 0 cel 6 x 195 y 19))
(instance enemyHealth17 of Prop(properties view 675 loop 0 cel 6 x 191 y 19))
(instance enemyHealth18 of Prop(properties view 675 loop 0 cel 6 x 187 y 19))