设为首页收藏本站|繁體中文

Project1

 找回密码
 注册会员
搜索
查看: 2165|回复: 1
打印 上一主题 下一主题

[已经解决] 请问VA随机技能怎么设置啊

[复制链接]

Lv1.梦旅人

梦石
0
星屑
85
在线时间
26 小时
注册时间
2014-12-3
帖子
13
跳转到指定楼层
1
发表于 2014-12-7 09:28:24 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式

加入我们,或者,欢迎回来。

您需要 登录 才可以下载或查看,没有帐号?注册会员

x
本帖最后由 wy155059181 于 2014-12-7 09:29 编辑

#==============================================================================
#
# ▼ Yanfly Engine Ace - Random Skill Invoke v1.00
# -- Last Updated: 2011.12.17
# -- Level: Normal, Hard
# -- Requires: n/a
#
#==============================================================================

$imported = {} if $imported.nil?
$imported["YEA-RandomSkillInvoke"] = true

#==============================================================================
# ▼ Updates
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# 2011.12.17 - Started Script and Finished.
#
#==============================================================================
# ▼ Introduction
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# This script grants the option, that when designated skills with random
# invokes are used, they have the ability to result in other skills (within the
# skill's designated random pool). Only valid skills are capable of being used
# (meaning that they must meet the conditions to be used).
#
#==============================================================================
# ▼ 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.
#
# -----------------------------------------------------------------------------
# Skill Notetags - These notetags go in the skills notebox in the database.
# -----------------------------------------------------------------------------
# <random invoke: x>
# <random invoke: x, x>
# This adds skill x to the random invoke pool (which includes the base skill
# itself, too). When the base skill is used, it will random select from all of
# the skills within the random invoke pool and use one. Only skills that meet
# the requirements of being used can be selected (meaning the battler must have
# sufficient MP costs, TP costs, no states that seal it, etc.). Multiples of
# this tag may be used to add more skills, and multiples of the same skill may
# be added to the random invoke pool.
#
#==============================================================================
# ▼ 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.
#
#==============================================================================
# ▼ 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 SKILL
   
    RANDOM_INVOKE =
      /<(?:RANDOM_INVOKE|random invoke):[ ]*(\d+(?:\s*,\s*\d+)*)>/i
   
  end # SKILL
  end # REGEXP
end # YEA

#==============================================================================
# ■ DataManager
#==============================================================================

module DataManager
  
  #--------------------------------------------------------------------------
  # alias method: load_database
  #--------------------------------------------------------------------------
  class <<self; alias load_database_rsi load_database; end
  def self.load_database
    load_database_rsi
    load_notetags_rsi
  end
  
  #--------------------------------------------------------------------------
  # new method: load_notetags_rsi
  #--------------------------------------------------------------------------
  def self.load_notetags_rsi
    for skill in $data_skills
      next if skill.nil?
      skill.load_notetags_rsi
    end
  end
  
end # DataManager

#==============================================================================
# ■ RPG::Skill
#==============================================================================

class RPG::Skill < RPG::UsableItem
  
  #--------------------------------------------------------------------------
  # public instance variables
  #--------------------------------------------------------------------------
  attr_accessor :random_invoke
  
  #--------------------------------------------------------------------------
  # common cache: load_notetags_rsi
  #--------------------------------------------------------------------------
  def load_notetags_rsi
    @random_invoke = []
    #---
    self.note.split(/[\r\n]+/).each { |line|
      case line
      #---
      when YEA::REGEXP::SKILL::RANDOM_INVOKE
        $1.scan(/\d+/).each { |num|
        @random_invoke.push(num.to_i) if num.to_i > 0 }
      #---
      end
    } # self.note.split
    #---
  end
  
end # RPG::Weapon

#==============================================================================
# ■ Game_Battler
#==============================================================================

class Game_Battler < Game_BattlerBase
  
  #--------------------------------------------------------------------------
  # new method: invoke_random_skill
  #--------------------------------------------------------------------------
  def invoke_random_skill
    return unless current_action.item.is_a?(RPG::Skill)
    valid_skills = [current_action.item]
    for random_skill_id in current_action.item.random_invoke
      next unless usable?($data_skills[random_skill_id])
      valid_skills.push($data_skills[random_skill_id])
    end
    skill_id = valid_skills.sample.id
    current_action.set_skill(skill_id)
  end
  
end # Game_Battler

#==============================================================================
# ■ Scene_Battle
#==============================================================================

class Scene_Battle < Scene_Base
  
  #--------------------------------------------------------------------------
  # alias method: use_item
  #--------------------------------------------------------------------------
  alias scene_battle_use_item_rsi use_item
  def use_item
    @subject.invoke_random_skill
    scene_battle_use_item_rsi
  end
  
end # Scene_Battle

#==============================================================================
#
# ▼ End of File
#
#==============================================================================
http://6rweb.sinaapp.com/articles/5129
76.随即技能系统(来自Yanfly Engine Ace)
使用此脚本可以在角色在战斗中使用过一个技能后继续释放你所设置的随即一个技能。比如,我们设置了一个技能,在此备注中设置了(X,Y为技能编号),那么,使用了这个技能后,系统会自动随机选取x,y其中一个技能来释放。大概就是这个意思了。

是我哪里设置错了吗 用技能的时候不随机出30 31编号技能

图1.jpg (163.71 KB, 下载次数: 28)

图1.jpg

点评

不是要用<random invoke: x>/<random invoke: x, x>麼?  发表于 2014-12-7 09:33

Lv1.梦旅人

梦石
0
星屑
85
在线时间
26 小时
注册时间
2014-12-3
帖子
13
2
 楼主| 发表于 2014-12-7 09:41:07 | 只看该作者
哎呀 确实是这样 太感谢你了啊。
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

拿上你的纸笔,建造一个属于你的梦想世界,加入吧。
 注册会员
找回密码

站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作

GMT+8, 2024-11-15 09:04

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表