Project1

标题: 请问有ACE没有战斗中根据状态改变人物脸图的脚本 [打印本页]

作者: 冰激麟    时间: 2024-5-11 14:37
标题: 请问有ACE没有战斗中根据状态改变人物脸图的脚本
类似在战斗时角色攻击或者受伤,濒死或状态受到影响的时候脸图表情有变化

在搜索里搜了搜,意思相近的只有以下一小段,想问问有没有这段完整代码或者类似的,非常感谢!

# 戦闘表情変化
module BattleManager
  DEFAULT_FACE_INDEX  = 0  # 通常
  DAMAGE_FACE_INDEX   = 1  # 被ダメージ
  RECOVERY_FACE_INDEX = 2  # 回復
  VICTORY_FACE_INDEX  = 3  # 勝利
  PAINFUL_FACE_INDEX  = 4  # 瀕死or重バッドステータス
  SLEEP_FACE_INDEX    = 5  # 睡眠

  SLEEP_STATE_ID = 9       # 睡眠
  HEAVY_BAD_STATUS_ID = [  # 重バッドステータス
作者: 神化元帅    时间: 2024-5-11 17:15
敌群里面可以设置,在战斗事件的条件,插太多脚步容易出错的,尽量能用事件就用事件
作者: 冰激麟    时间: 2024-5-12 18:39
神化元帅 发表于 2024-5-11 17:15
敌群里面可以设置,在战斗事件的条件,插太多脚步容易出错的,尽量能用事件就用事件 ...

在敌群里的事件页好像并不能实现角色攻击和受击瞬间的表情变化,啊啊也许有我还不知道怎么设置的地方,想问问这种瞬间变换的可以用什么操作实现呢
作者: 神化元帅    时间: 2024-5-14 15:44
冰激麟 发表于 2024-5-12 18:39
在敌群里的事件页好像并不能实现角色攻击和受击瞬间的表情变化,啊啊也许有我还不知道怎么设置的地方,想 ...

感觉能用横版战斗脚本解决,思路都一样的
作者: 冰激麟    时间: 2024-5-16 18:21
神化元帅 发表于 2024-5-14 15:44
感觉能用横版战斗脚本解决,思路都一样的

好好!感谢回答
作者: 晨风1    时间: 2024-9-16 10:26
你应该是在找状态脸脚本...
  1. =begin
  2. #===============================================================================
  3. Title: State Faces
  4. Author: Hime
  5. Date: Sep 6, 2015
  6. --------------------------------------------------------------------------------
  7. ** Change log
  8. Sep 6, 2015
  9.    - supports class note-tag
  10. Mar 30, 2013
  11.    - Initial release
  12. --------------------------------------------------------------------------------   
  13. ** Terms of Use
  14. * Free to use in non-commercial projects
  15. * Contact me for commercial use
  16. * No real support. The script is provided as-is
  17. * Will do bug fixes, but no compatibility patches
  18. * Features may be requested but no guarantees, especially if it is non-trivial
  19. * Credits to Hime Works in your project
  20. * Preserve this header
  21. --------------------------------------------------------------------------------
  22. ** Description

  23. This script allows you to setup "state faces" for each actor.

  24. A state face is just a face picture that will be used when a certain state has
  25. been applied.

  26. When the state is removed, the face picture also reverts to the original (or
  27. maybe another state face, depending on how many states are applied).

  28. --------------------------------------------------------------------------------
  29. ** Installation

  30. Place this below Materials and above Main.

  31. --------------------------------------------------------------------------------
  32. ** Usage

  33. Note-tag your actors or classes with

  34.    <state face: id name index>
  35.    
  36. Where
  37.    `id` is the state ID that this face will apply to
  38.    `name` is the name of the face, in the Graphics/Faces folder
  39.    `index` is the index of the face.
  40.    
  41. You will need to index the face sheet appropriately.

  42. 0 1 2 3
  43. 4 5 6 7

  44. If you are using one face per sheet, it is just 0.

  45. Note that state priority determines which face will be shown if multiple
  46. states are applied. States with higher priorities will be shown over states
  47. with lower priorities. In the case of a tie, the state that was first applied
  48. will be used.
  49. #===============================================================================
  50. =end
  51. $imported = {} if $imported.nil?
  52. $imported["TH_StateFaces"] = true
  53. #===============================================================================
  54. # ** Configuration
  55. #===============================================================================
  56. module TH
  57.   module State_Faces
  58.    
  59.     # state ID, face name, face index
  60.     Regex = /<state face:\s*(\d+)\s*(\w+)\s*(\d+)>/i
  61.   end
  62. end

  63. module RPG
  64.   class BaseItem
  65.    
  66.     def state_faces
  67.       return @state_faces unless @state_faces.nil?
  68.       load_notetag_state_faces
  69.       return @state_faces
  70.     end
  71.    
  72.     def state_face_list
  73.       return @state_face_list unless @state_face_list.nil?
  74.       load_notetag_state_faces
  75.       return @state_face_list
  76.     end
  77.    
  78.     def load_notetag_state_faces
  79.       @state_faces = {}
  80.       res = self.note.scan(TH::State_Faces::Regex)      
  81.       unless res.empty?
  82.         res.each do |(state_id, face_name, face_index)|
  83.           @state_faces[state_id.to_i] = [face_name, face_index.to_i]
  84.         end
  85.       end
  86.       @state_face_list = @state_faces.keys
  87.     end
  88.   end
  89. end

  90. class Game_Actor < Game_Battler
  91.   
  92.   alias :th_state_faces_face_name :face_name
  93.   def face_name
  94.     @state_actor_face = nil
  95.     @state_class_face = nil
  96.     name = states.detect {|state| actor.state_face_list.include?(state.id)}
  97.     if name
  98.       @state_actor_face = name
  99.       return actor.state_faces[@state_actor_face.id][0]
  100.     else
  101.       name = states.detect {|state| self.class.state_face_list.include?(state.id)}            
  102.       if name
  103.         @state_class_face = name
  104.         return self.class.state_faces[@state_class_face.id][0]
  105.       else        
  106.         return th_state_faces_face_name
  107.       end
  108.     end
  109.   end
  110.   
  111.   alias :th_state_faces_face_index :face_index
  112.   def face_index
  113.     if @state_actor_face
  114.       return actor.state_faces[@state_actor_face.id][1]
  115.     elsif @state_class_face
  116.       return self.class.state_faces[@state_class_face.id][1]
  117.     else
  118.       return th_state_faces_face_index
  119.     end
  120.   end
  121. end
复制代码

上面有说明,可以自己翻译一下看看怎么用




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