Bomb
| Bomb | |
|---|---|
| ZZT-OOP name | bomb |
| Internal ID | 14 (0x0E) |
| Character | #char 11 ♂ (0x0B) |
| Category | item |
| Stats | |
| Default cycle | 6 |
| P1 | Bomb Timer |
| Other traits | |
| Effect on movement | Pushable |
| Destructible? | no |
| Uses ZZT-OOP color names? | Yes |
The bomb is a single-use explosive item capable of damaging the player, destroying built-in enemies, destroying breakable walls, and interacting with objects.
When an unlit bomb is touched by the player or a player clone, the message "Bomb activated!" is displayed. The bomb then counts down from 9 to 2 each tick, before exploding on the next tick, and then deleting itself and the explosion on the tick after that. Note that despite being pushable, that bombs are not pushed by the player on the tick that they are activated.
The bomb's explosion covers a radius of 50 pixels surrounding the bomb (which is 15 tiles wide at the widest point and 9 tiles tall, or the same as the torch radius). The message bombed is sent to objects within the explosion radius. The explosion damages the player for 10 health (even if energized). Elements marked as "destructible" are destroyed, which includes gems, bullets, all built-in enemies (except for sharks and slimes), and player clones. Stars are also destroyed, despite being otherwise considered indestructible. Breakable walls and empty tiles within the explosion radius are turned into randomly colored breakables (within the range of ZZT-OOP colors). On the following cycle, all breakables within the bomb's radius are replaced with empties.
Quirks
It is possible for some breakables created by the bomb's explosion to linger on the board if the bomb is moved between the tick it explodes and the tick it cleans up its explosion (e.g. if a player was pushing a bomb into a built-in enemy). Bomb explosions can also linger if the bomb is deleted between the explosion and clean-up ticks, or if the breakables are changed into another element between those ticks.
Bombs display the character #char 11 ♂ (0x0B) if their P1 value is 0 or 1. Otherwise, they display the character corresponding to P1 + 48 mod 256. Thus, the only characters that cannot be displayed by bombs are #char 48 0 (0x30) and #char 49 1 (0x31). With this quirk, cycle 0 bombs can be used as pushable text.
Statless bombs will modify the P1 variable of the dummy stat while trying to tick, which is generally benign.
| Elements | |
|---|---|
| Special | |
| Items | |
| Terrain | |
| Creatures | |
| Text | |