Files
linuxdistro-roguelite/Assets/Scripts/Combat/EvolvedLanguageCards.cs
T

55 lines
4.2 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);
new DealDamageEffect(6 * count, 6 * count, 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(15, Language.CPlusPlus));
Add("lang_cpp_printf", Single, true, "deal {amount:0}. repair {amount:1} corrupted cards." + cpp,
Damage(6, 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, 12, secondary: 20, language: Language.CPlusPlus));
Add("shop_cpp_free", Single, true, "deal {amount:0}. repair {amount:1} corrupted cards. draw 2 (fixed)." + cpp,
Damage(22, Language.CPlusPlus), Fx(CardEffectKind.RepairCorruptedCards, 2), Fx(CardEffectKind.FixedDraw, 2));
Add("shop_cpp_sizeof", Single, true, "deal 6 x C and C++ cards in hand." + cpp,
Fx(CardEffectKind.SizeofDamage, 6, language: Language.CPlusPlus));
Add("shop_cpp_kernel_exploit", Single, true, "deal {amount:0} ignoring Shield." + cpp, Damage(40, 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(9, Language.CPlusPlus), Fx(CardEffectKind.FixedDraw, 1));
Add("shop_cpp_memset", All, true, "deal {amount:0} to all enemies." + cpp, Damage(6, Language.CPlusPlus, all: true));
Add("shop_cpp_realloc", Single, true, "deal {amount:0}. repair {amount:1} corrupted cards." + cpp, Damage(16, Language.CPlusPlus), Fx(CardEffectKind.RepairCorruptedCards, 3));
const string fixedHit = " Fixed damage; no critical roll.";
Add("lang_ts_console_log", Single, true, "deal {amount:0}." + fixedHit, Typed(9));
Add("lang_ts_fetch", Single, true, "deal {amount:0}." + fixedHit, Typed(13));
Add("lang_ts_typeof", Single, true, "deal {amount:0}. Always succeeds." + fixedHit, Typed(16));
Add("shop_ts_math_random", Single, true, "deal {amount:0}." + fixedHit, Typed(20));
Add("shop_ts_promise_all", Single, true, "deal {amount:0} three times." + fixedHit, Typed(10), Typed(10), Typed(10));
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(6, true));
Add("shop_ts_promise_resolve", Single, true, "deal {amount:0}." + fixedHit, Typed(5));
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(9), Fx(CardEffectKind.FixedDraw, 1));
Add("shop_ts_eval", Single, true, "deal {amount:0}." + fixedHit, Typed(30));
}
}
}