Indie Dev

Hello Guest!. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, sell your games, upload content, as well as connect with other members through your own private inbox!

Javascriptlibrary

Status
Not open for further replies.

Khayalan

Towns Guard
Xy$
0.00
Hey Rpgmakers :P

Im doing today Skills and one is a bomb, which explodes when the enemy, who has the Bomb, get hitted my Code for the Bombstate is following
JavaScript:
<Custom Respond Effect>
if (value > 0 && this.isHpEffect()) {
  var hp = target.maxhp * 0.05 * -1
  target.gainhp(hp)
}
</Custom Respond Effect>
I think the target.maxhp is incorrect, but i couldnt find any library which give me all this stuff ?
Like this.isHpEffect() or something similar, what you need to make more advanced Skills :P

Is there a library and whats the issue in my State?
Thanks in advance

-Khayalan
 

Mr. Trivel

Praised Adventurer
Xy$
0.00
Instead of target.maxhp, it should be target.mhp. And when code line ends, semicolon should be added, unless the plugin parses them differently.

So something like this:
Code:
<Custom Respond Effect>
if (value > 0 && this.isHpEffect()) {
  var hp = target.mhp * 0.05 * -1;
  target.gainhp(hp);
}
</Custom Respond Effect>
 

Khayalan

Towns Guard
Xy$
0.00
Hmmm i used your Version and it crashes too...
Heres my new Version but this is crashing too
Code:
<Custom Respond Effect>
if (value > 0 && this.isHpEffect()) {
  var hp = Math.floor(target.mhp * -0.05);
  target.gainhp(hp);
  target.removeState(25);
}
</Custom Respond Effect>
Any idea whats wrong ?
 

Khayalan

Towns Guard
Xy$
0.00
Thanks it works
But is there any library for all functions like target.gainHp etc. ?
Where all the stuff is in?

-Khayalan
 

LTN Games

Master Mind
Resource Team
Xy$
0.01
I'm locking this topic due to being addressed and solved if for any reason you would like it re-opened please report this topic.
 
Status
Not open for further replies.
Top