Not too hard to do s:
First, add this block of code in a new spot above main:
class Game_Temp
attr_accessor :alreadyate
alias foodinit initialize; def initialize; foodinit
@alreadyate = 0
end
end
Next, go to Window_Item (or whatever item window script you're using)
and find 'def draw_item(index)'.
Find this part:
if item.is_a?(RPG::Item) and
$game_party.item_can_use?(item.id)
self.contents.font.color = normal_color
else
self.contents.font.color = disabled_color
end
and add this right below it:
if item.element_set.include?($data_system.elements.index("Food")) and $game_temp.alreadyate != 0
self.contents.font.color = disabled_color
end
Then, still in Window_Item (or your item script)
and change 'def update_help' to this:
def update_help
if self.item.element_set.include?($data_system.elements.index("Food")) and $game_temp.alreadyate != 0
@help_window.set_text("We already ate.")
else
@help_window.set_text(self.item == nil ? "" : self.item.description)
end
end
Then, go into Scene Battle 1 (or whatever battle system you're using)
and find 'def battle_end(result)' and add this line:
$game_temp.alreadyate = 0
right under 'def battle_end(result)'.
Next, go into Scene_Battle 3 (or your battle system, again)
and find 'def update_phase3_item_select'.
Scroll down to this part:
# If C button was pressed
if Input.trigger?(Input::C)
# Get currently selected data on the item window
@item = @item_window.item
# If it can't be used
unless $game_party.item_can_use?(@item.id)
# Play buzzer SE
$game_system.se_play($data_system.buzzer_se)
return
end
and add this:
if @item.element_set.include?($data_system.elements.index("Food"))
if $game_temp.alreadyate != 0
$game_system.se_play($data_system.buzzer_se)
return
else
$game_temp.alreadyate = @active_battler.index + 1
end
end
right beneath the '@item = @item_window.item' line.
Next, still in Scene_Battle 3, find this block of code:
def update_phase3_basic_command
# If B button was pressed
if Input.trigger?(Input::B)
and right beneath the 'if Input.trigger?(Input::B)' line, add this:
$game_temp.alreadyate = 0 if @active_battler.index == $game_temp.alreadyate
And finally, in Scene_Battle 4, find this line: 'def start_phase4', and add this:
$game_temp.alreadyate = -2 if $game_temp.alreadyate != 0
right below the '@active_battler = nil' line.
Now you can mark any item that targets your entire party with an element named Food and it'll only let you use one of any item marked with that element per battle o_ob I would reccomend making it usable only in battle <.< Would have to make it call a common event with a script call with
'$game_temp.alreadyate = -2 if $game_temp.in_battle == false' in it if you want to be able to use it outside of battle s:
Also, it will only let 1 person use the item, so if you're using the DBS or something, and have more than 1 of that food type, 2 people won't be able to use it on the same turn. It disables it's use immediately after selecting it, and if you decide to reselect that person's action for that turn, it'll reenable it so a different actor can use it [/confusing] o_ob