Example #1
0
 static void bpm(int s, int, BS &b) {
     if (tmove(b,s).type == poke(b,s)["ItemArg"]) {
         if (b.gen() >= 4)
             b.chainBp(s, 4);
         else
             b.chainBp(s, 2);
     }
 }
Example #2
0
 static void bpm(int s, int, BS &b) {
     if (tmove(b,s).type == poke(b,s)["ItemArg"]) {
         if (b.gen() >= 4)
             turn(b,s)["BasePowerItemModifier"] = 2;
         else
             turn(b,s)["BasePowerItemModifier"] = 1;
     }
 }
Example #3
0
void
HGPutText(int justify,
	  POINT pnt,
	  register char *string)
{
  int savelasty = lasty;	/* vertical motion for text is to be */
				/* ignored.  Save current y here     */

  printf(".nr g8 \\n(.d\n");	/* save current vertical position. */
  printf(".ds g9 \"");		/* define string containing the text. */
  while (*string) {		/* put out the string */
    if (*string == '\\' &&
	*(string + 1) == '\\') {	/* one character at a */
      printf("\\\\\\");			/* time replacing //  */
      string++;				/* by //// to prevent */
    }					/* interpretation at  */
    printf("%c", *(string++));		/* printout time      */
  }
  printf("\n");

  tmove(&pnt);			/* move to positioning point */

  switch (justify) {
    /* local vertical motions                                            */
    /* (the numbers here are used to be somewhat compatible with gprint) */
  case CENTLEFT:
  case CENTCENT:
  case CENTRIGHT:
    printf("\\v'0.85n'");	/* down half */
    break;

  case TOPLEFT:
  case TOPCENT:
  case TOPRIGHT:
    printf("\\v'1.7n'");	/* down whole */
  }

  switch (justify) {
    /* local horizontal motions */
  case BOTCENT:
  case CENTCENT:
  case TOPCENT:
    printf("\\h'-\\w'\\*(g9'u/2u'");	/* back half */
    break;

  case BOTRIGHT:
  case CENTRIGHT:
  case TOPRIGHT:
    printf("\\h'-\\w'\\*(g9'u'");	/* back whole */
  }

  printf("\\&\\*(g9\n");	/* now print the text. */
  printf(".sp |\\n(g8u\n");	/* restore vertical position */
  lasty = savelasty;		/* vertical position restored to where it */
  lastx = xleft;		/* was before text, also horizontal is at */
				/* left                                   */
}				/* end HGPutText */
Example #4
0
 static void ahpc(int p, int s, BS &b) {
     /* Those berries don't activate immediately when attacked by offensive moves,
        but only after side effects applied. At that time, the battle thread will call
        the effect "TestPinch"
     */
     if (b.attacked() == s && tmove(b,b.attacker()).power > 0)
         return;
     tp(p, s, b);
 }
Example #5
0
    static void bpm(int s, int t, BS &b) {
        if (s == t)
            return;

        /* Doom Desire & Future sight don't have their gem attacking right away,
           only when it hits, and then b.attacking() is false */
        if (tmove(b,s).attack == Move::FutureSight || tmove(b,s).attack == Move::DoomDesire) {
            if (b.attacking())
                return;
        }

        if (tmove(b,s).power <= 1) {
            return;
        }
        if (tmove(b,s).type != poke(b,s)["ItemArg"].toInt() || tmove(b,s).attack == Move::FirePledge  || tmove(b,s).attack == Move::GrassPledge  || tmove(b,s).attack == Move::WaterPledge )
            return;
        b.sendItemMessage(37, s, 0, 0, b.poke(s).item(), move(b,s));
        turn(b,s)["GemActivated"] = true;
        b.disposeItem(s);
    }
Example #6
0
    static void m3b(int s, int t, BS &b) {
        if (!b.attacking()) {
            return;
        }
        if (!b.hasSubstitute(s) && fturn(b,t).typeMod > 0 && tmove(b,t).type == poke(b,s)["ItemArg"].toInt()) {
            b.sendBerryMessage(4,s,0,t,b.poke(s).item(),move(b,t));
            b.eatBerry(s,false);

            turn(b,t)["Mod3Berry"] = -5;
        }
    }
Example #7
0
    static void bpm(int s, int t, BS &b) {
        if (s == t)
            return;

        /* Doom Desire & Future sight don't have their jewel attacking right away,
           only when it hits, and then b.attacking() is false */
        if (tmove(b,s).attack == Move::FutureSight || tmove(b,s).attack == Move::DoomDesire) {
            if (b.attacking())
                return;
        }

        if (tmove(b,s).power <= 1) {
            return;
        }
        if (tmove(b,s).type != poke(b,s)["ItemArg"].toInt())
            return;
        b.sendItemMessage(37, s, 0, 0, b.poke(s).item(), move(b,s));
        turn(b,s)["BasePowerItemModifier"] = 5;
        b.disposeItem(s);
    }
Example #8
0
    static void bpm(int s, int, BS &b) {
        QStringList args = poke(b,s)["ItemArg"].toString().split('_');
        QStringList pokes = args[0].split('/');
        if (!pokes.contains(QString::number(b.pokenum(s).pokenum)))
            return;

        int type = tmove(b,s).type;
        for (int i = 1; i < args.size(); i++) {
            if (type == args[i].toInt())
                b.chainBp(s, 4);
        }
    }
Example #9
0
 static void uodr(int s, int t, BS &b) {
     if (!b.attacking()) {
         return;
     }
     //Magic Guard
     if (tmove(b,t).category != poke(b,s)["ItemArg"].toInt() || b.koed(t) || b.hasWorkingAbility(t, Ability::MagicGuard)) {
         return;
     }
     b.eatBerry(s);
     b.sendBerryMessage(12,s,0,t);
     b.inflictDamage(t, b.poke(t).totalLife()/8,s,false);
 }
Example #10
0
    static void m3b(int s, int t, BS &b) {
        if (!b.attacking()) {
            return;
        }
        /* We never want to activate this berry if this is consumed by Bug Bite */
        if (b.gen() >= 4 && !turn(b,s).value("BugBiter").toBool()) {
            /* Normal moves */
            if (!b.hasSubstitute(s) && tmove(b,t).type == 0) {
                b.sendBerryMessage(4,s,0,t,b.poke(s).item(),move(b,t));
                b.eatBerry(s,false);

                turn(b,t)["Mod3Berry"] = -5;
            }
        }
    }
task main()
{
	gyroCal();
	move(82, 25);
	turn(90, 20);
	findLine(-40, 25);
	move(15, 25);
	lower();
	tmove(-2000, 30); // raise house
	raise();
	findLine(40, 25);
	turn(90, 20);
	tmove(-2500, 30);
	move(7, 30);
	turn(90, 20);
	findLine(-40, 25);
	lower();
	move(3, 25);
	raise(); //flip stove
	move(7, 30);
	turn(270, 25);
	tmove(-2000, 30);
	findLine(40, 30);
	move(5, 15);
	turn(70, 15);
	move(60, 30);
	turn(20, 15);
	tmove(2000, 25);
	move(-4, 20);
	turn(90, 15);
	findLine(40, 20);
	move(10, 15); // push sign
	findLine(-40, 20);
	move(-25, 30);
	turn(90, 20);
	tmove(-1500, 25);
	move(22, 20);
	turn(40, 20);
	move(40, 20); //herd food
	pmove(30, 20, 25);
	move(-5, 20);
	turn(70, 20);
	tmove(1500, 20);
	move(-2, 20);
	turn(90, 15);
	move(30, 20);
	lower();
	move(20, 20);


}
Example #12
0
    static void uodr(int s, int t, BS &b) {
        if (!b.attacking() || b.koed(s)) {
            return;
        }
        int arg = poke(b,s)["ItemArg"].toInt();
        int berry = b.poke(s).item();

        if (turn(b,t).value("BugBiter").toBool() || tmove(b,t).category == Move::Special) {
            b.eatBerry(s, s==t);

            if (b.isOut(s)) {
                if (b.hasWorkingAbility(s, Ability::Contrary)) {
                    b.sendBerryMessage(7,s,1,s, berry, arg);
                } else {
                    b.sendBerryMessage(7,s,0,s, berry, arg);
                }
                b.inflictStatMod(s,arg,1,s,false);
            }
        }
    }
Example #13
0
 static void btl(int s, int, BS &b) {
     if (fturn(b,s).contains(TM::NoChoice)) {
         /* multiple turn move */
         return;
     }
     int count = poke(b,s)["IMMetroCount"].toInt();
     int lslot = poke(b,s)["IMLastMoveSlot"].toInt();
     int slot = fpoke(b,s).lastMoveSlot;
     bool act = poke(b,s)["IMMetroActivating"].toBool();
     poke(b,s)["IMLastMoveSlot"] = slot;
     poke(b,s)["IMMetroActivating"] = true;
     if (slot != lslot) {
         poke(b,s)["IMMetroCount"] = 0;
         return;
     }
     if (tmove(b,s).power == 0) {
         return;
     }
     if (act) {
         poke(b,s)["IMMetroCount"] = std::min(10, count+1);
     }
 }
Example #14
0
 static void uodr(int s, int t, BS &b) {
     if (tmove(b,t).flags & Move::PowderFlag) {
         turn(b,s)[QString("Block%1").arg(b.attackCount())] = true;
         //b.sendAbMessage(17, 0, s, t); //add message for Safety Goggles
     }
 }
Example #15
0
    static void ubh(int s, int t, BS &b) {
        //Red Card does not trigger if the Pokemon is phazed with Dragon Tail/Circle Throw
        if (b.koed(s) || (b.hasWorkingAbility(t, Ability::SheerForce) && turn(b,t).contains("EncourageBug")) || b.hasSubstitute(s) || tmove(b,t).attack == Move::DragonTail || tmove(b,t).attack == Move::CircleThrow)
            return;

        addFunction(turn(b,t), "AfterAttackFinished", "RedCard", &aaf);
        turn(b,t)["RedCardUser"] = s;
        turn(b,t)["RedCardCount"] = slot(b,t)["SwitchCount"];
        turn(b,t)["RedCardGiverCount"] = slot(b,s)["SwitchCount"];

        return;
    }
Example #16
0
 static void btl(int s, int, BS &b) {
     if (tmove(b,b.attacker()).power > 0) {
         tmove(b,s).critRaise += 2;
     }
 }
Example #17
0
 static void btl(int s, int, BS &b) {
     if (b.pokenum(s).pokenum == poke(b,s)["ItemArg"].toInt()) {
         tmove(b,s).critRaise += 2;
     }
 }
Example #18
0
 static void btl(int s, int, BS &b) {
     tmove(b, s).critRaise += 1;
 }
Example #19
0
 static void bpm(int s, int, BS &b) {
     if (tmove(b,s).category == poke(b,s)["ItemArg"]) {
         turn(b,s)["BasePowerItemModifier"] = 1;
     }
 }
Example #20
0
void
HGPrintElt(ELT *element,
	   int /* baseline */)
{
  register POINT *p1;
  register POINT *p2;
  register int length;
  register int graylevel;

  if (!DBNullelt(element) && !Nullpoint((p1 = element->ptlist))) {
    /* p1 always has first point */
    if (TEXT(element->type)) {
      HGSetFont(element->brushf, element->size);
      switch (element->size) {
      case 1:
	p1->y += adj1;
	break;
      case 2:
	p1->y += adj2;
	break;
      case 3:
	p1->y += adj3;
	break;
      case 4:
	p1->y += adj4;
	break;
      default:
	break;
      }
      HGPutText(element->type, *p1, element->textpt);
    } else {
      if (element->brushf)		/* if there is a brush, the */
	HGSetBrush(element->brushf);	/* graphics need it set     */

      switch (element->type) {

      case ARC:
	p2 = PTNextPoint(p1);
	tmove(p2);
	doarc(*p1, *p2, element->size);
	cr();
	break;

      case CURVE:
	length = 0;	/* keep track of line length */
	drawwig(p1, CURVE);
	cr();
	break;

      case BSPLINE:
	length = 0;	/* keep track of line length */
	drawwig(p1, BSPLINE);
	cr();
	break;

      case VECTOR:
	length = 0;		/* keep track of line length so */
	tmove(p1);		/* single lines don't get long  */
	while (!Nullpoint((p1 = PTNextPoint(p1)))) {
	  HGtline((int) (p1->x * troffscale),
		  (int) (p1->y * troffscale));
	  if (length++ > LINELENGTH) {
	    length = 0;
	    printf("\\\n");
	  }
	}			/* end while */
	cr();
	break;

      case POLYGON:
	{
	  /* brushf = style of outline; size = color of fill:
	   * on first pass (polyfill=FILL), do the interior using 'P'
	   *    unless size=0
	   * on second pass (polyfill=OUTLINE), do the outline using a series
	   *    of vectors. It might make more sense to use \D'p ...',
	   *    but there is no uniform way to specify a 'fill character'
	   *    that prints as 'no fill' on all output devices (and
	   *    stipple fonts).
	   * If polyfill=BOTH, just use the \D'p ...' command.
	   */
	  double firstx = p1->x;
	  double firsty = p1->y;

	  length = 0;		/* keep track of line length so */
				/* single lines don't get long  */

	  if (polyfill == FILL || polyfill == BOTH) {
	    /* do the interior */
	    char command = (polyfill == BOTH && element->brushf) ? 'p' : 'P';

	    /* include outline, if there is one and */
	    /* the -p flag was set                  */

	    /* switch based on what gremlin gives */
	    switch (element->size) {
	    case 1:
	      graylevel = 1;
	      break;
	    case 3:
	      graylevel = 2;
	      break;
	    case 12:
	      graylevel = 3;
	      break;
	    case 14:
	      graylevel = 4;
	      break;
	    case 16:
	      graylevel = 5;
	      break;
	    case 19:
	      graylevel = 6;
	      break;
	    case 21:
	      graylevel = 7;
	      break;
	    case 23:
	      graylevel = 8;
	      break;
	    default:		/* who's giving something else? */
	      graylevel = NSTIPPLES;
	      break;
	    }
	    /* int graylevel = element->size; */

	    if (graylevel < 0)
	      break;
	    if (graylevel > NSTIPPLES)
	      graylevel = NSTIPPLES;
	    printf("\\D'Fg %.3f'",
		   double(1000 - stipple_index[graylevel]) / 1000.0);
	    cr();
	    tmove(p1);
	    printf("\\D'%c", command);

	    while (!Nullpoint((PTNextPoint(p1)))) {
	      p1 = PTNextPoint(p1);
	      deltax((double) p1->x);
	      deltay((double) p1->y);
	      if (length++ > LINELENGTH) {
		length = 0;
		printf("\\\n");
	      }
	    } /* end while */

	    /* close polygon if not done so by user */
	    if ((firstx != p1->x) || (firsty != p1->y)) {
	      deltax((double) firstx);
	      deltay((double) firsty);
	    }
	    putchar('\'');
	    cr();
	    break;
	  }
	  /* else polyfill == OUTLINE; only draw the outline */
	  if (!(element->brushf))
	    break;
	  length = 0;		/* keep track of line length */
	  tmove(p1);

	  while (!Nullpoint((PTNextPoint(p1)))) {
	    p1 = PTNextPoint(p1);
	    HGtline((int) (p1->x * troffscale),
		    (int) (p1->y * troffscale));
	    if (length++ > LINELENGTH) {
	      length = 0;
	      printf("\\\n");
	    }
	  }			/* end while */

	  /* close polygon if not done so by user */
	  if ((firstx != p1->x) || (firsty != p1->y)) {
	    HGtline((int) (firstx * troffscale),
		    (int) (firsty * troffscale));
	  }
	  cr();
	  break;
	}			/* end case POLYGON */
      }				/* end switch */
    }				/* end else Text */
  }				/* end if */
}				/* end PrintElt */
Example #21
0
 static void bpm(int s, int, BS &b) {
     if (tmove(b,s).category == poke(b,s)["ItemArg"]) {
         b.chainBp(s, 2);
     }
 }