Project1
标题:
关于“增减水平”的一个BUG修正(诡异的问题)
[打印本页]
作者:
OCTSJimmy
时间:
2007-3-15 05:44
标题:
关于“增减水平”的一个BUG修正(诡异的问题)
某日,突然间发现……
有一个事件是这样子的……
======================分割线====================================
增减水平 : 全体同伴 +99
增减水平 : 全体同伴 -99
======================无敌的分割线 - -==========================
执行过后看看菜单里的特技,会发现人物还是1级,但是特技全部学会了……
这个就给一些设计“等级降低”、死亡掉经验等带来了BUG……
其实修正很简单,真的。
Game_Actor类
472行(也就是
exp=(exp)
方法)
@level -= 1
复制代码
前面
插入:
for j in $data_classes[@class_id].learnings
if j.level == @level
forget_skill(j.skill_id)
end
end
复制代码
这样就解决了。
[LINE]1,#dddddd[/LINE]
另附:
“物品金钱升级提示 v1.0”的同类修正
下面是已经修正好的,直接插入使用就好了
#==============================================================================
# 本脚本来自www.66RPG.com,使用和转载请保留此信息
#==============================================================================
#==============================================================================
# 物品金钱升级提示 v1.0
#
# 得失物品金钱提示 By 柳柳
# 升级提示 By 叶子
#
# Date: 2-12-2006
#==============================================================================
# 注意!!!在对话后得到物品,请在对话后先用事件等待3帧,否则对话框来不及消失。
# 同理,得到经验或升级,也要等待3帧以上。
# 开关定义:
$不显示金钱窗口 = 41
$不显示物品窗口 = 42
$不显示武器窗口 = 43
$不显示防具窗口 = 44
$不显示升级窗口 = 45
# 以上开关,当打开的时候,获得物品将不会提示,比如默认打开41号开关,获得金钱不再提示
# ————————————————————————————————————
class Interpreter
attr_accessor :parameters
#--------------------------------------------------------------------------
# ● 增减金钱
#--------------------------------------------------------------------------
def command_125
value = operate_value(@parameters[0], @parameters[1], @parameters[2])
$game_party.gain_gold(value)
if $game_switches[$不显示金钱窗口]==false
carol3_66RPG = Window_Base.new((640-160)/2,128,180,100)
carol3_66RPG.contents = Bitmap.new(carol3_66RPG.width - 32, carol3_66RPG.height - 32)
if value >= 0
carol3_66RPG.contents.draw_text(0,0,240,32,"获得金钱:")
#——声效,可以自己改
Audio.se_play("Audio/SE/"+"006-System06",80,100)
else
carol3_66RPG.contents.draw_text(0,0,240,32,"失去金钱:")
#——声效,可以自己改
Audio.se_play("Audio/SE/"+"005-System05",80,100)
end
carol3_66RPG.contents.draw_text(0,32,240,32,value.abs.to_s)
carol3_66RPG.contents.draw_text(0,32,140,32, $data_system.words.gold,2)
carol3_66RPG.opacity = 160
for i in 0..30
Graphics.update
end
for i in 0..10
carol3_66RPG.opacity -= 30
carol3_66RPG.contents_opacity -= 30
Graphics.update
end
carol3_66RPG.dispose
end
return true
end
#--------------------------------------------------------------------------
# ● 增减物品
#--------------------------------------------------------------------------
def command_126
value = operate_value(@parameters[1], @parameters[2], @parameters[3])
$game_party.gain_item(@parameters[0], value)
if $game_switches[$不显示物品窗口]==false
carol3_66RPG_item = $data_items[@parameters[0]]
carol3_66RPG = Window_Base.new((640-300)/2,128,300,100)
carol3_66RPG.contents = Bitmap.new(carol3_66RPG.width - 32, carol3_66RPG.height - 32)
if value >= 0
carol3_66RPG.contents.draw_text(0,0,240,32,"获得物品:")
#——声效,可以自己改
Audio.se_play("Audio/SE/"+"006-System06",80,100)
else
carol3_66RPG.contents.draw_text(0,0,240,32,"失去物品:")
#——声效,可以自己改
Audio.se_play("Audio/SE/"+"005-System05",80,100)
end
carol3_66RPG_bitmap = RPG::Cache.icon(carol3_66RPG_item.icon_name)
carol3_66RPG.contents.blt(0, 32, carol3_66RPG_bitmap, Rect.new(0, 0, 24, 24), 255)
carol3_66RPG.contents.draw_text(0 + 28, 32, 212, 32, carol3_66RPG_item.name, 0)
carol3_66RPG.contents.draw_text(0, 32, 268, 32, "×"+value.abs.to_s, 2)
carol3_66RPG.opacity = 160
for i in 0..30
Graphics.update
end
for i in 0..10
carol3_66RPG.opacity -= 30
carol3_66RPG.contents_opacity -= 30
Graphics.update
end
carol3_66RPG.dispose
end
return true
end
#--------------------------------------------------------------------------
# ● 增减武器
#--------------------------------------------------------------------------
def command_127
value = operate_value(@parameters[1], @parameters[2], @parameters[3])
$game_party.gain_weapon(@parameters[0], value)
if $game_switches[$不显示武器窗口]==false
carol3_66RPG_item = $data_weapons[@parameters[0]]
carol3_66RPG = Window_Base.new((640-300)/2,128,300,100)
carol3_66RPG.contents = Bitmap.new(carol3_66RPG.width - 32, carol3_66RPG.height - 32)
if value >= 0
carol3_66RPG.contents.draw_text(0,0,240,32,"获得武器:")
#——声效,可以自己改
Audio.se_play("Audio/SE/"+"006-System06",80,100)
else
carol3_66RPG.contents.draw_text(0,0,240,32,"失去武器:")
#——声效,可以自己改
Audio.se_play("Audio/SE/"+"005-System05",80,100)
end
carol3_66RPG_bitmap = RPG::Cache.icon(carol3_66RPG_item.icon_name)
carol3_66RPG.contents.blt(0, 32, carol3_66RPG_bitmap, Rect.new(0, 0, 24, 24), 255)
carol3_66RPG.contents.draw_text(0 + 28, 32, 212, 32, carol3_66RPG_item.name, 0)
carol3_66RPG.contents.draw_text(0, 32, 268, 32, "×"+value.abs.to_s, 2)
carol3_66RPG.opacity = 160
for i in 0..30
Graphics.update
end
for i in 0..10
carol3_66RPG.opacity -= 30
carol3_66RPG.contents_opacity -= 30
Graphics.update
end
carol3_66RPG.dispose
end
return true
end
#--------------------------------------------------------------------------
# ● 增减防具
#--------------------------------------------------------------------------
def command_128
value = operate_value(@parameters[1], @parameters[2], @parameters[3])
$game_party.gain_armor(@parameters[0], value)
if $game_switches[$不显示防具窗口]==false
carol3_66RPG_item = $data_armors[@parameters[0]]
carol3_66RPG = Window_Base.new((640-300)/2,128,300,100)
carol3_66RPG.contents = Bitmap.new(carol3_66RPG.width - 32, carol3_66RPG.height - 32)
if value >= 0
carol3_66RPG.contents.draw_text(0,0,240,32,"获得防具:")
#——声效,可以自己改
Audio.se_play("Audio/SE/"+"006-System06",80,100)
else
carol3_66RPG.contents.draw_text(0,0,240,32,"失去防具:")
#——声效,可以自己改
Audio.se_play("Audio/SE/"+"005-System05",80,100)
end
carol3_66RPG_bitmap = RPG::Cache.icon(carol3_66RPG_item.icon_name)
carol3_66RPG.contents.blt(0, 32, carol3_66RPG_bitmap, Rect.new(0, 0, 24, 24), 255)
carol3_66RPG.contents.draw_text(0 + 28, 32, 212, 32, carol3_66RPG_item.name, 0)
carol3_66RPG.contents.draw_text(0, 32, 268, 32, "×"+value.abs.to_s, 2)
carol3_66RPG.opacity = 160
for i in 0..30
Graphics.update
end
for i in 0..10
carol3_66RPG.opacity -= 30
carol3_66RPG.contents_opacity -= 30
Graphics.update
end
carol3_66RPG.dispose
end
return true
end
#--------------------------------------------------------------------------
# ● 增减 EXP
#--------------------------------------------------------------------------
def command_315
# 获取操作值
value = operate_value(@parameters[1], @parameters[2], @parameters[3])
# 处理重复
iterate_actor(@parameters[0]) do |actor|
# 记录等级
last_level = actor.level
# 更改角色 EXP
actor.exp += value
# 如果角色升级了的话,显示升级窗口
if actor.level > last_level and $game_switches[$不显示升级窗口] == false
show_level_up_result(actor, last_level)
#############降级、减经验修正 By OCTSJimmy##########################
elsif actor.level < last_level and $game_switches[$不显示升级窗口] == false
show_level_up_result(actor, last_level)
#############降级、减经验修正 By OCTSJimmy##########################
end
end
# 继续
return true
end
#--------------------------------------------------------------------------
# ● 增减等级
#--------------------------------------------------------------------------
def command_316
# 获取操作值
value = operate_value(@parameters[1], @parameters[2], @parameters[3])
# 处理重复
iterate_actor(@parameters[0]) do |actor|
# 记录等级
last_level = actor.level
# 更改角色的等级
actor.level += value
# 如果角色升级了的话,显示升级窗口
if actor.level > last_level and $game_switches[$不显示升级窗口] == false
show_level_up_result(actor, last_level)
#############降级、减经验修正 By OCTSJimmy##########################
elsif actor.level < last_level and $game_switches[$不显示升级窗口] == false
show_level_up_result(actor, last_level)
#############降级、减经验修正 By OCTSJimmy##########################
end
end
# 继续
return true
end
#--------------------------------------------------------------------------
# ● 升级显示处理
#--------------------------------------------------------------------------
def show_level_up_result(actor,last_level)
actor_parameters = actor.last_parameters(last_level)
last_maxhp = actor_parameters[0]
last_maxsp = actor_parameters[1]
last_str = actor_parameters[2]
last_dex = actor_parameters[3]
last_agi = actor_parameters[4]
last_int = actor_parameters[5]
level_up_window = Window_LevelUpWindow.new actor,last_level,last_maxhp,
last_maxsp,last_str,last_dex,last_agi,last_int
level_up_window.visible = true
#############降级、减经验修正 By OCTSJimmy##########################
if actor.level > last_level
skill_learning_window = Window_SkillLearning.new(actor.class_id, last_level, actor.level)
elsif actor.level < last_level
skill_learning_window = Window_ForgetLearning.new(actor.class_id, last_level, actor.level)
end
#############降级、减经验修正 By OCTSJimmy##########################
#——声效,可以自己改
Audio.me_play("Audio/ME/"+"007-Fanfare01")
# 循环
loop do
# 刷新游戏画面
Graphics.update
# 刷新输入信息
Input.update
# 按下C就关闭窗口
if Input.trigger?(Input::C) or Input.trigger?(Input::B)
unless skill_learning_window.refresh
level_up_window.dispose
skill_learning_window.dispose
return true
end
end
end
end
end
class Game_Battler
#--------------------------------------------------------------------------
# ● 一次取得全部旧属性
#--------------------------------------------------------------------------
def last_parameters(level)
#---------------------------
# maxhp
#---------------------------
n = [[$data_actors[@actor_id].parameters[0, level] + @maxhp_plus, 1].max, 9999].min
for i in @states
n *= $data_states[i].maxhp_rate / 100.0
end
n = [[Integer(n), 1].max, 9999].min
maxhp = n
#---------------------------
# maxsp
#---------------------------
n = [[$data_actors[@actor_id].parameters[1, level] + @maxsp_plus, 0].max, 9999].min
for i in @states
n *= $data_states[i].maxsp_rate / 100.0
end
n = [[Integer(n), 0].max, 9999].min
maxsp = n
#---------------------------
# str
#---------------------------
n = $data_actors[@actor_id].parameters[2, level]
weapon = $data_weapons[@weapon_id]
armor1 = $data_armors[@armor1_id]
armor2 = $data_armors[@armor2_id]
armor3 = $data_armors[@armor3_id]
armor4 = $data_armors[@armor4_id]
n += weapon != nil ? weapon.str_plus : 0
n += armor1 != nil ? armor1.str_plus : 0
n += armor2 != nil ? armor2.str_plus : 0
n += armor3 != nil ? armor3.str_plus : 0
n += armor4 != nil ? armor4.str_plus : 0
n = [[n + @str_plus, 1].max, 999].min
for i in @states
n *= $data_states[i].str_rate / 100.0
end
n = [[Integer(n), 1].max, 999].min
str = n
#---------------------------
# dex
#---------------------------
n = $data_actors[@actor_id].parameters[3, level]
weapon = $data_weapons[@weapon_id]
armor1 = $data_armors[@armor1_id]
armor2 = $data_armors[@armor2_id]
armor3 = $data_armors[@armor3_id]
armor4 = $data_armors[@armor4_id]
n += weapon != nil ? weapon.dex_plus : 0
n += armor1 != nil ? armor1.dex_plus : 0
n += armor2 != nil ? armor2.dex_plus : 0
n += armor3 != nil ? armor3.dex_plus : 0
n += armor4 != nil ? armor4.dex_plus : 0
n = [[n + @dex_plus, 1].max, 999].min
for i in @states
n *= $data_states[i].dex_rate / 100.0
end
n = [[Integer(n), 1].max, 999].min
dex = n
#---------------------------
# agi
#---------------------------
n = $data_actors[@actor_id].parameters[4, level]
weapon = $data_weapons[@weapon_id]
armor1 = $data_armors[@armor1_id]
armor2 = $data_armors[@armor2_id]
armor3 = $data_armors[@armor3_id]
armor4 = $data_armors[@armor4_id]
n += weapon != nil ? weapon.agi_plus : 0
n += armor1 != nil ? armor1.agi_plus : 0
n += armor2 != nil ? armor2.agi_plus : 0
n += armor3 != nil ? armor3.agi_plus : 0
n += armor4 != nil ? armor4.agi_plus : 0
n = [[n + @agi_plus, 1].max, 999].min
for i in @states
n *= $data_states[i].agi_rate / 100.0
end
n = [[Integer(n), 1].max, 999].min
agi = n
#---------------------------
# int
#---------------------------
n = $data_actors[@actor_id].parameters[5, level]
weapon = $data_weapons[@weapon_id]
armor1 = $data_armors[@armor1_id]
armor2 = $data_armors[@armor2_id]
armor3 = $data_armors[@armor3_id]
armor4 = $data_armors[@armor4_id]
n += weapon != nil ? weapon.int_plus : 0
n += armor1 != nil ? armor1.int_plus : 0
n += armor2 != nil ? armor2.int_plus : 0
n += armor3 != nil ? armor3.int_plus : 0
n += armor4 != nil ? armor4.int_plus : 0
n = [[n + @int_plus, 1].max, 999].min
for i in @states
n *= $data_states[i].int_rate / 100.0
end
n = [[Integer(n), 1].max, 999].min
int = n
return [maxhp, maxsp, str, dex, agi, int]
end
end
#==============================================================================
# 本脚本来自www.66RPG.com,使用和转载请保留此信息
#==============================================================================
# ————————————————————————————————————
# ▼▲▼ XRXS_BP10. LEVEL UP!能力上昇表示ウィンドウ plus ▼▲▼
# by 桜雅 在土
#——以下3个如果需要修改,直接输入文件名即可
$data_system_level_up_se = "" #升级时的音效设置
$data_system_level_up_me = "Audio/ME/007-Fanfare01" # 升级时播放的ME
$data_system_skilllearn_se = "" # 学会特技时播放的声效。
#==============================================================================
# ■ Window_LevelUpWindow
#------------------------------------------------------------------------------
# バトル終了時、レベルアップした場合にステータスを表示するウィンドウです。
#==============================================================================
class Window_LevelUpWindow < Window_Base
#--------------------------------------------------------------------------
# ● オブジェクト初期化
#--------------------------------------------------------------------------
def initialize(actor, last_lv, up_hp, up_sp, up_str, up_dex, up_agi, up_int)
super(210, 100, 220, 222)
self.contents = Bitmap.new(width - 32, height - 32)
self.visible = false
self.back_opacity = 160
refresh(actor, last_lv, up_hp, up_sp, up_str, up_dex, up_agi, up_int)
# SEの再生
if $data_system_level_up_se != ""
Audio.se_play($data_system_level_up_se)
end
# MEの再生
if $data_system_level_up_me != ""
Audio.me_stop
Audio.me_play($data_system_level_up_me)
end
end
#--------------------------------------------------------------------------
# ● リフレッシュ
#--------------------------------------------------------------------------
def refresh(actor, last_lv, up_hp, up_sp, up_str, up_dex, up_agi, up_int)
self.contents.clear
self.contents.font.color = text_color(6)
self.contents.font.size = 20
self.contents.draw_text(0, 0, 160, 24, actor.name.to_s)
self.contents.font.color = system_color
self.contents.font.size = 18
self.contents.draw_text( 0, 26, 160, 24, "等级")
self.contents.font.size = 18
self.contents.draw_text( 0, 48, 80, 24, $data_system.words.hp)
self.contents.draw_text( 0, 70, 80, 24, $data_system.words.sp)
self.contents.draw_text( 0, 92, 80, 24, $data_system.words.str)
self.contents.draw_text( 0, 114, 80, 24, $data_system.words.dex)
self.contents.draw_text( 0, 136, 80, 24, $data_system.words.agi)
self.contents.draw_text( 0, 158, 80, 24, $data_system.words.int)
self.contents.draw_text(110, 26, 128, 24, "→")
self.contents.draw_text(110, 48, 128, 24, "→")
self.contents.draw_text(110, 70, 128, 24, "→")
self.contents.draw_text(110, 92, 128, 24, "→")
self.contents.draw_text(110, 114, 128, 24, "→")
self.contents.draw_text(110, 136, 128, 24, "→")
self.contents.draw_text(110, 158, 128, 24, "→")
self.contents.font.color = normal_color
self.contents.draw_text( 60, 26, 88, 24, last_lv.to_s)
self.contents.draw_text( 60, 48, 72, 24, up_hp.to_s)
self.contents.draw_text( 60, 70, 72, 24, up_sp.to_s)
self.contents.draw_text( 60, 92, 72, 24, up_str.to_s)
self.contents.draw_text( 60, 114, 72, 24, up_dex.to_s)
self.contents.draw_text( 60, 136, 72, 24, up_agi.to_s)
self.contents.draw_text( 60, 158, 72, 24, up_int.to_s)
self.contents.draw_text( 145, 26, 128, 24, actor.level.to_s)
self.contents.draw_text( 145, 48, 128, 24, actor.maxhp.to_s)
self.contents.draw_text( 145, 70, 128, 24, actor.maxsp.to_s)
self.contents.draw_text( 145, 92, 128, 24, actor.str.to_s)
self.contents.draw_text( 145, 114, 128, 24, actor.dex.to_s)
self.contents.draw_text( 145, 136, 128, 24, actor.agi.to_s)
self.contents.draw_text( 145, 158, 128, 24, actor.int.to_s)
end
end
#==============================================================================
# ■ Window_SkillLearning
#------------------------------------------------------------------------------
# レベルアップ時などにスキルを習得した場合にそれを表示するウィンドウです。
#==============================================================================
class Window_SkillLearning < Window_Base
#--------------------------------------------------------------------------
# ● オブジェクト初期化
#--------------------------------------------------------------------------
def initialize(class_id, last_lv, now_lv)
super(210, 322, 220, 56)
self.contents = Bitmap.new(width - 32, height - 16) # わざと▽を表示
self.visible = false
self.back_opacity = 160
@learn_skills = []
for i in 0...$data_classes[class_id].learnings.size
learn_lv = $data_classes[class_id].learnings[i].level
# 今回のレベルアップ範囲で習得するスキルの場合
if learn_lv > last_lv and learn_lv <= now_lv
@learn_skills.push $data_skills[
$data_classes[class_id].learnings[i].skill_id].name
end
end
refresh
end
#--------------------------------------------------------------------------
# ● リフレッシュ
#--------------------------------------------------------------------------
def refresh
# 各描写
skill_name = @learn_skills.shift
if skill_name == nil
return false
end
# SEの再生
if $data_system_skilllearn_se != ""
Audio.se_play($data_system_skilllearn_se, 100, 70)
end
self.contents.clear
self.contents.font.size = 18
self.contents.font.color = text_color(0)
self.contents.draw_text(0,0,156,24, "学会特技:"+skill_name)
self.contents.font.color = text_color(6)
self.contents.draw_text(0,0,156,24, " "+skill_name)
self.contents.font.color = text_color(0)
self.visible = true
return true
end
end
#==============================================================================
# ■ Window_ForgetLearning
#------------------------------------------------------------------------------
# 遗忘特技,用SkillLearning改的 By OCTSJimmy
#==============================================================================
class Window_ForgetLearning < Window_Base
#--------------------------------------------------------------------------
# ● オブジェクト初期化
#--------------------------------------------------------------------------
def initialize(class_id, last_lv, now_lv)
super(210, 322, 220, 56)
self.contents = Bitmap.new(width - 32, height - 16) # わざと▽を表示
self.visible = false
self.back_opacity = 160
@learn_skills = []
#for i in 0...$data_classes[class_id].learnings.size
for i in $data_classes[class_id].learnings
#learn_lv = $data_classes[class_id].learnings[i].level
learn_lv = i.level
# 今回のレベルアップ範囲で習得するスキルの場合
if learn_lv < last_lv and learn_lv > now_lv
@learn_skills.push $data_skills[i.skill_id].name
#$data_classes[class_id].learnings[i].skill_id].name
end
end
refresh
end
#--------------------------------------------------------------------------
# ● リフレッシュ
#--------------------------------------------------------------------------
def refresh
# 各描写
skill_name = @learn_skills.shift
if skill_name == nil
return false
end
# SEの再生
if $data_system_skilllearn_se != ""
Audio.se_play($data_system_skilllearn_se, 100, 70)
end
self.contents.clear
self.contents.font.size = 18
self.contents.font.color = text_color(0)
self.contents.draw_text(0,0,156,24, "遗忘特技:"+skill_name)
self.contents.font.color = text_color(6)
self.contents.draw_text(0,0,156,24, " "+skill_name)
self.contents.font.color = text_color(0)
self.visible = true
return true
end
end
#==============================================================================
# 本脚本来自www.66RPG.com,使用和转载请保留此信息
#==============================================================================
复制代码
[LINE]1,#dddddd[/LINE]
关于升级加点也有类似问题。
就是降级后点数不变。
如果觉得降级后留着点数不合适,可以在
exp=(exp)
复制代码
这个方法的
@level -= 1
复制代码
这行后面插入:
$game_variables[self.id + LEVEL_UP_VARIABLE] -= LEVEL_UP_POINT
复制代码
如果点数被加掉了的话会变成负数,没有关系。等到等级升够了自然回到正数的。
作者:
OCTSJimmy
时间:
2007-3-15 05:44
标题:
关于“增减水平”的一个BUG修正(诡异的问题)
某日,突然间发现……
有一个事件是这样子的……
======================分割线====================================
增减水平 : 全体同伴 +99
增减水平 : 全体同伴 -99
======================无敌的分割线 - -==========================
执行过后看看菜单里的特技,会发现人物还是1级,但是特技全部学会了……
这个就给一些设计“等级降低”、死亡掉经验等带来了BUG……
其实修正很简单,真的。
Game_Actor类
472行(也就是
exp=(exp)
方法)
@level -= 1
复制代码
前面
插入:
for j in $data_classes[@class_id].learnings
if j.level == @level
forget_skill(j.skill_id)
end
end
复制代码
这样就解决了。
[LINE]1,#dddddd[/LINE]
另附:
“物品金钱升级提示 v1.0”的同类修正
下面是已经修正好的,直接插入使用就好了
#==============================================================================
# 本脚本来自www.66RPG.com,使用和转载请保留此信息
#==============================================================================
#==============================================================================
# 物品金钱升级提示 v1.0
#
# 得失物品金钱提示 By 柳柳
# 升级提示 By 叶子
#
# Date: 2-12-2006
#==============================================================================
# 注意!!!在对话后得到物品,请在对话后先用事件等待3帧,否则对话框来不及消失。
# 同理,得到经验或升级,也要等待3帧以上。
# 开关定义:
$不显示金钱窗口 = 41
$不显示物品窗口 = 42
$不显示武器窗口 = 43
$不显示防具窗口 = 44
$不显示升级窗口 = 45
# 以上开关,当打开的时候,获得物品将不会提示,比如默认打开41号开关,获得金钱不再提示
# ————————————————————————————————————
class Interpreter
attr_accessor :parameters
#--------------------------------------------------------------------------
# ● 增减金钱
#--------------------------------------------------------------------------
def command_125
value = operate_value(@parameters[0], @parameters[1], @parameters[2])
$game_party.gain_gold(value)
if $game_switches[$不显示金钱窗口]==false
carol3_66RPG = Window_Base.new((640-160)/2,128,180,100)
carol3_66RPG.contents = Bitmap.new(carol3_66RPG.width - 32, carol3_66RPG.height - 32)
if value >= 0
carol3_66RPG.contents.draw_text(0,0,240,32,"获得金钱:")
#——声效,可以自己改
Audio.se_play("Audio/SE/"+"006-System06",80,100)
else
carol3_66RPG.contents.draw_text(0,0,240,32,"失去金钱:")
#——声效,可以自己改
Audio.se_play("Audio/SE/"+"005-System05",80,100)
end
carol3_66RPG.contents.draw_text(0,32,240,32,value.abs.to_s)
carol3_66RPG.contents.draw_text(0,32,140,32, $data_system.words.gold,2)
carol3_66RPG.opacity = 160
for i in 0..30
Graphics.update
end
for i in 0..10
carol3_66RPG.opacity -= 30
carol3_66RPG.contents_opacity -= 30
Graphics.update
end
carol3_66RPG.dispose
end
return true
end
#--------------------------------------------------------------------------
# ● 增减物品
#--------------------------------------------------------------------------
def command_126
value = operate_value(@parameters[1], @parameters[2], @parameters[3])
$game_party.gain_item(@parameters[0], value)
if $game_switches[$不显示物品窗口]==false
carol3_66RPG_item = $data_items[@parameters[0]]
carol3_66RPG = Window_Base.new((640-300)/2,128,300,100)
carol3_66RPG.contents = Bitmap.new(carol3_66RPG.width - 32, carol3_66RPG.height - 32)
if value >= 0
carol3_66RPG.contents.draw_text(0,0,240,32,"获得物品:")
#——声效,可以自己改
Audio.se_play("Audio/SE/"+"006-System06",80,100)
else
carol3_66RPG.contents.draw_text(0,0,240,32,"失去物品:")
#——声效,可以自己改
Audio.se_play("Audio/SE/"+"005-System05",80,100)
end
carol3_66RPG_bitmap = RPG::Cache.icon(carol3_66RPG_item.icon_name)
carol3_66RPG.contents.blt(0, 32, carol3_66RPG_bitmap, Rect.new(0, 0, 24, 24), 255)
carol3_66RPG.contents.draw_text(0 + 28, 32, 212, 32, carol3_66RPG_item.name, 0)
carol3_66RPG.contents.draw_text(0, 32, 268, 32, "×"+value.abs.to_s, 2)
carol3_66RPG.opacity = 160
for i in 0..30
Graphics.update
end
for i in 0..10
carol3_66RPG.opacity -= 30
carol3_66RPG.contents_opacity -= 30
Graphics.update
end
carol3_66RPG.dispose
end
return true
end
#--------------------------------------------------------------------------
# ● 增减武器
#--------------------------------------------------------------------------
def command_127
value = operate_value(@parameters[1], @parameters[2], @parameters[3])
$game_party.gain_weapon(@parameters[0], value)
if $game_switches[$不显示武器窗口]==false
carol3_66RPG_item = $data_weapons[@parameters[0]]
carol3_66RPG = Window_Base.new((640-300)/2,128,300,100)
carol3_66RPG.contents = Bitmap.new(carol3_66RPG.width - 32, carol3_66RPG.height - 32)
if value >= 0
carol3_66RPG.contents.draw_text(0,0,240,32,"获得武器:")
#——声效,可以自己改
Audio.se_play("Audio/SE/"+"006-System06",80,100)
else
carol3_66RPG.contents.draw_text(0,0,240,32,"失去武器:")
#——声效,可以自己改
Audio.se_play("Audio/SE/"+"005-System05",80,100)
end
carol3_66RPG_bitmap = RPG::Cache.icon(carol3_66RPG_item.icon_name)
carol3_66RPG.contents.blt(0, 32, carol3_66RPG_bitmap, Rect.new(0, 0, 24, 24), 255)
carol3_66RPG.contents.draw_text(0 + 28, 32, 212, 32, carol3_66RPG_item.name, 0)
carol3_66RPG.contents.draw_text(0, 32, 268, 32, "×"+value.abs.to_s, 2)
carol3_66RPG.opacity = 160
for i in 0..30
Graphics.update
end
for i in 0..10
carol3_66RPG.opacity -= 30
carol3_66RPG.contents_opacity -= 30
Graphics.update
end
carol3_66RPG.dispose
end
return true
end
#--------------------------------------------------------------------------
# ● 增减防具
#--------------------------------------------------------------------------
def command_128
value = operate_value(@parameters[1], @parameters[2], @parameters[3])
$game_party.gain_armor(@parameters[0], value)
if $game_switches[$不显示防具窗口]==false
carol3_66RPG_item = $data_armors[@parameters[0]]
carol3_66RPG = Window_Base.new((640-300)/2,128,300,100)
carol3_66RPG.contents = Bitmap.new(carol3_66RPG.width - 32, carol3_66RPG.height - 32)
if value >= 0
carol3_66RPG.contents.draw_text(0,0,240,32,"获得防具:")
#——声效,可以自己改
Audio.se_play("Audio/SE/"+"006-System06",80,100)
else
carol3_66RPG.contents.draw_text(0,0,240,32,"失去防具:")
#——声效,可以自己改
Audio.se_play("Audio/SE/"+"005-System05",80,100)
end
carol3_66RPG_bitmap = RPG::Cache.icon(carol3_66RPG_item.icon_name)
carol3_66RPG.contents.blt(0, 32, carol3_66RPG_bitmap, Rect.new(0, 0, 24, 24), 255)
carol3_66RPG.contents.draw_text(0 + 28, 32, 212, 32, carol3_66RPG_item.name, 0)
carol3_66RPG.contents.draw_text(0, 32, 268, 32, "×"+value.abs.to_s, 2)
carol3_66RPG.opacity = 160
for i in 0..30
Graphics.update
end
for i in 0..10
carol3_66RPG.opacity -= 30
carol3_66RPG.contents_opacity -= 30
Graphics.update
end
carol3_66RPG.dispose
end
return true
end
#--------------------------------------------------------------------------
# ● 增减 EXP
#--------------------------------------------------------------------------
def command_315
# 获取操作值
value = operate_value(@parameters[1], @parameters[2], @parameters[3])
# 处理重复
iterate_actor(@parameters[0]) do |actor|
# 记录等级
last_level = actor.level
# 更改角色 EXP
actor.exp += value
# 如果角色升级了的话,显示升级窗口
if actor.level > last_level and $game_switches[$不显示升级窗口] == false
show_level_up_result(actor, last_level)
#############降级、减经验修正 By OCTSJimmy##########################
elsif actor.level < last_level and $game_switches[$不显示升级窗口] == false
show_level_up_result(actor, last_level)
#############降级、减经验修正 By OCTSJimmy##########################
end
end
# 继续
return true
end
#--------------------------------------------------------------------------
# ● 增减等级
#--------------------------------------------------------------------------
def command_316
# 获取操作值
value = operate_value(@parameters[1], @parameters[2], @parameters[3])
# 处理重复
iterate_actor(@parameters[0]) do |actor|
# 记录等级
last_level = actor.level
# 更改角色的等级
actor.level += value
# 如果角色升级了的话,显示升级窗口
if actor.level > last_level and $game_switches[$不显示升级窗口] == false
show_level_up_result(actor, last_level)
#############降级、减经验修正 By OCTSJimmy##########################
elsif actor.level < last_level and $game_switches[$不显示升级窗口] == false
show_level_up_result(actor, last_level)
#############降级、减经验修正 By OCTSJimmy##########################
end
end
# 继续
return true
end
#--------------------------------------------------------------------------
# ● 升级显示处理
#--------------------------------------------------------------------------
def show_level_up_result(actor,last_level)
actor_parameters = actor.last_parameters(last_level)
last_maxhp = actor_parameters[0]
last_maxsp = actor_parameters[1]
last_str = actor_parameters[2]
last_dex = actor_parameters[3]
last_agi = actor_parameters[4]
last_int = actor_parameters[5]
level_up_window = Window_LevelUpWindow.new actor,last_level,last_maxhp,
last_maxsp,last_str,last_dex,last_agi,last_int
level_up_window.visible = true
#############降级、减经验修正 By OCTSJimmy##########################
if actor.level > last_level
skill_learning_window = Window_SkillLearning.new(actor.class_id, last_level, actor.level)
elsif actor.level < last_level
skill_learning_window = Window_ForgetLearning.new(actor.class_id, last_level, actor.level)
end
#############降级、减经验修正 By OCTSJimmy##########################
#——声效,可以自己改
Audio.me_play("Audio/ME/"+"007-Fanfare01")
# 循环
loop do
# 刷新游戏画面
Graphics.update
# 刷新输入信息
Input.update
# 按下C就关闭窗口
if Input.trigger?(Input::C) or Input.trigger?(Input::B)
unless skill_learning_window.refresh
level_up_window.dispose
skill_learning_window.dispose
return true
end
end
end
end
end
class Game_Battler
#--------------------------------------------------------------------------
# ● 一次取得全部旧属性
#--------------------------------------------------------------------------
def last_parameters(level)
#---------------------------
# maxhp
#---------------------------
n = [[$data_actors[@actor_id].parameters[0, level] + @maxhp_plus, 1].max, 9999].min
for i in @states
n *= $data_states[i].maxhp_rate / 100.0
end
n = [[Integer(n), 1].max, 9999].min
maxhp = n
#---------------------------
# maxsp
#---------------------------
n = [[$data_actors[@actor_id].parameters[1, level] + @maxsp_plus, 0].max, 9999].min
for i in @states
n *= $data_states[i].maxsp_rate / 100.0
end
n = [[Integer(n), 0].max, 9999].min
maxsp = n
#---------------------------
# str
#---------------------------
n = $data_actors[@actor_id].parameters[2, level]
weapon = $data_weapons[@weapon_id]
armor1 = $data_armors[@armor1_id]
armor2 = $data_armors[@armor2_id]
armor3 = $data_armors[@armor3_id]
armor4 = $data_armors[@armor4_id]
n += weapon != nil ? weapon.str_plus : 0
n += armor1 != nil ? armor1.str_plus : 0
n += armor2 != nil ? armor2.str_plus : 0
n += armor3 != nil ? armor3.str_plus : 0
n += armor4 != nil ? armor4.str_plus : 0
n = [[n + @str_plus, 1].max, 999].min
for i in @states
n *= $data_states[i].str_rate / 100.0
end
n = [[Integer(n), 1].max, 999].min
str = n
#---------------------------
# dex
#---------------------------
n = $data_actors[@actor_id].parameters[3, level]
weapon = $data_weapons[@weapon_id]
armor1 = $data_armors[@armor1_id]
armor2 = $data_armors[@armor2_id]
armor3 = $data_armors[@armor3_id]
armor4 = $data_armors[@armor4_id]
n += weapon != nil ? weapon.dex_plus : 0
n += armor1 != nil ? armor1.dex_plus : 0
n += armor2 != nil ? armor2.dex_plus : 0
n += armor3 != nil ? armor3.dex_plus : 0
n += armor4 != nil ? armor4.dex_plus : 0
n = [[n + @dex_plus, 1].max, 999].min
for i in @states
n *= $data_states[i].dex_rate / 100.0
end
n = [[Integer(n), 1].max, 999].min
dex = n
#---------------------------
# agi
#---------------------------
n = $data_actors[@actor_id].parameters[4, level]
weapon = $data_weapons[@weapon_id]
armor1 = $data_armors[@armor1_id]
armor2 = $data_armors[@armor2_id]
armor3 = $data_armors[@armor3_id]
armor4 = $data_armors[@armor4_id]
n += weapon != nil ? weapon.agi_plus : 0
n += armor1 != nil ? armor1.agi_plus : 0
n += armor2 != nil ? armor2.agi_plus : 0
n += armor3 != nil ? armor3.agi_plus : 0
n += armor4 != nil ? armor4.agi_plus : 0
n = [[n + @agi_plus, 1].max, 999].min
for i in @states
n *= $data_states[i].agi_rate / 100.0
end
n = [[Integer(n), 1].max, 999].min
agi = n
#---------------------------
# int
#---------------------------
n = $data_actors[@actor_id].parameters[5, level]
weapon = $data_weapons[@weapon_id]
armor1 = $data_armors[@armor1_id]
armor2 = $data_armors[@armor2_id]
armor3 = $data_armors[@armor3_id]
armor4 = $data_armors[@armor4_id]
n += weapon != nil ? weapon.int_plus : 0
n += armor1 != nil ? armor1.int_plus : 0
n += armor2 != nil ? armor2.int_plus : 0
n += armor3 != nil ? armor3.int_plus : 0
n += armor4 != nil ? armor4.int_plus : 0
n = [[n + @int_plus, 1].max, 999].min
for i in @states
n *= $data_states[i].int_rate / 100.0
end
n = [[Integer(n), 1].max, 999].min
int = n
return [maxhp, maxsp, str, dex, agi, int]
end
end
#==============================================================================
# 本脚本来自www.66RPG.com,使用和转载请保留此信息
#==============================================================================
# ————————————————————————————————————
# ▼▲▼ XRXS_BP10. LEVEL UP!能力上昇表示ウィンドウ plus ▼▲▼
# by 桜雅 在土
#——以下3个如果需要修改,直接输入文件名即可
$data_system_level_up_se = "" #升级时的音效设置
$data_system_level_up_me = "Audio/ME/007-Fanfare01" # 升级时播放的ME
$data_system_skilllearn_se = "" # 学会特技时播放的声效。
#==============================================================================
# ■ Window_LevelUpWindow
#------------------------------------------------------------------------------
# バトル終了時、レベルアップした場合にステータスを表示するウィンドウです。
#==============================================================================
class Window_LevelUpWindow < Window_Base
#--------------------------------------------------------------------------
# ● オブジェクト初期化
#--------------------------------------------------------------------------
def initialize(actor, last_lv, up_hp, up_sp, up_str, up_dex, up_agi, up_int)
super(210, 100, 220, 222)
self.contents = Bitmap.new(width - 32, height - 32)
self.visible = false
self.back_opacity = 160
refresh(actor, last_lv, up_hp, up_sp, up_str, up_dex, up_agi, up_int)
# SEの再生
if $data_system_level_up_se != ""
Audio.se_play($data_system_level_up_se)
end
# MEの再生
if $data_system_level_up_me != ""
Audio.me_stop
Audio.me_play($data_system_level_up_me)
end
end
#--------------------------------------------------------------------------
# ● リフレッシュ
#--------------------------------------------------------------------------
def refresh(actor, last_lv, up_hp, up_sp, up_str, up_dex, up_agi, up_int)
self.contents.clear
self.contents.font.color = text_color(6)
self.contents.font.size = 20
self.contents.draw_text(0, 0, 160, 24, actor.name.to_s)
self.contents.font.color = system_color
self.contents.font.size = 18
self.contents.draw_text( 0, 26, 160, 24, "等级")
self.contents.font.size = 18
self.contents.draw_text( 0, 48, 80, 24, $data_system.words.hp)
self.contents.draw_text( 0, 70, 80, 24, $data_system.words.sp)
self.contents.draw_text( 0, 92, 80, 24, $data_system.words.str)
self.contents.draw_text( 0, 114, 80, 24, $data_system.words.dex)
self.contents.draw_text( 0, 136, 80, 24, $data_system.words.agi)
self.contents.draw_text( 0, 158, 80, 24, $data_system.words.int)
self.contents.draw_text(110, 26, 128, 24, "→")
self.contents.draw_text(110, 48, 128, 24, "→")
self.contents.draw_text(110, 70, 128, 24, "→")
self.contents.draw_text(110, 92, 128, 24, "→")
self.contents.draw_text(110, 114, 128, 24, "→")
self.contents.draw_text(110, 136, 128, 24, "→")
self.contents.draw_text(110, 158, 128, 24, "→")
self.contents.font.color = normal_color
self.contents.draw_text( 60, 26, 88, 24, last_lv.to_s)
self.contents.draw_text( 60, 48, 72, 24, up_hp.to_s)
self.contents.draw_text( 60, 70, 72, 24, up_sp.to_s)
self.contents.draw_text( 60, 92, 72, 24, up_str.to_s)
self.contents.draw_text( 60, 114, 72, 24, up_dex.to_s)
self.contents.draw_text( 60, 136, 72, 24, up_agi.to_s)
self.contents.draw_text( 60, 158, 72, 24, up_int.to_s)
self.contents.draw_text( 145, 26, 128, 24, actor.level.to_s)
self.contents.draw_text( 145, 48, 128, 24, actor.maxhp.to_s)
self.contents.draw_text( 145, 70, 128, 24, actor.maxsp.to_s)
self.contents.draw_text( 145, 92, 128, 24, actor.str.to_s)
self.contents.draw_text( 145, 114, 128, 24, actor.dex.to_s)
self.contents.draw_text( 145, 136, 128, 24, actor.agi.to_s)
self.contents.draw_text( 145, 158, 128, 24, actor.int.to_s)
end
end
#==============================================================================
# ■ Window_SkillLearning
#------------------------------------------------------------------------------
# レベルアップ時などにスキルを習得した場合にそれを表示するウィンドウです。
#==============================================================================
class Window_SkillLearning < Window_Base
#--------------------------------------------------------------------------
# ● オブジェクト初期化
#--------------------------------------------------------------------------
def initialize(class_id, last_lv, now_lv)
super(210, 322, 220, 56)
self.contents = Bitmap.new(width - 32, height - 16) # わざと▽を表示
self.visible = false
self.back_opacity = 160
@learn_skills = []
for i in 0...$data_classes[class_id].learnings.size
learn_lv = $data_classes[class_id].learnings[i].level
# 今回のレベルアップ範囲で習得するスキルの場合
if learn_lv > last_lv and learn_lv <= now_lv
@learn_skills.push $data_skills[
$data_classes[class_id].learnings[i].skill_id].name
end
end
refresh
end
#--------------------------------------------------------------------------
# ● リフレッシュ
#--------------------------------------------------------------------------
def refresh
# 各描写
skill_name = @learn_skills.shift
if skill_name == nil
return false
end
# SEの再生
if $data_system_skilllearn_se != ""
Audio.se_play($data_system_skilllearn_se, 100, 70)
end
self.contents.clear
self.contents.font.size = 18
self.contents.font.color = text_color(0)
self.contents.draw_text(0,0,156,24, "学会特技:"+skill_name)
self.contents.font.color = text_color(6)
self.contents.draw_text(0,0,156,24, " "+skill_name)
self.contents.font.color = text_color(0)
self.visible = true
return true
end
end
#==============================================================================
# ■ Window_ForgetLearning
#------------------------------------------------------------------------------
# 遗忘特技,用SkillLearning改的 By OCTSJimmy
#==============================================================================
class Window_ForgetLearning < Window_Base
#--------------------------------------------------------------------------
# ● オブジェクト初期化
#--------------------------------------------------------------------------
def initialize(class_id, last_lv, now_lv)
super(210, 322, 220, 56)
self.contents = Bitmap.new(width - 32, height - 16) # わざと▽を表示
self.visible = false
self.back_opacity = 160
@learn_skills = []
#for i in 0...$data_classes[class_id].learnings.size
for i in $data_classes[class_id].learnings
#learn_lv = $data_classes[class_id].learnings[i].level
learn_lv = i.level
# 今回のレベルアップ範囲で習得するスキルの場合
if learn_lv < last_lv and learn_lv > now_lv
@learn_skills.push $data_skills[i.skill_id].name
#$data_classes[class_id].learnings[i].skill_id].name
end
end
refresh
end
#--------------------------------------------------------------------------
# ● リフレッシュ
#--------------------------------------------------------------------------
def refresh
# 各描写
skill_name = @learn_skills.shift
if skill_name == nil
return false
end
# SEの再生
if $data_system_skilllearn_se != ""
Audio.se_play($data_system_skilllearn_se, 100, 70)
end
self.contents.clear
self.contents.font.size = 18
self.contents.font.color = text_color(0)
self.contents.draw_text(0,0,156,24, "遗忘特技:"+skill_name)
self.contents.font.color = text_color(6)
self.contents.draw_text(0,0,156,24, " "+skill_name)
self.contents.font.color = text_color(0)
self.visible = true
return true
end
end
#==============================================================================
# 本脚本来自www.66RPG.com,使用和转载请保留此信息
#==============================================================================
复制代码
[LINE]1,#dddddd[/LINE]
关于升级加点也有类似问题。
就是降级后点数不变。
如果觉得降级后留着点数不合适,可以在
exp=(exp)
复制代码
这个方法的
@level -= 1
复制代码
这行后面插入:
$game_variables[self.id + LEVEL_UP_VARIABLE] -= LEVEL_UP_POINT
复制代码
如果点数被加掉了的话会变成负数,没有关系。等到等级升够了自然回到正数的。
作者:
海的那边
时间:
2007-3-15 07:06
很好啊。不过RM本来是给RPG游戏设计的,一般RPG游戏死后就 game over 了,所以可能没注意到。
作者:
OCTSJimmy
时间:
2007-3-20 02:15
咋的看这帖子的人那么少?
作者:
小傻瓜
时间:
2007-3-20 19:54
提示:
作者被禁止或删除 内容自动屏蔽
作者:
叶舞枫
时间:
2007-3-20 20:56
错了错了,屏蔽掉……
作者:
OCTSJimmy
时间:
2007-3-25 20:29
怎么好象没什么人重视啊……{/lh}{/gg}
作者:
doranikofu
时间:
2007-3-25 20:38
可能不怎么用到这个功能吧{/gg}
一般都是技能多多益善嘛…
作者:
Benavii
时间:
2007-3-25 23:50
我觉得更应该修改的是转职后无法立即变换角色拥有技能的BUG{/fd}
作者:
精灵使者
时间:
2007-3-26 16:50
这样应该可以。你只需要设计每个职业增多的技能就行了。原来的技能没有必要取消。如果真想取消的话,可以在事件里面做,例如遗忘技能等等
作者:
OCTSJimmy
时间:
2007-4-11 23:12
好像回帖不多啊……{/gg}{/lh}
作者:
ikki
时间:
2007-4-13 00:10
{/gg}是遗忘了,一个技能都没留下,连初始技能都遗忘了。{/gg}
作者:
ikki
时间:
2007-4-13 00:22
其实,遗忘语句写在降级的前边就可以了哦,LZ放到后边会把1级的初始技能都忘掉的。
欢迎光临 Project1 (https://rpg.blue/)
Powered by Discuz! X3.1