Skip to content

Commit

Permalink
Implement Physical/Special split
Browse files Browse the repository at this point in the history
  • Loading branch information
roukaour committed May 8, 2016
1 parent 79ce51d commit e031fbc
Show file tree
Hide file tree
Showing 11 changed files with 308 additions and 317 deletions.
3 changes: 2 additions & 1 deletion README.md
Expand Up @@ -32,6 +32,7 @@ To set up the repository, see [**INSTALL.md**](INSTALL.md).
* Medium-Slow growth rate experience underflow at level 1
* HP bar lowering glitch
* Modern game mechanics:
* Physical/Special split
* Hold B to run
* Steel does not resist Ghost or Dark
* Type-enhancing items raise by 20%, not 10%
Expand Down Expand Up @@ -73,7 +74,6 @@ To set up the repository, see [**INSTALL.md**](INSTALL.md).
* Replace Cleffa and Igglybuff with Togekiss and Weavile
* Mechanics:
* Update base stats, learnt moves, and move and item mechanics to Gen VI
* Physical/Special split from Gen IV
* Gen III critical hit mechanics (ignore -Atk and +Def stat changes, don't ignore burn)
* Catch rate formula from Gen III
* Money loss formula from Gen III when whiting out
Expand All @@ -93,6 +93,7 @@ To set up the repository, see [**INSTALL.md**](INSTALL.md).
* Rock-type Pokémon get Sp.Def boosted by 50% in a sandstorm
* Convenience:
* Better default settings (fast text, stereo sound, set battle style, etc)
* Show Phys/Spcl/Stat category for moves
* Settings for 12/24-hour clock, and imperial/metric units
* Even faster text
* Continuous Repel system from Gen V
Expand Down
22 changes: 5 additions & 17 deletions battle/ai/scoring.asm
Expand Up @@ -1186,17 +1186,10 @@ AI_Smart_SpDefenseUp2: ; 38aed
jr nc, .asm_38b10

; 80% chance to greatly encourage this move if
; enemy's Special Defense level is lower than +2, and the player is of a special type.
; enemy's Special Defense level is lower than +2.
cp $9
ret nc

ld a, [BattleMonType1]
cp SPECIAL
jr nc, .asm_38b09
ld a, [BattleMonType2]
cp SPECIAL
ret c

.asm_38b09
call AI_80_20
ret c
Expand Down Expand Up @@ -1438,7 +1431,7 @@ AI_Smart_Counter: ; 38bf1
and a
jr z, .asm_38c0e

ld a, [wEnemyMoveStruct + MOVE_TYPE]
ld a, [wEnemyMoveStruct + MOVE_CATEGORY]
cp SPECIAL
jr nc, .asm_38c0e

Expand Down Expand Up @@ -1466,7 +1459,7 @@ AI_Smart_Counter: ; 38bf1
and a
jr z, .asm_38c38

ld a, [wEnemyMoveStruct + MOVE_TYPE]
ld a, [wEnemyMoveStruct + MOVE_CATEGORY]
cp SPECIAL
jr nc, .asm_38c38

Expand Down Expand Up @@ -2000,11 +1993,6 @@ AI_Smart_Curse: ; 38e5c
ld a, [BattleMonType1]
cp GHOST
jr z, .asm_38e92
cp SPECIAL
ret nc
ld a, [BattleMonType2]
cp SPECIAL
ret nc
call AI_80_20
ret c
rept 2
Expand Down Expand Up @@ -2757,7 +2745,7 @@ AI_Smart_MirrorCoat: ; 3918b
and a
jr z, .asm_391a8

ld a, [wEnemyMoveStruct + MOVE_TYPE]
ld a, [wEnemyMoveStruct + MOVE_CATEGORY]
cp SPECIAL
jr c, .asm_391a8

Expand Down Expand Up @@ -2785,7 +2773,7 @@ AI_Smart_MirrorCoat: ; 3918b
and a
jr z, .asm_391d2

ld a, [wEnemyMoveStruct + MOVE_TYPE]
ld a, [wEnemyMoveStruct + MOVE_CATEGORY]
cp SPECIAL
jr c, .asm_391d2

Expand Down
22 changes: 10 additions & 12 deletions battle/effect_commands.asm
Expand Up @@ -2805,11 +2805,12 @@ PlayerAttackDamage: ; 352e2
call ResetDamage

ld hl, wPlayerMoveStructPower
ld a, [hli]
ld a, [hl]
and a
ld d, a
ret z

ld hl, wPlayerMoveStructCategory
ld a, [hl]
cp SPECIAL
jr nc, .special
Expand Down Expand Up @@ -2953,7 +2954,7 @@ GetDamageStats: ; 3537e
ld a, [hBattleTurn]
and a
jr nz, .enemy
ld a, [wPlayerMoveStructType]
ld a, [wPlayerMoveStructCategory]
cp SPECIAL
; special
ld a, [PlayerSAtkLevel]
Expand All @@ -2967,7 +2968,7 @@ GetDamageStats: ; 3537e
jr .end

.enemy
ld a, [wEnemyMoveStructType]
ld a, [wEnemyMoveStructCategory]
cp SPECIAL
; special
ld a, [EnemySAtkLevel]
Expand Down Expand Up @@ -3071,11 +3072,12 @@ EnemyAttackDamage: ; 353f6

; No damage dealt with 0 power.
ld hl, wEnemyMoveStructPower
ld a, [hli] ; hl = wEnemyMoveStructType
ld a, [hl]
ld d, a
and a
ret z

ld hl, wEnemyMoveStructCategory
ld a, [hl]
cp SPECIAL
jr nc, .Special
Expand Down Expand Up @@ -3875,11 +3877,11 @@ BattleCommand_Counter: ; 35813
ld de, StringBuffer1
call GetMoveData

ld a, [StringBuffer1 + 2]
ld a, [StringBuffer1 + MOVE_POWER]
and a
ret z

ld a, [StringBuffer1 + 3]
ld a, [StringBuffer1 + MOVE_CATEGORY]
cp SPECIAL
ret nc

Expand Down Expand Up @@ -4175,10 +4177,6 @@ BattleCommand_Conversion2: ; 359e6
.loop
call BattleRandom
and $1f
cp UNUSED_TYPES
jr c, .okay
cp UNUSED_TYPES_END
jr c, .loop
cp TYPES_END
jr nc, .loop
.okay
Expand Down Expand Up @@ -9554,11 +9552,11 @@ BattleCommand_MirrorCoat: ; 37c95
ld de, StringBuffer1
call GetMoveData

ld a, [StringBuffer1 + 2]
ld a, [StringBuffer1 + MOVE_POWER]
and a
ret z

ld a, [StringBuffer1 + 3]
ld a, [StringBuffer1 + MOVE_CATEGORY]
cp SPECIAL
ret c

Expand Down
5 changes: 0 additions & 5 deletions battle/hidden_power.asm
Expand Up @@ -83,11 +83,6 @@ endr
; Skip Normal
inc a

; Skip unused types
cp UNUSED_TYPES
jr c, .done
add SPECIAL - UNUSED_TYPES

.done

; Overwrite the current move type.
Expand Down

0 comments on commit e031fbc

Please sign in to comment.