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

Project1

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

怎么弄横版

 关闭 [复制链接]

Lv1.梦旅人

梦石
0
星屑
40
在线时间
0 小时
注册时间
2008-7-9
帖子
2
跳转到指定楼层
1
发表于 2008-7-9 22:04:49 | 只看该作者 回帖奖励 |正序浏览 |阅读模式

加入我们,或者,欢迎回来。

您需要 登录 才可以下载或查看,没有帐号?注册会员

x
怎么弄横版
版务信息:本贴由楼主自主结贴~

Lv1.梦旅人

梦石
0
星屑
50
在线时间
3 小时
注册时间
2008-3-29
帖子
79
4
发表于 2008-7-9 22:10:27 | 只看该作者
=begin
==============================================================================

彩虹神剑(伤害分段显示)显示总伤害版 v1.0b

==============================================================================

彩虹神剑 by 柳柳
显示总伤害修改 by 叶子

==============================================================================

6-20-2006 v1.0
在彩虹神剑的基础上增加了显示总伤害的功能,而且总伤害的数字是弹出伤害时逐渐增加的

v1.0a
修正了显示伤害和实际伤害有差别的问题
修正了miss的情况下显示miss混乱的问题
修正了对己方技能重复显示伤害的问题
未修正播放目标动画第一帧时目标有时无端跳动的BUG

v1.0b
修改了总伤害数字的位置和z坐标
未修正播放目标动画第一帧时目标有时无端跳动的BUG

==============================================================================
=end
# 核心的说明:
# damage_pop 不再附带damage()的功能,这个放到animation里面去了

module RPG
#--------------------------------------------------------------------------
# ● 常量设定
#--------------------------------------------------------------------------
# 是否显示总伤害
SHOW_TOTAL_DAMAGE = true
# 角色受攻击时是否跳一下
BATTLER_JUMP = false

class Sprite < ::Sprite
   #==========================================
   # 修改说明:
   # @flash_shake用来制作挨打时候跳跃
   # @_damage    用来记录每次打击之后弹出数字
   # @_total_damage 记录总伤害
   # @_total_damage_duration 总伤害持续帧
   #==========================================
   #alias 66RPG_rainbow_initialize : initialize
   def initialize(viewport = nil)
     #66RPG_rainbow_initialize(viewport)
     super(viewport)
     @_whiten_duration = 0
     @_appear_duration = 0
     @_escape_duration = 0
     @_collapse_duration = 0
     @_damage_duration = 0
     @_animation_duration = 0
     @_blink = false
     # 挨打时候跳跃
     @flash_shake = 0
     # 伤害记录数组
     @_damage = []
     # 总伤害数字
     @_total_damage = 0
     # 总伤害持续帧
     @_total_damage_duration = 0
   end
   def damage(value, critical, sp_damage = false)
     if value.is_a?(Numeric)
       damage_string = value.abs.to_s
     else
       damage_string = value.to_s
     end
     bitmap = Bitmap.new(200, 80)
     bitmap.font.name = "Arial Black"
     bitmap.font.size = 32
      # 伤害值是数值的情况下
      if value.is_a?(Numeric)
        # 分割伤害值字符串
        damage_array = damage_string.scan(/./)
        damage_x = 81 - damage_string.size * 9
        # 伤害值为负的情况下
        if value < 0
          # 调用回复数字表
          rect_y = 32
        else
          # 调用伤害数字表
          rect_y = 0
        end
        # 循环伤害值字符串

       for char in damage_array
         number = char.to_i
          # 显示伤害数字
         if sp_damage
           bitmap.blt(damage_x, 32, RPG::Cache.picture("Damagesp"),
           Rect.new(number * 18, rect_y, 18, 32))
           damage_x += 18
         else
           bitmap.blt(damage_x, 32, RPG::Cache.picture("Damage"),
           Rect.new(number * 18, rect_y, 18, 32))
           damage_x += 18
         end# 伤害值不是数值的情况
        end
      else
        # 如果伤害值不是 Miss
        unless value == "Miss"
          # 系统默认描画字符串
          bitmap.font.color.set(0, 0, 0)
          bitmap.draw_text(-1, 27, 162, 36, damage_string, 1)
          bitmap.draw_text(+1, 27, 162, 36, damage_string, 1)
          bitmap.draw_text(-1, 29, 162, 36, damage_string, 1)
          bitmap.draw_text(+1, 29, 162, 36, damage_string, 1)
          bitmap.font.color.set(255, 255, 255)
          bitmap.draw_text(0, 28, 162, 36, damage_string, 1)
        # Miss 的情况下
        else
          # 显示未击中图画
          bitmap.blt(36, 28, RPG::Cache.picture("Damage"), Rect.new(90, 64, 90, 32))
        end
      end
      # 会心一击标志打开的情况
      if critical
        # 显示会心一击图画
        bitmap.blt(36, 0, RPG::Cache.picture("Damage"), Rect.new(0, 64, 90, 32))
      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
     #=======================================
     # 修改:推入新的伤害
     #=======================================
     @_damage.push([@_damage_sprite,@_damage_duration-10,0, rand(30) - 15, rand(3)])
     # 总伤害处理
     make_total_damage(value)
   end
   #--------------------------------------------------------------------------
   # ● 总伤害处理
   #--------------------------------------------------------------------------
   def make_total_damage(value)
     if value.is_a?(Numeric) and SHOW_TOTAL_DAMAGE and (@_animation.flame == 1)
       @_total_damage += value
     else
       return
     end
     bitmap = Bitmap.new(300, 150)
     bitmap.font.name = "Arial Black"
     bitmap.font.size = 48
     bitmap.font.color.set(0, 0, 0)
     bitmap.draw_text(+2, 12+2, 160, 36, @_total_damage.abs.to_s, 1)
     if @_total_damage < 0
       bitmap.font.color.set(80, 255, 00)
     else
       bitmap.font.color.set(255, 140, 0)
     end
     bitmap.draw_text(0, 12, 160, 36, @_total_damage.abs.to_s, 1)
     if @_total_damage_sprite.nil?
       @_total_damage_sprite = ::Sprite.new(self.viewport)
       @_total_damage_sprite.ox = 80
       @_total_damage_sprite.oy = 20
       @_total_damage_sprite.z = 3000
     end
     @_total_damage_sprite.bitmap = bitmap
     @_total_damage_sprite.zoom_x = 1.5
     @_total_damage_sprite.zoom_y = 1.5
     @_total_damage_sprite.x = self.x
     @_total_damage_sprite.y = self.y  - self.oy / 2 - 64
     @_total_damage_sprite.z = 3001
     @_total_damage_duration = 80
   end
   def animation(animation, hit, battler_damage="", battler_critical=false)
     dispose_animation      
     #=======================================
     # 修改:记录伤害和critical
     #=======================================
     @battler_damage = battler_damage
     @battler_critical = battler_critical
     @_animation = animation
     return if @_animation == nil
     @_animation_hit = hit
     @_animation_duration = @_animation.frame_max
     animation_name = @_animation.animation_name
     animation_hue = @_animation.animation_hue
     bitmap = RPG::Cache.animation(animation_name, animation_hue)
     #=======================================
     # 修改:计算总闪光权限值
     #=======================================
     for timing in @_animation.timings
       quanzhong = animation_process_timing(timing, @_animation_hit,true)
       @all_quanzhong += quanzhong
       # 记录最后一次闪光
       @_last_frame = timing.frame if quanzhong != 0
     end      
     if @@_reference_count.include?(bitmap)
       @@_reference_count[bitmap] += 1
     else
       @@_reference_count[bitmap] = 1
     end
     #=======================================
     # 修改:行动方动画不显示伤害
     #=======================================
     if $scene.is_a?(Scene_Battle)
       if $scene.animation1_id == @battler.animation_id
         @battler_damage = ""
       end
     end
     @_animation_sprites = []
     if @_animation.position != 3 or not @@_animations.include?(animation)
       for i in 0..15
         sprite = ::Sprite.new(self.viewport)
         sprite.bitmap = bitmap
         sprite.visible = false
         @_animation_sprites.push(sprite)
       end
       unless @@_animations.include?(animation)
         @@_animations.push(animation)
       end
     end                     主战上搬下来的脚本``````````用用看吧``
系统信息:本贴由楼主认可为正确答案,66RPG感谢您的热情解答~
http://imgbj.jpg.name/tthwvttwyhhzthhyjwywzwjwzjwswzhjtrvjj.gif (抄袭的图) http://rpg.blue/upload_program/files/1231241.gif
回复 支持 反对

使用道具 举报

Lv1.梦旅人

蚂蚁卡卡

梦石
0
星屑
116
在线时间
66 小时
注册时间
2007-12-16
帖子
3081
3
发表于 2008-7-9 22:09:59 | 只看该作者
http://rpg.blue/web/htm/news131.htm
《隋唐乱》完整解密版点击进入
米兰,让我怎么说离开……

曾经我也是一个有志青年,直到我膝盖中了一箭……

《隋唐乱》博客地址
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
29 小时
注册时间
2008-4-13
帖子
771
2
发表于 2008-7-9 22:06:01 | 只看该作者
请在主站搜索“横版”
我,南歌,回6R啦!
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2025-8-8 16:23

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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