#===============================================================================
# * SNuzlocke Mode - by JV (Credits if used please)
#===============================================================================
#
# This script is for Pok?mon Essentials. It adds support for the famous fan
# created Nuzlocke Mode, where Pok?mon are considered dead when fainted and
# the player is only able to capture the first pok?mon they spot in each map.
#
# This is script is at the same time an improvement and a simpler version of
# what I did on Pok?mon Uranium, for which I'll use this new script as a base
# for the one in my game.
#
# Features included:
# - Only one encounter per Map
# - Optional Dubious Clause (same species encounter doesn't count)
# - Support for connected maps (so you don't get 2 encounters in the same route)
# - Permadeath (no healing or revive)
#
#
#==INSTRUCTIONS=================================================================
#
# To install this script it's simple, just put it above main. (yes, plug and play)
# Also: Replace lines 327, 340, 1153, 1172 of Pok?monItemEffects replace:
# " if pokemon.hp>0"
# With:
# " if pokemon.hp>0 || $PokemonGlobal.snuzlocke==true"
#
#==HOW TO USE===================================================================
#
# To use this script simply call in an event: "$PokemonGlobal.snuzlocke = true"
#
# If you want to turn off the mode just do the same, but with false instead.
#
#==CONFIGURATION================================================================
# OPTION 1: Dubious Clause (same species encounter doesn't count)
DUBIOUSCLAUSE = false
# OPTION 2: Connected Maps (so you don't get 2 encounters in the same route)
# example: (It's an array of arrays, simple as that, just mimic the example)
begin
SNUZLOCKEMAPS = []
end
#===============================================================================
class PokemonGlobalMetadata
attr_accessor :snuzlocke
attr_accessor :snuzlockeMaps
alias snuzlocke_initialize initialize
def initialize
@snuzlocke=false
@snuzlockeMaps=[]
snuzlocke_initialize
end
def snuzlockeMapState(mapid)
if !@snuzlockeMaps
@snuzlockeMaps=[]
end
return 0 if @snuzlockeMaps.length==0
for i in
[email protected]
if @snuzlockeMaps
[0] == mapid
state = @snuzlockeMaps[1]
echo("(")
echo(@snuzlockeMaps)
echo("->")
echo(state)
echo(")\n")
return state
break
end
end
end
def checkDuplicates(mapid)
return false if !@snuzlockeMaps
for i in [email protected]
if @snuzlockeMaps[0] == mapid
return true
end
end
return false
end
end
class PokeBattle_Battle
alias snuzlocke_ThrowPokeBall pbThrowPokeBall
def pbThrowPokeBall(idxPokemon,ball,rareness=nil)
if $PokemonGlobal.snuzlocke
snuzlockeMultipleMaps
if $PokemonGlobal.snuzlockeMapState($game_map.map_id) == 1
pbDisplay(_INTL("But {1} already fought a wild pokemon on this area!",self.pbPlayer.name))
return
end
if $PokemonGlobal.snuzlockeMapState($game_map.map_id) == 2
pbDisplay(_INTL("But {1} already caught a pokemon on this area!",self.pbPlayer.name))
return
end
end
snuzlocke_ThrowPokeBall(idxPokemon,ball,rareness=nil)
end
alias snuzlocke_EndOfBattle pbEndOfBattle
def pbEndOfBattle(canlose=false)
snuzlocke_EndOfBattle
if $PokemonGlobal.snuzlocke
if @decision == 4
$PokemonGlobal.snuzlockeMaps.push([$game_map.map_id,2])
end
if !@opponent && $PokemonGlobal.snuzlockeMapState($game_map.map_id) != 2
$PokemonGlobal.snuzlockeMaps.push([$game_map.map_id,1]) if !DUBIOUSCLAUSE
$PokemonGlobal.snuzlockeMaps.push([$game_map.map_id,1]) if (DUBIOUSCLAUSE && !@battlers[1].owned)
end
end
end
def snuzlockeMultipleMaps
return if !SNUZLOCKEMAPS
for i in 0...SNUZLOCKEMAPS.length
for j in 0...SNUZLOCKEMAPS.length
mapid = SNUZLOCKEMAPS[j]
if $PokemonGlobal.snuzlockeMapState(mapid) && $game_map.map_id != mapid && !$PokemonGlobal.checkDuplicates($game_map.map_id)
if ($PokemonGlobal.snuzlockeMapState(mapid) != 0 && SNUZLOCKEMAPS.include?($game_map.map_id))
$PokemonGlobal.snuzlockeMaps.push([$game_map.map_id,$PokemonGlobal.snuzlockeMapState(mapid)])
end
end
end
end
end
end