Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

translation or where to put the skill ids and status ids.

Ive just been able to get this KGC script to be compatible with my other scripts.
But I am now asking if there are any good scripters out there that would be able to tell me where to put
the skill ids and status id so that the script will take effect.

here is the script
#_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
#_/  ◆条件付きスキル - KGC_ConditionalSkill◆
#_/----------------------------------------------------------------------------
#_/ スキルに特殊な使用条件を追加します。
#_/  Adding special requirements to skills.
#_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/

$imported = {} if $imported == nil
$imported["ConditionalSkill"] = true

if $game_special_elements == nil
  $game_special_elements = {}
  $data_system = load_data("Data/System.rxdata")
end
# 使用条件属性
$game_special_elements["skill_condition"] =
  /スキル条件([AHSW])[ ]*((?:[+\-]?\d+[ ]*(?:,)?[ ]*)+)([A])?/i

#==============================================================================
# ■ Game_Actor, Game_Enemy 共用モジュール
#==============================================================================

module KGC_Game_AE
  #--------------------------------------------------------------------------
  # ● スキルの使用可能判定
  #--------------------------------------------------------------------------
  if defined?(skill_can_use?) && !@_skill_can_use_conditionalskill
    alias skill_can_use_KGC_ConditionalSkill? skill_can_use?
  else
    @_skill_can_use_conditionalskill = true
  end
  def skill_can_use?(skill_id)
    result = true
    # 使用条件確認
    $data_skills[skill_id].element_set.compact.each { |element|
      if $game_special_elements["skill_condition"] =~ $data_system.elements[element]
        result &= judge_skill_requirement($1.upcase, $2, $3 == "A" || $3 == "a")
      end
    }
    if defined?(skill_can_use_KGC_ConditionalSkill?)
      return result & skill_can_use_KGC_ConditionalSkill?(skill_id)
    else
      return result & super
    end
  end
  #--------------------------------------------------------------------------
  # ● 条件処理
  #    type  : 条件形式
  #    string : 条件文字列
  #    all    : 全条件判定
  #--------------------------------------------------------------------------
  def judge_skill_requirement(type, string, all)
    result = all
    conditions = (string.gsub(/ /) {""}).split(/,/)
    case type
    when "H"  # HP
      conditions.each { |c|
        if c =~ /([+\-])?(\d+)/
          result2 = true
          if $1 != "-"  # HP○%以上
            result2 = false if self.hp * 100 / self.maxhp < $2.to_i
          else  # HP○%以下
            result2 = false if self.hp * 100 / self.maxhp > $2.to_i
          end
          if all
            result &= result2
          else
            result |= result2
          end
        end
      }
    when "W"  # 武器
      if self.is_a?(Game_Actor)
        # 装備武器を取得
        if $imported["EquipExtension"]
          if self.two_swords?
            weapons = []
            (0...self.ts_number).each { |i|
              weapons << self.weapon_id(i)
            }
          else
            weapons = [self.weapon_id]
          end
        else
          weapons = [@weapon_id]
        end
        conditions.each { |c|
          if c =~ /([+\-])?(\d+)/
            result2 = true
            # "-"で装備している、または"+"で装備していない場合は使用不可
            if ($1 == "-" && weapons.include?($2.to_i)) ||
                ($1 != "-" && !weapons.include?($2.to_i))
              result2 = false
            end
            if all
              result &= result2
            else
              result |= result2
            end
          end
        }
      end
    when "A"  # 防具
      if self.is_a?(Game_Actor)
        # 装備防具を取得
        armors = []
        (1...($imported["EquipExtension"] ? self.equip_type.size : 5)).each {|i|
          armors = ($imported["EquipExtension"] ? self.armor_id : eval("@armor#{i}_id"))
        }
        conditions.each { |c|
          if c =~ /([+\-])?(\d+)/
            result2 = true
            # "-"で装備している、または"+"で装備していない場合は使用不可
            if ($1 == "-" && armors.include?($2.to_i)) ||
                ($1 != "-" && !armors.include?($2.to_i))
              result2 = false
            end
            if all
              result &= result2
            else
              result |= result2
            end
          end
        }
      end
    when "S"  # ステート
      conditions.each { |c|
        if c =~ /([+\-])?(\d+)/
          result2 = true
          # "-"でステートにかかっている、または"+"でかかっていない場合は使用不可
          if ($1 == "-" && self.state?($2.to_i)) ||
              ($1 != "-" && !self.state?($2.to_i))
            result2 = false
          end
          if all
            result &= result2
          else
            result |= result2
          end
        end
      }
    end
    return result
  end
end

#==============================================================================
# â–  Game_Actor
#==============================================================================

class Game_Actor
  include KGC_Game_AE
end

#==============================================================================
# â–  Game_Enemy
#==============================================================================

class Game_Enemy
  include KGC_Game_AE
end


and here is the link to the script:

http://f44.aaa.livedoor.jp/~ytomy/tkool/rpgtech/tech_xp/skill/conditional_skill_xp.html

I am in no way advertising this website it is just there for additional information for people try to help me out.
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top