| 赞 | 1 |
| VIP | |
| 好人卡 | |
| 积分 | 1 |
| 经验 | |
| 最后登录 | 2016-1-18 |
| 在线时间 | 1269 小时 |
薄凉看客
- 梦石
- 0
- 星屑
- 50
- 在线时间
- 1269 小时
- 注册时间
- 2010-6-20
- 回帖
- 1223
|
加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有账号?注册会员
×
本帖最后由 恐惧剑刃 于 2014-11-7 19:38 编辑
先放截图
我的思路仅供参考。
再次更新,这次测试没发现问题。。
其余问题:
1. fill_rect过多
2. 敌人CP没有显示
等
太赖暂时不考虑修正 。。
工程
CP.zip
(230.77 KB, 下载次数: 112)
CP
- #------------------------------------------------------------------------------
- # - CP战斗
- #------------------------------------------------------------------------------
- #------------------------------------------------------------------------------
- # - 设置
- #------------------------------------------------------------------------------
- module CP
- Speed = 1 # 速度
- Width = 120 # CP条宽度
- Height = 6 # CP条高度
- Back_Color = Color.new(0, 0, 0) # CP条背景色
- Cp_Color = Color.new(255, 255, 64) # CP条填充色
- Cp_Color_2 = Color.new(255, 128, 255) # CP条填充色(满)
- end
- #------------------------------------------------------------------------------
- # - 战斗者CP属性
- #------------------------------------------------------------------------------
- class Game_Battler
- attr_accessor :cp, :cp_speed
- alias initialize_cp_old initialize
- def initialize
- @cp = 0
- @cp_speed = 0
- initialize_cp_old
- end
- end
- #------------------------------------------------------------------------------
- # - 战斗场景
- #------------------------------------------------------------------------------
- class Scene_Battle
- #----------------------------------------------------------------------------
- # - 主方法
- #----------------------------------------------------------------------------
- alias main_cp_old main
- def main
- @cp_viewport = Viewport.new(0, 465, 640, CP::Height)
- @cp_viewport.z = 9999
- @cp_sprite = Sprite.new(@cp_viewport)
- @cp_sprite.bitmap = Bitmap.new(640, CP::Height)
- cp_bar
- main_cp_old
- @cp_sprite.bitmap.dispose
- @cp_sprite.dispose
- @cp_viewport.dispose
- end
- #--------------------------------------------------------------------------
- # - 速度
- #--------------------------------------------------------------------------
- def cp_speed
- battlers_agi = []
- for battler in $game_party.actors + $game_troop.enemies
- battlers_agi << battler.agi
- end
- min_agi = battlers_agi.min
- for battler in $game_party.actors + $game_troop.enemies
- battler.cp_speed = battler.agi * 10 / min_agi * CP::Speed / 5
- end
- end
- #----------------------------------------------------------------------------
- # - 描绘CP
- #----------------------------------------------------------------------------
- def cp_bar
- @cp_sprite.bitmap.clear
- for index in 0...$game_party.actors.size
- actor = $game_party.actors[index]
- if actor.dead?
- actor.cp = 0
- next
- end
- x = (index + 1) * 20 + index * 140
- width = CP::Width
- height = CP::Height
- back_color = CP::Back_Color
- @cp_sprite.bitmap.fill_rect(x, 0, width, height, back_color)
- if actor.cp >= width - 1
- cp_color = CP::Cp_Color_2
- wid = width - 1
- else
- cp_color = CP::Cp_Color
- wid = actor.cp
- end
- @cp_sprite.bitmap.fill_rect(x + 1, 1, wid, height - 2, cp_color)
- end
- end
- end
- class Scene_Battle
- alias start_phase2_cp_old start_phase2
- def start_phase2
- cp_bar
- start_phase2_cp_old
- end
- def make_action_orders
- @action_battlers = [@active_battler_cp]
- end
- alias update_phase4_step6_cp_old update_phase4_step6
- def update_phase4_step6
- update_phase4_step6_cp_old
- @active_battler.cp = 0
- end
- end
复制代码
Scene_Battle 3
|
评分
-
查看全部评分
|