Exemple #1
0
int ObjWat2::GetPassable(u32 index)
{
#if (__GNUC__ == 4 && __GNUC_MINOR__ == 4)
    // fixed: array subscript is above array bounds
    const u8 disabled[] = { 11, 12, 19, 22, 255 };
#else
    const u8 disabled[] = { 11, 12, 19, 22 };
#endif
    const u8 restricted[] = { 2, 20 };

    if(isShadow(index))
        return DIRECTION_ALL;
    else
    if(10 == index)
        return Direction::CENTER | Direction::TOP | Direction::LEFT | Direction::TOP_LEFT;
    else
    if(22 == index)
        return DIRECTION_CENTER_ROW | Direction::BOTTOM | Direction::BOTTOM_LEFT;
    else
    if(isAction(index) ||
        ARRAY_COUNT_END(disabled) != std::find(disabled, ARRAY_COUNT_END(disabled), index))
        return 0;

    return ARRAY_COUNT_END(restricted) != std::find(restricted, ARRAY_COUNT_END(restricted), index) ?
            DIRECTION_CENTER_ROW | DIRECTION_BOTTOM_ROW : DIRECTION_ALL;
}
Exemple #2
0
bool ObjDirt::isShadow(const u8 & index)
{
    const u8 shadows[] = { 0, 1, 5, 6, 14, 47, 52, 59, 62, 65, 68, 70, 72, 75, 78, 81, 84,
	    87, 91, 94, 97, 100, 103, 111, 114, 117, 126, 128, 136, 149, 150, 161, 165, 177, 181, 196, 200 };

    return ARRAY_COUNT_END(shadows) != std::find(shadows, ARRAY_COUNT_END(shadows), index);
}
Exemple #3
0
bool ObjWatr::isShadow(u32 index)
{
#if (__GNUC__ == 4 && __GNUC_MINOR__ == 4)
    // fixed: array subscript is above array bounds
    const u8 shadows [] = { 12, 38, 52, 55, 118, 166, 188, 240, 255 };
#else
    const u8 shadows [] = { 12, 38, 52, 55, 118, 166, 188, 240 };
#endif

    return ARRAY_COUNT_END(shadows) != std::find(shadows, ARRAY_COUNT_END(shadows), index);
}
Exemple #4
0
int ObjMnts2::GetPassable(int icn, u32 index)
{
    const u8 disabled1[] = { 6, 7, 8, 9, 14, 15, 16, 28, 29, 30, 31, 33, 34, 35, 50, 51, 52, 65, 77, 78, 87, 94, 99, 112 };

    if(isShadow(index)) return DIRECTION_ALL;
    // fix: disable passable: invalid top sprite
    if(icn == ICN::MTNDIRT &&
	(73 == index || 84 == index || 86 == index))
        return 0;

    return ARRAY_COUNT_END(disabled1) != std::find(disabled1, ARRAY_COUNT_END(disabled1), index) ?
	0 : DIRECTION_CENTER_ROW | DIRECTION_BOTTOM_ROW;
}
Exemple #5
0
int ObjMnts1::GetPassable(int icn, u32 index)
{
    const u8 disabled2[] = { 6, 7, 8, 9, 14, 15, 16, 28, 29, 30, 31, 33, 34, 35, 47, 48, 56, 57, 64, 67, 68, 69, 82 };

    if(isShadow(index)) return DIRECTION_ALL;
    else
    // fix: disable passable: invalid top sprite
    if(icn == ICN::MTNGRAS &&
        (25 == index || 43 == index || 44 == index || 53 == index || 54 == index || 78 == index))
        return 0;

    return ARRAY_COUNT_END(disabled2) != std::find(disabled2, ARRAY_COUNT_END(disabled2), index) ?
	0 : DIRECTION_CENTER_ROW | DIRECTION_BOTTOM_ROW;
}
Exemple #6
0
std::vector<u8> Skill::SecondarySkills(void)
{
    const u8 vals[] = { Secondary::PATHFINDING, Secondary::ARCHERY, Secondary::LOGISTICS, Secondary::SCOUTING,
			Secondary::DIPLOMACY, Secondary::NAVIGATION, Secondary::LEADERSHIP, Secondary::WISDOM, Secondary::MYSTICISM,
			Secondary::LUCK, Secondary::BALLISTICS, Secondary::EAGLEEYE, Secondary::NECROMANCY, Secondary::ESTATES };

    return std::vector<u8>(vals, ARRAY_COUNT_END(vals));
}
Exemple #7
0
u16 ObjDirt::GetPassable(const u8 & index)
{
    const u8 disabled[] = { 23, 24, 25, 26, 27, 28, 29, 30, 32, 33, 34, 35, 36, 37, 48, 49, 50, 51 };
    const u8 restricted[] = { 7, 9, 12, 13, 15, 16, 17, 18 ,19, 20, 21, 22, 40, 41, 42, 43, 44, 45,
	53, 54, 55, 56, 57, 58, 60, 61, 63, 64, 66, 67, 69, 71, 73, 74, 76, 77, 79, 80, 82, 83, 85,
	86, 88, 89, 90, 92, 93, 98, 99, 101, 102, 104, 105, 118, 123, 127, 130, 133, 134, 137, 139,
	152, 189 };

    if(isShadow(index))
        return DIRECTION_ALL;
    else
    if(isAction(index) ||
	ARRAY_COUNT_END(disabled) != std::find(disabled, ARRAY_COUNT_END(disabled), index))
        return 0;

   return ARRAY_COUNT_END(restricted) != std::find(restricted, ARRAY_COUNT_END(restricted), index) ?
            DIRECTION_CENTER_ROW | DIRECTION_BOTTOM_ROW : DIRECTION_ALL;
}
Exemple #8
0
int ObjWatr::GetPassable(u32 index)
{
#if (__GNUC__ == 4 && __GNUC_MINOR__ == 4)
    // fixed: array subscript is above array bounds
    const u8 disabled[] = { 11, 12, 19, 22, 255 };
#else
    const u8 disabled[] = { 11, 12, 19, 22 };
#endif
    const u8 restricted[] = { 69, 182, 183, 185, 186, 187, 248 };

    if(isShadow(index))
        return DIRECTION_ALL;
    else
    if(isAction(index) ||
        ARRAY_COUNT_END(disabled) != std::find(disabled, ARRAY_COUNT_END(disabled), index))
        return 0;

    return ARRAY_COUNT_END(restricted) != std::find(restricted, ARRAY_COUNT_END(restricted), index) ?
            DIRECTION_CENTER_ROW | DIRECTION_BOTTOM_ROW : DIRECTION_ALL;
}
Exemple #9
0
bool ObjMnts2::isShadow(u32 index)
{
    const u8 shadows2[] = { 0, 5, 11, 17, 21, 26, 32, 38, 42, 46, 47, 53, 57, 58, 62,
			    68, 72, 75, 79, 82, 85, 89, 92, 95, 98, 101, 104, 105, 109, 110 };
    return ARRAY_COUNT_END(shadows2) != std::find(shadows2, ARRAY_COUNT_END(shadows2), index);
}
Exemple #10
0
bool ObjMnts1::isShadow(u32 index)
{
    const u8 shadows1[] = { 0, 5, 11, 17, 21, 26, 32, 38, 42, 45, 49, 52, 55, 59, 62, 65, 68, 71, 74, 75, 79, 80 };
    return ARRAY_COUNT_END(shadows1) != std::find(shadows1, ARRAY_COUNT_END(shadows1), index);
}