Плохо! Плохо!:  0
Страница 1 из 2 12 ПоследняяПоследняя
Показано с 1 по 10 из 12

Тема: Yanfly - Convert Damage

  1. #1

    По умолчанию Yanfly - Convert Damage

    Снова я -_-

    https://github.com/Archeia/YEARepo/b...vert_Damage.rb
    Неплохой скрипт, позволяющий преобразовывать нанесённый урон в HP или MP. Но у него есть пара ощутимых недостатков.

    1. Рабочий диапазон абсорба 1...100%. Запись подобная этой <convert hp physical: +500%> работать не будет.

    2. Нельзя прописать convert в примечение скиллов. Другими словами, не создашь противника с несколькими разновидностями вампирических атак, можно лишь поместить тэг в примечание баттлера, но тогда этот тэг распространится на все атаки врага, а хочется чтобы они вампирили с разной силой.

  2. #2
    Создатель Аватар для Рольф
    Информация о пользователе
    Регистрация
    14.04.2008
    Адрес
    Южно- Сахалинск/Пенза
    Сообщений
    10,081
    Записей в дневнике
    2
    Репутация: 108 Добавить или отнять репутацию

    По умолчанию

    А почему не в разделе скрипты? Там тоже помощь.

  3. #3

    По умолчанию

    Глупая привычка xD

  4. #4
    Познающий Аватар для Deme
    Информация о пользователе
    Регистрация
    16.05.2014
    Сообщений
    317
    Записей в дневнике
    16
    Репутация: 4 Добавить или отнять репутацию

    По умолчанию

    Цитата Сообщение от Succubus Посмотреть сообщение
    1. Рабочий диапазон абсорба 1...100%. Запись подобная этой <convert hp physical: +500%> работать не будет.
    Вы пробовали менять
    MAXIMUM_RATE = 1.0 # Maximum gain from dealing damage.
    с 1.0 на 5.0?
    «quī legis ista, tuam reprehendō, mea laudās // omnia, stultitiam; / nihil, invidiam» (Jōhannis Audoenī)
    'Ты, кто читает это: я порицаю, если ты хвалишь у меня // всё, твою глупость; / если ничего — твою злобу.' (Джон Оуэн)

  5. #5

    По умолчанию

    Какой позор, мне следовало об этом догадаться. Спасибо за подсказку.

    PS: Вопрос по пункту 2 отменяется, обошлась.
    Последний раз редактировалось Succubus; 27.08.2015 в 19:00.

  6. #6
    Познающий Аватар для Deme
    Информация о пользователе
    Регистрация
    16.05.2014
    Сообщений
    317
    Записей в дневнике
    16
    Репутация: 4 Добавить или отнять репутацию

    По умолчанию

    Цитата Сообщение от Succubus Посмотреть сообщение
    PS: Вопрос по пункту 2 отменяется, обошлась.
    Ой... А я уже сделал версию, где это можно настраивать для скиллов. На всякий случай прилагаю тут.

    Что сделать, чтобы можно было приписывать урон скилам: https://pastee.org/e3csg. Код после изменений приведён ниже в сообщении.

    Я почти не тестировал эти изменения! Вроде бы оно работает, но могут быть всякие баги. Сообщайте о них сюда. Правда, изменений сравнительно мало, поэтому, надеюсь, ничего не сломается.

    Это изменение позволяет для умений использовать коды <convert...> и <anticonvert...>, но забирает возможность для умений использовать код <noconvert...>. Надеюсь, без него можно обойтись. Если он нужен, могу сделать, чтобы были все три кода для умений.

    Если преобразование урона установлено и для монстра, и для скилла, то урон суммируется.


    Вот сам код:
    Код:
    #==============================================================================
    # 
    # ▼ Yanfly Engine Ace - Convert Damage v1.02 with Skills hack
    # -- Last Updated: 2012.01.23 EDITED 2015-08-27
    # -- Level: Normal
    # -- Requires: n/a
    # 
    #==============================================================================
    
    $imported = {} if $imported.nil?
    $imported["YEA-ConvertDamage"] = true
    
    #==============================================================================
    # ▼ Updates
    # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
    # 2013.02.17 - Bug fixes.
    # 2012.01.23 - Compatibility Update: Doppelganger
    # 2011.12.21 - Started Script and Finished.
    # 
    #==============================================================================
    # ▼ Introduction
    # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
    # This script gives actors, classes, equipment, enemies, and states passive
    # convert damage HP/MP traits. By dealing physical or magical damage (dependant
    # on the type of attack), attackers may recover HP or MP depending on what
    # kinds of convert damage types they have.
    # 
    #==============================================================================
    # ▼ Instructions
    # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
    # To install this script, open up your script editor and copy/paste this script
    # to an open slot below ▼ Materials/素材 but above ▼ Main. Remember to save.
    # 
    # -----------------------------------------------------------------------------
    # Actor Notetags - These notetags go in the actors notebox in the database.
    # -----------------------------------------------------------------------------
    # <convert hp physical: +x%>
    # <convert hp physical: -x%>
    # Converts any physical damage dealt to recover HP by x% of the damage dealt.
    # Bonus converted damage rates are additive. There will be no effects if HP
    # to be healed is 0 or below.
    # 
    # <convert hp magical: +x%>
    # <convert hp magical: -x%>
    # Converts any magical damage dealt to recover HP by x% of the damage dealt.
    # Bonus converted damage rates are additive. There will be no effects if HP
    # to be healed is 0 or below.
    # 
    # <convert mp physical: +x%>
    # <convert mp physical: -x%>
    # Converts any physical damage dealt to recover MP by x% of the damage dealt.
    # Bonus converted damage rates are additive. There will be no effects if MP
    # to be healed is 0 or below.
    # 
    # <convert mp magical: +x%>
    # <convert mp magical: -x%>
    # Converts any magical damage dealt to recover MP by x% of the damage dealt.
    # Bonus converted damage rates are additive. There will be no effects if MP
    # to be healed is 0 or below.
    # 
    # <anticonvert hp physical>
    # <anticonvert hp magical>
    # <anticonvert mp physical>
    # <anticonvert mp magical>
    # Prevents attackers from converting damage of those particular types. All
    # converted recovery effects of that type will be reduced to 0.
    # 
    # -----------------------------------------------------------------------------
    # Class Notetags - These notetags go in the class notebox in the database.
    # -----------------------------------------------------------------------------
    # <convert hp physical: +x%>
    # <convert hp physical: -x%>
    # Converts any physical damage dealt to recover HP by x% of the damage dealt.
    # Bonus converted damage rates are additive. There will be no effects if HP
    # to be healed is 0 or below.
    # 
    # <convert hp magical: +x%>
    # <convert hp magical: -x%>
    # Converts any magical damage dealt to recover HP by x% of the damage dealt.
    # Bonus converted damage rates are additive. There will be no effects if HP
    # to be healed is 0 or below.
    # 
    # <convert mp physical: +x%>
    # <convert mp physical: -x%>
    # Converts any physical damage dealt to recover MP by x% of the damage dealt.
    # Bonus converted damage rates are additive. There will be no effects if MP
    # to be healed is 0 or below.
    # 
    # <convert mp magical: +x%>
    # <convert mp magical: -x%>
    # Converts any magical damage dealt to recover MP by x% of the damage dealt.
    # Bonus converted damage rates are additive. There will be no effects if MP
    # to be healed is 0 or below.
    # 
    # <anticonvert hp physical>
    # <anticonvert hp magical>
    # <anticonvert mp physical>
    # <anticonvert mp magical>
    # Prevents attackers from converting damage of those particular types. All
    # converted recovery effects of that type will be reduced to 0.
    # 
    # -----------------------------------------------------------------------------
    # Skill Notetags - These notetags go in the skills notebox in the database.
    # -----------------------------------------------------------------------------
    # <convert hp physical: +x%>
    # <convert hp physical: -x%>
    # Converts any physical damage dealt to recover HP by x% of the damage dealt.
    # Bonus converted damage rates are additive. There will be no effects if HP
    # to be healed is 0 or below.
    # 
    # <convert hp magical: +x%>
    # <convert hp magical: -x%>
    # Converts any magical damage dealt to recover HP by x% of the damage dealt.
    # Bonus converted damage rates are additive. There will be no effects if HP
    # to be healed is 0 or below.
    # 
    # <convert mp physical: +x%>
    # <convert mp physical: -x%>
    # Converts any physical damage dealt to recover MP by x% of the damage dealt.
    # Bonus converted damage rates are additive. There will be no effects if MP
    # to be healed is 0 or below.
    # 
    # <convert mp magical: +x%>
    # <convert mp magical: -x%>
    # Converts any magical damage dealt to recover MP by x% of the damage dealt.
    # Bonus converted damage rates are additive. There will be no effects if MP
    # to be healed is 0 or below.
    # 
    # <anticonvert hp physical>
    # <anticonvert hp magical>
    # <anticonvert mp physical>
    # <anticonvert mp magical>
    # Prevents attackers from converting damage of those particular types. All
    # converted recovery effects of that type will be reduced to 0.
    # 
    # -----------------------------------------------------------------------------
    # Item Notetags - These notetags go in the items notebox in the database.
    # -----------------------------------------------------------------------------
    # <no convert>
    # Prevents any kind of converted damage effects from being applied when this
    # item is used.
    # 
    # -----------------------------------------------------------------------------
    # Weapon Notetags - These notetags go in the weapons notebox in the database.
    # -----------------------------------------------------------------------------
    # <convert hp physical: +x%>
    # <convert hp physical: -x%>
    # Converts any physical damage dealt to recover HP by x% of the damage dealt.
    # Bonus converted damage rates are additive. There will be no effects if HP
    # to be healed is 0 or below.
    # 
    # <convert hp magical: +x%>
    # <convert hp magical: -x%>
    # Converts any magical damage dealt to recover HP by x% of the damage dealt.
    # Bonus converted damage rates are additive. There will be no effects if HP
    # to be healed is 0 or below.
    # 
    # <convert mp physical: +x%>
    # <convert mp physical: -x%>
    # Converts any physical damage dealt to recover MP by x% of the damage dealt.
    # Bonus converted damage rates are additive. There will be no effects if MP
    # to be healed is 0 or below.
    # 
    # <convert mp magical: +x%>
    # <convert mp magical: -x%>
    # Converts any magical damage dealt to recover MP by x% of the damage dealt.
    # Bonus converted damage rates are additive. There will be no effects if MP
    # to be healed is 0 or below.
    # 
    # <anticonvert hp physical>
    # <anticonvert hp magical>
    # <anticonvert mp physical>
    # <anticonvert mp magical>
    # Prevents attackers from converting damage of those particular types. All
    # converted recovery effects of that type will be reduced to 0.
    # 
    # -----------------------------------------------------------------------------
    # Armour Notetags - These notetags go in the armours notebox in the database.
    # -----------------------------------------------------------------------------
    # <convert hp physical: +x%>
    # <convert hp physical: -x%>
    # Converts any physical damage dealt to recover HP by x% of the damage dealt.
    # Bonus converted damage rates are additive. There will be no effects if HP
    # to be healed is 0 or below.
    # 
    # <convert hp magical: +x%>
    # <convert hp magical: -x%>
    # Converts any magical damage dealt to recover HP by x% of the damage dealt.
    # Bonus converted damage rates are additive. There will be no effects if HP
    # to be healed is 0 or below.
    # 
    # <convert mp physical: +x%>
    # <convert mp physical: -x%>
    # Converts any physical damage dealt to recover MP by x% of the damage dealt.
    # Bonus converted damage rates are additive. There will be no effects if MP
    # to be healed is 0 or below.
    # 
    # <convert mp magical: +x%>
    # <convert mp magical: -x%>
    # Converts any magical damage dealt to recover MP by x% of the damage dealt.
    # Bonus converted damage rates are additive. There will be no effects if MP
    # to be healed is 0 or below.
    # 
    # <anticonvert hp physical>
    # <anticonvert hp magical>
    # <anticonvert mp physical>
    # <anticonvert mp magical>
    # Prevents attackers from converting damage of those particular types. All
    # converted recovery effects of that type will be reduced to 0.
    # 
    # -----------------------------------------------------------------------------
    # Enemy Notetags - These notetags go in the enemies notebox in the database.
    # -----------------------------------------------------------------------------
    # <convert hp physical: +x%>
    # <convert hp physical: -x%>
    # Converts any physical damage dealt to recover HP by x% of the damage dealt.
    # Bonus converted damage rates are additive. There will be no effects if HP
    # to be healed is 0 or below.
    # 
    # <convert hp magical: +x%>
    # <convert hp magical: -x%>
    # Converts any magical damage dealt to recover HP by x% of the damage dealt.
    # Bonus converted damage rates are additive. There will be no effects if HP
    # to be healed is 0 or below.
    # 
    # <convert mp physical: +x%>
    # <convert mp physical: -x%>
    # Converts any physical damage dealt to recover MP by x% of the damage dealt.
    # Bonus converted damage rates are additive. There will be no effects if MP
    # to be healed is 0 or below.
    # 
    # <convert mp magical: +x%>
    # <convert mp magical: -x%>
    # Converts any magical damage dealt to recover MP by x% of the damage dealt.
    # Bonus converted damage rates are additive. There will be no effects if MP
    # to be healed is 0 or below.
    # 
    # <anticonvert hp physical>
    # <anticonvert hp magical>
    # <anticonvert mp physical>
    # <anticonvert mp magical>
    # Prevents attackers from converting damage of those particular types. All
    # converted recovery effects of that type will be reduced to 0.
    # 
    # -----------------------------------------------------------------------------
    # State Notetags - These notetags go in the states notebox in the database.
    # -----------------------------------------------------------------------------
    # <convert hp physical: +x%>
    # <convert hp physical: -x%>
    # Converts any physical damage dealt to recover HP by x% of the damage dealt.
    # Bonus converted damage rates are additive. There will be no effects if HP
    # to be healed is 0 or below.
    # 
    # <convert hp magical: +x%>
    # <convert hp magical: -x%>
    # Converts any magical damage dealt to recover HP by x% of the damage dealt.
    # Bonus converted damage rates are additive. There will be no effects if HP
    # to be healed is 0 or below.
    # 
    # <convert mp physical: +x%>
    # <convert mp physical: -x%>
    # Converts any physical damage dealt to recover MP by x% of the damage dealt.
    # Bonus converted damage rates are additive. There will be no effects if MP
    # to be healed is 0 or below.
    # 
    # <convert mp magical: +x%>
    # <convert mp magical: -x%>
    # Converts any magical damage dealt to recover MP by x% of the damage dealt.
    # Bonus converted damage rates are additive. There will be no effects if MP
    # to be healed is 0 or below.
    # 
    # <anticonvert hp physical>
    # <anticonvert hp magical>
    # <anticonvert mp physical>
    # <anticonvert mp magical>
    # Prevents attackers from converting damage of those particular types. All
    # converted recovery effects of that type will be reduced to 0.
    # 
    #==============================================================================
    # ▼ Compatibility
    # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
    # This script is made strictly for RPG Maker VX Ace. It is highly unlikely that
    # it will run with RPG Maker VX without adjusting.
    # 
    # For maximum compatibility with Yanfly Engine Ace - Ace Battle Engine, place
    # this script under Ace Battle Engine.
    # 
    #==============================================================================
    
    module YEA
      module CONVERT_DAMAGE
        
        #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
        # - Limit Settings -
        #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
        # Adjust the maximum converted damage rate for dealing damage (so that an
        # attacker cannot gain huge amounts of recovery).
        #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
        MAXIMUM_RATE = 1.0   # Maximum gain from dealing damage.
        
      end # CONVERT_DAMAGE
    end # YEA
    
    #==============================================================================
    # ▼ Editting anything past this point may potentially result in causing
    # computer damage, incontinence, explosion of user's head, coma, death, and/or
    # halitosis so edit at your own risk.
    #==============================================================================
    
    module YEA
      module REGEXP
      module BASEITEM
        
        CONVERT_DMG = /<(?:CONVERT|convert)[ ](.*)[ ](.*):[ ]([\+\-]\d+)([%%])>/i
        ANTICONVERT = /<(?:ANTI_CONVERT|anti convert|anticonvert)[ ](.*)[ ](.*)>/i
        
      end # BASEITEM
      module USABLEITEM
        
        NO_CONVERT = /<(?:NO_CONVERT|no convert)>/i
        
      end # USABLEITEM
      end # REGEXP
    end # YEA
    
    #==============================================================================
    # ■ DataManager
    #==============================================================================
    
    module DataManager
      
      #--------------------------------------------------------------------------
      # alias method: load_database
      #--------------------------------------------------------------------------
      class <<self; alias load_database_convertdmg load_database; end
      def self.load_database
        load_database_convertdmg
        load_notetags_convertdmg
      end
      
      #--------------------------------------------------------------------------
      # new method: load_notetags_convertdmg
      #--------------------------------------------------------------------------
      def self.load_notetags_convertdmg
        groups = [$data_actors, $data_classes, $data_weapons, $data_armors,
          $data_enemies, $data_states, $data_skills, $data_items]
        for group in groups
          for obj in group
            next if obj.nil?
            obj.load_notetags_convertdmg
          end
        end
      end
      
    end # DataManager
    
    #==============================================================================
    # ■ RPG::BaseItem
    #==============================================================================
    
    class RPG::BaseItem
      
      #--------------------------------------------------------------------------
      # public instance variables
      #--------------------------------------------------------------------------
      attr_accessor :convert_dmg
      attr_accessor :anticonvert
      
      #--------------------------------------------------------------------------
      # common cache: load_notetags_convertdmg
      #--------------------------------------------------------------------------
      def load_notetags_convertdmg
        @convert_dmg ={
          :hp_physical => 0.0,
          :hp_magical  => 0.0,
          :mp_physical => 0.0,
          :mp_magical  => 0.0,
        } # Do not remove this.
        @anticonvert = []
        #---
        self.note.split(/[\r\n]+/).each { |line|
          case line
          #---
          when YEA::REGEXP::BASEITEM::CONVERT_DMG
            case $1.upcase
            when "HP"
              case $2.upcase
              when "PHYSICAL"; type = :hp_physical
              when "MAGICAL";  type = :hp_magical
              else; next
              end
            when "MP"
              case $2.upcase
              when "PHYSICAL"; type = :mp_physical
              when "MAGICAL";  type = :mp_magical
              else; next
              end
            else; next
            end
            @convert_dmg[type] = $3.to_i * 0.01
          #---
          when YEA::REGEXP::BASEITEM::ANTICONVERT
            case $1.upcase
            when "HP"
              case $2.upcase
              when "PHYSICAL"; type = :hp_physical
              when "MAGICAL";  type = :hp_magical
              else; next
              end
            when "MP"
              case $2.upcase
              when "PHYSICAL"; type = :mp_physical
              when "MAGICAL";  type = :mp_magical
              else; next
              end
            else; next
            end
            @anticonvert.push(type)
          #---
          end
        } # self.note.split
        #---
      end
      
    end # RPG::BaseItem
    
    #==============================================================================
    # ■ RPG::Item
    #==============================================================================
    
    class RPG::Item < RPG::UsableItem
      
      #--------------------------------------------------------------------------
      # public instance variables
      #--------------------------------------------------------------------------
      attr_accessor :no_convert
      
      #--------------------------------------------------------------------------
      # common cache: load_notetags_convertdmg
      #--------------------------------------------------------------------------
      def load_notetags_convertdmg
        #---
        self.note.split(/[\r\n]+/).each { |line|
          case line
          #---
          when YEA::REGEXP::USABLEITEM::NO_CONVERT
            @no_convert = true
          #---
          end
        } # self.note.split
        #---
      end
      
    end # RPG::Item
    
    #==============================================================================
    # ■ Game_BattlerBase
    #==============================================================================
    
    class Game_BattlerBase
      
      #--------------------------------------------------------------------------
      # new method: convert_dmg_rate
      #--------------------------------------------------------------------------
      def convert_dmg_rate(type)
        n = 0.0
        if actor?
          n += self.actor.convert_dmg[type]
          n += self.class.convert_dmg[type]
          for equip in equips
            next if equip.nil?
            n += equip.convert_dmg[type]
          end
        else
          n += self.enemy.convert_dmg[type]
          if $imported["YEA-Doppelganger"] && !self.class.nil?
            n += self.class.convert_dmg[type]
          end
        end
        skill = self.current_action.item
        if skill.is_a?(RPG::Skill) and not skill.convert_dmg.nil? then
          n += skill.convert_dmg[type]
        end
        for state in states
          next if state.nil?
          n += state.convert_dmg[type]
        end
        max_rate = YEA::CONVERT_DAMAGE::MAXIMUM_RATE
        return [[n, max_rate].min, -max_rate].max
      end
      
      #--------------------------------------------------------------------------
      # new method: anti_convert?
      #--------------------------------------------------------------------------
      def anti_convert?(type)
        if actor?
          return true if self.actor.anticonvert.include?(type)
          return true if self.class.anticonvert.include?(type)
          for equip in equips
            next if equip.nil?
            return true if equip.anticonvert.include?(type)
          end
        else
          return true if self.enemy.anticonvert.include?(type)
        end
        for state in states
          next if state.nil?
          return true if state.anticonvert.include?(type)
        end
        return false
      end
      
    end # Game_BattlerBase
    
    #==============================================================================
    # ■ Game_Battler
    #==============================================================================
    
    class Game_Battler < Game_BattlerBase
      
      #--------------------------------------------------------------------------
      # alias method: execute_damage
      #--------------------------------------------------------------------------
      alias game_battler_execute_damage_convertdmg execute_damage
      def execute_damage(user)
        apply_vampire_effects(user)
        game_battler_execute_damage_convertdmg(user)
      end
      
      #--------------------------------------------------------------------------
      # new method: apply_vampire_effect
      #--------------------------------------------------------------------------
      def apply_vampire_effects(user)
        return unless $game_party.in_battle
        return unless @result.hp_damage > 0 || @result.mp_damage > 0
        return if user.current_action.nil?
        action = user.current_action.item
        if action.is_a?(RPG::Item) then
          return if action.no_convert
        end
        apply_convert_physical_effect(user) if action.physical?
        apply_convert_magical_effect(user) if action.magical?
      end
      
      #--------------------------------------------------------------------------
      # new method: apply_convert_physical_effect
      #--------------------------------------------------------------------------
      def apply_convert_physical_effect(user)
        hp_rate = user.convert_dmg_rate(:hp_physical)
        hp_rate = 0 if anti_convert?(:hp_physical)
        hp_healed = (@result.hp_damage * hp_rate).to_i
        mp_rate = user.convert_dmg_rate(:mp_physical)
        mp_rate = 0 if anti_convert?(:mp_physical)
        mp_healed = (@result.mp_damage * mp_rate).to_i
        if hp_healed != 0
          user.hp += hp_healed
          make_ace_battle_engine_convert_hp_popup(user, hp_healed)
        end
        if mp_healed != 0
          user.mp += mp_healed
          make_ace_battle_engine_convert_mp_popup(user, mp_healed)
        end
      end
      
      #--------------------------------------------------------------------------
      # new method: apply_convert_magical_effect
      #--------------------------------------------------------------------------
      def apply_convert_magical_effect(user)
        hp_rate = user.convert_dmg_rate(:hp_magical)
        hp_rate = 0 if anti_convert?(:hp_magical)
        hp_healed = (@result.hp_damage * hp_rate).to_i
        mp_rate = user.convert_dmg_rate(:mp_magical)
        mp_rate = 0 if anti_convert?(:mp_magical)
        mp_healed = (@result.mp_damage * mp_rate).to_i
        if hp_healed != 0
          user.hp += hp_healed
          make_ace_battle_engine_convert_hp_popup(user, hp_healed)
        end
        if mp_healed != 0
          user.mp += mp_healed
          make_ace_battle_engine_convert_mp_popup(user, mp_healed)
        end
      end
      
      #--------------------------------------------------------------------------
      # new method: make_ace_battle_engine_convert_hp_popup
      #--------------------------------------------------------------------------
      def make_ace_battle_engine_convert_hp_popup(user, hp_healed)
        return unless $imported["YEA-BattleEngine"]
        setting = hp_healed > 0 ? :hp_heal : :hp_dmg
        rules = hp_healed > 0 ? "HP_HEAL" : "HP_DMG"
        value = hp_healed.abs
        text = sprintf(YEA::BATTLE::POPUP_SETTINGS[setting], value.group)
        user.create_popup(text, rules)
      end
      
      #--------------------------------------------------------------------------
      # new method: make_ace_battle_engine_convert_mp_popup
      #--------------------------------------------------------------------------
      def make_ace_battle_engine_convert_mp_popup(user, mp_healed)
        return unless $imported["YEA-BattleEngine"]
        setting = mp_healed > 0 ? :mp_heal : :mp_dmg
        rules = mp_healed > 0 ? "MP_HEAL" : "MP_DMG"
        value = mp_healed.abs
        text = sprintf(YEA::BATTLE::POPUP_SETTINGS[setting], value.group)
        user.create_popup(text, rules)
      end
      
    end # Game_Battler
    
    #==============================================================================
    # 
    # ▼ End of File
    # 
    #==============================================================================
    «quī legis ista, tuam reprehendō, mea laudās // omnia, stultitiam; / nihil, invidiam» (Jōhannis Audoenī)
    'Ты, кто читает это: я порицаю, если ты хвалишь у меня // всё, твою глупость; / если ничего — твою злобу.' (Джон Оуэн)

  7. #7
    Администратор Аватар для Пётр
    Информация о пользователе
    Регистрация
    24.04.2014
    Адрес
    Краснодар
    Сообщений
    3,940
    Записей в дневнике
    6
    Репутация: 132 Добавить или отнять репутацию

    По умолчанию

    Зачетное обсуждение!
    Много нужных правок и подсказок.
    Пока никто не видит, перетащил в Скрипты.

  8. #8

    По умолчанию

    2 Deme
    Спасибо, но, наверное, не стоило тратить из-за меня время и переписывать скрипт, т.к вампирский моб удался в обход проблеме ( А с другой стороны, исправленный скрипт может помочь кому-то еще, да и я обязательно зарезервирую его для теоретического продолжения. Очень много интересных идей можно реализовать с его помощью.

  9. #9

    По умолчанию

    Печаль...

    Обнаружен серьезный баг.
    Если затеять драку с врагом, способному к контратаке, а затем нажать стрелку право(влево?), то при каждом ударе по герою игра имеет высокий шанс вылететь с сообщением:

    Script ‘Convert Damage’ line 507: NoMethodError occurred.

    undefined method ‘no_convert’ for nil:NilClass

    Говорят это проявляется на YA - Battle Engine, но косяк именно в скрипте "Convert Damage".

  10. #10
    Познающий Аватар для Deme
    Информация о пользователе
    Регистрация
    16.05.2014
    Сообщений
    317
    Записей в дневнике
    16
    Репутация: 4 Добавить или отнять репутацию

    По умолчанию

    У меня сейчас Windows под рукой нет, но попробуйте перед строчкой 507:

    return if action.no_convert

    добавить вот такую строчку:

    return if action.nil?

    То есть чтобы метод apply_vampire_effects принял такой вид:
    Код:
      def apply_vampire_effects(user)
        return unless $game_party.in_battle
        return unless @result.hp_damage > 0 || @result.mp_damage > 0
        return if user.current_action.nil?
        action = user.current_action.item
        return if action.nil?   # ← ЭТУ СТРОЧКУ МЫ ДОБАВИЛИ
        return if action.no_convert
        apply_convert_physical_effect(user) if action.physical?
        apply_convert_magical_effect(user) if action.magical?
      end
    Может быть поможет. Если не поможет, то я завтра поразбираюсь.
    Последний раз редактировалось Deme; 02.09.2015 в 02:28.
    «quī legis ista, tuam reprehendō, mea laudās // omnia, stultitiam; / nihil, invidiam» (Jōhannis Audoenī)
    'Ты, кто читает это: я порицаю, если ты хвалишь у меня // всё, твою глупость; / если ничего — твою злобу.' (Джон Оуэн)

Страница 1 из 2 12 ПоследняяПоследняя

Информация о теме

Пользователи, просматривающие эту тему

Эту тему просматривают: 1 (пользователей: 0 , гостей: 1)

Метки этой темы

Социальные закладки

Социальные закладки

Ваши права

  • Вы не можете создавать новые темы
  • Вы не можете отвечать в темах
  • Вы не можете прикреплять вложения
  • Вы не можете редактировать свои сообщения
  •  
Yanfly - Convert Damage