赞 | 5 |
VIP | 620 |
好人卡 | 38 |
积分 | 69 |
经验 | 125468 |
最后登录 | 2015-7-27 |
在线时间 | 1666 小时 |
Lv4.逐梦者
- 梦石
- 0
- 星屑
- 6860
- 在线时间
- 1666 小时
- 注册时间
- 2008-10-29
- 帖子
- 6710
|
本帖最后由 后知后觉 于 2011-4-8 11:25 编辑
注意看我在开头加的说明.还有就是我没有测试.- #==============================================================================
- # 本脚本来自http://www.66rpg.com/,使用和转载请保留此信息
- #==============================================================================
- class Game_Battler
- # 补充说明 by 后知后觉
- # 使用这个脚本会忽略数据库角色的6项属性曲线
- # 实际上使用的是 属性曲线中的1级和2级的值
- # 计算公式是:该属性1级的数值 + 该属性2级的值 * 该角色当前等级
- BASE_VARIABLES_ID = 1000 #设置变量基础ID 角色的最高等级可以用变量设置
- #角色的最高等级的变量id是 设置的这个基础id+角色id
- #不过变量的值超过了下面设置的最高等级的话
- #会自动修正为下面设置的值
- # 以上常量由 后知后觉 添加.用于使用对应的变量来设置角色的最高等级
- # 而下面的这个 BASE_FINAL_LEVEL 是整个游戏的终极等级
- # 对应变量的值超过他就被自动修正为他
- BASE_FINAL_LEVEL = 200 #等级上限
- MAXHP_LIMIT = 999999999 #HP上限
- MAXSP_LIMIT = 999999999 #SP上限
- STR_LIMIT = 9999999 #力量上限
- DEX_LIMIT = 9999999 #灵巧上限
- AGI_LIMIT = 9999999 #敏捷上限
- INT_LIMIT = 9999999 #智力上限
- end
- class Game_Actor < Game_Battler
- def new_final_level
- if $game_variables[BASE_VARIABLES_ID + @actor_id].nil? or
- $game_variables[BASE_VARIABLES_ID + @actor_id] <= 0 or
- $game_variables[BASE_VARIABLES_ID + @actor_id] > BASE_FINAL_LEVEL
- return [BASE_FINAL_LEVEL, 1].max
- end
- return $game_variables[BASE_VARIABLES_ID + @actor_id]
- end
- #--------------------------------------------------------------------------
- # ● EXP 计算
- #--------------------------------------------------------------------------
- def make_exp_list
- actor = $data_actors[@actor_id]
- @exp_list = Array.new(BASE_FINAL_LEVEL + 2)
- @exp_list[1] = 0
- pow_i = 2.4 + actor.exp_inflation / 100.0
- for i in 2..BASE_FINAL_LEVEL + 1
- if i > BASE_FINAL_LEVEL
- @exp_list[i] = 0
- else
- n = actor.exp_basis * ((i + 3) ** pow_i) / (5 ** pow_i)
- @exp_list[i] = @exp_list[i-1] + Integer(n)
- end
- end
- end
- #--------------------------------------------------------------------------
- # ● MaxHP の取得
- #--------------------------------------------------------------------------
- def maxhp
- n = [[base_maxhp + @maxhp_plus, 1].max, MAXHP_LIMIT].min
- for i in @states
- n *= $data_states[i].maxhp_rate / 100.0
- end
- n = [[Integer(n), 1].max, MAXHP_LIMIT].min
- return n
- end
- #--------------------------------------------------------------------------
- # ● 基本 MaxHP の取得
- #--------------------------------------------------------------------------
- def base_maxhp
- n = $data_actors[@actor_id].parameters[0, 1]
- n += $data_actors[@actor_id].parameters[0, 2] * @level
- return n
- end
- #--------------------------------------------------------------------------
- # ● 基本 MaxSP の取得
- #--------------------------------------------------------------------------
- def base_maxsp
- n = $data_actors[@actor_id].parameters[1, 1]
- n += $data_actors[@actor_id].parameters[1, 2] * @level
- return n
- end
- #--------------------------------------------------------------------------
- # ● 基本腕力の取得
- #--------------------------------------------------------------------------
- def base_str
- n = $data_actors[@actor_id].parameters[2, 1]
- n += $data_actors[@actor_id].parameters[2, 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
- return [[n, 1].max, STR_LIMIT].min
- end
- #--------------------------------------------------------------------------
- # ● 基本器用さの取得
- #--------------------------------------------------------------------------
- def base_dex
- n = $data_actors[@actor_id].parameters[3, 1]
- n += $data_actors[@actor_id].parameters[3, 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.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
- return [[n, 1].max, DEX_LIMIT].min
- end
- #--------------------------------------------------------------------------
- # ● 基本素早さの取得
- #--------------------------------------------------------------------------
- def base_agi
- n = $data_actors[@actor_id].parameters[4, 1]
- n += $data_actors[@actor_id].parameters[4, 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.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
- return [[n, 1].max, AGI_LIMIT].min
- end
- #--------------------------------------------------------------------------
- # ● 基本魔力の取得
- #--------------------------------------------------------------------------
- def base_int
- n = $data_actors[@actor_id].parameters[5, 1]
- n += $data_actors[@actor_id].parameters[5, 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.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
- return [[n, 1].max, INT_LIMIT].min
- end
- #--------------------------------------------------------------------------
- # ● EXP の変更
- # exp : 新しい EXP
- #--------------------------------------------------------------------------
- def exp=(exp)
- return if @level == new_final_level
- @exp = [exp, 0].max
- while @exp >= @exp_list[@level+1] and @level + 1 <= new_final_level
- @level += 1
- for j in $data_classes[@class_id].learnings
- if j.level == @level
- learn_skill(j.skill_id)
- end
- end
- end
- while @exp < @exp_list[@level]
- @level -= 1
- end
- @hp = [@hp, self.maxhp].min
- @sp = [@sp, self.maxsp].min
- end
- #--------------------------------------------------------------------------
- # ● レベルの変更
- # level : 新しいレベル
- #--------------------------------------------------------------------------
- def level=(level)
- level = [[level, new_final_level].min, 1].max
- self.exp = @exp_list[level]
- end
- end
-
-
- class Game_Battler
- #--------------------------------------------------------------------------
- # ● MaxSP の取得
- #--------------------------------------------------------------------------
- def maxsp
- n = [[base_maxsp + @maxsp_plus, 0].max, MAXSP_LIMIT].min
- for i in @states
- n *= $data_states[i].maxsp_rate / 100.0
- end
- n = [[Integer(n), 0].max, MAXSP_LIMIT].min
- return n
- end
- #--------------------------------------------------------------------------
- # ● 腕力の取得
- #--------------------------------------------------------------------------
- def str
- n = [[base_str + @str_plus, 1].max, STR_LIMIT].min
- for i in @states
- n *= $data_states[i].str_rate / 100.0
- end
- n = [[Integer(n), 1].max, STR_LIMIT].min
- return n
- end
- #--------------------------------------------------------------------------
- # ● 器用さの取得
- #--------------------------------------------------------------------------
- def dex
- n = [[base_dex + @dex_plus, 1].max, DEX_LIMIT].min
- for i in @states
- n *= $data_states[i].dex_rate / 100.0
- end
- n = [[Integer(n), 1].max, DEX_LIMIT].min
- return n
- end
- #--------------------------------------------------------------------------
- # ● 素早さの取得
- #--------------------------------------------------------------------------
- def agi
- n = [[base_agi + @agi_plus, 1].max, AGI_LIMIT].min
- for i in @states
- n *= $data_states[i].agi_rate / 100.0
- end
- n = [[Integer(n), 1].max, AGI_LIMIT].min
- return n
- end
- #--------------------------------------------------------------------------
- # ● 魔力の取得
- #--------------------------------------------------------------------------
- def int
- n = [[base_int + @int_plus, 1].max, INT_LIMIT].min
- for i in @states
- n *= $data_states[i].int_rate / 100.0
- end
- n = [[Integer(n), 1].max, INT_LIMIT].min
- return n
- end
- #--------------------------------------------------------------------------
- # ● MaxHP の设定
- # maxhp : 新しい MaxHP
- #--------------------------------------------------------------------------
- def maxhp=(maxhp)
- @maxhp_plus += maxhp - self.maxhp
- @maxhp_plus = [[@maxhp_plus, -MAXHP_LIMIT].max, MAXHP_LIMIT].min
- @hp = [@hp, self.maxhp].min
- end
- #--------------------------------------------------------------------------
- # ● MaxSP の设定
- # maxsp : 新しい MaxSP
- #--------------------------------------------------------------------------
- def maxsp=(maxsp)
- @maxsp_plus += maxsp - self.maxsp
- @maxsp_plus = [[@maxsp_plus, -MAXSP_LIMIT].max, MAXSP_LIMIT].min
- @sp = [@sp, self.maxsp].min
- end
- #--------------------------------------------------------------------------
- # ● 腕力の设定
- # str : 新しい腕力
- #--------------------------------------------------------------------------
- def str=(str)
- @str_plus += str - self.str
- @str_plus = [[@str_plus, -STR_LIMIT].max, STR_LIMIT].min
- end
- #--------------------------------------------------------------------------
- # ● 器用さの设定
- # dex : 新しい器用さ
- #--------------------------------------------------------------------------
- def dex=(dex)
- @dex_plus += dex - self.dex
- @dex_plus = [[@dex_plus, -DEX_LIMIT].max, DEX_LIMIT].min
- end
- #--------------------------------------------------------------------------
- # ● 素早さの设定
- # agi : 新しい素早さ
- #--------------------------------------------------------------------------
- def agi=(agi)
- @agi_plus += agi - self.agi
- @agi_plus = [[@agi_plus, -AGI_LIMIT].max, AGI_LIMIT].min
- end
- #--------------------------------------------------------------------------
- # ● 魔力の设定
- # int : 新しい魔力
- #--------------------------------------------------------------------------
- def int=(int)
- @int_plus += int - self.int
- @int_plus = [[@int_plus, -INT_LIMIT].max, INT_LIMIT].min
- end
- end
- #==============================================================================
- # 本脚本来自http://www.66rpg.com/,使用和转载请保留此信息
- #==============================================================================
复制代码 |
|