smoothretro1982

Vaporizer script version 1.0

Mar 1st, 2026 (edited)
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.43 KB | None | 0 0
  1. (async () => {
  2.  
  3. const sleep = ms => new Promise(r => setTimeout(r, ms));
  4. const randInt = (min,max)=>Math.floor(Math.random()*(max-min+1))+min;
  5.  
  6. const explosionChars='█▓▒░▀▄'.split('');
  7. const burnChars='.,:;\'`"~-_'.split('');
  8. const burnCIDs=[29,6,22];
  9.  
  10. const randChar=()=>explosionChars[randInt(0,explosionChars.length-1)];
  11. const randBurnChar=()=>burnChars[randInt(0,burnChars.length-1)];
  12.  
  13.  
  14. // ═════════ SHAPE ENGINE ═════════
  15. function isInShape(dx,dy,radius,shape,outline=false){
  16. let include=false;
  17. switch(shape){
  18. case "circle": { const d=dx*dx+dy*dy; include=outline?(d<=radius*radius && d>=(radius-1)*(radius-1)):(d<=radius*radius); break; }
  19. case "square": include=outline?(Math.abs(dx)===radius||Math.abs(dy)===radius):(Math.abs(dx)<=radius&&Math.abs(dy)<=radius); break;
  20. case "diamond": include=outline?(Math.abs(dx)+Math.abs(dy)===radius):(Math.abs(dx)+Math.abs(dy)<=radius); break;
  21. case "cross": include=(dx===0||dy===0); break;
  22. case "x": include=(dx===dy||dx===-dy); break;
  23. case "triangle": include=(dy<=0 && Math.abs(dx)<=-dy); break;
  24. case "inverted-triangle": include=(dy>=0 && Math.abs(dx)<=dy); break;
  25. case "hexagon": include=(Math.abs(dx)<=radius && Math.abs(dy)<=radius && Math.abs(dx+dy)<=radius); break;
  26. case "star": include=(dx===0||dy===0||dx===dy||dx===-dy); break;
  27. case "ring": { const dist=Math.sqrt(dx*dx+dy*dy); include=(Math.abs(dist-radius)<1); break; }
  28. case "hourglass": include=(Math.abs(dx)<=radius-Math.abs(dy)); break;
  29. case "arrow-up": include=(dy<=0 && Math.abs(dx)<=-dy); break;
  30. case "arrow-down": include=(dy>=0 && Math.abs(dx)<=dy); break;
  31. case "arrow-left": include=(dx<=0 && Math.abs(dy)<=-dx); break;
  32. case "arrow-right": include=(dx>=0 && Math.abs(dy)<=dx); break;
  33. case "heart": { const v=(dx*dx+dy*dy-radius*radius/2)*(dx*dx+dy*dy-radius*radius/2)-dx*dx*dy*dy; include=(v<=0); break; }
  34. case "plus-circle": include=((dx*dx+dy*dy<=radius*radius)||dx===0||dy===0); break;
  35. }
  36. return include;
  37. }
  38.  
  39.  
  40. // ═════════ HUD PANEL ═════════
  41. const settings = await new Promise(resolve=>{
  42. let _speed=50;
  43. const hud=document.createElement("div");
  44.  
  45. Object.assign(hud.style,{
  46. position:"fixed",top:"50%",left:"50%",transform:"translate(-50%,-50%)",
  47. background:"#1a0000",color:"#ff9944",padding:"26px",borderRadius:"12px",
  48. fontFamily:"monospace",zIndex:"999999",border:"2px solid #ff4444",
  49. boxShadow:"0 0 40px rgba(255,0,0,.6)",minWidth:"420px",textAlign:"center"
  50. });
  51.  
  52. hud.innerHTML=`
  53. <h2 style="color:#ff4444">VAPORIZER CONTROL PANEL</h2>
  54.  
  55. Radius
  56. <input id="vap-radius" type="number" value="15" style="width:100%;margin-bottom:10px;background:#000;color:#ff9944">
  57.  
  58. Target X
  59. <input id="vap-x" type="number" style="width:100%;margin-bottom:10px;background:#000;color:#ff9944">
  60.  
  61. Target Y
  62. <input id="vap-y" type="number" style="width:100%;margin-bottom:12px;background:#000;color:#ff9944">
  63.  
  64. Shape
  65. <select id="vap-shape" style="width:100%;margin-bottom:10px;background:#000;color:#ff9944">
  66. <option value="circle">Circle</option>
  67. <option value="square">Square</option>
  68. <option value="diamond">Diamond</option>
  69. <option value="cross">Cross</option>
  70. <option value="x">X</option>
  71. <option value="triangle">Triangle</option>
  72. <option value="inverted-triangle">Inverted Triangle</option>
  73. <option value="hexagon">Hexagon</option>
  74. <option value="star">Star</option>
  75. <option value="ring">Ring</option>
  76. <option value="hourglass">Hourglass</option>
  77. <option value="arrow-up">Arrow Up</option>
  78. <option value="arrow-down">Arrow Down</option>
  79. <option value="arrow-left">Arrow Left</option>
  80. <option value="arrow-right">Arrow Right</option>
  81. <option value="heart">Heart</option>
  82. <option value="plus-circle">Plus Circle</option>
  83. </select>
  84.  
  85. Mode
  86. <select id="vap-mode" style="width:100%;margin-bottom:12px;background:#000;color:#ff9944">
  87. <option value="classic">Classic</option>
  88. <option value="firestorm">Firestorm</option>
  89. <option value="mushroom">Mushroom Cloud</option>
  90. <option value="shrapnel">Shrapnel</option>
  91. <option value="electric">Electric Arc</option>
  92. <option value="pulse">Pulse</option>
  93. </select>
  94.  
  95. Speed
  96. <input id="vap-speed" type="range" min="1" max="100" value="50">
  97.  
  98. <br><br>
  99. <button id="vap-arm" style="width:100%;padding:10px;background:#8b0000;color:white;font-weight:bold">
  100. ARM & DETONATE
  101. </button>
  102. `;
  103.  
  104. document.body.appendChild(hud);
  105.  
  106. document.getElementById("vap-arm").onclick = ()=>{
  107. const r=parseInt(document.getElementById("vap-radius").value);
  108. const x=parseInt(document.getElementById("vap-x").value);
  109. const y=parseInt(document.getElementById("vap-y").value);
  110. const shape=document.getElementById("vap-shape").value;
  111. const mode=document.getElementById("vap-mode").value;
  112. hud.remove();
  113. resolve({radius:r,startX:x,startY:-y,shape,mode,speed:_speed});
  114. };
  115. });
  116.  
  117.  
  118. // ═════════ SETTINGS ═════════
  119. const {radius,startX,startY,shape,mode,speed} = settings;
  120. const baseDelay = Math.max(0, 40-(speed*0.4));
  121. const tick=async()=>{if(baseDelay>0) await sleep(baseDelay);};
  122.  
  123. // countdown
  124. for(let i=5;i>=1;i--){ console.log("Detonating in",i); await sleep(1000); }
  125.  
  126. // compute positions
  127. const positions=[];
  128. for(let dy=-radius;dy<=radius;dy++){
  129. for(let dx=-radius;dx<=radius;dx++){
  130. if(isInShape(dx,dy,radius,shape,false)) positions.push({dx,dy});
  131. }
  132. }
  133.  
  134. // ═════════ MODES ═════════
  135. async function firestorm(){
  136. for(let i=0;i<500;i++){
  137. const p=positions[randInt(0,positions.length-1)];
  138. const x=startX+p.dx; const y=startY+p.dy-randInt(0,radius);
  139. w.changeColor(randInt(9,14));
  140. writeCharAt("^",randInt(9,14),x,y);
  141. await tick();
  142. }
  143. }
  144.  
  145. async function mushroom(){
  146. for(let h=0;h<radius*2;h++){
  147. writeCharAt("█",14,startX,startY-h);
  148. await tick();
  149. }
  150. }
  151.  
  152. async function shrapnel(){
  153. for(let i=0;i<600;i++){
  154. const p=positions[randInt(0,positions.length-1)];
  155. const x=startX+p.dx+randInt(-radius,radius);
  156. const y=startY+p.dy+randInt(-radius,radius);
  157. writeCharAt("*",randInt(2,29),x,y);
  158. await tick();
  159. }
  160. }
  161.  
  162. async function electric(){
  163. for(let i=0;i<300;i++){
  164. const p=positions[randInt(0,positions.length-1)];
  165. writeCharAt("≈",11,startX+p.dx,startY+p.dy);
  166. await tick();
  167. }
  168. }
  169.  
  170. async function pulse(){
  171. for(let r=1;r<=radius;r++){
  172. for(const p of positions){
  173. if(p.dx*p.dx+p.dy*p.dy<=r*r){
  174. writeCharAt("•",randInt(2,29),startX+p.dx,startY+p.dy);
  175. }
  176. }
  177. await tick();
  178. }
  179. }
  180.  
  181. // execute selected mode
  182. switch(mode){
  183. case "firestorm": await firestorm(); break;
  184. case "mushroom": await mushroom(); break;
  185. case "shrapnel": await shrapnel(); break;
  186. case "electric": await electric(); break;
  187. case "pulse": await pulse(); break;
  188. default: break;
  189. }
  190.  
  191. // classic explosion
  192. const t0=Date.now();
  193. while(Date.now()-t0<20000){
  194. const p=positions[randInt(0,positions.length-1)];
  195. const x=startX+p.dx; const y=startY+p.dy;
  196. w.changeColor(randInt(2,29));
  197. writeCharAt(randChar(),randInt(2,29),x,y);
  198. await tick();
  199. }
  200.  
  201. w.chat.send("Vaporizer complete.");
  202.  
  203. })();
Advertisement
Add Comment
Please, Sign In to add comment