*** This script assigns the shade parameter to selected walls or walls of selected sectors to the sectors' floorshades/ceilingshades.

// Parameter list begins
mov r99 1 // 0 - get shade from ceilings, 1 - from floors
// Parameter list ends
~~~ Default parameters:
~~~ mov r99 1 // 0 - get shade from ceilings, 1 - from floors
mov r00 -1
for each selected sector r00
  if r99 != 0
    getsector r00 floorshade r01
  else
    getsector r00 ceilingshade r01
  endif
  getsector r00 wallptr r02
  getsector r00 wallnum r03
  add r03 r02
  while r02 < r03
    setwall r02 shade r01
    inc r02
  continue
continue

mov r00 -1
for each selected wall r00
  getwallsectnum r00 r02
  if r99 != 0
    getsector r02 floorshade r01
  else
    getsector r02 ceilingshade r01
  endif
  setwall r01 shade r00
continue