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

Project1

 找回密码
 注册会员
搜索
查看: 3084|回复: 16

[原创发布] 【VA】可堆叠状态系统

[复制链接]

Lv3.寻梦者

梦石
0
星屑
1803
在线时间
133 小时
注册时间
2013-10-6
帖子
193
发表于 2022-5-19 03:47:39 | 显示全部楼层 |阅读模式

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

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

x
本帖最后由 不死鸟之翼 于 2022-5-19 03:57 编辑

# 简介

该系统可以让状态变得可堆叠,也就是说重复获得状态时会累计层数。同时,该系统支持将状态作为战斗资源使用,可以让技能以消费状态层数的方式打出。
ss1.jpg
ss2.jpg

# 使用方式

将脚本粘贴到数据库的单独一页内。

# 如何配置状态
给希望可堆叠的状态的备注栏加入一行:
[stackable]
这样重复获得状态时,不仅会刷新持续时间,还会增加计数。
如果希望限制最大层数,可以增加max属性:
[stackable max=3]

# 如何配置技能的发动条件
给希望消费状态的技能的备注栏加入一行:
[consume_state state=状态在数据库内的编号]
默认会消费全部层数的状态。如果想指定消费数量,可以使用count属性,例如:
[consume_state state=26 count=1]
这会消费一层26号状态。
特别地,如果count为0,表示只有在该状态下才能使出技能,但不会消费状态。

# 如何在脚本中读取状态的层数
使用Game_Battler的state_stack_count(skill_id)方法。

# 如何根据技能消费的状态层数决定威力
虽然理论上可以使用state_stack_count,但是由于VA的默认脚本会先支付技能消耗后使出技能,所以在计算伤害时状态层数已经变化了。
Game_Battler实例的last_state_cost属性表示上一次消耗的状态层数。
例如,伤害公式可以写成
1000 * a.last_state_cost
表示造成1000*攻击者发动技能前身上状态层数的伤害。

# 课后作业
1. 如何实现最多可蓄力3次的攻击?
2. 如何实现宝可梦系列的集气拳类技能(一回合蓄力后下一回合发动,但期间若受到攻击则蓄力会被打消而失败)?
3. 如何实现可以叠加威力的中毒debuff?
4. 如何实现技能连击系统(按照特定顺序使出特定技能的话会获得额外收益)?
5. 如何实现状态叠加到5层时即死?

# 使用许可
MIT

# 源代码
RUBY 代码复制
  1. # Stackable States by AzureFx
  2. # Revision 20220519.1
  3. # Licensed under the MIT License
  4.  
  5. def parse_note(note)
  6.   result=[]
  7.   note.each_line{|line|
  8.     m=/\[\s*([^\s=]+)\s*([^\]]+)?\s*\]/i.match(line)
  9.     if m!=nil
  10.       elem=m[1]
  11.       attr={}
  12.       attr_s=m[2]
  13.       if attr_s!=nil
  14.         attr_s.to_enum(:scan, /([^=\s]+)\s*=\s*([^=\s]+)/)
  15.           .map{Regexp.last_match}
  16.           .each{|m|attr[m[1]]=m[2]}
  17.       end
  18.       result.push([elem,attr])
  19.     end
  20.   }
  21.   result
  22. end
  23.  
  24.  
  25. class RPG::State
  26.   def stackable?
  27.     if @stackable==nil
  28.       parse_note_stackable
  29.     end
  30.     return @stackable
  31.   end
  32.  
  33.   def max_stack
  34.     if @max_stack==nil
  35.       parse_note_stackable
  36.     end
  37.     return @max_stack
  38.   end
  39.  
  40.   def parse_note_stackable
  41.     stackable=false
  42.     max_stack=0
  43.     parse_note(note).each{|entry|
  44.     elem, attr=entry
  45.       if elem=='stackable'
  46.         stackable=true
  47.         if attr['max']!=nil
  48.           max_stack=attr['max'].to_i
  49.         end
  50.       end
  51.     }
  52.     @stackable=stackable
  53.     @max_stack=max_stack
  54.   end
  55.  
  56. end
  57.  
  58. class RPG::Skill
  59.   def consume_stack
  60.     if @consume_stack_parsed==nil
  61.       parse_consume_stack
  62.       @consume_stack_parsed=true
  63.     end
  64.     @consume_stack
  65.   end
  66.  
  67.   def parse_consume_stack
  68.     parse_note(note).each{|entry|
  69.       elem, attr=entry
  70.       if elem=='consume_state'
  71.         if attr['state']!=nil
  72.           state_id=attr['state'].to_i
  73.           @consume_stack={state: state_id}
  74.           if attr['count']!=nil
  75.             @consume_stack[:count]=attr['count'].to_i
  76.           end
  77.         end
  78.       end
  79.     }
  80.   end
  81. end
  82.  
  83. class Game_BattlerBase
  84.   alias clear_states_b1f2b6 clear_states
  85.   def clear_states
  86.     clear_states_b1f2b6
  87.     @state_stacks={}
  88.   end
  89.  
  90.   alias erase_state_b1f2b6 erase_state
  91.   def erase_state(state_id)
  92.     erase_state_b1f2b6(state_id)
  93.     @state_stacks.delete(state_id)
  94.   end
  95.  
  96.   def state_stack_count(state_id)
  97.     @state_stacks[state_id]||0
  98.   end
  99.  
  100.   def decrease_state_stack(state_id, count)
  101.     new_count=state_stack_count(state_id)-count
  102.     if new_count<=0
  103.       erase_state(state_id)
  104.     else
  105.       @state_stacks[state_id]=new_count
  106.     end
  107.   end
  108.  
  109.   alias skill_cost_payable_b1f2b6? skill_cost_payable?
  110.   def skill_cost_payable?(skill)
  111.     cs=skill.consume_stack
  112.     if cs!=nil
  113.       count=state_stack_count(cs[:state])
  114.       cost=cs[:count]||-1
  115.       return false unless count>0&&count>=cost
  116.     end
  117.     skill_cost_payable_b1f2b6?(skill)
  118.   end
  119.  
  120.   alias pay_skill_cost_b1f2b6 pay_skill_cost
  121.   def pay_skill_cost(skill)
  122.     pay_skill_cost_b1f2b6(skill)
  123.     cs=skill.consume_stack
  124.     if cs!=nil
  125.       cost=cs[:count]||-1
  126.       if cost<0
  127.         cost=state_stack_count(cs[:state])
  128.       end
  129.       @@last_state_cost=cost
  130.       decrease_state_stack(cs[:state], cost)
  131.     end
  132.   end
  133.  
  134.   def last_state_cost
  135.     @@last_state_cost
  136.   end
  137. end
  138.  
  139. class Game_Battler
  140.   alias reset_state_counts_b1f2b6 reset_state_counts
  141.   def reset_state_counts(state_id)
  142.     reset_state_counts_b1f2b6(state_id)
  143.     state = $data_states[state_id]
  144.     if state.stackable?
  145.       if @state_stacks[state_id]==nil
  146.         @state_stacks[state_id]=0
  147.       end
  148.       if state.max_stack<=0||@state_stacks[state_id]<state.max_stack
  149.         @state_stacks[state_id]+=1
  150.       end
  151.     end
  152.   end
  153.  
  154.   alias on_action_end_b1f2b6 on_action_end
  155.   def on_action_end
  156.     on_action_end_b1f2b6
  157.     @@last_state_cost=nil
  158.   end
  159. end
  160.  
  161. STACK_COUNT_FONT_SIZE=14
  162. STACK_COUNT_FONT=Font.new
  163. STACK_COUNT_FONT.size=STACK_COUNT_FONT_SIZE
  164. STACK_COUNT_FONT.color=Color.new(0,255,0)
  165. STACK_COUNT_FONT.bold=true
  166. STACK_COUNT_FONT.outline=false
  167. STACK_COUNT_FONT.shadow=true
  168.  
  169. class Window_Base
  170.   alias draw_actor_icons_b1f2b6 draw_actor_icons
  171.   def draw_actor_icons(actor, x, y, width = 96)
  172.     draw_actor_icons_b1f2b6(actor, x, y, width)
  173.     last_font=contents.font
  174.     last_size=last_font.size
  175.     last_bold=last_font.bold
  176.     contents.font=STACK_COUNT_FONT
  177.     actor.states.select{|s|s.icon_index!=0}.each_with_index {|s, i|
  178.       if s.stackable?
  179.         count=actor.state_stack_count(s.id)
  180.         contents.draw_text(x, y+1, 22, STACK_COUNT_FONT_SIZE, count, 2)
  181.       end
  182.     }
  183.     contents.font=last_font
  184.     contents.font.size=last_size
  185.     contents.font.bold=last_bold
  186.   end
  187. end


# 版本历史
Revision 20220519.1 初次在P1发布
←你看到一只经常潜水的萌新。

Lv2.观梦者

梦石
0
星屑
529
在线时间
58 小时
注册时间
2021-3-3
帖子
18
发表于 2022-5-21 14:31:28 | 显示全部楼层
4{8HOR)NQ4M[3DPWIO_02OE.png 2U$X)@KEI}3J_@9L2]09LKQ.png
您好 我想设置一个需要充能才能释放的技能
可是在游戏中 该技能不需要充能状态也不消耗充能次数也能释放
是我使用有误吗
回复 支持 反对

使用道具 举报

Lv5.捕梦者

梦石
0
星屑
24057
在线时间
4983 小时
注册时间
2016-3-8
帖子
1613
发表于 2022-5-21 17:36:34 | 显示全部楼层
hq1107 发表于 2022-5-21 14:31
您好 我想设置一个需要充能才能释放的技能
可是在游戏中 该技能不需要充能状态也不消耗充能次数也能释放
...

用这个不香么?
RUBY 代码复制
  1. #==============================================================================
  2. #
  3. # ¥ Yami Engine Ace - Charge Skill
  4. # -- Last Updated: 2012.05.13
  5. # -- Level: Easy
  6. # -- Requires: none
  7. #
  8. #==============================================================================
  9.  
  10. $imported = {} if $imported.nil?
  11. $imported["YSE-ChargeSkill"] = true
  12.  
  13. #==============================================================================
  14. # ¥ Updates
  15. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  16. # 2012.05.13 - Fixed Enemy Charging.
  17. # 2012.03.30 - Fixed Skill Targets.
  18. # 2012.03.29 - Fixed Auto Battle bug.
  19. # 2012.03.27 - Fixed Cancel Charge bug.
  20. # 2012.03.26 - Fixed Battle End bug.
  21. # 2012.03.18 - Started and Finished Script.
  22. #
  23. #==============================================================================
  24. # ¥ Introduction
  25. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  26. # This script provides charging skill feature. Charging Skill means that skill
  27. # will be used after some turn it was choosen.
  28. #
  29. #==============================================================================
  30. # ¥ Instructions
  31. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  32. # To install this script, open up your script editor and copy/paste this script
  33. # to an open slot below ¥ Materials/‘fÞ but above ¥ Main. Remember to save.
  34. #
  35. # -----------------------------------------------------------------------------
  36. # Skill/Item Notetags - These notetags go in the skill/item notebox in the database.
  37. # -----------------------------------------------------------------------------
  38. # <charge turn: x>
  39. # Make skill be a charge skill with x charging turns.
  40. # -----------------------------------------------------------------------------
  41. # <start charge message>
  42. # example
  43. # </start charge message>
  44. #
  45. # Set the Charging Start Message to example.
  46. # -----------------------------------------------------------------------------
  47. # <continue charge message>
  48. # example
  49. # </continue charge message>
  50. #
  51. # Set the Charging Continue Message to example.
  52. #
  53. #==============================================================================
  54. # ¥ Compatibility
  55. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  56. # This script is made strictly for RPG Maker VX Ace. It is highly unlikely that
  57. # it will run with RPG Maker VX without adjusting.
  58. #
  59. #==============================================================================
  60.  
  61. module YSE
  62.   module CHARGE_SKILL
  63.  
  64.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  65.     # - Visual Settings -
  66.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  67.     VISUAL_SETTING = { # Start.
  68.       # Message shows when choose a charge skill.
  69.       # Set this to nil to disable.
  70.       :default_msg_start      =>  "%s is charging %s!",
  71.       # Message shows when end a charging turn.
  72.       # Set this to nil to disable.
  73.       :default_msg_continue   =>  "%s continue charging %s...",
  74.     } # End.
  75.  
  76.   end # CHARGE_SKILL
  77. end # YSE
  78.  
  79. #==============================================================================
  80. # ¥ Editting anything past this point may potentially result in causing
  81. # computer damage, incontinence, explosion of user's head, coma, death, and/or
  82. # halitosis so edit at your own risk.
  83. #==============================================================================
  84.  
  85. #==============================================================================
  86. # ¡ Regular Expression
  87. #==============================================================================
  88.  
  89. module YSE
  90.   module REGEXP
  91.   module USABLEITEM
  92.  
  93.     CHARGE_TURN = /<(?:CHARGE_TURN|charge turn):[ ](\d+)?>/i
  94.     START_MSG_BEGIN = /<(?:START_CHARGE_MESSAGE|start charge message)>/i
  95.     START_MSG_END = /<\/(?:START_CHARGE_MESSAGE|start charge message)>/i
  96.     CONT_MSG_BEGIN = /<(?:CONTINUE_CHARGE_MESSAGE|continue charge message)>/i
  97.     CONT_MSG_END = /<\/(?:CONTINUE_CHARGE_MESSAGE|continue charge message)>/i
  98.  
  99.   end # STATE
  100.   end # REGEXP
  101. end # YSE
  102.  
  103. #==============================================================================
  104. # ¡ DataManager
  105. #==============================================================================
  106.  
  107. module DataManager
  108.  
  109.   #--------------------------------------------------------------------------
  110.   # alias method: load_database
  111.   #--------------------------------------------------------------------------
  112.   class <<self; alias load_database_ysecs load_database; end
  113.   def self.load_database
  114.     load_database_ysecs
  115.     load_notetags_ysecs
  116.   end
  117.  
  118.   #--------------------------------------------------------------------------
  119.   # new method: load_notetags_ysecs
  120.   #--------------------------------------------------------------------------
  121.   def self.load_notetags_ysecs
  122.     groups = [$data_skills, $data_items]
  123.     for group in groups
  124.       for obj in group
  125.         next if obj.nil?
  126.         obj.load_notetags_ysecs
  127.       end
  128.     end
  129.   end
  130.  
  131. end # DataManager
  132.  
  133. #==============================================================================
  134. # ¡ RPG::UsableItem
  135. #==============================================================================
  136.  
  137. class RPG::UsableItem < RPG::BaseItem
  138.  
  139.   #--------------------------------------------------------------------------
  140.   # public instance variables
  141.   #--------------------------------------------------------------------------
  142.   attr_accessor :charge_turn
  143.   attr_accessor :start_msg
  144.   attr_accessor :continue_msg
  145.  
  146.   #--------------------------------------------------------------------------
  147.   # common cache: load_notetags_ysecs
  148.   #--------------------------------------------------------------------------
  149.   def load_notetags_ysecs
  150.     @start_begin = false
  151.     @continue_begin = false
  152.     @charge_turn = 0
  153.     #---
  154.     self.note.split(/[\r\n]+/).each { |line|
  155.       case line
  156.       #---
  157.       when YSE::REGEXP::USABLEITEM::CHARGE_TURN
  158.         @charge_turn = $1.to_i
  159.       when YSE::REGEXP::USABLEITEM::START_MSG_BEGIN
  160.         @start_begin = true
  161.       when YSE::REGEXP::USABLEITEM::START_MSG_END
  162.         @start_begin = false
  163.       when YSE::REGEXP::USABLEITEM::CONT_MSG_BEGIN
  164.         @continue_begin = true
  165.       when YSE::REGEXP::USABLEITEM::CONT_MSG_END
  166.         @continue_begin = false
  167.       else
  168.         @start_msg = line.to_s if @start_msg.nil? && @start_begin
  169.         @start_msg += line.to_s if @start_begin
  170.         @continue_msg = line.to_s if @continue_msg.nil? && @continue_begin
  171.         @continue_msg += line.to_s if @continue_begin
  172.       end
  173.     } # self.note.split
  174.     #---
  175.     @charge_turn = nil if @charge_turn <= 0
  176.     @start_msg = YSE::CHARGE_SKILL::VISUAL_SETTING[:default_msg_start]
  177.     @continue_msg = YSE::CHARGE_SKILL::VISUAL_SETTING[:default_msg_continue]
  178.     @start_msg = nil if @start_msg == ""
  179.     @continue_msg = nil if @continue_msg == ""
  180.   end
  181.  
  182. end # RPG::UsableItem
  183.  
  184. #==============================================================================
  185. # ¡ Game_Battler
  186. #==============================================================================
  187.  
  188. class Game_Battler < Game_BattlerBase
  189.  
  190.   #--------------------------------------------------------------------------
  191.   # public instance variables
  192.   #--------------------------------------------------------------------------
  193.   attr_accessor :charged
  194.   attr_accessor :first_charge
  195.  
  196.   #--------------------------------------------------------------------------
  197.   # alias method: auto_battle?
  198.   #--------------------------------------------------------------------------
  199.   alias yse_auto_battle_cs auto_battle?
  200.   def auto_battle?
  201.     charging? ? false : yse_auto_battle_cs
  202.   end
  203.  
  204.   #--------------------------------------------------------------------------
  205.   # new method: charging?
  206.   #--------------------------------------------------------------------------
  207.   def charging?
  208.     !@charging_cache.nil? || @charged
  209.   end
  210.  
  211.   #--------------------------------------------------------------------------
  212.   # new method: start_charge
  213.   #--------------------------------------------------------------------------
  214.   def start_charge
  215.     return false if charging?
  216.     return false if current_action.item.charge_turn.nil?
  217.     @charging_cache = current_action.clone
  218.     @charge_turn = current_action.item.charge_turn
  219.     return true
  220.   end
  221.  
  222.   #--------------------------------------------------------------------------
  223.   # new method: current_charging
  224.   #--------------------------------------------------------------------------
  225.   def current_charging
  226.     @charging_cache
  227.   end
  228.  
  229.   #--------------------------------------------------------------------------
  230.   # new method: end_charge
  231.   #--------------------------------------------------------------------------
  232.   def end_charge
  233.     @actions.push(@charging_cache)
  234.     @charging_cache = nil
  235.     @charge_turn = nil
  236.     @charged = true
  237.     return true
  238.   end
  239.  
  240.   #--------------------------------------------------------------------------
  241.   # new method: cancel_charge
  242.   #--------------------------------------------------------------------------
  243.   def cancel_charge
  244.     clear_actions
  245.     @charging_cache = nil
  246.     @charge_turn = nil
  247.     @charged = false
  248.   end
  249.  
  250.   #--------------------------------------------------------------------------
  251.   # new method: update_charge_skill
  252.   #--------------------------------------------------------------------------
  253.   def update_charge_skill
  254.     @charge_turn -= 1
  255.     return end_charge if @charge_turn == 0
  256.     return false
  257.   end
  258.  
  259.   #--------------------------------------------------------------------------
  260.   # alias method: on_battle_end
  261.   #--------------------------------------------------------------------------
  262.   alias yse_on_battle_end_cs on_battle_end
  263.   def on_battle_end
  264.     cancel_charge
  265.     yse_on_battle_end_cs
  266.   end
  267.  
  268. end # Game_Battler
  269.  
  270. #==============================================================================
  271. # ¡ Game_Actor
  272. #==============================================================================
  273.  
  274. class Game_Actor < Game_Battler
  275.  
  276.   #--------------------------------------------------------------------------
  277.   # alias method: inputable?
  278.   #--------------------------------------------------------------------------
  279.   alias yse_inputable_cs inputable?
  280.   def inputable?
  281.     yse_inputable_cs && !charging?
  282.   end
  283.  
  284. end # Game_Actor
  285.  
  286. #==============================================================================
  287. # ¡ Game_Enemy
  288. #==============================================================================
  289.  
  290. class Game_Enemy < Game_Battler
  291.  
  292.   #--------------------------------------------------------------------------
  293.   # alias method: make_actions
  294.   #--------------------------------------------------------------------------
  295.   alias yse_make_actions_cs make_actions
  296.   def make_actions
  297.     return super if charging?
  298.     yse_make_actions_cs
  299.   end
  300.  
  301. end # Game_Enemy
  302.  
  303. #==============================================================================
  304. # ¡ Scene_Battle
  305. #==============================================================================
  306.  
  307. class Scene_Battle < Scene_Base
  308.  
  309.   #--------------------------------------------------------------------------
  310.   # alias method: execute_action
  311.   #--------------------------------------------------------------------------
  312.   alias yse_execute_action_bacs execute_action
  313.   def execute_action
  314.     return start_charge if @subject.start_charge
  315.     yse_execute_action_bacs
  316.   end
  317.  
  318.   #--------------------------------------------------------------------------
  319.   # alias method: process_action_end
  320.   #--------------------------------------------------------------------------
  321.   alias yse_process_action_end_bacs process_action_end
  322.   def process_action_end
  323.     process_charge_skill
  324.     yse_process_action_end_bacs
  325.   end
  326.  
  327.   #--------------------------------------------------------------------------
  328.   # new method: start_charge
  329.   #--------------------------------------------------------------------------
  330.   def start_charge
  331.     @subject.first_charge = true
  332.     return if @subject.current_action.item.start_msg.nil?
  333.     str = @subject.current_action.item.start_msg
  334.     skill = @subject.current_action.item
  335.     skill_text = sprintf("\\i[%d]%s", skill.icon_index, skill.name)
  336.     text = sprintf(str, @subject.name, skill_text)
  337.     @log_window.add_text(text)
  338.     3.times do @log_window.wait end
  339.     @log_window.back_one
  340.   end
  341.  
  342.   #--------------------------------------------------------------------------
  343.   # new method: process_charge_skill
  344.   #--------------------------------------------------------------------------
  345.   def process_charge_skill
  346.     return @subject.first_charge = false if @subject.first_charge
  347.     return unless @subject.charging?
  348.     return unless check_charge_turn
  349.     process_action_charge
  350.   end
  351.  
  352.   #--------------------------------------------------------------------------
  353.   # new method: check_charge_turn
  354.   #--------------------------------------------------------------------------
  355.   def check_charge_turn
  356.     continue = @subject.update_charge_skill
  357.     if continue
  358.       return true
  359.     else
  360.       return false if @subject.current_charging.item.continue_msg.nil?
  361.       str = @subject.current_charging.item.continue_msg
  362.       skill = @subject.current_charging.item
  363.       skill_text = sprintf("\\i[%d]%s", skill.icon_index, skill.name)
  364.       text = sprintf(str, @subject.name, skill_text)
  365.       @log_window.add_text(text)
  366.       3.times do @log_window.wait end
  367.       @log_window.back_one
  368.     end
  369.     return false
  370.   end
  371.  
  372.   #--------------------------------------------------------------------------
  373.   # new method: process_action_charge
  374.   #--------------------------------------------------------------------------
  375.   def process_action_charge
  376.     loop do
  377.       break if $game_troop.all_dead?
  378.       break unless @subject.current_action
  379.       @subject.current_action.prepare
  380.       execute_action if @subject.current_action.valid?
  381.       @subject.remove_current_action
  382.     end
  383.     @subject.charged = false
  384.   end
  385.  
  386. end # Scene_Battle
  387.  
  388. #==============================================================================
  389. #
  390. # ¥ End of File
  391. #
  392. #==============================================================================
回复 支持 反对

使用道具 举报

Lv3.寻梦者

梦石
0
星屑
1803
在线时间
133 小时
注册时间
2013-10-6
帖子
193
 楼主| 发表于 2022-5-22 21:10:15 | 显示全部楼层
本帖最后由 不死鸟之翼 于 2022-5-22 22:03 编辑
hq1107 发表于 2022-5-21 14:31
您好 我想设置一个需要充能才能释放的技能
可是在游戏中 该技能不需要充能状态也不消耗充能次数也能释放
..


无法复现问题。可能是和你项目里的脚本有冲突?
我发一个demo你看看,艾里克的强击会附加充能状态,横扫消耗1层状态。
另外,stackable只能出现一次,你有了max=3了就不要第一行了。

Project2.zip (1.43 MB, 下载次数: 41)
←你看到一只经常潜水的萌新。
回复 支持 反对

使用道具 举报

Lv2.观梦者

梦石
0
星屑
529
在线时间
58 小时
注册时间
2021-3-3
帖子
18
发表于 2022-5-23 12:12:50 | 显示全部楼层
不死鸟之翼 发表于 2022-5-22 21:10
无法复现问题。可能是和你项目里的脚本有冲突?
我发一个demo你看看,艾里克的强击会附加充能状态,横扫 ...

好吧,是我自己的脚本冲突
回复 支持 反对

使用道具 举报

Lv5.捕梦者

梦石
0
星屑
20910
在线时间
1020 小时
注册时间
2016-1-6
帖子
3355
发表于 2022-5-23 12:48:35 | 显示全部楼层
功能好强大啊,那如果使用睡眠魔法是不是永远都睡不醒了?
回复 支持 反对

使用道具 举报

Lv3.寻梦者

梦石
0
星屑
1803
在线时间
133 小时
注册时间
2013-10-6
帖子
193
 楼主| 发表于 2022-5-24 03:58:52 | 显示全部楼层
plain666 发表于 2022-5-23 12:48
功能好强大啊,那如果使用睡眠魔法是不是永远都睡不醒了?

没懂什么意思
这个脚本只是重复获得状态时累加计数器而已,刷新持续时间的是自带逻辑,因此就算不用这个脚本,重复附加睡眠的话回合数也会重置的。
←你看到一只经常潜水的萌新。
回复 支持 反对

使用道具 举报

Lv5.捕梦者

梦石
0
星屑
20910
在线时间
1020 小时
注册时间
2016-1-6
帖子
3355
发表于 2022-5-25 21:17:36 | 显示全部楼层
不死鸟之翼 发表于 2022-5-24 03:58
没懂什么意思
这个脚本只是重复获得状态时累加计数器而已,刷新持续时间的是自带逻辑,因此就算不用这个 ...

我是说一直使用睡眠魔法让敌人睡不醒,睡不醒就不能还手,这样我方就安全了,对吧?
回复 支持 反对

使用道具 举报

Lv2.观梦者

梦石
0
星屑
346
在线时间
63 小时
注册时间
2020-2-24
帖子
13
发表于 2022-7-17 15:17:12 | 显示全部楼层
这个他会更改字体 不希望它更改得话应该怎么做呢
回复 支持 反对

使用道具 举报

Lv3.寻梦者

梦石
0
星屑
2638
在线时间
353 小时
注册时间
2015-1-29
帖子
13
发表于 2022-7-25 19:07:08 | 显示全部楼层
这脚本只累计层数,无法叠加特性啊。
一个状态+10%攻击力,就算有3层也只+10%攻击力。
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-3-29 19:09

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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