Hi

I create a new item: the pickaxe. It allows the hero to destroy some specifics entities and enemies. I want to know if it is possible to add a new kind of "attack_consequence" (as lign 26).
The principe is to attack a specific enemy class with the pickaxe to destroy their armor and, after, kill them with the sword.
enemy script:
local enemy = ...
local game = enemy:get_game()
local map = enemy:get_map()
local hero = map:get_hero()
local body_sprite
local movement
local shield_remove
-- Properties
local life = 2
local damage = 2
local speed = 24
local speed_faster = speed + speed/2
-----------------------------------------
-- Proprieties of the enemy with shield
local function shield_mode()
body_sprite:set_animation("walking_rock")
enemy:set_push_hero_on_sword(true)
enemy:set_attack_consequence("sword", "protected")
movement = sol.movement.create("target")
movement:set_target(hero)
movement:set_speed(speed)
movement:start(enemy)
enemy:set_attack_consequence("pickaxe","custom")-- ??
end
-----------------------------------------
-- Proprieties of the enemy without shield
local function normal_mode()
shield_remove = true
body_sprite:set_animation("walking")
movement = sol.movement.create("random")
enemy:set_push_hero_on_sword(false)
enemy:set_default_attack_consequences()
movement:set_speed(speed_faster)
movement:start(enemy)
end
-----------------------------------------
-- When the enemy is hit by a pickaxe
function enemy:on_custom_attack_received(attack,sprite)
normal_mode()
end
-----------------------------------------
function enemy:on_created()
body_sprite = enemy:create_sprite("enemies/" .. enemy:get_breed())
enemy:set_life(life)
enemy:set_damage(damage)
shield_remove = false
end
-----------------------------------------
function enemy:on_restarted()
if shield_remove == false then
shield_mode()
else
normal_mode()
end
end
-----------------------------------------
function enemy:on_movement_changed(movement)
local direction4 = movement:get_direction4()
local sprite = enemy:get_sprite()
sprite:set_direction(direction4)
end