// ==UserScript== // @license MIT // @name SCBOY乌龟雪插件 // @namespace https://gitee.com/rustyhare // @version 1.4.3 // @description 为论坛添加很棒的乌龟雪。 // @author RustyHare // @match *://www.scboy.cc/* // @grant none // @downloadURL none // ==/UserScript== window.normalTurtle=function(quantity){ //正常持续的乌龟 var normalTurtle=new Object(); normalTurtle.turtleList=[]; normalTurtle.quantity=quantity; var width=window.innerWidth; var height=window.innerHeight; for(var i=0;i window.rcanvas.width*1.11 || normalTurtle.turtleList[i][2] > window.rcanvas.height+20){//如果在屏幕之外则重置该乌龟 var destination=Math.random(); if(destination<0.5){ normalTurtle.turtleList[i]=(["🐢",Math.random()*window.rcanvas.width,Math.random()*window.rcanvas.height/10-window.rcanvas.height/10,window.w.velX,9.8,Math.random()*0.75+0.75]); }else if(destination>=0.5 && destination<0.75){ normalTurtle.turtleList[i]=(["🐢",-window.rcanvas.width/10,Math.random()*window.rcanvas.height,window.w.velX,9.8,Math.random()*0.75+0.75]); }else{ normalTurtle.turtleList[i]=(["🐢",window.rcanvas.width*1.1,Math.random()*window.rcanvas.height,window.w.velX,9.8,Math.random()*0.75+0.75]); } } normalTurtle.turtleList[i][1]+=normalTurtle.turtleList[i][3]*(0.6+normalTurtle.turtleList[i][5]*0.5)/10; normalTurtle.turtleList[i][2]+=normalTurtle.turtleList[i][4]*normalTurtle.turtleList[i][5]/10; normalTurtle.turtleList[i][3]+=(window.w.velX-normalTurtle.turtleList[i][3])/100; normalTurtle.turtleList[i][4]+=(window.w.velY-normalTurtle.turtleList[i][4])/100; } } return normalTurtle; } window.singleUseTurtle=function(quantity,x,y){//🎉🦌🐢❄ //一次性使用的乌龟, var singleUseTurtle=new Object(); var charList=["🎉","🦌","🐢","❄","🎄","🐇","🕊","👠"]; singleUseTurtle.turtleList=[]; for(var i=0;iMath.random()*200000){ wind.windVelX=(Math.random()*40)-20; wind.windVelY=5+(Math.random()*6); wind.accuCF=0; //console.log("RustyHare::Wind change triggered"); }else{ wind.accuCF+=1; } wind.velX+=(wind.windVelX-wind.velX)/750; wind.velY+=(wind.windVelY-wind.velY)/750; } return wind; } //类(伪)注册部分结束 //以下是动画更新方法 window.moveAllSingleUseTurtle=function(){ for(var j=0;j0){ for(var j=0;j window.rcanvas.width*1.11 || window.singleUseList[j].turtleList[i][2] > window.rcanvas.height+20){ window.singleUseList[j].turtleList.splice(i,1); }else{ window.singleUseList[j].turtleList[i][1]+=window.singleUseList[j].turtleList[i][3]*(0.6+window.singleUseList[j].turtleList[i][5]*0.5)/10; window.singleUseList[j].turtleList[i][2]+=window.singleUseList[j].turtleList[i][4]*window.singleUseList[j].turtleList[i][5]/10; window.singleUseList[j].turtleList[i][3]+=(window.w.velX-window.singleUseList[j].turtleList[i][3])/200; window.singleUseList[j].turtleList[i][4]+=(window.w.velY*3-window.singleUseList[j].turtleList[i][4])/50; } } } } } window.canvasRefreshTurtle=function(){ window.rcanvas.width=window.rcanvas.width; //window.ctx.globalAlpha=0.3; //以下是普通乌龟渲染 for(var i=0;i