1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Guest, PO has ceased our separate tiering and adopted Smogon tiers for SM. More information and updates here.

    Dismiss Notice

Custom Swift-like moves

Discussion in 'Implemented' started by Isa, Apr 27, 2012.

  1. Isa

    Isa Well-Known Tauros

    Joined:
    Dec 11, 2011
    Messages:
    936
    Likes Received:
    1,006
    PO Trainer Name:
    Isa
    The source code currently looks like this in battle.cpp:
    Code (text):
    1.  
    2.     //No Guard, as wall as Mimic, Transform & Swift in Gen 1.
    3.     if ((hasWorkingAbility(player, Ability::NoGuard) || hasWorkingAbility(target, Ability::NoGuard)) || (gen() == 1 && (move == Move::Swift || move == Move::Mimic
    4.                                                                                                                         || move == Move::Transform))) {
    5.         return true;
    6.     }
    7.  
    8.     if (turnMemory(target).contains("EvadeAttack")) {
    9.         if (!silent) {
    10.             notifyMiss(multiTar, player, target);
    11.         }
    12.         return false;
    13.     }
    14.  
    15.     if (acc == 0 || acc == 101 ||
    16.             (pokeMemory(target).value("LevitatedCount").toInt() > 0 &&
    17.              !MoveInfo::isOHKO(move, gen()))) {
    18.         return true;
    What this means is that currently the Gen 1-moves Swift, Transform and Mimic (but not Bide, which also goes into this category of always-hitting moves) as well as Pokémon with No Guard will hit a user that has used Fly, Dig or any other variation of the move. After this, the check to make the users of Fly, Dig etc. invulnerable goes through, and after this, a check to guarantee that a move like Reflect, Swords Dance etc. always will hit. However, if I want to make a move - let's say Surf - always hit the foe even when he is flying, that is currently impossible because the "101 accuracy" check is placed after the Fly check, so to speak.

    My suggestion is to either change the order of the EvadeAttack and the Acc=101 checks, or add an identical copy of the Acc=101 check in front of the EvadeAttack check, with the difference being that this check searches for the number 102. This would allow us to create Swift-like moves at free will.
     
  2. Fuzzysqurl

    Fuzzysqurl baa baa mareep I do what I want Server Owner Developer I do what I want Server Owner Developer

    Joined:
    Sep 12, 2012
    Messages:
    2,096
    Likes Received:
    967
    Done, a few years late but hey, you still love me right @Isa ?
     
  3. Isa

    Isa Well-Known Tauros

    Joined:
    Dec 11, 2011
    Messages:
    936
    Likes Received:
    1,006
    PO Trainer Name:
    Isa
    if this had happened while i was actually working on rbyplus, i'd have been very happy. now you're qualified for a "uh, thanks".