* Ignite starts fire on a tile, it will burn rounds. Fuel of a tile is the highest fuel of its objects. * NOT the sum of the fuel of the objects! */
| 553 | * NOT the sum of the fuel of the objects! |
| 554 | */ |
| 555 | void Tile::ignite(int power) |
| 556 | { |
| 557 | if (getFlammability() != 255) |
| 558 | { |
| 559 | power = power - (getFlammability() / 10) + 15; |
| 560 | if (power < 0) |
| 561 | { |
| 562 | power = 0; |
| 563 | } |
| 564 | if (RNG::percent(power)) |
| 565 | { |
| 566 | if (_fire == 0) |
| 567 | { |
| 568 | _smoke = 15 - std::max(1, std::min((getFlammability() / 10), 12)); |
| 569 | _overlaps = 1; |
| 570 | _fire = getFuel() + 1; |
| 571 | _animationOffset = RNG::generate(0,3); |
| 572 | } |
| 573 | } |
| 574 | } |
| 575 | } |
| 576 | |
| 577 | /** |
| 578 | * Animate the tile. This means to advance the current frame for every object. |