// CON Files for the 'Duke Carribean Add-on' by SunStorm Interactive
//
// Actor - BEACHBALL - Sprite #941
//
// --- Resources ---
//
// Sounds:
// Beach Ball Bounce      - BLBOUNCE.WAV
// Beach Ball Explode     - BALLBOOM.WAV
//
// Art:
// 1 * 1 frame(s)         - Beach Ball

define BEACHBALL 3400
define BALLSTRENGTH 20
action BBB 260 8 1 1 10
action BBI 261 1

move   BALL0  0     40
move   BALL1 -500   -90
move   BALL2 -400    30
move   BALL3 -300    -70
move   BALL4 -200    20
move   BALL5 -150    -50
move   BALL6 -80    10
move   BALL7 -100   0

ai     AIBALLRANDOM BBB BALL0 randomangle
ai     AIBALLI BBI BALL0
// faceplayer = Very, very bad.
ai     AIBALLR BBB BALL7 geth getv
ai     AIBALL1 BBB BALL1 geth getv faceplayer
// This is the right place for faceplayer.
ai     AIBALL2 BBB BALL2 geth getv
ai     AIBALL3 BBB BALL3 geth getv
ai     AIBALL4 BBB BALL4 geth getv
ai     AIBALL5 BBB BALL5 geth getv
ai     AIBALL6 BBB BALL6 geth getv

actor BEACHBALL WEAK BBI

fall
ifai 0 { ai AIBALLI sizeat 30 30 }

ifhitweapon
  {
  debris SCRAP3 5
  sound  BALLEXPLODE
  killit
  }

ifcansee { }

ifai AIBALLI
  {
  ifpdistl 1024
    {
    ai AIBALL1
    sound BOUNCESOUND
    }
  }

ifai AIBALL1
  {
  ifcount 8
    {
    ai AIBALL2
    }
  ifnotmoving
    {
    ai AIBALLRANDOM
    ai AIBALL1
    }
  }

ifai AIBALL2
  {
  iffloordistl 1
    {
    ai AIBALL3
    sound BOUNCESOUND
    }
  ifnotmoving
    {
    ai AIBALLRANDOM
    ai AIBALL2
    }
  }

ifai AIBALL3
  {
  ifcount 8
    {
    ai AIBALL4
    }
  ifnotmoving
    {
    ai AIBALLRANDOM
    ai AIBALL3
    }
  }

ifai AIBALL4
  {
  iffloordistl 1
    {
    ai AIBALL5
    sound BOUNCESOUND
    }
  ifnotmoving
    {
    ai AIBALLRANDOM
    ai AIBALL4
    }

  }

ifai AIBALL5
  {
  ifcount 8
    {
    ai AIBALL6
    break
    }
  ifnotmoving
    {
    ai AIBALLRANDOM
    ai AIBALL5
    }
  }

ifai AIBALL6
  {
  iffloordistl 1
    {
    ai AIBALLR
    sound BOUNCESOUND
    }
  ifnotmoving
    {
    ai AIBALLRANDOM
    ai AIBALL6
    }
  }

ifai AIBALLR
  {
  ifpdistl 1024
    {
    ai AIBALL1
    sound BOUNCESOUND
    }
  ifcount 15
    {
    ai AIBALLI
    }
  ifnotmoving
    {
    ai AIBALLRANDOM
    ai AIBALLR
    }
  }


break
enda



