OpenXcom Forum

Modding => OXCE Support => OpenXcom Extended => OXCE Support Y-scripts => Topic started by: efrenespartano on January 27, 2020, 04:43:42 pm

Title: [Answered] powerRangeIncrease
Post by: efrenespartano on January 27, 2020, 04:43:42 pm
Hi, folks!

Got a suggestion. powerRangeReduction is useful to limit the damage of certain weapons (Shotguns and pistols comes to mind) to a defined range. But, how about an increment of damage?

Instead of losing power at X number of tiles beyond powerRangeThreshold, the powerRangeIncrease would mean that a fixed power bonus is applied UNTIL the powerRangeThreshold. Let's imagine an SMG:

Code: [Select]
  - type: STR_SMG
    compatibleAmmo:
      - STR_SMG_CLIP
    powerRangeThreshold: 15
    powerRangeIncrease: 5

  - type: STR_SMG_CLIP
    power: 30

This gun will inflict 35 points of damage up to 15 tiles, where it will decrease to 30!

Enviado desde mi LG-M400 mediante Tapatalk

Title: Re: [Suggestion] powerRangeIncrease
Post by: Meridian on January 27, 2020, 05:46:00 pm
already scriptable today
Title: Re: [Suggestion] powerRangeIncrease
Post by: efrenespartano on January 27, 2020, 06:32:42 pm
already scriptable today
Cool! How can I do it, Meridian? :D

Enviado desde mi LG-M400 mediante Tapatalk

Title: Re: [Suggestion] powerRangeIncrease
Post by: Meridian on January 27, 2020, 06:42:42 pm
Cool! How can I do it, Meridian? :D

Using scripts.

I'm not going to write it for you though... you'll need to find someone else.
Title: Re: [Suggestion] powerRangeIncrease
Post by: Yankes on January 27, 2020, 07:44:20 pm
I see one thing that is missing from scripts, we do not expose range to `hitUnit` hook (you can check distance to other unit but it not always same).

I will look if I can add this.
Title: Re: [Suggestion] powerRangeIncrease
Post by: TBeholder on January 03, 2023, 06:07:31 pm
I see one thing that is missing from scripts, we do not expose range to `hitUnit` hook (you can check distance to other unit but it not always same).
I will look if I can add this.
hitUnit takes the current power and can adjust it as a variable, correct?
So negative powerRangeReduction does its thing, then on hit the script just caps it if it went above the threshold (presumably set in a tag). Or may even calculate range-by-trajectory from the current and ruleset power values, then apply its own damage (range) formula to the result.
The problem is, while hits to units can be controlled this way, how to handle hits to tiles?