[Résolu] Rapport de combat V3 + Système de matéria
Auteur
Message
Doddy
Citadin Lv.7
Age : 38 Inscrit le : 12/02/2010 Messages : 204
Sujet: [Résolu] Rapport de combat V3 + Système de matéria Jeu 18 Fév 2010 - 4:15
script de matéria :
Spoiler:
Code:
#============================================================================== # Materia System (FF:VII) #============================================================================== # Original script from XP by SephirothSpawn # and Converted for VX by Atoa #------------------------------------------------------------------------------ # Traslated by: Carbajosa... (Is this credit needed? lol) #------------------------------------------------------------------------------ # Sorry if these translations are a bit messy, its because # this is a direct translation but the instructions provided # here is originaly made by Atoa (copied and pasted) # So more thanks to Atoa for a great convertion! Yay! #============================================================================== =begin =================================================== Materia Icons ===================================================
IMPORTANT:You must create an new folder named "Icons" on the Graphic folder
You can set individual icons for each materia, the icon must be on the Incon folder. The name of the icon must be the same of the Materia + "_m"
E.g Cure materia icon must be named "Cure_m" Ultima materia icon must be named "Ultima_m"
Materias without individual icons will have the default materia icon, the color of defaut icon depends on the materia type
To configure the materias, look for lines like these in the "module Materia_Config"
MATERIA_LIST << [ID, name, type, status, elements, status effects, price, master price, ap, skill, special effect]
* ID = Materia ID * name = materia Name * type = materia type (can be "Magic", "Command", "Summon", "Support" and "Independent", they arent translated in demo) * status = status change of the materia.[hp, sp, str, dex, agi, int] in XP, [hp, mp, atk, def, spi, agi] in VX * elements = element id of materia. used when paired with elemental spuport materia. must be an array * status effect = status effect id of materia. used when paired with added effect spuport materia must. be an array * price = Price of materia with 0 AP * master price = Price of an level max materia * ap = ap nedded to level up. must be an array. the first value is the ap to level 2. Here is the place where you set the max level of materia, depending on how many values yoi add on the array.
E.G [1000, 2000 ,3000] = the materia will have 4 levels [2500, 5000, 10000, 20000, 40000] = the materia will have 6 levels
* skills = skills of the materia. must be an array. you can make an instace of this array = nil, so materia will "skip" this level
E.G [2,7,20] = materia gain skill ID 2 in level 1, skill ID 7 in level 2, and skill ID 20 in level 3. [nil,6,nil,13] = materia gain no skill in level 1, skill ID in level 2, no skill in level 3, and skill ID 13 in level 4.
# Do not Erase the lines WEAPON_MATERIA_SLOTS = [] ARMORS_MATERIA_SLOTS = [] MATERIA_LIST = [] ENEMY_AP = [] # Do not Erase the lines
# If true, when a materia reach a maximum level, you gain another # Stat in level 1, if false, nothing will happen Materia_Breeding = true
# Configuration of attributes IDs with special effects Negate_Absorb_ID = 17 # ID attribute to the effect "Negate Absorption" Negate_Turbo_ID = 18 # ID attribute to the effect "Negate MP Turbo" Negate_All_ID = 19 # ID attribute to the effect "Negate All"
# Materia Shop Message Configuration Shop_Message = 'How can I help you?' # ShoP Message Buy_Message = 'What Materia would you like to buy?' # Buy Message Sell_Message = 'Which materia you want to sell?' # Selling Message Buy_Command = 'Buy Materia' # Name of Option to purchase the store Materias Sell_Command = 'Sell Materia' # Name of Option to sell the store Materias Empty_Message = 'None' # Message when Equiped...? Master_Text = 'Master' # Text that indicates a Materia in High Level AP_Total = 'Total AP:' # AP Attribute name (in the window of materials)
#============================================================================== # ** Materia #============================================================================== class Materia #-------------------------------------------------------------------------- attr_reader :id attr_accessor :name attr_accessor :type attr_accessor :stat_effects attr_accessor :elements attr_accessor :states attr_accessor :new_value attr_accessor :master_value attr_accessor :skills attr_accessor :exp_levels attr_accessor :special_effect #-------------------------------------------------------------------------- def initialize(id, name, type, stat_effects = [], elements = [], states = [], n_value = 500, m_value = 1000, skills = [], exp_levels = [], s_effect = nil) @id, @name, @type, @stat_effects, @elements, @states, @new_value, @master_value, @exp_levels, @skills, @special_effect = id, name, type, stat_effects, elements, states, n_value, m_value, skills, exp_levels, s_effect @experience = 0 end #-------------------------------------------------------------------------- def experience return @experience end #-------------------------------------------------------------------------- def experience=(num) @experience = [num, @exp_levels[@exp_levels.size - 1]].min end #-------------------------------------------------------------------------- def level for i in 0...@exp_levels.size if @experience >= @exp_levels[@exp_levels.size - (1 + i)] return @exp_levels.size - i + 1 end end return 1 end #-------------------------------------------------------------------------- def buy_value return @new_value end #-------------------------------------------------------------------------- def base_sell_value return @new_value / 2 end #-------------------------------------------------------------------------- def sell_value variation = @master_value - (@new_value / 2) price_rate = [@experience * 100 / @exp_levels[@exp_levels.size - 1], 100].min return [((variation * price_rate) / 100) + (@new_value / 2) ,0].max end #-------------------------------------------------------------------------- def get_hue case @type when 'Magic' hue = 130 when 'Command' hue = 60 when 'Summon' hue = 10 when 'Support' hue = 240 when 'Independent' hue = 300 end return hue end end
#============================================================================== # ** Materia_System #============================================================================== class Materia_System #-------------------------------------------------------------------------- include Materia_Config #-------------------------------------------------------------------------- attr_accessor :set_up_materias #-------------------------------------------------------------------------- def set_up_materias materias = [] for m in MATERIA_LIST materias[m[0]] = Materia.new(m[0],m[1],m[2],m[3],m[4],m[5],m[6],m[7],m[8],m[9],m[10]) if m != nil end materias.sort! {|a, b| a.id <=> b.id} materias = materias.compact return materias end end
#============================================================================== # ** Game_Battler (part 3) #============================================================================== class Game_Battler #-------------------------------------------------------------------------- def make_obj_damage_value(user, obj) damage = obj.base_damage if damage > 0 damage += user.atk * 4 * obj.atk_f / 100 damage += user.spi * 2 * obj.spi_f / 100 unless obj.ignore_defense damage -= self.def * 2 * obj.atk_f / 100 damage -= self.spi * 1 * obj.spi_f / 100 end damage = 0 if damage < 0 elsif damage < 0 damage -= user.atk * 4 * obj.atk_f / 100 damage -= user.spi * 2 * obj.spi_f / 100 end damage *= elements_max_rate(obj.element_set) damage /= 100 damage = apply_variance(damage, obj.variance) damage = apply_guard(damage) if user.is_a?(Game_Actor) and obj.is_a?(RPG::Skill) for materia in user.weapon_materia + user.armor1_materia + user.armor2_materia + user.armor3_materia + user.armor4_materia unless materia.nil? if damage != 0 and materia.type == 'Summon' and materia.skills.include?(obj.id) damage += (damage * materia.level * 0.2).to_i end end end materia_set = user.return_paired_materia for paired_set in materia_set materia = paired_set[2] other_materia = paired_set[3] if materia.special_effect == 'MP Turbo' for skill_id in other_materia.skills unless skill_id == 0 or skill_id == nil m_skill = $data_skills[skill_id] if obj == m_skill unless obj.element_set.include?(Materia_Config::Negate_Turbo_ID) damage += (damage * materia.level * 0.2).to_i if damage != 0 end end end end end if materia.special_effect =='Absorb HP' for skill_id in other_materia.skills unless skill_id == 0 or skill_id == nil m_skill = $data_skills[skill_id] if obj == m_skill and $game_temp.in_battle unless obj.element_set.include?(Materia_Config::Negate_Absorb_ID) if damage > 0 dreno = materia.level * 2 hp = (damage * dreno / 100).to_i user.hp += [hp, user.maxhp - hp].min end end end end end end if materia.special_effect =='Absorb MP' for skill_id in other_materia.skills unless skill_id == 0 or skill_id == nil m_skill = $data_skills[skill_id] if obj == m_skill and $game_temp.in_battle unless obj.element_set.include?(Materia_Config::Negate_Absorb_ID) if damage > 0 dreno = materia.level mp = (damage * dreno / 100).to_i user.mp += [mp, user.maxmp - mp].min end end end end end end end end if obj.damage_to_mp @mp_damage = damage else @hp_damage = damage end end #-------------------------------------------------------------------------- def make_attack_damage_value(attacker) damage = attacker.atk * 4 - self.def * 2 damage = 0 if damage < 0 damage *= elements_max_rate(attacker.element_set) damage /= 100 if damage == 0 damage = rand(2) elsif damage > 0 @critical = (rand(100) < attacker.cri + attacker.critrateplus) @critical = false if prevent_critical damage += ((damage * (200 + attacker.critdmgplus)) / 100) if @critical end damage = apply_variance(damage, 20) damage = apply_guard(damage) @hp_damage = damage end #-------------------------------------------------------------------------- def calc_mp_cost(skill) if half_mp_cost cost = skill.mp_cost / 2 else cost = skill.mp_cost end if self.is_a?(Game_Actor) materia_set = self.return_paired_materia for paired_set in materia_set materia = paired_set[2] other_materia = paired_set[3] if materia.special_effect == 'MP Turbo' for skill_id in other_materia.skills unless skill_id == 0 or skill_id == nil m_skill = $data_skills[skill_id] if skill == m_skill and !skill.element_set.include?(Materia_Config::Negate_Turbo_ID) cost = (cost + (cost * materia.level * 0.2)).to_i end end end end if materia.special_effect == 'Reduce Cost' for skill_id in other_materia.skills unless skill_id == 0 or skill_id == nil m_skill = $data_skills[skill_id] if skill == m_skill cost = (cost - (cost * materia.level * 0.1)).to_i end end end end end end return cost end end
#============================================================================== # ** Game_BattleAction #============================================================================== class Game_BattleAction #-------------------------------------------------------------------------- alias materia_make_targets make_targets def make_targets if skill? and @battler.is_a?(Game_Actor) targets = [] paired_materia_set = @battler.return_paired_materia for paired_set in paired_materia_set materia = paired_set[2] other_materia = paired_set[3] if materia.special_effect == 'All' for skill_id in other_materia.skills if skill_id == skill.id and !skill.element_set.include?(Materia_Config::Negate_All_ID) if skill.for_opponent? for target in $game_troop.members do targets.push(target) if target.exist? end else for target in $game_party.members do targets.push(target) if target.exist? end end end end end end return targets unless targets.empty? end materia_make_targets end end
#============================================================================== # ** Game_Actor #============================================================================== class Game_Actor #-------------------------------------------------------------------------- attr_accessor :weapon_materia attr_accessor :armor1_materia attr_accessor :armor2_materia attr_accessor :armor3_materia attr_accessor :armor4_materia attr_accessor :old_weapon_id attr_accessor :old_armor1_id attr_accessor :old_armor2_id attr_accessor :old_armor3_id attr_accessor :old_armor4_id attr_reader :ap #-------------------------------------------------------------------------- alias seph_materiasystem_gameactor_init initialize alias seph_materiasystem_gameactor_setup setup alias seph_materiasystem_gameactor_skills skills alias seph_materiasystem_gameactor_equip change_equip alias seph_materiasystem_gameactor_elementrate element_rate alias seph_materiasystem_gameactor_stateguard? state_resist? alias seph_materiasystem_gameactor_elementset element_set alias seph_materiasystem_gameactor_plusstateset plus_state_set #-------------------------------------------------------------------------- def initialize(actor_id) @weapon_materia = Array.new @armor1_materia = Array.new @armor2_materia = Array.new @armor3_materia = Array.new @armor4_materia = Array.new seph_materiasystem_gameactor_init(actor_id) end #-------------------------------------------------------------------------- def setup(actor_id) seph_materiasystem_gameactor_setup(actor_id) @materia_skills = [] sn = [$data_weapons[@weapon_id].paired_materia * 2 + $data_weapons[@weapon_id].single_materia, 8].min unless @weapon_id == 0 @weapon_materia = @weapon_id == 0 ? [] : Array.new(sn, nil) if two_swords_style sn = [$data_weapons[@armor1_id].paired_materia * 2 + $data_weapons[@armor1_id].single_materia, 8].min unless @armor1_id == 0 @armor1_materia = @armor1_id == 0 ? [] : Array.new(sn, nil) else sn = [$data_armors[@armor1_id].paired_materia * 2 + $data_armors[@armor1_id].single_materia, 8].min unless @armor1_id == 0 @armor1_materia = @armor1_id == 0 ? [] : Array.new(sn, nil) end sn = [$data_armors[@armor2_id].paired_materia * 2 + $data_armors[@armor2_id].single_materia, 8].min unless @armor2_id == 0 @armor2_materia = @armor2_id == 0 ? [] : Array.new(sn, nil) sn = [$data_armors[@armor3_id].paired_materia * 2 + $data_armors[@armor3_id].single_materia, 8].min unless @armor3_id == 0 @armor3_materia = @armor3_id == 0 ? [] : Array.new(sn, nil) sn = [$data_armors[@armor4_id].paired_materia * 2 + $data_armors[@armor4_id].single_materia, 8].min unless @armor4_id == 0 @armor4_materia = @armor4_id == 0 ? [] : Array.new(sn, nil) end #-------------------------------------------------------------------------- def skills for skill_id in @materia_skills forget_skill(skill_id) end @materia_skills = [] for materia in @weapon_materia + @armor1_materia + @armor2_materia + @armor3_materia + @armor4_materia self.learn_materia_skill(materia) unless materia.nil? end result = seph_materiasystem_gameactor_skills return result end #-------------------------------------------------------------------------- def learn_materia_skill(materia) if materia.type == 'Magic' || materia.type == 'Command' || materia.type == 'Summon' materia_level = materia.level == materia.exp_levels.size + 1 ? materia.level - 1 : materia.level for i in 0...materia_level unless materia.skills[i] == nil or @skills.include?(materia.skills[i]) skill_id = materia.skills[i] learn_skill(skill_id) @materia_skills << skill_id end end end end #-------------------------------------------------------------------------- def base_maxhp n = actor.parameters[0, @level] variance = 0 for materia in @weapon_materia + @armor1_materia + @armor2_materia + @armor3_materia + @armor4_materia unless materia.nil? variance += materia.stat_effects[0] variance += (materia.level * 10) if materia.special_effect == 'HP Plus' n = $data_actors[@actor_id].parameters[1, @level] if materia.special_effect == 'HP <> MP' end end n *= ((100 + variance) / 100.0) return n.to_i end #-------------------------------------------------------------------------- def hp @hp = [@hp, maxhp].min return @hp end #-------------------------------------------------------------------------- def base_maxmp n = actor.parameters[1, @level] variance = 0 for materia in @weapon_materia + @armor1_materia + @armor2_materia + @armor3_materia + @armor4_materia unless materia.nil? variance += materia.stat_effects[1] variance += (materia.level * 10) if materia.special_effect == 'MP Plus' n = $data_actors[@actor_id].parameters[0, @level] if materia.special_effect == 'HP <> MP' end end n *= ((100 + variance) / 100.0) return n.to_i end #-------------------------------------------------------------------------- def mp @mp = [@mp, maxmp].min return @mp end #-------------------------------------------------------------------------- def base_atk n = actor.parameters[2, @level] for item in equips.compact do n += item.atk end variance = 0 for materia in @weapon_materia + @armor1_materia + @armor2_materia + @armor3_materia + @armor4_materia unless materia.nil? variance += materia.stat_effects[2] variance += (materia.level * 5) if materia.special_effect == 'Strength Plus' end end n *= ((100 + variance) / 100.0) return n.to_i end #-------------------------------------------------------------------------- def base_def n = actor.parameters[3, @level] for item in equips.compact do n += item.def end variance = 0 for materia in @weapon_materia + @armor1_materia + @armor2_materia + @armor3_materia + @armor4_materia unless materia.nil? variance += materia.stat_effects[3] variance += (materia.level * 5) if materia.special_effect == 'Defense Plus' end end n *= ((100 + variance) / 100.0) return n.to_i end #-------------------------------------------------------------------------- def base_spi n = actor.parameters[4, @level] for item in equips.compact do n += item.spi end variance = 0 for materia in @weapon_materia + @armor1_materia + @armor2_materia + @armor3_materia + @armor4_materia unless materia.nil? variance += materia.stat_effects[4] variance += (materia.level * 5) if materia.special_effect == 'Magic Plus' end end n *= ((100 + variance) / 100.0) return n.to_i end #-------------------------------------------------------------------------- def base_agi n = actor.parameters[5, @level] for item in equips.compact do n += item.agi end variance = 0 for materia in @weapon_materia + @armor1_materia + @armor2_materia + @armor3_materia + @armor4_materia unless materia.nil? variance += materia.stat_effects[5] variance += (materia.level * 5) if materia.special_effect == 'Agility Plus' end end n *= ((100 + variance) / 100.0) return n.to_i end #-------------------------------------------------------------------------- def base_eva n = 5 for item in armors.compact do n += item.eva end for materia in @weapon_materia + @armor1_materia + @armor2_materia + @armor3_materia + @armor4_materia unless materia.nil? n += (materia.level * 2) if materia.special_effect == 'Evasion Plus' end end return n.to_i end #-------------------------------------------------------------------------- def critrateplus variance = 0 for materia in @weapon_materia + @armor1_materia + @armor2_materia + @armor3_materia + @armor4_materia unless materia.nil? variance += (materia.level * 5) if materia.special_effect == 'Critical Chance Plus' end end return variance end #-------------------------------------------------------------------------- def critdmgplus variance = 0 for materia in @weapon_materia + @armor1_materia + @armor2_materia + @armor3_materia + @armor4_materia unless materia.nil? variance += (materia.level * 20) if materia.special_effect == 'Critical Damage Plus' end end return variance end #-------------------------------------------------------------------------- def escapeplus variance = 0 for materia in @weapon_materia + @armor1_materia + @armor2_materia + @armor3_materia + @armor4_materia unless materia.nil? variance += (materia.level * 2) if materia.special_effect == 'Escape Plus' end end return variance end #-------------------------------------------------------------------------- def itemdropup variance = 0 for materia in @weapon_materia + @armor1_materia + @armor2_materia + @armor3_materia + @armor4_materia unless materia.nil? variance += (materia.level * 2) if materia.special_effect == 'Sorte Extra' end end return variance end #-------------------------------------------------------------------------- def level_up for skill_id in @materia_skills self.forget_skill(skill_id) end @materia_skills = [] @level += 1 for learning in self.class.learnings learn_skill(learning.skill_id) if learning.level == @level end for materia in @weapon_materia + @armor1_materia + @armor2_materia + @armor3_materia + @armor4_materia self.learn_materia_skill(materia) unless materia.nil? end end #-------------------------------------------------------------------------- def gain_exp(exp, show) exp_plus = 0 for materia in @weapon_materia + @armor1_materia + @armor2_materia + @armor3_materia + @armor4_materia unless materia.nil? if materia.special_effect == 'Exp Plus' exp_plus += (materia.level * 10) end end end exp *= ((100 + exp_plus) / 100) if double_exp_gain change_exp(@exp + exp * 2, show) else change_exp(@exp + exp, show) end end #-------------------------------------------------------------------------- def ap return @ap == nil ? 0 : @ap end #-------------------------------------------------------------------------- def ap=(ap) @ap = ap for materia in @weapon_materia + @armor1_materia + @armor2_materia + @armor3_materia + @armor4_materia unless materia.nil? initial_level = materia.level materia.experience += @ap final_level = materia.level if initial_level < (materia.exp_levels.size + 1) and final_level == (materia.exp_levels.size + 1) $game_party.gain_materia(materia.id) end end end @ap = 0 end #-------------------------------------------------------------------------- def element_rate(element_id) result = seph_materiasystem_gameactor_elementrate(element_id) paired = return_paired_materia for set in paired if set[0] > 0 materia = set[2] if materia.special_effect == 'Elemental' other_materia = set[3] if other_materia.elements.include?(element_id) result /= 2 end end end end return result end #-------------------------------------------------------------------------- def state_resist?(state_id) result = seph_materiasystem_gameactor_stateguard?(state_id) unless result paired = return_paired_materia for set in paired if set[0] > 0 materia = set[2] if materia.special_effect == 'Added Effect' other_materia = set[3] if other_materia.states.include?(state_id) result = true end end end end end return result end #--------------------------------------------------------------------------
Dernière édition par Doddy le Ven 19 Fév 2010 - 2:33, édité 1 fois
Doddy
Citadin Lv.7
Age : 38 Inscrit le : 12/02/2010 Messages : 204
Sujet: Re: [Résolu] Rapport de combat V3 + Système de matéria Jeu 18 Fév 2010 - 4:16
Suite du script :
Spoiler:
Code:
def element_set result = seph_materiasystem_gameactor_elementset paired = return_paired_materia for set in paired if set[0] == 0 materia = set[2] if materia.special_effect == 'Elemental' other_materia = set[3] for elem_id in other_materia.elements result << elem_id unless set.include?(elem_id) end end end end return result end #-------------------------------------------------------------------------- def plus_state_set result = seph_materiasystem_gameactor_plusstateset paired = return_paired_materia for set in paired if set[0] == 0 materia = set[2] if materia.special_effect == 'Added Effect' other_materia = set[3] for state_id in other_materia.states result << state_id unless set.include?(state_id) end end end end return result end #------------------------------------------------------------------------------ def check_old_equip @old_weapon_id = @weapon_id @old_armor1_id = @armor1_id @old_armor2_id = @armor2_id @old_armor3_id = @armor3_id @old_armor4_id = @armor4_id end #------------------------------------------------------------------------------ def check_equip_change if @old_weapon_id != @weapon_id for materia in @weapon_materia $game_party.materia << materia unless materia.nil? end sn = [$data_weapons[@weapon_id].paired_materia * 2 + $data_weapons[@weapon_id].single_materia, 8].min unless @weapon_id == 0 @weapon_materia = @weapon_id == 0 ? [] : Array.new(sn, nil) end if @old_armor1_id != @armor1_id for materia in @armor1_materia $game_party.materia << materia unless materia.nil? end if two_swords_style sn = [$data_weapons[@armor1_id].paired_materia * 2 + $data_weapons[@armor1_id].single_materia, 8].min unless @armor1_id == 0 @armor1_materia = @armor1_id == 0 ? [] : Array.new(sn, nil) else sn = [$data_armors[@armor1_id].paired_materia * 2 + $data_armors[@armor1_id].single_materia, 8].min unless @armor1_id == 0 @armor1_materia = @armor1_id == 0 ? [] : Array.new(sn, nil) end end if @old_armor2_id != @armor2_id for materia in @armor2_materia $game_party.materia << materia unless materia.nil? end sn = [$data_armors[@armor2_id].paired_materia * 2 + $data_armors[@armor2_id].single_materia, 8].min unless @armor2_id == 0 @armor2_materia = @armor2_id == 0 ? [] : Array.new(sn, nil) end if @old_armor3_id != @armor3_id for materia in @armor3_materia $game_party.materia << materia unless materia.nil? end sn = [$data_armors[@armor3_id].paired_materia * 2 + $data_armors[@armor3_id].single_materia, 8].min unless @armor3_id == 0 @armor3_materia = @armor3_id == 0 ? [] : Array.new(sn, nil) end if @old_armor4_id != @armor4_id for materia in @armor4_materia $game_party.materia << materia unless materia.nil? end sn = [$data_armors[@armor4_id].paired_materia * 2 + $data_armors[@armor4_id].single_materia, 8].min unless @armor4_id == 0 @armor4_materia = @armor4_id == 0 ? [] : Array.new(sn, nil) end end #-------------------------------------------------------------------------- def equip_materia(equip_type, slot_index, index) new_materia = $game_party.materia[index] materia = equip_type == 0 ? @weapon_materia[slot_index] : (eval "@armor#{equip_type}_materia")[slot_index] $game_party.materia << materia unless materia.nil? case equip_type when 0 return if @weapon_materia.size == 0 @weapon_materia[slot_index] = new_materia when 1 return if @armor1_materia.size == 0 @armor1_materia[slot_index] = new_materia when 2 return if @armor2_materia.size == 0 @armor2_materia[slot_index] = new_materia when 3 return if @armor3_materia.size == 0 @armor3_materia[slot_index] = new_materia when 4 return if @armor4_materia.size == 0 @armor4_materia[slot_index] = new_materia end $game_party.materia.delete_at(index) end #-------------------------------------------------------------------------- def unequip_materia(equip_type, slot_index) materia = equip_type == 0 ? @weapon_materia[slot_index] : (eval "@armor#{equip_type}_materia")[slot_index] $game_party.materia << materia unless materia.nil? equip_type == 0 ? @weapon_materia[slot_index] = nil : (eval "@armor#{equip_type}_materia")[slot_index] = nil end #-------------------------------------------------------------------------- def return_paired_materia paired = [] unless @weapon_id == 0 if $data_weapons[@weapon_id].paired_materia > 0 for i in 0...($data_weapons[@weapon_id].paired_materia * 2) materia = @weapon_materia[i] if materia.type == 'Support' o_i = i + ([0, 2, 4, 6].include?(i) ? 1 : - 1) other_materia = @weapon_materia[o_i] paired << [0, [i, o_i].min, materia, other_materia] unless other_materia.nil? end end end end for a in 1..4 unless (eval "@armor#{a}_id") == 0 if (eval "$data_armors[@armor#{a}_id].paired_materia") > 0 for i in 0...((eval "$data_armors[@armor#{a}_id].paired_materia") * 2) materia = (eval "@armor#{a}_materia")[i] if materia.type == 'Support' o_i = i + ([0, 2, 4, 6].include?(i) ? 1 : - 1) other_materia = (eval "@armor#{a}_materia")[o_i] paired << [a, [i, o_i].min, materia, other_materia] unless other_materia.nil? end end end end end return paired end #-------------------------------------------------------------------------- def return_paired_materia_type unless @weapon_id == 0 if $data_weapons[@weapon_id].paired_materia > 0 for i in 0...($data_weapons[@weapon_id].paired_materia) materia = @weapon_materia[i] end end if $data_weapons[@weapon_id].single_materia > 0 for i in 0...($data_weapons[@weapon_id].single_materia) materia = @weapon_materia[i] end end end for a in 1..4 unless (eval "@armor#{a}_id") == 0 if (eval "$data_armors[@armor#{a}_id].paired_materia") > 0 for i in 0...((eval "$data_armors[@armor#{a}_id].paired_materia")) materia = (eval "@armor#{a}_materia")[i] end end if (eval "$data_armors[@armor#{a}_id].single_materia") > 0 for i in 0...((eval "$data_armors[@armor#{a}_id].single_materia")) materia = (eval "@armor#{a}_materia")[i] end end end end return end end
#============================================================================== # ** Game_Enemy #============================================================================== class Game_Enemy #------------------------------------------------------------------------------ attr_accessor :ap #------------------------------------------------------------------------------ alias materia_initialize initialize def initialize(index, enemy_id) materia_initialize(index, enemy_id) @enemy = $data_enemies[@enemy_id] @ap = get_ap end #------------------------------------------------------------------------------ def get_ap for i in 0...Materia_Config::ENEMY_AP.size ap = Materia_Config::ENEMY_AP[i] if @enemy_id == i end return ap == nil ? (@enemy.exp / 10).to_i : ap end #------------------------------------------------------------------------------ def ap return @ap == nil ? (@enemy.exp / 10).to_i : @ap end #------------------------------------------------------------------------------ def critrateplus return 0 end #-------------------------------------------------------------------------- def critdmgplus return 0 end end
#============================================================================== # ** Game_Party #============================================================================== class Game_Party < Game_Unit #-------------------------------------------------------------------------- attr_accessor :materia #-------------------------------------------------------------------------- alias seph_materiasystem_gameparty_init initialize alias seph_materiasystem_gameparty_gaingold gain_gold #-------------------------------------------------------------------------- def initialize seph_materiasystem_gameparty_init @materia = [] end #-------------------------------------------------------------------------- def gain_materia(materia_index) @materia << $data_materia[materia_index].dup end #-------------------------------------------------------------------------- def gain_gold(n) gil_plus = 0 for actor in $game_party.members for materia in actor.weapon_materia + actor.armor1_materia + actor.armor2_materia + actor.armor3_materia + actor.armor4_materia unless materia.nil? if materia.special_effect == 'Gil Plus' gil_plus += (materia.level * 5) end end end end n *= (100 + gil_plus) / 100 seph_materiasystem_gameparty_gaingold(n.to_i) end end
#============================================================================== # ** Window_MateriaBio #============================================================================== class Window_MateriaBio < Window_Base #-------------------------------------------------------------------------- def initialize super(256, 112, 288, 304) self.contents = Bitmap.new(width - 32, height - 32) self.visible = false end #-------------------------------------------------------------------------- def refresh(materia) self.contents.clear return if materia.nil? hue = materia.get_hue begin bitmap = Cache.icon(materia.name + "_m").dup rescue bitmap = Cache.icon(Materia_Config::Default_Icon).dup bitmap.hue_change(hue) end self.contents.blt(0, 0, bitmap, Rect.new(0, 0, 24, 24)) self.contents.font.size = 22 self.contents.font.color = normal_color self.contents.font.bold = false self.contents.draw_text(28, 0, contents.width, 24, materia.name) bitmap = Cache.icon(Materia_Config::Materia_Level).dup bitmap.hue_change(hue) star_x = contents.width / 2 - 144 materia.level.times do self.contents.blt(star_x += 24, 22, bitmap, Rect.new(0, 0, 24, 24)) end (materia.exp_levels.size + 1 - materia.level).times do self.contents.blt(star_x += 24, 22, bitmap, Rect.new(0, 0, 24, 24), 100) end self.contents.font.size = 14 self.contents.font.bold = true self.contents.font.color = system_color self.contents.draw_text(142, 44, 172, 16, 'Niveau:') self.contents.draw_text(142, 92, 172, 16, 'Niveau suivant:') self.contents.draw_text(142, 60, 172, 16, Materia_Config::AP_Total) self.contents.draw_text(0, 44 , contents.width, 16, 'Magies:') self.contents.font.color = normal_color lev = materia.level == materia.exp_levels.size + 1 ? Materia_Config::Master_Text : materia.level.to_s self.contents.draw_text(196, 44, 172, 16, lev) self.contents.draw_text(82, 76, 172, 16, materia.experience.to_s, 2) nxt = lev == Materia_Config::Master_Text ? '----------' : materia.exp_levels[materia.level - 1] - materia.experience self.contents.draw_text(82, 108, 172, 16, nxt.to_s, 2) materia_y = 18 for i in 0...(materia.level) self.contents.font.color.alpha = 255 unless materia.skills[i].nil? self.contents.draw_text(16, 44 + materia_y, 112, 16, $data_skills[materia.skills[i]].name) materia_y += 14 end end for i in (materia.level)...materia.skills.size self.contents.font.color.alpha = 128 unless materia.skills[i].nil? self.contents.draw_text(16, 44 + materia_y, 112, 16, $data_skills[materia.skills[i]].name) materia_y += 14 end end if materia.skills.size == 0 self.contents.draw_text(8, 52, contents.width / 2 - 8, 24, '') end self.contents.font.color = normal_color self.contents.font.color.alpha = 255 se = materia.special_effect.nil? ? '----------' : materia.special_effect self.contents.draw_text(0, 140, self.width - 48, 16, "Effet Spécial: ") txt_width = self.contents.text_size("Effet Spécial: ").width self.contents.draw_text(txt_width, 140, self.width - (48 + txt_width), 16, se) self.contents.font.bold = true self.contents.font.size = 12 self.contents.draw_text(0, 158, 160, 16, "Buy:#{materia.new_value}") self.contents.draw_text(92, 158, 160, 16, "Sell:#{materia.base_sell_value}") self.contents.draw_text(172, 158, 160, 16, Materia_Config::Master_Text + ":#{materia.master_value}") self.contents.font.color = system_color base_y = 172 self.contents.draw_text(0, base_y, contents.width / 2, 14, 'Statut:') self.contents.font.color = normal_color stat_names = [Vocab::hp, Vocab::mp, Vocab::atk,Vocab::def, Vocab::spi, Vocab::agi] for i in 0...materia.stat_effects.size self.contents.draw_text(0, base_y + (i + 1) * 14, contents.width / 2, 14, stat_names[i]) self.contents.draw_text(- 8, base_y + (i + 1) * 14, contents.width / 2, 14, "#{materia.stat_effects[i]} %", 2) end x, y = contents.width / 2 + 4, base_y self.contents.font.color = system_color self.contents.draw_text(x, y, contents.width / 2, 14, 'Eléments/Effets:') self.contents.font.color = normal_color if materia.elements.size + materia.states.size == 0 self.contents.draw_text(x + 4, y + 14, contents.width / 2, 14, '') else total = 1 for i in 0...materia.elements.size total += 1 ox = 4 + total % 2 * (contents.width / 4) oy = total / 2 * 14 self.contents.draw_text(x + ox, y + oy, contents.width / 2, 14, $data_system.elements[materia.elements[i]]) end for i in 0...materia.states.size total += 1 ox = 4 + total % 2 * (contents.width / 4) oy = total / 2 * 14 self.contents.draw_text(x + ox, y + oy, contents.width / 2, 14, $data_states[materia.states[i]].name) end end end end
#============================================================================== # ** Window_MateriaList #============================================================================== class Window_MateriaList < Window_Selectable #-------------------------------------------------------------------------- def initialize(width, height, buying, materia_list = nil, show_cost = true) super(0, 112, width, height) self.visible = self.active = false if buying @materia = [] for index in materia_list for materia in $data_materia @materia << materia if index == materia.id end end else @materia = $game_party.materia end @buying, @show_cost = buying, show_cost refresh self.index = 0 end #-------------------------------------------------------------------------- def materia return @materia[self.index] end #-------------------------------------------------------------------------- def refresh @materia.sort! {|a, b| a.id <=> b.id} @item_max = @materia.size self.contents.clear if self.contents != nil if @item_max > 0 self.contents = Bitmap.new(width - 32, row_max * 24) for i in 0...@item_max draw_item(i) end end end #-------------------------------------------------------------------------- def draw_item(index) rect = item_rect(index) self.contents.clear_rect(rect) materia = @materia[index] hue = materia.get_hue begin bitmap = Cache.icon(materia.name + "_m").dup rescue bitmap = Cache.icon(Materia_Config::Default_Icon).dup bitmap.hue_change(hue) end self.contents.blt(0, index * 24, bitmap, Rect.new(0, 0, 24, 24)) self.contents.font.color.alpha = materia.buy_value <= $game_party.gold ? 255 : 128 if @buying self.contents.draw_text(28, index * 24 - 4, 128, 32, materia.name) if @show_cost value = @buying ? materia.buy_value : materia.sell_value self.contents.draw_text(148, index * 24 - 4, 72, 32, ":#{value}", 2) end end end
#============================================================================== # ** Window_MateriaActor #============================================================================== class Window_MateriaStatus < Window_Base #-------------------------------------------------------------------------- def initialize(actor) super(0, 0, 544, 140) self.contents = Bitmap.new(width - 32, height - 32) @actor = actor @frame = 0 refresh end #-------------------------------------------------------------------------- def refresh(actor = @actor) self.contents.clear draw_face_materia(actor.face_name, actor.face_index, 4, 4) draw_actor_name(actor, 4, 0) draw_actor_level(actor, 4, 24) draw_actor_hp(actor, 4, 52) draw_actor_mp(actor, 4, 80) end #-------------------------------------------------------------------------- def update super end end
#============================================================================== # ** Window_MateriaActor #============================================================================== class Window_MateriaActor < Window_Base #-------------------------------------------------------------------------- def initialize(actor) super(0, -6, 544, 152) self.contents = Bitmap.new(width - 32, height - 32) self.opacity = 0 @actor = actor @frame = 0 refresh end #-------------------------------------------------------------------------- def refresh(actor = @actor) self.contents.clear draw_actor_equipment draw_actor_materia end #-------------------------------------------------------------------------- def draw_actor_equipment base_x = 132 draw_equipment(base_x, 0, $data_weapons[@actor.weapon_id], 0) if @actor.two_swords_style draw_equipment(base_x, 24, $data_weapons[@actor.armor1_id], 1) else draw_equipment(base_x, 24, $data_armors[@actor.armor1_id], 1) end draw_equipment(base_x, 48, $data_armors[@actor.armor2_id], 2) draw_equipment(base_x, 72, $data_armors[@actor.armor3_id], 3) draw_equipment(base_x, 96, $data_armors[@actor.armor4_id], 4) end #-------------------------------------------------------------------------- def draw_actor_materia base_x = 316 self.contents.fill_rect(base_x, 0, 192, 120, Color.new(0, 0, 0, 0)) for i in 0..4 self.contents.fill_rect(base_x, i * 24 + 2, 192, 22, Color.new(0, 0, 0, 50)) end for i in 0..4 slots_x, y = base_x - 24, i * 24 if i == 0 if @actor.weapon_id == 0 p_times, s_times = 0, 0 else p_times = $data_weapons[@actor.weapon_id].paired_materia s_times = $data_weapons[@actor.weapon_id].single_materia end else if (eval "@actor.armor#{i}_id") == 0 p_times, s_times = 0, 0 else p_times = eval "$data_armors[@actor.armor#{i}_id].paired_materia" s_times = eval "$data_armors[@actor.armor#{i}_id].single_materia" end end p_times.times do bitmap = Cache.icon(Materia_Config::Paired_Slot_Left) self.contents.blt(slots_x += 24, y, bitmap, Rect.new(0, 0, 24, 24)) bitmap = Cache.icon(Materia_Config::Paired_Slot_Right) self.contents.blt(slots_x += 24, y, bitmap, Rect.new(0, 0, 24, 24)) end s_times.times do bitmap = Cache.icon(Materia_Config::Single_Slot) self.contents.blt(slots_x += 24, y, bitmap, Rect.new(0, 0, 24, 24)) end end for i in 0...@actor.weapon_materia.size materia = @actor.weapon_materia[i] unless materia.nil? hue = materia.get_hue begin bitmap = Cache.icon(materia.name + "_m").dup rescue bitmap = Cache.icon(Materia_Config::Default_Icon).dup bitmap.hue_change(hue) end self.contents.blt(base_x + i * 24, 0, bitmap, Rect.new(0, 0, 24, 24)) end end for h in 1..4 size = eval "@actor.armor#{h}_materia.size" for i in 0...size list = eval "@actor.armor#{h}_materia" materia = list[i] unless materia.nil? hue = materia.get_hue begin bitmap = Cache.icon(materia.name + "_m").dup rescue bitmap = Cache.icon(Materia_Config::Default_Icon).dup bitmap.hue_change(hue) end self.contents.blt(base_x + i * 24, 24 * h, bitmap, Rect.new(0, 0, 24, 24)) end end end end #-------------------------------------------------------------------------- def update super end #-------------------------------------------------------------------------- def draw_equipment(x, y, item, type) if item.nil? case type when 0 bitmap = Materia_Config::Empty_Weapon when 1 if @actor.two_swords_style bitmap = Materia_Config::Empty_Weapon else bitmap = Materia_Config::Empty_Armor1 end when 2 bitmap = Materia_Config::Empty_Armor2 when 3 bitmap = Materia_Config::Empty_Armor3 when 4 bitmap = Materia_Config::Empty_Armor4 end text, enabled = Materia_Config::Empty_Message, false else bitmap = item.icon_index text, enabled = item.name, true end draw_icon(bitmap, x, y, enabled) self.contents.font.color = normal_color self.contents.font.color.alpha = enabled ? 255 : 128 self.contents.draw_text(x + 24, y, 160, 24, text, 1) end end
#============================================================================== # ** Window_MateriaEquipBio #============================================================================== class Window_MateriaEquipBio < Window_Base #-------------------------------------------------------------------------- def initialize super(0, 140, 352, 276) self.contents = Bitmap.new(width - 32, height - 32) end #-------------------------------------------------------------------------- def refresh(materia) self.contents.clear return if materia.nil? hue = materia.get_hue begin bitmap = Cache.icon(materia.name + "_m").dup rescue bitmap = Cache.icon(Materia_Config::Default_Icon).dup bitmap.hue_change(hue) end self.contents.blt(0, 0, bitmap, Rect.new(0, 0, 24, 24)) self.contents.font.color = normal_color self.contents.font.size = 22 self.contents.font.bold = false self.contents.draw_text(32, 0, contents.width, 24, materia.name) bitmap = Cache.icon(Materia_Config::Materia_Level).dup bitmap.hue_change(hue) star_x = contents.width / 2 - 180 materia.level.times do self.contents.blt(star_x += 24, 22, bitmap, Rect.new(0, 0, 24, 24)) end (materia.exp_levels.size + 1 - materia.level).times do self.contents.blt(star_x += 24, 22, bitmap, Rect.new(0, 0, 24, 24), 100) end self.contents.font.size = 14 self.contents.font.bold = true self.contents.font.color = system_color self.contents.draw_text(164, 44, 172, 16, 'Niveau:') self.contents.draw_text(164, 92, 172, 16, 'Niveau suivant:') self.contents.draw_text(164, 60, 172, 16, Materia_Config::AP_Total) self.contents.draw_text(4, 44, contents.width, 16, 'Magies:') self.contents.font.color = normal_color materia_y = 18 for i in 0...(materia.level) self.contents.font.color.alpha = 255 unless materia.skills[i].nil? self.contents.draw_text(16, 44 + materia_y, 128, 16, $data_skills[materia.skills[i]].name) materia_y += 14 end end for i in (materia.level)...materia.skills.size self.contents.font.color.alpha = 128 unless materia.skills[i].nil? self.contents.draw_text(16, 44 + materia_y, 128, 16, $data_skills[materia.skills[i]].name) materia_y += 14 end end self.contents.font.color = normal_color lev = materia.level == materia.exp_levels.size + 1 ? Materia_Config::Master_Text : materia.level.to_s self.contents.draw_text(216, 44, 172, 16, lev) self.contents.draw_text(102, 76, 172, 16, materia.experience.to_s, 2) nxt = lev == Materia_Config::Master_Text ? '----------' : materia.exp_levels[materia.level - 1] - materia.experience self.contents.draw_text(102,108, 172, 16, nxt.to_s, 2) self.contents.font.color = normal_color self.contents.font.color.alpha = 255 se = materia.special_effect.nil? ? '----------' : materia.special_effect self.contents.draw_text(4, 132, self.width - 48, 16, "Effet Spécial: ") txt_width = self.contents.text_size("Effet Spécial: ").width self.contents.draw_text(txt_width, 132, self.width - (48 + txt_width), 16, se) self.contents.font.bold = true self.contents.font.size = 12 self.contents.font.color = system_color base_y = 146 self.contents.draw_text(4, base_y, contents.width / 2, 16, 'Statut:') stat_names = [Vocab::hp, Vocab::mp, Vocab::atk,Vocab::def, Vocab::spi, Vocab::agi] self.contents.font.color = normal_color for i in 0...materia.stat_effects.size self.contents.draw_text(4, base_y + (i + 1) * 14, contents.width / 2, 16, stat_names[i]) self.contents.draw_text(- 8, base_y + (i + 1) * 14, contents.width / 2, 16, "#{materia.stat_effects[i]} %", 2) end x, y = contents.width / 2 + 4, base_y self.contents.font.color = system_color self.contents.draw_text(x, y, contents.width / 2, 16, 'Eléments/Effets') self.contents.font.color = normal_color if materia.elements.size + materia.states.size == 0 self.contents.draw_text(x + 4, y + 14, contents.width / 2, 16, '') else total = 1 for i in 0...materia.elements.size total += 1 ox = 4 + total % 2 * (contents.width / 4) oy = total / 2 * 16 self.contents.draw_text(x + ox, y + oy, contents.width / 2, 16, $data_system.elements[materia.elements[i]]) end for i in 0...materia.states.size total += 1 ox = 4 + total % 2 * (contents.width / 4) oy = total / 2 * 16 self.contents.draw_text(x + ox, y + oy, contents.width / 2, 16, $data_states[materia.states[i]].name) end end end end
#============================================================================== # ** Interpreter #============================================================================== class Game_Interpreter #------------------------------------------------------------------------------ def command_319 actor = $game_actors[@params[0]] actor.check_old_equip if actor != nil actor.change_equip_by_id(@params[1], @params[2]) end actor.check_equip_change return true end end
#============================================================================== # ** Scene_Title #============================================================================== class Scene_Title #-------------------------------------------------------------------------- include Materia_Config #-------------------------------------------------------------------------- alias seph_materiasystem_scenetitle_main main alias seph_materiasystem_scenetitle_newgame command_new_game alias seph_materiasystem_scenetitle_continue command_continue #-------------------------------------------------------------------------- def main seph_materiasystem_scenetitle_main materias = Materia_System.new $data_materia = materias.set_up_materias end #-------------------------------------------------------------------------- def command_new_game materias = Materia_System.new $data_materia = materias.set_up_materias for i in 1...$data_weapons.size if WEAPON_MATERIA_SLOTS[i] != nil $data_weapons[i].set_materia_slots(WEAPON_MATERIA_SLOTS[i]) else $data_weapons[i].set_materia_slots([0,0]) end end for i in 1...$data_armors.size if ARMORS_MATERIA_SLOTS[i] != nil $data_armors[i].set_materia_slots(ARMORS_MATERIA_SLOTS[i]) else $data_armors[i].set_materia_slots([0,0]) end end seph_materiasystem_scenetitle_newgame end #-------------------------------------------------------------------------- def command_continue materias = Materia_System.new $data_materia = materias.set_up_materias for i in 1...$data_weapons.size if WEAPON_MATERIA_SLOTS[i] != nil $data_weapons[i].set_materia_slots(WEAPON_MATERIA_SLOTS[i]) else $data_weapons[i].set_materia_slots([0,0]) end end for i in 1...$data_armors.size if ARMORS_MATERIA_SLOTS[i] != nil $data_armors[i].set_materia_slots(ARMORS_MATERIA_SLOTS[i]) else $data_armors[i].set_materia_slots([0,0]) end end seph_materiasystem_scenetitle_continue end end
#============================================================================== # ** Scene_Equip #============================================================================== class Scene_Equip #------------------------------------------------------------------------------ alias seph_materiasystem_sceneequip_main main def main @actor = $game_party.members[@actor_index] @actor.check_old_equip seph_materiasystem_sceneequip_main @actor.check_equip_change end end
#============================================================================== # ** Scene_MateriaShop #============================================================================== class Scene_MateriaShop < Scene_Base #-------------------------------------------------------------------------- def initialize(materia_avialable = []) @materia_avialable = materia_avialable end #-------------------------------------------------------------------------- def start super create_menu_background create_command_window @help_window = Window_Help.new @help_window.set_text(Materia_Config::Shop_Message) @gold_window = Window_Gold.new(384, 56) @dummy_window = Window_Base.new(0, 112, 544, 304) @buy_items = Window_MateriaList.new(256, 304, true, @materia_avialable) @sell_items = Window_MateriaList.new(256, 304, false) @materia_bio = Window_MateriaBio.new @objects = [@help_window, @shop_options_window, @gold_window, @buy_items, @sell_items, @dummy_window, @materia_bio] end #-------------------------------------------------------------------------- def terminate super @objects.each {|x| x.dispose} end #-------------------------------------------------------------------------- def update super @objects.each {|x| x.update} if @shop_options_window.active update_shop_commands elsif @buy_items.active update_buy_materia elsif @sell_items.active update_sell_materia end end #-------------------------------------------------------------------------- def create_command_window s1 = Vocab::ShopBuy s2 = Vocab::ShopSell s3 = Vocab::ShopCancel @shop_options_window = Window_Command.new(384, [s1, s2, s3], 3) @shop_options_window .y = 56 end #-------------------------------------------------------------------------- def update_shop_commands @help_window.set_text(Materia_Config::Shop_Message) if Input.trigger?(Input::B) Sound.play_cancel $scene = Scene_Map.new end if Input.trigger?(Input::C) Sound.play_decision case @shop_options_window.index when 0 @shop_options_window.active = false @dummy_window.visible = false @materia_bio.visible = true @materia_bio.refresh(@buy_items.materia) @buy_items.visible = @buy_items.active = true when 1 @shop_options_window.active = false @dummy_window.visible = false @materia_bio.visible = true @materia_bio.refresh(@sell_items.materia) @sell_items.visible = @sell_items.active = true when 2 $scene = Scene_Map.new end end end #-------------------------------------------------------------------------- def update_buy_materia @help_window.set_text(Materia_Config::Buy_Message) if Input.trigger?(Input::B) Sound.play_cancel @buy_items.visible = @buy_items.active = false @buy_items.index = 0 @materia_bio.visible = false @shop_options_window.active = true @dummy_window.visible = true end if Input.trigger?(Input::C) materia = @buy_items.materia if $game_party.gold < materia.buy_value Sound.play_buzzer return end Sound.play_shop $game_party.gain_materia(materia.id) $game_party.lose_gold(materia.buy_value) @gold_window.refresh @buy_items.refresh @sell_items.refresh @materia_bio.refresh(@buy_items.materia) end if Input.trigger?(Input::UP) || Input.trigger?(Input::DOWN) || Input.press?(Input::UP) || Input.press?(Input::DOWN) || Input.trigger?(Input::R) || Input.trigger?(Input::L) || Input.press?(Input::R) || Input.press?(Input::L) @materia_bio.refresh(@buy_items.materia) end end #-------------------------------------------------------------------------- def update_sell_materia @help_window.set_text(Materia_Config::Sell_Message) if Input.trigger?(Input::B) Sound.play_cancel @sell_items.visible = @sell_items.active = false @sell_items.index = 0 @materia_bio.visible = false @shop_options_window.active = true @dummy_window.visible = true end if Input.trigger?(Input::C) if @sell_items.materia.nil? Sound.play_buzzer return end Sound.play_shop $game_party.gain_gold(@sell_items.materia.sell_value) @gold_window.refresh $game_party.materia.delete_at(@sell_items.index) @sell_items.refresh @sell_items.index = 0 @materia_bio.refresh(@sell_items.materia) end if Input.trigger?(Input::UP) || Input.trigger?(Input::DOWN) || Input.press?(Input::UP) || Input.press?(Input::DOWN) || Input.trigger?(Input::R) || Input.trigger?(Input::L) || Input.press?(Input::R) || Input.press?(Input::L) @materia_bio.refresh(@sell_items.materia) end end end
#============================================================================== # ** Scene_MateriaEquip #============================================================================== class Scene_MateriaEquip < Scene_Base #-------------------------------------------------------------------------- def initialize(actor_index = 0, equip_index = 0) @actor_index = actor_index @equip_index = equip_index @materia_index = 0 @actor = $game_party.members[@actor_index] end #-------------------------------------------------------------------------- def start super create_menu_background @status_bio_window = Window_MateriaStatus.new(@actor) @character_bio_window = Window_MateriaActor.new(@actor) @materia_bio_window = Window_MateriaEquipBio.new @materia_list_window = Window_MateriaList.new(192, 276, false, $game_party.materia, false) @materia_list_window.x, @materia_list_window.y = 352, 140 @materia_list_window.visible = true @materia_bio_window.z = @materia_list_window.z = 1000 @pointer_sprite = Sprite.new @pointer_sprite.x = 316 + (@materia_index + 1) * 24 - 28 @pointer_sprite.y = @equip_index * 24 + 12 @pointer_sprite.z = 9999 @pointer_sprite.bitmap = Cache.icon(Materia_Config::Materia_Cursor) @materia_list_window.refresh update_materia_bio @objects = [@status_bio_window, @character_bio_window, @materia_bio_window, @materia_list_window, @pointer_sprite] end #-------------------------------------------------------------------------- def terminate super @objects.each {|x| x.dispose} end #-------------------------------------------------------------------------- def update super @objects.each {|x| x.update} !@materia_list_window.active ? update_weapon_select : update_materia_select end #-------------------------------------------------------------------------- def return_scene $scene = Scene_Menu.new(4) end #-------------------------------------------------------------------------- def update_weapon_select @pointer_sprite.x = 316 + (@materia_index + 1) * 24 - 28 @pointer_sprite.y = @equip_index * 24 + 12 if Input.trigger?(Input::UP) Sound.play_cursor @equip_index = @equip_index == 0 ? @equip_index = 4 : @equip_index -= 1 case @equip_index when 0 max = [@actor.weapon_materia.size - 1, 0].max when 1 max = [@actor.armor1_materia.size - 1, 0].max when 2 max = [@actor.armor2_materia.size - 1, 0].max when 3 max = [@actor.armor3_materia.size - 1, 0].max when 4 max = [@actor.armor4_materia.size - 1, 0].max end @materia_index = [@materia_index, max].min update_materia_bio end if Input.trigger?(Input::DOWN) Sound.play_cursor @equip_index = @equip_index == 4 ? @equip_index = 0 : @equip_index += 1 case @equip_index when 0 max = [@actor.weapon_materia.size - 1, 0].max when 1 max = [@actor.armor1_materia.size - 1, 0].max when 2 max = [@actor.armor2_materia.size - 1, 0].max when 3 max = [@actor.armor3_materia.size - 1, 0].max when 4 max = [@actor.armor4_materia.size - 1, 0].max end @materia_index = [@materia_index, max].min update_materia_bio end if Input.trigger?(Input::RIGHT) Sound.play_cursor case @equip_index when 0 max = @actor.weapon_materia.size when 1 max = @actor.armor1_materia.size when 2 max = @actor.armor2_materia.size when 3 max = @actor.armor3_materia.size when 4 max = @actor.armor4_materia.size end return if max == 0 @materia_index = @materia_index == max - 1 ? @materia_index = 0 : @materia_index += 1 update_materia_bio end if Input.trigger?(Input::LEFT) Sound.play_cursor case @equip_index when 0 max = @actor.weapon_materia.size when 1 max = @actor.armor1_materia.size when 2 max = @actor.armor2_materia.size when 3 max = @actor.armor3_materia.size when 4 max = @actor.armor4_materia.size end return if max == 0 @materia_index = @materia_index == 0 ? @materia_index = max - 1 : @materia_index -= 1 update_materia_bio end if Input.trigger?(Input::L) @actor_index = @actor_index == 0 ? @actor_index = $game_party.members.size - 1 : @actor_index -= 1 $scene = Scene_MateriaEquip.new(@actor_index, @equip_index) end if Input.trigger?(Input::R) @materia_list_window.refresh @actor_index = @actor_index == $game_party.members.size - 1 ? @actor_index = 0: @actor_index += 1 $scene = Scene_MateriaEquip.new(@actor_index, @equip_index) end if Input.trigger?(Input::A) Sound.play_equip @actor.unequip_materia(@equip_index, @materia_index) @materia_list_window.refresh @status_bio_window.refresh @character_bio_window.draw_actor_materia update_materia_bio end if Input.trigger?(Input::B) Sound.play_cancel return_scene end if Input.trigger?(Input::C) case @equip_index when 0 max = @actor.weapon_materia.size when 1 max = @actor.armor1_materia.size when 2 max = @actor.armor2_materia.size when 3 max = @actor.armor3_materia.size when 4 max = @actor.armor4_materia.size end if max == 0 Sound.play_buzzer return else Sound.play_decision @materia_list_window.active = true update_materia_bio end end end #-------------------------------------------------------------------------- def update_materia_select if Input.trigger?(Input::B) Sound.play_cancel @materia_list_window.active = false update_materia_bio end if Input.trigger?(Input::C) if @materia_list_window.materia.nil? Sound.play_buzzer return end Sound.play_equip @actor.equip_materia(@equip_index, @materia_index, @materia_list_window.index) @materia_list_window.refresh @status_bio_window.refresh @character_bio_window.draw_actor_materia @materia_list_window.active = false end if Input.trigger?(Input::UP) || Input.trigger?(Input::DOWN) || Input.press?(Input::UP) || Input.press?(Input::DOWN) || Input.trigger?(Input::R) || Input.trigger?(Input::L) || Input.press?(Input::R) || Input.press?(Input::L) update_materia_bio end end #-------------------------------------------------------------------------- def update_materia_bio if @materia_list_window.active @materia_bio_window.refresh(@materia_list_window.materia) else case @equip_index when 0 item = @actor.weapon_materia when 1 item = @actor.armor1_materia when 2 item = @actor.armor2_materia when 3 item = @actor.armor3_materia when 4 item = @actor.armor4_materia end @materia_bio_window.refresh(item[@materia_index]) end end end
#============================================================================== # ** Scene_Battle #============================================================================== class Scene_Battle #------------------------------------------------------------------------------ alias seph_materiasystem_scenebattle_determineskill determine_skill def determine_skill if @active_battler.actor? paired_materia_set = @active_battler.return_paired_materia for paired_set in paired_materia_set materia = paired_set[2] other_materia = paired_set[3] if materia.special_effect == 'All' for skill_id in other_materia.skills if skill_id == @skill.id and !@skill.element_set.include?(Materia_Config::Negate_All_ID) @active_battler.action.set_skill(@skill.id) @skill_window.active = false end_skill_selection next_actor return end end end end end seph_materiasystem_scenebattle_determineskill end #------------------------------------------------------------------------------ def display_exp_and_gold ap = 0 for enemy in $game_troop.members ap += enemy.ap end exp = $game_troop.exp_total gold = $game_troop.gold_total $game_party.gain_gold(gold) for actor in $game_party.existing_members actor.ap =+ ap end text = sprintf(Vocab::Victory, $game_party.name) $game_message.texts.push('\|' + text) if exp > 0 text = sprintf(Vocab::ObtainExp, exp) $game_message.texts.push('\.' + text) end if ap > 0 text = sprintf("Gained %s Ap!", ap) $game_message.texts.push('\.' + text) end if gold > 0 text = sprintf(Vocab::ObtainGold, gold, Vocab::gold) $game_message.texts.push('\.' + text) end wait_for_message end #------------------------------------------------------------------------------ def process_escape @info_viewport.visible = false @message_window.visible = true text = sprintf(Vocab::EscapeStart, $game_party.name) $game_message.texts.push(text) escapeplus = 0 for actor in $game_party.members escapeplus += actor.escapeplus if actor.exist? end if $game_troop.preemptive success = true else success = (rand(100) < @escape_ratio + escapeplus) end Sound.play_escape if success wait_for_message battle_end(1) else @escape_ratio += 10 $game_message.texts.push('\.' + Vocab::EscapeFailure) wait_for_message $game_party.clear_actions start_main end end end end
Doddy
Citadin Lv.7
Age : 38 Inscrit le : 12/02/2010 Messages : 204
Sujet: Re: [Résolu] Rapport de combat V3 + Système de matéria Jeu 18 Fév 2010 - 4:22
script du rapport de combat :
Spoiler:
Code:
#=============================================================== # ● [VX] ◦ Rapport de combat V3 #-------------------------------------------------------------- # ◦ Par Blockade # ◦ http://rpg-maker-vx.bbactif.com/forum.htm # ◦ Crée le 06/04/2009 # ◦ Version 3.6 # ◦ Remerciment à Woratana, Moghunter #-------------------------------------------------------------- #=============================================================== #=============================================================== # Notes de version : #--------------------------------------------------------------- # ~ Version 1.0 : # - Création du script # ~ Version 2.0 : # - Interface revue # - Regroupement et classement des objets gagnés # - Ajouts d'options de personalisations # ~ Version 3.0 : # - Le script distibue l'argent gagné correctement. # - Module de configuration entiérement revu # - Compatibilité améliorée # - Pop-up lors d'un level up qui affiche les caractéristiques # - Affiche les sorts gagnés # ~ Version 3.5 # - Meilleur affichage des caractéristiques quand le héros gagne un niveau # - Affichage du temps de combat # ~ Version 3.6 # - Mise à la norme de mes scripts # - Compatible avec 3 systèmes de combat : Combat VX, SBS, SBS avec ATB # - Détecte automatiquement le SBS #=============================================================== #=============================================================== # Utilisation : # Plug & Play, inserez le au dessus de Main ! # Jettez un coup d'oeil au module de configuration ! #=============================================================== module Blockade module Config_Report #=============================================================== # Blockade::Config_Report Début du Module de configuration #=============================================================== #------------------------------------------- # >> Configuration du texte #-------------------------------------------- # > Texte contenu dans l'help_window Text_help_window = "Rapport de Combat"
# > Dans la fenêtre de drop Drop_nil = "Aucun objet trouvé." # Si pas d'objet à la fin du combat Drop_objets = "Objets trouvés :" # Si des objets sont trouvées Drop_armures = "Armures trouvées :" # Si des armures sont trouvées Drop_armes = "Armes trouvées :" # Si des armes sont trouvées
# > Dans la fenêtre de changement de niveau Texte_hp = "HP " # Texte pour les Hp Texte_mp = "MP " # Texte pour les Mp Texte_atk = "Attaque " # Texte pour l'attaque Texte_def = "Défense " # Texte pour la défense Texte_int = "Intelligence " # Texte pour l'intelligence Texte_agi = "Agilité " # Texte pour l'agilité
# > Couleur des noms de caracteristiques Couleur_nom_carac = 4
# > Dans la fenêtre des nouveaux sorts Couleur_new_skill = 4 # Couleur de Texte_new_skill Texte_new_skill = "Nouveaux sorts : " # Texte pour introduire les nouveaux sorts #-------------------------------------------
#------------------------------------------- # >> Configuration des icones #-------------------------------------------- # > Dans la fenêtre de changement de niveau Icone_hp = 99 # Id de l'icone pour les PV Icone_mp = 100 # Id de l'icone pour les PM Icone_atk = 2 # Id de l'icone pour l'attaque Icone_def = 52 # Id de l'icone pour la défense Icone_int = 21 # Id de l'icone pour l'intelligence Icone_agi = 48 # Id de l'icone pour l'agilité
# > Dans la fenêtre des sorts Icone_new_skill = 130 #-------------------------------------------
#------------------------------------------- # >> Configuration des sons #-------------------------------------------- # > Quand un héros gagne un niveau Lvl_up_sound = "Recovery" # Nom du SE Lvl_up_volume = 80 # Volume entre 50-150 Lvl_up_tempo = 100 # Tempo entre 50-150 #=============================================================== # Blockade::Config_Report Fin du Module de configuration #=============================================================== end end
$imported = {} if $imported == nil $imported["Rapport_CombatV3"] = true
#============================================================================== # ** Scene_Battle #------------------------------------------------------------------------------ # Scene qui gère les combats #============================================================================== class Scene_Battle < Scene_Base #-------------------------------------------------------------------------- # * Prend le temps au début du combat #-------------------------------------------------------------------------- alias start_battle_block start def start start_battle_block @temps = Time.now end
#-------------------------------------------------------------------------- # * Processus de victoire #-------------------------------------------------------------------------- def process_victory if defined?(::N01) @status_window.visible = true @message_window.visible = false # ボスコラプスはウエイトを長く挟む for enemy in $game_troop.members break boss_wait = true if enemy.collapse_type == 3 end wait(440) if boss_wait wait(N01::WIN_WAIT) unless boss_wait # 動けないアクターを除いて勝利アクション for actor in $game_party.members unless actor.restriction >= 4 @spriteset.set_action(true, actor.index,actor.win) end end end @info_viewport.visible = false @message_window.visible = false RPG::BGM.stop $game_system.battle_end_me.play unless $BTEST $game_temp.map_bgm.play $game_temp.map_bgs.play end new_temps = Time.now temps = new_temps- @temps if temps >= 60 @temps_combat = (temps / 60).truncate @suffixe = @temps_combat > 1 ? "minutes" : "minute" else @temps_combat = temps.truncate @suffixe = "secondes" end @exp =$game_troop.exp_total @gold = $game_troop.gold_total @drop = $game_troop.make_drop_items $game_party.gain_gold(@gold) ini_variable Graphics.fadeout(30) afficher_rapport Graphics.fadein(20) end
#-------------------------------------------------------------------------- # * Initialise les variables #-------------------------------------------------------------------------- def ini_variable @fin_combat = true @actors_lvl_up = [] @num_passage= 0 end
#-------------------------------------------------------------------------- # * Afficher le rapport de combat #-------------------------------------------------------------------------- def afficher_rapport @help_window = Window_Help_Combat.new @heros_window = [] y=55 ; i=0 for actor in $game_party.members @heros_window[i] = Heros_Window.new(actor,y,@exp) @actors_lvl_up.push([actor,@heros_window[i].get_old_carac,@heros_window[i].get_new_carac,@heros_window[i].get_new_skills]) if @heros_window[i].level_up y +=74; i += 1 end @gold_exp_window = Gold_Exp_Window.new(@gold,@exp) @butin_window = Drop_Window.new(@drop) @help_window.set_text(Blockade::Config_Report::Text_help_window,Blockade::Config_Report::Alignement_texte,Blockade::Config_Report::Texte_temps_combat + "#{@temps_combat} #{@suffixe} ",Blockade::Config_Report::Alignement_texte_temps_combat) if @actors_lvl_up != [] RPG::SE.new(Blockade::Config_Report::Lvl_up_sound, Blockade::Config_Report::Lvl_up_volume, Blockade::Config_Report::Lvl_up_tempo).play @actor_window = Carac_Window.new(@actors_lvl_up[@num_passage]) new_skill = @actors_lvl_up[@num_passage] @actor_window2 = Skills_Window.new(@actors_lvl_up[@num_passage]) if @actors_lvl_up[@num_passage][3].size > 0 end end
#-------------------------------------------------------------------------- # * Update #-------------------------------------------------------------------------- alias update_block update unless $@ def update super if @fin_combat != true update_block else # Si c'est la fin du combat super @help_window.update @message_window.update for i in 0...@heros_window.size @heros_window[i].update end if @actors_lvl_up != [] @actor_window.update @actor_window2.update if @actors_lvl_up[@num_passage][3].size > 0 # if @heros_window[@num_passage].get_new_skills.size > 0 if Input.trigger?(Input::C) @num_passage += 1 @actor_window.dispose @actor_window2.visible = false if @actor_window2 != nil if @num_passage + 1 > @actors_lvl_up.size Input.update @actors_lvl_up = [] end # fin @num_passage if @actors_lvl_up != [] RPG::SE.new(Blockade::Config_Report::Lvl_up_sound, Blockade::Config_Report::Lvl_up_volume, Blockade::Config_Report::Lvl_up_tempo).play @actor_window = Carac_Window.new(@actors_lvl_up[@num_passage]) @actor_window2 = Skills_Window.new(@actors_lvl_up[@num_passage]) if @actors_lvl_up[@num_passage][3].size >0 # if @heros_window[@num_passage].get_new_skills.size > 0 end # fin @actors_lvl_up end # fin input else # si pas de lvl up end # Si on appuye sur Entrée if Input.trigger?(Input::C) and @actors_lvl_up == [] @help_window.dispose for i in 0...@heros_window.size @heros_window[i].dispose end @gold_exp_window.dispose @butin_window.dispose if $BTEST $scene = nil else Graphics.fadeout(30) battle_end(0) suppr_variables end end end end
#-------------------------------------------------------------------------- # * Reinitialise les variables #-------------------------------------------------------------------------- def suppr_variables @fin_combat = false @actors_lvl_up = [] end end
#============================================================================== # ** Window_Help_Combat #------------------------------------------------------------------------------ # This window shows skill and item explanations along with actor status. #============================================================================== class Window_Help_Combat < Window_Base #-------------------------------------------------------------------------- # * Object Initialization #-------------------------------------------------------------------------- def initialize super(0, 0, 544, WLH + 32) end #-------------------------------------------------------------------------- # * Set Text # text : character string displayed in window # align : alignment (0..flush left, 1..center, 2..flush right) #-------------------------------------------------------------------------- def set_text(text1, align1,text2,align2) if text1 != @text1 or align1 != @align1 or text2 != @text2 or align2 != @align2 self.contents.clear self.contents.font.color = normal_color self.contents.draw_text(4, 0, self.width - 40, WLH, text1, align1) self.contents.draw_text(4, 0, self.width - 40, WLH, text2, align2) @text1 = text1 ; @align = align2 @text2 = text2 ; @align2 = align2 end end end
#============================================================================== # ** Skills_Window #------------------------------------------------------------------------------ # Affiche les sorts #============================================================================== class Skills_Window < Window_Base def initialize(actor_info) @new_skills = actor_info[3] super(300,58,244,230) afficher_sorts end
#-------------------------------------------------------------------------- # * Affiche les nouveaux sorts #-------------------------------------------------------------------------- def afficher_sorts self.contents.font.color = text_color(Blockade::Config_Report::Couleur_new_skill) self.contents.draw_text(25,0, 200, WLH, Blockade::Config_Report::Texte_new_skill) draw_icon(Blockade::Config_Report::Icone_new_skill,0,0) y = 25 for skills in @new_skills draw_item_name(skills,0,y) y += 25 end end end
#============================================================================== # ** Carac_Window #------------------------------------------------------------------------------ # Affiche les caractérisqtiques #============================================================================== class Carac_Window < Window_Base def initialize(actor) @actor = actor[0] @old_carac = actor[1] @new_carac = actor[2] @new_skills = actor[3] x = 100 x = 0 if @new_skills.size > 0 super(x,58,300,230) afficher_info_actor afficher_icone afficher_carac end
#-------------------------------------------------------------------------- # * Affiche le nom et le niveau du héros #-------------------------------------------------------------------------- def afficher_info_actor draw_character(@actor.character_name, @actor.character_index, 20, 40) self.contents.draw_text(40,0, 200, WLH, @actor.name) self.contents.draw_text(40,20,200,WLH,Blockade::Config_Report::Lvl + @old_carac[0].to_s + " > " + Blockade::Config_Report::Lvl + @new_carac[0].to_s) end
#-------------------------------------------------------------------------- # * Affiche les icones #-------------------------------------------------------------------------- def afficher_icone draw_icon(Blockade::Config_Report::Icone_hp,0,50) draw_icon(Blockade::Config_Report::Icone_mp ,0,75) draw_icon(Blockade::Config_Report::Icone_atk ,0,100) draw_icon(Blockade::Config_Report::Icone_def,0,125) draw_icon(Blockade::Config_Report::Icone_int,0,150) draw_icon(Blockade::Config_Report::Icone_agi,0,175) end
#-------------------------------------------------------------------------- # * Affiche les caractéristiques #-------------------------------------------------------------------------- def afficher_carac self.contents.font.color = text_color(Blockade::Config_Report::Couleur_nom_carac) self.contents.draw_text(25,50, 150, WLH, Blockade::Config_Report::Texte_hp) self.contents.draw_text(25,75, 150, WLH, Blockade::Config_Report::Texte_mp) self.contents.draw_text(25,100, 150, WLH, Blockade::Config_Report::Texte_atk) self.contents.draw_text(25,125, 150, WLH, Blockade::Config_Report::Texte_def) self.contents.draw_text(25,150, 150, WLH, Blockade::Config_Report::Texte_int) self.contents.draw_text(25,175, 150, WLH, Blockade::Config_Report::Texte_agi) self.contents.font.color = normal_color y = 50 for i in 1...@new_carac.size self.contents.draw_text(150,y, 105, WLH, @old_carac[i],0) self.contents.draw_text(150,y, 110, WLH, "> ",1) self.contents.font.color = power_up_color if @old_carac[i] < @new_carac[i] self.contents.font.color.alpha = 128 if @old_carac[i] == @new_carac[i] self.contents.draw_text(150,y, 105, WLH, @new_carac[i],2) self.contents.font.color.alpha = 255 self.contents.font.color = normal_color y +=25 end end end
#============================================================================== # ** Gold_Exp_Window #------------------------------------------------------------------------------ # Affiche l'argent et l'exp obtenus #============================================================================== class Gold_Exp_Window < Window_Base def initialize(gold,exp) super(0,350,200,65) self.contents.draw_text(0,-6,200,WLH,Blockade::Config_Report::Exp + exp.to_s) self.contents.draw_text(0,14,200,WLH,Blockade::Config_Report::Gold + gold.to_s) end end
#============================================================================== # ** Heros_Window #------------------------------------------------------------------------------ # Affiche les informations d'exp sur les héros #============================================================================== class Heros_Window < Window_Base def initialize(actor,y,exp) super(0,y,200,75) @actor = actor @exp = exp afficher_info end
#-------------------------------------------------------------------------- # * Renvoie les anciennes caractérisques #-------------------------------------------------------------------------- def get_old_carac return @old_carac end
#-------------------------------------------------------------------------- # * Renvoie les nouvelles caractérisques #-------------------------------------------------------------------------- def get_new_carac return @new_carac end
#-------------------------------------------------------------------------- # * Renvoie les nouveaux sorts #-------------------------------------------------------------------------- def get_new_skills if @new_skills.size > 0 return @new_skills else return [] end end #-------------------------------------------------------------------------- # * Determine si le heros a pris un ou plusieurs niveaux #-------------------------------------------------------------------------- def level_up return @level_up end #-------------------------------------------------------------------------- # * Couleur 1 de la barre #-------------------------------------------------------------------------- def exp_gauge_color1 return text_color(30) end
#-------------------------------------------------------------------------- # * Couleur 1 de la barre #-------------------------------------------------------------------------- def exp_gauge_color2 return text_color(31) end
#-------------------------------------------------------------------------- # * Dessine la barre d'exp #------------------------------------------------------------------------- def draw_actor_exp_meter(actor, x, y, width = 100) if actor.next_exp != 0 exp = actor.now_exp else exp = 1 end gw = width * exp / [actor.next_exp, 1].max gc1 = exp_gauge_color1 gc2 = exp_gauge_color2 self.contents.fill_rect(x, y + WLH - 8, width, 6, gauge_back_color) self.contents.gradient_fill_rect(x, y + WLH - 8, gw, 6, gc1, gc2) self.contents.font.color = system_color self.contents.draw_text(x, y, 30, WLH, "Exp") self.contents.font.color = normal_color xr = x + width self.contents.draw_text(xr - 60, y, 60, WLH, actor.next_rest_exp_s, 2) end end
#============================================================================== # ** Drop_Window #------------------------------------------------------------------------------ # Affiche les objets obtenus #============================================================================== class Drop_Window < Window_Base def initialize(drop) super(200,55,344,360) @drop = drop if @drop != [] trier_drop regrouper afficher_drop donner_drop else afficher_mess end end
#-------------------------------------------------------------------------- # * Trie le drop en fonction du type d'objet #------------------------------------------------------------------------- def trier_drop @armes = [] @armures = [] @items = [] for item in @drop if item.is_a?(RPG::Item) @items.push(item) end if item.is_a?(RPG::Armor) @armures.push(item) end if item.is_a?(RPG::Weapon) @armes.push(item) end end end
#-------------------------------------------------------------------------- # * Regroupe les objets par nombre #------------------------------------------------------------------------- def regrouper #------------------------------------------------------- # Pour les objets #------------------------------------------------------ if @items != [] @items_unique = @items.uniq @regroupement_item = {} for item in @items_unique @regroupement_item[item] = 0 end for item in @items if @regroupement_item.include?(item) @regroupement_item[item] += 1 end end end
#------------------------------------------------------- # Pour les armures #------------------------------------------------------ if @armures != [] @armure_unique = @armures.uniq @regroupement_armures = {} for armure in @armure_unique @regroupement_armures[armure] = 0 end for armure in @armures if @regroupement_armures.include?(armure) @regroupement_armures[armure] += 1 end end end
#------------------------------------------------------- # Pour les armes #------------------------------------------------------ if @armes != [] @armes_unique = @armes.uniq @regroupement_armes = {} for arme in @armes_unique @regroupement_armes[arme] = 0 end for arme in @armes if @regroupement_armes.include?(arme) @regroupement_armes[arme] += 1 end end end end
#-------------------------------------------------------------------------- # * Affiche les objets #------------------------------------------------------------------------- def afficher_drop y=0 # Initialisation de la coordonée y #------------------------------------------------------- # Pour les objets #------------------------------------------------------ if @items != [] self.contents.draw_text(0,y,200,WLH,Blockade::Config_Report::Drop_objets) y += 25 for item in @regroupement_item draw_icon(item[0].icon_index, 0, y) if item[1] > 1 quantite = " x" + item[1].to_s else quantite = "" end self.contents.draw_text(24, y, 172, WLH, item[0].name + quantite) y+=25 end end
y += 5 if @items.nil? == false # Si les objets on été affiché augmenter y de 5
#------------------------------------------------------- # Pour les armures #------------------------------------------------------ if @armures != [] self.contents.draw_text(0,y,200,WLH,Blockade::Config_Report::Drop_armures) y += 25 for armure in @regroupement_armures draw_icon(armure[0].icon_index, 0, y) if armure[1] > 1 quantite = " x" + armure[1].to_s else quantite = "" end self.contents.draw_text(24, y, 172, WLH, armure[0].name + quantite) y +=25 end end
y += 5 if @armures.nil? == false # Si les armures on été affichées augmenter y de 5
#------------------------------------------------------- # Pour les armes #------------------------------------------------------ if @armes != [] self.contents.draw_text(0,y,200,WLH,Blockade::Config_Report::Drop_armes) y += 25 for arme in @regroupement_armes draw_icon(arme[0].icon_index, 0, y) if arme[1] > 1 quantite = " x" + arme[1].to_s else quantite = "" end self.contents.draw_text(24, y, 172, WLH, arme[0].name + quantite) y +=25 end end end
#------------------------------------------------------- # Afficher un message si pas de drop #------------------------------------------------------ def afficher_mess self.contents.draw_text(0,0,360,WLH,Blockade::Config_Report::Drop_nil) end
#------------------------------------------------------- # Donne le drop à l'équipe #------------------------------------------------------ def donner_drop for item in @drop $game_party.gain_item(item, 1) end end end
#============================================================================== # ** Game_Actor #------------------------------------------------------------------------------ # Gére les données système sur les héros. #============================================================================== class Game_Actor < Game_Battler #-------------------------------------------------------------------------- # * Calcul de l'exp accumulée #-------------------------------------------------------------------------- def now_exp return @exp - @exp_list[@level] end
#-------------------------------------------------------------------------- # * Calcul de l'exp a avoir pour gagner un niveau #-------------------------------------------------------------------------- def next_exp return @exp_list[@level+1] > 0 ? @exp_list[@level+1] - @exp_list[@level] : 0 end end
Mon problème c'est que les AP qui servent à l'évolution des matérias n'augmentent pas lorsque ce script est installé avec. Serait-il possible de rendre compatible ces deux script et tant qu'a faire si possible aménager une petite place pour que les AP gagnés durant un combat apparaissent dans le rapport !?
Si vous avez besoin de précision n'hésitez pas à demander. Merci d'avoir jeter un coup d'oeil.
Doddy
Citadin Lv.7
Age : 38 Inscrit le : 12/02/2010 Messages : 204
Sujet: Re: [Résolu] Rapport de combat V3 + Système de matéria Ven 19 Fév 2010 - 2:32
Grâce à thorm avec qui je discutais sur le chatbox et qui m'a suggéré de passer par un évent pour résoudre mon problème j'ai finis par résoudre mon problème très simplement :
Donc pour le slim par exemple dés que ses point de vie atteignent 0% J'ajoute 10Ap aux membres du groupe.
Mon seul problème (qui est mineur) c'est que ca ne s'affiche nul part il faut aller voir sur les matérias directement pour s'en rendre compte.
thorm
Va-nu-pieds Lv.4
Age : 29 Inscrit le : 29/11/2009 Messages : 66
Sujet: Re: [Résolu] Rapport de combat V3 + Système de matéria Ven 19 Fév 2010 - 2:34
ajoute un message après ton appel de script.
Doddy
Citadin Lv.7
Age : 38 Inscrit le : 12/02/2010 Messages : 204
Sujet: Re: [Résolu] Rapport de combat V3 + Système de matéria Ven 19 Fév 2010 - 5:04
Finalement j'ai été dans le script pour l'afficher et non seulement ça s'affiche dans le rapport de combat mais en plus ca fait évoluer les matérias donc je n'ai plus besoin d'évent.
Code:
#=============================================================== # ● [VX] ◦ Rapport de combat V3 #-------------------------------------------------------------- # ◦ Par Blockade # ◦ http://rpg-maker-vx.bbactif.com/forum.htm # ◦ Crée le 06/04/2009 # ◦ Version 3.6 # ◦ Remerciment à Woratana, Moghunter #-------------------------------------------------------------- #=============================================================== #=============================================================== # Notes de version : #--------------------------------------------------------------- # ~ Version 1.0 : # - Création du script # ~ Version 2.0 : # - Interface revue # - Regroupement et classement des objets gagnés # - Ajouts d'options de personalisations # ~ Version 3.0 : # - Le script distibue l'argent gagné correctement. # - Module de configuration entiérement revu # - Compatibilité améliorée # - Pop-up lors d'un level up qui affiche les caractéristiques # - Affiche les sorts gagnés # ~ Version 3.5 # - Meilleur affichage des caractéristiques quand le héros gagne un niveau # - Affichage du temps de combat # ~ Version 3.6 # - Mise à la norme de mes scripts # - Compatible avec 3 systèmes de combat : Combat VX, SBS, SBS avec ATB # - Détecte automatiquement le SBS #=============================================================== #=============================================================== # Utilisation : # Plug & Play, inserez le au dessus de Main ! # Jettez un coup d'oeil au module de configuration ! #=============================================================== module Blockade module Config_Report #=============================================================== # Blockade::Config_Report Début du Module de configuration #=============================================================== #------------------------------------------- # >> Configuration du texte #-------------------------------------------- # > Texte contenu dans l'help_window Text_help_window = "Rapport de Combat"
# > Monnaie (abrégée) Gold = "Gils : " Ap = "Ap : "#ajout de moi # > Niveau (abrégé) Lvl = "Niv. "
# > Dans la fenêtre de drop Drop_nil = "Aucun objet trouvé." # Si pas d'objet à la fin du combat Drop_objets = "Objets trouvés :" # Si des objets sont trouvées Drop_armures = "Armures trouvées :" # Si des armures sont trouvées Drop_armes = "Armes trouvées :" # Si des armes sont trouvées
# > Dans la fenêtre de changement de niveau Texte_hp = "HP " # Texte pour les Hp Texte_mp = "MP " # Texte pour les Mp Texte_atk = "Attaque " # Texte pour l'attaque Texte_def = "Défense " # Texte pour la défense Texte_int = "Intelligence " # Texte pour l'intelligence Texte_agi = "Agilité " # Texte pour l'agilité
# > Couleur des noms de caracteristiques Couleur_nom_carac = 4
# > Dans la fenêtre des nouveaux sorts Couleur_new_skill = 4 # Couleur de Texte_new_skill Texte_new_skill = "Nouveaux sorts : " # Texte pour introduire les nouveaux sorts #-------------------------------------------
#------------------------------------------- # >> Configuration des icones #-------------------------------------------- # > Dans la fenêtre de changement de niveau Icone_hp = 99 # Id de l'icone pour les PV Icone_mp = 100 # Id de l'icone pour les PM Icone_atk = 2 # Id de l'icone pour l'attaque Icone_def = 52 # Id de l'icone pour la défense Icone_int = 21 # Id de l'icone pour l'intelligence Icone_agi = 48 # Id de l'icone pour l'agilité
# > Dans la fenêtre des sorts Icone_new_skill = 130 #-------------------------------------------
#------------------------------------------- # >> Configuration des sons #-------------------------------------------- # > Quand un héros gagne un niveau Lvl_up_sound = "Recovery" # Nom du SE Lvl_up_volume = 80 # Volume entre 50-150 Lvl_up_tempo = 100 # Tempo entre 50-150 #=============================================================== # Blockade::Config_Report Fin du Module de configuration #=============================================================== end end
$imported = {} if $imported == nil $imported["Rapport_CombatV3"] = true
#============================================================================== # ** Scene_Battle #------------------------------------------------------------------------------ # Scene qui gère les combats #============================================================================== class Scene_Battle < Scene_Base #-------------------------------------------------------------------------- # * Prend le temps au début du combat #-------------------------------------------------------------------------- alias start_battle_block start def start start_battle_block @temps = Time.now end
#-------------------------------------------------------------------------- # * Processus de victoire #-------------------------------------------------------------------------- def process_victory if defined?(::N01) @status_window.visible = true @message_window.visible = false # ボスコラプスはウエイトを長く挟む for enemy in $game_troop.members break boss_wait = true if enemy.collapse_type == 3 end wait(440) if boss_wait wait(N01::WIN_WAIT) unless boss_wait # 動けないアクターを除いて勝利アクション for actor in $game_party.members unless actor.restriction >= 4 @spriteset.set_action(true, actor.index,actor.win) end end end @info_viewport.visible = false @message_window.visible = false RPG::BGM.stop $game_system.battle_end_me.play unless $BTEST $game_temp.map_bgm.play $game_temp.map_bgs.play end new_temps = Time.now temps = new_temps- @temps if temps >= 60 @temps_combat = (temps / 60).truncate @suffixe = @temps_combat > 1 ? "minutes" : "minute" else @temps_combat = temps.truncate @suffixe = "secondes" end @exp =$game_troop.exp_total @gold = $game_troop.gold_total @drop = $game_troop.make_drop_items $game_party.gain_gold(@gold) ini_variable Graphics.fadeout(30) afficher_rapport Graphics.fadein(20) end
#-------------------------------------------------------------------------- # * Initialise les variables #-------------------------------------------------------------------------- def ini_variable @fin_combat = true @actors_lvl_up = [] @num_passage= 0 end
#-------------------------------------------------------------------------- # * Afficher le rapport de combat #-------------------------------------------------------------------------- def afficher_rapport @help_window = Window_Help_Combat.new @heros_window = [] y=55 ; i=0 for actor in $game_party.members @heros_window[i] = Heros_Window.new(actor,y,@exp) @actors_lvl_up.push([actor,@heros_window[i].get_old_carac,@heros_window[i].get_new_carac,@heros_window[i].get_new_skills]) if @heros_window[i].level_up y +=74; i += 1 end @gold_exp_window = Gold_Exp_Window.new(@gold,@exp,@ap)#ajout de moi @butin_window = Drop_Window.new(@drop) @help_window.set_text(Blockade::Config_Report::Text_help_window,Blockade::Config_Report::Alignement_texte,Blockade::Config_Report::Texte_temps_combat + "#{@temps_combat} #{@suffixe} ",Blockade::Config_Report::Alignement_texte_temps_combat) if @actors_lvl_up != [] RPG::SE.new(Blockade::Config_Report::Lvl_up_sound, Blockade::Config_Report::Lvl_up_volume, Blockade::Config_Report::Lvl_up_tempo).play @actor_window = Carac_Window.new(@actors_lvl_up[@num_passage]) new_skill = @actors_lvl_up[@num_passage] @actor_window2 = Skills_Window.new(@actors_lvl_up[@num_passage]) if @actors_lvl_up[@num_passage][3].size > 0 end end
#-------------------------------------------------------------------------- # * Update #-------------------------------------------------------------------------- alias update_block update unless $@ def update super if @fin_combat != true update_block else # Si c'est la fin du combat super @help_window.update @message_window.update for i in 0...@heros_window.size @heros_window[i].update end if @actors_lvl_up != [] @actor_window.update @actor_window2.update if @actors_lvl_up[@num_passage][3].size > 0 # if @heros_window[@num_passage].get_new_skills.size > 0 if Input.trigger?(Input::C) @num_passage += 1 @actor_window.dispose @actor_window2.visible = false if @actor_window2 != nil if @num_passage + 1 > @actors_lvl_up.size Input.update @actors_lvl_up = [] end # fin @num_passage if @actors_lvl_up != [] RPG::SE.new(Blockade::Config_Report::Lvl_up_sound, Blockade::Config_Report::Lvl_up_volume, Blockade::Config_Report::Lvl_up_tempo).play @actor_window = Carac_Window.new(@actors_lvl_up[@num_passage]) @actor_window2 = Skills_Window.new(@actors_lvl_up[@num_passage]) if @actors_lvl_up[@num_passage][3].size >0 # if @heros_window[@num_passage].get_new_skills.size > 0 end # fin @actors_lvl_up end # fin input else # si pas de lvl up end # Si on appuye sur Entrée if Input.trigger?(Input::C) and @actors_lvl_up == [] @help_window.dispose for i in 0...@heros_window.size @heros_window[i].dispose end @gold_exp_window.dispose @butin_window.dispose if $BTEST $scene = nil else Graphics.fadeout(30) battle_end(0) suppr_variables end end end end
#-------------------------------------------------------------------------- # * Reinitialise les variables #-------------------------------------------------------------------------- def suppr_variables @fin_combat = false @actors_lvl_up = [] end end
#============================================================================== # ** Window_Help_Combat #------------------------------------------------------------------------------ # This window shows skill and item explanations along with actor status. #============================================================================== class Window_Help_Combat < Window_Base #-------------------------------------------------------------------------- # * Object Initialization #-------------------------------------------------------------------------- def initialize super(0, 0, 544, WLH + 32) end #-------------------------------------------------------------------------- # * Set Text # text : character string displayed in window # align : alignment (0..flush left, 1..center, 2..flush right) #-------------------------------------------------------------------------- def set_text(text1, align1,text2,align2) if text1 != @text1 or align1 != @align1 or text2 != @text2 or align2 != @align2 self.contents.clear self.contents.font.color = normal_color self.contents.draw_text(4, 0, self.width - 40, WLH, text1, align1) self.contents.draw_text(4, 0, self.width - 40, WLH, text2, align2) @text1 = text1 ; @align = align2 @text2 = text2 ; @align2 = align2 end end end
#============================================================================== # ** Skills_Window #------------------------------------------------------------------------------ # Affiche les sorts #============================================================================== class Skills_Window < Window_Base def initialize(actor_info) @new_skills = actor_info[3] super(300,58,244,230) afficher_sorts end
#-------------------------------------------------------------------------- # * Affiche les nouveaux sorts #-------------------------------------------------------------------------- def afficher_sorts self.contents.font.color = text_color(Blockade::Config_Report::Couleur_new_skill) self.contents.draw_text(25,0, 200, WLH, Blockade::Config_Report::Texte_new_skill) draw_icon(Blockade::Config_Report::Icone_new_skill,0,0) y = 25 for skills in @new_skills draw_item_name(skills,0,y) y += 25 end end end
#============================================================================== # ** Carac_Window #------------------------------------------------------------------------------ # Affiche les caractérisqtiques #============================================================================== class Carac_Window < Window_Base def initialize(actor) @actor = actor[0] @old_carac = actor[1] @new_carac = actor[2] @new_skills = actor[3] x = 100 x = 0 if @new_skills.size > 0 super(x,58,300,230) afficher_info_actor afficher_icone afficher_carac end
#-------------------------------------------------------------------------- # * Affiche le nom et le niveau du héros #-------------------------------------------------------------------------- def afficher_info_actor draw_character(@actor.character_name, @actor.character_index, 20, 40) self.contents.draw_text(40,0, 200, WLH, @actor.name) self.contents.draw_text(40,20,200,WLH,Blockade::Config_Report::Lvl + @old_carac[0].to_s + " > " + Blockade::Config_Report::Lvl + @new_carac[0].to_s) end
#-------------------------------------------------------------------------- # * Affiche les icones #-------------------------------------------------------------------------- def afficher_icone draw_icon(Blockade::Config_Report::Icone_hp,0,50) draw_icon(Blockade::Config_Report::Icone_mp ,0,75) draw_icon(Blockade::Config_Report::Icone_atk ,0,100) draw_icon(Blockade::Config_Report::Icone_def,0,125) draw_icon(Blockade::Config_Report::Icone_int,0,150) draw_icon(Blockade::Config_Report::Icone_agi,0,175) end
#-------------------------------------------------------------------------- # * Affiche les caractéristiques #-------------------------------------------------------------------------- def afficher_carac self.contents.font.color = text_color(Blockade::Config_Report::Couleur_nom_carac) self.contents.draw_text(25,50, 150, WLH, Blockade::Config_Report::Texte_hp) self.contents.draw_text(25,75, 150, WLH, Blockade::Config_Report::Texte_mp) self.contents.draw_text(25,100, 150, WLH, Blockade::Config_Report::Texte_atk) self.contents.draw_text(25,125, 150, WLH, Blockade::Config_Report::Texte_def) self.contents.draw_text(25,150, 150, WLH, Blockade::Config_Report::Texte_int) self.contents.draw_text(25,175, 150, WLH, Blockade::Config_Report::Texte_agi) self.contents.font.color = normal_color y = 50 for i in 1...@new_carac.size self.contents.draw_text(150,y, 105, WLH, @old_carac[i],0) self.contents.draw_text(150,y, 110, WLH, "> ",1) self.contents.font.color = power_up_color if @old_carac[i] < @new_carac[i] self.contents.font.color.alpha = 128 if @old_carac[i] == @new_carac[i] self.contents.draw_text(150,y, 105, WLH, @new_carac[i],2) self.contents.font.color.alpha = 255 self.contents.font.color = normal_color y +=25 end end end
#============================================================================== # ** Gold_Exp_Window #------------------------------------------------------------------------------ # Affiche l'argent et l'exp obtenus #============================================================================== class Gold_Exp_Window < Window_Base#--------pour matéria def initialize(gold,exp,ap=0)#-----ap=0 d'ajouté ap = 0 for enemy in $game_troop.members ap += enemy.ap end for actor in $game_party.existing_members actor.ap =+ ap end#-------pour matéria super(0,350,200,65) self.contents.draw_text(0,-6,200,WLH,Blockade::Config_Report::Exp + exp.to_s) self.contents.draw_text(100,-6,200,WLH,Blockade::Config_Report::Ap + ap.to_s)#ajout de moi self.contents.draw_text(0,14,200,WLH,Blockade::Config_Report::Gold + gold.to_s) end end
#============================================================================== # ** Heros_Window #------------------------------------------------------------------------------ # Affiche les informations d'exp sur les héros #============================================================================== class Heros_Window < Window_Base def initialize(actor,y,exp) super(0,y,200,75) @actor = actor @exp = exp afficher_info end
#-------------------------------------------------------------------------- # * Renvoie les anciennes caractérisques #-------------------------------------------------------------------------- def get_old_carac return @old_carac end
#-------------------------------------------------------------------------- # * Renvoie les nouvelles caractérisques #-------------------------------------------------------------------------- def get_new_carac return @new_carac end
#-------------------------------------------------------------------------- # * Renvoie les nouveaux sorts #-------------------------------------------------------------------------- def get_new_skills if @new_skills.size > 0 return @new_skills else return [] end end #-------------------------------------------------------------------------- # * Determine si le heros a pris un ou plusieurs niveaux #-------------------------------------------------------------------------- def level_up return @level_up end #-------------------------------------------------------------------------- # * Couleur 1 de la barre #-------------------------------------------------------------------------- def exp_gauge_color1 return text_color(30) end
#-------------------------------------------------------------------------- # * Couleur 1 de la barre #-------------------------------------------------------------------------- def exp_gauge_color2 return text_color(31) end
#-------------------------------------------------------------------------- # * Dessine la barre d'exp #------------------------------------------------------------------------- def draw_actor_exp_meter(actor, x, y, width = 100) if actor.next_exp != 0 exp = actor.now_exp else exp = 1 end gw = width * exp / [actor.next_exp, 1].max gc1 = exp_gauge_color1 gc2 = exp_gauge_color2 self.contents.fill_rect(x, y + WLH - 8, width, 6, gauge_back_color) self.contents.gradient_fill_rect(x, y + WLH - 8, gw, 6, gc1, gc2) self.contents.font.color = system_color self.contents.draw_text(x, y, 30, WLH, "Exp") self.contents.font.color = normal_color xr = x + width self.contents.draw_text(xr - 60, y, 60, WLH, actor.next_rest_exp_s, 2) end end
#============================================================================== # ** Drop_Window #------------------------------------------------------------------------------ # Affiche les objets obtenus #============================================================================== class Drop_Window < Window_Base def initialize(drop) super(200,55,344,360) @drop = drop if @drop != [] trier_drop regrouper afficher_drop donner_drop else afficher_mess end end
#-------------------------------------------------------------------------- # * Trie le drop en fonction du type d'objet #------------------------------------------------------------------------- def trier_drop @armes = [] @armures = [] @items = [] for item in @drop if item.is_a?(RPG::Item) @items.push(item) end if item.is_a?(RPG::Armor) @armures.push(item) end if item.is_a?(RPG::Weapon) @armes.push(item) end end end
#-------------------------------------------------------------------------- # * Regroupe les objets par nombre #------------------------------------------------------------------------- def regrouper #------------------------------------------------------- # Pour les objets #------------------------------------------------------ if @items != [] @items_unique = @items.uniq @regroupement_item = {} for item in @items_unique @regroupement_item[item] = 0 end for item in @items if @regroupement_item.include?(item) @regroupement_item[item] += 1 end end end
#------------------------------------------------------- # Pour les armures #------------------------------------------------------ if @armures != [] @armure_unique = @armures.uniq @regroupement_armures = {} for armure in @armure_unique @regroupement_armures[armure] = 0 end for armure in @armures if @regroupement_armures.include?(armure) @regroupement_armures[armure] += 1 end end end
#------------------------------------------------------- # Pour les armes #------------------------------------------------------ if @armes != [] @armes_unique = @armes.uniq @regroupement_armes = {} for arme in @armes_unique @regroupement_armes[arme] = 0 end for arme in @armes if @regroupement_armes.include?(arme) @regroupement_armes[arme] += 1 end end end end
#-------------------------------------------------------------------------- # * Affiche les objets #------------------------------------------------------------------------- def afficher_drop y=0 # Initialisation de la coordonée y #------------------------------------------------------- # Pour les objets #------------------------------------------------------ if @items != [] self.contents.draw_text(0,y,200,WLH,Blockade::Config_Report::Drop_objets) y += 25 for item in @regroupement_item draw_icon(item[0].icon_index, 0, y) if item[1] > 1 quantite = " x" + item[1].to_s else quantite = "" end self.contents.draw_text(24, y, 172, WLH, item[0].name + quantite) y+=25 end end
y += 5 if @items.nil? == false # Si les objets on été affiché augmenter y de 5
#------------------------------------------------------- # Pour les armures #------------------------------------------------------ if @armures != [] self.contents.draw_text(0,y,200,WLH,Blockade::Config_Report::Drop_armures) y += 25 for armure in @regroupement_armures draw_icon(armure[0].icon_index, 0, y) if armure[1] > 1 quantite = " x" + armure[1].to_s else quantite = "" end self.contents.draw_text(24, y, 172, WLH, armure[0].name + quantite) y +=25 end end
y += 5 if @armures.nil? == false # Si les armures on été affichées augmenter y de 5
#------------------------------------------------------- # Pour les armes #------------------------------------------------------ if @armes != [] self.contents.draw_text(0,y,200,WLH,Blockade::Config_Report::Drop_armes) y += 25 for arme in @regroupement_armes draw_icon(arme[0].icon_index, 0, y) if arme[1] > 1 quantite = " x" + arme[1].to_s else quantite = "" end self.contents.draw_text(24, y, 172, WLH, arme[0].name + quantite) y +=25 end end end
#------------------------------------------------------- # Afficher un message si pas de drop #------------------------------------------------------ def afficher_mess self.contents.draw_text(0,0,360,WLH,Blockade::Config_Report::Drop_nil) end
#------------------------------------------------------- # Donne le drop à l'équipe #------------------------------------------------------ def donner_drop for item in @drop $game_party.gain_item(item, 1) end end end
#============================================================================== # ** Game_Actor #------------------------------------------------------------------------------ # Gére les données système sur les héros. #============================================================================== class Game_Actor < Game_Battler #-------------------------------------------------------------------------- # * Calcul de l'exp accumulée #-------------------------------------------------------------------------- def now_exp return @exp - @exp_list[@level] end
#-------------------------------------------------------------------------- # * Calcul de l'exp a avoir pour gagner un niveau #-------------------------------------------------------------------------- def next_exp return @exp_list[@level+1] > 0 ? @exp_list[@level+1] - @exp_list[@level] : 0 end end
Contenu sponsorisé
Sujet: Re: [Résolu] Rapport de combat V3 + Système de matéria
[Résolu] Rapport de combat V3 + Système de matéria