MCPcopy Create free account
hub / github.com/OpenXcom/OpenXcom / ignite

Method ignite

src/Savegame/Tile.cpp:555–575  ·  view source on GitHub ↗

* 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! */

Source from the content-addressed store, hash-verified

553 * NOT the sum of the fuel of the objects!
554 */
555void 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.

Callers 4

prepareNewTurnMethod · 0.80
thinkMethod · 0.80
thinkMethod · 0.80
thinkMethod · 0.80

Calls 2

percentFunction · 0.85
generateFunction · 0.85

Tested by

no test coverage detected