diff options
-rw-r--r-- | auto-tune/data/.keep (renamed from rabbit-qol/data/.keep) | 0 | ||||
-rw-r--r-- | auto-tune/hooks/load.lua | 50 | ||||
-rw-r--r-- | auto-tune/init.lua | 20 | ||||
-rw-r--r-- | auto-tune/overload/.keep (renamed from rabbit-qol/hooks/.keep) | 0 | ||||
-rw-r--r-- | auto-tune/superload/.keep (renamed from rabbit-qol/overload/.keep) | 0 | ||||
-rwxr-xr-x | install.sh | 15 | ||||
-rw-r--r-- | rabbit-qol/init.lua | 17 | ||||
-rw-r--r-- | rabbit-qol/superload/.keep | 0 |
8 files changed, 78 insertions, 24 deletions
diff --git a/rabbit-qol/data/.keep b/auto-tune/data/.keep index e69de29..e69de29 100644 --- a/rabbit-qol/data/.keep +++ b/auto-tune/data/.keep diff --git a/auto-tune/hooks/load.lua b/auto-tune/hooks/load.lua new file mode 100644 index 0000000..1e3a421 --- /dev/null +++ b/auto-tune/hooks/load.lua @@ -0,0 +1,50 @@ +class:bindHook("ToME:load", function(self, data) + local Talents = require "engine.interface.ActorTalents" + local TD = Talents.talents_def + + if TD.T_ATTUNE_MINDSTAR then + TD.T_ATTUNE_MINDSTAR.action = function(self, t) + -- do nothing if disarmed + if self:attr("disarmed") then + return nil + end + + local hasValidMindstar = function(who, slot) + local o = who:getInven(slot) and who:getInven(slot)[1] + + if not o or not o.combat or not o.combat.talented == "mindstar" then + return nil + -- exclude fixedarts (those that don't teach Attune Mindstar) + elseif not o.wielder or not o.wielder.learn_talent or not o.wielder.learn_talent[who.T_ATTUNE_MINDSTAR] then + return nil + end + + game.logPlayer(self, "Found a %s in %s", o:getName{do_color=1}, slot) + return o + end + + local mh = hasValidMindstar(self, "MAINHAND") + local oh = hasValidMindstar(self, "OFFHAND") + local tk = hasValidMindstar(self, "PSIONIC_FOCUS") + + -- find the first valid mindstar so we can switch all of them to the opposite of that one + local primary = mh or oh or tk + if not primary then + game.logPlayer(self, "You can't attune a mindstar you're not wielding!") + return + end + + local wanted_damage_type = engine.DamageType.MIND + if primary.combat.damtype == engine.DamageType.MIND then + wanted_damage_type = engine.DamageType.NATURE + end + + -- update damage types + if mh then mh.combat.damtype = wanted_damage_type end + if oh then oh.combat.damtype = wanted_damage_type end + if tk then tk.combat.damtype = wanted_damage_type end + + game.logPlayer(self, "You attune your mindstar(s) to deal %s%s#LAST# damage.", engine.DamageType.dam_def[wanted_damage_type].text_color, engine.DamageType.dam_def[wanted_damage_type].name) + end + end +end) diff --git a/auto-tune/init.lua b/auto-tune/init.lua new file mode 100644 index 0000000..274bbec --- /dev/null +++ b/auto-tune/init.lua @@ -0,0 +1,20 @@ +long_name = "Auto-Tune Mindstars" +short_name = "auto-tune" +for_module = "tome" +addon_version = {0,1,0} +version = {1,7,6} +weight = 40 +author = {"Rabbit Whispers"} +homepage = {"starfall.systems"} +description = [[Quality of life changes for Attune Mindstar: + +- your equipped mindstars will have the same damage type after you use Attune Mindstar +- psionically wielded mindstars are also attuned + +This mod doesn't allow you to change damage types of each mindstar separately. If you have a use for that, consider Fine Tune Mindstars by nsrr or Mindstar Tuning by Zizzo.]] +tags = {"mindstar", "attune mindstar"} + +data = false +hooks = true +overload = false +superload = false diff --git a/rabbit-qol/hooks/.keep b/auto-tune/overload/.keep index e69de29..e69de29 100644 --- a/rabbit-qol/hooks/.keep +++ b/auto-tune/overload/.keep diff --git a/rabbit-qol/overload/.keep b/auto-tune/superload/.keep index e69de29..e69de29 100644 --- a/rabbit-qol/overload/.keep +++ b/auto-tune/superload/.keep diff --git a/install.sh b/install.sh index 6cfabb7..cfcc1a4 100755 --- a/install.sh +++ b/install.sh @@ -1,8 +1,9 @@ -cd rabbit-bugfix -zip -r --filesync tome-rabbit-bugfix.teaa init.lua data hooks overload superload -install -m755 tome-rabbit-bugfix.teaa $HOME/games/steam/TalesMajEyal/game/addons/tome-rabbit-bugfix.teaa -cd - +function update_mod { + cd $1 + zip -r --filesync tome-$1.teaa init.lua data hooks overload superload + install -m755 tome-$1.teaa $HOME/games/steam/TalesMajEyal/game/addons/tome-$1.teaa + cd - +} -# cd rabbit-qol -# zip -r --filesync tome-rabbit-qol.teaa init.loa data hooks overload superload -# install -m755 tome-rabbit-qol.teaa $HOME/games/steam/TalesMajEyal/game/addons/tome-rabbit-qol.teaa +update_mod rabbit-bugfix +update_mod auto-tune diff --git a/rabbit-qol/init.lua b/rabbit-qol/init.lua deleted file mode 100644 index 738ca2b..0000000 --- a/rabbit-qol/init.lua +++ /dev/null @@ -1,17 +0,0 @@ -long_name = "Rabbit Quality of Life" -short_name = "rabbit-qol" -for_module = "tome" -addon_version = {0,0,1} -version = {1,7,6} -weight = 0 -author = {'Rabbit Whispers'} -homepage = {'starfall.systems'} -description = [[ - -]] -tags = {} - -data = false -hooks = false -overload = false -superload = false diff --git a/rabbit-qol/superload/.keep b/rabbit-qol/superload/.keep deleted file mode 100644 index e69de29..0000000 --- a/rabbit-qol/superload/.keep +++ /dev/null |