Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #===============================================================================
- # ICF-Soft Enemy Selector for XP Version 1.0
- #-------------------------------------------------------------------------------
- # Scripted by ICF-Soft [http://icfsoft.blogspot.com.es/]
- # Commercial use avaiable. Credit to ICF-Soft
- #===============================================================================
- # This header must be included with script, in english or spanish.
- #===============================================================================
- #===============================================================================
- module ICFSOFT
- #===============================================================================
- #Configuration
- #Game Variable where store selector.
- $EnemyVar = 40
- #Conversion type:
- # true: change enemy if equal to selector. For diversity purposes.
- # false: change enemy according to the highest one that is lower than
- # selector. Usefull for difficulty purposes.
- $EnemyVarAbsolute = false
- #Selector table format
- #
- # A hash with key numbers that stores arrays.
- # Those arrays store 2 element arrays.
- # First element is the selector and second is id from enemy that sustitutes
- # actual enemy. Selectors must be in ascending order.
- #
- # You can init as an empty hash $EnemySelector = {}
- # Or give initial values like this
- $EnemySelector = {1=>[[1,2],[2,3],[3,4]], 2=>[[2,3],[3,4]], 3=>[[3,4]]}
- # You can add more keys like these
- $EnemySelector[5] = [[3,6]]
- $EnemySelector[7] = [[1,8],[2,9],[3,10]]
- $EnemySelector[11] = [[1,12],[2,13],[3,14]]
- #This way enemies are config to change according to selector
- #Non configured enemies will have no effect
- #-------------------------------------------------------------------------------
- def self.EnemySelector(enemyid)
- conver = enemyid
- ary = $EnemySelector[conver]
- x = -1
- if $EnemySelector[conver] == nil
- return conver
- end
- if $EnemyVarAbsolute
- for i in 0..(ary.length - 1)
- if ary[i][0] == $game_variables[$EnemyVar]
- x = i
- break
- end
- end
- else
- i = ary.length - 1
- while (i >= 0) do
- if ary[i][0] <= $game_variables[$EnemyVar]
- x = i
- break
- end
- i -= 1
- end
- end
- if x >= 0
- conver = ary[x][1]
- end
- return conver
- end
- end
- #===============================================================================
- #===============================================================================
- class Game_Enemy < Game_Battler
- def initialize(troop_id, member_index)
- super()
- @troop_id = troop_id
- @member_index = member_index
- troop = $data_troops[@troop_id]
- @enemy_id = ICFSOFT::EnemySelector(troop.members[@member_index].enemy_id)
- enemy = $data_enemies[@enemy_id]
- @battler_name = enemy.battler_name
- @battler_hue = enemy.battler_hue
- @hp = maxhp
- @sp = maxsp
- @hidden = troop.members[@member_index].hidden
- @immortal = troop.members[@member_index].immortal
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement