```
build(go): 升级 Go 版本至 1.20 并更新依赖包 将项目 Go 版本从 1.18 升级至 1.20,并同步更新了相关模块依赖。 同时替换 decimal 库为 alpacadecimal,以提升数值计算精度和性能。 - 升级 Go 模块版本 - 替换 github.com/govalues/decimal 为 github.com/alpacahq/alpacadecimal - 更新多个间接依赖包版本 - 调整相关代码中 decimal
This commit is contained in:
@@ -1,19 +1,39 @@
|
||||
module blazing/cool
|
||||
|
||||
go 1.18
|
||||
go 1.20
|
||||
|
||||
require (
|
||||
github.com/gogf/gf/v2 v2.8.0
|
||||
github.com/golang-jwt/jwt/v4 v4.5.0
|
||||
github.com/zmexing/go-sensitive-word v1.3.4
|
||||
gorm.io/gorm v1.25.7
|
||||
)
|
||||
|
||||
require (
|
||||
github.com/andybalholm/brotli v1.1.0 // indirect
|
||||
github.com/antlabs/stl v0.0.2 // indirect
|
||||
github.com/antlabs/timer v0.1.4 // indirect
|
||||
github.com/cloudflare/circl v1.3.7 // indirect
|
||||
github.com/emirpasic/gods v1.18.1 // indirect
|
||||
github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 // indirect
|
||||
github.com/google/pprof v0.0.0-20240227163752-401108e1b7e7 // indirect
|
||||
github.com/hashicorp/errwrap v1.1.0 // indirect
|
||||
github.com/hashicorp/go-multierror v1.1.1 // indirect
|
||||
github.com/imroc/req/v3 v3.43.3 // indirect
|
||||
github.com/klauspost/compress v1.17.7 // indirect
|
||||
github.com/onsi/ginkgo/v2 v2.16.0 // indirect
|
||||
github.com/orcaman/concurrent-map/v2 v2.0.1 // indirect
|
||||
github.com/quic-go/qpack v0.4.0 // indirect
|
||||
github.com/quic-go/quic-go v0.41.0 // indirect
|
||||
github.com/refraction-networking/utls v1.6.3 // indirect
|
||||
github.com/rogpeppe/go-internal v1.11.0 // indirect
|
||||
github.com/stretchr/testify v1.11.1 // indirect
|
||||
go.opentelemetry.io/otel/metric v1.24.0 // indirect
|
||||
go.uber.org/mock v0.4.0 // indirect
|
||||
golang.org/x/crypto v0.31.0 // indirect
|
||||
golang.org/x/exp v0.0.0-20240222234643-814bf88cf225 // indirect
|
||||
golang.org/x/mod v0.17.0 // indirect
|
||||
golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d // indirect
|
||||
)
|
||||
|
||||
require (
|
||||
@@ -24,7 +44,7 @@ require (
|
||||
github.com/fsnotify/fsnotify v1.7.0 // indirect
|
||||
github.com/go-logr/logr v1.4.2 // indirect
|
||||
github.com/go-logr/stdr v1.2.2 // indirect
|
||||
github.com/gorilla/websocket v1.5.1 // indirect
|
||||
github.com/gorilla/websocket v1.5.3 // indirect
|
||||
github.com/grokify/html-strip-tags-go v0.1.0 // indirect
|
||||
github.com/jinzhu/inflection v1.0.0 // indirect
|
||||
github.com/jinzhu/now v1.1.5 // indirect
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
github.com/BurntSushi/toml v1.4.0 h1:kuoIxZQy2WRRk1pttg9asf+WVv6tWQuBNVmK8+nqPr0=
|
||||
github.com/BurntSushi/toml v1.4.0/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho=
|
||||
github.com/andybalholm/brotli v1.1.0 h1:eLKJA0d02Lf0mVpIDgYnqXcUn0GqVmEFny3VuID1U3M=
|
||||
github.com/andybalholm/brotli v1.1.0/go.mod h1:sms7XGricyQI9K10gOSf56VKKWS4oLer58Q+mhRPtnY=
|
||||
github.com/antlabs/cronex v0.0.5 h1:n8vE2QVNc7ghd3NZpcC0OpLFtJZcNCgtDNwwA354has=
|
||||
github.com/antlabs/cronex v0.0.5/go.mod h1:g0KFeHNmsKMC6zhpiHKQcdSat93uAg5iIIrmncalyn8=
|
||||
github.com/antlabs/stl v0.0.2 h1:sna1AXR5yIkNE9lWhCcKbheFJSVfCa3vugnGyakI79s=
|
||||
@@ -7,29 +10,55 @@ github.com/antlabs/timer v0.1.4 h1:MHdE00MDnNfhJCmqSOdLXs35uGNwfkMwfbynxrGmQ1c=
|
||||
github.com/antlabs/timer v0.1.4/go.mod h1:mpw4zlD5KVjstEyUDp43DGLWsY076Mdo4bS78NTseRE=
|
||||
github.com/clbanning/mxj/v2 v2.7.0 h1:WA/La7UGCanFe5NpHF0Q3DNtnCsVoxbPKuyBNHWRyME=
|
||||
github.com/clbanning/mxj/v2 v2.7.0/go.mod h1:hNiWqW14h+kc+MdF9C6/YoRfjEJoR3ou6tn/Qo+ve2s=
|
||||
github.com/cloudflare/circl v1.3.7 h1:qlCDlTPz2n9fu58M0Nh1J/JzcFpfgkFHHX3O35r5vcU=
|
||||
github.com/cloudflare/circl v1.3.7/go.mod h1:sRTcRWXGLrKw6yIGJ+l7amYJFfAXbZG0kBSc8r4zxgA=
|
||||
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
|
||||
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
|
||||
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/emirpasic/gods v1.18.1 h1:FXtiHYKDGKCW2KzwZKx0iC0PQmdlorYgdFG9jPXJ1Bc=
|
||||
github.com/emirpasic/gods v1.18.1/go.mod h1:8tpGGwCnJ5H4r6BWwaV6OrWmMoPhUl5jm/FMNAnJvWQ=
|
||||
github.com/fatih/color v1.18.0 h1:S8gINlzdQ840/4pfAwic/ZE0djQEH3wM94VfqLTZcOM=
|
||||
github.com/fatih/color v1.18.0/go.mod h1:4FelSpRwEGDpQ12mAdzqdOukCy4u8WUtOY6lkT/6HfU=
|
||||
github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA=
|
||||
github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM=
|
||||
github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=
|
||||
github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY=
|
||||
github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
|
||||
github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=
|
||||
github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE=
|
||||
|
||||
github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 h1:tfuBGBXKqDEevZMzYi5KSi8KkcZtzBcTgAUUtapy0OI=
|
||||
github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572/go.mod h1:9Pwr4B2jHnOSGXyyzV8ROjYa2ojvAY6HCGYYfMoC3Ls=
|
||||
github.com/gogf/gf/v2 v2.8.0 h1:CgNDoLFQCBxQaWOoGMzgU068T+tm0t/eNUgLV2wPJag=
|
||||
github.com/gogf/gf/v2 v2.8.0/go.mod h1:6iYuZZ+A0ZcH8+4MDS/P0SvTPCvKzRvyAsY1kbkJYJc=
|
||||
github.com/golang-jwt/jwt/v4 v4.5.0 h1:7cYmW1XlMY7h7ii7UhUyChSgS5wUJEnm9uZVTGqOWzg=
|
||||
github.com/golang-jwt/jwt/v4 v4.5.0/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0=
|
||||
github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg=
|
||||
github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
|
||||
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
|
||||
github.com/gorilla/websocket v1.5.1 h1:gmztn0JnHVt9JZquRuzLw3g4wouNVzKL15iLr/zn/QY=
|
||||
github.com/gorilla/websocket v1.5.1/go.mod h1:x3kM2JMyaluk02fnUJpQuwD2dCS5NDG2ZHL0uE0tcaY=
|
||||
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
|
||||
github.com/google/pprof v0.0.0-20240227163752-401108e1b7e7 h1:y3N7Bm7Y9/CtpiVkw/ZWj6lSlDF3F74SfKwfTCer72Q=
|
||||
github.com/google/pprof v0.0.0-20240227163752-401108e1b7e7/go.mod h1:czg5+yv1E0ZGTi6S6vVK1mke0fV+FaUhNGcd6VRS9Ik=
|
||||
github.com/gorilla/websocket v1.5.3 h1:saDtZ6Pbx/0u+bgYQ3q96pZgCzfhKXGPqt7kZ72aNNg=
|
||||
github.com/gorilla/websocket v1.5.3/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
|
||||
github.com/grokify/html-strip-tags-go v0.1.0 h1:03UrQLjAny8xci+R+qjCce/MYnpNXCtgzltlQbOBae4=
|
||||
github.com/grokify/html-strip-tags-go v0.1.0/go.mod h1:ZdzgfHEzAfz9X6Xe5eBLVblWIxXfYSQ40S/VKrAOGpc=
|
||||
github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
|
||||
github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY2I=
|
||||
github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
|
||||
github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo=
|
||||
github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM=
|
||||
github.com/imroc/req/v3 v3.43.3 h1:WdZhpUev9THtuwEZsW2LOYacl12fm7IkB7OgACv40+k=
|
||||
github.com/imroc/req/v3 v3.43.3/go.mod h1:SQIz5iYop16MJxbo8ib+4LnostGCok8NQf8ToyQc2xA=
|
||||
github.com/jinzhu/inflection v1.0.0 h1:K317FqzuhWc8YvSVlFMCCUb36O/S9MCKRDI7QkRKD/E=
|
||||
github.com/jinzhu/inflection v1.0.0/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc=
|
||||
github.com/jinzhu/now v1.1.5 h1:/o9tlHleP7gOFmsnYNz3RGnqzefHA47wQpKrrdTIwXQ=
|
||||
github.com/jinzhu/now v1.1.5/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8=
|
||||
github.com/klauspost/compress v1.17.7 h1:ehO88t2UGzQK66LMdE8tibEd1ErmzZjNEqWkjLAKQQg=
|
||||
github.com/klauspost/compress v1.17.7/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw=
|
||||
github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
|
||||
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
|
||||
github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
|
||||
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
|
||||
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
|
||||
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
|
||||
@@ -46,12 +75,33 @@ github.com/mattn/go-runewidth v0.0.15 h1:UNAjwbU9l54TA3KzvqLGxwWjHmMgBUVhBiTjelZ
|
||||
github.com/mattn/go-runewidth v0.0.15/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w=
|
||||
github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec=
|
||||
github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY=
|
||||
github.com/onsi/ginkgo/v2 v2.16.0 h1:7q1w9frJDzninhXxjZd+Y/x54XNjG/UlRLIYPZafsPM=
|
||||
github.com/onsi/ginkgo/v2 v2.16.0/go.mod h1:llBI3WDLL9Z6taip6f33H76YcWtJv+7R3HigUjbIBOs=
|
||||
github.com/onsi/gomega v1.30.0 h1:hvMK7xYz4D3HapigLTeGdId/NcfQx1VHMJc60ew99+8=
|
||||
github.com/onsi/gomega v1.30.0/go.mod h1:9sxs+SwGrKI0+PWe4Fxa9tFQQBG5xSsSbMXOI8PPpoQ=
|
||||
github.com/orcaman/concurrent-map/v2 v2.0.1 h1:jOJ5Pg2w1oeB6PeDurIYf6k9PQ+aTITr/6lP/L/zp6c=
|
||||
github.com/orcaman/concurrent-map/v2 v2.0.1/go.mod h1:9Eq3TG2oBe5FirmYWQfYO5iH1q0Jv47PLaNK++uCdOM=
|
||||
github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA=
|
||||
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
|
||||
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||
github.com/quic-go/qpack v0.4.0 h1:Cr9BXA1sQS2SmDUWjSofMPNKmvF6IiIfDRmgU0w1ZCo=
|
||||
github.com/quic-go/qpack v0.4.0/go.mod h1:UZVnYIfi5GRk+zI9UMaCPsmZ2xKJP7XBUvVyT1Knj9A=
|
||||
github.com/quic-go/quic-go v0.41.0 h1:aD8MmHfgqTURWNJy48IYFg2OnxwHT3JL7ahGs73lb4k=
|
||||
github.com/quic-go/quic-go v0.41.0/go.mod h1:qCkNjqczPEvgsOnxZ0eCD14lv+B2LHlFAB++CNOh9hA=
|
||||
github.com/refraction-networking/utls v1.6.3 h1:MFOfRN35sSx6K5AZNIoESsBuBxS2LCgRilRIdHb6fDc=
|
||||
github.com/refraction-networking/utls v1.6.3/go.mod h1:yil9+7qSl+gBwJqztoQseO6Pr3h62pQoY1lXiNR/FPs=
|
||||
github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
|
||||
github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ=
|
||||
github.com/rivo/uniseg v0.4.7/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88=
|
||||
github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs=
|
||||
github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M=
|
||||
github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA=
|
||||
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
||||
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||
github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U=
|
||||
github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U=
|
||||
github.com/zmexing/go-sensitive-word v1.3.4 h1:Ke/e4s++UUhxQRftZ33hgxM8CKHJ8DhfC50/U4vDmjY=
|
||||
github.com/zmexing/go-sensitive-word v1.3.4/go.mod h1:wkNIpkq1iPOe3l7l83zvnnV5mm20jfj2x8V8kjOTsUM=
|
||||
go.opentelemetry.io/otel v1.24.0 h1:0LAOdjNmQeSTzGBzduGe/rU4tZhMwL5rWgtp9Ku5Jfo=
|
||||
go.opentelemetry.io/otel v1.24.0/go.mod h1:W7b9Ozg4nkF5tWI5zsXkaKKDjdVjpD4oAt9Qi/MArHo=
|
||||
go.opentelemetry.io/otel/metric v1.24.0 h1:6EhoGWWK28x1fbpA4tYTOWBkPefTDQnb8WSGXlc88kI=
|
||||
@@ -60,14 +110,32 @@ go.opentelemetry.io/otel/sdk v1.24.0 h1:YMPPDNymmQN3ZgczicBY3B6sf9n62Dlj9pWD3ucg
|
||||
go.opentelemetry.io/otel/sdk v1.24.0/go.mod h1:KVrIYw6tEubO9E96HQpcmpTKDVn9gdv35HoYiQWGDFg=
|
||||
go.opentelemetry.io/otel/trace v1.24.0 h1:CsKnnL4dUAr/0llH9FKuc698G04IrpWV0MQA/Y1YELI=
|
||||
go.opentelemetry.io/otel/trace v1.24.0/go.mod h1:HPc3Xr/cOApsBI154IU0OI0HJexz+aw5uPdbs3UCjNU=
|
||||
go.uber.org/mock v0.4.0 h1:VcM4ZOtdbR4f6VXfiOpwpVJDL6lCReaZ6mw31wqh7KU=
|
||||
go.uber.org/mock v0.4.0/go.mod h1:a6FSlNadKUHUa9IP5Vyt1zh4fC7uAwxMutEAscFbkZc=
|
||||
golang.org/x/crypto v0.31.0 h1:ihbySMvVjLAeSH1IbfcRTkD/iNscyz8rGzjF/E5hV6U=
|
||||
golang.org/x/crypto v0.31.0/go.mod h1:kDsLvtWBEx7MV9tJOj9bnXsPbxwJQ6csT/x4KIN4Ssk=
|
||||
golang.org/x/exp v0.0.0-20240222234643-814bf88cf225 h1:LfspQV/FYTatPTr/3HzIcmiUFH7PGP+OQ6mgDYo3yuQ=
|
||||
golang.org/x/exp v0.0.0-20240222234643-814bf88cf225/go.mod h1:CxmFvTBINI24O/j8iY7H1xHzx2i4OsyguNBmN/uPtqc=
|
||||
golang.org/x/mod v0.17.0 h1:zY54UmvipHiNd+pm+m0x9KhZ9hl1/7QNMyxXbc6ICqA=
|
||||
golang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
|
||||
golang.org/x/net v0.33.0 h1:74SYHlV8BIgHIFC/LrYkOGIwL19eTYXQ5wc6TBuO36I=
|
||||
golang.org/x/net v0.33.0/go.mod h1:HXLR5J+9DxmrqMwG9qjGCxZ+zKXxBru04zlTvWlWuN4=
|
||||
golang.org/x/sync v0.11.0 h1:GGz8+XQP4FvTTrjZPzNKTMFtSXH80RAzG+5ghFPgK9w=
|
||||
golang.org/x/sync v0.11.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
|
||||
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.30.0 h1:QjkSwP/36a20jFYWkSue1YwXzLmsV5Gfq7Eiy72C1uc=
|
||||
golang.org/x/sys v0.30.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||
golang.org/x/text v0.22.0 h1:bofq7m3/HAFvbF51jz3Q9wLg3jkvSPuiZu/pD1XwgtM=
|
||||
golang.org/x/text v0.22.0/go.mod h1:YRoo4H8PVmsu+E3Ou7cqLVH8oXWIHVoX0jqUWALQhfY=
|
||||
golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d h1:vU5i/LfpvrRCpgM/VPfJLg5KjxD3E+hfT1SH+d9zLwg=
|
||||
golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk=
|
||||
google.golang.org/protobuf v1.28.0 h1:w43yiav+6bVFTBQFZX0r7ipe9JQ1QsbMgHwbBziscLw=
|
||||
google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
|
||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
|
||||
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
|
||||
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
|
||||
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||
gorm.io/gorm v1.25.7 h1:VsD6acwRjz2zFxGO50gPO6AkNs7KKnvfzUjHQhZDz/A=
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"blazing/modules/blazing/model"
|
||||
"blazing/modules/blazing/service"
|
||||
|
||||
"github.com/govalues/decimal"
|
||||
"github.com/alpacahq/alpacadecimal"
|
||||
)
|
||||
|
||||
func (h Controller) PetFusion(data *pet.C2S_PetFusion, c *player.Player) (result *pet.PetFusionInfo, err errorcode.ErrorCode) {
|
||||
@@ -52,9 +52,9 @@ func (h Controller) PetFusion(data *pet.C2S_PetFusion, c *player.Player) (result
|
||||
}
|
||||
|
||||
effect := int(service.NewPetFusionMaterialService().Data(data.Item1))
|
||||
dv1 := decimal.newf(2).Div(decimal.NewFromInt(3)).Mul(decimal.NewFromInt(int64(Mcatchpetinfo.Dv)))
|
||||
dv2 := decimal.NewFromInt(1).Div(decimal.NewFromInt(3)).Mul(decimal.NewFromInt(int64(Auxpetinfo.Dv)))
|
||||
dv := dv1.Add(dv2).Add(decimal.NewFromInt(1)).IntPart()
|
||||
dv1 := alpacadecimal.NewFromInt(2).Div(alpacadecimal.NewFromInt(3)).Mul(alpacadecimal.NewFromInt(int64(Mcatchpetinfo.Dv)))
|
||||
dv2 := alpacadecimal.NewFromInt(1).Div(alpacadecimal.NewFromInt(3)).Mul(alpacadecimal.NewFromInt(int64(Auxpetinfo.Dv)))
|
||||
dv := dv1.Add(dv2).Add(alpacadecimal.NewFromInt(1)).IntPart()
|
||||
r := model.GenPetInfo(resid, int(dv), int(natureId), effect, -1, 1)
|
||||
r.OldCatchTime = Mcatchpetinfo.CatchTime
|
||||
c.Service.Pet.PetAdd(r)
|
||||
|
||||
@@ -18,7 +18,8 @@ require (
|
||||
)
|
||||
|
||||
require (
|
||||
github.com/govalues/decimal v0.1.2 // indirect
|
||||
github.com/alpacahq/alpacadecimal v0.0.8 // indirect
|
||||
github.com/shopspring/decimal v1.3.1 // indirect
|
||||
github.com/valyala/fastrand v1.1.0 // indirect
|
||||
)
|
||||
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
github.com/BurntSushi/toml v1.4.0 h1:kuoIxZQy2WRRk1pttg9asf+WVv6tWQuBNVmK8+nqPr0=
|
||||
github.com/BurntSushi/toml v1.4.0/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho=
|
||||
github.com/alpacahq/alpacadecimal v0.0.8 h1:DZlC1dfZT7dX9ljDmayVVlIvYb3ljglQd/Xq64aetDk=
|
||||
github.com/alpacahq/alpacadecimal v0.0.8/go.mod h1:RGlrk0IdAzlsqnONx7wnfvhO5g/9parrcU3HELvbfSI=
|
||||
github.com/antlabs/stl v0.0.2 h1:sna1AXR5yIkNE9lWhCcKbheFJSVfCa3vugnGyakI79s=
|
||||
github.com/antlabs/stl v0.0.2/go.mod h1:kKrO4xrn9cfS1mJVo+/BqePZjAYMXqD0amGF2Ouq7ac=
|
||||
github.com/antlabs/timer v0.1.4 h1:MHdE00MDnNfhJCmqSOdLXs35uGNwfkMwfbynxrGmQ1c=
|
||||
@@ -46,8 +48,6 @@ github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
|
||||
github.com/gorilla/websocket v1.5.1 h1:gmztn0JnHVt9JZquRuzLw3g4wouNVzKL15iLr/zn/QY=
|
||||
github.com/gorilla/websocket v1.5.1/go.mod h1:x3kM2JMyaluk02fnUJpQuwD2dCS5NDG2ZHL0uE0tcaY=
|
||||
github.com/gorilla/websocket v1.5.3/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
|
||||
github.com/govalues/decimal v0.1.2 h1:cHGR2FBD3M0zPY88CUqdtfqAcd4JHpug7u4nFe375Gs=
|
||||
github.com/govalues/decimal v0.1.2/go.mod h1:NfqNdX/GQBotCdmXtzckjhq54itVCX1Git3psSgom8A=
|
||||
github.com/grokify/html-strip-tags-go v0.1.0 h1:03UrQLjAny8xci+R+qjCce/MYnpNXCtgzltlQbOBae4=
|
||||
github.com/grokify/html-strip-tags-go v0.1.0/go.mod h1:ZdzgfHEzAfz9X6Xe5eBLVblWIxXfYSQ40S/VKrAOGpc=
|
||||
github.com/jinzhu/copier v0.4.0 h1:w3ciUoD19shMCRargcpm0cm91ytaBhDvuRpz1ODO/U8=
|
||||
@@ -94,6 +94,8 @@ github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDN
|
||||
github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA=
|
||||
github.com/samber/lo v1.52.0 h1:Rvi+3BFHES3A8meP33VPAxiBZX/Aws5RxrschYGjomw=
|
||||
github.com/samber/lo v1.52.0/go.mod h1:4+MXEGsJzbKGaUEQFKBq2xtfuznW9oz/WrgyzMzRoM0=
|
||||
github.com/shopspring/decimal v1.3.1 h1:2Usl1nmF/WZucqkFZhnfFYxxxu8LG21F6nPQBE5gKV8=
|
||||
github.com/shopspring/decimal v1.3.1/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o=
|
||||
github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U=
|
||||
github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U=
|
||||
github.com/tnnmigga/enum v1.0.2 h1:Yvchx0Esc01X5HiphW78sKzH/RXKttdFsfPO1ARiOa4=
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"blazing/logic/service/fight/info"
|
||||
"blazing/logic/service/fight/input"
|
||||
|
||||
"github.com/govalues/decimal"
|
||||
"github.com/alpacahq/alpacadecimal"
|
||||
)
|
||||
|
||||
// 11. 受到任何攻击都会反弹1/n的伤害给对方;(a1: n)
|
||||
@@ -27,7 +27,7 @@ func (e *NewSel11) Skill_Use_ex() bool {
|
||||
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{
|
||||
|
||||
Type: info.DamageType.Fixed,
|
||||
Damage: decimal.NewFromInt(int64(e.Ctx().Opp.SumDamage.IntPart())).Div(decimal.NewFromInt(int64(e.SideEffectArgs[0]))),
|
||||
Damage: alpacadecimal.NewFromInt(int64(e.Ctx().Opp.SumDamage.IntPart())).Div(alpacadecimal.NewFromInt(int64(e.SideEffectArgs[0]))),
|
||||
})
|
||||
return true
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"blazing/logic/service/fight/info"
|
||||
"blazing/logic/service/fight/input"
|
||||
|
||||
"github.com/govalues/decimal"
|
||||
"github.com/alpacahq/alpacadecimal"
|
||||
)
|
||||
|
||||
// 22. 被打时受到直接攻击伤害提高至n倍;(a1: n)
|
||||
@@ -21,7 +21,7 @@ func (e *NewSel22) Damage_DIV_ex(t *info.DamageZone) bool {
|
||||
if t.Type != info.DamageType.Red {
|
||||
return true
|
||||
}
|
||||
t.Damage = t.Damage.Mul(decimal.NewFromInt(int64(e.Args()[0])))
|
||||
t.Damage = t.Damage.Mul(alpacadecimal.NewFromInt(int64(e.Args()[0])))
|
||||
|
||||
return true
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ import (
|
||||
"blazing/logic/service/fight/input"
|
||||
"math"
|
||||
|
||||
"github.com/govalues/decimal"
|
||||
"github.com/alpacahq/alpacadecimal"
|
||||
)
|
||||
|
||||
// 23. 自身体力降到N以下时, 每次(针对多宠)攻击必定秒杀对方, 且必定先手;(a1: high 16, a2: low 16)
|
||||
@@ -49,7 +49,7 @@ func (e *NewSel23) OnSkill() bool {
|
||||
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{
|
||||
|
||||
Type: info.DamageType.Red,
|
||||
Damage: decimal.NewFromInt(int64(e.Ctx().Opp.GetPetInfo().Info.MaxHp)),
|
||||
Damage: alpacadecimal.NewFromInt(int64(e.Ctx().Opp.GetPetInfo().Info.MaxHp)),
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@ package effect
|
||||
import (
|
||||
"blazing/logic/service/fight/input"
|
||||
|
||||
"github.com/govalues/decimal"
|
||||
"github.com/alpacahq/alpacadecimal"
|
||||
)
|
||||
|
||||
// 25. 如果 hp 被打成 0, 则立刻增加一些hp
|
||||
@@ -18,7 +18,7 @@ func (e *NewSel25) Action_end_ex() bool {
|
||||
}
|
||||
if e.Ctx().Our.CurrentPet.Info.Hp == 0 {
|
||||
|
||||
e.Ctx().Our.Heal(e.Ctx().Our, nil, decimal.NewFromInt(1))
|
||||
e.Ctx().Our.Heal(e.Ctx().Our, nil, alpacadecimal.NewFromInt(1))
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"blazing/logic/service/fight/info"
|
||||
"blazing/logic/service/fight/input"
|
||||
|
||||
"github.com/govalues/decimal"
|
||||
"github.com/alpacahq/alpacadecimal"
|
||||
)
|
||||
|
||||
// 27. 按一定的属性顺序出招的技能才能对去血(a1-a8: mon_type)
|
||||
@@ -35,7 +35,7 @@ func (e *NewSel27) Damage_DIV_ex(t *info.DamageZone) bool {
|
||||
return true
|
||||
}
|
||||
|
||||
t.Damage = decimal.NewFromInt(0)
|
||||
t.Damage = alpacadecimal.NewFromInt(0)
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"blazing/logic/service/fight/info"
|
||||
"blazing/logic/service/fight/input"
|
||||
|
||||
"github.com/govalues/decimal"
|
||||
"github.com/alpacahq/alpacadecimal"
|
||||
)
|
||||
|
||||
// 28. XX系技能伤害增加n%(a1: mon_type, a2: n 百分比)
|
||||
@@ -24,7 +24,7 @@ func (e *NewSel28) Damage_ADD(t *info.DamageZone) bool {
|
||||
if e.Ctx().SkillEntity.Type != int(e.Args()[0]) {
|
||||
return true
|
||||
}
|
||||
t.Damage = t.Damage.Add(t.Damage.Mul(decimal.NewFromInt(int64(e.Args()[1])).Div(decimal.NewFromInt(100))))
|
||||
t.Damage = t.Damage.Add(t.Damage.Mul(alpacadecimal.NewFromInt(int64(e.Args()[1])).Div(alpacadecimal.NewFromInt(100))))
|
||||
return true
|
||||
}
|
||||
func init() {
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"blazing/logic/service/fight/info"
|
||||
"blazing/logic/service/fight/input"
|
||||
|
||||
"github.com/govalues/decimal"
|
||||
"github.com/alpacahq/alpacadecimal"
|
||||
)
|
||||
|
||||
// 3. 受到任何伤害减免 n%(a1: 0-100 百分比)
|
||||
@@ -20,7 +20,7 @@ func (e *NewSel3) Damage_DIV_ex(t *info.DamageZone) bool {
|
||||
}
|
||||
|
||||
if t.Type == info.DamageType.Red {
|
||||
reduceRatio := decimal.NewFromInt(100).Sub(decimal.NewFromInt(int64(e.Args()[0]))).Div(decimal.NewFromInt(100))
|
||||
reduceRatio := alpacadecimal.NewFromInt(100).Sub(alpacadecimal.NewFromInt(int64(e.Args()[0]))).Div(alpacadecimal.NewFromInt(100))
|
||||
t.Damage = t.Damage.Mul(reduceRatio)
|
||||
}
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"blazing/logic/service/fight/info"
|
||||
"blazing/logic/service/fight/input"
|
||||
|
||||
"github.com/govalues/decimal"
|
||||
"github.com/alpacahq/alpacadecimal"
|
||||
)
|
||||
|
||||
// 32. 进攻类技能有n%几率秒杀对方;(a1: n 千分比)
|
||||
@@ -25,7 +25,7 @@ func (e *NewSel32) OnSkill() bool {
|
||||
|
||||
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{
|
||||
Type: info.DamageType.Fixed,
|
||||
Damage: decimal.NewFromInt(int64(e.Ctx().Opp.CurrentPet.Info.Hp)),
|
||||
Damage: alpacadecimal.NewFromInt(int64(e.Ctx().Opp.CurrentPet.Info.Hp)),
|
||||
})
|
||||
return true
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@ package effect
|
||||
import (
|
||||
"blazing/logic/service/fight/input"
|
||||
|
||||
"github.com/govalues/decimal"
|
||||
"github.com/alpacahq/alpacadecimal"
|
||||
)
|
||||
|
||||
// 33. 精灵体力降低到 1/n 时有 m% 几率体力回满;(a1: n, a2: m 百分比)
|
||||
@@ -18,7 +18,7 @@ func (e *NewSel33) Action_end_ex() bool {
|
||||
}
|
||||
// 3. 概率判定(Args()[1]为触发概率)
|
||||
|
||||
cmp := e.Ctx().Our.CurrentPet.GetMaxHP().Div(decimal.NewFromInt(int64(e.Args()[0])))
|
||||
cmp := e.Ctx().Our.CurrentPet.GetMaxHP().Div(alpacadecimal.NewFromInt(int64(e.Args()[0])))
|
||||
if e.Ctx().Our.CurrentPet.GetHP().Cmp(cmp) == -1 {
|
||||
success, _, _ := e.Input.Player.Roll(e.Args()[1], 100)
|
||||
if !success {
|
||||
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
"blazing/logic/service/fight/info"
|
||||
"blazing/logic/service/fight/input"
|
||||
|
||||
"github.com/govalues/decimal"
|
||||
"github.com/alpacahq/alpacadecimal"
|
||||
)
|
||||
|
||||
// 36. 按5回合轮换属性顺序出招的技能才能对去血(a1-a8: btl_stat/elem_type)
|
||||
@@ -45,7 +45,7 @@ func (e *NewSel36) Damage_DIV_ex(t *info.DamageZone) bool {
|
||||
|
||||
if e.Args()[e.index] != e.Ctx().SkillEntity.Type {
|
||||
|
||||
t.Damage = decimal.NewFromInt(0)
|
||||
t.Damage = alpacadecimal.NewFromInt(0)
|
||||
}
|
||||
|
||||
return true
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"blazing/logic/service/fight/info"
|
||||
"blazing/logic/service/fight/input"
|
||||
|
||||
"github.com/govalues/decimal"
|
||||
"github.com/alpacahq/alpacadecimal"
|
||||
)
|
||||
|
||||
// 38. 自身造成的伤害增加n%;(a1: n 百分比)
|
||||
@@ -19,7 +19,7 @@ func (e *NewSel39) Damage_ADD(t *info.DamageZone) bool {
|
||||
return true
|
||||
}
|
||||
|
||||
t.Damage = t.Damage.Add(t.Damage.Mul(decimal.NewFromInt(int64(e.Args()[0]))))
|
||||
t.Damage = t.Damage.Add(t.Damage.Mul(alpacadecimal.NewFromInt(int64(e.Args()[0]))))
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"blazing/logic/service/fight/info"
|
||||
"blazing/logic/service/fight/input"
|
||||
|
||||
"github.com/govalues/decimal"
|
||||
"github.com/alpacahq/alpacadecimal"
|
||||
)
|
||||
|
||||
// 39. 偶数伤害(dmg) 提升到 n * dmg;(a1: n)
|
||||
@@ -23,7 +23,7 @@ func (e *NewSel39) Damage_Mul(t *info.DamageZone) bool {
|
||||
return true
|
||||
}
|
||||
|
||||
t.Damage = t.Damage.Mul(decimal.NewFromInt(int64(e.Args()[0])))
|
||||
t.Damage = t.Damage.Mul(alpacadecimal.NewFromInt(int64(e.Args()[0])))
|
||||
return true
|
||||
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"blazing/logic/service/fight/info"
|
||||
"blazing/logic/service/fight/input"
|
||||
|
||||
"github.com/govalues/decimal"
|
||||
"github.com/alpacahq/alpacadecimal"
|
||||
)
|
||||
|
||||
// 40. 奇数伤害(dmg) 改为 1/n * dmg;(a1: n)
|
||||
@@ -23,7 +23,7 @@ func (e *NewSel40) Damage_DIV_ex(t *info.DamageZone) bool {
|
||||
return true
|
||||
}
|
||||
|
||||
t.Damage = t.Damage.Mul(decimal.NewFromInt(1).Div(decimal.NewFromInt(int64(e.Args()[0]))))
|
||||
t.Damage = t.Damage.Mul(alpacadecimal.NewFromInt(1).Div(alpacadecimal.NewFromInt(int64(e.Args()[0]))))
|
||||
return true
|
||||
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@ package effect
|
||||
import (
|
||||
"blazing/logic/service/fight/input"
|
||||
|
||||
"github.com/govalues/decimal"
|
||||
"github.com/alpacahq/alpacadecimal"
|
||||
)
|
||||
|
||||
// 41. 每回合恢复自身n点体力;(a1: n)
|
||||
@@ -14,7 +14,7 @@ type NewSel41 struct {
|
||||
|
||||
func (e *NewSel41) Turn_End() {
|
||||
|
||||
e.Ctx().Our.Heal(e.Ctx().Our, nil, decimal.NewFromInt(int64(e.Args()[0])))
|
||||
e.Ctx().Our.Heal(e.Ctx().Our, nil, alpacadecimal.NewFromInt(int64(e.Args()[0])))
|
||||
|
||||
}
|
||||
func init() {
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"blazing/logic/service/fight/info"
|
||||
"blazing/logic/service/fight/input"
|
||||
|
||||
"github.com/govalues/decimal"
|
||||
"github.com/alpacahq/alpacadecimal"
|
||||
"github.com/samber/lo"
|
||||
)
|
||||
|
||||
@@ -30,7 +30,7 @@ func (e *NewSel5) Damage_Lock_ex(t *info.DamageZone) bool {
|
||||
return true
|
||||
}
|
||||
|
||||
t.Damage = decimal.NewFromInt(0)
|
||||
t.Damage = alpacadecimal.NewFromInt(0)
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"blazing/logic/service/fight/info"
|
||||
"blazing/logic/service/fight/input"
|
||||
|
||||
"github.com/govalues/decimal"
|
||||
"github.com/alpacahq/alpacadecimal"
|
||||
)
|
||||
|
||||
// 61. n%几率完全抵挡一次伤害(a1: n)
|
||||
@@ -28,7 +28,7 @@ func (e *NewSel61) Damage_DIV_ex(t *info.DamageZone) bool {
|
||||
//fmt.Println("Effect46_o", t.Damage)
|
||||
if t.Type == info.DamageType.Red {
|
||||
|
||||
t.Damage = decimal.NewFromInt(0)
|
||||
t.Damage = alpacadecimal.NewFromInt(0)
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"blazing/logic/service/fight/info"
|
||||
"blazing/logic/service/fight/input"
|
||||
|
||||
"github.com/govalues/decimal"
|
||||
"github.com/alpacahq/alpacadecimal"
|
||||
)
|
||||
|
||||
// 62. 物理攻击有n%几率使伤害提高m点(a1: n, a2: m)
|
||||
@@ -28,7 +28,7 @@ func (e *NewSel62) Damage_ADD(t *info.DamageZone) bool {
|
||||
if !success {
|
||||
return true
|
||||
}
|
||||
t.Damage = t.Damage.Add(decimal.NewFromInt(int64(e.Args()[1])))
|
||||
t.Damage = t.Damage.Add(alpacadecimal.NewFromInt(int64(e.Args()[1])))
|
||||
return true
|
||||
}
|
||||
func init() {
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"blazing/logic/service/fight/info"
|
||||
"blazing/logic/service/fight/input"
|
||||
|
||||
"github.com/govalues/decimal"
|
||||
"github.com/alpacahq/alpacadecimal"
|
||||
)
|
||||
|
||||
// 63. 特殊攻击有n%几率使伤害提高m点(a1: n, a2: m)
|
||||
@@ -28,7 +28,7 @@ func (e *NewSel63) Damage_ADD(t *info.DamageZone) bool {
|
||||
if !success {
|
||||
return true
|
||||
}
|
||||
t.Damage = t.Damage.Add(decimal.NewFromInt(int64(e.Args()[1])))
|
||||
t.Damage = t.Damage.Add(alpacadecimal.NewFromInt(int64(e.Args()[1])))
|
||||
return true
|
||||
}
|
||||
func init() {
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"blazing/logic/service/fight/info"
|
||||
"blazing/logic/service/fight/input"
|
||||
|
||||
"github.com/govalues/decimal"
|
||||
"github.com/alpacahq/alpacadecimal"
|
||||
)
|
||||
|
||||
// 65. 物理攻击或特殊攻击伤害增加m%(a1: 1=物理/3=特殊, a2: m)
|
||||
@@ -25,7 +25,7 @@ func (e *NewSel65) Damage_ADD(t *info.DamageZone) bool {
|
||||
return true
|
||||
}
|
||||
|
||||
t.Damage = t.Damage.Add(t.Damage.Mul(decimal.NewFromInt(int64(e.Args()[1]))))
|
||||
t.Damage = t.Damage.Add(t.Damage.Mul(alpacadecimal.NewFromInt(int64(e.Args()[1]))))
|
||||
return true
|
||||
}
|
||||
func init() {
|
||||
|
||||
@@ -6,7 +6,7 @@ import (
|
||||
"blazing/logic/service/fight/input"
|
||||
"blazing/logic/service/fight/node"
|
||||
|
||||
"github.com/govalues/decimal"
|
||||
"github.com/alpacahq/alpacadecimal"
|
||||
)
|
||||
|
||||
// -----------------------------------------------------------
|
||||
@@ -101,7 +101,7 @@ func (e *EffectDefeatTrigger) triggerByID(at info.AttackValue) {
|
||||
func (e *EffectDefeatTrigger) triggerHealSelfOnDefeat(at info.AttackValue) {
|
||||
// 计算恢复量:自身最大体力 / n(n=SideEffectArgs[0])
|
||||
maxHP := e.Ctx().Our.CurrentPet.Info.MaxHp
|
||||
healAmount := decimal.NewFromInt(int64(maxHP)).Div(decimal.NewFromInt(int64(e.SideEffectArgs[0])))
|
||||
healAmount := alpacadecimal.NewFromInt(int64(maxHP)).Div(alpacadecimal.NewFromInt(int64(e.SideEffectArgs[0])))
|
||||
// 执行回血
|
||||
e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, healAmount)
|
||||
}
|
||||
@@ -110,7 +110,7 @@ func (e *EffectDefeatTrigger) triggerHealSelfOnDefeat(at info.AttackValue) {
|
||||
func (e *EffectDefeatTrigger) triggerReduceNextHPOnDefeat(_ info.AttackValue) {
|
||||
// 计算伤害量:对方下只精灵最大体力 / n(n=SideEffectArgs[0])
|
||||
nextMaxHP := e.Ctx().Opp.CurrentPet.Info.MaxHp // 假设CurrentPet为下次出战精灵
|
||||
damageAmount := decimal.NewFromInt(int64(nextMaxHP)).Div(decimal.NewFromInt(int64(e.SideEffectArgs[0])))
|
||||
damageAmount := alpacadecimal.NewFromInt(int64(nextMaxHP)).Div(alpacadecimal.NewFromInt(int64(e.SideEffectArgs[0])))
|
||||
// 执行伤害
|
||||
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{
|
||||
Type: info.DamageType.Fixed,
|
||||
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
"blazing/logic/service/fight/input"
|
||||
"blazing/logic/service/fight/node"
|
||||
|
||||
"github.com/govalues/decimal"
|
||||
"github.com/alpacahq/alpacadecimal"
|
||||
)
|
||||
|
||||
/**
|
||||
@@ -29,7 +29,7 @@ func (e *Effect1) OnSkill() bool {
|
||||
}
|
||||
|
||||
e.Input.Heal(
|
||||
e.Ctx().Our, &action.SelectSkillAction{}, e.Ctx().Our.SumDamage.Div(decimal.NewFromInt(2)),
|
||||
e.Ctx().Our, &action.SelectSkillAction{}, e.Ctx().Our.SumDamage.Div(alpacadecimal.NewFromInt(2)),
|
||||
)
|
||||
return true
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
"blazing/logic/service/fight/input"
|
||||
"blazing/logic/service/fight/node"
|
||||
|
||||
"github.com/govalues/decimal"
|
||||
"github.com/alpacahq/alpacadecimal"
|
||||
)
|
||||
|
||||
// 自身体力越少则威力越大
|
||||
@@ -26,10 +26,10 @@ func (e *Effect100) Skill_Hit() bool {
|
||||
|
||||
//技能威力=【165-65*【当前体力百分比】】,任意体力百分比对应的威力浮动范围∈[-10,+10]
|
||||
|
||||
odp := e.GetInput().CurrentPet.GetHP().Div(e.GetInput().CurrentPet.GetMaxHP()).Mul(decimal.NewFromInt(65))
|
||||
odp := e.GetInput().CurrentPet.GetHP().Div(e.GetInput().CurrentPet.GetMaxHP()).Mul(alpacadecimal.NewFromInt(65))
|
||||
|
||||
if odp.Cmp(decimal.NewFromInt(165)) == -1 {
|
||||
e.Ctx().SkillEntity.Power = int(decimal.NewFromInt(165).Sub(odp).IntPart())
|
||||
if odp.Cmp(alpacadecimal.NewFromInt(165)) == -1 {
|
||||
e.Ctx().SkillEntity.Power = int(alpacadecimal.NewFromInt(165).Sub(odp).IntPart())
|
||||
}
|
||||
|
||||
return true
|
||||
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
"blazing/logic/service/fight/input"
|
||||
"blazing/logic/service/fight/node"
|
||||
|
||||
"github.com/govalues/decimal"
|
||||
"github.com/alpacahq/alpacadecimal"
|
||||
)
|
||||
|
||||
/**
|
||||
@@ -28,7 +28,7 @@ func (e *Effect101) OnSkill() bool {
|
||||
}
|
||||
|
||||
e.Input.Heal(
|
||||
e.Ctx().Our, &action.SelectSkillAction{}, e.Ctx().Our.SumDamage.Mul(decimal.NewFromInt(int64(e.Args()[0])).Div(decimal.NewFromInt(100))),
|
||||
e.Ctx().Our, &action.SelectSkillAction{}, e.Ctx().Our.SumDamage.Mul(alpacadecimal.NewFromInt(int64(e.Args()[0])).Div(alpacadecimal.NewFromInt(100))),
|
||||
)
|
||||
return true
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
"blazing/logic/service/fight/input"
|
||||
"blazing/logic/service/fight/node"
|
||||
|
||||
"github.com/govalues/decimal"
|
||||
"github.com/alpacahq/alpacadecimal"
|
||||
)
|
||||
|
||||
/**
|
||||
@@ -28,7 +28,7 @@ func (e *Effect105) OnSkill() bool {
|
||||
}
|
||||
|
||||
e.Input.Heal(
|
||||
e.Ctx().Our, &action.SelectSkillAction{}, e.Ctx().Our.SumDamage.Div(decimal.NewFromInt(int64(e.Args()[0]))),
|
||||
e.Ctx().Our, &action.SelectSkillAction{}, e.Ctx().Our.SumDamage.Div(alpacadecimal.NewFromInt(int64(e.Args()[0]))),
|
||||
)
|
||||
return true
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
"blazing/logic/service/fight/input"
|
||||
"blazing/logic/service/fight/node"
|
||||
|
||||
"github.com/govalues/decimal"
|
||||
"github.com/alpacahq/alpacadecimal"
|
||||
)
|
||||
|
||||
//若本次攻击造成的伤害小于n 则自身xx等级提升1个等级
|
||||
@@ -27,7 +27,7 @@ func (e *Effect107) Skill_Useed() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
d := e.Ctx().Our.SumDamage.Cmp(decimal.NewFromInt(int64(e.SideEffectArgs[0])))
|
||||
d := e.Ctx().Our.SumDamage.Cmp(alpacadecimal.NewFromInt(int64(e.SideEffectArgs[0])))
|
||||
//说明伤害小于N
|
||||
if d == -1 {
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
"blazing/logic/service/fight/input"
|
||||
"blazing/logic/service/fight/node"
|
||||
|
||||
"github.com/govalues/decimal"
|
||||
"github.com/alpacahq/alpacadecimal"
|
||||
)
|
||||
|
||||
// 附加额外伤害,自身等级越高,附加的伤害越高
|
||||
@@ -22,7 +22,7 @@ func (e *Effect111) OnSkill() bool {
|
||||
|
||||
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{
|
||||
Type: info.DamageType.Fixed,
|
||||
Damage: decimal.NewFromInt(int64(e.Ctx().Opp.CurrentPet.Info.Level)),
|
||||
Damage: alpacadecimal.NewFromInt(int64(e.Ctx().Opp.CurrentPet.Info.Level)),
|
||||
})
|
||||
return true
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
"blazing/logic/service/fight/input"
|
||||
"blazing/logic/service/fight/node"
|
||||
|
||||
"github.com/govalues/decimal"
|
||||
"github.com/alpacahq/alpacadecimal"
|
||||
)
|
||||
|
||||
/**
|
||||
@@ -30,12 +30,12 @@ func (e *Effect112) OnSkill() bool {
|
||||
e.can = true
|
||||
e.Ctx().Our.Damage(e.Ctx().Our, &info.DamageZone{
|
||||
Type: info.DamageType.Fixed,
|
||||
Damage: decimal.NewFromInt(int64(e.Ctx().Our.CurrentPet.Info.MaxHp)),
|
||||
Damage: alpacadecimal.NewFromInt(int64(e.Ctx().Our.CurrentPet.Info.MaxHp)),
|
||||
})
|
||||
n := int64(e.Input.FightC.GetRand().Int31n(int32(50+1))) + 250
|
||||
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{
|
||||
Type: info.DamageType.Fixed,
|
||||
Damage: decimal.Min(decimal.NewFromInt(n), e.Ctx().Opp.CurrentPet.GetHP().Sub(decimal.NewFromInt(1))),
|
||||
Damage: alpacadecimal.Min(alpacadecimal.NewFromInt(n), e.Ctx().Opp.CurrentPet.GetHP().Sub(alpacadecimal.NewFromInt(1))),
|
||||
})
|
||||
e.Ctx().Our.CurrentPet.NotAlive = true
|
||||
return true
|
||||
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
"blazing/logic/service/fight/input"
|
||||
"blazing/logic/service/fight/node"
|
||||
|
||||
"github.com/govalues/decimal"
|
||||
"github.com/alpacahq/alpacadecimal"
|
||||
)
|
||||
|
||||
/**
|
||||
@@ -32,7 +32,7 @@ func (e *Effect115) OnSkill() bool {
|
||||
if !ok {
|
||||
return true
|
||||
}
|
||||
rr := decimal.NewFromInt(int64(e.Ctx().Our.GetProp(4, true))).Div(decimal.NewFromInt(int64(e.SideEffectArgs[1])))
|
||||
rr := alpacadecimal.NewFromInt(int64(e.Ctx().Our.GetProp(4, true))).Div(alpacadecimal.NewFromInt(int64(e.SideEffectArgs[1])))
|
||||
|
||||
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{
|
||||
Type: info.DamageType.Fixed,
|
||||
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
"blazing/logic/service/fight/input"
|
||||
"blazing/logic/service/fight/node"
|
||||
|
||||
"github.com/govalues/decimal"
|
||||
"github.com/alpacahq/alpacadecimal"
|
||||
)
|
||||
|
||||
/**
|
||||
@@ -38,7 +38,7 @@ func (e *Effect116) Skill_Useed() bool {
|
||||
}
|
||||
|
||||
if e.Input.FightC.IsFirst(e.Input.Player) {
|
||||
e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, e.Ctx().Our.SumDamage.Div(decimal.NewFromInt(5)))
|
||||
e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, e.Ctx().Our.SumDamage.Div(alpacadecimal.NewFromInt(5)))
|
||||
}
|
||||
|
||||
return true
|
||||
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
"blazing/logic/service/fight/input"
|
||||
"blazing/logic/service/fight/node"
|
||||
|
||||
"github.com/govalues/decimal"
|
||||
"github.com/alpacahq/alpacadecimal"
|
||||
)
|
||||
|
||||
type Effect130 struct {
|
||||
@@ -25,7 +25,7 @@ func (e *Effect130) OnSkill() bool {
|
||||
return true
|
||||
}
|
||||
// 4. 附加固定伤害(从SideEffectArgs[0]获取伤害值)
|
||||
damageValue := decimal.NewFromInt(int64(e.SideEffectArgs[1]))
|
||||
damageValue := alpacadecimal.NewFromInt(int64(e.SideEffectArgs[1]))
|
||||
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{
|
||||
Type: info.DamageType.Fixed,
|
||||
Damage: damageValue,
|
||||
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
"blazing/logic/service/fight/input"
|
||||
"blazing/logic/service/fight/node"
|
||||
|
||||
"github.com/govalues/decimal"
|
||||
"github.com/alpacahq/alpacadecimal"
|
||||
)
|
||||
|
||||
/**
|
||||
@@ -28,7 +28,7 @@ func (e *Effect134) Damage_Floor(t *info.DamageZone) bool {
|
||||
// fmt.Println("Effect134_old", t.Damage.IntPart())
|
||||
if t.Type == info.DamageType.Red {
|
||||
|
||||
is := t.Damage.Cmp(decimal.NewFromInt(int64(e.Args()[0])))
|
||||
is := t.Damage.Cmp(alpacadecimal.NewFromInt(int64(e.Args()[0])))
|
||||
if is == -1 {
|
||||
|
||||
e.Ctx().Our.HealPP(e.Args()[1])
|
||||
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
"blazing/logic/service/fight/input"
|
||||
"blazing/logic/service/fight/node"
|
||||
|
||||
"github.com/govalues/decimal"
|
||||
"github.com/alpacahq/alpacadecimal"
|
||||
)
|
||||
|
||||
/**
|
||||
@@ -28,7 +28,7 @@ func (e *Effect135) Damage_Floor(t *info.DamageZone) bool {
|
||||
// fmt.Println("Effect135_old", t.Damage.IntPart())
|
||||
if t.Type == info.DamageType.Red {
|
||||
|
||||
t.Damage = decimal.Max(t.Damage, decimal.NewFromInt(int64(e.Args()[0])))
|
||||
t.Damage = alpacadecimal.Max(t.Damage, alpacadecimal.NewFromInt(int64(e.Args()[0])))
|
||||
|
||||
}
|
||||
//fmt.Println("Effect135_new", t.Damage.IntPart())
|
||||
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
"blazing/logic/service/fight/input"
|
||||
"blazing/logic/service/fight/node"
|
||||
|
||||
"github.com/govalues/decimal"
|
||||
"github.com/alpacahq/alpacadecimal"
|
||||
)
|
||||
|
||||
/**
|
||||
@@ -25,7 +25,7 @@ func init() {
|
||||
// 命中之后
|
||||
func (e *Effect136) OnSkill() bool {
|
||||
if !e.Hit() {
|
||||
heal := e.Ctx().Our.CurrentPet.GetMaxHP().Div(decimal.NewFromInt(int64(e.Args()[0])))
|
||||
heal := e.Ctx().Our.CurrentPet.GetMaxHP().Div(alpacadecimal.NewFromInt(int64(e.Args()[0])))
|
||||
e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, heal)
|
||||
}
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ import (
|
||||
"blazing/logic/service/fight/node"
|
||||
"sync"
|
||||
|
||||
"github.com/govalues/decimal"
|
||||
"github.com/alpacahq/alpacadecimal"
|
||||
)
|
||||
|
||||
/**
|
||||
@@ -57,7 +57,7 @@ func (e *Effect21) Skill_Use_ex() bool {
|
||||
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{
|
||||
|
||||
Type: info.DamageType.Fixed,
|
||||
Damage: decimal.NewFromInt(int64(e.Ctx().Opp.SumDamage.IntPart())).Div(decimal.NewFromInt(int64(e.SideEffectArgs[0]))),
|
||||
Damage: alpacadecimal.NewFromInt(int64(e.Ctx().Opp.SumDamage.IntPart())).Div(alpacadecimal.NewFromInt(int64(e.SideEffectArgs[0]))),
|
||||
})
|
||||
return true
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
"blazing/logic/service/fight/input"
|
||||
"blazing/logic/service/fight/node"
|
||||
|
||||
"github.com/govalues/decimal"
|
||||
"github.com/alpacahq/alpacadecimal"
|
||||
)
|
||||
|
||||
/**
|
||||
@@ -30,7 +30,7 @@ func (e *Effect28) OnSkill() bool {
|
||||
|
||||
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{
|
||||
Type: info.DamageType.Fixed,
|
||||
Damage: decimal.NewFromInt(int64(e.Ctx().Opp.CurrentPet.Info.Hp)).Div(decimal.NewFromInt(int64(e.SideEffectArgs[0]))),
|
||||
Damage: alpacadecimal.NewFromInt(int64(e.Ctx().Opp.CurrentPet.Info.Hp)).Div(alpacadecimal.NewFromInt(int64(e.SideEffectArgs[0]))),
|
||||
})
|
||||
return true
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
"blazing/logic/service/fight/input"
|
||||
"blazing/logic/service/fight/node"
|
||||
|
||||
"github.com/govalues/decimal"
|
||||
"github.com/alpacahq/alpacadecimal"
|
||||
)
|
||||
|
||||
/**
|
||||
@@ -31,7 +31,7 @@ func (e *Effect29) OnSkill() bool {
|
||||
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{
|
||||
|
||||
Type: info.DamageType.Fixed,
|
||||
Damage: decimal.NewFromInt(int64(e.SideEffectArgs[0])),
|
||||
Damage: alpacadecimal.NewFromInt(int64(e.SideEffectArgs[0])),
|
||||
})
|
||||
return true
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
"blazing/logic/service/fight/input"
|
||||
"blazing/logic/service/fight/node"
|
||||
|
||||
"github.com/govalues/decimal"
|
||||
"github.com/alpacahq/alpacadecimal"
|
||||
)
|
||||
|
||||
/**
|
||||
@@ -30,7 +30,7 @@ func (e *Effect31) Damage_Mul(t *info.DamageZone) bool {
|
||||
|
||||
if t.Type == info.DamageType.Red {
|
||||
n := int(e.Input.FightC.GetRand().Int31n(int32(e.SideEffectArgs[1]-e.SideEffectArgs[0]+1))) + e.SideEffectArgs[0]
|
||||
t.Damage = t.Damage.Mul(decimal.NewFromInt(int64(n)))
|
||||
t.Damage = t.Damage.Mul(alpacadecimal.NewFromInt(int64(n)))
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
"blazing/logic/service/fight/input"
|
||||
"blazing/logic/service/fight/node"
|
||||
|
||||
"github.com/govalues/decimal"
|
||||
"github.com/alpacahq/alpacadecimal"
|
||||
)
|
||||
|
||||
/**
|
||||
@@ -41,7 +41,7 @@ func (e *Effect34) Damage_Floor(t *info.DamageZone) bool {
|
||||
if e.Ctx().SkillEntity == nil {
|
||||
return true
|
||||
}
|
||||
t.Damage = decimal.NewFromInt(int64(e.Ctx().Opp.SumDamage.IntPart())).Mul(decimal.NewFromInt(int64(e.SideEffectArgs[0])))
|
||||
t.Damage = alpacadecimal.NewFromInt(int64(e.Ctx().Opp.SumDamage.IntPart())).Mul(alpacadecimal.NewFromInt(int64(e.SideEffectArgs[0])))
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
"blazing/logic/service/fight/input"
|
||||
"blazing/logic/service/fight/node"
|
||||
|
||||
"github.com/govalues/decimal"
|
||||
"github.com/alpacahq/alpacadecimal"
|
||||
)
|
||||
|
||||
/**
|
||||
@@ -40,7 +40,7 @@ func (e *Effect36) Damage_Floor(b *info.DamageZone) bool {
|
||||
}
|
||||
|
||||
if b.Type == info.DamageType.Red {
|
||||
b.Damage = decimal.NewFromInt(int64(e.Ctx().Opp.CurrentPet.Info.MaxHp))
|
||||
b.Damage = alpacadecimal.NewFromInt(int64(e.Ctx().Opp.CurrentPet.Info.MaxHp))
|
||||
|
||||
}
|
||||
return true
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"blazing/logic/service/fight/input"
|
||||
"blazing/logic/service/fight/node"
|
||||
|
||||
"github.com/govalues/decimal"
|
||||
"github.com/alpacahq/alpacadecimal"
|
||||
)
|
||||
|
||||
// 自身体力小于1/n时威力为m倍
|
||||
@@ -15,7 +15,7 @@ type Effect37 struct {
|
||||
|
||||
func (e *Effect37) Skill_Hit() bool {
|
||||
|
||||
cmphp := e.GetInput().CurrentPet.GetMaxHP().Div(decimal.NewFromInt(int64(e.Args()[0])))
|
||||
cmphp := e.GetInput().CurrentPet.GetMaxHP().Div(alpacadecimal.NewFromInt(int64(e.Args()[0])))
|
||||
if e.GetInput().CurrentPet.GetHP().Cmp(cmphp) == -1 {
|
||||
e.Ctx().SkillEntity.Power *= e.Args()[1]
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ import (
|
||||
"blazing/logic/service/fight/input"
|
||||
"blazing/logic/service/fight/node"
|
||||
|
||||
"github.com/govalues/decimal"
|
||||
"github.com/alpacahq/alpacadecimal"
|
||||
)
|
||||
|
||||
/**
|
||||
@@ -49,7 +49,7 @@ func (e *Effect41) Damage_DIV_ex(t *info.DamageZone) bool {
|
||||
return true
|
||||
}
|
||||
if t.Type == info.DamageType.Red {
|
||||
t.Damage = t.Damage.Div(decimal.NewFromInt(2))
|
||||
t.Damage = t.Damage.Div(alpacadecimal.NewFromInt(2))
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ import (
|
||||
"blazing/logic/service/fight/input"
|
||||
"blazing/logic/service/fight/node"
|
||||
|
||||
"github.com/govalues/decimal"
|
||||
"github.com/alpacahq/alpacadecimal"
|
||||
)
|
||||
|
||||
// ---- Effect42 ----
|
||||
@@ -29,7 +29,7 @@ func (e *Effect42) Damage_Mul(t *info.DamageZone) bool {
|
||||
//fmt.Println("Effect42_o", t.Damage)
|
||||
if t.Type == info.DamageType.Red {
|
||||
|
||||
t.Damage = t.Damage.Mul(decimal.NewFromInt(2))
|
||||
t.Damage = t.Damage.Mul(alpacadecimal.NewFromInt(2))
|
||||
|
||||
}
|
||||
//fmt.Println("Effect42_n", t.Damage)
|
||||
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
"blazing/logic/service/fight/input"
|
||||
"blazing/logic/service/fight/node"
|
||||
|
||||
"github.com/govalues/decimal"
|
||||
"github.com/alpacahq/alpacadecimal"
|
||||
)
|
||||
|
||||
/**
|
||||
@@ -25,7 +25,7 @@ func (e *Effect43) OnSkill() bool {
|
||||
if !e.Hit() {
|
||||
return true
|
||||
}
|
||||
tt := decimal.NewFromInt(int64(e.Ctx().Our.CurrentPet.Info.MaxHp)).Div(decimal.NewFromInt(int64(e.SideEffectArgs[0])))
|
||||
tt := alpacadecimal.NewFromInt(int64(e.Ctx().Our.CurrentPet.Info.MaxHp)).Div(alpacadecimal.NewFromInt(int64(e.SideEffectArgs[0])))
|
||||
//fmt.Println("恢复自身最大体量的1/n", tt.IntPart())
|
||||
e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, tt)
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
"blazing/logic/service/fight/input"
|
||||
"blazing/logic/service/fight/node"
|
||||
|
||||
"github.com/govalues/decimal"
|
||||
"github.com/alpacahq/alpacadecimal"
|
||||
)
|
||||
|
||||
// n回合自己受到特殊攻击伤害减半
|
||||
@@ -29,7 +29,7 @@ func (e *Effect44) Damage_DIV_ex(t *info.DamageZone) bool {
|
||||
//fmt.Println("Effect44_o", t.Damage)
|
||||
if t.Type == info.DamageType.Red {
|
||||
|
||||
t.Damage = t.Damage.Div(decimal.NewFromInt(2))
|
||||
t.Damage = t.Damage.Div(alpacadecimal.NewFromInt(2))
|
||||
|
||||
}
|
||||
//fmt.Println("Effect44_n", t.Damage)
|
||||
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
"blazing/logic/service/fight/input"
|
||||
"blazing/logic/service/fight/node"
|
||||
|
||||
"github.com/govalues/decimal"
|
||||
"github.com/alpacahq/alpacadecimal"
|
||||
)
|
||||
|
||||
// "可完全抵挡n次攻击伤害 百分百减伤 ,后面还有锁伤
|
||||
@@ -34,7 +34,7 @@ func (e *Effect46) Damage_DIV_ex(t *info.DamageZone) bool {
|
||||
//fmt.Println("Effect46_o", t.Damage)
|
||||
if t.Type == info.DamageType.Red {
|
||||
|
||||
t.Damage = decimal.NewFromInt(0)
|
||||
t.Damage = alpacadecimal.NewFromInt(0)
|
||||
|
||||
}
|
||||
e.conut++
|
||||
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
"blazing/logic/service/fight/input"
|
||||
"blazing/logic/service/fight/node"
|
||||
|
||||
"github.com/govalues/decimal"
|
||||
"github.com/alpacahq/alpacadecimal"
|
||||
)
|
||||
|
||||
// 可以抵挡n点伤害
|
||||
@@ -27,8 +27,8 @@ func (e *Effect49) Damage_SUB_ex(t *info.DamageZone) bool {
|
||||
|
||||
//fmt.Println("Effect49_o", t.Damage)
|
||||
if t.Type == info.DamageType.Red {
|
||||
if decimal.NewFromInt(int64(e.Args()[0])).Cmp(t.Damage) == -1 {
|
||||
t.Damage = t.Damage.Sub(decimal.NewFromInt(int64(e.Args()[0])))
|
||||
if alpacadecimal.NewFromInt(int64(e.Args()[0])).Cmp(t.Damage) == -1 {
|
||||
t.Damage = t.Damage.Sub(alpacadecimal.NewFromInt(int64(e.Args()[0])))
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
"blazing/logic/service/fight/input"
|
||||
"blazing/logic/service/fight/node"
|
||||
|
||||
"github.com/govalues/decimal"
|
||||
"github.com/alpacahq/alpacadecimal"
|
||||
)
|
||||
|
||||
// n回合自身受到物理攻击伤害减半
|
||||
@@ -29,7 +29,7 @@ func (e *Effect50) Damage_DIV_ex(t *info.DamageZone) bool {
|
||||
//fmt.Println("Effect50_o", t.Damage)
|
||||
if t.Type == info.DamageType.Red {
|
||||
|
||||
t.Damage = t.Damage.Div(decimal.NewFromInt(2))
|
||||
t.Damage = t.Damage.Div(alpacadecimal.NewFromInt(2))
|
||||
|
||||
}
|
||||
//fmt.Println("Effect50_n", t.Damage)
|
||||
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
"blazing/logic/service/fight/input"
|
||||
"blazing/logic/service/fight/node"
|
||||
|
||||
"github.com/govalues/decimal"
|
||||
"github.com/alpacahq/alpacadecimal"
|
||||
)
|
||||
|
||||
/**
|
||||
@@ -28,7 +28,7 @@ func (e *Effect90) Damage_Mul(t *info.DamageZone) bool {
|
||||
|
||||
if t.Type == info.DamageType.Red {
|
||||
|
||||
t.Damage = t.Damage.Mul(decimal.NewFromInt(int64(e.SideEffectArgs[1])))
|
||||
t.Damage = t.Damage.Mul(alpacadecimal.NewFromInt(int64(e.SideEffectArgs[1])))
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
"blazing/logic/service/fight/input"
|
||||
"blazing/logic/service/fight/node"
|
||||
|
||||
"github.com/govalues/decimal"
|
||||
"github.com/alpacahq/alpacadecimal"
|
||||
)
|
||||
|
||||
// n 回合使对方攻击伤害是正常状态下的 1/m
|
||||
@@ -29,7 +29,7 @@ func (e *Effect54) Damage_DIV_ex(t *info.DamageZone) bool {
|
||||
//fmt.Println("Effect54_o", t.Damage)
|
||||
if t.Type == info.DamageType.Red {
|
||||
|
||||
t.Damage = t.Damage.Div(decimal.NewFromInt(int64(e.Args()[1])))
|
||||
t.Damage = t.Damage.Div(alpacadecimal.NewFromInt(int64(e.Args()[1])))
|
||||
|
||||
}
|
||||
//fmt.Println("Effect54_n", t.Damage)
|
||||
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
"blazing/logic/service/fight/input"
|
||||
"blazing/logic/service/fight/node"
|
||||
|
||||
"github.com/govalues/decimal"
|
||||
"github.com/alpacahq/alpacadecimal"
|
||||
)
|
||||
|
||||
/**
|
||||
@@ -33,7 +33,7 @@ func (e *Effect57) OnSkill() bool {
|
||||
if !e.Hit() {
|
||||
return true
|
||||
}
|
||||
heal := e.Ctx().Our.CurrentPet.GetMaxHP().Div(decimal.NewFromInt(int64(e.Args()[1])))
|
||||
heal := e.Ctx().Our.CurrentPet.GetMaxHP().Div(alpacadecimal.NewFromInt(int64(e.Args()[1])))
|
||||
e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, heal)
|
||||
return true
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
"blazing/logic/service/fight/input"
|
||||
"blazing/logic/service/fight/node"
|
||||
|
||||
"github.com/govalues/decimal"
|
||||
"github.com/alpacahq/alpacadecimal"
|
||||
)
|
||||
|
||||
/**
|
||||
@@ -37,7 +37,7 @@ func (e *Effect59) OnSkill() bool {
|
||||
e.can = true
|
||||
e.Ctx().Our.Damage(e.Ctx().Our, &info.DamageZone{
|
||||
Type: info.DamageType.Fixed,
|
||||
Damage: decimal.NewFromInt(int64(e.Ctx().Our.CurrentPet.Info.MaxHp)),
|
||||
Damage: alpacadecimal.NewFromInt(int64(e.Ctx().Our.CurrentPet.Info.MaxHp)),
|
||||
})
|
||||
e.Ctx().Our.CurrentPet.NotAlive = true
|
||||
return true
|
||||
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
"blazing/logic/service/fight/input"
|
||||
"blazing/logic/service/fight/node"
|
||||
|
||||
"github.com/govalues/decimal"
|
||||
"github.com/alpacahq/alpacadecimal"
|
||||
)
|
||||
|
||||
//对方所受伤害的1/n会反弹给自己
|
||||
@@ -26,7 +26,7 @@ func (e *Effect6) Skill_Useed() bool {
|
||||
e.Ctx().Our.Damage(e.Ctx().Our, &info.DamageZone{
|
||||
Type: info.DamageType.Fixed,
|
||||
//这个对面计算前是在他的回合,所以后手也能拿到伤害
|
||||
Damage: e.Ctx().Our.SumDamage.Div(decimal.NewFromInt(int64(e.SideEffectArgs[0]))),
|
||||
Damage: e.Ctx().Our.SumDamage.Div(alpacadecimal.NewFromInt(int64(e.SideEffectArgs[0]))),
|
||||
})
|
||||
|
||||
return true
|
||||
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
"blazing/logic/service/fight/input"
|
||||
"blazing/logic/service/fight/node"
|
||||
|
||||
"github.com/govalues/decimal"
|
||||
"github.com/alpacahq/alpacadecimal"
|
||||
)
|
||||
|
||||
/**
|
||||
@@ -35,6 +35,6 @@ func (e *Effect60) OnSkill() bool {
|
||||
}
|
||||
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{
|
||||
Type: info.DamageType.Fixed,
|
||||
Damage: decimal.NewFromInt(int64(e.SideEffectArgs[1]))})
|
||||
Damage: alpacadecimal.NewFromInt(int64(e.SideEffectArgs[1]))})
|
||||
return true
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ import (
|
||||
"fmt"
|
||||
"math"
|
||||
|
||||
"github.com/govalues/decimal"
|
||||
"github.com/alpacahq/alpacadecimal"
|
||||
)
|
||||
|
||||
/**
|
||||
@@ -45,7 +45,7 @@ func (e *Effect62_sub) OnSkill() bool {
|
||||
//相当于对方给自己的伤害
|
||||
e.Ctx().Our.Damage(e.Ctx().Opp, &info.DamageZone{
|
||||
Type: info.DamageType.Fixed,
|
||||
Damage: decimal.NewFromInt(int64(e.Ctx().Our.CurrentPet.Info.MaxHp)),
|
||||
Damage: alpacadecimal.NewFromInt(int64(e.Ctx().Our.CurrentPet.Info.MaxHp)),
|
||||
})
|
||||
e.Alive(false)
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
"blazing/logic/service/fight/input"
|
||||
"blazing/logic/service/fight/node"
|
||||
|
||||
"github.com/govalues/decimal"
|
||||
"github.com/alpacahq/alpacadecimal"
|
||||
)
|
||||
|
||||
// 1回合内,受到致死攻击时则余下1点体力
|
||||
@@ -30,7 +30,7 @@ func (e *Effect68) Damage_Lock_ex(t *info.DamageZone) bool {
|
||||
//伤害溢出
|
||||
if t.Type == info.DamageType.Red && t.Damage.Cmp(e.Ctx().Our.CurrentPet.GetHP()) == 1 {
|
||||
//e.Ctx().Our.CurrentPet.Info.Hp = 1
|
||||
t.Damage = e.Ctx().Our.CurrentPet.GetHP().Sub(decimal.NewFromInt(1))
|
||||
t.Damage = e.Ctx().Our.CurrentPet.GetHP().Sub(alpacadecimal.NewFromInt(1))
|
||||
}
|
||||
//fmt.Println("Effect68_n", t.Damage)
|
||||
return true
|
||||
|
||||
@@ -6,7 +6,7 @@ import (
|
||||
"blazing/logic/service/fight/input"
|
||||
"blazing/logic/service/fight/node"
|
||||
|
||||
"github.com/govalues/decimal"
|
||||
"github.com/alpacahq/alpacadecimal"
|
||||
)
|
||||
|
||||
/**
|
||||
@@ -39,7 +39,7 @@ func (e *Effect7) Damage_Lock(t *info.DamageZone) bool {
|
||||
if t.Type == info.DamageType.Red {
|
||||
if e.Ctx().Our.CurrentPet.Info.Hp <= e.Ctx().Opp.CurrentPet.Info.Hp {
|
||||
|
||||
t.Damage = decimal.NewFromInt(int64(e.Ctx().Opp.CurrentPet.Info.Hp - e.Ctx().Our.CurrentPet.Info.Hp))
|
||||
t.Damage = alpacadecimal.NewFromInt(int64(e.Ctx().Opp.CurrentPet.Info.Hp - e.Ctx().Our.CurrentPet.Info.Hp))
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ import (
|
||||
"blazing/logic/service/fight/input"
|
||||
"blazing/logic/service/fight/node"
|
||||
|
||||
"github.com/govalues/decimal"
|
||||
"github.com/alpacahq/alpacadecimal"
|
||||
)
|
||||
|
||||
/**
|
||||
@@ -38,7 +38,7 @@ func (e *Effect71) OnSkill() bool {
|
||||
e.can = true
|
||||
e.Ctx().Our.Damage(e.Ctx().Our, &info.DamageZone{
|
||||
Type: info.DamageType.Fixed,
|
||||
Damage: decimal.NewFromInt(int64(e.Ctx().Our.CurrentPet.Info.MaxHp)),
|
||||
Damage: alpacadecimal.NewFromInt(int64(e.Ctx().Our.CurrentPet.Info.MaxHp)),
|
||||
})
|
||||
e.Ctx().Our.CurrentPet.NotAlive = true
|
||||
return true
|
||||
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
"blazing/logic/service/fight/input"
|
||||
"blazing/logic/service/fight/node"
|
||||
|
||||
"github.com/govalues/decimal"
|
||||
"github.com/alpacahq/alpacadecimal"
|
||||
)
|
||||
|
||||
/**
|
||||
@@ -27,7 +27,7 @@ func (e *Effect72) OnSkill() bool {
|
||||
if !e.Hit() {
|
||||
e.Ctx().Our.Damage(e.Ctx().Our, &info.DamageZone{
|
||||
Type: info.DamageType.True,
|
||||
Damage: decimal.NewFromInt(int64(e.Ctx().Our.CurrentPet.Info.Hp)),
|
||||
Damage: alpacadecimal.NewFromInt(int64(e.Ctx().Our.CurrentPet.Info.Hp)),
|
||||
})
|
||||
e.Ctx().Our.CurrentPet.NotAlive = true
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
"blazing/logic/service/fight/input"
|
||||
"blazing/logic/service/fight/node"
|
||||
|
||||
"github.com/govalues/decimal"
|
||||
"github.com/alpacahq/alpacadecimal"
|
||||
)
|
||||
|
||||
/**
|
||||
@@ -42,9 +42,9 @@ func (e *Effect73) Action_end_ex() bool {
|
||||
}
|
||||
tt := &info.DamageZone{
|
||||
Type: info.DamageType.Fixed,
|
||||
Damage: e.Ctx().Opp.SumDamage.Mul(decimal.NewFromInt(2)),
|
||||
Damage: e.Ctx().Opp.SumDamage.Mul(alpacadecimal.NewFromInt(2)),
|
||||
}
|
||||
maxhp := e.Ctx().Our.CurrentPet.GetMaxHP().Mul(decimal.NewFromInt(30))
|
||||
maxhp := e.Ctx().Our.CurrentPet.GetMaxHP().Mul(alpacadecimal.NewFromInt(30))
|
||||
if tt.Damage.Cmp(maxhp) == 1 {
|
||||
tt.Damage = maxhp
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
"blazing/logic/service/fight/input"
|
||||
"blazing/logic/service/fight/node"
|
||||
|
||||
"github.com/govalues/decimal"
|
||||
"github.com/alpacahq/alpacadecimal"
|
||||
)
|
||||
|
||||
/**
|
||||
@@ -34,7 +34,7 @@ func (e *Effect76) OnSkill() bool {
|
||||
}
|
||||
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{
|
||||
Type: info.DamageType.Fixed,
|
||||
Damage: decimal.NewFromInt(int64(e.SideEffectArgs[2])),
|
||||
Damage: alpacadecimal.NewFromInt(int64(e.SideEffectArgs[2])),
|
||||
})
|
||||
return true
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
"blazing/logic/service/fight/input"
|
||||
"blazing/logic/service/fight/node"
|
||||
|
||||
"github.com/govalues/decimal"
|
||||
"github.com/alpacahq/alpacadecimal"
|
||||
)
|
||||
|
||||
/**
|
||||
@@ -33,6 +33,6 @@ func (e *Effect77) OnSkill() bool {
|
||||
if !e.Hit() {
|
||||
return true
|
||||
}
|
||||
e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, decimal.NewFromInt(int64(e.Args()[1])))
|
||||
e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, alpacadecimal.NewFromInt(int64(e.Args()[1])))
|
||||
return true
|
||||
}
|
||||
|
||||
@@ -4,9 +4,6 @@ import (
|
||||
"blazing/logic/service/fight/info"
|
||||
"blazing/logic/service/fight/input"
|
||||
"blazing/logic/service/fight/node"
|
||||
"fmt"
|
||||
|
||||
"github.com/govalues/decimal"
|
||||
)
|
||||
|
||||
// ---- Effect776 ----
|
||||
@@ -19,13 +16,13 @@ func (e *Effect776) Damage_Mul(t *info.DamageZone) bool {
|
||||
if !e.Hit() {
|
||||
return true
|
||||
}
|
||||
fmt.Println("Effect776_o", t.Damage)
|
||||
|
||||
if t.Type == info.DamageType.Red {
|
||||
|
||||
t.Damage = t.Damage.Mul(decimal.NewFromInt(2))
|
||||
t.Mul(2)
|
||||
|
||||
}
|
||||
fmt.Println("Effect776_n", t.Damage)
|
||||
|
||||
return true
|
||||
}
|
||||
func (e *Effect776) SetArgs(t *input.Input, a ...int) {
|
||||
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
"blazing/logic/service/fight/input"
|
||||
"blazing/logic/service/fight/node"
|
||||
|
||||
"github.com/govalues/decimal"
|
||||
"github.com/alpacahq/alpacadecimal"
|
||||
)
|
||||
|
||||
/**
|
||||
@@ -33,7 +33,7 @@ func (e *Effect79) OnSkill() bool {
|
||||
e.Ctx().Our.SetProp(e.Ctx().Our, 5, 1, info.AbilityOpType.ADD)
|
||||
e.Ctx().Our.Damage(e.Ctx().Our, &info.DamageZone{
|
||||
Type: info.DamageType.Fixed,
|
||||
Damage: decimal.NewFromInt(int64(e.Ctx().Our.CurrentPet.Info.MaxHp)).Div(decimal.NewFromInt(2)),
|
||||
Damage: alpacadecimal.NewFromInt(int64(e.Ctx().Our.CurrentPet.Info.MaxHp)).Div(alpacadecimal.NewFromInt(2)),
|
||||
})
|
||||
return true
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ import (
|
||||
"blazing/logic/service/fight/input"
|
||||
"blazing/logic/service/fight/node"
|
||||
|
||||
"github.com/govalues/decimal"
|
||||
"github.com/alpacahq/alpacadecimal"
|
||||
)
|
||||
|
||||
/**
|
||||
@@ -25,7 +25,7 @@ type Effect8 struct {
|
||||
// 伤害落实前触发,限制最大伤害
|
||||
func (e *Effect8) Damage_Lock(t *info.DamageZone) bool {
|
||||
if t.Type == info.DamageType.Red {
|
||||
t.Damage = decimal.NewFromInt(utils.Min(t.Damage.IntPart(),
|
||||
t.Damage = alpacadecimal.NewFromInt(utils.Min(t.Damage.IntPart(),
|
||||
int64(e.Ctx().Opp.CurrentPet.Info.Hp)-1))
|
||||
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
"blazing/logic/service/fight/input"
|
||||
"blazing/logic/service/fight/node"
|
||||
|
||||
"github.com/govalues/decimal"
|
||||
"github.com/alpacahq/alpacadecimal"
|
||||
)
|
||||
|
||||
/**
|
||||
@@ -28,7 +28,7 @@ func (e *Effect80) OnSkill() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
att := decimal.NewFromInt(int64(e.Ctx().Our.CurrentPet.Info.MaxHp)).Div(decimal.NewFromInt(2))
|
||||
att := e.Ctx().Our.CurrentPet.GetMaxHP().Div(alpacadecimal.NewFromInt(2))
|
||||
e.Ctx().Our.Damage(e.Ctx().Our, &info.DamageZone{
|
||||
Type: info.DamageType.Fixed,
|
||||
Damage: att,
|
||||
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
"blazing/logic/service/fight/input"
|
||||
"blazing/logic/service/fight/node"
|
||||
|
||||
"github.com/govalues/decimal"
|
||||
"github.com/alpacahq/alpacadecimal"
|
||||
)
|
||||
|
||||
/**
|
||||
@@ -34,7 +34,7 @@ func (e *Effect88) Damage_Mul(t *info.DamageZone) bool {
|
||||
}
|
||||
if t.Type == info.DamageType.Red {
|
||||
|
||||
t.Damage = t.Damage.Mul(decimal.NewFromInt(int64(e.SideEffectArgs[1])))
|
||||
t.Damage = t.Damage.Mul(alpacadecimal.NewFromInt(int64(e.SideEffectArgs[1])))
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
"blazing/logic/service/fight/input"
|
||||
"blazing/logic/service/fight/node"
|
||||
|
||||
"github.com/govalues/decimal"
|
||||
"github.com/alpacahq/alpacadecimal"
|
||||
)
|
||||
|
||||
/**
|
||||
@@ -37,7 +37,7 @@ func (e *Effect89) Skill_Useed() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, e.Ctx().Our.SumDamage.Div(decimal.NewFromInt(int64(e.Args()[1]))))
|
||||
e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, e.Ctx().Our.SumDamage.Div(alpacadecimal.NewFromInt(int64(e.Args()[1]))))
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
"blazing/logic/service/fight/input"
|
||||
"blazing/logic/service/fight/node"
|
||||
|
||||
"github.com/govalues/decimal"
|
||||
"github.com/alpacahq/alpacadecimal"
|
||||
)
|
||||
|
||||
/**
|
||||
@@ -34,7 +34,7 @@ func (e *Effect93) OnSkill() bool {
|
||||
}
|
||||
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{
|
||||
Type: info.DamageType.Fixed,
|
||||
Damage: decimal.NewFromInt(int64(e.SideEffectArgs[1])),
|
||||
Damage: alpacadecimal.NewFromInt(int64(e.SideEffectArgs[1])),
|
||||
})
|
||||
return true
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
"blazing/logic/service/fight/input"
|
||||
"blazing/logic/service/fight/node"
|
||||
|
||||
"github.com/govalues/decimal"
|
||||
"github.com/alpacahq/alpacadecimal"
|
||||
)
|
||||
|
||||
/**
|
||||
@@ -34,7 +34,7 @@ func (e *Effect98) Damage_Mul(t *info.DamageZone) bool {
|
||||
|
||||
if t.Type == info.DamageType.Red {
|
||||
|
||||
t.Damage = t.Damage.Mul(decimal.NewFromInt(int64(e.SideEffectArgs[1])))
|
||||
t.Damage = t.Damage.Mul(alpacadecimal.NewFromInt(int64(e.SideEffectArgs[1])))
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
"blazing/logic/service/fight/input"
|
||||
"blazing/logic/service/fight/node"
|
||||
|
||||
"github.com/govalues/decimal"
|
||||
"github.com/alpacahq/alpacadecimal"
|
||||
)
|
||||
|
||||
// -----------------------------------------------------------
|
||||
@@ -72,7 +72,7 @@ func (e *EffectConditionalAddDamage) OnSkill() bool {
|
||||
}
|
||||
|
||||
// 4. 附加固定伤害(从SideEffectArgs[0]获取伤害值)
|
||||
damageValue := decimal.NewFromInt(int64(e.SideEffectArgs[0]))
|
||||
damageValue := alpacadecimal.NewFromInt(int64(e.SideEffectArgs[0]))
|
||||
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{
|
||||
Type: info.DamageType.Fixed,
|
||||
Damage: damageValue,
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"blazing/logic/service/fight/input"
|
||||
"blazing/logic/service/fight/node"
|
||||
|
||||
"github.com/govalues/decimal"
|
||||
"github.com/alpacahq/alpacadecimal"
|
||||
)
|
||||
|
||||
// 修正拼写错误:BaseSataus -> BaseStatus
|
||||
@@ -76,9 +76,9 @@ func (e *ContinuousDamage) Action_start(attacker, defender *action.SelectSkillAc
|
||||
}
|
||||
|
||||
// 计算伤害:最大生命值的1/8
|
||||
func (e *ContinuousDamage) calculateDamage() decimal.Decimal {
|
||||
return decimal.NewFromUint64(uint64(e.Ctx().Our.CurrentPet.Info.MaxHp)).
|
||||
Div(decimal.NewFromInt(8))
|
||||
func (e *ContinuousDamage) calculateDamage() alpacadecimal.Decimal {
|
||||
return alpacadecimal.NewFromInt(int64(e.Ctx().Our.CurrentPet.Info.MaxHp)).
|
||||
Div(alpacadecimal.NewFromInt(8))
|
||||
}
|
||||
|
||||
type Burned struct {
|
||||
@@ -100,8 +100,8 @@ type ParasiticSeed struct {
|
||||
func (e *ParasiticSeed) Action_start_ex(attacker, defender *action.SelectSkillAction) bool {
|
||||
// 过滤特定类型单位(假设1是植物类型,使用枚举替代魔法数字)
|
||||
|
||||
damage := decimal.NewFromUint64(uint64(e.Ctx().Our.CurrentPet.Info.MaxHp)).
|
||||
Div(decimal.NewFromInt(8))
|
||||
damage := alpacadecimal.NewFromInt(int64(e.Ctx().Our.CurrentPet.Info.MaxHp)).
|
||||
Div(alpacadecimal.NewFromInt(8))
|
||||
|
||||
// 对我方造成真实伤害
|
||||
e.Ctx().Our.Damage(e.Input, &info.DamageZone{
|
||||
@@ -165,7 +165,7 @@ func (e *Confused) Action_start(fattack *action.SelectSkillAction, sattack *acti
|
||||
|
||||
e.Ctx().Our.Damage(e.Ctx().Our, &info.DamageZone{
|
||||
Type: info.DamageType.Fixed,
|
||||
Damage: decimal.NewFromInt(50),
|
||||
Damage: alpacadecimal.NewFromInt(50),
|
||||
})
|
||||
return true
|
||||
|
||||
@@ -178,13 +178,13 @@ type Weakened struct {
|
||||
func (e *Weakened) Damage_DIV_ex(t *info.DamageZone) bool {
|
||||
// 1. 定义衰弱等级对应的倍率表(索引对应等级,0级无倍率)
|
||||
// 索引0: 0%(未衰弱)、1:25%、2:50%、3:100%、4:250%、5:500%
|
||||
weakenedMultiples := []decimal.Decimal{
|
||||
decimal.NewFromInt(0), // 0级
|
||||
decimal.NewFromFloat(0.25), // 1级(25%)
|
||||
decimal.NewFromFloat(0.5), // 2级(50%)
|
||||
decimal.NewFromFloat(1.0), // 3级(100%)
|
||||
decimal.NewFromFloat(2.5), // 4级(250%)
|
||||
decimal.NewFromFloat(5.0), // 5级(500%)
|
||||
weakenedMultiples := []alpacadecimal.Decimal{
|
||||
alpacadecimal.NewFromInt(0), // 0级
|
||||
alpacadecimal.NewFromFloat(0.25), // 1级(25%)
|
||||
alpacadecimal.NewFromFloat(0.5), // 2级(50%)
|
||||
alpacadecimal.NewFromFloat(1.0), // 3级(100%)
|
||||
alpacadecimal.NewFromFloat(2.5), // 4级(250%)
|
||||
alpacadecimal.NewFromFloat(5.0), // 5级(500%)
|
||||
}
|
||||
|
||||
// 2. 校验并限制衰弱等级(≤0 直接返回,≥5 按5级算)
|
||||
|
||||
@@ -11,8 +11,8 @@ import (
|
||||
"fmt"
|
||||
"reflect"
|
||||
|
||||
"github.com/alpacahq/alpacadecimal"
|
||||
"github.com/barkimedes/go-deepcopy"
|
||||
"github.com/govalues/decimal"
|
||||
)
|
||||
|
||||
// 处理技能攻击逻辑
|
||||
@@ -68,7 +68,7 @@ func (f *FightC) processSkillAttack(attacker, defender *input.Input, a *info.Ski
|
||||
}
|
||||
|
||||
//暴击翻倍
|
||||
attacker.SumDamage = attacker.SumDamage.Mul(decimal.NewFromInt(2))
|
||||
attacker.SumDamage = attacker.SumDamage.Mul(alpacadecimal.NewFromInt(2))
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"math/rand"
|
||||
"sync"
|
||||
|
||||
"github.com/govalues/decimal"
|
||||
"github.com/alpacahq/alpacadecimal"
|
||||
)
|
||||
|
||||
// 战斗属性类型
|
||||
@@ -79,14 +79,14 @@ func CalculateRealValue(value int, stat int) int {
|
||||
return r
|
||||
}
|
||||
}
|
||||
func (u *BattlePetEntity) GetHP() decimal.Decimal {
|
||||
func (u *BattlePetEntity) GetHP() alpacadecimal.Decimal {
|
||||
|
||||
return decimal.NewFromInt(int64(u.Info.Hp))
|
||||
return alpacadecimal.NewFromInt(int64(u.Info.Hp))
|
||||
|
||||
}
|
||||
func (u *BattlePetEntity) GetMaxHP() decimal.Decimal {
|
||||
func (u *BattlePetEntity) GetMaxHP() alpacadecimal.Decimal {
|
||||
|
||||
return decimal.NewFromInt(int64(u.Info.MaxHp))
|
||||
return alpacadecimal.NewFromInt(int64(u.Info.MaxHp))
|
||||
|
||||
}
|
||||
func (u *BattlePetEntity) GetType() *element.ElementCombination {
|
||||
|
||||
@@ -9,7 +9,9 @@ import (
|
||||
"fmt"
|
||||
"strconv"
|
||||
|
||||
"github.com/govalues/decimal"
|
||||
"github.com/alpacahq/alpacadecimal"
|
||||
"github.com/shopspring/decimal"
|
||||
|
||||
"github.com/tnnmigga/enum"
|
||||
)
|
||||
|
||||
@@ -39,7 +41,12 @@ var DamageType = enum.New[struct {
|
||||
|
||||
type DamageZone struct {
|
||||
Type EnumDamageType
|
||||
Damage decimal.Decimal
|
||||
Damage alpacadecimal.Decimal
|
||||
}
|
||||
|
||||
func (d *DamageZone) Mul(n int) {
|
||||
d.Damage = d.Damage.Mul(alpacadecimal.NewFromInt(int64(n)))
|
||||
|
||||
}
|
||||
|
||||
// SkillEntity 战斗技能实体
|
||||
@@ -181,9 +188,9 @@ func (s *SkillEntity) AttackTimeC(level int) uint32 {
|
||||
}
|
||||
return s.AttackTime
|
||||
}
|
||||
func (s *SkillEntity) CriticalsameTypeBonus() decimal.Decimal {
|
||||
func (s *SkillEntity) CriticalsameTypeBonus() alpacadecimal.Decimal {
|
||||
// 同系加成默认倍率为1.0
|
||||
sameTypeBonus := decimal.NewFromFloat(1.0)
|
||||
sameTypeBonus := alpacadecimal.NewFromFloat(1.0)
|
||||
|
||||
skillType := s.GetType()
|
||||
petType := s.Pet.GetType()
|
||||
@@ -205,7 +212,7 @@ func (s *SkillEntity) CriticalsameTypeBonus() decimal.Decimal {
|
||||
for _, pa := range petAttrs {
|
||||
if sa == pa {
|
||||
// 存在匹配属性,触发1.5倍加成
|
||||
sameTypeBonus = decimal.NewFromFloat(1.5)
|
||||
sameTypeBonus = alpacadecimal.NewFromFloat(1.5)
|
||||
return sameTypeBonus // 一旦匹配,直接返回,避免多余循环
|
||||
}
|
||||
}
|
||||
@@ -214,11 +221,11 @@ func (s *SkillEntity) CriticalsameTypeBonus() decimal.Decimal {
|
||||
return sameTypeBonus
|
||||
}
|
||||
|
||||
func (s *SkillEntity) Criticalrandom() decimal.Decimal {
|
||||
func (s *SkillEntity) Criticalrandom() alpacadecimal.Decimal {
|
||||
|
||||
randomnum := s.Rand.Int31n(39) + 217
|
||||
// 10. 随机倍率,随机值除以255
|
||||
randomFactor := decimal.NewFromInt(int64(randomnum)).Div(decimal.NewFromInt(255))
|
||||
randomFactor := alpacadecimal.NewFromInt(int64(randomnum)).Div(alpacadecimal.NewFromInt(255))
|
||||
return randomFactor
|
||||
|
||||
}
|
||||
|
||||
@@ -8,8 +8,8 @@ import (
|
||||
"blazing/logic/service/fight/action"
|
||||
"blazing/logic/service/fight/info"
|
||||
|
||||
"github.com/alpacahq/alpacadecimal"
|
||||
"github.com/gogf/gf/v2/util/grand"
|
||||
"github.com/govalues/decimal"
|
||||
)
|
||||
|
||||
// 计算暴击
|
||||
@@ -46,7 +46,7 @@ func (our *Input) CalculateCrit(opp *Input, skill *info.SkillEntity) {
|
||||
}
|
||||
|
||||
// 恢复血量
|
||||
func (our *Input) Heal(in *Input, ac action.BattleActionI, value decimal.Decimal) {
|
||||
func (our *Input) Heal(in *Input, ac action.BattleActionI, value alpacadecimal.Decimal) {
|
||||
|
||||
//使用道具回血
|
||||
if _, ok := ac.(*action.UseItemAction); !ok &&
|
||||
@@ -214,13 +214,13 @@ func (our *Input) GetAction(opp *Input) {
|
||||
|
||||
// 步骤1:计算所有技能的伤害,并筛选出能秒杀对方的技能
|
||||
var killableSkills []struct {
|
||||
*info.SkillEntity // 技能对象(假设原技能类型为skill)
|
||||
damage decimal.Decimal // 技能实际伤害
|
||||
*info.SkillEntity // 技能对象(假设原技能类型为skill)
|
||||
damage alpacadecimal.Decimal // 技能实际伤害
|
||||
}
|
||||
// 存储所有技能及伤害(用于后续筛选)
|
||||
type skillWithDamage struct {
|
||||
*info.SkillEntity
|
||||
damage decimal.Decimal
|
||||
damage alpacadecimal.Decimal
|
||||
}
|
||||
allSkills := make([]skillWithDamage, 0, len(skills))
|
||||
|
||||
@@ -240,7 +240,7 @@ func (our *Input) GetAction(opp *Input) {
|
||||
if uint32(damage.IntPart()) >= opp.CurrentPet.Info.Hp { // 假设oppPet.HP为对方当前剩余生命值
|
||||
killableSkills = append(killableSkills, struct {
|
||||
*info.SkillEntity
|
||||
damage decimal.Decimal
|
||||
damage alpacadecimal.Decimal
|
||||
}{s, damage})
|
||||
}
|
||||
}
|
||||
@@ -277,71 +277,72 @@ func (our *Input) GetAction(opp *Input) {
|
||||
}
|
||||
|
||||
// 计算技能威力
|
||||
func (our *Input) CalculatePower(deftype *Input, skill *info.SkillEntity) decimal.Decimal {
|
||||
func (our *Input) CalculatePower(deftype *Input, skill *info.SkillEntity) alpacadecimal.Decimal {
|
||||
|
||||
// 1. 计算等级因子 (level * 0.4 + 2)
|
||||
levelFactor := decimal.NewFromInt(int64(our.CurrentPet.Info.Level)).
|
||||
Mul(decimal.NewFromFloat(0.4)).Add(decimal.NewFromInt(2))
|
||||
levelFactor := alpacadecimal.NewFromInt(int64(our.CurrentPet.Info.Level)).
|
||||
Mul(alpacadecimal.NewFromFloat(0.4)).Add(alpacadecimal.NewFromInt(2))
|
||||
|
||||
var (
|
||||
attackDec decimal.Decimal //攻击值
|
||||
defenseDec decimal.Decimal //防御值
|
||||
attackDec alpacadecimal.Decimal //攻击值
|
||||
defenseDec alpacadecimal.Decimal //防御值
|
||||
|
||||
)
|
||||
|
||||
switch skill.Category() { //判断技能类型
|
||||
case info.Category.PHYSICAL:
|
||||
attackDec = decimal.NewFromInt(int64(our.GetProp(0, false)))
|
||||
defenseDec = decimal.NewFromInt(int64(deftype.GetProp(1, false)))
|
||||
attackDec = alpacadecimal.NewFromInt(int64(our.GetProp(0, false)))
|
||||
defenseDec = alpacadecimal.NewFromInt(int64(deftype.GetProp(1, false)))
|
||||
|
||||
case info.Category.SPECIAL:
|
||||
|
||||
attackDec = decimal.NewFromInt(int64(our.GetProp(2, false)))
|
||||
defenseDec = decimal.NewFromInt(int64(deftype.GetProp(3, false)))
|
||||
attackDec = alpacadecimal.NewFromInt(int64(our.GetProp(2, false)))
|
||||
defenseDec = alpacadecimal.NewFromInt(int64(deftype.GetProp(3, false)))
|
||||
|
||||
default:
|
||||
return decimal.NewFromInt(0)
|
||||
return alpacadecimal.NewFromInt(0)
|
||||
}
|
||||
|
||||
// 5. 基础伤害公式:等级因子 * 威力因子 * 攻击 / 防御 / 50 + 2
|
||||
baseDamage := levelFactor.
|
||||
Mul(decimal.NewFromInt(int64(skill.Power))).
|
||||
Mul(alpacadecimal.NewFromInt(int64(skill.Power))).
|
||||
Mul(attackDec).
|
||||
Div(defenseDec).
|
||||
Div(decimal.NewFromInt(50)).
|
||||
Add(decimal.NewFromInt(2))
|
||||
Div(alpacadecimal.NewFromInt(50)).
|
||||
Add(alpacadecimal.NewFromInt(2))
|
||||
|
||||
var typeRate decimal.Decimal
|
||||
var typeRate alpacadecimal.Decimal
|
||||
//fmt.Println(skill.Type().ID, deftype.CurrentPet.Type().ID)
|
||||
t, _ := element.Calculator.GetOffensiveMultiplier(skill.GetType().ID, deftype.CurrentPet.GetType().ID)
|
||||
|
||||
typeRate = decimal.NewFromFloat(t)
|
||||
typeRate = alpacadecimal.NewFromFloat(t)
|
||||
// 8. DmgBindLv: 使对方受到的伤害值等于等级; 默认: 0
|
||||
// 9. PwrBindDv: 1,威力(power)取决于潜力(个体值)*5; 2,威力(power)取决于最大体力*1/3+潜力(个体值); 默认: 0
|
||||
// 10. PwrDouble: 攻击时,若对方处于异常状态, 则威力翻倍;
|
||||
// 11. DmgBindHpDv: 造成的伤害等于自身剩余体力*1/2+潜力(个体值); 默认: 0
|
||||
if skill.DmgBindLv != 0 {
|
||||
baseDamage = decimal.NewFromInt(int64(deftype.CurrentPet.Info.Level))
|
||||
baseDamage = alpacadecimal.NewFromInt(int64(deftype.CurrentPet.Info.Level))
|
||||
|
||||
}
|
||||
if skill.PwrBindDv != 0 {
|
||||
if skill.PwrBindDv == 1 {
|
||||
baseDamage = decimal.NewFromInt(int64(our.CurrentPet.Info.Dv * 5))
|
||||
|
||||
baseDamage = alpacadecimal.NewFromInt(int64(our.CurrentPet.Info.Dv * 5))
|
||||
}
|
||||
if skill.PwrBindDv == 2 {
|
||||
baseDamage = decimal.NewFromInt(int64(our.CurrentPet.Info.Hp/3 + our.CurrentPet.Info.Dv))
|
||||
baseDamage = alpacadecimal.NewFromInt(int64(our.CurrentPet.Info.Hp/3 + our.CurrentPet.Info.Dv))
|
||||
}
|
||||
|
||||
}
|
||||
if skill.PwrDouble != 0 {
|
||||
|
||||
if deftype.StatEffect_Exist_all() {
|
||||
baseDamage = baseDamage.Mul(decimal.NewFromInt(2))
|
||||
baseDamage = baseDamage.Mul(alpacadecimal.NewFromInt(2))
|
||||
}
|
||||
|
||||
}
|
||||
if skill.DmgBindHpDv != 0 {
|
||||
baseDamage = decimal.NewFromInt(int64(our.CurrentPet.Info.Hp/2 + our.CurrentPet.Info.Dv))
|
||||
baseDamage = alpacadecimal.NewFromInt(int64(our.CurrentPet.Info.Hp/2 + our.CurrentPet.Info.Dv))
|
||||
|
||||
}
|
||||
damage := baseDamage.
|
||||
|
||||
@@ -8,7 +8,8 @@ import (
|
||||
"blazing/logic/service/fight/action"
|
||||
"blazing/logic/service/fight/info"
|
||||
|
||||
"github.com/govalues/decimal"
|
||||
"github.com/alpacahq/alpacadecimal"
|
||||
|
||||
"github.com/jinzhu/copier"
|
||||
)
|
||||
|
||||
@@ -27,7 +28,7 @@ type Input struct {
|
||||
EffectCache []Effect //这里是命中前执行的容器,也就是命中前执行的所有逻辑相关,理论上一个effect被激活,就应该同时将其他的effect取消激活
|
||||
Effect_Lost []Effect
|
||||
// 删掉伤害记录,可以在回调中记录,而不是每次调用记录
|
||||
SumDamage decimal.Decimal //伤害
|
||||
SumDamage alpacadecimal.Decimal //伤害
|
||||
// DamageZone struct {
|
||||
// Damage decimal.Decimal //伤害
|
||||
// BeforeADD decimal.Decimal //攻击伤害
|
||||
@@ -134,7 +135,7 @@ func (our *Input) ResetAttackValue() {
|
||||
our.AttackValue.IsCritical = 0
|
||||
our.AttackValue.GainHp = 0
|
||||
our.AttackValue.LostHp = 0
|
||||
our.SumDamage = decimal.NewFromInt(0)
|
||||
our.SumDamage = alpacadecimal.NewFromInt(0)
|
||||
//our.CanUseSkill = true
|
||||
}
|
||||
|
||||
|
||||
@@ -14,8 +14,8 @@ import (
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
"github.com/alpacahq/alpacadecimal"
|
||||
"github.com/gogf/gf/v2/util/gconv"
|
||||
"github.com/govalues/decimal"
|
||||
)
|
||||
|
||||
func (f *FightC) battleLoop() {
|
||||
@@ -278,7 +278,7 @@ func (f *FightC) handleItemAction(a *action.UseItemAction) {
|
||||
return true
|
||||
})
|
||||
|
||||
f.GetInputByAction(a, false).Heal(f.GetInputByAction(a, false), a, decimal.NewFromInt(int64(addhp)))
|
||||
f.GetInputByAction(a, false).Heal(f.GetInputByAction(a, false), a, alpacadecimal.NewFromInt(int64(addhp)))
|
||||
f.Broadcast(func(ff *input.Input) {
|
||||
ff.Player.SendPackCmd(2406, &info.UsePetIteminfo{
|
||||
UserID: f.GetInputByAction(a, false).UserID,
|
||||
|
||||
@@ -1,15 +1,17 @@
|
||||
module blazing/modules/base
|
||||
|
||||
go 1.18
|
||||
go 1.20
|
||||
|
||||
require (
|
||||
github.com/gogf/gf/v2 v2.8.0
|
||||
github.com/golang-jwt/jwt/v4 v4.5.0
|
||||
github.com/xiaoqidun/qqwry v0.0.0-20251127085533-cc141ac4f5de
|
||||
)
|
||||
|
||||
require (
|
||||
github.com/dolthub/maphash v0.1.0 // indirect
|
||||
github.com/hashicorp/golang-lru v1.0.2 // indirect
|
||||
github.com/emirpasic/gods v1.18.1 // indirect
|
||||
github.com/ipipdotnet/ipdb-go v1.3.3 // indirect
|
||||
github.com/klauspost/compress v1.17.9 // indirect
|
||||
github.com/stretchr/testify v1.11.1 // indirect
|
||||
)
|
||||
@@ -21,7 +23,7 @@ require (
|
||||
github.com/fsnotify/fsnotify v1.7.0 // indirect
|
||||
github.com/go-logr/logr v1.4.2 // indirect
|
||||
github.com/go-logr/stdr v1.2.2 // indirect
|
||||
github.com/gorilla/websocket v1.5.1 // indirect
|
||||
github.com/gorilla/websocket v1.5.3 // indirect
|
||||
github.com/grokify/html-strip-tags-go v0.1.0 // indirect
|
||||
github.com/kr/pretty v0.3.1 // indirect
|
||||
github.com/lxzan/gws v1.8.9
|
||||
@@ -38,7 +40,7 @@ require (
|
||||
go.opentelemetry.io/otel/trace v1.24.0 // indirect
|
||||
golang.org/x/net v0.33.0 // indirect
|
||||
golang.org/x/sys v0.30.0 // indirect
|
||||
golang.org/x/text v0.22.0 // indirect
|
||||
golang.org/x/text v0.31.0 // indirect
|
||||
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
|
||||
gopkg.in/yaml.v3 v3.0.1 // indirect
|
||||
)
|
||||
|
||||
@@ -7,6 +7,8 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c
|
||||
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/dolthub/maphash v0.1.0 h1:bsQ7JsF4FkkWyrP3oCnFJgrCUAFbFf3kOl4L/QxPDyQ=
|
||||
github.com/dolthub/maphash v0.1.0/go.mod h1:gkg4Ch4CdCDu5h6PMriVLawB7koZ+5ijb9puGMV50a4=
|
||||
github.com/emirpasic/gods v1.18.1 h1:FXtiHYKDGKCW2KzwZKx0iC0PQmdlorYgdFG9jPXJ1Bc=
|
||||
github.com/emirpasic/gods v1.18.1/go.mod h1:8tpGGwCnJ5H4r6BWwaV6OrWmMoPhUl5jm/FMNAnJvWQ=
|
||||
github.com/fatih/color v1.18.0 h1:S8gINlzdQ840/4pfAwic/ZE0djQEH3wM94VfqLTZcOM=
|
||||
github.com/fatih/color v1.18.0/go.mod h1:4FelSpRwEGDpQ12mAdzqdOukCy4u8WUtOY6lkT/6HfU=
|
||||
github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA=
|
||||
@@ -16,16 +18,18 @@ github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY=
|
||||
github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
|
||||
github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=
|
||||
github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE=
|
||||
|
||||
github.com/gogf/gf/v2 v2.8.0 h1:CgNDoLFQCBxQaWOoGMzgU068T+tm0t/eNUgLV2wPJag=
|
||||
github.com/gogf/gf/v2 v2.8.0/go.mod h1:6iYuZZ+A0ZcH8+4MDS/P0SvTPCvKzRvyAsY1kbkJYJc=
|
||||
github.com/golang-jwt/jwt/v4 v4.5.0 h1:7cYmW1XlMY7h7ii7UhUyChSgS5wUJEnm9uZVTGqOWzg=
|
||||
github.com/golang-jwt/jwt/v4 v4.5.0/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0=
|
||||
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
|
||||
github.com/gorilla/websocket v1.5.1 h1:gmztn0JnHVt9JZquRuzLw3g4wouNVzKL15iLr/zn/QY=
|
||||
github.com/gorilla/websocket v1.5.1/go.mod h1:x3kM2JMyaluk02fnUJpQuwD2dCS5NDG2ZHL0uE0tcaY=
|
||||
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
|
||||
github.com/gorilla/websocket v1.5.3 h1:saDtZ6Pbx/0u+bgYQ3q96pZgCzfhKXGPqt7kZ72aNNg=
|
||||
github.com/gorilla/websocket v1.5.3/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
|
||||
github.com/grokify/html-strip-tags-go v0.1.0 h1:03UrQLjAny8xci+R+qjCce/MYnpNXCtgzltlQbOBae4=
|
||||
github.com/grokify/html-strip-tags-go v0.1.0/go.mod h1:ZdzgfHEzAfz9X6Xe5eBLVblWIxXfYSQ40S/VKrAOGpc=
|
||||
github.com/hashicorp/golang-lru v1.0.2 h1:dV3g9Z/unq5DpblPpw+Oqcv4dU/1omnb4Ok8iPY6p1c=
|
||||
github.com/hashicorp/golang-lru v1.0.2/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4=
|
||||
github.com/ipipdotnet/ipdb-go v1.3.3 h1:GLSAW9ypLUd6EF9QNK2Uhxew9Jzs4XMJ9gOZEFnJm7U=
|
||||
github.com/ipipdotnet/ipdb-go v1.3.3/go.mod h1:yZ+8puwe3R37a/3qRftXo40nZVQbxYDLqls9o5foexs=
|
||||
github.com/klauspost/compress v1.17.9 h1:6KIumPrER1LHsvBVuDa0r5xaG0Es51mhhB9BQB2qeMA=
|
||||
github.com/klauspost/compress v1.17.9/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw=
|
||||
github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
|
||||
@@ -60,6 +64,8 @@ github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDN
|
||||
github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA=
|
||||
github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U=
|
||||
github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U=
|
||||
github.com/xiaoqidun/qqwry v0.0.0-20251127085533-cc141ac4f5de h1:wnVVQPzICTzakqclYk8cMWWAcaFVBmZAiNZ+vMRpWsU=
|
||||
github.com/xiaoqidun/qqwry v0.0.0-20251127085533-cc141ac4f5de/go.mod h1:9sdpx90hJhtHcY8cfEMVXw203RpHIIe7AHBBiRh1PkI=
|
||||
go.opentelemetry.io/otel v1.24.0 h1:0LAOdjNmQeSTzGBzduGe/rU4tZhMwL5rWgtp9Ku5Jfo=
|
||||
go.opentelemetry.io/otel v1.24.0/go.mod h1:W7b9Ozg4nkF5tWI5zsXkaKKDjdVjpD4oAt9Qi/MArHo=
|
||||
go.opentelemetry.io/otel/metric v1.24.0 h1:6EhoGWWK28x1fbpA4tYTOWBkPefTDQnb8WSGXlc88kI=
|
||||
@@ -74,8 +80,8 @@ golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBc
|
||||
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.30.0 h1:QjkSwP/36a20jFYWkSue1YwXzLmsV5Gfq7Eiy72C1uc=
|
||||
golang.org/x/sys v0.30.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||
golang.org/x/text v0.22.0 h1:bofq7m3/HAFvbF51jz3Q9wLg3jkvSPuiZu/pD1XwgtM=
|
||||
golang.org/x/text v0.22.0/go.mod h1:YRoo4H8PVmsu+E3Ou7cqLVH8oXWIHVoX0jqUWALQhfY=
|
||||
golang.org/x/text v0.31.0 h1:aC8ghyu4JhP8VojJ2lEHBnochRno1sgL6nEi9WGFGMM=
|
||||
golang.org/x/text v0.31.0/go.mod h1:tKRAlv61yKIjGGHX/4tP1LTbc13YSec1pxVEWXzfoeM=
|
||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
|
||||
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
module blazing/modules/blazing
|
||||
|
||||
go 1.18
|
||||
go 1.20
|
||||
|
||||
require (
|
||||
github.com/gogf/gf/v2 v2.8.0
|
||||
@@ -12,11 +12,13 @@ require (
|
||||
github.com/emirpasic/gods v1.18.1 // indirect
|
||||
github.com/go-sourcemap/sourcemap v2.1.3+incompatible // indirect
|
||||
github.com/google/pprof v0.0.0-20230207041349-798e818bf904 // indirect
|
||||
github.com/shopspring/decimal v1.3.1 // indirect
|
||||
github.com/stretchr/testify v1.11.1 // indirect
|
||||
)
|
||||
|
||||
require (
|
||||
github.com/BurntSushi/toml v1.4.0 // indirect
|
||||
github.com/alpacahq/alpacadecimal v0.0.8
|
||||
github.com/clbanning/mxj/v2 v2.7.0 // indirect
|
||||
github.com/creasty/defaults v1.8.0
|
||||
github.com/dop251/goja v0.0.0-20251008123653-cf18d89f3cf6
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
github.com/BurntSushi/toml v1.4.0 h1:kuoIxZQy2WRRk1pttg9asf+WVv6tWQuBNVmK8+nqPr0=
|
||||
github.com/BurntSushi/toml v1.4.0/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho=
|
||||
github.com/Masterminds/semver/v3 v3.2.1 h1:RN9w6+7QoMeJVGyfmbcgs28Br8cvmnucEXnY0rYXWg0=
|
||||
github.com/alpacahq/alpacadecimal v0.0.8 h1:DZlC1dfZT7dX9ljDmayVVlIvYb3ljglQd/Xq64aetDk=
|
||||
github.com/alpacahq/alpacadecimal v0.0.8/go.mod h1:RGlrk0IdAzlsqnONx7wnfvhO5g/9parrcU3HELvbfSI=
|
||||
github.com/clbanning/mxj/v2 v2.7.0 h1:WA/La7UGCanFe5NpHF0Q3DNtnCsVoxbPKuyBNHWRyME=
|
||||
github.com/clbanning/mxj/v2 v2.7.0/go.mod h1:hNiWqW14h+kc+MdF9C6/YoRfjEJoR3ou6tn/Qo+ve2s=
|
||||
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
|
||||
@@ -64,6 +66,8 @@ github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDN
|
||||
github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA=
|
||||
github.com/samber/lo v1.52.0 h1:Rvi+3BFHES3A8meP33VPAxiBZX/Aws5RxrschYGjomw=
|
||||
github.com/samber/lo v1.52.0/go.mod h1:4+MXEGsJzbKGaUEQFKBq2xtfuznW9oz/WrgyzMzRoM0=
|
||||
github.com/shopspring/decimal v1.3.1 h1:2Usl1nmF/WZucqkFZhnfFYxxxu8LG21F6nPQBE5gKV8=
|
||||
github.com/shopspring/decimal v1.3.1/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o=
|
||||
github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U=
|
||||
github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U=
|
||||
github.com/tnnmigga/enum v1.0.2 h1:Yvchx0Esc01X5HiphW78sKzH/RXKttdFsfPO1ARiOa4=
|
||||
|
||||
@@ -4,9 +4,9 @@ import (
|
||||
"blazing/cool"
|
||||
"blazing/modules/blazing/model"
|
||||
|
||||
"github.com/alpacahq/alpacadecimal"
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
"github.com/gogf/gf/v2/util/grand"
|
||||
"github.com/govalues/decimal"
|
||||
)
|
||||
|
||||
// PetFusionService 宠物融合配方主表Service(对应pet_fusion表)
|
||||
@@ -28,7 +28,7 @@ func NewPetFusionService() *PetFusionService {
|
||||
|
||||
func (s *PetFusionService) Data(p1, p2, rand uint32) uint32 {
|
||||
m := cool.DBM(s.Model)
|
||||
rand = uint32(decimal.NewFromInt(int64(rand)).Mul(decimal.NewFromFloat(0.5)).IntPart())
|
||||
rand = uint32(alpacadecimal.NewFromInt(int64(rand)).Mul(alpacadecimal.NewFromFloat(0.5)).IntPart())
|
||||
var pet []model.PetFusion //一个特性应该是唯一的,但是我们要获取默认随机特性
|
||||
condition := g.Map{
|
||||
"main_pet_id": p1,
|
||||
|
||||
Reference in New Issue
Block a user