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
38
39
40
41
42
43
44
45
46
47
48
|
#include "KingSystem/ActorSystem/Awareness/actAwarenessDefs.h"
#include <container/seadSafeArray.h>
#include <utility/aglParameter.h>
#include "KingSystem/ActorSystem/Awareness/actAwareness.h"
namespace ksys::act {
sead::SafeArray<const char*, 13> sAwarenessTerrorTypes = sead::toArray({
"TerrorPlayer",
"TerrorNpc",
"TerrorEnemy",
"TerrorGuardian",
"TerrorImpulse",
"TerrorFire",
"TerrorInsect",
"TerrorHorse",
"TerrorAnimal",
"TerrorWolfLink",
"TerrorIce",
"TerrorElectric",
"TerrorManMadeFire",
});
sead::SafeArray<const char*, 23> sAwarenessSensorTypes = sead::toArray({
"Player", "PlayerBomb", "Horse", "Enemy", "Prey", "Predator", "Domestic", "Assassin",
"Giant", "NPC", "Material", "Food", "Weapon", "Spirit", "Carry", "Tree",
"WolfLink", "Chemical", "Bullet", "Door", "Captured", "Guardian", "All",
});
u32 getAwarenessTerrorFlags(u32 hash) {
for (u32 i = 0; i < u32(sAwarenessTerrorTypes.size()); ++i) {
if (Awareness::calcHash(sAwarenessTerrorTypes(i)) == hash)
return 1 << i;
}
// XXX: wouldn't returning 0 be a better idea?
return 0xffffffff;
}
u32 getAwarenessSensorFlags(u32 hash) {
for (u32 i = 0; i < u32(sAwarenessSensorTypes.size()); ++i) {
if (Awareness::calcHash(sAwarenessSensorTypes(i)) == hash)
return 1 << i;
}
return 0xffffffff;
}
} // namespace ksys::act
|