Code: |
multiplier = @enemy.rareness * (ball_rate) maxhp = @enemy.maxhp_basis hp = @enemy.hp catch_rate = Integer((((maxhp * 3 - hp * 2)*multiplier).to_f/(maxhp*3).to_f)*status_multiplier) catch_value = Integer(1048560 / (Math.sqrt(Math.sqrt(16711680/catch_rate.to_f)))) |
Code: |
catch_value = Integer(65535*Math.sqrt(Math.sqrt(catch_rate.to_f/255))) |
Code: |
multiplier = @enemy.rareness * (ball_rate) maxhp = @enemy.maxhp_basis hp = @enemy.hp catch_rate = Integer((((maxhp * 3 - hp * 2)*multiplier).to_f/(maxhp*3).to_f)*status_multiplier) catch_value = Integer(1048560 / (Math.sqrt(Math.sqrt(16711680/catch_rate.to_f)))) list = [rand(65536), rand(65536), rand(65536), rand(65536)] j = 4 # nombre de fois que la balle oscille for i in list j -= i > catch_value ? 1 : 0 end |
Code: |
# Calcul des la possibilité de capture. # Source : Poképedia (http://www.pokepedia.fr/index.php/Capture_des_Pok%C3%A9mon) # Conversion des valeurs utilisé en flottant maxhp = @enemy.maxhp_basis.to_f hp = @enemy.hp.to_f rareness = @enemy.rareness.to_f ball_rate = ball_rate.to_f status_multiplier = status_multiplier.to_f # Calcul du premier flottant ( a = Float(((maxhp * 3 - 2 * hp) * rareness * ball_rate * status_multiplier)/(maxhp * 3)) if a >= 255 # Le Pokémon est capturé j = 4 else # Deuxième chance de capture b = 65535.0 * Math.sqrt(Math.sqrt(a/255.0)) j = 0 # Initialement, la ball ne bouge pas. for i in 0...4 if rand(65535) <= b # Ajoute un mouvement de la ball pour chaque nombre aléatoire en dessous de b j += 1 # Il y a une chance pour qu'ils soient tous en dessous de b et que le Pokémon soit capturé au rattrapage (comme au bac) end end end #print(a, ", ", b, ", ", j, " / ", rareness, ", ", status_multiplier, ", ", ball_rate) # DEBUG |
Pαlвσlѕку a écrit: |
Normalement ça doit pouvoir se mettre dans toutes les versions de PSP, sauf peut-être PSP4G+ avec le système de vol de Pokémon. |
Ku'rei Jinwu a écrit: |
Pour le système de vol; un copier/coller pour remplacer l'algo existant ligne 591 de Pokemon_Battle_Trainer et le tour est joué. |
Code: |
multiplier = @enemy.rareness * (ball_rate) maxhp = @enemy.maxhp_basis hp = @enemy.hp catch_rate = Integer((((maxhp * 3 - hp * 2)*multiplier).to_f/(maxhp*3).to_f)*status_multiplier) catch_value = Integer(1048560 / (Math.sqrt(Math.sqrt(16711680/catch_rate.to_f)))) list = [rand(65536), rand(65536), rand(65536), rand(65536)] j = 4 # nombre de fois que la balle oscille for i in list j -= i > catch_value ? 1 : 0 end |
Code: |
# Calcul des la possibilité de capture. # Source : Poképedia (http://www.pokepedia.fr/index.php/Capture_des_Pok%C3%A9mon) # Conversion des valeurs utilisé en flottant maxhp = @enemy.maxhp_basis.to_f hp = @enemy.hp.to_f rareness = @enemy.rareness.to_f ball_rate = ball_rate.to_f status_multiplier = status_multiplier.to_f # Calcul du premier flottant ( a = Float(((maxhp * 3 - 2 * hp) * rareness * ball_rate * status_multiplier)/(maxhp * 3)) if a >= 255 # Le Pokémon est capturé j = 4 else # Deuxième chance de capture b = 65535.0 * Math.sqrt(Math.sqrt(a/255.0)) j = 0 # Initialement, la ball ne bouge pas. for i in 0...4 if rand(65535) <= b # Ajoute un mouvement de la ball pour chaque nombre aléatoire en dessous de b j += 1 # Il y a une chance pour qu'ils soient tous en dessous de b et que le Pokémon soit capturé au rattrapage (comme au bac) end end end #print(a, ", ", b, ", ", j, " / ", rareness, ", ", status_multiplier, ", ", ball_rate) # DEBUG |