Skip to content

Commit

Permalink
Upgrades
Browse files Browse the repository at this point in the history
- !buycandy will noy give you the highest amount of candy you can buy
with what points you have left if you go over the amount you're able to
buy.
- Boss skills has been adjusted to be harder.
- Combat math has been adjusted to do more damage
- Using !release <waifu> will now also kick that waifu from your harem.
- Fixed a issue where buffed data wasnt deleted using !release <waifu>
thus caused issues adding that waifu back into the harem.
- Adjusted UpdateBattleStats to not increase stats if a waifu is lvl 100
- Added a max damage hit of 9999
- Better owrding of misses and dodging attacks in combat.
  • Loading branch information
phantomindex committed Apr 15, 2017
1 parent 489e4b6 commit 2019f62
Show file tree
Hide file tree
Showing 2 changed files with 73 additions and 57 deletions.
74 changes: 45 additions & 29 deletions Twitch Waifu System/scripts/games/waifuGames.js
Original file line number Diff line number Diff line change
Expand Up @@ -513,6 +513,10 @@
function updateBattleStats(username, array, id, isDecr) {
var rnd;

if (getLevel(username, id) > 99) {
return;
}

$.inidb.setAutoCommit(false);
for (var i = 0; i < array.length; i++) {
rnd = $.randRange(0, 1);
Expand All @@ -525,10 +529,6 @@
}
}

if (getLevel(username, id) >= 100) {
return;
}

$.inidb.incr(username, 'harem', getWaifuId(id), 5);
$.inidb.setAutoCommit(true);
}
Expand Down Expand Up @@ -564,7 +564,7 @@
candy = '',
candy2 = '',
candyDrop = $.randRange(1, 2);
rare = '';
rare = '';


if (chance >= 4 && candyDrop > 1) {
Expand Down Expand Up @@ -795,9 +795,9 @@
$.inidb.decr('points', sender, ((price * amount) - price));
$.say($.lang.get('waifugames.candy.buy', $.whisperPrefix(sender), amount, $.getPointsString(price * amount), getCandy(sender)));
} else {
amount = 1;
amount = ($.inidb.get('points', sender) / price);
$.inidb.incr(sender, 'candy', amount);
$.say($.lang.get('waifugames.candy.buy', $.whisperPrefix(sender), amount, $.getPointsString(price), getCandy(sender)));
$.say($.lang.get('waifugames.candy.buy', $.whisperPrefix(sender), Math.floor(amount), $.getPointsString(price * Math.floor(amount)), getCandy(sender)));
}

}
Expand Down Expand Up @@ -859,11 +859,14 @@
* @param {Number|String} id
*/
function releaseWaifu(username, id) {


if ($.inidb.GetInteger(username, 'harem', getWaifuId(id)) > 0) {
$.say($.lang.get('waifugames.harem.release404', replace(getWaifu(id))));
return;
if ($.inidb.get(username, 'married') == getWaifuId(id)) {
$.inidb.del(username, 'married');
}

if ($.inidb.GetInteger(username, 'harem', getWaifuId(id)) == 1) {
$.inidb.RemoveKey(username, 'harem', getWaifuId(id));
}
}

if ($.inidb.GetInteger(username, 'waifus', getWaifuId(id)) >= 1) {
Expand All @@ -874,6 +877,7 @@
$.inidb.RemoveKey(username, 'wDefense', getWaifuId(id));
$.inidb.RemoveKey(username, 'wLove', getWaifuId(id));
$.inidb.RemoveKey(username, 'wLewdness', getWaifuId(id));
$.inidb.RemoveKey(username, 'buffed', getWaifuId(id));
$.say($.lang.get('waifugames.harem.release', replace(getWaifu(id))));
} else {
$.say($.lang.get('waifugames.harem.release404', replace(getWaifu(id))));
Expand Down Expand Up @@ -916,7 +920,7 @@
return;
}

if (!$.inidb.GetString(username, 'buffed', getWaifuId(id)) == 1) {
if (!$.inidb.GetString(username, 'buffed', getWaifuId(id)) > 0) {
if (getWaifu(id).includes('[Rare]')) {
atk = $.randRange(1, 20), def = $.randRange(1, 20), love = $.randRange(1, 30), exp = 0;
}
Expand All @@ -931,8 +935,8 @@
}


$.inidb.SetString(username, 'harem', getWaifuId(id), 1);
$.inidb.SetString(username, 'buffed', getWaifuId(id), 1);
$.inidb.SetInteger(username, 'harem', getWaifuId(id), 1);
$.inidb.SetInteger(username, 'buffed', getWaifuId(id), 1);
$.inidb.SetInteger(username, 'wEXP', getWaifuId(id), exp);
$.inidb.incr(username, 'wAttack', getWaifuId(id), atk);
$.inidb.incr(username, 'wDefense', getWaifuId(id), def);
Expand Down Expand Up @@ -1043,9 +1047,10 @@
$.inidb.set('boss', 'id', bosses);
$.inidb.SetInteger('boss', 'harem', bosses, 1);
$.inidb.SetInteger('boss', 'wHitPoints', bosses, hpScale);
$.inidb.SetInteger('boss', 'wAttack', bosses, $.randRange(200, 600));
$.inidb.SetInteger('boss', 'wDefense', bosses, $.randRange(800, 1000));
$.inidb.SetInteger('boss', 'wAttack', bosses, $.randRange(600, 6000));
$.inidb.SetInteger('boss', 'wDefense', bosses, $.randRange(800, 8000));
$.inidb.SetInteger('boss', 'wLove', bosses, 100);
$.inidb.SetInteger('boss', 'wEXP', bosses, 120000);
}
return bosses;
}
Expand Down Expand Up @@ -1078,8 +1083,7 @@
attack = $.lang.get('waifugames.attack.' + random1),
dmg,
dmgRec,
critical1,
critical2,
critical,
dmgMsg = '',
winMsg = '';

Expand All @@ -1100,11 +1104,17 @@
return;
}

critical1 = $.randRange(0,5);
critical2 = $.randRange(0,6);
dmg = Math.floor(Math.abs((0.5 * (getAttack(username, id) / getDefense(opponent, id2)) * (getLevel(username, id) / getLevel(opponent, id2)) * critical1)));
dmgRec = Math.floor(Math.abs((0.5 * (getAttack(opponent, id2) / getDefense(username, id)) * (getLevel(username, id) / getLevel(opponent, id2)) * critical2)));
critical = $.randRange(0,15);
dmg = Math.floor(Math.abs((20 * (getAttack(username, id) / getDefense(opponent, id2)) * (getLevel(username, id) / getLevel(opponent, id2)) * critical)));
dmgRec = Math.floor(Math.abs((4 * (getAttack(opponent, id2) / getDefense(username, id)) * (getLevel(username, id) / getLevel(opponent, id2)) * critical)));

if (dmg > 9999) {
dmg = 999;
}

if (dmgRec > 9999) {
dmgRec = 9999;
}
if (getHitPoints(username, id) < 1) {
$.say($.lang.get('waifugames.player.nohp', player1, replace2(waifu1)));
return;
Expand Down Expand Up @@ -1181,8 +1191,7 @@
attack = $.lang.get('waifugames.attack.' + random1),
dmg,
dmgRec,
critical1,
critical2,
critical,
dmgMsg = '',
winMsg = '';

Expand All @@ -1209,18 +1218,25 @@
}

if (getTotalUserHarems(opponent) <= 0) {
$.say($.lang.get('waifugames.harem.fight4042'));
$.say($.lang.get('waifugames.harem.fight4042', getWaifu(id), action));
return;
} else {
if (getTotalUserHarems(username) <= 0) {
$.say($.lang.get('waifugames.harem.fight404'));
return;
}
}
critical1 = $.randRange(0,5);
critical2 = $.randRange(0,6);
dmg = Math.floor(Math.abs((0.5 * (getAttack(username, id) / getDefense(opponent, id2)) * (getLevel(username, id) / getLevel(opponent, id2)) * critical1)));
dmgRec = Math.floor(Math.abs((0.5 * (getAttack(opponent, id2) / getDefense(username, id)) * (getLevel(username, id) / getLevel(opponent, id2)) * critical2)));
critical = $.randRange(0,10);
dmg = Math.floor(Math.abs((0.6 * (getAttack(username, id) / getDefense(opponent, id2)) * (getLevel(username, id) / getLevel(opponent, id2)) * critical)));
dmgRec = Math.floor(Math.abs((0.6 * (getAttack(opponent, id2) / getDefense(username, id)) * (getLevel(username, id) / getLevel(opponent, id2)) * critical)));

if (dmg > 9999) {
dmg = 9999;
}

if (dmgRec > 9999) {
dmgRec = 9999;
}

if (getHitPoints(username, id) < 1) {
$.say($.lang.get('waifugames.player.nohp', player1, replace2(waifu1)));
Expand Down
56 changes: 28 additions & 28 deletions Twitch Waifu System/scripts/lang/custom/games/games-waifuGames.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ $.lang.register('waifugames.harem.reset', 'your harem has been disbanded!');
$.lang.register('waifugames.harem.404', 'You don\'t have a harem yet! Usage: !addharem <waifu>');
$.lang.register('waifugames.harem.nostock', 'You haven\'t unlocked that waifu or she doesn\'t exist!');
$.lang.register('waifugames.harem.fight404', 'You don\'t have a harem yet! Usage: !addharem <waifu>');
$.lang.register('waifugames.harem.fight4042', 'Wrong username or your opponent doesn\'t have a harem yet!');
$.lang.register('waifugames.harem.fight4042', '$1 murdered $2 because they didn\'t have a harem.');
$.lang.register('waifugames.harem.same', 'Can\'t start a battle with yourself!');
$.lang.register('waifugames.info.release', 'Usage: !release (waifu)');
$.lang.register('waifugames.harem.release', '$1 has been freed into the wild!');
Expand Down Expand Up @@ -87,7 +87,7 @@ $.lang.register('waifugames.catchmiss.5', '$1 you found $2 #$3 undressing in the
$.lang.register('waifugames.catchmiss.6', '$1 you spotted $2 #$3 but it was just an illusion! $4');
$.lang.register('waifugames.catchmiss.7', '$2 #$3 hugged $1 and said "Let\'s stay Friends!" $4');
$.lang.register('waifugames.catchmiss.8', '$2 #$3 was too busy eating dangos to listen. $4');
$.lang.register('waifugames.catchmiss.9', '$1 tried to approach $2 #$3 to ask her out. $2 $3 got scared and shot $1 Nisu Shot! $4');
$.lang.register('waifugames.catchmiss.9', '$1 tried to approach $2 #$3 to ask her out. $2 #$3 got scared and shot $1 Nisu Shot! $4');
$.lang.register('waifugames.catchmiss.10', '$1 $2 #$3 was too busy to deal with you! $4');

$.lang.register('waifugames.fight.block.1', 'while blocking any incoming damage');
Expand All @@ -97,35 +97,35 @@ $.lang.register('waifugames.fight.block.4', ', but negated incoming damage with
$.lang.register('waifugames.fight.block.5', ', but dodged incoming damage by dancing');

$.lang.register('waifugames.fight.miss.1', ' and missed');
$.lang.register('waifugames.fight.miss.2', ' and tripped');
$.lang.register('waifugames.fight.miss.3', ' and sneezed');
$.lang.register('waifugames.fight.miss.4', ' and fell asleep');
$.lang.register('waifugames.fight.miss.2', ', but tripped');
$.lang.register('waifugames.fight.miss.3', ', but sneezed');
$.lang.register('waifugames.fight.miss.4', ', but fell asleep');
$.lang.register('waifugames.fight.miss.5', ' and panicked');
$.lang.register('waifugames.fight.miss.6', ' and dropped her wallet');
$.lang.register('waifugames.fight.miss.6', ', but dropped her wallet');

$.lang.register('waifugames.fight.1', '$1 [HP:$2] used $3 on $4 [HP:$5] $6 $7! $8');
$.lang.register('waifugames.fight.1', '$1 [HP:$2] $3 $4 [HP:$5] $6 $7! $8');

$.lang.register('waifugames.attack.1', 'a pillow');
$.lang.register('waifugames.attack.2', 'the Kamehameha');
$.lang.register('waifugames.attack.3', 'a chainsaw');
$.lang.register('waifugames.attack.4', 'her boobs');
$.lang.register('waifugames.attack.5', 'her butt');
$.lang.register('waifugames.attack.5', ' a Dragon Punch');
$.lang.register('waifugames.attack.6', 'Hadouken');
$.lang.register('waifugames.attack.7', 'Shoryuken');
$.lang.register('waifugames.attack.8', 'Gravity Kick');
$.lang.register('waifugames.attack.9', 'a slap');
$.lang.register('waifugames.attack.10', 'a hug');
$.lang.register('waifugames.attack.11', 'ZA WARUDO');
$.lang.register('waifugames.attack.12', 'POWA BOMB');
$.lang.register('waifugames.attack.13', 'a kiss');
$.lang.register('waifugames.attack.14', 'Omnislash');
$.lang.register('waifugames.attack.15', 'Spirit Bomb');
$.lang.register('waifugames.attack.16', 'Destructo Disc');
$.lang.register('waifugames.attack.16', 'Final Flash');
$.lang.register('waifugames.attack.17', 'a wet T-Shirt');
$.lang.register('waifugames.attack.18', 'Ziodyne');
$.lang.register('waifugames.attack.19', 'EXPLOSION');
$.lang.register('waifugames.attack.1', 'used a pillow on');
$.lang.register('waifugames.attack.2', 'used the Kamehameha on');
$.lang.register('waifugames.attack.3', 'used a chainsaw on');
$.lang.register('waifugames.attack.4', 'attacked with her boobs on');
$.lang.register('waifugames.attack.5', 'attacked with her butt on');
$.lang.register('waifugames.attack.5', 'used her Dragon Punch on');
$.lang.register('waifugames.attack.6', 'used Hadouken on');
$.lang.register('waifugames.attack.7', 'used Shoryuken on');
$.lang.register('waifugames.attack.8', 'charged in with Gravity Kick towards');
$.lang.register('waifugames.attack.9', 'slapped');
$.lang.register('waifugames.attack.10', 'hugged');
$.lang.register('waifugames.attack.11', 'used ZA WARUDO on');
$.lang.register('waifugames.attack.12', 'used POWA BOMB on');
$.lang.register('waifugames.attack.13', 'gave a kiss to');
$.lang.register('waifugames.attack.14', 'used Omnislash on');
$.lang.register('waifugames.attack.15', 'used Spirit Bomb on');
$.lang.register('waifugames.attack.16', 'used Destructo Disc on');
$.lang.register('waifugames.attack.16', 'used Final Flash on');
$.lang.register('waifugames.attack.17', 'used a wet T-Shirt on');
$.lang.register('waifugames.attack.18', 'used Ziodyne on');
$.lang.register('waifugames.attack.19', 'used EXPLOSION on');

$.lang.register('waifugames.bosses.1', 'Alucard =Boss=');
$.lang.register('waifugames.bosses.2', 'Skeith =Boss=');
Expand Down

0 comments on commit 2019f62

Please sign in to comment.