From 7dc979d2b49ff73201235cfe428bbeec94d44180 Mon Sep 17 00:00:00 2001 From: ozh Date: Sun, 27 Oct 2019 13:54:56 +0100 Subject: Update to 2.021 per request Closes #3 --- minigameGrimoire.js | 34 +++++++++++++++++++--------------- 1 file changed, 19 insertions(+), 15 deletions(-) (limited to 'minigameGrimoire.js') diff --git a/minigameGrimoire.js b/minigameGrimoire.js index 2449b98..ea886d6 100644 --- a/minigameGrimoire.js +++ b/minigameGrimoire.js @@ -51,7 +51,7 @@ M.launch=function() var choices=[]; choices.push('frenzy','multiply cookies'); if (!Game.hasBuff('Dragonflight')) choices.push('click frenzy'); - if (Math.random()<0.1) choices.push('chain cookie','cookie storm','blab'); + if (Math.random()<0.1) choices.push('cookie storm','cookie storm','blab'); if (Game.BuildingsOwned>=10 && Math.random()<0.25) choices.push('building special'); //if (Math.random()<0.2) choices.push('clot','cursed finger','ruin cookies'); if (Math.random()<0.15) choices=['cookie storm drop']; @@ -201,7 +201,8 @@ M.launch=function() if (spells.length==0){Game.Popup('
No eligible spells!
',Game.mouseX,Game.mouseY);return -1;} var spell=choose(spells); var cost=M.getSpellCost(spell)*0.5; - setTimeout(function(){ + setTimeout(function(spell,cost,seed){return function(){ + if (Game.seed!=seed) return false; var out=M.castSpell(spell,{cost:cost,failChanceMax:0.5,passthrough:true}); if (!out) { @@ -210,7 +211,7 @@ M.launch=function() Game.Popup('
That\'s too bad!
Magic refunded.
',Game.mouseX,Game.mouseY); },1500); } - },1000); + }}(spell,cost,Game.seed),1000); Game.Popup('
Casting '+spell.name+'
for '+Beautify(cost)+' magic...
',Game.mouseX,Game.mouseY); }, }, @@ -362,14 +363,14 @@ M.launch=function() '
'+me.name+'
'+ '
Magic cost : '+cost+''+costBreakdown+'
'+ (me.fail?('
Chance to backfire : '+Math.ceil(100*backfire)+'%
'):'')+ - '
Effect : '+me.desc+(me.failDesc?('
Backfire : '+me.failDesc):'')+'
'; + '
Effect : '+(me.descFunc?me.descFunc():me.desc)+''+(me.failDesc?('
Backfire : '+me.failDesc+''):'')+'
'; return str; }; } var str=''; str+=''; @@ -408,7 +406,7 @@ M.launch=function() } str+=''; var icon=[29,14]; - str+='
Click to refill 100 units of your magic meter
for 1 sugar lump.
')+' id="grimoireLumpRefill" class="usesIcon shadowFilter" style="background-position:'+(-icon[0]*48)+'px '+(-icon[1]*48)+'px;">
This is your magic meter. Each spell costs magic to use.
Your maximum amount of magic varies depending on your amount of Wizard towers, and their level.
Magic refills over time. The lower your magic meter, the slower it refills.
')+' style="position:absolute;left:0px;top:0px;right:0px;bottom:0px;">'; + str+='
This is your magic meter. Each spell costs magic to use.
Your maximum amount of magic varies depending on your amount of Wizard towers, and their level.
Magic refills over time. The lower your magic meter, the slower it refills.
')+' style="position:absolute;left:0px;top:0px;right:0px;bottom:0px;">
'; str+='
'; str+=''; div.innerHTML=str; @@ -423,14 +421,18 @@ M.launch=function() AddEvent(l('grimoireSpell'+me.id),'click',function(spell){return function(){PlaySound('snd/tick.mp3');M.castSpell(spell);}}(me)); } + M.refillTooltip=function(){ + return '
Click to refill 100 units of your magic meter for 1 sugar lump.'+ + (Game.canRefillLump()?'
(can be done once every '+Game.sayTime(Game.getLumpRefillMax(),-1)+')':('
(usable again in '+Game.sayTime(Game.getLumpRefillRemaining()+Game.fps,-1)+')'))+ + '
'; + }; AddEvent(M.lumpRefill,'click',function(){ - if (Game.lumps>=1 && M.magic