mgmg 1.4.1 → 1.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/README.md +12 -2
- data/lib/mgmg/cuisine.rb +140 -0
- data/lib/mgmg/ir.rb +407 -373
- data/lib/mgmg/poly.rb +2 -2
- data/lib/mgmg/reinforce.rb +70 -0
- data/lib/mgmg/search.rb +21 -21
- data/lib/mgmg/utils.rb +25 -0
- data/lib/mgmg/version.rb +1 -1
- data/lib/mgmg.rb +29 -13
- data/reference.md +100 -15
- metadata +5 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 32ba0853f1b7578105ed06d7ebe4286544ae2a3188a2ab58c9d577b0e61bdd09
|
4
|
+
data.tar.gz: de86373a23cd69a9cbed9a9f28ce2fe0e10ef3dee1b7803a2eaeac154fda0cec
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 123076c3d2728af73cf53b1dbc9834d0eea262fcab89a454618b2e63798156c98d127a54dbb40e696af122064ad435a7794af165dc96a4ca883cf1a2c8256814
|
7
|
+
data.tar.gz: 79fe5ebb67a840611930042b9f75c21839d79d1b3164f59b88a88db66a4fdba719dda819414ecaa1fcf379507426f6776b99058f2329662b2838d001a94f0320
|
data/CHANGELOG.md
CHANGED
@@ -115,3 +115,8 @@
|
|
115
115
|
- `Mgmg.#find_lowerbound`, `Mgmg.#find_upperbound`を追加.
|
116
116
|
- 魔法の威力に対応する`Mgmg::Equip#magic2`を追加.
|
117
117
|
- `String#min_levels`およびその関連メソッドにおいて,重量1以外を指定できるようにした.
|
118
|
+
|
119
|
+
## 1.4.2 2022/06/09
|
120
|
+
- `Mgmg::Equip#reinforce`および`Mgmg::IR`を使うメソッド群に`reinforcement`キーワード引数を追加.
|
121
|
+
- スキルおよび料理による強化効果をシミュレートできるようになった.
|
122
|
+
- 料理については,プリセット料理名または`Mgmg.#cuisine`で生成される`Mgmg::Cuisine`オブジェクトを使う.
|
data/README.md
CHANGED
@@ -22,7 +22,7 @@ Excel版に比べ,入力のチェックがなされておらず,☆制限の
|
|
22
22
|
|
23
23
|
$ gem install mgmg
|
24
24
|
|
25
|
-
あるいは,http://cycloawaodorin.sakura.ne.jp/sonota/mgmg/mgmg.html
|
25
|
+
あるいは,[Ajax版](http://cycloawaodorin.sakura.ne.jp/sonota/mgmg/mgmg.html) を利用することもできます.Ajax版は一部の機能しか実装されていませんが,Ruby環境がない場合にも利用できます.
|
26
26
|
|
27
27
|
## 使い方
|
28
28
|
並列型多段合成杖を製作し,標準出力に出力する.
|
@@ -91,7 +91,17 @@ p [sc, Mgmg.exp(*sc)]
|
|
91
91
|
#=> [[155, 376], 304969]
|
92
92
|
```
|
93
93
|
|
94
|
-
|
94
|
+
探索の際,スキル及び料理を考慮する.
|
95
|
+
|
96
|
+
```ruby
|
97
|
+
r = '重鎧(皮2綿1)+[帽子(宝1宝1)+[重鎧(玉5金3)+[帽子(宝1宝1)+[重鎧(玉5金6)+[軽鎧(金3骨1)+[重鎧(皮2骨1)+軽鎧(鉄10綿1)]]]]]]'
|
98
|
+
sc = r.search(:phydef, 100_000, reinforcement: %w|物防御UP アースドランと氷河酒の蒸し焼き ガードアップ|)
|
99
|
+
p [sc, Mgmg.exp(*sc)]
|
100
|
+
#=> [[120, 264], 152502]
|
101
|
+
```
|
102
|
+
|
103
|
+
|
104
|
+
各メソッドの詳しい説明等は [リファレンス](./reference.md) を参照されたい.
|
95
105
|
|
96
106
|
### 表記ゆれについて
|
97
107
|
本ゲームでは,装備種別の名称に,下記の表のような表記ゆれが存在します.
|
data/lib/mgmg/cuisine.rb
ADDED
@@ -0,0 +1,140 @@
|
|
1
|
+
module Mgmg
|
2
|
+
using Refiner
|
3
|
+
class Cuisine
|
4
|
+
def initialize(vec)
|
5
|
+
@vec = vec
|
6
|
+
end
|
7
|
+
attr_accessor :vec
|
8
|
+
def initialize_copy(other)
|
9
|
+
@vec = other.vec.dup
|
10
|
+
end
|
11
|
+
|
12
|
+
def attack
|
13
|
+
@vec[0]
|
14
|
+
end
|
15
|
+
def phydef
|
16
|
+
@vec[1]
|
17
|
+
end
|
18
|
+
def magdef
|
19
|
+
@vec[2]
|
20
|
+
end
|
21
|
+
def to_s
|
22
|
+
"料理[攻撃:#{self.attack}, 物防:#{self.phydef}, 魔防:#{self.magdef}]"
|
23
|
+
end
|
24
|
+
alias :inspect :to_s
|
25
|
+
end
|
26
|
+
|
27
|
+
SystemCuisine = {
|
28
|
+
'焼き肉' => Cuisine.new( Vec[ 5, 0, 0] ), # ☆1
|
29
|
+
'焼き金肉' => Cuisine.new( Vec[10, 0, 0] ), # ☆3
|
30
|
+
'焼き黄金肉' => Cuisine.new( Vec[15, 0, 0] ), # ☆5
|
31
|
+
'焼きリンゴ' => Cuisine.new( Vec[ 0, 5, 0] ), # ☆1
|
32
|
+
'焼きイチゴ' => Cuisine.new( Vec[ 0, 10, 0] ), # ☆3
|
33
|
+
'焼きネギタマ' => Cuisine.new( Vec[ 0, 15, 0] ), # ☆5
|
34
|
+
'サボテン焼き1' => Cuisine.new( Vec[ 5, 5, 0] ), # ☆1
|
35
|
+
'サボテンバーガー' => Cuisine.new( Vec[10, 10, 0] ), # ☆3
|
36
|
+
'サボテン焼き7' => Cuisine.new( Vec[15, 15, 0] ), # ☆7
|
37
|
+
'獣肉とカエン酒の丸焼き' => Cuisine.new( Vec[ 8, 0, 0] ), # 料理Lv0
|
38
|
+
'ドランギョと煉獄酒の丸焼き' => Cuisine.new( Vec[15, 11, 6] ), # 料理Lv15
|
39
|
+
'ドラバーンと煉獄酒の丸焼き' => Cuisine.new( Vec[23, 17, 9] ), # 料理Lv24
|
40
|
+
'フレドランと煉獄酒の丸焼き' => Cuisine.new( Vec[59, 0, 0] ), # 料理Lv27
|
41
|
+
'ダークドンと煉獄酒の丸焼き' => Cuisine.new( Vec[35, 26, 21] ), # 料理Lv27
|
42
|
+
'ダークドンと氷河酒の丸焼き' => Cuisine.new( Vec[26, 35, 15] ), # 料理Lv27
|
43
|
+
'ウッチと氷酒の蒸し焼き' => Cuisine.new( Vec[ 0, 11, 10] ), # 料理Lv0
|
44
|
+
'ゴッチと氷酒の蒸し焼き' => Cuisine.new( Vec[ 0, 15, 13] ), # 料理Lv3
|
45
|
+
'ガガッチと氷水酒の蒸し焼き' => Cuisine.new( Vec[ 0, 19, 15] ), # 料理Lv6
|
46
|
+
'ガガッチと氷河酒の蒸し焼き' => Cuisine.new( Vec[ 0, 22, 16] ), # 料理Lv12
|
47
|
+
'ドランギョと氷河酒の蒸し焼き' => Cuisine.new( Vec[ 6, 24, 11] ), # 料理Lv15
|
48
|
+
'ドラバーンと氷河酒の蒸し焼き' => Cuisine.new( Vec[10, 35, 19] ), # 料理Lv24
|
49
|
+
'アースドランと氷河酒の蒸し焼き' => Cuisine.new( Vec[ 0, 87, 0] ), # 料理Lv27
|
50
|
+
'ダークドンと氷河酒の蒸し焼き' => Cuisine.new( Vec[15, 52, 38] ), # 料理Lv27
|
51
|
+
'ダークドンと煉獄酒の蒸し焼き' => Cuisine.new( Vec[15, 52, 38] ), # 料理Lv27
|
52
|
+
'ウッチとカエン酒の蒸し焼き' => Cuisine.new( Vec[ 0, 10, 11] ), # 料理Lv0
|
53
|
+
'ゴッチとカエン酒の蒸し焼き' => Cuisine.new( Vec[ 0, 13, 15] ), # 料理Lv3
|
54
|
+
'ガガッチと爆炎酒の蒸し焼き' => Cuisine.new( Vec[ 0, 15, 19] ), # 料理Lv6
|
55
|
+
'ガガッチと煉獄酒の蒸し焼き' => Cuisine.new( Vec[ 0, 16, 22] ), # 料理Lv12
|
56
|
+
'ドランギョと煉獄酒の蒸し焼き' => Cuisine.new( Vec[ 9, 18, 15] ), # 料理Lv15
|
57
|
+
'ドラバーンと煉獄酒の蒸し焼き' => Cuisine.new( Vec[14, 26, 25] ), # 料理Lv24
|
58
|
+
'アクアドランと煉獄酒の蒸し焼き' => Cuisine.new( Vec[ 0, 0, 87] ), # 料理Lv27
|
59
|
+
}
|
60
|
+
SystemCuisine.keys.each do |k|
|
61
|
+
ary = k.scan(%r|(.+)と(.+)の(.+)|)[0]
|
62
|
+
if ary
|
63
|
+
c = case ary[2]
|
64
|
+
when '丸焼き'
|
65
|
+
'焼き'
|
66
|
+
when '蒸し焼き'
|
67
|
+
'蒸し'
|
68
|
+
else
|
69
|
+
raise UnexpectedError
|
70
|
+
end
|
71
|
+
SystemCuisine.store("#{ary[0]}の#{ary[1]}#{c}", SystemCuisine[k])
|
72
|
+
end
|
73
|
+
end
|
74
|
+
|
75
|
+
MainFood = {
|
76
|
+
'獣肉' => Vec[10, 0, 0],
|
77
|
+
'ウッチ' => Vec[ 0, 10, 10],
|
78
|
+
'ゴッチ' => Vec[ 0, 12, 12],
|
79
|
+
'ガガッチ' => Vec[ 0, 14, 14],
|
80
|
+
'ドランギョ' => Vec[15, 15, 10],
|
81
|
+
'ドラバーン' => Vec[20, 20, 15],
|
82
|
+
'フレドラン' => Vec[50, 0, 0],
|
83
|
+
'アースドラン' => Vec[ 0, 50, 0],
|
84
|
+
'アクアドラン' => Vec[ 0, 0, 50],
|
85
|
+
'ダークドン' => Vec[30, 30, 30],
|
86
|
+
}
|
87
|
+
SubFood = {
|
88
|
+
'氷酒' => Vec[ 50, 70, 50],
|
89
|
+
'氷水酒' => Vec[ 50, 90, 50],
|
90
|
+
'氷河酒' => Vec[ 50, 110, 50],
|
91
|
+
'カエン酒' => Vec[ 70, 50, 70],
|
92
|
+
'爆炎酒' => Vec[ 90, 50, 90],
|
93
|
+
'煉獄酒' => Vec[110, 50, 110],
|
94
|
+
}
|
95
|
+
Cookery = {
|
96
|
+
'焼き' => Vec[50, 50, 30],
|
97
|
+
'蒸す' => Vec[30, 75, 75],
|
98
|
+
}
|
99
|
+
Cookery.store('丸焼き', Cookery['焼き'])
|
100
|
+
Cookery.store('すき焼き', Cookery['焼き'])
|
101
|
+
Cookery.store('焼く', Cookery['焼き'])
|
102
|
+
Cookery.store('焼', Cookery['焼き'])
|
103
|
+
Cookery.store('蒸し焼き', Cookery['蒸す'])
|
104
|
+
Cookery.store('ボイル', Cookery['蒸す'])
|
105
|
+
Cookery.store('蒸し', Cookery['蒸す'])
|
106
|
+
Cookery.store('蒸', Cookery['蒸す'])
|
107
|
+
|
108
|
+
class << Cuisine
|
109
|
+
def cook(cookery_s, main_s, sub_s, level)
|
110
|
+
begin
|
111
|
+
c = Cookery[cookery_s]
|
112
|
+
m = MainFood[main_s]
|
113
|
+
s = SubFood[sub_s]
|
114
|
+
v = Vec[1, 1, 1]
|
115
|
+
v.e_mul!(m).e_mul!(c).e_mul!(s.dup.add!(100+level)).e_div!(10000)
|
116
|
+
new(v)
|
117
|
+
rescue
|
118
|
+
arg = [cookery_s, main_s, sub_s, level].inspect
|
119
|
+
raise ArgumentError, "Some of arguments for cooking seems to be wrong. #{arg} is given, but they should be [cookery (String), main food (String), sub food (String), cooking level (Integer)]. Not all of cookeries and foods are supported."
|
120
|
+
end
|
121
|
+
end
|
122
|
+
end
|
123
|
+
|
124
|
+
module_function def cuisine(*arg)
|
125
|
+
case arg.size
|
126
|
+
when 3
|
127
|
+
if arg.all?{ |e| e.kind_of?(Integer) } then
|
128
|
+
Cuisine.new( Vec[*arg] )
|
129
|
+
else
|
130
|
+
raise ArgumentError, "All the cuisine parameters must be Integer."
|
131
|
+
end
|
132
|
+
when 1
|
133
|
+
SystemCuisine[arg[0]] or raise ArgumentError, "The cuisine name `#{arg[0]}' is not supported."
|
134
|
+
when 4
|
135
|
+
Cuisine.cook(*arg)
|
136
|
+
else
|
137
|
+
raise ArgumentError, 'The number of argument must be 1, 3 or 4.'
|
138
|
+
end
|
139
|
+
end
|
140
|
+
end
|