void LinkHandler::addDecorations() { fix x=Link.getX(); fix y=Link.getY(); fix z=Link.getZ(); if(isGrassType(COMBOTYPE(x,y+15)) && isGrassType(COMBOTYPE(x+15,y+15))&& z<=8) { if(!tallGrassDeco) { tallGrassDeco.reset(new dTallGrass(x, y, dTALLGRASS, 0)); decorations.add(tallGrassDeco.get()); } } else if(tallGrassDeco) tallGrassDeco.del(); if((COMBOTYPE(x,y+15)==cSHALLOWWATER)&&(COMBOTYPE(x+15,y+15)==cSHALLOWWATER) && z==0) { if(!ripplesDeco) { ripplesDeco.reset(new dRipples(x, y, dRIPPLES, 0)); decorations.add(ripplesDeco.get()); } } else if(ripplesDeco) ripplesDeco.del(); if(Link.hoverclk>0) { if(!hoverDeco) { hoverDeco.reset(new dHover(x, y, dHOVER, 0)); decorations.add(hoverDeco.get()); sfx(itemsbuf[current_item_id(itype_hoverboots)].usesound,pan(int(x))); } } else if(hoverDeco) hoverDeco.del(); }
bool dTallGrass::animate(int index) { index=index; //this is here to bypass compiler warnings about unused arguments return (!isGrassType(COMBOTYPE(LinkX(),LinkY()+15)) || !isGrassType(COMBOTYPE(LinkX()+15,LinkY()+15)) || LinkZ()>8); }