mirror of
https://github.com/thornAvery/jep-hack.git
synced 2025-09-17 02:30:50 +12:00
Gen 6+ Experience System
Makes the EXP. Share into a Key item and gives it to all party members. Changed several item descriptions to be less garbage Made the Dragon Fang boost attack like it should (Dragon Scale is left unchanged) The Lottery now gives you a Lucky Egg if you win 2nd Prize, the EXP Share is still obtained from Mr. Pokemon
This commit is contained in:
parent
7554222e3c
commit
af83085749
|
@ -121,7 +121,7 @@ ItemAttributes:
|
||||||
; POKE_FLUTE
|
; POKE_FLUTE
|
||||||
item_attribute $9999, HELD_NONE, 0, NO_LIMITS, ITEM, ITEMMENU_NOUSE, ITEMMENU_NOUSE
|
item_attribute $9999, HELD_NONE, 0, NO_LIMITS, ITEM, ITEMMENU_NOUSE, ITEMMENU_NOUSE
|
||||||
; EXP_SHARE
|
; EXP_SHARE
|
||||||
item_attribute 3000, HELD_NONE, 0, CANT_SELECT, ITEM, ITEMMENU_NOUSE, ITEMMENU_NOUSE
|
item_attribute 0, HELD_NONE, 0, CANT_SELECT | CANT_TOSS, KEY_ITEM, ITEMMENU_CURRENT, ITEMMENU_NOUSE
|
||||||
; OLD_ROD
|
; OLD_ROD
|
||||||
item_attribute 0, HELD_NONE, 0, CANT_TOSS, KEY_ITEM, ITEMMENU_CLOSE, ITEMMENU_NOUSE
|
item_attribute 0, HELD_NONE, 0, CANT_TOSS, KEY_ITEM, ITEMMENU_CLOSE, ITEMMENU_NOUSE
|
||||||
; GOOD_ROD
|
; GOOD_ROD
|
||||||
|
@ -294,9 +294,8 @@ ItemAttributes:
|
||||||
item_attribute 2100, HELD_NONE, 0, CANT_SELECT, ITEM, ITEMMENU_PARTY, ITEMMENU_NOUSE
|
item_attribute 2100, HELD_NONE, 0, CANT_SELECT, ITEM, ITEMMENU_PARTY, ITEMMENU_NOUSE
|
||||||
; METAL_COAT
|
; METAL_COAT
|
||||||
item_attribute 100, HELD_STEEL_BOOST, 10, CANT_SELECT, ITEM, ITEMMENU_NOUSE, ITEMMENU_NOUSE
|
item_attribute 100, HELD_STEEL_BOOST, 10, CANT_SELECT, ITEM, ITEMMENU_NOUSE, ITEMMENU_NOUSE
|
||||||
; BUG: Dragon Scale, not Dragon Fang, boosts Dragon-type moves (see docs/bugs_and_glitches.md)
|
|
||||||
; DRAGON_FANG
|
; DRAGON_FANG
|
||||||
item_attribute 100, HELD_NONE, 0, CANT_SELECT, ITEM, ITEMMENU_NOUSE, ITEMMENU_NOUSE
|
item_attribute 100, HELD_DRAGON_BOOST, 0, CANT_SELECT, ITEM, ITEMMENU_NOUSE, ITEMMENU_NOUSE
|
||||||
; BLK_AUGURITE
|
; BLK_AUGURITE
|
||||||
item_attribute 2100, HELD_NONE, 0, CANT_SELECT, ITEM, ITEMMENU_PARTY, ITEMMENU_NOUSE
|
item_attribute 2100, HELD_NONE, 0, CANT_SELECT, ITEM, ITEMMENU_PARTY, ITEMMENU_NOUSE
|
||||||
; LEFTOVERS
|
; LEFTOVERS
|
||||||
|
|
|
@ -389,7 +389,7 @@ LeafStoneDesc:
|
||||||
|
|
||||||
MetalPowderDesc:
|
MetalPowderDesc:
|
||||||
db "Raises DEFENSE of"
|
db "Raises DEFENSE of"
|
||||||
next "DITTO. (HOLD)@"
|
next "DITTO and MIMMEO.@"
|
||||||
|
|
||||||
NuggetDesc:
|
NuggetDesc:
|
||||||
db "Made of pure gold."
|
db "Made of pure gold."
|
||||||
|
@ -465,7 +465,7 @@ ItemfinderDesc:
|
||||||
|
|
||||||
ExpShareDesc:
|
ExpShareDesc:
|
||||||
db "Shares battle EXP."
|
db "Shares battle EXP."
|
||||||
next "Points. (HOLD)@"
|
next "Points.@"
|
||||||
|
|
||||||
OldRodDesc:
|
OldRodDesc:
|
||||||
db "Use by water to"
|
db "Use by water to"
|
||||||
|
@ -504,8 +504,8 @@ RedScaleDesc:
|
||||||
next "red GYARADOS.@"
|
next "red GYARADOS.@"
|
||||||
|
|
||||||
SecretPotionDesc:
|
SecretPotionDesc:
|
||||||
db "Fully heals any"
|
db "It can heal any"
|
||||||
next "#MON.@"
|
next "#MON illness.@"
|
||||||
|
|
||||||
SSTicketDesc:
|
SSTicketDesc:
|
||||||
db "A ticket for the"
|
db "A ticket for the"
|
||||||
|
@ -528,8 +528,8 @@ MoomooMilkDesc:
|
||||||
next "HP by 100.@"
|
next "HP by 100.@"
|
||||||
|
|
||||||
QuickClawDesc:
|
QuickClawDesc:
|
||||||
db "Raises 1st strike"
|
db "May allow the user"
|
||||||
next "ratio. (HOLD)@"
|
next "to move first.@"
|
||||||
|
|
||||||
PsnCureBerryDesc:
|
PsnCureBerryDesc:
|
||||||
db "A self-cure for"
|
db "A self-cure for"
|
||||||
|
@ -540,11 +540,11 @@ GoldLeafDesc:
|
||||||
next "colored leaf.@"
|
next "colored leaf.@"
|
||||||
|
|
||||||
SoftSandDesc:
|
SoftSandDesc:
|
||||||
db "Powers up ground-"
|
db "Powers up GROUND-"
|
||||||
next "type moves. (HOLD)@"
|
next "type moves. (HOLD)@"
|
||||||
|
|
||||||
SharpBeakDesc:
|
SharpBeakDesc:
|
||||||
db "Powers up flying-"
|
db "Powers up FLYING-"
|
||||||
next "type moves. (HOLD)@"
|
next "type moves. (HOLD)@"
|
||||||
|
|
||||||
PrzCureBerryDesc:
|
PrzCureBerryDesc:
|
||||||
|
@ -560,7 +560,7 @@ IceBerryDesc:
|
||||||
next "burn. (HOLD)@"
|
next "burn. (HOLD)@"
|
||||||
|
|
||||||
PoisonBarbDesc:
|
PoisonBarbDesc:
|
||||||
db "Powers up poison-"
|
db "Powers up POISON-"
|
||||||
next "type moves. (HOLD)@"
|
next "type moves. (HOLD)@"
|
||||||
|
|
||||||
KingsRockDesc:
|
KingsRockDesc:
|
||||||
|
@ -587,7 +587,7 @@ BigMushroomDesc:
|
||||||
next "Sell high.@"
|
next "Sell high.@"
|
||||||
|
|
||||||
SilverPowderDesc:
|
SilverPowderDesc:
|
||||||
db "Powers up bug-type"
|
db "Powers up BUG-type"
|
||||||
next "moves. (HOLD)@"
|
next "moves. (HOLD)@"
|
||||||
|
|
||||||
BluApricornDesc:
|
BluApricornDesc:
|
||||||
|
@ -608,18 +608,18 @@ CleanseTagDesc:
|
||||||
next "#MON. (HOLD)@"
|
next "#MON. (HOLD)@"
|
||||||
|
|
||||||
MysticWaterDesc:
|
MysticWaterDesc:
|
||||||
db "Powers up water-"
|
db "Powers up WATER-"
|
||||||
next "type moves. (HOLD)@"
|
next "type moves. (HOLD)@"
|
||||||
|
|
||||||
TwistedSpoonDesc:
|
TwistedSpoonDesc:
|
||||||
db "Powers up psychic-"
|
db "Powers up PSYCHIC-"
|
||||||
next "type moves. (HOLD)@"
|
next "type moves. (HOLD)@"
|
||||||
|
|
||||||
WhtApricornDesc:
|
WhtApricornDesc:
|
||||||
db "A white APRICORN.@"
|
db "A white APRICORN.@"
|
||||||
|
|
||||||
BlackbeltDesc:
|
BlackbeltDesc:
|
||||||
db "Boosts fighting-"
|
db "Boosts FIGHTING-"
|
||||||
next "type moves. (HOLD)@"
|
next "type moves. (HOLD)@"
|
||||||
|
|
||||||
BlkApricornDesc:
|
BlkApricornDesc:
|
||||||
|
@ -631,7 +631,7 @@ PnkApricornDesc:
|
||||||
next "@"
|
next "@"
|
||||||
|
|
||||||
BlackGlassesDesc:
|
BlackGlassesDesc:
|
||||||
db "Powers up dark-"
|
db "Powers up DARK-"
|
||||||
next "type moves. (HOLD)@"
|
next "type moves. (HOLD)@"
|
||||||
|
|
||||||
SlowpokeTailDesc:
|
SlowpokeTailDesc:
|
||||||
|
@ -639,23 +639,23 @@ SlowpokeTailDesc:
|
||||||
next "high.@"
|
next "high.@"
|
||||||
|
|
||||||
PinkBowDesc:
|
PinkBowDesc:
|
||||||
db "Powers up normal-"
|
db "Powers up NORMAL-"
|
||||||
next "type moves. (HOLD)@"
|
next "type moves. (HOLD)@"
|
||||||
|
|
||||||
StickDesc:
|
StickDesc:
|
||||||
db "An ordinary stick."
|
db "Ups crit ratio of"
|
||||||
next "Sell low.@"
|
next "FARFETCH'D. (HOLD)@"
|
||||||
|
|
||||||
SmokeBallDesc:
|
SmokeBallDesc:
|
||||||
db "Escape from wild"
|
db "Escape from wild"
|
||||||
next "#MON. (HOLD)@"
|
next "#MON. (HOLD)@"
|
||||||
|
|
||||||
NeverMeltIceDesc:
|
NeverMeltIceDesc:
|
||||||
db "Powers up ice-type"
|
db "Powers up ICE-type"
|
||||||
next "moves. (HOLD)@"
|
next "moves. (HOLD)@"
|
||||||
|
|
||||||
MagnetDesc:
|
MagnetDesc:
|
||||||
db "Boosts electric-"
|
db "Boosts ELECTRIC-"
|
||||||
next "type moves. (HOLD)@"
|
next "type moves. (HOLD)@"
|
||||||
|
|
||||||
MiracleBerryDesc:
|
MiracleBerryDesc:
|
||||||
|
@ -675,7 +675,7 @@ EverStoneDesc:
|
||||||
next "(HOLD)@"
|
next "(HOLD)@"
|
||||||
|
|
||||||
SpellTagDesc:
|
SpellTagDesc:
|
||||||
db "Powers up ghost-"
|
db "Powers up GHOST-"
|
||||||
next "type moves. (HOLD)@"
|
next "type moves. (HOLD)@"
|
||||||
|
|
||||||
RageCandyBarDesc:
|
RageCandyBarDesc:
|
||||||
|
@ -691,16 +691,16 @@ BlueCardDesc:
|
||||||
next "points.@"
|
next "points.@"
|
||||||
|
|
||||||
MiracleSeedDesc:
|
MiracleSeedDesc:
|
||||||
db "Powers up grass-"
|
db "Powers up GRASS-"
|
||||||
next "type moves. (HOLD)@"
|
next "type moves. (HOLD)@"
|
||||||
|
|
||||||
ThickClubDesc:
|
ThickClubDesc:
|
||||||
db "A bone of some"
|
db "Raises ATTACK of"
|
||||||
next "sort. Sell low.@"
|
next "the CUBONE line.@"
|
||||||
|
|
||||||
FocusBandDesc:
|
FocusBandDesc:
|
||||||
db "May prevent faint-"
|
db "It may prevent"
|
||||||
next "ing. (HOLD)@"
|
next "fainting. (HOLD)@"
|
||||||
|
|
||||||
EnergyPowderDesc:
|
EnergyPowderDesc:
|
||||||
db "Restores #MON"
|
db "Restores #MON"
|
||||||
|
@ -719,7 +719,7 @@ RevivalHerbDesc:
|
||||||
next "#MON. Bitter.@"
|
next "#MON. Bitter.@"
|
||||||
|
|
||||||
HardStoneDesc:
|
HardStoneDesc:
|
||||||
db "Powers up rock-"
|
db "Powers up ROCK-"
|
||||||
next "type moves. (HOLD)@"
|
next "type moves. (HOLD)@"
|
||||||
|
|
||||||
LuckyEggDesc:
|
LuckyEggDesc:
|
||||||
|
@ -735,8 +735,8 @@ MachinePartDesc:
|
||||||
next "the POWER PLANT.@"
|
next "the POWER PLANT.@"
|
||||||
|
|
||||||
EggTicketDesc:
|
EggTicketDesc:
|
||||||
db "May use at Golden-"
|
db "This item cannot"
|
||||||
next "rod trade corner.@"
|
next "be used.@"
|
||||||
|
|
||||||
LostItemDesc:
|
LostItemDesc:
|
||||||
db "The # DOLL lost"
|
db "The # DOLL lost"
|
||||||
|
@ -758,7 +758,7 @@ PassDesc:
|
||||||
next "MAGNET TRAIN.@"
|
next "MAGNET TRAIN.@"
|
||||||
|
|
||||||
CharcoalDesc:
|
CharcoalDesc:
|
||||||
db "Powers up fire-"
|
db "Powers up FIRE-"
|
||||||
next "type moves. (HOLD)@"
|
next "type moves. (HOLD)@"
|
||||||
|
|
||||||
BerryJuiceDesc:
|
BerryJuiceDesc:
|
||||||
|
@ -770,11 +770,11 @@ ScopeLensDesc:
|
||||||
next "hit ratio. (HOLD)@"
|
next "hit ratio. (HOLD)@"
|
||||||
|
|
||||||
MetalCoatDesc:
|
MetalCoatDesc:
|
||||||
db "Powers up steel-"
|
db "Powers up STEEL-"
|
||||||
next "type moves. (HOLD)@"
|
next "type moves. (HOLD)@"
|
||||||
|
|
||||||
DragonFangDesc:
|
DragonFangDesc:
|
||||||
db "Powers up dragon-"
|
db "Powers up DRAGON-"
|
||||||
next "type moves. (HOLD)@"
|
next "type moves. (HOLD)@"
|
||||||
|
|
||||||
LeftoversDesc:
|
LeftoversDesc:
|
||||||
|
@ -786,8 +786,8 @@ MysteryBerryDesc:
|
||||||
next "for PP. (HOLD)@"
|
next "for PP. (HOLD)@"
|
||||||
|
|
||||||
DragonScaleDesc:
|
DragonScaleDesc:
|
||||||
db "A rare dragon-type"
|
db "Powers up DRAGON-"
|
||||||
next "item.@"
|
next "type moves. (HOLD)@"
|
||||||
|
|
||||||
BerserkGeneDesc:
|
BerserkGeneDesc:
|
||||||
db "Boosts ATTACK but"
|
db "Boosts ATTACK but"
|
||||||
|
@ -818,8 +818,8 @@ FastBallDesc:
|
||||||
next "ing fast #MON.@"
|
next "ing fast #MON.@"
|
||||||
|
|
||||||
LightBallDesc:
|
LightBallDesc:
|
||||||
db "An odd, electrical"
|
db "Ups SPECIAL ATTACK"
|
||||||
next "orb. (HOLD)@"
|
next "of PIKACHU. (HOLD)@"
|
||||||
|
|
||||||
FriendBallDesc:
|
FriendBallDesc:
|
||||||
db "A BALL that makes"
|
db "A BALL that makes"
|
||||||
|
@ -846,7 +846,7 @@ SunStoneDesc:
|
||||||
next "kinds of #MON.@"
|
next "kinds of #MON.@"
|
||||||
|
|
||||||
PolkadotBowDesc:
|
PolkadotBowDesc:
|
||||||
db "Powers up normal-"
|
db "Powers up NORMAL-"
|
||||||
next "type moves. (HOLD)@"
|
next "type moves. (HOLD)@"
|
||||||
|
|
||||||
AntiquePotDesc:
|
AntiquePotDesc:
|
||||||
|
@ -921,24 +921,24 @@ MirageMailDesc:
|
||||||
next "(HOLD)@"
|
next "(HOLD)@"
|
||||||
|
|
||||||
FairyFeatherDesc:
|
FairyFeatherDesc:
|
||||||
db "Powers up fairy-"
|
db "Powers up FAIRY-"
|
||||||
next "type moves. (HOLD)@"
|
next "type moves. (HOLD)@"
|
||||||
|
|
||||||
OldAmberDesc:
|
OldAmberDesc:
|
||||||
db "Amber with DNA of"
|
db "Fossilized resin"
|
||||||
next "an ancient #MON."
|
next "containing DNA.@"
|
||||||
|
|
||||||
DomeFossilDesc:
|
DomeFossilDesc:
|
||||||
db "A dome-shaped fossil"
|
db "The shell of an"
|
||||||
next "of an ancient #MON."
|
next "ancient #MON.@"
|
||||||
|
|
||||||
HelixFossilDesc:
|
HelixFossilDesc:
|
||||||
db "A swirl-shaped fossil"
|
db "The shell of an"
|
||||||
next "of an ancient #MON."
|
next "ancient #MON.@"
|
||||||
|
|
||||||
WingFossilDesc:
|
WingFossilDesc:
|
||||||
db "A wing-shaped fossil"
|
db "The wing of an"
|
||||||
next "of an ancient #MON."
|
next "ancient #MON.@"
|
||||||
|
|
||||||
HeartStoneDesc:
|
HeartStoneDesc:
|
||||||
db "Evolves certain"
|
db "Evolves certain"
|
||||||
|
|
|
@ -1409,6 +1409,16 @@ _ItemGotOffText::
|
||||||
text "."
|
text "."
|
||||||
prompt
|
prompt
|
||||||
|
|
||||||
|
_ExpShareToggleOn::
|
||||||
|
text "The EXP.SHARE was"
|
||||||
|
line "turned on."
|
||||||
|
prompt
|
||||||
|
|
||||||
|
_ExpShareToggleOff::
|
||||||
|
text "The EXP.SHARE was"
|
||||||
|
line "turned off."
|
||||||
|
prompt
|
||||||
|
|
||||||
_KnowsMoveText::
|
_KnowsMoveText::
|
||||||
text_ram wStringBuffer1
|
text_ram wStringBuffer1
|
||||||
text " knows"
|
text " knows"
|
||||||
|
|
|
@ -2188,97 +2188,28 @@ UpdateBattleStateAndExperienceAfterEnemyFaint:
|
||||||
ld a, [wBattleResult]
|
ld a, [wBattleResult]
|
||||||
and BATTLERESULT_BITMASK
|
and BATTLERESULT_BITMASK
|
||||||
ld [wBattleResult], a ; WIN
|
ld [wBattleResult], a ; WIN
|
||||||
call IsAnyMonHoldingExpShare
|
; Preserve bits of non-fainted participants
|
||||||
jr z, .skip_exp
|
ld a, [wBattleParticipantsNotFainted]
|
||||||
ld hl, wEnemyMonBaseStats
|
ld d, a
|
||||||
ld b, wEnemyMonEnd - wEnemyMonBaseStats
|
push de
|
||||||
.loop
|
|
||||||
srl [hl]
|
|
||||||
inc hl
|
|
||||||
dec b
|
|
||||||
jr nz, .loop
|
|
||||||
|
|
||||||
.skip_exp
|
|
||||||
ld hl, wEnemyMonBaseStats
|
|
||||||
ld de, wBackupEnemyMonBaseStats
|
|
||||||
ld bc, wEnemyMonEnd - wEnemyMonBaseStats
|
|
||||||
call CopyBytes
|
|
||||||
xor a
|
|
||||||
ld [wGivingExperienceToExpShareHolders], a
|
|
||||||
call GiveExperiencePoints
|
call GiveExperiencePoints
|
||||||
call IsAnyMonHoldingExpShare
|
pop de
|
||||||
|
; If Exp. Share is ON, give 50% EXP to non-participants
|
||||||
|
ld a, [wExpShareToggle]
|
||||||
|
and a
|
||||||
ret z
|
ret z
|
||||||
|
ld hl, wEnemyMonBaseExp
|
||||||
|
srl [hl]
|
||||||
ld a, [wBattleParticipantsNotFainted]
|
ld a, [wBattleParticipantsNotFainted]
|
||||||
push af
|
push af
|
||||||
ld a, d
|
ld a, d
|
||||||
|
xor %00111111
|
||||||
ld [wBattleParticipantsNotFainted], a
|
ld [wBattleParticipantsNotFainted], a
|
||||||
ld hl, wBackupEnemyMonBaseStats
|
|
||||||
ld de, wEnemyMonBaseStats
|
|
||||||
ld bc, wEnemyMonEnd - wEnemyMonBaseStats
|
|
||||||
call CopyBytes
|
|
||||||
ld a, $1
|
|
||||||
ld [wGivingExperienceToExpShareHolders], a
|
|
||||||
call GiveExperiencePoints
|
call GiveExperiencePoints
|
||||||
pop af
|
pop af
|
||||||
ld [wBattleParticipantsNotFainted], a
|
ld [wBattleParticipantsNotFainted], a
|
||||||
ret
|
ret
|
||||||
|
|
||||||
IsAnyMonHoldingExpShare:
|
|
||||||
ld a, [wPartyCount]
|
|
||||||
ld b, a
|
|
||||||
ld hl, wPartyMon1
|
|
||||||
ld c, 1
|
|
||||||
ld d, 0
|
|
||||||
.loop
|
|
||||||
push hl
|
|
||||||
push bc
|
|
||||||
ld bc, MON_HP
|
|
||||||
add hl, bc
|
|
||||||
ld a, [hli]
|
|
||||||
or [hl]
|
|
||||||
pop bc
|
|
||||||
pop hl
|
|
||||||
jr z, .next
|
|
||||||
|
|
||||||
push hl
|
|
||||||
push bc
|
|
||||||
ld bc, MON_ITEM
|
|
||||||
add hl, bc
|
|
||||||
pop bc
|
|
||||||
ld a, [hl]
|
|
||||||
pop hl
|
|
||||||
|
|
||||||
cp EXP_SHARE
|
|
||||||
jr nz, .next
|
|
||||||
ld a, d
|
|
||||||
or c
|
|
||||||
ld d, a
|
|
||||||
|
|
||||||
.next
|
|
||||||
sla c
|
|
||||||
push de
|
|
||||||
ld de, PARTYMON_STRUCT_LENGTH
|
|
||||||
add hl, de
|
|
||||||
pop de
|
|
||||||
dec b
|
|
||||||
jr nz, .loop
|
|
||||||
|
|
||||||
ld a, d
|
|
||||||
ld e, 0
|
|
||||||
ld b, PARTY_LENGTH
|
|
||||||
.loop2
|
|
||||||
srl a
|
|
||||||
jr nc, .okay
|
|
||||||
inc e
|
|
||||||
|
|
||||||
.okay
|
|
||||||
dec b
|
|
||||||
jr nz, .loop2
|
|
||||||
ld a, e
|
|
||||||
and a
|
|
||||||
ret
|
|
||||||
|
|
||||||
StopDangerSound:
|
StopDangerSound:
|
||||||
xor a
|
xor a
|
||||||
ld [wLowHealthAlarm], a
|
ld [wLowHealthAlarm], a
|
||||||
|
@ -2595,10 +2526,6 @@ PlayVictoryMusic:
|
||||||
ld a, [wBattleMode]
|
ld a, [wBattleMode]
|
||||||
dec a
|
dec a
|
||||||
jr nz, .trainer_victory
|
jr nz, .trainer_victory
|
||||||
push de
|
|
||||||
call IsAnyMonHoldingExpShare
|
|
||||||
pop de
|
|
||||||
jr nz, .play_music
|
|
||||||
ld hl, wPayDayMoney
|
ld hl, wPayDayMoney
|
||||||
ld a, [hli]
|
ld a, [hli]
|
||||||
or [hl]
|
or [hl]
|
||||||
|
@ -7064,7 +6991,6 @@ GiveExperiencePoints:
|
||||||
bit 0, a
|
bit 0, a
|
||||||
ret nz
|
ret nz
|
||||||
|
|
||||||
call .EvenlyDivideExpAmongParticipants
|
|
||||||
xor a
|
xor a
|
||||||
ld [wCurPartyMon], a
|
ld [wCurPartyMon], a
|
||||||
ld bc, wPartyMon1Species
|
ld bc, wPartyMon1Species
|
||||||
|
@ -7433,40 +7359,6 @@ GiveExperiencePoints:
|
||||||
.done
|
.done
|
||||||
jp ResetBattleParticipants
|
jp ResetBattleParticipants
|
||||||
|
|
||||||
.EvenlyDivideExpAmongParticipants:
|
|
||||||
; count number of battle participants
|
|
||||||
ld a, [wBattleParticipantsNotFainted]
|
|
||||||
ld b, a
|
|
||||||
ld c, PARTY_LENGTH
|
|
||||||
ld d, 0
|
|
||||||
.count_loop
|
|
||||||
xor a
|
|
||||||
srl b
|
|
||||||
adc d
|
|
||||||
ld d, a
|
|
||||||
dec c
|
|
||||||
jr nz, .count_loop
|
|
||||||
cp 2
|
|
||||||
ret c
|
|
||||||
|
|
||||||
ld [wTempByteValue], a
|
|
||||||
ld hl, wEnemyMonBaseStats
|
|
||||||
ld c, wEnemyMonEnd - wEnemyMonBaseStats
|
|
||||||
.base_stat_division_loop
|
|
||||||
xor a
|
|
||||||
ldh [hDividend + 0], a
|
|
||||||
ld a, [hl]
|
|
||||||
ldh [hDividend + 1], a
|
|
||||||
ld a, [wTempByteValue]
|
|
||||||
ldh [hDivisor], a
|
|
||||||
ld b, 2
|
|
||||||
call Divide
|
|
||||||
ldh a, [hQuotient + 3]
|
|
||||||
ld [hli], a
|
|
||||||
dec c
|
|
||||||
jr nz, .base_stat_division_loop
|
|
||||||
ret
|
|
||||||
|
|
||||||
BoostExp:
|
BoostExp:
|
||||||
; Multiply experience by 1.5x
|
; Multiply experience by 1.5x
|
||||||
push bc
|
push bc
|
||||||
|
|
|
@ -38,7 +38,7 @@ ItemEffects:
|
||||||
dw EvoStoneEffect ; FIRE_STONE
|
dw EvoStoneEffect ; FIRE_STONE
|
||||||
dw EvoStoneEffect ; THUNDERSTONE
|
dw EvoStoneEffect ; THUNDERSTONE
|
||||||
dw EvoStoneEffect ; WATER_STONE
|
dw EvoStoneEffect ; WATER_STONE
|
||||||
dw NoEffect ; FAIRY_FEATHER
|
dw NoEffect ; FAIRY_FEATHER
|
||||||
dw VitaminEffect ; HP_UP
|
dw VitaminEffect ; HP_UP
|
||||||
dw VitaminEffect ; PROTEIN
|
dw VitaminEffect ; PROTEIN
|
||||||
dw VitaminEffect ; IRON
|
dw VitaminEffect ; IRON
|
||||||
|
@ -70,7 +70,7 @@ ItemEffects:
|
||||||
dw CoinCaseEffect ; COIN_CASE
|
dw CoinCaseEffect ; COIN_CASE
|
||||||
dw ItemfinderEffect ; ITEMFINDER
|
dw ItemfinderEffect ; ITEMFINDER
|
||||||
dw PokeFluteEffect ; POKE_FLUTE
|
dw PokeFluteEffect ; POKE_FLUTE
|
||||||
dw NoEffect ; EXP_SHARE
|
dw ExpShareEffect ; EXP_SHARE
|
||||||
dw OldRodEffect ; OLD_ROD
|
dw OldRodEffect ; OLD_ROD
|
||||||
dw GoodRodEffect ; GOOD_ROD
|
dw GoodRodEffect ; GOOD_ROD
|
||||||
dw NoEffect ; SILVER_LEAF
|
dw NoEffect ; SILVER_LEAF
|
||||||
|
@ -215,11 +215,14 @@ ItemEffects:
|
||||||
; This has been amended for architectural purposes, and because we have a shitload of SW97 items to add.
|
; This has been amended for architectural purposes, and because we have a shitload of SW97 items to add.
|
||||||
|
|
||||||
PokeBallEffect:
|
PokeBallEffect:
|
||||||
; BUG: The Dude's catching tutorial may crash if his Poké Ball can't be used (see docs/bugs_and_glitches.md)
|
|
||||||
ld a, [wBattleMode]
|
ld a, [wBattleMode]
|
||||||
dec a
|
dec a
|
||||||
jp nz, UseBallInTrainerBattle
|
jp nz, UseBallInTrainerBattle
|
||||||
|
|
||||||
|
ld a, [wBattleType]
|
||||||
|
cp BATTLETYPE_TUTORIAL
|
||||||
|
jr z, .room_in_party ; Fixes a catching tutorial bug
|
||||||
|
|
||||||
ld a, [wPartyCount]
|
ld a, [wPartyCount]
|
||||||
cp PARTY_LENGTH
|
cp PARTY_LENGTH
|
||||||
jr nz, .room_in_party
|
jr nz, .room_in_party
|
||||||
|
@ -232,11 +235,10 @@ PokeBallEffect:
|
||||||
jp z, Ball_BoxIsFullMessage
|
jp z, Ball_BoxIsFullMessage
|
||||||
|
|
||||||
.room_in_party
|
.room_in_party
|
||||||
; BUG: Using a Park Ball in non-Contest battles has a corrupt animation (see docs/bugs_and_glitches.md)
|
|
||||||
xor a
|
xor a
|
||||||
ld [wWildMon], a
|
ld [wWildMon], a
|
||||||
ld a, [wCurItem]
|
ld a, [wBattleType]
|
||||||
cp PARK_BALL
|
cp BATTLETYPE_CONTEST ; Fixes the Park Ball corrupting graphics when used outside of a Contest
|
||||||
call nz, ReturnToBattle_UseBall
|
call nz, ReturnToBattle_UseBall
|
||||||
|
|
||||||
ld hl, wOptions
|
ld hl, wOptions
|
||||||
|
@ -341,12 +343,12 @@ PokeBallEffect:
|
||||||
jr nz, .statuscheck
|
jr nz, .statuscheck
|
||||||
ld a, 1
|
ld a, 1
|
||||||
.statuscheck
|
.statuscheck
|
||||||
; BUG: BRN/PSN/PAR do not affect catch rate (see docs/bugs_and_glitches.md)
|
|
||||||
ld b, a
|
ld b, a
|
||||||
ld a, [wEnemyMonStatus]
|
ld a, [wEnemyMonStatus]
|
||||||
and 1 << FRZ | SLP_MASK
|
and 1 << FRZ | SLP_MASK
|
||||||
ld c, 10
|
ld c, 10
|
||||||
jr nz, .addstatus
|
jr nz, .addstatus
|
||||||
|
ld a, [wEnemyMonStatus] ; Fixes a bug where Burn, Poison and Paralysis have no effect on catch rate
|
||||||
and a
|
and a
|
||||||
ld c, 5
|
ld c, 5
|
||||||
jr nz, .addstatus
|
jr nz, .addstatus
|
||||||
|
@ -358,10 +360,10 @@ PokeBallEffect:
|
||||||
ld a, $ff
|
ld a, $ff
|
||||||
.max_1
|
.max_1
|
||||||
|
|
||||||
; BUG: HELD_CATCH_CHANCE has no effect (see docs/bugs_and_glitches.md)
|
|
||||||
ld d, a
|
ld d, a
|
||||||
push de
|
push de
|
||||||
ld a, [wBattleMonItem]
|
ld a, [wBattleMonItem]
|
||||||
|
ld b, a ; Fixes this effect having no effect when loaded
|
||||||
farcall GetItemHeldEffect
|
farcall GetItemHeldEffect
|
||||||
ld a, b
|
ld a, b
|
||||||
cp HELD_CATCH_CHANCE
|
cp HELD_CATCH_CHANCE
|
||||||
|
@ -946,7 +948,7 @@ LoveBallMultiplier:
|
||||||
inc d ; female
|
inc d ; female
|
||||||
.got_wild_gender
|
.got_wild_gender
|
||||||
|
|
||||||
; BUG: Love Ball boosts catch rate for the wrong gender (see docs/bugs_and_glitches.md)
|
; BUG?: Love Ball boosts catch rate for the same gender. We're currently keeping it because we're all gay.
|
||||||
ld a, d
|
ld a, d
|
||||||
pop de
|
pop de
|
||||||
cp d
|
cp d
|
||||||
|
@ -981,7 +983,7 @@ FastBallMultiplier:
|
||||||
push bc
|
push bc
|
||||||
|
|
||||||
.loop
|
.loop
|
||||||
; BUG: Fast Ball only boosts catch rate for three Pokémon (see docs/bugs_and_glitches.md)
|
; BUG: Fast Ball only boosts catch rate for three Pokémon (not sure if this has been fixed here)
|
||||||
ld a, BANK(FleeMons)
|
ld a, BANK(FleeMons)
|
||||||
call GetFarByte
|
call GetFarByte
|
||||||
ld c, a
|
ld c, a
|
||||||
|
@ -1876,19 +1878,16 @@ LoadCurHPIntoBuffer3:
|
||||||
ld [wHPBuffer3], a
|
ld [wHPBuffer3], a
|
||||||
ret
|
ret
|
||||||
|
|
||||||
LoadHPIntoBuffer3: ; unreferenced
|
ExpShareEffect:
|
||||||
ld a, d
|
ld a, [wExpShareToggle]
|
||||||
ld [wHPBuffer3 + 1], a
|
xor 1
|
||||||
ld a, e
|
ld [wExpShareToggle], a
|
||||||
ld [wHPBuffer3], a
|
and a
|
||||||
ret
|
ld hl, ExpShareToggleOn
|
||||||
|
jp nz, PrintText
|
||||||
|
|
||||||
LoadHPFromBuffer3: ; unreferenced
|
ld hl, ExpShareToggleOff
|
||||||
ld a, [wHPBuffer3 + 1]
|
jp PrintText
|
||||||
ld d, a
|
|
||||||
ld a, [wHPBuffer3]
|
|
||||||
ld e, a
|
|
||||||
ret
|
|
||||||
|
|
||||||
LoadCurHPIntoBuffer2:
|
LoadCurHPIntoBuffer2:
|
||||||
ld a, MON_HP
|
ld a, MON_HP
|
||||||
|
@ -2712,6 +2711,14 @@ ItemGotOffText: ; unreferenced
|
||||||
text_far _ItemGotOffText
|
text_far _ItemGotOffText
|
||||||
text_end
|
text_end
|
||||||
|
|
||||||
|
ExpShareToggleOff:
|
||||||
|
text_far _ExpShareToggleOff
|
||||||
|
text_end
|
||||||
|
|
||||||
|
ExpShareToggleOn:
|
||||||
|
text_far _ExpShareToggleOn
|
||||||
|
text_end
|
||||||
|
|
||||||
ApplyPPUp:
|
ApplyPPUp:
|
||||||
ld a, MON_MOVES
|
ld a, MON_MOVES
|
||||||
call GetPartyParamLocation
|
call GetPartyParamLocation
|
||||||
|
|
|
@ -82,7 +82,7 @@ RadioTower1FLuckyNumberManScript:
|
||||||
playsound SFX_2ND_PLACE
|
playsound SFX_2ND_PLACE
|
||||||
waitsfx
|
waitsfx
|
||||||
promptbutton
|
promptbutton
|
||||||
giveitem EXP_SHARE
|
giveitem LUCKY_EGG
|
||||||
iffalse .BagFull
|
iffalse .BagFull
|
||||||
itemnotify
|
itemnotify
|
||||||
setflag ENGINE_LUCKY_NUMBER_SHOW
|
setflag ENGINE_LUCKY_NUMBER_SHOW
|
||||||
|
@ -275,8 +275,8 @@ RadioTower1FLuckyNumberManOkayMatchText:
|
||||||
cont "three numbers!"
|
cont "three numbers!"
|
||||||
|
|
||||||
para "You've won second"
|
para "You've won second"
|
||||||
line "prize, an EXP."
|
line "prize, a LUCKY"
|
||||||
cont "SHARE!"
|
cont "EGG!"
|
||||||
done
|
done
|
||||||
|
|
||||||
RadioTower1FLuckyNumberManWeakMatchText:
|
RadioTower1FLuckyNumberManWeakMatchText:
|
||||||
|
|
|
@ -3020,7 +3020,7 @@ wRegisteredItem:: db
|
||||||
wPlayerState:: db
|
wPlayerState:: db
|
||||||
|
|
||||||
wHallOfFameCount:: db
|
wHallOfFameCount:: db
|
||||||
ds 1
|
wExpShareToggle:: db
|
||||||
wTradeFlags:: flag_array NUM_NPC_TRADES
|
wTradeFlags:: flag_array NUM_NPC_TRADES
|
||||||
ds 1
|
ds 1
|
||||||
wMooMooBerries:: db
|
wMooMooBerries:: db
|
||||||
|
|
Loading…
Reference in a new issue