예제 #1
0
 public static BufferedImage getFood(String name) {
   Item itm = Wiki.get(name);
   if (itm != null) {
     Map<String, Float[]> food = itm.food;
     if (food != null) {
       Float[] heal = food.get("Heals");
       Float[] salt = food.get("Salt");
       Float[] merc = food.get("Mercury");
       Float[] sulph = food.get("Sulphur");
       Float[] lead = food.get("Lead");
       int[] tempers = new int[4];
       int[][] evs = new int[4][4];
       for (int i = 0; i < 4; i++) {
         tempers[i] = (int) (1000 * heal[i]);
         evs[0][i] = (int) (1000 * salt[i]);
         evs[1][i] = (int) (1000 * merc[i]);
         evs[2][i] = (int) (1000 * sulph[i]);
         evs[3][i] = (int) (1000 * lead[i]);
       }
       FoodInfo fi = new FoodInfo(null, tempers);
       GobbleInfo gi = new GobbleInfo(null, evs, 0);
       return ItemInfo.catimgs(3, fi.longtip(), gi.longtip());
     }
   }
   return null;
 }
예제 #2
0
 public Object tooltip(Coord c, Widget prev) {
   Pagina pag = bhit(c);
   long now = System.currentTimeMillis();
   if ((pag != null) && (pag.act() != null)) {
     if (prev != this) hoverstart = now;
     boolean ttl = (now - hoverstart) > 500;
     Item itm = Wiki.get(pag.res().layer(Resource.action).name);
     if ((pag != curttp) || (ttl != curttl) || itm != ttitem) {
       ttitem = itm;
       curtt = rendertt(pag.res(), ttl, true);
       curttp = pag;
       curttl = ttl;
     }
     return (curtt);
   } else {
     hoverstart = now;
     return ("");
   }
 }
예제 #3
0
 public static BufferedImage getXPgain(String name) {
   Item itm = Wiki.get(name);
   if (itm != null) {
     Map<String, Integer> props = itm.attgive;
     if (props != null) {
       int n = props.size();
       String attrs[] = new String[n];
       int exp[] = new int[n];
       n = 0;
       for (String attr : props.keySet()) {
         Integer val = props.get(attr);
         attrs[n] = attr;
         exp[n] = val;
         n++;
       }
       Inspiration i = new Inspiration(null, attrs, exp);
       return i.longtip();
     }
   }
   return null;
 }