-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbundle.js
1 lines (1 loc) · 5.97 KB
/
bundle.js
1
!function(e,t){for(var n in t)e[n]=t[n]}(this,function(e){var t={};function n(o){if(t[o])return t[o].exports;var a=t[o]={i:o,l:!1,exports:{}};return e[o].call(a.exports,a,a.exports,n),a.l=!0,a.exports}return n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:o})},n.r=function(e){Object.defineProperty(e,"__esModule",{value:!0})},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=3)}([function(e,t,n){"use strict";e.exports=function e(t,n,o){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.name=t,this.hp=n,this.image=o}},function(e,t,n){"use strict";e.exports=function e(t,n,o,a){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.activated=!1,this.available=!0,this.name=t,this.multiplier=n,this.cost=o,this.timer=a}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.cheatFunction=function(e){"reset"===e?k():"1000points"===e&&(c+=1e3,document.getElementById("points").textContent=c)};var o=n(1),a=n(0),i=1,r=0,c=0,s=1,l=document.getElementById("canvas-1"),d=document.getElementById("message-box"),u=[],m=[];m[0]=new o("Gay Agenda",2,10,1e4),m[1]=new o("Rainbow Potion",3,50,2e4),m[2]=new o("Drag Disguise",4,75,1e4),m[3]=new o("Unihorn",5,100,2e4),m[4]=new o("Fairy Dust",6,150,25e3),m[5]=new o("Babadook",7,200,2e4),m[6]=new o(1,0,0),m[7]=new o(1,0,0),m[8]=new o(1,0,0);var p=[];p[0]=new a("Homophobes",1e3,"boss.gif"),p[1]=new a("Bestboro Waptist Church",2e3,"trumpcheeto.gif"),p[2]=new a("Trumpcheeto",3e3,"trumpcheeto.gif");for(var g=p[i-1],f=g.hp,y=g.hp,h=(g.image,[]),v=0;v<9;v++)h[v]={width:133,height:133};for(var E=0,I=0,w=["gayagenda-pixel.png","rainbow-potion-pixel.png","drag-disguise-pixel.png","horn-pixel.png","fairy-pixel.png","babadook.png","empty.jpg","empty.jpg","empty.jpg"],x=0;x<9;x++)u[x]={background:"item-holder.png"};for(var B=0;B<9;B++)u[B].name=w[B],u[B].posX=E,u[B].posY=I,(E+=133)>=399&&(E=0,I+=133);var b=function(e){var t=document.createElement("li"),n=document.createTextNode(e);t.appendChild(n),document.getElementById("text-list").appendChild(t),d.scrollTop=d.scrollHeight};function C(e){var t=l.getBoundingClientRect(),n=function(e,t){l.getContext("2d");for(var n=0;n<h.length;n++)if(Math.abs(h[n].x-e)<h[n].width&&Math.abs(h[n].y-t)<h[n].height)return h[n].num;return null}(e.pageX-t.left,e.pageY-t.top);null!=n&&(document.addEventListener("mouseup",T,!0),O(n)),e.stopPropagation(),e.preventDefault()}window.onload=function(){!function(){for(var e=0;e<3;e++)for(var t=0;t<3;t++)h[r].x=133*t,h[r].y=133*e,h[r].num=r,r++}(),console.log("Loading game...."),b("Loading Game...");try{var e=JSON.parse(localStorage.getItem("save"));console.log("Loading complete...."),b("Loading complete..."),void 0!==e.points&&(c=e.points,document.getElementById("points").textContent=c)}catch(e){console.error(e)}for(var t=l.getContext("2d"),n=function(e){var n=new Image;n.src=u[e].background,n.onload=function(){t.drawImage(n,u[e].posX,u[e].posY)}},o=0;o<9;o++)n(o);for(var a=function(e){var n=new Image;n.src=u[e].name,n.onload=function(){t.drawImage(n,u[e].posX,u[e].posY)}},i=0;i<9;i++)a(i);document.getElementById("canvas-1").style.cursor="pointer"};var O=function(e){var t=l.getContext("2d"),n=m[e].cost;if(c>=n)for(c-=n,document.getElementById("points").textContent=c,m[e].activated=!0;m[e].activated;){t.fillStyle="rgba(225,225,225,0.5)",t.fillRect(h[e].x,h[e].y,h[e].width,h[e].height),s+=m[e].multiplier,document.getElementById("multiplier").textContent=s;var o="Multiplier x"+m[e].multiplier+" activated for "+m[e].timer/1e3+"sec";b(o),setTimeout(function(){s-=m[e].multiplier,document.getElementById("multiplier").textContent=s,m[e].activated=!1,t.fillStyle="rgba(225,225,225,0.5)";var n=new Image,o=new Image;n.src=u[e].background,o.src=u[e].name,n.onload=function(){t.drawImage(n,u[e].posX,u[e].posY)},o.onload=function(){t.drawImage(o,u[e].posX,u[e].posY)}},m[e].timer),m[e].activated=!1}else b("NOT ENOUGH POINTS")};function T(e){e.stopPropagation(),$("#canvas-1").off("mouseup",T)}document.addEventListener("DOMContentLoaded",function(){document.getElementById("canvas-1").addEventListener("mousedown",C)}),document.getElementById("clickButton").addEventListener("click",function(){document.getElementById("character-overlay").style.display="block",setTimeout(function(){document.getElementById("character-overlay").style.display="none"},500),c+=s,document.getElementById("points").textContent=c}),document.getElementById("attackButton").addEventListener("click",function(){if(c>=25){if(c-=25,f-=20,document.getElementById("points").textContent=c,document.getElementById("boss-overlay").style.display="block",setTimeout(function(){document.getElementById("boss-overlay").style.display="none"},500),document.getElementById("progress-bar").style.width=f/y*100+"%",document.getElementById("hp").textContent=f,f<=0){var e="YOU DEFEATED "+g.name+"!!!";b(e),++i<=3?(g=p[i-1],f=g.hp,y=g.hp,document.getElementById("hp").textContent=y,document.getElementById("progress-bar").style.width="100%",document.getElementById("boss-image").src=g.image):(b("In a display of true pride and gayness you have defeated all who oppose you."),b("Go forth and conquer oh gay one."),b("The End..."))}}else b("NOT ENOUGH POWER")}),document.getElementById("save").addEventListener("click",function(){!function(){b("Attempting to save game..."),console.log("Attempting Save...");var e={points:c};try{localStorage.setItem("save",JSON.stringify(e)),b("Save complete..."),console.log("Save Complete...")}catch(e){console.error(e)}}()});var k=function(){b("Resetting Game...");try{c=0,g=p[(i=1)-1],f=g.hp,y=g.hp,document.getElementById("hp").textContent=y,document.getElementById("progress-bar").style.width="100%",document.getElementById("points").textContent=c,b("Game Reset")}catch(e){b("Error reseting game"),console.error(e)}}},function(e,t,n){e.exports=n(2)}]));