View difference between Paste ID: XD2f6TNE and R7DXE0iE
SHOW: | | - or go back to the newest paste.
1
#==============================================================================
2-
# FFS - Stealkiller
2+
# FFS - Stealkiller v1.0
3
#==============================================================================
4
# <stealkiller counter: x> x = Anzahl für den Stealskill
5
# <stealkiller ce: x> x = ID des Common Events
6
7
$imported = {} if $imported == nil
8
$imported["Stealkiller"] = true
9
10
module Flip
11
  COMMON_EVENT_STEALKILLER_COUNTER = 50
12
end
13
14
#==============================================================================
15
# RPG::Enemy
16
#==============================================================================
17
 
18
class RPG::Enemy
19
  #--------------------------------------------------------------------------
20
  # * Friendly EXP
21
  #--------------------------------------------------------------------------
22
  def stealkiller_counter
23
    return @stealkiller_counter if @stealkiller_counter != nil
24
    self.note.split(/[\r\n]+/).each { |line|
25
      case line
26
      when /<(?:STEALKILLER_COUNTER|stealkiller counter):[ ](\d+)>/i
27
        @stealkiller_counter = $1.to_i
28
      end
29
    }
30
    return @stealkiller_counter
31
  end
32
  #--------------------------------------------------------------------------
33
  # * Friendly EXP
34
  #--------------------------------------------------------------------------
35
  def stealkiller_ce
36
    return @stealkiller_ce if @stealkiller_ce != nil
37
    self.note.split(/[\r\n]+/).each { |line|
38
      case line
39
      when /<(?:STEALKILLER_CE|stealkiller ce):[ ](\d+)>/i
40
        @stealkiller_ce = $1.to_i
41
      end
42
    }
43
    return @stealkiller_ce
44
  end
45
46
end
47
48
#==============================================================================
49
# ■ Game_Battler
50
#==============================================================================
51
52
class Game_Battler
53
  attr_accessor :stealkiller_counter
54
  attr_accessor :stealkiller_ce
55
  
56
  alias initialize_stealkiller initialize
57
  def initialize
58
    initialize_stealkiller
59
    @stealkiller = 0
60
    @stealkiller_ce = 0
61
  end
62
end
63
64
#==============================================================================
65
# ■ Game_Enemy
66
#==============================================================================
67
68
class Game_Enemy < Game_Battler
69
  #--------------------------------------------------------------------------
70
  # ● オブジェクト初期化
71
  #     index    : 敵グループ内インデックス
72
  #     enemy_id : 敵キャラ ID
73
  #--------------------------------------------------------------------------
74-
        $game_temp.common_event_id = Flip::COMMON_EVENT_STEALKILLER_COUNTER
74+
75
  def initialize(index, enemy_id)
76
    initialize_flip_stealkiller(index, enemy_id)
77
    @stealkiller_counter = enemy.stealkiller_counter
78
    @stealkiller_ce = enemy.stealkiller_ce
79
  end
80
end
81
82
class Scene_Battle < Scene_Base
83
  #--------------------------------------------------------------------------
84
  # * process_kgc_steal
85
  #--------------------------------------------------------------------------
86
  def process_kgc_steal(target, steal_type)
87
    skill = @active_battler.action.skill
88
    target.bem_make_obj_steal_result(@active_battler, skill, steal_type)
89
    display_steal_effects(target, skill)
90
    if target.stealkiller_counter > 0
91
      target.stealkiller_counter -= 1
92
      if target.stealkiller_counter <= 0
93
        $game_temp.common_event_id = target.stealkiller_ce
94
      end
95
    end
96
  end
97
end