Move scripts into sub-directories.

This commit is contained in:
Daniel Schmidt 2023-05-16 09:11:12 +02:00
parent c9504360df
commit 346ccda366
32 changed files with 516 additions and 547 deletions

3
assets/scripts/_util.lua Normal file
View File

@ -0,0 +1,3 @@
function highlight(val)
return text_underline(text_bold("[" .. tostring(val) .. "]"))
end

View File

@ -1,147 +0,0 @@
register_artifact("GIGANTIC_STRENGTH", {
name = "Stone Of Gigantic Strength",
description = "Double all damage dealt.",
price = 250,
order = 0,
callbacks = {
on_damage_calc = function(ctx)
if ctx.target == ctx.owner then
return ctx.damage * 2
end
return nil
end
}
});
register_artifact("REPULSION_STONE", {
name = "Repulsion Stone",
description = "For each damage taken heal for 2",
price = 100,
order = 0,
callbacks = {
on_damage = function(ctx)
if ctx.target == ctx.owner then
heal(ctx.owner, 2)
end
return nil
end
}
});
register_artifact("RADIANT_SEED", {
name = "Radiant Seed",
description = "A small glowing seed.",
price = 140,
order = 0,
callbacks = {
on_pick_up = function(ctx)
give_card("RADIANT_SEED", ctx.owner)
return nil
end
}
});
register_artifact("JUICY_FRUIT", {
name = "Juicy Fruit",
description = "Tastes good and boosts your HP.",
price = 80,
order = 0,
callbacks = {
on_pick_up = function(ctx)
actor_add_max_hp(ctx.owner, 10)
return nil
end
}
});
register_artifact("DEFLECTOR_SHIELD", {
name = "Deflector Shield",
description = "Gain 8 block at the start of combat.",
price = 50,
order = 0,
callbacks = {
on_player_turn = function(ctx)
if ctx.round == 0 then
give_status_effect("BLOCK", ctx.owner, 8)
end
return nil
end
}
});
register_artifact("SHORT_RADIANCE", {
name = "Short Radiance",
description = "Apply 1 vulnerable at the start of combat.",
price = 50,
order = 0,
callbacks = {
on_player_turn = function(ctx)
if ctx.round == 0 then
each(function(val)
give_status_effect("VULNERABLE", val)
end, pairs(get_opponent_guids(ctx.owner)))
end
return nil
end
}
});
register_artifact("BAG_OF_HOLDING", {
name = "Bag of Holding",
description = "Start with a additional card at the beginning of combat.",
price = 50,
order = 0,
callbacks = {
on_player_turn = function(ctx)
if ctx.owner == PLAYER_ID and ctx.round == 0 then
player_draw_card(1)
end
return nil
end
}
});
register_artifact("SPIKED_PLANT", {
name = "Spiked Plant",
description = "Deal 2 damage back to enemy attacks.",
price = 50,
order = 0,
callbacks = {
on_damage = function(ctx)
if ctx.source ~= ctx.owner and ctx.owner == ctx.target then
deal_damage(ctx.owner, ctx.source, 2)
end
return nil
end
}
});
register_artifact("GOLD_CONVERTER", {
name = "Gold Converter",
description = "Gain 10 extra gold for each killed enemy.",
price = 50,
order = 0,
callbacks = {
on_actor_die = function(ctx)
if ctx.owner == PLAYER_ID and ctx.owner == ctx.source then
give_player_gold(10)
end
return nil
end
}
});
register_artifact("HOLY_GRAIL", {
name = "Holy Grail",
description = "At the start of each turn, heal for 2 HP for each card in your hand.",
price = 150,
order = 100, -- Evaluate late so that other draw artifacts have priority.
callbacks = {
on_player_turn = function(ctx)
local num_cards = #get_cards(ctx.owner)
local heal_amount = num_cards * 2
heal(ctx.owner, ctx.owner, heal_amount)
return nil
end
}
});

View File

@ -0,0 +1,14 @@
register_artifact("BAG_OF_HOLDING", {
name = "Bag of Holding",
description = "Start with a additional card at the beginning of combat.",
price = 50,
order = 0,
callbacks = {
on_player_turn = function(ctx)
if ctx.owner == PLAYER_ID and ctx.round == 0 then
player_draw_card(1)
end
return nil
end
}
});

View File

@ -0,0 +1,14 @@
register_artifact("DEFLECTOR_SHIELD", {
name = "Deflector Shield",
description = "Gain 8 block at the start of combat.",
price = 50,
order = 0,
callbacks = {
on_player_turn = function(ctx)
if ctx.round == 0 then
give_status_effect("BLOCK", ctx.owner, 8)
end
return nil
end
}
});

View File

@ -0,0 +1,14 @@
register_artifact("GIGANTIC_STRENGTH", {
name = "Stone Of Gigantic Strength",
description = "Double all damage dealt.",
price = 250,
order = 0,
callbacks = {
on_damage_calc = function(ctx)
if ctx.target == ctx.owner then
return ctx.damage * 2
end
return nil
end
}
});

View File

@ -0,0 +1,14 @@
register_artifact("GOLD_CONVERTER", {
name = "Gold Converter",
description = "Gain 10 extra gold for each killed enemy.",
price = 50,
order = 0,
callbacks = {
on_actor_die = function(ctx)
if ctx.owner == PLAYER_ID and ctx.owner == ctx.source then
give_player_gold(10)
end
return nil
end
}
});

View File

@ -0,0 +1,14 @@
register_artifact("HOLY_GRAIL", {
name = "Holy Grail",
description = "At the start of each turn, heal for 2 HP for each card in your hand.",
price = 150,
order = 100, -- Evaluate late so that other draw artifacts have priority.
callbacks = {
on_player_turn = function(ctx)
local num_cards = #get_cards(ctx.owner)
local heal_amount = num_cards * 2
heal(ctx.owner, ctx.owner, heal_amount)
return nil
end
}
});

View File

@ -0,0 +1,12 @@
register_artifact("JUICY_FRUIT", {
name = "Juicy Fruit",
description = "Tastes good and boosts your HP.",
price = 80,
order = 0,
callbacks = {
on_pick_up = function(ctx)
actor_add_max_hp(ctx.owner, 10)
return nil
end
}
});

View File

@ -0,0 +1,12 @@
register_artifact("RADIANT_SEED", {
name = "Radiant Seed",
description = "A small glowing seed.",
price = 140,
order = 0,
callbacks = {
on_pick_up = function(ctx)
give_card("RADIANT_SEED", ctx.owner)
return nil
end
}
});

View File

@ -0,0 +1,14 @@
register_artifact("REPULSION_STONE", {
name = "Repulsion Stone",
description = "For each damage taken heal for 2",
price = 100,
order = 0,
callbacks = {
on_damage = function(ctx)
if ctx.target == ctx.owner then
heal(ctx.owner, 2)
end
return nil
end
}
});

View File

@ -0,0 +1,16 @@
register_artifact("SHORT_RADIANCE", {
name = "Short Radiance",
description = "Apply 1 vulnerable at the start of combat.",
price = 50,
order = 0,
callbacks = {
on_player_turn = function(ctx)
if ctx.round == 0 then
each(function(val)
give_status_effect("VULNERABLE", val)
end, pairs(get_opponent_guids(ctx.owner)))
end
return nil
end
}
});

View File

@ -0,0 +1,14 @@
register_artifact("SPIKED_PLANT", {
name = "Spiked Plant",
description = "Deal 2 damage back to enemy attacks.",
price = 50,
order = 0,
callbacks = {
on_damage = function(ctx)
if ctx.source ~= ctx.owner and ctx.owner == ctx.target then
deal_damage(ctx.owner, ctx.source, 2)
end
return nil
end
}
});

View File

@ -1,233 +0,0 @@
function highlight(val)
return text_underline(text_bold("[" .. tostring(val) .. "]"))
end
register_card("KILL", {
name = "Kill",
description = "Debug Card",
state = function(ctx)
return nil
end,
max_level = 0,
color = "#2f3e46",
need_target = true,
point_cost = 0,
price = -1,
callbacks = {
on_cast = function(ctx)
deal_damage(ctx.caster, ctx.target, 1000, true)
return nil
end
}
})
register_card("MELEE_HIT", {
name = "Melee Hit",
description = "Use your bare hands to deal 5 (+3 for each upgrade) damage.",
state = function(ctx)
return "Use your bare hands to deal " .. highlight(5 + ctx.level * 3) .. " damage."
end,
max_level = 1,
color = "#2f3e46",
need_target = true,
point_cost = 1,
price = 30,
callbacks = {
on_cast = function(ctx)
deal_damage(ctx.caster, ctx.target, 5 + ctx.level * 3)
return nil
end
}
})
register_card("RUPTURE", {
name = "Rupture",
description = "Inflict your enemy with " .. highlight("Vulnerable") .. ".",
state = function(ctx)
return "Inflict your enemy with " .. highlight(tostring(1 + ctx.level) .. " Vulnerable") .. "."
end,
max_level = 3,
color = "#cf532d",
need_target = true,
point_cost = 1,
price = 30,
callbacks = {
on_cast = function(ctx)
give_status_effect("VULNERABLE", ctx.target, 1 + ctx.level)
return nil
end
}
})
register_card("BLOCK", {
name = "Block",
description = "Shield yourself and gain 5 " .. highlight("block") .. ".",
state = function(ctx)
return "Shield yourself and gain " .. highlight(5 + ctx.level * 3) .. " block."
end,
max_level = 1,
color = "#219ebc",
need_target = false,
point_cost = 1,
price = 40,
callbacks = {
on_cast = function(ctx)
give_status_effect("BLOCK", ctx.caster, 5 + ctx.level * 3)
return nil
end
}
})
register_card("BLOCK_SPIKES", {
name = "Block Spikes",
description = "Transforms " .. highlight("block") .. " to damage.",
state = function(ctx)
-- Fetch all BLOCK instances of owner
local blocks = fun.iter(pairs(get_actor_status_effects(ctx.owner))):map(get_status_effect_instance):filter(function(val)
return val.type_id == "BLOCK"
end):totable()
-- Sum stacks to get damage
local damage = fun.iter(pairs(blocks)):reduce(function(acc, val)
return acc + val.stacks
end, 0)
return "Transforms block to " .. highlight(damage) .. " damage."
end,
max_level = 0,
color = "#895cd6",
need_target = true,
point_cost = 1,
price = 100,
callbacks = {
on_cast = function(ctx)
-- Fetch all BLOCK instances of caster
local blocks = fun.iter(pairs(get_actor_status_effects(ctx.caster))):map(get_status_effect_instance):filter(function(val)
return val.type_id == "BLOCK"
end):totable()
-- Sum stacks to get damage
local damage = fun.iter(pairs(blocks)):reduce(function(acc, val)
return acc + val.stacks
end, 0)
if damage == 0 then
return "No block status effect present!"
end
-- Remove BLOCKs
fun.iter(pairs(blocks)):for_each(function(val)
remove_status_effect(val.guid)
end)
-- Deal Damage
deal_damage(ctx.caster, ctx.target, damage)
return nil
end
}
})
register_card("SHIELD_BASH", {
name = "Shield Bash",
description = "Deal 4 (+2 for each upgrade) damage to the enemy and gain " .. highlight("block") ..
" status effect equal to the damage dealt.",
state = function(ctx)
return "Deal " .. highlight(4 + ctx.level * 2) .. " damage to the enemy and gain " .. highlight("block") ..
" status effect equal to the damage dealt."
end,
max_level = 1,
color = "#ff5722",
need_target = true,
point_cost = 1,
price = 40,
callbacks = {
on_cast = function(ctx)
local damage = deal_damage(ctx.caster, 4 + ctx.level * 2)
give_status_effect("BLOCK", ctx.caster, damage)
return nil
end
}
})
register_card("FEAR", {
name = "Fear",
description = "Inflict " .. highlight("fear") .. " on the target, causing them to miss their next turn.",
state = function(ctx)
return nil
end,
max_level = 0,
color = "#725e9c",
need_target = true,
point_cost = 2,
price = 80,
callbacks = {
on_cast = function(ctx)
give_status_effect("FEAR", ctx.target)
return nil
end
}
})
register_card("RADIANT_SEED", {
name = "Radiant Seed",
description = "Inflict 10 (+2 for each upgrade) damage to all enemies, but also causes 5 (-2 for each upgrade) damage to the caster.",
state = function(ctx)
return "Inflict " .. highlight(10 + ctx.level * 2) .. " damage to all enemies, but also causes " .. highlight(5 - ctx.level * 2) ..
" damage to the caster."
end,
max_level = 1,
color = "#82c93e",
need_target = false,
point_cost = 2,
price = 120,
callbacks = {
on_cast = function(ctx)
-- Deal damage to caster without any modifiers applying
deal_damage(ctx.caster, ctx.caster, 5 - ctx.level * 2, true)
-- Deal damage to opponents
deal_damage_multi(ctx.caster, get_opponent_guids(ctx.caster), 10 + ctx.level * 2)
return nil
end
}
})
register_card("BERSERKER_RAGE", {
name = "Berserker Rage",
description = "Gain " .. highlight("3 energy") .. ", but take 30% (-10% per level) of your HP as damage.",
state = function(ctx)
return "Gain " .. highlight("3 energy") .. ", but take " .. highlight(tostring(30 - ctx.level * 10) .. "%") .. " (" ..
tostring(get_player().hp * (0.3 - ctx.level * 0.1)) .. ") of your HP as damage."
end,
max_level = 0,
color = "#d8a448",
need_target = false,
point_cost = 0,
price = 100,
callbacks = {
on_cast = function(ctx)
player_give_action_points(3)
deal_damage(ctx.caster, ctx.caster, get_player().hp * (0.3 - ctx.level * 0.1), true)
return nil
end
}
})
register_card("COMBINED_SHOT", {
name = "Combined Shot",
description = "Deal " .. highlight(5) .. " (+5 for each level) damage for each enemy.",
state = function(ctx)
return "Deal " .. highlight((5 + ctx.level * 5) * #get_opponent_guids(ctx.owner)) .. " damage for each enemy."
end,
max_level = 1,
color = "#d8a448",
need_target = true,
point_cost = 1,
price = 150,
callbacks = {
on_cast = function(ctx)
deal_damage(ctx.caster, ctx.target, (5 + ctx.level * 5) * #get_opponent_guids(ctx.owner))
return nil
end
}
})

View File

@ -0,0 +1,18 @@
register_card("KILL", {
name = "Kill",
description = "Debug Card",
state = function(ctx)
return nil
end,
max_level = 0,
color = "#2f3e46",
need_target = true,
point_cost = 0,
price = -1,
callbacks = {
on_cast = function(ctx)
deal_damage(ctx.caster, ctx.target, 1000, true)
return nil
end
}
})

View File

@ -0,0 +1,20 @@
register_card("BERSERKER_RAGE", {
name = "Berserker Rage",
description = "Gain " .. highlight("3 energy") .. ", but take 30% (-10% per level) of your HP as damage.",
state = function(ctx)
return "Gain " .. highlight("3 energy") .. ", but take " .. highlight(tostring(30 - ctx.level * 10) .. "%") .. " (" ..
tostring(get_player().hp * (0.3 - ctx.level * 0.1)) .. ") of your HP as damage."
end,
max_level = 0,
color = "#d8a448",
need_target = false,
point_cost = 0,
price = 100,
callbacks = {
on_cast = function(ctx)
player_give_action_points(3)
deal_damage(ctx.caster, ctx.caster, get_player().hp * (0.3 - ctx.level * 0.1), true)
return nil
end
}
})

View File

@ -0,0 +1,18 @@
register_card("BLOCK", {
name = "Block",
description = "Shield yourself and gain 5 " .. highlight("block") .. ".",
state = function(ctx)
return "Shield yourself and gain " .. highlight(5 + ctx.level * 3) .. " block."
end,
max_level = 1,
color = "#219ebc",
need_target = false,
point_cost = 1,
price = 40,
callbacks = {
on_cast = function(ctx)
give_status_effect("BLOCK", ctx.caster, 5 + ctx.level * 3)
return nil
end
}
})

View File

@ -0,0 +1,49 @@
register_card("BLOCK_SPIKES", {
name = "Block Spikes",
description = "Transforms " .. highlight("block") .. " to damage.",
state = function(ctx)
-- Fetch all BLOCK instances of owner
local blocks = fun.iter(pairs(get_actor_status_effects(ctx.owner))):map(get_status_effect_instance):filter(function(val)
return val.type_id == "BLOCK"
end):totable()
-- Sum stacks to get damage
local damage = fun.iter(pairs(blocks)):reduce(function(acc, val)
return acc + val.stacks
end, 0)
return "Transforms block to " .. highlight(damage) .. " damage."
end,
max_level = 0,
color = "#895cd6",
need_target = true,
point_cost = 1,
price = 100,
callbacks = {
on_cast = function(ctx)
-- Fetch all BLOCK instances of caster
local blocks = fun.iter(pairs(get_actor_status_effects(ctx.caster))):map(get_status_effect_instance):filter(function(val)
return val.type_id == "BLOCK"
end):totable()
-- Sum stacks to get damage
local damage = fun.iter(pairs(blocks)):reduce(function(acc, val)
return acc + val.stacks
end, 0)
if damage == 0 then
return "No block status effect present!"
end
-- Remove BLOCKs
fun.iter(pairs(blocks)):for_each(function(val)
remove_status_effect(val.guid)
end)
-- Deal Damage
deal_damage(ctx.caster, ctx.target, damage)
return nil
end
}
})

View File

@ -0,0 +1,18 @@
register_card("COMBINED_SHOT", {
name = "Combined Shot",
description = "Deal " .. highlight(5) .. " (+5 for each level) damage for each enemy.",
state = function(ctx)
return "Deal " .. highlight((5 + ctx.level * 5) * #get_opponent_guids(ctx.owner)) .. " damage for each enemy."
end,
max_level = 1,
color = "#d8a448",
need_target = true,
point_cost = 1,
price = 150,
callbacks = {
on_cast = function(ctx)
deal_damage(ctx.caster, ctx.target, (5 + ctx.level * 5) * #get_opponent_guids(ctx.owner))
return nil
end
}
})

View File

@ -0,0 +1,18 @@
register_card("FEAR", {
name = "Fear",
description = "Inflict " .. highlight("fear") .. " on the target, causing them to miss their next turn.",
state = function(ctx)
return nil
end,
max_level = 0,
color = "#725e9c",
need_target = true,
point_cost = 2,
price = 80,
callbacks = {
on_cast = function(ctx)
give_status_effect("FEAR", ctx.target)
return nil
end
}
})

View File

@ -0,0 +1,18 @@
register_card("MELEE_HIT", {
name = "Melee Hit",
description = "Use your bare hands to deal 5 (+3 for each upgrade) damage.",
state = function(ctx)
return "Use your bare hands to deal " .. highlight(5 + ctx.level * 3) .. " damage."
end,
max_level = 1,
color = "#2f3e46",
need_target = true,
point_cost = 1,
price = 30,
callbacks = {
on_cast = function(ctx)
deal_damage(ctx.caster, ctx.target, 5 + ctx.level * 3)
return nil
end
}
})

View File

@ -0,0 +1,22 @@
register_card("RADIANT_SEED", {
name = "Radiant Seed",
description = "Inflict 10 (+2 for each upgrade) damage to all enemies, but also causes 5 (-2 for each upgrade) damage to the caster.",
state = function(ctx)
return "Inflict " .. highlight(10 + ctx.level * 2) .. " damage to all enemies, but also causes " .. highlight(5 - ctx.level * 2) ..
" damage to the caster."
end,
max_level = 1,
color = "#82c93e",
need_target = false,
point_cost = 2,
price = 120,
callbacks = {
on_cast = function(ctx)
-- Deal damage to caster without any modifiers applying
deal_damage(ctx.caster, ctx.caster, 5 - ctx.level * 2, true)
-- Deal damage to opponents
deal_damage_multi(ctx.caster, get_opponent_guids(ctx.caster), 10 + ctx.level * 2)
return nil
end
}
})

View File

@ -0,0 +1,18 @@
register_card("RUPTURE", {
name = "Rupture",
description = "Inflict your enemy with " .. highlight("Vulnerable") .. ".",
state = function(ctx)
return "Inflict your enemy with " .. highlight(tostring(1 + ctx.level) .. " Vulnerable") .. "."
end,
max_level = 3,
color = "#cf532d",
need_target = true,
point_cost = 1,
price = 30,
callbacks = {
on_cast = function(ctx)
give_status_effect("VULNERABLE", ctx.target, 1 + ctx.level)
return nil
end
}
})

View File

@ -0,0 +1,21 @@
register_card("SHIELD_BASH", {
name = "Shield Bash",
description = "Deal 4 (+2 for each upgrade) damage to the enemy and gain " .. highlight("block") ..
" status effect equal to the damage dealt.",
state = function(ctx)
return "Deal " .. highlight(4 + ctx.level * 2) .. " damage to the enemy and gain " .. highlight("block") ..
" status effect equal to the damage dealt."
end,
max_level = 1,
color = "#ff5722",
need_target = true,
point_cost = 1,
price = 40,
callbacks = {
on_cast = function(ctx)
local damage = deal_damage(ctx.caster, 4 + ctx.level * 2)
give_status_effect("BLOCK", ctx.caster, damage)
return nil
end
}
})

View File

@ -24,4 +24,23 @@ register_enemy("RUST_MITE", {
return nil
end
}
})
})
register_status_effect("RITUAL", {
name = "Ritual",
description = "Gain strength each round",
look = "Rit",
foreground = "#bb3e03",
state = function(ctx)
return nil
end,
can_stack = true,
decay = DECAY_NONE,
rounds = 0,
callbacks = {
on_player_turn = function(ctx)
local guid = give_status_effect("STRENGTH", ctx.owner)
set_status_effect_stacks(guid, 3 + ctx.stacks)
end
}
})

View File

@ -41,6 +41,24 @@ register_enemy("SHADOW_ASSASSIN", {
deal_damage(ctx.guid, PLAYER_ID, 5)
end
return nil
end
}
})
register_status_effect("BLEED", {
name = "Bleed",
description = "Losing some red sauce.",
look = "Bld",
foreground = "#ff0000",
state = function(ctx)
return nil
end,
can_stack = false,
decay = DECAY_ONE,
rounds = 2,
callbacks = {
on_turn = function(ctx)
return nil
end
}

View File

@ -1,166 +0,0 @@
--
-- Negative Status Effects
--
register_status_effect("WEAKEN", {
name = "Weaken",
description = "Weakens damage for each stack",
look = "W",
foreground = "#ed985f",
state = function()
return "Deals " .. highlight(ctx.stacks * 2) .. " less damage"
end,
can_stack = true,
decay = DECAY_ALL,
rounds = 1,
callbacks = {
on_damage_calc = function(ctx)
if ctx.source == ctx.owner then
return ctx.damage - ctx.stacks * 2
end
return ctx.damage
end
}
})
register_status_effect("VULNERABLE", {
name = "Vulnerable",
description = "Increases received damage for each stack",
look = "Vur",
foreground = "#ffba08",
state = function(ctx)
return "Takes " .. highlight(ctx.stacks * 25) .. "% more damage"
end,
can_stack = true,
decay = DECAY_ONE,
rounds = 1,
callbacks = {
on_damage_calc = function(ctx)
if ctx.target == ctx.owner then
return ctx.damage * (1.0 + 0.25 * ctx.stacks)
end
return ctx.damage
end
}
})
register_status_effect("BURN", {
name = "Burning",
description = "The enemy burns and receives damage.",
look = "Brn",
foreground = "#d00000",
state = function(ctx)
return "Takes " .. highlight(ctx.stacks * 4) .. " damage per turn"
end,
can_stack = true,
decay = DECAY_ALL,
rounds = 1,
callbacks = {
on_turn = function(ctx)
deal_damage(ctx.guid, ctx.owner, ctx.stacks * 2, true)
return nil
end
}
})
--
-- Positive Status Effects
--
register_status_effect("STRENGTH", {
name = "Strength",
description = "Increases damage for each stack",
look = "Str",
foreground = "#d00000",
state = function(ctx)
return "Deal " .. highlight(ctx.stacks) .. " more damage"
end,
can_stack = true,
decay = DECAY_ALL,
rounds = 1,
callbacks = {
on_damage_calc = function(ctx)
if ctx.source == ctx.owner then
return ctx.damage + ctx.stacks
end
return ctx.damage
end
}
})
register_status_effect("BLOCK", {
name = "Block",
description = "Decreases incoming damage for each stack",
look = "Blk",
foreground = "#219ebc",
state = function(ctx)
return "Takes " .. highlight(ctx.stacks) .. " less damage"
end,
can_stack = true,
decay = DECAY_ALL,
rounds = 1,
order = 100,
callbacks = {
on_damage_calc = function(ctx)
if ctx.target == ctx.owner then
add_status_effect_stacks(ctx.guid, -ctx.damage)
return ctx.damage - ctx.stacks
end
return ctx.damage
end
}
})
register_status_effect("RITUAL", {
name = "Ritual",
description = "Gain strength each round",
look = "Rit",
foreground = "#bb3e03",
state = function(ctx)
return nil
end,
can_stack = true,
decay = DECAY_NONE,
rounds = 0,
callbacks = {
on_player_turn = function(ctx)
local guid = give_status_effect("STRENGTH", ctx.owner)
set_status_effect_stacks(guid, 3 + ctx.stacks)
end
}
})
register_status_effect("FEAR", {
name = "Fear",
description = "Can't act.",
look = "Fear",
foreground = "#bb3e03",
state = function(ctx)
return "Can't act for " .. highlight(ctx.stacks) .. " turns"
end,
can_stack = true,
decay = DECAY_ONE,
rounds = 1,
callbacks = {
on_turn = function(ctx)
return true
end
}
})
register_status_effect("BLEED", {
name = "Bleed",
description = "Losing some red sauce.",
look = "Bld",
foreground = "#ff0000",
state = function(ctx)
return nil
end,
can_stack = false,
decay = DECAY_ONE,
rounds = 2,
callbacks = {
on_turn = function(ctx)
return true
end
}
})

View File

@ -0,0 +1,22 @@
register_status_effect("BLOCK", {
name = "Block",
description = "Decreases incoming damage for each stack",
look = "Blk",
foreground = "#219ebc",
state = function(ctx)
return "Takes " .. highlight(ctx.stacks) .. " less damage"
end,
can_stack = true,
decay = DECAY_ALL,
rounds = 1,
order = 100,
callbacks = {
on_damage_calc = function(ctx)
if ctx.target == ctx.owner then
add_status_effect_stacks(ctx.guid, -ctx.damage)
return ctx.damage - ctx.stacks
end
return ctx.damage
end
}
})

View File

@ -0,0 +1,18 @@
register_status_effect("BURN", {
name = "Burning",
description = "The enemy burns and receives damage.",
look = "Brn",
foreground = "#d00000",
state = function(ctx)
return "Takes " .. highlight(ctx.stacks * 4) .. " damage per turn"
end,
can_stack = true,
decay = DECAY_ALL,
rounds = 1,
callbacks = {
on_turn = function(ctx)
deal_damage(ctx.guid, ctx.owner, ctx.stacks * 2, true)
return nil
end
}
})

View File

@ -0,0 +1,17 @@
register_status_effect("FEAR", {
name = "Fear",
description = "Can't act.",
look = "Fear",
foreground = "#bb3e03",
state = function(ctx)
return "Can't act for " .. highlight(ctx.stacks) .. " turns"
end,
can_stack = true,
decay = DECAY_ONE,
rounds = 1,
callbacks = {
on_turn = function(ctx)
return true
end
}
})

View File

@ -0,0 +1,20 @@
register_status_effect("STRENGTH", {
name = "Strength",
description = "Increases damage for each stack",
look = "Str",
foreground = "#d00000",
state = function(ctx)
return "Deal " .. highlight(ctx.stacks) .. " more damage"
end,
can_stack = true,
decay = DECAY_ALL,
rounds = 1,
callbacks = {
on_damage_calc = function(ctx)
if ctx.source == ctx.owner then
return ctx.damage + ctx.stacks
end
return ctx.damage
end
}
})

View File

@ -0,0 +1,20 @@
register_status_effect("VULNERABLE", {
name = "Vulnerable",
description = "Increases received damage for each stack",
look = "Vur",
foreground = "#ffba08",
state = function(ctx)
return "Takes " .. highlight(ctx.stacks * 25) .. "% more damage"
end,
can_stack = true,
decay = DECAY_ONE,
rounds = 1,
callbacks = {
on_damage_calc = function(ctx)
if ctx.target == ctx.owner then
return ctx.damage * (1.0 + 0.25 * ctx.stacks)
end
return ctx.damage
end
}
})

View File

@ -0,0 +1,20 @@
register_status_effect("WEAKEN", {
name = "Weaken",
description = "Weakens damage for each stack",
look = "W",
foreground = "#ed985f",
state = function()
return "Deals " .. highlight(ctx.stacks * 2) .. " less damage"
end,
can_stack = true,
decay = DECAY_ALL,
rounds = 1,
callbacks = {
on_damage_calc = function(ctx)
if ctx.source == ctx.owner then
return ctx.damage - ctx.stacks * 2
end
return ctx.damage
end
}
})