Thread: Development: Ability Resource Thread
View Single Post
  #185    
Old November 8th, 2015 (3:51 AM). Edited December 8th, 2015 by MrDollSteak.
MrDollSteak's Avatar
MrDollSteak MrDollSteak is offline
Formerly known as 11bayerf1
     
    Join Date: Dec 2008
    Location: Hong Kong
    Age: 23
    Gender: Male
    Posts: 842
    Sorry for the long delay, but here are the Type Change Abilities! Credits to Kleenexfeu for the original routines, I've just optimised them and added Normalize.

    Normalize, Refrigerate, Pixilate and Aerilate

    Spoiler:
    Fire Red
    Spoiler:
    Code:
    .text
    .align 2
    .thumb
    .thumb_func
    .global typechangeabilities
    
    BufferAbility:
    	mov r0, r6
    	add r0, #0x20
    	ldrb r1, [r0]
    NormalCheck:
    	mov r0, r9
    	cmp r0, #0x0
    	bne NormalizeCheck
    RefrigerateCheck:
    	cmp r1, #0xAF
    	bne PixilateCheck
    Refrigerate:
    	mov r0, #0xF
    	b StoreType
    PixilateCheck:
    	cmp r1, #0xB7
    	bne AerilateCheck
    Pixilate:
    	mov r0, #0x17
    	b StoreType
    AerilateCheck:
    	cmp r1, #0xB9
    	bne Return
    Aerilate:
    	mov r0, #0x2
    StoreType:
    	mov r9, r0
    	ldr r0, .ChangeTypeLoc
    	ldr r1, [r0]
    	add r1, #0x13
    	ldrb r1, [r1]
    	mov r2, #0x3F
    	and r2, r1
    	cmp r2, #0x0
    	bne Return
    	mov r2, r9
    	strb r2, [r1]
    Boost:
    	mov r0, r8
    	mov r1, #0xA7
    	mul r0, r1
    	lsr r0, #0x7
    	mov r8, r0
    	mul r7, r1
    	lsr r7, #0x7
    	b Return
    NormalizeCheck:
    	cmp r1, #0x61
    	bne Return
    Normalize:
    	mov r0, #0x0
    	mov r9, r0
    Return:
    	ldr r0, [sp, #0x4]
    	ldrh r0, [r0, #0xA]
    	str r0, [sp, #0x18]
    	ldrh r0, [r6, #0x2E]
    	cmp r0, #0xAF
    	bne NoEnigmaBerry
    	ldr r1, .Return
    	bx r1
    NoEnigmaBerry:
    	ldr r0, .Return2
    	bx r0
    
    .align 2
    .ChangeTypeLoc: .word 0x02023FE8
    .Return: .word 0x0803ED87
    .Return2: .word 0x0803EDA1
    
    Insert 01 48 00 47 00 00 xx+1 xx xx 08 at 0803ED7A

    Emerald
    Spoiler:
    Code:
    .text
    .align 2
    .thumb
    .thumb_func
    .global typechangeabilities
    
    BufferAbility:
    	mov r0, r6
    	add r0, #0x20
    	ldrb r1, [r0]
    NormalCheck:
    	mov r0, r10
    	cmp r0, #0x0
    	bne NormalizeCheck
    RefrigerateCheck:
    	cmp r1, #0xAF
    	bne PixilateCheck
    Refrigerate:
    	mov r0, #0xF
    	b StoreType
    PixilateCheck:
    	cmp r1, #0xB7
    	bne AerilateCheck
    Pixilate:
    	mov r0, #0x17
    	b StoreType
    AerilateCheck:
    	cmp r1, #0xB9
    	bne Return
    Aerilate:
    	mov r0, #0x2
    StoreType:
    	mov r10, r0
    	ldr r0, .ChangeTypeLoc
    	ldr r1, [r0]
    	add r1, #0x13
    	ldrb r1, [r1]
    	mov r2, #0x3F
    	and r2, r1
    	cmp r2, #0x0
    	bne Return
    	mov r2, r10
    	strb r2, [r1]
    Boost:
    	mov r0, r8
    	mov r1, #0xA7
    	mul r0, r1
    	lsr r0, #0x7
    	mov r8, r0
    	mul r7, r1
    	lsr r7, #0x7
    	b Return
    NormalizeCheck:
    	cmp r1, #0x61
    	bne Return
    Normalize:
    	mov r0, #0x0
    	mov r10, r0
    Return:
    	ldr r0, [sp, #0x4]
    	ldrh r0, [r0, #0xA]
    	str r0, [sp, #0x1C]
    	ldrh r0, [r6, #0x2E]
    	cmp r0, #0xAF
    	bne NoEnigmaBerry
    	ldr r1, .Return
    	bx r1
    NoEnigmaBerry:
    	ldr r0, .Return2
    	bx r0
    
    .align 2
    .ChangeTypeLoc: .word 0x0202449C
    .Return: .word 0x0806961B
    .Return2: .word 0x08069635
    
    Insert 01 48 00 47 00 0 xx+1 xx xx 08 at 0806960E
    __________________
    Reply With Quote