summaryrefslogtreecommitdiff
path: root/src/REL/d/t/d_t_heat_resist.cpp
blob: 045cce17ff3580ac2c994555ffdf4239e6262b74 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#include "d/t/d_t_heat_resist.h"

#include "d/a/d_a_player.h"
#include "f/f_base.h"
#include "toBeSorted/area_math.h"

SPECIAL_ACTOR_PROFILE(TAG_HEAT_RESIST, dTgHeatResist_c, fProfile::TAG_HEAT_RESIST, 0x223, 0, 4);

int dTgHeatResist_c::create() {
    mInverted = static_cast<u8>(mParams & 0x3);

    matrixCreateFromPosRotYScale(matrix, mPosition, mRotation.y, mScale, nullptr, 0.0f);
    return SUCCEEDED;
}

int dTgHeatResist_c::doDelete() {
    return SUCCEEDED;
}

int dTgHeatResist_c::actorExecute() {
    dAcPy_c *player = dAcPy_c::LINK;

    if (mInverted == 1) {
        if (!checkAreaBox(matrix, player->mPosition)) {
            player->onForceOrPreventActionFlags(0x8000000);
        }
    } else {
        if (checkAreaBox(matrix, player->mPosition)) {
            player->onForceOrPreventActionFlags(0x8000000);
        }
    }
    return SUCCEEDED;
}

int dTgHeatResist_c::draw() {
    return SUCCEEDED;
}