This commit is contained in:
2024-09-05 14:49:52 +08:00
parent d2a6ab3dce
commit 6191703970
4 changed files with 272 additions and 203 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -93,6 +93,16 @@ export class SingletonModuleComp extends ecs.Comp {
max: 5, max: 5,
speed:1, speed:1,
}, },
item_box:{
hp:0,
atk:0,
atk_cd:0,
power:0,
name:"",
skillcd:0,
skillsd:0,
info:"",
}
}; };
vmAdd() { vmAdd() {

View File

@@ -1,13 +1,7 @@
/* /*
* @Author: dgflash CardList type: 1:精灵 2:技能 3:装备
* @Date: 2021-11-23 15:28:39
* @LastEditors: dgflash
* @LastEditTime: 2022-01-26 16:42:00
*/ */
export const CardType = {
1: "前排",
2: "后排",
}
export const CardList={ export const CardList={
1:[ 1:[
{uuid:1101,type:1},{uuid:1102,type:1},{uuid:1201,type:1},{uuid:1202,type:1},{uuid:1301,type:1},{uuid:1302,type:1}, {uuid:1101,type:1},{uuid:1102,type:1},{uuid:1201,type:1},{uuid:1202,type:1},{uuid:1301,type:1},{uuid:1302,type:1},
@@ -38,6 +32,10 @@ export const CardList={
// 5:[5001,5002,5003,5004], // 5:[5001,5002,5003,5004],
} }
/*
CardSet type: 1:近战 2:远程 3:法术 暂定
*/
export const CardSet = { export const CardSet = {
1101:{uuid: 1101,path: "1101",type: 1,level: 1,name: "守护犬",atk: 4,hp: 8,atk_cd: 2,power: 50,speed: 80,skill: "base",max_skill: "base",int1: null,int2: null,dps: 2,word: "守护", info: "自身护盾",atktype: "攻击型", mon: "狗"}, 1101:{uuid: 1101,path: "1101",type: 1,level: 1,name: "守护犬",atk: 4,hp: 8,atk_cd: 2,power: 50,speed: 80,skill: "base",max_skill: "base",int1: null,int2: null,dps: 2,word: "守护", info: "自身护盾",atktype: "攻击型", mon: "狗"},
1102:{uuid: 1102,path: "1102",type: 1,level: 1,name: "狂暴犬",atk: 4,hp: 8,atk_cd: 2,power: 50,speed: 80,skill: "base",max_skill: "base",int1: null,int2: null,dps: 2,word: "狂暴", info: "全体攻击",atktype: "攻击型", mon: "狗"}, 1102:{uuid: 1102,path: "1102",type: 1,level: 1,name: "狂暴犬",atk: 4,hp: 8,atk_cd: 2,power: 50,speed: 80,skill: "base",max_skill: "base",int1: null,int2: null,dps: 2,word: "狂暴", info: "全体攻击",atktype: "攻击型", mon: "狗"},

View File

@@ -61,8 +61,19 @@ export class HeroCardViewComp extends CCComp {
onTouchMove(event: EventTouch) { onTouchMove(event: EventTouch) {
let delta = event.getDelta(); let delta = event.getDelta();
this.node.setPosition(this.node.position.x+delta.x,this.node.position.y+delta.y); this.node.setPosition(this.node.position.x+delta.x,this.node.position.y+delta.y);
this.show_info()
}
show_info(){
let parent = this.node.parent.parent let parent = this.node.parent.parent
parent.getChildByName("item_box").active=true if(this.card_type == 2){
smc.vm_data.item_box.info = SkillSet[this.card_uid].info
smc.vm_data.item_box.name = SkillSet[this.card_uid].name
smc.vm_data.item_box.skillcd = SkillSet[this.card_uid].cd
smc.vm_data.item_box.skillsd = SkillSet[this.card_uid].sd
smc.vm_data.item_box.atk = SkillSet[this.card_uid].atk
smc.vm_data.item_box.hp = SkillSet[this.card_uid].hp
parent.getChildByName("item_box").active=true
}
} }
onTouchEnd(){ onTouchEnd(){
if(this.node.position.y-this.pos_y > 150){ if(this.node.position.y-this.pos_y > 150){