## ## CONFIG.lua ################################################################################################ { -- Global CONFIG for customizing RC behaviors CONFIG = { } CONFIG.emojis = true } ## ## BEGIN ################################################################################################ : rc_msg("Initializing magus.rc ...") : crawl.enable_more(false) ## ## Globals/Globals.rc ################################################################################################ # PAUSE variable for ForceMorePrompts.rc $PAUSE_MORE := PAUSE ## ## Globals/Globals.lua ################################################################################################ { -- Pause for AnnounceDamage.lua PAUSE_MORE = "PAUSE" -- Standard Colors (ignoring black, not visible) COLORS = { } COLORS.lightgrey = "lightgrey" COLORS.white = "white" COLORS.blue = "blue" COLORS.lightblue = "lightblue" COLORS.green = "green" COLORS.lightgreen = "lightgreen" COLORS.cyan = "cyan" COLORS.lightcyan = "lightcyan" COLORS.red = "red" COLORS.lightred = "lightred" COLORS.magenta = "magenta" COLORS.lightmagenta = "lightmagenta" COLORS.yellow = "yellow" COLORS.brown = "brown" } ## ## Utils.lua ################################################################################################ { function withColor(color, str) return string.format("<%s>%s", color, str, color) end function rc_out(symbol, color, msg, channel) -- crawl_mpr source -- https://sourcegraph.com/search?q=context%3Aglobal+repo%3A%5Egithub%5C.com%2Fcrawl%2Fcrawl%24+file%3A%5Ecrawl-ref%2Fsource%2Fl-crawl%5C.cc+crawl_mpr&patternType=standard&sm=1&groupBy=path -- -- static const string message_channel_names[] = -- { -- "plain", "friend_action", "prompt", "god", "duration", "danger", "warning", -- "recovery", "sound", "talk", "talk_visual", "intrinsic_gain", -- "mutation", "monster_spell", "monster_enchant", "friend_spell", -- "friend_enchant", "monster_damage", "monster_target", "banishment", -- "equipment", "floor", "multiturn", "examine", "examine_filter", "diagnostic", -- "error", "tutorial", "orb", "timed_portal", "hell_effect", "monster_warning", -- "dgl_message", -- }; crawl.mpr(string.format("%s %s", symbol, withColor(color, msg)), channel) end function rc_msg(msg) rc_out("๐Ÿค–", "blue", msg, "diagnostic") end function rc_scs(msg) rc_out("โœ…", "green", msg, "diagnostic") end function rc_err(msg) rc_out("โŒ", "lightred", msg, "danger") end function rc_warn(msg) rc_out("โš ๏ธ", "yellow", msg, "warning") end function table_has(table, match) for index, value in ipairs(table) do if value == match then return true end end return false end } ## ## AnnounceDamage.lua ################################################################################################ ############### # Damage Calc # ############### { local previous_hp = 0 local previous_mp = 0 local previous_form = "" local was_berserk_last_turn = false -- Helper function to generate status messages and reduce code duplication. local function announce_change(change_type, diff, current, max) local percentage = current / max local status_color local template if change_type == "hp_loss" then if percentage <= 0.30 then status_color = "lightred" elseif percentage <= 0.50 then status_color = "red" elseif percentage <= 0.70 then status_color = "yellow" elseif percentage <= 0.90 then status_color = "lightgrey" else status_color = "green" end --template = "You take %d damage,<%s> and have %d/%d hp." template = "%d ๋งŒํผ hp ํ”ผํ•ด,<%s> ํ˜„์žฌ hp %d/%d." crawl.mpr(string.format(template, diff, status_color, current, max, status_color)) elseif change_type == "hp_gain" then if percentage <= 0.30 then status_color = "lightred" elseif percentage <= 0.50 then status_color = "red" elseif percentage <= 0.70 then status_color = "yellow" elseif percentage <= 0.90 then status_color = "lightgrey" else status_color = "green" end --template = "You regained %d hp,<%s> and now have %d/%d hp." template = "%d ๋งŒํผ hp ํšŒ๋ณต,<%s> ํ˜„์žฌ hp %d/%d." crawl.mpr(string.format(template, diff, status_color, current, max, status_color)) elseif change_type == "mp_gain" then if percentage < 0.25 then status_color = "red" elseif percentage < 0.50 then status_color = "yellow" else status_color = "green" end --template = "You regained %d mp,<%s> and now have %d/%d mp." template = "%d ๋งŒํผ mp ํšŒ๋ณต,<%s> ํ˜„์žฌ mp %d/%d." crawl.mpr(string.format(template, diff, status_color, current, max, status_color)) elseif change_type == "mp_loss" then if percentage <= (max / 5) then status_color = "red" elseif percentage <= (max / 2) then status_color = "yellow" else status_color = "green" end --template = "You now have <%s>%d/%d mp." template = "ํ˜„์žฌ mp<%s>%d/%d." -- The original message for losing MP doesn't include the difference amount. crawl.mpr(string.format(template, status_color, current, max, status_color)) end end function AnnounceDamage() local current_hp, max_hp = you.hp() local current_mp, max_mp = you.mp() local current_form = you.transform() local you_are_berserk = you.berserk() local max_hp_increased = false local max_hp_decreased = false if (current_form ~= previous_form) then if (previous_form:find("dragon") or previous_form:find("statue") or previous_form:find("tree") or previous_form:find("ice")) then max_hp_decreased = true elseif (current_form:find("dragon") or current_form:find("statue") or current_form:find("tree") or current_form:find("ice")) then max_hp_increased = true end end if (was_berserk_last_turn and not you_are_berserk) then max_hp_decreased = true elseif (you_are_berserk and not was_berserk_last_turn) then max_hp_increased = true end --Skips message on initializing game if previous_hp > 0 then if max_hp_increased or max_hp_decreased then if max_hp_increased then crawl.mpr("ํ˜„์žฌ " .. current_hp .. "/" .. max_hp .. " hp.") else crawl.mpr("ํ˜„์žฌ " .. current_hp .. "/" .. max_hp .. " hp.") end else --On losing health if (current_hp < previous_hp) then local hp_difference = previous_hp - current_hp announce_change("hp_loss", hp_difference, current_hp, max_hp) if hp_difference > (max_hp * 0.20) then crawl.mpr("์•…! ์ด๊ฑด ์ •๋ง๋กœ ์•„ํ”„๋‹ค!") end end --On gaining more than 1 health if (current_hp > previous_hp) then local health_gained = current_hp - previous_hp if (health_gained > 1) and not (current_hp == max_hp) then announce_change("hp_gain", health_gained, current_hp, max_hp) end if (current_hp == max_hp) then crawl.mpr("hp ๊ฐ€๋“ ์ฐธ: " .. current_hp .. "") end end --On gaining more than 1 magic if (current_mp > previous_mp) then local mp_gained = current_mp - previous_mp if (mp_gained > 1) and not (current_mp == max_mp) then announce_change("mp_gain", mp_gained, current_mp, max_mp) end if (current_mp == max_mp) then crawl.mpr("mp ๊ฐ€๋“ ์ฐธ: " .. current_mp .. "") end end --On losing magic if current_mp < previous_mp then local mp_difference = previous_mp - current_mp announce_change("mp_loss", mp_difference, current_mp, max_mp) end end end --Set previous hp/mp and form at end of turn previous_hp = current_hp previous_mp = current_mp previous_form = current_form was_berserk_last_turn = you_are_berserk end } ## ## OpenSkills.lua ################################################################################################ { -- Open skills menu at start of runs local is_gnoll = table_has({"Gnoll"}, you.race()) local need_skills_opened = not is_gnoll local function start_open_skills() if you.turns() == 0 and need_skills_opened then need_skills_opened = false crawl.sendkeys("m") end end -- Runs once when parsed during rc init start_open_skills() } ## ## PickupEquipment.lua ################################################################################################ { -- ์ด ๋ณ€์ˆ˜๋“ค์€ ํ˜„์žฌ ์Šคํฌ๋ฆฝํŠธ์—์„œ๋Š” ์‚ฌ์šฉ๋˜์ง€ ์•Š์ง€๋งŒ, ํ–ฅํ›„ ํ™•์žฅ์„ฑ์„ ์œ„ํ•ด ๋‚จ๊ฒจ๋‘ก๋‹ˆ๋‹ค. local favor_egos = false local favor_plus = false -- ์•„์ดํ…œ์ด ๋ธŒ๋žœ๋“œ(์˜ˆ: ํ™”์—ผ, ๋ƒ‰๊ธฐ)๋‚˜ ์—๊ณ (์˜ˆ: ์ €ํ•ญ, ๋น„ํ–‰)๋ฅผ ๊ฐ€์กŒ๋Š”์ง€ ํ™•์ธํ•ฉ๋‹ˆ๋‹ค. local function is_branded_ego(item) return item.branded or item.ego() end -- ์•„์ดํ…œ์ด ๋งˆ๋ฒ• ์†์„ฑ(๋ธŒ๋žœ๋“œ, ์—๊ณ , ์•„ํ‹ฐํŒฉํŠธ)์„ ๊ฐ€์กŒ๋Š”์ง€ ํ™•์ธํ•ฉ๋‹ˆ๋‹ค. local function is_magical(item) return is_branded_ego(item) or item.artefact end -- ์•„์ดํ…œ์ด nil์ผ ๊ฒฝ์šฐ๋ฅผ ๋Œ€๋น„ํ•œ ๋ฌธ์ž์—ด local nil_item = "item: nil"; -- (๋””๋ฒ„๊น…์šฉ) ์•„์ดํ…œ์˜ ์ƒ์„ธ ์ •๋ณด๋ฅผ ๋ฌธ์ž์—ด๋กœ ๋ฐ˜ํ™˜ํ•ฉ๋‹ˆ๋‹ค. local function debug_item(item) if item == nil then return nil_item end local qual = item.name("qual"); local subtype = item.subtype(); if qual == nil or subtype == nil then return nil_item end local magical = tostring(is_magical(item)); local plus = tostring(item.plus); return string.format("name: %s; subtype: %s, magical: %s, plus: %s", qual, subtype, magical, plus) end -- ==================================================================== -- ๋ฆฌํŒฉํ„ฐ๋ง๋œ ํ—ฌํผ ํ•จ์ˆ˜๋“ค (Refactored Helper Functions) -- ==================================================================== --- ์ธ๋ฒคํ† ๋ฆฌ์— ํŠน์ • ์ด๋ฆ„์„ ๊ฐ€์ง„ ์•„์ดํ…œ์ด ์žˆ๋Š”์ง€ ํ™•์ธํ•ฉ๋‹ˆ๋‹ค. -- @param item_name ํ™•์ธํ•  ์•„์ดํ…œ์˜ ์ „์ฒด ์ด๋ฆ„ (์˜ˆ: "orb of destruction") -- @return boolean ํ•ด๋‹น ์•„์ดํ…œ์„ ๊ฐ€์ง€๊ณ  ์žˆ์œผ๋ฉด true local function has_item_in_inventory(item_name) for item in items.inventory() do if item.name() == item_name then return true end end return false end --- ํ˜„์žฌ ์ฐฉ์šฉํ•œ ์•„์ดํ…œ(cur)์ด ์ด๋ฏธ ์ถฉ๋ถ„ํžˆ ์ข‹์•„์„œ -- ๋‹ค๋ฅธ ์•„์ดํ…œ์„ ์ฃผ์šธ ํ•„์š”๊ฐ€ ์—†๋Š”์ง€ ํ™•์ธํ•ฉ๋‹ˆ๋‹ค. -- @param cur ํ˜„์žฌ ์ฐฉ์šฉ ์ค‘์ธ ์•„์ดํ…œ -- @return boolean ์ค์ง€ ์•Š์•„์•ผ ํ•˜๋ฉด true local function is_pickup_declined(cur) -- ํ˜„์žฌ ์•„์ดํ…œ์ด nil์ด๊ฑฐ๋‚˜, ๋งˆ๋ฒ• ์†์„ฑ์ด ์—†์œผ๋ฉด ์ค๋Š” ๊ฒƒ์„ ๊ฑฐ์ ˆํ•  ์ด์œ ๊ฐ€ ์—†์Šต๋‹ˆ๋‹ค. if cur == nil or not is_magical(cur) then return false end -- ์ด๋ฏธ ๋งˆ๋ฒ• ์†์„ฑ์ด ๋ถ€์—ฌ๋œ ์•„์ดํ…œ์ด๋‚˜ ๋“œ๋ž˜๊ณค ๊ฐ‘์˜ท์„ ์ฐฉ์šฉ ์ค‘์ด๋ผ๋ฉด, -- ๋‹ค๋ฅธ ์•„์ดํ…œ์œผ๋กœ ๊ต์ฒดํ•˜๋Š” ๊ฒƒ์„ ๊ณ ๋ คํ•˜์ง€ ์•Š๊ณ  ์ค์ง€ ์•Š์Šต๋‹ˆ๋‹ค. local is_dragon_scales = string.find(cur.name("qual"), "dragon scale") if is_magical(cur) or is_dragon_scales then return true end return false end --- ๋ฐ”๋‹ฅ์˜ ์•„์ดํ…œ(i2)์ด ํ˜„์žฌ ์ฐฉ์šฉํ•œ ์•„์ดํ…œ(cur)์— ๋น„ํ•ด -- ๋ช…๋ฐฑํ•˜๊ฒŒ ๋” ์ข‹์€ ์—…๊ทธ๋ ˆ์ด๋“œ์ธ์ง€ ํ™•์ธํ•ฉ๋‹ˆ๋‹ค. -- @param cur ํ˜„์žฌ ์ฐฉ์šฉ ์ค‘์ธ ์•„์ดํ…œ -- @param i2 ๋ฐ”๋‹ฅ์— ์žˆ๋Š” ์•„์ดํ…œ -- @return boolean ๋ช…๋ฐฑํ•œ ์—…๊ทธ๋ ˆ์ด๋“œ์ผ ๊ฒฝ์šฐ true local function is_clear_upgrade(cur, i2) -- 1. ํ˜„์žฌ ์žฅ๋น„ ์Šฌ๋กฏ์ด ๋น„์–ด์žˆ์œผ๋ฉด ๋ฌด์กฐ๊ฑด ์ค์Šต๋‹ˆ๋‹ค. if cur == nil then return true end -- 2. ํ˜„์žฌ ์•„์ดํ…œ์ด ์ผ๋ฐ˜ ์•„์ดํ…œ์ธ๋ฐ, ๋ฐ”๋‹ฅ์˜ ์•„์ดํ…œ์— ๋งˆ๋ฒ• ์†์„ฑ์ด ๋ถ™์–ด์žˆ์œผ๋ฉด ์ค์Šต๋‹ˆ๋‹ค. local more_magical = not is_magical(cur) and is_magical(i2) if more_magical then return true end -- 3. ๋‘ ์•„์ดํ…œ์˜ ๊ธฐ๋ณธ ์ด๋ฆ„์ด ๊ฐ™์„ ๋•Œ, ๊ฐ•ํ™” ์ˆ˜์น˜๊ฐ€ ๋” ๋†’์œผ๋ฉด ์ค์Šต๋‹ˆ๋‹ค. local higher_plus = i2.plus ~= nil and i2.plus > (cur.plus or 0) if cur.name("qual") == i2.name("qual") and higher_plus then return true end return false end -- ==================================================================== -- ํ•ต์‹ฌ ๋กœ์ง ํ•จ์ˆ˜ (Core Logic Function) -- ==================================================================== --- ํ˜„์žฌ ์ฐฉ์šฉํ•œ ์•„์ดํ…œ(cur)๊ณผ ๋ฐ”๋‹ฅ์˜ ์•„์ดํ…œ(i2)์„ ๋น„๊ตํ•˜์—ฌ ์ฃผ์šธ์ง€ ์—ฌ๋ถ€๋ฅผ ์ตœ์ข… ๊ฒฐ์ •ํ•ฉ๋‹ˆ๋‹ค. -- @param cur ํ˜„์žฌ ์ฐฉ์šฉ ์ค‘์ธ ์•„์ดํ…œ -- @param i2 ๋ฐ”๋‹ฅ์— ์žˆ๋Š” ์•„์ดํ…œ -- @return boolean ์ฃผ์›Œ์•ผ ํ•˜๋ฉด true local function should_pickup(cur, i2) -- ์‹ ์ด ์„ ๋ฌผํ•œ ์•„์ดํ…œ์€ ํ•ญ์ƒ ์ค์Šต๋‹ˆ๋‹ค. if i2.god_gift then return true end -- 1. ์ค์ง€ ๋ง์•„์•ผ ํ•  ๋ช…๋ฐฑํ•œ ์ด์œ ๊ฐ€ ์žˆ๋Š”์ง€ ๋จผ์ € ํ™•์ธํ•ฉ๋‹ˆ๋‹ค. (์˜ˆ: ์ด๋ฏธ ์ข‹์€ ์•„ํ‹ฐํŒฉํŠธ ์ฐฉ์šฉ ์ค‘) if is_pickup_declined(cur) then return false end -- 2. ์ฃผ์›Œ์•ผ ํ•  ๋ช…๋ฐฑํ•œ ์ด์œ ๊ฐ€ ์žˆ๋Š”์ง€ ํ™•์ธํ•ฉ๋‹ˆ๋‹ค. (์˜ˆ: ๋นˆ ์Šฌ๋กฏ, ํ™•์‹คํ•œ ์„ฑ๋Šฅ ํ–ฅ์ƒ) if is_clear_upgrade(cur, i2) then return true end -- 3. ๊ทธ ์™ธ์˜ ๊ฒฝ์šฐ (ํ•˜๋“œ์ฝ”๋”ฉ๋œ ์„ค์ •๊ฐ’์— ๋”ฐ๋ผ ํŒ๋‹จ, ํ˜„์žฌ๋Š” ๋‘˜ ๋‹ค false) -- ๋งŒ์•ฝ ์—๊ณ /๋ธŒ๋žœ๋“œ ์•„์ดํ…œ์„ ์„ ํ˜ธํ•œ๋‹ค๋ฉด ์ค์Šต๋‹ˆ๋‹ค. if favor_egos and is_magical(i2) then return true end -- ๋งŒ์•ฝ ๊ฐ•ํ™” ์ˆ˜์น˜๋ฅผ ์„ ํ˜ธํ•˜๊ณ , ๊ฐ•ํ™” ์ˆ˜์น˜๊ฐ€ ๋” ๋†’๋‹ค๋ฉด ์ค์Šต๋‹ˆ๋‹ค. local higher_plus = i2.plus ~= nil and i2.plus > (cur.plus or 0) if favor_plus and higher_plus then return true end -- ์œ„์˜ ๋ชจ๋“  ์กฐ๊ฑด์— ํ•ด๋‹นํ•˜์ง€ ์•Š์œผ๋ฉด ๊ธฐ๋ณธ์ ์œผ๋กœ ์ค์ง€ ์•Š์Šต๋‹ˆ๋‹ค. return false end -- ์•„์ดํ…œ ์ข…๋ฅ˜์— ๋”ฐ๋ผ ํ•ด๋‹นํ•˜๋Š” ์žฅ๋น„ ์Šฌ๋กฏ์„ ์ฐพ์•„, ํ˜„์žฌ ์ฐฉ์šฉ ์ค‘์ธ ์•„์ดํ…œ์„ ๋ฐ˜ํ™˜ํ•ฉ๋‹ˆ๋‹ค. local item_subtype_equip_slot = { cloak="Cloak", helmet="Helmet", gloves="Gloves", boots="Boots", shield="Shield"} local function equip_slot(item_sub_type) -- ๊ฐ‘์˜ท(body armour)์˜ ๊ฒฝ์šฐ, ๋กœ์ปฌ๊ณผ ์›นํƒ€์ผ์—์„œ ์‚ฌ์šฉํ•˜๋Š” ์Šฌ๋กฏ ์ด๋ฆ„์ด ๋‹ฌ๋ผ ๋‘˜ ๋‹ค ์‹œ๋„ํ•ฉ๋‹ˆ๋‹ค. if item_sub_type == "body" then local body_armour = items.equipped_at("Body Armour"); local armour = items.equipped_at("Armour"); return body_armour or armour; end -- ๊ทธ ์™ธ ๋ฐฉ์–ด๊ตฌ๋Š” ํ…Œ์ด๋ธ”์„ ํ†ตํ•ด ์Šฌ๋กฏ์„ ์ฐพ์Šต๋‹ˆ๋‹ค. local equip_slot_name = item_subtype_equip_slot[item_sub_type]; return items.equipped_at(equip_slot_name); end --- ์ž๋™ ์Šต๋“ ๊ธฐ๋Šฅ์˜ ๋ฉ”์ธ ์ง„์ž… ํ•จ์ˆ˜์ž…๋‹ˆ๋‹ค. -- ๊ฒŒ์ž„ ๋‚ด์—์„œ ์•„์ดํ…œ์„ ๋ฐœ๊ฒฌํ•  ๋•Œ๋งˆ๋‹ค ํ˜ธ์ถœ๋ฉ๋‹ˆ๋‹ค. function pickup_equipment(it, name) local class = it.class(true) -- ์‹ ์—๊ฒŒ ๊ธˆ์ง€๋˜๊ฑฐ๋‚˜ ์“ธ๋ชจ์—†๋Š” ์•„์ดํ…œ์€ ์ค์ง€ ์•Š์Šต๋‹ˆ๋‹ค. if string.match(name, "forbidden") then return end if it.is_useless then return end -- ์•„ํ‹ฐํŒฉํŠธ๋Š” ํ•ญ์ƒ ์ค์Šต๋‹ˆ๋‹ค. if it.artefact then return true end if class == "weapon" then local currentWeapon = items.equipped_at("weapon"); -- ๋งจ์† ๊ฒฉํˆฌ ์ƒํƒœ์ผ ๋•Œ๋Š”, ์‹ ์˜ ์„ ๋ฌผ์„ ์ œ์™ธํ•˜๊ณ  ๋ฌด๊ธฐ๋ฅผ ์ค์ง€ ์•Š์Šต๋‹ˆ๋‹ค. if currentWeapon == nil then if it.god_gift then return true end return false end if should_pickup(currentWeapon, it) then return true end elseif class == "armour" then local sub_type = it.subtype(); -- ๋ฐœํ†ฑ์ด ์žˆ๋Š” ์ข…์กฑ์€ ์žฅ๊ฐ‘์„ ์ค์ง€ ์•Š์Šต๋‹ˆ๋‹ค. if sub_type == "gloves" and you.has_claws() > 0 then return end -- โ–ผโ–ผโ–ผโ–ผโ–ผโ–ผโ–ผโ–ผโ–ผโ–ผโ–ผโ–ผโ–ผโ–ผโ–ผโ–ผโ–ผโ–ผโ–ผโ–ผโ–ผโ–ผโ–ผโ–ผโ–ผโ–ผโ–ผโ–ผโ–ผโ–ผโ–ผโ–ผโ–ผโ–ผโ–ผโ–ผโ–ผโ–ผโ–ผโ–ผโ–ผโ–ผโ–ผโ–ผโ–ผโ–ผโ–ผโ–ผ -- ์ƒˆ๋กœ์šด ๋ฐฉํŒจ/๋ณด์ฃผ ๋กœ์ง -- โ–ผโ–ผโ–ผโ–ผโ–ผโ–ผโ–ผโ–ผโ–ผโ–ผโ–ผโ–ผโ–ผโ–ผโ–ผโ–ผโ–ผโ–ผโ–ผโ–ผโ–ผโ–ผโ–ผโ–ผโ–ผโ–ผโ–ผโ–ผโ–ผโ–ผโ–ผโ–ผโ–ผโ–ผโ–ผโ–ผโ–ผโ–ผโ–ผโ–ผโ–ผโ–ผโ–ผโ–ผโ–ผโ–ผโ–ผโ–ผ if sub_type == "shield" then local is_orb = string.find(it.name("qual"), "orb") if is_orb then -- [์˜ค๋ธŒ ๊ทœ์น™] ์ธ๋ฒคํ† ๋ฆฌ์— ๋™์ผํ•œ ์ด๋ฆ„์˜ ์˜ค๋ธŒ๊ฐ€ ์ด๋ฏธ ์žˆ๋‹ค๋ฉด ์ค์ง€ ์•Š์Šต๋‹ˆ๋‹ค. if has_item_in_inventory(it.name()) then return false -- ์ค‘๋ณต์ด๋ฏ€๋กœ ์ค์ง€ ์•Š์Œ else -- ์ธ๋ฒคํ† ๋ฆฌ์— ์—†๋Š” ์ƒˆ๋กœ์šด ์ข…๋ฅ˜์˜ ์˜ค๋ธŒ๋Š” ๋ฌด์กฐ๊ฑด ์ค์Šต๋‹ˆ๋‹ค. return true -- ์ƒˆ๋กœ์šด ์˜ค๋ธŒ์ด๋ฏ€๋กœ ์ค๊ธฐ end else -- ๋ฐฉํŒจ์ธ ๊ฒฝ์šฐ -- [๋ฐฉํŒจ ๊ทœ์น™] ๋ฐฉํŒจ์ˆ  ์Šคํ‚ฌ์ด 5๋ณด๋‹ค ์ž‘์œผ๋ฉด ์ค์ง€ ์•Š์Šต๋‹ˆ๋‹ค. if you.skill("Shields") < 5 then return -- ์Šคํ‚ฌ ๋ ˆ๋ฒจ์ด ๋‚ฎ์œผ๋ฏ€๋กœ ์ค์ง€ ์•Š์Œ end -- ์Šคํ‚ฌ ๋ ˆ๋ฒจ์ด ์ถฉ๋ถ„ํ•˜๋‹ค๋ฉด, ์•„๋ž˜์˜ ์ผ๋ฐ˜ ์žฅ๋น„ ๋น„๊ต ๋กœ์ง์„ ๋”ฐ๋ฆ…๋‹ˆ๋‹ค. end end -- โ–ฒโ–ฒโ–ฒโ–ฒโ–ฒโ–ฒโ–ฒโ–ฒโ–ฒโ–ฒโ–ฒโ–ฒโ–ฒโ–ฒโ–ฒโ–ฒโ–ฒโ–ฒโ–ฒโ–ฒโ–ฒโ–ฒโ–ฒโ–ฒโ–ฒโ–ฒโ–ฒโ–ฒโ–ฒโ–ฒโ–ฒโ–ฒโ–ฒโ–ฒโ–ฒโ–ฒโ–ฒโ–ฒโ–ฒโ–ฒโ–ฒโ–ฒโ–ฒโ–ฒโ–ฒโ–ฒโ–ฒโ–ฒ -- ํ˜„์žฌ ์ฐฉ์šฉํ•œ ์•„์ดํ…œ๊ณผ ๋น„๊ตํ•˜์—ฌ ์ฃผ์šธ์ง€ ๊ฒฐ์ •ํ•ฉ๋‹ˆ๋‹ค. local equipped_item = equip_slot(sub_type) if should_pickup(equipped_item, it) then return true end end return end -- ์Šคํฌ๋ฆฝํŠธ๊ฐ€ ๋กœ๋“œ๋  ๋•Œ, ์ด ํ•จ์ˆ˜๋ฅผ ๊ฒŒ์ž„์˜ ์ž๋™ ์Šต๋“ ๊ธฐ๋Šฅ์— ๋“ฑ๋กํ•ฉ๋‹ˆ๋‹ค. add_autopickup_func(pickup_equipment) } ## ## NoteVersion.lua ################################################################################################ { local didRun = false function note_version() if didRun then return end local version = "magus.rc [v1.11.6]" crawl.take_note(version) didRun = true end } function rc_msg(msg) rc_out("๐Ÿค–", "blue", msg, "diagnostic") end ## ## TurnReady.lua ################################################################################################ { -- Run every player turn function ready() -- rc_msg("Running ready function...") -- Display damage taken in log AnnounceDamage() note_version() end }