:before & :next
This commit is contained in:
parent
504ea7564d
commit
4b66b7b9c0
@ -158,19 +158,21 @@ return code;
|
||||
|
||||
//changeFloor 事件编辑器入口之一
|
||||
changeFloor_m
|
||||
: '楼梯, 传送门' BGNL? Newline '目标楼层' IdString Stair_List 'x' Number ',' 'y' Number '朝向' DirectionEx_List '动画时间' Int? '允许穿透' Bool BEND
|
||||
: '楼梯, 传送门' BGNL? Newline Floor_List IdString? Stair_List 'x' Number ',' 'y' Number '朝向' DirectionEx_List '动画时间' Int? '允许穿透' Bool BEND
|
||||
|
||||
|
||||
/* changeFloor_m
|
||||
tooltip : 楼梯, 传送门, 如果目标楼层有多个楼梯, 写upFloor或downFloor可能会导致到达的楼梯不确定, 这时候请使用loc方式来指定具体的点位置
|
||||
helpUrl : https://ckcz123.github.io/mota-js/#/element?id=%e8%b7%af%e9%9a%9c%ef%bc%8c%e6%a5%bc%e6%a2%af%ef%bc%8c%e4%bc%a0%e9%80%81%e9%97%a8
|
||||
default : ["MT1",null,0,0,null,500,null]
|
||||
default : [null,"MT1",null,0,0,null,500,null]
|
||||
var toFloorId = IdString_0;
|
||||
if (Floor_List_0!='floorId') toFloorId = Floor_List_0;
|
||||
var loc = ', "loc": ['+Number_0+', '+Number_1+']';
|
||||
if (Stair_List_0!=='loc')loc = ', "stair": "'+Stair_List_0+'"';
|
||||
DirectionEx_List_0 = DirectionEx_List_0 && (', "direction": "'+DirectionEx_List_0+'"');
|
||||
Int_0 = Int_0 ?(', "time": '+Int_0):'';
|
||||
Bool_0 = Bool_0 ?'':(', "portalWithoutTrigger": false');
|
||||
var code = '{"floorId": "'+IdString_0+'"'+loc+DirectionEx_List_0+Int_0+Bool_0+' }\n';
|
||||
var code = '{"floorId": "'+toFloorId+'"'+loc+DirectionEx_List_0+Int_0+Bool_0+' }\n';
|
||||
return code;
|
||||
*/;
|
||||
|
||||
@ -531,7 +533,7 @@ return code;
|
||||
*/;
|
||||
|
||||
changeFloor_s
|
||||
: '楼层切换' IdString 'x' PosString ',' 'y' PosString '朝向' DirectionEx_List '动画时间' Int? Newline
|
||||
: '楼层切换' IdString? 'x' PosString ',' 'y' PosString '朝向' DirectionEx_List '动画时间' Int? Newline
|
||||
|
||||
|
||||
/* changeFloor_s
|
||||
@ -1135,6 +1137,10 @@ PosString
|
||||
: 'sdeirughvuiyasbde'+ //为了被识别为复杂词法规则
|
||||
;
|
||||
|
||||
Floor_List
|
||||
: '楼层ID'|'前一楼'|'后一楼'
|
||||
/*Floor_List ['floorId',':before',':next']*/;
|
||||
|
||||
Stair_List
|
||||
: '坐标'|'上楼'|'下楼'
|
||||
/*Stair_List ['loc','upFloor','downFloor']*/;
|
||||
@ -1278,8 +1284,12 @@ ActionParser.prototype.parse = function (obj,type) {
|
||||
case 'changeFloor':
|
||||
if(!obj)obj={};
|
||||
if(!this.isset(obj.loc))obj.loc=[0,0];
|
||||
if (obj.floorId==':before'||obj.floorId==':next') {
|
||||
obj.floorType=obj.floorId;
|
||||
delete obj.floorId;
|
||||
}
|
||||
return MotaActionBlocks['changeFloor_m'].xmlText([
|
||||
obj.floorId,obj.stair||'loc',obj.loc[0],obj.loc[1],obj.direction,obj.time||0,!this.isset(obj.portalWithoutTrigger)
|
||||
obj.floorType||'floorId',obj.floorId,obj.stair||'loc',obj.loc[0],obj.loc[1],obj.direction,obj.time||0,!this.isset(obj.portalWithoutTrigger)
|
||||
]);
|
||||
|
||||
case 'point':
|
||||
|
||||
@ -164,6 +164,8 @@ N连击怪物的special是6,且我们可以为它定义n代表实际连击数
|
||||
|
||||
floorId指定的是目标楼层的唯一标识符(ID)。
|
||||
|
||||
也可以写`"floorId": ":before"`和`"floorId": ":next"`表示上一楼和下一楼。
|
||||
|
||||
后面可以写stair到upFloor或downFloor,表示将前往目标楼层的上楼梯/下楼梯位置。你也可以写loc然后指定目标点的坐标。
|
||||
|
||||
请注意的是,如果目标楼层有多个楼梯,写stair可能会导致到达的楼梯不确定,这时候请使用loc方式来指定具体的点位置。
|
||||
|
||||
@ -20,6 +20,8 @@ enemys.prototype.getEnemys = function (enemyId) {
|
||||
////// 判断是否含有某特殊属性 //////
|
||||
enemys.prototype.hasSpecial = function (special, test) {
|
||||
|
||||
if (!core.isset(special)) return false;
|
||||
|
||||
if (special instanceof Array) {
|
||||
return special.indexOf(test)>=0;
|
||||
}
|
||||
@ -28,6 +30,14 @@ enemys.prototype.hasSpecial = function (special, test) {
|
||||
return special!=0 && (special%100==test||this.hasSpecial(parseInt(special/100), test));
|
||||
}
|
||||
|
||||
if (typeof special == 'string') {
|
||||
return this.hasSpecial(core.material.enemys[special], test);
|
||||
}
|
||||
|
||||
if (core.isset(special.special)) {
|
||||
return this.hasSpecial(special.special, test);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -300,7 +310,7 @@ enemys.prototype.getDamageInfo = function(monster, hero_hp, hero_atk, hero_def,
|
||||
enemys.prototype.calDamage = function (monster, hero_hp, hero_atk, hero_def, hero_mdef) {
|
||||
|
||||
if (typeof monster == 'string') {
|
||||
monster = core.material.enemys[monsterId];
|
||||
monster = core.material.enemys[monster];
|
||||
}
|
||||
|
||||
var info = this.getDamageInfo(monster, hero_hp, hero_atk, hero_def, hero_mdef);
|
||||
|
||||
@ -986,6 +986,19 @@ events.prototype.trigger = function (x, y) {
|
||||
////// 楼层切换 //////
|
||||
events.prototype.changeFloor = function (floorId, stair, heroLoc, time, callback, fromLoad) {
|
||||
|
||||
if (!core.isset(floorId)) floorId = core.status.floorId;
|
||||
|
||||
if (floorId == ':before') {
|
||||
var index=core.floorIds.indexOf(core.status.floorId);
|
||||
if (index>0) floorId = core.floorIds[index-1];
|
||||
else floorId=core.status.floorId;
|
||||
}
|
||||
else if (floorId == ':next') {
|
||||
var index=core.floorIds.indexOf(core.status.floorId);
|
||||
if (index<core.floorIds.length-1) floorId = core.floorIds[index+1];
|
||||
else floorId=core.status.floorId;
|
||||
}
|
||||
|
||||
var displayAnimate=!(time==0) && !core.status.replay.replaying;
|
||||
|
||||
time = time || 800;
|
||||
|
||||
@ -1,50 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>BuildMachineOSBuild</key>
|
||||
<string>17E202</string>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>en</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>MTBuilder</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>com.xiongdianpku.MTBuilder</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>MTBuilder</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.0</string>
|
||||
<key>CFBundleSupportedPlatforms</key>
|
||||
<array>
|
||||
<string>MacOSX</string>
|
||||
</array>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1</string>
|
||||
<key>DTCompiler</key>
|
||||
<string>com.apple.compilers.llvm.clang.1_0</string>
|
||||
<key>DTPlatformBuild</key>
|
||||
<string>9E501</string>
|
||||
<key>DTPlatformVersion</key>
|
||||
<string>GM</string>
|
||||
<key>DTSDKBuild</key>
|
||||
<string>17E189</string>
|
||||
<key>DTSDKName</key>
|
||||
<string>macosx10.13</string>
|
||||
<key>DTXcode</key>
|
||||
<string>0931</string>
|
||||
<key>DTXcodeBuild</key>
|
||||
<string>9E501</string>
|
||||
<key>LSMinimumSystemVersion</key>
|
||||
<string>10.10</string>
|
||||
<key>NSHumanReadableCopyright</key>
|
||||
<string>Copyright © 2018年 熊典. All rights reserved.</string>
|
||||
<key>NSMainStoryboardFile</key>
|
||||
<string>Main</string>
|
||||
<key>NSPrincipalClass</key>
|
||||
<string>NSApplication</string>
|
||||
</dict>
|
||||
</plist>
|
||||
Binary file not shown.
@ -1 +0,0 @@
|
||||
APPL????
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1,252 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>files</key>
|
||||
<dict>
|
||||
<key>Resources/Assets.car</key>
|
||||
<data>
|
||||
Y8vFWeV9aMFK2k/Fmvn1VKDb4G4=
|
||||
</data>
|
||||
<key>Resources/Base.lproj/Main.storyboardc/3Jh-0i-2oC-view-FlG-D0-fB4.nib</key>
|
||||
<data>
|
||||
EN/jmkBY5XqitaaV2kWybEgMtTE=
|
||||
</data>
|
||||
<key>Resources/Base.lproj/Main.storyboardc/8cO-Uq-prt-view-GPE-0I-haQ.nib</key>
|
||||
<data>
|
||||
vZO5vWZuRi0vaSFqKPCW1qksfDE=
|
||||
</data>
|
||||
<key>Resources/Base.lproj/Main.storyboardc/Info.plist</key>
|
||||
<data>
|
||||
71E/nyD1JC6i4rw6+kjjVgE/fZA=
|
||||
</data>
|
||||
<key>Resources/Base.lproj/Main.storyboardc/MainMenu.nib</key>
|
||||
<data>
|
||||
lC9mNWqzXYAYynusmnCrDuM3hvI=
|
||||
</data>
|
||||
<key>Resources/Base.lproj/Main.storyboardc/NSViewController-3Jh-0i-2oC.nib</key>
|
||||
<data>
|
||||
jBRfznhMbiKUnUxlCD1QLUegGsc=
|
||||
</data>
|
||||
<key>Resources/Base.lproj/Main.storyboardc/NSWindowController-B8D-0N-5wS.nib</key>
|
||||
<data>
|
||||
S9xl+rRRrH6aWKPTrX11XmKhYtA=
|
||||
</data>
|
||||
<key>Resources/Base.lproj/Main.storyboardc/NSWindowController-QqD-oc-2tR.nib</key>
|
||||
<data>
|
||||
a5hup3BYBUycbe+iJd/nx+VQ/rA=
|
||||
</data>
|
||||
<key>Resources/Base.lproj/Main.storyboardc/XfG-lQ-9wD-view-m2S-Jp-Qdl.nib</key>
|
||||
<data>
|
||||
7osH7f7CY2aFRWbCLAy1odTex/M=
|
||||
</data>
|
||||
</dict>
|
||||
<key>files2</key>
|
||||
<dict>
|
||||
<key>Resources/Assets.car</key>
|
||||
<dict>
|
||||
<key>hash</key>
|
||||
<data>
|
||||
Y8vFWeV9aMFK2k/Fmvn1VKDb4G4=
|
||||
</data>
|
||||
<key>hash2</key>
|
||||
<data>
|
||||
R6hkb6fWvTpPEJXUWnyv4rhwHuVVIqsihlgRCdNNoz4=
|
||||
</data>
|
||||
</dict>
|
||||
<key>Resources/Base.lproj/Main.storyboardc/3Jh-0i-2oC-view-FlG-D0-fB4.nib</key>
|
||||
<dict>
|
||||
<key>hash</key>
|
||||
<data>
|
||||
EN/jmkBY5XqitaaV2kWybEgMtTE=
|
||||
</data>
|
||||
<key>hash2</key>
|
||||
<data>
|
||||
8KgZX7l1DB4wlq8OlL6h9gk2PUditNbKqqR7qnoHCoc=
|
||||
</data>
|
||||
</dict>
|
||||
<key>Resources/Base.lproj/Main.storyboardc/8cO-Uq-prt-view-GPE-0I-haQ.nib</key>
|
||||
<dict>
|
||||
<key>hash</key>
|
||||
<data>
|
||||
vZO5vWZuRi0vaSFqKPCW1qksfDE=
|
||||
</data>
|
||||
<key>hash2</key>
|
||||
<data>
|
||||
aK2kvZcgmqywotLHVkXGbEh1LkOnXWQEX6RKwgp3f7s=
|
||||
</data>
|
||||
</dict>
|
||||
<key>Resources/Base.lproj/Main.storyboardc/Info.plist</key>
|
||||
<dict>
|
||||
<key>hash</key>
|
||||
<data>
|
||||
71E/nyD1JC6i4rw6+kjjVgE/fZA=
|
||||
</data>
|
||||
<key>hash2</key>
|
||||
<data>
|
||||
d1R62G7VThDKTjMMGGoUR6TC9bR0hjwLNqAggKJwsS0=
|
||||
</data>
|
||||
</dict>
|
||||
<key>Resources/Base.lproj/Main.storyboardc/MainMenu.nib</key>
|
||||
<dict>
|
||||
<key>hash</key>
|
||||
<data>
|
||||
lC9mNWqzXYAYynusmnCrDuM3hvI=
|
||||
</data>
|
||||
<key>hash2</key>
|
||||
<data>
|
||||
ZBTMovff3XB5dFKWqxpFhQsHN7/F4Zfp45tuh4OSDB0=
|
||||
</data>
|
||||
</dict>
|
||||
<key>Resources/Base.lproj/Main.storyboardc/NSViewController-3Jh-0i-2oC.nib</key>
|
||||
<dict>
|
||||
<key>hash</key>
|
||||
<data>
|
||||
jBRfznhMbiKUnUxlCD1QLUegGsc=
|
||||
</data>
|
||||
<key>hash2</key>
|
||||
<data>
|
||||
niqIc11tpbnFJIeMHBNiCcjwUkpkJvJJoAKTguRNp/s=
|
||||
</data>
|
||||
</dict>
|
||||
<key>Resources/Base.lproj/Main.storyboardc/NSWindowController-B8D-0N-5wS.nib</key>
|
||||
<dict>
|
||||
<key>hash</key>
|
||||
<data>
|
||||
S9xl+rRRrH6aWKPTrX11XmKhYtA=
|
||||
</data>
|
||||
<key>hash2</key>
|
||||
<data>
|
||||
unrn3sgw+6nM2WDwyTjK8g/wIOAogLhFXRotyPK6xIw=
|
||||
</data>
|
||||
</dict>
|
||||
<key>Resources/Base.lproj/Main.storyboardc/NSWindowController-QqD-oc-2tR.nib</key>
|
||||
<dict>
|
||||
<key>hash</key>
|
||||
<data>
|
||||
a5hup3BYBUycbe+iJd/nx+VQ/rA=
|
||||
</data>
|
||||
<key>hash2</key>
|
||||
<data>
|
||||
P/jSqX6j8bzFQoaQzsZl49a9zRuMnaO4/Gq+iECoDu4=
|
||||
</data>
|
||||
</dict>
|
||||
<key>Resources/Base.lproj/Main.storyboardc/XfG-lQ-9wD-view-m2S-Jp-Qdl.nib</key>
|
||||
<dict>
|
||||
<key>hash</key>
|
||||
<data>
|
||||
7osH7f7CY2aFRWbCLAy1odTex/M=
|
||||
</data>
|
||||
<key>hash2</key>
|
||||
<data>
|
||||
aNkXpHLXtb/zTBJ/LsXFPlcRqVfZh4L5qRk4kUZx2NE=
|
||||
</data>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>rules</key>
|
||||
<dict>
|
||||
<key>^Resources/</key>
|
||||
<true/>
|
||||
<key>^Resources/.*\.lproj/</key>
|
||||
<dict>
|
||||
<key>optional</key>
|
||||
<true/>
|
||||
<key>weight</key>
|
||||
<real>1000</real>
|
||||
</dict>
|
||||
<key>^Resources/.*\.lproj/locversion.plist$</key>
|
||||
<dict>
|
||||
<key>omit</key>
|
||||
<true/>
|
||||
<key>weight</key>
|
||||
<real>1100</real>
|
||||
</dict>
|
||||
<key>^Resources/Base\.lproj/</key>
|
||||
<dict>
|
||||
<key>weight</key>
|
||||
<real>1010</real>
|
||||
</dict>
|
||||
<key>^version.plist$</key>
|
||||
<true/>
|
||||
</dict>
|
||||
<key>rules2</key>
|
||||
<dict>
|
||||
<key>.*\.dSYM($|/)</key>
|
||||
<dict>
|
||||
<key>weight</key>
|
||||
<real>11</real>
|
||||
</dict>
|
||||
<key>^(.*/)?\.DS_Store$</key>
|
||||
<dict>
|
||||
<key>omit</key>
|
||||
<true/>
|
||||
<key>weight</key>
|
||||
<real>2000</real>
|
||||
</dict>
|
||||
<key>^(Frameworks|SharedFrameworks|PlugIns|Plug-ins|XPCServices|Helpers|MacOS|Library/(Automator|Spotlight|LoginItems))/</key>
|
||||
<dict>
|
||||
<key>nested</key>
|
||||
<true/>
|
||||
<key>weight</key>
|
||||
<real>10</real>
|
||||
</dict>
|
||||
<key>^.*</key>
|
||||
<true/>
|
||||
<key>^Info\.plist$</key>
|
||||
<dict>
|
||||
<key>omit</key>
|
||||
<true/>
|
||||
<key>weight</key>
|
||||
<real>20</real>
|
||||
</dict>
|
||||
<key>^PkgInfo$</key>
|
||||
<dict>
|
||||
<key>omit</key>
|
||||
<true/>
|
||||
<key>weight</key>
|
||||
<real>20</real>
|
||||
</dict>
|
||||
<key>^Resources/</key>
|
||||
<dict>
|
||||
<key>weight</key>
|
||||
<real>20</real>
|
||||
</dict>
|
||||
<key>^Resources/.*\.lproj/</key>
|
||||
<dict>
|
||||
<key>optional</key>
|
||||
<true/>
|
||||
<key>weight</key>
|
||||
<real>1000</real>
|
||||
</dict>
|
||||
<key>^Resources/.*\.lproj/locversion.plist$</key>
|
||||
<dict>
|
||||
<key>omit</key>
|
||||
<true/>
|
||||
<key>weight</key>
|
||||
<real>1100</real>
|
||||
</dict>
|
||||
<key>^Resources/Base\.lproj/</key>
|
||||
<dict>
|
||||
<key>weight</key>
|
||||
<real>1010</real>
|
||||
</dict>
|
||||
<key>^[^/]+$</key>
|
||||
<dict>
|
||||
<key>nested</key>
|
||||
<true/>
|
||||
<key>weight</key>
|
||||
<real>10</real>
|
||||
</dict>
|
||||
<key>^embedded\.provisionprofile$</key>
|
||||
<dict>
|
||||
<key>weight</key>
|
||||
<real>20</real>
|
||||
</dict>
|
||||
<key>^version\.plist$</key>
|
||||
<dict>
|
||||
<key>weight</key>
|
||||
<real>20</real>
|
||||
</dict>
|
||||
</dict>
|
||||
</dict>
|
||||
</plist>
|
||||
Loading…
Reference in New Issue
Block a user