56 lines
4.3 KiB
C#
56 lines
4.3 KiB
C#
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using KernelPanic.Core;
|
|
|
|
namespace KernelPanic.Combat
|
|
{
|
|
public sealed class CppSizeofDamageEffect : ICardEffect
|
|
{
|
|
public void Execute(CombatContext context)
|
|
{
|
|
int count = context.HandController.Cards.Count(c => c.Definition?.Language is Language.C or Language.CPlusPlus);
|
|
int amount = SizeofDamageEffect.DamagePerCard * count;
|
|
new DealDamageEffect(amount, amount, Language.CPlusPlus).Execute(context);
|
|
}
|
|
}
|
|
|
|
public static partial class CardCatalog
|
|
{
|
|
private static void AddEvolvedCards(List<CardCatalogEntry> entries)
|
|
{
|
|
const string cpp = " Full overkill spills. No segfault recoil.";
|
|
void Add(string id, CardTargeting target, bool bleeding, string rules, params CardEffectSpec[] effects)
|
|
=> entries.Add(new CardCatalogEntry(id, target, bleeding, rules, effects));
|
|
CardEffectSpec Typed(int amount, bool all = false) => new(CardEffectKind.Damage, amount,
|
|
language: Language.TypeScript, allEnemies: all, canCrit: false);
|
|
Add("lang_cpp_malloc", Single, true, "deal {amount:0}." + cpp, Damage(12, Language.CPlusPlus));
|
|
Add("lang_cpp_printf", Single, true, "deal {amount:0}. repair {amount:1} corrupted cards." + cpp,
|
|
Damage(4, Language.CPlusPlus), Fx(CardEffectKind.RepairCorruptedCards, 2));
|
|
Add("lang_cpp_pointer", Single, true, "deal {amount:0}; {secondary:0} if the previous card was C++." + cpp,
|
|
Fx(CardEffectKind.PreviousLanguageDamage, 9, secondary: 15, language: Language.CPlusPlus));
|
|
Add("shop_cpp_free", Single, true, "deal {amount:0}. repair {amount:1} corrupted cards. draw 2 (fixed)." + cpp,
|
|
Damage(18, Language.CPlusPlus), Fx(CardEffectKind.RepairCorruptedCards, 2), Fx(CardEffectKind.FixedDraw, 2));
|
|
Add("shop_cpp_sizeof", Single, true, "deal {raw:0} x C and C++ cards in hand." + cpp,
|
|
Fx(CardEffectKind.SizeofDamage, SizeofDamageEffect.DamagePerCard, language: Language.CPlusPlus));
|
|
Add("shop_cpp_kernel_exploit", Single, true, "deal {amount:0} ignoring Shield." + cpp, Damage(36, Language.CPlusPlus, trueDamage: true));
|
|
Add("shop_cpp_gdb", None, false, "repair {amount:0} corrupted cards. draw {amount:1}.", Fx(CardEffectKind.RepairCorruptedCards, 3), Draw(2));
|
|
Add("shop_cpp_valgrind", None, false, "repair {amount:0} corrupted cards. gain {shield:1} Shield.", Fx(CardEffectKind.RepairCorruptedCards, 4), Shield(9));
|
|
Add("shop_cpp_memcpy", Single, true, "deal {amount:0}. draw 1 (fixed)." + cpp, Damage(6, Language.CPlusPlus), Fx(CardEffectKind.FixedDraw, 1));
|
|
Add("shop_cpp_memset", All, true, "deal {amount:0} to all enemies." + cpp, Damage(4, Language.CPlusPlus, all: true));
|
|
Add("shop_cpp_realloc", Single, true, "deal {amount:0}. repair {amount:1} corrupted cards." + cpp, Damage(12, Language.CPlusPlus), Fx(CardEffectKind.RepairCorruptedCards, 3));
|
|
const string fixedHit = " Fixed damage; cannot crit.";
|
|
Add("lang_ts_console_log", Single, true, "deal {amount:0}." + fixedHit, Typed(6));
|
|
Add("lang_ts_fetch", Single, true, "deal {amount:0}." + fixedHit, Typed(9));
|
|
Add("lang_ts_typeof", Single, true, "deal {amount:0}. Always succeeds." + fixedHit, Typed(11));
|
|
Add("shop_ts_math_random", Single, true, "deal {amount:0}." + fixedHit, Typed(11));
|
|
Add("shop_ts_promise_all", Single, true, "deal {amount:0} three times." + fixedHit, Typed(7), Typed(7), Typed(7));
|
|
Add("shop_ts_spread", None, false, "copy the lowest-cost card in hand. gain {shield:1} Shield.", Fx(CardEffectKind.CopyLowestCostHandCard), Shield(3));
|
|
Add("shop_ts_array_map", All, true, "deal {amount:0} to each enemy." + fixedHit, Typed(4, true));
|
|
Add("shop_ts_promise_resolve", Single, true, "deal {amount:0}." + fixedHit, Typed(3));
|
|
Add("shop_ts_try_catch", None, false, "gain {shield:0} Shield. cleanse harmful statuses.", Shield(8), Fx(CardEffectKind.Cleanse));
|
|
Add("shop_ts_json_parse", Single, true, "deal {amount:0}. draw 1 (fixed)." + fixedHit, Typed(6), Fx(CardEffectKind.FixedDraw, 1));
|
|
Add("shop_ts_eval", Single, true, "deal {amount:0}." + fixedHit, Typed(15));
|
|
}
|
|
}
|
|
}
|