mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-07 13:15:01 +00:00
Repels now have a flag in items.txt which determines if they can be reused when one runs out
This commit is contained in:
@@ -135,26 +135,23 @@ ItemHandlers::UseInField.add(:MAXREPEL, proc { |item|
|
||||
})
|
||||
|
||||
Events.onStepTaken += proc {
|
||||
if $PokemonGlobal.repel > 0 && !$game_player.terrain_tag.ice # Shouldn't count down if on ice
|
||||
$PokemonGlobal.repel -= 1
|
||||
if $PokemonGlobal.repel <= 0
|
||||
if $bag.has?(:REPEL) || $bag.has?(:SUPERREPEL) || $bag.has?(:MAXREPEL)
|
||||
if pbConfirmMessage(_INTL("The repellent's effect wore off! Would you like to use another one?"))
|
||||
ret = nil
|
||||
pbFadeOutIn {
|
||||
scene = PokemonBag_Scene.new
|
||||
screen = PokemonBagScreen.new(scene, $bag)
|
||||
ret = screen.pbChooseItemScreen(proc { |item|
|
||||
[:REPEL, :SUPERREPEL, :MAXREPEL].include?(item)
|
||||
})
|
||||
}
|
||||
pbUseItem($bag, ret) if ret
|
||||
end
|
||||
else
|
||||
pbMessage(_INTL("The repellent's effect wore off!"))
|
||||
end
|
||||
end
|
||||
next if $PokemonGlobal.repel <= 0 || $game_player.terrain_tag.ice # Shouldn't count down if on ice
|
||||
$PokemonGlobal.repel -= 1
|
||||
next if $PokemonGlobal.repel > 0
|
||||
repels = []
|
||||
GameData::Item.each { |itm| repels.push(itm.id) if itm.has_flag?("Repel") }
|
||||
if repels.none? { |item| $bag.has?(item) }
|
||||
pbMessage(_INTL("The repellent's effect wore off!"))
|
||||
next
|
||||
end
|
||||
next if !pbConfirmMessage(_INTL("The repellent's effect wore off! Would you like to use another one?"))
|
||||
ret = nil
|
||||
pbFadeOutIn {
|
||||
scene = PokemonBag_Scene.new
|
||||
screen = PokemonBagScreen.new(scene, $bag)
|
||||
ret = screen.pbChooseItemScreen(proc { |item| repels.include?(item) })
|
||||
}
|
||||
pbUseItem($bag, ret) if ret
|
||||
}
|
||||
|
||||
ItemHandlers::UseInField.add(:BLACKFLUTE, proc { |item|
|
||||
|
||||
@@ -6,6 +6,7 @@ NamePlural = Repels
|
||||
Pocket = 1
|
||||
Price = 350
|
||||
FieldUse = Direct
|
||||
Flags = Repel
|
||||
Description = An item that prevents weak wild Pokémon from appearing for 100 steps after its use.
|
||||
#-------------------------------
|
||||
[SUPERREPEL]
|
||||
@@ -14,6 +15,7 @@ NamePlural = Super Repels
|
||||
Pocket = 1
|
||||
Price = 500
|
||||
FieldUse = Direct
|
||||
Flags = Repel
|
||||
Description = An item that prevents weak wild Pokémon from appearing for 200 steps after its use.
|
||||
#-------------------------------
|
||||
[MAXREPEL]
|
||||
@@ -22,6 +24,7 @@ NamePlural = Max Repels
|
||||
Pocket = 1
|
||||
Price = 700
|
||||
FieldUse = Direct
|
||||
Flags = Repel
|
||||
Description = An item that prevents weak wild Pokémon from appearing for 250 steps after its use.
|
||||
#-------------------------------
|
||||
[BLACKFLUTE]
|
||||
|
||||
@@ -6,6 +6,7 @@ NamePlural = Repels
|
||||
Pocket = 1
|
||||
Price = 400
|
||||
FieldUse = Direct
|
||||
Flags = Repel
|
||||
Description = An item that prevents weak wild Pokémon from appearing for 100 steps after its use.
|
||||
#-------------------------------
|
||||
[SUPERREPEL]
|
||||
@@ -14,6 +15,7 @@ NamePlural = Super Repels
|
||||
Pocket = 1
|
||||
Price = 700
|
||||
FieldUse = Direct
|
||||
Flags = Repel
|
||||
Description = An item that prevents weak wild Pokémon from appearing for 200 steps after its use.
|
||||
#-------------------------------
|
||||
[MAXREPEL]
|
||||
@@ -22,6 +24,7 @@ NamePlural = Max Repels
|
||||
Pocket = 1
|
||||
Price = 900
|
||||
FieldUse = Direct
|
||||
Flags = Repel
|
||||
Description = An item that prevents weak wild Pokémon from appearing for 250 steps after its use.
|
||||
#-------------------------------
|
||||
[BLACKFLUTE]
|
||||
|
||||
@@ -6,6 +6,7 @@ NamePlural = Repels
|
||||
Pocket = 1
|
||||
Price = 400
|
||||
FieldUse = Direct
|
||||
Flags = Repel
|
||||
Description = An item that prevents weak wild Pokémon from appearing for 100 steps after its use.
|
||||
#-------------------------------
|
||||
[SUPERREPEL]
|
||||
@@ -14,6 +15,7 @@ NamePlural = Super Repels
|
||||
Pocket = 1
|
||||
Price = 700
|
||||
FieldUse = Direct
|
||||
Flags = Repel
|
||||
Description = An item that prevents weak wild Pokémon from appearing for 200 steps after its use.
|
||||
#-------------------------------
|
||||
[MAXREPEL]
|
||||
@@ -22,6 +24,7 @@ NamePlural = Max Repels
|
||||
Pocket = 1
|
||||
Price = 900
|
||||
FieldUse = Direct
|
||||
Flags = Repel
|
||||
Description = An item that prevents weak wild Pokémon from appearing for 250 steps after its use.
|
||||
#-------------------------------
|
||||
[BLACKFLUTE]
|
||||
@@ -5623,7 +5626,7 @@ Name = Mega Ring
|
||||
NamePlural = Mega Rings
|
||||
Pocket = 8
|
||||
Price = 0
|
||||
Flags = KeyItem
|
||||
Flags = KeyItem, MegaRing
|
||||
Description = This ring contains an untold power that somehow enables Pokémon carrying Mega Stones to Mega Evolve.
|
||||
#-------------------------------
|
||||
[POKEMONBOXLINK]
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# See the documentation on the wiki to learn how to edit this file.
|
||||
# See the documentation on the wiki to learn how to edit this file.
|
||||
#-------------------------------
|
||||
[REPEL]
|
||||
Name = Repel
|
||||
@@ -6,6 +6,7 @@ NamePlural = Repels
|
||||
Pocket = 1
|
||||
Price = 400
|
||||
FieldUse = Direct
|
||||
Flags = Repel
|
||||
Description = An item that prevents weak wild Pokémon from appearing for 100 steps after its use.
|
||||
#-------------------------------
|
||||
[SUPERREPEL]
|
||||
@@ -14,6 +15,7 @@ NamePlural = Super Repels
|
||||
Pocket = 1
|
||||
Price = 700
|
||||
FieldUse = Direct
|
||||
Flags = Repel
|
||||
Description = An item that prevents weak wild Pokémon from appearing for 200 steps after its use.
|
||||
#-------------------------------
|
||||
[MAXREPEL]
|
||||
@@ -22,6 +24,7 @@ NamePlural = Max Repels
|
||||
Pocket = 1
|
||||
Price = 900
|
||||
FieldUse = Direct
|
||||
Flags = Repel
|
||||
Description = An item that prevents weak wild Pokémon from appearing for 250 steps after its use.
|
||||
#-------------------------------
|
||||
[BLACKFLUTE]
|
||||
|
||||
Reference in New Issue
Block a user