summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authornotyouraveragehooman <65437533+notyouraveragehooman@users.noreply.github.com>2020-06-13 14:51:28 -0700
committerGitHub <noreply@github.com>2020-06-13 14:51:28 -0700
commit6fdaee5d2ea9d9d94cafbca212aa0967df11feaa (patch)
treecce8daef8e379cbcf879567b8841315a94db3261 /src
parent60f1ea5913b736a8d09811e4945d32eaba81f656 (diff)
parente0b6a041f0be02898701d8bf546c366ff814aed8 (diff)
Merge pull request #8 from Macrepeh/master
bladeTrap
Diffstat (limited to 'src')
-rw-r--r--src/bladeTrap.c33
1 files changed, 33 insertions, 0 deletions
diff --git a/src/bladeTrap.c b/src/bladeTrap.c
new file mode 100644
index 00000000..ba37b3ae
--- /dev/null
+++ b/src/bladeTrap.c
@@ -0,0 +1,33 @@
+#include "global.h"
+#include "entity.h"
+#include "entityData.h"
+
+extern void sub_080A2CC0();
+extern void sub_0806F69C();
+extern void sub_08004488();
+extern Entity * sub_0804B128();
+
+void sub_08032358(Entity *ent)
+{
+ u16 uVar1;
+ Entity *pEVar2;
+ u16 *puVar3;
+ if (ent->action == 0) {
+ ent->action = 1;
+ pEVar2 = sub_0804B128((u8)(ent->entityType).parameter1);
+ ent->attachedEntity = pEVar2;
+ sub_080A2CC0((EntityData *)ent,&ent->attachedEntity,&ent->heldObjectPtr);
+ }
+ if ((ent->direction & 0x80) == 0) {
+ sub_0806F69C(ent);
+ }
+ (u32)puVar3 = &(ent->heldObjectPtr);
+ uVar1 = *puVar3;
+ *puVar3 = uVar1 - 1;
+ if ((u16)(*puVar3) == 0) {
+ if ((ent->direction & 0x80) == 0) {
+ sub_08004488(0x74);
+ }
+ sub_080A2CC0((EntityData *)ent,&ent->attachedEntity,puVar3);
+ }
+}