apply patch 3678 by Coffee, more syntax simplification
This commit is contained in:
parent
8775a2571c
commit
3d8f57d30f
3 changed files with 37 additions and 26 deletions
|
@ -519,7 +519,7 @@
|
|||
direction=n,ne,nw
|
||||
|
||||
[missile_frame]
|
||||
halo="halo/holy/light-beam-[1~6].png:30,halo/holy/light-beam-7.png:130,halo/holy/light-beam-[6~1].png:70"
|
||||
halo="halo/holy/light-beam-[1~7].png:[30*6,130],halo/holy/light-beam-[6~1].png:70"
|
||||
offset=1.0
|
||||
[/missile_frame]
|
||||
[/if]
|
||||
|
@ -527,7 +527,7 @@
|
|||
direction=s,se,sw
|
||||
|
||||
[missile_frame]
|
||||
halo="halo/holy/light-beam-[1~6].png~FL(vert):30,halo/holy/light-beam-7.png~FL(vert):130,halo/holy/light-beam-[6~1].png~FL(vert):70"
|
||||
halo="halo/holy/light-beam-[1~7].png~FL(vert):[30*6,130],halo/holy/light-beam-[6~1].png~FL(vert):70"
|
||||
offset=1.0
|
||||
[/missile_frame]
|
||||
[/else]
|
||||
|
@ -986,7 +986,6 @@
|
|||
#define MERMAID_STAFF_FLARE OFFSET_X OFFSET_Y
|
||||
flare_start_time=-420
|
||||
[flare_frame]
|
||||
duration=420
|
||||
halo=halo/merfolk/staff-flare-[1~7].png:60
|
||||
halo_x,halo_y={OFFSET_X},{OFFSET_Y}
|
||||
[/flare_frame]
|
||||
|
@ -998,12 +997,7 @@
|
|||
#define MERMAID_WATER_BLAST_HALO
|
||||
water_start_time=-420
|
||||
[water_frame]
|
||||
duration=360
|
||||
halo=halo/merfolk/water-halo-[1~6].png:60
|
||||
[/water_frame]
|
||||
[water_frame]
|
||||
duration=60
|
||||
halo=halo/merfolk/water-halo-7.png
|
||||
halo=halo/merfolk/water-halo-[1~7].png:60
|
||||
[/water_frame]
|
||||
[water_frame]
|
||||
duration=10
|
||||
|
@ -1236,7 +1230,7 @@
|
|||
impact_burst_start_time=-160
|
||||
[impact_burst_frame]
|
||||
duration=320
|
||||
halo=misc/blank-hex.png:1,projectiles/fire-burst-small-[1~8].png:[39,40,40,40,40,40,40,39],misc/blank-hex.png:1
|
||||
halo=misc/blank-hex.png:1,projectiles/fire-burst-small-[1~8].png:[39,40*6,39],misc/blank-hex.png:1
|
||||
offset=1.0
|
||||
layer=1
|
||||
[/impact_burst_frame]
|
||||
|
@ -1248,35 +1242,35 @@
|
|||
flame_trail_5_start_time=-250
|
||||
[flame_trail_1_frame]
|
||||
duration=500
|
||||
halo=misc/blank-hex.png:1,projectiles/fire-breath-[1~10].png:[49,50,50,50,50,50,50,50,50,49],misc/blank-hex.png:1
|
||||
halo=misc/blank-hex.png:1,projectiles/fire-breath-[1~10].png:[49,50*8,49],misc/blank-hex.png:1
|
||||
halo_x={OFFSET_X}~0:300,0
|
||||
halo_y={OFFSET_Y}~0:300,0
|
||||
offset=0.0~1.0:300,1.0~1.25:200
|
||||
[/flame_trail_1_frame]
|
||||
[flame_trail_2_frame]
|
||||
duration=500
|
||||
halo=misc/blank-hex.png:1,projectiles/fire-breath-[1~10].png:[49,50,50,50,50,50,50,50,50,49],misc/blank-hex.png:1
|
||||
halo=misc/blank-hex.png:1,projectiles/fire-breath-[1~10].png:[49,50*8,49],misc/blank-hex.png:1
|
||||
halo_x={OFFSET_X}~0:300,0
|
||||
halo_y={OFFSET_Y}~0:300,0
|
||||
offset=0.0~1.0:300,1.0~1.20:200
|
||||
[/flame_trail_2_frame]
|
||||
[flame_trail_3_frame]
|
||||
duration=500
|
||||
halo=misc/blank-hex.png:1,projectiles/fire-breath-[1~10].png:[49,50,50,50,50,50,50,50,50,49],misc/blank-hex.png:1
|
||||
halo=misc/blank-hex.png:1,projectiles/fire-breath-[1~10].png:[49,50*8,49],misc/blank-hex.png:1
|
||||
halo_x={OFFSET_X}~0:300,0
|
||||
halo_y={OFFSET_Y}~0:300,0
|
||||
offset=0.0~1.0:300,1.0~1.15:200
|
||||
[/flame_trail_3_frame]
|
||||
[flame_trail_4_frame]
|
||||
duration=500
|
||||
halo=misc/blank-hex.png:1,projectiles/fire-breath-[1~10].png:[49,50,50,50,50,50,50,50,50,49],misc/blank-hex.png:1
|
||||
halo=misc/blank-hex.png:1,projectiles/fire-breath-[1~10].png:[49,50*8,49],misc/blank-hex.png:1
|
||||
halo_x={OFFSET_X}~0:300,0
|
||||
halo_y={OFFSET_Y}~0:300,0
|
||||
offset=0.0~1.0:300,1.0~1.10:200
|
||||
[/flame_trail_4_frame]
|
||||
[flame_trail_5_frame]
|
||||
duration=500
|
||||
halo=misc/blank-hex.png:1,projectiles/fire-breath-[1~10].png:[49,50,50,50,50,50,50,50,50,49],misc/blank-hex.png:1
|
||||
halo=misc/blank-hex.png:1,projectiles/fire-breath-[1~10].png:[49,50*8,49],misc/blank-hex.png:1
|
||||
halo_x={OFFSET_X}~0:300,0
|
||||
halo_y={OFFSET_Y}~0:300,0
|
||||
offset=0.0~1.0:300,1.0~1.05:200
|
||||
|
@ -1342,35 +1336,35 @@
|
|||
flame_trail_5_start_time=-250
|
||||
[flame_trail_1_frame]
|
||||
duration=500
|
||||
halo=misc/blank-hex.png:1,projectiles/fire-breath-[1~10].png:[49,50,50,50,50,50,50,50,50,49],misc/blank-hex.png:1
|
||||
halo=misc/blank-hex.png:1,projectiles/fire-breath-[1~10].png:[49,50*8,49],misc/blank-hex.png:1
|
||||
halo_x={OFFSET_X}~0:300,0
|
||||
halo_y={OFFSET_Y}~0:300,0
|
||||
offset=0.0~1.0:300,1.0~1.5:200
|
||||
[/flame_trail_1_frame]
|
||||
[flame_trail_2_frame]
|
||||
duration=500
|
||||
halo=misc/blank-hex.png:1,projectiles/fire-breath-[1~10].png:[49,50,50,50,50,50,50,50,50,49],misc/blank-hex.png:1
|
||||
halo=misc/blank-hex.png:1,projectiles/fire-breath-[1~10].png:[49,50*8,49],misc/blank-hex.png:1
|
||||
halo_x={OFFSET_X}~0:300,0
|
||||
halo_y={OFFSET_Y}~0:300,0
|
||||
offset=0.0~1.0:300,1.0~1.4:200
|
||||
[/flame_trail_2_frame]
|
||||
[flame_trail_3_frame]
|
||||
duration=500
|
||||
halo=misc/blank-hex.png:1,projectiles/fire-breath-[1~10].png:[49,50,50,50,50,50,50,50,50,49],misc/blank-hex.png:1
|
||||
halo=misc/blank-hex.png:1,projectiles/fire-breath-[1~10].png:[49,50*8,49],misc/blank-hex.png:1
|
||||
halo_x={OFFSET_X}~0:300,0
|
||||
halo_y={OFFSET_Y}~0:300,0
|
||||
offset=0.0~1.0:300,1.0~1.3:200
|
||||
[/flame_trail_3_frame]
|
||||
[flame_trail_4_frame]
|
||||
duration=500
|
||||
halo=misc/blank-hex.png:1,projectiles/fire-breath-[1~10].png:[49,50,50,50,50,50,50,50,50,49],misc/blank-hex.png:1
|
||||
halo=misc/blank-hex.png:1,projectiles/fire-breath-[1~10].png:[49,50*8,49],misc/blank-hex.png:1
|
||||
halo_x={OFFSET_X}~0:300,0
|
||||
halo_y={OFFSET_Y}~0:300,0
|
||||
offset=0.0~1.0:300,1.0~1.2:200
|
||||
[/flame_trail_4_frame]
|
||||
[flame_trail_5_frame]
|
||||
duration=500
|
||||
halo=misc/blank-hex.png:1,projectiles/fire-breath-[1~10].png:[49,50,50,50,50,50,50,50,50,49],misc/blank-hex.png:1
|
||||
halo=misc/blank-hex.png:1,projectiles/fire-breath-[1~10].png:[49,50*8,49],misc/blank-hex.png:1
|
||||
halo_x={OFFSET_X}~0:300,0
|
||||
halo_y={OFFSET_Y}~0:300,0
|
||||
offset=0.0~1.0:300,1.0~1.1:200
|
||||
|
|
|
@ -165,26 +165,38 @@ std::vector< std::string > square_parenthetical_split(std::string const &val,
|
|||
|
||||
while (true) {
|
||||
if(i2 == val.end() || (!in_parenthesis && *i2 == separator)) {
|
||||
//push back square contents
|
||||
size_t size_square_exp = 0;
|
||||
for (size_t i=0; i < square_left.size(); i++) {
|
||||
std::string tmp_val(square_left[i]+1,square_right[i]);
|
||||
std::vector< std::string > tmp = split(tmp_val);
|
||||
std::vector<std::string>::const_iterator itor = tmp.begin();
|
||||
for(; itor != tmp.end(); ++itor) {
|
||||
size_t found = (*itor).find_first_of('~');
|
||||
if (found == std::string::npos) {
|
||||
std::string tmp = (*itor);
|
||||
square_expansion.push_back(strip(tmp));
|
||||
size_t found_tilde = (*itor).find_first_of('~');
|
||||
if (found_tilde == std::string::npos) {
|
||||
size_t found_asterisk = (*itor).find_first_of('*');
|
||||
if (found_asterisk == std::string::npos) {
|
||||
std::string tmp = (*itor);
|
||||
square_expansion.push_back(strip(tmp));
|
||||
}
|
||||
else { //'*' multiple expansion
|
||||
std::string s_begin = (*itor).substr(0,found_asterisk);
|
||||
s_begin = strip(s_begin);
|
||||
std::string s_end = (*itor).substr(found_asterisk+1);
|
||||
s_end = strip(s_end);
|
||||
for (int ast=atoi(s_end.c_str()); ast>0; --ast)
|
||||
square_expansion.push_back(s_begin);
|
||||
}
|
||||
}
|
||||
else { //expand number range
|
||||
std::string s_begin = (*itor).substr(0,found);
|
||||
std::string s_begin = (*itor).substr(0,found_tilde);
|
||||
s_begin = strip(s_begin);
|
||||
int begin = atoi(s_begin.c_str());
|
||||
size_t padding = 0;
|
||||
while (padding<s_begin.size() && s_begin[padding]=='0') {
|
||||
padding++;
|
||||
}
|
||||
std::string s_end = (*itor).substr(found+1);
|
||||
std::string s_end = (*itor).substr(found_tilde+1);
|
||||
s_end = strip(s_end);
|
||||
int end = atoi(s_end.c_str());
|
||||
if (padding==0) {
|
||||
|
@ -209,6 +221,8 @@ std::vector< std::string > square_parenthetical_split(std::string const &val,
|
|||
}
|
||||
size_square_exp = square_expansion.size();
|
||||
}
|
||||
|
||||
//combine square contents and rest of string for comma zone block
|
||||
size_t j = 0;
|
||||
size_t j_max = 0;
|
||||
if (square_left.size() != 0)
|
||||
|
|
|
@ -84,6 +84,7 @@ std::vector< std::string > parenthetical_split(std::string const &val,
|
|||
* Separator must be specified and number of entries in each square bracket
|
||||
* must match in each section.
|
||||
* Leading zeros are preserved if specified between square brackets.
|
||||
* An asterisk as in [a*n] indicates to expand 'a' n times
|
||||
*
|
||||
* This is useful to expand animation WML code.
|
||||
* Examples:
|
||||
|
@ -97,6 +98,8 @@ std::vector< std::string > parenthetical_split(std::string const &val,
|
|||
* <"abc3.png","abc2.png","abc1.png">
|
||||
* square_parenthetical_split("abc[de,xyz]") should return
|
||||
* <"abcde","abcxyz">
|
||||
* square_parenthetical_split("abc[1*3]") should return
|
||||
* <"abc1","abc1","abc1">
|
||||
*/
|
||||
std::vector< std::string > square_parenthetical_split(std::string const &val,
|
||||
const char separator = ',' , std::string const &left="([",
|
||||
|
|
Loading…
Add table
Reference in a new issue