Project1
标题:
求整合一下这两个脚本。。。
[打印本页]
作者:
CR~
时间:
2014-5-7 11:46
标题:
求整合一下这两个脚本。。。
敌人的血条脚本(帮助兰的血条盖住的战斗力)
class Window_Help < Window_Base
def set_enemy(actor)
self.contents.clear
draw_actor_name(actor, 4, 0)
draw_actor_state(actor, 140, 0)
carol3_draw_hp_bar(actor, 284, 0)
carol3_draw_sp_bar(actor, 460, 0)
@text = nil
self.visible = true
end
def carol3_draw_hp_bar(actor, x, y, width = 128) #宽度可调
self.contents.font.color = system_color
w = width * actor.hp / [actor.maxhp,1].max
if actor.maxhp != 0
rate = actor.hp.to_f / actor.maxhp
else
rate = 0
end
color1 = Color.new(240 - 72 * rate, 240 * rate, 62 * rate, 150)
self.contents.fill_rect(x+1, y+15, width+2,1, Color.new(0, 0, 0, 255))
self.contents.fill_rect(x+1, y+16, width+2,1, Color.new(255, 255, 192, 192))
self.contents.fill_rect(x+1, y+17, w,6,color1)
self.contents.fill_rect(x+1, y+23, width+2,1, Color.new(255, 255, 192, 192))
self.contents.fill_rect(x+1, y+24, width+2,1, Color.new(0, 0, 0, 255))
self.contents.fill_rect(x, y+16, 1,8, Color.new(255, 255, 192, 192))
self.contents.fill_rect(x-1, y+15, 1,10, Color.new(0, 0, 0, 255))
self.contents.fill_rect(x+129, y+16, 1,8, Color.new(255, 255, 192, 192))
self.contents.fill_rect(x+130, y+15, 1,10, Color.new(0, 0, 0, 255))
self.contents.draw_text(x-53,y,128,32,$data_system.words.hp,1)
if actor.hp>actor.maxhp/3
self.contents.font.color = Color.new(255, 255, 255, 250)
end
if actor.hp>=actor.maxhp/6 and actor.maxhp/3>actor.hp
self.contents.font.color = Color.new(200, 200, 0, 255)
end
if actor.maxhp/6>actor.hp
self.contents.font.color = Color.new(200, 0, 0, 255)
end
self.contents.draw_text(x+47,y,128,32,actor.hp.to_s,1)
end
def carol3_draw_sp_bar(actor, x, y, width = 128)
self.contents.font.color = system_color
if actor.maxsp != 0
rate = actor.sp.to_f / actor.maxsp
else
rate = 0
end
color2 = Color.new(62 * rate, 240 - 72 * rate, 240 * rate, 192)
w = width * actor.sp / [actor.maxsp,1].max
self.contents.fill_rect(x+1, y+15, width+2,1, Color.new(0, 0, 0, 255))
self.contents.fill_rect(x+1, y+16, width+2,1, Color.new(255, 255, 192, 192))
self.contents.fill_rect(x+1, y+17, w,6,color2)
self.contents.fill_rect(x+1, y+23, width+2,1, Color.new(255, 255, 192, 192))
self.contents.fill_rect(x+1, y+24, width+2,1, Color.new(0, 0, 0, 255))
self.contents.fill_rect(x, y+16, 1,8, Color.new(255, 255, 192, 192))
self.contents.fill_rect(x-1, y+15, 1,10, Color.new(0, 0, 0, 255))
self.contents.fill_rect(x+129, y+16, 1,8, Color.new(255, 255, 192, 192))
self.contents.fill_rect(x+130, y+15, 1,10, Color.new(0, 0, 0, 255))
self.contents.draw_text(x-53,y,128,32,$data_system.words.sp,1)
if actor.hp>actor.maxsp/3
self.contents.font.color = Color.new(255, 255, 255, 250)
end
if actor.hp>=actor.maxsp/6 and actor.maxsp/3>actor.sp
self.contents.font.color = Color.new(200, 200, 0, 255)
end
if actor.maxsp/6>actor.sp
self.contents.font.color = Color.new(200, 0, 0, 255)
end
self.contents.draw_text(x+47,y,128,32,actor.sp.to_s,1)
end
end
复制代码
战斗力脚本
#【】【】【】【】【】【】【】【】【】【】【】【】【】【】【】【】【】【】【】【】
=begin
===============================================================================
★【战斗力】★
-------------------------------------------------------------------------------
by -> 芯☆淡茹水
===============================================================================
◎ 使用方法:复制该脚本,插入到 main 前。
-------------------------------------------------------------------------------
该脚本在状态窗口增加描绘角色战斗力,在帮助栏增加描绘角色和敌人的战斗力。
要在其他地方描绘角色战斗力,在欲描绘的地方写入:draw_actor_ce(actor, x, y)
敌人:draw_enemy_ce(enemy, x, y)
欲调用战斗力数值,先指定角色/敌人,然后:actor.ce / enemy.ce
===============================================================================
◆ 角色战斗力的构成:
-------------------------------------------------------------------------------
1.角色:力量 + 敏捷 + 速度 + 魔力
-------------------------------------------------------------------------------
2.武器:攻击力 + 物防 + 魔防 + 力量↑ + 敏捷↑ + 速度↑ + 魔力↑
+ 属性攻击数 X 100 + 附加状态数 X 100 + 解除状态数 X 50
-------------------------------------------------------------------------------
3.防具:物防 + 魔防 + 力量↑ + 敏捷↑ + 速度↑ + 魔力↑
+ 属性防御数 X 100 + 状态防御数 X 100 + 自动状态 X 100
-------------------------------------------------------------------------------
总战斗力 = 1(角色)+ 2(武器)+ 3(防具)
===============================================================================
◆ 敌人战斗力的构成:
--------------------------------------------------------------------------------
敌人战斗力 = 力量 + 敏捷 + 速度 + 魔力 + 攻击力 + 物防 + 魔防 + 回避
===============================================================================
=end #【】【】【】【】【】【】【】【】【】【】【】【】【】【】【】【】【】【】
#==============================================================================
class Game_Actor < Game_Battler
#--------------------------------------------------------------------------
# ● 武器品质
#--------------------------------------------------------------------------
def weapon_quality(id)
weapon = $data_weapons[id]
n = weapon.atk + weapon.pdef + weapon.mdef + weapon.str_plus +
weapon.dex_plus + weapon.agi_plus + weapon.int_plus
if weapon.element_set != nil
n += weapon.element_set.size * 100
end
if weapon.plus_state_set != nil
n += weapon.plus_state_set.size * 100
end
if weapon.minus_state_set != nil
n += weapon.minus_state_set.size * 50
end
return n
end
#---------------------------------------------------------------------------
#● 防具品质
#---------------------------------------------------------------------------
def armor_quality(id)
armor = $data_armors[id]
n = armor.pdef + armor.mdef + armor.str_plus + armor.dex_plus +
armor.agi_plus + armor.int_plus
if armor.guard_element_set != nil
n += armor.guard_element_set.size * 100
end
if armor.guard_state_set != nil
n += armor.guard_state_set.size * 100
end
if armor.auto_state_id > 0
n += 100
end
return n
end
#---------------------------------------------------------------------------
#● 角色战斗力
#---------------------------------------------------------------------------
def ce
weapon = $data_weapons[@weapon_id]
armor1 = $data_armors[@armor1_id]
armor2 = $data_armors[@armor2_id]
armor3 = $data_armors[@armor3_id]
armor4 = $data_armors[@armor4_id]
n = str + dex + agi + int
n += weapon != nil ? weapon_quality(@weapon_id) : 0
n += armor1 != nil ? armor_quality(@armor1_id) : 0
n += armor2 != nil ? armor_quality(@armor2_id) : 0
n += armor3 != nil ? armor_quality(@armor3_id) : 0
n += armor4 != nil ? armor_quality(@armor4_id) : 0
return n
end
end
#==============================================================================
class Window_Base < Window
#---------------------------------------------------------------------------
#● 战斗力描绘
#---------------------------------------------------------------------------
def draw_actor_ce(actor, x, y)
self.contents.font.color = system_color
self.contents.draw_text(x, y, 96, 32, "战斗力:")
self.contents.font.color = normal_color
self.contents.draw_text(x + 94, y, 164, 32, actor.ce.to_s)
end
#-------------------------------------------4--------------------------------
#● 敌人战斗力描绘
#---------------------------------------------------------------------------
def draw_enemy_ce(enemy, x, y)
self.contents.font.color = system_color
self.contents.draw_text(x, y, 96, 32, "战斗力:")
self.contents.font.color = normal_color
self.contents.draw_text(x + 94, y, 164, 32, enemy.ce.to_s)
end
end
#==============================================================================
class Window_Status < Window_Base
#--------------------------------------------------------------------------
# ● 刷新
#--------------------------------------------------------------------------
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")
draw_actor_ce(@actor, 319, 120)
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, 160, 96, 32, "装备")
draw_item_name($data_weapons[@actor.weapon_id], 320 + 16, 208)
draw_item_name($data_armors[@actor.armor1_id], 320 + 16, 256)
draw_item_name($data_armors[@actor.armor2_id], 320 + 16, 304)
draw_item_name($data_armors[@actor.armor3_id], 320 + 16, 352)
draw_item_name($data_armors[@actor.armor4_id], 320 + 16, 400)
end
def dummy
self.contents.font.color = system_color
self.contents.draw_text(320, 112, 96, 32, $data_system.words.weapon)
self.contents.draw_text(320, 176, 96, 32, $data_system.words.armor1)
self.contents.draw_text(320, 240, 96, 32, $data_system.words.armor2)
self.contents.draw_text(320, 304, 96, 32, $data_system.words.armor3)
self.contents.draw_text(320, 368, 96, 32, $data_system.words.armor4)
draw_item_name($data_weapons[@actor.weapon_id], 320 + 24, 144)
draw_item_name($data_armors[@actor.armor1_id], 320 + 24, 208)
draw_item_name($data_armors[@actor.armor2_id], 320 + 24, 272)
draw_item_name($data_armors[@actor.armor3_id], 320 + 24, 336)
draw_item_name($data_armors[@actor.armor4_id], 320 + 24, 400)
end
end
class Game_Enemy < Game_Battler
#============================================================================
def ce
n = base_str + base_dex + base_agi + base_int + base_atk + base_pdef +
base_mdef + base_eva
return n
end
end
#==============================================================================
class Window_Help < Window_Base
def set_actor(actor)
if actor != @actor
self.contents.clear
draw_actor_name(actor, 4, 0)
draw_actor_ce(actor, 460, 0)
draw_actor_state(actor, 102, 0)
draw_actor_hp(actor, 184, 0)
draw_actor_sp(actor, 320, 0)
[url=home.php?mod=space&uid=95897]@actor[/url] = actor
@text = nil
self.visible = true
end
end
#--------------------------------------------------------------------------
# ● 设置敌人
# enemy : 要显示名字和状态的敌人
#--------------------------------------------------------------------------
def set_enemy(enemy)
text = enemy.name
draw_enemy_ce(enemy, 460, 0)
state_text = make_battler_state_text(enemy, 112, false)
if state_text != ""
text += " " + state_text
end
set_text(text, 1)
end
end
#==============================================================================
复制代码
作者:
芯☆淡茹水
时间:
2014-5-7 11:46
#【】【】【】【】【】【】【】【】【】【】【】【】【】【】【】【】【】【】【】【】
=begin
===============================================================================
★【战斗力】★
-------------------------------------------------------------------------------
by -> 芯☆淡茹水
===============================================================================
◎ 使用方法:复制该脚本,插入到 main 前。
-------------------------------------------------------------------------------
该脚本在状态窗口增加描绘角色战斗力,在帮助栏增加描绘角色和敌人的战斗力。
要在其他地方描绘角色战斗力,在欲描绘的地方写入:draw_actor_ce(actor, x, y)
敌人:draw_enemy_ce(enemy, x, y)
欲调用战斗力数值,先指定角色/敌人,然后:actor.ce / enemy.ce
===============================================================================
◆ 角色战斗力的构成:
-------------------------------------------------------------------------------
1.角色:力量 + 敏捷 + 速度 + 魔力
-------------------------------------------------------------------------------
2.武器:攻击力 + 物防 + 魔防 + 力量↑ + 敏捷↑ + 速度↑ + 魔力↑
+ 属性攻击数 X 100 + 附加状态数 X 100 + 解除状态数 X 50
-------------------------------------------------------------------------------
3.防具:物防 + 魔防 + 力量↑ + 敏捷↑ + 速度↑ + 魔力↑
+ 属性防御数 X 100 + 状态防御数 X 100 + 自动状态 X 100
-------------------------------------------------------------------------------
总战斗力 = 1(角色)+ 2(武器)+ 3(防具)
===============================================================================
◆ 敌人战斗力的构成:
--------------------------------------------------------------------------------
敌人战斗力 = 力量 + 敏捷 + 速度 + 魔力 + 攻击力 + 物防 + 魔防 + 回避
===============================================================================
=end #【】【】【】【】【】【】【】【】【】【】【】【】【】【】【】【】【】【】
#==============================================================================
class Game_Actor < Game_Battler
#--------------------------------------------------------------------------
# ● 武器品质
#--------------------------------------------------------------------------
def weapon_quality(id)
weapon = $data_weapons[id]
n = weapon.atk + weapon.pdef + weapon.mdef + weapon.str_plus +
weapon.dex_plus + weapon.agi_plus + weapon.int_plus
if weapon.element_set != nil
n += weapon.element_set.size * 100
end
if weapon.plus_state_set != nil
n += weapon.plus_state_set.size * 100
end
if weapon.minus_state_set != nil
n += weapon.minus_state_set.size * 50
end
return n
end
#---------------------------------------------------------------------------
#● 防具品质
#---------------------------------------------------------------------------
def armor_quality(id)
armor = $data_armors[id]
n = armor.pdef + armor.mdef + armor.str_plus + armor.dex_plus +
armor.agi_plus + armor.int_plus
if armor.guard_element_set != nil
n += armor.guard_element_set.size * 100
end
if armor.guard_state_set != nil
n += armor.guard_state_set.size * 100
end
if armor.auto_state_id > 0
n += 100
end
return n
end
#---------------------------------------------------------------------------
#● 角色战斗力
#---------------------------------------------------------------------------
def ce
weapon = $data_weapons[@weapon_id]
armor1 = $data_armors[@armor1_id]
armor2 = $data_armors[@armor2_id]
armor3 = $data_armors[@armor3_id]
armor4 = $data_armors[@armor4_id]
n = str + dex + agi + int
n += weapon != nil ? weapon_quality(@weapon_id) : 0
n += armor1 != nil ? armor_quality(@armor1_id) : 0
n += armor2 != nil ? armor_quality(@armor2_id) : 0
n += armor3 != nil ? armor_quality(@armor3_id) : 0
n += armor4 != nil ? armor_quality(@armor4_id) : 0
return n
end
end
#==============================================================================
class Window_Base < Window
#---------------------------------------------------------------------------
#● 战斗力描绘
#---------------------------------------------------------------------------
def draw_actor_ce(actor, x, y)
self.contents.font.color = system_color
self.contents.draw_text(x, y, 96, 32, "战斗力:")
self.contents.font.color = normal_color
self.contents.draw_text(x + 94, y, 164, 32, actor.ce.to_s)
end
#-------------------------------------------4--------------------------------
#● 敌人战斗力描绘
#---------------------------------------------------------------------------
def draw_enemy_ce(enemy, x, y)
self.contents.font.color = system_color
self.contents.draw_text(x, y, 96, 32, "战斗力:")
self.contents.font.color = normal_color
self.contents.draw_text(x + 94, y, 164, 32, enemy.ce.to_s)
end
end
#==============================================================================
class Window_Status < Window_Base
#--------------------------------------------------------------------------
# ● 刷新
#--------------------------------------------------------------------------
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")
draw_actor_ce(@actor, 319, 120)
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, 160, 96, 32, "装备")
draw_item_name($data_weapons[@actor.weapon_id], 320 + 16, 208)
draw_item_name($data_armors[@actor.armor1_id], 320 + 16, 256)
draw_item_name($data_armors[@actor.armor2_id], 320 + 16, 304)
draw_item_name($data_armors[@actor.armor3_id], 320 + 16, 352)
draw_item_name($data_armors[@actor.armor4_id], 320 + 16, 400)
end
def dummy
self.contents.font.color = system_color
self.contents.draw_text(320, 112, 96, 32, $data_system.words.weapon)
self.contents.draw_text(320, 176, 96, 32, $data_system.words.armor1)
self.contents.draw_text(320, 240, 96, 32, $data_system.words.armor2)
self.contents.draw_text(320, 304, 96, 32, $data_system.words.armor3)
self.contents.draw_text(320, 368, 96, 32, $data_system.words.armor4)
draw_item_name($data_weapons[@actor.weapon_id], 320 + 24, 144)
draw_item_name($data_armors[@actor.armor1_id], 320 + 24, 208)
draw_item_name($data_armors[@actor.armor2_id], 320 + 24, 272)
draw_item_name($data_armors[@actor.armor3_id], 320 + 24, 336)
draw_item_name($data_armors[@actor.armor4_id], 320 + 24, 400)
end
end
class Game_Enemy < Game_Battler
#============================================================================
def ce
n = base_str + base_dex + base_agi + base_int + base_atk + base_pdef +
base_mdef + base_eva
return n
end
end
#==============================================================================
class Window_Help < Window_Base
#------------------------------------------------------------------------
def set_actor(actor)
if actor != @actor
self.contents.clear
draw_actor_name(actor, 4, 0)
draw_actor_ce(actor, 460, 0)
draw_actor_state(actor, 102, 0)
draw_actor_hp(actor, 184, 0)
draw_actor_sp(actor, 320, 0)
[url=home.php?mod=space&uid=95897]@actor[/url] = actor
@text = nil
self.visible = true
end
end
#--------------------------------------------------------------------------
# ● 设置敌人
# enemy : 要显示名字和状态的敌人
#--------------------------------------------------------------------------
def set_enemy(enemy)
self.contents.clear
draw_enemy_ce(enemy, 470, 0)
draw_actor_name(enemy, 4, 0)
draw_actor_state(enemy, 110, 0)
carol3_draw_hp_bar(enemy, 184, 0)
carol3_draw_sp_bar(enemy, 324, 0)
@text = nil
self.visible = true
end
#---------------------------------------------------------------------------
def carol3_draw_hp_bar(actor, x, y, width = 128) #宽度可调
self.contents.font.color = system_color
w = width * actor.hp / [actor.maxhp,1].max
if actor.maxhp != 0
rate = actor.hp.to_f / actor.maxhp
else
rate = 0
end
color1 = Color.new(240 - 72 * rate, 240 * rate, 62 * rate, 150)
self.contents.fill_rect(x+1, y+15, width+2,1, Color.new(0, 0, 0, 255))
self.contents.fill_rect(x+1, y+16, width+2,1, Color.new(255, 255, 192, 192))
self.contents.fill_rect(x+1, y+17, w,6,color1)
self.contents.fill_rect(x+1, y+23, width+2,1, Color.new(255, 255, 192, 192))
self.contents.fill_rect(x+1, y+24, width+2,1, Color.new(0, 0, 0, 255))
self.contents.fill_rect(x, y+16, 1,8, Color.new(255, 255, 192, 192))
self.contents.fill_rect(x-1, y+15, 1,10, Color.new(0, 0, 0, 255))
self.contents.fill_rect(x+129, y+16, 1,8, Color.new(255, 255, 192, 192))
self.contents.fill_rect(x+130, y+15, 1,10, Color.new(0, 0, 0, 255))
self.contents.draw_text(x-53,y,128,32,$data_system.words.hp,1)
if actor.hp>actor.maxhp/3
self.contents.font.color = Color.new(255, 255, 255, 250)
end
if actor.hp>=actor.maxhp/6 and actor.maxhp/3>actor.hp
self.contents.font.color = Color.new(200, 200, 0, 255)
end
if actor.maxhp/6>actor.hp
self.contents.font.color = Color.new(200, 0, 0, 255)
end
self.contents.draw_text(x+47,y,128,32,actor.hp.to_s,1)
end
#------------------------------------------------------------------------
def carol3_draw_sp_bar(actor, x, y, width = 128)
self.contents.font.color = system_color
if actor.maxsp != 0
rate = actor.sp.to_f / actor.maxsp
else
rate = 0
end
color2 = Color.new(62 * rate, 240 - 72 * rate, 240 * rate, 192)
w = width * actor.sp / [actor.maxsp,1].max
self.contents.fill_rect(x+1, y+15, width+2,1, Color.new(0, 0, 0, 255))
self.contents.fill_rect(x+1, y+16, width+2,1, Color.new(255, 255, 192, 192))
self.contents.fill_rect(x+1, y+17, w,6,color2)
self.contents.fill_rect(x+1, y+23, width+2,1, Color.new(255, 255, 192, 192))
self.contents.fill_rect(x+1, y+24, width+2,1, Color.new(0, 0, 0, 255))
self.contents.fill_rect(x, y+16, 1,8, Color.new(255, 255, 192, 192))
self.contents.fill_rect(x-1, y+15, 1,10, Color.new(0, 0, 0, 255))
self.contents.fill_rect(x+129, y+16, 1,8, Color.new(255, 255, 192, 192))
self.contents.fill_rect(x+130, y+15, 1,10, Color.new(0, 0, 0, 255))
self.contents.draw_text(x-53,y,128,32,$data_system.words.sp,1)
if actor.hp>actor.maxsp/3
self.contents.font.color = Color.new(255, 255, 255, 250)
end
if actor.hp>=actor.maxsp/6 and actor.maxsp/3>actor.sp
self.contents.font.color = Color.new(200, 200, 0, 255)
end
if actor.maxsp/6>actor.sp
self.contents.font.color = Color.new(200, 0, 0, 255)
end
self.contents.draw_text(x+47,y,128,32,actor.sp.to_s,1)
end
end
#==============================================================================
复制代码
作者:
CR~
时间:
2014-5-7 13:27
芯☆淡茹水 发表于 2014-5-7 11:46
非常感谢!~
欢迎光临 Project1 (https://rpg.blue/)
Powered by Discuz! X3.1