-
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
116 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
register_card("FLASH_SHIELD", { | ||
name = l("cards.FLASH_SHIELD.name", "Flash Shield"), | ||
description = string.format( | ||
l("cards.FLASH_SHIELD.description","%s\n\nDeploy a temporary shield. %s the next attack."), | ||
highlight("One-Time"), highlight("Negates") | ||
), | ||
tags = { "DEF" }, | ||
max_level = 0, | ||
color = COLOR_BLUE, | ||
need_target = false, | ||
does_consume = true, | ||
point_cost = 0, | ||
price = 180, | ||
callbacks = { | ||
on_cast = function(ctx) | ||
give_status_effect("FLASH_SHIELD", ctx.caster, 1 + ctx.level) | ||
return nil | ||
end | ||
} | ||
}) | ||
|
||
register_status_effect("FLASH_SHIELD", { | ||
name = l("status_effects.FLASH_SHIELD.name", "Flash Shield"), | ||
description = l("status_effects.FLASH_SHIELD.description", "Negates the next attack."), | ||
look = "Fsh", | ||
foreground = COLOR_BLUE, | ||
can_stack = false, | ||
decay = DECAY_ALL, | ||
rounds = 1, | ||
order = 100, | ||
callbacks = { | ||
on_damage_calc = function(ctx) | ||
if ctx.simulated then | ||
return ctx.damage | ||
end | ||
|
||
if ctx.target == ctx.owner then | ||
add_status_effect_stacks(ctx.guid, -1) | ||
return 0 | ||
end | ||
return ctx.damage | ||
end, | ||
}, | ||
test = function() | ||
return assert_chain({ | ||
function() return assert_status_effect_count(1) end, | ||
function() return assert_status_effect("FLASH_SHIELD", 1) end, | ||
function () | ||
local dummy = add_actor_by_enemy("DUMMY") | ||
local damage = deal_damage(dummy, PLAYER_ID, 100) | ||
if damage ~= 0 then | ||
return "Expected 0 damage, got " .. damage | ||
end | ||
|
||
damage = deal_damage(dummy, PLAYER_ID, 2) | ||
if damage ~= 2 then | ||
return "Expected 2 damage, got " .. damage | ||
end | ||
end | ||
}) | ||
end | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
register_card("STIM_PACK", { | ||
name = l("cards.STIM_PACK.name", "Stim Pack"), | ||
description = l("cards.STIM_PACK.description", highlight("One-Time") .. "\n\nRestores " .. highlight(5) .. " HP."), | ||
tags = { "HEAL" }, | ||
max_level = 0, | ||
color = COLOR_BLUE, | ||
need_target = false, | ||
does_consume = true, | ||
point_cost = 0, | ||
price = -1, | ||
callbacks = { | ||
on_cast = function(ctx) | ||
heal(ctx.caster, ctx.caster, 5) | ||
return nil | ||
end | ||
}, | ||
test = function () | ||
return assert_cast_heal("STIM_PACK", 5) | ||
end | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters