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

[转载发布] BattleEnd XP

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

    连续签到: 2 天

    [LV.7]常住居民III

    6120

    主题

    864

    回帖

    3万

    积分

    管理员

    Rank: 9Rank: 9Rank: 9

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

    灌水之王

    发表于 2026-7-19 16:06:17 | 显示全部楼层 |阅读模式
    BattleEnd XP

    by Kyonides


    Introduction

    As many years passed, some RMXP scripts got lost in the sands of time for many reasons. This is why I thought that offering you another option for improving the Party's Victory processing stage was something very convenient for everybody.

    What this scriptlet does is simple:

    It rewrites the Scene_Battle#start_phase5 by subdividing it into several other methods that handle very specific stuff.
    Then I added a Game Variable and a Game Switch to alter its normal behavior.

    The Game Variable handles how much EXP your heroes will get.

    • 0 stands for EXP divided by Total Heroes
    • 1 stands for EXP divided by Total Heroes * 2
    • 2 stands for Full EXP
    The Game Switch defines if the Party will get the whole list of Treasures.
    The Party will only get up to 5 Treasures if the Game Switch is OFF.

                    Ruby:       
    1. # * BattleEnd XP * #
    2. #   Scripter : Kyonides Arkanthes
    3. #   2023-06-16
    4. # - Values for VAR_FULL_EXP Game Variable:
    5. # 0 - EXP divided by Total Heroes
    6. # 1 - EXP divided by Total Heroes * 2 (Punishment)
    7. # 2 - Full EXP (Reward)
    8. # - SWITCH_ALL_TREASURES Game Switch allows you to let the party get all of
    9. #   the treasures they have earned instead of just 5 of them.
    10. module BattleEnd
    11.   VAR_FULL_EXP = 1
    12.   SWITCH_ALL_TREASURES = 1
    13. end
    14. class Scene_Battle
    15.   def start_phase5
    16.     @phase = 5
    17.     $game_system.me_play($game_system.battle_end_me)
    18.     $game_system.bgm_play($game_temp.map_bgm)
    19.     process_exp_gold_treasures
    20.     limit_treasures
    21.     distribute_treasures
    22.     distribute_exp_gold
    23.   end
    24.   def process_exp_gold_treasures
    25.     @exp = 0
    26.     @gold = 0
    27.     @treasures = []
    28.     for enemy in $game_troop.enemies
    29.       next if enemy.hidden
    30.       @exp += enemy.exp
    31.       @gold += enemy.gold
    32.       if rand(100) < enemy.treasure_prob
    33.         if enemy.item_id > 0
    34.           @treasures << $data_items[enemy.item_id]
    35.         elsif enemy.weapon_id > 0
    36.           @treasures << $data_weapons[enemy.weapon_id]
    37.         elsif enemy.armor_id > 0
    38.           @treasures << $data_armors[enemy.armor_id]
    39.         end
    40.       end
    41.     end
    42.   end
    43.   def limit_treasures
    44.     return if $game_variables[BattleEnd::SWITCH_ALL_TREASURES]
    45.     @treasures = @treasures[0..5]
    46.   end
    47.   def gain_treasure(item_id)
    48.     case item
    49.     when RPG::Item
    50.       $game_party.gain_item(item.id, 1)
    51.     when RPG::Weapon
    52.       $game_party.gain_weapon(item.id, 1)
    53.     when RPG::Armor
    54.       $game_party.gain_armor(item.id, 1)
    55.     end
    56.   end
    57.   def distribute_treasures
    58.     @treasures.each {|treasure| gain_treasure(treasure.id) }
    59.   end
    60.   def distribute_exp(actor)
    61.     case $game_variables[BattleEnd::VAR_FULL_EXP]
    62.     when 0
    63.       @final_exp = @exp / $game_party.actors.size
    64.       actor.exp += @final_exp
    65.     when 1
    66.       @final_exp = @exp / $game_party.actors.size / 2
    67.       actor.exp += @final_exp
    68.     when 2
    69.       @final_exp = @exp
    70.       actor.exp += @exp
    71.     end
    72.   end
    73.   def distribute_exp_gold
    74.     $game_party.actors.each_with_index do |actor, i|
    75.       next if actor.cant_get_exp?
    76.       last_level = actor.level
    77.       distribute_exp(actor)
    78.       @status_window.level_up(i) if actor.level > last_level
    79.     end
    80.     $game_party.gain_gold(@gold)
    81.     @result_window = Window_BattleResult.new(@final_exp, @gold, @treasures)
    82.     @phase5_wait_count = 100
    83.   end
    84. end
    复制代码


    Terms & Conditions

    Free for use in any game.
    Due credit is mandatory.
    That's it!



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

    本帖子中包含更多资源

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

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

    使用道具 举报

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

    本版积分规则

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

    幸运抽奖

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

    立即查看

    聊天机器人
    Loading...

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

    GMT+8, 2026-7-27 07:03 , Processed in 0.120384 second(s), 56 queries .

    Powered by Discuz! X3.4

    Copyright © 2001-2020, Tencent Cloud.

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