mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-09 14:14:59 +00:00
updates to version 6.1
This commit is contained in:
@@ -38,7 +38,47 @@ class LocationWindow
|
||||
end
|
||||
end
|
||||
|
||||
class NightmareSprite < SpriteWrapper
|
||||
attr_reader :radius
|
||||
|
||||
def initialize(viewport=nil)
|
||||
super(viewport)
|
||||
@darkness = BitmapWrapper.new(Graphics.width,Graphics.height)
|
||||
@radius = radiusMin
|
||||
self.bitmap = @darkness
|
||||
self.z = 99998
|
||||
refresh
|
||||
end
|
||||
|
||||
def dispose
|
||||
@darkness.dispose
|
||||
super
|
||||
end
|
||||
|
||||
def radiusMin; return 64; end # Before using Flash
|
||||
def radiusMax; return 176; end # After using Flash
|
||||
|
||||
def radius=(value)
|
||||
@radius = value
|
||||
refresh
|
||||
end
|
||||
|
||||
def refresh
|
||||
@darkness.fill_rect(0,0,Graphics.width,Graphics.height,Color.new(0,0,0,255))
|
||||
cx = Graphics.width/2
|
||||
cy = Graphics.height/2
|
||||
cradius = @radius
|
||||
numfades = 5
|
||||
for i in 1..numfades
|
||||
for j in cx-cradius..cx+cradius
|
||||
diff2 = (cradius * cradius) - ((j - cx) * (j - cx))
|
||||
diff = Math.sqrt(diff2)
|
||||
@darkness.fill_rect(j,cy-diff,1,diff*2,Color.new(0,0,0,255.0*(numfades-i)/numfades))
|
||||
end
|
||||
cradius = (cradius*0.9).floor
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
#===============================================================================
|
||||
# Visibility circle in dark maps
|
||||
|
||||
@@ -83,6 +83,7 @@ end
|
||||
#===============================================================================
|
||||
def pbStartOver(gameover=false)
|
||||
$game_variables[VAR_CURRENT_GYM_TYPE]=-1
|
||||
$game_switches[SWITCH_LOCK_PLAYER_MOVEMENT]=false
|
||||
if pbInBugContest?
|
||||
pbBugContestStartOver
|
||||
return
|
||||
|
||||
@@ -42,6 +42,11 @@ def pbBatteryLow?
|
||||
return false
|
||||
end
|
||||
|
||||
def pbOnBattery?
|
||||
pstate = System.power_state
|
||||
return pstate[:discharging]
|
||||
end
|
||||
|
||||
Events.onMapUpdate += proc { |_sender, _e|
|
||||
if !$PokemonTemp.batterywarning && pbBatteryLow?
|
||||
if !$game_temp.in_menu && !$game_temp.in_battle &&
|
||||
|
||||
@@ -242,6 +242,8 @@ def pbCanTripleBattle?
|
||||
return $PokemonGlobal.partner && $Trainer.able_pokemon_count >= 2
|
||||
end
|
||||
|
||||
|
||||
|
||||
#===============================================================================
|
||||
# Start a wild battle
|
||||
#===============================================================================
|
||||
@@ -257,6 +259,7 @@ def pbWildBattleCore(*args)
|
||||
$PokemonGlobal.nextBattleME = nil
|
||||
$PokemonGlobal.nextBattleCaptureME = nil
|
||||
$PokemonGlobal.nextBattleBack = nil
|
||||
$PokemonTemp.forced_alt_sprites=nil
|
||||
pbMEStop
|
||||
return 1 # Treat it as a win
|
||||
end
|
||||
@@ -331,6 +334,30 @@ def pbWildBattleCore(*args)
|
||||
return decision
|
||||
end
|
||||
|
||||
def pbWildDoubleBattleSpecific(pokemon1,pokemon2, outcomeVar=1, canRun=true, canLose=false)
|
||||
# Set some battle rules
|
||||
setBattleRule("outcomeVar",outcomeVar) if outcomeVar!=1
|
||||
setBattleRule("cannotRun") if !canRun
|
||||
setBattleRule("canLose") if canLose
|
||||
setBattleRule("double")
|
||||
# Perform the battle
|
||||
decision = pbWildBattleCore(pokemon1, pokemon2)
|
||||
return (decision!=2 && decision!=5)
|
||||
end
|
||||
|
||||
def pbWildBattleSpecific(pokemon, outcomeVar=1, canRun=true, canLose=false)
|
||||
# Set some battle rules
|
||||
setBattleRule("outcomeVar",outcomeVar) if outcomeVar!=1
|
||||
setBattleRule("cannotRun") if !canRun
|
||||
setBattleRule("canLose") if canLose
|
||||
# Perform the battle
|
||||
decision = pbWildBattleCore(pokemon)
|
||||
# Used by the Poké Radar to update/break the chain
|
||||
#Events.onWildBattleEnd.trigger(nil,species,level,decision)
|
||||
# Return false if the player lost or drew the battle, and true if any other result
|
||||
return (decision!=2 && decision!=5)
|
||||
end
|
||||
|
||||
#===============================================================================
|
||||
# Standard methods that start a wild battle of various sizes
|
||||
#===============================================================================
|
||||
@@ -423,6 +450,7 @@ def pbTrainerBattleCore(*args)
|
||||
$PokemonGlobal.nextBattleME = nil
|
||||
$PokemonGlobal.nextBattleCaptureME = nil
|
||||
$PokemonGlobal.nextBattleBack = nil
|
||||
$PokemonTemp.forced_alt_sprites=nil
|
||||
pbMEStop
|
||||
return ($Trainer.able_pokemon_count == 0) ? 0 : 1 # Treat it as undecided/a win
|
||||
end
|
||||
|
||||
@@ -112,6 +112,7 @@ def pbBattleAnimation(bgm=nil,battletype=0,foe=nil)
|
||||
$PokemonGlobal.nextBattleME = nil
|
||||
$PokemonGlobal.nextBattleCaptureME = nil
|
||||
$PokemonGlobal.nextBattleBack = nil
|
||||
$PokemonTemp.forced_alt_sprites=nil
|
||||
$PokemonEncounters.reset_step_count
|
||||
# Fade back to the overworld
|
||||
viewport.color = Color.new(0,0,0,255)
|
||||
|
||||
@@ -636,6 +636,54 @@ HiddenMoveHandlers::UseMove.add(:HEADBUTT, proc { |move, pokemon|
|
||||
pbHeadbuttEffect(facingEvent)
|
||||
})
|
||||
|
||||
HiddenMoveHandlers::CanUseMove.add(:RELICSONG, proc { |move, pokemon, showmsg|
|
||||
if !(pokemon.isFusionOf(:MELOETTA_A) || pokemon.isFusionOf(:MELOETTA_P))
|
||||
pbMessage(_INTL("It won't have any effect")) if showmsg
|
||||
next false
|
||||
end
|
||||
next true
|
||||
})
|
||||
|
||||
HiddenMoveHandlers::UseMove.add(:RELICSONG, proc { |move, pokemon|
|
||||
if !pbHiddenMoveAnimation(pokemon)
|
||||
pbMessage(_INTL("{1} used {2}!", pokemon.name, GameData::Move.get(move).name))
|
||||
end
|
||||
changeMeloettaForm(pokemon)
|
||||
})
|
||||
|
||||
def changeMeloettaForm(pokemon)
|
||||
is_meloetta_A = pokemon.isFusionOf(:MELOETTA_A)
|
||||
is_meloetta_P = pokemon.isFusionOf(:MELOETTA_P)
|
||||
if !pokemon.isFusion?
|
||||
if is_meloetta_A
|
||||
changeSpeciesSpecific(pokemon, :MELOETTA_P)
|
||||
pbMessage(_INTL("{1} changed to the Pirouette form!", pokemon.name))
|
||||
end
|
||||
if is_meloetta_P
|
||||
changeSpeciesSpecific(pokemon, :MELOETTA_A)
|
||||
pbMessage(_INTL("{1} changed to the Aria form!", pokemon.name))
|
||||
end
|
||||
return
|
||||
end
|
||||
if is_meloetta_A && is_meloetta_P
|
||||
if pokemon.species_data.get_body_species() == :MELOETTA_A
|
||||
changeSpeciesSpecific(pokemon, :B467H466)
|
||||
else
|
||||
changeSpeciesSpecific(pokemon, :B466H467)
|
||||
end
|
||||
pbMessage(_INTL("{1} changed form!", pokemon.name))
|
||||
else
|
||||
if is_meloetta_P
|
||||
replaceFusionSpecies(pokemon, :MELOETTA_P, :MELOETTA_A)
|
||||
pbMessage(_INTL("{1} changed to the Aria form!", pokemon.name))
|
||||
end
|
||||
if is_meloetta_A
|
||||
replaceFusionSpecies(pokemon, :MELOETTA_A, :MELOETTA_P)
|
||||
pbMessage(_INTL("{1} changed to the Pirouette form!", pokemon.name))
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
#===============================================================================
|
||||
# Rock Smash
|
||||
#===============================================================================
|
||||
|
||||
Reference in New Issue
Block a user