Project1
标题:
【再问次】百变宝典2还是3里面的那个精灵系统的问题
[打印本页]
作者:
BBBBB6
时间:
2010-7-7 21:27
标题:
【再问次】百变宝典2还是3里面的那个精灵系统的问题
好像叫做仿黄金太阳精灵系统捏,@sprite.each的each...Unfined method `each'(我用的是半角) for nil:Nilclass,据说是nil没有each方法。我用Ctrl+F搜索了@sprite。。。找到了@sprite = @sprite_turn = @new_skills = [],然后还想问问丫和我其他放进去的脚本有没有冲突,然后就没人鸟我捏。。。
还有RTAB战斗,里面的>(半角)也是一样的情况。。。不过也是没人鸟我。。。
是因为太弱智吗。。。{:2_44:}
作者:
BBBBB6
时间:
2010-7-7 21:28
整个脚本是这样
class Game_Actor < Game_Battler
attr_accessor :sprite # 精灵
attr_accessor :states_turn # 精灵持续回合
attr_accessor :sprite_max # 精灵数量上限
attr_accessor :sprskills # 精灵特技
attr_accessor :new_skills # 全特技
attr_accessor :spravtive # 活动精灵特技
attr_accessor :sprwait # 等待精灵特技
alias _setup setup
def setup(actor_id)
@sprite = @sprite_turn = @new_skills = []
@sprite_max = Sprite_Magic.sprite_max(actor_id)
_setup(actor_id)
clean_skills
end
def battler_wait_count
@sprite.each{|s| s.turn += 1 if s.turn?}
end
def equip_sprite?(name)
return @sprite.any?{|spr| spr.name == name}
end
def clean_skills
@sprskills = Sprite_Magic.find_skill_id(@sprite, @skills)
tempspr = @sprite.find_all{|s| !s.turn? }
@spravtive = Sprite_Magic.find_skill_id(tempspr, @skills)
@sprwait = @sprskills - @spravtive
@new_skills = @skills + @sprskills
end
def skill_learn?(skill_id)
clean_skills
return (@skills + @spravtive).include?(skill_id)
end
def house_moveto_equip(pos, index)
sprite.insert(pos, $game_party.sprite_house.delete_at(index))
end
def equip_moveto_house(index)
$game_party.sprite_house << @sprite.delete_at(index)
end
def actor_sprite_hp
temp_hp = 0
@sprite.each{|n| temp_hp += n.hp unless n.turn?}
return temp_hp
end
def actor_sprite_sp
temp_sp = 0
@sprite.each{|n| temp_sp += n.sp unless n.turn?}
return temp_sp
end
def actor_sprite_str
temp_str = 0
@sprite.each{|n| temp_str += n.str unless n.turn?}
return temp_str
end
def actor_sprite_dex
temp_dex = 0
@sprite.each{|n| temp_dex += n.dex unless n.turn?}
return temp_dex
end
def actor_sprite_agi
temp_agi = 0
@sprite.each{|n| temp_agi += n.agi unless n.turn?}
return temp_agi
end
def actor_sprite_int
temp_int = 0
@sprite.each{|n| temp_int += n.int unless n.turn?}
return temp_int
end
alias _base_maxhp base_maxhp
def base_maxhp
n = _base_maxhp
return (n + actor_sprite_hp)
end
alias _base_maxsp base_maxsp
def base_maxsp
n = _base_maxsp
return (n + actor_sprite_sp)
end
alias _base_str base_str
def base_str
n = _base_str
n += actor_sprite_str
return [[n, 1].max, 999].min
end
alias _base_dex base_dex
def base_dex
n = _base_dex
n += actor_sprite_dex
return [[n, 1].max, 999].min
end
alias _base_agi base_agi
def base_agi
n = _base_agi
n += actor_sprite_agi
return [[n, 1].max, 999].min
end
alias _base_int base_int
def base_int
n = _base_int
n += actor_sprite_int
return [[n, 1].max, 999].min
end
def actor_sprite_value
value = []
value << actor_sprite_hp
value << actor_sprite_sp
value << actor_sprite_str
value << actor_sprite_dex
value << actor_sprite_agi
value << actor_sprite_int
return value
end
def actor_value
value = []
value << actor.hp << actor.sp << actor.str << actor.dex << actor.agi << actor.int
return value
end
end
复制代码
作者:
BBBBB6
时间:
2010-7-9 22:41
{:2_33:}啊.................................怨念.......................................
作者:
六祈
时间:
2010-7-22 00:30
回复
BBBBB6
的帖子
lz你提供的信息不够,或许你要发上工程或者至少脚本文件
欢迎光临 Project1 (https://rpg.blue/)
Powered by Discuz! X3.1