Per 2016, RMID pindah ke RMID Discord (Invite link dihapus untuk mencegah spambot -Theo @ 2019). Posting sudah tidak bisa dilakukan lagi.
Mohon maaf atas ketidaknyamanannya dan mohon kerjasamanya.
|
|
| 2012-05-06, 11:03 | [PSS]DefendRecover |
---|
privateer Novice
Posts : 253 Thanked : 1 Engine : RMXP Skill : Advanced Type : Scripter
| [PSS]DefendRecover Versi: 1.0 Tipe: Custom Battle Add-on PengenalanIni hasil kerja saya selama 1 jam... Fungsi si script banyak direferensikan oleh KGC Fitur
- Bilinggual Edition
- Restorasi HP/SP jika unit ngedefend
ScreenshotsGak perlu.... DemoGak Perlu... Scripts - Code:
-
#============================================================================== # ** Defend Recover # ** Version : 1.0 # ** Author : privateer #------------------------------------------------------------------------------ # ** Category : Custom Battle Add-on # ** Date Created : 06/05/2012 #------------------------------------------------------------------------------ # * INTRODUCTION # A script based on my curiosity in the world of RGSS # Functions reference by KGC #------------------------------------------------------------------------------ # * FUNCTION # Units who used "Defend" command will recover their HP/SP. # Hero yang nge-defend akan merecover HP/SPnya #------------------------------------------------------------------------------ # * INSTRUCTION # Plug'N'Play, please read the instructions in the comment! # # This work is protected by the following license: # #---------------------------------------------------------------------------- # # # # Creative Commons - Attribution-NonCommercial-ShareAlike 3.0 Unported # # ( http://creativecommons.org/licenses/by-nc-sa/3.0/ ) # # # # You are free: # # # # to Share - to copy, distribute and transmit the work # # to Remix - to adapt the work # # # # Under the following conditions: # # # # Attribution. You must attribute the work in the manner specified by the # # author or licensor (but not in any way that suggests that they endorse you # # or your use of the work). # # # # Noncommercial. You may not use this work for commercial purposes. # # # # Share alike. If you alter, transform, or build upon this work, you may # # distribute the resulting work only under the same or similar license to # # this one. # # # # - For any reuse or distribution, you must make clear to others the license # # terms of this work. The best way to do this is with a link to this web # # page. # # # # - Any of the above conditions can be waived if you get permission from the # # copyright holder. # # # # - Nothing in this license impairs or restricts the author's moral rights. # # # #---------------------------------------------------------------------------- # $imported = {} if $imported == nil $imported["PSS_DR"] = true #============================================================================== # ** CONFIGURATION START! START CONFIGURING HERE! #============================================================================== module PSS_DR # Default HP rate percentage value for actors # Persentase default untuk HP aktor DEFAULT_ACTOR_HP_RATE = 10 # Default SP rate percentage value for actors # Persentase default untuk SP aktor DEFAULT_ACTOR_SP_RATE = 10 # Default HP rate percentage value for enemies # Persentase default untuk HP musuh DEFAULT_ENEMY_HP_RATE = 5 # Default SP rate percentage value for enemies # Persentase default untuk SP musuh DEFAULT_ENEMY_SP_RATE = 5 ################################################################################ # Custom Unit HP/SP Restoration Rate ################################################################################ # Don't remove this line! CUSTOM_ACTOR_RESTORATION_RATE = {} CUSTOM_ENEMY_RESTORATION_RATE = {} # Don't remove this line! ############################################################################## # Custom Unit Restoration Rate : # CUSTOM_ACTOR_RESTORATION_RATE[unit_id] = [hp_rate, sp_rate] for actors. # CUSTOM_ENEMY_RESTORATION_RATE[unit_id] = [hp_rate, sp_rate] for enemies. # For unlisted units, they will automatically use the DEFAULT_UNIT_RATE value. ############################################################################## CUSTOM_ACTOR_RESTORATION_RATE[2] = [15, 15] CUSTOM_ENEMY_RESTORATION_RATE[1] = [7, 7] end #============================================================================== # ** CONFIGURATION END! DON'T EDIT FURTHER UNLESS YOU KNOW WHAT YOU ARE DOING! #============================================================================== # #============================================================================== # ■ Scene_Battle (part 4) #==============================================================================
class Scene_Battle include PSS_DR #-------------------------------------------------------------------------- # ● Create Basic Action Result #-------------------------------------------------------------------------- alias make_basic_action_result_PSS_DR make_basic_action_result def make_basic_action_result # Perform the original method make_basic_action_result_PSS_DR # Checking the battler's action if @active_battler.current_action.kind == 0 && @active_battler.current_action.basic == 1 # Calculating recovery rate if @active_battler.is_a?(Game_Actor) && CUSTOM_ACTOR_RESTORATION_RATE.include?(@active_battler.id) defend_recover(CUSTOM_ACTOR_RESTORATION_RATE[@active_battler.id][0], CUSTOM_ACTOR_RESTORATION_RATE[@active_battler.id][1]) elsif @active_battler.is_a?(Game_Actor) && !CUSTOM_ACTOR_RESTORATION_RATE.include?(@active_battler.id) defend_recover(DEFAULT_ACTOR_HP_RATE, DEFAULT_ACTOR_SP_RATE) elsif @active_battler.is_a?(Game_Enemy) && CUSTOM_ENEMY_RESTORATION_RATE.include?(@active_battler.id) defend_recover(CUSTOM_ENEMY_RESTORATION_RATE[@active_battler.id][0], CUSTOM_ENEMY_RESTORATION_RATE[@active_battler.id][1]) else defend_recover(DEFAULT_ENEMY_HP_RATE, DEFAULT_ENEMY_SP_RATE) end end end def defend_recover(hp_rate, sp_rate) recover_hp = @active_battler.maxhp * hp_rate / 100 recover_sp = @active_battler.maxsp * sp_rate / 100 @active_battler.damage = "#{$data_system.words.hp} + #{recover_hp} #{$data_system.words.sp} + #{recover_sp}" @active_battler.hp += recover_hp @active_battler.sp += recover_sp # Display the recovered HP/SP @target_battlers |= [@active_battler] end end
Credits |
| | | 2012-05-06, 14:32 | Re: [PSS]DefendRecover |
---|
Kuru Senior
Posts : 985 Thanked : 9 Engine : RMVX Skill : Beginner Type : Writer
Awards:
| Wah Keren kayak game "Legend of Dragoon" dong. Defend terus kalau mau recovery, jadi nggak perlu makai potion . Sip |
| | | Halaman 1 dari 1 | |
| Permissions in this forum: | Anda tidak dapat menjawab topik
| |
| |
Latest 10 Topics | [Web Novel] Gloria Infidelis 2016-11-17, 21:27 by LightNightKnight
[Announcement] Forum baru untuk RMID 2016-08-25, 16:39 by TheoAllen
Where I'm Wrong ? 2016-07-24, 16:10 by ReydVires
flakeheartnet's Resources part III 2016-07-08, 14:30 by flakeheartnet
Keira's Art Warehouse 2016-06-28, 19:27 by KeiraBlaze
Theo Core Time System + Bingung 2016-06-27, 16:24 by Lockin
Error Script, Maybe ? 2016-06-27, 16:20 by Lockin
Nusaimoe @ RMID Lounge 2016-06-21, 05:02 by Jihad Bagas
Call Random Battle 2016-06-15, 17:04 by Lockin
Flakeheartnet Resources Part II [come back gift] 2016-06-07, 15:51 by flakeheartnet
|
Statistics
|
Members: [ 4947 ]
Topics: [ 8258 ]
Posts: [ 112606 ]
Newest member: [ https://rmid.forumotion.net/u4968 ]
|
|
|
|
|
|