Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- =begin
- ================================================================================
- ■「SIMPLE STUPID」 Alternative Shop
- ================================================================================
- CHANGELOG
- - ver0.60 2013.05.26 Finished the script
- ================================================================================
- INTRODUCTION
- - This script enables the user to use specified variable as money.
- ================================================================================
- INSTRUCTION
- - Put this script below ▼ Materials/素材 but above ▼ Main.
- - Write "<e-shop>" (without quotes) on items/weapons/armors that considered as
- alternative items to prevent those items from being sold on normal shop.
- - You can change the configurations below "on the fly" by typing corresponding
- variables via Event Script
- For example, if you want to change alternative shop variable in the middle of
- the game, just type:
- $eshop_var = x
- inside Event Script box
- - By default, alternative shop items can't be sold in normal shop mode vice versa.
- ================================================================================
- =end
- #CONFIG=========================================================================
- # alternative shop currency
- $eshop_currency = " E-Coin"
- # alternative shop variable
- $eshop_var = 1
- # the number of switch to turn alternative shop on. make sure to turn off that switch
- # off after you finished alternative shop scene.
- $eshop_switch = 1
- # determine wether alternative shop is purchase only.
- # this will remove sell command on alternative shop scene.
- $eshop_purchase_only = true #default = true
- # alternative shop items sell price rate on alternative shop scene.
- # only have effect if $eshop_purchase_only set to false
- $eshop_sell_rate = 0.5
- # determine if alternative shop items can be sold on normal shop
- $eshop_sell_in_normal_shop = false #default = false
- # alternative shop items sell price rate on normal shop scene.
- # normal item sell price rate will be 1/$eshop_normal_shop_rate
- # only have effect if $eshop_sell_in_normal_shop set to true
- $eshop_normal_shop_rate = 0.1
- #===============================================================================
- class Scene_Shop
- alias hbk_sses_do_buy do_buy
- def do_buy(number)
- if $game_switches[$eshop_switch]
- $game_variables[$eshop_var] -= (number * buying_price)
- $game_party.gain_item(@item, number)
- return
- end
- hbk_sses_do_buy(number)
- end
- alias hbk_sses_do_sell do_sell
- def do_sell(number)
- if $game_switches[$eshop_switch]
- $game_variables[$eshop_var] += (number * selling_price)
- $game_party.lose_item(@item, number)
- return
- end
- hbk_sses_do_sell(number)
- end
- alias hbk_sses_selling_price selling_price
- def selling_price
- if $game_switches[$eshop_switch]
- if @item.note.include?("<e-shop>")
- return (@item.price * $eshop_sell_rate.to_f).to_i
- elsif !@item.note.include?("<e-shop>")
- return (@item.price / $eshop_normal_shop_rate.to_f).to_i
- end
- else
- if @item.note.include?("<e-shop>")
- return (@item.price * $eshop_normal_shop_rate.to_f).to_i
- else
- return hbk_sses_selling_price
- end
- end
- end
- end #Scene_Shop
- class Window_ShopCommand
- alias hbk_sses_make_command_list make_command_list
- def make_command_list
- if $game_switches[$eshop_switch] && $eshop_purchase_only
- add_command(Vocab::ShopBuy, :buy)
- add_command(Vocab::ShopCancel, :cancel)
- return
- end
- hbk_sses_make_command_list
- end
- end #Window_ShopCommand
- class Window_Gold
- alias hbk_sses_value value
- def value
- return $game_variables[$eshop_var] if $game_switches[$eshop_switch]
- return hbk_sses_value
- end
- alias hbk_sses_currency_unit currency_unit
- def currency_unit
- return $eshop_currency if $game_switches[$eshop_switch]
- return hbk_sses_currency_unit
- end
- end #Window_Gold
- class Window_ShopSell
- alias hbk_sses_enable? enable?
- def enable?(item)
- if $game_switches[$eshop_switch]
- if $eshop_sell_in_normal_shop;return hbk_sses_enable?(item)
- else;return hbk_sses_enable?(item) && item.note.include?("<e-shop>")
- end
- else
- if $eshop_sell_in_normal_shop;return hbk_sses_enable?(item)
- else;return hbk_sses_enable?(item) && !item.note.include?("<e-shop>")
- end
- end
- end
- end #Window_ShopSell
Advertisement
Add Comment
Please, Sign In to add comment