|
from Expansion Manager's OXP list |
from Expansion Manifest |
Description |
Enables the energy units of all NPCs that have them installed.
Awards Extra or Naval Energy Units to NPCs based on their accuracy and energy recharge rate.
WARNING: this OXP makes NPCs much tougher, with severe consequences to game balance against the player - NOT for new Jamesons! |
Enables the energy units of all NPCs that have them installed.
Awards Extra or Naval Energy Units to NPCs based on their accuracy and energy recharge rate.
WARNING: this OXP makes NPCs much tougher, with severe consequences to game balance against the player - NOT for new Jamesons! |
Identifier |
oolite.oxp.dybal.NPC_Energy_Units |
oolite.oxp.dybal.NPC_Energy_Units |
Title |
NPC Energy Units |
NPC Energy Units |
Category |
Mechanics |
Mechanics |
Author |
Dybal |
Dybal |
Version |
1.0.2 |
1.0.2 |
Tags |
|
|
Required Oolite Version |
|
|
Maximum Oolite Version |
|
|
Required Expansions |
|
|
Optional Expansions |
oolite.oxp.Ngalo.N-Shields:0
oolite.oxp.Ngalo.NPC_Equipment_Damage:0
oolite.oxp.dybal.NPC_Equipment_Damage:0
oolite.oxp.Lone_Wolf.NavalGridNext:0
|
oolite.oxp.Ngalo.N-Shields:
oolite.oxp.Ngalo.NPC_Equipment_Damage:
oolite.oxp.dybal.NPC_Equipment_Damage:
oolite.oxp.Lone_Wolf.NavalGridNext:
|
Conflict Expansions |
oolite.oxp.Ngalo.NPC_Energy_Units:0
|
oolite.oxp.Ngalo.NPC_Energy_Units:
|
Information URL |
|
n/a |
Download URL |
https://wiki.alioth.net/img_auth.php/4/40/NpcEnergyUnits-1.0.2.oxz |
n/a |
License |
CC-BY-NC-SA 4.0 |
CC-BY-NC-SA 4.0 |
File Size |
n/a |
Upload date |
1660173281 |
Documentation
Also read http://wiki.alioth.net/index.php/NPC%20Energy%20Units
Readme.txt
NPC Energy Units
----------------
v1.0.2, by Dybal
NPC Energy Units makes the Extra Energy Units and Naval Energy Units installed in NPCs functional, enhancing their energy recharge rate.
For those NPC ships created with the energy units, this OXP will enable them by itself, for those ships whose energy units were granted by OXPs after the ship was spawned, this OXP makes available a function for the awarding OXP to call to enable the awarded energy unit.
This OXP also awards energy units (civilian and naval) to NPCs, based on their accuracy (the higher accuracy have greater probability of getting them) and recharge rate (the higher recharge rates have lesser probability of getting the energy units).
This OXP can be used as a drop-in replacement fro Ngalo's NPC Energy Units.
GAMEPLAY WARNING
----------------
This OXP will make NPC's tougher, and a few of them *much* tougher - a few of them () might even get an energy recharge rate that makes them almost invulnerable to laser weapons (they recharge so fast that they must be hit almost continously by a military laser to be brought down...)
Awarding Probabilities
----------------------
Accuracy Recharge EEU NEU
-5 to -1 1 0% 0%
0 1 46.03% 5.82%
1 1 48.89% 6.02%
2 1 51.75% 6.22%
3 1 54.60% 6.42%
4 1 57.46% 6.62%
5 1 60.32% 6.82%
6 1 63.17% 7.02%
7 1 66.03% 7.22%
8 1 68.89% 7.42%
9 1 71.75% 7.62%
10 1 74.60% 7.82%
-5 to -1 2 0% 0%
0 2 34.92% 4.65%
1 2 37.78% 4.85%
2 2 40.63% 5.05%
3 2 43.49% 5.25%
4 2 46.35% 5.45%
5 2 49.21% 5.65%
6 2 52.06% 5.85%
7 2 54.92% 6.05%
8 2 57.78% 6.25%
9 2 60.63% 6.45%
10 2 63.49% 6.65%
-5 to -1 3 0% 0%
0 3 23.81% 3.47%
1 3 26.67% 3.67%
2 3 29.52% 3.87%
3 3 32.38% 4.07%
4 3 35.24% 4.27%
5 3 38.10% 4.47%
6 3 40.95% 4.67%
7 3 43.81% 4.87%
8 3 46.67% 5.07%
9 3 49.52% 5.27%
10 3 52.38% 5.47%
-5 to -1 4 0% 0%
0 4 12.70% 2.29%
1 4 15.56% 2.49%
2 4 18.41% 2.69%
3 4 21.27% 2.89%
4 4 24.13% 3.09%
5 4 26.98% 3.29%
6 4 29.84% 3.49%
7 4 32.70% 3.69%
8 4 35.56% 3.89%
9 4 38.41% 4.09%
10 4 41.27% 4.29%
-5 to -1 5 0% 0%
0 5 1.59% 1.12%
1 5 4.44% 1.32%
2 5 7.30% 1.52%
3 5 10.16% 1.72%
4 5 13.02% 1.92%
5 5 15.87% 2.12%
6 5 18.73% 2.32%
7 5 21.59% 2.52%
8 5 24.44% 2.72%
9 5 27.31% 2.92%
10 5 30.16% 3.12%
-5 to 0 6 0% 0%
1 6 0% 0.14%
2 6 0% 0.34%
3 6 0% 0.54%
4 6 1.90% 0.74%
5 6 4.76% 0.94%
6 6 7.62% 1.14%
7 6 10.48% 1.34%
8 6 13.33% 1.54%
9 6 16.19% 1.74%
10 6 19.05% 1.94
-5 to 6 7 0% 0%
7 7 0% 0.16%
8 7 2.22% 0.36%
9 7 5.08% 0.56%
10 7 7.94% 0.76
all 8+ 0% 0%
Notes for OXP developers
------------------------
This OXP makes available the following functions:
* worldScripts.NPC_Energy_Units.$getShipEnergyUnit(ship)
A convenience function that returns the equipment Key for any energy unit installed on the ship, or null if the ship has none.
* worldScripts.NPC_Energy_Units.$setupEnergyUnits(ship)
Updates the ship's energy recharge rate to the factory value boosted by the energy unit installed, if it's not damaged.
Returns true if the ship's energy recharge was modified and false otherwise.
* worldScripts.NPC_Energy_Units.$energyUnitDamaged(equipmentKey)
An event handler for damage to energy units, it MUST be called in the context ('this') of the ship's script, as in:
worldScripts.NPC_Energy_Units.$energyUnitDamaged.call(ship.script, equipmentKey)
It restores the ship to its factory energy recharge rate if the equipmentKey is an energy unit and its status in the ship isn't EQUIPMENT_OK: it can be called after an energy unit is removed from the ship to reset its energy recharge rate, but that means that if the ship has a naval energy unit and this function is called with the key for an extra energy unit, the ship's energy recharge rate WILL be reset, rendering the naval energy unit non-functional.
This OXP includes this function in NPC Equipment Damage OXP list of equipment damage handlers if that OXP is installed.
Aknowledgements
---------------
This OXP is based on Ngalo's original NPC Energy Unit.
I would rather have updated the original OXP, but although it had a CC BY-NC-SA, it didn't specify the version, so I opted to write a new one to replace it just to be in safe licensing grounds.
License
-------
This work is released under the Creative Commons Attribution - Non-Commercial - Share Alike 4.0 (CC BY-NC-SA 4.0)
(https://creativecommons.org/licenses/by-nc-sa/4.0/)
Version History
---------------
Version 1.0.2 (july/2022):
* Fixes damage handler exported to NPC Equipment Damage OXP (it's called for any equipment damaged ina NPC, not only energy units, as it formerly expected).
* Removes some redundant logging messages.
* Don not award energy units to NPX of low accuracy (less than 0), since they are too green/incompetent to afford them.
* Reduces the probablities for awarding Naval Energy Units (they should be rare), making sure high recharging rate ships (7 or greater) do not get them.
Version 1.0.1 (december/2020):
* Adds _alreadyGotOne array (with ships that have high energy recharge rate to emulate an energy unit) for backwards compatibility with Ngalo's version (and used by Military Shields OXP).
* Changes parameters for granting NEU and EEU to reduce probability of granting to ships with recharge rate above 6.
Version 1.0 (november/2020):
* Initial version