[pre lang="Ruby"]
class Game_Variables
alias :rb_array_set_20220711 :[]=
def []=(variable_id, value)
@aux = true if variable_id == 2 && value < 0
rb_array_set_20220711(variable_id, value)
end
def v2_is_negative_since_game_start
@aux || false
end
end
[/pre]
使用:
[pre lang="Ruby"]if $game_variables.v2_is_negative_since_game_start
# do this
else
# do that
end
[/pre]