MCPcopy Create free account
hub / github.com/OpenDUNE/OpenDUNE / Script_Unit_ExplosionMultiple

Function Script_Unit_ExplosionMultiple

src/script/unit.c:553–567  ·  view source on GitHub ↗

* Make 8 explosions: 1 at the unit, and 7 around him. * It does damage to the surrounding units with predefined damage, but * anonymous. * * Stack: 1 - The radius of the 7 explosions. * * @param script The script engine to operate on. * @return The value 0. Always. */

Source from the content-addressed store, hash-verified

551 * @return The value 0. Always.
552 */
553uint16 Script_Unit_ExplosionMultiple(ScriptEngine *script)
554{
555 Unit *u;
556 uint8 i;
557
558 u = g_scriptCurrentUnit;
559
560 Map_MakeExplosion(EXPLOSION_DEATH_HAND, u->o.position, Tools_RandomLCG_Range(25, 50), 0);
561
562 for (i = 0; i < 7; i++) {
563 Map_MakeExplosion(EXPLOSION_DEATH_HAND, Tile_MoveByRandom(u->o.position, STACK_PEEK(1), false), Tools_RandomLCG_Range(75, 150), 0);
564 }
565
566 return 0;
567}
568
569/**
570 * Makes the current unit fire a bullet (or eat its target).

Callers

nothing calls this directly

Calls 3

Map_MakeExplosionFunction · 0.85
Tools_RandomLCG_RangeFunction · 0.85
Tile_MoveByRandomFunction · 0.85

Tested by

no test coverage detected