def generate_status_curve
# 第一个角色能力基数(即初始值,等级 1 时就是 这里的基数 * 指数)
$data_actors[1].parameters[0,0] = 500 # hp
$data_actors[1].parameters[1,0] = 500 # sp
$data_actors[1].parameters[2,0] = 50 # 力量
$data_actors[1].parameters[3,0] = 50 # 灵巧
$data_actors[1].parameters[4,0] = 50 # 速度
$data_actors[1].parameters[5,0] = 50 # 魔力
# 第一个角色能力的指数性成长
for j in 1..99
actor = $data_actors[1]
for i in 0..5
# 直接计算乘方的话速度很慢,所以这里是通过数列中前一个数 * 1.2 计算
actor.parameters[i,j] = (actor.parameters[i,j - 1] * 1.2).round
end
end
# 第二个角色能力基数
$data_actors[2].parameters[0,0] = 500 # hp
$data_actors[2].parameters[1,0] = 500 # sp
$data_actors[2].parameters[2,0] = 50 # 力量
$data_actors[2].parameters[3,0] = 50 # 灵巧
$data_actors[2].parameters[4,0] = 50 # 速度
$data_actors[2].parameters[5,0] = 50 # 魔力
# 第一个角色能力的指数性成长
for j in 1..99
actor = $data_actors[2]
for i in 0..5
actor.parameters[i,j] = (actor.parameters[i,j - 1] * 1.2).round
end
end
# ........
# ........
# 以此类推,分别给不同的角色设置不同的曲线
end
class Scene_Title
#--------------------------------------------------------------------------
# ● 住处理
#--------------------------------------------------------------------------
def main
# 战斗测试的情况下
if $BTEST
battle_test
return
end
# 载入数据库
$data_actors = load_data("Data/Actors.rxdata")
$data_classes = load_data("Data/Classes.rxdata")
$data_skills = load_data("Data/Skills.rxdata")
$data_items = load_data("Data/Items.rxdata")
$data_weapons = load_data("Data/Weapons.rxdata")
$data_armors = load_data("Data/Armors.rxdata")
$data_enemies = load_data("Data/Enemies.rxdata")
$data_troops = load_data("Data/Troops.rxdata")
$data_states = load_data("Data/States.rxdata")
$data_animations = load_data("Data/Animations.rxdata")
$data_tilesets = load_data("Data/Tilesets.rxdata")
$data_common_events = load_data("Data/CommonEvents.rxdata")
$data_system = load_data("Data/System.rxdata")
generate_status_curve
# 生成系统对像
$game_system = Game_System.new
# 生成标题图形
@sprite = Sprite.new
@sprite.bitmap = RPG::Cache.title($data_system.title_name)
# 生成命令窗口
s1 = "新游戏"
s2 = "继续"
s3 = "退出"
@command_window = Window_Command.new(192, [s1, s2, s3])
@command_window.back_opacity = 160
@command_window.x = 320 - @command_window.width / 2
@command_window.y = 288
# 判定继续的有效性
# 存档文件一个也不存在的时候也调查
# 有効为 @continue_enabled 为 true、無効为 false
@continue_enabled = false
for i in 0..3
if FileTest.exist?("Save#{i+1}.rxdata")
@continue_enabled = true
end
end
# 继续为有效的情况下、光标停止在继续上
# 无效的情况下、继续的文字显示为灰色
if @continue_enabled
@command_window.index = 1
else
@command_window.disable_item(1)
end
# 演奏标题 BGM
$game_system.bgm_play($data_system.title_bgm)
# 停止演奏 ME、BGS
Audio.me_stop
Audio.bgs_stop
# 执行过渡
Graphics.transition
# 主循环
loop do
# 刷新游戏画面
Graphics.update
# 刷新输入信息
Input.update
# 刷新画面
update
# 如果画面被切换就中断循环
if $scene != self
break
end
end
# 装备过渡
Graphics.freeze
# 释放命令窗口
@command_window.dispose
# 释放标题图形
@sprite.bitmap.dispose
@sprite.dispose
end
end
欢迎光临 Project1 (https://rpg.blue/) | Powered by Discuz! X3.1 |