Bubble + boomerang = fairy?

Started by YoshiMario2000, June 13, 2015, 06:02:18 PM

Previous topic - Next topic
Is it possible to trow a boomerang at a bubble and get a fairy?
This signature was way too long before, but now it's short!
Also, I am Still Alive!
On ad Off I go!

Do you ever get the feeling that the fandom of a product(s) ruin the potential that you could have had to enjoy the product?

Yes. It is possible to make almost anything if you know how to code it (but not easy).

To do what you want, I would use a custom entity for the bubble. You can use a collision test on the bubble script to detect the collision with the boomerang. (I have done something similar to make trees that throw leaves when hit with the sword, and it works.) You can use something like this:

entity:add_collision_test("sprite", function(entity, other_entity, sprite, other_sprite)
  if other_sprite:get_animation() ~= "boomerang" then return end
  -- Here goes your code...
end
"If you make people think they're thinking, they'll love you. But if you really make them think, they'll hate you."

It is even possible to keep the bubble as a normal enemy.
Define the enemy:on_hurt(attack) event on bubble, and if attack == "boomerang", call enemy:set_treasure("fairy").
See http://www.solarus-games.org/doc/latest/lua_api_enemy.html#lua_api_enemy_on_hurt

Quote from: Christopho on June 13, 2015, 11:57:26 PM
It is even possible to keep the bubble as a normal enemy.
Define the enemy:on_hurt(attack) event on bubble, and if attack == "boomerang", call enemy:set_treasure("fairy").
See http://www.solarus-games.org/doc/latest/lua_api_enemy.html#lua_api_enemy_on_hurt

After that I think we would want to remove the bubble.

If you have played link's awakening, or the oracle games,
Trowing a boomerang at a bubble will cause it to "transform" into a fairy.
That's probably why the are called anti-fairys.
This signature was way too long before, but now it's short!
Also, I am Still Alive!
On ad Off I go!

Do you ever get the feeling that the fandom of a product(s) ruin the potential that you could have had to enjoy the product?

That's right!

function enemy:on_hurt(attack)
  if attack == "boomerang" then
    local layer, x, y = enemy:get_position()
    map:create_pickable({
      layer = layer,
      x = x,
      y = y,
      treasure_name = "fairy"
    })
    enemy:remove()
  end
end
     
     

June 18, 2015, 01:11:08 AM #5 Last Edit: June 18, 2015, 01:13:29 AM by YoshiMario2000
But, This works beater, at least, for me anyways.

function enemy:on_created()
  self:set_life(1)
  self:create_sprite("enemies/bubble")
  self:set_size(8, 8)
  self:set_origin(4, 4)
  self:set_can_hurt_hero_running(true)
  self:set_attack_consequence("sword", "ignored")
  self:set_attack_consequence("hookshot", "ignored")
  self:set_attack_consequence("arrow", "ignored")
  self:set_attack_consequence("fire", "ignored")
  self:set_attack_consequence("explosion", "ignored")
  self:set_attack_consequence("thrown_item", "ignored")
  self:set_attack_consequence("boomerang", 10)
  self:set_treasure("fairy")
end


You're result Gave some useless and humorous results. The bubble could be hit,
It just couldn't be killed. even by boomerang.
This signature was way too long before, but now it's short!
Also, I am Still Alive!
On ad Off I go!

Do you ever get the feeling that the fandom of a product(s) ruin the potential that you could have had to enjoy the product?