SHOW:
|
|
- or go back to the newest paste.
| 1 | #=============================================================================== | |
| 2 | - | # ICF-Soft Enemy Selector for XP Version 1.0 |
| 2 | + | # ICF-Soft Enemy Selector para XP Version 1.0 |
| 3 | #------------------------------------------------------------------------------- | |
| 4 | - | # Scripted by ICF-Soft [http://icfsoft.blogspot.com.es/] |
| 4 | + | # Hecho por ICF-Soft [http://icfsoft.blogspot.com.es/] |
| 5 | - | # Commercial use avaiable. Credit to ICF-Soft |
| 5 | + | # Se permite el uso comercial. Se debe incluir a ICF-Soft en los créditos. |
| 6 | #=============================================================================== | |
| 7 | - | # This header must be included with script, in english or spanish. |
| 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 | - | #Configuration |
| 14 | + | #Configuración |
| 15 | ||
| 16 | - | #Game Variable where store selector. |
| 16 | + | #Variable donde almacenar el selector. |
| 17 | $EnemyVar = 40 | |
| 18 | ||
| 19 | - | #Conversion type: |
| 19 | + | #Tipo de conversión: |
| 20 | - | # true: change enemy if equal to selector. For diversity purposes. |
| 20 | + | # true para cambiar el enemigo si coincide con el selector. Para distintos |
| 21 | - | # false: change enemy according to the highest one that is lower than |
| 21 | + | # propósitos. |
| 22 | - | # selector. Usefull for difficulty purposes. |
| 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 | - | #Selector table format |
| 25 | + | |
| 26 | #Formato de la tabla de selectores | |
| 27 | - | # A hash with key numbers that stores arrays. |
| 27 | + | |
| 28 | - | # Those arrays store 2 element arrays. |
| 28 | + | # Se trata de una hash numérica que almacena arrays. |
| 29 | - | # First element is the selector and second is id from enemy that sustitutes |
| 29 | + | # Cada array se compone de otras arrays de 2 elementos. |
| 30 | - | # actual enemy. Selectors must be in ascending order. |
| 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 | - | # You can init as an empty hash $EnemySelector = {}
|
| 32 | + | |
| 33 | - | # Or give initial values like this |
| 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 | - | # You can add more keys like these |
| 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 | - | #This way enemies are config to change according to selector |
| 44 | + | |
| 45 | - | #Non configured enemies will have no effect |
| 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(troop_id, member_index) | |
| 84 | super() | |
| 85 | @troop_id = troop_id | |
| 86 | @member_index = member_index | |
| 87 | troop = $data_troops[@troop_id] | |
| 88 | @enemy_id = ICFSOFT::EnemySelector(troop.members[@member_index].enemy_id) | |
| 89 | enemy = $data_enemies[@enemy_id] | |
| 90 | @battler_name = enemy.battler_name | |
| 91 | @battler_hue = enemy.battler_hue | |
| 92 | @hp = maxhp | |
| 93 | @sp = maxsp | |
| 94 | @hidden = troop.members[@member_index].hidden | |
| 95 | @immortal = troop.members[@member_index].immortal | |
| 96 | end | |
| 97 | end |