Advertisement
dsiver144

Class Skin/System Add-on

Aug 5th, 2017
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.69 KB | None | 0 0
  1. #-------------------------------------------------------------------------------
  2. # * Class Skin/System Add-on
  3. # dsiver144
  4. # re-activate common event of class's current skin
  5. # - Put this below all of card skin script.
  6. #-------------------------------------------------------------------------------
  7. class Scene_ClassChoosing
  8. #-------------------------------------------------------------------------
  9. # * new method: on_class_confirm_ok
  10. #-------------------------------------------------------------------------
  11. def on_class_confirm_ok
  12. @window_confirm.close
  13. @window_confirm.deactivate
  14. while @sprite_black.opacity > 0
  15. @sprite_black.opacity -= 5
  16. Graphics.update
  17. @window_confirm.update
  18. end
  19. if $game_system.current_class
  20. class_data = CLASSES[$game_system.current_class]
  21. $game_switches[class_data[:switch_id]] = false
  22. end
  23. $game_system.current_class = @window_classcommand.current_class_id
  24. class_data = CLASSES[$game_system.current_class]
  25. $game_switches[class_data[:switch_id]] = true
  26. $game_actors[1].change_class(class_data[:class_id])
  27. $game_system.current_class = @window_classcommand.current_class_id
  28. @window_classcommand.activate
  29. deck_to_coll
  30. # --- Addtional to Class Skin System -------
  31. class_id = $game_system.current_class
  32. skin_id = $game_system.leader_current_card_skin[class_id]
  33. if skin_id != 0
  34. skin_data = DSIVER144::CARD_SKIN_SYSTEM::LEADER_SKINS[class_id][skin_id]
  35. if skin_data
  36. $game_switches[skin_data[:switch_id]] = true
  37. $game_temp.reserve_common_event(skin_data[:common_ev_id])
  38. end
  39. end
  40. # ------------------------------------------
  41. SceneManager.goto(Scene_Deck)
  42. end
  43. end # Scene_ClassChoosing
  44.  
  45. class Window_CardLeadSkinList
  46. #--------------------------------------------------------------------------
  47. # * set_new_skin
  48. #--------------------------------------------------------------------------
  49. def set_new_skin
  50. old_hash = LEADER_SKINS[@class_id][$game_system.leader_current_card_skin[@class_id]]
  51. if old_hash
  52. $game_switches[old_hash[:switch_id]] = false
  53. end
  54. if $game_system.leader_card_skins[@class_id].include?(current_skin_id) || current_skin_id == 0
  55. $game_system.leader_current_card_skin[@class_id] = current_skin_id
  56. if current_hash_data
  57. $game_switches[current_hash_data[:switch_id]] = true
  58. $game_temp.reserve_common_event(current_hash_data[:common_ev_id])
  59. end
  60. if old_hash && current_skin_id == 0
  61. $game_temp.reserve_common_event(old_hash[:common_ev_id])
  62. end
  63. Sound.play_ok
  64. refresh
  65. else
  66. Sound.play_buzzer
  67. end
  68. end
  69. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement