- 注册时间
- 2006-9-24
- 最后登录
- 2019-5-19
⑥精研
- 积分
- 1290
|
XAS的脚本对一些特殊物品定义为可装备
Mog Scene Item则对物品界面进行美化
两者只能显示其一,请问有无方法解决啊?
XAS中我觉得关键的就这段了
#===============================================================================
# XAS - SCENE_ITEM_AX
#===============================================================================
module XAS_WINDOW_ITEM
#Definição da ID do item que ativará a Ferramenta ID.
# XASITEM_ID = {A=>B, A=>B,...}
# A = ID do Item
# B = ID da Ferramenta
XASITEM_ID = {
# A B Nome do item
1=>8, # Potion
2=>9, # HI-Potion
3=>10, # Ether
4=>11, # HI-Ether
5=>12, # Remedy
6=>13, # Elixir
7=>14 # Bomb
}
#Texto de item Equipado.
EQUIPPED = "Equipado"
#Texto de ajuda inicial.
PRESS = " ressione C para Equipar"
#Botão para equipar o item.
BUTTON = Input::C
end
#===============================================================================
这是SC的脚本
##############
# Scene_Item #
##############
class Scene_Item
def main
@back = Plane.new
@back.bitmap = RPG::Cache.picture("MN_BK")
@back.z = 100
@item_lay = Sprite.new
@item_lay.bitmap = RPG::Cache.picture("Item_lay")
@item_lay.z = 100
@item_com = Sprite.new
@item_com.bitmap = RPG::Cache.picture("Item_com01")
@item_com.z = 100
@type = Window_Type.new
@type.opacity = 0
@type.visible = false
@help_window = Window_Help.new
@help_window.y = 405
@item_window = Window_Item_Ex.new
@item_window.help_window = @help_window
@item_window.visible = true
@item_window.active = true
@weapon_window = Window_Weapon.new
@weapon_window.help_window = @help_window
@weapon_window.visible = false
@weapon_window.active = true
@armor_window = Window_Armor.new
@armor_window.help_window = @help_window
@armor_window.visible = false
@armor_window.active = true
@target_window = Window_Target_Item.new
@target_window.x = -300
@target_window.active = false
@help_window.opacity = 0
@help_window.x = -200
@help_window.contents_opacity = 0
@item_window.opacity = 0
@weapon_window.opacity = 0
@armor_window.opacity = 0
@target_window.opacity = 0
@weapon_window.x = 640
@armor_window.x = 640
@item_window.x = 640
@weapon_window.contents_opacity = 0
@armor_window.contents_opacity = 0
@item_window.contents_opacity = 0
Graphics.transition(MOG::MNIT, "Graphics/Transitions/" + MOG::MNITT)
loop do
Graphics.update
Input.update
update
if $scene != self
break
end
end
for i in 0..30
@weapon_window.x += 20
@armor_window.x += 20
@item_window.x += 20
@weapon_window.contents_opacity -= 15
@armor_window.contents_opacity -= 15
@item_window.contents_opacity -= 15
@item_lay.zoom_x += 0.2
@item_lay.opacity -= 15
@item_com.zoom_y += 0.2
@item_com.opacity -= 15
@target_window.x -= 15
@help_window.contents_opacity -= 15
@back.ox += 1
Graphics.update
end
Graphics.freeze
@help_window.dispose
@item_window.dispose
@weapon_window.dispose
@armor_window.dispose
@target_window.dispose
@item_lay.dispose
@back.dispose
@item_com.dispose
@type.dispose
end
def update
if @target_window.active == true
@target_window.visible = true
if @target_window.x < 0
@target_window.x += 20
elsif @target_window.x >= 0
@target_window.x = 0
end
else
if @target_window.x > -300
@target_window.x -= 20
elsif @target_window.x >= -300
@target_window.x = -300
@target_window.visible = false
end
end
if @help_window.x < 0
@help_window.x += 10
@help_window.contents_opacity += 15
elsif @help_window.x >= 0
@help_window.x = 0
@help_window.contents_opacity = 255
end
if @item_window.x > 250
@weapon_window.x -= 20
@armor_window.x -= 20
@item_window.x -= 20
@weapon_window.contents_opacity += 15
@armor_window.contents_opacity += 15
@item_window.contents_opacity += 15
elsif @item_window.x <= 250
@weapon_window.x = 250
@armor_window.x = 250
@item_window.x = 250
@weapon_window.contents_opacity = 250
@armor_window.contents_opacity = 250
@item_window.contents_opacity = 250
end
if @target_window.active == false
if Input.trigger?(Input::RIGHT) or Input.trigger?(Input: EFT) or
Input.press?(Input::RIGHT) or Input.press?(Input: EFT)
@weapon_window.x = 640
@armor_window.x = 640
@item_window.x = 640
@weapon_window.contents_opacity = 0
@armor_window.contents_opacity = 0
@item_window.contents_opacity = 0
end
if Input.trigger?(Input.dir4) or Input.trigger?(Input.dir4) or
Input.trigger?(Input: ) or Input.trigger?(Input::R)
@help_window.x = -200
@help_window.contents_opacity = 0
end
end
@back.ox += 1
@help_window.update
@item_window.update
@weapon_window.update
@armor_window.update
@target_window.update
@type.update
case @type.index
when 0
@item_com.bitmap = RPG::Cache.picture("Item_com01")
if @target_window.active == true
update_target
@item_window.active = false
@type.active = false
return
else
@item_window.active = true
@type.active = true
end
@weapon_window.active = false
@armor_window.active = false
@item_window.visible = true
@weapon_window.visible = false
@armor_window.visible = false
when 1
@item_com.bitmap = RPG::Cache.picture("Item_com02")
@item_window.active = false
@weapon_window.active = true
@armor_window.active = false
@item_window.visible = false
@weapon_window.visible = true
@armor_window.visible = false
when 2
@item_com.bitmap = RPG::Cache.picture("Item_com03")
@item_window.active = false
@weapon_window.active = false
@armor_window.active = true
@item_window.visible = false
@weapon_window.visible = false
@armor_window.visible = true
end
if @item_window.active
update_item
return
end
if @weapon_window.active
update_weapon
return
end
if @armor_window.active
update_armor
return
end
end
def update_weapon
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
$scene = Scene_Menu.new(0)
return
end
end
def update_armor
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
$scene = Scene_Menu.new(0)
return
end
end
def update_item
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
$scene = Scene_Menu.new(0)
return
end
if Input.trigger?(Input::C)
@item = @item_window.item
unless @item.is_a?(RPG::Item)
$game_system.se_play($data_system.buzzer_se)
return
end
unless $game_party.item_can_use?(@item.id)
$game_system.se_play($data_system.buzzer_se)
return
end
$game_system.se_play($data_system.decision_se)
if @item.scope >= 3
@item_window.active = false
@target_window.x = (@item_window.index + 1) % 1 * 304
@target_window.active = true
@target_window.x = -350
if @item.scope == 4 || @item.scope == 6
@target_window.index = -1
else
@target_window.index = 0
end
else
if @item.common_event_id > 0
$game_temp.common_event_id = @item.common_event_id
$game_system.se_play(@item.menu_se)
if @item.consumable
$game_party.lose_item(@item.id, 1)
@item_window.draw_item(@item_window.index)
end
$scene = Scene_Map.new
return
end
end
return
end
end
def update_target
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
unless $game_party.item_can_use?(@item.id)
@item_window.refresh
end
@item_window.active = true
@target_window.active = false
return
end
if Input.trigger?(Input::C)
if $game_party.item_number(@item.id) == 0
$game_system.se_play($data_system.buzzer_se)
return
end
if @target_window.index == -1
used = false
for i in $game_party.actors
used |= i.item_effect(@item)
end
end
if @target_window.index >= 0
target = $game_party.actors[@target_window.index]
used = target.item_effect(@item)
end
if used
$game_system.se_play(@item.menu_se)
if @item.consumable
$game_party.lose_item(@item.id, 1)
@item_window.draw_item(@item_window.index)
end
@target_window.refresh
if $game_party.all_dead?
$scene = Scene_Gameover.new
return
end
if @item.common_event_id > 0
$game_temp.common_event_id = @item.common_event_id
$scene = Scene_Map.new
return
end
end
unless used
$game_system.se_play($data_system.buzzer_se)
end
return
end
end |
|