I’ve seen the posts about finding gold coins based on their item.value
. This works well for a hero collecting coins. If I want to use the Mimic, I’m stuck with his findNearestByType
, though. Do the different coins have different types, or am I stuck with "coin"
?
The “Meme” ? I’m going to assume you mean the Mimic.
And yes, all coins are type coin.
There are “gold-coin”, “silver-coin” and “bronze-coin”. You can click to an item to see it types (if it’s selectable).
All pets have this ability/method.
There are “gold-coin”, “silver-coin” and “bronze-coin”. You can click to an item to see it types (if it’s selectable).
I didn’t even know that!
Sorry, looks like I was wrong. @Shmoogy just a "coin"
. You can use ".value"
to distinguish them.
Also I think we can add findByType
especially for the Mimic because it’s a special pet.
@maka Yeah, I meant the Mimic (I edited). @Bryukh it’s true, all the pets have findByType
, but if I want to have my Mimic go pick up (magnetize, whatever) gold coins off on his own without my hero, I can’t rely on hero..value
out of line of sight, and even then it’ll be difficult to factor in how far things are from the Mimic, as opposed to the hero, though I suppose this too could be accomplished with hero.distanceTo
.
Thanks for the answers!
Edit: I didn’t realize that .value is called on the object, not through the hero. My Mimic is happily sucking up gold coins now.