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

[转载发布] Group Defeat Loot (Yanfly YEP State Categories extension)

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

    连续签到: 2 天

    [LV.7]常住居民III

    6501

    主题

    864

    回帖

    3万

    积分

    管理员

    Rank: 9Rank: 9Rank: 9

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

    灌水之王

    发表于 昨天 22:12 | 显示全部楼层 |阅读模式
    FBE Group Defeat Loot (YEP State Categories extension) v1.01
    by FeatherBrain

    Introduction
    Extension for Yanfly's YEP State Categories plugin so enemies with the <Group Defeat> category leave loot at the end of battle.

    Features
    YEP State Categories contains a <Group Defeat> notetag. If all group members are afflicted by states that have this notetag, it is considered a lost battle.

    However, by default, enemies that are in this "group defeat" category do not yield any loot (experience, gold, or items) when the battle ends.

    This plugin extension modifies the Game_Troop functions related to experience, gold, and items so that enemies who are in a "Group Defeat" state at the end of battle DO yield experience, gold, and items, just as they would if they were in the regular "dead" state.

    Plugin also supports Yanfly's Job Points plugin. Enemies in a "Group Defeat" state at the end of battle will reward Job Points appropriately.

    Terms of Use
    Free for any use. Credit "FeatherBrain Entertainment" if you want.

    Compatibility
    Requires YEP State Categories. Place this plugin beneath State Categories and Job Points (if using).
    No known incompatibilities, please report any issues to this thread.

    Update History
    * v1.0 - initial release
    * v1.01 - added support for Yanfly's Job Points plugin


                    JavaScript:       
    1. //=============================================================================
    2. // FBE_GroupDefeatLoot.js
    3. //=============================================================================
    4. /*:
    5. * @plugindesc v1.01 Extension for Yanfly's YEP State Categories plugin so enemies with the <Group Defeat> category leave loot at the end of battle.
    6. *
    7. * @author FeatherBrain Entertainment
    8. *
    9. * @help
    10. *
    11. * Purpose/Use:
    12. *
    13. * YEP State Categories contains a <Group Defeat> notetag. If all group members
    14. * are afflicted by states that have this notetag, it is considered a lost battle.
    15. * However, by default, enemies that are in this "group defeat" category do not
    16. * yield any loot (experience, gold, or items) when the battle ends.
    17. *
    18. * This plugin extension modifies the Game_Troop functions related to experience,
    19. * gold, and items so that enemies who are in a "Group Defeat" state at the end
    20. * of battle DO yield experience, gold, and items, just as they would if they
    21. * were in the regular "dead" state.
    22. *
    23. * Plugin also supports Yanfly's Job Points plugin. Enemies in a "Group Defeat"
    24. * state at the end of battle will reward Job Points appropriately.
    25. *
    26. * TERMS OF USE
    27. * Free for any use. Credit FeatherBrain Entertainment if you want.
    28. *
    29. * COMPATIBILITY
    30. * Requires YEP State Categories. Place this plugin beneath State Categories
    31. * and Job Points (if using).
    32. *
    33. * UPDATE HISTORY
    34. * v1.0 - initial release
    35. * v1.01 - added support for Yanfly's Job Points plugin
    36. *
    37. */
    38. //============================================================================
    39. (function() {
    40. //-----------------------------------------------------------------------------
    41. // Game_Unit
    42. //
    43. // The superclass of Game_Party and Game_Troop.
    44. Game_Unit.prototype.groupDefeatMembers = function() {
    45.     return this.members().filter(function(member) {
    46.         return member.isGroupDefeatAffected();
    47.     });
    48. };
    49. //-----------------------------------------------------------------------------
    50. // Game_Troop
    51. //
    52. // The game object class for a troop and the battle-related data.
    53. var FBE_Game_Troop_expTotal = Game_Troop.prototype.expTotal;
    54. Game_Troop.prototype.expTotal = function() {
    55.     var deadMemberExp = FBE_Game_Troop_expTotal.call(this);
    56.     var groupDefeatExp = this.groupDefeatMembers().reduce(function(r, enemy) {
    57.         return r + enemy.exp();
    58.     }, 0);
    59.     return deadMemberExp + groupDefeatExp;
    60. };
    61. var FBE_Game_Troop_goldTotal = Game_Troop.prototype.goldTotal;
    62. Game_Troop.prototype.goldTotal = function() {
    63.     var deadMemberGold = FBE_Game_Troop_goldTotal.call(this);
    64.     var groupDefeatGold = this.groupDefeatMembers().reduce(function(r, enemy) {
    65.         return r + enemy.gold();
    66.     }, 0) * this.goldRate();
    67.     return deadMemberGold + groupDefeatGold;
    68. };
    69. var FBE_Game_Troop_makeDropItems = Game_Troop.prototype.makeDropItems;
    70. Game_Troop.prototype.makeDropItems = function() {
    71.     var deadMemberItems = FBE_Game_Troop_makeDropItems.call(this);
    72.     var groupDefeatItems = this.groupDefeatMembers().reduce(function(r, enemy) {
    73.         return r.concat(enemy.makeDropItems());
    74.     }, []);
    75.     return groupDefeatItems.concat(deadMemberItems);
    76. };
    77. var FBE_Game_Troop_jpTotal = Game_Troop.prototype.jpTotal;
    78. Game_Troop.prototype.jpTotal = function() {
    79.     var deadMemberJP = FBE_Game_Troop_jpTotal.call(this);
    80.     var groupDefeatJP = this.groupDefeatMembers().reduce(function(r, enemy) {
    81.         return r + enemy.jp();
    82.     }, 0);
    83.     return deadMemberJP + groupDefeatJP;
    84. };
    85.    
    86. })();
    复制代码




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

    本帖子中包含更多资源

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

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

    使用道具 举报

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

    本版积分规则

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

    幸运抽奖

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

    立即查看

    聊天机器人
    Loading...

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

    GMT+8, 2026-7-28 01:33 , Processed in 0.136404 second(s), 59 queries .

    Powered by Discuz! X3.4

    Copyright © 2001-2020, Tencent Cloud.

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