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
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
| #===============================================================================
#
# Shanghai Simple Script - Passive Skills
# Last Date Updated: 2010.05.19
# Level: Normal
#
# Skills learned by actors can now give stat bonuses or apply autostates.
#===============================================================================
# Instructions
# -----------------------------------------------------------------------------
# To install this script, open up your script editor and copy/paste this script
# to an open slot below ▼ Materials but above ▼ Main. Remember to save.
#
# <passive param: +x>
# <passive param: -x>
# <passive param: x%>
# Replace param with hp, mp, atk, def, spi, agi, dex, res, hit, eva, cri, or
# odds, and this tag will increase or decrease the base stat by that much. %
# will increase by a percent.
#
# <passive state: x>
# <passive state: x, x, x>
# Gives the skill with state x always applied. Unremovable until the skill has
# been forgotten.
#
# Insert multiple of these tags if you want more than one passive effect
# applied for a single skill.
#===============================================================================
$imported = {} if $imported == nil
$imported["PassiveSkills"] = true
#==============================================================================
# RPG::BaseItem
#==============================================================================
class RPG::BaseItem
#--------------------------------------------------------------------------
# passive_traits
#--------------------------------------------------------------------------
def passive_traits
return @passive_traits if @passive_traits != nil
@passive_traits = { :maxhp => 0, :maxmp => 0, :atk => 0, :def => 0,
:spi => 0, :agi => 0, :dex => 0, :res => 0, :hit => 0, :eva => 0,
:cri => 0, :odds => 0, :maxhpp => 100, :maxmpp => 100, :atkp => 100,
:defp => 100, :spip => 100, :agip => 100, :dexp => 100, :resp => 100,
:hitp => 100, :evap => 100, :crip => 100, :oddsp => 100, :states => []}
self.note.split(/[\r\n]+/).each { |line|
case line
when /<(?:PASSIVE|pas)[ ](.*):[ ]([\+\-]\d+)>/i
case $1.upcase
when "MAXHP", "HP"
@passive_traits[:maxhp] = $2.to_i
when "MAXMP", "MP"
@passive_traits[:maxmp] = $2.to_i
when "ATK"
@passive_traits[:atk] = $2.to_i
when "DEF"
@passive_traits[:def] = $2.to_i
when "SPI"
@passive_traits[:spi] = $2.to_i
when "AGI"
@passive_traits[:agi] = $2.to_i
when "DEX"
@passive_traits[:dex] = $2.to_i
when "RES"
@passive_traits[:res] = $2.to_i
when "HIT"
@passive_traits[:hit] = $2.to_i
when "EVA"
@passive_traits[:eva] = $2.to_i
when "CRI"
@passive_traits[:cri] = $2.to_i
when "ODDS"
@passive_traits[:odds] = $2.to_i
end
when /<(?:PASSIVE|pas)[ ](.*):[ ](\d+)([%%])>/i
case $1.upcase
when "MAXHP", "HP"
@passive_traits[:maxhpp] = $2.to_i
when "MAXMP", "MP"
@passive_traits[:maxmpp] = $2.to_i
when "ATK"
@passive_traits[:atkp] = $2.to_i
when "DEF"
@passive_traits[:defp] = $2.to_i
when "SPI"
@passive_traits[:spip] = $2.to_i
when "AGI"
@passive_traits[:agip] = $2.to_i
when "DEX"
@passive_traits[:dexp] = $2.to_i
when "RES"
@passive_traits[:resp] = $2.to_i
when "HIT"
@passive_traits[:hitp] = $2.to_i
when "EVA"
@passive_traits[:evap] = $2.to_i
when "CRI"
@passive_traits[:crip] = $2.to_i
when "ODDS"
@passive_traits[:oddsp] = $2.to_i
end
when /<(?:PASSIVE_STATE|passive state):[ ](\d+(?:\s*,\s*\d+)*)>/i
$1.scan(/\d+/).each { |num|
@passive_traits[:states].push($data_states[num.to_i]) if num.to_i > 0 }
end
}
return @passive_traits
end
end
#==============================================================================
# ** Game_Battler
#==============================================================================
class Game_Battler
#--------------------------------------------------------------------------
# * Get Current States as an Object Array
#--------------------------------------------------------------------------
alias states_sss_passive_skills states unless $@
def states
array = states_sss_passive_skills
if actor?
for skill in skills do array |= skill.passive_traits[:states] end
end
return array.compact
end
end
#==============================================================================
# Game Actor
#==============================================================================
class Game_Actor < Game_Battler
#--------------------------------------------------------------------------
# * Get Basic Maximum HP
#--------------------------------------------------------------------------
alias base_maxhp_sss_passive_skills base_maxhp unless $@
def base_maxhp
n = base_maxhp_sss_passive_skills
for skill in skills do n = n * skill.passive_traits[:maxhpp] / 100.0 end
for skill in skills do n += skill.passive_traits[:maxhp] end
return Integer(n)
end
#--------------------------------------------------------------------------
# * Get Basic Maximum MP
#--------------------------------------------------------------------------
alias base_maxmp_sss_passive_skills base_maxmp unless $@
def base_maxmp
n = base_maxmp_sss_passive_skills
for skill in skills do n = n * skill.passive_traits[:maxmpp] / 100.0 end
for skill in skills do n += skill.passive_traits[:maxmp] end
return Integer(n)
end
#--------------------------------------------------------------------------
# * Get Basic Attack
#--------------------------------------------------------------------------
alias base_atk_sss_passive_skills base_atk unless $@
def base_atk
n = base_atk_sss_passive_skills
for skill in skills do n = n * skill.passive_traits[:atkp] / 100.0 end
for skill in skills do n += skill.passive_traits[:atk] end
return Integer(n)
end
#--------------------------------------------------------------------------
# * Get Basic Defense
#--------------------------------------------------------------------------
alias base_def_sss_passive_skills base_def unless $@
def base_def
n = base_def_sss_passive_skills
for skill in skills do n = n * skill.passive_traits[:defp] / 100.0 end
for skill in skills do n += skill.passive_traits[:def] end
return Integer(n)
end
#--------------------------------------------------------------------------
# * Get Basic Spirit
#--------------------------------------------------------------------------
alias base_spi_sss_passive_skills base_spi unless $@
def base_spi
n = base_spi_sss_passive_skills
for skill in skills do n = n * skill.passive_traits[:spip] / 100.0 end
for skill in skills do n += skill.passive_traits[:spi] end
return Integer(n)
end
#--------------------------------------------------------------------------
# * Get Basic Agility
#--------------------------------------------------------------------------
alias base_agi_sss_passive_skills base_agi unless $@
def base_agi
n = base_agi_sss_passive_skills
for skill in skills do n = n * skill.passive_traits[:agip] / 100.0 end
for skill in skills do n += skill.passive_traits[:agi] end
return Integer(n)
end
#--------------------------------------------------------------------------
# * Get Basic Dexterity
#--------------------------------------------------------------------------
if $imported["DEX Stat"]
alias base_dex_sss_passive_skills base_dex unless $@
def base_dex
n = base_dex_sss_passive_skills
for skill in skills do n = n * skill.passive_traits[:dexp] / 100.0 end
for skill in skills do n += skill.passive_traits[:dex] end
return Integer(n)
end
end
#--------------------------------------------------------------------------
# * Get Basic Resist
#--------------------------------------------------------------------------
if $imported["RES Stat"]
alias base_res_sss_passive_skills base_res unless $@
def base_res
n = base_res_sss_passive_skills
for skill in skills do n = n * skill.passive_traits[:resp] / 100.0 end
for skill in skills do n += skill.passive_traits[:res] end
return Integer(n)
end
end
#--------------------------------------------------------------------------
# * Get Hit Rate
#--------------------------------------------------------------------------
alias hit_sss_passive_skills hit unless $@
def hit
n = hit_sss_passive_skills
for skill in skills do n = n * skill.passive_traits[:hitp] / 100.0 end
for skill in skills do n += skill.passive_traits[:hit] end
return [Integer(n), 0].max
end
#--------------------------------------------------------------------------
# * Get Evasion Rate
#--------------------------------------------------------------------------
alias eva_sss_passive_skills eva unless $@
def eva
n = eva_sss_passive_skills
for skill in skills do n = n * skill.passive_traits[:evap] / 100.0 end
for skill in skills do n += skill.passive_traits[:eva] end
return [Integer(n), 0].max
end
#--------------------------------------------------------------------------
# * Get Critical Rate
#--------------------------------------------------------------------------
alias cri_sss_passive_skills cri unless $@
def cri
n = cri_sss_passive_skills
for skill in skills do n = n * skill.passive_traits[:crip] / 100.0 end
for skill in skills do n += skill.passive_traits[:cri] end
return [Integer(n), 0].max
end
#--------------------------------------------------------------------------
# * Get Get Ease of Hitting
#--------------------------------------------------------------------------
alias odds_sss_passive_skills odds unless $@
def odds
n = odds_sss_passive_skills
for skill in skills do n = n * skill.passive_traits[:oddsp] / 100.0 end
for skill in skills do n += skill.passive_traits[:odds] end
return [Integer(n), 1].max
end
end
#===============================================================================
#
# END OF FILE
#
#=============================================================================== |