-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathRS_SimplePasssiveStateForItem.rb
64 lines (60 loc) · 1.6 KB
/
RS_SimplePasssiveStateForItem.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#================================================================
# The MIT License
# Copyright (c) 2020 biud436
# ---------------------------------------------------------------
# Free for commercial and non commercial use.
#================================================================
#==============================================================================
# ** RS_SimplePasssiveStateForItem (2018.08.19)
#==============================================================================
$imported = {} if $imported.nil?
$imported["RS_SimplePasssiveStateForItem"] = true
module PassiveItem
PASSIVE_ITEMS =
{
# 아이템 ID => 상태 ID
1 => 26,
}
def update_my_passive_state
actor = $game_party.members[0]
# 플레이어가 있는가?
return if not actor
PASSIVE_ITEMS.each do |index, state_id|
# 아이템을 소지 중인가?
if $game_party.has_item?($data_items[index])
# 패시브 상태를 추가한다
actor.add_state(state_id)
else
# 패시브 상태를 제거한다
actor.remove_state(state_id)
end
end
end
end
# 맵
class Scene_Map
include PassiveItem
alias xxxx_my_passive_update update
def update
xxxx_my_passive_update
update_my_passive_state
end
end
# 전투
class Scene_Battle
include PassiveItem
alias xxxx_my_passive_update update
def update
xxxx_my_passive_update
update_my_passive_state
end
end
# 메뉴
class Scene_MenuBase
include PassiveItem
alias xxxx_my_passive_update update
def update
xxxx_my_passive_update
update_my_passive_state
end
end