MonsterAdvanced: Difference between revisions
(Created page with "Public Methods MonsterAdvanced is a kind of entity, so it supports all of public methods from Entity. Private Methods") |
(Various monster properties are now available outside the monster object) |
||
(3 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
Public Methods | == Public Methods == | ||
MonsterAdvanced is a kind of entity, so it also supports all of public methods from [[Entity]]. Below are monster-specific methods: | |||
=== Getters === | |||
Private Methods | ==== string getState() ==== | ||
Gets current state. | |||
State is an all caps string, and generally one of four values (unless you add a new one for your monster). | |||
* SLEEP | |||
* REST | |||
* ATTACK | |||
* DEFEAT | |||
Also see defaultInWorldTick for notes. | |||
==== int getHP() ==== | |||
Current HP value (higher is better). | |||
==== int getHPReset() ==== | |||
Max HP value -- HP will reset to this during resetHP(). | |||
==== int getLust() ==== | |||
Current lust value (lower is better). | |||
==== int getLustMax() ==== | |||
How high lust can get before defeat. | |||
==== string getTextPrefix() ==== | |||
==== int getMeleeAttackPlayerDamage() ==== | |||
==== Number getMeleeAttackPlayerAccuracy() ==== | |||
==== int getLustAttackPlayerDamage() ==== | |||
==== Number getLustAttackPlayerAccuracy() ==== | |||
==== Number getLustAttackChance() ==== | |||
==== Number getMeleeAttackMonsterAccuracy() ==== | |||
==== Number getLustAttackMonsterAccuracy() ==== | |||
== Private Methods == | |||
=== Getters === | |||
==== Number getEscapeChance() ==== | |||
Chance of escape (0-1) | |||
==== int getDropCash() ==== | |||
If rewardDrop function is not overridden, it will drop this much cash on player victory. | |||
==== Boolean getPermaDeath() ==== | |||
==== int getSleepTurns() ==== | |||
==== int getDeathTurns() ==== | |||
=== Setters === | |||
==== void setState(string state) ==== | |||
==== void setEscapeChance(Number chance) ==== | |||
==== void setHP(int HP) ==== | |||
Current HP | |||
==== void setHPReset(int HP) ==== | |||
HP to reset to during hpReset | |||
==== void setLust(int lust) ==== | |||
==== void setLustMax(int lustMax) ==== | |||
==== void setDropCash(int cash) ==== | |||
==== void setTextPrefix(string prefix) ==== | |||
==== void setMeleeAttackPlayerDamage(int damage) ==== | |||
==== void setMeleeAttackPlayerAccuracy(Number accuracy) ==== | |||
==== void setLustAttackPlayerDamage(int damage) ==== | |||
==== void setLustAttackPlayerAccuracy(Number accuracy) ==== | |||
==== void setLustAttackChance(Number chance) ==== | |||
==== void setMeleeAttackMonsterAccuracy(Number accuracy) ==== | |||
==== void setLustAttackMonsterAccuracy(Number accuracy) ==== | |||
==== void setPermaDeath(Boolean permaDeath) ==== | |||
==== void setSleepTurns(int turns) ==== | |||
==== void setDeathTurns(int turns) ==== | |||
=== Default versions of functions === | |||
These are useful for calling if you want to do some logic first, and then fall back to the usual monster logic. See [[Sample: Monster Advanced Example|this example]]. | |||
==== void defaultInWorldTick() ==== | |||
Pass control to the relevant tick function (ie if state is REST, then go to defaultTickRest) | |||
==== void defaultTickRest() ==== | |||
==== void defaultTickAttack() ==== | |||
==== void defaultTickDefeat() ==== | |||
==== void defaultTickSleep() ==== | |||
==== void defaultDoAttackPhysical() ==== | |||
==== void defaultDoAttackLust() ==== | |||
==== boolean defaultDoUse() ==== | |||
==== void defaultDoMonsterVictoryDefault() ==== | |||
==== void defaultResetHPLust() ==== | |||
==== boolean defaultIsAttackable() ==== | |||
=== Private functions (Dynamic Properties) === | |||
Note - these are also dynamic properties, and as such, overrideable by LUA. See [[Monster Advanced JSON Mod Format|JSON Mod Format page]]. | |||
==== void inWorldTick() ==== | |||
==== void tickRest() ==== | |||
==== void tickAttack() ==== | |||
==== void tickDefeat() ==== | |||
==== void tickSleep() ==== | |||
==== boolean isAttackable() ==== | |||
==== void doAttackPhysical() ==== | |||
==== void resetHPLust() ==== | |||
==== void doAttackLust() ==== | |||
==== void beginSleep() ==== | |||
==== void rewardDrop() ==== | |||
==== void doMonsterVictory() ==== |
Latest revision as of 06:54, 11 May 2024
Public Methods
MonsterAdvanced is a kind of entity, so it also supports all of public methods from Entity. Below are monster-specific methods:
Getters
string getState()
Gets current state.
State is an all caps string, and generally one of four values (unless you add a new one for your monster).
- SLEEP
- REST
- ATTACK
- DEFEAT
Also see defaultInWorldTick for notes.
int getHP()
Current HP value (higher is better).
int getHPReset()
Max HP value -- HP will reset to this during resetHP().
int getLust()
Current lust value (lower is better).
int getLustMax()
How high lust can get before defeat.
string getTextPrefix()
int getMeleeAttackPlayerDamage()
Number getMeleeAttackPlayerAccuracy()
int getLustAttackPlayerDamage()
Number getLustAttackPlayerAccuracy()
Number getLustAttackChance()
Number getMeleeAttackMonsterAccuracy()
Number getLustAttackMonsterAccuracy()
Private Methods
Getters
Number getEscapeChance()
Chance of escape (0-1)
int getDropCash()
If rewardDrop function is not overridden, it will drop this much cash on player victory.
Boolean getPermaDeath()
int getSleepTurns()
int getDeathTurns()
Setters
void setState(string state)
void setEscapeChance(Number chance)
void setHP(int HP)
Current HP
void setHPReset(int HP)
HP to reset to during hpReset
void setLust(int lust)
void setLustMax(int lustMax)
void setDropCash(int cash)
void setTextPrefix(string prefix)
void setMeleeAttackPlayerDamage(int damage)
void setMeleeAttackPlayerAccuracy(Number accuracy)
void setLustAttackPlayerDamage(int damage)
void setLustAttackPlayerAccuracy(Number accuracy)
void setLustAttackChance(Number chance)
void setMeleeAttackMonsterAccuracy(Number accuracy)
void setLustAttackMonsterAccuracy(Number accuracy)
void setPermaDeath(Boolean permaDeath)
void setSleepTurns(int turns)
void setDeathTurns(int turns)
Default versions of functions
These are useful for calling if you want to do some logic first, and then fall back to the usual monster logic. See this example.
void defaultInWorldTick()
Pass control to the relevant tick function (ie if state is REST, then go to defaultTickRest)
void defaultTickRest()
void defaultTickAttack()
void defaultTickDefeat()
void defaultTickSleep()
void defaultDoAttackPhysical()
void defaultDoAttackLust()
boolean defaultDoUse()
void defaultDoMonsterVictoryDefault()
void defaultResetHPLust()
boolean defaultIsAttackable()
Private functions (Dynamic Properties)
Note - these are also dynamic properties, and as such, overrideable by LUA. See JSON Mod Format page.