NoNameCracksInc

Storage

Mar 15th, 2014
434
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.87 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3.  
  4. <head>
  5. </head>
  6.  
  7. <body onLoad="randomize();document.getElementById('level').innerHTML='Level: '+document.cookie" style="overflow:hidden" background="http://bgfons.com/upload/grass_texture241.jpg">
  8. <style>
  9.  
  10. #enemy_container
  11. {
  12. width:400px;
  13. height:300px;
  14. position:absolute;
  15. top:0;bottom:0;left:0;right:0;
  16. margin:auto;
  17. border-radius:20px;
  18. background:url("http://w8themes.com/wp-content/uploads/2013/11/Blue-Wallpaper-HD.jpg");
  19. transition:opacity 0.4s;
  20. }
  21.  
  22. #photo
  23. {
  24. width:150px;
  25. height:250px;
  26. position:absolute;
  27. left:50%;
  28. border-style:inset;
  29. }
  30.  
  31. #name_bar
  32. {
  33. width:150px;
  34. height:20px;
  35. position:absolute;
  36. top:90%;left:50%;
  37. text-align:center;
  38. font-family:"Trebuchet MS", Helvetica, sans-serif;
  39. transition:background 0.4s;
  40. }
  41.  
  42. #name_bar:hover
  43. {
  44. background:#F0F0F0;
  45. }
  46.  
  47. #desc
  48. {
  49. width:150px;
  50. height:150px;
  51. position:absolute;
  52. left:10%;
  53. top:40%;
  54. font-family:"Trebuchet MS", Helvetica, sans-serif;
  55. }
  56.  
  57. #attack
  58. {
  59. width:100px;
  60. height:20px;
  61. position:absolute;
  62. left:10%;
  63. top:90%;
  64. font-family:"Trebuchet MS", Helvetica, sans-serif;
  65. }
  66.  
  67. #health_bar
  68. {
  69. width:150px;
  70. height:10px;
  71. position:absolute;
  72. top:5%;
  73. left:5%;
  74. border-radius:20px;
  75. background:red;
  76. transition:width 0.4s;
  77. }
  78.  
  79. #difficulty
  80. {
  81. width:50px;
  82. height:50px;
  83. position:absolute;
  84. top:15%;
  85. left:17%;
  86. font-size:300%;
  87. text-align:center;
  88. }
  89.  
  90. #player_container
  91. {
  92. width:300px;
  93. height:80px;
  94. position:absolute;
  95. top:2%;
  96. left:2%;
  97. margin:auto;
  98. border-radius:20px;
  99. background:url("http://www.psdgraphics.com/file/light-wooden-background.jpg");
  100. transition:opacity 0.4s;
  101. }
  102.  
  103. #health
  104. {
  105. width:250px;
  106. height:10px;
  107. position:absolute;
  108. left:10%;
  109. top:10%;
  110. border-radius:20px;
  111. background:red;
  112. transition:width 0.4s;
  113. }
  114.  
  115. #level
  116. {
  117. width:150px;
  118. height:40px;
  119. position:absolute;
  120. top:45%;
  121. font-family:"Trebuchet MS", Helvetica, sans-serif;
  122. font-size:200%;
  123. }
  124.  
  125. #spell_one
  126. {
  127. width:40px;
  128. height:40px;
  129. position:absolute;
  130. top:40%;
  131. left:50%;
  132. opacity:0.5;
  133. transition:opacity 0.4s;
  134. }
  135.  
  136. #spell_one:hover
  137. {
  138. opacity:1;
  139. }
  140.  
  141. #spell_two
  142. {
  143. width:40px;
  144. height:40px;
  145. position:absolute;
  146. top:40%;
  147. left:75%;
  148. opacity:0.5;
  149. transition:opacity 0.4s;
  150. }
  151.  
  152. #spell_two:hover
  153. {
  154. opacity:1;
  155. }
  156.  
  157. </style>
  158.  
  159. <script>
  160.  
  161. var enemy;
  162. var level=0;
  163.  
  164. if(parseInt(document.cookie)!=0&&!parseInt(document.cookie)>=1)
  165. document.cookie=0;
  166.  
  167. function randomize()
  168. {
  169. enemy=Math.floor(Math.random()*2)+1;
  170.  
  171. if(enemy==1)
  172. {
  173. document.getElementById("photo").style.background="url('http://www.comingsoon.net/nextraimages/assassinscreedarticle.jpg')";
  174. document.getElementById("name_bar").innerHTML="Assassin";
  175. document.getElementById("desc").innerHTML="Smart enemy.Uses his hidden blades to attack you.Spells: cut, ambush.Average health.High damage.";
  176. document.getElementById("difficulty").innerHTML="2";
  177. }
  178.  
  179. if(enemy==2)
  180. {
  181. document.getElementById("photo").style.background="url('http://puu.sh/6Iti1.png?dateline=1391433723')";
  182. document.getElementById("name_bar").innerHTML="Devourer";
  183. document.getElementById("desc").innerHTML="Exceptional enemy.Very strong damage.Has no spells, but has balanced offensive and defensive stats.";
  184. document.getElementById("difficulty").innerHTML="3";
  185. }
  186. }
  187.  
  188. function damage()
  189. {
  190. if(enemy==1)
  191. {
  192. player_dmg=Math.floor((Math.random()*20)+30);
  193. enemy_hp=document.getElementById("health_bar").offsetWidth;
  194. document.getElementById("health_bar").style.width=enemy_hp-player_dmg+"px";
  195. }
  196.  
  197. if(enemy==2)
  198. {
  199. player_dmg=Math.floor((Math.random()*20)+25);
  200. enemy_hp=document.getElementById("health_bar").offsetWidth;
  201. document.getElementById("health_bar").style.width=enemy_hp-player_dmg+"px";
  202. }
  203.  
  204. if((enemy_hp-player_dmg)<=0)
  205. {
  206. document.getElementById("enemy_container").style.opacity=0;
  207. level=level+1;
  208. document.cookie=parseInt(document.cookie)+level;
  209.  
  210. setTimeout(function end(){location.reload(true);},2000);
  211. }
  212.  
  213. giveback();
  214. }
  215.  
  216. function giveback()
  217. {
  218. if(enemy==1)
  219. {
  220. enemy_dmg=Math.floor((Math.random()*35)+45);
  221. player_hp=document.getElementById("health").offsetWidth;
  222. document.getElementById("health").style.width=player_hp-enemy_dmg+"px";
  223. }
  224.  
  225. if(enemy==2)
  226. {
  227. enemy_dmg=Math.floor((Math.random()*40)+60);
  228. player_hp=document.getElementById("health").offsetWidth;
  229. document.getElementById("health").style.width=player_hp-enemy_dmg+"px";
  230. }
  231.  
  232. if((player_hp-enemy_dmg)<=0)
  233. {
  234. document.getElementById("player_container").style.opacity=0;
  235. level=level-2;
  236. document.cookie=parseInt(document.cookie)+level;
  237.  
  238. setTimeout(function end(){location.reload(true);},2000);
  239. }
  240. }
  241.  
  242. </script>
  243.  
  244. <div id="enemy_container">
  245. <div id="photo"></div>
  246. <div id="name_bar"></div>
  247. <div id="desc"></div>
  248. <div id="attack"></div>
  249. <div id="health_bar"></div>
  250. <div id="difficulty"></div>
  251. <input type="button" id="attack" value="Attack!" onClick="damage()">
  252. </div>
  253.  
  254. <div id="player_container">
  255. <div id="health"></div>
  256. <div id="level"></div>
  257. <img src="http://hydra-media.cursecdn.com/cabal.gamepedia.com/5/55/Sword_Skill_Amp_icon.png" id="spell_one">
  258. <img src="http://hydra-media.cursecdn.com/vindictus.gamepedia.com/4/48/Aodhan%27s_Twin_Swords.png" id="spell_two">
  259. </div>
  260.  
  261. </body>
  262.  
  263. </html>
Advertisement
Add Comment
Please, Sign In to add comment