mirror of
				https://github.com/thornAvery/kep-hack.git
				synced 2025-11-04 20:51:02 +13:00 
			
		
		
		
	More (very small) AI improvements
- Fixed a bug where the Elite 4 wouldn't use Full Restores. Apparently the game only allows one item per trainer. - Gave Oak and Chief custom AI found from proto assets (then changed to be less ass) - Small amount of balancing - Minor text fixes - Figured out roughly how the current high-level AI works (Stat boosting moves are only used sometimes on the first turn, Recover is only used sometimes when below half health, otherwise just attack with a move that isn't ineffective. More testing needed for stat lowering moves and things like Barrier)
This commit is contained in:
		
							parent
							
								
									8a59ed4b8e
								
							
						
					
					
						commit
						c8f27d8bce
					
				| 
						 | 
				
			
			@ -28,28 +28,28 @@ TrainerAIPointers:
 | 
			
		|||
	dbw 3, GenericAI
 | 
			
		||||
	dbw 2, BlackbeltAI ; blackbelt
 | 
			
		||||
	dbw 3, GenericAI ; rival1
 | 
			
		||||
	dbw 3, GenericAI
 | 
			
		||||
	dbw 1, GenericAI ; chief
 | 
			
		||||
	dbw 2, OakAI
 | 
			
		||||
	dbw 3, ChiefAI ; chief
 | 
			
		||||
	dbw 3, GenericAI
 | 
			
		||||
	dbw 1, GiovanniAI ; giovanni
 | 
			
		||||
	dbw 3, GenericAI
 | 
			
		||||
	dbw 2, CooltrainerMAI ; cooltrainerm
 | 
			
		||||
	dbw 1, CooltrainerFAI ; cooltrainerf
 | 
			
		||||
	dbw 2, BrunoAI ; bruno
 | 
			
		||||
	dbw 1, BrunoAI ; bruno
 | 
			
		||||
	dbw 5, BrockAI ; brock
 | 
			
		||||
	dbw 1, MistyAI ; misty
 | 
			
		||||
	dbw 2, MistyAI ; misty
 | 
			
		||||
	dbw 1, LtSurgeAI ; surge
 | 
			
		||||
	dbw 1, ErikaAI ; erika
 | 
			
		||||
	dbw 2, KogaAI ; koga
 | 
			
		||||
	dbw 2, BlaineAI ; blaine
 | 
			
		||||
	dbw 1, SabrinaAI ; sabrina
 | 
			
		||||
	dbw 3, GenericAI
 | 
			
		||||
	dbw 1, Rival2AI ; rival2
 | 
			
		||||
	dbw 1, Rival3AI ; rival3
 | 
			
		||||
	dbw 2, LoreleiAI ; lorelei
 | 
			
		||||
	dbw 2, Rival2AI ; rival2
 | 
			
		||||
	dbw 3, Rival3AI ; rival3
 | 
			
		||||
	dbw 1, LoreleiAI ; lorelei
 | 
			
		||||
	dbw 3, GenericAI
 | 
			
		||||
	dbw 2, AgathaAI ; agatha
 | 
			
		||||
	dbw 1, LanceAI ; lance
 | 
			
		||||
	dbw 1, AgathaAI ; agatha
 | 
			
		||||
	dbw 2, LanceAI ; lance
 | 
			
		||||
	dbw 3, GenericAI ; Yujirou
 | 
			
		||||
	dbw 3, GenericAI ; Student
 | 
			
		||||
	dbw 3, GenericAI ; Firefighter
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -725,8 +725,8 @@ JugglerAI:
 | 
			
		|||
	ret nc
 | 
			
		||||
	jp AISwitchIfEnoughMons
 | 
			
		||||
 | 
			
		||||
BlackbeltAI:
 | 
			
		||||
	cp 13 percent - 1
 | 
			
		||||
BlackbeltAI:	; Fun fact! Jacky uses this same AI routine in the proto assets, but only 6% of the time.
 | 
			
		||||
	cp 25 percent + 1
 | 
			
		||||
	ret nc
 | 
			
		||||
	jp AIUseXAttack
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -763,10 +763,10 @@ BrockAI:
 | 
			
		|||
MistyAI:
 | 
			
		||||
	cp 25 percent + 1
 | 
			
		||||
	ret nc
 | 
			
		||||
	ld a, 10
 | 
			
		||||
	ld a, 5
 | 
			
		||||
	call AICheckIfHPBelowFraction
 | 
			
		||||
	ret nc
 | 
			
		||||
	jp AIUseSuperPotion ; Replicates Starmie using Recover. Unlike other trainers that heal, Misty will do this 26% of the time instead of 51%.
 | 
			
		||||
	jp AIUsePotion ; Replicates Starmie using Recover. Unlike other trainers that heal, Misty will do this 26% of the time instead of 51%.
 | 
			
		||||
 | 
			
		||||
LtSurgeAI:
 | 
			
		||||
	cp 20 percent + 1
 | 
			
		||||
| 
						 | 
				
			
			@ -774,25 +774,25 @@ LtSurgeAI:
 | 
			
		|||
	jp AIUseXSpecial
 | 
			
		||||
 | 
			
		||||
ErikaAI:
 | 
			
		||||
	cp 50 percent + 1
 | 
			
		||||
	cp 25 percent + 1
 | 
			
		||||
	ret nc
 | 
			
		||||
	ld a, 10
 | 
			
		||||
	ld a, 5
 | 
			
		||||
	call AICheckIfHPBelowFraction
 | 
			
		||||
	ret nc
 | 
			
		||||
	jp AIUseSuperPotion
 | 
			
		||||
 | 
			
		||||
KogaAI:
 | 
			
		||||
	cp 50 percent + 1
 | 
			
		||||
	cp 25 percent + 1
 | 
			
		||||
	ret nc
 | 
			
		||||
	ld a, 10
 | 
			
		||||
	ld a, 5
 | 
			
		||||
	call AICheckIfHPBelowFraction
 | 
			
		||||
	ret nc
 | 
			
		||||
	jp AIUseSuperPotion ; Koga is weird - I don't think anything fits. X Attack is certainly not the move though...
 | 
			
		||||
 | 
			
		||||
BlaineAI:
 | 
			
		||||
	cp 25 percent + 1
 | 
			
		||||
	cp 40 percent + 1
 | 
			
		||||
	ret nc
 | 
			
		||||
	ld a, 10
 | 
			
		||||
	ld a, 5
 | 
			
		||||
	call AICheckIfHPBelowFraction
 | 
			
		||||
	ret nc ; this fixes the super potion thing - PvK
 | 
			
		||||
	jp AIUseHyperPotion ; Instead of a Super Potion though, let's give him this. More impactful for the sixth gym while staying true to the meme that everyone knows Gen 1 Blaine for.
 | 
			
		||||
| 
						 | 
				
			
			@ -800,13 +800,13 @@ BlaineAI:
 | 
			
		|||
SabrinaAI:
 | 
			
		||||
	cp 25 percent + 1
 | 
			
		||||
	ret nc
 | 
			
		||||
	ld a, 10
 | 
			
		||||
	ld a, 5
 | 
			
		||||
	call AICheckIfHPBelowFraction
 | 
			
		||||
	ret nc
 | 
			
		||||
	jp AIUseHyperPotion
 | 
			
		||||
 | 
			
		||||
Rival2AI:
 | 
			
		||||
	cp 13 percent - 1
 | 
			
		||||
	cp 20 percent - 1
 | 
			
		||||
	ret nc
 | 
			
		||||
	ld a, 5
 | 
			
		||||
	call AICheckIfHPBelowFraction
 | 
			
		||||
| 
						 | 
				
			
			@ -822,9 +822,6 @@ Rival3AI:
 | 
			
		|||
	jp AIUseFullRestore
 | 
			
		||||
 | 
			
		||||
LoreleiAI:
 | 
			
		||||
	cp 15 percent + 1
 | 
			
		||||
	ret nc
 | 
			
		||||
	jp AIUseXSpecial
 | 
			
		||||
	cp 40 percent + 1
 | 
			
		||||
	ret nc
 | 
			
		||||
	ld a, 5
 | 
			
		||||
| 
						 | 
				
			
			@ -833,9 +830,6 @@ LoreleiAI:
 | 
			
		|||
	jp AIUseFullRestore
 | 
			
		||||
 | 
			
		||||
BrunoAI:
 | 
			
		||||
	cp 15 percent + 1
 | 
			
		||||
	ret nc
 | 
			
		||||
	jp AIUseXAttack
 | 
			
		||||
	cp 40 percent + 1
 | 
			
		||||
	ret nc
 | 
			
		||||
	ld a, 5
 | 
			
		||||
| 
						 | 
				
			
			@ -844,11 +838,8 @@ BrunoAI:
 | 
			
		|||
	jp AIUseFullRestore
 | 
			
		||||
 | 
			
		||||
AgathaAI:
 | 
			
		||||
	cp 8 percent
 | 
			
		||||
	cp 10 percent
 | 
			
		||||
	jp c, AISwitchIfEnoughMons
 | 
			
		||||
	cp 15 percent + 1
 | 
			
		||||
	ret nc
 | 
			
		||||
	jp AIUseXAccuracy ; hahahahahahahaha
 | 
			
		||||
	cp 40 percent + 1
 | 
			
		||||
	ret nc
 | 
			
		||||
	ld a, 5
 | 
			
		||||
| 
						 | 
				
			
			@ -857,15 +848,28 @@ AgathaAI:
 | 
			
		|||
	jp AIUseFullRestore
 | 
			
		||||
 | 
			
		||||
LanceAI:
 | 
			
		||||
	cp 15 percent + 1
 | 
			
		||||
	ret nc
 | 
			
		||||
	jp AIUseXSpecial
 | 
			
		||||
	cp 50 percent + 1
 | 
			
		||||
	ret nc
 | 
			
		||||
	ld a, 10
 | 
			
		||||
	ld a, 4
 | 
			
		||||
	call AICheckIfHPBelowFraction
 | 
			
		||||
	ret nc
 | 
			
		||||
	jp AIUseFullRestore
 | 
			
		||||
	
 | 
			
		||||
OakAI:
 | 
			
		||||
	cp 25 percent + 1
 | 
			
		||||
	ret nc
 | 
			
		||||
	ld a, 5
 | 
			
		||||
	call AICheckIfHPBelowFraction
 | 
			
		||||
	ret nc
 | 
			
		||||
	jp AIUseFullRestore
 | 
			
		||||
	
 | 
			
		||||
ChiefAI:
 | 
			
		||||
	cp 25 percent + 1
 | 
			
		||||
	ret nc
 | 
			
		||||
	ld a, 5
 | 
			
		||||
	call AICheckIfHPBelowFraction
 | 
			
		||||
	ret nc
 | 
			
		||||
	jp AIUseFullRestore	; this was a Dire Hit in the proto assets but we all know how useful that item is in Gen 1
 | 
			
		||||
 | 
			
		||||
GenericAI:
 | 
			
		||||
	and a ; clear carry
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -77,11 +77,11 @@ _GiovannisRoomText3::
 | 
			
		|||
	
 | 
			
		||||
	para "PROTECTOR: ¥3,000" ; Giovanni discovered the Protector's use with Rhyperior.
 | 
			
		||||
 | 
			
		||||
	para "DIRE HIT: ¥5,200" ; Giovanni uses this in battle.
 | 
			
		||||
	para "X ATTACK: ¥8,000" ; Giovanni uses this in battle.
 | 
			
		||||
 | 
			
		||||
	para "TM27 R&D: ¥15,000" ; Giovanni is confirmed to have created Fissure in vanilla RBY. He also says he made Earthquake in FRLG, but it feels contrived.
 | 
			
		||||
 | 
			
		||||
	para "Business: ¥100,000"
 | 
			
		||||
	para "Business: ¥250,000"
 | 
			
		||||
	
 | 
			
		||||
	para "It keeps going..."
 | 
			
		||||
	
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in a new issue