本帖最后由 howhow1314 于 2015-11-25 14:57 编辑
阿薩男爵 发表于 2015-11-25 05:53
经测试可用带为感谢一下,但同时我也有一问,如何将它修改为某个武器的默认攻击为某号技能呢?
如火枪的 ...
class RPG::Class def attack_skill_id /<呵呵\s*(\d+)>/ =~ note ? $1.to_i : 1 end end class RPG::Weapon def attack_skill_id /<呵呵\s*(\d+)>/ =~ note ? $1.to_i : nil end end class Game_Actor def attack_skill_id weapons[0] ? weapons[0].attack_skill_id || self.class.attack_skill_id : self.class.attack_skill_id end end
class RPG::Class
def attack_skill_id
/<呵呵\s*(\d+)>/ =~ note ? $1.to_i : 1
end
end
class RPG::Weapon
def attack_skill_id
/<呵呵\s*(\d+)>/ =~ note ? $1.to_i : nil
end
end
class Game_Actor
def attack_skill_id
weapons[0] ? weapons[0].attack_skill_id || self.class.attack_skill_id : self.class.attack_skill_id
end
end
武器呵呵>角色呵呵
用武器類型而不是武器的話..
class RPG::Weapon def attack_skill_id case $data_system.weapon_types[wtype_id] when "斧" 8 when "槍" 26 else nil end end end
class RPG::Weapon
def attack_skill_id
case $data_system.weapon_types[wtype_id]
when "斧"
8
when "槍"
26
else
nil
end
end
end
順便不加以下這段的話,會有一些問題,比如攻擊技能是治癒術什麼的,你也只能選敵人為目標,不過結果還是放在隊友身上(貌似是隨機一名隊友..忘了)
加了的話可以正確的選隊友為目標
class Scene_Battle def command_attack skill = $data_skills[BattleManager.actor.attack_skill_id] BattleManager.actor.input.set_attack if !skill.need_selection? next_command elsif skill.for_opponent? select_enemy_selection else select_actor_selection end end end
class Scene_Battle
def command_attack
skill = $data_skills[BattleManager.actor.attack_skill_id]
BattleManager.actor.input.set_attack
if !skill.need_selection?
next_command
elsif skill.for_opponent?
select_enemy_selection
else
select_actor_selection
end
end
end
另外就是全體攻擊或者隨機目標之類的也像使用技能一樣不用選目標了,不過我總覺得攻擊不選目標怪怪的...
所以又寫了以下這種..
class Scene_Battle def command_attack skill = $data_skills[BattleManager.actor.attack_skill_id] BattleManager.actor.input.set_attack if skill.for_opponent? select_enemy_selection else select_actor_selection end end end
class Scene_Battle
def command_attack
skill = $data_skills[BattleManager.actor.attack_skill_id]
BattleManager.actor.input.set_attack
if skill.for_opponent?
select_enemy_selection
else
select_actor_selection
end
end
end
|