Project1
标题:
谁有武器耐磨度的VX脚本
[打印本页]
作者:
只想做游戏
时间:
2008-8-29 04:55
标题:
谁有武器耐磨度的VX脚本
我急…… [LINE]1,#dddddd[/LINE]
版务信息:版主帮忙结贴~
作者:
Fantasy幻想
时间:
2008-8-29 05:45
我记得XP才有耐久度的脚本%……VX好像没有……LZ尿急的话去wc
作者:
木葬枫
时间:
2008-8-29 06:00
以下引用
Fantasy幻想于2008-8-28 21:45:20
的发言:
我记得XP才有耐久度的脚本%……VX好像没有……LZ尿急的话去wc
好回复·····
作者:
shinliwei
时间:
2008-8-29 07:11
如果你有一定水平的话,不妨根据http://rpg.blue/viewthread.php?tid=99474这个弄个.
#==============================================================================
# 读取rmvx备注栏指定字段 by 沉影不器
# -----------------------------------------------------------------------------
# 使用方法:
# 在vx数据库比如1号物品的备注栏里书写: 耐久度 = 10
# 读取时使用: p $data_items[1].read_note('耐久度')
# 几点注意:
# ① 忽略空格
# ② 返回值为文本格式
#==============================================================================
module RPG
#=============================================================================
# ■ BaseItem
#=============================================================================
class BaseItem
#-------------------------------------------------------------------------
# ○ 读取rmvx备注栏指定字段
# section : 字段名
# ignore_caps : 忽略大小写(仅字段名)
#-------------------------------------------------------------------------
def read_note(section, ignore_caps = false)
result = ''
# 忽略大小写时,全部转大写
section.upcase! if ignore_caps
# 转symbol方便比较
s = section.to_sym
self.note.each_line{|line|
temp = line.split(/=/)
# 去掉干扰字符
temp.each {|i| i.strip!}
temp[0].upcase! if ignore_caps
if temp[0].to_sym == s
unless temp[1] == nil
result = temp[1]
end
# 如果希望同名字段值覆盖前面的字段,去掉下一行
break
end
}
return result
end
end
#=============================================================================
# ■ Enemy
#=============================================================================
class Enemy
#-------------------------------------------------------------------------
# ○ 读取rmvx备注栏指定字段
# section : 字段名
# ignore_caps : 忽略大小写(仅字段名)
#-------------------------------------------------------------------------
def read_note(section, ignore_caps = false)
result = ''
# 忽略大小写时,全部转大写
section.upcase! if ignore_caps
# 转symbol方便比较
s = section.to_sym
self.note.each_line{|line|
temp = line.split(/=/)
# 去掉干扰字符
temp.each {|i| i.strip!}
temp[0].upcase! if ignore_caps
if temp[0].to_sym == s
unless temp[1] == nil
result = temp[1]
end
# 如果希望同名字段值覆盖前面的字段,去掉下一行
break
end
}
return result
end
end
#=============================================================================
# ■ State
#=============================================================================
class State
#-------------------------------------------------------------------------
# ○ 读取rmvx备注栏指定字段
# section : 字段名
# ignore_caps : 忽略大小写(仅字段名)
#-------------------------------------------------------------------------
def read_note(section, ignore_caps = false)
result = ''
# 忽略大小写时,全部转大写
section.upcase! if ignore_caps
# 转symbol方便比较
s = section.to_sym
self.note.each_line{|line|
temp = line.split(/=/)
# 去掉干扰字符
temp.each {|i| i.strip!}
temp[0].upcase! if ignore_caps
if temp[0].to_sym == s
unless temp[1] == nil
result = temp[1]
end
# 如果希望同名字段值覆盖前面的字段,去掉下一行
break
end
}
return result
end
end
end
复制代码
当然我水平不行,你要是弄好了 不妨发出来 我也想要个! [LINE]1,#dddddd[/LINE]
系统信息:本贴由本区版主认可为正确答案,66RPG感谢您的热情解答~
欢迎光临 Project1 (https://rpg.blue/)
Powered by Discuz! X3.1