Project1
标题: 敌人战斗力的问题 [打印本页]
作者: 大放异彩 时间: 2012-2-18 13:11
标题: 敌人战斗力的问题
本帖最后由 大放异彩 于 2012-2-18 13:47 编辑
敌人战斗减血的时候是从左边减的,有谁能帮我改下 从右边减向左边?
忘记带脚本了~~不好意思 现在就补上!- #===============================================================================
- # Zenith RGSS4 潜力表示 ver1.00
- # by 水夜
- # [url]http://zenith.ifdef.jp/[/url]
- #-------------------------------------------------------------------------------
- #显示敌方剩余战斗力
- #===============================================================================
- #常数设置
- #===============================================================================
- module ZENITH4
- #非表示
- E_SWITCH = 1
- #威力
- EG_WIDTH = 160
- EG_COLOR = Color.new(0, 0, 255,255)
- #表示文字列表
- EW_NAME = "敌人战斗力"
- #表示文字色调
- EW_COLOR = Color.new(255,255,255,255)
- end
- #===============================================================================
- # Window_BattleStatus
- #===============================================================================
- class Window_BattleStatus < Window_Base
- #-------------------------------------------------------------------------------
- #初始化
- #-------------------------------------------------------------------------------
- alias zenith4_initialize initialize
- def initialize
- #作成
- @enemy_force = Sprite.new
- @enemy_force.bitmap = Bitmap.new(8 + ZENITH4::EG_WIDTH,34)
- @enemy_force.x = 640 - (12 + ZENITH4::EG_WIDTH)
- @enemy_force.y = 62
- @enemy_force.z = 50
- #呼出
- zenith4_initialize
- end
- #-------------------------------------------------------------------------------
- #●解放
- #-------------------------------------------------------------------------------
- alias zenith4_dispose dispose
- def dispose
- #解放
- @enemy_force.bitmap.dispose
- @enemy_force.dispose
- #呼出
- zenith4_dispose
- end
- #-----------------------------------------------------------------------------
- #●解放
- #-----------------------------------------------------------------------------
- alias zenith4_refresh refresh
- def refresh
- #呼出
- zenith4_refresh
- if $game_switches[ZENITH4::E_SWITCH] == false
- @enemy_force.visible = true
- @enemy_force.bitmap.clear
- x = 4
- y = 4
- width = ZENITH4::EG_WIDTH
- # 文字列表描画
- @enemy_force.bitmap.font.size = 18
- @enemy_force.bitmap.font.color = Color.new( 0, 0, 0,255)
- @enemy_force.bitmap.draw_text(x+1,y+1,width,22,ZENITH4::EW_NAME)
- @enemy_force.bitmap.draw_text(x-1,y-1,width,22,ZENITH4::EW_NAME)
- @enemy_force.bitmap.draw_text(x+1,y-1,width,22,ZENITH4::EW_NAME)
- @enemy_force.bitmap.draw_text(x-1,y+1,width,22,ZENITH4::EW_NAME)
- @enemy_force.bitmap.font.color = ZENITH4::EW_COLOR
- @enemy_force.bitmap.draw_text(x,y,width,22,ZENITH4::EW_NAME)
- # 描画
- @item_max = $game_troop.enemies.size
- enemy_mh = 0
- enemy_h = 0
- for i in 0...@item_max
- enemy = $game_troop.enemies[i]
- enemy_mh += enemy.maxhp
- enemy_h += enemy.hp
- end
- @enemy_force.bitmap.fill_rect(x-1,y+24,width+2,5,Color.new(0,0,0,150))
- w = width * enemy_h/ enemy_mh
- @enemy_force.bitmap.fill_rect(x+width-w,y+25,w,3,ZENITH4::EG_COLOR)
- else
- @enemy_force.visible = false
- end
- end
- end
复制代码