Jeu Bishop version 2.0

Tapez pas Bishop !

  1. // ==UserScript==
  2. // @name Jeu Bishop version 2.0
  3. // @namespace InGame
  4. // @include http://www.dreadcast.net/Main
  5. // @version 2.0
  6. // @grant none
  7. // @description Tapez pas Bishop !
  8. // ==/UserScript==
  9.  
  10. whacAZimpNum = 0;
  11.  
  12. var whacAZimp = (function () {
  13. var CONGRATULATIONS = 'Bravo ! Tu es presque aussi doué que Bishop !',
  14. HEIGHT = 4,
  15. WIDTH = 7,
  16. LEVELUP = 80,
  17. initialize,
  18. levelHolder,
  19. level,
  20. li,
  21. liElements = [],
  22. tronchesZimp = [],
  23. tronchesGentils = [],
  24. prevZimp,
  25. prepGame,
  26. prepStage,
  27. renderZimp,
  28. renderStage,
  29. setUpEvents,
  30. scoreHolder,
  31. score,
  32. vieHolder,
  33. vie,
  34. stage,
  35. speed = 1100,
  36. startGame,
  37. timer,
  38. diff,
  39. utils = {
  40. id: function (id) {
  41. return document.getElementById(id);
  42. },
  43. getNodeAsInt: function (parent) {
  44. return parent.firstChild.nodeValue - 0;
  45. },
  46. setFirstChildValue: function (parentElem, value) {
  47. parentElem.firstChild.nodeValue = value;
  48. },
  49. setTimer: function (func, ms) {
  50. return setInterval(func, ms);
  51. }
  52. };
  53.  
  54. initialize = function (a) {
  55. liElements = [];
  56. if (undefined !== timer)
  57. clearInterval(timer);
  58. prepStage();
  59. renderStage();
  60. prepGame();
  61. setUpEvents();
  62. startGame(a);
  63. };
  64.  
  65. prepStage = function () {
  66. li = document.createElement('li');
  67. li.style.backgroundColor="#ccc";
  68. li.style.display = "inline-block";
  69. li.style.height = "50px";
  70. li.style.margin = "0 0 5px 5px";
  71. li.style.textDecoration = "none";
  72. li.style.width = "50px";
  73. li.style.backgroundImage = "url('http://www.dreadcast.net/images/avatars/Bishop.jpg')";
  74. li.style.backgroundSize = "cover";
  75.  
  76. stage = document.getElementById('ulStage'+whacAZimpNum);
  77.  
  78. };
  79.  
  80. renderStage = function () {
  81. for (var i = 0; i < (HEIGHT * WIDTH); i++) {
  82. var cloneLi = li.cloneNode(false);
  83.  
  84. stage.appendChild(cloneLi);
  85. liElements.push(cloneLi);
  86. }
  87. };
  88.  
  89. prepGame = function () {
  90. levelHolder = utils.id('level'+whacAZimpNum);
  91. level = utils.getNodeAsInt(levelHolder);
  92. scoreHolder = utils.id('score'+whacAZimpNum);
  93. score = utils.getNodeAsInt(scoreHolder);
  94. vieHolder = utils.id('vie'+whacAZimpNum);
  95. vie = utils.getNodeAsInt(vieHolder);
  96. };
  97.  
  98. setUpEvents = function () {
  99. stage.addEventListener('click', function(e) {
  100. if (e.target && 'li' === e.target.nodeName.toLowerCase()) {
  101. if ('zimp' === e.target.className) {
  102. score += 10;
  103. utils.setFirstChildValue(scoreHolder, score);
  104. e.target.style.backgroundImage = "url('http://nsa34.casimages.com/img/2014/06/05/14060504012010051.jpg')";
  105.  
  106. if (score === level*100) {
  107. clearInterval(timer);
  108. if (1000 === score) {
  109. scoreHolder.parentNode.innerHTML = CONGRATULATIONS;
  110. } else {
  111. speed -= LEVELUP;
  112. if(diff==1)
  113. timer = utils.setTimer(renderZimpFacile, speed);
  114. else if (diff > 1 || diff == -10)
  115. timer = utils.setTimer(renderZimp, speed);
  116.  
  117. level++;
  118. utils.setFirstChildValue(levelHolder, level);
  119. }
  120. }
  121. }
  122. else //erreur
  123. {
  124. if('zentil' === e.target.className)
  125. {
  126. score -= 50;
  127. if(diff > 2 || diff == -10)
  128. {
  129. if(vie > 0)
  130. {
  131. vie -= 1;
  132. utils.setFirstChildValue(vieHolder, vie);
  133. }
  134.  
  135. if(vie == 0)
  136. {
  137. clearInterval(timer);
  138. utils.setFirstChildValue(vieHolder, "Perdu!!");
  139. }
  140. }
  141. }
  142. else
  143. score -= 10;
  144. utils.setFirstChildValue(scoreHolder, score);
  145. e.target.style.backgroundImage = "url('http://nsa34.casimages.com/img/2014/06/05/14060504012010051.jpg')";
  146. setTimeout(function(){e.target.style.backgroundImage = "url('http://www.dreadcast.net/images/avatars/Bishop.jpg')";},speed);
  147. if (level > 1 && score < ((level-1)*100))
  148. {
  149. clearInterval(timer);
  150. speed += LEVELUP;
  151. if(diff==1)
  152. timer = utils.setTimer(renderZimpFacile, speed);
  153. else if (diff > 1 || diff == -10)
  154. timer = utils.setTimer(renderZimp, speed);
  155. level--;
  156. utils.setFirstChildValue(levelHolder, level);
  157. }
  158. }
  159. }
  160. }, false);
  161. };
  162.  
  163. startGame = function (a) {
  164. diff = a;
  165. if(diff==1)
  166. timer = utils.setTimer(renderZimpFacile, speed);
  167. else if (diff==-10)
  168. {
  169. tronchesZimp = ["EveR.jpg", "Linda.png","Valfaria.jpg","Marley.png","Kinchaka.jpg","Malia.png","Gotheve.png","Seth.jpg"];
  170. tronchesGentils = ["Bishop.jpg"];
  171. timer = utils.setTimer(renderZimp, speed);
  172. }
  173. else if (diff > 1)
  174. {
  175. tronchesZimp = ["Elea.png","Scout.png","Pistache.png","Djino.jpg","Ethayel.jpg","Valmont.jpg","L-X.jpg","Kelvin.jpg","Zalaniz.png","Laetitia.jpg","Kazuki.png","Kmaschta.jpg","Arsenia.png","Alinka.jpg","Ghost.jpg","Saurus.jpg","Manerina.jpg","Ella.jpg","Astaa.png"];
  176. tronchesGentils = ["Fitz.jpg","Kinchaka.jpg","Malia.png","Oshean.jpg","Odul.png","Sÿllia.png","Zarah.png","Junajo.png","Pixelle.jpg","Lorkah.png","EveR.png","Cyberthorvaldr.jpg","Cherakanon.jpg","Gabrielle.png","Vanity.jpg","Alucard.jpg","Joaw.png","Yenahe.jpg","Gotheve.png","Xiya.jpg","Mik.png","Ghazullmor.jpg","Akiross.png"];
  177. timer = utils.setTimer(renderZimp, speed);
  178. if(diff == 4)
  179. setInterval(function(){score -= 10; utils.setFirstChildValue(scoreHolder, score);},10000);
  180. }
  181. };
  182.  
  183. renderZimpFacile = function () {
  184. if (undefined !== prevZimp)
  185. {
  186. prevZimp.className = '';
  187. prevZimp.style.backgroundImage = "url('http://www.dreadcast.net/images/avatars/Bishop.jpg')";
  188. }
  189. prevZimp = liElements[Math.floor((Math.random()*(HEIGHT * WIDTH))+1)-1];
  190. prevZimp.className = 'zimp';
  191. if(level <= 2)
  192. prevZimp.style.backgroundImage = "url('http://nsa34.casimages.com/img/2014/06/05/140605035115599491.png')";
  193. else
  194. prevZimp.style.backgroundImage = "url('http://nsa34.casimages.com/img/2014/06/05/140605035115599491.png')";
  195. };
  196. renderZimp = function () {
  197. if (undefined !== prevZimp)
  198. {
  199. prevZimp.className = '';
  200. prevZimp.style.backgroundImage = "url('http://www.dreadcast.net/images/avatars/Bishop.jpg')";
  201. }
  202. prevZimp = liElements[Math.floor((Math.random()*(HEIGHT * WIDTH))+1)-1];
  203. var gentilmechant =Math.floor(Math.random()*7);
  204. if (gentilmechant != 0)
  205. {
  206. var tronche = tronchesZimp[Math.floor(Math.random()*tronchesZimp.length)]
  207. prevZimp.className = 'zimp';
  208. }
  209. else
  210. {
  211. var tronche = tronchesGentils[Math.floor(Math.random()*tronchesGentils.length)]
  212. prevZimp.className = 'zentil';
  213. }
  214.  
  215. prevZimp.style.backgroundImage = "url('http://www.dreadcast.net/images/avatars/"+tronche+"')";
  216. }
  217.  
  218. return {
  219. init: initialize
  220. };
  221. })();
  222.  
  223.  
  224. Deck.prototype.executeCommandSave = Deck.prototype.executeCommand;
  225.  
  226. Deck.prototype.executeCommand=function(a,b){
  227. var c=$("#"+b+" .ligne_ecriture input").val();
  228. $.ajaxSetup({async: false});
  229. this.executeCommandSave(a,b);
  230. $.ajaxSetup({async: true});
  231. if(c.toLowerCase() === "jeu")
  232. {
  233. $("#" + b + " .ligne_ecrite_fixed:last").html($("#" + b + " .ligne_ecrite_fixed:last").html() + '<div>Tapes jeu niveauDeDifficulté (en minuscule) avec </br> Facile : Frappes les zimp qui apparaîssent et tu marques 10 points. Touches à la gentille Bishop et tu perds dix points.</br> Moyen : Oh non c était Bishop! Si tu la confonds avec un zimp et lui éclate le nez tu perds 50 points! </br> Difficile : Moyen + Tu perds la partie si tu exploses trois jolie petite andro! </br> Hardcore : Difficile + Tu perds dix points toutes les dix secondes. </br></br> Élections : Nous allons élire la plus belle femme du SR, défoules toi sur les candidates! Mais ne touches pas à Bishop! Équivalent à difficile</div>');
  234. }
  235. else if(c.toLowerCase() === "jeu facile")
  236. {
  237. whacAZimpNum++;
  238. $("#" + b + " .ligne_ecrite_fixed:last").html($("#" + b + " .ligne_ecrite_fixed:last").html() + '<section style="width: 390px; padding : 5px 0;"><ul id="ulStage'+whacAZimpNum+'" style="padding : 0; margin :0; cursor : url(http://www.dreadcast.net/images/objets/mini/gant-hydro.png), auto;" ></ul><p style="color:#FFF;">Score: <span id="score'+whacAZimpNum+'">0</span> points!</p><p style="color:#FFF;">Level: <span id="level'+whacAZimpNum+'">1</span></p><p style="display:none">Vies: <span id="vie'+whacAZimpNum+'">3</span></p></section>');
  239. whacAZimp.init(1);
  240. }
  241. else if(c.toLowerCase() === "jeu moyen")
  242. {
  243. whacAZimpNum++;
  244. $("#" + b + " .ligne_ecrite_fixed:last").html($("#" + b + " .ligne_ecrite_fixed:last").html() + '<section style="width: 390px; padding : 5px 0;"><ul id="ulStage'+whacAZimpNum+'" style="padding : 0; margin :0; cursor : url(http://www.dreadcast.net/images/objets/mini/gant-hydro.png), auto;" ></ul><p style="color:#FFF;">Score: <span id="score'+whacAZimpNum+'">0</span> points!</p><p style="color:#FFF;">Level: <span id="level'+whacAZimpNum+'">1</span></p><p style="display:none;">Vies: <span id="vie'+whacAZimpNum+'">3</span></p></section>');
  245. whacAZimp.init(2);
  246. }
  247. else if(c.toLowerCase() === "jeu difficile")
  248. {
  249. whacAZimpNum++;
  250. $("#" + b + " .ligne_ecrite_fixed:last").html($("#" + b + " .ligne_ecrite_fixed:last").html() + '<section style="width: 390px; padding : 5px 0;"><ul id="ulStage'+whacAZimpNum+'" style="padding : 0; margin :0; cursor : url(http://www.dreadcast.net/images/objets/mini/gant-hydro.png), auto;" ></ul><p style="color:#FFF;">Score: <span id="score'+whacAZimpNum+'">0</span> points!</p><p style="color:#FFF;">Level: <span id="level'+whacAZimpNum+'">1</span></p><p style="color:#FFF;">Vies: <span id="vie'+whacAZimpNum+'">3</span></p></section>');
  251. whacAZimp.init(3);
  252. }
  253. else if(c.toLowerCase() === "jeu hardcore")
  254. {
  255. whacAZimpNum++;
  256. $("#" + b + " .ligne_ecrite_fixed:last").html($("#" + b + " .ligne_ecrite_fixed:last").html() + '<section style="width: 390px; padding : 5px 0;"><ul id="ulStage'+whacAZimpNum+'" style="padding : 0; margin :0; cursor : url(http://www.dreadcast.net/images/objets/mini/gant-hydro.png), auto;" ></ul><p style="color:#FFF;">Score: <span id="score'+whacAZimpNum+'">0</span> points!</p><p style="color:#FFF;">Level: <span id="level'+whacAZimpNum+'">1</span></p><p style="color:#FFF;">Vies: <span id="vie'+whacAZimpNum+'">3</span></p></section>');
  257. whacAZimp.init(4);
  258. }
  259. else if(c.toLowerCase() === "jeu elections")
  260. {
  261. whacAZimpNum++;
  262. $("#" + b + " .ligne_ecrite_fixed:last").html($("#" + b + " .ligne_ecrite_fixed:last").html() + '<section style="width: 390px; padding : 5px 0;"><ul id="ulStage'+whacAZimpNum+'" style="padding : 0; margin :0; cursor : url(http://www.dreadcast.net/images/objets/mini/gant-hydro.png), auto;" ></ul><p style="color:#FFF;">Score: <span id="score'+whacAZimpNum+'">0</span> points!</p><p style="color:#FFF;">Level: <span id="level'+whacAZimpNum+'">1</span></p><p style="color:#FFF;">Vies: <span id="vie'+whacAZimpNum+'">3</span></p></section>');
  263. whacAZimp.init(-10);
  264. }
  265. };

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址