赞 | 0 |
VIP | 13 |
好人卡 | 13 |
积分 | 1 |
经验 | 7273 |
最后登录 | 2014-2-17 |
在线时间 | 37 小时 |
Lv1.梦旅人
- 梦石
- 0
- 星屑
- 50
- 在线时间
- 37 小时
- 注册时间
- 2012-7-30
- 帖子
- 147
|
好吧,自己不用想的就是不周全- module SHIT
- ITEMMAX = 999
-
- end
- class Game_Party
- def gain_item(item, n, include_equip = false)
- number = item_number(item)
- case item
- when RPG::Item
- @items[item.id] = [[number + n, 0].max, SHIT::ITEMMAX].min
- when RPG::Weapon
- @weapons[item.id] = [[number + n, 0].max, SHIT::ITEMMAX].min
- when RPG::Armor
- @armors[item.id] = [[number + n, 0].max, SHIT::ITEMMAX].min
- end
- n += number
- if include_equip and n < 0
- for actor in members
- while n < 0 and actor.equips.include?(item)
- actor.discard_equip(item)
- n += 1
- end
- end
- end
- end
- end
- class Window_ShopBuy < Window_Selectable
-
- def draw_item(index)
- item = @data[index]
- number = $game_party.item_number(item)
- enabled = (item.price <= $game_party.gold and number < SHIT::ITEMMAX)
- rect = item_rect(index)
- self.contents.clear_rect(rect)
- draw_item_name(item, rect.x, rect.y, enabled)
- rect.width -= 4
- self.contents.draw_text(rect, item.price, 2)
- end
-
- end
- class Scene_Shop
- def update_buy_selection
- @status_window.item = @buy_window.item
- if Input.trigger?(Input::B)
- Sound.play_cancel
- @command_window.active = true
- @dummy_window.visible = true
- @buy_window.active = false
- @buy_window.visible = false
- @status_window.visible = false
- @status_window.item = nil
- @help_window.set_text("")
- return
- end
- if Input.trigger?(Input::C)
- @item = @buy_window.item
- number = $game_party.item_number(@item)
- if @item == nil or @item.price > $game_party.gold or number == SHIT::ITEMMAX
- Sound.play_buzzer
- else
- Sound.play_decision
- max = @item.price == 0 ? SHIT::ITEMMAX : $game_party.gold / @item.price
- max = [max, SHIT::ITEMMAX - number].min
- @buy_window.active = false
- @buy_window.visible = false
- @number_window.set(@item, max, @item.price)
- @number_window.active = true
- @number_window.visible = true
- end
- end
- end
- end
复制代码 放到插入的脚本那里。。。
速写的没有syntax error。别的不知道。 |
评分
-
查看全部评分
|