Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- =begin =========================================================================
- Dekita's v1.0
- ★ Pokémon CORE™ ★
- ================================================================================
- Script Information:
- ====================
- This is simply a "core" script to house some things ill need for some other
- pokemon related scripts i will do.
- The following scripts require this and should be placed below this script.
- Pokemon Capture,
- Pokemon Evolution,
- This script creates the following features
- ACTORS: (and enemies)
- weight,
- gender,
- types,
- species,
- generation_id,
- legendary,
- ================================================================================
- ★☆★☆★☆★☆★☆★☆★☆★ 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
- 24/12/2o12 - released beta version,
- 13/11/2012 - started,
- ================================================================================
- 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.
- Place this above other pokemon scripts i have written
- =end #==========================================================================#
- module Dekita__Pokémon_CORE
- # NOTETAG LIST :~
- # <weight: X>
- # <gender: X>
- # Where X is the percentage chance for a male actor. (can be a float value)
- # <species: X>
- # <legendary>
- # just give this notetag to a legendary enemy.
- # <gen id: X>
- # X = 1 - 5
- Main_Pokeball_Item_id = 1 # The id of your main pokeball item
- # this can be found in the database.
- p "Loaded : Pokemon Core"
- end
- module PkMn_Types
- # These are the id tags for each type, use the notetag like this...
- # <type: TYPE_ONE, TYPE_TWO>
- # replace TYPE_ONE and TYPE_TWO with the id number for the type you want..
- # e.g if you want water and dark type it would be
- # <type: 3, 16>
- # if you only want one type put "nil" in place of the id number... like so...
- # <type: 3, nil>
- # This notetag is for actors && enemies
- # PLEASE NOTE YOU !> MUST <! PUT IN THE TYPES IN ORDER E.G <type: 16, 3>
- # WOULD NOT BE ACCEPTED !!
- # <type: TYPE_ID>
- # use this notetag for skills, ( they can have only one type )
- Types = []
- # DO NOT USE "Types[0]"
- Types[1] = "Normal"
- Types[2] = "Fire"
- Types[3] = "Water"
- Types[4] = "Electric"
- Types[5] = "Grass"
- Types[6] = "Ice"
- Types[7] = "Fighting"
- Types[8] = "Poison"
- Types[9] = "Ground"
- Types[10]= "Flying"
- Types[11]= "Psychic"
- Types[12]= "Bug"
- Types[13]= "Rock"
- Types[14]= "Ghost"
- Types[15]= "Dragon"
- Types[16]= "Dark"
- Types[17]= "Steel"
- # End Types Config.
- end
- $imported = {} if $imported.nil?
- $imported[:Dekita__Pokémon_CORE] = true
- #==============================================================================
- module DataManager
- #==============================================================================
- class <<self; alias load_database_Poké_CORE load_database; end
- def self.load_database
- load_database_Poké_CORE
- load_Poké_CORE
- end
- def self.load_Poké_CORE
- groups = [$data_actors, $data_enemies, $data_skills]
- for group in groups
- for obj in group
- next if obj.nil?
- obj.load_Poké_CORE
- end
- end
- end
- end # DataManager
- #==============================================================================
- class RPG::UsableItem < RPG::BaseItem
- #==============================================================================
- attr_accessor :type
- def load_Poké_CORE
- @type = [nil , nil]
- load_Poké_CORE_Notes
- end
- def load_Poké_CORE_Notes
- # @type = [0, 0]
- self.note.split(/[\r\n]+/).each { |line|
- case line
- when /<type: (.*)>/i
- @type = [PkMn_Types::Types[$1.to_i], nil]
- #---
- when /<type: (.*), (.*)>/i
- @type = [PkMn_Types::Types[$1.to_i], PkMn_Types::Types[$2.to_i]]
- #---
- end
- } # self.note.split
- #---
- end
- end
- #==============================================================================
- class RPG::Actor < RPG::BaseItem
- #==============================================================================
- attr_accessor :pokemon_database_id
- attr_accessor :gender_ratio
- attr_accessor :type
- attr_accessor :species
- attr_accessor :weight
- attr_accessor :legendary
- attr_accessor :generation_id
- #attr_accessor :pokemons_pokeball
- def load_Poké_CORE
- @pokemon_database_id = @id
- @type = [nil , nil]
- @gender_ratio = [nil]
- @species = ""
- @weight = 0.0
- @legendary = false
- @generation_id = nil
- # @pokemons_pokeball = $data_items[Dekita__Pokémon_CORE::Main_Pokeball_Item_id].name
- load_Poké_CORE_Notes
- end
- def load_Poké_CORE_Notes
- self.note.split(/[\r\n]+/).each { |line|
- case line
- when /<gender: (.*)>/i
- @gender_ratio[0] = $1.to_f
- #---
- when /<weight: (.*)>/i
- @weight = $1.to_f
- #---
- when /<species: (.*)>/i
- @species = $1.to_s
- #---
- when /<legendary>/i
- @legendary = true
- #---
- when /<gen id: (.*)>/i
- @generation_id = $1.to_i
- #---
- when /<type: (.*), (.*)>/i
- @type = [PkMn_Types::Types[$1.to_i], PkMn_Types::Types[$2.to_i]]
- #---
- end
- } # self.note.split
- #---
- end
- end # RPG::Actor
- #==============================================================================
- class RPG::Enemy < RPG::BaseItem
- #==============================================================================
- #attr_accessor :pokemon_id
- #attr_accessor :catch_rate
- #attr_accessor :pokemon_database_id
- attr_accessor :gender
- attr_accessor :type
- attr_accessor :species
- attr_accessor :weight
- attr_accessor :legendary
- attr_accessor :generation_id
- def load_Poké_CORE
- @pokemon_database_id = @id
- @type = [nil , nil]
- @gender = [nil]
- @species = ""
- @weight = 0.0
- @legendary = false
- @generation_id = nil
- load_Poké_CORE_Notes
- end
- def load_Poké_CORE_Notes
- self.note.split(/[\r\n]+/).each { |line|
- case line
- when /<gender: (.*)>/i
- @gender_ratio[0] = $1.to_f
- #---
- when /<weight: (.*)>/i
- @weight = $1.to_f
- #---
- when /<species: (.*)>/i
- @species = $1.to_s
- #---
- when /<legendary>/i
- @legendary = true
- #---
- when /<gen id: (.*)>/i
- @generation_id = $1.to_i
- #---
- when /<type: (.*), (.*)>/i
- @type = [PkMn_Types::Types[$1.to_i], PkMn_Types::Types[$2.to_i]]
- #---
- end
- } # self.note.split
- #---
- end
- end # RPG::Enemy
- #==============================================================================
- class Game_Actor < Game_Battler
- #==============================================================================
- attr_accessor :pokemons_pokeball
- attr_accessor :pokemon_captured
- attr_accessor :pokemon_team
- attr_reader :pokemon_database_id
- attr_reader :gender
- attr_reader :type
- attr_reader :species
- attr_reader :weight
- attr_reader :legendary
- attr_reader :generation_id
- attr_reader :trainer_id
- attr_reader :real_game_id
- alias Poké_CORE_A_GO_GO setup
- def setup(actor_id)
- Poké_CORE_A_GO_GO(actor_id)
- setup_pokemon_system_by_Dekita_RPG
- end
- def setup_pokemon_system_by_Dekita_RPG
- @pokemon_database_id = actor.pokemon_database_id
- @gender = get_unique_gender
- @species = actor.species
- @weight = actor.weight
- @type = actor.type
- @legendary = actor.legendary
- @generation_id = actor.generation_id
- @trainer_id = rand(999_99)
- @pokemons_pokeball = $data_items[Dekita__Pokémon_CORE::Main_Pokeball_Item_id]
- @real_game_id = actor.id
- @pokemon_captured = 0
- init_poketeam
- end
- def get_unique_gender
- sex = rand(100+1)
- g = actor.gender_ratio
- return "" if g[0].nil?
- sex <= g[0] ? @gender = "male" : @gender = "female"
- end
- def init_poketeam
- @pokemon_team = []# * 6
- end
- def add_pokemon_into_team(pokemon)
- if @pokemon_team.size <= 5
- @pokemon_team.push($game_actors[pokemon])
- else
- end
- new_poke = gained_new_pokemon?($game_actors[pokemon].pokemon_database_id)
- @pokemon_captured += 1 if new_poke
- end
- def remove_pokemon_from_team(pokemon)
- @pokemon_team.delete_at(pokemon)
- end
- def gained_new_pokemon?(poke_id)
- istrue = 0
- $game_party.members.size.times{|i|
- istrue += 1 if $game_party.members[i].pokemon_database_id == poke_id
- }
- return false if istrue > 1
- return true
- end
- end
- #===============================================================================#
- class Game_Enemy < Game_Battler
- #===============================================================================#
- # attr_reader :gender
- # attr_reader :species
- # attr_reader :weight
- # attr_reader :type
- # attr_reader :legendary
- # attr_reader :generation_id
- attr_accessor :gender
- attr_accessor :type
- attr_accessor :species
- attr_accessor :weight
- attr_accessor :legendary
- attr_accessor :generation_id
- alias genderinitfoene initialize
- def initialize(index, enemy_id)
- genderinitfoene(index, enemy_id)
- dekita_pokemon_core_script_enemy_init(enemy_id)
- end
- def dekita_pokemon_core_script_enemy_init(enemy_id)
- @gender = get_unique_gender
- @species = $data_enemies[enemy_id].species
- @weight = $data_enemies[enemy_id].weight
- @type = $data_enemies[enemy_id].type
- @legendary = $data_enemies[enemy_id].legendary
- @generation_id = $data_enemies[enemy_id].generation_id
- end
- def get_unique_gender
- sex = rand(100+1)
- g = $data_enemies[enemy_id].gender
- return "" if g[0].nil?
- sex <= g[0] ? @gender = "male" : @gender = "female"
- end
- end
- #==============================================================================
- class Game_System
- #==============================================================================
- attr_accessor :night_time
- alias :init_for_the_shit_of_it :initialize
- def initialize
- init_for_the_shit_of_it
- @night_time = false
- end
- end
- #==============================================================================
- class Game_Party < Game_Unit
- #==============================================================================
- attr_accessor :fishing
- attr_accessor :diving
- attr_accessor :surfing
- attr_accessor :in_cave
- alias fishinginitforpoek initialize
- def initialize
- fishinginitforpoek
- @fishing = false
- @diving = false
- @surfing = false
- @in_cave = false
- end
- def add_pokemon(actor_id, level)
- new_actor = $data_actors[actor_id].clone
- new_actor.id = $data_actors.size
- $data_actors.push(new_actor)
- @actors.push(new_actor.id) unless @actors.include?(new_actor.id)
- $game_player.refresh
- $game_map.need_refresh = true
- get_initial_stats(new_actor.id, level)
- get_pokeball_aftermod(new_actor.id)
- end
- def get_initial_stats(actor_id, level)
- _GA = $game_actors[actor_id]
- _GA.change_level(level, false)
- _GA.recover_all
- _GA.capt_inf[5] = _GA.level
- $game_party.members[0].add_pokemon_into_team(actor_id)
- end
- def remove_pokemon(poke_id)
- $game_party.members[0].remove_pokemon_from_team(poke_id)
- end
- end
- #==============================================================================
- class Game_Interpreter
- #==============================================================================
- def party_has_pokemon?(poke_id)
- istrue = 0
- $game_party.members.size.times{|i|
- istrue += 1 if $game_party.members[i].pokemon_database_id == poke_id
- }
- return true if istrue > 0
- return false
- end
- end
- #===============================================================================#
- # - SCRIPT END - #
- #===============================================================================#
- # http://dekitarpg.wordpress.com/ #
- #===============================================================================#
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement