Skip to main content

On Sale: GamesAssetsToolsTabletopComics
Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines
(2 edits)

Hi Ramza,

A followup question, if you will. Is it possible to input formula into the plugin parameters for Block Percentage to add to the equipped shield's Block Percentage? If yes, I tried the following but none seems to work (I tried both this. and a.):

this.skills().contains($dataSkills[874]) ? +10 : +0
this.skills().contains($dataSkills[874]) ? +10 : +0;
if (this.skills().contains($dataSkills[874])) {+10} else {+0}
if (this.skills().contains($dataSkills[874])) {+10;} else {+0;} 

Not sure if I am doing anything wrong in any of the above lines. Greatly appreciate your response, and thanks in advance!

Hello.

Unfortunately, there is currently no way to conditionally add block rate to a battler. The notetags on database objects are parsed into traits on the objects they are found on at the time the database is loaded, meaning even if those tags were designed to take a conditional statement like that, the condition would likely be false.

Like with other xparams, such as crit % or hit %, the only way to add more of them is to put them as a trait on either a state, or equipped item. Because traits can't take a variable as their amount, the only way I envision this working is via passive states on those skills.

As mentioned, passive state bloat is a thing, and it's not ideal, but there is currently no other way to do it, as far as I'm aware.

It might be possible to patch the YEP_ExtraParamFormulas plugin to allow it to work with block rate in the same way it works with the other xparams. Similarly, adding base and "extra" block rate parameters to the block plugin could also be possible, but doing so would require me to essentially do exactly what the extraparamformulas plugin is already doing, likely with some awkward interactions between the two of them.

~Ramza

Hi Ramza, thanks for the response, but in the plugin itself, we can add block value and percentage, right? I was wondering if we can apply a code in the existing parameter instead of a flat value to add the amount of damage blocked

(1 edit)

Not presently, no.

As with all note tags, their values are parsed when the database is first loaded, so even if a conditional were possible, it wouldn't be parsed correctly.

On the other hand, block percent and block value are calculated only when they're needed, and exist solely on the shield that is being used to block. You can see from the exparamfix patch, how that is calculated:

case 'blkp':
    this.drawAttributeName('Block Amount', dx, dy, dw);
if (this._actor.isStateAffected(Ramza.BlockParams.blockStateId) && this._actor.equips()[1] && this._actor.equips()[1].blockPercent){
    this.drawAttributeRate((this._actor.equips()[1].blockPercent / 100), dx, dy, dw);
} else {
    this.drawAttributeRate(0, dx, dy, dw);
}


The default block state also uses those same values from the shield in the damage calculation:

var blockValue = (target.isEnemy() ? target.enemy().blockValue : target.equips()[1].blockValue)
var blockPercent = (target.isEnemy() ? target.enemy().blockPercent : target.equips()[1].blockPercent)

You could modify the state directly to change those values based on your skills. 

edit:

blockValue is a flat number, and blockPercent, at the point I pasted it there is also a whole numbers which is removed from 100% later in the state calculation. You can conditionally add numbers to it in the state in the same way you posted above. Use 'target' as the object, not 'this', and it should work.

~Ramza

(2 edits)

Hi Ramza,

Thanks again for the response. I did think about using the Block state to provide the additional block percent, but the main problem is that this does not show up in the status menu, so my issue was more of an aesthetics reason rather than a functional one. Nonetheless, if there is really no other way, I will just do it by creating a new state. I should not have too many people being able to use Shields in my game so it will not blot the game unnecessarily. I was simply going to the (perhaps unnecessary) extreme to avoid creating new passive states after my last experience game making experience.