AI攻击
0043AC2F |. 8A45 F8 MOV AL,BYTE PTR SS:[EBP-8]
0043AC32 |. 50 PUSH EAX <——被攻击方的战场编号压入0C栈
0043AC33 |. 8B4D F0 MOV ECX,DWORD PTR SS:[EBP-10]
0043AC36 |. 8A51 04 MOV DL,BYTE PTR DS:[ECX+4]
0043AC39 |. 52 PUSH EDX <——攻击方的战场编号压入08栈
0043AC3A |. B9 F0274900 MOV ECX,004927F0
0043AC3F |. E8 ADB8FCFF CALL 004064F1
玩家点击攻击
0043DB3E |. 8A45 F8 MOV AL,BYTE PTR SS:[EBP-8]
0043DB41 |. 50 PUSH EAX <——被攻击方的战场编号压入0C栈
0043DB42 |. 8B4D F4 MOV ECX,DWORD PTR SS:[EBP-C]
0043DB45 |. 8A51 04 MOV DL,BYTE PTR DS:[ECX+4]
0043DB48 |. 52 PUSH EDX <——攻击方的战场编号压入08栈
0043DB49 |. B9 F0274900 MOV ECX,004927F0
0043DB4E |. E8 9E89FCFF CALL 004064F1
反击
004064DA |. 8A02 MOV AL,BYTE PTR DS:[EDX]
004064DC |. 50 PUSH EAX <——原攻击方的战场编号压入0C栈变成被攻击方
004064DD |. 8B4D F0 MOV ECX,DWORD PTR SS:[EBP-10]
004064E0 |. 8A51 01 MOV DL,BYTE PTR DS:[ECX+1]
004064E3 |. 52 PUSH EDX <——原被攻击方的战场编号压入08栈变成攻击方
004064E4 |. 8B4D F0 MOV ECX,DWORD PTR SS:[EBP-10] <——4927F0
004064E7 |. E8 05000000 CALL 004064F1
另外还有两个地方是引导攻击的,不贴了,分别在AI攻击和玩家点击攻击的下面。
004064F1 /$ 55 PUSH EBP
004064F2 |. 8BEC MOV EBP,ESP
004064F4 |. 51 PUSH ECX
004064F5 |. 894D FC MOV DWORD PTR SS:[EBP-4],ECX
004064F8 |. 8A45 0C MOV AL,BYTE PTR SS:[EBP+C]
004064FB |. 50 PUSH EAX ; /Arg2
004064FC |. 8A4D 08 MOV CL,BYTE PTR SS:[EBP+8] ; |
004064FF |. 51 PUSH ECX ; |Arg1
00406500 |. 8B4D FC MOV ECX,DWORD PTR SS:[EBP-4] ; |
00406503 |. E8 F4FCFFFF CALL 004061FC
4061FC会将攻防双方的战场编号存入4927F0开始的各个内存位置中,再经过各种计算算出攻击处理所需要的一系列数据存进内存中,后面的各种处理就可以直接从4927F0+XX中读出使用。
00406508 |. 8B55 FC MOV EDX,DWORD PTR SS:[EBP-4]
0040650B |. C682 08060000 >MOV BYTE PTR DS:[EDX+608],0
00406512 |. EB 15 JMP SHORT 00406529
00406514 |> 8B45 FC /MOV EAX,DWORD PTR SS:[EBP-4]
00406517 |. 8A88 08060000 |MOV CL,BYTE PTR DS:[EAX+608]
0040651D |. 80C1 01 |ADD CL,1
00406520 |. 8B55 FC |MOV EDX,DWORD PTR SS:[EBP-4]
00406523 |. 888A 08060000 |MOV BYTE PTR DS:[EDX+608],CL
00406529 |> 8B45 FC MOV EAX,DWORD PTR SS:[EBP-4]
0040652C |. 33C9 |XOR ECX,ECX
0040652E |. 8A88 08060000 |MOV CL,BYTE PTR DS:[EAX+608]
00406534 |. 83F9 02 |CMP ECX,2
00406537 |. 7D 28 |JGE SHORT 00406561
00406539 |. 8B4D FC |MOV ECX,DWORD PTR SS:[EBP-4]
0040653C |. E8 C2F8FFFF |CALL 00405E03
00406541 |. 8B4D FC |MOV ECX,DWORD PTR SS:[EBP-4]
00406544 |. E8 FBF1FFFF |CALL 00405744
00406549 |. 8B4D FC |MOV ECX,DWORD PTR SS:[EBP-4]
0040654C |. E8 38F3FFFF |CALL 00405889
00406551 |. 8B4D FC |MOV ECX,DWORD PTR SS:[EBP-4]
00406554 |. E8 28FCFFFF |CALL 00406181
00406559 |. 85C0 |TEST EAX,EAX
0040655B |. 75 02 |JNZ SHORT 0040655F
0040655D |. EB 02 |JMP SHORT 00406561
0040655F |>^EB B3 \JMP SHORT 00406514
00406561 |> 8B4D FC MOV ECX,DWORD PTR SS:[EBP-4]
00406564 |. E8 03F7FFFF CALL 00405C6C
00406569 |. 8B4D FC MOV ECX,DWORD PTR SS:[EBP-4]
0040656C |. E8 29FEFFFF CALL 0040639A
00406571 |. 8BE5 MOV ESP,EBP
00406573 |. 5D POP EBP
00406574 \. C2 0800 RETN 8
[ 本帖最后由 godtype 于 2011-4-16 09:52 编辑 ]
|