加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有帐号?注册会员
x
本帖最后由 醉后③缈丶 于 2013-7-5 15:00 编辑
目测。我只发现商店物品价格变动只能对指定物品变价
我想的是商店物品全部变价,求大神指教。这里多谢先了
class Game_Interpreter def command_物品定价(id, percent) $data_items[id].quotation_percent = percent end def command_武器定价(id, percent) $data_weapons[id].quotation_percent = percent end def command_防具定价(id, percent) $data_armors[id].quotation_percent = percent end end module RPG class Item attr_accessor :quotation_percent def price @quotation_percent = 100 if @quotation_percent.nil? return @price * @quotation_percent / 100 end end class Weapon attr_accessor :quotation_percent def price @quotation_percent = 100 if @quotation_percent.nil? return @price * @quotation_percent / 100 end end class Armor attr_accessor :quotation_percent def price @quotation_percent = 100 if @quotation_percent.nil? return @price * @quotation_percent / 100 end end end
class Game_Interpreter
def command_物品定价(id, percent)
$data_items[id].quotation_percent = percent
end
def command_武器定价(id, percent)
$data_weapons[id].quotation_percent = percent
end
def command_防具定价(id, percent)
$data_armors[id].quotation_percent = percent
end
end
module RPG
class Item
attr_accessor :quotation_percent
def price
@quotation_percent = 100 if @quotation_percent.nil?
return @price * @quotation_percent / 100
end
end
class Weapon
attr_accessor :quotation_percent
def price
@quotation_percent = 100 if @quotation_percent.nil?
return @price * @quotation_percent / 100
end
end
class Armor
attr_accessor :quotation_percent
def price
@quotation_percent = 100 if @quotation_percent.nil?
return @price * @quotation_percent / 100
end
end
end
|