以下引用drgdrg于2008-9-13 12:40:52的发言:
如果想折扣更灵活一些,可以用这个脚本……
#在事件中插入脚本可以调整价格,比如插入
# command_物品定价(1, 77)
#则物品ID为1的打七七折
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
欢迎光临 Project1 (https://rpg.blue/) | Powered by Discuz! X3.1 |