| 赞 | 42 |
| VIP | |
| 好人卡 | |
| 积分 | 26 |
| 经验 | |
| 最后登录 | 2025-7-21 |
| 在线时间 | 452 小时 |
- 梦石
- 0
- 星屑
- 2590
- 在线时间
- 452 小时
- 注册时间
- 2019-6-22
- 回帖
- 68
|
发表于 2020-1-27 03:02:46
|
显示全部楼层
本帖最后由 kunikai 于 2020-1-27 03:04 编辑
从另一个问题过来,复制自己的部分回答好了。
首先,我们要知道什么是“计算公式”。
1. 提供三个简单范例。设原计算公式为(a.atk-b.def)。
(1) (a.atk-b.def)*(2-(10*a.hp*10/a.mhp/100)) 使用者的血量每减少1%,攻击就多造成1%的伤害。
(2) (a.atk+((a.mhp-a.hp)*0.2)-b.def) 使用者的血量每少于其血量上限5点,攻击就多造成1点的伤害。
(3) (a.atk-b.def)*(0.9+((1-(10*a.hp*10/a.mhp/100))*0.2)) 使用者的血量由100%→0%时,技能伤害由90%→110%。
2.
例:a.hp -= (a.atk-b.def)*8/10 ; (a.atk-b.def) 使用者受到的伤害等于造成伤害的80%。
3.- =begin #=======================================================================
- ◆◇ターゲット拡張 RGSS3◇◆
- ◆DEICIDE ALMA
- ◆レーネ
- ◆[url]http://blog.goo.ne.jp/exa_deicide_alma[/url]
- ◆機能/注意
- スキルやアイテムにデータベースで設定できない効果範囲を設定できるようにします。
- また、ランダム攻撃時の攻撃の重複回数の限界を設定することができます。
- ※効果範囲がランダムや全体の場合は
- データベースの効果範囲はタゲ選択不可のランダムか全体にしてください。
- ★スキルかアイテムのメモ欄に以下のワードを書いて使用します。
- --------------------------------------------------------------------------------
- ◆重複回数の設定
- <重複限界:n> ⇒ ランダム攻撃時の同じユニットへの重複回数の限界
- ※制限超過分は拡散せずに消滅。
- 敵3体にランダム8回攻撃を行った際に4、1、3回当たるとして
- <重複限界:2>の表記があった場合は2、1、2回になります。
-
- ◆重複アニメの設定
- <重複アニメ無効> ⇒ 同じターゲットにアニメを1度しか再生しないようにする
- ※VXAでは、ランダムn体のときに同じタゲに何度もアニメを再生します。
- (中心のアニメのみ?)
- --------------------------------------------------------------------------------
- ◆ターゲット拡張用ワード(2つ以上書かないこと)
- <敵単体連続:n> ⇒ 敵単体にn回効果
- <敵全体連続:n> ⇒ 敵全体にn回効果
- <敵ランダム:n> ⇒ 敵にn回効果(タゲは1回ごとにバラバラ、重複あり)
- <敵ランダム連続:n> ⇒ ランダムな敵1体に対してn回効果(タゲ選択不可の敵単体連続)
- <味方単体連続:n> ⇒ 味方単体にn回効果
- <味方全体連続:n> ⇒ 味方全体にn回効果
- <味方ランダム:n> ⇒ 味方にn回効果(タゲは1回ごとにバラバラ、重複あり)
- <味方ランダム連続:n> ⇒ タゲ選択不可の味方単体連続
- <敵味方全体> ⇒ 敵味方全体に効果
- <敵味方ランダム:n> ⇒ 敵味方にn回効果(タゲは1回ごとにバラバラ、重複あり)
- --------------------------------------------------------------------------------
- ◆上記ワードと併用前提のワード(単独使用不可)
- <追加ランダム:n> ⇒ 効果を0~n回追加
- <使用者除外:n> ※n は 0 か 1
- 0 ⇒ 最後に使用者を除外する
- (ランダム範囲の場合、使用者が選ばれた回数分、攻撃回数が減ります)
- 1 ⇒ 始めから使用者を除外しておく
- (ランダム範囲専用、使用者が選ばれることがないので回数分攻撃)
- ※ランダム範囲でない場合は 0 にしてください。
- --------------------------------------------------------------------------------
- ■例1:自分以外の味方全体
- メモ欄記述は
- <味方全体連続:1>
- <使用者除外:0>
- ■例2:自分以外の敵味方ランダムで5~8回攻撃
- メモ欄記述は
- <敵味方ランダム:5>
- <追加ランダム:3>
- <使用者除外:1> ※0 だと使用者が選ばれた回数分、攻撃回数が減ってしまいます。
- --------------------------------------------------------------------------------
- ※ターゲットが誰もいなくなる場合は、自動的に使用者に効果になります。
- この場合、効果範囲の設定がおかしいので設定を見直してください。
- (味方ランダム&使用者除外など)
- ◆導入箇所
- ▼素材のところ、mainより上
- =end #=========================================================================
- module RENNE ; module Target_Exp
- # 重複限界
- OVERLAP = /<重複限界[::](\d+)>/
-
- # 重複アニメ無効
- NON_OL_ANIMA = "<重複アニメ無効>"
-
- # 敵のターゲット拡張
- Reg1 = /<敵単体連続:(\d+)>/
- Reg2 = /<敵全体連続:(\d+)>/
- Reg3 = /<敵ランダム:(\d+)>/
-
- # 味方のターゲット拡張
- Reg4 = /<味方単体連続:(\d+)>/
- Reg5 = /<味方全体連続:(\d+)>/
- Reg6 = /<味方ランダム:(\d+)>/
-
- # 敵味方など特殊なターゲット
- Reg7 = /<敵ランダム連続:(\d+)>/
- Reg8 = /<味方ランダム連続:(\d+)>/
- Reg9 = /<敵味方全体>/
- Reg10 = /<敵味方ランダム:(\d+)>/
-
- # 上記ワードとの併用ワード(単独使用不可)
- Add1 = /<追加ランダム:(\d+)>/
- Add2 = /<使用者除外:(\d+)>/
-
- end ; end
- $renne_rgss3 = {} if $renne_rgss3.nil?
- $renne_rgss3[:target_exp] = true
- class RPG::UsableItem < RPG::BaseItem
- #--------------------------------------------------------------------------
- # ● インクルード
- #--------------------------------------------------------------------------
- include RENNE::Target_Exp
- #--------------------------------------------------------------------------
- # ● 拡張ターゲットの取得
- #--------------------------------------------------------------------------
- def exp_target?
- if @exp_target.nil?
- @exp_target = []
- @exp_target[2] = -1
- note.each_line{|line|
- case line
- when Reg1 ; @exp_target[0] = [1,$1.to_i]
- when Reg2 ; @exp_target[0] = [2,$1.to_i]
- when Reg3 ; @exp_target[0] = [3,$1.to_i]
- when Reg4 ; @exp_target[0] = [4,$1.to_i]
- when Reg5 ; @exp_target[0] = [5,$1.to_i]
- when Reg6 ; @exp_target[0] = [6,$1.to_i]
- when Reg7 ; @exp_target[0] = [7,$1.to_i]
- when Reg8 ; @exp_target[0] = [8,$1.to_i]
- when Reg9 ; @exp_target[0] = [9, true]
- when Reg10; @exp_target[0] = [10,$1.to_i]
- when Add1 ; @exp_target[1] = $1.to_i + 1
- when Add2 ; @exp_target[2] = $1.to_i
- end
- }
- if @exp_target[0].nil?
- @exp_target = false
- end
- end
- return @exp_target
- end
- alias exp_target exp_target?
- #--------------------------------------------------------------------------
- # ● 重複限界スキルの設定を取得
- #--------------------------------------------------------------------------
- def overlap_limit
- if @overlap_limit.nil?
- @overlap_limit = note[OVERLAP,1].to_i
- end
- return @overlap_limit
- end
- #--------------------------------------------------------------------------
- # ● 重複アニメの無効化フラグの取得
- #--------------------------------------------------------------------------
- def non_overlap_anima?
- if @non_overlap_anima.nil?
- @non_overlap_anima = note.include?(NON_OL_ANIMA)
- end
- return @non_overlap_anima
- end
- end
- class Game_Unit
- #--------------------------------------------------------------------------
- # ● 拡張ランダムターゲットの取得
- #--------------------------------------------------------------------------
- def exp_ram_target(subject)
- tgr_rand = rand * (tgr_sum - subject.tgr)
- arr = alive_members - [subject]
- arr.each do |member|
- tgr_rand -= member.tgr
- return member if tgr_rand < 0
- end
- return arr[0]
- end
- end
- class Game_Action
- #--------------------------------------------------------------------------
- # ● 制限ターゲットの作成
- #--------------------------------------------------------------------------
- def limit_targets(arr, max)
- result = []
- temp = {}
- arr.each{|obj|
- temp[obj] = temp[obj].to_i + 1
- result << obj unless temp[obj] > max
- }
- return result
- end
- #--------------------------------------------------------------------------
- # ● 拡張ターゲットの作成
- #--------------------------------------------------------------------------
- def make_exp_targets
- arr = []
- exp = item.exp_target
- exp_id = exp[0][0]
- num = exp[0][1]
- ram = exp[1] ? rand(exp[1]) : 0
- ex_remove = friends_unit.members.size == 1
- case exp_id
- when 1
- arr << opponents_unit.smooth_target(@target_index)
- arr *= (num + ram)
- when 2
- arr = opponents_unit.alive_members
- arr *= (num + ram)
- when 3
- (num + ram).times do arr << opponents_unit.random_target end
- when 4
- arr << friends_unit.smooth_target(@target_index)
- arr *= (num + ram)
- when 5
- arr = friends_unit.alive_members
- arr *= (num + ram)
- when 6
- if exp[2] == 1
- (num + ram).times do arr << friends_unit.exp_ram_target(subject) end
- else
- (num + ram).times do arr << friends_unit.random_target end
- end
- when 7
- arr << opponents_unit.random_target
- arr *= (num + ram)
- when 8
- arr << friends_unit.random_target
- arr *= (num + ram)
- when 9
- arr = opponents_unit.alive_members + friends_unit.alive_members
- arr *= (1 + ram)
- when 10
- if ex_remove
- (num + ram).times do arr << opponents_unit.random_target end
- else
- (num + ram).times do
- if rand(2).zero?
- arr << opponents_unit.random_target
- else
- if exp[2] == 1
- arr << friends_unit.exp_ram_target(subject)
- else
- arr << friends_unit.random_target
- end
- end
- end
- end
- end
- arr.delete(subject) if exp[2].zero?
- arr.compact!
- arr = [subject] if arr.empty?
- return arr
- end
- #--------------------------------------------------------------------------
- # ● ターゲットの配列作成(エイリアス)
- #--------------------------------------------------------------------------
- alias target_exp_make_targets make_targets
- def make_targets
- if !(!forcing && subject.confusion?) && item.exp_target?
- targets = make_exp_targets
- else
- targets = target_exp_make_targets
- end
- if item.overlap_limit > 0
- targets = limit_targets(targets, item.overlap_limit)
- end
- return targets
- end
- end
- class Scene_Battle < Scene_Base
- #--------------------------------------------------------------------------
- # ● アニメーションの表示(エイリアス)
- #--------------------------------------------------------------------------
- alias target_exp_show_animation show_animation
- def show_animation(targets, animation_id)
- item = @subject.current_action.item
- if item.non_overlap_anima?
- targets = targets.uniq
- end
- target_exp_show_animation(targets, animation_id)
- end
- end
复制代码
将该脚本插入到默认脚本以下、Main以上,技能备注<敵味方全体>。
4. 计算公式中这样写:
例:a.add_state(6);(a.atk-b.def) 造成伤害的同时,为自己附加6号状态。
|
评分
-
查看全部评分
|