-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path4186.ea0c5625dd5ee061e437.js
More file actions
1 lines (1 loc) · 56.2 KB
/
Copy path4186.ea0c5625dd5ee061e437.js
File metadata and controls
1 lines (1 loc) · 56.2 KB
1
(self.webpackChunkudonarium_lily_gk=self.webpackChunkudonarium_lily_gk||[]).push([[4186],{4186:function(Ze,Je,Qe){Qe(4656),Opal.modules["bcdice/format"]=function(e){var z,k,L,de,ve,h,le,T=[],t=e.nil,l=e.$$,we=e.module,Y=e.truthy;return z=T,k=le=[we(T[0],"BCDice")].concat(z),ve=we(le[0],"Format"),h=[ve].concat(k),ve.$module_function(),e.def(ve,"$comparison_operator",L=function(c){var H;return"=="["$==="](H=c)?"=":"!="["$==="](H)?"<>":l(h,"Symbol")["$==="](H)?c.$to_s():t},L.$$arity=1),void e.def(ve,"$modifier",de=function(c){return Y(c["$nil?"]())?t:c["$=="](0)?"":Y("number"==typeof(i=c)?i>0:i["$>"](0))?"+"+c:c.$to_s();var i},de.$$arity=1)},Opal.modules["racc/parser"]=function(e){function ae(w,c){return"number"==typeof w&&"number"==typeof c?w<c:w["$<"](c)}function fe(w,c){return"number"==typeof w&&"number"==typeof c?w-c:w["$-"](c)}function T(w,c){return"number"==typeof w&&"number"==typeof c?w+c:w["$+"](c)}function t(w,c){return"number"==typeof w&&"number"==typeof c?w>=c:w["$>="](c)}function W(w,c){return"number"==typeof w&&"number"==typeof c?w>c:w["$>"](c)}function l(w,c){return"number"==typeof w&&"number"==typeof c?w<=c:w["$<="](c)}var ie,U,$,c,H,z=[],r=e.nil,le=e.$$$,v=e.$$,k=e.module,ve=e.klass,h=e.truthy,L=e.gvars,de=e.send;return c=z,ie=(H=[k(z[0],"Racc")].concat(c))[0],U=v(H,"StandardError"),$=H,[ve(ie,U,"ParseError")].concat($),h(le("::","ParseError","skip_raise")?"constant":r)||e.const_set(z[0],"ParseError",le(v(z,"Racc"),"ParseError")),function(w,c){var R,I,x,u,E,N,_e,G,P,D,X,te,q,a,_,C,se,K,M,j,p,o,ee,Q,ge,m,A,H=[k(w,"Racc")].concat(c);h(v(H,"Racc_No_Extensions","skip_raise")?"constant":r)||e.const_set(H[0],"Racc_No_Extensions",!1),R=H,m=ve(H[0],null,"Parser"),A=[m].concat(R),m.$$prototype.yydebug=m.$$prototype.racc_debug_out=m.$$prototype.racc_error_status=m.$$prototype.racc_t=m.$$prototype.racc_vstack=m.$$prototype.racc_val=m.$$prototype.racc_state=m.$$prototype.racc_tstack=r,e.const_set(A[0],"Racc_Runtime_Version","1.4.6"),e.const_set(A[0],"Racc_Runtime_Revision",["originalRevision:","1.8"]["$[]"](1)),e.const_set(A[0],"Racc_Runtime_Core_Version_R","1.4.6"),e.const_set(A[0],"Racc_Runtime_Core_Revision_R",["originalRevision:","1.8"]["$[]"](1)),e.const_set(A[0],"Racc_Main_Parsing_Routine","_racc_do_parse_rb"),e.const_set(A[0],"Racc_YY_Parse_Method","_racc_yyparse_rb"),e.const_set(A[0],"Racc_Runtime_Core_Version",v(A,"Racc_Runtime_Core_Version_R")),e.const_set(A[0],"Racc_Runtime_Core_Revision",v(A,"Racc_Runtime_Core_Revision_R")),e.const_set(A[0],"Racc_Runtime_Type","ruby"),e.defs(v(A,"Parser"),"$racc_runtime_type",I=function(){return v(A,"Racc_Runtime_Type")},I.$$arity=0),e.def(m,"$_racc_setup",x=function(){var f,B,n=this,S=r,b=r,y=r;return null==L.stderr&&(L.stderr=r),h(le(n.$class(),"Racc_debug_parser"))||(n.yydebug=!1),h(null!=(f=n.yydebug)&&f!==r?"instance-variable":r)||(n.yydebug=!1),h(n.yydebug)&&(h(null!=(B=n.racc_debug_out)&&B!==r?"instance-variable":r)||(n.racc_debug_out=L.stderr),n.racc_debug_out=h(S=n.racc_debug_out)?S:L.stderr),b=le(n.$class(),"Racc_arg"),h(ae(b.$size(),14))&&(de(b,"[]=",e.to_a(y=[13,!0])),fe(y.length,1)),b},x.$$arity=0),e.def(m,"$_racc_init_sysvars",u=function(){var f=this;return f.racc_state=[0],f.racc_tstack=[],f.racc_vstack=[],f.racc_t=r,f.racc_val=r,f.racc_read_next=!0,f.racc_user_yyerror=!1,f.racc_error_status=0},u.$$arity=0),e.def(m,"$do_parse",E=function(){return this.$__send__(v(A,"Racc_Main_Parsing_Routine"),this.$_racc_setup(),!1)},E.$$arity=0),e.def(m,"$next_token",N=function(){return this.$raise(v(A,"NotImplementedError"),this.$class()+"#next_token is not defined")},N.$$arity=0),e.def(m,"$_racc_do_parse_rb",_e=function(f,B){var n,b,y=this,ue=r,ce=r,me=r,ke=r,Pe=r,pe=r,he=r,ne=r;return n=e.to_ary(f),ue=null==n[0]?r:n[0],ce=null==n[1]?r:n[1],me=null==n[2]?r:n[2],ke=null==n[3]?r:n[3],Pe=null==n[10]?r:n[10],y.$_racc_init_sysvars(),pe=he=ne=r,de(y,"catch",["racc_end_parse"],((b=function(){var Ce,Ie,V=null==b.$$s?this:b.$$s,De=r,Be=r,Ne=r;for(null==V.racc_state&&(V.racc_state=r),null==V.racc_read_next&&(V.racc_read_next=r),null==V.racc_t&&(V.racc_t=r),null==V.yydebug&&(V.yydebug=r),null==V.racc_val&&(V.racc_val=r);h(!0);)for(h(ne=ke["$[]"](V.racc_state["$[]"](-1)))?(h(V.racc_read_next)&&h(V.racc_t["$!="](0))&&(Ie=V.$next_token(),Ce=e.to_ary(Ie),pe=null==Ce[0]?r:Ce[0],V.racc_val=null==Ce[1]?r:Ce[1],V.racc_t=h(pe)?h(De=Pe["$[]"](pe))?De:1:0,h(V.yydebug)&&V.$racc_read_token(V.racc_t,pe,V.racc_val),V.racc_read_next=!1),ne=T(ne,V.racc_t),h(h(Be=h(Ne=t(ne,0))?he=ue["$[]"](ne):Ne)?ce["$[]"](ne)["$=="](V.racc_state["$[]"](-1)):Be)||(he=me["$[]"](V.racc_state["$[]"](-1)))):he=me["$[]"](V.racc_state["$[]"](-1));h(he=V.$_racc_evalact(he,f)););}).$$s=y,b.$$arity=0,b))},_e.$$arity=2),e.def(m,"$yyparse",G=function(f,B){return this.$__send__(v(A,"Racc_YY_Parse_Method"),f,B,this.$_racc_setup(),!0)},G.$$arity=2),e.def(m,"$_racc_yyparse_rb",P=function(f,B,n,S){var b,ue,me=r,ke=r,ye=r,Pe=r,he=r,ne=r,be=r;return b=e.to_ary(n),me=null==b[0]?r:b[0],ke=null==b[1]?r:b[1],ye=null==b[2]?r:b[2],Pe=null==b[3]?r:b[3],he=null==b[10]?r:b[10],this.$_racc_init_sysvars(),ne=r,be=r,de(this,"catch",["racc_end_parse"],((ue=function(){var De,Se=null==ue.$$s?this:ue.$$s;for(null==Se.racc_state&&(Se.racc_state=r);!h(be=Pe["$[]"](Se.racc_state["$[]"](-1)));)for(;h(ne=Se.$_racc_evalact(ye["$[]"](Se.racc_state["$[]"](-1)),n)););return de(f,"__send__",[B],((De=function(Ne,Le){var qe,Ue,xe=null==De.$$s?this:De.$$s,ze=r,Fe=r,We=r,je=r,J=r,d=r,$e=r;for(null==xe.racc_t&&(xe.racc_t=r),null==xe.racc_state&&(xe.racc_state=r),null==xe.racc_read_next&&(xe.racc_read_next=r),null==Ne&&(Ne=r),null==Le&&(Le=r),xe.racc_t=h(Ne)?h(ze=he["$[]"](Ne))?ze:1:0,xe.racc_val=Le,xe.racc_read_next=!1,be=T(be,xe.racc_t),h(h(qe=h(Ue=t(be,0))?ne=me["$[]"](be):Ue)?ke["$[]"](be)["$=="](xe.racc_state["$[]"](-1)):qe)||(ne=ye["$[]"](xe.racc_state["$[]"](-1)));h(ne=xe.$_racc_evalact(ne,n)););for(;h(h(Fe=h(We=(be=Pe["$[]"](xe.racc_state["$[]"](-1)))["$!"]())?We:xe.racc_read_next["$!"]())?Fe:xe.racc_t["$=="](0));)for(h(h(je=h(J=h(d=h($e=be)?be=T(be,xe.racc_t):$e)?t(be,0):d)?ne=me["$[]"](be):J)?ke["$[]"](be)["$=="](xe.racc_state["$[]"](-1)):je)||(ne=ye["$[]"](xe.racc_state["$[]"](-1)));h(ne=xe.$_racc_evalact(ne,n)););}).$$s=Se,De.$$arity=2,De))}).$$s=this,ue.$$arity=0,ue))},P.$$arity=4),e.def(m,"$_racc_evalact",D=function(f,B){var n,b,ye,pe,y=this,ue=r,ce=r,ke=r,Pe=r,he=r,ne=r,be=r,V=r,Se=r,Ce=r;if(ue=null==(n=e.to_ary(B))[0]?r:n[0],ce=null==n[1]?r:n[1],ke=null==n[3]?r:n[3],ye=null==n[11]?r:n[11],Pe=null==n[12]?r:n[12],h(h(pe=W(f,0))?ae(f,ye):pe))h(W(y.racc_error_status,0))&&(y.racc_t["$=="](1)||(y.racc_error_status=fe(y.racc_error_status,1))),y.racc_vstack.$push(y.racc_val),y.racc_state.$push(f),y.racc_read_next=!0,h(y.yydebug)&&(y.racc_tstack.$push(y.racc_t),y.$racc_shift(y.racc_t,y.racc_tstack,y.racc_vstack));else if(h(h(he=ae(f,0))?W(f,Pe["$-@"]()):he)){if(ne=de(y,"catch",["racc_jump"],((b=function(){var De=null==b.$$s?this:b.$$s;return null==De.racc_state&&(De.racc_state=r),De.racc_state.$push(De.$_racc_do_reduce(B,f)),!1}).$$s=y,b.$$arity=0,b)),h(ne)){if(1["$==="](be=ne))return y.racc_user_yyerror=!0,Pe["$-@"]();if(2["$==="](be))return ye;y.$raise("[Racc Bug] unknown jump code")}}else if(f["$=="](ye))h(y.yydebug)&&y.$racc_accept(),y.$throw("racc_end_parse",y.racc_vstack["$[]"](0));else{if(f["$=="](Pe["$-@"]())){for((0)["$==="](be=y.racc_error_status)?h(B["$[]"](21))||y.$on_error(y.racc_t,y.racc_val,y.racc_vstack):3["$==="](be)&&(y.racc_t["$=="](0)&&y.$throw("racc_end_parse",r),y.racc_read_next=!0),y.racc_user_yyerror=!1,y.racc_error_status=3;h(!0)&&(!h(V=ke["$[]"](y.racc_state["$[]"](-1)))||(V=T(V,1),!h(h(Se=h(Ce=t(V,0))?f=ue["$[]"](V):Ce)?ce["$[]"](V)["$=="](y.racc_state["$[]"](-1)):Se)));)h(l(y.racc_state.$size(),1))&&y.$throw("racc_end_parse",r),y.racc_state.$pop(),y.racc_vstack.$pop(),h(y.yydebug)&&(y.racc_tstack.$pop(),y.$racc_e_pop(y.racc_state,y.racc_tstack,y.racc_vstack));return f}y.$raise("[Racc Bug] unknown action "+f.$inspect())}return h(y.yydebug)&&y.$racc_next_state(y.racc_state["$[]"](-1),y.racc_state),r},D.$$arity=2),e.def(m,"$_racc_do_reduce",X=function(f,B){var n,ye,pe,Ce,Ie,De,xe,b=this,ue=r,ce=r,me=r,ke=r,Pe=r,he=r,ne=r,be=r,V=r,Se=r,Be=r,Ne=r,Le=r,He=r,Ge=r,ze=r;return ue=null==(n=e.to_ary(f))[4]?r:n[4],ce=null==n[5]?r:n[5],me=null==n[6]?r:n[6],ke=null==n[7]?r:n[7],ye=null==n[8]?r:n[8],Pe=null==n[9]?r:n[9],pe=null==n[13]?r:n[13],he=b.racc_state,ne=b.racc_vstack,be=b.racc_tstack,V=function(w,c){return"number"==typeof w?-3*w:w["$*"](-3)}(B),Se=Pe["$[]"](V),Ce=Pe["$[]"](T(V,1)),Ie=Pe["$[]"](T(V,2)),De=[],h(b.yydebug)&&(Be=be["$[]"](Se["$-@"](),Se)),Ne=ne["$[]"](Se["$-@"](),Se),h(b.yydebug)&&(Le=[Se["$-@"](),Se,De],de(be,"[]=",e.to_a(Le)),fe(Le.length,1)),Le=[Se["$-@"](),Se,De],de(ne,"[]=",e.to_a(Le)),fe(Le.length,1),Le=[Se["$-@"](),Se,De],de(he,"[]=",e.to_a(Le)),fe(Le.length,1),h(pe)?ne.$push(b.$__send__(Ie,Ne,ne,Ne["$[]"](0))):ne.$push(b.$__send__(Ie,Ne,ne)),be.$push(Ce),h(b.yydebug)&&b.$racc_reduce(Be,Ce,be,ne),xe=fe(Ce,ye),h(V=ke["$[]"](xe))&&(V=T(V,he["$[]"](-1)),h(h(He=h(Ge=t(V,0))?ze=ue["$[]"](V):Ge)?ce["$[]"](V)["$=="](xe):He))?ze:me["$[]"](xe)},X.$$arity=2),e.def(m,"$on_error",te=function(f,B,n){var b,S=this;return S.$raise(v(A,"ParseError"),S.$sprintf("\nparse error on value %s (%s)",B.$inspect(),h(b=S.$token_to_str(f))?b:"?"))},te.$$arity=3),e.def(m,"$yyerror",q=function(){return this.$throw("racc_jump",1)},q.$$arity=0),e.def(m,"$yyaccept",a=function(){return this.$throw("racc_jump",2)},a.$$arity=0),e.def(m,"$yyerrok",_=function(){return this.racc_error_status=0},_.$$arity=0),e.def(m,"$racc_read_token",C=function(f,B,n){var S=this;return S.racc_debug_out.$print("read "),S.racc_debug_out.$print(B.$inspect(),"(",S.$racc_token2str(f),") "),S.racc_debug_out.$puts(n.$inspect()),S.racc_debug_out.$puts()},C.$$arity=3),e.def(m,"$racc_shift",se=function(f,B,n){var S=this;return S.racc_debug_out.$puts("shift "+S.$racc_token2str(f)),S.$racc_print_stacks(B,n),S.racc_debug_out.$puts()},se.$$arity=3),e.def(m,"$racc_reduce",K=function(f,B,n,S){var b,y=this,ue=r;return(ue=y.racc_debug_out).$print("reduce "),h(f["$empty?"]())?ue.$print(" <none>"):de(f,"each",[],((b=function(me){return null==me&&(me=r),ue.$print(" ",(null==b.$$s?this:b.$$s).$racc_token2str(me))}).$$s=y,b.$$arity=1,b)),ue.$puts(" --\x3e "+y.$racc_token2str(B)),y.$racc_print_stacks(n,S),y.racc_debug_out.$puts()},K.$$arity=4),e.def(m,"$racc_accept",M=function(){return this.racc_debug_out.$puts("accept"),this.racc_debug_out.$puts()},M.$$arity=0),e.def(m,"$racc_e_pop",j=function(f,B,n){var S=this;return S.racc_debug_out.$puts("error recovering mode: pop token"),S.$racc_print_states(f),S.$racc_print_stacks(B,n),S.racc_debug_out.$puts()},j.$$arity=3),e.def(m,"$racc_next_state",p=function(f,B){var n=this;return n.racc_debug_out.$puts("goto "+f),n.$racc_print_states(B),n.racc_debug_out.$puts()},p.$$arity=2),e.def(m,"$racc_print_stacks",o=function(f,B){var n,b=r;return(b=this.racc_debug_out).$print(" ["),de(f,"each_index",[],((n=function(ue){return null==ue&&(ue=r),b.$print(" (",(null==n.$$s?this:n.$$s).$racc_token2str(f["$[]"](ue))," ",B["$[]"](ue).$inspect(),")")}).$$s=this,n.$$arity=1,n)),b.$puts(" ]")},o.$$arity=2),e.def(m,"$racc_print_states",ee=function(f){var B,S=r;return(S=this.racc_debug_out).$print(" ["),de(f,"each",[],((B=function(y){return null==y&&(y=r),S.$print(" ",y)}).$$s=this,B.$$arity=1,B)),S.$puts(" ]")},ee.$$arity=1),e.def(m,"$racc_token2str",Q=function(f){var n;return h(n=le(this.$class(),"Racc_token_to_s_table")["$[]"](f))?n:this.$raise("[Racc Bug] can't convert token "+f+" to string")},Q.$$arity=1),e.def(m,"$token_to_str",ge=function(f){return le(this.$class(),"Racc_token_to_s_table")["$[]"](f)},ge.$$arity=1)}(z[0],z)},Opal.modules["bcdice/arithmetic/node"]=function(e){function ae(z,r){return"number"==typeof z&&"number"==typeof r?z/r:z["$/"](r)}var r,ve,w,H,ie,U,m,A,I,x,u,E,$,R,re,L,v,T=[],t=e.nil,W=e.$$$,l=e.$$,we=e.module,Y=e.klass,i=e.send2;return r=T,ve=v=[we(T[0],"BCDice")].concat(r),w=L=[we(v[0],"Arithmetic")].concat(ve),function(H,ie,U){var m,A,I,x,u,$=Y(H,null,"BinaryOp");[$].concat(U),$.$$prototype.lhs=$.$$prototype.rhs=$.$$prototype.op=t,e.def($,"$initialize",m=function(N,_e,G){var P=this;return P.lhs=N,P.op=_e,P.rhs=G},m.$$arity=3),e.def($,"$eval",A=function(N){var P,G=t;return G=this.lhs.$eval(N),P=this.rhs.$eval(N),G.$send(this.op,P)},A.$$arity=1),e.def($,"$output",I=function(){var N=this;return""+N.lhs.$output()+N.op+N.rhs.$output()},I.$$arity=0),e.def($,"$s_exp",x=function(){var N=this;return"("+N.$op_for_s_exp()+" "+N.lhs.$s_exp()+" "+N.rhs.$s_exp()+")"},x.$$arity=0),e.def($,"$op_for_s_exp",u=function(){return this.op},u.$$arity=0)}((re=[we(L[0],"Node")].concat(w))[0],0,re),H=re[0],ie=l(re,"BinaryOp"),U=re,$=Y(H,ie,"DivideBase"),R=[$].concat(U),$.$$prototype.lhs=$.$$prototype.rhs=$.$$prototype.op=t,e.def($,"$initialize",m=function(_e,G){return m.$$p&&(m.$$p=null),i(this,e.find_super_dispatcher(this,"initialize",m,!1,!0),"initialize",[_e,"/",G],null)},m.$$arity=2),e.def($,"$eval",A=function(_e){var P,G=this,D=t;return P=G.lhs.$eval(_e),(D=G.rhs.$eval(_e))["$=="](0)&&G.$raise(l(R,"ZeroDivisionError")),G.$divide_and_round(P,D,_e)},A.$$arity=1),e.def($,"$output",I=function(){var _e=I.$$p,P=this,D=t,X=t,te=t;for(_e&&(I.$$p=null),X=0,te=arguments.length,D=new Array(te);X<te;X++)D[X]=arguments[X];return""+i(P,e.find_super_dispatcher(P,"output",I,!1,!0),"output",D,_e)+P.$rounding_method()},I.$$arity=0),$.$private(),e.def($,"$rounding_method",x=function(){return W(this.$class(),"ROUNDING_METHOD")},x.$$arity=0),e.def($,"$op_for_s_exp",u=function(){return""+this.op+this.$rounding_method()},u.$$arity=0),e.def($,"$divide_and_round",E=function(_e,G,P){return this.$raise(l(R,"NotImplementedError"))},E.$$arity=3),function(H,ie,U){var m,$=Y(H,ie,"DivideWithGameSystemDefault"),R=[$].concat(U);e.const_set(R[0],"ROUNDING_METHOD",""),$.$private(),e.def($,"$divide_and_round",m=function(I,x,u){var N;return N=u,W(l(R,"RoundType"),"CEIL")["$==="](N)?ae(I.$to_f(),x).$ceil():W(l(R,"RoundType"),"ROUND")["$==="](N)?ae(I.$to_f(),x).$round():ae(I,x).$to_i()},m.$$arity=3)}(re[0],l(re,"DivideBase"),re),function(H,ie,U){var m,$=Y(H,ie,"DivideWithCeil"),R=[$].concat(U);e.const_set(R[0],"ROUNDING_METHOD","C"),$.$private(),e.def($,"$divide_and_round",m=function(I,x,u){return ae(I.$to_f(),x).$ceil()},m.$$arity=3)}(re[0],l(re,"DivideBase"),re),function(H,ie,U){var m,$=Y(H,ie,"DivideWithRound"),R=[$].concat(U);e.const_set(R[0],"ROUNDING_METHOD","R"),$.$private(),e.def($,"$divide_and_round",m=function(I,x,u){return ae(I.$to_f(),x).$round()},m.$$arity=3)}(re[0],l(re,"DivideBase"),re),function(H,ie,U){var m,$=Y(H,ie,"DivideWithFloor"),R=[$].concat(U);e.const_set(R[0],"ROUNDING_METHOD","F"),$.$private(),e.def($,"$divide_and_round",m=function(I,x,u){return ae(I,x).$to_i()},m.$$arity=3)}(re[0],l(re,"DivideBase"),re),function(H,ie,U){var m,A,I,x,$=Y(H,null,"Negative");[$].concat(U),$.$$prototype.body=t,e.def($,"$initialize",m=function(E){return this.body=E},m.$$arity=1),e.def($,"$eval",A=function(E){return this.body.$eval(E)["$-@"]()},A.$$arity=1),e.def($,"$output",I=function(){return"-"+this.body.$output()},I.$$arity=0),e.def($,"$s_exp",x=function(){return"(- "+this.body.$s_exp()+")"},x.$$arity=0)}(re[0],0,re),function(H,ie,U){var m,A,I,x,$=Y(H,null,"Parenthesis");[$].concat(U),$.$$prototype.expr=t,e.def($,"$initialize",m=function(E){return this.expr=E},m.$$arity=1),e.def($,"$eval",A=function(E){return this.expr.$eval(E)},A.$$arity=1),e.def($,"$output",I=function(){return"("+this.expr.$output()+")"},I.$$arity=0),e.def($,"$s_exp",x=function(){return"(Parenthesis "+this.expr.$s_exp()+")"},x.$$arity=0)}(re[0],0,re),void function(H,ie,U){var m,A,I,$=Y(H,null,"Number");[$].concat(U),$.$$prototype.value=t,e.def($,"$initialize",m=function(u){return this.value=u},m.$$arity=1),e.def($,"$eval",A=function(u){return this.value},A.$$arity=1),e.def($,"$output",I=function(){return this.value.$to_s()},I.$$arity=0),e.alias($,"s_exp","output")}(re[0],0,re)},Opal.modules.strscan=function(e){var le,ve,h,L,de,w,c,re,H,ie,U,$,R,m,A,I,x,u,E,N,_e,G,P,D,X,te,v,k,T=[],t=e.nil,l=e.$$,Y=e.truthy,i=e.send;return le=T,v=(0,e.klass)(T[0],null,"StringScanner"),k=[v].concat(le),v.$$prototype.pos=v.$$prototype.string=v.$$prototype.working=v.$$prototype.matched=v.$$prototype.prev_pos=v.$$prototype.match=t,v.$attr_reader("pos"),v.$attr_reader("matched"),e.def(v,"$initialize",ve=function(a){var _=this;return _.string=a,_.pos=0,_.matched=t,_.working=a,_.match=[]},ve.$$arity=1),v.$attr_reader("string"),e.def(v,"$beginning_of_line?",h=function(){var a=this;return 0===a.pos||"\n"===a.string.charAt(a.pos-1)},h.$$arity=0),e.alias(v,"bol?","beginning_of_line?"),e.def(v,"$scan",L=function(a){var _=this,C=(a=_.$anchor(a)).exec(_.working);return null==C?_.matched=t:"object"==typeof C?(_.prev_pos=_.pos,_.pos+=C[0].length,_.working=_.working.substring(C[0].length),_.matched=C[0],_.match=C,C[0]):"string"==typeof C?(_.pos+=C.length,_.working=_.working.substring(C.length),C):t},L.$$arity=1),e.def(v,"$scan_until",de=function(a){var _=this;a=_.$anchor(a);for(var K,C=_.pos,se=_.working;;){if(K=a.exec(se),C+=1,se=se.substr(1),null!=K)return _.matched=_.string.substr(_.pos,C-_.pos-1+K[0].length),_.match=K,_.prev_pos=C-1,_.pos=C,_.working=se.substr(K[0].length),_.matched;if(0===se.length)return _.match=[],_.matched=t}},de.$$arity=1),e.def(v,"$[]",w=function(a){var C;if(Y(this.match["$empty?"]()))return t;C=a,l(k,"Symbol")["$==="](C)?a=a.$to_s():l(k,"String")["$==="](C)||(a=l(k,"Opal")["$coerce_to!"](a,l(k,"Integer"),"to_int"));var se=this.match;return a<0&&(a+=se.length),a<0||a>=se.length||null==se[a]?t:se[a]},w.$$arity=1),e.def(v,"$check",c=function(a){var _=this,C=(a=_.$anchor(a)).exec(_.working);return _.matched=null==C?t:C[0]},c.$$arity=1),e.def(v,"$check_until",re=function(a){var _=this,C=_.prev_pos,se=_.pos,K=_.$scan_until(a);return K!==t&&(_.matched=K.substr(-1),_.working=_.string.substr(se)),_.prev_pos=C,_.pos=se,K},re.$$arity=1),e.def(v,"$peek",H=function(a){return this.working.substring(0,a)},H.$$arity=1),e.def(v,"$eos?",ie=function(){return 0===this.working.length},ie.$$arity=0),e.def(v,"$exist?",U=function(a){var C=a.exec(this.working);return null==C?t:0==C.index?0:C.index+1},U.$$arity=1),e.def(v,"$skip",$=function(a){var _=this,C=(a=_.$anchor(a)).exec(_.working);if(null==C)return _.match=[],_.matched=t;var se=C[0],K=se.length;return _.matched=se,_.match=C,_.prev_pos=_.pos,_.pos+=K,_.working=_.working.substring(K),K},$.$$arity=1),e.def(v,"$skip_until",R=function(a){var C=this.$scan_until(a);return C===t?t:(this.matched=C.substr(-1),C.length)},R.$$arity=1),e.def(v,"$get_byte",m=function(){var a=this,_=t;return a.pos<a.string.length?(a.prev_pos=a.pos,a.pos+=1,_=a.matched=a.working.substring(0,1),a.working=a.working.substring(1)):a.matched=t,_},m.$$arity=0),e.alias(v,"getch","get_byte"),e.def(v,"$match?",A=function(a){var _=this,C=(a=_.$anchor(a)).exec(_.working);return null==C?t:(_.prev_pos=_.pos,C[0].length)},A.$$arity=1),e.def(v,"$pos=",I=function(a){var _=this;return a<0&&(a+=_.string.$length()),_.pos=a,_.working=_.string.slice(a)},I.$$arity=1),e.def(v,"$matched_size",x=function(){return this.matched===t?t:this.matched.length},x.$$arity=0),e.def(v,"$post_match",u=function(){var a=this;return a.matched===t?t:a.string.substr(a.pos)},u.$$arity=0),e.def(v,"$pre_match",E=function(){var a=this;return a.matched===t?t:a.string.substr(0,a.prev_pos)},E.$$arity=0),e.def(v,"$reset",N=function(){var a=this;return a.working=a.string,a.matched=t,a.pos=0},N.$$arity=0),e.def(v,"$rest",_e=function(){return this.working},_e.$$arity=0),e.def(v,"$rest?",G=function(){return 0!==this.working.length},G.$$arity=0),e.def(v,"$rest_size",P=function(){return this.$rest().$size()},P.$$arity=0),e.def(v,"$terminate",D=function(){var _,z,a=this;return a.match=t,_=[a.string.$length()],i(a,"pos=",e.to_a(_)),_[(z=_.length,"number"==typeof z?z-1:z["$-"](1))]},D.$$arity=0),e.def(v,"$unscan",X=function(){var a=this;return a.pos=a.prev_pos,a.prev_pos=t,a.match=t,a},X.$$arity=0),v.$private(),e.def(v,"$anchor",te=function(a){var C=a.toString().match(/\/([^\/]+)$/);return C=C?C[1]:void 0,new RegExp("^(?:"+a.source+")",C)},te.$$arity=1),t&&"anchor"},Opal.modules["bcdice/normalize"]=function(e){var le,ve,h,v,Y,z,fe=[],T=e.nil,l=e.module;return Y=fe,le=z=[l(fe[0],"BCDice")].concat(Y),[v=l(z[0],"Normalize")].concat(le),v.$module_function(),e.def(v,"$comparison_operator",ve=function(de){var c;return/<=|=</["$==="](c=de)?"<=":/>=|=>/["$==="](c)?">=":/<>|!=|=!/["$==="](c)?"!=":/</["$==="](c)?"<":/>/["$==="](c)?">":/=/["$==="](c)?"==":T},ve.$$arity=1),void e.def(v,"$target_number",h=function(de){return de["$=="]("?")?de:de.$to_i()},h.$$arity=1)},Opal.modules["bcdice/command/lexer"]=function(e){var le,h,re,U,$,R,H,ie,de,k,ae=e.top,fe=[],T=e.nil,W=e.$$,l=e.module,we=e.klass,Y=e.hash2,i=e.truthy,z=e.send;return ae.$require("strscan"),ae.$require("bcdice/normalize"),le=fe,h=k=[l(fe[0],"BCDice")].concat(le),re=de=[l(k[0],"Command")].concat(h),H=we(de[0],null,"Lexer"),ie=[H].concat(re),H.$$prototype.scanner=H.$$prototype.notations=T,e.const_set(ie[0],"SYMBOLS",Y(["+","-","*","/","(",")","?","@","#","$"],{"+":"PLUS","-":"MINUS","*":"ASTERISK","/":"SLASH","(":"PARENL",")":"PARENR","?":"QUESTION","@":"AT","#":"SHARP",$:"DOLLAR"}).$freeze()),e.def(H,"$initialize",U=function(A,I){var x,u,E,_e,N=this;return A=i(_e=(u=(x=A)===T||null==x?T:z(x,"split",[" ",2]))===T||null==u?T:z(u,"first",[]))?_e:"",N.scanner=W(ie,"StringScanner").$new(A),N.notations=z(I,"map",[],((E=function(G){function P(D){return G.apply(this,arguments)}return P.toString=function(){return G.toString()},P}(function(G){return null==G&&(G=T),i(G["$is_a?"](W(ie,"String")))?W(ie,"Regexp").$new(G):G})).$$s=N,E.$$arity=1,E))},U.$$arity=2),e.def(H,"$next_token",$=function(){try{var A,I=this,x=T,u=T,N=T,_e=T;return i(I.scanner["$eos?"]())?[!1,"$"]:(z(I.notations,"each",[],((A=function(G){function P(D){return G.apply(this,arguments)}return P.toString=function(){return G.toString()},P}(function(G){var D,P=null==A.$$s?this:A.$$s;if(null==P.scanner&&(P.scanner=T),null==G&&(G=T),D=P.scanner.$scan(G),!i(D))return T;e.ret(["NOTATION",D])})).$$s=I,A.$$arity=1,A)),i(x=I.scanner.$scan(/\d+/))?["NUMBER",x.$to_i()]:i(u=I.scanner.$scan(/[<>!=]+/))?(u=W(ie,"Normalize").$comparison_operator(u),[i(u)?"CMP_OP":"ILLEGAL",u]):(N=I.scanner.$getch().$upcase(),[i(_e=W(ie,"SYMBOLS")["$[]"](N))?_e:N.$to_sym(),N]))}catch(G){if(G===e.returner)return G.$v;throw G}},$.$$arity=0),void e.def(H,"$source",R=function(){return this.scanner.$string()},R.$$arity=0)},Opal.modules["bcdice/command/parsed"]=function(e){var z,k,w,H,ie,U,c,re,h,le,fe=[],T=e.nil,W=e.$$,l=e.module,we=e.klass,Y=e.truthy;return z=fe,k=le=[l(fe[0],"BCDice")].concat(z),w=h=[l(le[0],"Command")].concat(k),c=we(h[0],null,"Parsed"),re=[c].concat(w),c.$$prototype.question_target=c.$$prototype.critical=c.$$prototype.fumble=c.$$prototype.dollar=c.$$prototype.modify_number=c.$$prototype.target_number=c.$$prototype.prefix_number=c.$$prototype.command=c.$$prototype.suffix_number=c.$$prototype.cmp_op=T,c.$attr_accessor("command"),c.$attr_accessor("prefix_number"),c.$attr_accessor("suffix_number"),c.$attr_accessor("critical"),c.$attr_accessor("fumble"),c.$attr_accessor("dollar"),c.$attr_accessor("modify_number"),c.$attr_accessor("cmp_op"),c.$attr_accessor("target_number"),c.$attr_writer("question_target"),e.def(c,"$initialize",H=function(){var R=this;return R.prefix_number=T,R.suffix_number=T,R.critical=T,R.fumble=T,R.dollar=T,R.cmp_op=T,R.target_number=T,R.question_target=!1},H.$$arity=0),e.def(c,"$question_target?",ie=function(){return this.question_target},ie.$$arity=0),void e.def(c,"$to_s",U=function(R){var N,m=this,A=T,I=T,x=T,u=T,E=T;return null==R&&(R="after_command"),A=Y(m.critical)?"@"+m.critical:T,I=Y(m.fumble)?"#"+m.fumble:T,x=Y(m.dollar)?"$"+m.dollar:T,u=W(re,"Format").$modifier(m.modify_number),E=Y(m.question_target)?"?":m.target_number,"after_command"["$==="](N=R)?[m.prefix_number,m.command,m.suffix_number,A,I,x,u,m.cmp_op,E].$join():"after_modify_number"["$==="](N)?[m.prefix_number,m.command,m.suffix_number,u,A,I,x,m.cmp_op,E].$join():"after_target_number"["$==="](N)?[m.prefix_number,m.command,m.suffix_number,u,m.cmp_op,E,A,I,x].$join():T},U.$$arity=-1)},Opal.modules["bcdice/command/parser"]=function(e){function ae(k,ve){return"number"==typeof k&&"number"==typeof ve?k-ve:k["$-"](ve)}var ve,w,H,ie,U,m,A,I,x,u,E,N,_e,G,P,D,X,te,q,a,_,C,se,K,M,j,p,o,ee,Q,ge,F,f,B,n,S,b,y,ue,ce,me,ke,ye,Pe,pe,he,ne,be,V,Se,Ce,Ie,De,Be,Ne,Le,xe,He,Ge,ze,Fe,$,R,re,L,fe=e.top,T=[],t=e.nil,W=e.$$$,l=e.$$,we=e.klass,Y=e.module,i=e.hash2,z=e.send2,r=e.send,le=e.hash,v=e.truthy;return fe.$require("racc/parser.rb"),fe.$require("bcdice/arithmetic/node"),fe.$require("bcdice/command/lexer"),fe.$require("bcdice/command/parsed"),function(k,ve,h){[we(k,ve,"Parser")].concat(h)}(W(l(T,"BCDice"),"Command"),W(l(T,"Racc"),"Parser"),T),ve=T,w=L=[Y(T[0],"BCDice")].concat(ve),H=(re=[Y(L[0],"Command")].concat(w))[0],ie=W(l(re,"Racc"),"Parser"),U=re,$=we(H,ie,"Parser"),R=[$].concat(U),$.$$prototype.notations=$.$$prototype.lexer=$.$$prototype.modifier=$.$$prototype.prefix_number=$.$$prototype.suffix_number=$.$$prototype.need_suffix_number=$.$$prototype.need_prefix_number=$.$$prototype.critical=$.$$prototype.fumble=$.$$prototype.dollar=$.$$prototype.allowed_cmp_op=$.$$prototype.question_target=t,e.def($,"$initialize",m=function(d,$e){var g,s,Z,Ee,Te=m.$$p,oe=this;if(Te&&(m.$$p=null),g=e.slice.call(arguments,0,arguments.length),null==(s=e.extract_kwargs(g)))s=i([],{});else if(!s.$$is_hash)throw e.ArgumentError.$new("expected kwargs");if(Z=g,!e.hasOwnProperty.call(s.$$smap,"round_type"))throw e.ArgumentError.$new("missing keyword: round_type");return Ee=s.$$smap.round_type,z(oe,e.find_super_dispatcher(oe,"initialize",m,!1,!0),"initialize",[],null),oe.notations=Z,oe.round_type=Ee,oe.prefix_number=!1,oe.suffix_number=!1,oe.need_prefix_number=!1,oe.need_suffix_number=!1,oe.modifier=!0,oe.critical=!1,oe.fumble=!1,oe.dollar=!1,oe.allowed_cmp_op=[t,">=",">","<=","<","==","!="],oe.question_target=!1},m.$$arity=-2),e.def($,"$disable_modifier",A=function(){return this.modifier=!1,this},A.$$arity=0),e.def($,"$enable_prefix_number",I=function(){return this.prefix_number=!0,this},I.$$arity=0),e.def($,"$enable_suffix_number",x=function(){return this.suffix_number=!0,this},x.$$arity=0),e.def($,"$has_prefix_number",u=function(){var d=this;return d.prefix_number=!0,d.need_prefix_number=!0,d},u.$$arity=0),e.def($,"$has_suffix_number",E=function(){var d=this;return d.suffix_number=!0,d.need_suffix_number=!0,d},E.$$arity=0),e.def($,"$enable_critical",N=function(){return this.critical=!0,this},N.$$arity=0),e.def($,"$enable_fumble",_e=function(){return this.fumble=!0,this},_e.$$arity=0),e.def($,"$enable_dollar",G=function(){return this.dollar=!0,this},G.$$arity=0),e.def($,"$restrict_cmp_op_to",P=function(d){var $e,s=this;return $e=e.slice.call(arguments,0,arguments.length),s.allowed_cmp_op=$e,s},P.$$arity=-1),e.def($,"$enable_question_target",D=function(){return this.question_target=!0,this},D.$$arity=0),e.def($,"$parse",X=function(d){try{return this.lexer=l(R,"Lexer").$new(d,this.notations),this.$do_parse()}catch(g){if(!e.rescue(g,[l(R,"ParseError"),l(R,"ZeroDivisionError")]))throw g;try{return t}finally{e.pop_exception()}}},X.$$arity=1),$.$private(),e.def($,"$parsed",te=function(d,$e,g,s){var Z;return r(l(R,"Parsed").$new(),"tap",[],((Z=function(Re){var Ae,Me,Xe,Ve,Ye,Ke,oe=null==Z.$$s?this:Z.$$s,O=t;return null==oe.round_type&&(oe.round_type=t),null==Re&&(Re=t),O=[d["$[]"]("command")],r(Re,"command=",e.to_a(O)),ae(O.length,1),O=[(Ae=d["$[]"]("prefix"),Ae===t||null==Ae?t:r(Ae,"eval",[oe.round_type]))],r(Re,"prefix_number=",e.to_a(O)),ae(O.length,1),O=[(Me=d["$[]"]("suffix"),Me===t||null==Me?t:r(Me,"eval",[oe.round_type]))],r(Re,"suffix_number=",e.to_a(O)),ae(O.length,1),O=[(Xe=$e["$[]"]("critical"),Xe===t||null==Xe?t:r(Xe,"eval",[oe.round_type]))],r(Re,"critical=",e.to_a(O)),ae(O.length,1),O=[(Ve=$e["$[]"]("fumble"),Ve===t||null==Ve?t:r(Ve,"eval",[oe.round_type]))],r(Re,"fumble=",e.to_a(O)),ae(O.length,1),O=[(Ye=$e["$[]"]("dollar"),Ye===t||null==Ye?t:r(Ye,"eval",[oe.round_type]))],r(Re,"dollar=",e.to_a(O)),ae(O.length,1),O=[g.$eval(oe.round_type)],r(Re,"modify_number=",e.to_a(O)),ae(O.length,1),O=[s["$[]"]("cmp_op")],r(Re,"cmp_op=",e.to_a(O)),ae(O.length,1),s["$[]"]("target")["$=="]("?")?(r(Re,"question_target=",e.to_a(O=[!0])),ae(O.length,1),r(Re,"target_number=",e.to_a(O=[0])),O[ae(O.length,1)]):(r(Re,"question_target=",e.to_a(O=[!1])),ae(O.length,1),O=[(Ke=s["$[]"]("target"),Ke===t||null==Ke?t:r(Ke,"eval",[oe.round_type]))],r(Re,"target_number=",e.to_a(O)),O[ae(O.length,1)])}).$$s=this,Z.$$arity=1,Z))},te.$$arity=4),e.def($,"$next_token",q=function(){return this.lexer.$next_token()},q.$$arity=0),Ie=[6,6,6,6,7,28,29,17,18,5,5,5,5,6,26,12,4,45,17,18,10,11,5,10,11,6,23,24,25,26,17,18,6,20,5,33,34,17,18,6,35,5,28,29,17,18,6,t,5,36,37,17,18,6,t,5,36,37,17,18,6,t,5,36,37,17,18,6,t,5,33,34,17,18,6,t,5,36,37,17,18,6,t,5,36,37,17,18,6,t,5,36,37,17,18,6,t,5,36,37,17,18,6,t,5,t,t,17,18,6,t,5,t,t,17,18,t,t,5,23,24,25,26,56,54,55,57],De=[0,4,26,12,1,21,21,26,26,0,4,26,12,5,21,3,0,26,5,5,8,8,5,2,2,10,8,8,8,8,10,10,11,7,10,14,14,11,11,17,14,11,9,9,17,17,18,t,17,15,15,18,18,23,t,18,30,30,23,23,24,t,23,31,31,24,24,25,t,24,44,44,25,25,28,t,25,47,47,28,28,29,t,28,48,48,29,29,33,t,29,49,49,33,33,34,t,33,50,50,34,34,36,t,34,t,t,36,36,37,t,36,t,t,37,37,t,t,37,27,27,27,27,52,52,52,52],Be=[-2,4,16,-3,-1,11,t,33,13,35,23,30,1,t,28,40,t,37,44,t,t,-2,t,51,58,65,0,106,72,79,47,54,t,86,93,t,100,107,t,t,t,t,t,t,63,t,t,68,75,82,89,t,120,t,t,t,t,t],Ne=[-35,-35,-8,-35,-7,-35,-34,-35,-16,-8,-35,-35,-5,-6,-35,-21,-24,-35,-35,-32,58,-16,-3,-35,-35,-35,-35,-16,-35,-35,-12,-13,-4,-35,-35,-33,-35,-35,-30,-31,-1,-9,-10,-11,-17,-18,-2,-14,-15,-19,-20,-22,-25,-23,-26,-27,-28,-29],Le=[30,31,38,39,14,8,1,22,41,42,43,9,27,2,53,t,t,21,47,48,40,51,52,49,50,44,46,3,t,t,t,13,t,t,t,t,t,t,t,32],xe=[8,8,7,7,9,3,1,5,7,7,7,4,3,2,10,t,t,4,8,8,5,7,7,8,8,9,5,6,t,t,t,6,t,t,t,t,t,t,t,6],He=[t,6,13,3,9,-1,27,-15,-10,-1,-38],Ge=[t,t,t,t,t,t,19,16,15,t,t],ze=[0,0,"racc_error",4,20,"_reduce_1",4,20,"_reduce_2",3,20,"_reduce_3",3,21,"_reduce_4",2,21,"_reduce_5",2,21,"_reduce_6",1,21,"_reduce_7",0,22,"_reduce_8",3,22,"_reduce_9",3,22,"_reduce_10",3,22,"_reduce_11",2,23,"_reduce_12",2,23,"_reduce_13",3,23,"_reduce_14",3,23,"_reduce_15",0,24,"_reduce_16",2,24,"_reduce_17",2,24,"_reduce_18",3,28,"_reduce_19",3,28,"_reduce_20",1,28,"_reduce_none",3,27,"_reduce_22",4,27,"_reduce_23",1,27,"_reduce_none",0,29,"_reduce_25",1,29,"_reduce_26",1,29,"_reduce_27",1,29,"_reduce_28",1,29,"_reduce_29",2,26,"_reduce_30",2,26,"_reduce_31",1,26,"_reduce_none",3,25,"_reduce_33",1,25,"_reduce_34"],Fe=le(!1,0,"error",1,"NUMBER",2,"R",3,"U",4,"C",5,"F",6,"PLUS",7,"MINUS",8,"ASTERISK",9,"SLASH",10,"PARENL",11,"PARENR",12,"AT",13,"SHARP",14,"DOLLAR",15,"CMP_OP",16,"QUESTION",17,"NOTATION",18),e.const_set(R[0],"Racc_arg",[Ie,De,Ne,Be,Le,xe,Ge,He,19,ze,Fe,58,35,!0]),e.const_set(R[0],"Racc_token_to_s_table",["$end","error","NUMBER","R","U","C","F","PLUS","MINUS","ASTERISK","SLASH","PARENL","PARENR","AT","SHARP","DOLLAR","CMP_OP","QUESTION","NOTATION","$start","expr","notation","option","modifier","target","term","unary","mul","add","round_type"]),e.const_set(R[0],"Racc_debug_parser",!1),e.def($,"$_reduce_1",a=function(d,$e,g){var s;return v(this.modifier)||this.$raise(l(R,"ParseError")),s=e.to_ary(d),this.$parsed(null==s[0]?t:s[0],null==s[1]?t:s[1],null==s[2]?t:s[2],null==s[3]?t:s[3])},a.$$arity=3),e.def($,"$_reduce_2",_=function(d,$e,g){var s;return v(this.modifier)||this.$raise(l(R,"ParseError")),s=e.to_ary(d),this.$parsed(null==s[0]?t:s[0],null==s[2]?t:s[2],null==s[1]?t:s[1],null==s[3]?t:s[3])},_.$$arity=3),e.def($,"$_reduce_3",C=function(d,$e,g){var s,oe;return oe=null==(s=e.to_ary(d))[2]?t:s[2],this.$parsed(null==s[0]?t:s[0],null==s[1]?t:s[1],W(W(l(R,"Arithmetic"),"Node"),"Number").$new(0),oe)},C.$$arity=3),e.def($,"$_reduce_4",se=function(d,$e,g){var Z,s=this;return v(v(Z=s.prefix_number)?s.suffix_number:Z)||s.$raise(l(R,"ParseError")),i(["command","prefix","suffix"],{command:d["$[]"](1),prefix:d["$[]"](0),suffix:d["$[]"](2)})},se.$$arity=3),e.def($,"$_reduce_5",K=function(d,$e,g){var s=this;return v(s.prefix_number)||s.$raise(l(R,"ParseError")),v(s.need_suffix_number)&&s.$raise(l(R,"ParseError")),i(["command","prefix"],{command:d["$[]"](1),prefix:d["$[]"](0)})},K.$$arity=3),e.def($,"$_reduce_6",M=function(d,$e,g){var s=this;return v(s.suffix_number)||s.$raise(l(R,"ParseError")),v(s.need_prefix_number)&&s.$raise(l(R,"ParseError")),i(["command","suffix"],{command:d["$[]"](0),suffix:d["$[]"](1)})},M.$$arity=3),e.def($,"$_reduce_7",j=function(d,$e,g){var Z,s=this;return v(v(Z=s.need_prefix_number)?Z:s.need_suffix_number)&&s.$raise(l(R,"ParseError")),i(["command"],{command:d["$[]"](0)})},j.$$arity=3),e.def($,"$_reduce_8",p=function(d,$e,g){return i([],{})},p.$$arity=3),e.def($,"$_reduce_9",o=function(d,$e,g){var s,oe,Me,Ae,Te=t;return Te=null==(s=e.to_ary(d))[0]?t:s[0],oe=null==s[2]?t:s[2],v(v(Ae=this.critical)?Te["$[]"]("critical")["$nil?"]():Ae)||this.$raise(l(R,"ParseError")),r(Te,"[]=",e.to_a(Me=["critical",oe])),ae(Me.length,1),Te},o.$$arity=3),e.def($,"$_reduce_10",ee=function(d,$e,g){var s,oe,Me,Ae,Te=t;return Te=null==(s=e.to_ary(d))[0]?t:s[0],oe=null==s[2]?t:s[2],v(v(Ae=this.fumble)?Te["$[]"]("fumble")["$nil?"]():Ae)||this.$raise(l(R,"ParseError")),r(Te,"[]=",e.to_a(Me=["fumble",oe])),ae(Me.length,1),Te},ee.$$arity=3),e.def($,"$_reduce_11",Q=function(d,$e,g){var s,oe,Me,Ae,Te=t;return Te=null==(s=e.to_ary(d))[0]?t:s[0],oe=null==s[2]?t:s[2],v(v(Ae=this.dollar)?Te["$[]"]("dollar")["$nil?"]():Ae)||this.$raise(l(R,"ParseError")),r(Te,"[]=",e.to_a(Me=["dollar",oe])),ae(Me.length,1),Te},Q.$$arity=3),e.def($,"$_reduce_12",ge=function(d,$e,g){return d["$[]"](1)},ge.$$arity=3),e.def($,"$_reduce_13",F=function(d,$e,g){return W(W(l(R,"Arithmetic"),"Node"),"Negative").$new(d["$[]"](1))},F.$$arity=3),e.def($,"$_reduce_14",f=function(d,$e,g){return W(W(l(R,"Arithmetic"),"Node"),"BinaryOp").$new(d["$[]"](0),"+",d["$[]"](2))},f.$$arity=3),e.def($,"$_reduce_15",B=function(d,$e,g){return W(W(l(R,"Arithmetic"),"Node"),"BinaryOp").$new(d["$[]"](0),"-",d["$[]"](2))},B.$$arity=3),e.def($,"$_reduce_16",n=function(d,$e,g){return v(this.allowed_cmp_op["$include?"](t))||this.$raise(l(R,"ParseError")),i([],{})},n.$$arity=3),e.def($,"$_reduce_17",S=function(d,$e,g){var s,Te,Re;return Re=null==(s=e.to_ary(d))[1]?t:s[1],v(this.allowed_cmp_op["$include?"](Te=null==s[0]?t:s[0]))||this.$raise(l(R,"ParseError")),i(["cmp_op","target"],{cmp_op:Te,target:Re})},S.$$arity=3),e.def($,"$_reduce_18",b=function(d,$e,g){var Z,s=this;return Z=d["$[]"](0),v(s.question_target)||s.$raise(l(R,"ParseError")),v(s.allowed_cmp_op["$include?"](Z))||s.$raise(l(R,"ParseError")),i(["cmp_op","target"],{cmp_op:Z,target:"?"})},b.$$arity=3),e.def($,"$_reduce_19",y=function(d,$e,g){return W(W(l(R,"Arithmetic"),"Node"),"BinaryOp").$new(d["$[]"](0),"+",d["$[]"](2))},y.$$arity=3),e.def($,"$_reduce_20",ue=function(d,$e,g){return W(W(l(R,"Arithmetic"),"Node"),"BinaryOp").$new(d["$[]"](0),"-",d["$[]"](2))},ue.$$arity=3),e.def($,"$_reduce_22",ce=function(d,$e,g){return W(W(l(R,"Arithmetic"),"Node"),"BinaryOp").$new(d["$[]"](0),"*",d["$[]"](2))},ce.$$arity=3),e.def($,"$_reduce_23",me=function(d,$e,g){return d["$[]"](3).$new(d["$[]"](0),d["$[]"](2))},me.$$arity=3),e.def($,"$_reduce_25",ke=function(d,$e,g){return W(W(l(R,"Arithmetic"),"Node"),"DivideWithGameSystemDefault")},ke.$$arity=3),e.def($,"$_reduce_26",ye=function(d,$e,g){return W(W(l(R,"Arithmetic"),"Node"),"DivideWithCeil")},ye.$$arity=3),e.def($,"$_reduce_27",Pe=function(d,$e,g){return W(W(l(R,"Arithmetic"),"Node"),"DivideWithCeil")},Pe.$$arity=3),e.def($,"$_reduce_28",pe=function(d,$e,g){return W(W(l(R,"Arithmetic"),"Node"),"DivideWithRound")},pe.$$arity=3),e.def($,"$_reduce_29",he=function(d,$e,g){return W(W(l(R,"Arithmetic"),"Node"),"DivideWithFloor")},he.$$arity=3),e.def($,"$_reduce_30",ne=function(d,$e,g){return d["$[]"](1)},ne.$$arity=3),e.def($,"$_reduce_31",be=function(d,$e,g){return W(W(l(R,"Arithmetic"),"Node"),"Negative").$new(d["$[]"](1))},be.$$arity=3),e.def($,"$_reduce_33",V=function(d,$e,g){return d["$[]"](1)},V.$$arity=3),e.def($,"$_reduce_34",Se=function(d,$e,g){return W(W(l(R,"Arithmetic"),"Node"),"Number").$new(d["$[]"](0))},Se.$$arity=3),void e.def($,"$_reduce_none",Ce=function(d,$e,g){return d["$[]"](0)},Ce.$$arity=3)},Opal.modules["bcdice/dice_table/table"]=function(e){var le,h,re,U,$,R,m,H,ie,de,k,T=[],t=e.nil,l=e.$$,we=e.module,Y=e.klass,i=e.hash2,z=e.truthy;return le=T,h=k=[we(T[0],"BCDice")].concat(le),re=de=[we(k[0],"DiceTable")].concat(h),H=Y(de[0],null,"Table"),ie=[H].concat(re),H.$$prototype.times=H.$$prototype.sides=H.$$prototype.name=H.$$prototype.items=t,e.defs(H,"$from_i18n",U=function(I,x){var E=t;return E=l(ie,"I18n").$t(I,i(["locale"],{locale:x})),this.$new(E["$[]"]("name"),E["$[]"]("type"),E["$[]"]("items"))},U.$$arity=2),e.def(H,"$initialize",$=function(I,x,u){var E=this,N=t;return E.name=I,E.items=u.$freeze(),N=/(\d+)D(\d+)/i.$match(x),z(N)||E.$raise(l(ie,"ArgumentError"),"Unexpected table type: "+x),E.times=N["$[]"](1).$to_i(),E.sides=N["$[]"](2).$to_i()},$.$$arity=3),e.def(H,"$roll",R=function(I){var u,x=this;return u=I.$roll_sum(x.times,x.sides),x.$choice(u)},R.$$arity=1),void e.def(H,"$choice",m=function(I){var u,x=this;return u=function(r,le){return"number"==typeof r&&"number"==typeof le?r-le:r["$-"](le)}(I,x.times),l(ie,"RollResult").$new(x.name,I,x.items["$[]"](u))},m.$$arity=1)},Opal.modules["bcdice/dice_table/range_table"]=function(e){var k,de,ie,R,m,A,I,x,u,E,N,_e,U,$,c,h,W=[],l=e.nil,Y=e.$$,i=e.module,z=e.klass,r=e.send,le=e.truthy;return k=W,de=h=[i(W[0],"BCDice")].concat(k),ie=c=[i(h[0],"DiceTable")].concat(de),U=z(c[0],null,"RangeTable"),$=[U].concat(ie),U.$$prototype.name=U.$$prototype.items=U.$$prototype.num_of_dice=U.$$prototype.num_of_sides=U.$$prototype.formatter=l,e.const_set($[0],"RollResult",r(Y($,"Struct"),"new",["sum","values","content","formatted"],((R=function(){return(null==R.$$s?this:R.$$s).$alias_method("to_s","formatted")}).$$s=U,R.$$arity=0,R))),e.const_set($[0],"Item",Y($,"Struct").$new("range","content")),e.const_set($[0],"DICE_ROLL_METHOD_RE",/^(\d+)D(\d+)$/i.$freeze()),e.const_set($[0],"DEFAULT_FORMATTER",r(U,"lambda",[],($$2=function(G){function P(D,X){return G.apply(this,arguments)}return P.toString=function(){return G.toString()},P}(function(G,P){return null==$$2.$$s||$$2,null==G&&(G=l),null==P&&(P=l),G.$name()+"("+P.$sum()+") \uff1e "+P.$content()}),$$2.$$s=U,$$2.$$arity=2,$$2))),U.$attr_reader("name"),U.$attr_reader("num_of_dice"),U.$attr_reader("num_of_sides"),e.def(U,"$initialize",m=function(P,D,X){var _,te=m.$$p,q=te||l,a=this,C=l;return te&&(m.$$p=null),te&&(m.$$p=null),a.name=P.$freeze(),a.formatter=le(_=q)?_:Y($,"DEFAULT_FORMATTER"),C=Y($,"DICE_ROLL_METHOD_RE").$match(D),le(C)||a.$raise(Y($,"ArgumentError"),a.name+": invalid dice roll method: "+D),a.num_of_dice=C["$[]"](1).$to_i(),a.num_of_sides=C["$[]"](2).$to_i(),a.$store(X)},m.$$arity=3),e.def(U,"$fetch",A=function(P){var D,te,X=this;return te=r(X.items,"find",[],((D=function(q){function a(_){return q.apply(this,arguments)}return a.toString=function(){return q.toString()},a}(function(q){return null==q&&(q=l),q.$range()["$include?"](P)})).$$s=X,D.$$arity=1,D)),le(te)||X.$raise(Y($,"RangeError"),X.name+": value is out of range: "+P),te},A.$$arity=1),e.def(U,"$roll",I=function(P){var te,q,a,v,D=this,X=l;return te=(X=P.$roll_barabara(D.num_of_dice,D.num_of_sides)).$sum(),q=Y($,"RollResult").$new(te,X,D.$fetch(te).$content()),a=[D.formatter["$[]"](D,q)],r(q,"formatted=",e.to_a(a)),"number"==typeof(v=a.length)||v["$-"](1),q},I.$$arity=1),U.$private(),e.def(U,"$store",x=function(P){var D,X,te,a,_,q=this;return a=r(P,"map",[],((D=function(se,K){return null==se&&(se=l),null==K&&(K=l),[(null==D.$$s?this:D.$$s).$coerce_to_int_range(se),K]}).$$s=q,D.$$arity=2,D)),_=r(a,"sort_by",[],((X=function(se,K){return null==se&&(se=l),null==K&&(K=l),se.$min()}).$$s=q,X.$$arity=2,X)),q.$assert_min_sum_is_covered(_),q.$assert_max_sum_is_covered(_),q.$assert_no_gap_or_overlap_in_ranges(_),q.items=r(_,"map",[],(te=function(se,K){return null==se&&(se=l),null==K&&(K=l),Y($,"Item").$new(se,K.$freeze()).$freeze()},te.$$s=q,te.$$arity=2,te)).$freeze(),q},x.$$arity=1),e.def(U,"$coerce_to_int_range",u=function(P){var X,te=l;return X=P,Y($,"Integer")["$==="](X)?Y($,"Range").$new(P,P):Y($,"Range")["$==="](X)&&le(le(te=P.$begin()["$is_a?"](Y($,"Integer")))?P.$end()["$is_a?"](Y($,"Integer")):te)?P:this.$raise(Y($,"TypeError"),this.name+": "+P+" ("+P.$class()+") must be an Integer or a Range with Integers ")},u.$$arity=1),e.def(U,"$assert_min_sum_is_covered",E=function(P){var X,D=this,te=l;return X=D.num_of_dice,te=P.$first()["$[]"](0),le(te["$include?"](X))||D.$raise(Y($,"RangeError"),D.name+": min value ("+X+") is not covered: "+te),D},E.$$arity=1),e.def(U,"$assert_max_sum_is_covered",N=function(P){var X,D=this,te=l;return X=function(v,k){return"number"==typeof v&&"number"==typeof k?v*k:v["$*"](k)}(D.num_of_dice,D.num_of_sides),te=P.$last()["$[]"](0),le(te["$include?"](X))||D.$raise(Y($,"RangeError"),D.name+": max value ("+X+") is not covered: "+te),D},N.$$arity=1),void e.def(U,"$assert_no_gap_or_overlap_in_ranges",_e=function(P){var D;return r(P,"each_cons",[2],((D=function(q,a){var K,M,v,_=null==D.$$s?this:D.$$s,C=l,se=l;return null==_.name&&(_.name=l),null==q&&(q=l),null==a&&(a=l),C=q["$[]"](0),se=a["$[]"](0),M="number"==typeof(v=K=C.$max())?v+1:v["$+"](1),le(se["$include?"](K))&&_.$raise(Y($,"RangeError"),_.name+": Range overlap: "+C+" and "+se),le(se["$include?"](M))?l:_.$raise(Y($,"RangeError"),_.name+": Range gap: "+C+" and "+se)}).$$s=this,D.$$arity=2,D)),this},_e.$$arity=1)},function(e){function ae(w,c){return"number"==typeof w&&"number"==typeof c?w*c:w["$*"](c)}function fe(w,c){return"number"==typeof w&&"number"==typeof c?w+c:w["$+"](c)}function T(w,c){return"number"==typeof w&&"number"==typeof c?w>c:w["$>"](c)}function t(w,c){return"number"==typeof w&&"number"==typeof c?w>=c:w["$>="](c)}function l(w,c){return"number"==typeof w&&"number"==typeof c?w-c:w["$-"](c)}var c,U,m,A,I,E,N,_e,G,P,D,X,te,q,a,_,C,se,j,p,o,x,u,R,H,we=e.top,Y=[],i=e.nil,z=e.$$$,r=e.$$,le=e.module,v=e.klass,k=e.truthy,ve=e.hash2,h=e.send,L=e.range,de=e.hash;we.$require("bcdice/format"),we.$require("bcdice/command/parser"),we.$require("bcdice/dice_table/table"),we.$require("bcdice/dice_table/range_table"),c=Y,U=H=[le(Y[0],"BCDice")].concat(c),m=(R=[le(H[0],"GameSystem")].concat(U))[0],A=r(R,"Base"),I=R,x=v(m,A,"BattleTech"),u=[x].concat(I),x.$$prototype.randomizer=i,e.const_set(u[0],"ID","BattleTech"),e.const_set(u[0],"NAME","\u30d0\u30c8\u30eb\u30c6\u30c3\u30af"),e.const_set(u[0],"SORT_KEY","\u306f\u3068\u308b\u3066\u3064\u304f"),e.const_set(u[0],"HELP_MESSAGE","\u30fb\u5224\u5b9a\u65b9\u6cd5\n\u3000(\u56de\u6570)BT(\u30c0\u30e1\u30fc\u30b8)(\u90e8\u4f4d)+(\u57fa\u672c\u5024)>=(\u76ee\u6a19\u5024)\n\u3000\u56de\u6570\u306f\u7701\u7565\u6642 1\u56fa\u5b9a\u3002\n\u3000\u90e8\u4f4d\u306fC\uff08\u6b63\u9762\uff09R\uff08\u53f3\uff09\u3001L\uff08\u5de6\uff09\u3002\u7701\u7565\u6642\u306fC\uff08\u6b63\u9762\uff09\u56fa\u5b9a\n\u3000U\uff08\u4e0a\u534a\u8eab\uff09\u3001L\uff08\u4e0b\u534a\u8eab\uff09\u3092\u7d44\u307f\u5408\u308f\u305b CU/RU/LU/CL/RL/LL\u3082\u6307\u5b9a\u53ef\u80fd\n\u3000\u4f8b\uff09BT3+2>=4\n\u3000\u3000\u6b63\u9762\u304b\u3089\u30c0\u30e1\u30fc\u30b83\u306e\u653b\u6483\u3092\u6280\u80fd\u30d9\u30fc\u30b92\u76ee\u6a19\u50244\u30671\u56de\u5224\u5b9a\n\u3000\u4f8b\uff092BT3RL+5>=8\n\u3000\u3000\u53f3\u4e0b\u534a\u8eab\u306b\u30c0\u30e1\u30fc\u30b83\u306e\u653b\u6483\u3092\u6280\u80fd\u30d9\u30fc\u30b95\u76ee\u6a19\u50248\u30672\u56de\u5224\u5b9a\n\u3000\u30df\u30b5\u30a4\u30eb\u306b\u3088\u308b\u30c0\u30e1\u30fc\u30b8\u306f BT(\u30c0\u30e1\u30fc\u30b8) \u306e\u4ee3\u308f\u308a\u306b SRM2/4/6, LRM5/10/15/20 \u3092\u6307\u5b9a\n\u3000\u4f8b\uff093SRM6LU+5>=8\n\u3000\u3000\u5de6\u4e0a\u534a\u8eab\u306bSRM6\u9023\u3092\u6280\u80fd\u30d9\u30fc\u30b95\u76ee\u6a19\u50248\u30673\u56de\u5224\u5b9a\n BT(\u30c0\u30e1\u30fc\u30b8) \u306e\u4ee3\u308f\u308a\u306b PPC \u3092\u6307\u5b9a\u3059\u308b\u3068\u30c0\u30e1\u30fc\u30b810\u3067\u5224\u5b9a\n \u4f8b\uff092PPCR+3>=10\n \u3000\u53f3\u5074\u304b\u3089PPC\uff08\u30c0\u30e1\u30fc\u30b810\uff09\u306b\u3088\u308b\u653b\u6483\u3092\u6280\u80fd\u30d9\u30fc\u30b93\u76ee\u6a19\u502410\u30672\u56de\u5224\u5b9a\n\u30fbCT\uff1a\u81f4\u547d\u7684\u547d\u4e2d\u8868\n\u30fbDW\uff1a\u8ee2\u5012\u5f8c\u306e\u5411\u304d\u8868\n\u30fbCDx\uff1a\u30e1\u30c3\u30af\u6226\u58eb\u610f\u8b58\u7dad\u6301\u30ed\u30fc\u30eb\u3002\u30c0\u30e1\u30fc\u30b8\u5024x\uff081\u301c6\uff09\u3067\u5224\u5b9a\u3000\u4f8b\uff09CD3\n"),x.$register_prefix("\\d*SRM","\\d*LRM","\\d*BT","\\d*PPC","CT","DW","CD"),e.const_set(u[0],"NO_CRITICAL_HIT_LIMIT",7),e.defs(x,"$ppc_parser",E=function(){var M=this;return null==M.ppc_parser&&(M.ppc_parser=i),k(M.ppc_parser)||(M.ppc_parser=z(r(u,"Command"),"Parser").$new(/PPC(?:[LCR][LU]?)?/,ve(["round_type"],{round_type:z(r(u,"RoundType"),"FLOOR")})),M.ppc_parser.$enable_prefix_number(),M.ppc_parser.$restrict_cmp_op_to(">=")),M.ppc_parser},E.$$arity=0),e.def(x,"$ppc_parser",N=function(){return this.$class().$ppc_parser()},N.$$arity=0),e.def(x,"$eval_game_system_specific_command",_e=function(M){var j=this,p=i,o=i,ee=i,Q=i,ge=i,F=i,f=i,B=i,n=i;try{return p=j.$roll_tables(M,r(u,"TABLES")),k(p)?p:k(o=j.$ppc_parser().$parse(M))?j.$execute_ppc(o):(ee=1,k(M["$=~"](/^(\d+)(.+)/))&&(ee=r(u,"Regexp").$last_match(1).$to_i(),M=r(u,"Regexp").$last_match(2)),j.$debug("executeCommandCatched count",ee),j.$debug("executeCommandCatched command",M),/^CD([1-6])$/["$==="](Q=M)?(ge=r(u,"Regexp").$last_match(1).$to_i(),j.$consciousness_roll(ge)):/^((S|L)RM\d+)(.+)/["$==="](Q)?(F=r(u,"Regexp").$last_match(3),f=r(u,"Regexp").$last_match(1),B=h(j,"lambda",[],($$4=function(S){function b(){return S.apply(this,arguments)}return b.toString=function(){return S.toString()},b}(function(){return(null==$$4.$$s?this:$$4.$$s).$getXrmDamage(f)}),$$4.$$s=j,$$4.$$arity=0,$$4)),j.$getHitResult(ee,B,F)):/^BT(\d+)(.+)/["$==="](Q)?(j.$debug("BT pattern"),F=r(u,"Regexp").$last_match(2),n=r(u,"Regexp").$last_match(1).$to_i(),B=h(j,"lambda",[],($$5=function(S){function b(){return S.apply(this,arguments)}return b.toString=function(){return S.toString()},b}(function(){return null==$$5.$$s||$$5,n}),$$5.$$s=j,$$5.$$arity=0,$$5)),j.$getHitResult(ee,B,F)):i)}catch(S){if(!e.rescue(S,[r(u,"UnknownXRMError")]))throw S;try{return i}finally{e.pop_exception()}}},_e.$$arity=1),function(K,M,j){[v(K,M,"UnknownXRMError")].concat(j)}(u[0],r(u,"StandardError"),u),e.def(x,"$getXrmDamage",G=function(M){var ee,Q,o=i;return k(r(u,"XRM_DAMAGE_TABLES")["$key?"](M))||this.$raise(r(u,"UnknownXRMError"),"unknown XRM: "+M),o=r(u,"XRM_DAMAGE_TABLES")["$[]"](M).$roll(this.randomizer),ee=M["$start_with?"]("L"),Q=o.$content(),[k(ee)?Q:ae(2,Q),o.$sum(),ee]},G.$$arity=1),e.const_set(u[0],"LRM_LIMIT",5),e.def(x,"$getHitResult",P=function(M,j,p){var o,Q=i,ge=i,F=i,f=i,B=i,n=i,S=i,b=i,y=i,ue=i,ce=i,me=i,ke=i,ye=i;return Q=/^([LCR][LU]?)?(\+\d+)?>=(\d+)/.$match(p),k(Q)?(ge=k(F=Q["$[]"](1))?F:"C",f=Q["$[]"](2),B=Q["$[]"](3).$to_i(),n=this.$getBaseValue(f),this.$debug("side, base, target",ge,n,B),S=z(r(u,"HitPart"),"TABLES")["$[]"](ge),b=[],y=ve([],{}),ue=0,h(M,"times",[],((o=function(){var he,ne,pe=null==o.$$s?this:o.$$s,V=i;return ne=pe.$getHitText(n,B),V=null==(he=e.to_ary(ne))[1]?i:he[1],k(null==he[0]?i:he[0])&&(ue=fe(ue,1),ne=pe.$getDamages(j,S,y),he=e.to_ary(ne),y=null==he[0]?i:he[0],V=fe(V,null==he[1]?i:he[1])),b["$<<"](V)}).$$s=this,o.$$arity=0,o)),ce=T(ue,0),me=" \uff1e "+ue+"\u56de\u547d\u4e2d",ke=k(ce)?me+" \u547d\u4e2d\u7b87\u6240\uff1a"+this.$getTotalDamage(y):me,b.$push(ke),ye=b.$join("\n"),k(ce)?r(u,"Result").$success(ye):r(u,"Result").$failure(ye)):i},P.$$arity=3),e.def(x,"$getBaseValue",D=function(M){var p=i;return p=0,k(M["$nil?"]())||(p=r(u,"ArithmeticEvaluator").$eval(M)),p},D.$$arity=1),e.def(x,"$getHitText",X=function(M,j){var o,ee,Q,ge,f=i;return ge=t(Q=fe(fe(o=this.randomizer.$roll_once(6),ee=this.randomizer.$roll_once(6)),M),j),f=Q+"["+o+","+ee+(k(T(M,0))?"+"+M:"")+"]>="+j+" \uff1e ",[ge,f=k(ge)?fe(f,"\u547d\u4e2d \uff1e "):fe(f,"\u5916\u308c")]},X.$$arity=2),e.def(x,"$getDamages",te=function(M,j,p){var o,ee,Q,f,B,n,F=i,S=i;return F="",ee=M.$call(),o=e.to_ary(ee),f=null==o[0]?i:o[0],B=null==o[1]?i:o[1],S=1,k(n=null==o[2]?i:o[2])&&(S=function(w,c){return"number"==typeof w&&"number"==typeof c?w/c:w["$/"](c)}(ae(1,f),r(u,"LRM_LIMIT")).$ceil(),F=fe(F,"["+B+"] "+f+"\u70b9")),h(S,"times",[],((Q=function(y){var ce,me,ke,Pe,pe,ue=null==Q.$$s?this:Q.$$s,he=i,ne=i;return null==y&&(y=i),me=ue.$getDamageInfo(B,f,n,y),ke=null==(ce=e.to_ary(me))[0]?i:ce[0],me=ue.$getHitResultOne(null==ce[1]?i:ce[1],j),Pe=null==(ce=e.to_ary(me))[0]?i:ce[0],pe=null==ce[1]?i:ce[1],he=null==ce[2]?i:ce[2],k(n)&&(F=fe(F," ")),F=fe(F,Pe),k(p["$[]"](pe)["$nil?"]())&&(ne=[pe,ve(["partDamages","criticals"],{partDamages:[],criticals:[]})],h(p,"[]=",e.to_a(ne)),l(ne.length,1)),p["$[]"](pe)["$[]"]("partDamages")["$<<"](ke),k(he["$empty?"]())?i:p["$[]"](pe)["$[]"]("criticals")["$<<"](he)}).$$s=this,Q.$$arity=1,Q)),[p,F]},te.$$arity=3),e.def(x,"$getDamageInfo",q=function(M,j,p,o){var Q=i;return k(M["$nil?"]())?[j,j.$to_s()]:k(p)?(Q=l(j,ae(r(u,"LRM_LIMIT"),o)),k(T(Q,r(u,"LRM_LIMIT")))&&(Q=r(u,"LRM_LIMIT")),[Q,Q.$to_s()]):[j,"["+M+"] "+j]},q.$$arity=4),e.def(x,"$getTotalDamage",a=function(M){var j,ee=i,Q=i;return ee=0,Q=[],h(["\u982d","\u80f4\u4e2d\u592e","\u53f3\u80f4","\u5de6\u80f4","\u53f3\u811a","\u5de6\u811a","\u53f3\u8155","\u5de6\u8155"],"each",[],((j=function(f){var n,B=null==j.$$s?this:j.$$s,S=i,b=i,y=i,ue=i,ce=i;return null==f&&(f=i),S=M.$delete(f),k(S["$nil?"]())?i:(b=h(S["$[]"]("partDamages"),"inject",[0],((n=function(ke,ye){return null==ke&&(ke=i),null==ye&&(ye=i),fe(ke,ye)}).$$s=B,n.$$arity=2,n)),ee=fe(ee,b),y=S["$[]"]("partDamages").$size(),ue=S["$[]"]("criticals"),ce=fe(ce="",f+"("+y+"\u56de) "+b+"\u70b9"),k(ue["$empty?"]())||(ce=fe(ce," "+ue.$join(" "))),Q["$<<"](ce))}).$$s=this,j.$$arity=1,j)),k(M["$empty?"]())||this.$raise("damages rest!! "+M.$inspect()),fe(Q.$join(" \uff0f ")," \uff1e \u5408\u8a08\u30c0\u30e1\u30fc\u30b8 "+ee+"\u70b9")},a.$$arity=1),e.def(x,"$getHitResultOne",_=function(M,j){var Q,o=i,ee=i,ge=i,F=i,f=i;return ee=(o=j.$roll(this.randomizer)).$content(),Q=k(ee.$critical_hit_may_occur())?"\uff08\u81f4\u547d\u7684\u547d\u4e2d\uff09":"",ge=[["["+o.$sum()+"]",""+ee.$name()+Q,M+"\u70b9"].$join(" ")],F="",k(ee.$critical_hit_may_occur())&&(f=r(u,"TABLES")["$[]"]("CT").$roll(this.randomizer),k(T(f.$sum(),r(u,"NO_CRITICAL_HIT_LIMIT")))&&(F=f.$content()),ge.$push("["+f.$sum()+"] "+f.$content())),[ge.$join(" \uff1e "),ee.$name(),F]},_.$$arity=2),e.def(x,"$consciousness_roll",C=function(M){var p=i,ee=i,Q=i,ge=i,F=i,B=i,n=i,y=i;return k(L(1,6,!1)["$include?"](M))?(p="CD"+M,M["$=="](6)?r(u,"Result").$fumble(p+" \uff1e \u6b7b\u4ea1"):(Q="(2D6>="+(ee=de(1,3,2,5,3,7,4,10,5,11)["$[]"](M))+")",B=(F=(ge=this.randomizer.$roll_barabara(2,6)).$sum())+"["+ge.$join(",")+"]",n=t(F,ee),y=[p,Q,B,F,k(n)?"\u6210\u529f":"\u5931\u6557"].$join(" \uff1e "),k(n)?r(u,"Result").$success(y):r(u,"Result").$failure(y))):i},C.$$arity=1),e.def(x,"$execute_ppc",se=function(M){var p,F,o,j=this;return p=k(o=M.$prefix_number())?o:1,F=""+M.$command()["$[]"](L(3,-1,!1))+r(u,"Format").$modifier(M.$modify_number())+">="+M.$target_number(),j.$getHitResult(p,h(j,"lambda",[],($$20=function(f){function B(){return f.apply(this,arguments)}return B.toString=function(){return f.toString()},B}(function(){return null==$$20.$$s||$$20,10}),$$20.$$s=j,$$20.$$arity=0,$$20)),F)},se.$$arity=1),e.const_set(u[0],"TABLES",ve(["CT","DW"],{CT:z(r(u,"DiceTable"),"RangeTable").$new("\u81f4\u547d\u7684\u547d\u4e2d\u8868","2D6",[[e.Range.$new(2,r(u,"NO_CRITICAL_HIT_LIMIT"),!1),"\u81f4\u547d\u7684\u547d\u4e2d\u306f\u306a\u304b\u3063\u305f"],[L(8,9,!1),"1\u7b87\u6240\u306e\u81f4\u547d\u7684\u547d\u4e2d"],[L(10,11,!1),"2\u7b87\u6240\u306e\u81f4\u547d\u7684\u547d\u4e2d"],[12,"\u305d\u306e\u90e8\u4f4d\u304c\u5439\u304d\u98db\u3076\uff08\u8155\u3001\u811a\u3001\u982d\uff09\u307e\u305f\u306f3\u7b87\u6240\u306e\u81f4\u547d\u7684\u547d\u4e2d\uff08\u80f4\uff09"]]),DW:z(r(u,"DiceTable"),"Table").$new("\u8ee2\u5012\u5f8c\u306e\u5411\u304d\u8868","1D6",["\u540c\u3058\uff08\u524d\u9762\u304b\u3089\u8ee2\u5012\uff09 \u6b63\u9762\uff0f\u80cc\u9762","1\u30d8\u30af\u30b9\u30b5\u30a4\u30c9\u53f3\uff08\u5074\u9762\u304b\u3089\u8ee2\u5012\uff09 \u53f3\u5074\u9762","2\u30d8\u30af\u30b9\u30b5\u30a4\u30c9\u53f3\uff08\u5074\u9762\u304b\u3089\u8ee2\u5012\uff09 \u53f3\u5074\u9762","180\u5ea6\u9006\uff08\u80cc\u9762\u304b\u3089\u8ee2\u5012\uff09 \u6b63\u9762\uff0f\u80cc\u9762","2\u30d8\u30af\u30b9\u30b5\u30a4\u30c9\u5de6\uff08\u5074\u9762\u304b\u3089\u8ee2\u5012\uff09 \u5de6\u5074\u9762","1\u30d8\u30af\u30b9\u30b5\u30a4\u30c9\u5de6\uff08\u5074\u9762\u304b\u3089\u8ee2\u5012\uff09 \u5de6\u5074\u9762"])}).$freeze()),e.const_set(u[0],"HitPart",r(u,"Struct").$new("name","critical_hit_may_occur")),j=u,o=[p=v(u[0],null,"HitPart")].concat(j),e.const_set(o[0],"LEFT_TORSO","\u5de6\u80f4"),e.const_set(o[0],"CENTER_TORSO","\u80f4\u4e2d\u592e"),e.const_set(o[0],"RIGHT_TORSO","\u53f3\u80f4"),e.const_set(o[0],"LEFT_ARM","\u5de6\u8155"),e.const_set(o[0],"RIGHT_ARM","\u53f3\u8155"),e.const_set(o[0],"LEFT_LEG","\u5de6\u811a"),e.const_set(o[0],"RIGHT_LEG","\u53f3\u811a"),e.const_set(o[0],"HEAD","\u982d"),e.const_set(o[0],"TABLES",ve(["L","C","R","LU","CU","RU","LL","CL","RL"],{L:z(r(o,"DiceTable"),"RangeTable").$new("\u547d\u4e2d\u90e8\u4f4d\u8868\uff08\u5de6\uff09","2D6",[[2,p.$new(r(o,"LEFT_TORSO"),!0)],[3,p.$new(r(o,"LEFT_LEG"),!1)],[L(4,5,!1),p.$new(r(o,"LEFT_ARM"),!1)],[6,p.$new(r(o,"LEFT_LEG"),!1)],[7,p.$new(r(o,"LEFT_TORSO"),!1)],[8,p.$new(r(o,"CENTER_TORSO"),!1)],[9,p.$new(r(o,"RIGHT_TORSO"),!1)],[10,p.$new(r(o,"RIGHT_ARM"),!1)],[11,p.$new(r(o,"RIGHT_LEG"),!1)],[12,p.$new(r(o,"HEAD"),!1)]]),C:z(r(o,"DiceTable"),"RangeTable").$new("\u547d\u4e2d\u90e8\u4f4d\u8868\uff08\u6b63\u9762\uff09","2D6",[[2,p.$new(r(o,"CENTER_TORSO"),!0)],[L(3,4,!1),p.$new(r(o,"RIGHT_ARM"),!1)],[5,p.$new(r(o,"RIGHT_LEG"),!1)],[6,p.$new(r(o,"RIGHT_TORSO"),!1)],[7,p.$new(r(o,"CENTER_TORSO"),!1)],[8,p.$new(r(o,"LEFT_TORSO"),!1)],[9,p.$new(r(o,"LEFT_LEG"),!1)],[L(10,11,!1),p.$new(r(o,"LEFT_ARM"),!1)],[12,p.$new(r(o,"HEAD"),!1)]]),R:z(r(o,"DiceTable"),"RangeTable").$new("\u547d\u4e2d\u90e8\u4f4d\u8868\uff08\u53f3\uff09","2D6",[[2,p.$new(r(o,"RIGHT_TORSO"),!0)],[3,p.$new(r(o,"RIGHT_LEG"),!1)],[L(4,5,!1),p.$new(r(o,"RIGHT_ARM"),!1)],[6,p.$new(r(o,"RIGHT_LEG"),!1)],[7,p.$new(r(o,"RIGHT_TORSO"),!1)],[8,p.$new(r(o,"CENTER_TORSO"),!1)],[9,p.$new(r(o,"LEFT_TORSO"),!1)],[10,p.$new(r(o,"LEFT_ARM"),!1)],[11,p.$new(r(o,"LEFT_LEG"),!1)],[12,p.$new(r(o,"HEAD"),!1)]]),LU:z(r(o,"DiceTable"),"RangeTable").$new("\u547d\u4e2d\u90e8\u4f4d\u8868\uff08\u5de6\u4e0a\u534a\u8eab\uff09","1D6",[[L(1,2,!1),p.$new(r(o,"LEFT_TORSO"),!1)],[3,p.$new(r(o,"CENTER_TORSO"),!1)],[L(4,5,!1),p.$new(r(o,"LEFT_ARM"),!1)],[6,p.$new(r(o,"HEAD"),!1)]]),CU:z(r(o,"DiceTable"),"RangeTable").$new("\u547d\u4e2d\u90e8\u4f4d\u8868\uff08\u6b63\u9762\u4e0a\u534a\u8eab\uff09","1D6",[[1,p.$new(r(o,"LEFT_ARM"),!1)],[2,p.$new(r(o,"LEFT_TORSO"),!1)],[3,p.$new(r(o,"CENTER_TORSO"),!1)],[4,p.$new(r(o,"RIGHT_TORSO"),!1)],[5,p.$new(r(o,"RIGHT_ARM"),!1)],[6,p.$new(r(o,"HEAD"),!1)]]),RU:z(r(o,"DiceTable"),"RangeTable").$new("\u547d\u4e2d\u90e8\u4f4d\u8868\uff08\u53f3\u4e0a\u534a\u8eab\uff09","1D6",[[L(1,2,!1),p.$new(r(o,"RIGHT_TORSO"),!1)],[3,p.$new(r(o,"CENTER_TORSO"),!1)],[L(4,5,!1),p.$new(r(o,"RIGHT_ARM"),!1)],[6,p.$new(r(o,"HEAD"),!1)]]),LL:z(r(o,"DiceTable"),"RangeTable").$new("\u547d\u4e2d\u90e8\u4f4d\u8868\uff08\u5de6\u4e0b\u534a\u8eab\uff09","1D6",[[L(1,6,!1),p.$new(r(o,"LEFT_LEG"),!1)]]),CL:z(r(o,"DiceTable"),"RangeTable").$new("\u547d\u4e2d\u90e8\u4f4d\u8868\uff08\u53f3\u4e0b\u534a\u8eab\uff09","1D6",[[L(1,3,!1),p.$new(r(o,"RIGHT_LEG"),!1)],[L(4,6,!1),p.$new(r(o,"LEFT_LEG"),!1)]]),RL:z(r(o,"DiceTable"),"RangeTable").$new("\u547d\u4e2d\u90e8\u4f4d\u8868\uff08\u53f3\u4e0b\u534a\u8eab\uff09","1D6",[[L(1,6,!1),p.$new(r(o,"RIGHT_LEG"),!1)]])}).$freeze()),e.const_set(u[0],"XRM_DAMAGE_TABLES",ve(["SRM2","SRM4","SRM6","LRM5","LRM10","LRM15","LRM20"],{SRM2:z(r(u,"DiceTable"),"RangeTable").$new("SRM2\u30c0\u30e1\u30fc\u30b8\u8868","2D6",[[L(2,7,!1),1],[L(8,12,!1),2]]),SRM4:z(r(u,"DiceTable"),"RangeTable").$new("SRM4\u30c0\u30e1\u30fc\u30b8\u8868","2D6",[[2,1],[L(3,6,!1),2],[L(7,10,!1),3],[L(11,12,!1),4]]),SRM6:z(r(u,"DiceTable"),"RangeTable").$new("SRM6\u30c0\u30e1\u30fc\u30b8\u8868","2D6",[[L(2,3,!1),2],[L(4,5,!1),3],[L(6,8,!1),4],[L(9,10,!1),5],[L(11,12,!1),6]]),LRM5:z(r(u,"DiceTable"),"RangeTable").$new("LRM5\u30c0\u30e1\u30fc\u30b8\u8868","2D6",[[2,1],[L(3,4,!1),2],[L(5,8,!1),3],[L(9,10,!1),4],[L(11,12,!1),5]]),LRM10:z(r(u,"DiceTable"),"RangeTable").$new("LRM10\u30c0\u30e1\u30fc\u30b8\u8868","2D6",[[L(2,3,!1),3],[4,4],[L(5,8,!1),6],[L(9,10,!1),8],[L(11,12,!1),10]]),LRM15:z(r(u,"DiceTable"),"RangeTable").$new("LRM15\u30c0\u30e1\u30fc\u30b8\u8868","2D6",[[L(2,3,!1),5],[4,6],[L(5,8,!1),9],[L(9,10,!1),12],[L(11,12,!1),15]]),LRM20:z(r(u,"DiceTable"),"RangeTable").$new("LRM20\u30c0\u30e1\u30fc\u30b8\u8868","2D6",[[L(2,3,!1),6],[4,9],[L(5,8,!1),12],[L(9,10,!1),16],[L(11,12,!1),20]])}).$freeze())}(Opal)}}]);