Project1
标题: VA的转生系统 [打印本页]
作者: 300英雄 时间: 2017-8-9 10:43
标题: VA的转生系统
本人知道XP有一个转生系统,想问问有没有VA版本的转生系统。
作者: j296196585 时间: 2017-8-9 20:09
本帖最后由 j296196585 于 2017-8-9 20:15 编辑
转生系统VA版
转生设定
状态画面+菜单主界面
转生界面WINDOW
转生界面SCENE
转生核心
#===========================================LX_LEVEL = 50 #达到转生要求的最低等级。
#------------------------------------------------------------------------------
LX_VARIABLE = 200 #储存各角色转生次数的起始变量。比如:设置为 200 ,那么1号角
# 色转生次数储存在 201 号变量,2号角色储存在 202 号变量,,,
#------------------------------------------------------------------------------
LX_N = 10 #转生前,角色的各属性除以设定的这个值,再乘以转生次数,加入
# 到转生后的属性中。这个设定的值越高,加入转生后的属性就越
# 少,反之就越多。
#------------------------------------------------------------------------------
LX_DX = false #转生次数限制,限制写 true 不限制写 false
#------------------------------------------------------------------------------
LX_DX_N = 5 #转生最高次数限制,上面的限制设置写 true 该项才有效。
#------------------------------------------------------------------------------
LX_CLASS = false #转生后是否改变角色职业,是 写入 true 否 写入 false
#------------------------------------------------------------------------------
LX_CLASS_ID = 1 #转生后,角色的职业ID。上面是否改变职业设置写 true
# 该设置才有效。
# 比如转生后,全部转为 1 号职业,从“新手”做起。
#------------------------------------------------------------------------------
LX_EVENT_ID = 1 #转生成功后激活的公共事件ID。公共事件里可设置一些转生成功后
# 播放动画,以及一些提示等。
#------------------------------------------------------------------------------
#~ LEVEL_UP = false #推荐配合使用升级加点系统。如果工程里有升级加点系统
# 请写 true 没有则写 false
#==============================================================================
##转生后角色各属性增加度设置:
#------------------------------------------------------------------------------
#(角色每升一级增加的属性 = 数据库设置的基本值 + 下面设置的增加度 乘以 转生次数)
#(比如设置HP为 10 ,转生 0 次 角色每升一级,角色的HP多增加 0 点;
# 转生 1 次 多增加 10 点;转生 2 次 多增加 20 点,,,,;以此类推。)
#------------------------------------------------------------------------------
LX_EXP = 2 # EXP曲线基础值和增加度。(一般设为 1 — 10)
#------------------------------------------------------------------------------
LX_HP = 10 # HP
#------------------------------------------------------------------------------
LX_SP = 8 # MP
#------------------------------------------------------------------------------
LX_STATE = 1 # 六项基础能力
LX_LEVEL = 50 #达到转生要求的最低等级。
#------------------------------------------------------------------------------
LX_VARIABLE = 200 #储存各角色转生次数的起始变量。比如:设置为 200 ,那么1号角
# 色转生次数储存在 201 号变量,2号角色储存在 202 号变量,,,
#------------------------------------------------------------------------------
LX_N = 10 #转生前,角色的各属性除以设定的这个值,再乘以转生次数,加入
# 到转生后的属性中。这个设定的值越高,加入转生后的属性就越
# 少,反之就越多。
#------------------------------------------------------------------------------
LX_DX = false #转生次数限制,限制写 true 不限制写 false
#------------------------------------------------------------------------------
LX_DX_N = 5 #转生最高次数限制,上面的限制设置写 true 该项才有效。
#------------------------------------------------------------------------------
LX_CLASS = false #转生后是否改变角色职业,是 写入 true 否 写入 false
#------------------------------------------------------------------------------
LX_CLASS_ID = 1 #转生后,角色的职业ID。上面是否改变职业设置写 true
# 该设置才有效。
# 比如转生后,全部转为 1 号职业,从“新手”做起。
#------------------------------------------------------------------------------
LX_EVENT_ID = 1 #转生成功后激活的公共事件ID。公共事件里可设置一些转生成功后
# 播放动画,以及一些提示等。
#------------------------------------------------------------------------------
#~ LEVEL_UP = false #推荐配合使用升级加点系统。如果工程里有升级加点系统
# 请写 true 没有则写 false
#==============================================================================
##转生后角色各属性增加度设置:
#------------------------------------------------------------------------------
#(角色每升一级增加的属性 = 数据库设置的基本值 + 下面设置的增加度 乘以 转生次数)
#(比如设置HP为 10 ,转生 0 次 角色每升一级,角色的HP多增加 0 点;
# 转生 1 次 多增加 10 点;转生 2 次 多增加 20 点,,,,;以此类推。)
#------------------------------------------------------------------------------
LX_EXP = 2 # EXP曲线基础值和增加度。(一般设为 1 — 10)
#------------------------------------------------------------------------------
LX_HP = 10 # HP
#------------------------------------------------------------------------------
LX_SP = 8 # MP
#------------------------------------------------------------------------------
LX_STATE = 1 # 六项基础能力
===================================
# ★ 【角色转生系统】★
#------------------------------------------------------------------------------
# ☆ 原作者 by 芯☆淡茹水
# ☆ VA版移植 by 魔法丶小肉包
#==============================================================================
#◆ 使用方法:
# 复制该脚本,插入到 Main 前。
# 召唤转生系统的方法:事件 → 脚本 写入 SceneManager.call(Scene_Lx)
#===============================================================================
#◆ 说明:
# 和一些网游的转生类似。角色随着转生次数的增加,各种属性(hp,sp,力量,
# 灵巧,,,等)的初始值会越来越高,而每升一级增加的属性也会越来越多。
# (注意:数据库各角色的初始等级都设置为 1 级。)
#
# 由于手动设置的项目较多,在使用前,请先仔细阅读并设置下面的设置项。
#
#===============================================================================
#VA版说明补充:
#1.适用于加点系统的LEVEL_UP功能取消(懒...)当然需要的话可以加上去
作者: j296196585 时间: 2017-8-9 20:11
class Window_Base < Window
def draw_actor_xdrs_lx(actor, x, y)
self.contents.font.color = text_color(3)
draw_text(x + 4, y, 120, 32, "轮回次数:")
i = actor.id + LX_VARIABLE
self.contents.font.color = text_color(6)
draw_text(x + 126, y, 80, 32, $game_variables[i].to_s)
end
end
class Window_MenuStatus < Window_Selectable
def draw_item(index)
actor = $game_party.members[index]
enabled = $game_party.battle_members.include?(actor)
rect = item_rect(index)
draw_item_background(index)
draw_actor_face(actor, rect.x + 1, rect.y + 1, enabled)
draw_actor_simple_status(actor, rect.x + 108, rect.y + line_height / 2)
draw_actor_xdrs_lx(actor, rect.x + 98, rect.y+60)
end
end
class Window_Status < Window_Selectable
def draw_block1(y)
draw_actor_name(@actor, 4, y)
draw_actor_class(@actor, 128, y)
draw_actor_nickname(@actor, 268, y)
draw_actor_xdrs_lx(@actor, 380, y)
end
end
#encoding:utf-8
#==============================================================================
# ■ Window_Help1
#------------------------------------------------------------------------------
# 显示特技和物品等的说明、以及角色状态的窗口
#==============================================================================
class Window_Help1 < Window_Base
#--------------------------------------------------------------------------
# ● 初始化对象
#--------------------------------------------------------------------------
def initialize(line_number = 2)
super(0, 0, Graphics.width, fitting_height(line_number))
end
#--------------------------------------------------------------------------
# ● 设置内容
#--------------------------------------------------------------------------
def set_text(text)
if text != @text
@text = text
refresh
end
end
#--------------------------------------------------------------------------
# ● 清除
#--------------------------------------------------------------------------
def clear
set_text("")
end
#--------------------------------------------------------------------------
# ● 设置物品
# item : 技能、物品等
#--------------------------------------------------------------------------
def set_item(item)
set_text(item ? item.description : "")
end
#--------------------------------------------------------------------------
# ● 刷新
#--------------------------------------------------------------------------
def refresh
contents.clear
draw_text_ex(4, 0, @text)
end
end
class Window_Base < Window
def draw_actor_xdrs_lx(actor, x, y)
self.contents.font.color = text_color(3)
draw_text(x + 4, y, 120, 32, "轮回次数:")
i = actor.id + LX_VARIABLE
self.contents.font.color = text_color(6)
draw_text(x + 126, y, 80, 32, $game_variables[i].to_s)
end
end
class Window_MenuStatus < Window_Selectable
def draw_item(index)
actor = $game_party.members[index]
enabled = $game_party.battle_members.include?(actor)
rect = item_rect(index)
draw_item_background(index)
draw_actor_face(actor, rect.x + 1, rect.y + 1, enabled)
draw_actor_simple_status(actor, rect.x + 108, rect.y + line_height / 2)
draw_actor_xdrs_lx(actor, rect.x + 98, rect.y+60)
end
end
class Window_Status < Window_Selectable
def draw_block1(y)
draw_actor_name(@actor, 4, y)
draw_actor_class(@actor, 128, y)
draw_actor_nickname(@actor, 268, y)
draw_actor_xdrs_lx(@actor, 380, y)
end
end
#encoding:utf-8
#==============================================================================
# ■ Window_Help1
#------------------------------------------------------------------------------
# 显示特技和物品等的说明、以及角色状态的窗口
#==============================================================================
class Window_Help1 < Window_Base
#--------------------------------------------------------------------------
# ● 初始化对象
#--------------------------------------------------------------------------
def initialize(line_number = 2)
super(0, 0, Graphics.width, fitting_height(line_number))
end
#--------------------------------------------------------------------------
# ● 设置内容
#--------------------------------------------------------------------------
def set_text(text)
if text != @text
@text = text
refresh
end
end
#--------------------------------------------------------------------------
# ● 清除
#--------------------------------------------------------------------------
def clear
set_text("")
end
#--------------------------------------------------------------------------
# ● 设置物品
# item : 技能、物品等
#--------------------------------------------------------------------------
def set_item(item)
set_text(item ? item.description : "")
end
#--------------------------------------------------------------------------
# ● 刷新
#--------------------------------------------------------------------------
def refresh
contents.clear
draw_text_ex(4, 0, @text)
end
end
作者: j296196585 时间: 2017-8-9 20:12
class Window_LxStatus < Window_Base
attr_reader :selected
def initialize(height, i)
super(0, i * height, Graphics.width, height)
@index = i
refresh
@selected = false
end
def refresh
contents.clear
change_color(normal_color)
actor = $game_party.members[@index]
draw_actor_xdrs_lx(actor, x + 130, 56)
draw_actor_graphic(actor, x + 35, 80)
draw_actor_name(actor, x, 0)
draw_actor_class(actor, x + 134, 28)
draw_actor_level(actor, x + 134, 0)
draw_actor_hp(actor, x + 300, 0 )
draw_actor_mp(actor, x + 300, 26)
end
def draw_current_and_max_values(x, y, width, current, max, color1, color2)
change_color(color1)
xr = x + width
if width < 96
draw_text(xr - 40, y, 42, line_height, current, 2)
else
draw_text(xr - 92, y, 42, line_height, current, 2)
change_color(color2)
draw_text(xr - 52, y, 12, line_height, "/", 2)
draw_text(xr - 42, y, 42, line_height, max, 2)
end
end
def selected=(selected)
@selected = selected
update_cursor
end
def update_cursor
if @selected
cursor_rect.set(0, 0, Graphics.width, height)
else
cursor_rect.empty
end
end
end
class Window_xz < Window_Command
def make_command_list
add_command("是", :ok)
add_command("否", :cancel)
end
end
class Window_LxStatus < Window_Base
attr_reader :selected
def initialize(height, i)
super(0, i * height, Graphics.width, height)
@index = i
refresh
@selected = false
end
def refresh
contents.clear
change_color(normal_color)
actor = $game_party.members[@index]
draw_actor_xdrs_lx(actor, x + 130, 56)
draw_actor_graphic(actor, x + 35, 80)
draw_actor_name(actor, x, 0)
draw_actor_class(actor, x + 134, 28)
draw_actor_level(actor, x + 134, 0)
draw_actor_hp(actor, x + 300, 0 )
draw_actor_mp(actor, x + 300, 26)
end
def draw_current_and_max_values(x, y, width, current, max, color1, color2)
change_color(color1)
xr = x + width
if width < 96
draw_text(xr - 40, y, 42, line_height, current, 2)
else
draw_text(xr - 92, y, 42, line_height, current, 2)
change_color(color2)
draw_text(xr - 52, y, 12, line_height, "/", 2)
draw_text(xr - 42, y, 42, line_height, max, 2)
end
end
def selected=(selected)
@selected = selected
update_cursor
end
def update_cursor
if @selected
cursor_rect.set(0, 0, Graphics.width, height)
else
cursor_rect.empty
end
end
end
class Window_xz < Window_Command
def make_command_list
add_command("是", :ok)
add_command("否", :cancel)
end
end
作者: j296196585 时间: 2017-8-9 20:12
class Scene_Lx < Scene_MenuBase
def start
super
create_help_window
create_lx_viewport
create_lx_windows
init_selection
end
def terminate
super
@lx_viewport.dispose
@lx_windows.each {|window| window.dispose }
end
def update
super
@lx_windows.each {|window| window.update }
update_lx_selection
end
def create_help_window
@help_window = Window_Help1.new(1)
@help_window.set_text("★请选择要轮回的角色★")
end
def create_lx_viewport
@lx_viewport = Viewport.new
@lx_viewport.rect.y = @help_window.height
@lx_viewport.rect.height -= @help_window.height
end
def create_lx_windows
@lx_windows = Array.new(item_max) do |i|
Window_LxStatus.new(lx_height, i)
end
@lx_windows.each {|window| window.viewport = @lx_viewport }
end
def init_selection
@index = first_lx_index
@lx_windows[@index].selected = true
self.top_index = @index - visible_max / 2
ensure_cursor_visible
end
def item_max
$game_party.all_members.size
end
def visible_max
return 4
end
def lx_height
@lx_viewport.rect.height / visible_max
end
def first_lx_index
return 0
end
def index
@index
end
def top_index
@lx_viewport.oy / lx_height
end
def top_index=(index)
index = 0 if index < 0
index = item_max - visible_max if index > item_max - visible_max
@lx_viewport.oy = index * lx_height
end
def bottom_index
top_index + visible_max - 1
end
def bottom_index=(index)
self.top_index = index - (visible_max - 1)
end
def update_lx_selection
return on_lx_ok if Input.trigger?(:C)
return on_lx_cancel if Input.trigger?(:B)
update_cursor
end
def on_lx_ok
level = $game_party.members[index].level
if level >= LX_LEVEL
if LX_DX == true
i = $game_party.members[index].id
if $game_variables[i + LX_VARIABLE] < LX_DX_N
@xz = Window_xz.new(100,200)
@xz.x = 100
@xz.y = 400
@xz.set_handler(:ok, method(:c_ok))
@xz.set_handler(:cancel, method(:c_cancel))
else
@help_window.set_text("已达轮回次数上限!")
end
else
@xz = Window_xz.new(100,200)
@xz.x = 100
@xz.y = 200
@xz.set_handler(:ok, method(:c_ok))
@xz.set_handler(:cancel, method(:c_cancel))
end
else
text = LX_LEVEL.to_s
text += "级后才能轮回!"
@help_window.set_text(text)
end
return
end
def on_lx_cancel
Sound.play_cancel
return_scene
end
def c_ok
actor = $game_party.members[index]
i = actor.id
v = LX_VARIABLE + i
n = $game_variables[v] + 1
hp = actor.mhp/LX_N * n
sp = actor.mmp/LX_N * n
atk = actor.atk/LX_N * n
de = actor.def/LX_N * n
mat = actor.mat/LX_N * n
mdf = actor.mdf/LX_N * n
agi = actor.agi/LX_N * n
luk = actor.luk/LX_N * n
$game_actors[i].setup(i)
if LX_CLASS == true
actor.class_id = LX_CLASS_ID
end
actor.add_param(0,hp)
actor.add_param(1,sp)
actor.add_param(2,atk)
actor.add_param(3,de)
actor.add_param(4,mat)
actor.add_param(5,mdf)
actor.add_param(6,agi)
actor.add_param(7,luk)
$game_variables[v] += 1
actor.recover_all
$data_common_events[LX_EVENT_ID]
return_scene
end
def c_cancel
@xz.hide
end
def update_cursor
last_index = @index
cursor_down (Input.trigger?(:DOWN)) if Input.repeat?(:DOWN)
cursor_up (Input.trigger?(:UP)) if Input.repeat?(:UP)
cursor_pagedown if Input.trigger?(:R)
cursor_pageup if Input.trigger?(:L)
if @index != last_index
Sound.play_cursor
@lx_windows[last_index].selected = false
@lx_windows[@index].selected = true
end
end
def cursor_down(wrap)
@index = (@index + 1) % item_max if @index < item_max - 1 || wrap
ensure_cursor_visible
end
def cursor_up(wrap)
@index = (@index - 1 + item_max) % item_max if @index > 0 || wrap
ensure_cursor_visible
end
def cursor_pagedown
if top_index + visible_max < item_max
self.top_index += visible_max
@index = [@index + visible_max, item_max - 1].min
end
end
def cursor_pageup
if top_index > 0
self.top_index -= visible_max
@index = [@index - visible_max, 0].max
end
end
def ensure_cursor_visible
self.top_index = index if index < top_index
self.bottom_index = index if index > bottom_index
end
end
class Scene_Lx < Scene_MenuBase
def start
super
create_help_window
create_lx_viewport
create_lx_windows
init_selection
end
def terminate
super
@lx_viewport.dispose
@lx_windows.each {|window| window.dispose }
end
def update
super
@lx_windows.each {|window| window.update }
update_lx_selection
end
def create_help_window
@help_window = Window_Help1.new(1)
@help_window.set_text("★请选择要轮回的角色★")
end
def create_lx_viewport
@lx_viewport = Viewport.new
@lx_viewport.rect.y = @help_window.height
@lx_viewport.rect.height -= @help_window.height
end
def create_lx_windows
@lx_windows = Array.new(item_max) do |i|
Window_LxStatus.new(lx_height, i)
end
@lx_windows.each {|window| window.viewport = @lx_viewport }
end
def init_selection
@index = first_lx_index
@lx_windows[@index].selected = true
self.top_index = @index - visible_max / 2
ensure_cursor_visible
end
def item_max
$game_party.all_members.size
end
def visible_max
return 4
end
def lx_height
@lx_viewport.rect.height / visible_max
end
def first_lx_index
return 0
end
def index
@index
end
def top_index
@lx_viewport.oy / lx_height
end
def top_index=(index)
index = 0 if index < 0
index = item_max - visible_max if index > item_max - visible_max
@lx_viewport.oy = index * lx_height
end
def bottom_index
top_index + visible_max - 1
end
def bottom_index=(index)
self.top_index = index - (visible_max - 1)
end
def update_lx_selection
return on_lx_ok if Input.trigger?(:C)
return on_lx_cancel if Input.trigger?(:B)
update_cursor
end
def on_lx_ok
level = $game_party.members[index].level
if level >= LX_LEVEL
if LX_DX == true
i = $game_party.members[index].id
if $game_variables[i + LX_VARIABLE] < LX_DX_N
@xz = Window_xz.new(100,200)
@xz.x = 100
@xz.y = 400
@xz.set_handler(:ok, method(:c_ok))
@xz.set_handler(:cancel, method(:c_cancel))
else
@help_window.set_text("已达轮回次数上限!")
end
else
@xz = Window_xz.new(100,200)
@xz.x = 100
@xz.y = 200
@xz.set_handler(:ok, method(:c_ok))
@xz.set_handler(:cancel, method(:c_cancel))
end
else
text = LX_LEVEL.to_s
text += "级后才能轮回!"
@help_window.set_text(text)
end
return
end
def on_lx_cancel
Sound.play_cancel
return_scene
end
def c_ok
actor = $game_party.members[index]
i = actor.id
v = LX_VARIABLE + i
n = $game_variables[v] + 1
hp = actor.mhp/LX_N * n
sp = actor.mmp/LX_N * n
atk = actor.atk/LX_N * n
de = actor.def/LX_N * n
mat = actor.mat/LX_N * n
mdf = actor.mdf/LX_N * n
agi = actor.agi/LX_N * n
luk = actor.luk/LX_N * n
$game_actors[i].setup(i)
if LX_CLASS == true
actor.class_id = LX_CLASS_ID
end
actor.add_param(0,hp)
actor.add_param(1,sp)
actor.add_param(2,atk)
actor.add_param(3,de)
actor.add_param(4,mat)
actor.add_param(5,mdf)
actor.add_param(6,agi)
actor.add_param(7,luk)
$game_variables[v] += 1
actor.recover_all
$data_common_events[LX_EVENT_ID]
return_scene
end
def c_cancel
@xz.hide
end
def update_cursor
last_index = @index
cursor_down (Input.trigger?(:DOWN)) if Input.repeat?(:DOWN)
cursor_up (Input.trigger?(:UP)) if Input.repeat?(:UP)
cursor_pagedown if Input.trigger?(:R)
cursor_pageup if Input.trigger?(:L)
if @index != last_index
Sound.play_cursor
@lx_windows[last_index].selected = false
@lx_windows[@index].selected = true
end
end
def cursor_down(wrap)
@index = (@index + 1) % item_max if @index < item_max - 1 || wrap
ensure_cursor_visible
end
def cursor_up(wrap)
@index = (@index - 1 + item_max) % item_max if @index > 0 || wrap
ensure_cursor_visible
end
def cursor_pagedown
if top_index + visible_max < item_max
self.top_index += visible_max
@index = [@index + visible_max, item_max - 1].min
end
end
def cursor_pageup
if top_index > 0
self.top_index -= visible_max
@index = [@index - visible_max, 0].max
end
end
def ensure_cursor_visible
self.top_index = index if index < top_index
self.bottom_index = index if index > bottom_index
end
end
作者: j296196585 时间: 2017-8-9 20:12
- class RPG::Class < RPG::BaseItem
- def initialize
- super
- @exp_params = [30,20,30,30]
- @params = Table.new(8,100)
- (1..99).each do |i|
- @params[0,i] = 400+i*50#+LX_HP * $game_variables[LX_VARIABLE+id]
- @params[1,i] = 80+i*10
- (2..5).each {|j| @params[j,i] = 15+i*5/4 }
- (6..7).each {|j| @params[j,i] = 30+i*5/2 }
- end
- @learnings = []
- @features.push(RPG::BaseItem::Feature.new(23, 0, 1))
- @features.push(RPG::BaseItem::Feature.new(22, 0, 0.95))
- @features.push(RPG::BaseItem::Feature.new(22, 1, 0.05))
- @features.push(RPG::BaseItem::Feature.new(22, 2, 0.04))
- @features.push(RPG::BaseItem::Feature.new(41, 1))
- @features.push(RPG::BaseItem::Feature.new(51, 1))
- @features.push(RPG::BaseItem::Feature.new(52, 1))
- end
- def exp_for_level(level)
- lv = level.to_f
- lx = LX_EXP * $game_variables[LX_VARIABLE+id]
- basis = @exp_params[0].to_f+lx
- extra = @exp_params[1].to_f+lx
- acc_a = @exp_params[2].to_f+lx
- acc_b = @exp_params[3].to_f+lx
- return (basis*((lv-1)**(0.9+acc_a/250))*lv*(lv+1)/
- (6+lv**2/50/acc_b)+(lv-1)*extra).round.to_i
- end
- attr_accessor :exp_params
- attr_accessor :params
- attr_accessor :learnings
- end
复制代码
作者: 300英雄 时间: 2017-8-9 20:15
先说声多谢,但是身上没有好人卡。(抱歉了)
作者: j296196585 时间: 2017-8-9 20:22
复制的时候已经知道怕你出错 已经一楼 一个顺序 排列好了
-
360截图20170809202331464.jpg
(101.44 KB, 下载次数: 2)
欢迎光临 Project1 (https://rpg.blue/) |
Powered by Discuz! X3.1 |