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

[转载发布] KursedVictory ACE

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

    连续签到: 2 天

    [LV.7]常住居民III

    9071

    主题

    864

    回帖

    6万

    积分

    管理员

    Rank: 9Rank: 9Rank: 9

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

    灌水之王

    发表于 2026-8-3 13:33:34 | 显示全部楼层 |阅读模式
    KursedVictory ACE

    by Kyonides


    Introduction

    You will either love this scriptlet or just hate it.

    Sometimes the heroes cannot simply obtain a flawless victory. That would be inconceivable!

    Thus, they need some final punishment to make sure they learn their lesson!


    Just add enemy ID's to the ENEMY_IDS constant to make this happen!


    Or leave this note tag in the enemy's notebox: curse_victory

    Warning:
    If you refuse to comply, you might have to fight another troop...

    Spoiler: Screenshots


    The Script

                    Ruby:       
    1. # * KursedVictory ACE * #
    2. #   Scripter : Kyonides
    3. #   v1.2.0 - 2025-09-09
    4. # Sometimes the heroes cannot simply obtain a flawless victory. Thus, they need
    5. # some final punishment to make sure they learn their lesson!
    6. # - Method #1
    7. # Just add enemy ID's to the ENEMY_IDS constant to make this happen!
    8. # - Method #2
    9. # Leave a note tag in the enemy's notebox: curse_victory
    10. # Warning: If you refuse to comply, you might have to fight another troop...
    11. module KursedVictory
    12.   BGS = "Darkness"
    13.   CURSOR = "sword0132"
    14.   CURSOR_OY = 4
    15.   OPTION_BACKDROP = "box240"
    16.   MESSAGE = ["Flawless Victory!", "Now choose a curse victim!"]
    17.   OPTIONS = ["Comply", "Refuse"]
    18.   OUTCOME = ["You complied with the %s's demand.",
    19.              "You refused to listen to %s."]
    20.   CURSE_CHANCE = 100
    21.   WAIT_FRAMES = 40
    22.   ENEMY_NOTE_TAG = /curse_victory/i
    23.   ENEMY_IDS = []
    24.   ROUND2_ENEMY_IDS = {}
    25.   ROUND2_ENEMY_IDS[1] = { :name => "Basilisk", :troop_id => 2 }
    26. end
    27. class Game_Enemy
    28.   def cursed_victory_note
    29.     @cursed_victory ||= enemy.note[KursedVictory::ENEMY_NOTE_TAG]
    30.   end
    31.   def curse_victory?
    32.     return true if KursedVictory::ENEMY_IDS.include?(@enemy_id)
    33.     cursed_victory_note != nil
    34.   end
    35. end
    36. class Game_Party
    37.   def dead_members
    38.     members.select {|member| member.dead? }
    39.   end
    40.   def all_dead_now?
    41.     dead_members.size == @actors.size
    42.   end
    43. end
    44. class Game_Troop
    45.   def curse_flawless_victory?
    46.     enemy = @enemies.find {|enemy| enemy.curse_victory? }
    47.     enemy != nil
    48.   end
    49.   attr_reader :troop_id
    50. end
    51. class CursedMessageWindow < Window_Base
    52.   def initialize(wx, wy)
    53.     super(wx, wy, 280, 76)
    54.     refresh
    55.   end
    56.   def refresh
    57.     line1, line2 = KursedVictory::MESSAGE
    58.     font = self.contents.font
    59.     font.bold = true
    60.     font.color.set(220, 80, 0)
    61.     self.contents.draw_text(0, 0, width - 32, 24, line1, 1)
    62.     font.bold = false
    63.     font.color.set(255, 255, 255)
    64.     self.contents.draw_text(0, 26, width - 32, 24, line2, 1)
    65.   end
    66. end
    67. module KursedVictory
    68.   class Message < Window_Base
    69.     def set_text(text)
    70.       contents.clear
    71.       contents.draw_text(0, 0, contents.width, 24, text)
    72.       self.visible = true
    73.       self.pause = true
    74.     end
    75.   end
    76.   class TextBox
    77.     def initialize(pos, total, vp=nil)
    78.       @index = pos
    79.       @max = total
    80.       @row_max = 2
    81.       @col_max = 1
    82.       @viewport = vp
    83.       @backdrop = Sprite.new(vp)
    84.       @label = Sprite.new(vp)
    85.       @label.z = 50
    86.     end
    87.     def set_image(filename)
    88.       @filename = filename
    89.       set_bitmap
    90.       set_text_bitmap
    91.       reset_alignment
    92.     end
    93.     def set_bitmap
    94.       bitmap = Cache.picture(@filename)
    95.       @width = bitmap.width
    96.       @height = bitmap.height
    97.       @rect = bitmap.rect
    98.       @col_width = Graphics.width
    99.       @center_x = (@col_width - @width) / 2
    100.       @backdrop.bitmap = bitmap
    101.     end
    102.     def set_text_bitmap
    103.       @align_x = 1
    104.       @label.bitmap = Bitmap.new(@width, @height)
    105.     end
    106.     def set_align_xy
    107.       h = @height + 24
    108.       @backdrop.x = @center_x
    109.       @backdrop.y = 140 + @index * h
    110.     end
    111.     def reset_alignment
    112.       set_align_xy
    113.       @label.x = @backdrop.x
    114.       @label.y = @backdrop.y
    115.     end
    116.     def x
    117.       @backdrop.x
    118.     end
    119.     def y
    120.       @backdrop.y
    121.     end
    122.     def set_text(text)
    123.       @text = text
    124.       bit = @label.bitmap
    125.       bit.clear
    126.       bit.draw_text(@rect, text, @align_x)
    127.     end
    128.     def dispose
    129.       @label.bitmap.dispose
    130.       @label.dispose
    131.       @backdrop.bitmap.dispose
    132.       @backdrop.dispose
    133.     end
    134.     attr_reader :text
    135.   end
    136.   class Spriteset
    137.     def initialize
    138.       @curse_viewport = Viewport.new
    139.       @curse_viewport.z = 500
    140.       @curse_boxes = []
    141.       @curse_x = []
    142.       @curse_y = []
    143.       filename = KursedVictory::OPTION_BACKDROP
    144.       options = KursedVictory::OPTIONS
    145.       options.each_with_index do |choice, n|
    146.         box = KursedVictory::TextBox.new(n, options.size, @curse_viewport)
    147.         box.set_image(filename)
    148.         box.set_text(choice)
    149.         @curse_x << box.x
    150.         @curse_y << box.y + KursedVictory::CURSOR_OY
    151.         @curse_boxes << box
    152.       end
    153.       @cursed_cursor = Sprite.new(@curse_viewport)
    154.       @cursed_cursor.x = @curse_x[0]
    155.       @cursed_cursor.y = @curse_y[0]
    156.       @cursed_cursor.z = 100
    157.       @cursed_cursor.bitmap = Cache.picture(KursedVictory::CURSOR)
    158.     end
    159.     def move_cursor(index)
    160.       @cursed_cursor.y = @curse_y[index]
    161.     end
    162.     def dispose
    163.       @curse_boxes.each {|box| box.dispose }
    164.       @cursed_cursor.bitmap.dispose
    165.       @cursed_cursor.dispose
    166.       @curse_viewport.dispose
    167.     end
    168.   end
    169. end
    170. class << BattleManager
    171.   alias :kyon_kurvic_btlman_proc_victor :process_victory
    172.   def process_victory
    173.     process_cursed_victory
    174.     if @cursed_victory and $game_party.all_dead_now?
    175.       process_defeat
    176.       return true
    177.     end
    178.     kyon_kurvic_btlman_proc_victor
    179.     start_anti_curse_battle if @curse_lifted
    180.     @curse_lifted = nil
    181.     true
    182.   end
    183.   def process_cursed_victory
    184.     return if KursedVictory::CURSE_CHANCE < rand(100)
    185.     return unless $game_troop.curse_flawless_victory?
    186.     return if $game_party.dead_members.size > 0
    187.     RPG::BGM.stop
    188.     @bgs = RPG::BGS.new(KursedVictory::BGS)
    189.     @bgs.play
    190.     @scene = SceneManager.scene
    191.     @scene.create_cursed_message
    192.     @scene.start_cursed_victory
    193.   end
    194.   def start_anti_curse_battle
    195.     RPG::BGM.stop
    196.     RPG::BGS.stop
    197.     $game_party.clear_actions
    198.     $game_troop.clear
    199.     $game_troop.setup(@next_troop_id)
    200.     @next_troop_id = nil
    201.     Sound.play_battle_start
    202.     BattleManager.play_battle_bgm
    203.     SceneManager.call(Scene_Battle)
    204.   end
    205.   attr_writer :cursed_victory, :next_troop_id
    206.   attr_accessor :curse_lifted
    207. end
    208. class Scene_Battle
    209.   def create_cursed_message
    210.     wx = (Graphics.width - 280) / 2
    211.     @cursed_message = CursedMessageWindow.new(wx, 40)
    212.     @info_viewport.visible = true
    213.     @party_command_window.contents.clear
    214.     @party_command_window.index = -1
    215.     @message_window.visible = false
    216.     @status_window.index = 0
    217.     @status_window.active = true
    218.     @outcome_window = KursedVictory::Message.new(0, 288, 544, 128)
    219.     @outcome_window.visible = false
    220.   end
    221.   def start_cursed_victory
    222.     troop_id = $game_troop.troop_id
    223.     @round2_data = KursedVictory::ROUND2_ENEMY_IDS[troop_id]
    224.     if @round2_data
    225.       process_cursed_victory_options
    226.       return if BattleManager.curse_lifted
    227.     end
    228.     process_cursed_victory_execution
    229.   end
    230.   def process_cursed_victory_options
    231.     @cursed_spriteset = KursedVictory::Spriteset.new
    232.     @curse_stage = 0
    233.     @curse_index = 0
    234.     while @curse_stage
    235.       Graphics.update
    236.       Input.update
    237.       update_cursed_victory
    238.     end
    239.   end
    240.   def update_cursed_victory
    241.     case @curse_stage
    242.     when 0
    243.       update_cursed_victory_options
    244.     when 1
    245.       update_cursed_victory_decision
    246.     end
    247.   end
    248.   def update_cursed_victory_options
    249.     if Input.trigger?(:UP) or Input.trigger?(:DOWN)
    250.       Sound.play_cursor
    251.       @curse_index = (@curse_index + 1) % 2
    252.       @cursed_spriteset.move_cursor(@curse_index)
    253.       return
    254.     elsif Input.trigger?(:C)
    255.       Sound.play_ok
    256.       name = @round2_data[:name]
    257.       if name
    258.         text = KursedVictory::OUTCOME[@curse_index]
    259.         text = sprintf(text, name)
    260.       end
    261.       @cursed_spriteset.dispose
    262.       if @curse_index == 1
    263.         RPG::BGS.stop
    264.         BattleManager.curse_lifted = true
    265.         BattleManager.next_troop_id = @round2_data[:troop_id]
    266.         @cursed_message.dispose
    267.         @cursed_message = nil
    268.       end
    269.       if name
    270.         @outcome_window.set_text(text)
    271.         @status_window.visible = false
    272.         @curse_stage = 1
    273.       else
    274.         @curse_stage = nil
    275.       end
    276.     end
    277.   end
    278.   def update_cursed_victory_decision
    279.     @outcome_window.update
    280.     if Input.trigger?(:C)
    281.       Sound.play_ok
    282.       state = @curse_index == 0
    283.       BattleManager.cursed_victory = state
    284.       @status_window.visible = state
    285.       @message_window.visible = !state
    286.       @outcome_window.dispose
    287.       @outcome_window = @curse_stage = nil
    288.     end
    289.   end
    290.   def process_cursed_victory_execution
    291.     while @curse_index
    292.       Graphics.update
    293.       Input.update
    294.       update_cursed_victory_execution
    295.     end
    296.     KursedVictory::WAIT_FRAMES.times { Graphics.update }
    297.     @message_window.visible = true
    298.     @cursed_message.dispose
    299.     @cursed_message = nil
    300.   end
    301.   def update_cursed_victory_execution
    302.     @status_window.update
    303.     if Input.trigger?(:C)
    304.       Sound.play_ok
    305.       n = @status_window.index
    306.       $game_party.members[n].add_state(1)
    307.       BattleManager.cursed_victory = nil
    308.       @status_window.refresh
    309.       @status_window.active = false
    310.       @curse_index = nil
    311.     end
    312.   end
    313. end
    复制代码




    Terms & Conditions

    Free as in beer for non commercial games.
    Include my nickname in your game credits.
    That's it!



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

    本帖子中包含更多资源

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

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

    使用道具 举报

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

    本版积分规则

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

    幸运抽奖

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

    立即查看

    聊天机器人
    Loading...

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

    GMT+8, 2026-8-17 06:15 , Processed in 0.120859 second(s), 56 queries .

    Powered by Discuz! X3.4

    Copyright © 2001-2020, Tencent Cloud.

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