mirror of
https://github.com/BigJk/end_of_eden.git
synced 2026-02-06 10:48:09 +00:00
Move scripts into sub-directories.
This commit is contained in:
parent
c9504360df
commit
346ccda366
3
assets/scripts/_util.lua
Normal file
3
assets/scripts/_util.lua
Normal file
@ -0,0 +1,3 @@
|
||||
function highlight(val)
|
||||
return text_underline(text_bold("[" .. tostring(val) .. "]"))
|
||||
end
|
||||
@ -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
|
||||
}
|
||||
});
|
||||
14
assets/scripts/artifacts/bag_of_holding.lua
Normal file
14
assets/scripts/artifacts/bag_of_holding.lua
Normal 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
|
||||
}
|
||||
});
|
||||
14
assets/scripts/artifacts/deflector_shield.lua
Normal file
14
assets/scripts/artifacts/deflector_shield.lua
Normal 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
|
||||
}
|
||||
});
|
||||
14
assets/scripts/artifacts/gigantic_strength.lua
Normal file
14
assets/scripts/artifacts/gigantic_strength.lua
Normal 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
|
||||
}
|
||||
});
|
||||
14
assets/scripts/artifacts/gold_converter.lua
Normal file
14
assets/scripts/artifacts/gold_converter.lua
Normal 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
|
||||
}
|
||||
});
|
||||
14
assets/scripts/artifacts/holy_grail.lua
Normal file
14
assets/scripts/artifacts/holy_grail.lua
Normal 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
|
||||
}
|
||||
});
|
||||
12
assets/scripts/artifacts/juicy_fruit.lua
Normal file
12
assets/scripts/artifacts/juicy_fruit.lua
Normal 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
|
||||
}
|
||||
});
|
||||
12
assets/scripts/artifacts/radiant_seed.lua
Normal file
12
assets/scripts/artifacts/radiant_seed.lua
Normal 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
|
||||
}
|
||||
});
|
||||
14
assets/scripts/artifacts/repulsion_stone.lua
Normal file
14
assets/scripts/artifacts/repulsion_stone.lua
Normal 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
|
||||
}
|
||||
});
|
||||
16
assets/scripts/artifacts/short_radiance.lua
Normal file
16
assets/scripts/artifacts/short_radiance.lua
Normal 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
|
||||
}
|
||||
});
|
||||
14
assets/scripts/artifacts/spiked_plant.lua
Normal file
14
assets/scripts/artifacts/spiked_plant.lua
Normal 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
|
||||
}
|
||||
});
|
||||
@ -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
|
||||
}
|
||||
})
|
||||
18
assets/scripts/cards/_debug.lua
Normal file
18
assets/scripts/cards/_debug.lua
Normal 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
|
||||
}
|
||||
})
|
||||
20
assets/scripts/cards/berserker_rage.lua
Normal file
20
assets/scripts/cards/berserker_rage.lua
Normal 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
|
||||
}
|
||||
})
|
||||
18
assets/scripts/cards/block.lua
Normal file
18
assets/scripts/cards/block.lua
Normal 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
|
||||
}
|
||||
})
|
||||
49
assets/scripts/cards/block_spikes.lua
Normal file
49
assets/scripts/cards/block_spikes.lua
Normal 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
|
||||
}
|
||||
})
|
||||
18
assets/scripts/cards/combined_shot.lua
Normal file
18
assets/scripts/cards/combined_shot.lua
Normal 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
|
||||
}
|
||||
})
|
||||
18
assets/scripts/cards/fear.lua
Normal file
18
assets/scripts/cards/fear.lua
Normal 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
|
||||
}
|
||||
})
|
||||
18
assets/scripts/cards/melee_hit.lua
Normal file
18
assets/scripts/cards/melee_hit.lua
Normal 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
|
||||
}
|
||||
})
|
||||
22
assets/scripts/cards/radiant_seed.lua
Normal file
22
assets/scripts/cards/radiant_seed.lua
Normal 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
|
||||
}
|
||||
})
|
||||
18
assets/scripts/cards/rupture.lua
Normal file
18
assets/scripts/cards/rupture.lua
Normal 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
|
||||
}
|
||||
})
|
||||
21
assets/scripts/cards/shield_bash.lua
Normal file
21
assets/scripts/cards/shield_bash.lua
Normal 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
|
||||
}
|
||||
})
|
||||
@ -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
|
||||
}
|
||||
})
|
||||
|
||||
@ -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
|
||||
}
|
||||
|
||||
@ -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
|
||||
}
|
||||
})
|
||||
22
assets/scripts/status_effects/block.lua
Normal file
22
assets/scripts/status_effects/block.lua
Normal 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
|
||||
}
|
||||
})
|
||||
18
assets/scripts/status_effects/burn.lua
Normal file
18
assets/scripts/status_effects/burn.lua
Normal 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
|
||||
}
|
||||
})
|
||||
17
assets/scripts/status_effects/fear.lua
Normal file
17
assets/scripts/status_effects/fear.lua
Normal 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
|
||||
}
|
||||
})
|
||||
20
assets/scripts/status_effects/strength.lua
Normal file
20
assets/scripts/status_effects/strength.lua
Normal 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
|
||||
}
|
||||
})
|
||||
20
assets/scripts/status_effects/vulnerable.lua
Normal file
20
assets/scripts/status_effects/vulnerable.lua
Normal 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
|
||||
}
|
||||
})
|
||||
20
assets/scripts/status_effects/weaken.lua
Normal file
20
assets/scripts/status_effects/weaken.lua
Normal 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
|
||||
}
|
||||
})
|
||||
Loading…
Reference in New Issue
Block a user