Project1
标题:
【只有一小段】脚本帮忙,很简单。大家进。
[打印本页]
作者:
sd358314
时间:
2009-5-19 23:29
标题:
【只有一小段】脚本帮忙,很简单。大家进。
我准备根据队伍的角色多少来确定每个角色在战斗中的位置
怎么写这句话: 如果队伍中有1个队员
帮忙将上面那句话翻译成语言。
是否还需要定义些什么?
脚本新手请大家帮忙 。
作者:
失去的记忆
时间:
2009-5-19 23:34
#==============================================================================
# 本脚本来自www.66RPG.com,使用和转载请保留此信息
#==============================================================================
class Window_BattleStatus < Window_Base
#--------------------------------------------------------------------------
# ● 初始化对像
#--------------------------------------------------------------------------
def initialize
super(320 - $game_party.actors.size*80, 340, 160*$game_party.actors.size, 140)
@w = []
for i in 0..$game_party.actors.size-1
@w[i] = Window_Base.new(320 - $game_party.actors.size*80 + i*160,340,160,140)
@w[i].back_opacity = 0
end
self.contents = Bitmap.new(width - 32, height - 32)
@level_up_flags = [false, false, false, false]
@hp = []
for j in 0...$game_party.actors.size
@hp[j] = $game_party.actors[j].hp
end
@refresh_flag = true
refresh
end
#--------------------------------------------------------------------------
# ● 释放
#--------------------------------------------------------------------------
def dispose
super
for w in @w
w.dispose
end
end
#--------------------------------------------------------------------------
# ● 设置升级标志
# actor_index : 角色索引
#--------------------------------------------------------------------------
def level_up(actor_index)
@level_up_flags[actor_index] = true
end
#--------------------------------------------------------------------------
# ● 刷新
#--------------------------------------------------------------------------
def refresh
self.contents.clear
@item_max = $game_party.actors.size
for i in 0...$game_party.actors.size
actor = $game_party.actors[i]
actor_x = i * 160 + 4
draw_actor_name(actor, actor_x, 0)
draw_actor_hp(@hp[i], actor_x, 32, 120)
draw_actor_sp(actor, actor_x, 64, 120)
if @level_up_flags[i]
self.contents.font.color = normal_color
self.contents.draw_text(actor_x, 96, 120, 32, "升级!")
else
draw_actor_state(actor, actor_x, 96)
end
end
@refresh_flag = false
end
#--------------------------------------------------------------------------
# ● 描绘 HP
# actor : 角色
# x : 描画目标 X 坐标
# y : 描画目标 Y 坐标
# width : 描画目标的宽
#--------------------------------------------------------------------------
def draw_actor_hp(number, x, y, width = 144)
# 描绘字符串 "HP"
self.contents.font.color = system_color
self.contents.draw_text(x, y, 32, 32, $data_system.words.hp)
self.contents.font.color = normal_color
self.contents.draw_text(x+72, y, 48, 32, number.to_s, 2)
end
#--------------------------------------------------------------------------
# ● 刷新画面
#--------------------------------------------------------------------------
def update
super
# 主界面的不透明度下降
if $game_temp.battle_main_phase
self.contents_opacity -= 4 if self.contents_opacity > 191
else
self.contents_opacity += 4 if self.contents_opacity < 255
end
for i in 0...$game_party.actors.size
if @hp[i] != $game_party.actors[i].hp
@refresh_flag = true
if @hp[i] > $game_party.actors[i].hp
@hp[i] -= 1
else
@hp[i] += 1
end
refresh if @refresh_flag
end
end
end
end
#==============================================================================
# 本脚本来自www.66RPG.com,使用和转载请保留此信息
#==============================================================================
复制代码
LZ想要的效果是这个吧!
自己去试试吧! 具体的我也说不清。。 先去试一下就知道了{/cy}{/cy}
作者:
66rpg学习
时间:
2009-5-19 23:46
提示:
作者被禁止或删除 内容自动屏蔽
作者:
sd358314
时间:
2009-5-20 02:21
谢谢
作者:
66rpg学习
时间:
2009-5-20 03:50
提示:
作者被禁止或删除 内容自动屏蔽
作者:
tommay
时间:
2009-5-20 03:51
以下引用
66rpg学习于2009-5-19 19:50:53
的发言:
我无语,,连这好几个这样的 请你点认可答案可以么 不要直接结帖
你可以去提问区申诉贴申诉。
欢迎光临 Project1 (https://rpg.blue/)
Powered by Discuz! X3.1