The RPG Maker Resource Kit

RMRK RPG Maker Creation => VX => VX Scripts Database => Topic started by: epson777341 on May 09, 2009, 04:53:51 PM

Title: Different Ways to Die
Post by: epson777341 on May 09, 2009, 04:53:51 PM
This script was made for me by BigEd781 of RMVX.net
It makes so when a certain status effect happens to allof your party members, it's game over.

Like Petrify in Final Fantasy.

module ExtendedDeath
 
  # add the id numbers of the states taht should cause a gameover
  # if the entire party is inflicted
  STATE_IDS = [ 7, 8 ]
 
end

class Game_Party < Game_Unit
 
  def all_affected?(state_id)
    all_inflicted = true
    for actor in self.members   
      all_inflicted = false unless actor.state?(state_id)
    end
    return all_inflicted
  end
 
end

class Scene_Battle

  def check_status
    for id in ExtendedDeath::STATE_IDS
      call_gameover if $game_party.all_affected?(id)
    end
  end
 
  alias :eds_pre_death_process_action :process_action
  def process_action
    check_status
    eds_pre_death_process_action
  end 
 
end


There Aren't really any screenshots I can show with this script.

Title: Re: Different Ways to Die
Post by: Grafikal on May 09, 2009, 05:05:20 PM
This is pretty neat. Thanks for sharing :)
Title: Re: Different Ways to Die
Post by: Darkrai1276 on April 04, 2012, 12:33:47 PM
i was wondering if it could be used if there's two different states on the different characters but they still count as a game over
e.g. petrify and x-zone on two different people but it still counts as a game over