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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
| #===============================================================================
#
# Project YERD + Tankentai Compatibility Patch
#
# This is a compatibility patch to make the Yanfly Engine ReDux battle scripts
# work with Tankentai. This patch is plug and play but both Yanfly's scripts and
# Tankentai aren't. This is only for the non ATB version.
#
#===============================================================================
# Instructions
# -----------------------------------------------------------------------------
# Place the scripts in this order from top to bottom. If you don't, you'll
# never get these scripts working together.
# Default Scripts
#
# YERD Battler Stat: Aggro
# YERD Battler Stat: Barehand
# YERD Battler Stat: Morale
# YERD Bestiary + Display Scanned Enemy
# YERD Display Item Query
# YERD Display Skill Query
# Tankentai
# This script: Project YERD + Tankentai Compatibility Patch
#
# Main
#===============================================================================
$imported = {} if $imported == nil
#===============================================================================
# class Scene Battle
#===============================================================================
class Scene_Battle < Scene_Base
#--------------------------------------------------------------------------
# update
# compatibility for Bestiary + Display Scanned Enemy
#--------------------------------------------------------------------------
alias update_yerdtankentai update
def update
if $imported["DisplayScannedEnemy"] and @enemy_scan_window.visible
update_scan_enemy_windows
else
update_yerdtankentai
end
end
#--------------------------------------------------------------------------
# select member
# compatibility for Bestiary + Display Scanned Enemy
#--------------------------------------------------------------------------
def select_member(actor = false)
members = $game_party.members if actor
members = $game_troop.members unless actor
loop do
update_basic
@cursor_flame = 0 if @cursor_flame == 30
@cursor.src_rect.set(0, 0, 32, 32) if @cursor_flame == 29
@cursor.src_rect.set(0, 32, 32, 32) if @cursor_flame == 15
point = @spriteset.set_cursor(actor, @index)
@cursor.x = point[0]
@cursor.y = point[1]
@cursor_flame += 1
if Input.trigger?(Input::B)
Sound.play_cancel
end_target_selection
break
elsif Input.trigger?(Input::C)
Sound.play_decision
@active_battler.action.target_index = @index
end_target_selection
end_skill_selection
end_item_selection
next_actor
break
elsif $imported["DisplayScannedEnemy"] and !actor and Input.trigger?(YE::MENU::MONSTER::ENEMY_SCAN_BUTTON)
Sound.play_decision
enemy = $game_troop.members[@index]
@enemy_scan_window.appear(enemy, nil)
@enemy_image_window.appear(enemy, nil)
@enemy_name_window.appear(enemy, nil)
$yerdtkt_actor = actor
break
end
if Input.repeat?(Input::LEFT)
if actor
cursor_down(members, actor) if $back_attack
cursor_up(members, actor) unless $back_attack
else
cursor_up(members, actor) if $back_attack
cursor_down(members, actor) unless $back_attack
end
end
if Input.repeat?(Input::RIGHT)
if actor
cursor_up(members, actor) if $back_attack
cursor_down(members, actor) unless $back_attack
else
cursor_down(members, actor) if $back_attack
cursor_up(members, actor) unless $back_attack
end
end
cursor_up(members, actor) if Input.repeat?(Input::UP)
cursor_down(members, actor) if Input.repeat?(Input::DOWN)
end
end
#--------------------------------------------------------------------------
# update scan enemy windows
# compatibility for Bestiary + Display Scanned Enemy
#--------------------------------------------------------------------------
def update_scan_enemy_windows
return unless $imported["DisplayScannedEnemy"]
@enemy_scan_window.update
@enemy_image_window.update
@enemy_name_window.update
if Input.trigger?(Input::B)
Sound.play_cancel
@enemy_scan_window.disappear
@enemy_image_window.disappear
@enemy_name_window.visible = false
select_member($yerdtkt_actor)
elsif Input.trigger?(Input::LEFT) or Input.trigger?(Input::UP)
@enemy_scan_window.previous_page
elsif Input.trigger?(Input::RIGHT) or Input.trigger?(Input::DOWN)
@enemy_scan_window.next_page
elsif Input.trigger?(Input::L)
@enemy_scan_window.top_page
elsif Input.trigger?(Input::R)
@enemy_scan_window.bottom_page
end
end
#--------------------------------------------------------------------------
# target decision
# compatibility for Battler Stat: Morale
#--------------------------------------------------------------------------
def target_decision(obj = nil)
@targets = @active_battler.action.make_targets
if $imported["BattlerStatMorale"] and obj != nil
@active_battler.boost_morale(obj.change_morale)
for target in @targets
target.boost_morale(obj.boost_morale) unless target.dead?
end
end
if @targets.size == 0
action = @active_battler.recover_action
@spriteset.set_action(@active_battler.actor?, @active_battler.index, action)
end
if obj != nil
if obj.for_two? or obj.for_three? or obj.dual?
@targets = [@targets[0]]
end
if obj.extension.include?("RANDOMTARGET")
randum_targets = @targets.dup
@targets = [randum_targets[rand(randum_targets.size)]]
end
end
@spriteset.set_target(@active_battler.actor?, @active_battler.index, @targets)
end
end |