赞 | 0 |
VIP | 0 |
好人卡 | 0 |
积分 | 1 |
经验 | 5330 |
最后登录 | 2022-10-12 |
在线时间 | 297 小时 |
Lv1.梦旅人 太后老佛爷
- 梦石
- 0
- 星屑
- 90
- 在线时间
- 297 小时
- 注册时间
- 2007-1-13
- 帖子
- 1912
|
3楼
楼主 |
发表于 2008-2-9 06:51:28
|
只看该作者
class Game_Skill
# 每个技能升级的经验
# 技能ID => [升到1级需要的经验, .....]
SKILL_EXP = {
1 => [40,60,80,120,200,280,350,500,800,1000],
2 => [35,45,78,110,150,200,280,400,600,800],
3 => [35,45,78,110,150,200,280,400,600,800],
4 => [35,45,78,110,150,200,280,400,600,800],
5 => [35,45,78,110,150,200,280,400,600,800],
6 => [35,45,78,110,150,200,280,400,600,800],
7 => [35,45,78,110,150,200,280,400,600,800],
8 => [35,45,78,110,150,200,280,400,600,800],
9 => [35,45,78,110,150,200,280,400,600,800],
10 => [35,45,78,110,150,200,280,400,600,800],
11 => [35,45,78,110,150,200,280,400,600,800],
12 => [35,45,78,110,150,200,280,400,600,800],
13 => [35,45,78,110,150,200,280,400,600,800],
14 => [35,45,78,110,150,200,280,400,600,800],
15 => [35,45,78,110,150,200,280,400,600,800],
16 => [35,45,78,110,150,200,280,400,600,800],
}
#--------------------------------------------------------------------------
# ● 定义实例变量
#--------------------------------------------------------------------------
attr_accessor :id
attr_accessor :name
attr_accessor :icon_name
attr_accessor :description
attr_accessor :scope
attr_accessor :occasion
attr_accessor :animation1_id
attr_accessor :animation2_id
attr_accessor :menu_se
attr_accessor :common_event_id
attr_accessor :sp_cost
attr_accessor :power
attr_accessor :atk_f
attr_accessor :eva_f
attr_accessor :str_f
attr_accessor :dex_f
attr_accessor :agi_f
attr_accessor :int_f
attr_accessor :hit
attr_accessor :pdef_f
attr_accessor :mdef_f
attr_accessor :variance
attr_accessor :element_set
attr_accessor :plus_state_set
attr_accessor :minus_state_set
attr_accessor :exp
attr_accessor :level
attr_accessor :dop?
attr_accessor :time
attr_accessor :rang
#--------------------------------------------------------------------------
# ● 初始化对像
# skill_id : 特技 ID
#--------------------------------------------------------------------------
def initialize(skill_id)
super()
setup(skill_id)
end
#--------------------------------------------------------------------------
# ● 设置
# skill_id : 特技 ID
#--------------------------------------------------------------------------
def setup(skill_id)
skill = $data_skills[skill_id]
@id = skill.id
@name = skill.name
@icon_name = skill.icon_name
@description = skill.description
@scope = skill.scope
@occasion = skill.occasion
@animation1_id = skill.animation1_id
@animation2_id = skill.animation2_id
@menu_se = skill.menu_se
@common_event_id = skill.common_event_id
@sp_cost = skill.sp_cost
@power = skill.power
@atk_f = skill.atk_f
@eva_f = skill.eva_f
@str_f = skill.str_f
@dex_f = skill.dex_f
@agi_f = skill.agi_f
@int_f = skill.int_f
@hit = skill.hit
@pdef_f = skill.pdef_f
@mdef_f = skill.mdef_f
@variance = skill.variance
@element_set = skill.element_set
@plus_state_set = skill.plus_state_set
@minus_state_set = skill.minus_state_set
@time = skill.time
@rang = skill.rang
@exp = 0
@level = 0
@dop = skill.dop?
end
def power
return @power.to_i
end
def sp_cost
return @sp_cost.to_i
end
def dop?
return @dop
end
def level_exp(level)
return SKILL_EXP[@id][@level]
end
def exp=(val)
return if @level >= 9
@exp = val
if @exp > SKILL_EXP[@id][@level]
@level += 1
@exp = 0
@power *= 1.5
@sp_cost *= 1.5
up_rate = 1.3
if @plus_state_set.size > 0
if $data_states[@plus_state_set[0]].maxhp_rate > 100
$data_states[@plus_state_set[0]].maxhp_rate *= up_rate
end
if $data_states[@plus_state_set[0]].maxsp_rate > 100
$data_states[@plus_state_set[0]].maxsp_rate *= up_rate
end
if $data_states[@plus_state_set[0]].str_rate > 100
$data_states[@plus_state_set[0]].str_rate *= up_rate
end
if $data_states[@plus_state_set[0]].dex_rate > 100
$data_states[@plus_state_set[0]].dex_rate *= up_rate
end
if $data_states[@plus_state_set[0]].agi_rate > 100
$data_states[@plus_state_set[0]].int_rate *= up_rate
end
if $data_states[@plus_state_set[0]].int_rate > 100
$data_states[@plus_state_set[0]].int_rate *= up_rate
end
if $data_states[@plus_state_set[0]].atk_rate > 100
$data_states[@plus_state_set[0]].atk_rate *= up_rate
end
if $data_states[@plus_state_set[0]].pdef_rate > 100
$data_states[@plus_state_set[0]].pdef_rate *= up_rate
end
if $data_states[@plus_state_set[0]].mdef_rate > 100
$data_states[@plus_state_set[0]].mdef_rate *= up_rate
end
if $data_states[@plus_state_set[0]].eva > 100
$data_states[@plus_state_set[0]].eva *= up_rate
end
$data_states[@plus_state_set[0]].hold_turn *= up_rate
end
Mess_Text.write("#{@name}等级提升")
$refresh["skill"] = true
end
end
def exp
return @exp
end
end
并没有特殊的操作 |
|