|
|
#============================================================================== # ** COGWHEEL Plug 'n' Play Menu Bars (based on Syvkal's revisions) #------------------------------------------------------------------------------- # by DerVVulfman # Version 1.1 # 06-28-06 #------------------------------------------------------------------------------ # This is a revision of Cogwheel's famous bargraph system, now set as an inser- # table script to display bargraphs behind values in the menus. # # To prevent conflict with Cogwheel's RTAB system, two key definitions have been # renamed: "gauge_rect" to "cw_gauge" & "gradation_rect" to "cw_grad_rect." # # # Affected Systems: Main Menu # Skill Menu # Status Menu # Hero Select Menu (for Items & Skills) # Equipment Menu # BattleStatus Menu # # The system uses a series of CONSTANTS that can be edited here. They control # the basic gauge colors and the manner the gauge is filled:
# Gauge Border Colors COG_COLOR1 = Color.new(0, 0, 0, 192) # Outer Border COG_COLOR2 = Color.new(255, 255, 192, 192) # Inner Border # Gauge Empty filler COG_COLOR3 = Color.new(0, 0, 0, 192) # Half of Inner Shading COG_COLOR4 = Color.new(64, 0, 0, 192) # Half of Inner Shading # Alignment COG_ALIGN1 = 1 # Type 1: (0: Left / 1: Center / 2: Right Justify) COG_ALIGN2 = 2 # Type 2: (0: Upper / 1: Central / 2: Lower) COG_ALIGN3 = 0 # FILL ALIGNMENT (0: Left Justify / 1: Right Justify) # Gauge Settings COG_GRADE1 = 1 # EMPTY gauge (0: Side / 1: Vertical / 2: Slanted) COG_GRADE2 = 0 # FILLER gauge (0: Side / 1: Vertical / 2: Slanted)
#============================================================================== # ** Game_Actor #------------------------------------------------------------------------------ # This class handles the actor. It's used within the Game_Actors class # ($game_actors) and refers to the Game_Party class ($game_party). #==============================================================================
class Game_Actor < Game_Battler #-------------------------------------------------------------------------- # * Get EXP - numeric for calculations #-------------------------------------------------------------------------- def now_exp return @exp - @exp_list[@level] end #-------------------------------------------------------------------------- # * Get Next Level EXP - numeric for calculations #-------------------------------------------------------------------------- def next_exp return @exp_list[@level+1] > 0 ? @exp_list[@level+1] - @exp_list[@level] : 0 end #-------------------------------------------------------------------------- # * End of Class #-------------------------------------------------------------------------- end
#============================================================================== # ** Window_Base #------------------------------------------------------------------------------ # This class is for all in-game windows. #==============================================================================
class Window_Base < Window #-------------------------------------------------------------------------- # * Draw EXP w/ Bars # actor : actor # x : draw spot x-coordinate # y : draw spot y-coordinate #-------------------------------------------------------------------------- alias draw_actor_exp_original draw_actor_exp def draw_actor_exp(actor, x, y, width = 204) if actor.next_exp != 0 rate = actor.now_exp.to_f / actor.next_exp else rate = 1 end # Calculate Bar Gradiation if actor.next_exp != 0 rate = actor.now_exp.to_f / actor.next_exp else rate = 1 end # Adjust Bar Color based on Gradiation color1 = Color.new(80 - 24 * rate, 80 * rate, 14 * rate, 192) color2 = Color.new(100 - 72 * rate, 240 * rate, 62 * rate, 192) # Calculate Bar Width if actor.next_exp != 0 exp = width * actor.now_exp / actor.next_exp else exp = width end # Draw Bar Graph cw_gauge(x, y + 25, width, 10, exp, color1, color2) # Call original EXP draw_actor_exp_original(actor, x, y) end #-------------------------------------------------------------------------- # * Draw HP w/ Bars # actor : actor # x : draw spot x-coordinate # y : draw spot y-coordinate # width : draw spot width #-------------------------------------------------------------------------- alias draw_actor_hp_original draw_actor_hp def draw_actor_hp(actor, x, y, width = 144) # Calculate Bar Gradiation if actor.maxhp != 0 rate = actor.hp.to_f / actor.maxhp else rate = 0 end # Adjust Bar Color based on Gradiation color1 = Color.new(216 - 24 * rate, 0 * rate, 0 * rate, 192) color2 = Color.new(255 * rate, 165 * rate, 0 * rate, 192) # Calculate Bar Width if actor.maxhp != 0 hp = width * actor.hp / actor.maxhp else hp = 0 end # Draw Bar Graph cw_gauge(x, y + 25, width, 10, hp, color1, color2) # Call original HP draw_actor_hp_original(actor, x, y, width) end
#-------------------------------------------------------------------------- # * Draw SP w/ Bars # actor : actor # x : draw spot x-coordinate # y : draw spot y-coordinate # width : draw spot width #-------------------------------------------------------------------------- alias draw_actor_sp_original draw_actor_sp def draw_actor_sp(actor, x, y, width = 144) # Calculate Bar Gradiation if actor.maxsp != 0 rate = actor.sp.to_f / actor.maxsp else rate = 1 end # Adjust Bar Color based on Gradiation color1 = Color.new(14 * rate, 80 - 24 * rate, 80 * rate, 192) color2 = Color.new(62 * rate, 240 - 72 * rate, 240 * rate, 192) # Calculate Bar Width if actor.maxsp != 0 sp = width * actor.sp / actor.maxsp else sp = width end # Draw Bar Graph cw_gauge(x + width * 0 / 100, y + 25, width, 10, sp, color1, color2) # Call original SP draw_actor_sp_original(actor, x, y, width) end
#-------------------------------------------------------------------------- # * Draw Parameter w/ Bars # actor : actor # x : draw spot x-coordinate # y : draw spot y-coordinate # type : parameter type (0-6) #-------------------------------------------------------------------------- alias draw_actor_parameter_original draw_actor_parameter def draw_actor_parameter(actor, x, y, type) # Choose Color & Parameter Type case type when 0 e1 = actor.atk c6 = Color.new(253, 53, 56, 192) c5 = Color.new(242, 2, 6, 192) when 1 e1 = actor.pdef c6 = Color.new(238, 254, 124, 192) c5 = Color.new(228, 253, 48, 192) when 2 e1 = actor.mdef c6 = Color.new(150, 37, 184, 192) c5 = Color.new(170, 57, 204, 192) when 3 e1 = actor.str c6 = Color.new(253, 163, 33, 192) c5 = Color.new(254, 209, 154, 192) when 4 e1 = actor.dex c6 = Color.new(255, 255, 255, 192) c5 = Color.new(222, 222, 222, 192) when 5 e1 = actor.agi c6 = Color.new(124, 254, 155, 192) c5 = Color.new(33, 253, 86, 192) when 6 e1 = actor.int c6 = Color.new(119, 203, 254, 192) c5 = Color.new(8, 160, 253, 192) end # Calculate Bar Gradiation e2 = 999 if e1.to_f != 0 rate = e1.to_f / e2.to_f else rate = 1 end # Adjust Bar Color based on Gradiation & Parameter Type for i in 0..7 r = c6.red * rate g = (c6.green - 10) * rate b = c6.blue * rate a = c6.alpha end # Calculate Bar Width width = 168 if e1.to_f != 0 par = width * e1.to_f / e2.to_f else par = width end # Equipment Calc Fix case type when 0 if e1 == 0 par = 0 end when 1 if e1 == 0 par = 0 end when 2 if e1 == 0 par = 0 end end # Draw Bar Graph cw_gauge(x , y + 25, width, 7, par, c5, Color.new(r, g, b, a)) # Call Original Parameter draw_actor_parameter_original(actor, x, y, type) end
#-------------------------------------------------------------------------- # * Gauge Rectangle (New to Class) #-------------------------------------------------------------------------- def cw_gauge(x, y, width, height, gauge, color1, color2)
# Use Cogwheel PRESETS color3 = COG_COLOR1 color4 = COG_COLOR2 color5 = COG_COLOR3 color6 = COG_COLOR4 align1 = COG_ALIGN1 align2 = COG_ALIGN2 align3 = COG_ALIGN3 grade1 = COG_GRADE1 grade2 = COG_GRADE2 # Create Rectangle Width based on gauge max. rect_width = width case align1 when 1 x += (rect_width - width) / 2 when 2 x += rect_width - width end case align2 when 1 y -= height / 2 when 2 y -= height end self.contents.fill_rect(x, y, width, height, color3) self.contents.fill_rect(x + 1, y + 1, width - 2, height - 2, color4) if align3 == 0 if grade1 == 2 grade1 = 3 end if grade2 == 2 grade2 = 3 end end if (align3 == 1 and grade1 == 0) or grade1 > 0 color = color5 color5 = color6 color6 = color end if (align3 == 1 and grade2 == 0) or grade2 > 0 color = color1 color1 = color2 color2 = color end self.contents.cw_grad_rect(x + 2, y + 2, width - 4, height - 4, color5, color6, grade1) if align3 == 1 x += width - gauge end self.contents.cw_grad_rect(x + 2, y + 2, gauge - 4, height - 4, color1, color2, grade2) end #-------------------------------------------------------------------------- # * End of Class #-------------------------------------------------------------------------- end
#============================================================================== # ** Bitmap #============================================================================== class Bitmap
#-------------------------------------------------------------------------- # * Gradation Rectangle #-------------------------------------------------------------------------- def cw_grad_rect(x, y, width, height, color3, color4, align = 0) if align == 0 for i in x...x + width red = color3.red + (color4.red - color3.red) * (i - x) / (width - 1) green = color3.green + (color4.green - color3.green) * (i - x) / (width - 1) blue = color3.blue + (color4.blue - color3.blue) * (i - x) / (width - 1) alpha = color3.alpha + (color4.alpha - color3.alpha) * (i - x) / (width - 1) color = Color.new(red, green, blue, alpha) fill_rect(i, y, 1, height, color) end elsif align == 1 for i in y...y + height red = color3.red + (color4.red - color3.red) * (i - y) / (height - 1) green = color3.green + (color4.green - color3.green) * (i - y) / (height - 1) blue = color3.blue + (color4.blue - color3.blue) * (i - y) / (height - 1) alpha = color3.alpha + (color4.alpha - color3.alpha) * (i - y) / (height - 1) color = Color.new(red, green, blue, alpha) fill_rect(x, i, width, 1, color) end elsif align == 2 for i in x...x + width for j in y...y + height red = color3.red + (color4.red - color3.red) * ((i - x) / (width - 1.0) + (j - y) / (height - 1.0)) / 2 green = color3.green + (color4.green - color3.green) * ((i - x) / (width - 1.0) + (j - y) / (height - 1.0)) / 2 blue = color3.blue + (color4.blue - color3.blue) * ((i - x) / (width - 1.0) + (j - y) / (height - 1.0)) / 2 alpha = color3.alpha + (color4.alpha - color3.alpha) * ((i - x) / (width - 1.0) + (j - y) / (height - 1.0)) / 2 color = Color.new(red, green, blue, alpha) set_pixel(i, j, color) end end elsif align == 3 for i in x...x + width for j in y...y + height red = color3.red + (color4.red - color3.red) * ((x + width - i) / (width - 1.0) + (j - y) / (height - 1.0)) / 2 green = color3.green + (color4.green - color3.green) * ((x + width - i) / (width - 1.0) + (j - y) / (height - 1.0)) / 2 blue = color3.blue + (color4.blue - color3.blue) * ((x + width - i) / (width - 1.0) + (j - y) / (height - 1.0)) / 2 alpha = color3.alpha + (color4.alpha - color3.alpha) * ((x + width - i) / (width - 1.0) + (j - y) / (height - 1.0)) / 2 color = Color.new(red, green, blue, alpha) set_pixel(i, j, color) end end end end #-------------------------------------------------------------------------- # * End of Class #-------------------------------------------------------------------------- end
Expand to see the code.
#============================================================================== # ** Dynamic Enemies #------------------------------------------------------------------------------ # SephirothSpawn # Version 3.01 # 2007-05-11 # SDK : Version 2.0+, Part 1 #------------------------------------------------------------------------------ # * Version History : # # Version 1 ---------------------------------------------------- (2006-08-06) # Version 2 ---------------------------------------------------- (2006-10-07) # - Update : Updated to work with Trickster's Curve Generator Module # Version 3 ---------------------------------------------------- (2007-02-28) # - Update : Rescripted entire system # Version 3.01 ------------------------------------------------ (2007-05-11) # - Bug Fix : Fixed Extremely Minor Base Stat Level Error #------------------------------------------------------------------------------ # * Requirements : # # Method & Class Library 2.1+ #------------------------------------------------------------------------------ # * Description # # This script was designed to allow your game to have enemies that develope # as your actors do. No longer will you encounter the same old boring enemy # each time. As the developer, you can control the development of each stat # for each enemy. The script assigns the enemy a semi-random and controled # level depending on the party's average level. The stats are then pulled # from a generated curve based of your definitions. #------------------------------------------------------------------------------ # * Instructions # # Place The Script Below the SDK and Above Main. # To Customize your enemy stats, refer to the customization instructions. #------------------------------------------------------------------------------ # * Customization # # Setting unaffected enemies # - Unaffected_Enemies = [enemy_id, enemy_id, ...] # # Setting enemy stats # - Stats = { # enemy_id => { <stat_name> => [ generator_type, *args ], ... } # , ... # } # # Stat Names : 'maxhp', 'maxsp', 'str', 'dex', 'agi', 'int', 'atk', # 'pdef', 'mdef', 'eva', 'hit', 'exp', 'gold' # # ** Refer to Curve Generator System for type and args specification. # # Enemy Min & Max Level # - Min_Levels = { enemy_id => min_level, ... } # - Max_Levels = { enemy_id => max_level, ... } # # Default Min & Max Level (For all non-defined enemies) # - Min_Levels.default = min_level # - Max_Levels.default = max_level # # Range For Enemy Levels Off Party Level # - Level_Ranges = { enemy_id => (min_v..max_v), ... } # # Range For Enemy Levels Off Party Level (For all non-defined enemies) # - Level_Ranges.default = (min_v..max_v) #-------------------------------------------------------------------------- # * Syntax : # # Enemy Level # - <game_enemy>.level # # Dynamic Enemies # - <game_enemy>.is_dynamic? #==============================================================================
#------------------------------------------------------------------------------ # * SDK Log Script #------------------------------------------------------------------------------ SDK.log('Dynamic Enemies', 'SephirothSpawn', 3.01, '2007-05-11') SDK.check_requirements(2.0, [], {'Method & Class Library' => 2.1})
#------------------------------------------------------------------------------ # * Begin SDK Enable Test #------------------------------------------------------------------------------ if SDK.enabled?('Dynamic Enemies') #============================================================================== # ** Dynamic_Enemies #==============================================================================
module Dynamic_Enemies #-------------------------------------------------------------------------- # * Saves Curves # # ~ @cache = { <generator_setup> => <curve>, ... } #-------------------------------------------------------------------------- @cache = {} #-------------------------------------------------------------------------- # * Unaffected Enemies # # ~ Unaffected_Enemies = [enemy_id, enemy_id, ...] #-------------------------------------------------------------------------- Unaffected_Enemies = [] #-------------------------------------------------------------------------- # * Stats # # ~ enemy_id => { <stat_name> => [ generator_type, *args ], ... } # # Stat Names : 'maxhp', 'maxsp', 'str', 'dex', 'agi', 'int', 'atk', # 'pdef', 'mdef', 'eva', 'hit', 'exp', 'gold' # # ** Refer to Curve Generator System for type and args specification. #-------------------------------------------------------------------------- Stats = { 2 => { 'maxhp' => [0, 1, 5, 1, 100], 'maxsp' => [0, 1, 99, 150, 50], 'str' => [0, 1, 99, 50, 5], 'dex' => [0, 1, 99, 50, 10], 'agi' => [0, 1, 99, 50, 10], 'int' => [0, 1, 99, 10, 5] }, 4 => { 'maxhp' => [0, 1, 99, 500, 150], 'maxsp' => [0, 1, 99, 200, 75], 'str' => [0, 1, 99, 50, 10], 'dex' => [0, 1, 99, 50, 10], 'agi' => [0, 1, 99, 50, 10], 'int' => [0, 1, 99, 10, 10] }, 35 => { 'maxhp' => [0, 1, 99, 500, 150], 'maxsp' => [0, 1, 99, 200, 75], 'str' => [0, 1, 99, 50, 10], 'dex' => [0, 1, 99, 50, 10], 'agi' => [0, 1, 99, 50, 10], 'int' => [0, 1, 99, 10, 10] }, 34 => { 'maxhp' => [0, 1, 99, 500, 150], 'maxsp' => [0, 1, 99, 200, 75], 'str' => [0, 1, 99, 50, 10], 'dex' => [0, 1, 99, 50, 10], 'agi' => [0, 1, 99, 50, 10], 'int' => [0, 1, 99, 10, 10] }, 33 => { 'maxhp' => [0, 1, 99, 500, 150], 'maxsp' => [0, 1, 99, 200, 75], 'str' => [0, 1, 99, 50, 10], 'dex' => [0, 1, 99, 50, 10], 'agi' => [0, 1, 99, 50, 10], 'int' => [0, 1, 99, 10, 10] }, 13 => { 'maxhp' => [0, 1, 99, 500, 150], 'maxsp' => [0, 1, 99, 200, 75], 'str' => [0, 1, 99, 50, 10], 'dex' => [0, 1, 99, 50, 10], 'agi' => [0, 1, 99, 50, 10], 'int' => [0, 1, 99, 10, 10] }, 36 => { 'maxhp' => [0, 1, 99, 500, 150], 'maxsp' => [0, 1, 99, 200, 75], 'str' => [0, 1, 99, 50, 10], 'dex' => [0, 1, 99, 50, 10], 'agi' => [0, 1, 99, 50, 10], 'int' => [0, 1, 99, 50, 10] }, 3 => { 'maxhp' => [0, 1, 99, 500, 150], 'maxsp' => [0, 1, 99, 200, 75], 'str' => [0, 1, 99, 50, 10], 'dex' => [0, 1, 99, 50, 10], 'agi' => [0, 1, 99, 50, 10], 'int' => [0, 1, 99, 50, 10] }, 7 => { 'maxhp' => [0, 1, 99, 500, 150], 'maxsp' => [0, 1, 99, 200, 75], 'str' => [0, 1, 99, 50, 10], 'dex' => [0, 1, 99, 50, 10], 'agi' => [0, 1, 99, 50, 10], 'int' => [0, 1, 99, 50, 10] }, 11 => { 'maxhp' => [0, 1, 99, 500, 150], 'maxsp' => [0, 1, 99, 200, 75], 'str' => [0, 1, 99, 50, 10], 'dex' => [0, 1, 99, 50, 10], 'agi' => [0, 1, 99, 50, 10], 'int' => [0, 1, 99, 50, 10] }, 41 => { 'maxhp' => [0, 1, 99, 500, 150], 'maxsp' => [0, 1, 99, 200, 75], 'str' => [0, 1, 99, 50, 10], 'dex' => [0, 1, 99, 50, 10], 'agi' => [0, 1, 99, 50, 10], 'int' => [0, 1, 99, 50, 10] }, 42 => { 'maxhp' => [0, 1, 99, 500, 150], 'maxsp' => [0, 1, 99, 200, 75], 'str' => [0, 1, 99, 50, 10], 'dex' => [0, 1, 99, 50, 10], 'agi' => [0, 1, 99, 50, 10], 'int' => [0, 1, 99, 50, 10] }, 5 => { 'maxhp' => [0, 1, 99, 500, 150], 'maxsp' => [0, 1, 99, 200, 75], 'str' => [0, 1, 99, 50, 10], 'dex' => [0, 1, 99, 50, 10], 'agi' => [0, 1, 99, 50, 10], 'int' => [0, 1, 99, 50, 10] } } #-------------------------------------------------------------------------- # * Defaults : BE CAREFUL WITH ALTERATION #-------------------------------------------------------------------------- Stats.default = {} # Default For All Non-Defined Stats Stats.default.default = [0, 1, 99, 500, 220] Stats.values.each do |stat_settings| # Default For All Non-Defined Stats For Defined Enemies stat_settings.default = [0, 1, 99, 500, 220] end #-------------------------------------------------------------------------- # * Level Specifications # # Enemy Min & Max Level # - Min_Levels = { enemy_id => min_level, ... } # - Max_Levels = { enemy_id => max_level, ... } # # Default Min & Max Level (For all non-defined enemies) # - Min_Levels.default = min_level # - Max_Levels.default = max_level # # Range For Enemy Levels Off Party Level # - Level_Ranges = { enemy_id => (min_v..max_v), ... } # # Range For Enemy Levels Off Party Level (For all non-defined enemies) # - Level_Ranges.default = (min_v..max_v) #-------------------------------------------------------------------------- Min_Levels = {} Max_Levels = {} Level_Ranges = {} Min_Levels.default = 1 Max_Levels.default = 99 Level_Ranges.default = (0..0) #-------------------------------------------------------------------------- # * Get Base Stat #-------------------------------------------------------------------------- def self.get_base_stat(enemy_id, stat_name, level) # Gets Curve Data curve_data = Stats[enemy_id][stat_name] # Checks For Pre-defined Curve if @cache.has_key?(curve_data) return @cache[curve_data][level] end # Creates Curve Data curve = Curve_Generator.generate_curve(*curve_data) # Save Curve @cache[curve_data] = curve # Return Stat return curve[level] end #-------------------------------------------------------------------------- # * Generate Level #-------------------------------------------------------------------------- def self.generate_level(enemy_id) # Collect Average Party Level level = 0 $game_party.actors.each {|a| level += a.level} level /= $game_party.actors.size # Cap Level level = [[level, Min_Levels[enemy_id]].max, Max_Levels[enemy_id]].min # Modifies Level level += Level_Ranges[enemy_id].random # Return Level Data return level end end
#============================================================================== # ** Game_Enemy #==============================================================================
class Game_Enemy < Game_Battler #-------------------------------------------------------------------------- # * Public Instance Variables #-------------------------------------------------------------------------- attr_reader :level #-------------------------------------------------------------------------- # * Alias Listings #-------------------------------------------------------------------------- alias_method :seph_dynenemies_gmenmy_init, :initialize alias_method :seph_dynenemies_gmenmy_maxhp, :base_maxhp alias_method :seph_dynenemies_gmenmy_maxsp, :base_maxhp alias_method :seph_dynenemies_gmenmy_str, :base_str alias_method :seph_dynenemies_gmenmy_dex, :base_dex alias_method :seph_dynenemies_gmenmy_agi, :base_agi alias_method :seph_dynenemies_gmenmy_int, :base_int alias_method :seph_dynenemies_gmenmy_atk, :base_atk alias_method :seph_dynenemies_gmenmy_eva, :base_eva alias_method :seph_dynenemies_gmenmy_pdef, :base_pdef alias_method :seph_dynenemies_gmenmy_mdef, :base_mdef alias_method :seph_dynenemies_gmenmy_exp, :exp alias_method :seph_dynenemies_gmenmy_gold, :gold #-------------------------------------------------------------------------- # * Is Dynamic #-------------------------------------------------------------------------- def is_dynamic?(enemy_id = @enemy_id) return Dynamic_Enemies::Stats.has_key?(enemy_id) end #-------------------------------------------------------------------------- # * Object Initialization #-------------------------------------------------------------------------- def initialize(troop_id, member_index) # Gets Enemy ID enemy_id = $data_troops[troop_id].members[member_index].enemy_id # Set Level @level = Dynamic_Enemies.generate_level(enemy_id) # Setup Dynamic Enemy setup_dynamic_enemy(enemy_id) if is_dynamic?(enemy_id) # Original Initialization seph_dynenemies_gmenmy_init(troop_id, member_index) end #-------------------------------------------------------------------------- # * Setup Dynamic Enemy #-------------------------------------------------------------------------- def setup_dynamic_enemy(enemy_id) # Set Dynamic Stats @dyn_base_maxhp = Dynamic_Enemies.get_base_stat(enemy_id, 'hp', @level) @dyn_base_maxsp = Dynamic_Enemies.get_base_stat(enemy_id, 'sp', @level) @dyn_base_str = Dynamic_Enemies.get_base_stat(enemy_id, 'str', @level) @dyn_base_dex = Dynamic_Enemies.get_base_stat(enemy_id, 'dex', @level) @dyn_base_agi = Dynamic_Enemies.get_base_stat(enemy_id, 'agi', @level) @dyn_base_int = Dynamic_Enemies.get_base_stat(enemy_id, 'int', @level) @dyn_base_atk = Dynamic_Enemies.get_base_stat(enemy_id, 'atk', @level) @dyn_base_eva = Dynamic_Enemies.get_base_stat(enemy_id, 'eva', @level) @dyn_base_pdef = Dynamic_Enemies.get_base_stat(enemy_id, 'pdef', @level) @dyn_base_mdef = Dynamic_Enemies.get_base_stat(enemy_id, 'mdef', @level) @dyn_gold = Dynamic_Enemies.get_base_stat(enemy_id, 'gold', @level) @dyn_exp = Dynamic_Enemies.get_base_stat(enemy_id, 'exp', @level) end #-------------------------------------------------------------------------- # * Get Basic Maximum HP #-------------------------------------------------------------------------- def base_maxhp return is_dynamic? ? @dyn_base_maxhp : seph_dynenemies_gmenmy_maxhp end #-------------------------------------------------------------------------- # * Get Basic Maximum SP #-------------------------------------------------------------------------- def base_maxsp return is_dynamic? ? @dyn_base_maxsp : seph_dynenemies_gmenmy_maxsp end #-------------------------------------------------------------------------- # * Get Basic Strength #-------------------------------------------------------------------------- def base_str return is_dynamic? ? @dyn_base_str : seph_dynenemies_gmenmy_str end #-------------------------------------------------------------------------- # * Get Basic Dexterity #-------------------------------------------------------------------------- def base_dex return is_dynamic? ? @dyn_base_dex : seph_dynenemies_gmenmy_dex end #-------------------------------------------------------------------------- # * Get Basic Agility #-------------------------------------------------------------------------- def base_agi return is_dynamic? ? @dyn_base_agi : seph_dynenemies_gmenmy_agi end #-------------------------------------------------------------------------- # * Get Basic Intelligence #-------------------------------------------------------------------------- def base_int return is_dynamic? ? @dyn_base_int : seph_dynenemies_gmenmy_int end #-------------------------------------------------------------------------- # * Get Basic Attack Power #-------------------------------------------------------------------------- def base_atk return is_dynamic? ? @dyn_base_atk : seph_dynenemies_gmenmy_atk end #-------------------------------------------------------------------------- # * Get Basic Physical Defense #-------------------------------------------------------------------------- def base_pdef return is_dynamic? ? @dyn_base_pdef : seph_dynenemies_gmenmy_pdef end #-------------------------------------------------------------------------- # * Get Basic Magic Defense #-------------------------------------------------------------------------- def base_mdef return is_dynamic? ? @dyn_base_mdef : seph_dynenemies_gmenmy_mdef end #-------------------------------------------------------------------------- # * Get Basic Evasion #-------------------------------------------------------------------------- def base_eva return is_dynamic? ? @dyn_base_eva : seph_dynenemies_gmenmy_eva end #-------------------------------------------------------------------------- # * Exp #-------------------------------------------------------------------------- def exp return is_dynamic? ? @dyn_exp : seph_dynenemies_gmenmy_exp end #-------------------------------------------------------------------------- # * Gold #-------------------------------------------------------------------------- def gold return is_dynamic? ? @dyn_gold : seph_dynenemies_gmenmy_gold end end
#-------------------------------------------------------------------------- # * End SDK Enable Test #-------------------------------------------------------------------------- end
Expand to see the code.
#============================================================================== # ** Dynamic Enemies - Quick Database Addition #------------------------------------------------------------------------------ # SephirothSpawn # Version 1 # 2007-08-05 # SDK : Version 2.0+, Part I #------------------------------------------------------------------------------ # * Version History : # # Version 1 ---------------------------------------------------- (2006-08-06) #------------------------------------------------------------------------------ # * Requirements : # # Dynamic Enemies System (3.0+) # Method & Class Library 2.1+ #------------------------------------------------------------------------------ # * Description # # This script was designed to allow you to quickly modify your enemy stats # rather than over-complicating things. It uses the quick point-slope # formula (base_value + inflation * enemy_level). Here, whatever you input # in the database will be the base_value. All you have to do is modify the # inflation values for each stat for each enemy. Any modifications to the # Stats constant in Dynamic Enemies system will be skipped (if you # setup for the stats for enemy 1, this will NOT override those settings). #------------------------------------------------------------------------------ # * Instructions # # Place The Script Below the SDK and Above Main. # To Customize your enemy stats, refer to the customization instructions. #------------------------------------------------------------------------------ # * Customization # # Setting Inflation Values # - Inflation_Values = { enemy_id => { <stat_name> => inflation, ...}, ... } # # Stat Names : 'maxhp', 'maxsp', 'str', 'dex', 'agi', 'int', 'atk', # 'pdef', 'mdef', 'eva', 'hit', 'exp', 'gold' #==============================================================================
#------------------------------------------------------------------------------ # * SDK Log Script #------------------------------------------------------------------------------ SDK.log('Dynamic Enemies - Quick Database Addition', 'SephirothSpawn', 1.0, '2007-08-05') SDK.check_requirements(2.0, [], {'Method & Class Library' => 2.1, 'Dynamic Enemies' => 3.0})
#------------------------------------------------------------------------------ # * Begin SDK Enable Test #------------------------------------------------------------------------------ if SDK.enabled?('Dynamic Enemies - Quick Database Addition') #============================================================================== # ** Dynamic_Enemies #==============================================================================
module Dynamic_Enemies #-------------------------------------------------------------------------- # * Inflation Values # # Setting Inflation Values # - Inflation_Values = { # enemy_id => { <stat_name> => inflation, ...}, ... # } # # Simple Modification Instrucitons # # 1) Below this line : Inflation_Values = {}, for each of your enemies, # add: # # Inflation_Values[enemy_id] = {} # # 2) For each of your enemies stats, add: # # Inflation_Values[enemy_id][<stat_name>] = inflation_value # # 3) Repeat for all enemies # # 4) Setting default for all enemeis, for all stats # # Default_Inflation_Values[<stat_name>] = inflation # # # Stat Names : 'maxhp', 'maxsp', 'str', 'dex', 'agi', 'int', 'atk', # 'pdef', 'mdef', 'eva', 'hit', 'exp', 'gold' # # NOTE : I have set hit to have a base value as 100. You can find it down # in the Do Not Modify section if you really want to modify it. I # just wouldn't suggest it. #-------------------------------------------------------------------------- Inflation_Values = {} #-------------------------------------------------------------------------- # * Default Settings #-------------------------------------------------------------------------- Default_Inflation_Values = {} Default_Inflation_Values['maxhp'] = 100 Default_Inflation_Values['maxsp'] = 50 Default_Inflation_Values['str'] = 3 Default_Inflation_Values['dex'] = 3 Default_Inflation_Values['agi'] = 3 Default_Inflation_Values['int'] = 3 Default_Inflation_Values['atk'] = 0 Default_Inflation_Values['pdef'] = 0 Default_Inflation_Values['mdef'] = 0 Default_Inflation_Values['eva'] = 0 Default_Inflation_Values['hit'] = 0 Default_Inflation_Values['exp'] = 1 Default_Inflation_Values['gold'] = 2 #-------------------------------------------------------------------------- # * Do Not Modify #-------------------------------------------------------------------------- # Loads enemy data data_enemies = load_data('Data/Enemies.rxdata') # Create stats array stats = ['maxhp', 'maxsp', 'str', 'dex', 'agi', 'int', 'atk', 'pdef', 'mdef', 'eva', 'hit', 'exp', 'gold'] # Pass through all enemies for i in 1...data_enemies.size # Create enemy stat hash unless already made Stats[i] = {} unless Stats.has_key?(i) # Pass Through all stats for stat in stats # Next if stat curve already set up next if Stats[i].has_key?(stat) # Get Base Value from Database if stat == 'hit' base = 100 else base = eval "data_enemies[i].#{stat}" end # Get Inflation Value if Inflation_Values.has_key?(i) && Inflation_Values[i].has_key?(stat) inflation = Inflation_Values[i][stat] else inflation = Default_Inflation_Values[stat] end # Set Stat Curve Stats[i][stat] = [0, Min_Levels[i], Max_Levels[i], base, inflation] end end end
#-------------------------------------------------------------------------- # * End SDK Enable Test #-------------------------------------------------------------------------- end
Expand to see the code.
#========================================================================== # ** SG Optional Battle Music #========================================================================== # sandgolem # Version 1 # 24.06.06 #==========================================================================
# Switch number to activate the Even Music # #Also note, in Event enabling this switch, change battle win ME to null Scene_Map::SG_Disable_BattleMusic = 27
#========================================================================== # # To check for updates or find more scripts, visit: # http://www.gamebaker.com/rmxp/scripts/ # # To use this script, copy it and insert it in a new section above "Main", # under the default scripts, and the SDK if you're using it. # # Have problems? Official topic: # http://forums.gamebaker.com/showthread.php?t=13 # #==========================================================================
begin SDK.log('SG Optional Battle Music', 'sandgolem', 1, '24.06.06') if SDK.state('SG Optional Battle Music') != true @sg_nobattlebgm_disabled = true end rescue end
if !@sg_nobattlebgm_disabled #--------------------------------------------------------------------------
class Game_System alias sandgolem_nobattlebgm_system_bgm bgm_play def bgm_play(bgm) if !$sg_keep_music sandgolem_nobattlebgm_system_bgm(bgm) end end alias sandgolem_nobattlebgm_system_bgmstop bgm_stop def bgm_stop if !$sg_keep_music sandgolem_nobattlebgm_system_bgmstop end end end
class Scene_Map alias sandgolem_nobattlebgm_map_callbattle call_battle def call_battle if $game_switches[SG_Disable_BattleMusic] $sg_keep_music = true end sandgolem_nobattlebgm_map_callbattle $sg_keep_music = nil end end
#-------------------------------------------------------------------------- end
Expand to see the code.
|
|