设为首页收藏本站同能贴吧 切换语言 繁体中文
开启辅助访问 切换到窄版
扫描二维码关注官方公众号
返回列表
+ 发新帖
查看: 60|回复: 0

[转载发布] KAftermathSpoils VX

[复制链接]
累计送礼:
0 个
累计收礼:
1 个
  • TA的每日心情
    开心
    2026-7-12 04:10
  • 签到天数: 209 天

    连续签到: 2 天

    [LV.7]常住居民III

    7546

    主题

    864

    回帖

    3万

    积分

    管理员

    Rank: 9Rank: 9Rank: 9

    VIP
    7
    卡币
    29099
    OK点
    16
    推广点
    0
    同能卷
    50
    积分
    37539

    灌水之王

    发表于 7 天前 | 显示全部楼层 |阅读模式
    KAftermathSpoils VX

    by Kyonides


    Introduction

    The title tells you what this scriptlet is all about: healing based on the battle aftermath.

    How does it work?
    :

    It's very simple! Just set the values of a series of ranges, i.e.

                    Ruby:       
    1. HP_TOTAL_TURNS[min_value..max_value] = 100
    复制代码


    ...and the system will check how many turns it actually took you to defeat your opponents.

    Did you need 11 turns to defeat some ghosts?
    Was there a range like 10..20 included in your hash?
    Does that range store 75 as its current value?
    Then you already know the answer here: it will pick that very same range and assign your heroes a 75% HP recovery rate!


    The Script
    Spoiler: Healing + Gold
                    Ruby:       
    1. # * KAftermathSpoils VX * #
    2. #   Scripter : Kyonides Arkanthes
    3. #   v0.4.0 - 2024-10-19
    4. # This script lets you automatically heal your heroes after winning a battle
    5. # based on the number of battle turns.
    6. module KBattle
    7.   # Leave these hashes alone!
    8.   HP_TOTAL_TURNS   = {}
    9.   MP_TOTAL_TURNS   = {}
    10.   GOLD_TOTAL_TURNS = {}
    11.   # If it took too long to defeat the enemy troopers...
    12.   HP_TOTAL_TURNS.default   = 0
    13.   MP_TOTAL_TURNS.default   = 0
    14.   GOLD_TOTAL_TURNS.default = 0
    15.   # Add as many Ranges, i.e. 1..50 as necessary:
    16.   HP_TOTAL_TURNS[1..6]     = 100
    17.   HP_TOTAL_TURNS[7..17]    = 75
    18.   HP_TOTAL_TURNS[18..35]   = 50
    19.   HP_TOTAL_TURNS[36..60]   = 25
    20.   MP_TOTAL_TURNS[1..5]     = 100
    21.   MP_TOTAL_TURNS[6..15]    = 75
    22.   MP_TOTAL_TURNS[16..30]   = 50
    23.   MP_TOTAL_TURNS[31..50]   = 25
    24.   GOLD_TOTAL_TURNS[1..2]   = 150
    25.   GOLD_TOTAL_TURNS[3..6]   = 120
    26.   GOLD_TOTAL_TURNS[7..10]  = 100
    27.   GOLD_TOTAL_TURNS[11..13] = 80
    28.   GOLD_TOTAL_TURNS[14..17] = 60
    29. end
    30. class Range
    31.   def <=>(other)
    32.     to_a <=> other.to_a
    33.   end
    34. end
    35. class Game_Troop
    36.   alias :kyon_btl_score_gm_trp_gold_ttl :gold_total
    37.   def gold_total
    38.     gold = kyon_btl_score_gm_trp_gold_ttl
    39.     gp_perc = 0
    40.     KBattle::GOLD_TOTAL_TURNS.sort.reverse.each do |min_turns, percent|
    41.       next unless min_turns.include?(turns)
    42.       gp_perc = percent
    43.       break
    44.     end
    45.     gold + gold * gp_perc / 100
    46.   end
    47. end
    48. class Scene_Battle
    49.   alias :kyon_btl_score_scn_btl_disp_exp_gold :display_exp_and_gold
    50.   def process_aftermath_healing
    51.     hp_perc = mp_perc = 0
    52.     turns = $game_troop.turn_count
    53.     KBattle::HP_TOTAL_TURNS.sort.reverse.each do |min_turns, percent|
    54.       next unless min_turns.include?(turns)
    55.       hp_perc = percent
    56.       break
    57.     end
    58.     KBattle::MP_TOTAL_TURNS.sort.reverse.each do |min_turns, percent|
    59.       next unless min_turns.include?(turns)
    60.       mp_perc = percent
    61.       break
    62.     end
    63.     $game_party.members.each do |actor|
    64.       next if actor.dead?
    65.       actor.hp += actor.maxhp * hp_perc / 100
    66.       actor.mp += actor.maxmp * mp_perc / 100
    67.     end
    68.   end
    69.   def display_exp_and_gold
    70.     process_aftermath_healing
    71.     kyon_btl_score_scn_btl_disp_exp_gold
    72.   end
    73. end
    复制代码


    Spoiler: Just Healing
                    Ruby:       
    1. # * KAftermathHealing VX * #
    2. #   Scripter : Kyonides Arkanthes
    3. #   v0.3.1 - 2024-10-01
    4. # This script lets you automatically heal your heroes after winning a battle
    5. # based on the number of battle turns.
    6. module KBattle
    7.   # Leave these hashes alone!
    8.   HP_TOTAL_TURNS = {}
    9.   MP_TOTAL_TURNS = {}
    10.   # If it took too long to defeat the enemy troopers...
    11.   HP_TOTAL_TURNS.default = 0
    12.   MP_TOTAL_TURNS.default = 0
    13.   # Add as many Ranges, i.e. 1..50 as necessary:
    14.   HP_TOTAL_TURNS[1..6]   = 100
    15.   HP_TOTAL_TURNS[7..17]  = 75
    16.   HP_TOTAL_TURNS[18..35] = 50
    17.   HP_TOTAL_TURNS[36..60] = 25
    18.   MP_TOTAL_TURNS[1..5]   = 100
    19.   MP_TOTAL_TURNS[6..15]  = 75
    20.   MP_TOTAL_TURNS[16..30] = 50
    21.   MP_TOTAL_TURNS[31..50] = 25
    22. end
    23. class Range
    24.   def <=>(other)
    25.     to_a <=> other.to_a
    26.   end
    27. end
    28. class Scene_Battle
    29.   alias :kyon_btl_score_scn_btl_proc_victory :process_victory
    30.   def process_aftermath_healing
    31.     hp_perc = mp_perc = 0
    32.     turns = $game_troop.turn_count
    33.     KBattle::HP_TOTAL_TURNS.sort.reverse.each do |min_turns, percent|
    34.       next unless min_turns.include?(turns)
    35.       hp_perc = percent
    36.       break
    37.     end
    38.     KBattle::MP_TOTAL_TURNS.sort.reverse.each do |min_turns, percent|
    39.       next unless min_turns.include?(turns)
    40.       mp_perc = percent
    41.       break
    42.     end
    43.     $game_party.members.each do |actor|
    44.       next if actor.dead?
    45.       actor.hp += actor.maxhp * hp_perc / 100
    46.       actor.mp += actor.maxmp *mp_perc / 100
    47.     end
    48.   end
    49.   def process_victory
    50.     process_aftermath_healing
    51.     kyon_btl_score_scn_btl_proc_victory
    52.   end
    53. end
    复制代码




    Terms & Conditions

    Free for use in ANY game.

    Due credit is mandatory!
    Include this forum in your game credits as well!
    That's it!



    本贴来自国际rpgmaker官方论坛作者:kyonides处,因国际论坛即将永久关站,为了存档多年珍贵资料,署名转载到本论坛存档,由于官方帖子为英文原帖,需要中文翻译请点击论坛顶部切换语言为中文就可以将帖子翻译成中文浏览,方便大家随时查看,原文地址:https://forums.rpgmakerweb.com/threads/kaftermathspoils-vx.172303/

    本帖子中包含更多资源

    您需要 登录 才可以下载或查看,没有账号?立即注册

    x
    天天去同能,天天有童年!
    回复 送礼论坛版权

    使用道具 举报

    文明发言,和谐互动
    文明发言,和谐互动
    高级模式
    您需要登录后才可以回帖 登录 | 立即注册

    本版积分规则

    简体中文
    繁體中文
    English(英语)
    日本語(日语)
    Deutsch(德语)
    Русский язык(俄语)
    بالعربية(阿拉伯语)
    Türkçe(土耳其语)
    Português(葡萄牙语)
    ภาษาไทย(泰国语)
    한어(朝鲜语/韩语)
    Français(法语)
    关闭

    幸运抽奖

    社区每日抽奖来袭,快来试试你是欧皇还是非酋~

    立即查看

    聊天机器人
    Loading...

    QQ|Archiver|手机版|小黑屋|同能RPG制作大师 ( 沪ICP备12027754号-3 )

    GMT+8, 2026-7-30 20:29 , Processed in 0.092640 second(s), 55 queries .

    Powered by Discuz! X3.4

    Copyright © 2001-2020, Tencent Cloud.

    快速回复 返回顶部 返回列表