设为首页收藏本站|繁體中文

Project1

 找回密码
 注册会员
搜索
查看: 1054|回复: 8
打印 上一主题 下一主题

[有事请教] 求帮忙找一个强化装备的插件

[复制链接]

Lv1.梦旅人

梦石
0
星屑
156
在线时间
44 小时
注册时间
2023-2-11
帖子
4
跳转到指定楼层
1
发表于 2023-4-9 14:09:14 手机端发表。 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
57星屑
之前看过一个插件,找不到了。大概功能是比如消耗一样武器/道具/金币等,给10级长剑增加1点攻击力。

在板块内只找到Yep和ab强化的插件,但是并不好用。也不是那个武器升级的那种,想要强化后还是原装,名称后缀最后面多个加1这种????????????

Lv3.寻梦者

梦石
0
星屑
1932
在线时间
48 小时
注册时间
2019-1-30
帖子
65
2
发表于 2023-4-10 09:44:37 | 只看该作者
yep可以加后缀,强化也是原来那个,你看错插件了吧
回复

使用道具 举报

Lv3.寻梦者

梦石
0
星屑
3657
在线时间
1133 小时
注册时间
2017-4-6
帖子
278

开拓者

3
发表于 2023-4-10 10:51:27 | 只看该作者
  1. //=============================================================================
  2. // Dhoom_WeaponUpgrade.js
  3. //=============================================================================
  4. var Imported = Imported || {};
  5. Imported.Dhoom_WeaponUpgrade = "2.1";

  6. var Dhoom = Dhoom || {};
  7. Dhoom.WeaponUpgrade = Dhoom.WeaponUpgrade || {};
  8. /*:
  9. * @plugindesc ▶物品 武器升级系统[2.10] 作者:DrDhoom
  10. * @author DrDhoom - drd-workshop.blogspot.com
  11. * @param ▶▶插件信息
  12. * @type []
  13. * @default ["名称: Dhoom_WeaponUpgrade","作者: DrDhoom","版本: 2.10","更新: raw.githubusercontent.com/DrDhoom/RMMV-Plugins/master/DhoomWeaponUpgrade.js","主页: github.com/DrDhoom/RMMV-Plugins"]
  14. * @param
  15. *
  16. * @param General
  17. * @text 常规
  18. *
  19. * @param Default Upgrade Cost Formula
  20. * @text 升级成本公式✚
  21. * @desc a-角色   b-武器   c-武器等级
  22. * @parent General
  23. * @default b.price * 2
  24. *
  25. * @param Default Max Level
  26. * @text 武器最大等级
  27. * @type number
  28. * @min 1
  29. * @parent General
  30. * @default 99
  31. *
  32. * @param Default Growth Formula
  33. * @text 武器参数增长公式✚
  34. * @desc a-角色   b-武器   c-武器等级
  35. * @type struct<growthSetting>
  36. * @default {"mhp":"","mmp":"","atk":"b.params[2] + 10 * c","def":"","mat":"","mdf":"","agi":"","luk":""}
  37. * @parent General
  38. *
  39. * @param Scene
  40. * @text 菜单
  41. *
  42. * @param Background
  43. * @text 菜单背景
  44. * @type file
  45. * @dir img/Ex_MenuBackground/
  46. * @parent Scene
  47. * @default
  48. *
  49. * @param Gold Window
  50. * @text 金币窗口
  51. * @type struct<windowSetting>
  52. * @default {"x":"0","y":"696","width":"300","height":"72","opacity":"255","padding":"12","background":"{\"filename\":\"\",\"x\":\"0\",\"y\":\"0\",\"opacity\":\"255\"}","text":"\\\\I[196]%1","style":"{\"name\":\"\",\"size\":\"28\",\"color\":\"#FFFFFF\",\"outlineWidth\":\"3\",\"outlineColor\":\"#000000\",\"bold\":\"false\",\"italic\":\"false\",\"align\":\"left\"}"}
  53. * @parent Scene
  54. *
  55. * @param Help Window
  56. * @text 帮助窗口
  57. * @type struct<helpWindow>
  58. * @default {"x":"0","y":"0","width":"1366","height":"144","opacity":"255","padding":"12","background":"{\"filename\":\"\",\"x\":\"0\",\"y\":\"0\",\"opacity\":\"255\"}","texts":"[\"{\\\"x\\\":\\\"0\\\",\\\"y\\\":\\\"0\\\",\\\"width\\\":\\\"456\\\",\\\"height\\\":\\\"28\\\",\\\"text\\\":\\\"%2\\\",\\\"style\\\":\\\"{\\\\\\\"name\\\\\\\":\\\\\\\"\\\\\\\",\\\\\\\"size\\\\\\\":\\\\\\\"28\\\\\\\",\\\\\\\"color\\\\\\\":\\\\\\\"#FFFFFF\\\\\\\",\\\\\\\"outlineWidth\\\\\\\":\\\\\\\"3\\\\\\\",\\\\\\\"outlineColor\\\\\\\":\\\\\\\"#000000\\\\\\\",\\\\\\\"bold\\\\\\\":\\\\\\\"false\\\\\\\",\\\\\\\"italic\\\\\\\":\\\\\\\"false\\\\\\\",\\\\\\\"align\\\\\\\":\\\\\\\"left\\\\\\\"}\\\"}\"]"}
  59. * @parent Scene
  60. *
  61. * @param Actor Selection Window
  62. * @text 角色选择窗口
  63. * @type struct<windowSelectable>
  64. * @default {"x":"0","y":"144","width":"300","height":"552","opacity":"255","padding":"12","cols":"1","background":"{\"filename\":\"\",\"x\":\"0\",\"y\":\"0\",\"opacity\":\"255\"}","text":"%1","style":"{\"name\":\"\",\"size\":\"28\",\"color\":\"#FFFFFF\",\"outlineWidth\":\"3\",\"outlineColor\":\"#000000\",\"bold\":\"false\",\"italic\":\"false\",\"align\":\"left\"}"}
  65. * @parent Scene
  66. *
  67. * @param Upgrade Window
  68. * @text 升级窗口
  69. * @type struct<upgradeWindow>
  70. * @default {"x":"300","y":"144","width":"1066","height":"624","opacity":"255","padding":"12","background":"{\"filename\":\"\",\"x\":\"0\",\"y\":\"0\",\"opacity\":\"255\"}","texts":"[\"{\\\"x\\\":\\\"0\\\",\\\"y\\\":\\\"0\\\",\\\"width\\\":\\\"404\\\",\\\"height\\\":\\\"28\\\",\\\"text\\\":\\\"%1\\\",\\\"style\\\":\\\"{\\\\\\\"name\\\\\\\":\\\\\\\"\\\\\\\",\\\\\\\"size\\\\\\\":\\\\\\\"28\\\\\\\",\\\\\\\"color\\\\\\\":\\\\\\\"#f38900\\\\\\\",\\\\\\\"outlineWidth\\\\\\\":\\\\\\\"3\\\\\\\",\\\\\\\"outlineColor\\\\\\\":\\\\\\\"#000000\\\\\\\",\\\\\\\"bold\\\\\\\":\\\\\\\"true\\\\\\\",\\\\\\\"italic\\\\\\\":\\\\\\\"false\\\\\\\",\\\\\\\"align\\\\\\\":\\\\\\\"left\\\\\\\"}\\\"}\",\"{\\\"x\\\":\\\"404\\\",\\\"y\\\":\\\"0\\\",\\\"width\\\":\\\"100\\\",\\\"height\\\":\\\"28\\\",\\\"text\\\":\\\"lv. %2\\\",\\\"style\\\":\\\"{\\\\\\\"name\\\\\\\":\\\\\\\"\\\\\\\",\\\\\\\"size\\\\\\\":\\\\\\\"28\\\\\\\",\\\\\\\"color\\\\\\\":\\\\\\\"#f38900\\\\\\\",\\\\\\\"outlineWidth\\\\\\\":\\\\\\\"3\\\\\\\",\\\\\\\"outlineColor\\\\\\\":\\\\\\\"#000000\\\\\\\",\\\\\\\"bold\\\\\\\":\\\\\\\"true\\\\\\\",\\\\\\\"italic\\\\\\\":\\\\\\\"false\\\\\\\",\\\\\\\"align\\\\\\\":\\\\\\\"right\\\\\\\"}\\\"}\",\"{\\\"x\\\":\\\"0\\\",\\\"y\\\":\\\"32\\\",\\\"width\\\":\\\"252\\\",\\\"height\\\":\\\"28\\\",\\\"text\\\":\\\"下一等级\\\",\\\"style\\\":\\\"{\\\\\\\"name\\\\\\\":\\\\\\\"\\\\\\\",\\\\\\\"size\\\\\\\":\\\\\\\"28\\\\\\\",\\\\\\\"color\\\\\\\":\\\\\\\"#FFFFFF\\\\\\\",\\\\\\\"outlineWidth\\\\\\\":\\\\\\\"3\\\\\\\",\\\\\\\"outlineColor\\\\\\\":\\\\\\\"#000000\\\\\\\",\\\\\\\"bold\\\\\\\":\\\\\\\"false\\\\\\\",\\\\\\\"italic\\\\\\\":\\\\\\\"false\\\\\\\",\\\\\\\"align\\\\\\\":\\\\\\\"left\\\\\\\"}\\\"}\",\"{\\\"x\\\":\\\"252\\\",\\\"y\\\":\\\"32\\\",\\\"width\\\":\\\"252\\\",\\\"height\\\":\\\"28\\\",\\\"text\\\":\\\"%3\\\",\\\"style\\\":\\\"{\\\\\\\"name\\\\\\\":\\\\\\\"\\\\\\\",\\\\\\\"size\\\\\\\":\\\\\\\"28\\\\\\\",\\\\\\\"color\\\\\\\":\\\\\\\"#FFFFFF\\\\\\\",\\\\\\\"outlineWidth\\\\\\\":\\\\\\\"3\\\\\\\",\\\\\\\"outlineColor\\\\\\\":\\\\\\\"#000000\\\\\\\",\\\\\\\"bold\\\\\\\":\\\\\\\"false\\\\\\\",\\\\\\\"italic\\\\\\\":\\\\\\\"false\\\\\\\",\\\\\\\"align\\\\\\\":\\\\\\\"right\\\\\\\"}\\\"}\",\"{\\\"x\\\":\\\"0\\\",\\\"y\\\":\\\"70\\\",\\\"width\\\":\\\"252\\\",\\\"height\\\":\\\"28\\\",\\\"text\\\":\\\"需要金币\\\",\\\"style\\\":\\\"{\\\\\\\"name\\\\\\\":\\\\\\\"\\\\\\\",\\\\\\\"size\\\\\\\":\\\\\\\"28\\\\\\\",\\\\\\\"color\\\\\\\":\\\\\\\"#FFFFFF\\\\\\\",\\\\\\\"outlineWidth\\\\\\\":\\\\\\\"3\\\\\\\",\\\\\\\"outlineColor\\\\\\\":\\\\\\\"#000000\\\\\\\",\\\\\\\"bold\\\\\\\":\\\\\\\"false\\\\\\\",\\\\\\\"italic\\\\\\\":\\\\\\\"false\\\\\\\",\\\\\\\"align\\\\\\\":\\\\\\\"left\\\\\\\"}\\\"}\",\"{\\\"x\\\":\\\"252\\\",\\\"y\\\":\\\"70\\\",\\\"width\\\":\\\"252\\\",\\\"height\\\":\\\"28\\\",\\\"text\\\":\\\"%4\\\\\\\\\\\\\\\\I[196]\\\",\\\"style\\\":\\\"{\\\\\\\"name\\\\\\\":\\\\\\\"\\\\\\\",\\\\\\\"size\\\\\\\":\\\\\\\"28\\\\\\\",\\\\\\\"color\\\\\\\":\\\\\\\"#FFFFFF\\\\\\\",\\\\\\\"outlineWidth\\\\\\\":\\\\\\\"3\\\\\\\",\\\\\\\"outlineColor\\\\\\\":\\\\\\\"#000000\\\\\\\",\\\\\\\"bold\\\\\\\":\\\\\\\"false\\\\\\\",\\\\\\\"italic\\\\\\\":\\\\\\\"false\\\\\\\",\\\\\\\"align\\\\\\\":\\\\\\\"right\\\\\\\"}\\\"}\"]","stats":"{\"x\":\"0\",\"y\":\"108\",\"width\":\"504\",\"height\":\"28\",\"spacing\":\"10\",\"termText\":\"%1\",\"termStyle\":\"{\\\"name\\\":\\\"\\\",\\\"size\\\":\\\"28\\\",\\\"color\\\":\\\"#FFFFFF\\\",\\\"outlineWidth\\\":\\\"3\\\",\\\"outlineColor\\\":\\\"#000000\\\",\\\"bold\\\":\\\"false\\\",\\\"italic\\\":\\\"false\\\",\\\"align\\\":\\\"left\\\"}\",\"valueText\":\"%1\",\"valueStyle\":\"{\\\"name\\\":\\\"\\\",\\\"size\\\":\\\"28\\\",\\\"color\\\":\\\"#FFFFFF\\\",\\\"outlineWidth\\\":\\\"3\\\",\\\"outlineColor\\\":\\\"#000000\\\",\\\"bold\\\":\\\"false\\\",\\\"italic\\\":\\\"false\\\",\\\"align\\\":\\\"right\\\"}\"}"}
  71. * @parent Scene
  72. *
  73. * @param Upgrade SE
  74. * @text 升级武器播放音效
  75. * @type struct<audioSe>
  76. * @default {"name":"Shop1","volume":"100","pitch":"100","pan":"0"}
  77. * @parent Scene
  78. *
  79. * @param Shop Settings
  80. * @text 升级商店设置
  81. * @type struct<shopSetting>[]
  82. * @default ["{\"name\":\"Jiji\",\"description\":\"你想加强那个角色的武器?\",\"min\":\"1\",\"max\":\"3\",\"cost\":\"c * 10\"}","{\"name\":\"Baba\",\"description\":\"你想加强那个角色的武器?\",\"min\":\"3\",\"max\":\"10\",\"cost\":\"c * 1000\"}"]
  83. *
  84. * @help
  85. * >>>SE声音素材名称:
  86. * 〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓
  87. * Weaponupgrade.ogg
  88. * 〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓
  89. *
  90. *
  91. * >>>图片路径:
  92. * 〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓
  93. * img/Ex_MenuBackground/WeaponUpgradeBack.png
  94. * 〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓
  95. *
  96. *
  97. * >>>武器备注:
  98. * 〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓
  99. * <upgradeFormula 类型: 公式>   设置该武器参数增长公式
  100. *
  101. * 类型: mhp, mmp, atk, def, mat, mdf, agi, luk
  102. *
  103. * 公式: a-角色, b-武器, c-武器等级
  104. * --------------------------------------
  105. * <upgradeMaxLevel: x>   设置该武器的最大武器等级
  106. * <noUpgrade>            该武器无法升级
  107. * 〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓
  108. *
  109. *
  110. * >>>插件参数:
  111. * 〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓
  112. * WeaponUpgrade open 名称        打开指定的武器升级商店
  113. * WeaponUpgrade upgrade 角色ID   升级指定角色的当前武器
  114. * 〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓
  115. */

  116. /*~struct~growthSetting:
  117. @param mhp
  118. @text 最大HP成长公式✚
  119. @desc a-角色   b-武器   c-武器等级

  120. @param mmp
  121. @text 最大MP成长公式✚
  122. @desc a-角色   b-武器   c-武器等级

  123. @param atk
  124. @text 物理攻击成长公式✚
  125. @desc a-角色   b-武器   c-武器等级

  126. @param def
  127. @text 物理防御成长公式✚
  128. @desc a-角色   b-武器   c-武器等级

  129. @param mat
  130. @text 魔法攻击成长公式✚
  131. @desc a-角色   b-武器   c-武器等级

  132. @param mdf
  133. @text 魔法防御成长公式✚
  134. @desc a-角色   b-武器   c-武器等级

  135. @param agi
  136. @text 敏捷成长公式✚
  137. @desc a-角色   b-武器   c-武器等级

  138. @param luk
  139. @text 运气成长公式✚
  140. @desc a-角色   b-武器   c-武器等级
  141. */

  142. /*~struct~audioSe:
  143. @param name
  144. @text 文件名称
  145. @type file
  146. @dir audio/se/

  147. @param volume
  148. @text 音量(0~100)
  149. @type number
  150. @min 0
  151. @max 100
  152. @default 100

  153. @param pitch
  154. @text 音调(50~150)
  155. @type number
  156. @min 50
  157. @max 150
  158. @default 100

  159. @param pan
  160. @text 音像(-100~100)
  161. @type number
  162. @min -100
  163. @max 100
  164. @default 0
  165. */

  166. /*~struct~shopSetting:
  167. @param name
  168. @text 商店名称

  169. @param description
  170. @text 商店描述✚
  171. @desc 使用\\n换行

  172. @param min
  173. @text 最低武器等级要求
  174. @type number
  175. @min 1

  176. @param max
  177. @text 最高武器等级要求
  178. @type number
  179. @min 1

  180. @param cost
  181. @text 升级成本公式✚
  182. @desc a-角色   b-武器   c-武器等级
  183. @default 100 * a
  184. */

  185. /*~struct~weaponIds:
  186. @param start
  187. @text Base Weapon
  188. @desc Weapon that can be upgraded, basically this is the level 1.
  189. @type weapon

  190. @param upgrades
  191. @text Upgrade IDs
  192. @desc Upgrades for the base weapon.
  193. @type weapon[]
  194. */

  195. /*~struct~armorIds:
  196. @param start
  197. @text Base Armor
  198. @desc Armor that can be upgraded, basically this is the level 1.
  199. @type armor

  200. @param upgrades
  201. @text Upgrade IDs
  202. @desc Upgrades for the base armor.
  203. @type armor[]
  204. */

  205. /*~struct~windowSelectable:
  206. @param x
  207. @text X坐标
  208. @type number
  209. @min -999999999
  210. @default 0

  211. @param y
  212. @text Y坐标
  213. @type number
  214. @min -999999999
  215. @default 0

  216. @param width
  217. @text 窗口宽度
  218. @default 1786
  219. @type number
  220. @min 32

  221. @param height
  222. @text 窗口高度
  223. @default 797
  224. @type number
  225. @min 32

  226. @param opacity
  227. @text 窗口不透明度
  228. @default 0
  229. @type number
  230. @max 255

  231. @param padding
  232. @text 窗口填充值
  233. @default 0
  234. @type number
  235. @min 0

  236. @param cols
  237. @text 最大列数
  238. @type number
  239. @min 1
  240. @default 4

  241. @param background
  242. @text 窗口背景
  243. @type struct<imageSetting>

  244. @param text
  245. @text 窗口文本✚
  246. @desc %1-角色名字
  247. @default %1

  248. @param style
  249. @text 文本样式
  250. @type struct<FontStyle>
  251. */

  252. /*~struct~helpWindow:
  253. @param x
  254. @text X坐标
  255. @type number
  256. @min -999999999
  257. @default 0

  258. @param y
  259. @text Y坐标
  260. @type number
  261. @min -999999999
  262. @default 0

  263. @param width
  264. @text 窗口宽度
  265. @default 1786
  266. @type number
  267. @min 32

  268. @param height
  269. @text 窗口高度
  270. @default 797
  271. @type number
  272. @min 32

  273. @param opacity
  274. @text 窗口不透明度
  275. @default 0
  276. @type number
  277. @max 255

  278. @param padding
  279. @text 窗口填充值
  280. @default 0
  281. @type number
  282. @min 0

  283. @param background
  284. @text 窗口背景
  285. @type struct<imageSetting>

  286. @param texts
  287. @text 窗口文本
  288. @desc %1-商店名称  %2-商店描述
  289. %3-商店的最低武器等级要求  %4-商店的最高等级武器要求
  290. @type struct<textSetting>[]
  291. @default
  292. */

  293. /*~struct~upgradeWindow:
  294. @param x
  295. @text X坐标
  296. @type number
  297. @min -999999999
  298. @default 0

  299. @param y
  300. @text Y坐标
  301. @type number
  302. @min -999999999
  303. @default 0

  304. @param width
  305. @text 窗口宽度
  306. @default 1786
  307. @type number
  308. @min 32

  309. @param height
  310. @text 窗口高度
  311. @default 797
  312. @type number
  313. @min 32

  314. @param opacity
  315. @text 窗口不透明度
  316. @default 0
  317. @type number
  318. @max 255

  319. @param padding
  320. @text 窗口填充值
  321. @default 0
  322. @type number
  323. @min 0

  324. @param background
  325. @text 窗口背景
  326. @type struct<imageSetting>

  327. @param texts
  328. @text 窗口文本
  329. @desc %1-武器名称  %2-当前武器等级
  330. %3-下个武器等级  %4-升级成本
  331. @type struct<textSetting>[]

  332. @param stats
  333. @text 武器升级统计
  334. @type struct<statsSetting>
  335. */

  336. /*~struct~statsSetting:
  337. @param x
  338. @text 文本相对X坐标
  339. @type number
  340. @min -999999999
  341. @default 0

  342. @param y
  343. @text 文本相对Y坐标
  344. @type number
  345. @min -999999999
  346. @default 0

  347. @param width
  348. @text 文本宽度
  349. @type number
  350. @min 4

  351. @param height
  352. @text 文本高度
  353. @type number
  354. @min 4

  355. @param spacing
  356. @text 行间距
  357. @type number

  358. @param termText
  359. @text 术语文本内容✚
  360. @desc %1-对应的基本参数名称

  361. @param termStyle
  362. @text 术语文本样式
  363. @type struct<FontStyle>

  364. @param valueText
  365. @text 数值文本内容✚
  366. @desc %1-对应的基本参数数值

  367. @param valueStyle
  368. @text 数值文本样式
  369. @type struct<FontStyle>
  370. */

  371. /*~struct~windowSetting:
  372. @param x
  373. @text X坐标
  374. @type number
  375. @min -999999999
  376. @default 0

  377. @param y
  378. @text Y坐标
  379. @type number
  380. @min -999999999
  381. @default 0

  382. @param width
  383. @text 窗口宽度
  384. @default 1786
  385. @type number
  386. @min 32

  387. @param height
  388. @text 窗口高度
  389. @default 797
  390. @type number
  391. @min 32

  392. @param opacity
  393. @text 窗口不透明度
  394. @default 0
  395. @type number
  396. @max 255

  397. @param padding
  398. @text 窗口填充值
  399. @default 0
  400. @type number
  401. @min 0

  402. @param background
  403. @text 窗口背景
  404. @type struct<imageSetting>

  405. @param text
  406. @text 窗口文本✚
  407. @desc %1-当前金币   %2-货币单位
  408. @default %1

  409. @param style
  410. @text 文本样式
  411. @type struct<FontStyle>
  412. */

  413. /*~struct~imageSetting:
  414. @param filename
  415. @text 文件名称
  416. @type file
  417. @dir img/Ex_MenuBackground/

  418. @param x
  419. @text X坐标
  420. @type number
  421. @min -999999999
  422. @default 0

  423. @param y
  424. @text Y坐标
  425. @type number
  426. @min -999999999
  427. @default 0

  428. @param opacity
  429. @text 不透明度
  430. @type number
  431. @min 0
  432. @max 255
  433. @default 255
  434. */

  435. /*~struct~textSetting:
  436. @param x
  437. @text 文本相对X坐标
  438. @type number
  439. @min -999999999
  440. @default 0

  441. @param y
  442. @text 文本相对Y坐标
  443. @type number
  444. @min -999999999
  445. @default 0

  446. @param width
  447. @text 文本宽度
  448. @type number
  449. @min 4

  450. @param height
  451. @text 文本高度
  452. @type number
  453. @min 4

  454. @param text
  455. @text 文本内容

  456. @param style
  457. @text 文本样式
  458. @type struct<FontStyle>
  459. */

  460. /*~struct~FontStyle:
  461. @param name
  462. @text 字体名称

  463. @param size
  464. @text 字体大小
  465. @default 28
  466. @type number
  467. @min 1

  468. @param color
  469. @text 字体颜色
  470. @desc Font color
  471. @default #FFFFFF

  472. @param outlineWidth
  473. @text 字体轮廓宽度
  474. @default 1
  475. @type number

  476. @param outlineColor
  477. @text 字体轮廓颜色
  478. @default #000000

  479. @param bold
  480. @text 字体加粗
  481. @default false
  482. @type boolean

  483. @param italic
  484. @text 字体斜体
  485. @default false
  486. @type boolean

  487. @param align
  488. @text 文本对齐方式
  489. @default center
  490. @type select
  491. @option left
  492. @option center
  493. @option right
  494. */



  495. Dhoom.Parameters = $plugins.filter(function (obj) { return obj.description.match(/武器升级系统/) })[0].parameters;
  496. if (!Dhoom.jsonParse) {
  497.     Dhoom.jsonParse = function (string) {
  498.         try {
  499.             return JSON.parse(string, function (key, value) {
  500.                 try {
  501.                     return this.jsonParse(value);
  502.                 } catch (e) {
  503.                     return value;
  504.                 }
  505.             }.bind(this))
  506.         } catch (e) {
  507.             return string;
  508.         }
  509.     };
  510. }
  511. if (!Dhoom.loadParam) {
  512.     Dhoom.loadParam = function (sym) {
  513.         return Dhoom.jsonParse(Dhoom.Parameters[sym]);
  514.     };
  515. }

  516. Dhoom.WeaponUpgrade.defaultCost = Dhoom.loadParam('Default Upgrade Cost Formula');
  517. Dhoom.WeaponUpgrade.defaultGrowthFormula = Dhoom.loadParam('Default Growth Formula');
  518. Dhoom.WeaponUpgrade.defaultMaxLevel = Dhoom.loadParam("Default Max Level");

  519. Dhoom.WeaponUpgrade.sceneBackground = Dhoom.loadParam('Background');
  520. Dhoom.WeaponUpgrade.goldWindow = Dhoom.loadParam('Gold Window');
  521. Dhoom.WeaponUpgrade.helpWindow = Dhoom.loadParam('Help Window');
  522. Dhoom.WeaponUpgrade.actorWindow = Dhoom.loadParam('Actor Selection Window');
  523. Dhoom.WeaponUpgrade.upgradeWindow = Dhoom.loadParam('Upgrade Window');
  524. Dhoom.WeaponUpgrade.upgradeSE = Dhoom.loadParam('Upgrade SE');

  525. Dhoom.WeaponUpgrade.shopSettings = Dhoom.loadParam('Shop Settings');

  526. //vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
  527. // Dhoom.WeaponUpgrade
  528. //vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
  529. Dhoom.WeaponUpgrade.paramTypes = ['mhp', 'mmp', 'atk', 'def', 'mat', 'mdf', 'agi', 'luk'];
  530. Dhoom.WeaponUpgrade.isValid = function (weapon) {
  531.     return DataManager.isWeapon(weapon) && !weapon.noUpgrade;
  532. };

  533. Dhoom.WeaponUpgrade.isWeaponLevelMax = function (weapon) {
  534.     if (this.isValid(weapon)) {
  535.         var max = this.defaultMaxLevel;
  536.         if (weapon.upgradeMaxLevel) max = weapon.upgradeMaxLevel;
  537.         return (weapon.weaponLevel || 1) === max;
  538.     }
  539.     return false;
  540. };

  541. Dhoom.WeaponUpgrade.getUpgradeCost = function (actor, weapon, level) {
  542.     var formula = this.defaultCost;
  543.     if (this.currentShop && this.currentShop.cost) formula = this.currentShop.cost;
  544.     var a = actor;
  545.     var b = weapon;
  546.     var c = level;
  547.     var result = 0;
  548.     try {
  549.         result = eval(formula);
  550.     } catch (e) {
  551.         console.warn("Upgrade Cost Formula Error!");
  552.         console.warn(e);
  553.         result = 0;
  554.     }
  555.     return result;
  556. };

  557. Dhoom.WeaponUpgrade.getShop = function (name) {
  558.     for (var i = 0; i < this.shopSettings.length; i++) {
  559.         if (this.shopSettings[i].name === name) return this.shopSettings[i];
  560.     };
  561. };

  562. Dhoom.WeaponUpgrade.shopCanUpgrade = function (level) {
  563.     if (this.currentShop) return level >= this.currentShop.min && level < this.currentShop.max;
  564.     return true;
  565. };

  566. Dhoom.WeaponUpgrade.upgradeWeapon = function (actor, weapon, amount) {
  567.     var types = this.paramTypes;
  568.     if (this.isValid(weapon)) {
  569.         for (var i = 0; i < amount; i++) {
  570.             if (!this.isWeaponLevelMax(weapon)) {
  571.                 var level = (weapon.weaponLevel || 1) + 1;
  572.                 weapon.weaponLevel = level;
  573.                 for (var j = 0; j < 7; j++) {
  574.                     var type = types[j];
  575.                     weapon.params[j] = this.getUpgradedStat(type, actor, weapon, level);
  576.                 }
  577.             }
  578.         }
  579.     }
  580. };

  581. Dhoom.WeaponUpgrade.getUpgradedStat = function (type, actor, weapon, level) {
  582.     var a = actor;
  583.     var b = weapon;
  584.     var c = level;
  585.     var types = this.paramTypes;
  586.     var formula = "";
  587.     if (this.defaultGrowthFormula[type]) formula = this.defaultGrowthFormula[type];
  588.     if (b.upgradeFormula[type]) formula = b.upgradeFormula[type];
  589.     if (formula.trim()) {
  590.         try {
  591.             return Math.floor(eval(formula));
  592.         } catch (e) {
  593.             console.warn('Upgrade Formula Error!');
  594.             console.warn(e);
  595.         }
  596.     }
  597.     return b.params[types.indexOf(type)];
  598. };

  599. if (Imported.YEP_ItemCore) {
  600.     //vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
  601.     // Bitmap
  602.     //vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
  603.     Dhoom.WeaponUpgrade.Bitmap_initialize = Bitmap.prototype.initialize;
  604.     Bitmap.prototype.initialize = function (width, height) {
  605.         Dhoom.WeaponUpgrade.Bitmap_initialize.call(this, width, height);
  606.         this.fontBold = false;
  607.     };

  608.     Dhoom.WeaponUpgrade.Bitmap_makeFontNameText = Bitmap.prototype._makeFontNameText;
  609.     Bitmap.prototype._makeFontNameText = function () {
  610.         if (this.fontBold) return 'Bold ' + this.fontSize + 'px ' + this.fontFace;
  611.         return Dhoom.WeaponUpgrade.Bitmap_makeFontNameText.call(this);
  612.     };

  613.     Bitmap.prototype.changeTextStyle = function (style) {
  614.         this.fontFace = style.name.length > 0 ? style.name : 'GameFont';
  615.         this.fontSize = style.size;
  616.         this.textColor = style.color;
  617.         this.outlineWidth = style.outlineWidth;
  618.         this.outlineColor = style.outlineColor;
  619.         this.fontBold = style.bold;
  620.         this.fontItalic = style.italic;
  621.     };

  622.     Dhoom.WeaponUpgrade.Bitmap_drawTextOutline = Bitmap.prototype._drawTextOutline;
  623.     Bitmap.prototype._drawTextOutline = function (text, tx, ty, maxWidth) {
  624.         if (this.outlineWidth === 0) return;
  625.         Dhoom.WeaponUpgrade.Bitmap_drawTextOutline.call(this, text, tx, ty, maxWidth);
  626.     };

  627.     //vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
  628.     // DataManager
  629.     //vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
  630.     Dhoom.WeaponUpgrade.DataManager_isDatabaseLoaded = DataManager.isDatabaseLoaded;
  631.     DataManager.isDatabaseLoaded = function () {
  632.         if (!Dhoom.WeaponUpgrade.DataManager_isDatabaseLoaded.call(this)) return false;
  633.         if (!Dhoom.WeaponUpgrade.isWeaponUpgradeInitialized) {
  634.             this.DhoomWeaponUpgradeInitWeapons();
  635.             Dhoom.WeaponUpgrade.isWeaponUpgradeInitialized = true;
  636.         }
  637.         return true;
  638.     };

  639.     DataManager.DhoomWeaponUpgradeInitWeapons = function () {
  640.         var group = $dataWeapons;
  641.         for (var i = 1; i < group.length; i++) {
  642.             var object = group[i];
  643.             if (object) {
  644.                 object.weaponLevel = object.weaponLevel || 1;
  645.                 object.upgradeFormula = {};
  646.                 var notedata = object.note.split(/[\r\n]+/);
  647.                 for (var n = 0; n < notedata.length; n++) {
  648.                     if (notedata[n].match(/<upgradeformula (\w+):\s*(.+)>/i)) {
  649.                         if (Dhoom.WeaponUpgrade.paramTypes.contains(RegExp.$1.trim().toLowerCase()))
  650.                             object.upgradeFormula[RegExp.$1.trim().toLowerCase()] = RegExp.$2.trim();
  651.                     }
  652.                     if (notedata[n].match(/<upgrademaxlevel:\s*(\d+)>/i)) {
  653.                         object.upgradeMaxLevel = Number(RegExp.$1);
  654.                     }
  655.                     if (notedata[n].match(/<noupgrade>/i)) {
  656.                         object.noUpgrade = true;
  657.                         object.weaponLevel = undefined;
  658.                     }
  659.                 }
  660.             }
  661.         }
  662.     };

  663.     //vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
  664.     // Game_Interpreter
  665.     //vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
  666.     Dhoom.WeaponUpgrade.Game_Interpreter_pluginCommand = Game_Interpreter.prototype.pluginCommand;
  667.     Game_Interpreter.prototype.pluginCommand = function (command, args) {
  668.         Dhoom.WeaponUpgrade.Game_Interpreter_pluginCommand.call(this, command, args);
  669.         if (command.toLowerCase() === 'weaponupgrade') {
  670.             switch (args[0].toLowerCase()) {
  671.                 case 'open':
  672.                     var name = args.slice(1).join(" ");
  673.                     var shop = Dhoom.WeaponUpgrade.getShop(name);
  674.                     if (shop) {
  675.                         Dhoom.WeaponUpgrade.currentShop = shop;
  676.                         SceneManager.push(Scene_WeaponUpgrade);
  677.                     }
  678.                     break;
  679.                 case 'upgrade':
  680.                     var actorId = Number(args[1]);
  681.                     Dhoom.WeaponUpgrade.upgradeWeapon($gameActors.actor(actorId), $gameActors.actor(actorId).equips()[0], 1);
  682.                     break;
  683.             }
  684.         }
  685.     };

  686.     //vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
  687.     // Window_WeaponUpBase
  688.     //vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
  689.     function Window_WeaponUpBase() {
  690.         this.initialize.apply(this, arguments);
  691.     }

  692.     Window_WeaponUpBase.prototype = Object.create(Window_Base.prototype);
  693.     Window_WeaponUpBase.prototype.constructor = Window_WeaponUpBase;

  694.     Window_WeaponUpBase.prototype.initialize = function (setting) {
  695.         this._setting = setting;
  696.         Window_Base.prototype.initialize.call(this, this.setting().x, this.setting().y, this.setting().width, this.setting().height);
  697.         this.opacity = this.setting().opacity;
  698.         this.createBackground();
  699.     };

  700.     Window_WeaponUpBase.prototype.setting = function () {
  701.         return this._setting;
  702.     };

  703.     Window_WeaponUpBase.prototype.standardPadding = function () {
  704.         return this.setting().padding;
  705.     };

  706.     Window_WeaponUpBase.prototype.createBackground = function () {
  707.         var setting = this.setting().background;
  708.         this._background = new Sprite();
  709.         this._background.bitmap = ImageManager.loadSystem(setting.filename);
  710.         this._background.x = setting.x;
  711.         this._background.y = setting.y;
  712.         this._background.opacity = setting.opacity;
  713.         this.addChildToBack(this._background);
  714.     };

  715.     Window_WeaponUpBase.prototype.resetFontSettings = function () {
  716.         Window_Base.prototype.resetFontSettings.call(this);
  717.         if (this.setting().style) this.contents.changeTextStyle(this.setting().style);
  718.     };

  719.     Window_WeaponUpBase.prototype.drawFormattedText = function (data, x, y, width, height, setting) {
  720.         setting = setting || this.setting();
  721.         var tempSetting = this._setting;
  722.         this._setting = setting;
  723.         var style = setting.style;
  724.         var text = setting.text.format.apply(setting.text, data);
  725.         text = this.convertEscapeCharacters(text);
  726.         text = this.convertEscapeCharacters(text);
  727.         var texts = text.split("\x1bn");
  728.         texts.forEach(function (text) {
  729.             this.resetFontSettings();
  730.             var tw = this.calculateTextWidth(text);
  731.             var textState = {};
  732.             textState.x = 0;
  733.             textState.y = 0;
  734.             textState.left = 0;
  735.             textState.text = text;
  736.             textState.index = 0;
  737.             var th = this.calcTextHeight(textState, false);
  738.             var tx = 0;
  739.             if (style.align === 'center') {
  740.                 tx = (width - tw) / 2;
  741.             } else if (style.align === 'right') {
  742.                 tx = width - tw;
  743.             }
  744.             var ty = (height - th) / 2;
  745.             this.drawTextEx(text, x + tx, y + ty);
  746.             y += height;
  747.         }, this);
  748.         this._setting = tempSetting;
  749.     };

  750.     Window_WeaponUpBase.prototype.calculateTextWidth = function (text) {
  751.         var textState = {};
  752.         textState.x = 0;
  753.         textState.y = 0;
  754.         textState.left = 0;
  755.         textState.text = text;
  756.         textState.index = 0;
  757.         var result = 0;
  758.         while (textState.index < textState.text.length) {
  759.             switch (textState.text[textState.index]) {
  760.                 case '\x1b':
  761.                     switch (this.obtainEscapeCode(textState)) {
  762.                         case 'C':
  763.                             this.changeTextColor(this.textColor(this.obtainEscapeParam(textState)));
  764.                             break;
  765.                         case 'I':
  766.                             this.obtainEscapeParam(textState);
  767.                             result += Window_Base._iconWidth + 4;
  768.                             break;
  769.                         case '{':
  770.                             this.makeFontBigger();
  771.                             break;
  772.                         case '}':
  773.                             this.makeFontSmaller();
  774.                             break;
  775.                     }
  776.                     break;
  777.                 default:
  778.                     result += this.contents.measureTextWidth(textState.text[textState.index]);
  779.                     textState.index++;
  780.                     break;
  781.             }
  782.         }
  783.         return result;
  784.     };

  785.     //vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
  786.     // Window_WeaponUpSelectable
  787.     //-----------------------------------------------------------------------------
  788.     // Help
  789.     //vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
  790.     function Window_WeaponUpSelectable() {
  791.         this.initialize.apply(this, arguments);
  792.     }

  793.     Window_WeaponUpSelectable.prototype = Object.create(Window_Selectable.prototype);
  794.     Window_WeaponUpSelectable.prototype.constructor = Window_WeaponUpSelectable;

  795.     Window_WeaponUpSelectable.prototype.initialize = function (setting) {
  796.         this._setting = setting;
  797.         Window_Selectable.prototype.initialize.call(this, this.setting().x, this.setting().y, this.setting().width, this.setting().height);
  798.         this.opacity = this.setting().opacity;
  799.         this.createBackground();
  800.     };

  801.     Window_WeaponUpSelectable.prototype.setting = function () {
  802.         return this._setting;
  803.     };

  804.     Window_WeaponUpSelectable.prototype.standardPadding = function () {
  805.         return this.setting().padding;
  806.     };

  807.     Window_WeaponUpSelectable.prototype.maxCols = function () {
  808.         return this.setting().cols;
  809.     };

  810.     Window_WeaponUpSelectable.prototype.createBackground = function () {
  811.         var setting = this.setting().background;
  812.         this._background = new Sprite();
  813.         this._background.bitmap = ImageManager.loadSystem(setting.filename);
  814.         this._background.x = setting.x;
  815.         this._background.y = setting.y;
  816.         this._background.opacity = setting.opacity;
  817.         this.addChildToBack(this._background);
  818.     };

  819.     Window_WeaponUpSelectable.prototype.resetFontSettings = function () {
  820.         Window_Selectable.prototype.resetFontSettings.call(this);
  821.         this.contents.changeTextStyle(this.setting().style);
  822.     };

  823.     Window_WeaponUpSelectable.prototype.drawFormattedText = function (data, x, y, width, height) {
  824.         var style = this.setting().style;
  825.         var text = this.setting().text.format.apply(this.setting().text, data);
  826.         text = this.convertEscapeCharacters(text);
  827.         text = this.convertEscapeCharacters(text);
  828.         this.resetFontSettings();
  829.         var tw = this.calculateTextWidth(text);
  830.         var textState = {};
  831.         textState.x = 0;
  832.         textState.y = 0;
  833.         textState.left = 0;
  834.         textState.text = text;
  835.         textState.index = 0;
  836.         var th = this.calcTextHeight(textState, false);
  837.         var tx = 0;
  838.         if (style.align === 'center') {
  839.             tx = (width - tw) / 2;
  840.         } else if (style.align === 'right') {
  841.             tx = width - tw;
  842.         }
  843.         var ty = (height - th) / 2;
  844.         this.drawTextEx(text, x + tx, y + ty);
  845.     };

  846.     Window_WeaponUpSelectable.prototype.calculateTextWidth = function (text) {
  847.         var textState = {};
  848.         textState.x = 0;
  849.         textState.y = 0;
  850.         textState.left = 0;
  851.         textState.text = text;
  852.         textState.index = 0;
  853.         var result = 0;
  854.         while (textState.index < textState.text.length) {
  855.             switch (textState.text[textState.index]) {
  856.                 case '\x1b':
  857.                     switch (this.obtainEscapeCode(textState)) {
  858.                         case 'C':
  859.                             this.changeTextColor(this.textColor(this.obtainEscapeParam(textState)));
  860.                             break;
  861.                         case 'I':
  862.                             this.obtainEscapeParam(textState);
  863.                             result += Window_Base._iconWidth + 4;
  864.                             break;
  865.                         case '{':
  866.                             this.makeFontBigger();
  867.                             break;
  868.                         case '}':
  869.                             this.makeFontSmaller();
  870.                             break;
  871.                     }
  872.                     break;
  873.                 default:
  874.                     result += this.contents.measureTextWidth(textState.text[textState.index]);
  875.                     textState.index++;
  876.                     break;
  877.             }
  878.         }
  879.         return result;
  880.     };

  881.     //vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
  882.     // Window_WeaponUpGold
  883.     //vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
  884.     function Window_WeaponUpGold() {
  885.         this.initialize.apply(this, arguments);
  886.     }

  887.     Window_WeaponUpGold.prototype = Object.create(Window_WeaponUpBase.prototype);
  888.     Window_WeaponUpGold.prototype.constructor = Window_WeaponUpGold;

  889.     Window_WeaponUpGold.prototype.initialize = function (setting) {
  890.         Window_WeaponUpBase.prototype.initialize.call(this, setting);
  891.         this.refresh();
  892.     };

  893.     Window_WeaponUpGold.prototype.refresh = function () {
  894.         this.contents.clear();
  895.         var data = [$gameParty.gold(), TextManager.currencyUnit];
  896.         this.drawFormattedText(data, 0, 0, this.contents.width, this.contents.height);
  897.     };

  898.     //vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
  899.     // Window_WeaponUpActor
  900.     //vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
  901.     function Window_WeaponUpActor() {
  902.         this.initialize.apply(this, arguments);
  903.     }

  904.     Window_WeaponUpActor.prototype = Object.create(Window_WeaponUpSelectable.prototype);
  905.     Window_WeaponUpActor.prototype.constructor = Window_WeaponUpActor;

  906.     Window_WeaponUpActor.prototype.maxItems = function () {
  907.         return $gameParty.members().length;
  908.     };

  909.     Window_WeaponUpActor.prototype.actor = function () {
  910.         return $gameParty.members()[this.index()];
  911.     };

  912.     Window_WeaponUpActor.prototype.drawItem = function (index) {
  913.         var rect = this.itemRect(index);
  914.         var actor = $gameParty.members()[index];
  915.         var data = [actor.name()];
  916.         this.changePaintOpacity(this.isCommandEnabled(index));
  917.         this.drawFormattedText(data, rect.x, rect.y, rect.width, rect.height);
  918.     };

  919.     Window_WeaponUpActor.prototype.updateHelp = function () {
  920.         this.setHelpWindowItem(this.actor());
  921.     };

  922.     Window_WeaponUpActor.prototype.isCommandEnabled = function (index) {
  923.         var actor = $gameParty.members()[index];
  924.         if (!actor) return false;
  925.         var weapon = actor.equips()[0];
  926.         return Dhoom.WeaponUpgrade.isValid(weapon) && !Dhoom.WeaponUpgrade.isWeaponLevelMax(weapon) && Dhoom.WeaponUpgrade.shopCanUpgrade(weapon.weaponLevel) && $gameParty.gold() >= Dhoom.WeaponUpgrade.getUpgradeCost(actor, weapon, weapon.weaponLevel + 1);
  927.     };

  928.     Window_WeaponUpActor.prototype.isCurrentItemEnabled = function () {
  929.         return this.isCommandEnabled(this.index());
  930.     };

  931.     //vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
  932.     // Window_WeaponUpgrade
  933.     //vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
  934.     function Window_WeaponUpgrade() {
  935.         this.initialize.apply(this, arguments);
  936.     }

  937.     Window_WeaponUpgrade.prototype = Object.create(Window_WeaponUpBase.prototype);
  938.     Window_WeaponUpgrade.prototype.constructor = Window_WeaponUpgrade;

  939.     Window_WeaponUpgrade.prototype.setItem = function (actor) {
  940.         if (actor !== this._actor) {
  941.             this._actor = actor;
  942.             this.refresh();
  943.         }
  944.     };

  945.     Window_WeaponUpgrade.prototype.clear = function () {
  946.         this.setItem(null);
  947.     };

  948.     Window_WeaponUpgrade.prototype.refresh = function () {
  949.         this.contents.clear();
  950.         if (!this._actor) return;
  951.         var weapon = this._actor.equips()[0];
  952.         var name = weapon ? weapon.name : "";
  953.         var level = "-";
  954.         var next = "-";
  955.         var cost = "-";
  956.         if (Dhoom.WeaponUpgrade.isValid(weapon)) {
  957.             level = weapon.weaponLevel;
  958.             next = Dhoom.WeaponUpgrade.isWeaponLevelMax(weapon) ? "MAX" : weapon.weaponLevel + 1;
  959.             cost = Dhoom.WeaponUpgrade.isWeaponLevelMax(weapon) ? "-" : Dhoom.WeaponUpgrade.getUpgradeCost(this._actor, weapon, weapon.weaponLevel + 1);
  960.             if (!Dhoom.WeaponUpgrade.isWeaponLevelMax(weapon) && !Dhoom.WeaponUpgrade.shopCanUpgrade(weapon.weaponLevel)) {
  961.                 next = 'Not Available';
  962.                 cost = 'Not Available';
  963.             }
  964.         }
  965.         var data = [name, level, next, cost];
  966.         this.setting().texts.forEach(function (setting) {
  967.             this.drawFormattedText(data, setting.x, setting.y, setting.width, setting.height, setting);
  968.         }, this);
  969.         if (Dhoom.WeaponUpgrade.isValid(weapon) && !Dhoom.WeaponUpgrade.isWeaponLevelMax(weapon) && Dhoom.WeaponUpgrade.shopCanUpgrade(weapon.weaponLevel)) {
  970.             var sx = this.setting().stats.x;
  971.             var sy = this.setting().stats.y;
  972.             var sw = this.setting().stats.width;
  973.             var sh = this.setting().stats.height;
  974.             var th = sh;
  975.             if (this.setting().stats.termStyle.fontSize && this.setting().stats.termStyle.fontSize > th)
  976.                 th = this.setting().stats.termStyle.fontSize;
  977.             if (this.setting().stats.valueStyle.fontSize && this.setting().stats.valueStyle.fontSize > th)
  978.                 th = this.setting().stats.valueStyle.fontSize;
  979.             var types = Dhoom.WeaponUpgrade.paramTypes;
  980.             for (var i = 0; i < 8; i++) {
  981.                 var upgrade = Dhoom.WeaponUpgrade.getUpgradedStat(types[i], this._actor, weapon, next);
  982.                 var value = upgrade - weapon.params[i];
  983.                 if (value !== 0) {
  984.                     var setting = { text: this.setting().stats.termText, style: this.setting().stats.termStyle };
  985.                     this.drawFormattedText([TextManager.param(i)], sx, sy, sw, th, setting);
  986.                     setting = { text: this.setting().stats.valueText, style: this.setting().stats.valueStyle };
  987.                     this.drawFormattedText([value > 0 ? "+%1".format(value) : value], sx, sy, sw, th, setting);
  988.                     sy += th + this.setting().stats.spacing;
  989.                 }
  990.             }
  991.         }
  992.     };

  993.     //vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
  994.     // Window_WeaponUpHelp
  995.     //vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
  996.     function Window_WeaponUpHelp() {
  997.         this.initialize.apply(this, arguments);
  998.     }

  999.     Window_WeaponUpHelp.prototype = Object.create(Window_WeaponUpBase.prototype);
  1000.     Window_WeaponUpHelp.prototype.constructor = Window_WeaponUpHelp;

  1001.     Window_WeaponUpHelp.prototype.refresh = function () {
  1002.         this.contents.clear();
  1003.         var shop = Dhoom.WeaponUpgrade.currentShop;
  1004.         var data = [shop.name, shop.description, shop.min, shop.max];
  1005.         this.setting().texts.forEach(function (setting) {
  1006.             this.drawFormattedText(data, setting.x, setting.y, setting.width, setting.height, setting);
  1007.         }, this);
  1008.     };

  1009.     //vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
  1010.     // Scene_WeaponUpgrade
  1011.     //vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
  1012.     function Scene_WeaponUpgrade() {
  1013.         this.initialize.apply(this, arguments);
  1014.     }

  1015.     Scene_WeaponUpgrade.prototype = Object.create(Scene_MenuBase.prototype);
  1016.     Scene_WeaponUpgrade.prototype.constructor = Scene_WeaponUpgrade;

  1017.     Scene_WeaponUpgrade.prototype.create = function () {
  1018.         Scene_MenuBase.prototype.create.call(this);
  1019.         this.createGoldWindow();
  1020.         this.createHelpWindow();
  1021.         this.createUpgradeWindow();
  1022.         this.createActorWindow();
  1023.     };

  1024.     Scene_WeaponUpgrade.prototype.createBackground = function () {
  1025.         Scene_MenuBase.prototype.createBackground.call(this);
  1026.         if (Dhoom.WeaponUpgrade.sceneBackground) this._backgroundSprite.bitmap = ImageManager.loadSystem(Dhoom.WeaponUpgrade.sceneBackground);
  1027.     };

  1028.     Scene_WeaponUpgrade.prototype.createGoldWindow = function () {
  1029.         this._goldWindow = new Window_WeaponUpGold(Dhoom.WeaponUpgrade.goldWindow);
  1030.         this.addChild(this._goldWindow);
  1031.     };

  1032.     Scene_WeaponUpgrade.prototype.createHelpWindow = function () {
  1033.         this._helpWindow = new Window_WeaponUpHelp(Dhoom.WeaponUpgrade.helpWindow);
  1034.         this._helpWindow.refresh();
  1035.         this.addChild(this._helpWindow);
  1036.     };

  1037.     Scene_WeaponUpgrade.prototype.createUpgradeWindow = function () {
  1038.         this._upgradeWindow = new Window_WeaponUpgrade(Dhoom.WeaponUpgrade.upgradeWindow);
  1039.         this.addChild(this._upgradeWindow);
  1040.     };

  1041.     Scene_WeaponUpgrade.prototype.createActorWindow = function () {
  1042.         this._actorWindow = new Window_WeaponUpActor(Dhoom.WeaponUpgrade.actorWindow);
  1043.         this._actorWindow.setHandler('ok', this.onActorOk.bind(this));
  1044.         this._actorWindow.setHandler('cancel', this.popScene.bind(this));
  1045.         this._actorWindow.setHelpWindow(this._upgradeWindow);
  1046.         this._actorWindow.refresh();
  1047.         this._actorWindow.select(0);
  1048.         this._actorWindow.activate();
  1049.         this.addChild(this._actorWindow);
  1050.     };

  1051.     Scene_WeaponUpgrade.prototype.update = function () {
  1052.         Scene_MenuBase.prototype.update.call(this);
  1053.         if (this._seBuffer && this._seBuffer.isReady() && !this._seBuffer.isPlaying()) this.endSE();
  1054.     };

  1055.     Scene_WeaponUpgrade.prototype.onActorOk = function () {
  1056.         this.startSE();
  1057.     };

  1058.     Scene_WeaponUpgrade.prototype.startSE = function () {
  1059.         AudioManager.playSe(Dhoom.WeaponUpgrade.upgradeSE);
  1060.         this._seBuffer = AudioManager._seBuffers[AudioManager._seBuffers.length - 1];
  1061.     };

  1062.     Scene_WeaponUpgrade.prototype.endSE = function () {
  1063.         this._seBuffer = undefined;
  1064.         var actor = this._actorWindow.actor();
  1065.         var weapon = actor.equips()[0];
  1066.         Dhoom.WeaponUpgrade.upgradeWeapon(actor, actor.equips()[0], 1);
  1067.         $gameParty.loseGold(Dhoom.WeaponUpgrade.getUpgradeCost(actor, weapon, weapon.weaponLevel));
  1068.         this._goldWindow.refresh();
  1069.         this._actorWindow.refresh();
  1070.         this._upgradeWindow.refresh();
  1071.         this._actorWindow.activate();
  1072.     };
  1073. } else {
  1074.     console.error('You need to use YEP Item Core for this plugin to work.');
  1075. }
复制代码

评分

参与人数 1+1 收起 理由
xiamumomo + 1 塞糖

查看全部评分

回复

使用道具 举报

Lv2.观梦者

梦石
0
星屑
791
在线时间
71 小时
注册时间
2023-12-26
帖子
105
4
发表于 2024-3-21 16:23:29 | 只看该作者
MV不是插件吗,脚本要怎么用?
回复

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
143
在线时间
63 小时
注册时间
2024-3-13
帖子
47
5
发表于 2024-3-21 16:36:59 | 只看该作者
djs789783 发表于 2024-3-21 16:23
MV不是插件吗,脚本要怎么用?

MV是软件系列之一。插件是脚本,在【工具】->【插件管理】(F10)中管理使用,文件位于 project/js/plugins 目录下,可以看论坛图书馆(https://rpg.blue/thread-386094-1-1.html)或者软件【目录】(F1)学习
回复

使用道具 举报

Lv2.观梦者

梦石
0
星屑
791
在线时间
71 小时
注册时间
2023-12-26
帖子
105
6
发表于 2024-3-22 10:03:01 | 只看该作者
koumei 发表于 2024-3-21 16:36
MV是软件系列之一。插件是脚本,在【工具】->【插件管理】(F10)中管理使用,文件位于 project/js/plugi ...

还是听不懂,打开游戏工具--插件管理,对照你说的意思,还是没懂。脚本是脚本,插件是插件,有脚本怎么变插件?脚本是小本子,插件图标都不一样。脚本是代码,脚本要转成插件,懂了吗?
回复

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
143
在线时间
63 小时
注册时间
2024-3-13
帖子
47
7
发表于 2024-3-22 10:20:11 | 只看该作者
djs789783 发表于 2024-3-22 10:03
还是听不懂,打开游戏工具--插件管理,对照你说的意思,还是没懂。脚本是脚本,插件是插件,有脚本怎么变 ...

啊?插件图标?插件图标是啥
脚本是代码没错呀,插件就是代码(脚本)的集合呀
MV通过【插件管理】来加载插件进游戏呀
回复

使用道具 举报

Lv2.观梦者

梦石
0
星屑
791
在线时间
71 小时
注册时间
2023-12-26
帖子
105
8
发表于 2024-3-23 04:14:06 | 只看该作者
koumei 发表于 2024-3-22 10:20
啊?插件图标?插件图标是啥
脚本是代码没错呀,插件就是代码(脚本)的集合呀
MV通过【插件管理】来加载 ...

那脚本要怎么变插件啊?我看了好多大佬发了MV脚本,光有MV脚本,又不懂,插件还知道怎么用,就工具选择插件就可以了。MV脚本。。。要怎么变插件勒?
回复

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
143
在线时间
63 小时
注册时间
2024-3-13
帖子
47
9
发表于 2024-3-23 10:24:03 | 只看该作者
本帖最后由 koumei 于 2024-3-23 10:29 编辑
djs789783 发表于 2024-3-23 04:14
那脚本要怎么变插件啊?我看了好多大佬发了MV脚本,光有MV脚本,又不懂,插件还知道怎么用,就工具选择插 ...


怎么用插件可以看 :【MV❀RPG制作大师】MV官方自带插件合集 - 硕明云书   (  https://www.bilibili.com/video/BV1Ta4y147aj  )
什么是脚本:可以理解为组成插件的文件,可以不用管
怎么使用别人提供的插件(脚本):一般情况下,把 js 文件放到 project\js\plugins 目录下,在【插件管理】(F10)中使用即可
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

拿上你的纸笔,建造一个属于你的梦想世界,加入吧。
 注册会员
找回密码

站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作

GMT+8, 2024-4-27 19:17

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表