Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- =begin
- #==============================================================================
- ** Effect: Simple Pet
- Author: Estriole
- Date: 14 Jan 2013
- ------------------------------------------------------------------------------
- ** Change log
- 2013-01-14
- - initial release
- ------------------------------------------------------------------------------
- ** Terms of Use
- * Free to use in commercial/non-commercial projects
- * No real support. The script is provided as-is
- * Will do bug fixes, but no compatibility patches
- * Features may be requested but no guarantees, especially if it is non-trivial
- * Preserve this header
- ------------------------------------------------------------------------------
- Requires
- - Tsukihime Effect Manager 2.6
- - Yanfly Equip Engine
- Create your armor : equipment type accessory
- Tag your armors with
- <equip type: Pet>
- <eff: simple_pet x>
- Where x is the id of actor that acting as pet.
- Give it name: example:
- "Natalie Lv - " it will shown as: "Natalie Lv - x" (x -> natalie level)
- then tag your actor (not the pet one) with notetags to allow him to equip Pet.
- don't add Pet as default equip type. since pet will be able to equip another pet
- and that will become trouble.
- Compatibility
- not compatible with yanfly command equip. it turn out error.
- #==============================================================================
- =end
- $imported = {} if $imported.nil?
- $imported["Effect_Simple_Pet"] = true
- #==============================================================================
- # ** Rest of the script
- #==============================================================================
- module Effect
- module Simple_Pet
- Effect_Manager.register_effect(:simple_pet)
- EQUIP_TYPE = 10
- #CHANGE ABOVE TO NEW ID IF THAT ID ALREADY USED
- YEA::EQUIP::TYPES[EQUIP_TYPE]=[ "Pet", true, false]
- end
- end
- class Game_Battler < Game_BattlerBase
- def armor_effect_simple_pet_equip(user, effect)
- end
- def armor_effect_simple_pet_unequip(user, effect)
- end
- end
- class Game_Actor < Game_Battler
- def armor_effect_simple_pet_equip(user, effect)
- pet_id = effect.value1[0].to_i
- $game_party.add_actor(pet_id)
- @result.effect_results.push("%s takes out %s!" %[user.name, $game_actors[pet_id].name])
- @result.success = true
- end
- def armor_effect_simple_pet_unequip(user, effect)
- pet_id = effect.value1[0].to_i
- $game_party.remove_actor(pet_id)
- @result.effect_results.push("%s returns!" %[$game_actors[pet_id].name])
- @result.success = true
- end
- end
- class RPG::EquipItem < RPG::BaseItem
- def linked_actor
- if @linked_actor.nil?
- if @note =~ /<eff: simple_pet (.*)>/i
- @linked_actor = $1.to_i
- else
- @linked_actor = nil
- end
- end
- @linked_actor
- end
- end
- class Window_Base < Window
- alias draw_pet_lv_draw_item_name draw_item_name
- def draw_item_name(item, x, y, enabled = true, width = 172)
- return unless item
- if item.is_a?(RPG::EquipItem) && item.linked_actor
- draw_icon(item.icon_index, x, y, enabled)
- change_color(normal_color, enabled)
- text = item.name
- text += $game_actors[item.linked_actor].level.to_s
- draw_text(x + 24, y, width, line_height, text)
- else
- draw_pet_lv_draw_item_name(item, x, y, enabled = true, width = 172)
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment