Project1
标题:
图标战斗脚本 与 战斗更换武器脚本 的问题
[打印本页]
作者:
deadcz5
时间:
2008-2-2 21:56
标题:
图标战斗脚本 与 战斗更换武器脚本 的问题
http://rpg.blue/web/htm/news61.htm 图标战斗
http://rpg.blue/web/htm/news902.htm 战斗更换武器
我之前是使用的图标战斗脚本,这个脚本里默认的是4个战斗选项图标化,战斗,特技,防御,物品,然后在之后使用了战斗更换武器脚本,就会多出了一项,更换武器,请问如何将更换武器这一项也用在图标战斗里呢
[LINE]1,#dddddd[/LINE]
如果问题未解决,请继续提问
如果问题已解决,请结贴
若到末贴发贴时间后一周仍未结贴
管理员会自动为你过期帖子、结贴或强行认可答案(好人卡-1)
[LINE]1,#dddddd[/LINE]
此贴于 2008-2-16 6:53:51 被版主凌冰提醒,请楼主看到后对本贴做出回应。
[LINE]1,#dddddd[/LINE]
版务信息:版主帮忙结贴~
作者:
水迭澜
时间:
2008-2-2 22:16
要改Window_CommandIcon嗯嗯- -
因为两个脚本运用的不是同一个战斗选单……
整合起来不难但还挺麻烦的=v=+
作者:
deadcz5
时间:
2008-2-2 22:21
拜求整合OTL
作者:
水迭澜
时间:
2008-2-2 22:39
这个啊
我看不如把图标战斗脚本做成能扩展的通用版好了{/hx}
等俺有空慢慢研究……虽然LZ一定会打我……
作者:
deadcz5
时间:
2008-2-10 23:05
继续求整合。。OTL
作者:
凌冰
时间:
2008-2-11 01:47
#==========================================================================
# 本脚本来自www.66RPG.com,使用和转载请保留此信息
#==========================================================================
module Momo_IconCommand
# 图标名称设定
ATTACK_ICON_NAME = "001-Weapon01" # 攻撃
SKILL_ICON_NAME = "044-Skill01" # 特技
GUARD_ICON_NAME = "009-Shield01" # 防御
ITEM_ICON_NAME = "032-Item01" # 物品
WEAPON_ICON_NAME = "001-Weapon01"
# X坐标修正
X_PLUS = -40
# Y坐标修正
Y_PLUS = -180
# 选择时图标的动作
# 0:静止 1:放大
SELECT_TYPE = 0
# 闪烁时光芒的颜色
FLASH_COLOR = Color.new(255, 255, 255, 128)
# 闪烁时间
FLASH_DURATION = 10
# 闪烁间隔
FLASH_INTERVAL = 20
# 是否写出文字的名称
COM_NAME_DROW = true
# 文字名称是否移动
COM_NAME_MOVE = true
# 文字内容
ATTACK_NAME = "攻击" # 攻击
SKILL_NAME = "特技" # 特技
GUARD_NAME = "防御" # 防御
ITEM_NAME = "物品" # 物品
WEAPON_NAME = "更换武器"
# 文字颜色
COM_NAME_COLOR = Color.new(255, 255, 255, 255)
# 文字坐标修正
COM_NAME_X_PLUS = 0
COM_NAME_Y_PLUS = 0
end
class Window_CommandIcon < Window_Selectable
attr_accessor :last_index
#------------------------------------------------------------------------
# ● オブジェクト初期化
#------------------------------------------------------------------------
def initialize(x, y, commands)
super(x, y, 32, 32)
# ウィンドウスキンに空文字列を指定してウィンドウを描画しないようにする
self.windowskin = RPG::Cache.windowskin("")
@item_max = commands.size
@commands = commands
@column_max = commands.size
@index = 0
@last_index = nil
@name_sprite = nil
@sprite = []
refresh
end
def dispose
super
for sprite in @sprite
sprite.dispose unless sprite.nil?
end
@name_sprite.dispose unless @name_sprite.nil?
end
#------------------------------------------------------------------------
# ● リフレッシュ
#------------------------------------------------------------------------
def refresh
@name_sprite.dispose unless @name_sprite.nil?
for sprite in @sprite
sprite.dispose unless sprite.nil?
end
@name_sprite = nil
draw_com_name if Momo_IconCommand::COM_NAME_DROW
@sprite = []
for i in 0...@item_max
draw_item(i)
end
end
#------------------------------------------------------------------------
# ● 項目の描画
#------------------------------------------------------------------------
def draw_item(index)
@sprite[index] = Sprite_Icon.new(nil, @commands[index])
@sprite[index].z = self.z + 1
end
def draw_com_name
@name_sprite = Sprite_Comm_Name.new(nil, get_com_name)
end
# 更新
def update
super
icon_update
com_name_update if Momo_IconCommand::COM_NAME_DROW
if move_index?
@last_index = self.index
end
end
# アイコンの更新
def icon_update
for i in
[email protected]
@sprite[i].active = (self.index == i)
@sprite[i].x = self.x + i * 24
@sprite[i].y = self.y + 0
@sprite[i].z = (self.index == i) ? self.z + 2 : self.z + 1
@sprite[i].visible = self.visible
@sprite[i].update
end
end
# コマンドネームの更新
def com_name_update
if move_index?
@name_sprite.name = get_com_name
end
@name_sprite.x = self.x - 12 + Momo_IconCommand::COM_NAME_X_PLUS
@name_sprite.y = self.y - 40 + Momo_IconCommand::COM_NAME_Y_PLUS
@name_sprite.z = self.z + 1
@name_sprite.active = self.active
@name_sprite.visible = self.visible
@name_sprite.update
end
def get_com_name
make_name_set if @name_set.nil?
name = @name_set[self.index]
name = "" if name.nil?
return name
end
def make_name_set
@name_set = []
@name_set[0] = Momo_IconCommand::ATTACK_NAME
@name_set[1] = Momo_IconCommand::SKILL_NAME
@name_set[2] = Momo_IconCommand::GUARD_NAME
@name_set[3] = Momo_IconCommand::ITEM_NAME
@name_set[4] = Momo_IconCommand::WEAPON_NAME
end
def move_index?
return self.index != @last_index
end
def need_reset
@name_sprite.need_reset = true if Momo_IconCommand::COM_NAME_DROW
end
end
# アイコン用スプライト
class Sprite_Icon < Sprite
attr_accessor :active
attr_accessor :icon_name
#------------------------------------------------------------------------
# ● オブジェクト初期化
#------------------------------------------------------------------------
def initialize(viewport, icon_name)
super(viewport)
@icon_name = icon_name
@last_icon = @icon_name
@count = 0
self.bitmap = RPG::Cache.icon(@icon_name)
self.ox = self.bitmap.width / 2
self.oy = self.bitmap.height / 2
@active = false
end
#------------------------------------------------------------------------
# ● 解放
#------------------------------------------------------------------------
def dispose
if self.bitmap != nil
self.bitmap.dispose
end
super
end
#------------------------------------------------------------------------
# ● フレーム更新
#------------------------------------------------------------------------
def update
super
if @icon_name != @last_icon
@last_icon = @icon_name
self.bitmap = RPG::Cache.icon(@icon_name)
end
if @active
@count += 1
case Momo_IconCommand::SELECT_TYPE
when 0
icon_flash
when 1
icon_zoom
end
@count = 0 if @count == 20
else
icon_reset
end
end
def icon_flash
if @count % Momo_IconCommand::FLASH_INTERVAL == 0 or @count == 1
self.flash(Momo_IconCommand::FLASH_COLOR, Momo_IconCommand::FLASH_DURATION)
end
end
def icon_zoom
case @count
when 1..10
zoom = 1.0 + @count / 10.0
when 11..20
zoom = 2.0 - (@count - 10) / 10.0
end
self.zoom_x = zoom
self.zoom_y = zoom
end
def icon_reset
@count = 0
self.zoom_x = 1.0
self.zoom_y = 1.0
end
end
# コマンドネーム用スプライト
class Sprite_Comm_Name < Sprite
attr_accessor :active
attr_accessor :name
attr_accessor :need_reset
#------------------------------------------------------------------------
# ● オブジェクト初期化
#------------------------------------------------------------------------
def initialize(viewport, name)
super(viewport)
@name = name
@last_name = nil
@count = 0
@x_plus = 0
@opa_plus = 0
@need_reset = false
@active = false
self.bitmap = Bitmap.new(160, 32)
end
#------------------------------------------------------------------------
# ● 解放
#------------------------------------------------------------------------
def dispose
if self.bitmap != nil
self.bitmap.dispose
end
super
end
#------------------------------------------------------------------------
# ● フレーム更新
#------------------------------------------------------------------------
def update
super
if @active
if need_reset?
@need_reset = false
@last_name = @name
text_reset
end
move_text if Momo_IconCommand::COM_NAME_MOVE
end
end
def move_text
@count += 1
@x_plus = [@count * 8, 80].min
self.x = self.x - 80 + @x_plus
self.opacity = @count * 25
end
def text_reset
@count = 0
@x_plus = 0
self.bitmap.clear
self.bitmap.font.color = Momo_IconCommand::COM_NAME_COLOR
self.bitmap.draw_text(0, 0, 160, 32, @name)
end
def need_reset?
return (@name != @last_name or @need_reset)
end
end
class Scene_Battle
#------------------------------------------------------------------------
# ● プレバトルフェーズ開始
#------------------------------------------------------------------------
alias scene_battle_icon_command_start_phase1 start_phase1
def start_phase1
com1 = Momo_IconCommand::ATTACK_ICON_NAME
com2 = Momo_IconCommand::SKILL_ICON_NAME
com3 = Momo_IconCommand::GUARD_ICON_NAME
com4 = Momo_IconCommand::ITEM_ICON_NAME
com5 = Momo_IconCommand::WEAPON_ICON_NAME
@actor_command_window = Window_CommandIcon.new(0, 0, [com1, com2, com3, com4,com5])
@actor_command_window.y = 160
@actor_command_window.back_opacity = 160
@actor_command_window.active = false
@actor_command_window.visible = false
@actor_command_window.update
scene_battle_icon_command_start_phase1
end
#------------------------------------------------------------------------
# ● アクターコマンドウィンドウのセットアップ
#------------------------------------------------------------------------
alias scene_battle_icon_command_phase3_setup_command_window phase3_setup_command_window
def phase3_setup_command_window
scene_battle_icon_command_phase3_setup_command_window
# アクターコマンドウィンドウの位置を設定
@actor_command_window.x = command_window_actor_x(@actor_index)
@actor_command_window.y = command_window_actor_y(@actor_index)
@actor_command_window.need_reset
end
def command_window_actor_x(index)
$game_party.actors[index].screen_x + Momo_IconCommand::X_PLUS
end
def command_window_actor_y(index)
$game_party.actors[index].screen_y + Momo_IconCommand::Y_PLUS
end
end
#==========================================================================
# 本脚本来自www.66RPG.com,使用和转载请保留此信息
#==========================================================================
复制代码
[LINE]1,#dddddd[/LINE]
系统信息:本贴由本区版主认可为正确答案,66RPG感谢您的热情解答~
作者:
凌冰
时间:
2008-2-11 01:48
测试过了,默认的系统是兼容的
作者:
凌冰
时间:
2008-2-11 01:49
把 图标战斗 改成这样
战斗更换武器 保留 [LINE]1,#dddddd[/LINE]
版主对此帖的评论:『那啥……有话一个回帖里面说清楚,不要连贴。』,积分『-5』。这些被扣积分的一半会用于对本帖正确答案的悬赏。
作者:
凌冰
时间:
2008-2-11 01:51
也不是很难
因为刚刚做过RTAB横板的图标战斗
所以手到擒来 [LINE]1,#dddddd[/LINE]
版主对此帖的评论:『=口=,你有看到我上面的评论吗?』,积分『-0』。这些被扣积分的一半会用于对本帖正确答案的悬赏。
作者:
凌冰
时间:
2008-2-12 00:49
我还等着结帖呢?
欢迎光临 Project1 (https://rpg.blue/)
Powered by Discuz! X3.1