setHero -> setHeroIcon
This commit is contained in:
parent
7009b57c10
commit
e6ccdf75ed
@ -165,7 +165,7 @@ action
|
|||||||
| revisit_s
|
| revisit_s
|
||||||
| exit_s
|
| exit_s
|
||||||
| setBlock_s
|
| setBlock_s
|
||||||
| setHero_s
|
| setHeroIcon_s
|
||||||
| update_s
|
| update_s
|
||||||
| sleep_s
|
| sleep_s
|
||||||
| battle_s
|
| battle_s
|
||||||
@ -416,17 +416,17 @@ var code = '{"type": "setBlock", "number":'+Int_0+floorstr+IdString_0+'},\n';
|
|||||||
return code;
|
return code;
|
||||||
*/
|
*/
|
||||||
|
|
||||||
setHero_s
|
setHeroIcon_s
|
||||||
: '更改角色行走图' EvalString? Newline
|
: '更改角色行走图' EvalString? Newline
|
||||||
;
|
;
|
||||||
|
|
||||||
/* setHero_s
|
/* setHeroIcon_s
|
||||||
tooltip : setHero:更改角色行走图
|
tooltip : setHeroIcon:更改角色行走图
|
||||||
helpUrl : https://ckcz123.github.io/mota-js/#/event?id=setHero-%e6%9b%b4%e6%94%b9%e8%a7%92%e8%89%b2%e8%a1%8c%e8%b5%b0%e5%9b%be
|
helpUrl : https://ckcz123.github.io/mota-js/#/event?id=setHeroIcon-%e6%9b%b4%e6%94%b9%e8%a7%92%e8%89%b2%e8%a1%8c%e8%b5%b0%e5%9b%be
|
||||||
colour : this.dataColor
|
colour : this.dataColor
|
||||||
default : ["hero.png"]
|
default : ["hero.png"]
|
||||||
EvalString_0 = EvalString_0 && (', "name": "'+EvalString_0+'"');
|
EvalString_0 = EvalString_0 && (', "name": "'+EvalString_0+'"');
|
||||||
var code = '{"type": "setHero"'+EvalString_0+'},\n';
|
var code = '{"type": "setHeroIcon"'+EvalString_0+'},\n';
|
||||||
return code;
|
return code;
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -1277,9 +1277,9 @@ ActionParser.prototype.parseAction = function() {
|
|||||||
this.next = MotaActionBlocks['setBlock_s'].xmlText([
|
this.next = MotaActionBlocks['setBlock_s'].xmlText([
|
||||||
data.number||0,data.loc[0]||'',data.loc[1]||'',data.floorId||'',this.next]);
|
data.number||0,data.loc[0]||'',data.loc[1]||'',data.floorId||'',this.next]);
|
||||||
break;
|
break;
|
||||||
case "setHero": // 改变勇士
|
case "setHeroIcon": // 改变勇士
|
||||||
this.next = MotaActionBlocks['setHero_s'].xmlText([
|
this.next = MotaActionBlocks['setHeroIcon_s'].xmlText([
|
||||||
data.name,this.next]);
|
data.name||"",this.next]);
|
||||||
break;
|
break;
|
||||||
case "move": // 移动事件
|
case "move": // 移动事件
|
||||||
data.loc=data.loc||[];
|
data.loc=data.loc||[];
|
||||||
|
|||||||
@ -90,7 +90,7 @@ editor_blockly = function () {
|
|||||||
MotaActionBlocks['battle_s'].xmlText(),
|
MotaActionBlocks['battle_s'].xmlText(),
|
||||||
MotaActionBlocks['openDoor_s'].xmlText(),
|
MotaActionBlocks['openDoor_s'].xmlText(),
|
||||||
MotaActionBlocks['setBlock_s'].xmlText(),
|
MotaActionBlocks['setBlock_s'].xmlText(),
|
||||||
MotaActionBlocks['setHero_s'].xmlText(),
|
MotaActionBlocks['setHeroIcon_s'].xmlText(),
|
||||||
'<label text="事件控制"></label>',
|
'<label text="事件控制"></label>',
|
||||||
MotaActionBlocks['if_s'].xmlText(),
|
MotaActionBlocks['if_s'].xmlText(),
|
||||||
MotaActionBlocks['revisit_s'].xmlText(),
|
MotaActionBlocks['revisit_s'].xmlText(),
|
||||||
|
|||||||
@ -482,14 +482,14 @@ number为**要更改到的数字**,有关“数字”的定义详见参见[素
|
|||||||
|
|
||||||
图块更改往往与[同一个点的多事件处理](#同一个点的多事件处理)相关。
|
图块更改往往与[同一个点的多事件处理](#同一个点的多事件处理)相关。
|
||||||
|
|
||||||
### setHero:更改角色行走图
|
### setHeroIcon:更改角色行走图
|
||||||
|
|
||||||
使用`{"type": "setHero"}`可以更改角色行走图。
|
使用`{"type": "setHeroIcon"}`可以更改角色行走图。
|
||||||
|
|
||||||
``` js
|
``` js
|
||||||
"x,y": [ // 实际执行的事件列表
|
"x,y": [ // 实际执行的事件列表
|
||||||
{"type": "setHero", "name": "hero2.png"}, // 将勇士行走图改成hero2.png;必须在全塔属性的images中被定义过。
|
{"type": "setHeroIcon", "name": "hero2.png"}, // 将勇士行走图改成hero2.png;必须在全塔属性的images中被定义过。
|
||||||
{"type": "setHero"}, // 如果不加name则恢复最初默认状态
|
{"type": "setHeroIcon"}, // 如果不加name则恢复最初默认状态
|
||||||
{"type": "setValue", "name": "status:name", "value": "'可绒'"}, // 修改勇士名;请注意value必须加单引号。
|
{"type": "setValue", "name": "status:name", "value": "'可绒'"}, // 修改勇士名;请注意value必须加单引号。
|
||||||
]
|
]
|
||||||
```
|
```
|
||||||
|
|||||||
@ -569,14 +569,14 @@ events.prototype.doAction = function() {
|
|||||||
this.doAction();
|
this.doAction();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case "setHero":
|
case "setHeroIcon":
|
||||||
{
|
{
|
||||||
var name = "hero.png";
|
var name = "hero.png";
|
||||||
if (core.isset(core.material.images.images[data.name]) && core.material.images.images[data.name].width==128)
|
if (core.isset(core.material.images.images[data.name]) && core.material.images.images[data.name].width==128)
|
||||||
name = data.name;
|
name = data.name;
|
||||||
core.setFlag("heroIcon", data.name);
|
core.setFlag("heroIcon", name);
|
||||||
core.material.images.hero.src = core.material.images.images[data.name].src;
|
core.material.images.hero.src = core.material.images.images[name].src;
|
||||||
core.material.icons.hero.height = core.material.images.images[data.name].height/4;
|
core.material.icons.hero.height = core.material.images.images[name].height/4;
|
||||||
core.drawHero();
|
core.drawHero();
|
||||||
this.doAction();
|
this.doAction();
|
||||||
break;
|
break;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user