KursedVictory VX + ACE
#1
KursedVictory VX + ACE

by Kyonides

Introduction

You will either love this scriptlet or just hate it. Laughing
Sometimes the heroes cannot simply obtain a flawless victory. That would be inconceivable! Incredible 
Thus, they need some final punishment to make sure they learn their lesson! Serious 

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

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

Screenshots

VX Script

Code:
# * KursedVictory VX * #
#   Scripter : Kyonides
#   v1.0.0 - 2025-09-06

# Sometimes the heroes cannot simply obtain a flawless victory. Thus, they need
# some final punishment to make sure they learn their lesson!
# - Method #1
# Just add enemy ID's to the ENEMY_IDS constant to make this happen!
# - Method #2
# Leave a note tag in the enemy's notebox: curse_victory

module KursedVictory
  BGS = "Darkness"
  MESSAGE = ["Flawless Victory!", "Now choose a curse victim!"]
  CURSE_CHANCE = 100
  WAIT_FRAMES = 40
  ENEMY_NOTE_TAG = /curse_victory/i
  ENEMY_IDS = []
end

class Game_Enemy
  def cursed_victory_note
    @cursed_victory ||= enemy.note[KursedVictory::ENEMY_NOTE_TAG]
  end

  def curse_victory?
    return true if KursedVictory::ENEMY_IDS.include?(@enemy_id)
    cursed_victory_note != nil
  end
end

class Game_Party
  def dead_members
    members.select {|member| member.dead? }
  end

  def all_dead_now?
    dead_members.size == @actors.size
  end
end

class Game_Troop
  def curse_flawless_victory?
    enemy = @enemies.find {|enemy| enemy.curse_victory? }
    enemy != nil
  end
end

class CursedMessageWindow < Window_Base
  def initialize(wx, wy)
    super(wx, wy, 280, 80)
    refresh
  end

  def refresh
    line1, line2 = KursedVictory::MESSAGE
    font = self.contents.font
    font.bold = true
    font.color.set(220, 80, 0)
    self.contents.draw_text(0, 0, width - 32, 24, line1, 1)
    font.bold = false
    font.color.set(255, 255, 255)
    self.contents.draw_text(0, 24, width - 32, 24, line2, 1)
  end
end

class Scene_Battle
  alias :kyon_kurvic_scn_btl_proc_victor :process_victory
  def process_victory
    process_cursed_victory
    if @cursed_victory and $game_party.all_dead_now?
      process_defeat
    else
      kyon_kurvic_scn_btl_proc_victor
    end
  end

  def process_cursed_victory
    return if KursedVictory::CURSE_CHANCE < rand(100)
    return unless $game_troop.curse_flawless_victory?
    return if $game_party.dead_members.size > 0
    RPG::BGM.stop
    @bgs = RPG::BGS.new(KursedVictory::BGS)
    @bgs.play
    wx = (Graphics.width - 280) / 2
    @cursed_message = CursedMessageWindow.new(wx, 40)
    @info_viewport.visible = true
    @party_command_window.contents.clear
    @party_command_window.index = -1
    @message_window.visible = false
    @status_window.index = 0
    @status_window.active = true
    @cursed_victory = true
    while @cursed_victory
      Graphics.update
      Input.update
      update_cursed_victory
    end
    KursedVictory::WAIT_FRAMES.times { Graphics.update }
    @cursed_message.dispose
    @info_viewport.visible = false
    @cursed_victory = true
  end

  def update_cursed_victory
    @status_window.update
    if Input.trigger?(Input::C)
      Sound.play_decision
      n = @status_window.index
      $game_party.members[n].add_state(1)
      @status_window.refresh
      @status_window.active = false
      @cursed_victory = nil
    end
  end
end

VX ACE Script

Code:
# * KursedVictory ACE * #
#   Scripter : Kyonides
#   v1.0.0 - 2025-09-07

# Sometimes the heroes cannot simply obtain a flawless victory. Thus, they need
# some final punishment to make sure they learn their lesson!
# - Method #1
# Just add enemy ID's to the ENEMY_IDS constant to make this happen!
# - Method #2
# Leave a note tag in the enemy's notebox: curse_victory

module KursedVictory
  BGS = "Darkness"
  MESSAGE = ["Flawless Victory!", "Now choose a curse victim!"]
  CURSE_CHANCE = 100
  WAIT_FRAMES = 40
  ENEMY_NOTE_TAG = /curse_victory/i
  ENEMY_IDS = []
end

class Game_Enemy
  def cursed_victory_note
    @cursed_victory ||= enemy.note[KursedVictory::ENEMY_NOTE_TAG]
  end

  def curse_victory?
    return true if KursedVictory::ENEMY_IDS.include?(@enemy_id)
    cursed_victory_note != nil
  end
end

class Game_Party
  def dead_members
    members.select {|member| member.dead? }
  end

  def all_dead_now?
    dead_members.size == @actors.size
  end
end

class Game_Troop
  def curse_flawless_victory?
    enemy = @enemies.find {|enemy| enemy.curse_victory? }
    enemy != nil
  end
end

class CursedMessageWindow < Window_Base
  def initialize(wx, wy)
    super(wx, wy, 280, 76)
    refresh
  end

  def refresh
    line1, line2 = KursedVictory::MESSAGE
    font = self.contents.font
    font.bold = true
    font.color.set(220, 80, 0)
    self.contents.draw_text(0, 0, width - 32, 24, line1, 1)
    font.bold = false
    font.color.set(255, 255, 255)
    self.contents.draw_text(0, 26, width - 32, 24, line2, 1)
  end
end

class << BattleManager
  alias :kyon_kurvic_btlman_proc_victor :process_victory
  def process_victory
    process_cursed_victory
    if @cursed_victory and $game_party.all_dead_now?
      process_defeat
    else
      kyon_kurvic_btlman_proc_victor
    end
    true
  end

  def process_cursed_victory
    return if KursedVictory::CURSE_CHANCE < rand(100)
    return unless $game_troop.curse_flawless_victory?
    return if $game_party.dead_members.size > 0
    RPG::BGM.stop
    @bgs = RPG::BGS.new(KursedVictory::BGS)
    @bgs.play
    @scene = SceneManager.scene
    @scene.create_cursed_message
    @cursed_victory = true
    while @cursed_victory
      Graphics.update
      Input.update
      @scene.update_cursed_victory
    end
    KursedVictory::WAIT_FRAMES.times { Graphics.update }
    @scene.hide_cursed_message
    @cursed_victory = true
  end
  attr_writer :cursed_victory
end

class Scene_Battle
  def create_cursed_message
    wx = (Graphics.width - 280) / 2
    @cursed_message = CursedMessageWindow.new(wx, 40)
    @info_viewport.visible = true
    @party_command_window.contents.clear
    @party_command_window.index = -1
    @message_window.visible = false
    @status_window.index = 0
    @status_window.active = true
  end

  def update_cursed_victory
    @status_window.update
    if Input.trigger?(:C)
      Sound.play_ok
      n = @status_window.index
      $game_party.members[n].add_state(1)
      @status_window.refresh
      @status_window.active = false
      BattleManager.cursed_victory = nil
    end
  end

  def hide_cursed_message
    @cursed_message.visible = false
    @message_window.visible = true
  end
end

Terms & Conditions

Free as in Beer beer for non commercial games. Gamer
Include my nickname in your game credits.
That's it! Tongue sticking out
"For God has not destined us for wrath, but for obtaining salvation through our Lord Jesus Christ," 1 Thessalonians 5:9

Maranatha!

The Internet might be either your friend or enemy. It just depends on whether or not she has a bad hair day.

[Image: SP1-Scripter.png]
[Image: SP1-Writer.png]
[Image: SP1-Poet.png]
[Image: SP1-PixelArtist.png]
[Image: SP1-Reporter.png]

My Original Stories (available in English and Spanish)

List of Compiled Binary Executables I have published...
HiddenChest & Roole

Give me a free copy of your completed game if you include at least 3 of my scripts! Laughing + Tongue sticking out

Just some scripts I've already published on the board...
KyoGemBoost XP VX & ACE, RandomEnkounters XP, KSkillShop XP, Kolloseum States XP, KEvents XP, KScenario XP & Gosu, KyoPrizeShop XP Mangostan, Kuests XP, KyoDiscounts XP VX, ACE & MV, KChest XP VX & ACE 2016, KTelePort XP, KSkillMax XP & VX & ACE, Gem Roulette XP VX & VX Ace, KRespawnPoint XP, VX & VX Ace, GiveAway XP VX & ACE, Klearance XP VX & ACE, KUnits XP VX, ACE & Gosu 2017, KLevel XP, KRumors XP & ACE, KMonsterPals XP VX & ACE, KStatsRefill XP VX & ACE, KLotto XP VX & ACE, KItemDesc XP & VX, KPocket XP & VX, OpenChest XP VX & ACE
Reply
#2
The Script Has Been Ported to VX ACE!

The VX ACE port features the same mechanism that might cause your team to lose a team member after obtaining a flawless victory. Laughing
That does not exclude the possibility that you might still lose the battle if the last hero standing meets his demise then. Confused
Life is hard indeed. Sad
Just take a look at the screenshots if you don't believe me!
"For God has not destined us for wrath, but for obtaining salvation through our Lord Jesus Christ," 1 Thessalonians 5:9

Maranatha!

The Internet might be either your friend or enemy. It just depends on whether or not she has a bad hair day.

[Image: SP1-Scripter.png]
[Image: SP1-Writer.png]
[Image: SP1-Poet.png]
[Image: SP1-PixelArtist.png]
[Image: SP1-Reporter.png]

My Original Stories (available in English and Spanish)

List of Compiled Binary Executables I have published...
HiddenChest & Roole

Give me a free copy of your completed game if you include at least 3 of my scripts! Laughing + Tongue sticking out

Just some scripts I've already published on the board...
KyoGemBoost XP VX & ACE, RandomEnkounters XP, KSkillShop XP, Kolloseum States XP, KEvents XP, KScenario XP & Gosu, KyoPrizeShop XP Mangostan, Kuests XP, KyoDiscounts XP VX, ACE & MV, KChest XP VX & ACE 2016, KTelePort XP, KSkillMax XP & VX & ACE, Gem Roulette XP VX & VX Ace, KRespawnPoint XP, VX & VX Ace, GiveAway XP VX & ACE, Klearance XP VX & ACE, KUnits XP VX, ACE & Gosu 2017, KLevel XP, KRumors XP & ACE, KMonsterPals XP VX & ACE, KStatsRefill XP VX & ACE, KLotto XP VX & ACE, KItemDesc XP & VX, KPocket XP & VX, OpenChest XP VX & ACE
Reply




Users browsing this thread: