赞 | 0 |
VIP | 0 |
好人卡 | 0 |
积分 | 1 |
经验 | 1310 |
最后登录 | 2016-2-13 |
在线时间 | 60 小时 |
Lv1.梦旅人
- 梦石
- 0
- 星屑
- 50
- 在线时间
- 60 小时
- 注册时间
- 2013-1-21
- 帖子
- 53
|
3楼

楼主 |
发表于 2013-2-20 17:30:47
|
只看该作者
protosssonny 发表于 2013-2-20 16:22 ![]()
错了错了,LZ你错了喵~
应该是这样:
[001]=随机数(100..300)
理解,谢谢
不过出错了, “$game_system.tax.percent ”这是我脚本, $game_system.tax.percent = 120 为 120%价格
#============================================================================
# Shop Taxes V1.6 (VXA version)
# By Emerald
#----------------------------------------------------------------------------
# Originally made by Falcon for RMXP
# Edited by Emerald to fit the RMVX and now also RMVX Ace
# You're free to use the script for any game, as long as you give credits
#----------------------------------------------------------------------------
# Version History
# 0.5 -> Script ported to RMVX Ace with minor edits to avoid errors
# 1.0 -> Further edits due to problems with percentage taxes
# Added possibility to easily configure x/y position of tax information
# and a value to configure if it will even be shown at all.
# 1.5 -> Again, further edits due to slight problems. But aside from that,
# you can use <tax key item> again. Also added possibility to create
# items which alter taxes. DRASTICALLY changed Instructions, be sure to
# read it thoroughly.
# 1.6 -> Added Sell taxes and item Sell Tax changes.
#----------------------------------------------------------------------------
# With this script, you can almost fully control prices for VX Ace. You can
# normally set prices and prices unique per shop, and this script adds the
# possibility to make taxes. With these taxes, you can easily change prices of
# all items in a shop, either higher or lower.
#
# Instructions:
#
# Just as always, put this script between ▼ Materials and ▼ Main. If the
# information about the taxes is not shown correctly in shops, you can change
# it below.
# 就像往常一样,把这个脚本▼材料和▼之间。如果信息无法正确显示在商店的税收,你可以改变它下面
#
# In order to add taxes, use the call script method within an event. Use
# the following codes codes:
#
# $game_system.tax.percent = x
# Where x > 100 results in a tax with x% the normal price
# 其中,x> 100结果在一个纳税X%的正常价格
# Where x < 100 results in a discount with x% the normal price
# 其中,x<100 X%的正常价格折扣
#
# $game_systeme.tax.direct = y
# Where y > 0 results in a tax which adds y to every price
# 其中y> 0,y为每一个价格在一个纳税
# Where y < 0 results in a discount which subtracts y to every price
# 式中,y<0的结果中减去y为每一个价格的折扣
#
# WARNING
# For n = the price of an item,
# If n - y equals 0, the item becomes free
# If n - y < 0, the item becomes free AND you GET money (why doesn't that happen
# in real life)
# If x = a negative value then you'll GET money (x% the normal price)
# 对于n =一个项目的价格,
# 如果n - y等于0时,该项目成为自由
# 如果n - Y <0时,该项目成为自由,你会得到钱(为什么不发生在现实生活中)
# 如果x =负值,那么你会得到钱(X%的正常价格)
#
#
# ALWAYS!!, unless you're SURE the player can't have any items which alter taxes,
# add $game_system.tax.perbon to percentage taxes and $game_system.tax.dirbon to
# direct taxes. Else, the changes of the items ARE NOT APLIED!!
# ALWAYS!,除非你确定玩家可以没有任何改变税收的项目,
# $ game_system.tax.perbon的百分比税和$ game_system.tax.dirbon到
# 直接税。否则,不APLIED项目的变化!
# END WARNING
#
# $game_system.selltax.percent = x
# $game_system.selltax.direct = y
# $game_system.selltax.perbon = x
# $game_system.selltax.dirbon = y
#
# Exact same story as above, only these are hidden and for items being sold.
# 精确上述同样的故事,这些都是隐藏的,正在出售的物品。
#
# <tax key item>
# Use the above tag if you don't want that the price of that item can be changed
# by taxes. Useful for items which the player may not buy/sell. 使用上面的标签,
# 如果你不希望这样的价格,该项目可以改变税收。有用的物品,玩家可以不买/卖。
#
#
# <tax +/-x>
# Use the above tag to make items which will alter direct taxes. Use + to make
# it higher, - to make it lower. Enter a value for x. 使用上面的标签,这将改变
# 直接税。高,使用+ - ,使其低。输入x的值。
#
# <tax +/-x%>
# Use the above tag to make items whcih will alter percentage taxes. Use + to
# make it higher, - to make it lower. WARNING!! The value you enter for x will
# be ADDED or SUBSTRACTED of the current tax.percent!! 使用上面的标记,让项目的
# 酦将改变比例税。高,使用+ - ,使其低。警告!您输入的x的值将被添加或中减去目前
# 的tax.percent!!
#
# Examples:
# $game_system.tax.percent = 150 & an item with <tax +20%> will result in a tax
# of 170%. “150”项目与<tax+20%>将导致在一个纳税170%。
#
# $game_system.tax.percent = 100 (/no value set) & an item with <tax -42%> will
# result in a tax of 58%.“100”(/没有价值的)一个项目,<tax-42%>导致58%的税。
#
# NOTE that if the player gets any items with these tags, the amount he/she has
# of the item determines how many times the taxes will be altered! Two of the
# same items in Example 1 will result in a tax of 190% instead of 170%.
# Also, if the player gets any items with these tags, the changes to taxes will
# be stored in $game_system.tax.perbon and $game_system.tax.dirbon for
# percentage and direct taxes respectively. Always add these variable to
# $game_system.tax.percent and $game_system.tax.direct respectively if changes
# to these two are made. Don't change perbon and dirbon as they only handle the
# changes made by items. 需要注意的是,如果玩家获得这些标签的任何项目,该项目确定
# 他/她有多少次税将改变!例1在同一项目中的两个将导致190%,而不是170%的税。
# 此外,如果玩家获得这些标签的任何项目的税收,将,在$ game_system.tax.perbon美元和
# 百分比game_system.tax.dirbon和直接税分别存放。一定要添加这些变量$ game_system.
# tax.percent的美元和game_system.tax.direct如果这两个分别。 ,不要改变perbon和dirbon,
# 因为他们处理的项目所做的更改。
#
# <selltax +/-x>
# Exact same effect as <tax...> but this one changes the prices of sold items.
# 精确相同的效果<tax...>但这个变化的价格出售项目。
#
# <selltax +/-x%>
# Same story as above.上同
#
# Use $game_system.selltax.perbon and $game_system.selltax.perbon for the above
# two tags.
#----------------------------------------------------------------------------
# Credits to:
# Falcon for the original script
# Blizard for the idea that triggered version 2.0 (Falcon's Credits)
# You, because you ate a cookie in your life =D (I hope... If not, I'll send
# Bennett to make you eat a cookie with his manliness...)
#----------------------------------------------------------------------------
# This script should be compatible with all shop systems. If not, alert me.
#============================================================================
#
# CONFIGURATIONS
#
#============================================================================
class Window_ShopStatus < Window_Base
TAX = "Tax" # Word which stands before percent tax IF the percent tax > 100代表%的税率征收前IF%的税> 100
DISCOUNT = "价格" # Word which stands before percent tax IF the percent tax < 100字代表IF%的税率征收100%的税前
TAX_DIRECT = "Tax (A)" # Word which stands before direct tax IF the direct tax > 0 里面站立在直接税,如果直接税>0
DISCOUNT_DIRECT = "Discount (A)" # Word which stands before direct tax IF the direct tax < 0代表如果直接税直接税之前<0
TAX_INFORMATION = true # True = show information about taxes in shops, false = well... the opposite
TAX_X = 4 # x position of the information of the taxes. Usually, text has an x-value of 4 x位置的信息的税收。一般,文字有4的x值
TAX_Y = 216 # y position of the information. Default = 216. Not that text starts on y = 0 and every line has a height of y = 24 y位置的信息。默认值= 216。非该文本在y=0开始,每行有一个高度为y =24
end
module EME
module REGEXP
module ITEM
# Only edit things past here if you know what you're doing
KEY_ITEM_TAG = /<tax[\s_]?key[\s_]?item>/i # <tax key item>
ITEM_TAX_PER = /<tax[\s_]?[ ]*([\+\-]\d+)([%%])>/i # <tax +/-x%>
ITEM_TAX_DIR = /<tax[\s_]?[ ]*([\+\-]\d+)>/i # <tax +/-x>
ITEM_SELLTAX_PER = /<selltax[\s_]?[ ]*([\+\-]\d+)([%%])>/i # <selltax +/-x%>
ITEM_SELLTAX_DIR = /<selltax[\s_]?[ ]*([\+\-]\d+)>/i # <selltax +/-x>
end
end
end
#============================================================================
#
# Game_System
# Defines all needed variables for taxes.定义所有需要的变量税。
#============================================================================
class Game_System::Tax
attr_accessor :percent
attr_accessor :perbon
attr_accessor :direct
attr_accessor :dirbon
def initialize
@percent = 100
@perbon = 0
@direct = 0
@dirbon = 0
end
end
class Game_System::SellTax
attr_accessor :percent
attr_accessor :perbon
attr_accessor :direct
attr_accessor :dirbon
def initialize
@percent = 100
@perbon = 0
@direct = 0
@dirbon = 0
end
end
class Game_System
attr_reader :tax
attr_reader :selltax
alias eme_tax_initialize initialize
def initialize
eme_tax_initialize
@tax = Tax.new
@selltax = SellTax.new
end
end
#============================================================================
#
# Window_ShopBuy
# Handles effects of taxes and <tax key item>.处理的税和<tax的关键项目>的影响。
#============================================================================
class Window_ShopBuy
def price(item)
@price[item]
notetag_check(item)
if @key_item
@new_price = @price[item]
elsif $game_system.tax.percent != 100 or $game_system.tax.direct != 0
@new_price = @price[item] * $game_system.tax.percent / 100 + $game_system.tax.direct
else
@new_price = @price[item]
end
end
def notetag_check(item)
@key_item = false
item.note.split(/[\r\n]+/).each { |line|
case line
when EME::REGEXP::ITEM::KEY_ITEM_TAG
@key_item = true
end
}
end
end
class Scene_Shop
def selling_price
the_selling_price = @item.price / 2
notetag_check(@item)
unless @key_item = true
if $game_system.selltax.percent != 100
the_selling_price *= $game_system.selltax.percent / 100
end
if $game_system.selltax.direct != 0
the_selling_price += $game_system.selltax.direct
end
end
return the_selling_price
end
def notetag_check(item)
@key_item = false
item.note.split(/[\r\n]+/).each { |line|
case line
when EME::REGEXP::ITEM::KEY_ITEM_TAG
@key_item = true
end
}
end
end
#============================================================================
#
# Game_Party
# Handles items which alter taxes.处理改变税的项目。
#============================================================================
class Game_Party
alias eme_tax_gain_item gain_item
def gain_item(item, amount, include_equip = false)
eme_tax_gain_item(item, amount, include_equip = false)
if amount > 0 and item != nil
item.note.split(/[\r\n]+/).each { |line|
case line
when EME::REGEXP::ITEM::ITEM_TAX_PER
$game_system.tax.percent += $1.to_i * amount
$game_system.tax.perbon += $1.to_i * amount
when EME::REGEXP::ITEM::ITEM_TAX_DIR
$game_system.tax.direct += $1.to_i * amount
$game_system.tax.dirbon += $1.to_i * amount
when EME::REGEXP::ITEM::ITEM_SELLTAX_PER
$game_system.selltax.percent += $1.to_i * amount
$game_system.selltax.perbon += $1.to_i * amount
when EME::REGEXP::ITEM::ITEM_SELLTAX_PER
$game_system.selltax.percent += $1.to_i * amount
$game_system.selltax.perbon += $1.to_i * amount
end
}
elsif item != nil
item.note.split(/[\r\n]+/).each { |line|
case line
when EME::REGEXP::ITEM::ITEM_TAX_PER
$game_system.tax.percent -= $1.to_i * amount
$game_system.tax.perbon -= $1.to_i * amount
when EME::REGEXP::ITEM::ITEM_TAX_DIR
$game_system.tax.direct -= $1.to_i * amount
$game_system.tax.dirbon -= $1.to_i * amount
when EME::REGEXP::ITEM::ITEM_SELLTAX_PER
$game_system.selltax.percent -= $1.to_i * amount
$game_system.selltax.perbon -= $1.to_i * amount
when EME::REGEXP::ITEM::ITEM_SELLTAX_PER
$game_system.selltax.percent -= $1.to_i * amount
$game_system.selltax.perbon -= $1.to_i * amount
end
}
end
end
end
#============================================================================
#
# Window_ShopStatus
# Handles information of taxes shown in shops.在商店的税收处理信息。
#============================================================================
class Window_ShopStatus < Window_Base
alias eme_tax_refresh refresh
def refresh
eme_tax_refresh
if TAX_INFORMATION
draw_taxes(TAX_X, TAX_Y)
end
end
def draw_taxes(x, y)
if $game_system.tax.percent != 100
rect = Rect.new(x, y, contents.width - 4 - x, line_height)
change_color(system_color)
if $game_system.tax.percent > 100
draw_text(rect, TAX + ":")
else
draw_text(rect, DISCOUNT + ":")
end
change_color(normal_color)
draw_text(rect, $game_system.tax.percent.to_s + "%", 2)
end
if $game_system.tax.direct != 0
rect = Rect.new(x, y + 24, contents.width - 4 - x, line_height)
change_color(system_color)
if $game_system.tax.direct > 0
draw_text(rect, TAX_DIRECT + ":")
else
draw_text(rect, DISCOUNT_DIRECT + ":")
end
change_color(normal_color)
draw_text(rect, $game_system.tax.direct.to_s, 2)
end
end
end |
|