diff options
| author | theo3 <arisstephenson2@gmail.com> | 2020-07-13 15:27:20 -0700 |
|---|---|---|
| committer | theo3 <arisstephenson2@gmail.com> | 2020-07-13 15:27:20 -0700 |
| commit | 62ddaaa5f6fe2dc2aaa2dd002d4ce0b1d61a3cc9 (patch) | |
| tree | d625ad1b183fc6aa5b56c00ce6573ef850679731 /src/enemy/bladeTrap.c | |
| parent | c47f16e5e7b0abb010133b3ee1a58099d8b8915d (diff) | |
add subdirs
Diffstat (limited to 'src/enemy/bladeTrap.c')
| -rw-r--r-- | src/enemy/bladeTrap.c | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/src/enemy/bladeTrap.c b/src/enemy/bladeTrap.c new file mode 100644 index 00000000..3c37d08a --- /dev/null +++ b/src/enemy/bladeTrap.c @@ -0,0 +1,34 @@ +#include "global.h" +#include "entity.h" +#include "room.h" +extern void sub_080A2CC0(); +extern void sub_0806F69C(); +extern void sub_08004488(); +extern Entity* GetCurrentRoomProperty(); + +void BladeTrap(Entity* ent) { + u16 uVar1; + Entity* pEVar2; + u16* puVar3; + if (ent->action == 0) { + ent->action = 1; + pEVar2 = GetCurrentRoomProperty((u8)(ent->entityType).form); + ent->attachedEntity = pEVar2; + sub_080A2CC0((EntityData*)ent, &ent->attachedEntity, &ent->field_0x74); + } + if ((ent->direction & 0x80) == 0) { + sub_0806F69C(ent); + } + + + + puVar3 = &(ent->field_0x74); + uVar1 = *puVar3; + *puVar3 = uVar1 - 1; + if ((*puVar3) == 0) { + if ((u16)(ent->direction & 0x80) == 0) { + sub_08004488(0x74); + } + sub_080A2CC0((EntityData*)ent, &ent->attachedEntity, puVar3); + } +} |
