UNPKG

koishi-plugin-dicex

Version:
15 lines (12 loc) 20.2 kB
var E=Object.defineProperty;var _=($,F)=>E($,"name",{value:F,configurable:!0});(()=>{"use strict";var $={913:function(M,i,c){var f=this&&this.__decorate||function(R,p,y,g){var s=arguments.length,t=s<3?p:g===null?g=Object.getOwnPropertyDescriptor(p,y):g,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")t=Reflect.decorate(R,p,y,g);else for(var a=R.length-1;a>=0;a--)(o=R[a])&&(t=(s<3?o(t):s>3?o(p,y,t):o(p,y))||t);return s>3&&t&&Object.defineProperty(p,y,t),t},d=this&&this.__metadata||function(R,p){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(R,p)};Object.defineProperty(i,"__esModule",{value:!0}),i.DicePluginConfig=void 0;const h=c(856);let e=_(class{constructor(p){}},"DicePluginConfig");f([(0,h.SchemaProperty)({description:"\u63B7\u9AB0\u7684\u6700\u5927\u70B9\u6570\u3002",default:65536}),d("design:type",Number)],e.prototype,"maxPoint",void 0),f([(0,h.SchemaProperty)({description:"\u5355\u6B21\u8C03\u7528\u4E2D\u6700\u5927\u63B7\u9AB0\u6B21\u6570\u3002",default:64}),d("design:type",Number)],e.prototype,"maxTimes",void 0),e=f([(0,h.RegisterSchema)(),d("design:paramtypes",[Object])],e),i.DicePluginConfig=e},607:function(M,i,c){var f=this&&this.__createBinding||(Object.create?function(r,u,n,l){l===void 0&&(l=n);var m=Object.getOwnPropertyDescriptor(u,n);(!m||("get"in m?!u.__esModule:m.writable||m.configurable))&&(m={enumerable:!0,get:function(){return u[n]}}),Object.defineProperty(r,l,m)}:function(r,u,n,l){l===void 0&&(l=n),r[l]=u[n]}),d=this&&this.__decorate||function(r,u,n,l){var m=arguments.length,P=m<3?u:l===null?l=Object.getOwnPropertyDescriptor(u,n):l,b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")P=Reflect.decorate(r,u,n,l);else for(var D=r.length-1;D>=0;D--)(b=r[D])&&(P=(m<3?b(P):m>3?b(u,n,P):b(u,n))||P);return m>3&&P&&Object.defineProperty(u,n,P),P},h=this&&this.__exportStar||function(r,u){for(var n in r)n!=="default"&&!Object.prototype.hasOwnProperty.call(u,n)&&f(u,r,n)},e=this&&this.__metadata||function(r,u){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,u)};Object.defineProperty(i,"__esModule",{value:!0});const R=c(913),p=c(856),y=c(916),g=c(714),s=c(269),t=c(867),o=c(848);h(c(913),i);let a=_(class extends g.BaseModule{diceCommand(){}onApply(){this.ctx.plugin(y.DbModule,this.config),this.ctx.plugin(s.RollModule,this.config),this.ctx.plugin(t.RcModule,this.config),this.ctx.plugin(o.CompatModule,this.config)}},"DicePlugin");d([(0,p.UseCommand)("dice",{empty:!0}),(0,p.CommandDescription)({zh:"\u9AB0\u5B50\u6307\u4EE4",en:"Dice command"}),e("design:type",Function),e("design:paramtypes",[]),e("design:returntype",void 0)],a.prototype,"diceCommand",null),a=d([(0,p.Isolate)("diceDb"),(0,p.DefinePlugin)({name:"dicex",schema:R.DicePluginConfig})],a),i.default=a},848:function(M,i,c){var f=this&&this.__decorate||function(g,s,t,o){var a=arguments.length,r=a<3?s:o===null?o=Object.getOwnPropertyDescriptor(s,t):o,u;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(g,s,t,o);else for(var n=g.length-1;n>=0;n--)(u=g[n])&&(r=(a<3?u(r):a>3?u(s,t,r):u(s,t))||r);return a>3&&r&&Object.defineProperty(s,t,r),r},d=this&&this.__metadata||function(g,s){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(g,s)};Object.defineProperty(i,"__esModule",{value:!0}),i.CompatModule=void 0;const h=c(559),e=c(714),R=c(856),p=c(126);let y=_(class extends e.BaseModule{constructor(){super(...arguments),this.checkCommands=["st","rc","ra","r"]}onRollCompat(s,t){if(!s.parsed)return t();const{content:o,prefix:a}=s.parsed;if(!a)return t();const r=this.checkCommands.find(u=>o.startsWith(u));if(r){const u=o.slice(r.length);return s.execute(`${r} ${u}`,t)}return t()}},"CompatModule");f([(0,R.UseMiddleware)(),d("design:type",Function),d("design:paramtypes",[p.Session,Function]),d("design:returntype",void 0)],y.prototype,"onRollCompat",null),y=f([(0,h.DiceModule)()],y),i.CompatModule=y},916:function(M,i,c){var f=this&&this.__decorate||function(u,n,l,m){var P=arguments.length,b=P<3?n:m===null?m=Object.getOwnPropertyDescriptor(n,l):m,D;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")b=Reflect.decorate(u,n,l,m);else for(var v=u.length-1;v>=0;v--)(D=u[v])&&(b=(P<3?D(b):P>3?D(n,l,b):D(n,l))||b);return P>3&&b&&Object.defineProperty(n,l,b),b},d=this&&this.__metadata||function(u,n){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(u,n)},h=this&&this.__param||function(u,n){return function(l,m){n(l,m,u)}};Object.defineProperty(i,"__esModule",{value:!0}),i.DbModule=i.DiceSkill=i.DiceUserProfile=void 0;const e=c(856),R=c(126),p=c(630),y=c(559),g=c(714),s=c(980);class t{}_(t,"DiceProfileBase"),f([(0,e.Primary)(),(0,e.ModelField)("string(64)"),d("design:type",String)],t.prototype,"userId",void 0),f([(0,e.Primary)(),(0,e.ModelField)("string(64)"),d("design:type",String)],t.prototype,"channelId",void 0);let o=_(class extends t{},"DiceUserProfile");f([(0,e.ModelField)("string(64)"),d("design:type",String)],o.prototype,"currentCharacter",void 0),o=f([(0,e.DefineModel)("diceUserProfile")],o),i.DiceUserProfile=o;let a=_(class extends t{},"DiceSkill");f([(0,e.Primary)(),(0,e.ModelField)({type:"string",length:64,initial:"default"}),d("design:type",String)],a.prototype,"character",void 0),f([(0,e.Primary)(),(0,e.ModelField)("string(32)"),d("design:type",String)],a.prototype,"skillName",void 0),f([(0,e.ModelField)("unsigned(1)"),d("design:type",Number)],a.prototype,"value",void 0),a=f([(0,e.DefineModel)("diceSkill")],a),i.DiceSkill=a;let r=_(class extends g.BaseModule{onApply(){this.logger.info("Dice database module loaded.")}targetPattern(n){return n?"\u9891\u9053":"\u7528\u6237"}async getCurrentCharacter(n){const[l]=await this.database.get("diceUserProfile",{userId:n.userId,channelId:n.channelId},["currentCharacter"]);return l?.currentCharacter||"default"}async onChar(n,l){return l?(await this.database.upsert("diceUserProfile",[{userId:n.userId,channelId:n.channelId,currentCharacter:l}],["userId","channelId"]),`\u5DF2\u8BBE\u7F6E\u5F53\u524D\u89D2\u8272\u4E3A ${l}\u3002`):`\u5F53\u524D\u89D2\u8272\u4E3A ${await this.getCurrentCharacter(n)}\u3002`}async onSetSkill(n,l){const m={userId:n.userId,channelId:n.channelId||"priv",character:await this.getCurrentCharacter(n)};if(!l)return"\u8BED\u6CD5\u9519\u8BEF\u3002";const P=l.split(/\s/),b=new Set,D=[],v=[],x=_((C,S)=>{if(!C){v.push("\u6280\u80FD\u540D\u79F0\u4E0D\u80FD\u4E3A\u7A7A");return}if(S==null||S<0){v.push(`${C} \u7684\u6570\u503C\u65E0\u6548\u3002`);return}if(b.has(C)){v.push(`${C} \u51FA\u73B0\u91CD\u590D\u3002`);return}b.add(C),D.push({...m,skillName:C,value:S})},"appendData");for(let C=0;C<P.length;C++)if(P[C].match(/^(\D+\d{1,3})+$/)){let j="",B="";const I=P[C];for(let O=0;O<I.length;O++){const w=I[O];w.match(/\d/)?(B+=w,(O===I.length-1||!I[O+1].match(/\d/))&&(x(j,parseInt(B)),j="",B="")):j+=w}}else{const j=P[C+1];if(j.match(/^\d{1,3}$/))x(P[C],parseInt(j)),C++;else return"\u8BED\u6CD5\u9519\u8BEF\u3002"}if(v.length>0)return v.join(` `);if(!!D.length)return await this.database.upsert("diceSkill",D,["userId","channelId","character","skillName"]),`\u5DF2\u8BBE\u7F6E\u80FD\u529B\u6570\u503C: ${D.map(({skillName:C,value:S})=>`${C}=${S}`).join(" ")}`}async getAllSkills(n){const l=await this.database.get("diceSkill",{userId:n.userId,channelId:n.channelId||"priv",character:await this.getCurrentCharacter(n)},["skillName","value"]);return Object.fromEntries(l.map(({skillName:m,value:P})=>[m,P]))}async getSkillValue(n,l){const[m]=await this.database.get("diceSkill",{userId:n.userId,channelId:n.channelId||"priv",character:await this.getCurrentCharacter(n),skillName:l},["value"]);return m?.value}setRcMode(n,l,m,P){return P&&!l?"\u8BF7\u5728\u9891\u9053\u4E2D\u4F7F\u7528\u8BE5\u529F\u80FD\u3002":m==null?`\u5F53\u524D${this.targetPattern(P)}\u7684\u68C0\u70B9\u89C4\u5219\u5982\u4E0B: ${p.RcRuleList[(0,y.getRcMode)(P?void 0:n,l)].text}`:m<0||m>=p.RcRuleList.length?"\u89C4\u5219\u5E8F\u53F7\u4E0D\u5408\u6CD5":((P?l:n).diceProfile.rcMode=m,`\u5DF2\u8BBE\u7F6E\u5F53\u524D${this.targetPattern(P)}\u7684\u68C0\u70B9\u89C4\u5219\u4E3A ${m} \u3002`)}setFaces(n,l,m,P,b){if(b&&!l)return"\u8BF7\u5728\u9891\u9053\u4E2D\u4F7F\u7528\u8BE5\u529F\u80FD\u3002";const D=P||m;return D==null?`\u5F53\u524D${this.targetPattern(b)}\u7684\u9ED8\u8BA4\u63B7\u9AB0\u9762\u6570\u4E3A ${(0,y.getDefaultRollFaces)(b?void 0:n,l)} \u3002`:D<2||D>this.config.maxPoint?`\u9762\u6570\u5FC5\u987B\u5728 2 \u5230 ${this.config.maxPoint} \u4E4B\u95F4\u3002`:((b?l:n).diceProfile.defaultRollFaces=D,`\u5DF2\u8BBE\u7F6E\u5F53\u524D${this.targetPattern(b)}\u7684\u9ED8\u8BA4\u9762\u6570\u4E3A ${D} \u3002`)}},"DbModule");f([(0,e.Inject)(!0),d("design:type",R.Database)],r.prototype,"database",void 0),f([(0,e.Inject)(!0),d("design:type",R.DatabaseService)],r.prototype,"model",void 0),f([(0,e.InjectLogger)("dicex-db"),d("design:type",R.Logger)],r.prototype,"logger",void 0),f([(0,e.UseCommand)("dice/char [char:string]","\u8BBE\u7F6E\u5F53\u524D\u89D2\u8272"),(0,e.CommandDescription)({zh:"\u8BBE\u7F6E\u80FD\u529B\u6570\u503C",en:"Set skill value"}),(0,e.CommandAlias)("switch"),(0,e.CommandExample)("char \u5E7D\u5E7D\u5B50"),h(0,(0,e.PutSession)()),h(1,(0,e.PutArg)(0)),d("design:type",Function),d("design:paramtypes",[R.Session,String]),d("design:returntype",Promise)],r.prototype,"onChar",null),f([(0,e.UseCommand)("dice/st <exprs:text>"),(0,e.CommandDescription)({zh:"\u8BBE\u7F6E\u80FD\u529B\u6570\u503C",en:"Set skill value"}),(0,e.CommandExample)("st \u6F5C\u884C 50"),h(0,(0,e.PutSession)()),h(1,(0,e.PutArg)(0)),d("design:type",Function),d("design:paramtypes",[R.Session,String]),d("design:returntype",Promise)],r.prototype,"onSetSkill",null),f([(0,e.UseCommand)("dice/rcmode"),(0,e.CommandDescription)({zh:"\u8BBE\u7F6E\u68C0\u70B9\u89C4\u5219",en:"Set RC rule"}),(0,e.CommandUsage)(`\u9ED8\u8BA4\u89C4\u5219\u4E3A0\uFF0C\u89C4\u5219\u5E8F\u53F7\u5982\u4E0B: ${p.RcRuleList.map((u,n)=>`${n} ${u.text} `).join(` `)}`),(0,e.CommandExample)("rcmode -s 1 \u8BBE\u7F6E\u5F53\u524D\u9891\u9053\u7684\u68C0\u70B9\u89C4\u5219\u4E3A1\u3002"),h(0,(0,y.PutUserProfile)()),h(1,(0,y.PutChannelProfile)()),h(2,(0,e.PutOption)("set","-s <rule:integer> \u8BBE\u7F6E\u89C4\u5219",{description:{en:"Set rule"}})),h(3,(0,y.PutIsGlobal)()),d("design:type",Function),d("design:paramtypes",[Object,Object,Number,Boolean]),d("design:returntype",void 0)],r.prototype,"setRcMode",null),f([(0,e.UseCommand)("dice/faces [faces:number]"),(0,e.CommandDescription)({zh:"\u8BBE\u7F6E\u9ED8\u8BA4\u9762\u6570",en:"Set default face count"}),(0,e.CommandAlias)("set"),(0,e.CommandUsage)("\u9ED8\u8BA4\u9762\u6570\u4E3A 6 \u3002"),(0,e.CommandExample)("faces -s 10 \u8BBE\u7F6E\u5F53\u524D\u9891\u9053\u7684\u9ED8\u8BA4\u9762\u6570\u4E3A10\u3002"),h(0,(0,y.PutUserProfile)()),h(1,(0,y.PutChannelProfile)()),h(2,(0,e.PutArg)(0)),h(3,(0,e.PutOption)("set","-s <rule:integer> \u8BBE\u7F6E\u9762\u6570",{description:{en:"Set face count"}})),h(4,(0,y.PutIsGlobal)()),d("design:type",Function),d("design:paramtypes",[Object,Object,Number,Number,Boolean]),d("design:returntype",void 0)],r.prototype,"setFaces",null),r=f([(0,e.Provide)("diceDb"),(0,e.MixinModel)("user",{diceProfile:s.DiceProfile}),(0,e.MixinModel)("channel",{diceProfile:s.DiceProfile}),(0,e.UseModel)(a,o),(0,y.DiceModule)()],r),i.DbModule=r},867:function(M,i,c){var f=this&&this.__decorate||function(o,a,r,u){var n=arguments.length,l=n<3?a:u===null?u=Object.getOwnPropertyDescriptor(a,r):u,m;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")l=Reflect.decorate(o,a,r,u);else for(var P=o.length-1;P>=0;P--)(m=o[P])&&(l=(n<3?m(l):n>3?m(a,r,l):m(a,r))||l);return n>3&&l&&Object.defineProperty(a,r,l),l},d=this&&this.__metadata||function(o,a){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(o,a)},h=this&&this.__param||function(o,a){return function(r,u){a(r,u,o)}};Object.defineProperty(i,"__esModule",{value:!0}),i.RcModule=void 0;const e=c(856),R=c(126),p=c(559),y=c(714),g=c(630),s=c(916);let t=_(class extends y.BaseModule{getRcRule(a,r){const u=(0,p.getRcMode)(a,r);return g.RcRuleList[u]}async onRc(a,r,u,n,l,m){if(n==null&&this.diceDb&&(n=await this.diceDb.getSkillValue(a,u)),n==null||n<0||n>100)return"\u6210\u529F\u7387\u5FC5\u987B\u5728 0 \u5230 100 \u4E4B\u95F4\u3002";const P=this.getRcRule(l,m),b=R.Random.int(1,101),D=P.check(n,b),v=D===g.RcResult.BigFailure?"\u5927\u5931\u8D25\uFF01":D===g.RcResult.Failure?"\u5931\u8D25":D===g.RcResult.Success?"\u6210\u529F":"\u5927\u6210\u529F\uFF01";return`${r}\u8981${u}\uFF0C\u5F00\u59CB\u8FDB\u884C\u68C0\u5B9A\uFF1AD100=${b}/${n} ${v}`}},"RcModule");f([(0,e.Inject)(),d("design:type",s.DbModule)],t.prototype,"diceDb",void 0),f([(0,e.UseCommand)("dice/rc <reason:string> [rate:integer]"),(0,e.CommandDescription)({zh:"\u68C0\u5B9A",en:"Roll check"}),(0,e.CommandAlias)("ra"),(0,e.CommandShortcut)("\u68C0\u5B9A",{fuzzy:!0}),(0,e.CommandUsage)("\u53EF\u4EE5\u7528 st \u8BBE\u7F6E\u6570\u503C\u3002"),(0,e.CommandExample)("rc \u6F5C\u884C 20"),(0,e.CommandExample)("rc \u6F5C\u884C"),h(0,(0,e.PutSession)()),h(1,(0,e.PutUserName)(!0)),h(2,(0,e.PutArg)(0)),h(3,(0,e.PutArg)(1)),h(4,(0,p.PutUserProfile)()),h(5,(0,p.PutChannelProfile)()),d("design:type",Function),d("design:paramtypes",[R.Session,String,String,Number,Object,Object]),d("design:returntype",Promise)],t.prototype,"onRc",null),t=f([(0,p.DiceModule)()],t),i.RcModule=t},269:function(M,i,c){var f=this&&this.__decorate||function(o,a,r,u){var n=arguments.length,l=n<3?a:u===null?u=Object.getOwnPropertyDescriptor(a,r):u,m;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")l=Reflect.decorate(o,a,r,u);else for(var P=o.length-1;P>=0;P--)(m=o[P])&&(l=(n<3?m(l):n>3?m(a,r,l):m(a,r))||l);return n>3&&l&&Object.defineProperty(a,r,l),l},d=this&&this.__metadata||function(o,a){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(o,a)},h=this&&this.__param||function(o,a){return function(r,u){a(r,u,o)}};Object.defineProperty(i,"__esModule",{value:!0}),i.RollModule=void 0;const e=c(856),R=c(126),p=c(559),y=c(714),g=c(756),s=c(916);let t=_(class extends y.BaseModule{async onRoll(a,r,u,n,l){r||(r="1d");const{maxPoint:m=1<<16,maxTimes:P=64}=this.config;let b=`${a} \u63B7\u9AB0\uFF1A${r}=`;try{b+=new g.OneDice({defaultDiceFaces:(0,p.getDefaultRollFaces)(u,n),maxDiceCount:P,maxDiceFaces:m,valueDict:this.diceDb?await this.diceDb.getAllSkills(l):{}}).calculate(r)}catch{return"\u8868\u8FBE\u5F0F\u8BED\u6CD5\u9519\u8BEF\u3002"}return b}},"RollModule");f([(0,e.Inject)(),d("design:type",s.DbModule)],t.prototype,"diceDb",void 0),f([(0,e.UseCommand)("dice/roll [expr:string]","\u63B7\u9AB0"),(0,e.CommandDescription)({en:"Roll dice"}),(0,e.CommandAlias)("r"),(0,e.CommandShortcut)("\u63B7\u9AB0",{fuzzy:!0}),(0,e.CommandExample)("roll 2d6+d10"),h(0,(0,e.PutUserName)(!0)),h(1,(0,e.PutArg)(0)),h(2,(0,p.PutUserProfile)()),h(3,(0,p.PutChannelProfile)()),h(4,(0,e.PutSession)()),d("design:type",Function),d("design:paramtypes",[String,String,Object,Object,R.Session]),d("design:returntype",Promise)],t.prototype,"onRoll",null),t=f([(0,p.DiceModule)()],t),i.RollModule=t},714:(M,i,c)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.BaseModule=void 0;const f=c(913),d=c(856);class h extends(0,d.StarterPlugin)(f.DicePluginConfig){}_(h,"BaseModule"),i.BaseModule=h},980:function(M,i,c){var f=this&&this.__decorate||function(R,p,y,g){var s=arguments.length,t=s<3?p:g===null?g=Object.getOwnPropertyDescriptor(p,y):g,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")t=Reflect.decorate(R,p,y,g);else for(var a=R.length-1;a>=0;a--)(o=R[a])&&(t=(s<3?o(t):s>3?o(p,y,t):o(p,y))||t);return s>3&&t&&Object.defineProperty(p,y,t),t},d=this&&this.__metadata||function(R,p){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(R,p)};Object.defineProperty(i,"__esModule",{value:!0}),i.DiceProfile=void 0;const h=c(856);class e{}_(e,"DiceProfile"),f([(0,h.ModelField)({type:"integer",initial:0}),d("design:type",Number)],e.prototype,"rcMode",void 0),f([(0,h.ModelField)({type:"integer",initial:6}),d("design:type",Number)],e.prototype,"defaultRollFaces",void 0),i.DiceProfile=e},630:(M,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.RcRuleList=i.RcRule5=i.RcRule4=i.RcRule3=i.RcRule2=i.RcRule1=i.RcRule0=i.RcRule=i.RcResult=void 0;var c;(function(g){g[g.BigSuccess=1]="BigSuccess",g[g.Success=2]="Success",g[g.Failure=3]="Failure",g[g.BigFailure=4]="BigFailure"})(c=i.RcResult||(i.RcResult={}));class f{check(s,t){return t<=s?c.Success:c.Failure}}_(f,"RcRule"),i.RcRule=f;class d extends f{constructor(){super(...arguments),this.text=`\u51FA1\u5927\u6210\u529F \u4E0D\u6EE150\u51FA96-100\u5927\u5931\u8D25\uFF0C\u6EE150\u51FA100\u5927\u5931\u8D25`}check(s,t){if(t<=1)return c.BigSuccess;const o=super.check(s,t);return o===c.Failure&&(s<50&&t>=96||s>=50&&t>=100)?c.BigFailure:o}}_(d,"RcRule0"),i.RcRule0=d;class h extends f{constructor(){super(...arguments),this.text=`\u4E0D\u6EE150\u51FA1\u5927\u6210\u529F\uFF0C\u6EE150\u51FA1-5\u5927\u6210\u529F \u4E0D\u6EE150\u51FA96-100\u5927\u5931\u8D25\uFF0C\u6EE150\u51FA100\u5927\u5931\u8D25`}check(s,t){const o=super.check(s,t);if(o===c.Success){if(s<50&&t<=1||s>=50&&t<=5)return c.BigSuccess}else if((s<50&&t>=96||s>=50&&t>=100)&&o===c.Failure)return c.BigFailure;return o}}_(h,"RcRule1"),i.RcRule1=h;class e extends f{constructor(){super(...arguments),this.text=`\u51FA1-5\u4E14<=\u6210\u529F\u7387\u5927\u6210\u529F \u51FA100\u6216\u51FA96-99\u4E14>\u6210\u529F\u7387\u5927\u5931\u8D25`}check(s,t){const o=super.check(s,t);if(o===c.Success){if(t<=5)return c.BigSuccess}else if(t>=96)return c.BigFailure;return o}}_(e,"RcRule2"),i.RcRule2=e;class R extends f{constructor(){super(...arguments),this.text=`\u51FA1-5\u5927\u6210\u529F \u51FA96-100\u5927\u5931\u8D25`}check(s,t){return t<=5?c.BigSuccess:t>=96?c.BigFailure:super.check(s,t)}}_(R,"RcRule3"),i.RcRule3=R;class p extends f{constructor(){super(...arguments),this.text="\u51FA1-5\u4E14<=\u5341\u5206\u4E4B\u4E00\u5927\u6210\u529F\\n\u4E0D\u6EE150\u51FA>=96+\u5341\u5206\u4E4B\u4E00\u5927\u5931\u8D25\uFF0C\u6EE150\u51FA100\u5927\u5931\u8D25"}check(s,t){const o=super.check(s,t);if(o===c.Success){if(t<=5&&t<=s/10)return c.BigSuccess}else if(s<50&&t>=96+s/10||s>=50&&t>=100)return c.BigFailure;return o}}_(p,"RcRule4"),i.RcRule4=p;class y extends f{constructor(){super(...arguments),this.text="\u51FA1-2\u4E14<\u4E94\u5206\u4E4B\u4E00\u5927\u6210\u529F\\n\u4E0D\u6EE150\u51FA96-100\u5927\u5931\u8D25\uFF0C\u6EE150\u51FA99-100\u5927\u5931\u8D25"}check(s,t){const o=super.check(s,t);if(o===c.Success){if(t<=2&&t<=s/5)return c.BigSuccess}else if(s<50&&t>=96||s>=50&&t>=99&&t<=100)return c.BigFailure;return o}}_(y,"RcRule5"),i.RcRule5=y,i.RcRuleList=[new d,new h,new e,new R,new p,new y]},559:(M,i,c)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.PutIsGlobal=i.PutChannelProfile=i.PutUserProfile=i.getDefaultRollFaces=i.getRcMode=i.getProfileProperty=i.DiceModule=void 0;const f=c(856),d=c(913),h=_(()=>(0,f.DefinePlugin)({schema:d.DicePluginConfig}),"DiceModule");i.DiceModule=h;function e(t,o,a,r){return t?.diceProfile?.[a]??o?.diceProfile?.[a]??r}_(e,"getProfileProperty"),i.getProfileProperty=e;const R=_((t,o)=>e(t,o,"rcMode",0),"getRcMode");i.getRcMode=R;const p=_((t,o)=>e(t,o,"defaultRollFaces",6),"getDefaultRollFaces");i.getDefaultRollFaces=p;const y=_(()=>(0,f.PutUser)(["diceProfile"]),"PutUserProfile");i.PutUserProfile=y;const g=_(()=>(0,f.PutChannel)(["diceProfile"]),"PutChannelProfile");i.PutChannelProfile=g;const s=_(()=>(0,f.PutOption)("global","-g \u4F5C\u7528\u4E8E\u672C\u9891\u9053\u3002"),"PutIsGlobal");i.PutIsGlobal=s},126:M=>{M.exports=require("koishi")},856:M=>{M.exports=require("koishi-thirdeye")},756:M=>{M.exports=require("onedice")}},F={};function A(M){var i=F[M];if(i!==void 0)return i.exports;var c=F[M]={exports:{}};return $[M].call(c.exports,c,c.exports,A),c.exports}_(A,"__webpack_require__");var U=A(607),N=exports;for(var z in U)N[z]=U[z];U.__esModule&&Object.defineProperty(N,"__esModule",{value:!0})})(); //# sourceMappingURL=index.js.map