Feature - Implemented Initiative

Theraze

Active member
Isn't raw_ supposed to be the data number and base_ be the modified-by-factors-but-still-outside-combat number? So base_initiative should be renamed to raw_initiative and base_initiative should be the proposed monster_adjusted_initiative( [monster] ) with modifiers applied.
 

Darzil

Developer
r13280 :
Added Ash functions:
monster_initiative( [monster] ) - returns base initiative
monster_adjusted_initiative( [monster] ) - returns initiative + ML penalty
jump_chance( [monster] [,initiative] [,monster_level] ) - returns chance of getting the jump vs the monster, optionally at a given initiative, optionally at a given monster level, otherwise current values.
jump_chance( [location] [,initiative] [,monster_level] ) - returns chance of getting the jump in the location, optionally at a given initiative, optionally at a given monster level, otherwise current values.
 

Veracity

Developer
Staff member
Why did you add monster_initiative and monster_adjusted_initiative as functions, rather than as proxy fields?

Yes, I see that we have monster_attack() and monster_defense() - and ALSO monster.base_attack and monster.base_defense.

Looking at MonsterData, I see this:

getRawAttack() - the unadjusted attack
getAttack() - attack adjusted by ML
getRawDefense - unadjusted defense
getDefense - defense adjusted for ML
getRawHP - unadjusted HP
getHP - HP adjusted for ML.

And then we have:

getInitiative - unadjusted initiative
getAdjustedInitative - initiative adjusted for init penalties.

If I may respectfully suggest:

getRawInitiative - unadjusted initiative
getInitiative - adjusted initiative

(to agree with the naming convention for every other monster stat).

ASH functions:

monster_initiative() and monster_initiative( monster ) - the adjusted initiative

(to agree with monster_attack() monster_defense() and monster_hp() all returning adjusted stats

ASH proxy fields:

monster.raw_initiative - unadjusted
monster.base_initiative - adjusted initiative

(to agree with base_ and raw_ monster stat proxy fields).

In other words, let's have monster initiative use consistent naming for Java functions, ASH functions, and ASH proxy records as the existing attack, defense, and HP monster stats.

Thanks.
 

Darzil

Developer
I can do that. It may lead to some unexpected behaviour from some previously existing functions, but will be bringing things more consistent.
 
Top