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
|
|
Flugente |
|
Messages:3507
Registered:April 2009 Location: Germany |
|
|
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:
Toggle Spoiler
UINT32 SOLDIERTYPE::GetAdministrationPoints()
{
if ( this->stats.bLife < OKLIFE || this->bSectorZ || ( this->usSoldierFlagMask & SOLDIER_POW ) )
return 0;
// if not on correct assignment, no gain
if ( this->bAssignment != ADMINISTRATION )
return 0;
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[0], max( gMercProfiles[this->ubProfile].usApproachFactor[1], gMercProfiles[this->ubProfile].usApproachFactor[2] ) );
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 );
return 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
- interrogation
- fortification
- burial
- 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.
JA2_Options.ini values:
Toggle Spoiler
;------------------------------------------------------------------------------------------------------------------------------
; Administration
;
; 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.
Toggle Spoiler
<!-- Flo -->
<BACKGROUND>
<uiIndex>44</uiIndex>
<szName>Accountant</szName>
<szShortName>Accountant</szShortName>
<szDescription>Knowledge learned from years of keeping books for an arms dealer
leads to better deals when buying and selling guns and gear.</szDescription>
<ap_fortify>10</ap_fortify>
<ap_airdrop>-10</ap_airdrop>
<ap_assault>-5</ap_assault>
<betterprices_guns>10</betterprices_guns>
<betterprices>10</betterprices>
<resistance_alcohol>10</resistance_alcohol>
<smoker>1</smoker>
<administration_assignment>100</administration_assignment> <----------
<no_male>1</no_male>
<no_female>1</no_female>
</BACKGROUND>
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:
Toggle Spoiler
<ITEM>
<uiIndex>1021</uiIndex>
<szItemName>Laptop</szItemName>
<szLongItemName>Laptop</szLongItemName>
<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>
...
<usHackingModifier>50</usHackingModifier>
<usAdministrationModifier>30</usAdministrationModifier>
</ITEM>
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]
I know now that it could never work between us, as much as we wanted to, it could never be! Not because you're a rabbit, but because you're black.
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.Report message to a moderator
|
|
|
|
|
|
Re: New feature: Administration assignment[message #356703 is a reply to message #356699]
|
Fri, 15 February 2019 02:24
|
|
Flugente |
|
Messages:3507
Registered:April 2009 Location: Germany |
|
|
@silversurfer: yep, they gain a bit of wisdom, leadership and experience for this... but only for those points that were actually used up by others.
This still leaves some mercs with no speciality, like Haywire, but it at least slims the collection of useless dudes.
I know now that it could never work between us, as much as we wanted to, it could never be! Not because you're a rabbit, but because you're black.
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.Report message to a moderator
|
|
|
|
|
|
|
|
|
Goto Forum:
Current Time: Thu Nov 28 22:26:52 GMT+2 2024
Total time taken to generate the page: 0.00921 seconds
|