Project1
标题: 为什么战斗结束了还显示状态 [打印本页]
作者: wxj541374210 时间: 2013-1-27 21:11
标题: 为什么战斗结束了还显示状态
就像这样......但有时他自己也会消失
又有时会一直在那里.......
我装了一个状态颜色的脚本才出现的。。。
自己也不会改啊..........
#============================================================================================
# 本脚本来自[url]www.66RPG.com[/url],由sdxsdx转载。使用请保留此信息
#============================================================================================
#============================================
# 自定义
#============================================
class Window_BattleStatus < Window_Base
STATE_DRAW_FRAME = 20 # 状态框的间隔
STATE_DRAW_X = 160 # X 坐标
STATE_DRAW_Y = 96 # Y 坐标
STATE_DRAW_COLOR_USE = true # 文字颜色是否有效
#--------------------------------------------------------------------------
# ● ステートの文字色設定
# actor : アクター
# text : 描画文字列
#--------------------------------------------------------------------------
def state_font_color(actor, text)
if STATE_DRAW_COLOR_USE
color = normal_color
case text
when "[正常]"
color = normal_color
when "[死亡]"
color = Color.new(255, 0, 0)
when "[灼伤]"
color = Color.new(241, 71, 14, 255)
when "[愤怒]"
color = Color.new(240, 252, 10, 255)
when "[激动]"
color = Color.new(255, 123, 15, 255)
when "[晕血]"
color = Color.new(197, 73, 163, 255)
when "[混乱]"
color = Color.new(200, 255, 140, 255)
when "[睡眠]"
color = Color.new(64, 64, 200, 255)
when "[麻痺]"
color = Color.new(254, 235, 1, 255)
when "[无力]","[干扰]","[濒死]"
color = Color.new(128, 128, 128, 255)
when "[大力]","[疾风]","[热血]"
color = Color.new(128, 128, 255, 255)
when "[冻伤]"
color = Color.new(3, 22, 254, 255)
when "[风毒]"
color = Color.new(117, 130, 140, 255)
when "[水毒]"
color = Color.new(10, 181, 254, 255)
when "[火毒]"
color = Color.new(214, 99, 50, 255)
when "[土毒]"
color = Color.new(191, 165, 72, 255)
when "[雷毒]"
color = Color.new(9, 237, 255, 255)
end
else
# STATE_DRAW_COLOR_USEがfalseの場合はデフォの処理(戦闘不能のみ赤で描画)
color = actor.hp == 0 ? knockout_color : normal_color
end
@state_sprite.bitmap.font.color = color
end
attr_accessor :state_count
alias window_battlestatus_state_draw_initialize initialize
def initialize
window_battlestatus_state_draw_initialize
# ステート表示用のカウンタを作成
@state_count = 0
# ステート表示用のスプライトを作成
@state_sprite = Sprite.new(self.viewport)
@state_sprite.bitmap = Bitmap.new(self.width - 32, self.height - 32)
@state_sprite.x = self.x + 16
@state_sprite.y = self.y + 16
@state_sprite.z = self.z + 2
# ステート表示用スプライトをリフレッシュ
state_draw_refresh
end
alias window_battlestatus_state_draw_dispose dispose
def dispose
window_battlestatus_state_draw_dispose
# ステート表示用スプライトを開放
@state_sprite.dispose
end
#--------------------------------------------------------------------------
# ● 描画用のステート文字列作成
# actor : アクター
# width : 描画先の幅
# need_normal : [正常] が必要かどうか (true / false)
#--------------------------------------------------------------------------
def make_battler_state_text(battler, width, need_normal)
# 括弧の幅を取得
brackets_width = self.contents.text_size("[]").width
# ステート名の文字列を作成
text = ""
# 実際表示するステートの配列作成
show_state = []
for i in battler.states
if $data_states[i].rating >= 1
show_state.push($data_states[i].name)
end
end
# 表示ステートの配列が空の場合は "[正常]" にする
if show_state.size == 0
if need_normal
text = "[正常]"
else
text = ""
end
else
# カウントに見合ったステートを文字列に設定
text = show_state[(@state_count / STATE_DRAW_FRAME) % show_state.size]
# 括弧をつける
text = "[" + text + "]"
end
# 完成した文字列を返す
return text
end
def state_draw_refresh
# ステート表示用のカウントを増加
@state_count += 1
# ステート更新間隔でなく、最初の更新時でなければ更新しない
return if @state_count % STATE_DRAW_FRAME != 0 and @state_count != 1
@state_sprite.bitmap.clear
for i in 0...$game_party.actors.size
actor = $game_party.actors[i]
actor_x = i * STATE_DRAW_X + 4
if @level_up_flags[i]
@state_sprite.bitmap.font.color = normal_color
@state_sprite.bitmap.draw_text(actor_x, STATE_DRAW_Y, 120, 32, "升级!")
else
text = make_battler_state_text(actor, 120, true)
state_font_color(actor, text)
@state_sprite.bitmap.draw_text(actor_x, STATE_DRAW_Y, 120, 32, text)
end
end
end
def draw_actor_state(actor, x, y, width = 120)
# 通常のdraw_actor_stateを実行させない為のダミー
end
end
class Scene_Battle
alias scene_battle_state_draw_update update
def update
# update毎にステート表示を更新
@status_window.state_draw_refresh
scene_battle_state_draw_update
end
end
#============================================================================================
# 本脚本来自[url]www.66RPG.com[/url],由sdxsdx转载。使用请保留此信息
#============================================================================================
#============================================
# 自定义
#============================================
class Window_BattleStatus < Window_Base
STATE_DRAW_FRAME = 20 # 状态框的间隔
STATE_DRAW_X = 160 # X 坐标
STATE_DRAW_Y = 96 # Y 坐标
STATE_DRAW_COLOR_USE = true # 文字颜色是否有效
#--------------------------------------------------------------------------
# ● ステートの文字色設定
# actor : アクター
# text : 描画文字列
#--------------------------------------------------------------------------
def state_font_color(actor, text)
if STATE_DRAW_COLOR_USE
color = normal_color
case text
when "[正常]"
color = normal_color
when "[死亡]"
color = Color.new(255, 0, 0)
when "[灼伤]"
color = Color.new(241, 71, 14, 255)
when "[愤怒]"
color = Color.new(240, 252, 10, 255)
when "[激动]"
color = Color.new(255, 123, 15, 255)
when "[晕血]"
color = Color.new(197, 73, 163, 255)
when "[混乱]"
color = Color.new(200, 255, 140, 255)
when "[睡眠]"
color = Color.new(64, 64, 200, 255)
when "[麻痺]"
color = Color.new(254, 235, 1, 255)
when "[无力]","[干扰]","[濒死]"
color = Color.new(128, 128, 128, 255)
when "[大力]","[疾风]","[热血]"
color = Color.new(128, 128, 255, 255)
when "[冻伤]"
color = Color.new(3, 22, 254, 255)
when "[风毒]"
color = Color.new(117, 130, 140, 255)
when "[水毒]"
color = Color.new(10, 181, 254, 255)
when "[火毒]"
color = Color.new(214, 99, 50, 255)
when "[土毒]"
color = Color.new(191, 165, 72, 255)
when "[雷毒]"
color = Color.new(9, 237, 255, 255)
end
else
# STATE_DRAW_COLOR_USEがfalseの場合はデフォの処理(戦闘不能のみ赤で描画)
color = actor.hp == 0 ? knockout_color : normal_color
end
@state_sprite.bitmap.font.color = color
end
attr_accessor :state_count
alias window_battlestatus_state_draw_initialize initialize
def initialize
window_battlestatus_state_draw_initialize
# ステート表示用のカウンタを作成
@state_count = 0
# ステート表示用のスプライトを作成
@state_sprite = Sprite.new(self.viewport)
@state_sprite.bitmap = Bitmap.new(self.width - 32, self.height - 32)
@state_sprite.x = self.x + 16
@state_sprite.y = self.y + 16
@state_sprite.z = self.z + 2
# ステート表示用スプライトをリフレッシュ
state_draw_refresh
end
alias window_battlestatus_state_draw_dispose dispose
def dispose
window_battlestatus_state_draw_dispose
# ステート表示用スプライトを開放
@state_sprite.dispose
end
#--------------------------------------------------------------------------
# ● 描画用のステート文字列作成
# actor : アクター
# width : 描画先の幅
# need_normal : [正常] が必要かどうか (true / false)
#--------------------------------------------------------------------------
def make_battler_state_text(battler, width, need_normal)
# 括弧の幅を取得
brackets_width = self.contents.text_size("[]").width
# ステート名の文字列を作成
text = ""
# 実際表示するステートの配列作成
show_state = []
for i in battler.states
if $data_states[i].rating >= 1
show_state.push($data_states[i].name)
end
end
# 表示ステートの配列が空の場合は "[正常]" にする
if show_state.size == 0
if need_normal
text = "[正常]"
else
text = ""
end
else
# カウントに見合ったステートを文字列に設定
text = show_state[(@state_count / STATE_DRAW_FRAME) % show_state.size]
# 括弧をつける
text = "[" + text + "]"
end
# 完成した文字列を返す
return text
end
def state_draw_refresh
# ステート表示用のカウントを増加
@state_count += 1
# ステート更新間隔でなく、最初の更新時でなければ更新しない
return if @state_count % STATE_DRAW_FRAME != 0 and @state_count != 1
@state_sprite.bitmap.clear
for i in 0...$game_party.actors.size
actor = $game_party.actors[i]
actor_x = i * STATE_DRAW_X + 4
if @level_up_flags[i]
@state_sprite.bitmap.font.color = normal_color
@state_sprite.bitmap.draw_text(actor_x, STATE_DRAW_Y, 120, 32, "升级!")
else
text = make_battler_state_text(actor, 120, true)
state_font_color(actor, text)
@state_sprite.bitmap.draw_text(actor_x, STATE_DRAW_Y, 120, 32, text)
end
end
end
def draw_actor_state(actor, x, y, width = 120)
# 通常のdraw_actor_stateを実行させない為のダミー
end
end
class Scene_Battle
alias scene_battle_state_draw_update update
def update
# update毎にステート表示を更新
@status_window.state_draw_refresh
scene_battle_state_draw_update
end
end
求高手解决
作者: wingzeroplus 时间: 2013-1-28 00:38
原版应该是没有什么问题的,你是不是加了其他的战斗类脚本?最好列出来
作者: wxj541374210 时间: 2013-1-28 14:27
wingzeroplus 发表于 2013-1-28 00:38
原版应该是没有什么问题的,你是不是加了其他的战斗类脚本?最好列出来
状态颜色(上面有)
敌方战斗力:#==============================================================================
# Zenith RGSS4 エネミー残勢力表示 ver1.00
# by 水夜
# [url]http://zenith.ifdef.jp/[/url]
#------------------------------------------------------------------------------
# 显示敌方剩余战斗力
#==============================================================================
#==============================================================================
# □ 常数设置
#==============================================================================
module ZENITH4
# エネミー残勢力の表示?非表示を切り替えるスイッチのID(スイッチON時に非表示)
E_SWITCH = 1
# 残勢力ゲージの長さ
EG_WIDTH = 160
# 残勢力ゲージの色
EG_COLOR = Color.new(255, 0, 0, 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
#==============================================================================
# Zenith RGSS4 エネミー残勢力表示 ver1.00
# by 水夜
# [url]http://zenith.ifdef.jp/[/url]
#------------------------------------------------------------------------------
# 显示敌方剩余战斗力
#==============================================================================
#==============================================================================
# □ 常数设置
#==============================================================================
module ZENITH4
# エネミー残勢力の表示?非表示を切り替えるスイッチのID(スイッチON時に非表示)
E_SWITCH = 1
# 残勢力ゲージの長さ
EG_WIDTH = 160
# 残勢力ゲージの色
EG_COLOR = Color.new(255, 0, 0, 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
CP制战斗(这个就不用放代码了吧)
作者: wingzeroplus 时间: 2013-1-28 16:33
敌方战斗力给我放状态没什么关系,也许真是CP制战斗的问题,建议你吧工程传上来
作者: wxj541374210 时间: 2013-1-29 18:34
wingzeroplus 发表于 2013-1-28 16:33
敌方战斗力给我放状态没什么关系,也许真是CP制战斗的问题,建议你吧工程传上来 ...
其实我还装了彩虹神剑和动态指标......
但经测试,这两个没问题,还真是CP战斗的问题......
因为我把CP战斗的脚本贴上去后就出现了这种情况
我还是把工程放上来吧(我希望能得到解决):
Project2.7z
(214.19 KB, 下载次数: 11)
作者: wxj541374210 时间: 2013-1-29 18:42
wingzeroplus 发表于 2013-1-28 16:33
敌方战斗力给我放状态没什么关系,也许真是CP制战斗的问题,建议你吧工程传上来 ...
如果可以的话,能不能帮我把彩虹神剑弄出显示SP伤害的效果.........
作者: wingzeroplus 时间: 2013-1-29 22:10
把 “敌方战斗力” 和 “状态颜色” 两个脚本放到“速度条”下方即可解决问题
另外彩虹神剑我不怎么熟悉,你另外开个帖子问其他人吧
欢迎光临 Project1 (https://rpg.blue/) |
Powered by Discuz! X3.1 |