Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- X = Attack
- Z = PickUp
- 指定足場のPrev/Nextがない場合クラッシュする場合有
- */
- [Enable]
- Alloc(AutoMove, 512)
- Label(AutoMove_Ending)
- Label(SetDirection)
- Label(SD_Ending)
- Label(TurnLeft)
- Label(AutoAttack)
- Label(AutoPickUp)
- Label(SD_Attack)
- Label(TurnRight)
- Label(SD_Turn)
- Label(SetRight)
- Label(SetLeft)
- Label(SetTimer)
- Alloc(MoveFlag, 12)
- MoveFlag:
- dd 1//Flag
- dd 0//Time
- dd 0//Last
- AutoMove:
- call SetDirection
- mov [esp+20],eax
- AutoMove_Ending:
- jmp 01517433
- SetDirection:
- push ecx
- push edx
- push ebx
- push [MyPlatformID]
- call PlatformFinder
- test eax,eax
- je SD_Ending
- /*
- mov edx,[eax+10]//Left
- mov ebx,[eax+18]//Right
- */
- //this code may cause crashes
- mov edx,[eax+64]//Prev
- mov edx,[edx+10]
- mov ebx,[eax+68]//Next
- mov ebx,[ebx+18]
- mov ecx,[01CCBC74]
- test ecx,ecx
- je SD_Ending
- cmp [MoveFlag],1
- je SetRight
- cmp [MoveFlag],-1
- je SetLeft
- jmp SD_Attack
- SetRight:
- call AutoPickUp
- cmp [ecx+4C80],ebx
- jl SD_Ending
- mov [MoveFlag+8],-1
- call SetTimer
- jmp TurnLeft
- SetLeft:
- call AutoPickUp
- cmp [ecx+4C80],edx
- jg SD_Ending
- mov [MoveFlag+8],1
- call SetTimer
- jmp TurnRight
- SetTimer:
- mov [MoveFlag],0
- call winmm.timeGetTime
- mov [MoveFlag+4],eax
- ret
- TurnLeft:
- mov eax,-1
- pop ebx
- pop edx
- pop ecx
- ret
- TurnRight:
- mov eax,1
- pop ebx
- pop edx
- pop ecx
- ret
- SD_Turn:
- mov eax,[MoveFlag+8]
- mov [MoveFlag],eax
- jmp SD_Ending
- SD_Attack:
- call winmm.timeGetTime
- sub eax,[MoveFlag+4]
- cmp eax,BB8
- ja SD_Turn
- call AutoAttack
- SD_Ending:
- mov eax,[MoveFlag]
- pop ebx
- pop edx
- pop ecx
- ret
- AutoAttack:
- pushad
- push 58
- push 002D0000
- mov ecx,[01CCBC74]
- call 0140AA10
- popad
- ret
- AutoPickUp:
- pushad
- push 5A
- push 002C0000
- mov ecx,[01CCBC74]
- call 0140AA10
- popad
- ret
- 01517003:
- jmp AutoMove
- db 90 90 90
- [Disable]
- 01517003:
- cmp eax,edi
- jne 01517433
- DeAlloc(AutoMove)
- DeAlloc(MoveFlag)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement