View difference between Paste ID: R7DXE0iE and 9XDmsVuw
SHOW: | | - or go back to the newest paste.
1
#==============================================================================
2
# FFS - Stealkiller
3
#==============================================================================
4
5
$imported = {} if $imported == nil
6
$imported["Stealkiller"] = true
7
8
module Flip
9
  COMMON_EVENT_STEALKILLER_COUNTER = 50
10
end
11
12
#==============================================================================
13
# RPG::Enemy
14
#==============================================================================
15
 
16
class RPG::Enemy
17
  #--------------------------------------------------------------------------
18
  # * Friendly EXP
19
  #--------------------------------------------------------------------------
20
  def stealkiller_counter
21
    return @stealkiller_counter if @stealkiller_counter != nil
22
    self.note.split(/[\r\n]+/).each { |line|
23
      case line
24
      when /<(?:STEALKILLER_COUNTER|stealkiller counter):[ ](\d+)>/i
25
        @stealkiller_counter = $1.to_i
26
      end
27
    }
28
    return @stealkiller_counter
29
  end
30
end
31
32
#==============================================================================
33
# ■ Game_Battler
34
#==============================================================================
35
36
class Game_Battler
37
  attr_accessor :stealkiller_counter
38
  
39
  alias initialize_stealkiller initialize
40
  def initialize
41
    initialize_stealkiller
42
    @stealkiller = 0
43
  end
44
end
45
46
#==============================================================================
47
# ■ Game_Enemy
48
#==============================================================================
49
50
class Game_Enemy < Game_Battler
51
  #--------------------------------------------------------------------------
52
  # ● オブジェクト初期化
53
  #     index    : 敵グループ内インデックス
54
  #     enemy_id : 敵キャラ ID
55
  #--------------------------------------------------------------------------
56
  alias initialize_flip_stealkiller initialize
57
  def initialize(index, enemy_id)
58
    initialize_flip_stealkiller(index, enemy_id)
59
    @stealkiller_counter = enemy.stealkiller_counter
60
  end
61
end
62
63
class Scene_Battle < Scene_Base
64
  #--------------------------------------------------------------------------
65-
  # ○ 戦闘行動の実行 : 盗む
65+
  # * process_kgc_steal
66
  #--------------------------------------------------------------------------
67-
  def execute_action_steal
67+
  def process_kgc_steal(target, steal_type)
68
    skill = @active_battler.action.skill
69-
    text = @active_battler.name + skill.message1
69+
    target.bem_make_obj_steal_result(@active_battler, skill, steal_type)
70-
    @message_window.add_instant_text(text)
70+
    display_steal_effects(target, skill)
71-
    unless skill.message2.empty?
71+
    if target.stealkiller_counter > 0
72-
      wait(10)
72+
      target.stealkiller_counter -= 1
73-
      @message_window.add_instant_text(skill.message2)
73+
      if target.stealkiller_counter <= 0
74
        $game_temp.common_event_id = Flip::COMMON_EVENT_STEALKILLER_COUNTER
75-
    targets = @active_battler.action.make_targets
75+
76-
    display_animation(targets, skill.animation_id)
76+
77-
    @active_battler.mp -= @active_battler.calc_mp_cost(skill)
77+
78-
    $game_temp.common_event_id = skill.common_event_id
78+