Tax System VX Version: 2.0
By: Delyemerald2 (Original XP version by Falcon)
Introduction
With this script you can add taxes to shops, or even add discounts. Depending on the item's price, you can make taxes or discounts everywhere. You can even create shops which will give you money when you buy an item if you overdo the discounts.
Features
Screenshots
Script
Instructions
Paste above main, underneath ALL standard shop scripts.
Use the command Script in an event and enter this:
(For Taxes)
$game_system.taxrate = x
Where x is a value above 0 (will be counted in percentages)
$game_system.taxamount = y
Where y is a value above 0 (this will be added to the base prices)
(For Discounts)
$game_system.taxrate = x
Where x is a value below 0 (will be counted in percentages)
$game_system.taxamount = y
Where y is a value below 0 (this will be added to the base prices)
Compatibility
No compatibility issues are found yet. If any are found, report them please.
Credits and Thanks
Falcon for the original RMXP version
Author's Notes
The original version is on an other site. I've said there that any requests are welcome, and thus this script CAN be updated. If any of you have a request, PM me please.
Terms and Conditions
This script is open for everyone, but be sure to credit Falcon, for the original version, and me for the small edits.
By: Delyemerald2 (Original XP version by Falcon)
Introduction
With this script you can add taxes to shops, or even add discounts. Depending on the item's price, you can make taxes or discounts everywhere. You can even create shops which will give you money when you buy an item if you overdo the discounts.
Features
- Taxes (in percentage)
- Taxes (in amounts)
- Discounts (in percentage)
- Discounts (in amounts)
- Free items (which aren't free normally)
- Items (that are free normally) with a price
- Free items with money
Screenshots
Normally
Spoiler

With Tax
Spoiler

With Discount
Spoiler

Overdid it a little =P
Spoiler

Script
- #============================================================================
- # Tax Script 2.0 (VX)
- #----------------------------------------------------------------------------
- # Originally made by Falcon for RMXP (see further info at bottom of this part)
- # Edited by Delyemerald2 to fit the RMVX
- #----------------------------------------------------------------------------
- # This system adds something to shop status, but in the same process, copies
- # Everything normally there.
- # With this script, you can add taxes or discounts.
- # In order to do so, use the command Script in an event and enter this:
- # (For Taxes)
- # $game_system.taxrate = x
- # Where x is a value above 0 (will be counted in percentages)
- # $game_system.taxamount = y
- # Where y is a value above 0 (this will be added to the base prices)
- # (For Discounts)
- # $game_system.taxrate = x
- # Where x is a value below 0 (will be counted in percentages)
- # $game_system.taxamount = y
- # Where y is a value below 0 (this will be added to the base prices)
- #----------------------------------------------------------------------------
- # Credits to:
- # Falcon for the original script
- # Blizard for the idea that triggered version 2.0 (Falcon's Credits)
- # You, becuase you eat a cookie in your life =D
- #----------------------------------------------------------------------------
- # ORIGINAL INFO (RMXP Version)
- #----------------------------------------------------------------------------
- # By Falcon
- # Thanks to Blizzard for the idea that triggered version 2.0
- #----------------------------------------------------------------------------
- # This system should be compatible with all shop systems, but the
- # Shop Status window will only show the tax/discount rate for the default
- #============================================================================
- # setup the variable that will hold the tax rate
- class Game_System
- attr_accessor :taxrate
- attr_accessor :taxamount
- alias declaration initialize
- def initialize
- declaration
- @taxrate = 0
- @taxamount = 0
- end
- end
- # increase the price of the following items by the tax rate
- class RPG::Item
- def price
- return Integer(@price + $game_system.taxamount + @price * $game_system.taxrate / 100)
- end
- end
- class RPG::Weapon
- def price
- return Integer(@price + $game_system.taxamount + @price * $game_system.taxrate / 100)
- end
- end
- class RPG::Armor
- def price
- return Integer(@price + $game_system.taxamount + @price * $game_system.taxrate / 100)
- end
- end
- class Window_ShopStatus < Window_Base
- #--------------------------------------------------------------------------
- # * Object Initialization
- # x : window X coordinate
- # y : window Y coordinate
- #--------------------------------------------------------------------------
- def initialize(x, y)
- super(x, y, 240, 304)
- @item = nil
- refresh
- end
- #--------------------------------------------------------------------------
- # * Refresh
- #--------------------------------------------------------------------------
- def refresh
- self.contents.clear
- if @item != nil
- number = $game_party.item_number(@item)
- self.contents.font.color = system_color
- self.contents.draw_text(4, 0, 200, WLH, Vocab::Possession)
- self.contents.font.color = normal_color
- self.contents.draw_text(4, 0, 200, WLH, number, 2)
- # Here you can customize what there will stand when there's a tax. You can also
- # edit the heights of the words and numbers. One warning: Don't make it to long
- # or it will overlap the percentages.
- if $game_system.taxrate > 0 # If there is tax
- self.contents.draw_text(4, 16, 200, WLH, "Current Tax")
- self.contents.font.color = normal_color
- self.contents.draw_text(100, 16, 104, WLH, $game_system.taxrate.to_s + "%", 2)
- elsif 0 > $game_system.taxrate # If there is a discount rate
- self.contents.draw_text(4, 16, 200, WLH, "Discount")
- self.contents.font.color = normal_color
- self.contents.draw_text(100, 16, 104, WLH, $game_system.taxrate.to_s + "%", 2)
- end
- if $game_system.taxamount > 0 # If there is tax
- self.contents.draw_text(4, 32, 200, WLH, "Tax (A)")
- self.contents.font.color = normal_color
- self.contents.draw_text(100, 32, 104, WLH, $game_system.taxamount.to_s , 2)
- elsif 0 > $game_system.taxamount # If there is a discount rate
- self.contents.draw_text(4, 32, 200, WLH, "Discount (A)")
- self.contents.font.color = normal_color
- self.contents.draw_text(100, 32, 104, WLH, $game_system.taxamount.to_s , 2)
- end
- for actor in $game_party.members
- x = 4
- y = WLH * (2 + actor.index * 2)
- draw_actor_parameter_change(actor, x, y)
- end
- end
- end
- #--------------------------------------------------------------------------
- # * Draw Actor's Current Equipment and Parameters
- # actor : actor
- # x : draw spot x-coordinate
- # y : draw spot y-coordinate
- #--------------------------------------------------------------------------
- def draw_actor_parameter_change(actor, x, y)
- return if @item.is_a?(RPG::Item)
- enabled = actor.equippable?(@item)
- self.contents.font.color = normal_color
- self.contents.font.color.alpha = enabled ? 255 : 128
- self.contents.draw_text(x, y, 200, WLH, actor.name)
- if @item.is_a?(RPG::Weapon)
- item1 = weaker_weapon(actor)
- elsif actor.two_swords_style and @item.kind == 0
- item1 = nil
- else
- item1 = actor.equips[1 + @item.kind]
- end
- if enabled
- if @item.is_a?(RPG::Weapon)
- atk1 = item1 == nil ? 0 : item1.atk
- atk2 = @item == nil ? 0 : @item.atk
- change = atk2 - atk1
- else
- def1 = item1 == nil ? 0 : item1.def
- def2 = @item == nil ? 0 : @item.def
- change = def2 - def1
- end
- self.contents.draw_text(x, y, 200, WLH, sprintf("%+d", change), 2)
- end
- draw_item_name(item1, x, y + WLH, enabled)
- end
- #--------------------------------------------------------------------------
- # * Get Weaker Weapon Equipped by the Actor (for dual wielding)
- # actor : actor
- #--------------------------------------------------------------------------
- def weaker_weapon(actor)
- if actor.two_swords_style
- weapon1 = actor.weapons[0]
- weapon2 = actor.weapons[1]
- if weapon1 == nil or weapon2 == nil
- return nil
- elsif weapon1.atk < weapon2.atk
- return weapon1
- else
- return weapon2
- end
- else
- return actor.weapons[0]
- end
- end
- #--------------------------------------------------------------------------
- # * Set Item
- # item : new item
- #--------------------------------------------------------------------------
- def item=(item)
- if @item != item
- @item = item
- refresh
- end
- end
- end
Expand to see the code.
Instructions
Paste above main, underneath ALL standard shop scripts.
Use the command Script in an event and enter this:
(For Taxes)
$game_system.taxrate = x
Where x is a value above 0 (will be counted in percentages)
$game_system.taxamount = y
Where y is a value above 0 (this will be added to the base prices)
(For Discounts)
$game_system.taxrate = x
Where x is a value below 0 (will be counted in percentages)
$game_system.taxamount = y
Where y is a value below 0 (this will be added to the base prices)
Compatibility
No compatibility issues are found yet. If any are found, report them please.
Credits and Thanks
Falcon for the original RMXP version
Author's Notes
The original version is on an other site. I've said there that any requests are welcome, and thus this script CAN be updated. If any of you have a request, PM me please.
Terms and Conditions
This script is open for everyone, but be sure to credit Falcon, for the original version, and me for the small edits.