赞 | 0 |
VIP | 0 |
好人卡 | 0 |
积分 | 1 |
经验 | 436 |
最后登录 | 2013-8-10 |
在线时间 | 12 小时 |
Lv1.梦旅人
- 梦石
- 0
- 星屑
- 50
- 在线时间
- 12 小时
- 注册时间
- 2013-7-11
- 帖子
- 15
|
加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有帐号?注册会员
x
本帖最后由 HeRo_SKY 于 2013-7-12 12:30 编辑
为什么我的技能按键增强的脚本里技能ID都写的好好的,但是只有个别技能出现按键增强的效果。同一个技能移到不同的但在脚本中写了的技能ID,那个本来有效果的也出不来了。
#====================================================
# 按键威力加成 Ver.1.3.0 by Claimh sphinger汉化修改
# 本脚本来自www.66rpg.com,转载和使用请保留注释,方便来者
#--------------------------------------------------------------------
# 功能添加:柳柳
#
# 添加修改说明:1、在T_SKILL设置技能的加成按键和威力的加成比例。
# 威力加成可以使用随机数
# 2、窗口目前是可以输入很多内容,并且会自动滚动
# 3、添加困难指令个数的数量限制
# 4、添加随机生成指令的功能,指令处直接给定一个数字就是随机出来的指令个数
# 如果给定一个字符串的数字,比如 "15" 这样,则是只有上下左右构成的随机指令15个。
#
# 范例研究方法:用默认工程,给希露达(魔法师)学会7、8、9号技能(也就是火系的三招)
# 然后使用这三招就知道了。
#
# 可能会用到的窗口修改:class Window_KeyCounter,描绘血槽的窗口
# class Window_KeyCount,描绘按键的窗口。你可以恶搞地把它弄成跳舞机
#====================================================
#==============================================================================
# 按键威力加成 Ver.1.3.0 by Claimh sphinger汉化修改
# 本脚本来自www.66rpg.com,转载和使用请保留注释,方便来者
#------------------------------------------------------------------------------
# 功能添加:柳柳
#
# 添加修改说明:1、在T_SKILL设置技能的加成按键和威力的加成比例。
# 威力加成可以使用随机数
# 2、窗口目前是可以输入很多内容,并且会自动滚动
# 3、添加困难指令个数的数量限制
# 4、添加随机生成指令的功能,指令处直接给定一个数字就是随机出来的指令个数
# 如果给定一个字符串的数字,比如 "15" 这样,则是只有上下左右构成的随机指令15个。
#
# 范例研究方法:用默认工程,给希露达(魔法师)学会7、8、9号技能(也就是火系的三招)
# 然后使用这三招就知道了。
#
# 可能会用到的窗口修改:class Window_KeyCounter,描绘血槽的窗口
# class Window_KeyCount,描绘按键的窗口。你可以恶搞地把它弄成跳舞机
#==============================================================================
module TacticalSkill
#==============================================================================
# START
#==============================================================================
# 按键设定
A = Input::A # 对应按键:Z
B = Input::B # 对应按键:X
C = Input::C # 对应按键:C
X = Input::X # 对应按键:A
Y = Input::Y # 对应按键:S
Z = Input::Z # 对应按键:D
L = Input::L # 对应按键:Q
R = Input::R # 对应按键:W
UP = Input::UP
DOWN = Input::DOWN
LEFT = Input::LEFT
RIGHT = Input::RIGHT
# 时间的快慢调整,越大越慢
KEY_SEC = 0.5
# 时间条显示自己放个150*10的就可以了,放在(Graphics/Windowskins/)下就可以拉
T_BAR_NAME = "bar"
T_HARD_NUMBER = 8 # 确定输入多少个的时候开始算做困难指令
# 困难指令给的时间不会按照按键数量增多而增长
# 技能设定
T_SKILL = {#技能ID => [[按键1,按键2,……,按键N],技能攻击力加成]
30 => ["4", 30], 31 => ["6", 100], 32 => ["8", 110], 33 => ["10", 210],
34 => ["4", 30], 35 => ["6", 100], 36 => ["8", 110], 37 => ["10", 210],
38 => ["4", 30], 39 => ["6", 100], 40 => ["8", 110], 41 => ["10", 500],
42 => ["4", 30], 43 => ["6", 100], 44 => ["8", 110], 45 => ["10", 210],
46 => ["4", 30], 47 => ["6", 100], 48 => ["8", 110], 49 => ["10", 210],
50 => ["4", 30], 51 => ["6", 100], 52 => ["8", 110], 53 => ["10", 210],
54 => ["4", 30], 55 => ["6", 100], 56 => ["8", 110], 57 => ["10", 210],
132 => ["6", 80], 133 => ["10", 200],
60 => ["8", 80], 108 => ["6", 60],
63 => ["6", 60],
79 => ["10", 100], 80 => ["10", 300],
98 => ["10", 210]
}
#==============================================================================
# END
#==============================================================================
end
#==============================================================================
# Input
#==============================================================================
module Input
module_function
#--------------------------------------------------------------------------
#--------------------------------------------------------------------------
def n_trigger?(num)
if trigger?(num)
return false
elsif trigger?(A) or trigger?(B) or trigger?(C) or
trigger?(X) or trigger?(Y) or trigger?(Z) or
trigger?(L) or trigger?(R) or
trigger?(UP) or trigger?(DOWN) or trigger?(RIGHT) or trigger?(LEFT)
return true
end
return false
end
#--------------------------------------------------------------------------
#--------------------------------------------------------------------------
def key_converter(key)
# 按键对应的字母或文字
case key
when A
return "Z"
when B
return "X"
when C
return "C"
when X
return "A"
when Y
return "S"
when Z
return "D"
when L
return "Q"
when R
return "W"
when UP
return "上"
when DOWN
return "下"
when LEFT
return "左"
when RIGHT
return "右"
end
end
end
#==============================================================================
# Game_Battler
#==============================================================================
class Game_Battler
# attr_accessor :tact_flag
#--------------------------------------------------------------------------
#--------------------------------------------------------------------------
# alias initialize_tactical initialize
# def initialize
# initialize_tactical #
# @tact_flag = false
# end
#--------------------------------------------------------------------------
# user :
# skill :
#--------------------------------------------------------------------------
alias skill_effect_tactical skill_effect
def skill_effect(user, skill)
skill_copy = $data_skills[skill.id].dup
if $game_switches[8] == true
skill.power += 1 + TacticalSkill::T_SKILL[skill.id][1]
end
$game_switches[8] = false
skill.hit = 0 if skill.power == 0
ret = skill_effect_tactical(user, skill)
user.tact_flag = false
$data_skills[skill.id] = skill_copy.dup
return ret
end
end
#==============================================================================
# Scene_Battle
#==============================================================================
class Scene_Battle
def make_rand_tact(ini)
b = []
for i in 0...ini
case rand(12).to_i
when 0
b.push(Input::A)
when 1
b.push(Input::B)
when 2
b.push(Input::C)
when 3
b.push(Input::X)
when 4
b.push(Input::Y)
when 5
b.push(Input::Z)
when 6
b.push(Input::L)
when 7
b.push(Input::R)
when 8
b.push(Input::RIGHT)
when 9
b.push(Input::UP)
when 10
b.push(Input::LEFT)
when 11
b.push(Input::DOWN)
end
end
return b
end
def make_rand_tact4(ini)
b = []
for i in 0...ini
case rand(4).to_i
when 0
b.push(Input::RIGHT)
when 1
b.push(Input::UP)
when 2
b.push(Input::LEFT)
when 3
b.push(Input::DOWN)
end
end
return b
end
#--------------------------------------------------------------------------
#--------------------------------------------------------------------------
def make_tactical_skill_result
ta = @active_battler.current_action.skill_id
ta2 = $data_skills[ta].att
if @active_battler.att != ta2
return false
end
tact_skill = TacticalSkill::T_SKILL[@active_battler.current_action.skill_id][0]
if tact_skill.is_a?(Numeric)
a = tact_skill
tact_skill = make_rand_tact(a)
elsif tact_skill.is_a?(String)
a = tact_skill.to_i
tact_skill = make_rand_tact4(a)
end
time = TacticalSkill::KEY_SEC * [tact_skill.size,TacticalSkill::T_HARD_NUMBER].min * Graphics.frame_rate
key_count = 0
@active_battler.tact_flag = true
window_keycount = Window_KeyCount.new(tact_skill)
window_counter = Window_KeyCounter.new
actor_x = @active_battler.index * 160
# window_keycount.x = window_counter.x = actor_x
window_keycount.x = 0
window_counter.x = 0
window_keycount.y = 160
window_counter.y = 190
@a = Sprite.new
@a.bitmap = RPG::Cache.title("窗体2.png")
for i in 0...time
if Input.trigger?(tact_skill[key_count])
key_count += 1
window_keycount.key_in
elsif Input.n_trigger?(tact_skill[key_count])
break
end
# 如果成功
if key_count >= tact_skill.size
window_keycount.text_in("成功")
# 成功提示音
Audio.se_play("Audio/SE/056-Right02")
@active_battler.tact_flag = false
common_event = $data_common_events[7]
$game_system.battle_interpreter.setup($data_common_events[7].list, 0)
# 成功与失败后的处理
for i in 0...10
Graphics.update
@spriteset.update
end
window_keycount.dispose
window_counter.dispose
@a.dispose
$game_switches[8] = true
return true
end
# 刷新
window_counter.refresh((i*100/time).truncate)
Graphics.update
Input.update
end
# 如果失败
if @active_battler.tact_flag
#失败提示音
Audio.se_play("Audio/SE/057-Wrong01")
window_keycount.text_in("失败")
end
# 成功与失败后的处理
for i in 0...10
Graphics.update
@spriteset.update
end
window_keycount.dispose
window_counter.dispose
@a.dispose
$game_switches[8] = false
return false
end
end
#==============================================================================
# Window_Base
#==============================================================================
class Window_Base < Window
#--------------------------------------------------------------------------
#--------------------------------------------------------------------------
def draw_counter_bar(x, y, current)
bitmap = RPG::Cache.windowskin(TacticalSkill::T_BAR_NAME)
cw = bitmap.width * current / 100
ch = bitmap.height
src_rect = Rect.new(0, 0, cw, ch)
self.contents.blt(x, y, bitmap, src_rect)
end
end
#==============================================================================
# Window_KeyCounter
#==============================================================================
class Window_KeyCounter < Window_Base
#--------------------------------------------------------------------------
# 输入窗口的描绘
#--------------------------------------------------------------------------
def initialize
super(0, 256, 160, 80)
self.contents = Bitmap.new(width - 32, height - 32)
self.opacity = 0
self.z = 1
refresh(0)
end
#--------------------------------------------------------------------------
#--------------------------------------------------------------------------
def refresh(current)
self.contents.clear
draw_counter_bar(0, 0, current)
end
end
#==============================================================================
# Window_KeyCount
#------------------------------------------------------------------------------
#
#==============================================================================
class Window_KeyCount < Window_Base
#--------------------------------------------------------------------------
#--------------------------------------------------------------------------
def initialize(key)
super(0, 230, 160, 80)
self.contents = Bitmap.new(width - 32, height - 32)
self.opacity = 0
self.z = 0
@key = key
@key_count = 0
refresh
end
#--------------------------------------------------------------------------
#--------------------------------------------------------------------------
def refresh
self.contents.clear
for i in [email protected]
if @key.size > 4
if @key_count >= 3
x = (i- @key_count+2)*32
else
x = i *32
end
else
x = i * 32
end
if i < @key_count
self.contents.font.color = disabled_color
self.contents.font.size = 16
elsif i== @key_count
self.contents.font.color = normal_color
self.contents.font.size = 25
else
self.contents.font.color = disabled_color
self.contents.font.size = 18
end
self.contents.draw_text(x, 0, 100, 32, Input.key_converter(@key))
end
end
#--------------------------------------------------------------------------
#--------------------------------------------------------------------------
def key_in
@key_count += 1
refresh
end
#--------------------------------------------------------------------------
#--------------------------------------------------------------------------
def text_in(text)
self.contents.clear
self.contents.font.size = 20
self.contents.draw_text(0, 0, 130, 32, text, 1)
end
end
=begin
=end |
|