赞 | 274 |
VIP | 0 |
好人卡 | 0 |
积分 | 158 |
经验 | 515 |
最后登录 | 2024-11-8 |
在线时间 | 2106 小时 |
Lv4.逐梦者
- 梦石
- 1
- 星屑
- 14790
- 在线时间
- 2106 小时
- 注册时间
- 2017-9-28
- 帖子
- 662
|
- #==============================================================================
- # 延时施放技能的状态
- # Version 1.1
- # By Szyu
- #
- # 介绍:
- # 可以创建一个延时施放技能的状态
- # 例如,一个定时炸弹的技能,对敌方附加“被安置炸弹”的状态,三回合后敌人会自动
- # 受到“爆破”技能的伤害。
- #
- # 安装方法:
- # - 放在"插件脚本"之下,"Main"之上.
- #
- # 使用方法:
- # - <延时技能: 技能id>
- # - <延时技能: 技能id1, 技能id2, ..., 技能idn>
- # 在状态备注中填入以上内容,则状态解除时将会依次触发所有技能
- #
- # 例子:
- # <延时技能: 10, 50>
- #
- #
- # 需要:
- # - RPG Maker VX Ace
- #
- # 使用条款:
- # - 免费用于商业或非商业游戏.请署名我在制作名单中以支持我的作品。
- #
- # Pastebin:
- # http://pastebin.com/ye790Zsy
- #
- #
- #==============================================================
- # * Game_Battler
- #==============================================================
- class Game_Battler < Game_BattlerBase
-
- alias sz_update_timed_states update_state_turns
- def update_state_turns
- sz_update_timed_states
- update_timed_states
- end
-
- def update_timed_states
- states.each do |state|
- if state.timed && @state_turns[state.id] == 0
- state.triggered_skills.each do |s|
- BattleManager.triggering_timed_states.push(RPG::EventCommand.new(339, 0, get_ts_params(s)))
- end
- end
- end
- end
-
- def get_ts_params(skill)
- if self.is_a?(Game_Enemy)
- return [0, self.index, skill, self.index]
- elsif self.is_a?(Game_Actor)
- return [1, self.character_index + 1, skill, self.index]
- else
- return [0, 0, 0, 0]
- end
- end
- end
- #==============================================================
- # * BattleManager
- #==============================================================
- module BattleManager
- class << self
- attr_accessor :triggering_timed_states
- alias sz_ts_setup setup
- alias sz_ts_turn_end turn_end
- end
-
- def self.setup(troop_id, can_escape = true, can_lose = false)
- sz_ts_setup(troop_id, can_escape, can_lose)
- @triggering_timed_states = []
- end
-
- def self.turn_end
- sz_ts_turn_end
- if @triggering_timed_states.size > 0
- $game_troop.interpreter.setup(@triggering_timed_states.clone)
- @triggering_timed_states.clear
- end
- end
- end
- #==============================================================
- # * Initialize BaseItems
- #==============================================================
- module DataManager
- class << self
- alias load_db_timer_notes load_database
- end
-
- def self.load_database
- load_db_timer_notes
- load_sz_timer_items
- end
-
- def self.load_sz_timer_items
- groups = [$data_states]
- for group in groups
- for obj in group
- next if obj.nil?
- obj.load_sz_state_timer
- end
- end
- end
- end
- #==============================================================
- # * Notes
- #==============================================================
- class RPG::State < RPG::BaseItem
- attr_accessor :timed
- attr_accessor :triggered_skills
-
- def load_sz_state_timer
- @timed = false
- @triggered_skills = []
-
- self.note.split(/[\r\n]+/).each do |line|
- scan_sz_timer_data(line)
- end
- end
-
- def scan_sz_timer_data(line)
- return unless line =~ /<延时技能:\s*([\d+\s*,?\s*]+)>/i ? true : false
- @timed = true
- skills = $1.scan(/\s*,?\d+,?\s*/i)
- skills.each do |skill|
- @triggered_skills.push(skill.to_i)
- end
- end
-
- end
复制代码 |
评分
-
查看全部评分
|