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

[转载发布] Random Game Over v1.1

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

    连续签到: 2 天

    [LV.7]常住居民III

    7959

    主题

    864

    回帖

    3万

    积分

    管理员

    Rank: 9Rank: 9Rank: 9

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

    灌水之王

    发表于 3 天前 | 显示全部楼层 |阅读模式
    Introduction
    This plugin allows the developer to randomise the defeat ME, Game Over image, and Game Over ME.
    Hue and pitch variances may also be set.

    How to use
    Save it as APHO_RandomGameOver.js and put it in your plugin folder.
    You will also need to create a 'gameover' folder in your 'img' folder for the Game Over images.
    Specify the list of images/MEs that will be used via the plugin parameters.
    You may also specify a minimum and maximum hue adjustment range for the Game Over image, as well as a minimum and maximum pitch for the MEs, which will be applied at random. If you do not wish to use this feature, you can set the min and max to the same value.
    You may also specify another optional image to be overlayed over the Game Over image. Useful for if you want to randomise the Game Over message independently from the background, or apply different hue adjustments to different parts.

    Script
    Spoiler: CODE
                    JavaScript:       
    1. //==========================================
    2. // APHO_RandomGameOver.js
    3. //==========================================
    4. /*:
    5. * @title Random Game Over
    6. * @author Apho
    7. * @plugindesc v1.1 Allows for randomising the defeat ME, Game Over image, and Game Over ME, and having hue and pitch variances for them.
    8. *
    9. * @param DefeatMEList
    10. * @text Defeat ME list
    11. * @type file[]
    12. * @dir audio/me
    13. * @require 1
    14. * @desc Pool of MEs for when the player falls in battle.
    15. * @default ["Defeat1", "Defeat2"]
    16. *
    17. * @param DefeatVolume
    18. * @text Defeat volume
    19. * @type number
    20. * @desc Volume of the Defeat ME.
    21. * @default 90
    22. *
    23. * @param DefeatPitchMin
    24. * @text Defeat minimum pitch
    25. * @type number
    26. * @desc Minimum pitch of the Defeat ME.
    27. * @default 100
    28. *
    29. * @param DefeatPitchMax
    30. * @text Defeat maximum pitch
    31. * @type number
    32. * @desc Maximum pitch of the Defeat ME.
    33. * @default 120
    34. *
    35. * @param ImageList
    36. * @text Game Over image list
    37. * @type file[]
    38. * @dir img/gameover
    39. * @require 1
    40. * @desc Pool of images for the Game Over screen.
    41. *
    42. * @param HueMin
    43. * @text Minimum hue
    44. * @type number
    45. * @desc Minimum hue adjustment for the gameover image.
    46. * @min -360
    47. * @default -180
    48. *
    49. * @param HueMax
    50. * @text Maximum hue
    51. * @type number
    52. * @desc Maximum hue adjustment for the gameover image.
    53. * @min -360
    54. * @default 180
    55. *
    56. * @param OverlayList
    57. * @text Game Over overlay list
    58. * @type file[]
    59. * @dir img/gameover
    60. * @desc (Optional)Pool of images to be overlayed over the Game Over screen
    61. *
    62. * @param OverlayHueMin
    63. * @text Minimum hue (Overlay)
    64. * @type number
    65. * @desc Minimum hue adjustment for the gameover overlay.
    66. * @min -360
    67. * @default 0
    68. *
    69. * @param OverlayHueMax
    70. * @text Maximum hue (Overlay)
    71. * @type number
    72. * @desc Maximum hue adjustment for the gameover overlay.
    73. * @min -360
    74. * @default 0
    75. *
    76. * @param GameOverMEList
    77. * @text Game Over ME list
    78. * @type file[]
    79. * @dir audio/me
    80. * @require 1
    81. * @desc Pool of MEs for the Game Over screen.
    82. * @default ["GameOver1", "GameOver2"]
    83. *
    84. * @param GameOverVolume
    85. * @text Game Over volume
    86. * @type number
    87. * @desc Volume of the Game Over ME.
    88. * @default 90
    89. *
    90. * @param GameOverPitchMin
    91. * @text Game Over minimum pitch
    92. * @type number
    93. * @desc Minimum pitch of the Game Over ME.
    94. * @default 100
    95. *
    96. * @param GameOverPitchMax
    97. * @text Game Over maximum pitch
    98. * @type number
    99. * @desc Maximum pitch of the Game Over ME.
    100. * @default 120
    101. *
    102. * @help
    103. * This plugin allows the developer to randomise the defeat ME, Game Over image,
    104. * and Game Over ME.
    105. * Hue and pitch variances may also be set.
    106. * You will need to create a 'gameover' folder in your img directory for the
    107. * gameover images.
    108. * You may also add an optional overlay over the Game Over image.
    109. *
    110. * TERMS OF USE
    111. * - Free for commercial and non-commercial use, as long as I get a free copy
    112. *   of the game.
    113. * - Edits allowed for personal use.
    114. * - Do not repost or claim as your own, even if edited.
    115. *
    116. * VERSION HISTORY
    117. * v1.1 - 2023/6/30 - Added optional overlay for the Game Over image.
    118. * v1.0 - 2023/6/28 - Initial release.
    119. */
    120. (function(){
    121.     var parameters = PluginManager.parameters('APHO_RandomGameOver');
    122.     var ImageList = JSON.parse(parameters['ImageList']);
    123.     var HueRange = Math.max(parseInt(parameters['HueMax']) - parseInt(parameters['HueMin']), 0);
    124.     if(parameters['OverlayList'] != '' && parameters['OverlayList'] != '[]')
    125.     {
    126.         var OverlayList = JSON.parse(parameters['OverlayList']);
    127.         var OverlayHueRange = Math.max(parseInt(parameters['OverlayHueMax']) - parseInt(parameters['OverlayHueMin']), 0);
    128.     }
    129.     var DefeatMEList = JSON.parse(parameters['DefeatMEList']);
    130.     var DefeatPitchRange = Math.max(parseInt(parameters['DefeatPitchMax']) - parseInt(parameters['DefeatPitchMin']), 0);
    131.     var DefeatVolume = parseInt(parameters['DefeatVolume']);
    132.     var GameOverMEList = JSON.parse(parameters['GameOverMEList']);
    133.     var GameOverPitchRange = Math.max(parseInt(parameters['GameOverPitchMax']) - parseInt(parameters['GameOverPitchMin']), 0);
    134.     var GameOverVolume = parseInt(parameters['GameOverVolume']);
    135.     BattleManager.playDefeatMe = function()
    136.     {
    137.         let Pitch = parseInt(parameters['DefeatPitchMin']) + Math.randomInt(DefeatPitchRange + 1);
    138.         let ME =
    139.         {
    140.             name: DefeatMEList[Math.randomInt(DefeatMEList.length)],
    141.             volume: DefeatVolume,
    142.             pitch: Pitch,
    143.             pan: 0
    144.         }
    145.         AudioManager.playMe(ME);
    146.     };
    147.     Scene_Gameover.prototype.createBackground = function()
    148.     {
    149.         let Hue = parseInt(parameters['HueMin']) + Math.randomInt(HueRange + 1);
    150.         let Image = ImageList[Math.randomInt(ImageList.length)];
    151.         this._backSprite = new Sprite(ImageManager.loadBitmap('img/gameover/', Image, Hue, false));
    152.         this.addChild(this._backSprite);
    153.         if(parameters['OverlayList'] != '' && parameters['OverlayList'] != '[]')
    154.         {
    155.             let OverlayHue = parseInt(parameters['OverlayHueMin']) + Math.randomInt(OverlayHueRange + 1);
    156.             let Overlay = OverlayList[Math.randomInt(OverlayList.length)];
    157.             this._overlay = new Sprite(ImageManager.loadBitmap('img/gameover/', Overlay, OverlayHue, false));
    158.             this.addChild(this._overlay);
    159.         }
    160.     };
    161.     Scene_Gameover.prototype.playGameoverMusic = function()
    162.     {
    163.         AudioManager.stopBgm();
    164.         AudioManager.stopBgs();
    165.         let Pitch = parseInt(parameters['GameOverPitchMin']) + Math.randomInt(GameOverPitchRange + 1);
    166.         let ME =
    167.         {
    168.             name: GameOverMEList[Math.randomInt(GameOverMEList.length)],
    169.             volume: GameOverVolume,
    170.             pitch: Pitch,
    171.             pan: 0
    172.         }
    173.         AudioManager.playMe(ME);
    174.     };
    175. })();
    复制代码


    Terms of use

    • Free for commercial and non-commercial use, as long as I get a free copy of the game.
    • Edits allowed for personal use.
    • Do not repost or claim as your own, even if edited.
    • Do not use for training AI models. This includes, but is not limited to, inputting the plugin contents or part thereof into AI models that train on user input.
    Version history
    v1.1 - 2023/6/30 - Added optional overlay for the Game Over image.
    v1.0 - 2023/6/28 - Initial release.

    Download link
    Github


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

    本帖子中包含更多资源

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

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

    使用道具 举报

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

    本版积分规则

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

    幸运抽奖

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

    立即查看

    聊天机器人
    Loading...

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

    GMT+8, 2026-8-1 04:49 , Processed in 0.086317 second(s), 55 queries .

    Powered by Discuz! X3.4

    Copyright © 2001-2020, Tencent Cloud.

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