mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-08 05:34:58 +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 {
|
Events.onStepTaken += proc {
|
||||||
if $PokemonGlobal.repel > 0 && !$game_player.terrain_tag.ice # Shouldn't count down if on ice
|
next if $PokemonGlobal.repel <= 0 || $game_player.terrain_tag.ice # Shouldn't count down if on ice
|
||||||
$PokemonGlobal.repel -= 1
|
$PokemonGlobal.repel -= 1
|
||||||
if $PokemonGlobal.repel <= 0
|
next if $PokemonGlobal.repel > 0
|
||||||
if $bag.has?(:REPEL) || $bag.has?(:SUPERREPEL) || $bag.has?(:MAXREPEL)
|
repels = []
|
||||||
if pbConfirmMessage(_INTL("The repellent's effect wore off! Would you like to use another one?"))
|
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
|
ret = nil
|
||||||
pbFadeOutIn {
|
pbFadeOutIn {
|
||||||
scene = PokemonBag_Scene.new
|
scene = PokemonBag_Scene.new
|
||||||
screen = PokemonBagScreen.new(scene, $bag)
|
screen = PokemonBagScreen.new(scene, $bag)
|
||||||
ret = screen.pbChooseItemScreen(proc { |item|
|
ret = screen.pbChooseItemScreen(proc { |item| repels.include?(item) })
|
||||||
[:REPEL, :SUPERREPEL, :MAXREPEL].include?(item)
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
pbUseItem($bag, ret) if ret
|
pbUseItem($bag, ret) if ret
|
||||||
end
|
|
||||||
else
|
|
||||||
pbMessage(_INTL("The repellent's effect wore off!"))
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ItemHandlers::UseInField.add(:BLACKFLUTE, proc { |item|
|
ItemHandlers::UseInField.add(:BLACKFLUTE, proc { |item|
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ NamePlural = Repels
|
|||||||
Pocket = 1
|
Pocket = 1
|
||||||
Price = 350
|
Price = 350
|
||||||
FieldUse = Direct
|
FieldUse = Direct
|
||||||
|
Flags = Repel
|
||||||
Description = An item that prevents weak wild Pokémon from appearing for 100 steps after its use.
|
Description = An item that prevents weak wild Pokémon from appearing for 100 steps after its use.
|
||||||
#-------------------------------
|
#-------------------------------
|
||||||
[SUPERREPEL]
|
[SUPERREPEL]
|
||||||
@@ -14,6 +15,7 @@ NamePlural = Super Repels
|
|||||||
Pocket = 1
|
Pocket = 1
|
||||||
Price = 500
|
Price = 500
|
||||||
FieldUse = Direct
|
FieldUse = Direct
|
||||||
|
Flags = Repel
|
||||||
Description = An item that prevents weak wild Pokémon from appearing for 200 steps after its use.
|
Description = An item that prevents weak wild Pokémon from appearing for 200 steps after its use.
|
||||||
#-------------------------------
|
#-------------------------------
|
||||||
[MAXREPEL]
|
[MAXREPEL]
|
||||||
@@ -22,6 +24,7 @@ NamePlural = Max Repels
|
|||||||
Pocket = 1
|
Pocket = 1
|
||||||
Price = 700
|
Price = 700
|
||||||
FieldUse = Direct
|
FieldUse = Direct
|
||||||
|
Flags = Repel
|
||||||
Description = An item that prevents weak wild Pokémon from appearing for 250 steps after its use.
|
Description = An item that prevents weak wild Pokémon from appearing for 250 steps after its use.
|
||||||
#-------------------------------
|
#-------------------------------
|
||||||
[BLACKFLUTE]
|
[BLACKFLUTE]
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ NamePlural = Repels
|
|||||||
Pocket = 1
|
Pocket = 1
|
||||||
Price = 400
|
Price = 400
|
||||||
FieldUse = Direct
|
FieldUse = Direct
|
||||||
|
Flags = Repel
|
||||||
Description = An item that prevents weak wild Pokémon from appearing for 100 steps after its use.
|
Description = An item that prevents weak wild Pokémon from appearing for 100 steps after its use.
|
||||||
#-------------------------------
|
#-------------------------------
|
||||||
[SUPERREPEL]
|
[SUPERREPEL]
|
||||||
@@ -14,6 +15,7 @@ NamePlural = Super Repels
|
|||||||
Pocket = 1
|
Pocket = 1
|
||||||
Price = 700
|
Price = 700
|
||||||
FieldUse = Direct
|
FieldUse = Direct
|
||||||
|
Flags = Repel
|
||||||
Description = An item that prevents weak wild Pokémon from appearing for 200 steps after its use.
|
Description = An item that prevents weak wild Pokémon from appearing for 200 steps after its use.
|
||||||
#-------------------------------
|
#-------------------------------
|
||||||
[MAXREPEL]
|
[MAXREPEL]
|
||||||
@@ -22,6 +24,7 @@ NamePlural = Max Repels
|
|||||||
Pocket = 1
|
Pocket = 1
|
||||||
Price = 900
|
Price = 900
|
||||||
FieldUse = Direct
|
FieldUse = Direct
|
||||||
|
Flags = Repel
|
||||||
Description = An item that prevents weak wild Pokémon from appearing for 250 steps after its use.
|
Description = An item that prevents weak wild Pokémon from appearing for 250 steps after its use.
|
||||||
#-------------------------------
|
#-------------------------------
|
||||||
[BLACKFLUTE]
|
[BLACKFLUTE]
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ NamePlural = Repels
|
|||||||
Pocket = 1
|
Pocket = 1
|
||||||
Price = 400
|
Price = 400
|
||||||
FieldUse = Direct
|
FieldUse = Direct
|
||||||
|
Flags = Repel
|
||||||
Description = An item that prevents weak wild Pokémon from appearing for 100 steps after its use.
|
Description = An item that prevents weak wild Pokémon from appearing for 100 steps after its use.
|
||||||
#-------------------------------
|
#-------------------------------
|
||||||
[SUPERREPEL]
|
[SUPERREPEL]
|
||||||
@@ -14,6 +15,7 @@ NamePlural = Super Repels
|
|||||||
Pocket = 1
|
Pocket = 1
|
||||||
Price = 700
|
Price = 700
|
||||||
FieldUse = Direct
|
FieldUse = Direct
|
||||||
|
Flags = Repel
|
||||||
Description = An item that prevents weak wild Pokémon from appearing for 200 steps after its use.
|
Description = An item that prevents weak wild Pokémon from appearing for 200 steps after its use.
|
||||||
#-------------------------------
|
#-------------------------------
|
||||||
[MAXREPEL]
|
[MAXREPEL]
|
||||||
@@ -22,6 +24,7 @@ NamePlural = Max Repels
|
|||||||
Pocket = 1
|
Pocket = 1
|
||||||
Price = 900
|
Price = 900
|
||||||
FieldUse = Direct
|
FieldUse = Direct
|
||||||
|
Flags = Repel
|
||||||
Description = An item that prevents weak wild Pokémon from appearing for 250 steps after its use.
|
Description = An item that prevents weak wild Pokémon from appearing for 250 steps after its use.
|
||||||
#-------------------------------
|
#-------------------------------
|
||||||
[BLACKFLUTE]
|
[BLACKFLUTE]
|
||||||
@@ -5623,7 +5626,7 @@ Name = Mega Ring
|
|||||||
NamePlural = Mega Rings
|
NamePlural = Mega Rings
|
||||||
Pocket = 8
|
Pocket = 8
|
||||||
Price = 0
|
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.
|
Description = This ring contains an untold power that somehow enables Pokémon carrying Mega Stones to Mega Evolve.
|
||||||
#-------------------------------
|
#-------------------------------
|
||||||
[POKEMONBOXLINK]
|
[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]
|
[REPEL]
|
||||||
Name = Repel
|
Name = Repel
|
||||||
@@ -6,6 +6,7 @@ NamePlural = Repels
|
|||||||
Pocket = 1
|
Pocket = 1
|
||||||
Price = 400
|
Price = 400
|
||||||
FieldUse = Direct
|
FieldUse = Direct
|
||||||
|
Flags = Repel
|
||||||
Description = An item that prevents weak wild Pokémon from appearing for 100 steps after its use.
|
Description = An item that prevents weak wild Pokémon from appearing for 100 steps after its use.
|
||||||
#-------------------------------
|
#-------------------------------
|
||||||
[SUPERREPEL]
|
[SUPERREPEL]
|
||||||
@@ -14,6 +15,7 @@ NamePlural = Super Repels
|
|||||||
Pocket = 1
|
Pocket = 1
|
||||||
Price = 700
|
Price = 700
|
||||||
FieldUse = Direct
|
FieldUse = Direct
|
||||||
|
Flags = Repel
|
||||||
Description = An item that prevents weak wild Pokémon from appearing for 200 steps after its use.
|
Description = An item that prevents weak wild Pokémon from appearing for 200 steps after its use.
|
||||||
#-------------------------------
|
#-------------------------------
|
||||||
[MAXREPEL]
|
[MAXREPEL]
|
||||||
@@ -22,6 +24,7 @@ NamePlural = Max Repels
|
|||||||
Pocket = 1
|
Pocket = 1
|
||||||
Price = 900
|
Price = 900
|
||||||
FieldUse = Direct
|
FieldUse = Direct
|
||||||
|
Flags = Repel
|
||||||
Description = An item that prevents weak wild Pokémon from appearing for 250 steps after its use.
|
Description = An item that prevents weak wild Pokémon from appearing for 250 steps after its use.
|
||||||
#-------------------------------
|
#-------------------------------
|
||||||
[BLACKFLUTE]
|
[BLACKFLUTE]
|
||||||
|
|||||||
Reference in New Issue
Block a user