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

Project1

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

[有事请教] 请问有ACE没有战斗中根据状态改变人物脸图的脚本

[复制链接]

Lv1.梦旅人

梦石
0
星屑
186
在线时间
36 小时
注册时间
2024-2-20
帖子
6
跳转到指定楼层
1
发表于 2024-5-11 14:37:55 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

加入我们,或者,欢迎回来。

您需要 登录 才可以下载或查看,没有帐号?注册会员

x
类似在战斗时角色攻击或者受伤,濒死或状态受到影响的时候脸图表情有变化

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

# 戦闘表情変化
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 = [  # 重バッドステータス

Lv4.逐梦者

梦石
0
星屑
8952
在线时间
789 小时
注册时间
2016-3-12
帖子
36
2
发表于 2024-5-11 17:15:38 | 只看该作者
敌群里面可以设置,在战斗事件的条件,插太多脚步容易出错的,尽量能用事件就用事件
绝对之必胜,史上之最强!
回复 支持 1 反对 0

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
186
在线时间
36 小时
注册时间
2024-2-20
帖子
6
3
 楼主| 发表于 2024-5-12 18:39:27 | 只看该作者
神化元帅 发表于 2024-5-11 17:15
敌群里面可以设置,在战斗事件的条件,插太多脚步容易出错的,尽量能用事件就用事件 ...

在敌群里的事件页好像并不能实现角色攻击和受击瞬间的表情变化,啊啊也许有我还不知道怎么设置的地方,想问问这种瞬间变换的可以用什么操作实现呢
回复 支持 反对

使用道具 举报

Lv4.逐梦者

梦石
0
星屑
8952
在线时间
789 小时
注册时间
2016-3-12
帖子
36
4
发表于 2024-5-14 15:44:31 | 只看该作者
冰激麟 发表于 2024-5-12 18:39
在敌群里的事件页好像并不能实现角色攻击和受击瞬间的表情变化,啊啊也许有我还不知道怎么设置的地方,想 ...

感觉能用横版战斗脚本解决,思路都一样的
绝对之必胜,史上之最强!
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
186
在线时间
36 小时
注册时间
2024-2-20
帖子
6
5
 楼主| 发表于 2024-5-16 18:21:21 | 只看该作者
神化元帅 发表于 2024-5-14 15:44
感觉能用横版战斗脚本解决,思路都一样的

好好!感谢回答
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
198
在线时间
14 小时
注册时间
2022-12-22
帖子
19
6
发表于 4 天前 | 只看该作者
你应该是在找状态脸脚本...
  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
复制代码

上面有说明,可以自己翻译一下看看怎么用
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-9-20 20:51

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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