Created
December 13, 2012 19:01
-
-
Save coyotte508/4278752 to your computer and use it in GitHub Desktop.
how to log a battle
This file contains 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
BattleOld=Battle; | |
Battle = function Battle() { | |
var self = this, run, getPoke; | |
BattleOld.apply(self, arguments); | |
run = self.run; | |
self.run = function(str, preempt) { | |
console.log("run: " + str); run.apply(self,arguments); | |
}; | |
getPoke = self.getPokemon; | |
self.getPokemon = function(){ | |
console.log("getPoke: " + JSON.stringify(arguments)); | |
getPoke.apply(self, arguments); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
BattleRoomOld = BattleRoom;
BattleRoom = function BattleRoom() {
var self = this, add;
BattleRoomOld.apply(self, arguments);
add = self.add;
self.add = function(data) {
console.log("add: " + data); add.apply(self,arguments);
};
}