Last active
August 29, 2015 13:57
-
-
Save zh99998/9779955 to your computer and use it in GitHub Desktop.
maotama for rpg maker
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Maotama | |
Achievements = [ | |
21..28 | |
] | |
def self.unlock_achievement(type, id) | |
STDOUT.write("<maotama><achievement type='#{type}' id='#{id}'/></maotama>") | |
STDOUT.flush | |
end | |
end | |
class Game_Switches | |
alias maotama_old_set []= | |
def []=(switch_id, value) | |
if value and !self[switch_id] | |
Maotama::Achievements.each_with_index do |achievement_range, type| | |
if achievement_range.include? switch_id | |
Maotama.unlock_achievement(type, switch_id - achievement_range.first) | |
end | |
end | |
end | |
maotama_old_set(switch_id, value) | |
end | |
end | |
#测试 | |
#unlock_achievement(0, 0) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment