Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Copy enemy skill
- #Xypher
- module Copyskill
- Exclusion_list = [1, 2, 6, 7]
- Regex = /<mimic skill>/i
- end
- class Game_Battler < Game_BattlerBase
- def skills_list
- temp = []
- if self.enemy?
- enemy.actions.each {|skill| temp.push(skill.skill_id) unless Copyskill::Exclusion_list.include?(skill.skill_id)}
- else
- temp = (@skills | added_skills).sort
- end
- return temp.uniq
- end
- end
- class Scene_Battle
- alias x135739593 apply_item_effects
- def apply_item_effects(target, item)
- if item.note =~ Copyskill::Regex && @subject.copied_skill.empty? && @subject.actor?
- e = true
- c = target.skills_list.sample
- d = $data_skills[c].name
- @subject.copied_skill.push(c)
- end
- @log_window.add_text(sprintf("%s was copied!", d)) if e
- e = false
- x135739593(target, item)
- end
- end
- class Game_Actor < Game_Battler
- def skills
- (@skills | added_skills | @copied_skill).sort.collect {|id| $data_skills[id] }
- end
- attr_accessor :copied_skill
- alias x563486452 initialize
- def initialize(actor_id)
- x563486452(actor_id)
- @copied_skill = []
- end
- def on_battle_end
- super
- @copied_skill.clear
- end
- end
- class Window_SkillList < Window_Selectable
- alias x215435435 include?
- def include?(item)
- return false if item.note =~ Copyskill::Regex && !@actor.copied_skill.empty?
- x215435435(item)
- end
- end
- class Game_ActionResult
- attr_accessor :cs_added_msg
- def clear_cs_added_messages
- @cs_added_msg = []
- end
- alias cs_actionresult_clear clear
- def clear
- cs_actionresult_clear
- clear_cs_added_messages
- end
- end
- class Window_BattleLog
- alias cs_battlelog_display_affected_status display_affected_status
- def display_affected_status(target, item)
- target.result.cs_added_msg.each {|text|
- add_text(text)
- wait
- }
- cs_battlelog_display_affected_status(target, item)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement