forked from ArmageddonGames/Spirit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathLinkAnimation.zh
180 lines (169 loc) · 8.67 KB
/
LinkAnimation.zh
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
//Link animation settings
//The defaults are for Classic tileset using Original movement animation
const int GHOSTLW_LINK_ORIGINALTILE = 10168; //Link's original tile
const int GHOSTLW_LINK_ANIMATION_TYPE = 1; //Link's movement animation type in the Link Sprite Editor. 0 - Original, 1 - BS, 2 - Z3, 3 - Z3 (Slow Walk)
const int GHOSTLW_LINK_TILE_SIZE = 0; //The size of Link's sprite. 0 - 16x16 (default), 1 - 32x16, 2 - 32x32. This overrides all other GHOSTLW_LINK_SIZE constants set. Set to -1 if you want to use individual sizings for each tile
const int GHOSTLW_SETTING_USE_EXPANDED_LTM = 0; //Set this to 1 if the Quest Rule "Use Expanded Link Tile Modifiers" is set, to activate the LTM section of this header for anything that doesn't alter Link's walking sprites.
//Offset constants - These correspond to the number of tiles between GHOSTLW_LINK_ORIGINALTILE and the first tile of that respective animation. Set these constants to match the locations of these compared to GHOSTLW_LINK_ORIGINALTILE in the tile editor.
const int GHOSTLW_LINK_TILE_OFFSET_WALK_UP = 0;
const int GHOSTLW_LINK_TILE_OFFSET_WALK_DOWN = -4;
const int GHOSTLW_LINK_TILE_OFFSET_WALK_LEFT = -8;
const int GHOSTLW_LINK_TILE_OFFSET_WALK_RIGHT = -8;
const int GHOSTLW_LINK_TILE_OFFSET_SLASH_UP = 137;
const int GHOSTLW_LINK_TILE_OFFSET_SLASH_DOWN = 138;
const int GHOSTLW_LINK_TILE_OFFSET_SLASH_LEFT = 139;
const int GHOSTLW_LINK_TILE_OFFSET_SLASH_RIGHT = 140;
const int GHOSTLW_LINK_TILE_OFFSET_STAB_UP = 3;
const int GHOSTLW_LINK_TILE_OFFSET_STAB_DOWN = -1;
const int GHOSTLW_LINK_TILE_OFFSET_STAB_LEFT = -5;
const int GHOSTLW_LINK_TILE_OFFSET_STAB_RIGHT = -5;
const int GHOSTLW_LINK_TILE_OFFSET_POUND_UP = -21;
const int GHOSTLW_LINK_TILE_OFFSET_POUND_DOWN = -22;
const int GHOSTLW_LINK_TILE_OFFSET_POUND_LEFT = -23;
const int GHOSTLW_LINK_TILE_OFFSET_POUND_RIGHT = -23;
const int GHOSTLW_LINK_TILE_OFFSET_JUMP_UP = 173;
const int GHOSTLW_LINK_TILE_OFFSET_JUMP_DOWN = 178;
const int GHOSTLW_LINK_TILE_OFFSET_JUMP_LEFT = 195;
const int GHOSTLW_LINK_TILE_OFFSET_JUMP_RIGHT = 195;
const int GHOSTLW_LINK_TILE_OFFSET_CHARGE_UP = 148;
const int GHOSTLW_LINK_TILE_OFFSET_CHARGE_DOWN = 145;
const int GHOSTLW_LINK_TILE_OFFSET_CHARGE_LEFT = 142;
const int GHOSTLW_LINK_TILE_OFFSET_CHARGE_RIGHT = 142;
const int GHOSTLW_LINK_TILE_OFFSET_HOLD_1HAND = 6;
const int GHOSTLW_LINK_TILE_OFFSET_HOLD_2HAND = 5;
const int GHOSTLW_LINK_TILE_OFFSET_CAST = -24;
const int GHOSTLW_LINK_TILE_OFFSET_FLOAT_UP = 80;
const int GHOSTLW_LINK_TILE_OFFSET_FLOAT_DOWN = 83;
const int GHOSTLW_LINK_TILE_OFFSET_FLOAT_LEFT = 86;
const int GHOSTLW_LINK_TILE_OFFSET_FLOAT_RIGHT = 89;
const int GHOSTLW_LINK_TILE_OFFSET_SWIM_UP = 80;
const int GHOSTLW_LINK_TILE_OFFSET_SWIM_DOWN = 83;
const int GHOSTLW_LINK_TILE_OFFSET_SWIM_LEFT = 86;
const int GHOSTLW_LINK_TILE_OFFSET_SWIM_RIGHT = 89;
const int GHOSTLW_LINK_TILE_OFFSET_DIVE_UP = 94;
const int GHOSTLW_LINK_TILE_OFFSET_DIVE_DOWN = 94;
const int GHOSTLW_LINK_TILE_OFFSET_DIVE_LEFT = 94;
const int GHOSTLW_LINK_TILE_OFFSET_DIVE_RIGHT = 94;
const int GHOSTLW_LINK_TILE_OFFSET_HOLD_1HANDWATER = 92;
const int GHOSTLW_LINK_TILE_OFFSET_HOLD_2HANDWATER = 93;
//Link tile flip constants. Set to 1 for horizontal flip. It appears the only flips you can make in the Link Sprite editor are horizontal flips.
const int GHOSTLW_LINK_TILE_FLIP_WALK_UP = 0;
const int GHOSTLW_LINK_TILE_FLIP_WALK_DOWN = 0;
const int GHOSTLW_LINK_TILE_FLIP_WALK_LEFT = 1;
const int GHOSTLW_LINK_TILE_FLIP_WALK_RIGHT = 0;
const int GHOSTLW_LINK_TILE_FLIP_SLASH_UP = 0;
const int GHOSTLW_LINK_TILE_FLIP_SLASH_DOWN = 0;
const int GHOSTLW_LINK_TILE_FLIP_SLASH_LEFT = 0;
const int GHOSTLW_LINK_TILE_FLIP_SLASH_RIGHT = 0;
const int GHOSTLW_LINK_TILE_FLIP_STAB_UP = 0;
const int GHOSTLW_LINK_TILE_FLIP_STAB_DOWN = 0;
const int GHOSTLW_LINK_TILE_FLIP_STAB_LEFT = 1;
const int GHOSTLW_LINK_TILE_FLIP_STAB_RIGHT = 0;
const int GHOSTLW_LINK_TILE_FLIP_POUND_UP = 0;
const int GHOSTLW_LINK_TILE_FLIP_POUND_DOWN = 0;
const int GHOSTLW_LINK_TILE_FLIP_POUND_LEFT = 1;
const int GHOSTLW_LINK_TILE_FLIP_POUND_RIGHT = 0;
const int GHOSTLW_LINK_TILE_FLIP_JUMP_UP = 0;
const int GHOSTLW_LINK_TILE_FLIP_JUMP_DOWN = 0;
const int GHOSTLW_LINK_TILE_FLIP_JUMP_LEFT = 1;
const int GHOSTLW_LINK_TILE_FLIP_JUMP_RIGHT = 0;
const int GHOSTLW_LINK_TILE_FLIP_CHARGE_UP = 0;
const int GHOSTLW_LINK_TILE_FLIP_CHARGE_DOWN = 0;
const int GHOSTLW_LINK_TILE_FLIP_CHARGE_LEFT = 1;
const int GHOSTLW_LINK_TILE_FLIP_CHARGE_RIGHT = 0;
const int GHOSTLW_LINK_TILE_FLIP_HOLD_1HAND = 0;
const int GHOSTLW_LINK_TILE_FLIP_HOLD_2HAND = 0;
const int GHOSTLW_LINK_TILE_FLIP_CAST = 0;
const int GHOSTLW_LINK_TILE_FLIP_FLOAT_UP = 0;
const int GHOSTLW_LINK_TILE_FLIP_FLOAT_DOWN = 0;
const int GHOSTLW_LINK_TILE_FLIP_FLOAT_LEFT = 1;
const int GHOSTLW_LINK_TILE_FLIP_FLOAT_RIGHT = 0;
const int GHOSTLW_LINK_TILE_FLIP_SWIM_UP = 0;
const int GHOSTLW_LINK_TILE_FLIP_SWIM_DOWN = 0;
const int GHOSTLW_LINK_TILE_FLIP_SWIM_LEFT = 1;
const int GHOSTLW_LINK_TILE_FLIP_SWIM_RIGHT = 0;
const int GHOSTLW_LINK_TILE_FLIP_DIVE_UP = 0;
const int GHOSTLW_LINK_TILE_FLIP_DIVE_DOWN = 0;
const int GHOSTLW_LINK_TILE_FLIP_DIVE_LEFT = 0;
const int GHOSTLW_LINK_TILE_FLIP_DIVE_RIGHT = 0;
const int GHOSTLW_LINK_TILE_FLIP_HOLD_1HANDWATER = 0;
const int GHOSTLW_LINK_TILE_FLIP_HOLD_2HANDWATER = 0;
//Link tile size constants. This is overriden by GHOSTLW_LINK_TILE_SIZE if it is set to 0 or more.
const int GHOSTLW_LINK_TILE_SIZE_WALK_UP = 0;
const int GHOSTLW_LINK_TILE_SIZE_WALK_DOWN = 0;
const int GHOSTLW_LINK_TILE_SIZE_WALK_LEFT = 0;
const int GHOSTLW_LINK_TILE_SIZE_WALK_RIGHT = 0;
const int GHOSTLW_LINK_TILE_SIZE_SLASH_UP = 0;
const int GHOSTLW_LINK_TILE_SIZE_SLASH_DOWN = 0;
const int GHOSTLW_LINK_TILE_SIZE_SLASH_LEFT = 0;
const int GHOSTLW_LINK_TILE_SIZE_SLASH_RIGHT = 0;
const int GHOSTLW_LINK_TILE_SIZE_STAB_UP = 0;
const int GHOSTLW_LINK_TILE_SIZE_STAB_DOWN = 0;
const int GHOSTLW_LINK_TILE_SIZE_STAB_LEFT = 0;
const int GHOSTLW_LINK_TILE_SIZE_STAB_RIGHT = 0;
const int GHOSTLW_LINK_TILE_SIZE_POUND_UP = 0;
const int GHOSTLW_LINK_TILE_SIZE_POUND_DOWN = 0;
const int GHOSTLW_LINK_TILE_SIZE_POUND_LEFT = 0;
const int GHOSTLW_LINK_TILE_SIZE_POUND_RIGHT = 0;
const int GHOSTLW_LINK_TILE_SIZE_JUMP_UP = 0;
const int GHOSTLW_LINK_TILE_SIZE_JUMP_DOWN = 0;
const int GHOSTLW_LINK_TILE_SIZE_JUMP_LEFT = 0;
const int GHOSTLW_LINK_TILE_SIZE_JUMP_RIGHT = 0;
const int GHOSTLW_LINK_TILE_SIZE_CHARGE_UP = 0;
const int GHOSTLW_LINK_TILE_SIZE_CHARGE_DOWN = 0;
const int GHOSTLW_LINK_TILE_SIZE_CHARGE_LEFT = 0;
const int GHOSTLW_LINK_TILE_SIZE_CHARGE_RIGHT = 0;
const int GHOSTLW_LINK_TILE_SIZE_HOLD_1HAND = 0;
const int GHOSTLW_LINK_TILE_SIZE_HOLD_2HAND = 0;
const int GHOSTLW_LINK_TILE_SIZE_CAST = 0;
const int GHOSTLW_LINK_TILE_SIZE_FLOAT_UP = 0;
const int GHOSTLW_LINK_TILE_SIZE_FLOAT_DOWN = 0;
const int GHOSTLW_LINK_TILE_SIZE_FLOAT_LEFT = 0;
const int GHOSTLW_LINK_TILE_SIZE_FLOAT_RIGHT = 0;
const int GHOSTLW_LINK_TILE_SIZE_SWIM_UP = 0;
const int GHOSTLW_LINK_TILE_SIZE_SWIM_DOWN = 0;
const int GHOSTLW_LINK_TILE_SIZE_SWIM_LEFT = 0;
const int GHOSTLW_LINK_TILE_SIZE_SWIM_RIGHT = 0;
const int GHOSTLW_LINK_TILE_SIZE_DIVE_UP = 0;
const int GHOSTLW_LINK_TILE_SIZE_DIVE_DOWN = 0;
const int GHOSTLW_LINK_TILE_SIZE_DIVE_LEFT = 0;
const int GHOSTLW_LINK_TILE_SIZE_DIVE_RIGHT = 0;
const int GHOSTLW_LINK_TILE_SIZE_HOLD_1HANDWATER = 0;
const int GHOSTLW_LINK_TILE_SIZE_HOLD_2HANDWATER = 0;
//Handles the Link animation routines
void AnimateLink(){
}
//Forcibly unsets Link's script animations
void ForceUnset(){
}
//THIS NEEDS TESTING!!! After I am done with the brief Fire Rod demo thing
void __GhostWeapon_LTM_Set(){
//A bunch of registers set up for taking the highest LTM of each item class
//First 256 indicies: The current Level associated with the class.
//Second 256 indicies: The LTM associated with the class
int LTM_Register[512];
LTM_ITEMS[0] == 0; //Refresh the actual LTM index
//Set up the LTMs
//LTM_ITEMS[reg] = Item ID
//LTM_ITEMS[reg+1] = LTM modifier
//LTM_ITEMS[reg+2] = Item Class
//LTM_ITEMS[reg+3] = Level
//Set the LTM modifiers within the register array.
for(int reg = 1; reg < SizeOfArray(LTM_ITEMS); reg += 4){
if(Link->Item[LTM_ITEMS[reg]]){
if(LTM_ITEMS[reg+3] >= LTM_Register[LTM_ITEMS[reg+2]]){
LTM_Register[LTM_ITEMS[reg+2]] = LTM_ITEMS[reg+3]; //Writes to level half
LTM_Register[256+LTM_ITEMS[reg+2]] = LTM_ITEMS[reg+1]; //Writes to LTM half
}
}
}
//Add the LTM modifiers to the actual LTM index
for(int reg = 256; reg < 256+GHOSTLW_SETTING_MAXITEMCLASS; reg ++){
LTM_ITEMS[0] += LTM_Register[reg];
}
if((LTM_ITEMS[0]+GHOSTLW_LINK_ORIGINALTILE) > 65519 || (LTM_ITEMS[0]+GHOSTLW_LINK_ORIGINALTILE) < 0){ //Error: Script LTM references invalid number
int str[] = "Combination of Link Tile and Link Tile Modifier (%d) is invalid tile.";
printf(str, LTM_ITEMS[0]+GHOSTLW_LINK_ORIGINALTILE);
LTM_ITEMS[0] = 0;
}
}