赞 | 287 |
VIP | 11 |
好人卡 | 74 |
积分 | 226 |
经验 | 281171 |
最后登录 | 2024-11-14 |
在线时间 | 9413 小时 |
Lv5.捕梦者 (暗夜天使) 只有笨蛋才会看到
- 梦石
- 1
- 星屑
- 21621
- 在线时间
- 9413 小时
- 注册时间
- 2012-6-19
- 帖子
- 7118
|
先加入这段脚本- =begin
- #===============================================================================
- Title: Convert Code: Eval
- Author: Tsukihime
- Date: Nov 25, 2013
- URL: http://himeworks.wordpress.com/2013/09/17/battle-reactions/
- --------------------------------------------------------------------------------
- ** Change log
- Nov 25, 2013
- - Initial release
- --------------------------------------------------------------------------------
- ** Terms of Use
- * Free to use in non-commercial projects
- * Contact me for commercial use
- * No real support. The script is provided as-is
- * Will do bug fixes, but no compatibility patches
- * Features may be requested but no guarantees, especially if it is non-trivial
- * Credits to Tsukihime in your project
- * Preserve this header
- --------------------------------------------------------------------------------
- ** Description
-
- This script adds a new convert code to your project called "eval".
-
- You can use this to evaluate arbitrary formulas inside your show text
- commands.
-
- --------------------------------------------------------------------------------
- ** Installation
-
- In the script editor, place this script below Materials and above Main
- --------------------------------------------------------------------------------
- ** Usage
- In your show text command, use the convert code
-
- \eval[FORMULA}
- The formula will be evaluated when the message is being processed and the
- appropriate value will be displayed.
-
- The following formula variables are available
-
- p - game party
- t - game troop
- s - game switches
- v - game variables
-
- Note that the text is not automatically re-positioned to fill in the gaps.
-
- #===============================================================================
- =end
- $imported = {} if $imported.nil?
- $imported["TH_ConvertCodeEval"] = true
- #===============================================================================
- # ** Rest of Script
- #===============================================================================
- class Window_Base < Window
-
- alias :th_convert_code_eval_convert_escape_characters :convert_escape_characters
- def convert_escape_characters(text)
- result = th_convert_code_eval_convert_escape_characters(text)
- result.gsub!(/\eEVAL\[(.*)\]/i) { eval_convert_code($1) }
- result
- end
-
- def eval_convert_code(formula, p=$game_party, t=$game_troop, s=$game_switches, v=$game_variables)
- eval(formula)
- end
- end
复制代码 然后技能说明这么写即可:
造成\eval[(p.leader.atk * 0.5 +2).to_i]點物理傷害
|
|