Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #===============================================================================
- #
- # Shanghai Simple Script - Hospital Fees Retain State Add-on
- # Last Date Updated: 2010.09.17
- # Level: Normal
- # Original Script by: Shanghai
- # Add-on by: Jet Kobayashi Zala
- #
- # This script is an add-on for Shanghai Simple Script - Hospital Fees. It
- # adds functionality to retain states that you don't want removed from
- # characters when the hospital is used.
- #
- # As an add-on, this script requires that you have
- # Shanghai Simple Script - Hospital Fees already installed.
- #
- # This was not made by Shanghai, but by Jet Kobayashi Zala and without
- # Shanghai's consent and so he may end up flayed for this. If you need
- # help regarding this add-on, contact Jet about it, not Shanghai.
- #
- # E-mail: jetkobayashizala@gmail.com
- #===============================================================================
- # Instructions
- # -----------------------------------------------------------------------------
- # To install this script, open up your script editor and copy/paste this script
- # to an open slot below Shanghai Simple Script - Hospital Fees
- # but above ▼ Main. Remember to save.
- #
- # To launch the hospital scene, have a script call in an event with
- # $scene = Scene_Hospital.new
- #
- # New notebox tag:
- #
- # <hospital retain>
- # Add this to any state that should not be removed when the hospital works its
- # magical healy ways. Tingly.
- #===============================================================================
- $imported = {} if $imported == nil
- $imported["HospitalFeesRetainStateAddon"] = true
- #==============================================================================
- # ** RPG::State
- #==============================================================================
- class RPG::State
- #--------------------------------------------------------------------------
- # hospital_keep_state
- #--------------------------------------------------------------------------
- def hospital_keep_state
- self.note.split(/[\r\n]+/).each { |line|
- case line
- when /<(?:HOSPITAL_RETAIN|hospital retain)>/i
- return true
- end
- }
- return false
- end
- end
- #==============================================================================
- # ** Scene_Hospital
- #==============================================================================
- class Scene_Hospital < Scene_Base
- #--------------------------------------------------------------------------
- # * Update Hospital Selection
- #--------------------------------------------------------------------------
- def update_hospital_selection
- @hospital_window.update
- if Input.trigger?(Input::B)
- Sound.play_cancel
- @command_window.active = true
- @hospital_window.active = false
- elsif Input.trigger?(Input::C)
- actor = @hospital_window.actor
- if $game_party.gold < actor.heal_cost or actor.heal_cost == 0
- Sound.play_buzzer
- else
- Sound.play_recovery
- $game_party.lose_gold(actor.heal_cost)
- @gold_window.refresh
- for state in actor.states
- actor.remove_state(state.id) unless state.hospital_keep_state
- end
- actor.hp = actor.maxhp
- actor.mp = actor.maxmp
- @hospital_window.draw_item(@hospital_window.index)
- text = sprintf(SSS::HOSPITAL_HELP_TEXT, $game_party.heal_cost)
- text = SSS::HOSPITAL_HELP_HEALTHY if $game_party.heal_cost == 0
- @help_window.set_text(text, 1)
- end
- end
- end
- end
- #===============================================================================
- #
- # END OF FILE
- #
- #===============================================================================
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement