赞 | 2 |
VIP | 109 |
好人卡 | 208 |
积分 | 4 |
经验 | 22037 |
最后登录 | 2024-11-9 |
在线时间 | 1198 小时 |
Lv2.观梦者 虚構歪曲
- 梦石
- 0
- 星屑
- 359
- 在线时间
- 1198 小时
- 注册时间
- 2010-12-18
- 帖子
- 3928
|
加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有帐号?注册会员
x
本帖最后由 忧雪の伤 于 2011-4-4 12:07 编辑
- #______________________________________________________________________________
- # * 此脚本归66RPG - Idiot Script Association(ISA)所有,谢绝任何形式转载。
- #______________________________________________________________________________
- #==============================================================================
- # ■ 角色变化敌人 - Actor Change Enemy - for XP
- #------------------------------------------------------------------------------
- # 遵守协议:66RPG - Idiot Script Association(ISA)
- # 当前版本:1.0.0.0
- #------------------------------------------------------------------------------
- # 更新日记:忧雪の伤(2011.4.3)
- # - 初始化
- #==============================================================================
- #--------------------------------------------------------------------------
- # ● 资料记录
- #--------------------------------------------------------------------------
- module ISA
- Use["角色变化敌人"] = [true, "1.0.0.0"]
- System["角色变化敌人"] = {}
- end
-
- #--------------------------------------------------------------------------
- # ● 设定部分
- #--------------------------------------------------------------------------
- module ISA
- System["角色变化敌人"]["等级显示"] = true
- System["角色变化敌人"]["名称改变"] = true
- System["角色变化敌人"]["图形改变"] = true
- end
- #==============================================================================
- # ■ RPG
- #------------------------------------------------------------------------------
- # 集合了 RPGXP 数据结构等的模块。
- #==============================================================================
- module RPG
- #--------------------------------------------------------------------------
- # ● 敌人的数据类。
- #--------------------------------------------------------------------------
- class Enemy
- def name
- return @name.split(/change/)[0]
- end
- def change_id
- return @name.split(/change/)[1].to_i
- end
- end
- end
- #==============================================================================
- # ■ Game_Enemy
- #------------------------------------------------------------------------------
- # 处理敌人的类。本类在 Game_Troop 类 ($game_troop) 的
- # 内部使用。
- #==============================================================================
- class Game_Enemy < Game_Battler
- include ISA
- #--------------------------------------------------------------------------
- # ● 定义实例变量
- #--------------------------------------------------------------------------
- attr_reader :level
- attr_reader :change_id
- #--------------------------------------------------------------------------
- # ● 初始化对像
- # troop_id : 循环 ID
- # member_index : 循环成员的索引
- #--------------------------------------------------------------------------
- alias :actor_change_enemy_initialize :initialize unless method_defined? :actor_change_enemy_initialize
- def initialize(troop_id, member_index)
- enemy_id = $data_troops[troop_id].members[member_index].enemy_id
- @change_id = $data_enemies[enemy_id].change_id
- level_list = 0
- $game_party.actors.each do |actor|
- level_list += actor.level
- end
- @level = level_list / $game_party.actors.size + rand(2) - rand(2)
- @level = 99 if @level > 99
- actor_change_enemy_initialize(troop_id, member_index)
- end
- #--------------------------------------------------------------------------
- # ● 获取战斗者 文件名
- #--------------------------------------------------------------------------
- def battler_name
- case System["角色变化敌人"]["图形改变"]
- when true
- return (@change_id != 0 ? $data_actors[@change_id].battler_name : @battler_name)
- when false
- return @battler_name
- end
- end
- #--------------------------------------------------------------------------
- # ● 获取名称
- #--------------------------------------------------------------------------
- alias :actor_change_enemy_name :name unless method_defined? :actor_change_enemy_name
- def name
- level = System["角色变化敌人"]["等级显示"] ? " Lv" + @level.to_s : ""
- case System["角色变化敌人"]["名称改变"]
- when true
- return (@change_id != 0 ? $data_actors[@change_id].name : actor_change_enemy_name) + level
- else
- return actor_change_enemy_name + level
- end
- end
- #--------------------------------------------------------------------------
- # ● 获取基本 MaxHP
- #--------------------------------------------------------------------------
- alias :actor_change_enemy_base_maxhp :base_maxhp unless method_defined? :actor_change_enemy_base_maxhp
- def base_maxhp
- if @change_id != 0
- n = change_parameters(@change_id, 0, @level)
- else
- n = (actor_change_enemy_base_maxhp * wave).to_i
- end
- return n
- end
- #--------------------------------------------------------------------------
- # ● 获取基本 MaxSP
- #--------------------------------------------------------------------------
- alias :actor_change_enemy_base_maxsp :base_maxsp unless method_defined? :actor_change_enemy_base_maxsp
- def base_maxsp
- if @change_id != 0
- n = change_parameters(@change_id, 1, @level)
- else
- n = (actor_change_enemy_base_maxsp * wave).to_i
- end
- return n
- end
- #--------------------------------------------------------------------------
- # ● 获取基本力量
- #--------------------------------------------------------------------------
- alias :actor_change_enemy_base_str :base_str unless method_defined? :actor_change_enemy_base_str
- def base_str
- if @change_id != 0
- n = change_parameters(@change_id, 2, @level)
- else
- n = (actor_change_enemy_base_str * wave).to_i
- end
- return n
- end
- #--------------------------------------------------------------------------
- # ● 获取基本灵巧
- #--------------------------------------------------------------------------
- alias :actor_change_enemy_base_dex :base_dex unless method_defined? :actor_change_enemy_base_dex
- def base_dex
- if @change_id != 0
- n = change_parameters(@change_id, 3, @level)
- else
- n = (actor_change_enemy_base_dex * wave).to_i
- end
- return n
- end
- #--------------------------------------------------------------------------
- # ● 获取基本速度
- #--------------------------------------------------------------------------
- alias :actor_change_enemy_base_agi :base_agi unless method_defined? :actor_change_enemy_base_agi
- def base_agi
- if @change_id != 0
- n = change_parameters(@change_id, 4, @level)
- else
- n = (actor_change_enemy_base_agi * wave).to_i
- end
- return n
- end
- #--------------------------------------------------------------------------
- # ● 获取基本魔力
- #--------------------------------------------------------------------------
- alias :actor_change_enemy_base_int :base_int unless method_defined? :actor_change_enemy_base_int
- def base_int
- if @change_id != 0
- n = change_parameters(@change_id, 5, @level)
- else
- n = (actor_change_enemy_base_int * wave).to_i
- end
- return n
- end
- #--------------------------------------------------------------------------
- # ● 获取基本攻击力
- #--------------------------------------------------------------------------
- alias :actor_change_enemy_base_atk :base_atk unless method_defined? :actor_change_enemy_base_atk
- def base_atk
- return (actor_change_enemy_base_atk * wave).to_i
- end
- #--------------------------------------------------------------------------
- # ● 获取基本物理防御
- #--------------------------------------------------------------------------
- alias :actor_change_enemy_base_pdef :base_pdef unless method_defined? :actor_change_enemy_base_pdef
- def base_pdef
- return (actor_change_enemy_base_pdef * wave).to_i
- end
- #--------------------------------------------------------------------------
- # ● 获取基本魔法防御
- #--------------------------------------------------------------------------
- alias :actor_change_enemy_base_mdef :base_mdef unless method_defined? :actor_change_enemy_base_mdef
- def base_mdef
- return (actor_change_enemy_base_mdef * wave).to_i
- end
- #--------------------------------------------------------------------------
- # ● 获取金钱
- #--------------------------------------------------------------------------
- alias :actor_change_enemy_gold :gold unless method_defined? :actor_change_enemy_gold
- def gold
- return (actor_change_enemy_gold * wave).to_i
- end
- #--------------------------------------------------------------------------
- # ● 获取浮动
- #--------------------------------------------------------------------------
- def wave
- return 1 + 0.05 * (@level - 1)
- end
- #--------------------------------------------------------------------------
- # ● 获取变化参数
- # change_id : 变化 ID
- # kind : 种类
- # level : 等级
- #--------------------------------------------------------------------------
- def change_parameters(change_id, kind, level = 1)
- return $data_actors[change_id].parameters[kind, level]
- end
- end
复制代码
两大功能 - ①附带敌人能力随角色等级变化,并存在敌人的等级 ②可以让敌人变身角色
敌人变身角色使用方法 - 在数据库敌人名字后面加上change id。id为想要变身的角色id。 |
|