mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2026-01-24 23:35:59 +00:00
release 6.2
This commit is contained in:
@@ -79,6 +79,14 @@ class PokemonMartAdapter
|
||||
def removeItem(item)
|
||||
return $PokemonBag.pbDeleteItem(item)
|
||||
end
|
||||
|
||||
def getBaseColorOverride(item)
|
||||
return nil
|
||||
end
|
||||
|
||||
def getShadowColorOverride(item)
|
||||
return nil
|
||||
end
|
||||
end
|
||||
|
||||
#===============================================================================
|
||||
@@ -97,6 +105,14 @@ class BuyAdapter
|
||||
@adapter.getDisplayPrice(item, false)
|
||||
end
|
||||
|
||||
def getBaseColorOverride(item)
|
||||
return @adapter.getBaseColorOverride(item)
|
||||
end
|
||||
|
||||
def getShadowColorOverride(item)
|
||||
return @adapter.getShadowColorOverride(item)
|
||||
end
|
||||
|
||||
def isSelling?
|
||||
return false
|
||||
end
|
||||
@@ -125,6 +141,15 @@ class SellAdapter
|
||||
def isSelling?
|
||||
return true
|
||||
end
|
||||
|
||||
def getBaseColorOverride(item)
|
||||
return @adapter.getBaseColorOverride(item)
|
||||
end
|
||||
|
||||
def getShadowColorOverride(item)
|
||||
return @adapter.getShadowColorOverride(item)
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
#===============================================================================
|
||||
@@ -158,11 +183,18 @@ class Window_PokemonMart < Window_DrawableCommand
|
||||
else
|
||||
item = @stock[index]
|
||||
itemname = @adapter.getDisplayName(item)
|
||||
|
||||
baseColorOverride = @adapter.getBaseColorOverride(item)
|
||||
shadowColorOverride = @adapter.getShadowColorOverride(item)
|
||||
|
||||
baseColor = baseColorOverride ? baseColorOverride : self.baseColor
|
||||
shadowColor = shadowColorOverride ? shadowColorOverride : self.shadowColor
|
||||
|
||||
qty = @adapter.getDisplayPrice(item)
|
||||
sizeQty = self.contents.text_size(qty).width
|
||||
xQty = rect.x + rect.width - sizeQty - 2 - 16
|
||||
textpos.push([itemname, rect.x, ypos - 4, false, self.baseColor, self.shadowColor])
|
||||
textpos.push([qty, xQty, ypos - 4, false, self.baseColor, self.shadowColor])
|
||||
textpos.push([itemname, rect.x, ypos - 4, false, baseColor, shadowColor])
|
||||
textpos.push([qty, xQty, ypos - 4, false, baseColor, shadowColor])
|
||||
end
|
||||
pbDrawTextPositions(self.contents, textpos)
|
||||
end
|
||||
@@ -188,15 +220,23 @@ class PokemonMart_Scene
|
||||
itemwindow = @sprites["itemwindow"]
|
||||
@sprites["icon"].item = itemwindow.item
|
||||
@sprites["itemtextwindow"].text =
|
||||
(itemwindow.item) ? @adapter.getDescription(itemwindow.item) : _INTL("Quit shopping.")
|
||||
(itemwindow.item) ? @adapter.getDescription(itemwindow.item) : _INTL("Quit shopping.")
|
||||
itemwindow.refresh
|
||||
end
|
||||
@sprites["moneywindow"].text = _INTL("{2}:\r\n<r>{1}", @adapter.getMoneyString,@currency_name)
|
||||
end
|
||||
|
||||
def scroll_map()
|
||||
pbScrollMap(6, 5, 5)
|
||||
end
|
||||
|
||||
def scroll_back_map()
|
||||
pbScrollMap(4, 5, 5)
|
||||
end
|
||||
|
||||
def pbStartBuyOrSellScene(buying, stock, adapter)
|
||||
# Scroll right before showing screen
|
||||
pbScrollMap(6, 5, 5)
|
||||
scroll_map()
|
||||
@viewport = Viewport.new(0, 0, Graphics.width, Graphics.height)
|
||||
@viewport.z = 99999
|
||||
@stock = stock
|
||||
@@ -207,12 +247,12 @@ class PokemonMart_Scene
|
||||
@sprites["icon"] = ItemIconSprite.new(36, Graphics.height - 50, nil, @viewport)
|
||||
winAdapter = buying ? BuyAdapter.new(adapter) : SellAdapter.new(adapter)
|
||||
@sprites["itemwindow"] = Window_PokemonMart.new(stock, winAdapter,
|
||||
Graphics.width - 316 - 16, 12, 330 + 16, Graphics.height - 126)
|
||||
Graphics.width - 316 - 16, 12, 330 + 16, Graphics.height - 126)
|
||||
@sprites["itemwindow"].viewport = @viewport
|
||||
@sprites["itemwindow"].index = 0
|
||||
@sprites["itemwindow"].refresh
|
||||
@sprites["itemtextwindow"] = Window_UnformattedTextPokemon.newWithSize("",
|
||||
64, Graphics.height - 96 - 16, Graphics.width - 64, 128, @viewport)
|
||||
64, Graphics.height - 96 - 16, Graphics.width - 64, 128, @viewport)
|
||||
pbPrepareWindow(@sprites["itemtextwindow"])
|
||||
@sprites["itemtextwindow"].baseColor = Color.new(248, 248, 248)
|
||||
@sprites["itemtextwindow"].shadowColor = Color.new(0, 0, 0)
|
||||
@@ -291,9 +331,10 @@ class PokemonMart_Scene
|
||||
|
||||
def pbEndBuyScene
|
||||
pbDisposeSpriteHash(@sprites)
|
||||
Kernel.pbClearText()
|
||||
@viewport.dispose
|
||||
# Scroll left after showing screen
|
||||
pbScrollMap(4, 5, 5)
|
||||
scroll_back_map()
|
||||
end
|
||||
|
||||
def pbEndSellScene
|
||||
@@ -418,64 +459,64 @@ class PokemonMart_Scene
|
||||
itemprice /= 2 if !@buying
|
||||
pbDisplay(helptext, true)
|
||||
using(numwindow = Window_AdvancedTextPokemon.new("")) { # Showing number of items
|
||||
qty = @adapter.getQuantity(item)
|
||||
using(inbagwindow = Window_AdvancedTextPokemon.new("")) { # Showing quantity in bag
|
||||
pbPrepareWindow(numwindow)
|
||||
pbPrepareWindow(inbagwindow)
|
||||
numwindow.viewport = @viewport
|
||||
numwindow.width = 224
|
||||
numwindow.height = 64
|
||||
numwindow.baseColor = Color.new(88, 88, 80)
|
||||
numwindow.shadowColor = Color.new(168, 184, 184)
|
||||
inbagwindow.visible = @buying
|
||||
inbagwindow.viewport = @viewport
|
||||
inbagwindow.width = 190
|
||||
inbagwindow.height = 64
|
||||
inbagwindow.baseColor = Color.new(88, 88, 80)
|
||||
inbagwindow.shadowColor = Color.new(168, 184, 184)
|
||||
inbagwindow.text = _INTL("In Bag:<r>{1} ", qty)
|
||||
qty = @adapter.getQuantity(item)
|
||||
using(inbagwindow = Window_AdvancedTextPokemon.new("")) { # Showing quantity in bag
|
||||
pbPrepareWindow(numwindow)
|
||||
pbPrepareWindow(inbagwindow)
|
||||
numwindow.viewport = @viewport
|
||||
numwindow.width = 224
|
||||
numwindow.height = 64
|
||||
numwindow.baseColor = Color.new(88, 88, 80)
|
||||
numwindow.shadowColor = Color.new(168, 184, 184)
|
||||
inbagwindow.visible = @buying
|
||||
inbagwindow.viewport = @viewport
|
||||
inbagwindow.width = 190
|
||||
inbagwindow.height = 64
|
||||
inbagwindow.baseColor = Color.new(88, 88, 80)
|
||||
inbagwindow.shadowColor = Color.new(168, 184, 184)
|
||||
inbagwindow.text = _INTL("In Bag:<r>{1} ", qty)
|
||||
numwindow.text = _INTL("x{1}<r>$ {2}", curnumber, (curnumber * itemprice).to_s_formatted)
|
||||
pbBottomRight(numwindow)
|
||||
numwindow.y -= helpwindow.height
|
||||
pbBottomLeft(inbagwindow)
|
||||
inbagwindow.y -= helpwindow.height
|
||||
loop do
|
||||
Graphics.update
|
||||
Input.update
|
||||
numwindow.update
|
||||
inbagwindow.update
|
||||
self.update
|
||||
if Input.repeat?(Input::LEFT)
|
||||
pbPlayCursorSE
|
||||
curnumber -= 10
|
||||
curnumber = 1 if curnumber < 1
|
||||
numwindow.text = _INTL("x{1}<r>$ {2}", curnumber, (curnumber * itemprice).to_s_formatted)
|
||||
pbBottomRight(numwindow)
|
||||
numwindow.y -= helpwindow.height
|
||||
pbBottomLeft(inbagwindow)
|
||||
inbagwindow.y -= helpwindow.height
|
||||
loop do
|
||||
Graphics.update
|
||||
Input.update
|
||||
numwindow.update
|
||||
inbagwindow.update
|
||||
self.update
|
||||
if Input.repeat?(Input::LEFT)
|
||||
pbPlayCursorSE
|
||||
curnumber -= 10
|
||||
curnumber = 1 if curnumber < 1
|
||||
numwindow.text = _INTL("x{1}<r>$ {2}", curnumber, (curnumber * itemprice).to_s_formatted)
|
||||
elsif Input.repeat?(Input::RIGHT)
|
||||
pbPlayCursorSE
|
||||
curnumber += 10
|
||||
curnumber = maximum if curnumber > maximum
|
||||
numwindow.text = _INTL("x{1}<r>$ {2}", curnumber, (curnumber * itemprice).to_s_formatted)
|
||||
elsif Input.repeat?(Input::UP)
|
||||
pbPlayCursorSE
|
||||
curnumber += 1
|
||||
curnumber = 1 if curnumber > maximum
|
||||
numwindow.text = _INTL("x{1}<r>$ {2}", curnumber, (curnumber * itemprice).to_s_formatted)
|
||||
elsif Input.repeat?(Input::DOWN)
|
||||
pbPlayCursorSE
|
||||
curnumber -= 1
|
||||
curnumber = maximum if curnumber < 1
|
||||
numwindow.text = _INTL("x{1}<r>$ {2}", curnumber, (curnumber * itemprice).to_s_formatted)
|
||||
elsif Input.trigger?(Input::USE)
|
||||
pbPlayDecisionSE
|
||||
ret = curnumber
|
||||
break
|
||||
elsif Input.trigger?(Input::BACK)
|
||||
pbPlayCancelSE
|
||||
ret = 0
|
||||
break
|
||||
end
|
||||
end
|
||||
}
|
||||
elsif Input.repeat?(Input::RIGHT)
|
||||
pbPlayCursorSE
|
||||
curnumber += 10
|
||||
curnumber = maximum if curnumber > maximum
|
||||
numwindow.text = _INTL("x{1}<r>$ {2}", curnumber, (curnumber * itemprice).to_s_formatted)
|
||||
elsif Input.repeat?(Input::UP)
|
||||
pbPlayCursorSE
|
||||
curnumber += 1
|
||||
curnumber = 1 if curnumber > maximum
|
||||
numwindow.text = _INTL("x{1}<r>$ {2}", curnumber, (curnumber * itemprice).to_s_formatted)
|
||||
elsif Input.repeat?(Input::DOWN)
|
||||
pbPlayCursorSE
|
||||
curnumber -= 1
|
||||
curnumber = maximum if curnumber < 1
|
||||
numwindow.text = _INTL("x{1}<r>$ {2}", curnumber, (curnumber * itemprice).to_s_formatted)
|
||||
elsif Input.trigger?(Input::USE)
|
||||
pbPlayDecisionSE
|
||||
ret = curnumber
|
||||
break
|
||||
elsif Input.trigger?(Input::BACK)
|
||||
pbPlayCancelSE
|
||||
ret = 0
|
||||
break
|
||||
end
|
||||
end
|
||||
}
|
||||
}
|
||||
helpwindow.visible = false
|
||||
return ret
|
||||
@@ -494,7 +535,7 @@ class PokemonMart_Scene
|
||||
if itemwindow.item != olditem
|
||||
@sprites["icon"].item = itemwindow.item
|
||||
@sprites["itemtextwindow"].text =
|
||||
(itemwindow.item) ? @adapter.getDescription(itemwindow.item) : _INTL("Quit shopping.")
|
||||
(itemwindow.item) ? @adapter.getDescription(itemwindow.item) : _INTL("Quit shopping.")
|
||||
end
|
||||
if Input.trigger?(Input::BACK)
|
||||
pbPlayCloseMenuSE
|
||||
@@ -557,7 +598,7 @@ class PokemonMartScreen
|
||||
end
|
||||
if GameData::Item.get(item).is_important?
|
||||
if !pbConfirm(_INTL("Certainly. You want {1}. That will be ${2}. OK?",
|
||||
itemname,price.to_s_formatted))
|
||||
itemname,price.to_s_formatted))
|
||||
next
|
||||
end
|
||||
quantity=1
|
||||
@@ -565,11 +606,11 @@ class PokemonMartScreen
|
||||
maxafford = (price <= 0) ? Settings::BAG_MAX_PER_SLOT : @adapter.getMoney / price
|
||||
maxafford = Settings::BAG_MAX_PER_SLOT if maxafford > Settings::BAG_MAX_PER_SLOT
|
||||
quantity=@scene.pbChooseNumber(
|
||||
_INTL("{1}? Certainly. How many would you like?",itemname),item,maxafford)
|
||||
_INTL("{1}? Certainly. How many would you like?",itemname),item,maxafford)
|
||||
next if quantity==0
|
||||
price*=quantity
|
||||
if !pbConfirm(_INTL("{1}, and you want {2}. That will be ${3}. OK?",
|
||||
itemname,quantity,price.to_s_formatted))
|
||||
itemname,quantity,price.to_s_formatted))
|
||||
next
|
||||
end
|
||||
end
|
||||
@@ -626,7 +667,7 @@ class PokemonMartScreen
|
||||
@scene.pbShowMoney
|
||||
if qty>1
|
||||
qty=@scene.pbChooseNumber(
|
||||
_INTL("{1}? How many would you like to sell?",itemname),item,qty)
|
||||
_INTL("{1}? How many would you like to sell?",itemname),item,qty)
|
||||
end
|
||||
if qty==0
|
||||
@scene.pbHideMoney
|
||||
@@ -653,11 +694,11 @@ def replaceShopStockWithRandomized(stock)
|
||||
newStock = []
|
||||
for item in stock
|
||||
newItem =$PokemonGlobal.randomItemsHash[item]
|
||||
if newItem != nil && GameData::Item.get(newItem).price >0 && !Settings::EXCLUDE_FROM_RANDOM_SHOPS.include?(newItem)
|
||||
newStock << newItem
|
||||
else
|
||||
newStock << item
|
||||
end
|
||||
if newItem != nil && GameData::Item.get(newItem).price >0 && !Settings::EXCLUDE_FROM_RANDOM_SHOPS.include?(newItem)
|
||||
newStock << newItem
|
||||
else
|
||||
newStock << item
|
||||
end
|
||||
end
|
||||
return newStock
|
||||
end
|
||||
@@ -685,8 +726,8 @@ def pbPokemonMart(stock,speech=nil,cantsell=false)
|
||||
commands[cmdSell = commands.length] = _INTL("Sell") if !cantsell
|
||||
commands[cmdQuit = commands.length] = _INTL("Quit")
|
||||
cmd = pbMessage(
|
||||
speech ? speech : _INTL("Welcome! How may I serve you?"),
|
||||
commands,cmdQuit+1)
|
||||
speech ? speech : _INTL("Welcome! How may I serve you?"),
|
||||
commands,cmdQuit+1)
|
||||
loop do
|
||||
if cmdBuy>=0 && cmd==cmdBuy
|
||||
scene = PokemonMart_Scene.new
|
||||
@@ -701,7 +742,7 @@ def pbPokemonMart(stock,speech=nil,cantsell=false)
|
||||
break
|
||||
end
|
||||
cmd = pbMessage(_INTL("Is there anything else I can help you with?"),
|
||||
commands,cmdQuit+1)
|
||||
commands,cmdQuit+1)
|
||||
end
|
||||
$game_temp.clear_mart_prices
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user