Jass documentation Database

JASS Documentation Database REFORGED


Results for the query "ChangeElevatorWallBlocker" as a "function"

The search keyword must be a single word (no spaces).

Function ChangeElevatorWallBlocker

Line: 4465
Location: blizzard.j
Constant? no
Type: function
Arguments: real x, real y, real facing, boolean open
Returns: nothing

Preview

Extra spaces may have been removed from the original file to show the function in a comfortable way.
  1. function ChangeElevatorWallBlocker takes real x, real y, real facing, boolean open returns nothing
  2.     local destructable blocker = null
  3.     local real         findThreshold = 32
  4.     local real         nudgeLength   = 4.25 * bj_CELLWIDTH
  5.     local real         nudgeWidth    = 1.25 * bj_CELLWIDTH
  6.     local rect         r
  7.  
  8.     // Search for the pathing blocker within the general area.
  9.     set r = Rect(x - findThreshold, y - findThreshold, x + findThreshold, y + findThreshold)
  10.     set bj_elevatorWallBlocker = null
  11.     call RemoveRect(r)
  12.     set blocker = bj_elevatorWallBlocker
  13.  
  14.     // Ensure that the blocker exists.
  15.     if (blocker == null) then
  16.         set blocker = CreateDeadDestructable(bj_ELEVATOR_BLOCKER_CODE, x, y, facing, 1, 0)
  17.     elseif (GetDestructableTypeId(blocker) != bj_ELEVATOR_BLOCKER_CODE) then
  18.         // If a different destructible exists in the blocker's spot, ignore
  19.         // the request.  (Two destructibles cannot occupy the same location
  20.         // on the map, so we cannot create an elevator blocker here.)
  21.         return
  22.     endif
  23.  
  24.     if (open) then
  25.         // Ensure that the blocker is dead.
  26.         if (GetDestructableLife(blocker) > 0) then
  27.             call KillDestructable(blocker)
  28.         endif
  29.     else
  30.         // Ensure that the blocker is alive.
  31.         if (GetDestructableLife(blocker) <= 0) then
  32.             call DestructableRestoreLife(blocker, GetDestructableMaxLife(blocker), false)
  33.         endif
  34.  
  35.         // Nudge any objects standing in the blocker's way.
  36.         if (facing == 0) then
  37.             set r = Rect(x - nudgeWidth/2, y - nudgeLength/2, x + nudgeWidth/2, y + nudgeLength/2)
  38.             call NudgeObjectsInRect(r)
  39.             call RemoveRect(r)
  40.         elseif (facing == 90) then
  41.             set r = Rect(x - nudgeLength/2, y - nudgeWidth/2, x + nudgeLength/2, y + nudgeWidth/2)
  42.             call NudgeObjectsInRect(r)
  43.             call RemoveRect(r)
  44.         else
  45.             // Unrecognized blocker angle - don't nudge anything.
  46.         endif
  47.     endif
  48. endfunction
"That guy ’s nuts! Grab ’m!" Hmmm... there's no info about this keyword... be the first one in contribute with the keyword ChangeElevatorWallBlocker. You must be logged into the site in order to give us a hand in keeping updated the information. If you don't have an account, you can create one here.
Page loaded in 0.0762 seconds.
Vivir aprendiendo.co - A place for learning stuff, in Spanish   Chaos Realm - The world of Game modders and wc3 addicts   Diplo, a gaming community   Power of Corruption, an altered melee featuring Naga and Demon. Play it now!!!   WC3JASS.com - The JASS Vault + vJASS and Zinc   Jetcraft - A Starcraft II mod   WormTastic Clan (wTc)   Warcraft RESOURCES Reforged: Modelos, mapas, proyectos y mas...