{"name":"deathcape","enabled":true,"description":"Track and display deathcape activity. Type DEATHCAPE for usage.","type":"group","id":1,"items":[{"type":"function","name":"Read_Me","enabled":true,"id":15,"code":"/* \n\nDeathcape v1.0.0\nby: Zahan of Achaea\n\n\nTracks deathcape kills and counts down to fade in the character window.\nFixes \"lifesteal\" interface bug.\n\n------------------------------\n\nUse DEATHCAPE in-game for options, settings, and/or syntaxes.\n\n------------------------------\n\nIf you have any problems or questions, send me a msg in the game or on the forum.\n\nThis plugin is provided for free but donations to Zahan (achaea) are always appreciated, no matter how small!\n\n\n\n------------------------------\n\nVersion notes:\n- initial release\n\n*/","items":[]},{"type":"alias","name":"","enabled":true,"id":11,"matching":"exact","whole_words":false,"case_sensitive":false,"prefix_suffix":true,"actions":[{"action":"script","script":"if (typeof deathcape === \"undefined\")\n send_command(\"deathcape reload\");\n\nlet check_on = function () {\n if (deathcape.on)\n return \"ON\";\n else\n return \"OFF\";\n};\nlet line = \"Deathcape tracking is currently: \"+check_on()+\".\" +\n \"\\nSyntax:\" +\n \"\\n DEATHCAPE OFF|ON\" +\n \"\\n DEATHCAPE ADD\" +\n \"\\n DEATHCAPE KILLS <#>\" +\n \"\\n DEATHCAPE CLEAR\"\n;\ndisplay_notice(line);"}],"text":"deathcape"},{"type":"group","name":"Functions","enabled":true,"id":14,"items":[{"type":"function","name":"onLoad","enabled":true,"id":3,"code":"// Initialize\nif (typeof deathcape === \"undefined\") {\n deathcape = {\n minute: parseInt(0),\n second: parseInt(0),\n kills: parseInt(0),\n old: {},\n on: true,\n };\n}\n\n\ndeathcape.timer_tick = function () {\n var min = Number(deathcape.minute);\n var sec = Number(deathcape.second);\n\n if (sec === 0) {\n deathcape.second = 59;\n deathcape.minute -= 1;\n }\n else \n deathcape.second -= 1;\n\n deathcape.update_ui();\n};\n\n\ndeathcape.update_ui = function () {\n if (!deathcape.on)\n return false;\n \n // create div if needed\n if (!$(\"#deathcape\").height()) {\n var con = '
Cape:
';\n $(\"#tab_affdef_stats\").append(con);\n }\n\n // update amount\n $(\"#deathcape_kills\").html(\"\"+deathcape.kills);\n\n if (deathcape.minute === 0 && deathcape.second === 0)\n return;\n\n // update timer\n var div = $(\"#deathcape_timer\");\n var min = deathcape.minute;\n var sec = deathcape.second;\n if (sec < 10)\n sec = \"0\"+sec;\n div.html(\"(\"+min+\":\"+sec+\")\");\n\n // colour the timer\n if (deathcape.minute < 1) // red\n div.css(\"color\", \"#FFA0A0\");\n else if (deathcape.minute < 2) // yellow\n div.css(\"color\", \"#FFFF8C\");\n else if (deathcape.minute < 3) // green\n div.css(\"color\", \"#B4FFB4\");\n else // standard\n div.css(\"color\", \"#787878\"); \n};\n\n\ndeathcape.start_timer = function () {\n // reset timer\n deathcape.minute = 4;\n deathcape.second = 0;\n clearInterval(deathcape.interval);\n \n if (!deathcape.on)\n return false;\n \n if (deathcape.kills < 50)\n deathcape.kills += 1;\n\n deathcape.update_ui();\n\n // start timer\n deathcape.time_left = (deathcape.minute * 60) + deathcape.second;\n deathcape.interval = setInterval(function(){\n deathcape.time_left -= 1;\n if(deathcape.time_left == 0)\n clearInterval(deathcape.interval);\n deathcape.timer_tick();\n }, 1000);\n};\n\n\ndeathcape.stop_timer = function () {\n clearInterval(deathcape.interval);\n \n if (!deathcape.on)\n return false;\n\n deathcape.kills = 0;\n deathcape.minute = 0;\n deathcape.second = 0;\n\n delete GMCP.Defences.lifesteal;\n draw_affdef_tab();\n\n deathcape.update_ui();\n\n $(\"#deathcape_timer\").html(\"\");\n};\n\n/////////////////////////////\n\n//update_affdef_stats\nif (deathcape.old.update_affdef_stats)\n update_affdef_stats = deathcape.old.update_affdef_stats;\nelse\n deathcape.old.update_affdef_stats = update_affdef_stats;\n\nupdate_affdef_stats = (function() {\n var cached_function = update_affdef_stats;\n return function() {\n\n var result = cached_function.apply(this, arguments);\n\n deathcape.update_ui();\n\n };\n})();\n\n/////////////////////////////\nif (deathcape.on)\n deathcape.update_ui();"}],"actions":[]},{"type":"group","name":"Aliases","enabled":true,"id":12,"items":[{"type":"alias","name":"","enabled":true,"id":16,"matching":"exact","whole_words":false,"case_sensitive":false,"prefix_suffix":true,"actions":[{"action":"script","script":"// Failsafe - fresh install\nif (typeof deathcape == 'undefined')\n send_command('deathcape reload');\n\ndeathcape.on = false;\n$(\"#deathcape\").remove();"}],"text":"deathcape off"},{"type":"alias","name":"","enabled":true,"id":17,"matching":"exact","whole_words":false,"case_sensitive":false,"prefix_suffix":true,"actions":[{"action":"script","script":"// Failsafe - fresh install\nif (typeof deathcape == 'undefined')\n send_command('deathcape reload');\n\ndeathcape.on = true;\ndeathcape.update_ui();"}],"text":"deathcape on"},{"type":"alias","name":"","enabled":true,"id":2,"matching":"exact","whole_words":false,"case_sensitive":false,"prefix_suffix":true,"actions":[{"action":"script","script":"// Failsafe - fresh install\nif (typeof deathcape == 'undefined')\n send_command('deathcape reload');\n\ndeathcape.start_timer();"}],"text":"deathcape add"},{"type":"alias","name":"deathcape kills <#>","enabled":true,"id":10,"matching":"regexp","whole_words":false,"case_sensitive":false,"prefix_suffix":true,"actions":[{"action":"script","script":"// Failsafe - fresh install\nif (typeof deathcape == 'undefined')\n send_command('deathcape reload');\n\nvar num = Number(args[1]);\ndeathcape.kills = num;\n\ndeathcape.update_ui();"}],"text":"^deathcape kills (\\d+)$"},{"type":"alias","name":"","enabled":true,"id":7,"matching":"exact","whole_words":false,"case_sensitive":false,"prefix_suffix":true,"actions":[{"action":"script","script":"// Failsafe - fresh install\nif (typeof deathcape == 'undefined')\n send_command('deathcape reload');\n\ndeathcape.stop_timer();"}],"text":"deathcape clear"},{"type":"alias","name":"","enabled":true,"id":4,"matching":"exact","whole_words":false,"case_sensitive":false,"prefix_suffix":true,"actions":[{"action":"function","fn":"onLoad"}],"text":"deathcape reload"}],"actions":[]},{"type":"group","name":"Triggers","enabled":true,"id":13,"items":[{"type":"trigger","name":"cape added kill","enabled":true,"id":5,"matching":"exact","whole_words":true,"case_sensitive":true,"text":"You feel a surge of energy course through your body as a sycophantic shoulder cape feeds upon the lifeforce of your fallen foe.","actions":[{"action":"script","script":"// Failsafe - fresh install\nif (typeof deathcape == 'undefined')\n send_command('deathcape reload');\n\ndeathcape.start_timer();"}]},{"type":"trigger","name":"cape timed out","enabled":true,"id":6,"matching":"exact","whole_words":true,"case_sensitive":true,"text":"You grow pale as the eerie shade of stolen life force dissipates from around you.","actions":[{"action":"script","script":"// Failsafe - fresh install\nif (typeof deathcape == 'undefined')\n send_command('deathcape reload');\n\ndeathcape.stop_timer();"}]},{"type":"trigger","name":"wear cape","enabled":true,"id":8,"matching":"exact","whole_words":true,"case_sensitive":true,"text":"You are now wearing a sycophantic shoulder cape.","actions":[{"action":"script","script":"// Failsafe - fresh install\nif (typeof deathcape == 'undefined')\n send_command('deathcape reload');\n\ndeathcape.on = true;\ndeathcape.update_ui();"}]},{"type":"trigger","name":"remove cape","enabled":true,"id":9,"matching":"exact","whole_words":true,"case_sensitive":true,"text":"You remove a sycophantic shoulder cape.","actions":[{"action":"script","script":"// Failsafe - fresh install\nif (typeof deathcape == 'undefined')\n send_command('deathcape reload');\n\ndeathcape.on = false;\ndeathcape.stop_timer();\n$(\"#deathcape\").remove();"}]}],"actions":[]}]}