=begin
===============================================================================
元角分 By喵呜喵5
===============================================================================
【说明】
把金钱的显示方式修改成了XX元XX角XX分这样的形式
=end
module M5Money
#==============================================================================
# 设定部分
#==============================================================================
RATE = 10
#设定进制,例如10分=1角、10角=1元的时候就把上方的数字设置成10
FEN = "分"
#设定游戏中1G所对应的单位,默认获得1G即获得1分钱
JIAO = "角"
#设定游戏中1G*RATE所对应的单位
YUAN = "元"
#设定游戏中1G*RATE*RATE所对应的单位
#==============================================================================
# 设定结束
#==============================================================================
#==============================================================================
# 脚本部分
#==============================================================================
end
class Window_Gold < Window_Base
def refresh
contents.clear
draw_currency_value("",m5_gain_gold($game_party.gold),4, 0,
contents.width - 8)
end
def m5_gain_gold(gold)
yuan = gold / ( M5Money::RATE * M5Money::RATE)
val = (yuan == 0 ? "" : yuan.to_s + M5Money::YUAN )
jiao = (gold / M5Money::RATE) % M5Money::RATE
val += (jiao == 0 ? "" : jiao.to_s + M5Money::JIAO )
fen = gold % ( M5Money::RATE )
val += fen.to_s + M5Money::FEN
end
end
class << BattleManager
def gain_gold
if $game_troop.gold_total > 0
gold = $game_troop.gold_total
yuan = gold / ( M5Money::RATE * M5Money::RATE)
val = (yuan == 0 ? "" : yuan.to_s + M5Money::YUAN )
jiao = (gold / M5Money::RATE) % M5Money::RATE
val += (jiao == 0 ? "" : jiao.to_s + M5Money::JIAO )
fen = gold % ( M5Money::RATE )
val += fen.to_s + M5Money::FEN
text = '获得了' + val
$game_message.add('\.' + text)
$game_party.gain_gold($game_troop.gold_total)
end
wait_for_message
end
end