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

Method damage

src/Savegame/Tile.cpp:480–486  ·  view source on GitHub ↗

* damage terrain - check against armor * @param part Part to check. * @param power Power of the damage. * @return bool Return true objective was destroyed */

Source from the content-addressed store, hash-verified

478 * @return bool Return true objective was destroyed
479 */
480bool Tile::damage(int part, int power)
481{
482 bool objective = false;
483 if (power >= _objects[part]->getArmor())
484 objective = destroy(part);
485 return objective;
486}
487
488/**
489 * Set a "virtual" explosive on this tile. We mark a tile this way to detonate it later.

Callers 3

prepareNewTurnMethod · 0.45
hitMethod · 0.45
explodeMethod · 0.45

Calls 1

getArmorMethod · 0.45

Tested by

no test coverage detected