mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-10 06:34:59 +00:00
Minor new additions for v20 (#147)
* Moved TMs/ TRs and HMs into their own handlers * Improved Plugin Error Message * Added sound effect when picking berries * Allow player to always see quantity when buying items * Trainers now require a Mega Ring item in their items (in trainers.txt) to Mega Evolve
This commit is contained in:
@@ -54,6 +54,7 @@ class Battle
|
||||
attr_reader :player # Player trainer (or array of trainers)
|
||||
attr_reader :opponent # Opponent trainer (or array of trainers)
|
||||
attr_accessor :items # Items held by opponents
|
||||
attr_accessor :ally_items # Items held by allies
|
||||
attr_accessor :endSpeeches
|
||||
attr_accessor :endSpeechesWin
|
||||
attr_accessor :party1starts # Array of start indexes for each player-side trainer's party
|
||||
@@ -119,6 +120,7 @@ class Battle
|
||||
@player = player # Array of Player/NPCTrainer objects, or nil
|
||||
@opponent = opponent # Array of NPCTrainer objects, or nil
|
||||
@items = nil
|
||||
@ally_items = nil # Array of items held by ally. This is just used for Mega Evolution for now.
|
||||
@endSpeeches = []
|
||||
@endSpeechesWin = []
|
||||
@party1 = p1
|
||||
@@ -167,6 +169,8 @@ class Battle
|
||||
else
|
||||
@struggle = Move::Struggle.new(self, nil)
|
||||
end
|
||||
@mega_rings = []
|
||||
GameData::Item.each { |item| @mega_rings.push(item.id) if item.has_flag?("MegaRing") }
|
||||
end
|
||||
|
||||
#=============================================================================
|
||||
@@ -259,8 +263,14 @@ class Battle
|
||||
end
|
||||
|
||||
def pbGetOwnerItems(idxBattler)
|
||||
return [] if !@items || !opposes?(idxBattler)
|
||||
return @items[pbGetOwnerIndexFromBattlerIndex(idxBattler)]
|
||||
if opposes?(idxBattler)
|
||||
return [] if !@items
|
||||
return @items[pbGetOwnerIndexFromBattlerIndex(idxBattler)]
|
||||
else
|
||||
return [] if !@ally_items
|
||||
return @ally_items[pbGetOwnerIndexFromBattlerIndex(idxBattler)]
|
||||
end
|
||||
return []
|
||||
end
|
||||
|
||||
# Returns whether the battler in position idxBattler is owned by the same
|
||||
|
||||
Reference in New Issue
Block a user