|
@@ -55,11 +55,6 @@ export default class FCagePet1 extends BaseEvent {
|
|
|
type: cc.Node
|
|
|
})
|
|
|
mPet: cc.Node = null;//伙伴
|
|
|
- @property({
|
|
|
- displayName: '解救出来的对话',
|
|
|
- type: [cc.String]
|
|
|
- })
|
|
|
- dialog2: Array<string> = [];
|
|
|
|
|
|
@property({
|
|
|
displayName: '宠物预制体',
|
|
@@ -74,13 +69,25 @@ export default class FCagePet1 extends BaseEvent {
|
|
|
mFenceTrigger: Array<cc.Node> = [];
|
|
|
|
|
|
@property({
|
|
|
- displayName: 'npc',
|
|
|
+ displayName: '落单的精灵',
|
|
|
type: cc.Node
|
|
|
})
|
|
|
mNPC2: cc.Node = null;
|
|
|
|
|
|
+ @property({
|
|
|
+ displayName: '路过的矮人',
|
|
|
+ type: cc.Node
|
|
|
+ })
|
|
|
+ mNPC3: cc.Node = null;
|
|
|
+
|
|
|
private isOver = false;
|
|
|
|
|
|
+ onLoad(){
|
|
|
+ super.onLoad()
|
|
|
+
|
|
|
+ this.mNPC3.active = false
|
|
|
+ }
|
|
|
+
|
|
|
onBegin(tag: number) {
|
|
|
if (this.isOver) {
|
|
|
return;
|
|
@@ -129,12 +136,10 @@ export default class FCagePet1 extends BaseEvent {
|
|
|
if (count > 0) {
|
|
|
head.removeTmpGood(2001, 1);
|
|
|
this.isOver = true;
|
|
|
-
|
|
|
+ this.pause()
|
|
|
this.spine.setCompleteListener(() => {
|
|
|
this.spine.setCompleteListener(null);
|
|
|
- this.showDialog(this.node,this.dialog2,()=>{
|
|
|
- this.movePet()
|
|
|
- })
|
|
|
+ this.movePet()
|
|
|
});
|
|
|
if (this.spine.findAnimation("open3")) {
|
|
|
this.spine.setAnimation(0, 'open3', false);
|
|
@@ -157,17 +162,175 @@ export default class FCagePet1 extends BaseEvent {
|
|
|
spine.setAnimation(0, SpriteActionType.run, true);
|
|
|
anim.on('finished', this.onFinished, this);
|
|
|
anim.play('cage_pet_move');
|
|
|
+
|
|
|
+ cc.tween(this.mNPC2).sequence(
|
|
|
+ cc.moveTo(1,cc.v2(3202,3990)),
|
|
|
+ cc.callFunc(()=>{
|
|
|
+ this.npcDialog()
|
|
|
+ })
|
|
|
+ ).start()
|
|
|
}
|
|
|
private onFinished(num, string) {
|
|
|
let anim = this.mPet.getComponent(cc.Animation);
|
|
|
let spine = this.mPet.getComponent(sp.Skeleton);
|
|
|
anim.off('finished', this.onFinished, this);
|
|
|
spine.setAnimation(0, SpriteActionType.stand, true);
|
|
|
- this.mPet.destroy()
|
|
|
- this.openDoor()
|
|
|
}
|
|
|
-
|
|
|
- public openDoor(){
|
|
|
+ /**
|
|
|
+ * 落单的精灵:多么快活的小家伙!
|
|
|
+ 落单的精灵:你做了一件好事。做好事的人心地善良,人也会变得漂亮。
|
|
|
+ 落单的精灵:我的妈妈告诉我,人类就是这么变漂亮的。
|
|
|
+ 角色:……
|
|
|
+ 落单的精灵:快看,这只小鹿非常喜欢你。它没有红鼻子,但也非常可爱。
|
|
|
+ 落单的精灵:但是它一直待在你身边,这让我有点沮丧。
|
|
|
+ */
|
|
|
+ private npcDialog(){
|
|
|
+ let text = [
|
|
|
+ '多么快活的小家伙!',
|
|
|
+ '你做了一件好事。做好事的人心地善良,人也会变得漂亮。',
|
|
|
+ '我的妈妈告诉我,人类就是这么变漂亮的。',
|
|
|
+ '……',
|
|
|
+ '快看,这只小鹿非常喜欢你。它没有红鼻子,但也非常可爱。',
|
|
|
+ '但是它一直待在你身边,这让我有点沮丧。'
|
|
|
+ ]
|
|
|
+ this.showDialog(this.mNPC2,text,()=>{
|
|
|
+ this.meDialog()
|
|
|
+ })
|
|
|
+ }
|
|
|
+ private meDialog(){
|
|
|
+ let text = [
|
|
|
+ '你也帮助了它。',
|
|
|
+ ]
|
|
|
+ this.showDialog(this.ff.mainSprite.node,text,()=>{
|
|
|
+ this.npcDialog1()
|
|
|
+ })
|
|
|
+ }
|
|
|
+ private npcDialog1(){
|
|
|
+ let text = [
|
|
|
+ '等等……它似乎不是普通的小鹿。',
|
|
|
+ ]
|
|
|
+ this.showDialog(this.mNPC2,text,()=>{
|
|
|
+ this.npcDialog2()
|
|
|
+ })
|
|
|
+ }
|
|
|
+ private npcDialog2(){
|
|
|
+ let text = [
|
|
|
+ '这是一只战斗宠物,难怪会出现在这里……',
|
|
|
+ '落单的精灵:恭喜你,它是你的伙伴了!',
|
|
|
+ ]
|
|
|
+ this.showDialog(this.mNPC2,text,()=>{
|
|
|
+ this.getPet()
|
|
|
+ this.npcDialog3()
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+ private getPet(){
|
|
|
+
|
|
|
+ let node = cc.instantiate(this.mPetPrefab);
|
|
|
+ node.group = GroupType.A;
|
|
|
+ node.x = this.node.x + this.mPet.x
|
|
|
+ node.y = this.node.y + this.mPet.y
|
|
|
+ let sp = node.addComponent(PSprite);
|
|
|
+ let attrData = this.ff.main.sManage.getMonsterData(1003);
|
|
|
+ sp.setAttrData(attrData)
|
|
|
+ this.ff.addRole(sp);
|
|
|
+ sp.hp = sp.attrData.hp
|
|
|
+ sp.addComponent(AIPet);
|
|
|
+ this.mPet.removeFromParent();
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ private npcDialog3(){
|
|
|
+ let text = [
|
|
|
+ '小法师,我要走了。我得去寻找我的弟弟。',
|
|
|
+ ]
|
|
|
+ this.showDialog(this.mNPC2,text,()=>{
|
|
|
+ this.npc3()
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+ private npc3(){
|
|
|
+ this.mNPC3.active = true
|
|
|
+ cc.tween(this.mNPC3).sequence(
|
|
|
+ cc.moveTo(1,cc.v2(3340,3943)),
|
|
|
+ cc.callFunc(()=>{
|
|
|
+ this.npc3Dialog()
|
|
|
+ })
|
|
|
+ ).start()
|
|
|
+ }
|
|
|
+
|
|
|
+ private npc3Dialog(){
|
|
|
+ let text = [
|
|
|
+ '强大的法师,请……啊!!!',
|
|
|
+ ]
|
|
|
+ this.showDialog(this.mNPC3,text,()=>{
|
|
|
+ this.npc2T()
|
|
|
+ })
|
|
|
+ }
|
|
|
+ /**
|
|
|
+ * NPC2踢飞NPC3
|
|
|
+ */
|
|
|
+ private npc2T(){
|
|
|
+ cc.tween(this.mNPC2).sequence(
|
|
|
+ cc.moveTo(0.5,cc.v2(3340,3943)),
|
|
|
+ cc.callFunc(()=>{
|
|
|
+ this.npc3Fly()
|
|
|
+ })
|
|
|
+ ).start()
|
|
|
+ }
|
|
|
+ private npc3Fly(){
|
|
|
+ cc.tween(this.mNPC3).sequence(
|
|
|
+ cc.moveBy(0.7,cc.v2(800,800)),
|
|
|
+ cc.callFunc(()=>{
|
|
|
+ this.npcDialog4()
|
|
|
+ }),
|
|
|
+ cc.destroySelf()
|
|
|
+ ).start()
|
|
|
+ cc.tween(this.mNPC3).repeatForever(
|
|
|
+ cc.rotateBy(0.1,60)
|
|
|
+ ).start()
|
|
|
+ }
|
|
|
+
|
|
|
+ private npcDialog4(){
|
|
|
+ let text = [
|
|
|
+ '不用为别的事物分心。小法师,你似乎刚刚成为法师?',
|
|
|
+ ]
|
|
|
+ this.showDialog(this.mNPC2,text,()=>{
|
|
|
+ this.meDialog2()
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+ private meDialog2(){
|
|
|
+ let text = [
|
|
|
+ '是的。',
|
|
|
+ '告知失落之地的事情。',
|
|
|
+ ]
|
|
|
+ this.showDialog(this.ff.mainSprite.node,text,()=>{
|
|
|
+ this.npcDialog5()
|
|
|
+ })
|
|
|
+ }
|
|
|
+ private npcDialog5(){
|
|
|
+ let text = [
|
|
|
+ '等等!!',
|
|
|
+ '发生了这么可怕的事情,怎么现在才告诉我。',
|
|
|
+ '我改变了主意,小法师,在森林中等我。'
|
|
|
+ ]
|
|
|
+ this.showDialog(this.mNPC2,text,()=>{
|
|
|
+ this.npc2Move()
|
|
|
+ })
|
|
|
+ }
|
|
|
+ private npc2Move(){
|
|
|
+ cc.tween(this.mNPC2).sequence(
|
|
|
+ cc.moveBy(1,cc.v2(0,-500)),
|
|
|
+ cc.callFunc(()=>{
|
|
|
+ this.openDoor()
|
|
|
+ }),
|
|
|
+ cc.destroySelf()
|
|
|
+ ).start()
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ private openDoor(){
|
|
|
this.pause()
|
|
|
this.moveCamera(this.mFenceTrigger[0].getPosition(), 1, () => {
|
|
|
cc.tween(this.node).sequence(
|