return function(mod) mod.content.statuses:register("TUTORIAL_CURSE", { label = "CURSE", hudLabel = "CRS", cureOnSwitch = true, residual = function(battler) local mon = battler.mon local damage = math.max(1, math.floor(mon.stats.hp / 16)) mon.hp = math.max(0, mon.hp - damage) return { battler.name .. " is cursed!" } end, }) mod.content.move_effects:register("TUTORIAL_CURSE_EFFECT", { kind = "primary", accuracyChecked = true, run = function(ctx) return ctx.inflict(ctx.target, "TUTORIAL_CURSE") end, }) mod.content.moves:register("TUTORIAL_CURSE_MOVE", { id = "TUTORIAL_CURSE_MOVE", name = "CURSE", type = "GHOST", category = "status", power = 0, accuracy = 100, pp = 10, effect = "TUTORIAL_CURSE_EFFECT", }) mod.content.pokemon:patch("ABRA", { learnset = { __append = { { level = 5, move = "TUTORIAL_CURSE_MOVE" } } }, }) mod.content.maps:patch("PALLET_TOWN", { objects = { __append = { { index = 93, x = 10, y = 7, sprite = "SPRITE_SCIENTIST", movement = "STAY", range = "NONE", text = "TEXT_TUTORIAL_CURSE_GIVER", name = "TUTORIAL_CURSE_GIVER", }, } }, }) mod.content.map_scripts:register("PALLET_TOWN", { talk = { TEXT_TUTORIAL_CURSE_GIVER = { { "check_flag", "mod:abra_given" }, { "jump_if_true", "after" }, { "give_pokemon", "ABRA", 5, true }, { "jump_if_false", "full" }, { "set_field", "mod:abra_given", true }, { "show_text", "This ABRA knows\nCURSE. Try a battle!" }, { "jump", "end" }, { "label", "full" }, { "show_text", "Make room and\ntalk again." }, { "jump", "end" }, { "label", "after" }, { "show_text", "Watch CURSE deal\ndamage each turn." }, { "label", "end" }, }, }, }) end