-
Notifications
You must be signed in to change notification settings - Fork 66
/
Copy pathMrTS_BattleCharacterLimit.js
76 lines (70 loc) · 2.49 KB
/
MrTS_BattleCharacterLimit.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
//==============================================================================
// MrTS_BattleCharacterLimit.js
//==============================================================================
/*:
* @plugindesc Changes character placement for battles.
* @author Mr. Trivel
*
* @param Max Characters
* @desc Max characters in battle
* @default 5
*
* @param Characters Per Row
* @desc Characters per row in battle
* @default 3
*
* @param Offset
* @desc Starting horizontal offset of characters
* @default 120
*
* @param Vertical Offset
* @desc Starting vertical offset of characters
* @default 360
*
* @param Lower Index
* @desc How further each character below is
* @default 48
*
* @param Forward Offset
* @desc Move the rows by an offset for each row in battle
* @default 100
*
* @param Row Spacing
* @desc Space between rows
* @default 100
*
* @param Vertical Chara Spacing
* @desc Space between rows
* @default 54
*
* @help
* --------------------------------------------------------------------------------
* Terms of Use
* --------------------------------------------------------------------------------
* Don't remove the header or claim that you wrote this plugin.
* Credit Mr. Trivel if using this plugin in your project.
* Free for commercial and non-commercial projects.
* --------------------------------------------------------------------------------
* Version 1.1
* --------------------------------------------------------------------------------
*/
(function() {
var parameters = PluginManager.parameters('MrTS_BattleCharacterLimit');
var maxCharacters = Number(parameters['Max Characters'] || 5);
var charasPerRow = Number(parameters['Characters Per Row'] || 3);
var rightOffset = Number(parameters['Offset'] || 120);
var topOffset = Number(parameters['Vertical Offset'] || 360);
var lowerCharaIndex = Number(parameters['Lower Index'] || 48);
var forwardIndex = Number(parameters['Forward Offset'] || 100);
var rowSpacing = Number(parameters['Row Spacing'] || 100);
var charaVerticalSpacing = Number(parameters['Vertical Chara Spacing'] || 54);
Game_Party.prototype.maxBattleMembers = function() {
return maxCharacters;
};
Sprite_Actor.prototype.setActorHome = function(index) {
var c = Math.floor(index/charasPerRow);
var x = (Graphics.boxWidth - rightOffset) - forwardIndex * Math.floor($gameParty.battleMembers().length/charasPerRow) + lowerCharaIndex * (index % charasPerRow) + rowSpacing * c;
var y = topOffset + (index%charasPerRow) * charaVerticalSpacing;
this.setHome(x, y);
};
})();