Advertisement
medal893

BCBOT_1.4m240

Mar 29th, 2019
411
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 26.28 KB | None | 0 0
  1. require 'line/bot'
  2. class KamigoController < ApplicationController
  3. protect_from_forgery with: :null_session
  4.  
  5. def webhook
  6. # 設定回覆文字
  7. reply_text = cutword(received_text)
  8.  
  9. # 傳送訊息到 line
  10. response = reply_to_line(reply_text)
  11.  
  12. # 回應 200
  13. head :ok
  14. end
  15.  
  16. # 取得對方說的話
  17. def received_text
  18. message = params['events'][0]['message']
  19. message['text'] unless message.nil?
  20. end
  21.  
  22. #計算功能實作
  23. def cutword(received_text)
  24. # return nil unless received_text[0..2]== 'cky'
  25. # lvget = received_text[-3...-1]
  26. cmdkind = received_text[0..3]
  27. catkind = received_text[4..7]
  28. p "---------------------------"
  29. p "cmd load as follow:"
  30. p cmdkind
  31. p catkind
  32. p "the original received codes:"
  33. p received_text
  34. p "---------------------------"
  35. if cmdkind =="help"
  36. answer = "cmls:Command List\n Main Command:ckrsAAAA(xBBBB)CCC, AAAA are the CatCode(with the status),CCC are the Level of cat(must fill full main+plus into 3gens. The (xBBBB) is the additional twist,which allow to fill NP level include the ATK and HP's calculation.\n"
  37. end
  38. if cmdkind == "cmls"
  39. answer = "help: The use way of ckrs.\nvers: Show out the Version runing now.\nupd1,upd2,upd3,upd4: The Update History.(May not update to time.)\nskjp,sktw,spss: UNWORKABLE now.\nnkrs: As same as ckrs but accept to use NickName which had been installed by author,\nit's a little bit more lag than the ckrs since it need more time to sort,and it doesn't support the (XBBBB) as the NP level's calculation.\nauth: show the Author's ID and helpers."
  40. end
  41. if cmdkind =="auth"
  42. answer = "Main Author: Medal893\nHelpers:中日群"
  43. end
  44. if cmdkind =="vers"
  45. answer = "Neko BOT(Dev Version), Version: Alpha 1.4 -m240"
  46. end
  47. if cmdkind =="upd1"
  48. answer = "Alpha 1.0pre1, -m v21: add cmds ver,upd,fix tiny bugs.\nAlpha 1.0pre1,-m v22: fix the bugs of upd and avoid crash.\nAlpha 1.0pre1,-m v23: fix the bugs of upd's unresponse, add some UNWRITE contexts' cmd and add cats 0033,0043"
  49. end
  50. if cmdkind =="upd2"
  51. answer = "Alpha 1.1 -m24: Completely change the information's storage way.\nAlpha 1.1 -m25~m53 Testing Version with tons of bugs.\nAlpha 1.1 -m54:Edit the output of ckrs partically.\nAlpha 1.1 -m55:Fix bugs.\nAlpha 1.1 -m56:Add More Files.\nAlpha 1.1 -m57:Add More Files.\nAlpha 1.1 -m58~m67 Fix bugs related to m57."
  52. end
  53. if cmdkind =="upd3"
  54. answer = "Alpha 1.2 -m68: Change the ckrs command type in order to support not to input NPlevels.\nAlpha 1.2 -m69:Add ADDITIONAL line information.\nAlpha 1.2 -m70~m71: Edit the Additional line's output way.\nAlpha 1.2-m72: Add catkind16~20."
  55. end
  56. if cmdkind =="upd4"
  57. answer = "Alpha 1.3 -m73: Add new command nkrs which support NickName.\nAlpha 1.3 -m96 potimize the nkrs.\NAlpha 1.3-m97 potimize some codes' performance."
  58. end
  59. if cmdkind =="skjp"
  60. answer = "UNWORKABLE and UNWRITE yet.\n"
  61. end
  62. if cmdkind =="sktw"
  63. answer = "UNWORKABLE and UNWRITE yet.\n"
  64. end
  65. if cmdkind =="spss"
  66. answer = "UNWORKABLE and UNWRITE yet.\n"
  67. end
  68. if cmdkind =="ckrs" #ckrs support only Number Names,Support NPLevel,and faster than nkrs.
  69. p "---------Working ckrs---------"
  70. value_ATK = ValuesGetATK(catkind)
  71. value_HP = ValuesGetHP(catkind)
  72. value_RANGE = ValuesGetRANGE(catkind)
  73. value_COST = ValuesGetCOST(catkind)
  74. value_RECOVERY = ValuesGetRECOVERY(catkind)
  75. value_NAME = ValuesGetNAME(catkind)
  76. value_KB = ValuesGetKB(catkind)
  77. value_ADDITIONAL = ValuesGetADDITIONAL(catkind)
  78. p "---------ckrs Infos LOADED-------"
  79. p value_ATK
  80. p value_HP
  81. p value_KB
  82. p value_NAME
  83. p value_RECOVERY
  84. p value_RANGE
  85. p value_COST
  86. p "--------ckrs Infos LOADED---"
  87. npwork = received_text[8]
  88. npatk = 0
  89. nphealth = 0
  90. if npwork == 'x'
  91. npatk = received_text[9..10]
  92. nphealth = received_text[11..12] #ckrsAAAAxBBBBCCC
  93.  
  94. end
  95. lvget = received_text[-3..-1]
  96. p "--------ckrs word cut results:"
  97. p npwork
  98. p lvget
  99. p npatk
  100. p nphealth
  101. p "--------ckrs word cut END---"
  102. n_lvget = lvget.to_f
  103. n_catkind = catkind.to_f
  104. n_npatk = npatk.to_f
  105. n_nphealth = nphealth.to_f
  106. n_value_ATK = value_ATK.to_f
  107. n_value_HP = value_HP.to_f
  108. atk = ((n_lvget+ 4)/5 * (n_npatk+50) * 0.02 * n_value_ATK).round(0) #the White Value
  109. health = ((n_lvget+ 4)/5 * (n_nphealth+50) *0.02 * n_value_HP).round(0) #the White Value
  110. answer = "cat " + catkind + " " + value_NAME +"\n" + atk.to_s + " atk / " + health.to_s + " health\n" + "Range = " + value_RANGE + " Cost = " + value_COST + "\nRecovery = " + value_RECOVERY + "KB = " + value_KB + "\nHPNP= " + n_nphealth.to_s + " ATKNP= " + n_npatk.to_s + " LV = " + n_lvget.to_s + "||" + value_ADDITIONAL
  111. end
  112.  
  113. if cmdkind =="nkrs"
  114. if received_text[6] == 'x' #nkrsAAAAxbbb
  115. catkind = received_text[4..5]
  116. strlen = 3
  117. elsif received_text[7] =='x'
  118. catkind = received_text[4..6]
  119. strlen = 4
  120. elsif received_text[8] =='x'
  121. catkind = received_text[4..7]
  122. strlen = 5
  123. end
  124. p "---------nkrs n_catkind----------"
  125. p strlen
  126. p catkind
  127. p "---------------------------------"
  128. n_catkind = NickNameGet(catkind)
  129. p "---------Working nkrs---------"
  130. value_ATK = ValuesGetATK(n_catkind)
  131. value_HP = ValuesGetHP(n_catkind)
  132. value_RANGE = ValuesGetRANGE(n_catkind)
  133. value_COST = ValuesGetCOST(n_catkind)
  134. value_RECOVERY = ValuesGetRECOVERY(n_catkind)
  135. value_NAME = ValuesGetNAME(n_catkind)
  136. value_KB = ValuesGetKB(n_catkind)
  137. value_ADDITIONAL = ValuesGetADDITIONAL(n_catkind)
  138. p "---------nkrs Infos LOADED-------"
  139. p value_ATK
  140. p value_HP
  141. p value_KB
  142. p value_NAME
  143. p value_RECOVERY
  144. p value_RANGE
  145. p value_COST
  146. p "--------nkrs Infos LOADED---"
  147. npwork = 0
  148. npatk = 0
  149. nphealth = 0
  150. lvget_original = received_text[-3..-1]
  151. lvget = lvget_original
  152. lvget = ValueGetLV(n_catkind,lvget)
  153. p "--------nkrs word cut results:"
  154. p npwork
  155. p lvget
  156. p npatk
  157. p nphealth
  158. p "--------nkrs word cut END---"
  159. n_lvget = lvget.to_f
  160. n_catkind = catkind.to_f
  161. n_npatk = npatk.to_f
  162. n_nphealth = nphealth.to_f
  163. n_value_ATK = value_ATK.to_f
  164. n_value_HP = value_HP.to_f
  165. atk = ((n_lvget+ 4)/5 * (n_npatk+50) * 0.02 * n_value_ATK).round(0) #the White Value
  166. health = ((n_lvget+ 4)/5 * (n_nphealth+50) *0.02 * n_value_HP).round(0) #the White Value
  167. answer = "cat " + catkind + " " + value_NAME +"\n" + atk.to_s + " atk / " + health.to_s + " health\n " + "Range = " + value_RANGE + " Cost = " + value_COST + "\nRecovery = " + value_RECOVERY + "KB = " + value_KB ++ "\nEqsLV = " + lvget_original.to_s + "||" + value_ADDITIONAL
  168. end
  169.  
  170. if cmdkind == 'nkrt'
  171. answer = "UNWORKABLE and UNWRITE yet.\n"
  172. end
  173.  
  174. if cmdkind == 'ckrt'
  175. answer = "UNWORKABLE and UNWRITE yet.\n"
  176. end
  177.  
  178. return answer
  179.  
  180. end
  181.  
  182. # 關鍵字回覆
  183. # def keyword_reply(received_text)
  184. # 學習紀錄表
  185. # keyword_mapping = {
  186. # 'QQ' => 'I see GG',
  187. # '??' => '郭',
  188. # '010小貓' => '110hp120atk'
  189. # }
  190.  
  191. # 查表
  192. # keyword_mapping[received_text]
  193. # end
  194.  
  195. # 傳送訊息到 line
  196. def reply_to_line(reply_text)
  197. return nil if reply_text.nil?
  198.  
  199. # 取得 reply token
  200. reply_token = params['events'][0]['replyToken']
  201.  
  202. # 設定回覆訊息
  203. message = {
  204. type: 'text',
  205. text: reply_text
  206. }
  207.  
  208. # 傳送訊息
  209. line.reply_message(reply_token, message)
  210. end
  211.  
  212. # Line Bot API 物件初始化
  213. def line
  214. @line ||= Line::Bot::Client.new { |config|
  215. config.channel_secret = 'SECRET'
  216. config.channel_token = 'SECRET'
  217. }
  218. end
  219.  
  220.  
  221. def eat
  222. render plain: "please write down 6 number the first 3 is for the cat kind,the forth number is for the status,the fifth and sixth is for the HP's NPstatus,the seventh and eighth is for the ATK's NPstatus, and the next 3 is for the level.Fill 00 if Unuse, thank you."
  223. end
  224. def ValueGetLV(catkind ,lvget)
  225. p "------LOADED ValueGetLV-----"
  226. p catkind
  227. p lvget
  228. lveditor = lvget.to_f
  229. n2_lvget = lvget.to_f
  230. n2_catkind = catkind.to_f
  231. splender_crazys = 912
  232. splender_basics = 10#0012~0093
  233. splender_normal = 0
  234. nsplender_crazys = splender_crazys.to_f
  235. nsplender_basics = splender_basics.to_f
  236. if n2_catkind == nsplender_crazys..nsplender_crazys+92
  237. p "EDIT"
  238. if n2_lvget >= 20
  239. lveditor = n2_lvget/2+10
  240. elsif n2_lvget <= 20
  241. lveditor = n2_lvget
  242. end
  243. elsif n2_catkind == nsplender_basics..nsplender_basics+85
  244. if n2_lvget >=90
  245. lveditor = n2_lvget/4 + 67.5
  246. elsif n2_lvget >=70
  247. lveditor = n2_lvget/2+35
  248. elsif n2_lvget <70
  249. lveditor = n2_lvget
  250. end
  251. elsif splender_normal == 0
  252. if n2_lvget >=90
  253. lveditor = n2_lvget/4 + 67.5
  254. elsif n2_lvget >=70
  255. lveditor = n2_lvget/2+35
  256. elsif n2_lvget <70
  257. lveditor = n2_lvget
  258. end
  259.  
  260. end
  261.  
  262. p n2_lvget
  263. p n2_catkind
  264. p lveditor
  265. p "----------------------------"
  266.  
  267. return lveditor
  268. end
  269.  
  270.  
  271. #FILES OF LIST
  272.  
  273. def ValuesGetNAME(catkind) #Name White Value(Recovery of making)
  274.  
  275. keyword_mapping = {
  276.  
  277. '0012' => 'ネコビルダー',
  278. '0013' => 'ネコモヒカン',
  279. '0022' => 'ネコカベ',
  280. '0023' => 'ゴムネコ',
  281. '0032' => '勇者ネコ',
  282. '0033' => '暗黒ネコ',
  283. '0042' => '美脚ネコ',
  284. '0043' => 'ムキあしネコ',
  285. '0052' => 'ネコキリン',
  286. '0053' => 'ネコライオン',
  287. '0062' => 'ネコUFO',
  288. '0063' => '天空のネコ',
  289. '0072' => 'ネコクジラ',
  290. '0073' => 'ネコ島',
  291. '0082' => 'ネコドラゴン',
  292. '0083' => 'ネコキングドラゴン',
  293. '0092' => 'ネコダラボッチ',
  294. '0093' => 'ネコジャラミ',
  295. '0102' => 'ネコ聖母',
  296. '0103' => 'ネコマッチョ',
  297. '0112' => '酔拳にゃんこ',
  298. '0113' => 'ネコダンサー',
  299. '0122' => 'Super Mr.',
  300. '0123' => 'Hyper Mr.',
  301. '0132' => '猫縛りNEO',
  302. '0133' => '猫縛り極上',
  303. '0142' => '処刑人',
  304. '0143' => '暗黒嬢',
  305. '0152' => 'ネコギャング',
  306. '0153' => '重機C・A・T',
  307. '0162' => 'ネコ葉っぱ',
  308. '0163' => 'ネコぺろきゃん',
  309. '0171' => 'もねこ',
  310. '0172' => 'スターもねこ',
  311. '0182' => 'ネコワイルド',
  312. '0183' => 'イチリンリン',
  313. '0192' => 'ガマネコ忍者',
  314. '0193' => 'ムササビネコ忍者',
  315. '0202' => 'デビルネコ',
  316. '0203' => 'ネコボーン',
  317. '0212' => '',
  318. '0213' => '',
  319. '0222' => '',
  320. '0223' => '',
  321. '0232' => '',
  322. '0233' => '',
  323. '0242' => '',
  324. '0243' => '',
  325. '0252' => '',
  326. '0253' => '',
  327. '0262' => '',
  328. '0263' => '',
  329. '0272' => '',
  330. '0273' => '',
  331. '0282' => '',
  332. '0283' => '',
  333. '0292' => '',
  334. '0293' => '',
  335. '0302' => '',
  336. '0303' => '',
  337. '0312' => '',
  338. '0313' => '',
  339. '0322' => '',
  340. '0323' => '',
  341. '0332' => '',
  342. '0333' => '',
  343. '0342' => '',
  344. '0343' => '',
  345. '0352' => '',
  346. '0353' => '',
  347. '0362' => '',
  348. '0363' => '',
  349. '0372' => '',
  350. '0373' => '',
  351. '0382' => '',
  352. '0383' => '',
  353. '0392' => '',
  354. '0393' => '',
  355. '0402' => '',
  356. '0403' => ''
  357. }
  358. # 查表
  359. return keyword_mapping[catkind]
  360. end
  361. def ValuesGetATK(catkind) #ATK White Value
  362.  
  363. keyword_mapping = {
  364. '0012' => '20',
  365. '0013' => '40',
  366. '0022' => '5',
  367. '0023' => '10',
  368. '0032' => '62',
  369. '0033' => '125',
  370. '0042' => '250',
  371. '0043' => '500',
  372. '0052' => '32',
  373. '0053' => '65',
  374. '0062' => '412',
  375. '0063' => '825',
  376. '0072' => '450',
  377. '0073' => '990',
  378. '0082' => '875',
  379. '0083' => '1000',
  380. '0092' => '700',
  381. '0093' => '1400',
  382. '0102' => '250',
  383. '0103' => '250',
  384. '0112' => '3025',
  385. '0113' => '3025',
  386. '0122' => '87',
  387. '0123' => '87',
  388. '0132' => '250',
  389. '0133' => '250',
  390. '0142' => '330',
  391. '0143' => '330',
  392. '0151' => '750',
  393. '0152' => '750',
  394. '0162' => '250',
  395. '0163' => '250',
  396. '0171' => '1000',
  397. '0172' => '1000',
  398. '0182' => '450',
  399. '0183' => '450',
  400. '0192' => '70',
  401. '0193' => '70',
  402. '0202' => '500',
  403. '0203' => '500',
  404. '0212' => '',
  405. '0213' => '',
  406. '0222' => '',
  407. '0223' => '',
  408. '0232' => '',
  409. '0233' => '',
  410. '0242' => '',
  411. '0243' => '',
  412. '0252' => '',
  413. '0253' => '',
  414. '0262' => '',
  415. '0263' => '',
  416. '0272' => '',
  417. '0273' => '',
  418. '0282' => '',
  419. '0283' => '',
  420. '0292' => '',
  421. '0293' => '',
  422. '0302' => '',
  423. '0303' => '',
  424. '0312' => '',
  425. '0313' => '',
  426. '0322' => '',
  427. '0323' => '',
  428. '0332' => '',
  429. '0333' => '',
  430. '0342' => '',
  431. '0343' => '',
  432. '0352' => '',
  433. '0353' => '',
  434. '0362' => '',
  435. '0363' => '',
  436. '0372' => '',
  437. '0373' => '',
  438. '0382' => '',
  439. '0383' => '',
  440. '0392' => '',
  441. '0393' => '',
  442. '0402' => '',
  443. '0403' => ''
  444. }
  445. # 查表
  446. return keyword_mapping[catkind]
  447. end
  448.  
  449. def ValuesGetHP(catkind) #HP White Value
  450.  
  451. keyword_mapping = {
  452. '0012' => '250',
  453. '0013' => '500',
  454. '0022' => '1000',
  455. '0023' => '1500',
  456. '0032' => '500',
  457. '0033' => '1000',
  458. '0042' => '1000',
  459. '0043' => '2000',
  460. '0052' => '1250',
  461. '0053' => '2500',
  462. '0062' => '750',
  463. '0063' => '1500',
  464. '0072' => '1750',
  465. '0073' => '3500',
  466. '0082' => '2000',
  467. '0083' => '2250',
  468. '0092' => '2500',
  469. '0093' => '5000',
  470. '0102' => '1000',
  471. '0103' => '1625',
  472. '0112' => '2250',
  473. '0113' => '2250',
  474. '0122' => '1250',
  475. '0123' => '1250',
  476. '0132' => '1750',
  477. '0133' => '3500',
  478. '0142' => '1750',
  479. '0143' => '1750',
  480. '0151' => '2000',
  481. '0152' => '2000',
  482. '0162' => '1000',
  483. '0163' => '1000',
  484. '0171' => '1500',
  485. '0172' => '2500',
  486. '0182' => '1000',
  487. '0183' => '1000',
  488. '0192' => '600',
  489. '0193' => '600',
  490. '0202' => '1750',
  491. '0203' => '1750',
  492. '0212' => '',
  493. '0213' => '',
  494. '0222' => '',
  495. '0223' => '',
  496. '0232' => '',
  497. '0233' => '',
  498. '0242' => '',
  499. '0243' => '',
  500. '0252' => '',
  501. '0253' => '',
  502. '0262' => '',
  503. '0263' => '',
  504. '0272' => '',
  505. '0273' => '',
  506. '0282' => '',
  507. '0283' => '',
  508. '0292' => '',
  509. '0293' => '',
  510. '0302' => '',
  511. '0303' => '',
  512. '0312' => '',
  513. '0313' => '',
  514. '0322' => '',
  515. '0323' => '',
  516. '0332' => '',
  517. '0333' => '',
  518. '0342' => '',
  519. '0343' => '',
  520. '0352' => '',
  521. '0353' => '',
  522. '0362' => '',
  523. '0363' => '',
  524. '0372' => '',
  525. '0373' => '',
  526. '0382' => '',
  527. '0383' => '',
  528. '0392' => '',
  529. '0393' => '',
  530. '0402' => '',
  531. '0403' => ''
  532. }
  533. # 查表
  534. return keyword_mapping[catkind]
  535. end
  536. def ValuesGetRANGE(catkind) #Range White Value
  537.  
  538. keyword_mapping = {
  539. '0012' => '140',
  540. '0013' => '140',
  541. '0022' => '110',
  542. '0023' => '110',
  543. '0032' => '150',
  544. '0033' => '150',
  545. '0042' => '350',
  546. '0043' => '350',
  547. '0052' => '140',
  548. '0053' => '140',
  549. '0062' => '170',
  550. '0063' => '170',
  551. '0072' => '150',
  552. '0073' => '150',
  553. '0082' => '400',
  554. '0083' => '400',
  555. '0092' => '150',
  556. '0093' => '150',
  557. '0102' => '350',
  558. '0103' => '350',
  559. '0112' => '300',
  560. '0113' => '300',
  561. '0122' => '140',
  562. '0123' => '140',
  563. '0132' => '120',
  564. '0133' => '120',
  565. '0142' => '210',
  566. '0143' => '210',
  567. '0151' => '140',
  568. '0152' => '199',
  569. '0162' => '350',
  570. '0163' => '350',
  571. '0171' => '160',
  572. '0172' => '160',
  573. '0182' => '170',
  574. '0183' => '170',
  575. '0192' => '150',
  576. '0193' => '150',
  577. '0202' => '150',
  578. '0203' => '150',
  579. '0212' => '',
  580. '0213' => '',
  581. '0222' => '',
  582. '0223' => '',
  583. '0232' => '',
  584. '0233' => '',
  585. '0242' => '',
  586. '0243' => '',
  587. '0252' => '',
  588. '0253' => '',
  589. '0262' => '',
  590. '0263' => '',
  591. '0272' => '',
  592. '0273' => '',
  593. '0282' => '',
  594. '0283' => '',
  595. '0292' => '',
  596. '0293' => '',
  597. '0302' => '',
  598. '0303' => '',
  599. '0312' => '',
  600. '0313' => '',
  601. '0322' => '',
  602. '0323' => '',
  603. '0332' => '',
  604. '0333' => '',
  605. '0342' => '',
  606. '0343' => '',
  607. '0352' => '',
  608. '0353' => '',
  609. '0362' => '',
  610. '0363' => '',
  611. '0372' => '',
  612. '0373' => '',
  613. '0382' => '',
  614. '0383' => '',
  615. '0392' => '',
  616. '0393' => '',
  617. '0402' => '',
  618. '0403' => ''
  619. }
  620. # 查表
  621. return keyword_mapping[catkind]
  622. end
  623. def ValuesGetCOST(catkind) #Cost White Value(Default World_2 Value as most common.)
  624.  
  625. keyword_mapping = {
  626. '0012' => '75',
  627. '0013' => '150',
  628. '0022' => '150',
  629. '0023' => '150',
  630. '0032' => '300',
  631. '0033' => '300',
  632. '0042' => '600',
  633. '0043' => '600',
  634. '0052' => '750',
  635. '0053' => '750',
  636. '0062' => '975',
  637. '0063' => '975',
  638. '0072' => '1200',
  639. '0073' => '1200',
  640. '0082' => '1500',
  641. '0083' => '1500',
  642. '0092' => '1950',
  643. '0093' => '1950',
  644. '0102' => '900',
  645. '0103' => '900',
  646. '0112' => '2250',
  647. '0113' => '2250',
  648. '0122' => '825',
  649. '0123' => '825',
  650. '0132' => '1035',
  651. '0133' => '1035',
  652. '0142' => '1440',
  653. '0143' => '1440',
  654. '0151' => '1125',
  655. '0152' => '1125',
  656. '0162' => '525',
  657. '0163' => '525',
  658. '0171' => '148',
  659. '0172' => '148',
  660. '0182' => '1050',
  661. '0183' => '525',
  662. '0192' => '300',
  663. '0193' => '225',
  664. '0202' => '1125',
  665. '0203' => '1125',
  666. '0212' => '',
  667. '0213' => '',
  668. '0222' => '',
  669. '0223' => '',
  670. '0232' => '',
  671. '0233' => '',
  672. '0242' => '',
  673. '0243' => '',
  674. '0252' => '',
  675. '0253' => '',
  676. '0262' => '',
  677. '0263' => '',
  678. '0272' => '',
  679. '0273' => '',
  680. '0282' => '',
  681. '0283' => '',
  682. '0292' => '',
  683. '0293' => '',
  684. '0302' => '',
  685. '0303' => '',
  686. '0312' => '',
  687. '0313' => '',
  688. '0322' => '',
  689. '0323' => '',
  690. '0332' => '',
  691. '0333' => '',
  692. '0342' => '',
  693. '0343' => '',
  694. '0352' => '',
  695. '0353' => '',
  696. '0362' => '',
  697. '0363' => '',
  698. '0372' => '',
  699. '0373' => '',
  700. '0382' => '',
  701. '0383' => '',
  702. '0392' => '',
  703. '0393' => '',
  704. '0402' => '',
  705. '0403' => ''
  706. }
  707. # 查表
  708. return keyword_mapping[catkind]
  709. end
  710. def ValuesGetRECOVERY(catkind) #Cost White Value(Recovery of making)
  711.  
  712. keyword_mapping = {
  713. '0012' => '2s(60f)',
  714. '0013' => '2s(60f)',
  715. '0022' => 's(60f)',
  716. '0023' => 's(60f)',
  717. '0032' => 's(60f)',
  718. '0033' => 's(60f)',
  719. '0042' => 's(76f)',
  720. '0043' => 's(236f)',
  721. '0052' => 's(60f)',
  722. '0053' => 's(136f)',
  723. '0062' => 's(60f)',
  724. '0063' => 's(116f)',
  725. '0072' => 's(136f)',
  726. '0073' => 's(256f)',
  727. '0082' => 's(316f)',
  728. '0083' => 's(516f)',
  729. '0092' => 's(556f)',
  730. '0093' => 's(676f)',
  731. '0102' => 's(76f)',
  732. '0103' => 's(76f)',
  733. '0112' => 's(606f)',
  734. '0113' => 's(606f)',
  735. '0122' => 's(226f)',
  736. '0123' => 's(226f)',
  737. '0132' => 's(186f)',
  738. '0133' => 's(186f)',
  739. '0142' => 's(186f)',
  740. '0143' => 's(186f)',
  741. '0151' => 's(206f)',
  742. '0152' => 's(206f)',
  743. '0162' => 's(76f)',
  744. '0163' => 's(76f)',
  745. '0171' => 's(1744f)',
  746. '0172' => 's(1744f)',
  747. '0182' => 's(60f)',
  748. '0183' => 's(60f)',
  749. '0192' => 's(60f)',
  750. '0193' => 's(60f)',
  751. '0202' => 's(146f)',
  752. '0203' => 's(146f)',
  753. '0212' => '',
  754. '0213' => '',
  755. '0222' => '',
  756. '0223' => '',
  757. '0232' => '',
  758. '0233' => '',
  759. '0242' => '',
  760. '0243' => '',
  761. '0252' => '',
  762. '0253' => '',
  763. '0262' => '',
  764. '0263' => '',
  765. '0272' => '',
  766. '0273' => '',
  767. '0282' => '',
  768. '0283' => '',
  769. '0292' => '',
  770. '0293' => '',
  771. '0302' => '',
  772. '0303' => '',
  773. '0312' => '',
  774. '0313' => '',
  775. '0322' => '',
  776. '0323' => '',
  777. '0332' => '',
  778. '0333' => '',
  779. '0342' => '',
  780. '0343' => '',
  781. '0352' => '',
  782. '0353' => '',
  783. '0362' => '',
  784. '0363' => '',
  785. '0372' => '',
  786. '0373' => '',
  787. '0382' => '',
  788. '0383' => '',
  789. '0392' => '',
  790. '0393' => '',
  791. '0402' => '',
  792. '0403' => ''
  793. }
  794. # 查表
  795. return keyword_mapping[catkind]
  796. end
  797. def ValuesGetKB(catkind) #Knock Back
  798.  
  799. # p "Loaded ValuesGetKB"
  800. # p catkind
  801. # p "The catkind loaded by ValueGetKB"
  802.  
  803. keyword_mapping = {
  804. '0012' => '3',
  805. '0013' => '3',
  806. '0022' => '1',
  807. '0023' => '1',
  808. '0032' => '3',
  809. '0033' => '3',
  810. '0042' => '3',
  811. '0043' => '3',
  812. '0052' => '5',
  813. '0053' => '5',
  814. '0062' => '4',
  815. '0063' => '4',
  816. '0072' => '3',
  817. '0073' => '3',
  818. '0082' => '3',
  819. '0083' => '3',
  820. '0092' => '1',
  821. '0093' => '1',
  822. '0102' => '3',
  823. '0103' => '3',
  824. '0112' => '1',
  825. '0113' => '1',
  826. '0122' => '5',
  827. '0123' => '5',
  828. '0132' => '1',
  829. '0133' => '1',
  830. '0142' => '1',
  831. '0143' => '1',
  832. '0151' => '3',
  833. '0152' => '3',
  834. '0162' => '3',
  835. '0163' => '3',
  836. '0171' => '4',
  837. '0172' => '4',
  838. '0182' => '4',
  839. '0183' => '4',
  840. '0192' => '3',
  841. '0193' => '3',
  842. '0202' => '3',
  843. '0203' => '3',
  844. '0212' => '',
  845. '0213' => '',
  846. '0222' => '',
  847. '0223' => '',
  848. '0232' => '',
  849. '0233' => '',
  850. '0242' => '',
  851. '0243' => '',
  852. '0252' => '',
  853. '0253' => '',
  854. '0262' => '',
  855. '0263' => '',
  856. '0272' => '',
  857. '0273' => '',
  858. '0282' => '',
  859. '0283' => '',
  860. '0292' => '',
  861. '0293' => '',
  862. '0302' => '',
  863. '0303' => '',
  864. '0312' => '',
  865. '0313' => '',
  866. '0322' => '',
  867. '0323' => '',
  868. '0332' => '',
  869. '0333' => '',
  870. '0342' => '',
  871. '0343' => '',
  872. '0352' => '',
  873. '0353' => '',
  874. '0362' => '',
  875. '0363' => '',
  876. '0372' => '',
  877. '0373' => '',
  878. '0382' => '',
  879. '0383' => '',
  880. '0392' => '',
  881. '0393' => '',
  882. '0402' => '',
  883. '0403' => ''
  884. }
  885. # 查表
  886. return keyword_mapping[catkind]
  887. end
  888. def ValuesGetADDITIONAL(catkind) #Knock Back
  889.  
  890. # p "Loaded ValuesGetKB"
  891. # p catkind
  892. # p "The catkind loaded by ValueGetKB"
  893.  
  894. keyword_mapping = {
  895. '0012' => '',
  896. '0013' => '',
  897. '0022' => '',
  898. '0023' => '',
  899. '0032' => ' Good to red.',
  900. '0033' => ' Good to red',
  901. '0042' => '',
  902. '0043' => '',
  903. '0052' => '',
  904. '0053' => '',
  905. '0062' => '',
  906. '0063' => '',
  907. '0072' => '',
  908. '0073' => '',
  909. '0082' => '',
  910. '0083' => '',
  911. '0092' => '',
  912. '0093' => '',
  913. '0102' => '',
  914. '0103' => '',
  915. '0112' => '',
  916. '0113' => '',
  917. '0122' => '',
  918. '0123' => '',
  919. '0132' => '',
  920. '0133' => '',
  921. '0142' => '',
  922. '0143' => '',
  923. '0151' => '',
  924. '0152' => '',
  925. '0162' => '',
  926. '0163' => '',
  927. '0172' => '',
  928. '0173' => '',
  929. '0182' => '',
  930. '0183' => '',
  931. '0192' => '',
  932. '0193' => '',
  933. '0202' => '',
  934. '0203' => '',
  935. '0212' => '',
  936. '0213' => '',
  937. '0222' => '',
  938. '0223' => '',
  939. '0232' => '',
  940. '0233' => '',
  941. '0242' => '',
  942. '0243' => '',
  943. '0252' => '',
  944. '0253' => '',
  945. '0262' => '',
  946. '0263' => '',
  947. '0272' => '',
  948. '0273' => '',
  949. '0282' => '',
  950. '0283' => '',
  951. '0292' => '',
  952. '0293' => '',
  953. '0302' => '',
  954. '0303' => '',
  955. '0312' => '',
  956. '0313' => '',
  957. '0322' => '',
  958. '0323' => '',
  959. '0332' => '',
  960. '0333' => '',
  961. '0342' => '',
  962. '0343' => '',
  963. '0352' => '',
  964. '0353' => '',
  965. '0362' => '',
  966. '0363' => '',
  967. '0372' => '',
  968. '0373' => '',
  969. '0382' => '',
  970. '0383' => '',
  971. '0392' => '',
  972. '0393' => '',
  973. '0402' => '',
  974. '0403' => ''
  975. }
  976. # 查表
  977. return keyword_mapping[catkind]
  978. end
  979. def NickNameGet(catkind) #Get Cat's NickName
  980.  
  981. p "Loaded NickNameGet"
  982. p catkind
  983. p "The catkind loaded by NickNameGet"
  984.  
  985. keyword_mapping = {
  986. '小貓2' => '0012',
  987. '小貓3' => '0013',
  988. '小貓' => '0013',
  989. '牆貓' => '0022',
  990. '橡皮擦貓' => '0023',
  991. '1003' => '1003'
  992. }
  993. # 查表
  994. return keyword_mapping[catkind]
  995. end
  996.  
  997.  
  998.  
  999.  
  1000. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement