Project1
标题:
有事请教
[打印本页]
作者:
nazx
时间:
2009-1-27 19:41
标题:
有事请教
First:我使用了升级提示的脚本(就是有箭头升的那个),和等级无限升的那个脚本.不过用了等级的那个之后,有箭头的提示就出不到来,请问如何解决.
Second:使用了等级的脚本后,尝试升过了99极后发现int的成长特别高,基本上我的男主角(物理型+半魔法)到9999级后就是精神力大于攻击力5倍以上.女主角(魔法+半物理)更是达到了10倍左右.
Third:vx本身程序的设置数值不能太大(能力max是999,武器防具是500),但是使用了等级脚本后,能力也应该相应增加,请问如何突破?
请知道如何解决的朋友说明白的(关于脚本方面我是个超级大白)
先谢过帮忙的朋友.(其实本人十分喜欢魔界战记的,所以才想仿照9999级之类)
谢谢 [LINE]1,#dddddd[/LINE]
此贴于 2009-2-4 11:18:32 被版主木葬枫提醒,请楼主看到后对本贴做出回应。
[LINE]1,#dddddd[/LINE]
此贴于 2009-2-10 21:51:58 被版主八云紫提醒,请楼主看到后对本贴做出回应。
[LINE]1,#dddddd[/LINE]
本贴由论坛斑竹八云紫结贴,如楼主认为问题未解决,请重新将此贴编辑为“有事请教”,并回帖叙述疑点即可~ ^-^
作者:
nazx
时间:
2009-1-28 03:30
请问有高手帮忙吗?
作者:
紫丞
时间:
2009-1-28 03:44
提示:
作者被禁止或删除 内容自动屏蔽
作者:
塑望
时间:
2009-1-28 03:50
1,那个应该是脚本冲突造成 同类型脚本(如等级脚本)尽量使用一个.
2,可以修改角色能力曲线看看.
3,请贴出脚本
作者:
nazx
时间:
2009-1-28 04:16
#_/----------------------------------------------------------------------------
#_/ 游戏的变化,在各种属性上限设定
#_/============================================================================
#_/
#_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
#==============================================================================
# ★ 定制数据 - Customize ★
#==============================================================================
module KGC
module LimitBreak
# ◆ 等级经验值计算方式
# 0..按照数据库那样(系统默认)
# (100级以后使用 PARAMETER_CALC_EXP 作为计算式)
#
# 1..使用了数据库的2次函数
# 作为a:等级1数值 b:等级2数值 c:等级3数值 x:现实等级
#
# ax^2 + bx + c
# 这是用来算出等级数值的公式
#
# 2..使用了数据库的1次函数
# 作为b:等级2数值 c:等级3数值 x:现实等级
#
# bx + c
# 这是用来算出等级数值的公式
# (使用等级 2 和 3 的数值,为了轻松跟2次函数方式的分开使用)
PARAMETER_CALC_METHOD = 0 # 在这里输入能力值计算方式的编号
# ◆ 水平 100以后的等级经验值计算式
# PARAMETER_CALC_METHOD = 0 的时候使用
# 【 level..现实等级 param[x]..等级 x 的等级经验值 】
# 这个是等级 99 的等级经验值加在一起算的计算结果
PARAMETER_CALC_EXP = "(param[99] - param[94]) * (level - 99)"
# ◆ 角色的等级上限
ACTOR_FINAL_LEVEL = [] # ← 这个保留
# 从这里输入,每个角色的等级上限
# ACTOR_FINAL_LEVEL[角色ーID] = 等级上限
# <例> ↓ 角色ー 1 の等级上限为 9999
ACTOR_FINAL_LEVEL[1] = 9999 # 按上面所说的的进行设定
# ◆ 角色的等级上限(默认)
# 没指定上限的情况,作为最后等级使用这个数值
ACTOR_FINAL_LEVEL_DEFAULT = 9999
# ◆ 角色的经验值上限
ACTOR_EXP_LIMIT = 9999999999999
# ◆ 角色的 MaxHP 上限
ACTOR_MAXHP_LIMIT = 999999999
# ◆ 角色的 MaxMP 上限
ACTOR_MAXMP_LIMIT = 999999999
# ◆ 角色的攻击力,防御力,精神力,敏捷性上限
ACTOR_PARAMETER_LIMIT = 999999999
# ◆ 敌人的 MaxHP 上限
ENEMY_MAXHP_LIMIT = 999999999
# ◆ 敌人的 MaxMP 上限
ENEMY_MAXMP_LIMIT = 999999999
# ◆ 敌人的攻击力,防御力,精神力,敏捷性上限
ENEMY_PARAMETER_LIMIT = 999999999
# ◆ 敌人的能力值补正
# 把敌人的各种能力值做为数据库的 0%
# 如果要数据库那样请输入 100
ENEMY_MAXHP_RATE = 100 # MaxHP
ENEMY_MAXMP_RATE = 100 # MaxMP
ENEMY_ATK_RATE = 100 # 攻击力
ENEMY_DEF_RATE = 100 # 防御力
ENEMY_SPI_RATE = 100 # 精神力
ENEMY_AGI_RATE = 100 # 敏捷性
# ◆ 所携带金钱上限
GOLD_LIMIT = 9999999999999
# ◆ 所携带物品数量上限
ITEM_NUMBER_LIMIT = 99
module_function
#--------------------------------------------------------------------------
# ○ 敌人能力值直接指定
# 在这里能直接指定敌人的 MaxHP 等数据
# 如果不指定将使用数据库默认的数据使用
# 注意,如果要直接指定,必须去掉$data_enemies前面的#哦
#--------------------------------------------------------------------------
def set_enemy_parameters
# <例> ID:10 敌人的 MaxHP 为 2000000 的情况
# $data_enemies[10].maxhp = 2000000
# <例> ID:16 敌人的 攻击力 为 5000 的情况
# $data_enemies[16].atk = 5000
# <例> ID:20 敌人的 防御力为 2 倍 的情况
# $data_enemies[20].def *= 2
end
end
end
#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
$imported = {} if $imported == nil
$imported["LimitBreak"] = true
module KGC::LimitBreak
# 定义正则表达式
module Regexp
# 基本规定
module BaseItem
# 所持数上限
NUMBER_LIMIT = /^<(?:NUMBER_LIMIT|所持数上限)[ ]*(\d+)>/i
end
end
module_function
#--------------------------------------------------------------------------
# ○ 适用敌人的能力修正
#--------------------------------------------------------------------------
def revise_enemy_parameters
(1...$data_enemies.size).each { |i|
enemy = $data_enemies[i]
enemy.maxhp = enemy.maxhp * ENEMY_MAXHP_RATE / 100
enemy.maxmp = enemy.maxmp * ENEMY_MAXMP_RATE / 100
enemy.atk = enemy.atk * ENEMY_ATK_RATE / 100
enemy.def = enemy.def * ENEMY_DEF_RATE / 100
enemy.spi = enemy.spi * ENEMY_SPI_RATE / 100
enemy.agi = enemy.agi * ENEMY_AGI_RATE / 100
}
end
end
#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
#==============================================================================
# ■ RPG::BaseItem
#==============================================================================
class RPG::BaseItem
#--------------------------------------------------------------------------
# ○ 所携带金钱上限生成
#--------------------------------------------------------------------------
def create_limit_break_cache
@__number_limit = KGC::LimitBreak::ITEM_NUMBER_LIMIT
@note.split(/[\r\n]+/).each { |line|
if line =~ KGC::LimitBreak::Regexp::BaseItem::NUMBER_LIMIT
# 所持数上限
@__number_limit = $1.to_i
end
}
end
#--------------------------------------------------------------------------
# ○ 所持数上限获得
#--------------------------------------------------------------------------
def number_limit
create_limit_break_cache if @__number_limit == nil
return @__number_limit
end
end
#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
#==============================================================================
# ■ Game_Battler
#==============================================================================
class Game_Battler
#--------------------------------------------------------------------------
# ● MaxHP 上限获得
#--------------------------------------------------------------------------
def maxhp_limit
return KGC::LimitBreak::ENEMY_MAXHP_LIMIT
end
#--------------------------------------------------------------------------
# ○ MaxMP 上限获得
#--------------------------------------------------------------------------
def maxmp_limit
return KGC::LimitBreak::ENEMY_MAXMP_LIMIT
end
#--------------------------------------------------------------------------
# ● MaxMP 上限获得
#--------------------------------------------------------------------------
def maxmp
return [[base_maxmp + @maxmp_plus, 0].max, maxmp_limit].min
end
#--------------------------------------------------------------------------
# ○ 各种能力值的上限数据获得
#--------------------------------------------------------------------------
def parameter_limit
return KGC::LimitBreak::ENEMY_PARAMETER_LIMIT
end
#--------------------------------------------------------------------------
# ● 攻击力获得
#--------------------------------------------------------------------------
def atk
n = [base_atk + @atk_plus, 1].max
states.each { |state| n *= state.atk_rate / 100.0 }
n = [[Integer(n), 1].max, parameter_limit].min
return n
end
#--------------------------------------------------------------------------
# ● 防御力获得
#--------------------------------------------------------------------------
def def
n = [base_def + @def_plus, 1].max
states.each { |state| n *= state.def_rate / 100.0 }
n = [[Integer(n), 1].max, parameter_limit].min
return n
end
#--------------------------------------------------------------------------
# ● 精神力获得
#--------------------------------------------------------------------------
def spi
n = [base_spi + @spi_plus, 1].max
states.each { |state| n *= state.spi_rate / 100.0 }
n = [[Integer(n), 1].max, parameter_limit].min
return n
end
#--------------------------------------------------------------------------
# ● 敏捷性获得
#--------------------------------------------------------------------------
def agi
n = [base_agi + @agi_plus, 1].max
states.each { |state| n *= state.agi_rate / 100.0 }
n = [[Integer(n), 1].max, parameter_limit].min
return n
end
#--------------------------------------------------------------------------
# ● MaxHP 的设定
# new_maxhp : 新的 MaxHP
#--------------------------------------------------------------------------
def maxhp=(new_maxhp)
@maxhp_plus += new_maxhp - self.maxhp
@maxhp_plus = [[@maxhp_plus, -maxhp_limit].max, maxhp_limit].min
@hp = [@hp, self.maxhp].min
end
#--------------------------------------------------------------------------
# ● MaxMP 的设定
# new_maxmp : 新的 MaxMP
#--------------------------------------------------------------------------
def maxmp=(new_maxmp)
@maxmp_plus += new_maxmp - self.maxmp
@maxmp_plus = [[@maxmp_plus, -maxmp_limit].max, maxmp_limit].min
@mp = [@mp, self.maxmp].min
end
#--------------------------------------------------------------------------
# ● 攻击力的设定
# new_atk : 新的攻击力
#--------------------------------------------------------------------------
def atk=(new_atk)
@atk_plus += new_atk - self.atk
@atk_plus = [[@atk_plus, -parameter_limit].max, parameter_limit].min
end
#--------------------------------------------------------------------------
# ● 防御力的设定
# new_def : 新的防御力
#--------------------------------------------------------------------------
def def=(new_def)
@def_plus += new_def - self.def
@def_plus = [[@def_plus, -parameter_limit].max, parameter_limit].min
end
#--------------------------------------------------------------------------
# ● 精神力的设定
# new_spi : 新的精神力
#--------------------------------------------------------------------------
def spi=(new_spi)
@spi_plus += new_spi - self.spi
@spi_plus = [[@spi_plus, -parameter_limit].max, parameter_limit].min
end
#--------------------------------------------------------------------------
# ● 敏捷性的设定
# agi : 新的敏捷性
#--------------------------------------------------------------------------
def agi=(new_agi)
@agi_plus += new_agi - self.agi
@agi_plus = [[@agi_plus, -parameter_limit].max, parameter_limit].min
end
end
#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
#==============================================================================
# ■ Game_Actor
#==============================================================================
class Game_Actor < Game_Battler
#--------------------------------------------------------------------------
# ● 经验值計算
#--------------------------------------------------------------------------
def make_exp_list
@exp_list = Array.new(final_level + 2)
@exp_list[1] = @exp_list[final_level + 1] = 0
m = actor.exp_basis
n = 0.75 + actor.exp_inflation / 200.0
(2..final_level).each { |i|
@exp_list[i] = @exp_list[i-1] + Integer(m)
m *= 1 + n
n *= 0.9
}
end
#--------------------------------------------------------------------------
# ○ 最后等级的获得
#--------------------------------------------------------------------------
def final_level
n = KGC::LimitBreak::ACTOR_FINAL_LEVEL[self.id]
return (n != nil ? n : KGC::LimitBreak::ACTOR_FINAL_LEVEL_DEFAULT)
end
#--------------------------------------------------------------------------
# ● MaxHP 的上限获得
#--------------------------------------------------------------------------
def maxhp_limit
return KGC::LimitBreak::ACTOR_MAXHP_LIMIT
end
#--------------------------------------------------------------------------
# ○ MaxMP 的上限获得
#--------------------------------------------------------------------------
def maxmp_limit
return KGC::LimitBreak::ACTOR_MAXMP_LIMIT
end
#--------------------------------------------------------------------------
# ○ 各種能力值的上限获得
#--------------------------------------------------------------------------
def parameter_limit
return KGC::LimitBreak::ACTOR_PARAMETER_LIMIT
end
#--------------------------------------------------------------------------
# ○ 经验值的上限获得
#--------------------------------------------------------------------------
def exp_limit
return KGC::LimitBreak::ACTOR_EXP_LIMIT
end
#--------------------------------------------------------------------------
# ● 经验值的变更
# exp : 新的经验值
# show : 提高等级表示标志
#--------------------------------------------------------------------------
def change_exp(exp, show)
last_level = @level
last_skills = skills
@exp = [[exp, exp_limit].min, 0].max
while @exp >= @exp_list[@level+1] && @exp_list[@level+1] > 0
level_up
end
while @exp < @exp_list[@level]
level_down
end
@hp = [@hp, maxhp].min
@mp = [@mp, maxmp].min
if show && @level > last_level
display_level_up(skills - last_skills)
end
end
#--------------------------------------------------------------------------
# ● 等级的变更
# level : 新的等级
# show : 提高等级表示标志
#--------------------------------------------------------------------------
def change_level(level, show)
level = [[level, final_level].min, 1].max
change_exp(@exp_list[level], show)
end
#--------------------------------------------------------------------------
# ○ 基本参数的取得
#--------------------------------------------------------------------------
def base_parameter(type)
case KGC::LimitBreak::PARAMETER_CALC_METHOD
when 0 # 数式定义
if @level >= 100
calc_text = KGC::LimitBreak::PARAMETER_CALC_EXP.dup
calc_text.gsub!(/level/i) { "@level" }
calc_text.gsub!(/param\[(\d+)\]/i) {
"actor.parameters[type, #{$1.to_i}]"
}
return actor.parameters[type, 99] + eval(calc_text)
end
when 1 # 二次函数
a = actor.parameters[type, 1]
b = actor.parameters[type, 2]
c = actor.parameters[type, 3]
return ((a * @level + b) * @level + c)
when 2 # 一次函数
b = actor.parameters[type, 2]
c = actor.parameters[type, 3]
return (b * @level + c)
end
return actor.parameters[type, @level]
end
#--------------------------------------------------------------------------
# ● 基本 MaxHP 的获得
#--------------------------------------------------------------------------
def base_maxhp
return base_parameter(0)
end
#--------------------------------------------------------------------------
# ● 基本 MaxMP 的获得
#--------------------------------------------------------------------------
def base_maxmp
return base_parameter(1)
end
#--------------------------------------------------------------------------
# ● 基本攻击力的获得
#--------------------------------------------------------------------------
def base_atk
n = base_parameter(2)
equips.compact.each { |item| n += item.atk }
return n
end
#--------------------------------------------------------------------------
# ● 基本防御力的获得
#--------------------------------------------------------------------------
def base_def
n = base_parameter(3)
equips.compact.each { |item| n += item.def }
return n
end
#--------------------------------------------------------------------------
# ● 基本精神力的获得
#--------------------------------------------------------------------------
def base_spi
n = base_parameter(4)
equips.compact.each { |item| n += item.spi }
return n
end
#--------------------------------------------------------------------------
# ● 基本敏捷性的获得
#--------------------------------------------------------------------------
def base_agi
n = base_parameter(5)
equips.compact.each { |item| n += item.agi }
return n
end
end
#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
#==============================================================================
# ■ Game_Party
#==============================================================================
class Game_Party < Game_Unit
#--------------------------------------------------------------------------
# ○ 所携带金钱上限值获得
#--------------------------------------------------------------------------
def gold_limit
return KGC::LimitBreak::GOLD_LIMIT
end
#--------------------------------------------------------------------------
# ● 金钱的增加(减少)
# n : 金额
#--------------------------------------------------------------------------
def gain_gold(n)
@gold = [[@gold + n, 0].max, gold_limit].min
end
#--------------------------------------------------------------------------
# ● 物品的増加(減少)
# item : 物品
# n : 个数
# include_equip : 包含装备物品
#--------------------------------------------------------------------------
def gain_item(item, n, include_equip = false)
number = item_number(item)
case item
when RPG::Item
@items[item.id] = [[number + n, 0].max, item.number_limit].min
when RPG::Weapon
@weapons[item.id] = [[number + n, 0].max, item.number_limit].min
when RPG::Armor
@armors[item.id] = [[number + n, 0].max, item.number_limit].min
end
n += number
if include_equip && n < 0
members.each { |actor|
while n < 0 && actor.equips.include?(item)
actor.discard_equip(item)
n += 1
end
}
end
end
end
#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
#==============================================================================
# ■ Window_ShopBuy
#==============================================================================
class Window_ShopBuy < Window_Selectable
#--------------------------------------------------------------------------
# ● 项目的描画
# index : 项目番号
#--------------------------------------------------------------------------
def draw_item(index)
item = @data[index]
number = $game_party.item_number(item)
enabled = (item.price <= $game_party.gold && number < item.number_limit)
rect = item_rect(index)
self.contents.clear_rect(rect)
draw_item_name(item, rect.x, rect.y, enabled)
rect.width -= 4
self.contents.draw_text(rect, item.price, 2)
end
end
#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
#==============================================================================
# ■ Scene_Title
#==============================================================================
class Scene_Title < Scene_Base
#--------------------------------------------------------------------------
# ● 数据库的路径
#--------------------------------------------------------------------------
alias load_database_KGC_LimitBreak load_database
def load_database
load_database_KGC_LimitBreak
set_enemy_parameters
end
#--------------------------------------------------------------------------
# ● 战斗测试的数据库的路径
#--------------------------------------------------------------------------
alias load_bt_database_KGC_LimitBreak load_bt_database
def load_bt_database
load_bt_database_KGC_LimitBreak
set_enemy_parameters
end
#--------------------------------------------------------------------------
# ○ 设定敌人的能力值
#--------------------------------------------------------------------------
def set_enemy_parameters
KGC::LimitBreak.revise_enemy_parameters
KGC::LimitBreak.set_enemy_parameters
end
end
#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
#==============================================================================
# ■ Scene_File
#==============================================================================
class Scene_File < Scene_Base
#--------------------------------------------------------------------------
# ● 存档数据读取
# file : 读取存档文件
#--------------------------------------------------------------------------
alias read_save_data_KGC_LimitBreak read_save_data
def read_save_data(file)
read_save_data_KGC_LimitBreak(file)
(1...$data_actors.size).each { |i|
actor = $game_actors[i]
actor.make_exp_list
# 等级上限检查
if actor.level > actor.final_level
while actor.level > actor.final_level
actor.level_down
end
# 反映减少了的 HP 等
actor.change_level(actor.final_level, false)
end
}
end
end
#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
#==============================================================================
# ■ Scene_Shop
#==============================================================================
class Scene_Shop < Scene_Base
#--------------------------------------------------------------------------
# ● 购买物品选择更新
#--------------------------------------------------------------------------
def update_buy_selection
@status_window.item = @buy_window.item
if Input.trigger?(Input::B)
Sound.play_cancel
@command_window.active = true
@dummy_window.visible = true
@buy_window.active = false
@buy_window.visible = false
@status_window.visible = false
@status_window.item = nil
@help_window.set_text("")
return
end
if Input.trigger?(Input::C)
@item = @buy_window.item
number = $game_party.item_number(@item)
if @item == nil || @item.price > $game_party.gold ||
number == @item.number_limit
Sound.play_buzzer
else
Sound.play_decision
max = (@item.price == 0 ?
@item.number_limit : $game_party.gold / @item.price)
max = [max, @item.number_limit - number].min
@buy_window.active = false
@buy_window.visible = false
@number_window.set(@item, max, @item.price)
@number_window.active = true
@number_window.visible = true
end
end
end
end
复制代码
这个是等级的
关于成长曲线,我修改了,但是效果只是好了一点.
作者:
nazx
时间:
2009-1-28 04:16
class Game_Actor < Game_Battler
attr_accessor :last_level
def initialize(actor_id)
super()
setup(actor_id)
@last_level = 0
@last_skill_id = 0
end
def last_atk
return actor.parameters[2,@last_level]
end
def last_def
return actor.parameters[3,@last_level]
end
def last_spi
return actor.parameters[4,@last_level]
end
def last_agi
return actor.parameters[5,@last_level]
end
def now_atk
return actor.parameters[2,@level]
end
def now_def
return actor.parameters[3,@level]
end
def now_spi
return actor.parameters[4,@level]
end
def now_agi
return actor.parameters[5,@level]
end
def change_exp(exp, show)
@last_level = @level
last_skills = skills
@exp = [[exp, 9999999].min, 0].max
while @exp >= @exp_list[@level+1] and @exp_list[@level+1] > 0
level_up
end
while @exp < @exp_list[@level]
level_down
end
@hp = [@hp, maxhp].min
@mp = [@mp, maxmp].min
if show and @level > last_level
zhonglevelup_push(skills - last_skills)
end
end
#==========================================================================
#★角色升级显示
#==========================================================================
def zhonglevelup_push(new_skills)
text = [@actor_id,new_skills]
$game_temp.levelup_texts.push(text)
end
end
class Scene_Battle < Scene_Base
def display_level_up
exp = $game_troop.exp_total
$game_party.remove_states_battle
@message_window.contents_opacity = 0
@message_window.opacity = 0
@levelup_window = Window_zhonglevelup.new
for actor in $game_party.existing_members
last_level = actor.level
last_skills = actor.skills
actor.gain_exp(exp, true)
end
update_zhonglevelup
end
#==========================================================================
#★等待升级窗口刷新
#==========================================================================
def update_zhonglevelup
@levelup_window.update
while @levelup_window.visible
@levelup_window.update
Graphics.update
Input.update
end
end
end
class Game_Temp
attr_accessor :levelup_texts
#--------------------------------------------------------------------------
# ● オブジェクト初期化
#--------------------------------------------------------------------------
alias oldinitialize initialize
def initialize
@levelup_texts = []
oldinitialize
end
end
class Window_zhonglevelup < Window_Base
attr_accessor :index
def initialize
super(122, 15, 350, 345)
$game_temp.levelup_texts = []
@index = 0
@skill_index = 0
@skill_window = Window_Base.new(122,23,260,36)
@skill_window.opacity = 0
@skill_window.z = self.z - 1
@main_window = Window_Base.new(122,59,260,290)
@main_window.opacity = 0
@main_window.z = self.z - 1
self.opacity = 0
self.visible = false
#update
end
#--------------------------------------------------------------------------
# ★ $game_temp.levelup_texts = [角色id,新特技]
#--------------------------------------------------------------------------
def update
zhonginputupdate if @index <= $game_temp.levelup_texts.size-1
if @index <= $game_temp.levelup_texts.size-1
self.visible = true
@main_window.opacity = 150
actor = $game_actors[$game_temp.levelup_texts[@index][0]]
if @skill_index == 0 and $game_temp.levelup_texts[@index][1].size != 0
@skill_index = $game_temp.levelup_texts[@index][1].size
end
level = actor.level
last_level = actor.last_level
atk = actor.now_atk
now_def = actor.now_def
spi = actor.now_spi
agi = actor.now_agi
last_atk = actor.last_atk
last_def = actor.last_def
last_spi = actor.last_spi
last_agi = actor.last_agi
self.contents.clear
# x = 122
# y = 58
@skill_window.opacity = $game_temp.levelup_texts[@index][1].size != 0 ? 150 : 0
skill_name = $game_temp.levelup_texts[@index][1][@skill_index - 1].name if @skill_index != 0
level_name = Vocab::level
atk_name = Vocab::atk
def_name = Vocab::def
spi_name = Vocab::spi
agi_name = Vocab::agi
font = self.contents.font.size
x = 5
y = 165
self.contents.draw_text(x,y,60,60,atk_name)
self.contents.draw_text(x,y+30,60,60,def_name)
self.contents.draw_text(x,y+60,60,60,spi_name)
self.contents.draw_text(x,y+90,60,60,agi_name)
self.contents.draw_text(x + 45,y,60,60, last_atk)
self.contents.draw_text(x + 45,y+30,60,60,last_def)
self.contents.draw_text(x + 45,y+60,60,60,last_spi)
self.contents.draw_text(x + 45,y + 90,60,60,last_agi)
self.contents.draw_text(x,y-30,60,60,level_name)
self.contents.draw_text(x + 45,y-30,60,60,last_level)
self.contents.font.color = Color.new(0,255,0,255)
self.contents.draw_text(x + 105,y-30,60,60,level)
bitmap_5 = Bitmap.new("Graphics/system/箭头")
rect_5 = Rect.new(0,0,bitmap_5.width,bitmap_5.height)
self.contents.blt(x + 70,y - 18,bitmap_5,rect_5)
if atk > last_atk
self.contents.draw_text(x+105,y,60,60,atk)
atk_opacity = 255
else
atk_opacity = 0
end
bitmap_1 = Bitmap.new("Graphics/system/箭头")
rect_1 = Rect.new(0,0,bitmap_1.width,bitmap_1.height)
self.contents.blt(x+70,y+12,bitmap_1,rect_1,atk_opacity)
if now_def > last_def
self.contents.draw_text(x+105,y+30,60,60,now_def)
def_opacity = 255
else
def_opacity = 0
end
bitmap_2 = Bitmap.new("Graphics/system/箭头")
rect_2 = Rect.new(0,0,bitmap_1.width,bitmap_1.height)
self.contents.blt(x+70,y+42,bitmap_1,rect_1,def_opacity)
if spi > last_spi
self.contents.draw_text(x+105,y+60,60,60,spi)
spi_opacity = 255
else
spi_opacity = 0
end
bitmap_3 = Bitmap.new("Graphics/system/箭头")
rect_3 = Rect.new(0,0,bitmap_1.width,bitmap_1.height)
self.contents.blt(x+70,y+72,bitmap_1,rect_1,spi_opacity)
if agi > last_agi
self.contents.draw_text(x + 105,y + 90,60,60,agi)
agi_opacity = 255
else
agi_opacity = 0
end
bitmap_4 = Bitmap.new("Graphics/system/箭头")
rect_4 = Rect.new(0,0,bitmap_1.width,bitmap_1.height)
self.contents.blt(x+70,y+102,bitmap_1,rect_1,agi_opacity)
self.contents.font.color = normal_color
self.contents.font.size = 16
self.contents.draw_text(60, -19, 120, 60,"学会了 #{skill_name}")if @skill_index != 0
self.contents.font.color = Color.new(255,255,0,255)
self.contents.draw_text(61, -19,120,60," #{skill_name}")
self.contents.font.size = font
draw_face(actor.face_name, actor.face_index,3, 55, size = 80)
draw_actor_name(actor, 92, 55)
draw_actor_hp(actor, 95, 85)
draw_actor_mp(actor, 95, 115)
self.contents.font.color = normal_color
actor.hp = [actor.maxhp,9999].min
actor.mp = [actor.maxmp,9999].min
else
@main_window.visible = false
@skill_window.visible =false
self.visible = false
end
end
#==========================================================================
#★窗口按键刷新
#==========================================================================
def zhonginputupdate
if Input.trigger?(Input::DOWN)
if @skill_index != 0
@skill_index -= 1
end
@index += 1 if @skill_index == 0
end
if Input.trigger?(Input::UP)
if @skill_index != 0
@skill_index -= 1
end
@index += 1 if @skill_index == 0
end
if Input.trigger?(Input::RIGHT)
if @skill_index != 0
@skill_index -= 1
end
@index += 1 if @skill_index == 0
end
if Input.trigger?(Input::LEFT)
if @skill_index != 0
@skill_index -= 1
end
@index += 1 if @skill_index == 0
end
if Input.trigger?(Input::B)
if @skill_index != 0
@skill_index -= 1
end
@index += 1 if @skill_index == 0
end
if Input.trigger?(Input::C)
if @skill_index != 0
@skill_index -= 1
end
@index += 1 if @skill_index == 0
end
end
#==========================================================================
def dispose
super
@skill_window.dispose
@main_window.dispose
end
end
class Scene_Map < Scene_Base
def start
super
$game_map.refresh
@spriteset = Spriteset_Map.new
@message_window = Window_Message.new
@levelup_window = Window_zhonglevelup.new
@lus_window = Window_Base.new(122,23,260,36)
@m_window = Window_Base.new(122,59,260,290)
@m_window.opacity = 0
@lus_window.opacity = 0
@m_window.z = 9998
@lus_window.z = 9998
@levelup_window.z = 9999
end
def update
super
$game_map.interpreter.update
$game_map.update
$game_player.update
$game_system.update
@spriteset.update
@message_window.update
unless $game_message.visible
update_levelup_window
update_transfer_player
update_encounter
update_call_menu
update_call_debug
update_scene_change
end
end
def update_levelup_window
@levelup_window.update
while @levelup_window.visible
@lus_window.opacity = $game_temp.levelup_texts[@levelup_window.index][1].size != 0 ? 150 : 0
@m_window.opacity = 150
@levelup_window.update
Graphics.update
Input.update
end
@m_window.opacity = 0
@lus_window.opacity = 0
end
def terminate
super
if $scene.is_a?(Scene_Battle) # バトル画面に切り替え中の場合
@spriteset.dispose_characters # 背景作成のためにキャラを隠す
end
snapshot_for_background
@spriteset.dispose
@message_window.dispose
@levelup_window.dispose
@m_window.dispose
@lus_window.dispose
if $scene.is_a?(Scene_Battle) # バトル画面に切り替え中の場合
perform_battle_transition # 戦闘前トランジション実行
end
end
end
复制代码
这个是升级提升
欢迎光临 Project1 (https://rpg.blue/)
Powered by Discuz! X3.1