Oh sorry. It's for Rpg maker XP.Justin Lee":2cfjecjs said:Which engine? I do not really understand your question
Not exactly what I'm trying to accomplish. You see.. I'm using an abs. But one of the enemies on the field is my ally. I need to set the damage he takes to the allies health. So I can have a working four person hud. A random number might work. I'll look into this. I am welcome to any other ideas.Souloux":9ke3vvep said:So you want an attack that does damage to the enemy and self-inflicted damage?
Okay okay. I just didn't want any mod or whatnot to toss my question aside saying it was a scripting question. It's for XAS Abs. viewtopic.php?f=11&t=36855 Initially you can't have Party Members in this ABS. Which is why I use enemies to act like allies instead. And I use pathfinding to make them attack other enemies and enemies to attack them. There's just no possible way I could think of to match an allies health with an enemyUnka Josh":2sji0sf1 said:Ah, the phrase "I'm using an ABS" really should have appeared in your first post.
Ideally, with the actual ABS that you are using.
Because, well, that has a HUGE IMPACT ON WHAT KIND OF SOLUTION COULD WORK.
The idea that I tossed out, for example, will not. Because it's an ABS.
And the actual solution to this problem might very well work differently in different systems.
# Recoil Weapons & Skills
# By SephirothSpawn
Â
module Recoil
 # weapon/skill_id => percent/direct damage
 Weapon_Percent = {}
 Skill_Percent = {}
 Weapon_Direct = {}
 Skill_Direct = {}
end
Â
class RPG::Weapon
 def recoil_percent
  if Recoil::Weapon_Percent.has_key?(@id)
   return Recoil::Weapon_Percent[@id]
  end
  return 0
 end
 def recoil_direct
  if Recoil::Weapon_Direct.has_key?(@id)
   return Recoil::Weapon_Direct[@id]
  end
  return 0
 end
end
Â
class RPG::Skill
 def recoil_percent
  if Recoil::Skill_Percent.has_key?(@id)
   return Recoil::Skill_Percent[@id]
  end
  return 0
 end
 def recoil_direct
  if Recoil::Skill_Direct.has_key?(@id)
   return Recoil::Skill_Direct[@id]
  end
  return 0
 end
end
Â
class Game_Battler
 alias_method :seph_recoildamages_gmbtlr_ae, :attack_effect
 def attack_effect(attacker)
  result = seph_recoildamages_gmbtlr_ae(attacker)
  if result && attacker.is_a?(Game_Actor)
   weapon = attacker.weapon_id
   if weapon != nil
    damage = Integer(self.damage * (weapon.recoil_percent / 100.0))
    damage += weapon.recoil_direct
    if damage > 0
     attacker.damage = damage
     attacker.damage_pop = true
    end
   end
  end
  return result
 end
 alias_method :seph_recoildamage_gmbtlr_se, :skill_effect
 def skill_effect(skill, user)
  result = seph_recoildamages_gmbtlr_se(skill, user)
  if result
   damage = Integer(self.damage * (skill.recoil_percent / 100.0))
   damage += skill.recoil_direct
   if damage > 0
    attacker.damage = damage
    attacker.damage_pop = true
   end
  end
  return result
 end
end