Project1

标题: 如何让人物使用特技或魔法时出现图片 [打印本页]

作者: 175746527    时间: 2014-5-24 16:35
标题: 如何让人物使用特技或魔法时出现图片
就是使用特技或魔法时,游戏上方出现就像这么一个图片:
作者: 落月小天魔    时间: 2014-5-24 16:42
没记错的话可以用技能-使用效果-最后一页-公共事件。公共事件显示该图。
作者: 喵kano    时间: 2014-5-24 17:11
先设一个假的A技能,然后使用效果里加公共事件显示立绘且强制发动真正生效的B技能。
详细要点:1.设置A技能:假的A技能是给玩家看的,确实消耗MP/TP,必定命中,无动画,但伤害公式那里留空,使用信息里最好填写一些配合立绘的台词,否则会有显示BUG。如果是对敌人使用的话,需要另外在使用效果里再加个100%生效 的空白状态,这样打到敌人时不会有反应,也不会产生伤害描述文字。
                 2.设置立绘公共事件:显示需要的立绘,等待一定的帧数,消除图片,强制战斗指令-B技能发动
                 3.设置B技能:正常产生效果的技能,但消耗MP/TP记得留空,否则就会二次产生消耗。
以下附上我之前做的某游戏的立绘特写技能加以说明好了。注意图中红线部分。
A技能设置(假技能,仅显示立绘)

--------------------------------------------------------------------------------------------------------------------
B技能设置(正常技能,但无消耗)

--------------------------------------------------------------------------------------------------------------------
公共事件设置(我这里移动了图片,自带了时间计算,如果不用这种效果的话需要利用时间调整下的【等待】来给定图片消失的时间)


作者: 子弹君    时间: 2014-5-24 17:14
使用方法:技能栏备注里填上[コモン呼出 = N] N为公共事件ID
  1. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

  2. #==============================================================================
  3. #                   ◆ コモンイベント呼出し ver2.03 ◆ VX Ace ◆
  4. #                                                     by Oz
  5. #------------------------------------------------------------------------------
  6. #  スキル発動前にコモンイベントを呼び出します。スキルの詠唱イベントとかに
  7. # 使えると思います。スキルのメモに
  8. # [コモン呼出(call commonでもok) コモンイベントID]
  9. # と記述するとスキル使用前にコモンイベントIDを実行します。
  10. # イベントのスクリプトで使用者のユニット、使用者、スキルを取得したい場合は、
  11. # 以下のメソッドをイベントのスクリプトで呼び出すことで取得できます。
  12. # user_unit_in_battle  →  使用者が味方ならtrue、敵ならfalse
  13. # user_in_battle      → スキル発動したキャラのIDです。
  14. # use_skill_in_battle  →  発動するスキルIDです。
  15. # よくわかんない人用にDBの変数に入れることもできます。使わない場合 nil に
  16. # にしてください。
  17. # 戦闘中以外に呼び出した場合、0を返します。(使用者のユニットはtrueを返します。)
  18. # 戦闘前、勝利時、敗北時、逃走時にコモンイベントを呼び出せるようにしました。
  19. # 0を指定するとコモンイベントは呼び出ししません。
  20. # Call_Common_Event.phase で戦闘開始前、勝利時、敗北時、逃走時を取得できます。
  21. #==============================================================================

  22. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

  23. $imported = {} if $imported == nil
  24. $imported["Call_Common_Event"] = true

  25. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

  26. #==============================================================================
  27. # ★ 設定項目 Call Common Event ★
  28. #==============================================================================

  29. module Call_Common_Event
  30.   #スキル発動者のユニット用変数(0:敵、1:味方)
  31.   User_Unit_Variable_ID = nil
  32.   #スキル発動者用変数
  33.   User_Variable_ID = nil
  34.   #スキル用変数
  35.   Use_Skill_Variable_ID = nil
  36.   #戦闘前
  37.   Standby_Event_ID = 0
  38.   #戦闘勝利時
  39.   Won_Event_ID = 4
  40.   #戦闘敗北時
  41.   Defeat_Event_ID = 0
  42.   #戦闘逃走時
  43.   Escaped_Event_ID = 0
  44. end

  45. #==============================================================================
  46. # ★ 設定項目 Call Common Event ★
  47. #==============================================================================

  48. module Call_Common_Event_System_Word
  49.   Call_Common_Event = /\[(?:コモン呼出|call\s*common)\s*[==]\s*(\d+)\]/i
  50. end

  51. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

  52. #==============================================================================
  53. # ■ RPG::Item
  54. #==============================================================================

  55. class RPG::UsableItem
  56.   #------------------------------------------------------------------------
  57.   # ○ キャッシュを生成
  58.   #------------------------------------------------------------------------
  59.   def create_call_common_event_cache
  60.     @call_common_event = false
  61.     @call_common_event_id = 0
  62.     self.note.each_line{|line|
  63.       case line
  64.       when Call_Common_Event_System_Word::Call_Common_Event
  65.         @call_common_event = true
  66.         @call_common_event_id = $1.to_i
  67.       end
  68.     }
  69.   end
  70.   #------------------------------------------------------------------------
  71.   # ○ コモン呼出?
  72.   #------------------------------------------------------------------------
  73.   def call_common_event?
  74.     create_call_common_event_cache if @call_common_event.nil?
  75.     return @call_common_event
  76.   end
  77.   #------------------------------------------------------------------------
  78.   # ○ コモン呼出ID
  79.   #------------------------------------------------------------------------
  80.   def call_common_event_id
  81.     create_call_common_event_cache unless @call_common_event_id
  82.     return @call_common_event_id
  83.   end
  84. end

  85. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

  86. #==============================================================================
  87. # ■ Call Common Event
  88. #==============================================================================

  89. module Call_Common_Event
  90.   #--------------------------------------------------------------------------
  91.   # ● メンバ変数の初期化
  92.   #--------------------------------------------------------------------------
  93.   def self.initialize(proc = nil)
  94.     @user_unit = true
  95.     [url=home.php?mod=space&uid=103426]@User[/url] = 0
  96.     @use_skill = 0
  97.     @call_event_proc = proc
  98.     @phase = :standby
  99.     clear_last_battler
  100.   end
  101.   #--------------------------------------------------------------------------
  102.   # ● ユニット
  103.   #--------------------------------------------------------------------------
  104.   def self.user_unit
  105.     initialize if @user_unit.nil?
  106.     return @user_unit
  107.   end
  108.   #--------------------------------------------------------------------------
  109.   # ● 発動者
  110.   #--------------------------------------------------------------------------
  111.   def self.user
  112.     initialize unless @User   
  113.     return @user
  114.   end
  115.   #--------------------------------------------------------------------------
  116.   # ● スキル
  117.   #--------------------------------------------------------------------------
  118.   def self.use_skill
  119.     initialize unless @use_skill
  120.     return @use_skill
  121.   end
  122.   #--------------------------------------------------------------------------
  123.   # ● フェイズ
  124.   #--------------------------------------------------------------------------
  125.   def self.phase
  126.     initialize unless @phase
  127.     return @phase
  128.   end
  129.   #--------------------------------------------------------------------------
  130.   # ● ユニット
  131.   #--------------------------------------------------------------------------
  132.   def self.user_unit=(user_unit)
  133.     @user_unit = user_unit
  134.     self.user_unit_variable = user_unit
  135.   end
  136.   #--------------------------------------------------------------------------
  137.   # ● 発動者
  138.   #--------------------------------------------------------------------------
  139.   def self.user=(user)
  140.     @user = user
  141.     self.user_variable = user
  142.   end
  143.   #--------------------------------------------------------------------------
  144.   # ● スキル
  145.   #--------------------------------------------------------------------------
  146.   def self.use_skill=(skill)
  147.     @use_skill = skill
  148.     self.use_skill_variable = skill
  149.   end
  150.   #--------------------------------------------------------------------------
  151.   # ● ユニット変数
  152.   #--------------------------------------------------------------------------
  153.   def self.user_unit_variable=(value)
  154.     return unless User_Unit_Variable_ID
  155.     $game_variables[User_Unit_Variable_ID] = value ? 1 : 0
  156.   end
  157.   #--------------------------------------------------------------------------
  158.   # ● 発動者変数
  159.   #--------------------------------------------------------------------------
  160.   def self.user_variable=(value)
  161.     return unless User_Variable_ID
  162.     $game_variables[User_Variable_ID] = value
  163.   end
  164.   #--------------------------------------------------------------------------
  165.   # ● 発動スキル変数
  166.   #--------------------------------------------------------------------------
  167.   def self.use_skill_variable=(value)
  168.     return unless Use_Skill_Variable_ID
  169.     $game_variables[Use_Skill_Variable_ID] = value
  170.   end
  171.   #--------------------------------------------------------------------------
  172.   # ● 戦闘開始前
  173.   #--------------------------------------------------------------------------
  174.   def self.standby?
  175.     @phase == :standby
  176.   end
  177.   #--------------------------------------------------------------------------
  178.   # ● 勝利後
  179.   #--------------------------------------------------------------------------
  180.   def self.won?
  181.     @phase == :won
  182.   end
  183.   #--------------------------------------------------------------------------
  184.   # ● 敗北後
  185.   #--------------------------------------------------------------------------
  186.   def self.defeat?
  187.     @phase == :defeat
  188.   end
  189.   #--------------------------------------------------------------------------
  190.   # ● 逃走中
  191.   #--------------------------------------------------------------------------
  192.   def self.escaped?
  193.     @phase == :escaped
  194.   end
  195.   #--------------------------------------------------------------------------
  196.   # ● 開始前
  197.   #--------------------------------------------------------------------------
  198.   def self.call_standby_event
  199.     return unless Standby_Event_ID > 0
  200.     @phase = :standby
  201.     @call_event_proc.call(Standby_Event_ID) if @call_event_proc
  202.   end
  203.   #--------------------------------------------------------------------------
  204.   # ● 勝利時
  205.   #--------------------------------------------------------------------------
  206.   def self.call_won_event
  207.     return unless Won_Event_ID > 0
  208.     @phase = :won
  209.     @call_event_proc.call(Won_Event_ID) if @call_event_proc
  210.   end
  211.   #--------------------------------------------------------------------------
  212.   # ● 敗北時
  213.   #--------------------------------------------------------------------------
  214.   def self.call_defeat_event
  215.     return unless Defeat_Event_ID > 0
  216.     @phase = :defeat
  217.     @call_event_proc.call(Defeat_Event_ID) if @call_event_proc
  218.   end
  219.   #--------------------------------------------------------------------------
  220.   # ● 逃走時
  221.   #--------------------------------------------------------------------------
  222.   def self.call_escaped_event
  223.     return unless Escaped_Event_ID > 0
  224.     @phase = :escaped
  225.     @call_event_proc.call(Escaped_Event_ID) if @call_event_proc
  226.   end
  227.   #--------------------------------------------------------------------------
  228.   # ● 最後の行動者
  229.   #--------------------------------------------------------------------------
  230.   def self.last_battler=(battler)
  231.     @last_battler = battler
  232.   end
  233.   #--------------------------------------------------------------------------
  234.   # ● アクター:ランダム
  235.   #--------------------------------------------------------------------------
  236.   def self.actor_randam
  237.     members = $game_party.alive_members
  238.     actor = members[rand * members.size]
  239.     return actor ? actor.id : 0
  240.   end
  241.   #--------------------------------------------------------------------------
  242.   # ● アクター:最後の行動者
  243.   #--------------------------------------------------------------------------
  244.   def self.last_actor
  245.     return 0 if @last_battler.nil? || @last_battler.enemy?
  246.     return @last_battler.actor.id
  247.   end
  248.   #--------------------------------------------------------------------------
  249.   # ● エネミー:最後の行動者
  250.   #--------------------------------------------------------------------------
  251.   def self.last_enemy
  252.     return 0 if @last_battler.nil? || @last_battler.actor?
  253.     return @last_battler.enemy.id
  254.   end
  255.   #--------------------------------------------------------------------------
  256.   # ● 最後の行動者:クリアー
  257.   #--------------------------------------------------------------------------
  258.   def self.clear_last_battler
  259.     @last_battler = nil
  260.   end
  261. end

  262. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

  263. #==============================================================================
  264. # ■ BattleManager
  265. #------------------------------------------------------------------------------
  266. #  戦闘の進行を管理するモジュールです。
  267. #==============================================================================

  268. class << BattleManager
  269.   #--------------------------------------------------------------------------
  270.   # ● 戦闘開始
  271.   #--------------------------------------------------------------------------
  272.   alias call_common_event_battle_start battle_start
  273.   def battle_start
  274.     call_common_event_battle_start
  275.     Call_Common_Event.call_standby_event
  276.   end
  277.   #--------------------------------------------------------------------------
  278.   # ● 勝利の処理
  279.   #--------------------------------------------------------------------------
  280.   alias call_common_event_process_victory process_victory
  281.   def process_victory
  282.     return if Call_Common_Event.won?
  283.     Call_Common_Event.call_won_event
  284.     call_common_event_process_victory   
  285.   end
  286.   #--------------------------------------------------------------------------
  287.   # ● 中断の処理
  288.   #--------------------------------------------------------------------------
  289.   alias call_common_event_process_abort process_abort
  290.   def process_abort
  291.     return if Call_Common_Event.escaped?
  292.     Call_Common_Event.call_escaped_event
  293.     call_common_event_process_abort
  294.   end
  295.   #--------------------------------------------------------------------------
  296.   # ● 敗北の処理
  297.   #--------------------------------------------------------------------------
  298.   alias call_common_event_process_defeat process_defeat
  299.   def process_defeat
  300.     return if Call_Common_Event.defeat?
  301.     Call_Common_Event.call_defeat_event
  302.     call_common_event_process_defeat
  303.   end
  304. end

  305. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

  306. #==============================================================================
  307. # ? Command
  308. #==============================================================================

  309. module Commands
  310.   module_function
  311.   #--------------------------------------------------------------------------
  312.   # ● ユーザのユニット
  313.   #--------------------------------------------------------------------------
  314.   def user_unit_in_battle
  315.     return true unless $game_party.in_battle
  316.     Call_Common_Event.user_unit
  317.   end
  318.   #--------------------------------------------------------------------------
  319.   # ● ユーザ
  320.   #--------------------------------------------------------------------------
  321.   def user_in_battle
  322.     return 0 unless $game_party.in_battle
  323.     Call_Common_Event.user
  324.   end
  325.   #--------------------------------------------------------------------------
  326.   # ● 発動スキル
  327.   #--------------------------------------------------------------------------
  328.   def use_skill_in_battle
  329.     return 0 unless $game_party.in_battle
  330.     Call_Common_Event.use_skill
  331.   end
  332. end

  333. class Game_Interpreter
  334.   include Commands
  335. end

  336. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

  337. #==============================================================================
  338. # ■ Scene_Battle
  339. #------------------------------------------------------------------------------
  340. #  バトル画面の処理を行うクラスです。
  341. #==============================================================================

  342. class Scene_Battle < Scene_Base
  343.   #--------------------------------------------------------------------------
  344.   # ● 開始処理
  345.   #--------------------------------------------------------------------------
  346.   alias call_common_event_start start
  347.   def start
  348.     Call_Common_Event.initialize(method(:call_common_event))
  349.     call_common_event_start
  350.   end
  351.   #--------------------------------------------------------------------------
  352.   # ● 戦闘行動終了時の処理
  353.   #--------------------------------------------------------------------------
  354.   alias call_common_event_process_action_end process_action_end
  355.   def process_action_end
  356.     unless call_common_event_process_action_end
  357.       Call_Common_Event.clear_last_battler
  358.       return false
  359.     else
  360.       return true
  361.     end
  362.   end
  363.   #--------------------------------------------------------------------------
  364.   # ● スキル/アイテムの使用
  365.   #--------------------------------------------------------------------------
  366.   alias call_common_event_use_item use_item
  367.   def use_item
  368.     item = @subject.current_action.item
  369.     Call_Common_Event.last_battler = @subject
  370.     Call_Common_Event.use_skill = item.id
  371.     Call_Common_Event.user_unit = @subject.actor?
  372.     Call_Common_Event.user = @subject.actor? ? @subject.actor.id : @subject.enemy.id
  373.     call_common_event(item.call_common_event_id) if item.call_common_event?
  374.     call_common_event_use_item
  375.   end
  376.   #--------------------------------------------------------------------------
  377.   # ● 反撃の発動
  378.   #--------------------------------------------------------------------------
  379.   alias call_common_event_invoke_counter_attack invoke_counter_attack
  380.   def invoke_counter_attack(target, item)
  381.     Call_Common_Event.last_battler = target
  382.     invoke_counter_attack(target, item)   
  383.   end
  384.   #--------------------------------------------------------------------------
  385.   # ● コモンイベントの呼び出し
  386.   #--------------------------------------------------------------------------
  387.   def call_common_event(common_event_id)
  388.     $game_temp.reserve_common_event(common_event_id)
  389.     process_event
  390.   end
  391. end

  392. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
复制代码

作者: 黑化の鼠标    时间: 2014-5-24 17:14
https://rpg.blue/thread-334400-1-1.html
自行参考,通常战斗系统的话,关键句只是【火球术A→公共事件→显示图片→强制战斗动作→火球术B】
作者: tan12345    时间: 2014-5-27 23:28
直接在技能动画里做就可以了,发动技能时,先显示特定图片,然后再显示技能动画。




欢迎光临 Project1 (https://rpg.blue/) Powered by Discuz! X3.1