哦,进展蛮快啊!好的,写得蛮简单的,我就说说我的做法。
class Game_Battler < Game_BattlerBase
attr_accessor :zhongdu #就在这添加
attr_accessor :fengxue
attr_accessor :neishang
attr_accessor :waishang
attr_accessor :cimu
attr_accessor :dingsheng
attr_accessor :zizhi
attr_accessor :sex #男2 女1 太监3
alias initialize_old initialize
def initialize
@zhongdu = 0
@fengxue = 0
@neishang = 0
@waishang = 0
@cimu = 0
@dingsheng = 0 #初始化
@zizhi = 50
@sex = 2
initialize_old
end
def zczd(num)
return if self.state_resist?(2)
self.zhongdu += num
end
def zcfx(num)
return if self.state_resist?(3)
self.fengxue += num
end
def zcws(num)
return if self.state_resist?(4)
self.waishang += num
end
def zcns(num)
return if self.state_resist?(5)
self.neishang += num
end
def zccm(num)
return if self.state_resist?(7)
self.cimu += num
end
def zcds(num)
return if self.state_resist?(6)
self.dingsheng +=num
end
def clearbadstate
self.zhongdu = 0
self.waishang = 0
self.neishang = 0
self.fengxue = 0
self.cimu = 0
self.dingsheng = 0
end
end
游戏初期初始化一下性别,比如
def setupsex
a = {3=>1,16=>1,18=>1,22=>1,26=>1,48=>1,57=>1,60=>1,64=>1,67=>1,74=>1,75=>1,77=>1,78=>1,79=>1,80=>1,82=>1,84=>1,87=>1,88=>1,91=>1,92=>1,94=>1,100=>1,105=>1,106=>1,118=>1,119=>1,137=>1,
155=>1,162=>1,167=>1,176=>1,177=>1,194=>1,195=>1,196=>1,197=>1,198=>1}
for i in a.keys
$game_actors[i].sex = a.value#(这里]我忘怎么写了。。)
end
end
对了,还有个建议,不知道你们做没有。。关于武功的,随机技能脚本。序章武功不是分为基式,以及后期高级的招式。这个可以用随机技能,给角色添加招式触发率的属性(我是用气功反击率改的),使用基式的时候有几率出高级招式。如果你武功用了技能等级的脚本,等级还可以增加该武功触发招式的几率,我个人觉得蛮有意思的(其实是被苍龙逐日给毒害的!)
|