Advertisement
Vlue

Skill Features

Mar 1st, 2014
2,177
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 3.21 KB | None | 0 0
  1. #Skill Features v1.0a
  2. #----------#
  3. #Features: Allows you to add features to skills, useful for support skills.
  4. #
  5. #Usage:    Usage:
  6. #           You can have as many features as you want, set up in notes:
  7. #           <FEATURE code id value>
  8. #          But what are the codes, ids, and values?? Don't worry, it's right here:
  9. #
  10. #           Element Rate   = 11, element_id, float value
  11. #           Debuff Rate    = 12, param_id, float value
  12. #           State Rate     = 13, state_id, float value
  13. #           State Resist   = 14, state_id, 0
  14. #
  15. #           Parameter      = 21, param_id, float value
  16. #           Ex-Parameter   = 22, exparam_id, float value
  17. #           Sp-Parameter   = 23, spparam_id, float value
  18. #
  19. #           Atk Element    = 31, element_id, 0
  20. #           Atk State      = 32, state_id, float value
  21. #           Atk Speed      = 33, 0, value
  22. #           Atk Times+     = 34, 0, value
  23. #
  24. #           Add Skill Type = 41, skill_type, 0
  25. #          Seal Skill Type = 42, skill_type, 0
  26. #           Add Skill      = 43, skill_id, 0
  27. #           Seal Skill     = 44, skill_id, 0
  28. #
  29. #           Equip Weapon   = 51, weapon_skill, 0
  30. #           Equip Armor    = 52, armor_skill, 0
  31. #           Fix Equip      = 53, item_type, 0
  32. #           Seal Equip     = 54, item_type, 0
  33. #           Slot Type      = 55, 1, 0
  34. #
  35. #           Action Times+  = 61, 0, value
  36. #           Special Flag   = 62, flag_id, 0
  37. #          Collapse Effect = 62, flag_id, 0
  38. #           Party Ability  = 63, flag_id, 0
  39. #
  40. #     float value = percentage value where 1 = 100%, 0.75 = 75%, and 1.25 = 125%
  41. #     param_id, 0=hp, 1=mp, 2=atk, 3=def, 4=mat, 5=mdf, 6=agi, 7=luk
  42. #
  43. #     Examples: <FEATURE 21 2 1.5> which would increase atk to 150%
  44. #               <FEATURE 62 0 0>   which makes the item give the auto-battle flag
  45. #               <FEATURE 32 1 0.5> which gives a 50% of applying death state
  46. #
  47. #----------#
  48. #-- Script by: Vlue of Daimonious Tails
  49. #
  50. #- Questions or comments can be:
  51. #    given by email: sumptuaryspade@live.ca
  52. #    provided on facebook: http://www.facebook.com/DaimoniousTailsGames
  53. #   All my other scripts and projects can be found here: http://daimonioustails.weebly.com/
  54. #
  55. #--- Free to use in any project, commercial or non-commercial, with credit given
  56. # - - Though a donation's always a nice way to say thank you~ (I also accept actual thank you's)
  57.  
  58. class Game_Actor
  59.   def feature_objects
  60.     super + [actor] + [self.class] + equips.compact + skills
  61.   end
  62.   def features(code)
  63.     if code == FEATURE_SKILL_ADD
  64.       return all_features_noskills.select {|ft| ft.code == code }
  65.     else
  66.       return all_features.select {|ft| ft.code == code }
  67.     end
  68.   end
  69.   def all_features_noskills
  70.     feature_objects_noskills.inject([]) {|r, obj| r + obj.features }
  71.   end
  72.   def feature_objects_noskills
  73.     states + [actor] + [self.class] + equips.compact
  74.   end
  75. end
  76.  
  77. class RPG::Skill
  78.   def features
  79.     all_features = []
  80.     note = self.note.clone
  81.     note =~ /<FEATURE (\d+) (\d+) (\d+.\d+|\d+)>/
  82.     while $1
  83.       all_features.push(RPG::BaseItem::Feature.new($1.to_i,$2.to_i,$3.to_f))
  84.       note[note.index("FEAT")] = "*"
  85.       note =~ /<FEATURE (\d+) (\d+) (\d+.\d+|\d+)>/
  86.     end
  87.     all_features
  88.   end
  89. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement