Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- =begin =========================================================================
- Dekita's v1.1
- ★ Pokémon Shinies™ ★
- ================================================================================
- Script Information:
- ====================
- This script replicates the shiny feature from pokemon, e.g each pokemon,
- (in this case actors/enemies) can randomly be a shiny ( more rare ) version
- of that actor/enemy, in pokemon its only the actors/enemies
- graphics that change, but i have included extra options...
- ================================================================================
- ★☆★☆★☆★☆★☆★☆★☆★ TERMS AND CONDITIONS: ☆★☆★☆★☆★☆★☆★☆★☆★☆
- ================================================================================
- 1. You must give credit to "Dekita"
- 2. You are NOT allowed to repost this script.(or modified versions)
- 3. You are NOT allowed to convert this script.(into other game engines e.g RGSS2)
- 4. You are NOT allowed to use this script for Commercial games.
- 5. ENJOY!
- "FINE PRINT"
- By using this script you hereby agree to the above terms and conditions,
- if any violation of the above terms occurs "legal action" may be taken.
- Not understanding the above terms and conditions does NOT mean that
- they do not apply to you.
- If you wish to discuss the terms and conditions in further detail you can
- contact me at http://dekitarpg.wordpress.com/ or DekitaRPG@gmail.com
- ================================================================================
- History:
- =========
- D /M /Y
- 17/11/2o12 - added enemy shiny nature's
- 13/11/2o12 - started and finished,
- ================================================================================
- Credit and Thanks to :
- =======================
- ================================================================================
- Known Bugs:
- ============
- N/A
- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
- If a new bug is found please contact me at
- http://dekitarpg.wordpress.com/
- ================================================================================
- INSTRUCTIONS:
- ==============
- Place this script UNDER "▼ Materials" and ABOVE "▼ Main" in your script editor.
- ================================================================================
- Notetags:
- ==========
- ACTOR NOTETAGS:
- <shiny char name: STRING>
- <shiny char index: INDEX>
- <shiny face name: STRING>
- <shiny face index: INDEX>
- STIRNG = the name of the file in either the Graphics/characters or
- Graphics/faces folders #################
- # 0 | 1 | 2 | 3 #
- INDEX = the index of the file graphic ( 0 - 7 ) #---+---+---+---#
- # 4 | 5 | 6 | 7 #
- #################
- ENEMY NOTETAGS:
- <shiny graphic: STRING>
- <shiny hue: VALUE>
- STRING = the name of the enemy graphic in the Graphics/Battlers folder
- VALUE = a value between 0 - 360
- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
- Examples:
- Actor:~
- <shiny char name: $bulbasaur shiny>
- <shiny char index: 0>
- <shiny face name: $bulbasaur shiny face>
- <shiny face index: 0>
- Enemy:~
- <shiny graphic: Bat>
- <shiny hue: 180>
- =end #==========================================================================#
- module Dekita__Pokemon_Shinies
- # you will have a 1 in Shiny_Chance, chance for an actor to be a shiny upon
- # entering the party
- Shiny_Chance = 8192
- # If you are using the actor natures, iv's and ev's script you can
- # make your shinies have a chance at gaining a shiny only nature
- Shiny_Nature = []# <- DO NOT DELETE.
- # Make this false if you do not want to have shiny natures.
- Use_Shiny_Natures = true
- Shiny_Nature_Chance = 100 # 100 = 100% chance
- # NOTE: nature multipliers are percentage values, this means that
- # 1.1 = 110% 0.9 = 90% 0.01 = 1%
- # 1 is the default, any stats you do not want modified make sure they are 1.
- #Shiny_Nature[id]=[ Name, mhp, mmp, atk, def, mat, mdf, agi, luk]
- Shiny_Nature[0] = ["Epic 1", 1.2, 1.2, 1, 1.2, 1, 1.2, 1, 1]
- Shiny_Nature[1] = ["Epic 2", 1, 1, 1.2, 1, 1.2, 1, 1.2, 1.2]
- Shiny_Nature[2] = ["Epic 3", 1.1, 1.1, 1.1, 1.1, 1.1, 1.1, 1.1, 1.1]
- Shiny_Nature[3] = ["Epic 4", 1.4, 1, 1.2, 1.2, 1, 1, 1, 1]
- end
- $imported = {} if $imported.nil?
- $imported[:Dekita_Pokémon_Shinies] = true
- #==============================================================================
- module DataManager
- #==============================================================================
- class <<self; alias load_database_SHINIES load_database; end
- def self.load_database
- load_database_SHINIES
- load_SHINIES
- end
- def self.load_SHINIES
- groups = [$data_actors, $data_enemies]
- for group in groups
- for obj in group
- next if obj.nil?
- obj.load_SHINIES
- end
- end
- end
- end # DataManager
- #==============================================================================
- class RPG::Actor < RPG::BaseItem
- #==============================================================================
- attr_accessor :shiny_char_name
- attr_accessor :shiny_char_index
- attr_accessor :shiny_face_name
- attr_accessor :shiny_face_index
- def load_SHINIES
- @shiny_char_name = @character_name
- @shiny_char_index = @character_index
- @shiny_face_name = @face_name
- @shiny_face_index = @face_index
- self.note.split(/[\r\n]+/).each { |line|
- case line
- when /<shiny char name: (.*)>/i
- @shiny_char_name = $1.to_s
- #---
- when /<shiny char index: (.*)>/i
- @shiny_char_index = $1.to_i
- #---
- when /<shiny face name: (.*)>/i
- @shiny_face_name = $1.to_s
- #---
- when /<shiny face index: (.*)>/i
- @shiny_face_index = $1.to_i
- #---
- end
- } # self.note.split
- end
- end
- #==============================================================================
- class RPG::Enemy < RPG::BaseItem
- #==============================================================================
- attr_accessor :shiny_image
- attr_accessor :shiny_hue
- def load_SHINIES
- @shiny_image = @battler_name
- @shiny_hue = @battler_hue
- self.note.split(/[\r\n]+/).each { |line|
- case line
- when /<shiny graphic: (.*)>/i
- @shiny_image = $1.to_s
- #---
- when /<shiny hue: (.*)>/i
- @shiny_hue = $1.to_i
- #---
- end
- } # self.note.split
- end
- end
- #===============================================================================#
- class Game_Temp
- #===============================================================================#
- attr_accessor :fix_nature_battle_SHINY
- attr_accessor :fix_battle_SHINY
- alias pokenemylvsgt_SHINYinit initialize
- def initialize
- pokenemylvsgt_SHINYinit
- init_fixed__SHINY_info
- end
- def init_fixed__SHINY_info
- @fix_nature_battle_SHINY = [false, 0]
- @fix_battle_SHINY = [false]
- end
- def clear_fixed_nature_data_SHINY
- @fix_nature_battle_SHINY = [false, 0, 0]
- end
- def clear_fixed_data_SHINY
- @fix_battle_SHINY = [false]
- end
- end # Game_Temp
- #==============================================================================
- class Game_Actor < Game_Battler
- #==============================================================================
- attr_reader :shiny
- alias Poké_SHINIES_A_GO_GO setup
- def setup(actor_id)
- Poké_SHINIES_A_GO_GO(actor_id)
- @shiny = is_a_shiny
- recover_all
- end
- def is_a_shiny
- value = rand(Dekita__Pokemon_Shinies::Shiny_Chance+1)
- if value == 1
- setup_shiny
- return true
- else
- return false
- end
- end
- def setup_shiny
- charname = actor.shiny_char_name
- charindex = actor.shiny_char_index
- facename = actor.shiny_face_name
- faceindex = actor.shiny_face_index
- set_graphic(charname, charindex, facename, faceindex)
- @nature = get_shinies_nature if Dekita__Pokemon_Shinies::Use_Shiny_Natures
- end
- def get_shinies_nature
- return unless $imported[:Dekita_Pokémon_Natures]
- randomness = (1 + rand(100))
- return if randomness > Dekita__Pokemon_Shinies::Shiny_Nature_Chance
- dnar = (Dekita__Pokemon_Shinies::Shiny_Nature.size)
- val = rand(dnar)
- p "Got Rare nature #{Dekita__Pokemon_Shinies::Shiny_Nature[val][0]}"
- return Dekita__Pokemon_Shinies::Shiny_Nature[val]
- end
- end
- #===============================================================================#
- class Game_Enemy < Game_Battler
- #===============================================================================#
- alias init_for_enemy_shiny initialize
- def initialize(index, enemy_id)
- init_for_enemy_shiny(index, enemy_id)
- @shiny = get_shiny?
- end
- def is_shiny?
- return true if @shiny
- return false
- end
- def get_shiny?
- value = rand(Dekita__Pokemon_Shinies::Shiny_Chance+1)
- if value == 1
- setup_shiny
- return true
- else
- return false
- end
- end
- def setup_shiny
- @battler_name = enemy.shiny_image
- @battler_hue = enemy.shiny_hue
- @nature = get_shinies_nature if Dekita__Pokemon_Shinies::Use_Shiny_Natures
- end
- def get_shinies_nature
- return unless $imported[:Dekita_Pokémon_Enemies]
- randomness = (1 + rand(100))
- return if randomness > Dekita__Pokemon_Shinies::Shiny_Nature_Chance
- dnar = (Dekita__Pokemon_Shinies::Shiny_Nature.size)
- val = rand(dnar)
- p "Got Rare nature #{Dekita__Pokemon_Shinies::Shiny_Nature[val][0]}"
- return Dekita__Pokemon_Shinies::Shiny_Nature[val]
- end
- end # Game_Enemy < Game_Battler
- #==============================================================================
- class Game_Interpreter
- #==============================================================================
- def fix_shiny_battle(val)
- $game_temp.fixed_level_battle[0] = true
- $game_temp.fixed_level_battle[1] = val
- end
- def fix_nature_battle(val)
- $game_temp.fixed_nature_battle[0] = true
- $game_temp.fixed_nature_battle[1] = val
- end
- end # Game_Interpreter
- #===============================================================================#
- # - SCRIPT END - #
- #===============================================================================#
- # http://dekitarpg.wordpress.com/ #
- #===============================================================================#
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement