"终末之冬(敌)" => ["一步向前移动","技能变身","30","终末之冬","90","终末之冬 杀",
"60","对象动画","60","击倒许可","还原变身","坐标初始化"],
#-------------------------------------------------------------------------------
"完毕" => ["完毕"]}
end
#==============================================================================
# ■ Game_Actor
#------------------------------------------------------------------------------
# 设定主人公的基本动作类
#==============================================================================
class Game_Actor < Game_Battler
#--------------------------------------------------------------------------
# ● 从主人公ID中确定空手时的动作(无武器时)
#--------------------------------------------------------------------------
# when 1 ←这个数字是主人公ID
# return "通常攻击" ←填入对应的连贯动作名
def non_weapon
case @actor_id
when 1
return "通常攻击"
end
# 上述主人公ID以外的其他主人公全部使用的连贯动作名
return "通常攻击"
end
#--------------------------------------------------------------------------
# ● 通常待机
#--------------------------------------------------------------------------
def normal
case @actor_id
when 1
return "待机"
end
# 上述主人公ID以外的其他主人公全部使用的连贯动作名
return "待机"
end
#--------------------------------------------------------------------------
# ● 危急(HP1/4以下)
#--------------------------------------------------------------------------
def pinch
case @actor_id
when 1
return "危急待机"
end
# 上述主人公ID以外的其他主人公全部使用的连贯动作名
return "危急待机"
end
#--------------------------------------------------------------------------
# ● 防御
#--------------------------------------------------------------------------
def defence
case @actor_id
when 1
return "防御"
end
# 上述主人公ID以外的其他主人公全部使用的连贯动作名
return "防御"
end
#--------------------------------------------------------------------------
# ● 伤害 对象动画時、取得命中时的动作
#--------------------------------------------------------------------------
def damage_hit
case @actor_id
when 1
return "伤害"
end
# 上述主人公ID以外的其他主人公全部使用的连贯动作名
return "伤害"
end
#--------------------------------------------------------------------------
# ● 回避 对象动画時、取得沒命中时的动作
#--------------------------------------------------------------------------
def evasion
case @actor_id
when 1
return "友方回避"
end
# 上述主人公ID以外的其他主人公全部使用的连贯动作名
return "友方回避"
end
#--------------------------------------------------------------------------
# ● 选择指令前動作
#--------------------------------------------------------------------------
def command_b
case @actor_id
when 1
return "选择指令"
end
# 上述主人公ID以外的其他主人公全部使用的连贯动作名
return "选择指令"
end
#--------------------------------------------------------------------------
# ● 选择指令后動作
#--------------------------------------------------------------------------
def command_a
case @actor_id
when 1
return "选择指令后"
end
# 上述主人公ID以外的其他主人公全部使用的连贯动作名
return "选择指令后"
end
#--------------------------------------------------------------------------
# ● 逃走成功
#--------------------------------------------------------------------------
def run_success
case @actor_id
when 1
return "逃走"
end
# 上述主人公ID以外的其他主人公全部使用的连贯动作名
return "逃走"
end
#--------------------------------------------------------------------------
# ● 逃走失败
#--------------------------------------------------------------------------
def run_ng
case @actor_id
when 1
return "逃走失败"
end
# 上述主人公ID以外的其他主人公全部使用的连贯动作名
return "逃走失败"
end
#--------------------------------------------------------------------------
# ● 胜利
#--------------------------------------------------------------------------
def win
case @actor_id
when 1
return "胜利"
end
# 上述主人公ID以外的其他主人公全部使用的连贯动作名
return "胜利"
end
#--------------------------------------------------------------------------
# ● 进入战斗时的动作
#--------------------------------------------------------------------------
def first_action
case @actor_id
when 1
return "战斗开始"
end
# 上述主人公ID以外的其他主人公全部使用的连贯动作名
return "战斗开始"
end
#--------------------------------------------------------------------------
# ● 动作被中断时的恢复动作
#--------------------------------------------------------------------------
def recover_action
case @actor_id
when 1
return "坐标复原"
end
# 上述主人公ID以外的其他主人公全部使用的连贯动作名
return "坐标复原"
end
#--------------------------------------------------------------------------
# ● 影图像 在人物行走图文件夹中读取
#--------------------------------------------------------------------------
# return "shadow00" ←在这里填入想要设定的话像文件名
def shadow
case @actor_id
when 1
return "shadow00"
end
# 上述主人公ID以外的其他主人公全部使用的影图像
return "shadow00"
end
#--------------------------------------------------------------------------
# ● 略微调整影图像的位置
#--------------------------------------------------------------------------
# return [横坐标, 縦坐标]
def shadow_plus
case @actor_id
when 1
return [ 0, 4]
end
# 上述主人公ID以外的其他主人公全部使用的位置
return [ 0, 4]
end
end
#==============================================================================
# ■ Game_Enemy
#------------------------------------------------------------------------------
# 敌方的基本动作设定
#==============================================================================
class Game_Enemy < Game_Battler
#--------------------------------------------------------------------------
# ● 从敌方ID来确定未装备武器时的通常攻击动作
#--------------------------------------------------------------------------
# when 1 ←这里的数字是敌方ID编号
# return "敌方无武器的攻击" ←请填入对应的连贯动作名
def base_action
case @enemy_id
when 1
return "敌方无武器的攻击"
end
# 上述敌方ID以外的其他敌方队员全部使用的武器ID动作
return "敌方无武器的攻击"
end
#--------------------------------------------------------------------------
# ● 通常待机
#--------------------------------------------------------------------------
def normal
case @enemy_id
when 1
return "待机"
end
# 上述敌方ID以外的其他敌方队员全部使用的武器ID动作
return "待机"
end
#--------------------------------------------------------------------------
# ● 危急(HP1/4以下)
#--------------------------------------------------------------------------
def pinch
case @enemy_id
when 1
return "待机"
end
# 上述敌方ID以外的其他敌方队员全部使用的武器ID动作
return "待机"
end
#--------------------------------------------------------------------------
# ● 防御
#--------------------------------------------------------------------------
def defence
case @enemy_id
when 1
return "防御"
end
# 上述敌方ID以外的其他敌方队员全部使用的武器ID动作
return "防御"
end
#--------------------------------------------------------------------------
# ● 伤害 对象动画時、取得命中时的动作
#--------------------------------------------------------------------------
def damage_hit
case @enemy_id
when 1
return "伤害"
end
# 上述敌方ID以外的其他敌方队员全部使用的武器ID动作
return "敌伤害"
end
#--------------------------------------------------------------------------
# ● 回避 对象动画時、取得未命中时的动作
#--------------------------------------------------------------------------
def evasion
case @enemy_id
when 1
return "敌方回避"
end
# 上述敌方ID以外的其他敌方队员全部使用的武器ID动作
return "敌方回避"
end
#--------------------------------------------------------------------------
# ● 逃走
#--------------------------------------------------------------------------
def run_success
case @enemy_id
when 1
return "敌方逃走"
end
# 上述敌方ID以外的其他敌方队员全部使用的武器ID动作
return "敌方逃走"
end
#--------------------------------------------------------------------------
# ● 进入战斗时的动作
#--------------------------------------------------------------------------
def first_action
case @enemy_id
when 1
return "战斗开始"
end
# 上述敌方ID以外的其他敌方队员全部使用的武器ID动作
return "战斗开始"
end
#--------------------------------------------------------------------------
# ● 动作被中断时的恢复动作
#--------------------------------------------------------------------------
def recover_action
case @enemy_id
when 1
return "坐标复原"
end
# 上述敌方ID以外的其他敌方队员全部使用的武器ID动作
return "坐标复原"
end
#--------------------------------------------------------------------------
# ● 影图像 在人物行走图文件夹中读取
#--------------------------------------------------------------------------
# return "shadow01" ←在这里填入想要设定的话像文件名。
def shadow
case @enemy_id
when 1
return "shadow01"
when 30
return ""
end
# 上述敌方ID以外的其他敌方队员全部使用的武器ID影图像
return "shadow01"
end
#--------------------------------------------------------------------------
# ● 略微调整影图像的位置
#--------------------------------------------------------------------------
# return [横坐标, 縦坐标]
def shadow_plus
case @enemy_id
when 3
return [ 0, -8]
when 301 # 索妮娅
return [ 0, 8]
end
# 上述敌方ID以外的其他敌方队员全部使用的武器ID位置
return [ 0, 0]
end
#--------------------------------------------------------------------------
# ● 敌方武器设定 在动作和动画时,武器也被显示。
#--------------------------------------------------------------------------
# return 1 ←这个数字是武器ID。0的话将被判别为空手。
# 只有在敌方动画NO的时候画像才被显示。
def weapon
case @enemy_id
when 1
return 0
end
# 上述敌方ID以外的其他敌方队员全部使用的武器ID
return 0
end
#--------------------------------------------------------------------------
# ● 战斗配置的略微调整 在这里可以设置数据库中所不能设置的广范围坐标
#--------------------------------------------------------------------------
# return [ 0, 0] => [X坐标、Y坐标] 这个数值从数据库上的配置上变化
def position_plus
case @enemy_id
when 1
return [0, 0]
end
# 上述敌方ID以外的其他敌方队员全部使用的武器ID坐标调整
return [ 0, 0]
end
#--------------------------------------------------------------------------
# ● 敌方击倒(击破时的退场)方式
#--------------------------------------------------------------------------
# 被击倒画像残留的为1、普通为2、BOSS型为3
def collapse_type
case @enemy_id
when 1
return 2
when 30 #敌方ID为30,BOSS型击倒!
return 3
end
# 上述敌方ID以外的其他敌方队员全部使用的武器ID击倒方式
return 2
end
#--------------------------------------------------------------------------
# ● 敌方行动回数 1回合做几次行动
#--------------------------------------------------------------------------
# 回数 确率 补正
# return [ 2, 100, 50]
#
# 回数…最大的行动回数
# 确率…下次行动能否成功的成功率。数值为%
# 补正…速度修正。行动的每次数值%后得出的值
def action_time
case @enemy_id
when 1
return [ 1, 100, 100]
end
# 上述敌方ID以外的其他敌方队员全部使用的武器ID行动回数
return [ 1, 100, 100]
end
#--------------------------------------------------------------------------
# ● 敌方动画
#--------------------------------------------------------------------------
# 敌方被作成动画? true是是跟主人公同等对待。
# [设定方法]
# 1.敌方的动画画像变成行走图
# 2.数据库的敌方角色名、参照着行走图文件名填写
def anime_on
case @enemy_id
when 1,2
return true
end
# 上述敌方ID以外的其他敌方队员全部使用的武器ID动画设定
return false
end
#--------------------------------------------------------------------------
# ● 敌方动画時的自动反转
#--------------------------------------------------------------------------
# 如果想自动反转上面设定为NO的敌方画像和武器动画时为true
def action_mirror
case @enemy_id
when 1,2
return true
end
# 上述敌方ID以外的其他敌方队员全部使用的武器ID动画设定
return false
end
end
module RPG
#==============================================================================
# ■ module RPG
#------------------------------------------------------------------------------
# 设定状态动作。
#==============================================================================
class State
#--------------------------------------------------------------------------
# ● 指定ID 根据状态改变通常待机、危急时的动作。
#--------------------------------------------------------------------------
# when 1 ←这个数字是状态ID
# return "气绝" ←填入对应的连贯动作名
def base_action
case @id
when 1 # 无法战斗(HP0)时。最优先。
return "气绝"
when 2,3,4,5,7
return "异常状态待机"
when 6
return "睡眠待机"
when 17
return "漂浮待机"
end
# 上述状态ID以外的其他状态全部使用的连贯动作
return "待机"
end
#--------------------------------------------------------------------------
# ● 扩张设定 从状态ID确定扩张设定。可以重复。
#--------------------------------------------------------------------------
# "自动复活/50"…无法战斗时自动复活。不要解除无法战斗。
# /后的数字是回复时的HP(最大值的比例%)回复后状态会自动解除
# "魔法反弹/39"…反弹魔法(物理攻击以外)技能。/后填入反射时显示的动画ID编号
# "物理反弹/39"…反弹物理攻击(包含物理技能)。/后填入反射时显示的动画ID编号
# "魔法无效/39"…魔法(物理攻击以外)技能无效化。/后填入无效时显示的动画ID编号
# "物理无效/39"…物理攻击(包含物理技能)无效化。/后填入无效时显示的动画ID编号
# "成本吸収"…受到技能时将他的成本还原到自身。数值不显示。
# "0回合解除"…按照行动顺序的回合数解除状态。
# "敌方除外"…让敌方不显示这个状态
# "无POP"…附加这个状态時、伤害窗口上不显示状态名
# "不显示ICON"…在状态窗口上不显示状态ICON
# "禁止状态动作"…附加这个状态时不会改变人物待机状态
# "连续伤害"…调用下面的连续伤害
# "无"…无扩张
def extension
case @id
when 1 # 无法战斗
return ["无POP","敌方除外"]
when 2 # 毒
return ["敌方除外"]
when 218
return ["0回合解除","不显示ICON"]
when 219
return ["0回合解除","不显示ICON"]
when 220
return ["不显示ICON","禁止状态动作"]
end
# 上記のID以外すべてに適用される拡張設定
return ["无"]
end
#--------------------------------------------------------------------------
# ● 连续伤害扩张设置 包含连续回复
#--------------------------------------------------------------------------
# when 1 ←这个数字是状态ID。上面的只有填写了"连续伤害"的扩张才会有这个效果
# 可以多数设置。例)[["hp",0,5,true],["mp",0,5,true]]
#
# 对象 定数 比例 POP 无法战斗许可
# return [["hp", 0, 10, true, true]]
#
# 对象…比例伤害对象是 HP的话为"hp" MP为"mp"
# 定数…这个数值直接是伤害值。如果是负数时便成为回復。数值上多少会有些误差
# 比例…对象的最大值的比例伤害。数值以%计算。数值上多少会有些误差
# POP…在战斗画面上显示数值是true
# 无法战斗许可…许可HP0的情况是true
def slip_extension
case @id
when 2 # 毒
return [["hp", 0, 10, true, true]]
end
return []
end
end
#==============================================================================
# ■ module RPG
#------------------------------------------------------------------------------
# 设置武器动作
#==============================================================================
class Weapon
#--------------------------------------------------------------------------
# ● 动作指定 从装备着的武器ID来决定通常攻击的动作。
#--------------------------------------------------------------------------
# when 1 ←这个数字是武器ID
# return "通常攻击" ←请填入对应的连贯动作名
def base_action
case @base_id
when 2
return "剑系统攻击动作"
when 3
return "枪系统攻击动作"
end
# 上述ID以外的其他全部使用的动作
return "通常攻击"
end
#--------------------------------------------------------------------------
# ● 图像指定 从装备着的武器ID来决定通常攻击的动作。
#--------------------------------------------------------------------------
# return "001-Weapon01" ←请填入对应的武器图像的文件名
# 武器图像请放入人物行走图文件夹中
# 使用ICON时、在ID上没有的全部使用ICON来表示
# 特定的武器想要让他们不显示的话请用空白的图像。
def graphic
case @base_id
when 1
return ""
end
# 使用上述ID以外的全ICON画像
return ""
end
#--------------------------------------------------------------------------
# ● 飞出动画中贴附武器图像 自人物行走图文件夹中读取
#--------------------------------------------------------------------------
# 飞出动画用武器画像另行设定。显示弓和箭之类的。
# 在这里没有被设置的武器会和上面的图像作相同处理。
def flying_graphic
case @base_id
when 1
return ""
end
# 上述ID以外一律使用的图像
return ""
end
end
#==============================================================================
# ■ module RPG
#------------------------------------------------------------------------------
# 技能动作设定。
#==============================================================================
class Skill
#--------------------------------------------------------------------------
# ● 从技能ID决定动作。
#--------------------------------------------------------------------------
def base_action
case @id
when 84
return "武器投掷"
when 86
return "高速多段攻击"
when 87
return "单独全体远距离攻击"
when 88
return "全体远距离攻击"
when 89
return "多段随机攻击"
when 90,320,340,341
return "回复连发"
when 91
return "适当连发"
when 92,255,257,260,266,267,268,269,271,272,273,275,276,277,278,279,280,281,282,283,284,285,287,289,290,291,292,293,295,298,299,300,305,308,309,312,313,314,315,316,319,322,323,324,325,326,329,330,331,334,337,338,339,342,343,344,345,347,349,351,352,356,357,359,360,362,363,364,365,366,368,369,371,372,373,374,375,376,377,378,379,380,381
return "通常攻击"
when 93
return "特写"
when 94
return "踩踏攻击"
when 95,262
return "全体攻击1"
when 96,256,261,270,274,286,288,294,296,297,301,302,303,306,307,310,311,317,318,321,327,328,335,336,346,348,350,358,361,367,370,382,383,384
return "通用技能单独处理"
when 97
return "变身成猫"
when 98
return "二人同時攻击"
when 99
return "二人同時攻击准备"
when 100
return "四人同時攻击"
when 101
return "四人同時攻击准备"
when 102
return "四人同時攻击准备"
when 103
return "四人同時攻击准备"
when 104
return "人体投掷"
when 201,253,255,256,257,259,260,263,264,265,266,267,268,269,270,271,273,274,275,276,277,278,279,280,281,283,284,285,287,288,289,290,291,293,295,297,298,299,300,301,304,305,308,309,312,316,322,323,324,325,326,287,334,337,338,339,342,343,344,345,347,349,351,352,353,355,356,357,359,360,362,363,364,365,366,368,369,371,372,373,374,375,376,377,378,379,380,381
return "敌方无武器的攻击"
when 251
return "幻鬼之阵(敌)"
when 252
return "终末之冬(敌)"
when 34,251,252,254,256,258,261,262,272,282,286,292,294,296,302,303,306,307,310,311,317,318,328,331,346,348,350,354,358,361,367,370,382,383,384
return "敌方使用技能"
end
# 上述ID以外的其他全部使用的动作
return "使用通用技能"
end
#--------------------------------------------------------------------------
# ● 扩张设定 从技能ID决定扩张设定。可以重复。
#--------------------------------------------------------------------------
# "必中"…攻击绝对不会被回避
# "HP消費"…将MP消费改为HP消费
# "%成本MAX"…技能成本变为以最大MP(HP)的比例取值。例)MAXMP500的成本10是消费MP50
# "%成本NOW"…技能成本变为以现在MP(HP)的比例取值。例)现MP100的成本10是消费MP10
# "无视反射"…无视魔法、物理技能反射和无效化状态
# "%伤害MAX/30"…伤害计算变为以对象的最大HP(MP)的比例取值。/后的数值为%值伤害
# "%伤害NOW/30"…伤害计算变为以对象的现在HP(MP)的比例取值。/后的数值为%值伤害
# "成本威力"…根据使用者的最大MP(HP)判别消費MP(HP)的比例威力。MAX消費是原本威力、MAX10%是原有威力的1/10
# "现HP威力"…根据使用者的最大HP改变现在HP的比例威力。MAX是原本威力、MAX10%是原有威力的1/10
# "现MP威力"…根据使用者的最大MP改变现在MP的比例威力。MAX是原本威力、MAX10%是原有威力的1/10
# "MP消耗减半无效"…防具上的定义「MP消耗减半」被无效化
# "不显示HELP"…动作时、帮助窗口上不显示技能名
# "全区域"…目标范围为敌我方全体
# "随机目标"…目标内随机选择一个对象
# "自身以外"…在目标内将自己排除
# "伤害动作禁止"…不显示伤害命中时的动作
# "行动前无闪光"…行动时角色不发光
# "无"…无扩张
def extension
case @id
when 86
return ["伤害动作禁止"]
when 89
return ["随机目标"]
when 94
return ["伤害动作禁止"]
when 96
return ["全域"]
when 98
return ["伤害动作禁止"]
when 99
return ["不显示HELP","行动前无闪光"]
when 100
return ["伤害动作禁止"]
when 101
return ["不显示HELP","行动前无闪光"]
when 102
return ["不显示HELP","行动前无闪光"]
when 103
return ["不显示HELP","行动前无闪光"]
end
# 上述ID以外的其他全部使用的拡張設定
return ["无"]
end
#--------------------------------------------------------------------------
# ● 飞出动画上贴附的画像 自人物行走图文件夹中读取
#--------------------------------------------------------------------------
# 指定技能ID的画像
def flying_graphic
case @id
when 1
return ""
end
# 上述ID以外为画像未使用
return ""
end
end
#==============================================================================
# ■ module RPG
#------------------------------------------------------------------------------
# 物品动作设定。
#==============================================================================
class Item
#--------------------------------------------------------------------------
# ● 根据物品ID决定动作。
#--------------------------------------------------------------------------
def base_action
case @id
when 1
return "使用物品"
end
# 上述ID以外的其他全部使用的动作
return "使用物品"
end
#--------------------------------------------------------------------------
# ● 扩张设定 根据物品ID决定扩张设定。可以重复。
#--------------------------------------------------------------------------
# "必中"…攻击绝对不会被回避
# "反射无视"…无视魔法、物理反射和无效化状态
# "不显示HELP"…帮助窗口上不显示物品名
# "全区域"…目标范围为敌我全体
# "随机目标"…目标内中随机选择一个对象
# "自身以外"…目标内中将自身排除
# "伤害动作禁止"…不显示伤害命中时的动作
# "行动前无闪光"…行动时角色不发光
# "无"…无扩张
def extension
case @id
when 1
return ["无"]
end
# 上述ID以外的其他全部使用的拡張設定
return ["无"]
end
end
end
#==============================================================================
# Learn Skills By Use
# Version: 2.0b
# Author: modern algebra (rmrk.net)
# Date: October 29, 2010
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# NB: If you wish to use the learn immediately option of the script, then
# Zeriab's Dialog System is required and he should be credited. You can find
# it here: http://rmrk.net/index.php/topic,24828.0.html
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# Description:
#
# This script allows you to have actors learn skills by using other skills.
# For instance, you could set it so that an actor will learn Fire II only
# after he has used Fire 50 times. You can also set it so that there can be
# multiple paths to learning a skill and multiple skill requirements. For
# instance, that same actor could also learn Fire II if he has used Flame
# 60 times and Flame II 25 times. However, you can also set class
# prohibitions and level requirements, so if you never want a Paladin to
# learn Fire II no matter how many times he uses its root skills, then it is
# easy to set that up, and if you don't want Fire II to be learned by any
# actor until they are at least level 7, then that can be setup too. You may
# also set it up so that it is like an upgrade - Fire becomes obsolete once
# Fire II is learned, and so you can simply forget Fire once you have Fire II
# It also has two options of ways to show the number of times you've used a
# skill.
#
# Also, you can set it so that the actor either learns the new skill
# immediately upon meeting use requirements, or at his/her next level.
#
# Further, this doesn't interfere with the regular skill learning system, so
# if you set it that a mage will learn Fire II at level 6 in the Class Tab
# of the database, than the mage will learn Fire II at level 6 no matter if
# she has met the use requirements of its root skills, and no matter what
# the class prohibitions or level requirements are.
#
# There are also a number of options you can set regarding how to show the
# number of uses in the help window, and you can do it by either pressing a
# button or it will show up at the same time as the description. There is
# also a new set of mastery options.
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# Instructions:
#
# Place this script above Main and below Materials in the Editor. It should
# also be below any custom levelup scripts you may have. If set to learn
# immediately, then Zeriab's Dialog System is required above this script:
# http://rmrk.net/index.php/topic,24828.0.html
#
# To set up a skill to be learned through use, you must use this code in a
# notes box:
#
# \ROOT_SKILL[skill_id, number_of_uses, <supplement_skills>, forget]
# skill_id : The ID of the root skill that leads to this skill.
# number_of_uses : An integer - the number of times the root skill has
# be used before it teaches this skill.
# <supplement_skills> : a list of skill IDs that also have to have their
# root requirements fulfilled before the skill will be learned. It is
# of the format: <x, y, z> where x, y, and z are the IDs of the other
# skills that must have usage requirements met. You can have as many
# as you like. Note, however, that you must set up one of these
# requirements notes for each of the other skills as well, and you
# must cross-reference the skills in this path. Defaults to <>,
# meaning that the only usage requirements needed to be filled is this
# one
# forget : If this is set to 1, then the root skills will be forgotten
# once this skill is learned. If left blank or set to any other digit,
# than the root skills will be retained.
#
# EXAMPLE A:
#
# This code in the notebox of a skill:
#
# \ROOT_SKILL[9, 100]
#
# There is only one path to learning this skill:
# (i) Use the skill with ID 9 at least 100 times.
#
# No skill is forgotten
#
# EXAMPLE B:
#
# These codes in the notebox of a skill:
#
# \ROOT_SKILL[1, 20, 1]
# \ROOT_SKILL[4, 15, <5>]
# \ROOT_SKILL[5, 8, <4>]
#
# With these codes, there are two paths to learning this skill.
# (i) Use the skill with ID 1 at least 20 times.
# (ii) Use the skill with ID 4 at least 15 times and use the skill with
# ID 5 at least 8 times.
#
# No matter which path is taken to the skill, the skill with ID 1 will be
# forgotten as soon as the new skill is learned.
#
# EXAMPLE C:
#
# The following codes in the notebox of a skill:
#
# \ROOT_SKILL[6, 100]
# \ROOT_SKILL[7, 100]
# \ROOT_SKILL[6, 20, <7, 8>]
# \ROOT_SKILL[7, 25, <6, 8>]
# \ROOT_SKILL[8, 15, <6, 7>]
#
# With these codes, there are three paths to learning this skill.
# (i) Use the skill with ID 6 at least 100 times
# (ii) Use the skill with ID 7 at least 100 times
# (iii) Use the skill with ID 6 at least 20 times, the skill with ID 7 at
# least 25 times, and the skill with ID 8 at least 15 times.
#
# No matter which path is taken, no skills will be forgotten.
#
# To prohibit a class from learning a skill through usage requirements,
# put this code in a notebox of a skill:
#
# \PROHIBIT_CLASS[class_id]
# class_id : ID of class not allowed to learn this skill through use
#
# To set a minimum level for learning a skill through usage requirements,
# put this code in the notebox of a skill:
#
# \MIN_LEVEL[x]
# x : an integer that is the minimum level. An actor cannot learn
# the skill until his level is at least equal to x.
#
# Next, you may want to setup if and how the use count is displayed. To, set the text that you
# want to signify the count under LSU_VOCAB_USECOUNT at line 159, and you can
# set the color of the text at line 165 - LSU_COUNT_FONTCOLOR. If this is an
# integer, it takes the color from the windowskin palette. You could also set
# it as an array of the form: [red, green, blue, alpha].
# Alternatively, you could set it up to only show the skill count if the
# player presses a specified button. You would not get to choose the color in
# that case, but would get to specify alignment.
#
# Lastly, there is now an option to show "Mastery". You can specify a number
# of uses to meet this threshold. When showing use count, it will show up as
# # of uses / mastery threshold, and once reached, it will be replaced by any
# text you choose. Those options are between lines 162 and 168. To set the
# threshold for a skill individually, use the following code:
# \MASTER[x]
# x : the number of uses to reach mastery.
#==============================================================================
#\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
# EDITABLE REGION
#||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
LSU_LEARN_IMMEDIATELY = true # Whether to learn the skill immediately upon
# meeting usage requirements or to wait for level
# If true, you MUST have Zeriab's Dialog System:
# http://rmrk.net/index.php/topic,24828.0.html
LSU_VOCAB_OBTAIN_SKILL = "%n has learned %s!" # The message shown when an actor
# learns a new skill if immediate and not on level
LSU_SE_OBTAIN_SKILL = "Skill" # The SE that plays when an actor learns a new
# skill. Again, only applies if on immediate.
#``````````````````````````````````````````````````````````````````````````````
LSU_SHOW_USE = false # Whether or not to show use count at all in the
# the help window.
LSU_VOCAB_USECOUNT = "Used: " # Text to label skill count
LSU_BUTTONSHOW = false # Whether or not it shows up with the description
# or is drawn only when pressing a button
LSU_BUTTON = Input::SHIFT # If LSU_BUTTONSHOW is true, what button needs to
# be pressed to show the skill use count
LSU_SHOWCOUNT_ALIGN = 0 # Alignment of text if LSU_BUTTONSHOW is true
LSU_COUNT_FONTCOLOR = 16 # Font color if LSU_BUTTONSHOW is false
#``````````````````````````````````````````````````````````````````````````````
LSU_SHOW_MASTERY = true # Whether or not to show some the word for mastery
# when a script has been used to its maximum
# efficiency or to a stated goal.
LSU_DEFAULT_MASTERY = 100 # The default number of uses for mastery
LSU_VOCAB_MASTERY = "[MASTERED]" # The word to show once skill use reaches goal
LSU_MASTER_REPLACE = true # Whether to replace the Used: x text or simply be
# placed after it.
#||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
# END EDITABLE REGION
#//////////////////////////////////////////////////////////////////////////////
if LSU_LEARN_IMMEDIATELY
#==============================================================================
# ** Dialog_DiscoverFavourite
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# This class processes when a favourite item is discovered
#==============================================================================
class Dialog_LearnSkill < Dialog
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * A show method
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def initialize(actor, skill) @actor = actor @skill = skill
begin
(RPG::SE.new (*skill.ma_learn_se)).play
rescue
(RPG::SE.new ("Skill")).play
end
end
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Create the windows
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def main_window
text = help_text
tw = [@background_sprite.bitmap.text_size (text).width + 32, Graphics.width].min
@learn_window = Window_Help.new
@learn_window.width = tw
@learn_window.create_contents
@learn_window.x = (Graphics.width - tw) / 2
@learn_window.y = (Graphics.height - @learn_window.height) / 2
@learn_window.z = STARTING_Z_VALUE + 1
@learn_window.set_text (text, 1)
end
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Help Text
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def help_text
text = LSU_VOCAB_OBTAIN_SKILL.gsub (/%s/) { @skill.name }
text.gsub! (/%n/) { @actor.name }
return text
end
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Dispose the windows
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def main_dispose
@learn_window.dispose
end
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Frame Update
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def update
if Input.trigger?(Input::B) || Input.trigger?(Input::C)
mark_to_close
self.value = false
end
end
end
end
#==============================================================================
# ** Skill
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# Summary of Changes:
# new public variables - ma_root_skills; ma_descendant_skills;
# ma_level_requirement; ma_prohibited classes
# new methods - ma_learn_se; ma_cache_lsu_skill_stats
#==============================================================================
class RPG::Skill
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Public Instance Variables
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
attr_accessor :ma_root_skills
attr_accessor :ma_descendant_skills
attr_accessor :ma_level_requirement
attr_accessor :ma_prohibited_classes
attr_accessor :ma_master_uses
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Learn SE
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def ma_learn_se
# Not cached because it will only rarely be accessed. Better to use RAM
if self.note[/\\LEARN_SE\[(.+?),?\s*(\d*?),?\s*(\d*?)\]/i] != nil
learn_se = [$1.to_s]
learn_se.push ($2.to_i) unless $2.empty?
learn_se.push ($3.to_i) unless $3.empty?
else
return LSU_SE_OBTAIN_SKILL
end
end
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Cache LSU stats
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def ma_cache_lsu_skill_stats
# Get skill paths and descendants
@ma_root_skills, @ma_prohibited_classes = [], []
@ma_descendant_skills = [] if @ma_descendant_skills.nil?
@ma_master_uses, @ma_level_requirement = LSU_DEFAULT_MASTERY, 1
# Level Requirements
@ma_level_requirement = $1.to_i if self.note[/\\MIN_LEVEL\[(\d+)\]/i] != nil
@ma_master_uses = $1.to_i if self.note[/\\MASTERY?\[(\d+)\]/i] != nil && $1.to_i > 0
root_paths = {}
root_skills = []
(self.note.scan (/\\ROOT_SKILL\[(\d+),?\s*(\d*),?\s*?<?([\d ,;:]*?)>?,?\s*?([F1]?)\]/i)).each { |match|
id = match[0].to_i
n = match[1].to_i
supplement_skills = []
(match[2].scan (/\d+?/)).each { |id2| supplement_skills.push (id2.to_i) } unless match[2].empty?
forget = !match[3].empty?
root_skills.push ([id, n, forget, supplement_skills])
}
root_skills.each { |array|
key = ([array[0]] + array[3]).sort
root_paths[key] = [] if !root_paths[key]
root_paths[key].push (array[0, 3])
}
root_paths.each { |key, path|
if path.size < key.size
key.each { |key2|
exists = false
path.each { |array| exists = true if path[0] == key2 }
path.push ([key2, 0, false]) if !exists
}
end
path.sort! { |a, b| a[0] <=> b[0] }
@ma_root_skills.push (path)
}
@ma_root_skills.each { |path|
path.each { |d_id, n, forget|
$data_skills[d_id].ma_descendant_skills = [] if $data_skills[d_id].ma_descendant_skills.nil?
d_skills = $data_skills[d_id].ma_descendant_skills
d_skills.push (self.id) unless d_skills.include? (self.id)
}
}
# Prohibited Classes
(self.note.scan (/\\PROHIBIT_CLASS\[(\d+)\]/i)).each { |id|
@ma_prohibited_classes.push (id[0].to_i)
}
end
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Compatibility with Note Editor + General Compatibility Patch
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
if self.method_defined? (:ma_reset_note_values)
alias malg_lsu_rsetnote_8uk2 ma_reset_note_values
def ma_reset_note_values (*args)
malg_lsu_rsetnote_8uk2 (*args) # Run Original Method
@ma_root_skills.each { |path|
path.each { |a| $data_skills[a[0]].ma_descendant_skills.delete (self.id) }
}
ma_cache_lsu_skill_stats # Recache skill stats for LSU
end
end
end
class Game_Actor
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Object Initialization
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
alias modalg_brnchskill_stp_1xc3 setup
def setup (*args)
@lsbu_skill_count = []
# Run Original Method
modalg_brnchskill_stp_1xc3(*args)
end
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Level Up
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
alias malg_skl_brnches_byuse_lvlplus_0kb2 level_up
def level_up (*args)
# Run Original Method
malg_skl_brnches_byuse_lvlplus_0kb2 (*args)
# Check all skills to see if requirements have been met to learn the skill
skills.each { |skill|
skill.ma_descendant_skills.each { |descendant_id|
descen = $data_skills[descendant_id]
if [email protected]? (descen.id) && lsu_skill_requirements_met? (descen)
# Learn Skill
learn_skill_by_use (descen.id)
end
}
}
end
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Check if this actor meets requirements to learn skill
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def lsu_skill_requirements_met? (skill)
return false if skill.ma_prohibited_classes.include? (@class_id)
return false if @level < skill.ma_level_requirement
skill.ma_root_skills.each { |path|
path_complete = true
path.each { |reqs|
if skill_count (reqs[0]) < reqs[1]
path_complete = false
break
end
}
return true if path_complete # If all requirements met
}
return false
end
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Learn Skill By Use
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def learn_skill_by_use (skill_id)
forgets = []
$data_skills[skill_id].ma_root_skills.each { |path|
path.each { |reqs| forgets.push (reqs[0]) if reqs[2] }
}
forgets.each { |forget_id| forget_skill (forget_id) }
learn_skill (skill_id)
end
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Retrieve Skill Count
# skill_id : ID of skill checked
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def skill_count (skill_id)
@lsbu_skill_count[skill_id] = 0 if @lsbu_skill_count[skill_id].nil?
return @lsbu_skill_count[skill_id]
end
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Increase Skill Count
# skill_id : ID of skill increased
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def increase_skill_count (skill_id)
@lsbu_skill_count[skill_id] = skill_count (skill_id) + 1
end
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Skill Mastered?
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def skill_mastered? (skill)
return skill_count (skill.id) >= skill.ma_master_uses
end
end
#==============================================================================
# ** Window_Help
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# Summary of Changes:
# new method - lsu_set_secondary_text
#==============================================================================
class Window_Help
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Set Secondary Text
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def lsu_insert_secondary_text (text, align = 2)
# Check if real text has changed
if (@lsu_changed_text != @text) || (@lsu_changed_align != @align)
if LSU_COUNT_FONTCOLOR.is_a? (Integer)
self.contents.font.color = text_color (LSU_COUNT_FONTCOLOR)
else
self.contents.font.color = Color.new (*LSU_COUNT_FONTCOLOR)
end
self.contents.draw_text(4, 0, self.width - 40, WLH, text, align)
@lsu_changed_text, @lsu_changed_align = @text, @align
end
end
end
class Window_Skill
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Update Help Text
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
alias ma_lsu_updhelp_uses_8kh2 update_help
def update_help (*args)
if LSU_BUTTONSHOW
if Input.press? (LSU_BUTTON) && @actor
@help_window.set_text (ma_use_text, LSU_SHOWCOUNT_ALIGN)
else
ma_lsu_updhelp_uses_8kh2 (*args)
end
else
ma_lsu_updhelp_uses_8kh2 (*args)
return unless @actor && skill
@help_window.lsu_insert_secondary_text (ma_use_text)
end
end
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Get Use Text
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def ma_use_text
add = ""
if LSU_SHOW_MASTERY
if @actor.skill_mastered? (skill)
return LSU_VOCAB_MASTERY if LSU_MASTER_REPLACE
add = LSU_VOCAB_MASTERY
else
add = " / #{skill.ma_master_uses}"
end
end
return LSU_VOCAB_USECOUNT + @actor.skill_count(skill.id).to_s + add
end
end
#==============================================================================
# ** Scene_Base
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# Summary of Changes:
# new method - lsu_advance_skill_count
#==============================================================================
class Scene_Base
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Advance Skill Count
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def lsu_advance_skill_count (user, skill)
# Increase skill count
user.increase_skill_count (skill.id)
if LSU_LEARN_IMMEDIATELY
new_skills = []
skill.ma_descendant_skills.each { |descendant_id|
descendant = $data_skills[descendant_id]
# Check requirements
if !user.skill_learn? (descendant) && user.lsu_skill_requirements_met? (descendant)
new_skills.push (descendant)
end
}
for new_skill in new_skills
user.learn_skill_by_use (new_skill.id)
Dialog_LearnSkill.show (user, new_skill)
end
end
end
end
class Scene_Title
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Load Database
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
alias malsu_lddata_5yj7 load_database
def load_database (*args)
malsu_lddata_5yj7 (*args) # Run Original Method
$data_skills.each { |skill| skill.ma_cache_lsu_skill_stats if !skill.nil? }
end
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Load Battle Test Database
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
alias malg_lsu_btdat_6yh1 load_bt_database
def load_bt_database (*args)
malg_lsu_btdat_6yh1 (*args) # Run Original Method
$data_skills.each { |skill| skill.ma_cache_lsu_skill_stats if !skill.nil? }
end
end
class Scene_Skill
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Use Skill Nontarget
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
alias ma_lsu_uskll_7uj2 use_skill_nontarget
def use_skill_nontarget (*args)
ma_lsu_uskll_7uj2 (*args) # Run Original Method
lsu_advance_skill_count (@actor, @skill) # Advance Skill Count
end
end
#==============================================================================
# ** Scene Battle
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# Summary of Changes:
# aliased methods - execute_action_skill
#==============================================================================
class Scene_Battle
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Execute Skill
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
alias mdrnalg_exctskl_lsbu_4nv2 execute_action_skill
def execute_action_skill (*args)
mdrnalg_exctskl_lsbu_4nv2 (*args) # Run Original Method
# Increase User's skill count if actor
lsu_advance_skill_count (@active_battler, @active_battler.action.skill) if @active_battler.actor?
end
end