-
Notifications
You must be signed in to change notification settings - Fork 73
#1539 - Add configs to force most DoTs to tick on turn end #1541
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,9 +1,16 @@ | ||
| [XComGame.X2Effect_Burning] | ||
| ;BURNED_IGNORES_SHIELDS=true ; Make burn and acid DOT ignore shields | ||
| ; Issue #1539 | ||
| ; Add damage types whose burn DOTs should tick on turn end. | ||
| ; These must be the same `DamageType` passed to SetBurnDamage() for a given DOT. | ||
| ;+BURN_TYPES_TICKING_AFTER_TURN="Fire" ; Make burn DOT tick on turn end! | ||
|
|
||
| [XComGame.X2StatusEffects] | ||
| ;POISONED_IGNORES_SHIELDS=true ; Make poison DOT ignore shields | ||
| ;BLEEDING_IGNORES_SHIELDS=true ; Make bleeding DOT ignore shields | ||
| ; Issue #1539 | ||
| ;POISONED_TICKS_AFTER_TURN=true ; Make poison DOT tick on turn end | ||
| ;BLEEDING_TICKS_AFTER_TURN=true ; Make bleeding DOT tick on turn end | ||
|
Comment on lines
+12
to
+13
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would add "instead of turn start" to these. With the lines above the inverse case is clear (ignores/does not ignore shields). For tick timing, it's not as obvious (after turn/before turn/during turn/some other trigger).
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Might be moot, depending on the outcome of our conversation in #1539, but I'll keep it in mind! |
||
|
|
||
| [XComGame.X2TacticalGameRuleset] | ||
| ;PlayerTurnOrder=eTeam_XCom | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -14,6 +14,7 @@ class X2Effect_Burning extends X2Effect_Persistent | |
|
|
||
| var privatewrite name BurningEffectAddedEventName; | ||
| var config bool BURNED_IGNORES_SHIELDS; //Issue #89 | ||
| var config array<name> BURN_TYPES_TICKING_AFTER_TURN; //Issue #1539 | ||
|
|
||
| function bool IsThisEffectBetterThanExistingEffect(const out XComGameState_Effect ExistingEffect) | ||
| { | ||
|
|
@@ -52,8 +53,18 @@ simulated function SetBurnDamage(int Damage, int Spread, name DamageType) | |
|
|
||
| ApplyOnTick.AddItem(BurnDamage); | ||
| `assert( ApplyOnTick.Length == 1 ); | ||
|
|
||
| //Begin Issue #1539 | ||
| // This isn't how I expected to do this, but I made one critical oversight | ||
| // in my initial research: SetBurnDamage isn't what calls BuildPersistentEffect. :o | ||
|
Comment on lines
+58
to
+59
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please rewrite this comment to be less conversational. An observation of where this is handled for poison/bleed, and why the same approach doesn't work for burning, would be sufficient.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How does this sound? |
||
| if (BURN_TYPES_TICKING_AFTER_TURN.Find(DamageType) != INDEX_NONE) | ||
| { | ||
| self.WatchRule = eGameRule_PlayerTurnEnd; | ||
| } | ||
| //End Issue #1539 | ||
| } | ||
|
|
||
|
|
||
| simulated function X2Effect_ApplyWeaponDamage GetBurnDamage() | ||
| { | ||
| return X2Effect_ApplyWeaponDamage(ApplyOnTick[0]); | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -99,6 +99,7 @@ var config int POISONED_DAMAGE; | |
| var config int POISONED_INFECT_DISTANCE; | ||
| var config int POISONED_INFECT_PERCENTAGE; | ||
| var config bool POISONED_IGNORES_SHIELDS; // Issue #89 | ||
| var config bool POISONED_TICKS_AFTER_TURN; // Issue #1539 | ||
| var localized string PoisonedFriendlyName; | ||
| var localized string PoisonedFriendlyDesc; | ||
| var localized string PoisonedEffectAcquiredString; | ||
|
|
@@ -217,6 +218,7 @@ var localized string BleedingEffectAcquiredString; | |
| var localized string BleedingEffectTickedString; | ||
| var localized string BleedingEffectLostString; | ||
| var config bool BLEEDING_IGNORES_SHIELDS; // Single variable for Issue #629 | ||
| var config bool BLEEDING_TICKS_AFTER_TURN; // Issue #1539 | ||
|
|
||
| var config int ULTRASONICLURE_TURNS; | ||
| var name UltrasonicLureName; | ||
|
|
@@ -1102,10 +1104,52 @@ static function X2Effect_PersistentStatChange CreatePoisonedStatusEffect() | |
| local X2Effect_ApplyWeaponDamage DamageEffect; | ||
| local X2Condition_UnitProperty UnitPropCondition; | ||
|
|
||
| //Begin Issue #1539 | ||
| /// HL-Docs: feature:DOTsTickAfterTurn; issue:1539; tags:tactical | ||
| /// In the base game, DoTs such as bleeding, burning, or poison typically tick at the | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nitpick: DOTs instead of DoTs (for consistency) |
||
| /// start of the unit owner's turn. Mods can override this behavior by setting the following | ||
| /// flags in `XComGameCore.ini`: | ||
| /// | ||
| ///```ini | ||
| ///[XComGame.X2Effect_Burning] | ||
| ///+BURN_TYPES_TICKING_AFTER_TURN=Fire ; Make fire burn DOT tick on turn end! | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remove the "!" at end of line for consistency |
||
| /// | ||
| ///[XComGame.X2StatusEffects] | ||
| ///POISONED_TICKS_AFTER_TURN=true ; Make poison DOT tick on turn end | ||
| ///BLEEDING_TICKS_AFTER_TURN=true ; Make bleeding DOT tick on turn end | ||
| ///``` | ||
| /// Note that `BURN_TYPES_TICKING_AFTER_TURN` will apply to all instances of `X2Effect_Burning` that | ||
| /// use its `SetBurnDamage()` helper method to set up the burn damage effect, *and* use a damage type | ||
| /// specified in the `BURN_TYPES_TICKING_AFTER_TURN` array. In the example above, only Fire damage | ||
| /// will tick on turn end, while other burning effects such as Acid Burn will continue to tick on | ||
| /// turn start. | ||
| /// | ||
| /// `POISONED_TICKS_AFTER_TURN` will apply to all instances of the poisoned effect created using | ||
| /// the `X2StatusEffect::CreatePoisonedStatusEffect()` helper method. | ||
| /// | ||
| /// Similarly, `BLEEDING_TICKS_AFTER_TURN` will apply to all instances of the bleeding effect | ||
| /// created using the `X2StatusEffect::CreateBleedingStatusEffect()` helper method. | ||
| /// | ||
| /// This should cover all instances of these effects in the base game, but mods can potentially | ||
| /// disregard these helper methods, or explicitly override the effect's `WatchRule` property | ||
| /// after calling the helper. | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would append a small addendum here: "Mods which create DOT effects without these helper methods should consider accessing these configs to implement similar behavior. This improves compatibility between mods and provides more consistency for the player."
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Would that be in addition to the existing paragraph? If so, I might go with something more like this: "However, it is recommended that mods which create DOT effects either use the appropriate helper methods, or access these configs to implement similar behavior. This improves compatibility between mods and provides more consistency for the player." If it's replacing the paragraph, I might want to object, on the grounds that someone might have a legitimate interest in knowing how to bypass this feature. |
||
| local GameRuleStateChange WatchRule; | ||
|
|
||
| if (default.POISONED_TICKS_AFTER_TURN) | ||
| { | ||
| WatchRule = eGameRule_PlayerTurnEnd; | ||
| } | ||
| else | ||
| { | ||
| WatchRule = eGameRule_PlayerTurnBegin; | ||
| } | ||
| /// End Issue #1539 | ||
|
|
||
|
|
||
| PersistentStatChangeEffect = new class'X2Effect_PersistentStatChange'; | ||
| PersistentStatChangeEffect.EffectName = default.PoisonedName; | ||
| PersistentStatChangeEffect.DuplicateResponse = eDupe_Refresh; | ||
| PersistentStatChangeEffect.BuildPersistentEffect(default.POISONED_TURNS,, false,,eGameRule_PlayerTurnBegin); | ||
| PersistentStatChangeEffect.BuildPersistentEffect(default.POISONED_TURNS,, false,,WatchRule); //Issue #1539 | ||
| PersistentStatChangeEffect.SetDisplayInfo(ePerkBuff_Penalty, default.PoisonedFriendlyName, default.PoisonedFriendlyDesc, "img:///UILibrary_PerkIcons.UIPerk_poisoned"); | ||
| PersistentStatChangeEffect.AddPersistentStatChange(eStat_Mobility, default.POISONED_MOBILITY_ADJUST); | ||
| PersistentStatChangeEffect.AddPersistentStatChange(eStat_Offense, default.POISONED_AIM_ADJUST); | ||
|
|
@@ -2285,10 +2329,23 @@ static function X2Effect_Persistent CreateBleedingStatusEffect(int NumTurns, int | |
| local X2Effect_ApplyWeaponDamage DamageEffect; | ||
| local X2Condition_UnitProperty UnitPropCondition; | ||
|
|
||
| //Begin Issue #1539 | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't know HL convention here. I'd personally leave a comment pointing to the HLDocs comment within
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I haven't looked at it too thoroughly, but historical precedent (... including the shield bypass features this PR is derivative of...) appears to be to tag every line or block of code with the issue number, but only define HL-Docs in one location. I suspect the HL-Docs definitions exist primarily to build the online documentation, and nobody's wanted to clog the Highlander up with duplicate doc sheets. |
||
| local GameRuleStateChange WatchRule; | ||
|
|
||
| if (default.BLEEDING_TICKS_AFTER_TURN) | ||
| { | ||
| WatchRule = eGameRule_PlayerTurnEnd; | ||
| } | ||
| else | ||
| { | ||
| WatchRule = eGameRule_PlayerTurnBegin; | ||
| } | ||
| /// End Issue #1539 | ||
|
|
||
| PersistentEffect = new class'X2Effect_Persistent'; | ||
| PersistentEffect.EffectName = default.BleedingName; | ||
| PersistentEffect.DuplicateResponse = eDupe_Refresh; | ||
| PersistentEffect.BuildPersistentEffect(NumTurns, , false, , eGameRule_PlayerTurnBegin); | ||
| PersistentEffect.BuildPersistentEffect(NumTurns, , false, , WatchRule); //Issue #1539 | ||
| PersistentEffect.SetDisplayInfo(ePerkBuff_Penalty, default.BleedingFriendlyName, default.BleedingFriendlyDesc, "img:///UILibrary_XPACK_Common.UIPerk_bleeding"); | ||
| PersistentEffect.VisualizationFn = BleedingVisualization; | ||
| PersistentEffect.EffectSyncVisualizationFn = BleedingSyncVisualization; | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't like treating burn separately from other damage types here, unless there's a mod author who has already indicated that, if their DOT effect were moved to end-of-turn, they would add its damage type to the start-of-turn list to explicitly counter it. If such fine-grained control is required, let it be a separate issue raised by whoever wants to use it. We can implement it when (and if) it comes up without any backwards compatibility issues.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
... There's me. 😂
I actually got into Highlander development to support an extensive TJ-based, LWR-inspired combat overhaul I've been thinking of. (As of yesterday, I've gotten it all to a point where I can playtest it!) I'm not actually sure whether I'll release it to the public yet - partly because it wants all my configs/events to make it into the Highlander in some form - and the closest thing I've got to a formal design doc is in a media/rambling thread in the LWotC Discord, but here's the gist of it:
half ofFire, Napalm, Cold, and Electric damage bypass ablative HP and go straight to HP. [Partial shield bypassing across an entire damage type will require either extensive OPTCing or a far more invasive event than anything I've already had to make for Add events required for cover DR and point-blank bonuses #1540, so I've decided not to do it right now.]Projectile_BeamAvatardamage type as the Avatar weapons, and then setting that damage type to bypass defenses... though it only now occurs to me that I need to add ESO configs for the same effect.]TL;DR: While all of my proposals are aiming for maximum flexibility (to the extent that I'm disappointed by my current event payloads for #1540 and #1542 being so laser-focused on the exact data I'm reading), a good chunk of this is because I already need a lot of that flexibility for my own purposes. I probably wouldn't have thought of it otherwise.