Home » MODDING HQ 1.13 » Flugente's Magika Workshop » New feature: Administration assignment
New feature: Administration assignment[message #356696]
||Thu, 14 February 2019 22:41 |
||This most boring feature is to adress the following issues:
- We have a wide variety of mercenaries at our disposal, with widely differing talents. Most are good at combat. Some at training. Or doctoring. Or repairing. Or spying. Or shoveling graves. There are, however, a few mercs that barely qualify for anything *waves at early M.E.R.C. roster*. Would be neat if at least some of them had a specific talent.
- The player themselves does all kinds of logistics/administering. While we can't have the mercs do that, it would be neat, if only from a roleplay perspective, if we could represent that ingame.
I've adressed this by adding a new assignment: Administration.
A merc on this new assignment will generate assignment points. These points are then calculated into a percentual increase in other merc's effectivity at their assignments and evenly distributed. The first number on the portrait shows the percentage generated, the second one is the percentage for merc who receives this benefit. Due to technical reasons, the second number only takes into account the mercs who have been at their assignment long enough to count, so this isn't immediately correct upon setting the assignment.
Shepard's normal max points for training militia (84) are smaller than the number she currently has, 96, due to Lara and Sara boosting assignments in Drassen by 15%. Notice that Lara benefits others even though she is in another sector (C13 vs D13). For ease of use, the administration bonus is shard over all sectors in a town. Outside of towns it only works for the sector itself.
The point generation works like this:
if ( this->stats.bLife < OKLIFE || this->bSectorZ || ( this->usSoldierFlagMask & SOLDIER_POW ) )
// if not on correct assignment, no gain
if ( this->bAssignment != ADMINISTRATION )
UINT32 val = 250 + 4 * EffectiveWisdom( this ) + 3 * EffectiveLeadership( this ) + 5 * EffectiveExpLevel( this, FALSE );
// personality/disability modifiers
FLOAT persmodifier = 1.0f;
if ( DoesMercHaveDisability( this, NERVOUS ) ) persmodifier -= 0.01f;
if ( DoesMercHaveDisability( this, FORGETFUL ) ) persmodifier -= 0.60f;
if ( DoesMercHaveDisability( this, PSYCHO ) ) persmodifier -= 0.03f;
if ( DoesMercHaveDisability( this, DEAF ) ) persmodifier -= 0.15f;
if ( DoesMercHaveDisability( this, SHORTSIGHTED ) ) persmodifier -= 0.10f;
if ( gGameOptions.fNewTraitSystem )
if ( DoesMercHavePersonality( this, CHAR_TRAIT_SOCIABLE ) ) persmodifier += 0.10f;
if ( DoesMercHavePersonality( this, CHAR_TRAIT_LONER ) ) persmodifier -= 0.10f;
if ( DoesMercHavePersonality( this, CHAR_TRAIT_OPTIMIST ) ) persmodifier += 0.02f;
if ( DoesMercHavePersonality( this, CHAR_TRAIT_ASSERTIVE ) ) persmodifier += 0.08f;
if ( DoesMercHavePersonality( this, CHAR_TRAIT_INTELLECTUAL ) ) persmodifier += 0.15f;
if ( DoesMercHavePersonality( this, CHAR_TRAIT_PRIMITIVE ) ) persmodifier -= 0.15f;
if ( DoesMercHavePersonality( this, CHAR_TRAIT_AGGRESSIVE ) ) persmodifier -= 0.04f;
if ( DoesMercHavePersonality( this, CHAR_TRAIT_PHLEGMATIC ) ) persmodifier -= 0.05f;
if ( DoesMercHavePersonality( this, CHAR_TRAIT_SHOWOFF ) ) persmodifier -= 0.03f;
if ( DoesMercHavePersonality( this, CHAR_TRAIT_COWARD ) ) persmodifier -= 0.07f;
// background modifier
persmodifier += ( this->GetBackgroundValue( BG_ADMINISTRATION_ASSIGNMENT ) ) / 100.0f;
// equipment modifier
FLOAT bestequipmentmodifier = 1.0f;
OBJECTTYPE* pObj = NULL;
INT8 invsize = (INT8)inv.size(); // remember inventorysize, so we don't call size() repeatedly
for ( INT8 bLoop = 0; bLoop < invsize; ++bLoop ) // ... for all items in our inventory ...
if ( inv[bLoop].exists() == true && Item[inv[bLoop].usItem].usAdministrationModifier )
OBJECTTYPE * pObj = &( this->inv[bLoop] ); // ... get pointer for this item ...
if ( pObj != NULL ) // ... if pointer is not obviously useless ...
for ( INT16 i = 0; i < pObj->ubNumberOfObjects; ++i )
FLOAT modifier = 1.0f + ( Item[inv[bLoop].usItem].usAdministrationModifier * ( *pObj )[i]->data.objectStatus ) / 10000.0f;
if ( modifier > bestequipmentmodifier )
bestequipmentmodifier = modifier;
// the best friendly/direct/recruit approach factor can alter the value up to 10%
FLOAT approachmax = max( gMercProfiles[this->ubProfile].usApproachFactor, max( gMercProfiles[this->ubProfile].usApproachFactor, gMercProfiles[this->ubProfile].usApproachFactor ) );
FLOAT approachmodifier = 1.0f + max( -0.1f, min( 0.1f, (approachmax - 100.0f) / 100.0f ));
UINT32 totalvalue = val * persmodifier * bestequipmentmodifier * approachmodifier / gGameExternalOptions.fAdministrationPointsPerPercent;
ReducePointsForFatigue( this, &totalvalue );
Most assignments benefit from this - they are:
- any doctor task
- any repair task
- traing oneself, being a trainer, being student
- training/drilling militia/workers
- moving items
- staffing facilities
- spreading rumous
- diagnosing/treating disease
The maximum bonus one can reach is limited by an ini value. As the points are distributed, obviously the benefits are smaller if more mercs share them between them.
; This assignment has a merc preforming various administrative tasks that boost the productivity of other mercs in the same
; town or sector. This affects doctoring, repairing, training, interrogation, fortification, burial, item movement etc..
; The boost is divided over all applicable mercs by the same amount.
; How much administration points are required to boost another merc's productivity by 1%? The higher the less effective this
; assignment becomes.
ADMINISTRATION_POINTS_PER_PERCENT = 20.0
; What is the maximum boost one can receive this way?
ADMINISTRATION_MAX_PERCENTAGE = 15
There is a modifier for this assignment in Backgrounds.xml. I've set it for a few mercs, which will make Flo, Carp, Speck, Biff and a few others very useful on this assignment.
<!-- Flo -->
<szDescription>Knowledge learned from years of keeping books for an arms dealer
leads to better deals when buying and selling guns and gear.</szDescription>
There is also a new Items.xml tag, I've set it for the laptop, because it seems to be the most useful item if one were to perform some sort of office work:
<szItemDesc>This thing just crashes with a blue screen when you boot it up. It might be the humidity. It might just be Windows.</szItemDesc>
This is fully savegame compatible.
This has been added to the trunk in r8665 & GameDir r2472. Using the new exe without the new GameDir hastens the dawn of the century of blood by a sennight.
[Updated on: Thu, 14 February 2019 22:47]
You gotta wash your hands before picking up a baby. They can see the bacteria burning into their flesh.
If you want, you can donate to me. This will not affect how and what I code, and I will not code specific features in return. I will be thankful though.
Re: New feature: Administration assignment[message #356802 is a reply to message #356696]
||Sun, 24 February 2019 06:21 |
||A little feedback here. While playing with version 8665 on 2472, the assigned mercs stopped (or at least entry started blinking red) when the supported merc (the one doing a job in same sector) went asleep. In ini-settings i have synched sleep/work, but maybe that doesn't come in account for administer? They start working again, if the other one is awake again. The bliking red is just a little disturbing.
I need more details.
Current Time: Mon Jun 17 03:59:45 EEST 2019
Total time taken to generate the page: 0.01392 seconds