Nanocom Boosters and Authentic FM-Taro Scale Logic (#315)

* Groundwork for nanocom boosters

* The item use handler now has a switch for multiple item types (currently gumballs, and a stub for boosters)
* All item types are now checked for expiration, not just vehicles

* implement nanocom booster helpers, save and expiry

* implement authentic taro and fm modfication

* magic number and code refactor

* make sure only close by group members are counted

* add safe taro fm handling, rate command, race and mission booster logic

* add config option to disable authentic group scaling

* rename for consistency

* make rates percentages, fix chat message, add config options

* add config option to the ini file

* add index guard for hasBoost functions

* reorder config ini options

* add bank item expiry option

* fix trade oversight

---------

Co-authored-by: CakeLancelot <CakeLancelot@users.noreply.github.com>
This commit is contained in:
FinnHornhoover
2026-03-25 20:09:40 +03:00
committed by GitHub
parent 9a62ec61c9
commit 113bc0bc1b
26 changed files with 691 additions and 258 deletions

View File

@@ -15,6 +15,14 @@ struct BuffStack;
#define PC_MAXHEALTH(level) (925 + 75 * (level))
enum class CappedValueType {
TAROS,
FUSIONMATTER,
BATTERY_W,
BATTERY_N,
TAROS_IN_TRADE,
};
struct Player : public Entity, public ICombatant {
int accountId = 0;
int accountLevel = 0; // permission level (see CN_ACCOUNT_LEVEL enums)
@@ -65,8 +73,6 @@ struct Player : public Entity, public ICombatant {
sItemBase QInven[AQINVEN_COUNT] = {};
int32_t CurrentMissionID = 0;
sTimeLimitItemDeleteInfo2CL toRemoveVehicle = {};
Group* group = nullptr;
bool notify = false;
@@ -84,7 +90,14 @@ struct Player : public Entity, public ICombatant {
time_t lastShot = 0;
std::vector<sItemBase> buyback = {};
Player() { kind = EntityKind::PLAYER; }
double rateF[5] = { 1.0, 1.0, 1.0, 1.0, 1.0 };
double rateT[5] = { 1.0, 1.0, 1.0, 1.0, 1.0 };
Player() {
kind = EntityKind::PLAYER;
std::fill_n(rateF, 5, (double)settings::FUSIONMATTERRATE / 100.0);
std::fill_n(rateT, 5, (double)settings::TARORATE / 100.0);
}
virtual void enterIntoViewOf(CNSocket *sock) override;
virtual void disappearFromViewOf(CNSocket *sock) override;
@@ -111,4 +124,11 @@ struct Player : public Entity, public ICombatant {
sNano* getActiveNano();
sPCAppearanceData getAppearanceData();
bool hasQuestBoost() const;
bool hasHunterBoost() const;
bool hasRacerBoost() const;
bool hasSuperBoost() const;
void addCapped(CappedValueType type, int32_t diff);
void subtractCapped(CappedValueType type, int32_t diff);
void setCapped(CappedValueType type, int32_t value);
};