Subversion Repositories nw_plus

Rev

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

/*
--------------------------------------------------------------------------------
Duke: Nuclear Winter
By Joris Weimar
© 1997 Simply Silly Software
--------------------------------------------------------------------------------
Duke: Nuclear Winter Plus
By Hendricks266
--------------------------------------------------------------------------------
*/

definecheat 14 endepisode
definecheat 15 endlevel
definecheat 25 endvolume

include NWDefs.con
include NWUser.con

setgamename Duke: Nuclear Winter

gamevar picnum 0 2
gamevar temp 0 2
gamevar tempb 0 2
gamevar x 0 2
gamevar y 0 2
gamevar z 0 2

gamevar owner 0 2
gamevar temp2 0 2
gamevar temp3 0 2
gamevar temp4 0 2
gamevar ptemp 0 1
gamevar holodukeid 0 1
gamevar musicchange 0 1
gamevar skin DUKE 132097 // do not reset flag enabled

gamevar LOGO_FLAGS 767 0 // default; TEN screen reenabled

state cutsceneambience
  getactor[THISACTOR].lotag temp

  switch temp

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

    case FLY_BY
     setactor[THISACTOR].lotag FLY_BY2
    break

  endswitch
ends

onevent EVENT_LOADACTOR
  getactor[THISACTOR].picnum picnum
  switch picnum

   case SNOWYDOORSHOCK 
     spritepal 30
     cactor DOORSHOCK
   break

   case 3765 case 3766 case 3767 case 3768 cactor WOODENHORSE2 break

  // case PIGCOP case PIGCOPSTAYPUT case PIGCOPDIVE sizeat 48 40 break
   case SOBBOTWALK case SOBBOTFLY sizeat 42 36 break
   case ELFUZI case ELFUZISTAYPUT sizeat 32 27 break
   case ELFGUN case ELFGUNSTAYPUT sizeat 32 27 break
   case SNOWMAN sizeat 42 36 break

   case 1915
    cactor COMMANDER // failsafe fix for NWL5 bug
   break

   case MUSICANDSFX
     state cutsceneambience
   break

   case JETPACK
     ifspritepal 21 setvar temp 1
     spritepal 0
   break

/*
   case SNOWFLAKE
     cactor SNOW
     sizeat 8 8
   break
*/

   case XMASPRESENT
   case XMASPRESENT2
     getactor[THISACTOR].hitag temp
     setactor[THISACTOR].hitag 0
   break

  endswitch
endevent

onevent EVENT_EGS
 getactor[THISACTOR].picnum picnum
 getactor[THISACTOR].owner owner

 ifactor APLAYER setactor[THISACTOR].mdflags 16
 ifactor DUKETORSO setactor[THISACTOR].mdflags 16
 ifactor DUKEGUN setactor[THISACTOR].mdflags 16
 ifactor DUKELEG setactor[THISACTOR].mdflags 16
 ifactor DOORSHOCK setactor[THISACTOR].mdflags 16

 ifactor SNOW
   {
     sizeat 8 8

     setvar temp3 0
     randvar temp3 2047
     setactor[THISACTOR].ang temp3

     setvar temp2 -2047
     randvar temp2 2047

/*
     setvar temp3 0
     ifrnd 128 addvar temp3 4
     ifrnd 128 addvar temp3 8
     setactor[THISACTOR].cstat temp3
*/
   }
endevent

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

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

state nwbreakobject
  ifaction 0
  {
    action ANULLACTION
    cstator 257
  }
    ifhitweapon
    {
      ifdead
      {
        ifactor WOODSLATS
        {
          sound GLASS_HEAVYBREAK
          debris SCRAP3 5
          debris SCRAP4 3
          killit
        }
      else
        ifactor RIBBON
        {
          sound GLASS_HEAVYBREAK
          debris SCRAP3 5
          debris SCRAP4 3
          killit
        }
      else
        ifactor MYBOX
        {
          sound GLASS_HEAVYBREAK
          debris SCRAP3 5
          debris SCRAP4 3
          killit
        }
      else
        ifactor SNOWGIB killit
      else
        ifactor DRUNKELF
        {
          sound PRED_DYING
          guts JIBS6 2
          guts JIBS6 3
          guts JIBS6 4
          killit
        }
      else
        ifactor CHOOCHOOSLUT
        {
          sound GLASS_HEAVYBREAK
          debris SCRAP3 5
          debris SCRAP4 3
          killit
        }
      else
        ifactor HORSEPOWER
        {
          sound GLASS_HEAVYBREAK
          debris SCRAP3 5
          debris SCRAP4 3
          killit
        }
      else
        ifactor CHANDELIER
        {
          sound GLASS_BREAKING
          debris SCRAP3 3
          debris SCRAP4 4
          lotsofglass 10
          killit
        }
      else
        ifactor TREEWITHSOMETHING
        {
          sound GLASS_HEAVYBREAK
          debris SCRAP3 5
          ifrnd 96
          {
            ifrnd 64 spawn ATOMICHEALTH else spawn SHIELD
          }
          else
          {
            ifrnd 128 spawn STEROIDS else spawn FECES
          }
          killit
        }
      else
        ifactor SSPEAKER
        {
          debris SCRAP4 3
          killit
        }
      }
    }
ends

useractor notenemy WOODSLATS MEDIUMSTRENGTH state nwbreakobject enda

useractor notenemy RIBBON WEAK state nwbreakobject enda

useractor notenemy SSPEAKER WEAK state nwbreakobject enda

useractor notenemy MYBOX WEAK state nwbreakobject enda

useractor notenemy DRUNKELF WEAK state nwbreakobject enda

useractor notenemy CHOOCHOOSLUT WEAK state nwbreakobject enda

useractor notenemy HORSEPOWER WEAK state nwbreakobject enda

useractor notenemy SNOWGIB WEAK state nwbreakobject enda

useractor notenemy CHANDELIER WEAK state nwbreakobject enda

useractor notenemy TREEWITHSOMETHING TOUGH state nwbreakobject enda

actor JETPACK
  fall
  ifmove RESPAWN_ACTOR_FLAG
    state respawnit
  else
    ifp pshrunk nullop
    else
      ifp palive
        ifpdistl RETRIEVEDISTANCE
          ifcount 6
            ifpinventory GET_JETPACK JETPACK_AMOUNT
              ifcanseetarget
      {
        ifvare temp 1
        {
          addinventory GET_JETPACK JETPACK_NEAR_EMPTY
          quote 125
        }
        else
        {
          addinventory GET_JETPACK JETPACK_AMOUNT
          quote 41
        }
        ifspawnedby JETPACK
          state getcode
        else
          state quikget
      }
enda

action FEMHDANCE1 205 1 1 1 16
action FEMHDANCE3 205 1 1 1 26
action FEMHDANCE2 206 2 1 1 10



state nwbabecode
 getactor[THISACTOR].cstat temp
 ifvarand temp 1 nullop else addvar temp 1
 ifactor HALFBITCH { ifvarand temp 128 nullop else addvar temp 128 }
 ifvarand temp 256 nullop else addvar temp 256

 getuserdef .lockout temp2
 ifvare temp2 1
   {
     ifvarand temp 32768 nullop else addvar temp 32768
   }
 else
  // {
     ifvarand temp 32768 subvar temp 32768
  // }

 setactor[THISACTOR].cstat temp



  ifactor HALFBITCH nullop else fall

  ifaction FEMSHRUNK
  {
    ifcount SHRUNKDONECOUNT
    {
      action FEMANIMATE
      cstat 257
    }
    else
      ifcount SHRUNKCOUNT
        sizeto 40 40
    else
      state genericshrunkcode
  }
  else ifaction FEMGROW
  {
    ifcount 32
    {
      respawnhitag
      guts JIBS4 20
      guts JIBS6 20
      spritepal 6
      soundonce LADY_SCREAM
      ifactor SLUTASS debris SCRAP6 1
      sound SQUISH2
      killit
    }
    else
      sizeto MAXXSTRETCH MAXYSTRETCH
  }


  else
    ifaction FEMHDANCE1
  {
    ifactioncount 2
      action FEMHDANCE2
  }
  else
    ifaction FEMHDANCE2
  {
    ifactioncount 8
      action FEMHDANCE3
  }
  else
    ifaction FEMHDANCE3
  {
    ifactioncount 2
    action FEMANIMATE
  }
  else
    ifaction FEMFROZEN1
  {
    ifcount THAWTIME
    {
      action FEMANIMATE
      getlastpal
    }
    else
      ifcount FROZENDRIPTIME
    {
      ifactioncount 26
      {
        spawn WATERDRIP
        resetactioncount
      }
    }

    ifhitweapon
    {
      ifwasweapon FREEZEBLAST
      {
        strength 0
        break
      }
      lotsofglass 30
      sound GLASS_BREAKING
      respawnhitag
      ifrnd 84
        spawn BLOODPOOL
      killit
    }
    else
      ifp pfacing
        ifpdistl FROZENQUICKKICKDIST
          pkick
    break
  }
  else ifaction FEMFROZEN2
  {
    ifcount THAWTIME
    {
      action FEMANIMATE
      getlastpal
    }
    else
      ifcount FROZENDRIPTIME
    {
      ifactioncount 26
      {
        spawn WATERDRIP
        resetactioncount
      }
    }

    ifhitweapon
    {
      ifwasweapon FREEZEBLAST
      {
        strength 0
          break
      }

      lotsofglass 30

      sound GLASS_BREAKING
      ifrnd 84
        spawn BLOODPOOL
      respawnhitag

      ifrnd 128
        sound DUKE_HIT_STRIPPER1
      else
        sound DUKE_HIT_STRIPPER2

      killit
    }
    else
      ifp pfacing
        ifpdistl FROZENQUICKKICKDIST
          pkick
    break
  }

  ifhitweapon
  {
    ifdead
    {
      ifwasweapon GROWSPARK
      {
        cstat 0
        move 0
        sound ACTOR_GROWING
        action FEMGROW
        break
      }
      else ifwasweapon FREEZEBLAST
      {
        ifaction FEMSHRUNK
          break

          action FEMFROZEN1

        move 0
        spritepal 1
        strength 0

        sound SOMETHINGFROZE

        break
      }

      ifrnd 128
        sound DUKE_HIT_STRIPPER1
      else
        sound DUKE_HIT_STRIPPER2

      respawnhitag
      state standard_bjibs
      state random_wall_jibs
      spawn BLOODPOOL

        ifactor HALFBITCH
          money 3
      else
        ifactor SLUTASS
          money 3


        spritepal 6
        soundonce LADY_SCREAM
        ifactor NAKED1
          debris SCRAP3 18
        else
          ifactor PODFEM1
            debris SCRAP3 18
        killit
    }
    else
    {
      ifwasweapon SHRINKSPARK
      {
        sound ACTOR_SHRINKING
        move 0
        action FEMSHRUNK
        cstat 0
        break
      }
      else
        ifwasweapon GROWSPARK
          sound EXPANDERHIT


      sound SQUISH2

      guts JIBS6 1
    }
  }



  ifp pfacing
    ifpdistl 1280
      ifhitspace
  {
    tip
    ifrnd 128
      soundonce DUKE_TIP1
    else
      soundonce DUKE_TIP2
ifactor HALFBITCH
      action FEMHDANCE1
  }
ends

useractor notenemy HALFBITCH TOUGH
  state nwbabecode
enda

useractor notenemy SLUTASS TOUGH
  state nwbabecode
enda

state nwl3surprise
ifvare VOLUME 1
  {
    ifvare LEVEL 2
      {
        getactor[THISACTOR].sectnum temp
        switch temp
          case 220 case 221
            ifvarn musicchange 1
              {
                starttrack 12 // doom
                setvar musicchange 1
              }
          break
          case 563 case 564 case 565 case 566 case 567
            ifvarn musicchange 2
              {
                starttrack 13 // mario
                setvar musicchange 2
              }
          break
          case 192 case 193 case 194 case 195 case 196 case 197 case 198 case 237 case 238 case 239 case 240
          case 166 case 167 case 172 case 173 case 174 case 176 case 179
            ifvarn musicchange 0
              {
                starttrackvar LEVEL // level music
                setvar musicchange 0
              }
          break
        endswitch
      }
  }
ends

// Flying Frosty

/*
action ACOMMBREETH  0  3  5  1  40
action ACOMMFROZEN  0  1  5
action ACOMMSPIN   -5  1  5  1  12
action ACOMMGET   0  3  5  1  30
action ACOMMSHOOT  20  1  5   1 35
action ACOMMABOUTTOSHOOT 20 1 5 1 30
action ACOMMDYING  30  8  1  1  12
action ACOMMDEAD   38  1  1  1  1


move COMMGETUPVELS 128 -64
move COMMGETVELS 128 64
move COMMSLOW 64 24
move COMMSTOPPED

ai AICOMMWAIT ACOMMBREETH COMMSTOPPED faceplayerslow
ai AICOMMGET ACOMMGET COMMGETVELS seekplayer
ai AICOMMSHOOT ACOMMSHOOT COMMSTOPPED faceplayerslow
ai AICOMMABOUTTOSHOOT ACOMMABOUTTOSHOOT COMMSTOPPED faceplayerslow
ai AICOMMSPIN ACOMMSPIN COMMGETVELS spin
ai AICOMMDYING ACOMMDYING COMMSTOPPED faceplayer
ai AICOMMSHRUNK ACOMMGET COMMSLOW furthestdir
ai AICOMMGROW ACOMMGET COMMSTOPPED furthestdir
*/

move COMMGETUPVELSNW 128 -64
move COMMGETVELSNW 128 64
move COMMSLOWNW 64 24
move COMMSTOPPEDNW

action ACOMMSPINNW   0  1  5  1  12
action ACOMMSHOOTNW  20  1  5 1  16 // this is custom to shorten the delay between firing freezeblasts

ai AICOMMSPINNW ACOMMSPINNW COMMGETVELSNW spin
ai AICOMMSHOOTNW ACOMMSHOOTNW COMMSTOPPEDNW faceplayerslow

state checkcommhitstate

  ifhitweapon
  {
    debris SCRAP3 5
    ifdead
    {
      ifwasweapon FREEZEBLAST
      {
        break
      }
      else
        ifwasweapon GROWSPARK
      {
        sound ACTOR_GROWING
        ai AICOMMGROW
        break
      }

      addkills 1

      ifwasweapon RADIUSEXPLOSION
      {
        debris SCRAP3 5
        sound SQUISH2
        killit
      }
      else
        ifwasweapon RPG
      {
        sound SQUISH2
        debris SCRAP3 5
        state standard_jibs
        killit
      }

      debris SCRAP3 100
      sound COMM_DYING
      ai AICOMMDYING
    }
    else
    {
      soundonce COMM_PAIN
      ifwasweapon SHRINKSPARK
      {
        sound ACTOR_SHRINKING
        ai AICOMMSHRUNK
      }
      else
        ifwasweapon GROWSPARK
          sound EXPANDERHIT
      else
        ifrnd 24
          ai AICOMMABOUTTOSHOOT
    }
  }
ends

actor COMMANDERSTAYPUT COMMANDERSTRENGTH
  cactor COMMANDER
  ai AICOMMABOUTTOSHOOT
enda

actor COMMANDER COMMANDERSTRENGTH

  state checksquished

  ifaction ACOMMFROZEN
  {
    fall

    ifcount THAWTIME
    {
      getlastpal
      ai AICOMMWAIT
    }
    else
      ifcount FROZENDRIPTIME
    {
      ifactioncount 26
      {
        spawn WATERDRIP
        resetactioncount
      }
    }

    ifhitweapon
    {
      ifwasweapon FREEZEBLAST
      {
        strength 0
        break
      }
      addkills 1

      ifrnd 84
        spawn BLOODPOOL
      lotsofglass 30
      sound GLASS_BREAKING
      killit
    }
    ifp pfacing
      ifpdistl FROZENQUICKKICKDIST
        pkick
    break
  }
  ifai 0
    ai AICOMMSHOOTNW
  else
    ifai AICOMMWAIT
  {
    ifcount 20
    {
      ifcansee
      {
        ifcanshoottarget
        {
          ifrnd 96
            ai AICOMMGET
          else
            ai AICOMMABOUTTOSHOOT
        }
      }
      else
        ai AICOMMGET
    }
  }
  else
    ifai AICOMMABOUTTOSHOOT
  {
    ifactioncount 2
    {
      ifcansee
        ai AICOMMSHOOTNW
      else
      {
        ai AICOMMGET
        break
      }
    }
    ifrnd 32 soundonce COMM_ATTACK
  }
  else
    ifai AICOMMSHOOTNW
  {
    ifcanshoottarget
    {
      ifcount 12
        ifrnd 16
          ai AICOMMWAIT
        
      ifactioncount 1
      {
        shoot FREEZEBLAST
        resetactioncount
      }
 
      getplayer[THISACTOR].i temp
      getactor[temp].pal temp
      ifvare temp 1 // if player is frozen
        ai AICOMMGET
    }
    else
      ai AICOMMGET
  }
  else
    ifai AICOMMSHRUNK
  {
    ifcount SHRUNKDONECOUNT
      ai AICOMMGET
    else
      ifcount SHRUNKCOUNT
        sizeto 48 40
    else
      state genericshrunkcode
  }
  else
    ifai AICOMMGROW
      state genericgrowcode
  else
    ifai AICOMMGET
  {
    ifnotmoving
      ifrnd 4
        operate
    ifpdistl 1024
    {
      ifp palive
      {
        sound COMM_SPIN
        ai AICOMMSPINNW
        break
      }
      
      getplayer[THISACTOR].i temp
      getactor[temp].pal temp
      ifvare temp 1 // if player is frozen
      {
        sound COMM_SPIN
        ai AICOMMSPINNW
        break
      }
    }

    ifcansee
    {
      ifp phigher
        move COMMGETUPVELS getv geth faceplayer
      else
        move COMMGETVELS getv geth faceplayer
    }
    ifactioncount 8
      ifrnd 2
        ai AICOMMABOUTTOSHOOT
  }
  else
    ifai AICOMMSPINNW
  {
    soundonce COMM_SPIN
    ifcount 16
    {
      ifpdistl 1280
      {
        setvar tempb CAPTSPINNINGPLAYER
        mulvar tempb -1
        // addphealth CAPTSPINNINGPLAYER
        getplayer[THISACTOR].i temp
        setactor[temp].htextra tempb
        setactor[temp].htpicnum KNEE
        setactor[temp].htowner THISACTOR

        globalsound DUKE_GRUNT
        palfrom 32 16
        resetcount
      }
      else
        ifpdistg 2300
          ai AICOMMWAIT
    }
    ifactioncount 52
      ai AICOMMWAIT
    ifnotmoving
      ifrnd 32
        operate
  }

  ifai AICOMMDYING
  {
    fall
    strength 0

    ifhitweapon
      ifwasweapon RADIUSEXPLOSION
    {
      sound SQUISH2
      spawn BLOODPOOL
      state standard_jibs

      killit
    }

    ifaction ACOMMDYING
      ifactioncount 8
    {
      iffloordistl 8
        sound THUD
      cstat 0
      action ACOMMDEAD
    }
  }
  else
  {
    ifrnd 2
      soundonce COMM_ROAM
    state checkcommhitstate
  }
enda

// Frosted Battle Mobile

move TANKSTOPNW

useractor enemy TANK TANKSTRENGTH
    fall

//  sizeat 45 45
  ifaction 0
  {
    action ATANKWAIT
    cstat 257
    clipdist 100
  }
  else
    ifaction ATANKSPIN
  {
    soundonce TANK_ROAM

    ifactioncount 20
    {
      ifrnd 16
        ifcansee
          ifcanshoottarget
      {
        move TANKSTOPNW geth
        action ATANKSHOOTING
        stopsound TANK_ROAM
      }
    }

    ifrnd 16
      move TANKFORWARD seekplayer
  }
  else
    ifaction ATANKSHOOTING
  {
    ifactioncount 22
    {
      ifpdistg 8192
      {
        sound BOS1_ATTACK2
        shoot MORTER
      }
      resetcount
      move 0 action ATANKWAIT
    }
    else
      ifactioncount 2
    {
      ifcansee
      {
        ifpdistl 16384
        {
          ifrnd 128
          {


            sound PISTOL_FIRE
            shoot SHOTSPARK1
          }
        }
        else
          ifrnd 128
        {
          sound PRED_ATTACK
          shoot FIRELASER
        }
      }
      else
      {
        move TANKFORWARD seekplayer
        action ATANKSPIN
      }
    }

    ifrnd 16
    {
      stopsound TANK_ROAM
      move TANKSTOPNW faceplayerslow
    }
  }
  else
    ifaction ATANKWAIT
  {
    ifactioncount 32
    {
      move TANKFORWARD seekplayer
      action ATANKSPIN
    }
  }
  else
    ifaction ATANKDEAD
  {
    addkills 1
    hitradius 6144 TOUGH TOUGH TOUGH TOUGH
    sound LASERTRIP_EXPLODE
    debris SCRAP1 15
    spawn EXPLOSION2
    ifrnd 128 spawn SNOWMAN
    killit
  }

  ifhitweapon
  {
    ifdead
      action ATANKDEAD
    else
    {
      debris SCRAP1 1
      ifaction ATANKSHOOTING break

      ifrnd 192
      {
        move TANKSTOPNW geth
        action ATANKSHOOTING
        stopsound TANK_ROAM
      }
    }
  }

enda


include NWActor.con
include NWSnow.con

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

onevent EVENT_GAME
  ifactor APLAYER
  {
    state nwl3surprise
    
    getplayer[THISACTOR].holoduke_on holodukeid
    ifvarg holodukeid -1
      setactor[holodukeid].mdflags 16
    
   // addlogvar skin
  }
  ifactor FRAMEEFFECT1
    ifspawnedby APLAYER
      setactor[THISACTOR].mdflags 16

/*
  ifactor MONEY
    {
      setactor[THISACTOR].mdflags 16
      // getactor[THISACTOR].owner owner
      switch owner
      case SNOW case SNOWFLAKE case SNOWMAKER case SNOWMAKERNOMOVE
        getactor[THISACTOR].x x
        getactor[THISACTOR].y y
        getactor[THISACTOR].z z

        updatesectorz x y z temp
        ifvarn temp -1 getflorzofslope temp x y temp2 else killit

        ifvarvare z temp2 killit
      break
      endswitch
    }
*/
endevent

onevent EVENT_ANIMATESPRITES

 ifvare picnum DOORSHOCK
   {
     ifspritepal 30 settspr[THISACTOR].tsprpicnum 3656
     ifvare VOLUME 1 ifvare LEVEL 2 settspr[THISACTOR].tsprpicnum 3656
     break
   }
 ifvare picnum SNOWFLAKE
   {
     settspr[THISACTOR].tsprpicnum SNOW
     settspr[THISACTOR].tsprxrepeat 4
     settspr[THISACTOR].tspryrepeat 4
     break
   }
/*
 ifvare picnum MONEY
   {
      switch owner
      case SNOW case SNOWFLAKE case SNOWMAKER case SNOWMAKERNOMOVE
        settspr[THISACTOR].tsprpicnum SNOW
      break
      endswitch
   }
*/
 
  switch picnum
    case APLAYER
      ifvare skin SANTA
      {
        gettspr[THISACTOR].tsprpicnum temp3
        ifvarg temp3 1399 ifvarl temp3 1544 addvar temp3 4096
        settspr[THISACTOR].tsprpicnum temp3

        ifvarg holodukeid -1
        {
          gettspr[holodukeid].tsprpicnum temp3
          ifvarg temp3 1399 ifvarl temp3 1544 addvar temp3 4096
          settspr[holodukeid].tsprpicnum temp3
        }
      }
      break
 
    case FRAMEEFFECT1
      ifvare skin SANTA
        ifspawnedby APLAYER
        {
          gettspr[THISACTOR].tsprpicnum temp3
          ifvarg temp3 1399 ifvarl temp3 1544 addvar temp3 4096
          settspr[THISACTOR].tsprpicnum temp3
        }
      break
 
    case DUKETORSO
    case DUKEGUN
      getactor[owner].picnum temp2
      ifvare temp2 SOBBOTWALK
      {
        gettspr[THISACTOR].tsprpicnum temp3
        addvar temp3 2456
        settspr[THISACTOR].tsprpicnum temp3
      }
      ifvare temp2 SOBBOTFLY
      {
        gettspr[THISACTOR].tsprpicnum temp3
        addvar temp3 2456
        settspr[THISACTOR].tsprpicnum temp3
      }
      ifvare temp2 APLAYER
      {
        ifvare skin SANTA
        {
          gettspr[THISACTOR].tsprpicnum temp3
          addvar temp3 2456
          settspr[THISACTOR].tsprpicnum temp3
        }
      }
      break

    case DUKELEG
      getactor[owner].picnum temp2
      ifvare temp2 SOBBOTWALK settspr[THISACTOR].tsprpal 30
      ifvare temp2 SOBBOTFLY settspr[THISACTOR].tsprpal 30
      ifvare temp2 APLAYER ifvare skin SANTA settspr[THISACTOR].tsprpal 30
      break
  endswitch

 ifvare picnum APLAYER // this fixes the bug with the misplaced TV screen tiles
   {
     gettspr[THISACTOR].tsprpicnum temp
     switch temp
      case 1470 case 1471 case 1472 case 1473 case 1474
       subvar temp 5
       settspr[THISACTOR].tsprpicnum temp
      break
     endswitch
   }
endevent




useractor notenemy NWEFFECTOR 0 
  cstat 32768
  // sizeat 1 1

  ifspritepal 31 // phone ringing effect
  {
    /*
    getplayer[THISACTOR].cursectnum temp3
    switch temp3
      case 60 case 61 case 62 case 63
      case 86 case 87
      case 299 case 300 case 301 case 302 case 303 case 304 case 305 case 306 case 307 case 308 case 309
      case 310 case 311 case 312 case 313 case 314 case 315 case 316 case 317
        soundonce PHONE_RING
        break

      default
        stopsound PHONE_RING
        break
    endswitch
    */

    ifpdistl 8192 // 4096
      soundonce PHONE_RING
    ifpdistg 16384
      stopsound PHONE_RING

    ifpdistl RETRIEVEDISTANCE
      ifp pfacing
        ifhitspace
          ifvare temp2 0
          {
            setvar temp 0
            setvar temp2 1
            setvar temp3 0
            setvar tempb 0
          }

    ifvare temp2 1
    {
      addvar temp 1

      stopsound PHONE_RING
      ifvare temp 1
        sound PHONE_PICKUP
      else ifvare temp 30
      {
        setvar tempb 0
        randvar tempb 3

        switch tempb
          case 0
            sound LOWANG1
            setvar temp3 57
            break
          case 1
            sound LOWANG2
            setvar temp3 124
            break
          case 2
            sound LOWANG3
            setvar temp3 121
            break
          case 3
            sound LOWANG4
            setvar temp3 156
            break
        endswitch

        addvar temp3 60
        setvar tempb 0
      }
      else ifvarvare temp temp3
      {
        sound PHONE_HANGUP
        setvarvar tempb temp3
        addvar tempb 150
      }
      else ifvarvare temp tempb
      {
        setvar temp2 0
        setvar temp 0
      }
    }
  }
enda

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

action WOODENHORSE2FRAME  0   1   5
action WOODEN2FALLFRAME  -2738  1   5
useractor notenemy WOODENHORSE2 WEAK WOODENHORSE2FRAME
  fall
  ifhitweapon
  {
    ifdead
    {
      debris SCRAP1 4
      debris SCRAP2 3
      killit
    }
    else
      action WOODEN2FALLFRAME
  }
enda

useractor notenemy NWSTEAM 0 
  ifpdistl 6144
    soundonce STEAM_HISSING
enda

define title_x1 73
define title_x2 306
define title_y 194
define title_zoom 32768

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

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