Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- =begin =========================================================================
- Dekita's v1.1
- ★ 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
- 29/12/2o12 - updated some things, information ect..
- 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
- ================================================================================
- NOTETAGS:
- ==========
- <weight: X>
- Where X is the weight for an actor/enemy. (can and SHOULD be a float value)
- <gender: X>
- Where X is the percentage chance for a male actor. (can be a float value)
- <species: X>
- Where X is the ID number for the species, defined below.
- <legendary>
- just give this notetag to a legendary actor / enemy.
- this will make it a legendary "pokemon"
- <gen id: X>
- X = 1 - 5
- this determines the generation id
- 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. Types are defined below.
- <type: TYPE_ID>
- use this notetag for skills, ( they can have only one type )
- ================================================================================
- SCRIPT CALLS:
- ==============
- $game_party.add_pokemon(actor_id, level)
- actor_id = the id of the actor in the database,
- level = the level of the actor.
- This gives you a pokemon (cloned actor)...
- $game_party.ACTIVITY = B00L
- replace "ACTIVITY" with " fishing " OR " diving " OR " surfing " OR " in_cave "
- replace "B00L" with true or false
- eg. $game_party.fishing = true , $game_party.in_cave = false
- This is for certain pokeball effects.
- there is also
- $game_system.night_time = B00L
- this obviously determines "night time" for certain scripts, e.g pokeball effects
- only use this if you are NOT using my realtime effects script.
- party_has_pokemon?(poke_id)
- poke_id = the id of the actor you are checking for.
- you must use this because each time a new "pokemon"(actor) is added into the
- party it is cloned, therefor the standard method for checking if an actor is in
- the party does not work. use this for things like conditional branch checks.
- change_desc(text)
- This will change the description for $game_party.members[0] (i count them as
- the main trainer). this is only visible in certain scripts i write.
- =end #==========================================================================#
- module Dekita__Pokémon_CORE
- Main_Pokeball_Item_id = 1 # The id of your main pokeball item
- # this can be found in the database.
- # this is so that the game know's what a basic pokeball is, this determines
- # the initial pokeball that each pokemon is "stored" in.
- p "Loaded : Pokemon Core"
- end ; module PkMn_Types
- 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"
- # Add more lines like this .. Types[ID] = ["INFO"]
- Species = []
- Species[0] = ["Mouse"]
- Species[1] = ["Bird"]
- Species[2] = ["Dinosaur"]
- Species[3] = ["Jelly"]
- Species[4] = ["Fish thing ^_^"]
- # Add more lines like this .. Species[ID] = ["INFO"]
- # i obviously havent finished the pokemon species yet, feel free to not use
- # this feature until i do :p
- end #####################
- # CUSTOMISATION END #
- #####################
- #===============================================================================#
- #☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★#
- # #
- # http://dekitarpg.wordpress.com/ #
- # #
- #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆#
- #===============================================================================#
- # ARE YOU MODIFYING BEYOND THIS POINT? \.\. #
- # YES?\.\. #
- # OMG, REALLY? \| #
- # WELL SLAP MY FACE AND CALL ME A DITTO.\..\.. #
- # I REALLY DIDN'T THINK YOU HAD IT IN YOU.\..\.. #
- #===============================================================================#
- $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
- 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
- def load_Poké_CORE
- @pokemon_database_id = @id
- @type = [nil , nil]
- @gender_ratio = [nil]
- @species = 0
- @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 = PkMn_Types::Species[$1.to_i]
- #---
- 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 :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 = 0
- @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 = PkMn_Types::Species[$1.to_i]
- #---
- 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_accessor :capt_inf
- attr_reader :pokemon_database_id # origional db id
- attr_reader :real_game_id # new game 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 :t_desc
- 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
- setup_capture_data
- @t_desc = actor.description
- 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
- def setup_capture_data
- day = Time.now.strftime("%d")
- month = Time.now.strftime("%B")
- year = Time.now.strftime("%Y")
- time = "#{Time.now.strftime("%H")}:#{Time.now.strftime("%M")}"
- map = $BTEST ? "" : $game_map.display_name
- lv = @level
- ot = ""
- id_no = 0
- @capt_inf = [day, month, year, time, map, lv, ot, id_no]
- 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
- 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
- _GA.capt_inf[6] = $game_party.members[0].name
- _GA.capt_inf[7] = $game_party.members[0].trainer_id
- $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
- def get_pokeball_aftermod(actor_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
- def change_desc(text)
- $game_party.members[0].t_desc = text
- end
- end
- #==============================================================================
- class Window_Base < Window
- #==============================================================================
- # Method to Draw a Gauge with height
- def draw_gauge_DPBz(dx, dy, dw, dh, rate, color1, color2)
- empty_gauge_color = Color.new(111,111,111,0)
- fill_w = [(dw * rate).to_i, dw].min
- gauge_h = dh
- gauge_y = dy + line_height - 2 - gauge_h
- contents.fill_rect(dx, gauge_y, dw, gauge_h, empty_gauge_color)
- contents.gradient_fill_rect(dx, gauge_y, fill_w, gauge_h, color1, color2)
- end
- end # Window_Base < Window
- #===============================================================================#
- # - SCRIPT END - #
- #===============================================================================#
- # http://dekitarpg.wordpress.com/ #
- #===============================================================================#
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement