OpenXcom Forum

Modding => OpenXcom Extended => Topic started by: skyhawk on December 04, 2019, 01:17:00 am

Title: [DONE][Suggestion] Base Defense Facility Ammunition
Post by: skyhawk on December 04, 2019, 01:17:00 am
In vanilla TFTD [And there's an equivalent in EU/UFO I believe] there's a late-game weapon type called the PWT. It requires ammunition that is very expensive in Zrbite.

There's a craft PWT launcher, which likewise requires very Zrbite expensive projectiles.

Then there's a base defense facility, which costs no exotics to build [You've already addressed this], but can also fire at incoming hostiles without a care in the world, because its ammunition is free.

This suggestion will not have any impact at all on vanilla, but allow modders to easily correct this situation:

facilities.rul
  Add two attributes
    ammunitionType: default none
    ammunitionCount: default 0
    [optional] noAmmoMessage: default 'NO AMMO'? # This would allow per-facility type no ammo strings

The logic is very straightforward. During a base defense, this facility cannot fire if the required ammunition is not present [Print a message like 'NO AMMO']. If the facility does fire, subtract the ammunition from stores.

OPTIONAL - Allow reduced damage with incomplete ammo loads. For example - the facility has a defense strength of 1000 and an ammo count of 4 [4 torpedo launchers]. If there's only two torpedoes in stock, the facility will fire for a strength of [(1000/4) * 2]. Some way of communicating to the player that ammunition was insufficient would be a good idea, but I'm not sure the best way to handle that.

This will also require tweaking the UFOPedia to show the required quantity and type of ammunition.
Title: Re: [Suggestion] Base Defense Facility Ammunition
Post by: davide on December 08, 2019, 08:26:58 am
+1

there is this thread about them

https://openxcom.org/forum/index.php/topic,3513.msg42822.html#msg42822 (https://openxcom.org/forum/index.php/topic,3513.msg42822.html#msg42822)
Title: Re: [DONE][Suggestion] Base Defense Facility Ammunition
Post by: Meridian on October 31, 2020, 11:54:08 pm
Added.

Code: [Select]
facilities:
  - type: STR_MISSILE_DEFENSES
    defense: 500
    hitRatio: 50
    ammoNeeded: 2                       # default 1
    ammoItem: STR_AVALANCHE_MISSILES    # default empty
    fireSound: 5
    hitSound: 10

Code: [Select]
  STR_NO_AMMO: "NO AMMO!"

No partial loads.
No custom messages per facility.

Ufopedia will show the info under the "INFO" button (a.k.a. Stats for Nerds).
Or you can just update the description.
Title: Re: [DONE][Suggestion] Base Defense Facility Ammunition
Post by: skyhawk on November 01, 2020, 12:19:48 am
Unexpected Necromancy!

Thanks Meridian.