Screeps Creep.attack(): Melee Range, ATTACK Parts, and Return Codes
Use Creep.attack() with the correct range-1 boundary, active ATTACK parts, documented return codes, Rampart behavior, and later-tick verification.
TOPIC · 9 GUIDES
Focused English articles connected to defense, organized with the same filters used by the main article library.
Use Creep.attack() with the correct range-1 boundary, active ATTACK parts, documented return codes, Rampart behavior, and later-tick verification.
Find injured owned Creeps, rank lower hit ratios before missing hits and nearest-Tower range, require active owned Towers with TOWER_ENERGY_COST, save heal() results, avoid caching stale targets, and leave over-heal optimization to a later dispatcher.
Route every Safe Mode request through one final per-tick dispatcher, bind the exact Controller ID, disable the request before activateSafeMode(), and verify activation consumption on the next tick.
Bind one reviewed boolean change to the exact Rampart, reserve that ID for the tick, record pending evidence only after OK, and verify the same object's isPublic state on the next tick.
Bind confirmation to the exact Extension and owned room, block hostile Creeps and Power Creeps, submit one queued destroy call, then distinguish original-ID removal from a later replacement at the tile.
Set room-specific Wall and Rampart stages, reserve targets across repairers, record only accepted repair calls, and verify the exact Repairer-to-structure EVENT_REPAIR on the next tick.
Bind confirmation to the exact Nuker and target, record only an accepted launch, verify the launcher's zeroed resources and cooldown, and match the exact Nuke object when target vision exists.
Bind one target and each Tower ID, estimate range- and Power-adjusted output for allocation, submit one attack intent per Tower, then verify exact prior-tick ranged-attack events instead of inferring a volley from net hits.
Preserve a defense Energy reserve, select an ordinary damaged structure, estimate range-adjusted repair to limit over-repair, submit one intent per Tower, then verify exact prior-tick repair events and Energy spent.