| 赞 | 664 |
| VIP | |
| 好人卡 | |
| 积分 | 345 |
| 经验 | |
| 最后登录 | 2024-7-10 |
| 在线时间 | 5096 小时 |
- 梦石
- 0
- 星屑
- 34467
- 在线时间
- 5096 小时
- 注册时间
- 2012-11-19
- 回帖
- 4715

|
发表于 2018-8-5 23:12:12
|
显示全部楼层
本帖最后由 芯☆淡茹水 于 2018-8-6 00:22 编辑
其实,相对于实时的侦测状态变化计算,也可以这样把 base_xx 一项一项的逐个改过来。
但有时候又不想改太多的默认函数,但最终弄好才发现也改了好多默认函数。
上面 ↑ 状态增加的属性受状态百分比增幅的影响; 下面 ↓ 状态增加的属性不受状态百分比增幅的影响,但是如果有 属性破限 脚本可能会失效。
[pre lang="ruby"]#==============================================================================
# 状态增减固定属性
#==============================================================================
# Author : 芯☆淡茹水
#==============================================================================
# 1,状态关联公共事件。
# 状态名后面加上 ☆ ,接着写上公共事件ID。
#
# 2,对应公共事件的编辑。
# 公共事件编辑 注释 ,然后写上以下的对应备注项。
# 注意:两项之间不要接连备注,用随意字符或空格隔开以及换行都行。
# 备注格式:<maxhp:num> 最大HP
# <maxsp:num> 最大SP
# <str:num> 力量
# <dex:num> 敏捷
# <agi:num> 速度
# <int:num> 魔力
# <atk:num> 攻击力
# <pdef:num> 防御力
# <mdef:num> 魔法防御力
#
# 里面的 num 为增/减的值,正加负减,不要留空格。例: <maxhp:200> , <str:-20>
#
#==============================================================================
module RPG
class State
#--------------------------------------------------------------------------
def name; return @name.split("☆")[0] || ""; end
#--------------------------------------------------------------------------
def spce_id; return @name.split("☆")[1].to_i || 0; end
end
end
#==============================================================================
module XdRs_Sp
#--------------------------------------------------------------------------
def self.state_has_spce?(state_id)
event = self.spce_event(state_id)
return event && event.list.any?{|l| l.code == 108 }
end
#--------------------------------------------------------------------------
def self.spce_event(state_id)
return $data_common_events[$data_states[state_id].spce_id]
end
#--------------------------------------------------------------------------
def self.state_add(state_id, sym)
return 0 unless self.state_has_spce?(state_id)
note = self.event_note(self.spce_event(state_id))
return $1.to_i if note.match(Regexp.new("<#{sym}:(\\d+)>"))
return -$1.to_i if note.match(Regexp.new("<#{sym}:-(\\d+)>"))
return 0
end
#--------------------------------------------------------------------------
def self.event_note(event)
note = event.list.find_all{|l| [108,408].include?(l.code)}.map{|l| l.parameters[0]}
return note.join(";")
end
end
#==============================================================================
class Game_Battler
#--------------------------------------------------------------------------
def state_add(sym)
return 0 if @states.empty?
return eval(@states.map{|id| XdRs_Sp.state_add(id, sym)}.join("+"))
end
#--------------------------------------------------------------------------
alias xr_state_property_maxhp maxhp
def maxhp
n = xr_state_property_maxhp + state_add("maxhp")
return [[n, 1].max, 999999].min
end
#--------------------------------------------------------------------------
alias xr_state_property_maxsp maxsp
def maxsp
n = xr_state_property_maxsp + state_add("maxsp")
return [[n, 0].max, 9999].min
end
#--------------------------------------------------------------------------
alias xr_state_property_str str
def str
n = xr_state_property_str + state_add("str")
return [[n, 0].max, 999].min
end
#--------------------------------------------------------------------------
alias xr_state_property_dex dex
def dex
n = xr_state_property_dex + state_add("dex")
return [[n, 0].max, 999].min
end
#--------------------------------------------------------------------------
alias xr_state_property_agi agi
def agi
n = xr_state_property_agi + state_add("agi")
return [[n, 0].max, 999].min
end
#--------------------------------------------------------------------------
alias xr_state_property_int int
def int
n = xr_state_property_int + state_add("int")
return [[n, 0].max, 999].min
end
#--------------------------------------------------------------------------
alias xr_state_property_atk atk
def atk; return xr_state_property_atk + state_add("atk"); end
#--------------------------------------------------------------------------
alias xr_state_property_pdef pdef
def pdef; return xr_state_property_pdef + state_add("pdef"); end
#--------------------------------------------------------------------------
alias xr_state_property_mdef mdef
def mdef; return xr_state_property_mdef + state_add("mdef"); end
end
#==============================================================================
class Game_Actor < Game_Battler
#--------------------------------------------------------------------------
alias xr_state_property_maxhp maxhp
def maxhp
n = xr_state_property_maxhp + state_add("maxhp")
return [[n, 1].max, 9999].min
end
end
#==============================================================================
#==============================================================================[/pre]
至于属性有效度 element_ranks , 可以直接修改, 也可以修改后并储存。
但是,element_ranks 相当于公共数据,比如你把它的某项属性有效度改为 C ,
如果是角色, 所有是这个修改过属性有效度的职业的角色,他的那项属性有效度都变成了 C。
敌人相同,所有ID相同的敌人的属性有效度都跟着改变。 |
|