Advertiser Content

Scripting Question Need help updating Destiny Bond

Started by DonutDoctor10 August 30th, 2019 3:30 PM
  • 1003 views
  • 12 replies
Seen 1 Week Ago
Posted 1 Week Ago
19 posts
98 Days
Does anyone know how to make it so Destiny Bond will fail when it's used twice in a row (like in Gen 7)?
I've tried scripting it myself, but I ran into an issue where once it failed, it would fail for the rest of the battle.
If anyone could help me, that would be great.

By the way, here's my failed attempt at scripting it.

class PokeBattle_Move_0E7 < PokeBattle_Move
  def pbEffect(attacker,opponent,hitnum=0,alltargets=nil,showanimation=true)
    if id==attacker.lastMoveUsed && id=186
      @battle.pbDisplay(_INTL("But it failed!"))
      return -1
    end  
    pbShowAnimation(@id,attacker,nil,hitnum,alltargets,showanimation)
    attacker.effects[PBEffects::DestinyBond]=true
    @battle.pbDisplay(_INTL("{1} is trying to take its foe down with it!",attacker.pbThis))
    return 0 
  end  
end

WolfPP

Discord: Wolf#1235

Male
Brazil
Seen 2 Hours Ago
Posted 18 Hours Ago
813 posts
1.2 Years
I think what I made is good:

Into 'PokeBattle_Battler' script, inside 'def pbBeginTurn(choice)', remove:
@effects[PBEffects::DestinyBond]=false
Then, inside 'PokeBattle_MoveEffects', replace Destiny Bond's code for:
################################################################################
# If user is KO'd before it next moves, the battler that caused it also faints.
# (Destiny Bond)
################################################################################
class PokeBattle_Move_0E7 < PokeBattle_Move
  def pbEffect(attacker,opponent,hitnum=0,alltargets=nil,showanimation=true)
    if attacker.effects[PBEffects::DestinyBond]==true
      @battle.pbDisplay(_INTL("But it failed!"))
      return -1
    else
      pbShowAnimation(@id,attacker,opponent,hitnum,alltargets,showanimation)
      attacker.effects[PBEffects::DestinyBond]=true
      @battle.pbDisplay(_INTL("{1} is trying to take its foe down with it!",attacker.pbThis))
      return 0
    end
  end
And I think is done. But need make a upgrade about double battle: if first pokémon uses and then the second one too, will fail. Need to fix that variation.

WolfPP

Discord: Wolf#1235

Male
Brazil
Seen 2 Hours Ago
Posted 18 Hours Ago
813 posts
1.2 Years
Am using v17.2 and works fine to me (double battle included). Check all the steps again. Delete your save file, compile your game while start in debug mode (holding CTRL) and start a new game.

EDIT: TBH IDK how its work lol. If I use and won't die, and try to use again, will fail, right? But if into next turn I die, then the opponent dies too, because I use Destiny Bond previously, right? Or only if I die into the same turn than I use?
Give me right variations/probabilities for that move, please.
Seen 1 Week Ago
Posted 1 Week Ago
19 posts
98 Days
It's ok, i found a way to fix it. What I did was take your script and add [PBEffects::DestinyBond]=false under the "But it failed!" message. Here's what it looks like, in case anyone wants to use it.

class PokeBattle_Move_0E7 < PokeBattle_Move
  def pbEffect(attacker,opponent,hitnum=0,alltargets=nil,showanimation=true)
    if attacker.effects[PBEffects::DestinyBond]==true
      @battle.pbDisplay(_INTL("But it failed!"))
      attacker.effects[PBEffects::DestinyBond]=false
      return -1
    else
      pbShowAnimation(@id,attacker,opponent,hitnum,alltargets,showanimation)
      attacker.effects[PBEffects::DestinyBond]=true
      @battle.pbDisplay(_INTL("{1} is trying to take its foe down with it!",attacker.pbThis))
      return 0
    end
  end
end
Advertiser Content