Project1
标题:
[RM脚本] 呃,想发两个法站上搞来的脚本
[打印本页]
作者:
frantice
时间:
2006-6-7 05:35
标题:
[RM脚本] 呃,想发两个法站上搞来的脚本
这个是原地址
http://rpgcreative.free.fr
效果图如下,一个是同时装备3个装饰品,还有一个是雷达式人物属性防御图表。
征求下大家的意见,如果觉得不错的话我就把脚本贴出来,已经修改过字体,其他注释几乎没有,乱码的也不想管了。
忘了怎么帖图了{/fd}
[本贴由 九泪 于 2006-6-6 22:12:48 最后编辑]
作者:
frantice
时间:
2006-6-7 05:35
标题:
[RM脚本] 呃,想发两个法站上搞来的脚本
这个是原地址
http://rpgcreative.free.fr
效果图如下,一个是同时装备3个装饰品,还有一个是雷达式人物属性防御图表。
征求下大家的意见,如果觉得不错的话我就把脚本贴出来,已经修改过字体,其他注释几乎没有,乱码的也不想管了。
忘了怎么帖图了{/fd}
[本贴由 九泪 于 2006-6-6 22:12:48 最后编辑]
作者:
非常白菜
时间:
2006-6-7 05:44
呵呵...第2个挺有意思....{/cy}
第一个无视...{/hx}
作者:
兰色枫叶
时间:
2006-6-7 05:48
貌似在日站也看到过````
PS,贴图:
= =||
作者:
九泪
时间:
2006-6-7 06:13
支持支持~
{/qiang}{/qiang}
作者:
frantice
时间:
2006-6-7 06:43
嗯嗯,我就先贴出来了,看过或者有了的就不用看下去了。
第一个是同时装备3个装饰品,个人认为和其他脚本冲突的可能不是很大。
#==============================================================================
# AccessoireX3
#==============================================================================
module XRXS_MP8_Fixed_Valuables
EQUIP_KINDS = [1, 2, 3, 4, 4, 4]
EQUIP_KIND_NAMES = []
WINDOWS_STRETCH = true
STATUS_WINDOW_ARRANGE = true
STATUS_WINDOW_EX_EQUIP_ROW_SIZE = 24
STATUS_WINDOW_EX_EQUIP_X = 336
STATUS_WINDOW_EX_EQUIP_Y = 256
end
#==============================================================================
# ¡ Game_Actor
#==============================================================================
class Game_Actor < Game_Battler
#--------------------------------------------------------------------------
# ? ?C???N??[?h
#--------------------------------------------------------------------------
include XRXS_MP8_Fixed_Valuables
#--------------------------------------------------------------------------
# ? ?ö?J?C???X?^???X?Ï?
#--------------------------------------------------------------------------
attr_reader :armor_ids
#--------------------------------------------------------------------------
# ? ?Z?b?g?A?b?v
#--------------------------------------------------------------------------
alias xrxs_mp8_setup setup
def setup(actor_id)
xrxs_mp8_setup(actor_id)
@armor_ids = []
# ?g?£?—
for i in 4...EQUIP_KINDS.size
@armor_ids[i+1] = 0
end
end
#--------------------------------------------------------------------------
# ? ?î–{?r—Í?Ì?æ?¾
#--------------------------------------------------------------------------
alias xrxs_mp8_base_str base_str
def base_str
n = xrxs_mp8_base_str
for i in 4...EQUIP_KINDS.size
armor = $data_armors[@armor_ids[i+1]]
n += armor != nil ? armor.str_plus : 0
end
return n
end
#--------------------------------------------------------------------------
# ? ?î–{?í—p?³?Ì?æ?¾
#--------------------------------------------------------------------------
alias xrxs_mp8_base_dex base_dex
def base_dex
n = xrxs_mp8_base_dex
for i in 4...EQUIP_KINDS.size
armor = $data_armors[@armor_ids[i+1]]
n += armor != nil ? armor.dex_plus : 0
end
return n
end
#--------------------------------------------------------------------------
# ? ?î–{?f??³?Ì?æ?¾
#--------------------------------------------------------------------------
alias xrxs_mp8_base_agi base_agi
def base_agi
n = xrxs_mp8_base_agi
for i in 4...EQUIP_KINDS.size
armor = $data_armors[@armor_ids[i+1]]
n += armor != nil ? armor.agi_plus : 0
end
return n
end
#--------------------------------------------------------------------------
# ? ?î–{–?—Í?Ì?æ?¾
#--------------------------------------------------------------------------
alias xrxs_mp8_base_int base_int
def base_int
n = xrxs_mp8_base_int
for i in 4...EQUIP_KINDS.size
armor = $data_armors[@armor_ids[i+1]]
n += armor != nil ? armor.int_plus : 0
end
return n
end
#--------------------------------------------------------------------------
# ? ?î–{?¨—–h?ä?Ì?æ?¾
#--------------------------------------------------------------------------
alias xrxs_mp8_base_pdef base_pdef
def base_pdef
n = xrxs_mp8_base_pdef
for i in 4...EQUIP_KINDS.size
armor = $data_armors[@armor_ids[i+1]]
n += armor != nil ? armor.pdef : 0
end
return n
end
#--------------------------------------------------------------------------
# ? ?î–{–?–@–h?ä?Ì?æ?¾
#--------------------------------------------------------------------------
alias xrxs_mp8_base_mdef base_mdef
def base_mdef
n = xrxs_mp8_base_mdef
for i in 4...EQUIP_KINDS.size
armor = $data_armors[@armor_ids[i+1]]
n += armor != nil ? armor.mdef : 0
end
return n
end
#--------------------------------------------------------------------------
# ? ?î–{?ñ?ðC³?Ì?æ?¾
#--------------------------------------------------------------------------
alias xrxs_mp8_base_eva base_eva
def base_eva
n = xrxs_mp8_base_eva
for i in 4...EQUIP_KINDS.size
armor = $data_armors[@armor_ids[i+1]]
n += armor != nil ? armor.eva : 0
end
return n
end
#--------------------------------------------------------------------------
# ? ???õ?Ì?ÏX
# equip_type : ???õ?^?C?v
# id : ??í or –h?ï ID (0 ?È?ç???õ?ð?)
#--------------------------------------------------------------------------
alias xrxs_mp8_equip equip
def equip(equip_type, id)
xrxs_mp8_equip(equip_type, id)
if equip_type >= 5
if id == 0 or $game_party.armor_number(id) > 0
update_auto_state($data_armors[@armor_ids[equip_type]], $data_armors[id])
$game_party.gain_armor(@armor_ids[equip_type], 1)
@armor_ids[equip_type] = id
$game_party.lose_armor(id, 1)
end
end
end
end
#==============================================================================
# ¡ Window_EquipRight
#==============================================================================
class Window_EquipRight < Window_Selectable
#--------------------------------------------------------------------------
# ? ?C???N??[?h
#--------------------------------------------------------------------------
include XRXS_MP8_Fixed_Valuables
#--------------------------------------------------------------------------
# ? ?I?u?W?F?N?g??ú?»
# actor : ?A?N?^[
#--------------------------------------------------------------------------
if WINDOWS_STRETCH
def initialize(actor)
super(272, 64, 368, 192)
h = (EQUIP_KINDS.size + 1) * 32
self.contents = Bitmap.new(width - 32, h)
@actor = actor
refresh
self.index = 0
end
end
#--------------------------------------------------------------------------
# ? ???t???b?V??
#--------------------------------------------------------------------------
alias xrxs_mp8_refresh refresh
def refresh
xrxs_mp8_refresh
@item_max = EQUIP_KINDS.size + 1
for i in 4...EQUIP_KINDS.size
@data.push($data_armors[@actor.armor_ids[i+1]])
self.contents.font.color = system_color
self.contents.draw_text(5, 32 * (i+1), 92, 32, EQUIP_KIND_NAMES[i-4].to_s)
draw_item_name(@data[i+1], 92, 32 * (i+1))
end
end
end
#==============================================================================
# ¡ Window_EquipItem
#==============================================================================
class Window_EquipItem < Window_Selectable
#--------------------------------------------------------------------------
# ? ???õ?í?Ê?ÌÝ?è
#--------------------------------------------------------------------------
def equip_type=(et)
@equip_type = et
refresh
end
#--------------------------------------------------------------------------
# ? ???t???b?V??
#--------------------------------------------------------------------------
alias xrxs_mp8_refresh refresh
def refresh
xrxs_mp8_refresh
if @equip_type >= 5
if self.contents != nil
self.contents.dispose
self.contents = nil
end
@data = []
armor_set = $data_classes[@actor.class_id].armor_set
for i in 1...$data_armors.size
if $game_party.armor_number(i) > 0 and armor_set.include?(i)
type = $data_armors[i].kind + 1
if !@equip_type.to_s.scan(/#{type}/).empty?
@data.push($data_armors[i])
end
end
end
@data.push(nil)
@item_max = @data.size
self.contents = Bitmap.new(width - 32, row_max * 32)
for i in 0...@item_max-1
draw_item(i)
end
end
end
end
#==============================================================================
# ¡ Window_Status
#==============================================================================
class Window_Status < Window_Base
#--------------------------------------------------------------------------
# ? ?C???N??[?h
#--------------------------------------------------------------------------
include XRXS_MP8_Fixed_Valuables
#--------------------------------------------------------------------------
# ?J?X?^?}?C?Y?|?C???gu?X?e[?^?X?æ–Ê?Ì?f?U?C???ð?ÏX?·?év
#--------------------------------------------------------------------------
if STATUS_WINDOW_ARRANGE
def refresh
self.contents.clear
draw_actor_graphic(@actor, 40, 112)
draw_actor_name(@actor, 4, 0)
draw_actor_class(@actor, 4 + 144, 0)
draw_actor_level(@actor, 96, 32)
draw_actor_state(@actor, 96, 64)
draw_actor_hp(@actor, 96, 112, 172)
draw_actor_sp(@actor, 96, 144, 172)
draw_actor_parameter(@actor, 96, 192, 0)
draw_actor_parameter(@actor, 96, 224, 1)
draw_actor_parameter(@actor, 96, 256, 2)
draw_actor_parameter(@actor, 96, 304, 3)
draw_actor_parameter(@actor, 96, 336, 4)
draw_actor_parameter(@actor, 96, 368, 5)
draw_actor_parameter(@actor, 96, 400, 6)
self.contents.font.color = system_color
self.contents.draw_text(320, 48, 80, 32, "EXP")
self.contents.draw_text(320, 80, 80, 32, "NEXT")
self.contents.font.color = normal_color
self.contents.draw_text(320 + 80, 48, 84, 32, @actor.exp_s, 2)
self.contents.draw_text(320 + 80, 80, 84, 32, @actor.next_rest_exp_s, 2)
self.contents.font.color = system_color
self.contents.draw_text(320, 112, 96, 32, "装备")
draw_item_name($data_weapons[@actor.weapon_id], 320 + 16, 136)
draw_item_name($data_armors[@actor.armor1_id], 320 + 16, 160)
draw_item_name($data_armors[@actor.armor2_id], 320 + 16, 184)
draw_item_name($data_armors[@actor.armor3_id], 320 + 16, 208)
draw_item_name($data_armors[@actor.armor4_id], 320 + 16, 232)
end
end
#--------------------------------------------------------------------------
# ? ???t???b?V??
#--------------------------------------------------------------------------
alias xrxs_mp8_refresh refresh
def refresh
xrxs_mp8_refresh
# ?g?£?—
for i in 4...EQUIP_KINDS.size
armor = $data_armors[@actor.armor_ids[i+1]]
draw_item_name($data_armors[@actor.armor_ids[i+1]], STATUS_WINDOW_EX_EQUIP_X, STATUS_WINDOW_EX_EQUIP_Y + STATUS_WINDOW_EX_EQUIP_ROW_SIZE * (i-4))
end
end
end
#==============================================================================
# ¡ Scene_Equip
#==============================================================================
class Scene_Equip
#--------------------------------------------------------------------------
# ? ?C???N??[?h
#--------------------------------------------------------------------------
include XRXS_MP8_Fixed_Valuables
#--------------------------------------------------------------------------
# ? ??C???—
#--------------------------------------------------------------------------
alias xrxs_mp8_main main
def main
@addition_initialize_done = false
xrxs_mp8_main
for i in 4...EQUIP_KINDS.size
@item_windows[i+2].dispose
end
end
#--------------------------------------------------------------------------
# ? ???t???b?V??
#--------------------------------------------------------------------------
alias xrxs_mp8_refresh refresh
def refresh
unless @addition_initialize_done
@item_windows = []
@item_window2.equip_type = EQUIP_KINDS[0]
@item_window3.equip_type = EQUIP_KINDS[1]
@item_window4.equip_type = EQUIP_KINDS[2]
@item_window5.equip_type = EQUIP_KINDS[3]
for i in 4...EQUIP_KINDS.size
@item_windows[i+2] = Window_EquipItem.new(@actor, EQUIP_KINDS[i])
@item_windows[i+2].help_window = @help_window
end
if WINDOWS_STRETCH
@right_window.height = (EQUIP_KINDS.size + 2) * 32
if @left_window.y + @left_window.height == 256
@left_window.height = @right_window.height
end
y_pos = (@right_window.y + @right_window.height)
y_space = 480 - y_pos
@item_window1.y = y_pos
@item_window2.y = y_pos
@item_window3.y = y_pos
@item_window4.y = y_pos
@item_window5.y = y_pos
@item_window1.height = y_space
@item_window2.height = y_space
@item_window3.height = y_space
@item_window4.height = y_space
@item_window5.height = y_space
for i in 4...EQUIP_KINDS.size
@item_windows[i+2].y = y_pos
@item_windows[i+2].height = y_space
end
end
@addition_initialize_done = true
end
for i in 4...EQUIP_KINDS.size
@item_windows[i+2].visible = (@right_window.index == i+1)
end
if @right_window.index >= 5
@item_window = @item_windows[@right_window.index + 1]
end
xrxs_mp8_refresh
end
#--------------------------------------------------------------------------
# ? ?t??[??XV (?A?C?e???E?B???h?E?ª?A?N?e?B?u?Ìê?)
#--------------------------------------------------------------------------
alias xrxs_mp8_update_item update_item
def update_item
xrxs_mp8_update_item
if Input.trigger?(Input::C)
@item_window1.refresh
@item_window2.refresh
@item_window3.refresh
@item_window4.refresh
@item_window5.refresh
for i in 4...EQUIP_KINDS.size
@item_windows[i+2].refresh
end
Graphics.frame_reset
return
end
end
end
复制代码
第二个,人物防御属性描绘雷达图,同上一个一样,脚本间冲突不会很大,不过如果两个脚本同时用后多出来的两个装饰品会遮住雷达图,所以用的时候尽量想办法克服吧~
#=============
# Graphic_Def_Elem
#=============
class Window_Base
FONT_SIZE = 18
WORD_ELEMENT_GUARD = "属性"
NUMBER_OF_ELEMENTS = 8
ELEMENT_ORDER = [1,3,8,5,2,4,7,6]
GRAPH_SCALINE_COLOR = Color.new(255, 255, 255, 128)
GRAPH_SCALINE_COLOR_SHADOW = Color.new( 0, 0, 0, 192)
GRAPH_LINE_COLOR = Color.new(255, 255, 64, 255)
GRAPH_LINE_COLOR_MINUS = Color.new( 64, 255, 255, 255)
GRAPH_LINE_COLOR_PLUS = Color.new(255, 64, 64, 255)
end
#=============
# ¡ Window_Status
#=============
class Window_Status < Window_Base
alias xrxs_mp4_refresh refresh
def refresh
xrxs_mp4_refresh
draw_actor_element_radar_graph(@actor, 320, 240)
end
#--------------------
def draw_actor_element_radar_graph(actor, x, y, radius = 56)
cx = x + radius + FONT_SIZE + 48
cy = y + radius + FONT_SIZE + 32
self.contents.font.color = system_color
self.contents.draw_text(x, y, 104, 32, WORD_ELEMENT_GUARD)
for loop_i in 0..NUMBER_OF_ELEMENTS
if loop_i == 0
else
@pre_x = @now_x
@pre_y = @now_y
@pre_ex = @now_ex
@pre_ey = @now_ey
@color1 = @color2
end
if loop_i == NUMBER_OF_ELEMENTS
eo = ELEMENT_ORDER[0]
else
eo = ELEMENT_ORDER[loop_i]
end
er = actor.element_rate(eo)
estr = $data_system.elements[eo]
@color2 = er < 0 ? GRAPH_LINE_COLOR_MINUS : er > 100 ? GRAPH_LINE_COLOR_PLUS : GRAPH_LINE_COLOR
er = er.abs
th = Math::PI * (0.5 - 2.0 * loop_i / NUMBER_OF_ELEMENTS)
@now_x = cx + (radius * Math.cos(th)).floor
@now_y = cy - (radius * Math.sin(th)).floor
@now_wx = cx + ((radius+FONT_SIZE*2/2) * Math.cos(th)).floor - FONT_SIZE
@now_wy = cy - ((radius+FONT_SIZE*1/2) * Math.sin(th)).floor - FONT_SIZE/2
@now_vx = cx + ((radius+FONT_SIZE*6/2) * Math.cos(th)).floor - FONT_SIZE
@now_vy = cy - ((radius+FONT_SIZE*3/2) * Math.sin(th)).floor - FONT_SIZE/2
@now_ex = cx + (er*radius/100 * Math.cos(th)).floor
@now_ey = cy - (er*radius/100 * Math.sin(th)).floor
if loop_i == 0
@pre_x = @now_x
@pre_y = @now_y
@pre_ex = @now_ex
@pre_ey = @now_ey
@color1 = @color2
else
end
next if loop_i == 0
self.contents.draw_line(cx+1,cy+1, @now_x+1,@now_y+1, GRAPH_SCALINE_COLOR_SHADOW)
self.contents.draw_line(@pre_x+1,@pre_y+1, @now_x+1,@now_y+1, GRAPH_SCALINE_COLOR_SHADOW)
self.contents.draw_line(cx,cy, @now_x,@now_y, GRAPH_SCALINE_COLOR)
self.contents.draw_line(@pre_x,@pre_y, @now_x,@now_y, GRAPH_SCALINE_COLOR)
self.contents.draw_line(@pre_ex,@pre_ey, @now_ex,@now_ey, @color1, 2, @color2)
self.contents.font.size = FONT_SIZE
self.contents.font.color = system_color
self.contents.draw_text(@now_wx,@now_wy, FONT_SIZE*2, FONT_SIZE, estr, 1)
self.contents.font.color = Color.new(255,255,255,128)
self.contents.draw_text(@now_vx,@now_vy, FONT_SIZE*2, FONT_SIZE, er.to_s + "%", 2)
end
end
end
#=============
# ž ŠO•”ƒ‰ƒCƒuƒ‰ƒŠ
#=============
class Bitmap
def draw_line(start_x, start_y, end_x, end_y, start_color, width = 1, end_color = start_color)
distance = (start_x - end_x).abs + (start_y - end_y).abs
if end_color == start_color
for i in 1..distance
x = (start_x + 1.0 * (end_x - start_x) * i / distance).to_i
y = (start_y + 1.0 * (end_y - start_y) * i / distance).to_i
if width == 1
self.set_pixel(x, y, start_color)
else
self.fill_rect(x, y, width, width, start_color)
end
end
else
for i in 1..distance
x = (start_x + 1.0 * (end_x - start_x) * i / distance).to_i
y = (start_y + 1.0 * (end_y - start_y) * i / distance).to_i
r = start_color.red * (distance-i)/distance + end_color.red * i/distance
g = start_color.green * (distance-i)/distance + end_color.green * i/distance
b = start_color.blue * (distance-i)/distance + end_color.blue * i/distance
a = start_color.alpha * (distance-i)/distance + end_color.alpha * i/distance
if width == 1
self.set_pixel(x, y, Color.new(r, g, b, a))
else
self.fill_rect(x, y, width, width, Color.new(r, g, b, a))
end
end
end
end
end
复制代码
最后要废话的是,两个脚本都没有写上出处和作者,请大家用的时候说明一下来源:
http://rpgcreative.free.fr
PS:我怎么突然发现我突然不会这个不会那个了啊?
作者:
link006007
时间:
2006-6-7 06:55
那个雷达,好东西.{/se},(表情又换回来了)
作者:
美兽
时间:
2006-6-7 06:58
第一个不会小……
作者:
frantice
时间:
2006-6-7 07:10
嗯嗯,
不和装备介面强化冲突的吧,而且和菜单(不是改得很厉害的那种)也不冲突的,当然和有些限制了装备窗口大小的冲突是一定的,整合的话就看自己的啦。
作者:
兰色枫叶
时间:
2006-6-7 08:33
OTZ~~```
法文那么厉害= =|
作者:
link006007
时间:
2006-6-7 08:46
那个雷达的作者干嘛不把def draw_actor_element_radar_graph写在Window_Base里...?
作者:
美兽
时间:
2006-6-7 09:06
“XRXS”RM名人……
那个站上也是转载的……
作者:
张永
时间:
2006-6-7 12:20
XMSX上有的……
作者:
DriftZxnZERO
时间:
2006-6-7 16:48
第二个我早就搞过比他好看的了...
不过因为巨卡...(Ruby的绘点语句和绘字语句都巨卡,这点跟JAVA一样..)
作者:
美兽
时间:
2006-6-7 17:03
以下引用
DriftZxnZERO于2006-6-7 8:48:35
的发言:
第二个我早就搞过比他好看的了...
不过因为巨卡...(Ruby的绘点语句和绘字语句都巨卡,这点跟JAVA一样..)
单纯连线不卡,你填充了吧……
作者:
亿万星辰
时间:
2006-6-17 20:44
雷达那个实现不难,难的把里面的内容填充....{/pz}
作者:
koalli
时间:
2006-6-18 04:34
第2个挺感兴趣的```
作者:
千鸟
时间:
2006-6-29 19:10
值的顶!!!{/se}
欢迎光临 Project1 (https://rpg.blue/)
Powered by Discuz! X3.1