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

[转载发布] KursedVictory VX

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

    连续签到: 2 天

    [LV.7]常住居民III

    5778

    主题

    864

    回帖

    3万

    积分

    管理员

    Rank: 9Rank: 9Rank: 9

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

    灌水之王

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

    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 VX * #
    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, 80)
    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, 24, width - 32, 24, line2, 1)
    65.   end
    66. end
    67. module KursedVictory
    68.   class TextBox
    69.     def initialize(pos, total, vp=nil)
    70.       @index = pos
    71.       @max = total
    72.       @row_max = 2
    73.       @col_max = 1
    74.       @viewport = vp
    75.       @backdrop = Sprite.new(vp)
    76.       @label = Sprite.new(vp)
    77.       @label.z = 50
    78.     end
    79.     def set_image(filename)
    80.       @filename = filename
    81.       set_bitmap
    82.       set_text_bitmap
    83.       reset_alignment
    84.     end
    85.     def set_bitmap
    86.       bitmap = Cache.picture(@filename)
    87.       @width = bitmap.width
    88.       @height = bitmap.height
    89.       @rect = bitmap.rect
    90.       @col_width = Graphics.width
    91.       @center_x = (@col_width - @width) / 2
    92.       @backdrop.bitmap = bitmap
    93.     end
    94.     def set_text_bitmap
    95.       @align_x = 1
    96.       @label.bitmap = Bitmap.new(@width, @height)
    97.     end
    98.     def set_align_xy
    99.       h = @height + 24
    100.       @backdrop.x = @center_x
    101.       @backdrop.y = 140 + @index * h
    102.     end
    103.     def reset_alignment
    104.       set_align_xy
    105.       @label.x = @backdrop.x
    106.       @label.y = @backdrop.y
    107.     end
    108.     def x
    109.       @backdrop.x
    110.     end
    111.     def y
    112.       @backdrop.y
    113.     end
    114.     def set_text(text)
    115.       @text = text
    116.       bit = @label.bitmap
    117.       bit.clear
    118.       bit.draw_text(@rect, text, @align_x)
    119.     end
    120.     def dispose
    121.       @label.bitmap.dispose
    122.       @label.dispose
    123.       @backdrop.bitmap.dispose
    124.       @backdrop.dispose
    125.     end
    126.     attr_reader :text
    127.   end
    128.   class Spriteset
    129.     def initialize
    130.       @curse_viewport = Viewport.new(0, 0, 640, 480)
    131.       @curse_viewport.z = 500
    132.       @curse_boxes = []
    133.       @curse_x = []
    134.       @curse_y = []
    135.       filename = KursedVictory::OPTION_BACKDROP
    136.       options = KursedVictory::OPTIONS
    137.       options.each_with_index do |choice, n|
    138.         box = KursedVictory::TextBox.new(n, options.size, @curse_viewport)
    139.         box.set_image(filename)
    140.         box.set_text(choice)
    141.         @curse_x << box.x
    142.         @curse_y << box.y + KursedVictory::CURSOR_OY
    143.         @curse_boxes << box
    144.       end
    145.       @cursed_cursor = Sprite.new(@curse_viewport)
    146.       @cursed_cursor.x = @curse_x[0]
    147.       @cursed_cursor.y = @curse_y[0]
    148.       @cursed_cursor.z = 100
    149.       @cursed_cursor.bitmap = Cache.picture(KursedVictory::CURSOR)
    150.     end
    151.     def move_cursor(index)
    152.       @cursed_cursor.y = @curse_y[index]
    153.     end
    154.     def dispose
    155.       @curse_boxes.each {|box| box.dispose }
    156.       @cursed_cursor.bitmap.dispose
    157.       @cursed_cursor.dispose
    158.       @curse_viewport.dispose
    159.     end
    160.   end
    161. end
    162. class Scene_Battle
    163.   alias :kyon_kurvic_scn_btl_proc_victor :process_victory
    164.   def process_victory
    165.     process_cursed_victory
    166.     if @cursed_victory and $game_party.all_dead_now?
    167.       process_defeat
    168.       return
    169.     end
    170.     kyon_kurvic_scn_btl_proc_victor
    171.     start_anti_curse_battle if @curse_lifted
    172.   end
    173.   def start_anti_curse_battle
    174.     RPG::BGM.stop
    175.     RPG::BGS.stop
    176.     $game_party.clear_actions
    177.     $game_troop.clear
    178.     $game_troop.setup(@round2_data[:troop_id])
    179.     Sound.play_battle_start
    180.     $game_system.battle_bgm.play
    181.     $scene = Scene_Battle.new
    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.     wx = (Graphics.width - 280) / 2
    191.     @cursed_message = CursedMessageWindow.new(wx, 40)
    192.     troop_id = $game_troop.troop_id
    193.     @round2_data = KursedVictory::ROUND2_ENEMY_IDS[troop_id]
    194.     if @round2_data
    195.       process_cursed_victory_options
    196.       return if @curse_lifted
    197.     end
    198.     process_cursed_victory_execution
    199.   end
    200.   def process_cursed_victory_options
    201.     @cursed_spriteset = KursedVictory::Spriteset.new
    202.     @curse_stage = 0
    203.     @curse_index = 0
    204.     @cursed_options = true
    205.     while @cursed_options
    206.       Graphics.update
    207.       Input.update
    208.       update_cursed_victory
    209.     end
    210.   end
    211.   def update_cursed_victory
    212.     case @curse_stage
    213.     when 0
    214.       update_cursed_victory_options
    215.     when 1
    216.       update_cursed_victory_decision
    217.     end
    218.   end
    219.   def update_cursed_victory_options
    220.     if Input.trigger?(Input::UP) or Input.trigger?(Input::DOWN)
    221.       Sound.play_cursor
    222.       @curse_index = (@curse_index + 1) % 2
    223.       @cursed_spriteset.move_cursor(@curse_index)
    224.       return
    225.     elsif Input.trigger?(Input::C)
    226.       Sound.play_decision
    227.       name = @round2_data[:name]
    228.       if name
    229.         text = KursedVictory::OUTCOME[@curse_index]
    230.         text = sprintf(text, name)
    231.       end
    232.       @cursed_spriteset.dispose
    233.       if @curse_index == 1
    234.         RPG::BGS.stop
    235.         @cursed_message.dispose
    236.         @curse_lifted = true
    237.       end
    238.       if name
    239.         ow = 460
    240.         $game_message.texts << text
    241.         @curse_stage = 1
    242.       else
    243.         @cursed_options = @curse_stage = nil
    244.       end
    245.     end
    246.   end
    247.   def update_cursed_victory_decision
    248.     @message_window.update
    249.     if Input.trigger?(Input::C)
    250.       Sound.play_decision
    251.       @cursed_options = @curse_stage = nil
    252.     end
    253.   end
    254.   def process_cursed_victory_execution
    255.     @info_viewport.visible = true
    256.     @party_command_window.contents.clear
    257.     @party_command_window.index = -1
    258.     @message_window.visible = false
    259.     @status_window.index = 0
    260.     @status_window.active = true
    261.     @cursed_victory = true
    262.     while @cursed_victory
    263.       Graphics.update
    264.       Input.update
    265.       update_cursed_victory_execution
    266.     end
    267.     KursedVictory::WAIT_FRAMES.times { Graphics.update }
    268.     @cursed_message.dispose
    269.     @info_viewport.visible = false
    270.     @cursed_victory = true
    271.   end
    272.   def update_cursed_victory_execution
    273.     @status_window.update
    274.     if Input.trigger?(Input::C)
    275.       Sound.play_decision
    276.       n = @status_window.index
    277.       $game_party.members[n].add_state(1)
    278.       @status_window.refresh
    279.       @status_window.active = false
    280.       @cursed_victory = nil
    281.     end
    282.   end
    283. 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-vx.180024/

    本帖子中包含更多资源

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

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

    使用道具 举报

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

    本版积分规则

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

    幸运抽奖

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

    立即查看

    聊天机器人
    Loading...

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

    GMT+8, 2026-7-26 03:55 , Processed in 0.067043 second(s), 60 queries .

    Powered by Discuz! X3.4

    Copyright © 2001-2020, Tencent Cloud.

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