赞 | 68 |
VIP | 0 |
好人卡 | 0 |
积分 | 65 |
经验 | 0 |
最后登录 | 2023-7-2 |
在线时间 | 119 小时 |
Lv4.逐梦者
- 梦石
- 0
- 星屑
- 6483
- 在线时间
- 119 小时
- 注册时间
- 2020-1-8
- 帖子
- 234
|
本帖最后由 RPGzh500223 于 2020-11-15 22:20 编辑
替换原来那个
脚本:
#对机器人描述词的设置
$R = {
"id" => 2,
"hp" => "能量",
"sp" => "能源",
"武" => "器械",
"盾" => "护盾",
"头" => "芯片",
"身" => "装甲",
"饰" => "装置",
"值" => "火力_护甲值_护盾值_输出_传动_机动_感知"
}
#修改窗口中HP、SP、能力值的描述词
class Window_Base < Window
alias ori_draw_actor_hp draw_actor_hp
def draw_actor_hp(actor, x, y, width = 144)
# 描绘字符串 "HP"
self.contents.font.color = system_color
hp_str = actor.id == $R["id"] ? $R["hp"] : $data_system.words.hp
self.contents.draw_text(x, y, 32, 32, hp_str)
# 计算描绘 MaxHP 所需的空间
if width - 32 >= 108
hp_x = x + width - 108
flag = true
elsif width - 32 >= 48
hp_x = x + width - 48
flag = false
end
# 描绘 HP
self.contents.font.color = actor.hp == 0 ? knockout_color :
actor.hp <= actor.maxhp / 4 ? crisis_color : normal_color
self.contents.draw_text(hp_x, y, 48, 32, actor.hp.to_s, 2)
# 描绘 MaxHP
if flag
self.contents.font.color = normal_color
self.contents.draw_text(hp_x + 48, y, 12, 32, "/", 1)
self.contents.draw_text(hp_x + 60, y, 48, 32, actor.maxhp.to_s)
end
end
alias ori_draw_actor_sp draw_actor_sp
def draw_actor_sp(actor, x, y, width = 144)
# 描绘字符串 "SP"
self.contents.font.color = system_color
sp_str = actor.id == $R["id"] ? $R["sp"] : $data_system.words.sp
self.contents.draw_text(x, y, 32, 32, sp_str)
# 计算描绘 MaxSP 所需的空间
if width - 32 >= 108
sp_x = x + width - 108
flag = true
elsif width - 32 >= 48
sp_x = x + width - 48
flag = false
end
# 描绘 SP
self.contents.font.color = actor.sp == 0 ? knockout_color :
actor.sp <= actor.maxsp / 4 ? crisis_color : normal_color
self.contents.draw_text(sp_x, y, 48, 32, actor.sp.to_s, 2)
# 描绘 MaxSP
if flag
self.contents.font.color = normal_color
self.contents.draw_text(sp_x + 48, y, 12, 32, "/", 1)
self.contents.draw_text(sp_x + 60, y, 48, 32, actor.maxsp.to_s)
end
end
alias ori_draw_actor_parameter draw_actor_parameter
def draw_actor_parameter(actor, x, y, type)
case type
when 0
parameter_name = $data_system.words.atk
parameter_value = actor.atk
when 1
parameter_name = $data_system.words.pdef
parameter_value = actor.pdef
when 2
parameter_name = $data_system.words.mdef
parameter_value = actor.mdef
when 3
parameter_name = $data_system.words.str
parameter_value = actor.str
when 4
parameter_name = $data_system.words.dex
parameter_value = actor.dex
when 5
parameter_name = $data_system.words.agi
parameter_value = actor.agi
when 6
parameter_name = $data_system.words.int
parameter_value = actor.int
end
self.contents.font.color = system_color
str = actor.id == $R["id"] ? $R["值"].split("_")[type] : parameter_name
self.contents.draw_text(x, y, 120, 32, str)
self.contents.font.color = normal_color
self.contents.draw_text(x + 120, y, 36, 32, parameter_value.to_s, 2)
end
end
#修改装备窗口中装备种类的描述词
class Window_EquipRight < Window_Selectable
alias ori_refresh refresh
def refresh
self.contents.clear
@data = []
@data.push($data_weapons[@actor.weapon_id])
@data.push($data_armors[@actor.armor1_id])
@data.push($data_armors[@actor.armor2_id])
@data.push($data_armors[@actor.armor3_id])
@data.push($data_armors[@actor.armor4_id])
@item_max = @data.size
self.contents.font.color = system_color
weapon_s = @actor.id == $R["id"] ? $R["武"] : $data_system.words.weapon
self.contents.draw_text(4, 32 * 0, 92, 32, weapon_s)
armor1_s = @actor.id == $R["id"] ? $R["盾"] : $data_system.words.armor1
self.contents.draw_text(4, 32 * 1, 92, 32, armor1_s)
armor2_s = @actor.id == $R["id"] ? $R["头"] : $data_system.words.armor2
self.contents.draw_text(4, 32 * 2, 92, 32, armor2_s)
armor3_s = @actor.id == $R["id"] ? $R["身"] : $data_system.words.armor3
self.contents.draw_text(4, 32 * 3, 92, 32, armor3_s)
armor4_s = @actor.id == $R["id"] ? $R["饰"] : $data_system.words.armor4
self.contents.draw_text(5, 32 * 4, 92, 32, armor4_s)
draw_item_name(@data[0], 92, 32 * 0)
draw_item_name(@data[1], 92, 32 * 1)
draw_item_name(@data[2], 92, 32 * 2)
draw_item_name(@data[3], 92, 32 * 3)
draw_item_name(@data[4], 92, 32 * 4)
end
end |
|