赞 | 0 |
VIP | 0 |
好人卡 | 0 |
积分 | 1 |
经验 | 4332 |
最后登录 | 2017-1-5 |
在线时间 | 29 小时 |
Lv1.梦旅人
- 梦石
- 0
- 星屑
- 50
- 在线时间
- 29 小时
- 注册时间
- 2010-7-5
- 帖子
- 483
|
2楼
楼主 |
发表于 2010-7-7 21:28:44
|
只看该作者
整个脚本是这样
- 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
复制代码 |
|