Browse Source

New script- unsticks style meter (under S rank)

master
5 years ago
parent
commit
9217d790cc
2 changed files with 880 additions and 506 deletions
  1. 113
    0
      CEAs/style-rank-decay-under-S.CEA
  2. 767
    506
      DevilMayCry4SpecialEdition.CT

+ 113
- 0
CEAs/style-rank-decay-under-S.CEA View File

@@ -0,0 +1,113 @@
[enable]
alloc(rankdown,76)
alloc(rankup,39)
alloc(percentage,4)
alloc(upercentage,4)
registersymbol(percentage)
registersymbol(upercentage)
label(ret_from_rdown)
label(returnhere)
label(originalcode)
label(originalcode2)
label(exit_rdown)
label(exit_rup)
percentage:
//buffer combo gauge so the game will not constantly rank down through
dd (float)0.75
upercentage:
//buffer combo gauge so the game will not rank down immediately after rank up
dd (float)0.25
//going to unstick the style rank like DMC3
//this section concerns rank down logic
//when ranking down give a buffer value for the combo meter
//otherwise it'll simply fall through down to N rank
rankdown:
//xmm1 = combo gauge
//xmm2 = 0.0
//esi = style meter object
//OK to write over eax here
//game has checked if style rank is above 5
mov eax, [esi+20] //eax = style rank
comiss xmm1, xmm2 //check if combo gauge is above 0.0
ja originalcode //current combo gauge is above 0 so proceed as usual
cmp eax, 0 //check if player is at N rank
je originalcode //can't rank down for N, go to original code & exit
dec eax //rank down the player
mov [esi+20], eax //place new rank at style rank address
//Rank Up Threshhold Array Appears as:
//{+1cc,............,+1e4}
//{D, C, B, A, S, SS, SSS
//{0, 1, 2, 3, 4, 5, 6}
//Actual Corresponding Ranks:
//{N, D, C, B, A, S, SS, SSS}
//{0, 1, 2, 3, 4, 5, 6, 7}
//If we rank down from S -> A, we want to the threshhold to rank from A.
push ebx //safety, not entirely sure if can overwrite ebx w/o issues
mov ebx, [esi+eax*4+1cc] //ebx = rank up threshhold for current rank
//game only sticks for S and below
//the set of possible new ranks is {N, D, C, B, A}
cvtsi2ss xmm5, ebx
movss xmm2, [percentage]
mulss xmm5, xmm2
movss [esi+190], xmm5
pop ebx //restore ebx
xorps xmm2, xmm2 //restore xmm2, 0.0
xorps xmm5, xmm5 //restore xmm5, 0.0
originalcode:
//still need to do this
mov eax,esi
call DevilMayCry4SpecialEdition.exe+1B1220
exit_rdown:
jmp ret_from_rdown
"DevilMayCry4SpecialEdition.exe"+1B0B91:
jmp rankdown
nop
nop
ret_from_rdown:
//-----------------------------------------+
rankup:
//xmm0 = 0.0
//esi = style meter object
//eax = style rank
//OK to overwrite xmm0, ecx, xmm2
//game has already checked if style rank is below 5
//this is prior to the game assigning the new style rank
push eax //save style rank
inc eax //index for rank up threshhold
mov ecx, [esi+eax*4+1cc]
pop eax
cvtsi2ss xmm0, ecx //convert 4-byte to floating point
movss xmm2, [upercentage]
mulss xmm0, xmm2 //xmm0 = rankup threshold * 0.25
originalcode2:
movss [esi+00000190],xmm0
exit_rup:
jmp returnhere
"DevilMayCry4SpecialEdition.exe"+1B0CF1:
jmp rankup
nop
nop
nop
returnhere:
[disable]
dealloc(rankdown)
dealloc(rankup)
dealloc(percentage)
dealloc(upercentage)
"DevilMayCry4SpecialEdition.exe"+1B0B91:
mov eax,esi
call DevilMayCry4SpecialEdition.exe+1B1220
"DevilMayCry4SpecialEdition.exe"+1B0CF1:
movss [esi+00000190],xmm0

+ 767
- 506
DevilMayCry4SpecialEdition.CT
File diff suppressed because it is too large
View File


Loading…
Cancel
Save