Here's a script I made that simulates this. It defines a class (Game_ActorEnemy) that derives from Game_Actor and describes enemies with the characteristics of actors. The trick here is that when a new enemy is created, it actually returns a Game_ActorEnemy object, instead of a Game_Enemy object (look at the bottom of the script). Thus, the enemy object would have the same methods that actors have (for example, "weapons", "equips", "skills", and so on.)
Put the script below all others in the Materials section of the script editor. Look at the bottom of the script for ACTORENEMIES, where you can see how to customize it.
The code is below. Please notify me if there are errors.
class Game_ActorEnemy < Game_Actor
attr_reader :index # index in troop
attr_reader :enemy_id # enemy ID
attr_reader :original_name # original name
attr_accessor :letter # letters to be attached to the name
attr_accessor :plural # multiple appearance flag
attr_accessor :screen_x # battle screen X coordinate
attr_accessor :screen_y # battle screen Y coordinate
def is_a?(cls)
return true if cls==Game_ActorEnemy
return true if cls==Game_Enemy
return super.is_a?(cls)
end
def kind_of?(cls)
return true if cls==Game_ActorEnemy
return true if cls==Game_Enemy
return super.kind_of?(cls)
end
def actor?; return false; end
def name
if @plural
return @original_name + letter
else
return @original_name
end
end
def initialize(index, enemy_id, actor_id)
super(actor_id)
@enemy_id=enemy_id
@index=index
enemy = $data_enemies[@enemy_id]
@original_name = enemy.name
@letter = ''
@plural = false
@screen_x = 0
@screen_y = 0
@battler_name = enemy.battler_name
@battler_hue = enemy.battler_hue
@hp = maxhp
@mp = maxmp
end
def enemy
return $data_enemies[@enemy_id]
end
def exp
return enemy.exp
end
def gold
return enemy.gold
end
def drop_item1
return enemy.drop_item1
end
def drop_item2
return enemy.drop_item2
end
def use_sprite?
return true
end
def screen_z
return 100
end
def perform_collapse
if $game_temp.in_battle and dead?
@collapse = true
Sound.play_enemy_collapse
end
end
def escape
@hidden = true
@action.clear
end
def transform(enemy_id)
@enemy_id = enemy_id
if enemy.name != @original_name
@original_name = enemy.name
@letter = ''
@plural = false
end
@battler_name = enemy.battler_name
@battler_hue = enemy.battler_hue
make_action
end
def conditions_met?(action)
case action.condition_type
when 1 # Number of turns
n = $game_troop.turn_count
a = action.condition_param1
b = action.condition_param2
return false if (b == 0 and n != a)
return false if (b > 0 and (n < 1 or n < a or n % b != a % b))
when 2 # HP
hp_rate = hp * 100.0 / maxhp
return false if hp_rate < action.condition_param1
return false if hp_rate > action.condition_param2
when 3 # MP
mp_rate = mp * 100.0 / maxmp
return false if mp_rate < action.condition_param1
return false if mp_rate > action.condition_param2
when 4 # State
return false unless state?(action.condition_param1)
when 5 # Party level
return false if $game_party.max_level < action.condition_param1
when 6 # Switch
switch_id = action.condition_param1
return false if $game_switches[switch_id] == false
end
return true
end
def make_action
@action.clear
return unless movable?
available_actions = []
rating_max = 0
for action in enemy.actions
next unless conditions_met?(action)
if action.kind == 1
next unless skill_can_use?($data_skills[action.skill_id])
end
available_actions.push(action)
rating_max = [rating_max, action.rating].max
end
for skill in skills
next unless $game_troop.turn_count>=3
next unless skill_can_use?(skill)
available_actions.push(action)
action=RPG::Enemy::Action.new
action.kind=1
action.skill_id=skill.id
action.rating=1
rating_max = [rating_max, action.rating].max
end
ratings_total = 0
rating_zero = rating_max - 3
for action in available_actions
next if action.rating <= rating_zero
ratings_total += action.rating - rating_zero
end
return if ratings_total == 0
value = rand(ratings_total)
for action in available_actions
next if action.rating <= rating_zero
if value < action.rating - rating_zero
@action.kind = action.kind
@action.basic = action.basic
@action.skill_id = action.skill_id
@action.decide_random_target
return
else
value -= action.rating - rating_zero
end
end
end
end
class Game_Enemy
########################
ACTORENEMIES={
# Enemy ID => Actor ID
20=>1,
21=>2,
22=>3
}
#########################
class << self
alias petero_actorenemy_Game_Enemy_new new
def new(index, enemy_id)
if ACTORENEMIES[enemy_id]
return Game_ActorEnemy.new(index,enemy_id,ACTORENEMIES[enemy_id])
end
return petero_actorenemy_Game_Enemy_new(index,enemy_id)
end
end
end