SHOW:
|
|
- or go back to the newest paste.
| 1 | #=============================================================================== | |
| 2 | - | # ICF-Soft Enemy Selector para VX Version 1.0 |
| 2 | + | # ICF-Soft Enemy Selector para VX Ace Version 1.0 |
| 3 | #------------------------------------------------------------------------------- | |
| 4 | # Hecho por ICF-Soft [http://icfsoft.blogspot.com.es/] | |
| 5 | # Se permite el uso comercial. Se debe incluir a ICF-Soft en los créditos. | |
| 6 | #=============================================================================== | |
| 7 | # Esta cabecera debe incluirse en el script, ya sea en inglés o en español. | |
| 8 | #=============================================================================== | |
| 9 | ||
| 10 | #=============================================================================== | |
| 11 | module ICFSOFT | |
| 12 | #=============================================================================== | |
| 13 | ||
| 14 | #Configuración | |
| 15 | ||
| 16 | #Variable donde almacenar el selector. | |
| 17 | $EnemyVar = 40 | |
| 18 | ||
| 19 | #Tipo de conversión: | |
| 20 | # true para cambiar el enemigo si coincide con el selector. Para distintos | |
| 21 | # propósitos. | |
| 22 | # false para cambiar el enemigo conforme al valor más alto que no supere al | |
| 23 | # selector. Útil para niveles de dificultad. | |
| 24 | $EnemyVarAbsolute = false | |
| 25 | ||
| 26 | #Formato de la tabla de selectores | |
| 27 | # | |
| 28 | # Se trata de una hash numérica que almacena arrays. | |
| 29 | # Cada array se compone de otras arrays de 2 elementos. | |
| 30 | # El primer elemento es el selector y el segundo la id del enemigo por | |
| 31 | # la que se reemplaza. Los selectores deben estar en orden progresivo. | |
| 32 | # | |
| 33 | # Se puede inicializar como una hash vacía $EnemySelector = {}
| |
| 34 | # O poner unos valores iniciales como aquí | |
| 35 | ||
| 36 | $EnemySelector = {1=>[[1,2],[2,3],[3,4]], 2=>[[2,3],[3,4]], 3=>[[3,4]]}
| |
| 37 | ||
| 38 | # Se pueden ir añadiendo más claves del siguiente modo | |
| 39 | ||
| 40 | $EnemySelector[5] = [[3,6]] | |
| 41 | $EnemySelector[7] = [[1,8],[2,9],[3,10]] | |
| 42 | $EnemySelector[11] = [[1,12],[2,13],[3,14]] | |
| 43 | ||
| 44 | ||
| 45 | #De este modo se configuran los enemigos según el nivel de dificultad | |
| 46 | #Los enemigos que no configures no recibirán ningún efecto | |
| 47 | ||
| 48 | #------------------------------------------------------------------------------- | |
| 49 | def self.EnemySelector(enemyid) | |
| 50 | conver = enemyid | |
| 51 | ary = $EnemySelector[conver] | |
| 52 | x = -1 | |
| 53 | if $EnemySelector[conver] == nil | |
| 54 | return conver | |
| 55 | end | |
| 56 | if $EnemyVarAbsolute | |
| 57 | for i in 0..(ary.length - 1) | |
| 58 | if ary[i][0] == $game_variables[$EnemyVar] | |
| 59 | x = i | |
| 60 | break | |
| 61 | end | |
| 62 | end | |
| 63 | else | |
| 64 | i = ary.length - 1 | |
| 65 | while (i >= 0) do | |
| 66 | if ary[i][0] <= $game_variables[$EnemyVar] | |
| 67 | x = i | |
| 68 | break | |
| 69 | end | |
| 70 | i -= 1 | |
| 71 | end | |
| 72 | end | |
| 73 | if x >= 0 | |
| 74 | conver = ary[x][1] | |
| 75 | end | |
| 76 | return conver | |
| 77 | end | |
| 78 | ||
| 79 | end | |
| 80 | #=============================================================================== | |
| 81 | #=============================================================================== | |
| 82 | class Game_Enemy < Game_Battler | |
| 83 | def initialize(index, enemy_id) | |
| 84 | super() | |
| 85 | @index = index | |
| 86 | @enemy_id = ICFSOFT::EnemySelector(enemy_id) | |
| 87 | enemy = $data_enemies[@enemy_id] | |
| 88 | @original_name = enemy.name | |
| 89 | - | @letter = '' |
| 89 | + | @letter = "" |
| 90 | @plural = false | |
| 91 | @screen_x = 0 | |
| 92 | @screen_y = 0 | |
| 93 | @battler_name = enemy.battler_name | |
| 94 | @battler_hue = enemy.battler_hue | |
| 95 | - | @hp = maxhp |
| 95 | + | @hp = mhp |
| 96 | - | @mp = maxmp |
| 96 | + | @mp = mmp |
| 97 | end | |
| 98 | end |