Jump to content

Mod idea: Remove all backstab immunity (looking for a quick tp2 feedback/code review)


Recommended Posts

I'm thinking of using this locally, and publishing it on github/here (although it's quite a trivial/small update).

The intent is to remove the backstab immunity from everything but kitted barbarians (as their immunity is part of kit).

Game play wise, I feel like thieves are lackluster late game, as so many important fights trivialize backstab tactics by using this opcode (reducing thieves to a trap/detect invis side line guy).

I see 2 different approaches to this in the weidu code - remove opcode 292 (backstab immunity), or add it and set to 0 (disabled).

Which would be better?  (I also tried/tested out setting opcode 101 immunity to opcode parameter2=292, but this didn't seem to make my immuned to backstab xvart vulnerable to it):

BACKUP ~ahungry_backstab/backup~
AUTHOR ~Ahungry~
VERSION 1.0

BEGIN ~Ahungry's Restore Backstab~

REQUIRE_PREDICATE (GAME_IS ~bgee bg2ee eet~) ~Game not supported.~

COPY_EXISTING_REGEXP GLOB ~^.+\.cre$~ ~override~
    // We can explicitly add/set it to 0 (disabled)
    // LPF ADD_CRE_EFFECT INT_VAR opcode=292 timing=9 parameter2=0 END

    // Or we can remove the effect
    // LPF DELETE_CRE_EFFECT INT_VAR opcode_to_delete=292 END
BUT_ONLY_IF_IT_CHANGES

 

Edited by ahungry
Link to comment

This wouldn't do what you want. Many backstab immunities are on items instead, such as with golems; iron golems have it as an equip effect on both their attack item GOLIRO and the immunity item IRONGOL. Even the player version of the iron golem weapon (the only iron golem status immunity that actually works with Shapechange) and several ToB items that players can use have it.

In addition, there are a few barbarian enemies such as the Thayan goons at the end of Neera's BGEE quest. Your code would remove their backstab immunities improperly, since kitted enemies have their kit abilities added as spells/effects explicitly in the creature file rather than by spell.

So, you need more complexity. Add a class/kit check so you don't remove immunity from barbarians. Remove from items as well - maybe only the undroppable ones, maybe some or all of the player-usable ones as well.

Link to comment
BEGIN ~Ahungry's Restore Backstab~

REQUIRE_PREDICATE (GAME_IS ~bgee bg2ee eet~) ~Game not supported.~

COPY_EXISTING_REGEXP GLOB ~^.+\.cre$~ ~override~
LPF DELETE_CRE_EFFECT INT_VAR opcode_to_delete=292 END
BUT_ONLY_IF_IT_CHANGES

COPY_EXISTING_REGEXP GLOB ~^.+\.itm$~ ~override~
LPF DELETE_ITEM_EFFECT INT_VAR opcode_to_delete=292 END
BUT_ONLY

... but this will

Link to comment

Added note ... I should have actually looked at those goons from Neera's quest. Despite actually being barbarians, they don't have backstab immunity. Which is not to say that other mods might rectify this, or make other creatures into barbarians.

There's no particular rhyme or reason as to which creatures get backstab immunity from undroppable items and which get it from preset effects. Despite there being a dedicated beholder immunity item (BEHOLDER.itm), beholders get their backstab immunity from effects. 

Link to comment
10 minutes ago, jmerry said:

There's no particular rhyme or reason as to which creatures get backstab immunity from undroppable items and which get it from preset effects. Despite there being a dedicated beholder immunity item (BEHOLDER.itm), beholders get their backstab immunity from effects. 

You should understand that games are made in iterations... and when one doesn't block the other, all sorts of things like this can be left in the game files. And yes, you need to remove all of them when you want to change it.

Link to comment

Join the conversation

You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...