Project1

标题: 如何才能做到受到一定次数攻击就消失的状态?跪求大佬! [打印本页]

作者: ACRI    时间: 2024-7-11 21:46
标题: 如何才能做到受到一定次数攻击就消失的状态?跪求大佬!
本帖最后由 ACRI 于 2024-7-12 01:35 编辑

如标题所说,就是想做一种,受到两三次攻击,然后就会消失的状态。
因为想要制作出弱多段攻击的boss,不论是什么办法都行,有什么脚本能做到,或者是事件都行!
站内倒是有个受到一次攻击就消失的状态脚本,但是有点不符合吧()

站内的类似脚本链接:https://rpg.blue/thread-400654-1-1.htmlhttps://rpg.blue/thread-411803-1-1.html
作者: salt    时间: 2024-7-13 19:42
翻到过这种脚本
你看看行不行

攻击次数解除.7z

1.15 KB, 下载次数: 10


作者: 契约师Vi    时间: 2024-7-14 00:16
武器添加状态,添加等多个状态,然后添加负增益状态、抵消状态就可以。理论上是这样,实际我没有操作过
作者: BCJT    时间: 2025-2-4 22:23
=begin
#===============================================================================
Title: 状态充能
Author: Hime
Date: Jun 14, 2015
--------------------------------------------------------------------------------
** Change log
Jun 14, 2015
   - only reset state counts if state is still applied
Mar 22, 2014
   - fixed bug where states with charges are not removed after battle
Feb 28, 2014
   - state is correctly removed when charges drop to zero
Nov 16, 2013
   - is it possible to have the state but no state charge recorded?
Sep 14, 2013
   - added some methods for adding/removing state charges
Jun 23, 2013
   - Initial release
--------------------------------------------------------------------------------   
** Terms of Use
* Free to use in non-commercial projects
* Contact me for commercial use
* No real support. The script is provided as-is
* Will do bug fixes, but no compatibility patches
* Features may be requested but no guarantees, especially if it is non-trivial
* Credits to Hime Works in your project
* Preserve this header
--------------------------------------------------------------------------------
** 说明

此脚本可以让状态有“充能”的效果,要求状态彻底移除前,需要被移除的次数
例如某个状态有3次充能,则状态移除3次后才会真正被移除.

这和“状态堆叠”不同,因为状态充能并不会让状态多次附加。
--------------------------------------------------------------------------------
** Installation

Place this script below Materials and above Main.
如果和 Yanfly的状态管理 同时使用, 请放在其之下

--------------------------------------------------------------------------------
** 使用方法

使用状态备注:

   <state charges: x>
   
  代表状态附加时,充能x次.

#===============================================================================
=end
$imported = {} if $imported.nil?
$imported["TH_StateCharges"] = true
#===============================================================================
# ** Configuration
#===============================================================================
module TH
  module State_Charges
   
    Regex = /<state[-_ ]charges: (\d+)>/i
  end
end
#===============================================================================
# ** Rest of the script
#===============================================================================
module RPG
  class State
    def state_charges
      return @state_charges unless @state_charges.nil?
      load_notetag_state_charges
      return @state_charges
    end
   
    def load_notetag_state_charges
      res = self.note.match(TH::State_Charges::Regex)
      @state_charges = res ? res[1].to_i : 1
    end
  end
end

class Game_BattlerBase
  
  alias :th_state_charges_clear_states :clear_states
  def clear_states
    th_state_charges_clear_states
    @state_charges = {}
  end
  
  alias :th_state_charges_erase_state :erase_state
  def erase_state(state_id)
    th_state_charges_erase_state(state_id)
    @state_charges.delete(state_id)
  end
end

class Game_Battler < Game_BattlerBase
  
  alias :th_state_charges_remove_state :remove_state
  def remove_state(state_id)
    if has_state_charges?(state_id)
      remove_state_charges(state_id, 1)
      reset_state_counts(state_id) if state?(state_id)
    else
      th_state_charges_remove_state(state_id)
    end
  end
  
  alias :th_state_charges_add_new_state :add_new_state
  def add_new_state(state_id)
    set_state_charges(state_id, $data_states[state_id].state_charges)
    th_state_charges_add_new_state(state_id)
  end
  
  def state_charges(state_id)
    return @state_charges[state_id]
  end
  
  def set_state_charges(state_id, amount)
    @state_charges[state_id] = amount
  end
  
  def add_state_charges(state_id, amount)
    @state_charges[state_id] += amount
  end
  
  def remove_state_charges(state_id, amount)
    @state_charges[state_id] = [@state_charges[state_id]-amount, 0].max
    th_state_charges_remove_state(state_id) if @state_charges[state_id] == 0
  end
  
  def has_state_charges?(state_id)
    return state?(state_id) && @state_charges[state_id] && @state_charges[state_id] > 0
  end
  
  alias :th_state_charges_remove_battle_states :remove_battle_states
  def remove_battle_states
    remove_battle_state_charges
    th_state_charges_remove_battle_states
  end
  
  #-----------------------------------------------------------------------------
  # New.
  #-----------------------------------------------------------------------------
  def remove_battle_state_charges
    states.each do |state|
      @state_charges[state.id] = 0 if state.remove_at_battle_end
    end
  end
end
作者: ACRI    时间: 2025-3-20 03:26
总之呢,自己回复一下吧
依靠http://artificialprovidence.web. ... SS3ST_END_STATE.txt
星潟的这个脚本,再通过帖子第一个脚本,消失一个状态自动添加另一个状态的方式,就能够做出弱多段攻击的boos了。

至于其他的的用法,比如说次数超级盾(不免疫攻击但是减伤很高),请自行摸索吧,因为我也忘了,不过可以看看二楼的脚本,我记得好像和二楼的脚本有关。




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