MCPcopy Create free account
hub / github.com/diasurgical/devilution / Obj_FlameTrap

Function Obj_FlameTrap

Source/objects.cpp:1591–1632  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1589}
1590
1591void Obj_FlameTrap(int i)
1592{
1593 int x, y;
1594 int j, k;
1595
1596 if (object[i]._oVar2) {
1597 if (object[i]._oVar4) {
1598 object[i]._oAnimFrame--;
1599 if (object[i]._oAnimFrame == 1) {
1600 object[i]._oVar4 = 0;
1601 AddUnLight(object[i]._olid);
1602 } else if (object[i]._oAnimFrame <= 4) {
1603 ChangeLightRadius(object[i]._olid, object[i]._oAnimFrame);
1604 }
1605 }
1606 } else if (!object[i]._oVar4) {
1607 if (object[i]._oVar3 == 2) {
1608 x = object[i]._ox - 2;
1609 y = object[i]._oy;
1610 for (j = 0; j < 5; j++) {
1611 if (dPlayer[x][y] || dMonster[x][y])
1612 object[i]._oVar4 = 1;
1613 x++;
1614 }
1615 } else {
1616 x = object[i]._ox;
1617 y = object[i]._oy - 2;
1618 for (k = 0; k < 5; k++) {
1619 if (dPlayer[x][y] || dMonster[x][y])
1620 object[i]._oVar4 = 1;
1621 y++;
1622 }
1623 }
1624 if (object[i]._oVar4)
1625 ActivateTrapLine(object[i]._otype, object[i]._oVar1);
1626 } else {
1627 if (object[i]._oAnimFrame == object[i]._oAnimLen)
1628 object[i]._oAnimFrame = 11;
1629 if (object[i]._oAnimFrame <= 5)
1630 ChangeLightRadius(object[i]._olid, object[i]._oAnimFrame);
1631 }
1632}
1633
1634void Obj_Trap(int i)
1635{

Callers 1

ProcessObjectsFunction · 0.85

Calls 3

AddUnLightFunction · 0.85
ChangeLightRadiusFunction · 0.85
ActivateTrapLineFunction · 0.85

Tested by

no test coverage detected