Project1
标题:
RPG VX技能石
[打印本页]
作者:
鑫磊
时间:
2013-8-19 14:32
标题:
RPG VX技能石
请问大家,谁会设置技能石,教教我好么,做好有截图
作者:
Password
时间:
2013-8-19 15:08
技能石是什么……类似技能书?
是的话就参考下面的范例吧。
Project1.rar
(238.7 KB, 下载次数: 52)
2013-8-19 15:08 上传
点击文件名下载附件
作者:
鑫磊
时间:
2013-8-19 15:13
不是这种想小刀赏金猎人最新版做的那种
作者:
鑫磊
时间:
2013-8-19 17:40
用技能石升级技能,能将技能从一级生成两级
作者:
轩辕大将军
时间:
2013-8-19 20:02
亲,既然不会脚本,就利用事件吧。
利用事件来做出技能石
作者:
鑫磊
时间:
2013-8-19 20:24
你发截图呀LS
作者:
上贺茂润
时间:
2013-8-20 08:01
j事件做不出技能石,因为无法获取所选技能号。
作者:
200928326
时间:
2013-8-20 09:35
你为何不召唤下小刀本人- -b
@小小刀886
作者:
鑫磊
时间:
2013-8-20 11:49
我无权加小刀为好友,我的经验太少
作者:
小小刀886
时间:
2013-8-20 12:26
本帖最后由 小小刀886 于 2013-8-20 16:27 编辑
先在柳啊搜一下,用手机发不了代码。
作者:
没想好
时间:
2013-8-20 13:11
你要的是这个吗
作者:
鑫磊
时间:
2013-8-20 13:29
差不多,但不想小刀的那样,每升一级技能就从一级升为二级,技能后面有显示
作者:
鑫磊
时间:
2013-8-20 14:04
小刀君,我要拜你为师,你加我为好友吧
,你工程里的脚本借我用用
作者:
小小刀886
时间:
2013-8-21 13:33
# -----------------------------------------------------------------------------
# 技能升级系统(SLV)
# ver:1.0VX
# date:2011.10.11 by.Ultra
# 【说明】
# 呼出界面:$scene = Scene_SLV.new(队员ID)
# 切换角色:L 或 R 键
# -----------------------------------------------------------------------------
module SLV
# ·消耗的物品ID
ITEMID = 1
# ·升级技能关联
# 技能ID => 升级后技能ID
SLVUP = {
}
# ·设定消耗物品数量
# 技能ID => 升级时消耗物品数量
SCONSUM = {
}
# ·默认消耗物品数量
ALLSCONSUM = 3
end
#==============================================================================
# ■ Window_SLVindex
#------------------------------------------------------------------------------
# 显示升级特技目录的窗口。
#==============================================================================
class Window_SLVindex < Window_Selectable
#--------------------------------------------------------------------------
# ● 初始化对像
# x : 窗口 X 座标
# y : 窗口 Y 座标
# width : 窗口宽度
# height : 窗口高度
# actor : 角色
#--------------------------------------------------------------------------
def initialize(actor)
super(0, 112, 272, 304)
[url=home.php?mod=space&uid=95897]@actor[/url] = actor
self.index = 0
refresh
end
#--------------------------------------------------------------------------
# ● 获取技能
#--------------------------------------------------------------------------
def skill
return @data[self.index]
end
#--------------------------------------------------------------------------
# ● 刷新
#--------------------------------------------------------------------------
def refresh
@data = []
for skill in @actor.skills
@data.push(skill)
if skill.id == @actor.last_skill_id
self.index = @data.size - 1
end
end
@item_max = @data.size
create_contents
for i in 0...@item_max
draw_item(i)
end
end
#--------------------------------------------------------------------------
# ● 描绘项目
# index : 项目编号
#--------------------------------------------------------------------------
def draw_item(index)
rect = item_rect(index)
self.contents.clear_rect(rect)
skill = @data[index]
if skill != nil
rect.width -= 4
enabled = @actor.skill_can_use?(skill)
draw_item_name(skill, rect.x, rect.y, enabled)
self.contents.draw_text(rect, @actor.calc_mp_cost(skill), 2)
end
end
#--------------------------------------------------------------------------
# ● 更新帮助窗口文字
#--------------------------------------------------------------------------
def update_help
@help_window.set_text(skill == nil ? "" : skill.description)
end
end
#==============================================================================
# ■ Window_SkillStatus
#------------------------------------------------------------------------------
# 显示特技升级消耗品的窗口
#==============================================================================
class Window_SLVconsum < Window_Base
#--------------------------------------------------------------------------
# ● 初始化窗口
#--------------------------------------------------------------------------
def initialize
super(0, 0, 544, 56)
self.contents = Bitmap.new(width - 32, height - 32)
refresh
end
#--------------------------------------------------------------------------
# ● 刷新
#--------------------------------------------------------------------------
def refresh
self.contents.clear
item = $data_items[SLV::ITEMID]
return if not item
icon_index = item.icon_index
number = $game_party.item_number(item)
x,y = 0,0
draw_icon(icon_index,x,y)
self.contents.draw_text(x + 24, y, 320, WLH, item.name+":#{number.to_s}")
end
end
#==============================================================================
# ■ Window_Gold
#------------------------------------------------------------------------------
# 显示技能信息的窗口。
#==============================================================================
class Window_SLVinfo < Window_Base
#--------------------------------------------------------------------------
# ● 初始化窗口
#--------------------------------------------------------------------------
def initialize(skill)
super(272, 112, 272, 304)
self.contents = Bitmap.new(width - 32, height - 32)
[url=home.php?mod=space&uid=260100]@skill[/url] = skill
refresh
end
#--------------------------------------------------------------------------
# ● 刷新
#--------------------------------------------------------------------------
def refresh
self.contents.clear
self.contents.font.size = 18
return if not @skill
id = @skill.id
up = SLV::SLVUP
if up.include?(id)
self.contents.font.color = normal_color
draw(@skill,0,0)
self.contents.font.color = text_color(3)
draw($data_skills[up[id]],4,138)
else
self.contents.font.color = normal_color
draw(@skill,0,0)
self.contents.font.color = text_color(2)
self.contents.draw_text(0, 138, 320, WLH, "技能已达极限")
end
end
def draw(skill,x,y)
yh = 22
draw_icon(skill.icon_index,x,y)
self.contents.draw_text(x + 24, y, 320, WLH, skill.name)
scope = ["无","敌方单体","敌方全体","敌方单体连击","敌方单体随机目标",
"敌方二体随机目标","敌方三体随机目标","我方单体","我方全体",
"我方单个濒死者","我方所有濒死者","使用者自身"]
self.contents.draw_text(x, y+yh, 320, WLH, "使用范围:"+scope[skill.scope])
occasion = ["不限制使用场合","仅作战时使用","仅菜单中使用","不可用"]
self.contents.draw_text(x, y+yh*2, 320, WLH, "使用场合:"+occasion[skill.occasion])
self.contents.draw_text(x, y+yh*3, 320, WLH, "消耗SP:"+skill.mp_cost.to_s)
self.contents.draw_text(x, y+yh*4, 320, WLH, "基本伤害值:"+skill.base_damage.to_s)
self.contents.draw_text(x, y+yh*5, 320, WLH, "命中率:"+skill.hit.to_s)
end
def skill
@skill
end
def skill=(val)
@skill = val
end
end
class Window_SLVchoice < Window_Selectable
def initialize(skill)
super(272, 112, 272, 152)
@commands = ["确定","返回"]
@item_max = 2
@skill = skill
refresh
self.index = 0
self.z = 1000
end
def refresh
item = $data_items[SLV::ITEMID]
number = $game_party.item_number(item)
upnum = SLV::SCONSUM[@skill.id]
upnum = SLV::ALLSCONSUM unless upnum
self.contents.clear
for i in 0...@item_max
if number < upnum
color1 = Color.new(255, 255, 255, 128)
color2 = text_color(2)
else
color1 = normal_color
color2 = normal_color
end
self.contents.font.color = color1
self.contents.font.color = normal_color if i == 1
draw_item(i)
end
self.contents.draw_text(0, 56, 320, WLH, "升级必要:")
x,y = 0,82
icon_index = item.icon_index
draw_icon(icon_index,x,y)
self.contents.font.color = color2
self.contents.draw_text(x + 24, y, 320, WLH, item.name+" * #{upnum.to_s}")
end
def draw_item(index)
self.contents.draw_text(0, 26 * index, self.contents.width-8, WLH, @commands[index], 1)
end
def skill
@skill
end
def skill=(val)
@skill = val
end
end
#==============================================================================
# ■ Scene_Skill
#------------------------------------------------------------------------------
# 处理特技升级画面的类。
#==============================================================================
class Scene_SLV
#--------------------------------------------------------------------------
# ● 初始化对像
# actor_index : 角色索引
#--------------------------------------------------------------------------
def initialize(actor_index = 0)
@actor_index = actor_index
end
#--------------------------------------------------------------------------
# ● 主处理
#--------------------------------------------------------------------------
def main
# 获取角色
@actor = $game_party.members[@actor_index]
# 生成帮助窗口、状态窗口、特技窗口
@help_window = Window_Help.new
@help_window.y = 56
@consum_window = Window_SLVconsum.new
@skill_window = Window_SLVindex.new(@actor)
@info_window = Window_SLVinfo.new(@skill_window.skill)
@choice_window = Window_SLVchoice.new(@skill_window.skill)
@choice_window.visible = false
@choice_window.active = false
# 关联帮助窗口
@skill_window.help_window = @help_window
# 执行过渡
Graphics.transition
# 主循环
loop do
# 刷新游戏画面
Graphics.update
# 刷新输入信息
Input.update
# 刷新画面
update
# 如果画面切换的话就中断循环
if $scene != self
break
end
end
# 准备过渡
Graphics.freeze
# 释放窗口
@help_window.dispose
@consum_window.dispose
@skill_window.dispose
@info_window.dispose
@choice_window.dispose
end
#--------------------------------------------------------------------------
# ● 刷新画面
#--------------------------------------------------------------------------
def update
# 刷新窗口
@help_window.update
@consum_window.update
@skill_window.update
@info_window.update
@choice_window.update
if @info_window.skill != @skill_window.skill
@info_window.skill = @skill_window.skill
@choice_window.skill = @skill_window.skill
@info_window.refresh
@choice_window.refresh
end
# 技能窗口被激活的情况下
if @skill_window.active
skill_update
return
end
# 选项窗口被激活的情况下
if @choice_window.active
choice_update
return
end
end
#--------------------------------------------------------------------------
# ● 刷新画面(选项)
#--------------------------------------------------------------------------
def choice_update
# 按下 B 键的情况下
if Input.trigger?(Input::B)
Sound.play_cancel
@choice_window.index = 0
@skill_window.active = true
@choice_window.visible = false
@choice_window.active = false
return
end
# 按下 C 键的情况下
if Input.trigger?(Input::C)
case @choice_window.index
when 0
item = $data_items[SLV::ITEMID]
number = $game_party.item_number(item)
upnum = SLV::SCONSUM[@skill.id]
upnum = SLV::ALLSCONSUM unless upnum
if number < upnum
Sound.play_buzzer
else
Audio.se_play("Audio/SE/Up",100,100)
$game_party.gain_item(item, -upnum)
@actor.forget_skill(@skill.id)
@actor.learn_skill(SLV::SLVUP[@skill.id])
@consum_window.refresh
@skill_window.refresh
@skill_window.active = true
@choice_window.visible = false
@choice_window.active = false
end
when 1
Sound.play_cancel
@choice_window.index = 0
@skill_window.active = true
@choice_window.visible = false
@choice_window.active = false
end
return
end
end
#--------------------------------------------------------------------------
# ● 刷新画面(技能)
#--------------------------------------------------------------------------
def skill_update
# 按下 B 键的情况下
if Input.trigger?(Input::B)
# 演奏取消 SE
Sound.play_cancel
# 切换到菜单画面
$scene = Scene_Menu.new(5)
return
end
# 按下 C 键的情况下
if Input.trigger?(Input::C)
Sound.play_decision
# 获取特技窗口现在选择的特技的数据
@skill = @skill_window.skill
unless SLV::SLVUP.include?(@skill.id)
Sound.play_buzzer
return
end
@skill_window.active = false
@choice_window.visible = true
@choice_window.active = true
return
end
# 按下 R 键的情况下
if Input.trigger?(Input::R)
# 演奏光标 SE
Sound.play_cursor
# 移至下一位角色
@actor_index += 1
@actor_index %= $game_party.members.size
# 切换到别的特技画面
$scene = Scene_SLV.new(@actor_index)
return
end
# 按下 L 键的情况下
if Input.trigger?(Input::L)
# 演奏光标 SE
Sound.play_cursor
# 移至上一位角色
@actor_index += $game_party.members.size - 1
@actor_index %= $game_party.members.size
# 切换到别的特技画面
$scene = Scene_SLV.new(@actor_index)
return
end
end
end
复制代码
作者:
鑫磊
时间:
2013-8-22 13:17
咋用呢?
欢迎光临 Project1 (https://rpg.blue/)
Powered by Discuz! X3.1