Subversion Repositories vaca_plus

Rev

Rev 17 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

/*
--------------------------------------------------------------------------------
Duke Caribbean: Life's A Beach
By Joris Weimar
© 1997 Sunstorm Interactive
--------------------------------------------------------------------------------
Duke Caribbean: Life's A Beach Plus
By Hendricks266
--------------------------------------------------------------------------------
*/

definegamefuncname 34 Sunglasses
definegamefuncname 35 Crate_of_Bananas
definegamefuncname 48 Hot_Sauce

definecheat 14 endepisode
definecheat 15 endlevel
// definecheat 23 creditcards
// keys
definecheat 25 endvolume

include VacaDefs.con
include VacaUser.con
include VSounds.con
include VBeachBall.con

spritenoshade GROWAMMO

setgamename Duke Caribbean: Life's A Beach

gamevar temp2 0 2
gamevar temp3 0 2
gamevar x2 0 2
gamevar y2 0 2
gamevar pose 0 0

// The following gamevars disable the Polymer dynamic muzzle flashes for certain Caribbean weapons.
gamevar WEAPON1_FLASHCOLOR 0 1
gamevar WEAPON2_FLASHCOLOR 0 1
gamevar WEAPON3_FLASHCOLOR 0 1
gamevar WEAPON4_FLASHCOLOR 0 1
gamevar WEAPON7_FLASHCOLOR 0 1
gamevar WEAPON9_FLASHCOLOR 0 1

onevent EVENT_GETMENUTILE
 setvar RETURN 3281
endevent

/*
onevent EVENT_GETLOADTILE
 ifvare VOLUME 2
   {
     ifvare LEVEL 2 setvar RETURN 19665
     ifvare LEVEL 3 setvar RETURN 19665
   }
endevent

onevent EVENT_DISPLAYLOADINGSCREEN
 ifvare VOLUME 2
   {
     ifvare LEVEL 2 rotatesprite 160 100 65536 0 3706 0 0 2 0 0 xdim ydim
     ifvare LEVEL 3 rotatesprite 160 95 65536 0 3639 0 0 2 0 0 xdim ydim
   }
endevent
*/

state cutsceneambience
  getactor[THISACTOR].lotag temp

  switch temp

    case WIND_AMBIENCE
    case WIND_REPEAT
     setactor[THISACTOR].lotag WIND2
    break

  endswitch
ends

onevent EVENT_LOADACTOR
  getactor[THISACTOR].picnum picnum
  switch picnum

   case DRAGON sizeat 42 50 break
   case BEACHBABE1 sizeat 40 40 break
   case BEACHBALL sizeat 30 30 break
   case BEACHBATHER1 sizeat 42 40 break
   case SEAGULL sizeat 20 20 break

   case GROWSPRITEICON sizeat 28 28 break

   case 681 case 682 case 683 case 684 cactor CHAIR3 break

   case CAMERA1
    getactor[THISACTOR].cstat temp
    setvar temp2 0
    ifvarand temp 4 addvar temp2 4
    ifvarand temp 8 addvar temp2 8
    setactor[THISACTOR].cstat temp2
   break

   case MUSICANDSFX
    state cutsceneambience
   break

  endswitch
endevent

gamevar LOGO_FLAGS 767 0 // default; TEN screen reenabled

onevent EVENT_GAME
  getactor[THISACTOR].picnum picnum
  switch picnum

   case RPG
   case FREEZEBLAST
    setactor[THISACTOR].htflags 256
   break

   case FIRELASER
    spritepal 1
    setactor[THISACTOR].htflags 256
   break

/*
   case MUSICANDSFX
       ifsound WIND_AMBIENCE stopsound WIND_AMBIENCE
       ifsound WIND_REPEAT stopsound WIND_REPEAT
   break
*/

   case CHAIR3
     ifvare temp3 0
     {
     findnearsprite3d 1037 768 temp
     ifvarn temp -1
       {
          getactor[temp].x x2
          getactor[temp].y y2
          getactor[THISACTOR].x x
          getactor[THISACTOR].y y // gets the coordinates of the chair and table
          subvarvar x2 x
          subvarvar y2 y
          getangle temp2 x2 y2 // calculates the angle to face the table
          setactor[THISACTOR].ang temp2 // sets the angle
          setvar temp3 1
       }
     else setvar temp3 1
     }
   break

   case SHELL
   case SHOTGUNSHELL
    killit
   break

   case CAMERA1
      setactor[THISACTOR].cstat temp2
   break

   case SMALLSMOKE
      ifspawnedby RPG killit
   break

   case SHOTSPARK1
     ifspawnedby JIBS6 spritepal 1
     ifspawnedby BLOODSPLAT1 spritepal 1
     ifspawnedby SHOTSPARK1 spritepal 1
     ifspawnedby SHOTGUN spritepal 1
     ifspawnedby CHAINGUN spritepal 1
     ifspawnedby FIRELASER spritepal 1
     ifspawnedby APLAYER spritepal 1
     ifspawnedby RPG killit
     ifspritepal 1 setactor[THISACTOR].htflags 256 // replace with blue light placement code when available
   break

  endswitch
endevent

onevent EVENT_EGS
  getactor[THISACTOR].picnum picnum
  switch picnum

   case FREEZEAMMO
     spritepal 1
     spawn BLOODPOOL
     getlastpal
   break

   case WATERSPLASH2
     ifspawnedby SEAGULLSHIT spritepal 19
   break

   case GROWAMMO
     setactor[THISACTOR].mdflags 16
   break

  endswitch
endevent

state scrap3_colorchange
        ifspritepal 10 spritepal 2
   else ifspritepal 11 spritepal 8
   else ifspritepal 12 spritepal 0
   else ifspritepal 13 spritepal 0 // needs work
   else ifspritepal 14 spritepal 8
   else ifspritepal 15 spritepal 7 // needs work
   else ifspritepal 16 spritepal 1
   else ifspritepal 18 spritepal 0
   else ifspritepal 21 spritepal 2
   else ifspritepal 22 spritepal 8
   else ifspritepal 23 spritepal 7
   else spritepal 1 // This is so that the white SCRAP3 will turn the color of the object (chair, dragon) (approximately).
ends

onevent EVENT_KILLIT
 ifactor CHAIR3
   {
        state scrap3_colorchange
        debris SCRAP3 12
        getlastpal
        sound GLASS_HEAVYBREAK
        sound VENT_BUST
   }
endevent

// -----------------------------------------------------------------------------

state standard_bjibs
  guts JIBS2 1
  guts JIBS3 2
  guts JIBS4 3
  guts JIBS5 2
  guts JIBS6 3
  ifrnd 6
  {
    guts JIBS1 1
    spawn BLOODPOOL
  }         // a badly drawn spine
ends

state randgetweapsnds
    setvar temp2 0
    randvar temp2 2
    switch temp2
     case 0 globalsound DUKE_GETWEAPON1 break
     case 1 globalsound DUKE_GETWEAPON2 break
     case 2 globalsound DUKE_GETWEAPON4 break
    endswitch
ends

actor FIRSTGUNSPRITE
  fall
  ifmove RESPAWN_ACTOR_FLAG
    state respawnit
  else
    ifp pshrunk nullop
    else
      ifp palive
        ifpdistl RETRIEVEDISTANCE
          ifcount 6
            ifcanseetarget
      {
        ifgotweaponce 0
          break
        addweapon PISTOL_WEAPON 48
        quote 1118
        ifspawnedby FIRSTGUNSPRITE
          state getweaponcode
        else
          state quikweaponget
      }
enda

actor CRYSTALAMMO
  fall
  ifmove RESPAWN_ACTOR_FLAG
    state respawnit
  else
    ifp pshrunk nullop
    else
      ifp palive
        ifpdistl RETRIEVEDISTANCE
          ifcount 6
            ifcanseetarget
      {
        getplayer[THISACTOR].gotweapon SHRINKER_WEAPON temp2
        getplayer[THISACTOR].gotweapon GROW_WEAPON temp
        addammo SHRINKER_WEAPON CRYSTALAMMOAMOUNT
        ifvare temp2 0 ifvare temp 1 setplayer[THISACTOR].gotweapon SHRINKER_WEAPON 1

        quote 78
        ifspawnedby CRYSTALAMMO
          state getcode
        else
          state quikget
      }
enda

actor GROWAMMO
  fall
  ifmove RESPAWN_ACTOR_FLAG
    state respawnit
  else
    ifp pshrunk nullop
    else
      ifp palive
        ifpdistl RETRIEVEDISTANCE
          ifcount 6
            ifcanseetarget
      {
        getplayer[THISACTOR].gotweapon SHRINKER_WEAPON temp2
        getplayer[THISACTOR].gotweapon GROW_WEAPON temp
        addammo GROW_WEAPON GROWCRYSTALAMMOAMOUNT
        ifvare temp 0 ifvare temp2 1 setplayer[THISACTOR].gotweapon GROW_WEAPON 1

        quote 123
        ifspawnedby GROWAMMO
          state getcode
        else
          state quikget
      }


enda

actor SHRINKERSPRITE
  fall
  ifmove RESPAWN_ACTOR_FLAG
    state respawnit
  else
    ifp pshrunk nullop
    else
      ifp palive
        ifpdistl RETRIEVEDISTANCE
          ifcount 6
            ifcanseetarget
      {
        ifgotweaponce 0
          break
        getplayer[THISACTOR].gotweapon GROW_WEAPON temp
        addweapon SHRINKER_WEAPON 10
        ifvare temp 0 setplayer[THISACTOR].gotweapon GROW_WEAPON 0

        quote 60
        ifspawnedby SHRINKERSPRITE
          state getweaponcode
        else
          state quikweaponget
      }
enda

useractor notenemy GROWSPRITEICON 0
  fall
  ifspritepal 1 ifmultiplayer spritepal 0 else killit

  ifmove RESPAWN_ACTOR_FLAG
    state respawnit
  else
    ifp pshrunk nullop
    else
      ifp palive
        ifpdistl RETRIEVEDISTANCE
          ifcount 6
            ifcanseetarget
      {
        ifgotweaponce 0
          break
        getplayer[THISACTOR].gotweapon SHRINKER_WEAPON temp
        addweapon GROW_WEAPON 10
        ifvare temp 0 setplayer[THISACTOR].gotweapon SHRINKER_WEAPON 0

        quote 999
        ifspawnedby GROWSPRITEICON
          state getweaponcode
        else
          state quikweaponget
      }
enda

state babechecksquished
  ifsquished
  {
    sound SQUISHED
    state standard_bjibs
    state random_ooz
    killit
  }
ends

include VSeagull.con
include VDragon.con
include VBeachBather.con
include VBeachBabe.con

// -----------------------------------------------------------------------------

useractor notenemy 3831 0
// cstat 32768
 sizeat 12 13
 getactor[THISACTOR].sectnum temp
 getplayer[THISACTOR].cursectnum temp2
 ifvarvare temp temp2
   {
     setuserdef[THISACTOR].volume_number 2
     endofgame 13
   }
enda


useractor notenemy TIKIGOD 0 
     getactor[THISACTOR].cstat temp
     ifvarand temp 16 setactor[THISACTOR].mdflags 1
enda


onevent EVENT_ANIMATESPRITES
 ifactor GROWAMMO
   {
   // t->shade = (sintable[(totalclock<<4)&2047]>>10);
     setvarvar temp totalclock
     shiftvarl temp 4
     andvar temp 2047
     sin temp temp
     shiftvarr temp 10
     settspr[THISACTOR].tsprshade temp
   }
endevent

define title_x1 54
define title_x2 306
define title_y1 186
define title_y2 194
define title_zoom 32768

onevent EVENT_DISPLAYMENU
//  getplayer[THISACTOR].gm temp
//  ifvarand temp 4 nullop else
// {
  rotatesprite title_x1 title_y1 title_zoom 0 3838 0 0 0 0 0 xdim ydim
  rotatesprite title_x2 title_y2 title_zoom 0 3839 0 0 0 0 0 xdim ydim
// }
endevent

/*
onevent EVENT_DISPLAYTITLE
  rotatesprite title_x1 title_y1 title_zoom 0 3838 0 0 0 0 0 xdim ydim
  rotatesprite title_x2 title_y2 title_zoom 0 3839 0 0 0 0 0 xdim ydim
endevent
*/