Save-Point
KMustDie XP - Printable Version

+- Save-Point (https://www.save-point.org)
+-- Forum: Material Development (https://www.save-point.org/forum-8.html)
+--- Forum: Scripts Database (https://www.save-point.org/forum-39.html)
+---- Forum: RPGMaker XP (RGSS) Engine (https://www.save-point.org/forum-116.html)
+---- Thread: KMustDie XP (/thread-12715.html)



KMustDie XP - kyonides - 09-01-2025

KMustDie XP

by Kyonides

Look Up Imagine a game world where certain battles won't force you to kill ALL of the enemy troops on screen.
Happy with a sweat Well, you can stop doing that right away because now you can make your battle dream come true! Shocked
Just set which troops are mandatory to kill via a script call and that's it! Two Thumbs Up! 
You won't have to depend on a tough negotiator to deal with tyrants looking for free lands up for the grabs. Winking

Script Call - Use natural index values like 1 upto 8 here:
Code:
$game_troop.must_die(EnemyIndex1, etc.)

The Script
Code:
# * KMustDie XP * #
#   Scripter : Kyonides Arkanthes
#   v1.0.1 - 2025-09-06

# This scriptlet allows you to set a given number of enemies that must die in
# battle before the player can be proclaimed as the victor there.

# * Script Call * #
# - Enter 1+ Enemy Indexes to set which enemies should die before battle ends.
#   You should use number 1 as the first position available there.
# $game_troop.must_die(EnemyIndex1, etc.)

class Game_Troop
  alias :kyon_must_die_gm_trp_init :initialize
  attr_reader :hunt_targets
  def initialize
    kyon_must_die_gm_trp_init
    @hunt_targets = []
  end

  def dead_now
    @enemies.select {|e| e.dead? }
  end

  def hunt_targets_dead?
    targets = dead_now.map {|e| e.index + 1 }
    @hunt_targets.any? and targets.sort == @hunt_targets
  end

  def must_die(*targets)
    @hunt_targets = targets.sort
  end
end

class Scene_Battle
  alias :kyon_must_die_scn_btl_judge :judge
  alias :kyon_must_die_scn_btl_blt_end :battle_end
  def judge
    return start_victory_phase if $game_troop.hunt_targets_dead?
    kyon_must_die_scn_btl_judge
  end

  def start_victory_phase
    start_phase5
    true
  end

  def battle_end(result)
    $game_troop.hunt_targets.clear
    kyon_must_die_scn_btl_blt_end(result)
  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


RE: KMustDie XP - kyonides - 09-06-2025

Maintenance Update

I had to revisit this recent script because I had found a weird Bug on the VX port. It failed to differentiate between normal battles and Must Die ones. This could lead the party to the victory scene without ever defeating any mobs on screen! Incredible What a Ghost monstrous disaster!

This release addresses that issue by fully exterminating it! Killer