update_terrain
Modify terrain types like obstacles, difficult terrain, or water in RPG encounters using efficient range-based operations for lines, shapes, and algebraic expressions.
Instructions
Add, remove, or modify terrain in an active encounter. ALWAYS prefer ranges over tiles arrays for efficiency.
TERRAIN TYPES:
obstacles: Blocking terrain (walls, rocks, fallen trees)
difficultTerrain: Half-speed terrain (mud, rubble, underbrush)
water: Watery terrain (streams, rivers, pools)
INPUT OPTIONS (use ranges for efficiency):
ranges: Array of range shortcuts (PREFERRED - saves tokens)
tiles: Array of "x,y" strings (only for specific scattered tiles)
RANGE SHORTCUTS (use these!):
LINES:
"x=N" - vertical line at x=N (full height)
"x=N:y1:y2" - vertical line segment
"y=N" - horizontal line at y=N (full width)
"y=N:x1:x2" - horizontal line segment
"line:x1,y1,x2,y2" - diagonal/any line from point to point (Bresenham)
"hline:y:x1:x2" - horizontal line
"vline:x:y1:y2" - vertical line
"row:N" / "col:N" - aliases for y=N / x=N
SHAPES:
"rect:x,y,w,h" - filled rectangle
"box:x,y,w,h" - hollow rectangle (border only)
"border:margin" - outer border of grid (margin=0 for edge)
"fill:x1,y1,x2,y2" - fill between two corners
"circle:cx,cy,r" - filled circle
"ring:cx,cy,r" - hollow circle
ALGEBRA (for curves, diagonals):
"y=x:0:99" - diagonal line (y equals x)
"y=2*x+5:0:50" - any linear equation
"y=x/2:0:99" - half-speed diagonal
"expr:EQUATION:xMin:xMax" - explicit expression format
EXAMPLES:
Maze outer walls (1 call vs 4): { "ranges": ["border:0"], "gridWidth": 100, "gridHeight": 100 }
Complex maze section: { "ranges": ["y=10:0:50", "x=25:10:40", "line:50,50,75,25", "box:60,60,15,15"] }
Diagonal river: { "terrainType": "water", "ranges": ["y=x:0:99"] }
Circular arena: { "ranges": ["ring:50,50,40", "border:0"] }
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||