设为首页收藏本站|繁體中文

Project1

 找回密码
 注册会员
搜索
查看: 2424|回复: 2
打印 上一主题 下一主题

[已经解决] 求整合一下这两个脚本。。。

[复制链接]

Lv3.寻梦者

梦石
0
星屑
1308
在线时间
354 小时
注册时间
2009-9-14
帖子
328
跳转到指定楼层
1
发表于 2014-5-7 11:46:24 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
2星屑
敌人的血条脚本(帮助兰的血条盖住的战斗力)
  1. class Window_Help < Window_Base
  2.   def set_enemy(actor)
  3.     self.contents.clear
  4.     draw_actor_name(actor, 4, 0)
  5.     draw_actor_state(actor, 140, 0)
  6.     carol3_draw_hp_bar(actor, 284, 0)
  7.     carol3_draw_sp_bar(actor, 460, 0)
  8.     @text = nil
  9.     self.visible = true
  10.   end  
  11.   def carol3_draw_hp_bar(actor, x, y, width = 128) #宽度可调
  12.     self.contents.font.color = system_color
  13.     w = width * actor.hp / [actor.maxhp,1].max
  14.     if actor.maxhp != 0
  15.       rate = actor.hp.to_f / actor.maxhp
  16.     else
  17.       rate = 0
  18.     end
  19.     color1 = Color.new(240 - 72 * rate, 240 * rate, 62 * rate, 150)
  20.     self.contents.fill_rect(x+1, y+15, width+2,1, Color.new(0, 0, 0, 255))
  21.     self.contents.fill_rect(x+1, y+16, width+2,1, Color.new(255, 255, 192, 192))
  22.      self.contents.fill_rect(x+1, y+17, w,6,color1)
  23.     self.contents.fill_rect(x+1, y+23, width+2,1, Color.new(255, 255, 192, 192))
  24.      self.contents.fill_rect(x+1, y+24, width+2,1, Color.new(0, 0, 0, 255))
  25.     self.contents.fill_rect(x, y+16, 1,8, Color.new(255, 255, 192, 192))
  26.     self.contents.fill_rect(x-1, y+15, 1,10, Color.new(0, 0, 0, 255))
  27.     self.contents.fill_rect(x+129, y+16, 1,8, Color.new(255, 255, 192, 192))
  28.     self.contents.fill_rect(x+130, y+15, 1,10, Color.new(0, 0, 0, 255))
  29.     self.contents.draw_text(x-53,y,128,32,$data_system.words.hp,1)
  30.     if actor.hp>actor.maxhp/3
  31.       self.contents.font.color = Color.new(255, 255, 255, 250)
  32.     end
  33.     if actor.hp>=actor.maxhp/6 and actor.maxhp/3>actor.hp
  34.       self.contents.font.color = Color.new(200, 200, 0, 255)
  35.     end
  36.     if actor.maxhp/6>actor.hp
  37.       self.contents.font.color = Color.new(200, 0, 0, 255)
  38.     end
  39.     self.contents.draw_text(x+47,y,128,32,actor.hp.to_s,1)
  40.   end
  41.   def carol3_draw_sp_bar(actor, x, y, width = 128)
  42.     self.contents.font.color = system_color
  43.     if actor.maxsp != 0
  44.       rate = actor.sp.to_f / actor.maxsp
  45.     else
  46.       rate = 0
  47.     end
  48.     color2 = Color.new(62 * rate, 240 - 72 * rate, 240 * rate, 192)
  49.     w = width * actor.sp / [actor.maxsp,1].max  
  50.     self.contents.fill_rect(x+1, y+15, width+2,1, Color.new(0, 0, 0, 255))
  51.     self.contents.fill_rect(x+1, y+16, width+2,1, Color.new(255, 255, 192, 192))
  52.      self.contents.fill_rect(x+1, y+17, w,6,color2)
  53.     self.contents.fill_rect(x+1, y+23, width+2,1, Color.new(255, 255, 192, 192))
  54.      self.contents.fill_rect(x+1, y+24, width+2,1, Color.new(0, 0, 0, 255))
  55.     self.contents.fill_rect(x, y+16, 1,8, Color.new(255, 255, 192, 192))
  56.     self.contents.fill_rect(x-1, y+15, 1,10, Color.new(0, 0, 0, 255))
  57.     self.contents.fill_rect(x+129, y+16, 1,8, Color.new(255, 255, 192, 192))
  58.     self.contents.fill_rect(x+130, y+15, 1,10, Color.new(0, 0, 0, 255))
  59.     self.contents.draw_text(x-53,y,128,32,$data_system.words.sp,1)
  60.     if actor.hp>actor.maxsp/3
  61.       self.contents.font.color = Color.new(255, 255, 255, 250)
  62.     end
  63.     if actor.hp>=actor.maxsp/6 and actor.maxsp/3>actor.sp
  64.       self.contents.font.color = Color.new(200, 200, 0, 255)
  65.     end
  66.     if actor.maxsp/6>actor.sp
  67.       self.contents.font.color = Color.new(200, 0, 0, 255)
  68.     end
  69.     self.contents.draw_text(x+47,y,128,32,actor.sp.to_s,1)
  70.   end
  71. end  
复制代码
战斗力脚本
  1. #【】【】【】【】【】【】【】【】【】【】【】【】【】【】【】【】【】【】【】【】
  2. =begin
  3. ===============================================================================
  4. ★【战斗力】★
  5. -------------------------------------------------------------------------------
  6.   by ->  芯☆淡茹水
  7. ===============================================================================
  8. ◎ 使用方法:复制该脚本,插入到 main 前。
  9. -------------------------------------------------------------------------------
  10.   该脚本在状态窗口增加描绘角色战斗力,在帮助栏增加描绘角色和敌人的战斗力。
  11.   要在其他地方描绘角色战斗力,在欲描绘的地方写入:draw_actor_ce(actor, x, y)
  12.                                             敌人:draw_enemy_ce(enemy, x, y)
  13.   欲调用战斗力数值,先指定角色/敌人,然后:actor.ce / enemy.ce
  14. ===============================================================================
  15. ◆ 角色战斗力的构成:
  16. -------------------------------------------------------------------------------
  17.        1.角色:力量 + 敏捷 + 速度 + 魔力
  18. -------------------------------------------------------------------------------
  19.        2.武器:攻击力 + 物防 + 魔防 + 力量↑ + 敏捷↑ + 速度↑ + 魔力↑
  20.                + 属性攻击数 X 100 + 附加状态数 X 100 + 解除状态数 X 50
  21. -------------------------------------------------------------------------------
  22.        3.防具:物防 + 魔防 + 力量↑ + 敏捷↑ + 速度↑ + 魔力↑
  23.                + 属性防御数 X 100 + 状态防御数 X 100 + 自动状态 X 100
  24. -------------------------------------------------------------------------------
  25.    总战斗力 = 1(角色)+ 2(武器)+ 3(防具)
  26. ===============================================================================
  27. ◆ 敌人战斗力的构成:
  28. --------------------------------------------------------------------------------
  29.    敌人战斗力 = 力量 + 敏捷 + 速度 + 魔力 + 攻击力 + 物防 + 魔防 + 回避
  30. ===============================================================================
  31. =end   #【】【】【】【】【】【】【】【】【】【】【】【】【】【】【】【】【】【】
  32. #==============================================================================
  33. class Game_Actor < Game_Battler
  34.   #--------------------------------------------------------------------------
  35.   # ● 武器品质
  36.   #--------------------------------------------------------------------------
  37.   def weapon_quality(id)
  38.     weapon = $data_weapons[id]
  39.     n = weapon.atk + weapon.pdef + weapon.mdef + weapon.str_plus +
  40.         weapon.dex_plus + weapon.agi_plus + weapon.int_plus
  41.     if weapon.element_set != nil
  42.       n += weapon.element_set.size * 100
  43.     end
  44.     if weapon.plus_state_set != nil
  45.       n += weapon.plus_state_set.size * 100
  46.     end
  47.     if weapon.minus_state_set != nil
  48.       n += weapon.minus_state_set.size * 50
  49.     end
  50.     return n
  51.   end
  52.   #---------------------------------------------------------------------------
  53.   #● 防具品质
  54.   #---------------------------------------------------------------------------
  55.   def armor_quality(id)
  56.     armor = $data_armors[id]
  57.     n = armor.pdef + armor.mdef + armor.str_plus + armor.dex_plus +
  58.         armor.agi_plus + armor.int_plus
  59.     if armor.guard_element_set != nil
  60.       n += armor.guard_element_set.size * 100
  61.     end
  62.     if armor.guard_state_set != nil
  63.       n += armor.guard_state_set.size * 100
  64.     end
  65.     if armor.auto_state_id > 0
  66.       n += 100
  67.     end
  68.     return n
  69.   end
  70.   #---------------------------------------------------------------------------
  71.   #● 角色战斗力
  72.   #---------------------------------------------------------------------------
  73.   def ce
  74.     weapon = $data_weapons[@weapon_id]
  75.     armor1 = $data_armors[@armor1_id]
  76.     armor2 = $data_armors[@armor2_id]
  77.     armor3 = $data_armors[@armor3_id]
  78.     armor4 = $data_armors[@armor4_id]
  79.     n = str + dex + agi + int
  80.     n += weapon != nil ? weapon_quality(@weapon_id) : 0
  81.     n += armor1 != nil ?  armor_quality(@armor1_id) : 0
  82.     n += armor2 != nil ?  armor_quality(@armor2_id) : 0
  83.     n += armor3 != nil ?  armor_quality(@armor3_id) : 0
  84.     n += armor4 != nil ?  armor_quality(@armor4_id) : 0
  85.     return n
  86.   end
  87. end
  88. #==============================================================================
  89. class Window_Base < Window
  90.   #---------------------------------------------------------------------------
  91.   #● 战斗力描绘
  92.   #---------------------------------------------------------------------------
  93.   def draw_actor_ce(actor, x, y)
  94.     self.contents.font.color = system_color
  95.     self.contents.draw_text(x, y, 96, 32, "战斗力:")
  96.     self.contents.font.color = normal_color
  97.     self.contents.draw_text(x + 94, y, 164, 32, actor.ce.to_s)
  98.   end
  99.   #-------------------------------------------4--------------------------------
  100.   #● 敌人战斗力描绘
  101.   #---------------------------------------------------------------------------
  102.   def draw_enemy_ce(enemy, x, y)
  103.     self.contents.font.color = system_color
  104.     self.contents.draw_text(x, y, 96, 32, "战斗力:")
  105.     self.contents.font.color = normal_color
  106.     self.contents.draw_text(x + 94, y, 164, 32, enemy.ce.to_s)
  107.   end
  108. end
  109. #==============================================================================
  110. class Window_Status < Window_Base
  111.   #--------------------------------------------------------------------------
  112.   # ● 刷新
  113.   #--------------------------------------------------------------------------
  114.   def refresh
  115.     self.contents.clear
  116.     draw_actor_graphic(@actor, 40, 112)
  117.     draw_actor_name(@actor, 4, 0)
  118.     draw_actor_class(@actor, 4 + 144, 0)
  119.     draw_actor_level(@actor, 96, 32)
  120.     draw_actor_state(@actor, 96, 64)
  121.     draw_actor_hp(@actor, 96, 112, 172)
  122.     draw_actor_sp(@actor, 96, 144, 172)
  123.     draw_actor_parameter(@actor, 96, 192, 0)
  124.     draw_actor_parameter(@actor, 96, 224, 1)
  125.     draw_actor_parameter(@actor, 96, 256, 2)
  126.     draw_actor_parameter(@actor, 96, 304, 3)
  127.     draw_actor_parameter(@actor, 96, 336, 4)
  128.     draw_actor_parameter(@actor, 96, 368, 5)
  129.     draw_actor_parameter(@actor, 96, 400, 6)
  130.     self.contents.font.color = system_color
  131.     self.contents.draw_text(320, 48, 80, 32, "EXP")
  132.     self.contents.draw_text(320, 80, 80, 32, "NEXT")
  133.     draw_actor_ce(@actor, 319, 120)
  134.     self.contents.font.color = normal_color
  135.     self.contents.draw_text(320 + 80, 48, 84, 32, @actor.exp_s, 2)
  136.     self.contents.draw_text(320 + 80, 80, 84, 32, @actor.next_rest_exp_s, 2)
  137.     self.contents.font.color = system_color
  138.     self.contents.draw_text(320, 160, 96, 32, "装备")
  139.     draw_item_name($data_weapons[@actor.weapon_id], 320 + 16, 208)
  140.     draw_item_name($data_armors[@actor.armor1_id], 320 + 16, 256)
  141.     draw_item_name($data_armors[@actor.armor2_id], 320 + 16, 304)
  142.     draw_item_name($data_armors[@actor.armor3_id], 320 + 16, 352)
  143.     draw_item_name($data_armors[@actor.armor4_id], 320 + 16, 400)
  144.   end
  145.   def dummy
  146.     self.contents.font.color = system_color
  147.     self.contents.draw_text(320, 112, 96, 32, $data_system.words.weapon)
  148.     self.contents.draw_text(320, 176, 96, 32, $data_system.words.armor1)
  149.     self.contents.draw_text(320, 240, 96, 32, $data_system.words.armor2)
  150.     self.contents.draw_text(320, 304, 96, 32, $data_system.words.armor3)
  151.     self.contents.draw_text(320, 368, 96, 32, $data_system.words.armor4)
  152.     draw_item_name($data_weapons[@actor.weapon_id], 320 + 24, 144)
  153.     draw_item_name($data_armors[@actor.armor1_id], 320 + 24, 208)
  154.     draw_item_name($data_armors[@actor.armor2_id], 320 + 24, 272)
  155.     draw_item_name($data_armors[@actor.armor3_id], 320 + 24, 336)
  156.     draw_item_name($data_armors[@actor.armor4_id], 320 + 24, 400)
  157.   end
  158. end
  159. class Game_Enemy < Game_Battler
  160.   #============================================================================
  161.   def ce
  162.     n = base_str + base_dex + base_agi + base_int + base_atk + base_pdef +
  163.         base_mdef + base_eva
  164.     return n
  165.   end
  166. end
  167. #==============================================================================
  168. class Window_Help < Window_Base
  169.   def set_actor(actor)
  170.     if actor != @actor
  171.       self.contents.clear
  172.       draw_actor_name(actor, 4, 0)
  173.       draw_actor_ce(actor, 460, 0)
  174.       draw_actor_state(actor, 102, 0)
  175.       draw_actor_hp(actor, 184, 0)
  176.       draw_actor_sp(actor, 320, 0)
  177.       [url=home.php?mod=space&uid=95897]@actor[/url] = actor
  178.       @text = nil
  179.       self.visible = true
  180.     end
  181.   end
  182.   #--------------------------------------------------------------------------
  183.   # ● 设置敌人
  184.   #     enemy : 要显示名字和状态的敌人
  185.   #--------------------------------------------------------------------------
  186.   def set_enemy(enemy)
  187.     text = enemy.name
  188.     draw_enemy_ce(enemy, 460, 0)
  189.     state_text = make_battler_state_text(enemy, 112, false)
  190.     if state_text != ""
  191.       text += "  " + state_text
  192.     end
  193.     set_text(text, 1)
  194.   end
  195. end
  196. #==============================================================================
  197.    
复制代码

Lv5.捕梦者

梦石
0
星屑
33422
在线时间
5108 小时
注册时间
2012-11-19
帖子
4878

开拓者

2
发表于 2014-5-7 11:46:25 | 只看该作者
  1. #【】【】【】【】【】【】【】【】【】【】【】【】【】【】【】【】【】【】【】【】
  2. =begin
  3. ===============================================================================
  4. ★【战斗力】★
  5. -------------------------------------------------------------------------------
  6.   by ->  芯☆淡茹水
  7. ===============================================================================
  8. ◎ 使用方法:复制该脚本,插入到 main 前。
  9. -------------------------------------------------------------------------------
  10.   该脚本在状态窗口增加描绘角色战斗力,在帮助栏增加描绘角色和敌人的战斗力。
  11.   要在其他地方描绘角色战斗力,在欲描绘的地方写入:draw_actor_ce(actor, x, y)
  12.                                             敌人:draw_enemy_ce(enemy, x, y)
  13.   欲调用战斗力数值,先指定角色/敌人,然后:actor.ce / enemy.ce
  14. ===============================================================================
  15. ◆ 角色战斗力的构成:
  16. -------------------------------------------------------------------------------
  17.        1.角色:力量 + 敏捷 + 速度 + 魔力
  18. -------------------------------------------------------------------------------
  19.        2.武器:攻击力 + 物防 + 魔防 + 力量↑ + 敏捷↑ + 速度↑ + 魔力↑
  20.                + 属性攻击数 X 100 + 附加状态数 X 100 + 解除状态数 X 50
  21. -------------------------------------------------------------------------------
  22.        3.防具:物防 + 魔防 + 力量↑ + 敏捷↑ + 速度↑ + 魔力↑
  23.                + 属性防御数 X 100 + 状态防御数 X 100 + 自动状态 X 100
  24. -------------------------------------------------------------------------------
  25.    总战斗力 = 1(角色)+ 2(武器)+ 3(防具)
  26. ===============================================================================
  27. ◆ 敌人战斗力的构成:
  28. --------------------------------------------------------------------------------
  29.    敌人战斗力 = 力量 + 敏捷 + 速度 + 魔力 + 攻击力 + 物防 + 魔防 + 回避
  30. ===============================================================================
  31. =end   #【】【】【】【】【】【】【】【】【】【】【】【】【】【】【】【】【】【】
  32. #==============================================================================
  33. class Game_Actor < Game_Battler
  34.   #--------------------------------------------------------------------------
  35.   # ● 武器品质
  36.   #--------------------------------------------------------------------------
  37.   def weapon_quality(id)
  38.     weapon = $data_weapons[id]
  39.     n = weapon.atk + weapon.pdef + weapon.mdef + weapon.str_plus +
  40.         weapon.dex_plus + weapon.agi_plus + weapon.int_plus
  41.     if weapon.element_set != nil
  42.       n += weapon.element_set.size * 100
  43.     end
  44.     if weapon.plus_state_set != nil
  45.       n += weapon.plus_state_set.size * 100
  46.     end
  47.     if weapon.minus_state_set != nil
  48.       n += weapon.minus_state_set.size * 50
  49.     end
  50.     return n
  51.   end
  52.   #---------------------------------------------------------------------------
  53.   #● 防具品质
  54.   #---------------------------------------------------------------------------
  55.   def armor_quality(id)
  56.     armor = $data_armors[id]
  57.     n = armor.pdef + armor.mdef + armor.str_plus + armor.dex_plus +
  58.         armor.agi_plus + armor.int_plus
  59.     if armor.guard_element_set != nil
  60.       n += armor.guard_element_set.size * 100
  61.     end
  62.     if armor.guard_state_set != nil
  63.       n += armor.guard_state_set.size * 100
  64.     end
  65.     if armor.auto_state_id > 0
  66.       n += 100
  67.     end
  68.     return n
  69.   end
  70.   #---------------------------------------------------------------------------
  71.   #● 角色战斗力
  72.   #---------------------------------------------------------------------------
  73.   def ce
  74.     weapon = $data_weapons[@weapon_id]
  75.     armor1 = $data_armors[@armor1_id]
  76.     armor2 = $data_armors[@armor2_id]
  77.     armor3 = $data_armors[@armor3_id]
  78.     armor4 = $data_armors[@armor4_id]
  79.     n = str + dex + agi + int
  80.     n += weapon != nil ? weapon_quality(@weapon_id) : 0
  81.     n += armor1 != nil ?  armor_quality(@armor1_id) : 0
  82.     n += armor2 != nil ?  armor_quality(@armor2_id) : 0
  83.     n += armor3 != nil ?  armor_quality(@armor3_id) : 0
  84.     n += armor4 != nil ?  armor_quality(@armor4_id) : 0
  85.     return n
  86.   end
  87. end
  88. #==============================================================================
  89. class Window_Base < Window
  90.   #---------------------------------------------------------------------------
  91.   #● 战斗力描绘
  92.   #---------------------------------------------------------------------------
  93.   def draw_actor_ce(actor, x, y)
  94.     self.contents.font.color = system_color
  95.     self.contents.draw_text(x, y, 96, 32, "战斗力:")
  96.     self.contents.font.color = normal_color
  97.     self.contents.draw_text(x + 94, y, 164, 32, actor.ce.to_s)
  98.   end
  99.   #-------------------------------------------4--------------------------------
  100.   #● 敌人战斗力描绘
  101.   #---------------------------------------------------------------------------
  102.   def draw_enemy_ce(enemy, x, y)
  103.     self.contents.font.color = system_color
  104.     self.contents.draw_text(x, y, 96, 32, "战斗力:")
  105.     self.contents.font.color = normal_color
  106.     self.contents.draw_text(x + 94, y, 164, 32, enemy.ce.to_s)
  107.   end
  108. end
  109. #==============================================================================
  110. class Window_Status < Window_Base
  111.   #--------------------------------------------------------------------------
  112.   # ● 刷新
  113.   #--------------------------------------------------------------------------
  114.   def refresh
  115.     self.contents.clear
  116.     draw_actor_graphic(@actor, 40, 112)
  117.     draw_actor_name(@actor, 4, 0)
  118.     draw_actor_class(@actor, 4 + 144, 0)
  119.     draw_actor_level(@actor, 96, 32)
  120.     draw_actor_state(@actor, 96, 64)
  121.     draw_actor_hp(@actor, 96, 112, 172)
  122.     draw_actor_sp(@actor, 96, 144, 172)
  123.     draw_actor_parameter(@actor, 96, 192, 0)
  124.     draw_actor_parameter(@actor, 96, 224, 1)
  125.     draw_actor_parameter(@actor, 96, 256, 2)
  126.     draw_actor_parameter(@actor, 96, 304, 3)
  127.     draw_actor_parameter(@actor, 96, 336, 4)
  128.     draw_actor_parameter(@actor, 96, 368, 5)
  129.     draw_actor_parameter(@actor, 96, 400, 6)
  130.     self.contents.font.color = system_color
  131.     self.contents.draw_text(320, 48, 80, 32, "EXP")
  132.     self.contents.draw_text(320, 80, 80, 32, "NEXT")
  133.     draw_actor_ce(@actor, 319, 120)
  134.     self.contents.font.color = normal_color
  135.     self.contents.draw_text(320 + 80, 48, 84, 32, @actor.exp_s, 2)
  136.     self.contents.draw_text(320 + 80, 80, 84, 32, @actor.next_rest_exp_s, 2)
  137.     self.contents.font.color = system_color
  138.     self.contents.draw_text(320, 160, 96, 32, "装备")
  139.     draw_item_name($data_weapons[@actor.weapon_id], 320 + 16, 208)
  140.     draw_item_name($data_armors[@actor.armor1_id], 320 + 16, 256)
  141.     draw_item_name($data_armors[@actor.armor2_id], 320 + 16, 304)
  142.     draw_item_name($data_armors[@actor.armor3_id], 320 + 16, 352)
  143.     draw_item_name($data_armors[@actor.armor4_id], 320 + 16, 400)
  144.   end
  145.   def dummy
  146.     self.contents.font.color = system_color
  147.     self.contents.draw_text(320, 112, 96, 32, $data_system.words.weapon)
  148.     self.contents.draw_text(320, 176, 96, 32, $data_system.words.armor1)
  149.     self.contents.draw_text(320, 240, 96, 32, $data_system.words.armor2)
  150.     self.contents.draw_text(320, 304, 96, 32, $data_system.words.armor3)
  151.     self.contents.draw_text(320, 368, 96, 32, $data_system.words.armor4)
  152.     draw_item_name($data_weapons[@actor.weapon_id], 320 + 24, 144)
  153.     draw_item_name($data_armors[@actor.armor1_id], 320 + 24, 208)
  154.     draw_item_name($data_armors[@actor.armor2_id], 320 + 24, 272)
  155.     draw_item_name($data_armors[@actor.armor3_id], 320 + 24, 336)
  156.     draw_item_name($data_armors[@actor.armor4_id], 320 + 24, 400)
  157.   end
  158. end
  159. class Game_Enemy < Game_Battler
  160.   #============================================================================
  161.   def ce
  162.     n = base_str + base_dex + base_agi + base_int + base_atk + base_pdef +
  163.         base_mdef + base_eva
  164.     return n
  165.   end
  166. end
  167. #==============================================================================
  168. class Window_Help < Window_Base
  169.   #------------------------------------------------------------------------
  170.   def set_actor(actor)
  171.     if actor != @actor
  172.       self.contents.clear
  173.       draw_actor_name(actor, 4, 0)
  174.       draw_actor_ce(actor, 460, 0)
  175.       draw_actor_state(actor, 102, 0)
  176.       draw_actor_hp(actor, 184, 0)
  177.       draw_actor_sp(actor, 320, 0)
  178.       [url=home.php?mod=space&uid=95897]@actor[/url] = actor
  179.       @text = nil
  180.       self.visible = true
  181.     end
  182.   end
  183.   #--------------------------------------------------------------------------
  184.   # ● 设置敌人
  185.   #     enemy : 要显示名字和状态的敌人
  186.   #--------------------------------------------------------------------------
  187.   def set_enemy(enemy)
  188.     self.contents.clear
  189.     draw_enemy_ce(enemy, 470, 0)
  190.     draw_actor_name(enemy, 4, 0)
  191.     draw_actor_state(enemy, 110, 0)
  192.     carol3_draw_hp_bar(enemy, 184, 0)
  193.     carol3_draw_sp_bar(enemy, 324, 0)
  194.     @text = nil
  195.     self.visible = true
  196.   end  
  197.   #---------------------------------------------------------------------------
  198.   def carol3_draw_hp_bar(actor, x, y, width = 128) #宽度可调
  199.     self.contents.font.color = system_color
  200.     w = width * actor.hp / [actor.maxhp,1].max
  201.     if actor.maxhp != 0
  202.       rate = actor.hp.to_f / actor.maxhp
  203.     else
  204.       rate = 0
  205.     end
  206.     color1 = Color.new(240 - 72 * rate, 240 * rate, 62 * rate, 150)
  207.     self.contents.fill_rect(x+1, y+15, width+2,1, Color.new(0, 0, 0, 255))
  208.     self.contents.fill_rect(x+1, y+16, width+2,1, Color.new(255, 255, 192, 192))
  209.      self.contents.fill_rect(x+1, y+17, w,6,color1)
  210.     self.contents.fill_rect(x+1, y+23, width+2,1, Color.new(255, 255, 192, 192))
  211.      self.contents.fill_rect(x+1, y+24, width+2,1, Color.new(0, 0, 0, 255))
  212.     self.contents.fill_rect(x, y+16, 1,8, Color.new(255, 255, 192, 192))
  213.     self.contents.fill_rect(x-1, y+15, 1,10, Color.new(0, 0, 0, 255))
  214.     self.contents.fill_rect(x+129, y+16, 1,8, Color.new(255, 255, 192, 192))
  215.     self.contents.fill_rect(x+130, y+15, 1,10, Color.new(0, 0, 0, 255))
  216.     self.contents.draw_text(x-53,y,128,32,$data_system.words.hp,1)
  217.     if actor.hp>actor.maxhp/3
  218.       self.contents.font.color = Color.new(255, 255, 255, 250)
  219.     end
  220.     if actor.hp>=actor.maxhp/6 and actor.maxhp/3>actor.hp
  221.       self.contents.font.color = Color.new(200, 200, 0, 255)
  222.     end
  223.     if actor.maxhp/6>actor.hp
  224.       self.contents.font.color = Color.new(200, 0, 0, 255)
  225.     end
  226.     self.contents.draw_text(x+47,y,128,32,actor.hp.to_s,1)
  227.   end
  228.   #------------------------------------------------------------------------
  229.   def carol3_draw_sp_bar(actor, x, y, width = 128)
  230.     self.contents.font.color = system_color
  231.     if actor.maxsp != 0
  232.       rate = actor.sp.to_f / actor.maxsp
  233.     else
  234.       rate = 0
  235.     end
  236.     color2 = Color.new(62 * rate, 240 - 72 * rate, 240 * rate, 192)
  237.     w = width * actor.sp / [actor.maxsp,1].max  
  238.     self.contents.fill_rect(x+1, y+15, width+2,1, Color.new(0, 0, 0, 255))
  239.     self.contents.fill_rect(x+1, y+16, width+2,1, Color.new(255, 255, 192, 192))
  240.      self.contents.fill_rect(x+1, y+17, w,6,color2)
  241.     self.contents.fill_rect(x+1, y+23, width+2,1, Color.new(255, 255, 192, 192))
  242.      self.contents.fill_rect(x+1, y+24, width+2,1, Color.new(0, 0, 0, 255))
  243.     self.contents.fill_rect(x, y+16, 1,8, Color.new(255, 255, 192, 192))
  244.     self.contents.fill_rect(x-1, y+15, 1,10, Color.new(0, 0, 0, 255))
  245.     self.contents.fill_rect(x+129, y+16, 1,8, Color.new(255, 255, 192, 192))
  246.     self.contents.fill_rect(x+130, y+15, 1,10, Color.new(0, 0, 0, 255))
  247.     self.contents.draw_text(x-53,y,128,32,$data_system.words.sp,1)
  248.     if actor.hp>actor.maxsp/3
  249.       self.contents.font.color = Color.new(255, 255, 255, 250)
  250.     end
  251.     if actor.hp>=actor.maxsp/6 and actor.maxsp/3>actor.sp
  252.       self.contents.font.color = Color.new(200, 200, 0, 255)
  253.     end
  254.     if actor.maxsp/6>actor.sp
  255.       self.contents.font.color = Color.new(200, 0, 0, 255)
  256.     end
  257.     self.contents.draw_text(x+47,y,128,32,actor.sp.to_s,1)
  258.   end
  259. end
  260. #==============================================================================
复制代码

评分

参与人数 1星屑 +120 收起 理由
myownroc + 120 认可答案

查看全部评分

xp vx va mv  va mz 各类型脚本/插件定制
回复

使用道具 举报

Lv3.寻梦者

梦石
0
星屑
1308
在线时间
354 小时
注册时间
2009-9-14
帖子
328
3
 楼主| 发表于 2014-5-7 13:27:52 | 只看该作者
芯☆淡茹水 发表于 2014-5-7 11:46

非常感谢!~
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

拿上你的纸笔,建造一个属于你的梦想世界,加入吧。
 注册会员
找回密码

站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作

GMT+8, 2024-11-11 15:16

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表