Project1
标题:
有没人愿意帮我修改一脚本
[打印本页]
作者:
痒死我了
时间:
2010-7-28 20:03
标题:
有没人愿意帮我修改一脚本
本帖最后由 痒死我了 于 2010-7-29 20:22 编辑
这个是云版的得失物品提示
问题是提示时背景涂成了白色
因为我不懂改脚本F1中的学习也还没精通,
所以我以很低的姿态和诚挚的态度请大神们帮我修改一下:
将背景的白色去除。
谢谢了!!!
class Game_Interpreter
UnShowSwitch = 5 #禁止显示提示开关
GainSe = "Audio/SE/Recovery.ogg"
LoseSe = "Audio/SE/Raise2.ogg"
#--------------------------------------------------------------------------
# ● 增减金钱
#--------------------------------------------------------------------------
def command_125
value = operate_value(@params[0], @params[1], @params[2])
$game_party.gain_gold(value)
show_window(0,value) unless $game_switches[UnShowSwitch]
return true
end
#--------------------------------------------------------------------------
# ● 增减物品
#--------------------------------------------------------------------------
def command_126
value = operate_value(@params[1], @params[2], @params[3])
$game_party.gain_item($data_items[@params[0]], value)
$game_map.need_refresh = true
show_window(1,value,@params[0]) unless $game_switches[UnShowSwitch]
return true
end
#--------------------------------------------------------------------------
# ● 增减武器
#--------------------------------------------------------------------------
def command_127
value = operate_value(@params[1], @params[2], @params[3])
$game_party.gain_item($data_weapons[@params[0]], value, @params[4])
show_window(2,value,@params[0]) unless $game_switches[UnShowSwitch]
return true
end
#--------------------------------------------------------------------------
# ● 增减防具
#--------------------------------------------------------------------------
def command_128
value = operate_value(@params[1], @params[2], @params[3])
$game_party.gain_item($data_armors[@params[0]], value, @params[4])
show_window(3,value,@params[0]) unless $game_switches[UnShowSwitch]
return true
end
def show_window(type,value,id = 0)
if type == 0
item = "gold"
else #物品,武器,防具
if type == 1
item = $data_items[id]
elsif type == 2
item = $data_weapons[id]
else
item = $data_armors[id]
end
end
width = 150 + (type == 0 ? value.to_s.size * 7 - 16 : item.name.size * 7)
w = Window_Base.new((640-width)/2 - 30 ,208,width,64)
w.windowskin = Cache.system("Window2")
w.contents = Bitmap.new(w.width - 32, w.height - 32)
w.contents.font.color = w.text_color(1)
w.contents.fill_rect(w.contents.rect,w.text_color(0))
w.opacity = w.contents_opacity =0
for i in 0..10
w.opacity += 26
w.contents_opacity += 26
w.x += 3
Graphics.update
end
if value >= 0
w.contents.draw_text(0,4,48,24,"得到")
Audio.se_play(GainSe)
else
w.contents.draw_text(0,4,48,24,"失去")
Audio.se_play(LoseSe)
end
if type != 0
w.draw_item_name_c(item,50, 4 ,type + 23)
w.opacity = w.back_opacity = 255
w.contents.font.color = w.text_color(14)
w.contents.draw_text(width - 72 , 4, 40, 24, "× " + value.abs.to_s ,2)
else
bitmap = Cache.system("gold")
w.contents.blt(50, 4 ,bitmap , bitmap.rect)
w.contents.font.color = w.text_color(14)
w.contents.draw_text(width - 112 , 4, 72, 24, " " + value.abs.to_s ,2)
end
for i in 0..30
Graphics.update
end
for i in 0..20
w.opacity -= 13
w.contents_opacity -= 13
w.x += 2
Graphics.update
end
w.dispose
end
end
class Window_Base
def draw_item_name_c(item, x, y , color)
if item != nil
draw_icon(item.icon_index, x, y, true)
self.contents.font.color = self.text_color(color)
self.contents.draw_text(x + 24, y, 172, WLH, item.name)
end
end
end
复制代码
作者:
wangswz
时间:
2010-7-28 20:17
这个如何
#==============================================================================
# 动态显示的宝箱 v1.1 (old name: Chest Item Pop-Up)
#------------------------------------------------------------------------------
# 作者 : OriginalWij
#------------------------------------------------------------------------------
# 版本信息:
#
# v1.0
# - 初版
# v1.1
# - 添加提示窗体
#------------------------------------------------------------------------------
# 注意: ① 得失物品/金钱之前,请先打开指定开关
# ② 得失多个物品时,在多个物品之间插入一个wait(1),详见范例工程
#------------------------------------------------------------------------------
# 汉化版改动: ① 去掉开关自动还原功能
# ② 按中文习惯显示描述信息
# ③ 在描述信息中描绘图标
# ④ 窗体屏幕居中显示
# ⑤ 增加提示窗体自动关闭功能
#==============================================================================
# "金钱" 图标序号
GOLD_ICON = 205
# 激活动态显示的开关序号,默认为1号开关
POPUP_SWITCH = 10
# 得失物品的声音设定
POPUP_SOUND = 'Chime2'
POPUP_SOUND_VOLUME = 100
POPUP_SOUND_PITCH = 150
## 提示窗体自动关闭的时间(以帧计算)
WAIT_TIME = 180
#==============================================================================
# Game_Interpreter
#==============================================================================
class Game_Interpreter
#--------------------------------------------------------------------------
# Get X
#--------------------------------------------------------------------------
def get_x
events = $game_map.events
x_coord = events[@event_id]
return x_coord.screen_x
end
#--------------------------------------------------------------------------
# Get Y
#--------------------------------------------------------------------------
def get_y
events = $game_map.events
y_coord = events[@event_id]
return y_coord.screen_y
end
#--------------------------------------------------------------------------
# Change Gold
#--------------------------------------------------------------------------
def command_125
value = operate_value(@params[0], @params[1], @params[2])
$game_party.gain_gold(value)
x_value = get_x
y_value = get_y
$scene = Chest_Popup.new(x_value, y_value, 0, value, 1) if $game_switches[POPUP_SWITCH]
return true
end
#--------------------------------------------------------------------------
# Change Items
#--------------------------------------------------------------------------
def command_126
value = operate_value(@params[1], @params[2], @params[3])
$game_party.gain_item($data_items[@params[0]], value)
$game_map.need_refresh = true
x_value = get_x
y_value = get_y
$scene = Chest_Popup.new(x_value, y_value, 1, value, @params[0]) if $game_switches[POPUP_SWITCH]
return true
end
#--------------------------------------------------------------------------
# Change Weapons
#--------------------------------------------------------------------------
def command_127
value = operate_value(@params[1], @params[2], @params[3])
$game_party.gain_item($data_weapons[@params[0]], value, @params[4])
x_value = get_x
y_value = get_y
$scene = Chest_Popup.new(x_value, y_value, 2, value, @params[0]) if $game_switches[POPUP_SWITCH]
return true
end
#--------------------------------------------------------------------------
# Change Armor
#--------------------------------------------------------------------------
def command_128
value = operate_value(@params[1], @params[2], @params[3])
$game_party.gain_item($data_armors[@params[0]], value, @params[4])
x_value = get_x
y_value = get_y
$scene = Chest_Popup.new(x_value, y_value, 3, value, @params[0]) if $game_switches[POPUP_SWITCH]
return true
end
end
#==============================================================================
# Item Popup Window
#==============================================================================
class Item_Popup_Window < Window_Base
#--------------------------------------------------------------------------
# Initialize
#--------------------------------------------------------------------------
def initialize(x, y)
super(0, 0, 544, 416)
self.opacity = 0
@x = x - 26
@y = y - 56
end
#--------------------------------------------------------------------------
# Pop-Up
#--------------------------------------------------------------------------
def pop_up(icon_index, x, y)
self.contents.clear
draw_icon(icon_index, x, y, true)
end
end
#==============================================================================
# Name window
#==============================================================================
class Name_Window < Window_Base
#--------------------------------------------------------------------------
# Initialize ## 去掉坐标传递,新增 icon_index
#--------------------------------------------------------------------------
def initialize(icon_index, desc, gold = false)
## 此位图缓存应该不需要重载
width = Cache.system("Window").text_size(desc).width + 32
width += 24 if gold
## 屏幕居中
x = (Graphics.width - width)/2
y = (Graphics.height - WLH-32)/2
super(x, y, width, WLH + 32)
if gold
self.contents.draw_text(0, 0, width-24, WLH, desc)
draw_icon(icon_index, width - 24-32, 0, true)
else
draw_icon(icon_index, 56, 0, true)
self.contents.draw_text(0, 0, width, WLH, desc)
end
end
end
#==============================================================================
# Scene_Base
#==============================================================================
class Scene_Base
#--------------------------------------------------------------------------
# Create Snapshot for Using as Background of Another Screen
#--------------------------------------------------------------------------
def snapshot_for_background
$game_temp.background_bitmap.dispose
$game_temp.background_bitmap = Graphics.snap_to_bitmap
$game_temp.background_bitmap.blur if !$game_switches[POPUP_SWITCH]
end
end
#==============================================================================
# Chest_Popup
#==============================================================================
class Chest_Popup < Scene_Base
#--------------------------------------------------------------------------
# Initialize
#--------------------------------------------------------------------------
def initialize(x, y, type, amount, index)
@x = x
@y = y
@amount = amount
@gold = false
case type
## 改写成中文习惯
when 0 # gold
@icon_index = GOLD_ICON
@desc = '金钱: ' + @amount.to_s
@amount = 1
@gold = true
when 1 # items
@icon_index = $data_items[index].icon_index
## 自定义文字时,请注意留空格,下同
@desc = '物品: ' + $data_items[index].name + '×' + @amount.to_s
when 2 # weapons
@icon_index = $data_weapons[index].icon_index
@desc = '武器: ' + $data_weapons[index].name + '×' + @amount.to_s
when 3 # armors
@icon_index = $data_armors[index].icon_index
@desc = '防具: ' + $data_armors[index].name + '×' + @amount.to_s
end
end
#--------------------------------------------------------------------------
# Start
#--------------------------------------------------------------------------
def start
create_background
@popup_window = Item_Popup_Window.new(@x, @y)
end
#--------------------------------------------------------------------------
# Terminate
#--------------------------------------------------------------------------
def terminate
@popup_window.dispose
@name_window.dispose
@menuback_sprite.dispose
end
#--------------------------------------------------------------------------
# Return Scene
#--------------------------------------------------------------------------
def return_scene
##$game_switches[POPUP_SWITCH] = false ## 去掉还原限制
$scene = Scene_Map.new
end
#--------------------------------------------------------------------------
# Update
#--------------------------------------------------------------------------
def update
super
@popup_window.update
@menuback_sprite.update
do_popup
end
#--------------------------------------------------------------------------
# Update Basic
#--------------------------------------------------------------------------
def update_basic
Graphics.update
Input.update
$game_map.update
end
#--------------------------------------------------------------------------
# Wait
#--------------------------------------------------------------------------
def wait(duration)
for i in 0...duration
update_basic
end
end
#--------------------------------------------------------------------------
# Wait for "C"
#--------------------------------------------------------------------------
def wait_for_c
## 自动关闭的计数器
@wait_count = WAIT_TIME
loop do
@wait_count -= 1
update_basic
## 关闭判定
break if Input.trigger?(Input::C) or @wait_count <= 0
end
end
#--------------------------------------------------------------------------
# Create Background
#--------------------------------------------------------------------------
def create_background
@menuback_sprite = Sprite.new
@menuback_sprite.bitmap = $game_temp.background_bitmap
@menuback_sprite.update
end
#--------------------------------------------------------------------------
# Show Name
#--------------------------------------------------------------------------
def show_name
## 去掉坐标传递,新增 icon_index
@name_window = Name_Window.new(@icon_index, @desc, @gold)
wait_for_c
Sound.play_cancel
end
#--------------------------------------------------------------------------
# Do Pop-Up
#--------------------------------------------------------------------------
def do_popup
for i in 1..@amount
Audio.se_play('Audio/SE/' + POPUP_SOUND, POPUP_SOUND_VOLUME, POPUP_SOUND_PITCH)
for i in 0..4
@popup_window.pop_up(@icon_index, @x - 26, @y - (i * 4) - 48)
@popup_window.update
wait(2)
end
wait(5) if i != @amount
end
wait(5)
show_name
return_scene
end
end
复制代码
欢迎光临 Project1 (https://rpg.blue/)
Powered by Discuz! X3.1