Skip to content

Commit

Permalink
Merge pull request #18 from phantomindex/master
Browse files Browse the repository at this point in the history
fix for pokemon commands
  • Loading branch information
phantomindex committed Jan 10, 2017
2 parents 39eb0c9 + cf9c999 commit c196a28
Showing 1 changed file with 25 additions and 25 deletions.
50 changes: 25 additions & 25 deletions pokemonSystem/scripts/games/pokemonSystem.js
Expand Up @@ -7,7 +7,7 @@
lost: 1,
stalemate: 1
},
totalWaifus = 0,
totalPokemon = 0,
navigatorImg = 'navigator.gif';

// load();
Expand All @@ -34,7 +34,7 @@
string += 'Pokémon #' + i + ' ' + replace($.lang.get('waifugames.waifu.' + i)) + '\r\n';
++i;
}
totalWaifus = i;
totalPokemon = i;
}

/*
Expand Down Expand Up @@ -378,7 +378,7 @@
* @return {String}
*/
function url(str) {
return str.match(reGetUrl)[2] + ' ' + str.match(reGetUrl)[3];
return str.replace(/=/, '(').replace('[Legendary]', '').replace(/=/g, ')');
}

/*
Expand Down Expand Up @@ -432,7 +432,7 @@
* @param {String} username
*/
function catchWaifu(username) {
var id = $.randRange(0, totalWaifus),
var id = $.randRange(0, totalPokemon),
unlock = 1,
chance = $.randRange(1, 5),
reward = getReward(),
Expand Down Expand Up @@ -480,7 +480,7 @@
* @param {String} username
*/
function randomWaifu(username) {
var id = $.randRange(0, totalWaifus),
var id = $.randRange(0, totalPokemon),
waifu = getWaifu(id),
link = (google + url(waifu));

Expand Down Expand Up @@ -529,7 +529,7 @@
* @info Used to get your current profile of waifus.
*/
function waifuProfile(username) {
$.say($.lang.get('waifugames.profile.success', $.whisperPrefix(username), getTotalUserWaifus(username), totalWaifus, getCandy(username), Math.floor((getTotalUserWaifus(username) / totalWaifus) * 100)));
$.say($.lang.get('waifugames.profile.success', $.whisperPrefix(username), getTotalUserWaifus(username), totalPokemon, getCandy(username), Math.floor((getTotalUserWaifus(username) / totalPokemon) * 100)));
}

/*
Expand Down Expand Up @@ -790,13 +790,13 @@
return;
}

if ($.randRange((getAttack(username, id) / 20), getAttack(username, id)) > getDefense(opponent, id2)) {
if ($.randRange(0, getAttack(username, id)) > getDefense(opponent, id2)) {
updateBattleStats(username, ['pLove', 'pDefense'], id, true);
updateBattleStats(username, ['pLewdness', 'pAttack'], id, false);
updateBattleStats(opponent, ['pLewdness', 'pLove', 'pDefense'], id2, false);
$.inidb.incr('points', username, 25);
$.say($.lang.get('waifugames.win.' + random1, replace2(player1), replace2(player2), attacker, attacked, $.pointNameMultiple));
} else if ($.randRange((getDefense(username, id) / 20), getDefense(username, id)) > getAttack(opponent, id2)) {
} else if ($.randRange(0, getDefense(username, id)) > getAttack(opponent, id2)) {
updateBattleStats(username, ['pAttack'], id, false);
updateBattleStats(opponent, ['pDefense'], id2, false);
$.say($.lang.get('waifugames.stalemate.' + random2, replace2(player1), replace2(player2), attacker, attacked, $.pointNameMultiple));
Expand Down Expand Up @@ -921,23 +921,23 @@
* @event initReady
*/
$.bind('initReady', function() {
if ($.bot.isModuleEnabled('./games/waifuGames.js')) {
$.registerChatCommand('./games/waifuGames.js', 'pokedex');
$.registerChatCommand('./games/waifuGames.js', 'profile');
$.registerChatCommand('./games/waifuGames.js', 'battle');
$.registerChatCommand('./games/waifuGames.js', 'candy');
$.registerChatCommand('./games/waifuGames.js', 'catch');
$.registerChatCommand('./games/waifuGames.js', 'giftpokemon');
$.registerChatCommand('./games/waifuGames.js', 'resetpokemon');
$.registerChatCommand('./games/waifuGames.js', 'setpokemon');
$.registerChatCommand('./games/waifuGames.js', 'buypokemon');
$.registerChatCommand('./games/waifuGames.js', 'team');
$.registerChatCommand('./games/waifuGames.js', 'addteam');
$.registerChatCommand('./games/waifuGames.js', 'kickteam');
$.registerChatCommand('./games/waifuGames.js', 'resetteam');
$.registerChatCommand('./games/waifuGames.js', 'pokemonhelp');
$.registerChatCommand('./games/waifuGames.js', 'rarechance', 1);
$.registerChatCommand('./games/waifuGames.js', 'pokereward', 1);
if ($.bot.isModuleEnabled('./games/pokemonSystem.js')) {
$.registerChatCommand('./games/pokemonSystem.js', 'pokedex');
$.registerChatCommand('./games/pokemonSystem.js', 'profile');
$.registerChatCommand('./games/pokemonSystem.js', 'battle');
$.registerChatCommand('./games/pokemonSystem.js', 'candy');
$.registerChatCommand('./games/pokemonSystem.js', 'catch');
$.registerChatCommand('./games/pokemonSystem.js', 'giftpokemon');
$.registerChatCommand('./games/pokemonSystem.js', 'resetpokemon');
$.registerChatCommand('./games/pokemonSystem.js', 'setpokemon');
$.registerChatCommand('./games/pokemonSystem.js', 'buypokemon');
$.registerChatCommand('./games/pokemonSystem.js', 'team');
$.registerChatCommand('./games/pokemonSystem.js', 'addteam');
$.registerChatCommand('./games/pokemonSystem.js', 'kickteam');
$.registerChatCommand('./games/pokemonSystem.js', 'resetteam');
$.registerChatCommand('./games/pokemonSystem.js', 'pokemonhelp');
$.registerChatCommand('./games/pokemonSystem.js', 'rarechance', 1);
$.registerChatCommand('./games/pokemonSystem.js', 'pokereward', 1);
load();
}
});
Expand Down

0 comments on commit c196a28

Please sign in to comment.