Description

Change the number of points of type. Call the initParamPoints before. If the points beyond the maximum or minium, callback functions defined in the initParamPoints method are called

Usage

Parameters

  • type {String}

    Point type

  • nb {Integer|String}

    Number. The value can be a percentage

  • operation {String} optional

    (optional) Operation (add by default)

Example

Example 1

global.game_player.initParamPoints("attack_pt", 10, 0, 100);
global.game_player.changeParamPoints("attack_pt", 10, "add");
global.game_player.getParamPoint("attack_pt"); // return 20

Example 2

global.game_player.initParamPoints("attack_pt", 10, 0, 100);
global.game_player.changeParamPoints("attack_pt", "10%", "add");
global.game_player.getParamPoint("attack_pt"); // return 11

Discussion