fork/training-mode-ce

git clone https://git.julia.blue/fork/training-mode-ce

AitchMerge pull request #242 from NickCondron/remove-asm96edbd1

techchase-camera
1.6 KiB63 linesraw
1    # To be inserted at 8008f71c
2    .include "../../../Globals.s"
3    .include "../../../m-ex/Header.s"
4
5    .set entity, 31
6    .set playerdata, 31
7    .set player, 30
8    .set text, 29
9    .set textprop, 28
10    .set hitbool, 27
11
12##########################################################
13## 804a1f5c -> 804a1fd4 = Static Stock Icon Text Struct ##
14## Is 0x80 long and is zero'd at the start ##
15## of every VS Match ##
16## Store Text Info here ##
17##########################################################
18
19    # Get Victims Data
20    lwz r6, 0x2C(r31)
21    # Get Attacker GObj
22    lwz r5, 0x1868(r6)
23    # If Pointer doesn't exist, its most likely environmental damage (break the targets walls)
24    cmpwi r5, 0x0
25    beq ResetSDICount
26    # Check if Player
27    lhz r0, 0(r5)       # Entity Type
28    lwz r5, 0x2C(r5)    # Get Attacker Data
29    cmpwi r0, 4         # Player
30    beq LastPlayerMove
31    cmpwi r0, 6         # Item
32    beq LastItemMove
33    b exit              # If neither, exit
34
35LastPlayerMove:
36    # Get current Move Instance from attacker
37    lhz r4, 0x2088(r5)
38    b GetLastMoveVictimHitBy
39
40LastItemMove:
41    # Get current Move Instance from attacker
42    lhz r4, 0xDA8(r5)
43
44GetLastMoveVictimHitBy:
45    # Get last Move Instance Victim was hit by
46    lhz r3, TM_PreviousMoveInstanceHitBy(r6)
47
48    # If the move instance is 0, was most likely a stage element (corneria lasers)
49    cmpwi r4, 0
50    beq ResetSDICount
51
52    # Check If New Hit
53    cmpw r3, r4
54    beq exit
55
56# Reset SDI Counter
57ResetSDICount:
58    li r0, 0x0
59    sth r0, TM_SuccessfulSDIInputs (r6)
60    sth r0, TM_TotalSDIInputs (r6)
61
62exit:
63    cmpwi r30, 0