#===============================================================================
# Passive Skills, by Leon_Westbrooke
# v. 1.0
#----------------------------------------------------------------------
# Instructions: Put below all default scripts, and above Main
#
# Features: Creates passive skills that adds to the stats:
# HP, SP, STR, DEX, AGI, INT, EVA, Atk, PDef, MDef
#
# Adds stats based on a percentage. (so, 100% will double that stat.)
#
# To have a skill lower stats, make the number negative in the module.
#
# Compatability:
# There are no known clashes with other scripts.
#
# Notes:
# This script aliases the stats in Game_Actor, and rewrites the refresh
# method in Window_Skill.
#===============================================================================
#===============================================================================
# module Passive_Skills
#===============================================================================
module Passive_Skills
#--------------------------------------------------------------------
# Passive_Skills = { skill_id => {'stat' => amount,..},..}
# stats: 'hp', 'sp', 'str', 'dex', 'agi', 'int', 'eva', 'atk', 'pdef', 'mdef'
#--------------------------------------------------------------------
Passive_Skills = {
84 => {'hp' => 10},
85 => {'hp' => 5},
86 => {'hp' => 5},
87 => {'hp' => 5},
88 => {'sp' => 10},
89 => {'sp' => 5},
90 => {'sp' => 5},
91 => {'sp' => 5},
}
end
#===============================================================================
# END module Passive_Skills
#===============================================================================
#===============================================================================
# Game_Actor
#===============================================================================
class Game_Actor < Game_Battler
attr_accessor :passive_hp
attr_accessor :passive_sp
attr_accessor :passive_str
attr_accessor :passive_dex
attr_accessor :passive_agi
attr_accessor :passive_int
attr_accessor :passive_eva
attr_accessor :passive_atk
attr_accessor :passive_pdef
attr_accessor :passive_mdef
alias leon_passiveskills_gameactor_setup setup
alias leon_passiveskills_gameactor_basehp base_maxhp
alias leon_passiveskills_gameactor_basesp base_maxsp
alias leon_passiveskills_gameactor_basestr base_str
alias leon_passiveskills_gameactor_basedex base_dex
alias leon_passiveskills_gameactor_baseagi base_agi
alias leon_passiveskills_gameactor_baseint base_int
alias leon_passiveskills_gameactor_baseeva base_eva
alias leon_passiveskills_gameactor_baseatk base_atk
alias leon_passiveskills_gameactor_basepdef base_pdef
alias leon_passiveskills_gameactor_basemdef base_mdef
def setup(actor_id)
@passive_hp = 0
@passive_sp = 0
@passive_str = 0
@passive_dex = 0
@passive_agi = 0
@passive_int = 0
@passive_eva = 0
@passive_atk = 0
@passive_pdef = 0
@passive_mdef = 0
leon_passiveskills_gameactor_setup(actor_id)
end
def passive_bonus
ps = Passive_Skills
hp = 0
sp = 0
str = 0
dex = 0
agi = 0
int = 0
eva = 0
atk = 0
pdef = 0
mdef = 0
for i in 0...@skills.size
if ps::Passive_Skills.keys.include?(@skills[i])
for j in 0...ps::Passive_Skills[@skills[i]].size
case ps::Passive_Skills[@skills[i]].keys[j]
when 'hp'
hp += ps::Passive_Skills[@skills[i]]['hp']
when 'sp'
sp += ps::Passive_Skills[@skills[i]]['sp']
when 'str'
str += ps::Passive_Skills[@skills[i]]['str']
when 'dex'
dex += ps::Passive_Skills[@skills[i]]['dex']
when 'agi'
agi += ps::Passive_Skills[@skills[i]]['agi']
when 'int'
int += ps::Passive_Skills[@skills[i]]['int']
when 'eva'
eva += ps::Passive_Skills[@skills[i]]['eva']
when 'atk'
atk += ps::Passive_Skills[@skills[i]]['atk']
when 'pdef'
pdef += ps::Passive_Skills[@skills[i]]['pdef']
when 'mdef'
mdef += ps::Passive_Skills[@skills[i]]['mdef']
end
end
end
end
@passive_hp = hp
@passive_sp = sp
@passive_str = str
@passive_dex = dex
@passive_agi = agi
@passive_int = int
@passive_eva = eva
@passive_atk = atk
@passive_pdef = pdef
@passive_mdef = mdef
end
def base_maxhp
ps = Passive_Skills
n = leon_passiveskills_gameactor_basehp
n = n + (n * @passive_hp * 0.01)
passive_bonus
return n
end
def base_maxsp
ps = Passive_Skills
n = leon_passiveskills_gameactor_basesp
n = n + (n * @passive_sp * 0.01)
return n
end
def base_str
ps = Passive_Skills
n = leon_passiveskills_gameactor_basestr
n = n + (n * @passive_str * 0.01)
return n
end
def base_dex
ps = Passive_Skills
n = leon_passiveskills_gameactor_basedex
n = n + (n * @passive_dex * 0.01)
return n
end
def base_agi
ps = Passive_Skills
n = leon_passiveskills_gameactor_baseagi
n = n + (n * @passive_agi * 0.01)
return n
end
def base_int
ps = Passive_Skills
n = leon_passiveskills_gameactor_baseint
n = n + (n * @passive_int * 0.01)
return n
end
def base_atk
ps = Passive_Skills
n = leon_passiveskills_gameactor_baseatk
n = n + (n * @passive_atk * 0.01)
return n
end
def base_pdef
ps = Passive_Skills
n = leon_passiveskills_gameactor_basepdef
n = n + (n * @passive_pdef * 0.01)
return n
end
def base_mdef
ps = Passive_Skills
n = leon_passiveskills_gameactor_basemdef
n = n + (n * @passive_mdef * 0.01)
return n
end
end
#===============================================================================
# END Game_Actor
#===============================================================================
#===============================================================================
# Window_Skill
#===============================================================================
class Window_Skill
def refresh
if self.contents != nil
self.contents.dispose
self.contents = nil
end
@data = []
for i in 0...@actor.skills.size
skill = $data_skills[@actor.skills[i]]
#-----------------------------------------------------------------
# Added 3 Lines right here:
# if $game_temp.in_battle
# ps = Passive_Skills
# unless ps::Passive_Skills.keys.include?(skill)
# ----------------------------------------------------------------
if $game_temp.in_battle
ps = Passive_Skills
unless ps::Passive_Skills.keys.include?(skill.id)
if skill != nil
@data.push(skill)
end
#-----------------------------------------------------------------
# Added two 'end's right here.
#-----------------------------------------------------------------
end
end
end
@item_max = @data.size
if @item_max > 0
self.contents = Bitmap.new(width - 32, row_max * 32)
self.contents.font.name = $defaultfonttype # "Skill" window font
self.contents.font.size = $defaultfontsize
for i in 0...@item_max
draw_item(i)
end
end
end
end
#===============================================================================
# End Window_Skill
#===============================================================================