#============================================================================== # 本脚本来自www.66RPG.com,使用和转载请保留此信息 #============================================================================== # -------------------------------------------------------------------- # 本脚本来自www.66rpg.com,转载自www.phylomortis.com,转载请保留此信息 # -------------------------------------------------------------------- =begin 原文说明: This script allows you change the damage display font and color. To use this script, create a new script page in the script editor and copy the code below onto that page. Next, replace "fontname" in red with the the font you want to use. Replace "fontsize" with the size of your font. Then, replace the first set of "red", "green", and "blue" values with an RGB value for the color you want for healing, and the second set with the color you want for damage. Note that only TTF, non-wingdings fonts are supported. This script is also easily extended so that you can show MP damage and recovery in a different color, but this is your responsibility to learn, so don't bug me about it. 66RPG说明: 这里并不是一个简单的傻瓜型脚本。如果你只是将它插入到main的前面,则只是把 "CRITICAL"改为了"超重击"。这个脚本的功能绝非如此简单,你可以设置不同伤害的字 体颜色或文字表述,就像黑暗圣剑传说那样,有一些攻击显示的并不是数字,而是“损 失金钱”,“剑灵恢复”一类的东西。bitmap.font.color.set(R,G,B)是设置字体RGB 颜色的,其他的效果(如显示SP的伤害,用不同颜色来恢复)如果需要用,看懂脚本并修 改它——这是你的责任与义务,也是你的荣誉。尽管我对这个脚本了如指掌,但我不会 去做相关回答的,这会剥夺很多人自主学习的权利。 =end module RPG class Sprite < ::Sprite def damage(value, critical) dispose_damage if value.is_a?(Numeric) damage_string = value.abs.to_s else damage_string = value.to_s end bitmap = Bitmap.new(160, 48) bitmap.font.name = "黑体" bitmap.font.size = 18 bitmap.font.color.set(0, 0, 0) bitmap.draw_text(-1, 12-1, 160, 36, damage_string, 1) bitmap.draw_text(+1, 12-1, 160, 36, damage_string, 1) bitmap.draw_text(-1, 12+1, 160, 36, damage_string, 1) bitmap.draw_text(+1, 12+1, 160, 36, damage_string, 1) if value.is_a?(Numeric) and value < 0 bitmap.font.color.set(255, 255, 255) else bitmap.font.color.set(255, 0, 0) end bitmap.draw_text(0, 12, 160, 36, damage_string, 1) if critical bitmap.font.size = 20 bitmap.font.color.set(0, 0, 0) bitmap.draw_text(-1, -1, 160, 20, "超重击", 1) bitmap.draw_text(+1, -1, 160, 20, "超重击", 1) bitmap.draw_text(-1, +1, 160, 20, "超重击", 1) bitmap.draw_text(+1, +1, 160, 20, "超重击", 1) bitmap.font.color.set(255, 255, 255) bitmap.draw_text(0, 0, 160, 20, "超重击", 1) end @_damage_sprite = ::Sprite.new(self.viewport) @_damage_sprite.bitmap = bitmap @_damage_sprite.ox = 80 @_damage_sprite.oy = 20 @_damage_sprite.x = self.x @_damage_sprite.y = self.y - self.oy / 2 @_damage_sprite.z = 3000 @_damage_duration = 40 end end end
#============================================================================== # 本脚本来自www.66RPG.com,使用和转载请保留此信息 #============================================================================== |