dd
This commit is contained in:
@@ -74,7 +74,7 @@ export class Boss extends ecs.Entity {
|
||||
var bs = node.getComponent(BossViewComp)!;
|
||||
// console.log("hero_init",buff)
|
||||
bs.speed =bs.ospeed = smc.monsters[uuid].speed;
|
||||
bs.hero_name= smc.monsters[uuid].name;
|
||||
bs.boos_name= smc.monsters[uuid].name;
|
||||
bs.hp= bs.hp_max = smc.monsters[uuid].hp;
|
||||
bs.level = smc.monsters[uuid].level;
|
||||
bs.atk = smc.monsters[uuid].atk;
|
||||
@@ -84,6 +84,7 @@ export class Boss extends ecs.Entity {
|
||||
bs.power_max = smc.monsters[uuid].power_max;
|
||||
bs.skill = smc.monsters[uuid].skill_uuid;
|
||||
bs.type = smc.monsters[uuid].type;
|
||||
bs.box_group = BoxSet.MONSTER;
|
||||
bs.scale = -1;
|
||||
bs.Tpos = v3(0,0,0);
|
||||
this.add(bs);
|
||||
|
||||
@@ -20,8 +20,8 @@ export class BossSpine extends Component {
|
||||
private default:string = "idle";
|
||||
private atk_name: string = "atk";
|
||||
private move_name: string = "move";
|
||||
private max_name: string = "max";
|
||||
private idel_name: string = "idle";
|
||||
private max_name: string = "atk";
|
||||
private idel_name: string = "move";
|
||||
start() {
|
||||
this.spine.setAnimation(0, this.default, true);
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@ export class BossViewComp extends CCComp {
|
||||
atkMaterial: Material;
|
||||
sprite: Sprite;
|
||||
/** 角色动画 */
|
||||
|
||||
|
||||
|
||||
as:BossSpine =null!;
|
||||
is_role:boolean = false;
|
||||
@@ -43,8 +43,8 @@ export class BossViewComp extends CCComp {
|
||||
atk_enemy:any=null!;
|
||||
neraster_enemy:any=null!;
|
||||
/** 角色动画 */
|
||||
hero_uuid:number = 1001;
|
||||
hero_name : string = "role";
|
||||
boos_uuid:number = 1001;
|
||||
boos_name : string = "role";
|
||||
level:number =1;
|
||||
scale: number = 1; /** 角色阵营 1:hero -1 :monster */
|
||||
state: number = 1; /** 状态 1:move ,2: act 3: stop */
|
||||
@@ -168,6 +168,9 @@ export class BossViewComp extends CCComp {
|
||||
|
||||
|
||||
update(dt: number){
|
||||
if(smc.vm_data.game_over||smc.vm_data.game_pause){
|
||||
return
|
||||
}
|
||||
if (this.timer.update(dt)) {
|
||||
|
||||
}
|
||||
@@ -229,7 +232,7 @@ export class BossViewComp extends CCComp {
|
||||
let {pos,t_pos}=this.get_enemy_pos()
|
||||
pos.y=pos.y + y
|
||||
pos.x=pos.x + x
|
||||
skill.load(pos,BoxSet.HERO,this.node,skill_uuid,atk,t_pos);
|
||||
skill.load(pos,this.box_group,this.node,skill_uuid,atk,t_pos);
|
||||
// this.tooltip(3,smc.skills[skill_uuid].name,this.skill_uuid);
|
||||
}
|
||||
//使用max_skill
|
||||
@@ -282,7 +285,6 @@ export class BossViewComp extends CCComp {
|
||||
this.dead();
|
||||
this.is_dead = true;
|
||||
this.ent.remove(MoveToComp)
|
||||
smc.vm_data.game_over = true;
|
||||
setTimeout(() => {
|
||||
this.ent.destroy();
|
||||
}, 15);
|
||||
|
||||
@@ -55,15 +55,19 @@ export class Role extends ecs.Entity {
|
||||
rv.hero_uuid=uuid;
|
||||
rv.speed =rv.ospeed = role.speed;
|
||||
rv.hero_name= "role";
|
||||
rv.hp= rv.hp_max = role.hp;
|
||||
rv.hp= rv.hp_max = role.hp*(1+smc.vm_data.talent[1].bonus*smc.vm_data.talent[1].lv);
|
||||
rv.level = role.lv;
|
||||
rv.atk = role.atk;
|
||||
rv.atk_cd = role.atk_cd;
|
||||
rv.atk = role.atk*(1+smc.vm_data.talent[2].bonus*smc.vm_data.talent[2].lv);
|
||||
rv.atk_cd = role.atk_cd*(1-smc.vm_data.talent[3].bonus*smc.vm_data.talent[3].lv);
|
||||
rv.st_boncus=1+smc.vm_data.talent[15].bonus*smc.vm_data.talent[15].lv;
|
||||
rv.s_boncus=1+smc.vm_data.talent[16].bonus*smc.vm_data.talent[16].lv;
|
||||
rv.power = role.power;
|
||||
rv.skills = role.skills;
|
||||
rv.skill = role.skill;
|
||||
rv.atk_range=role.atk_range;
|
||||
rv.power= role.power;
|
||||
for (let i = 0; i < rv.skills.length; i++) {
|
||||
rv.skills[i].cd*(1-smc.vm_data.talent[4].bonus*smc.vm_data.talent[4].lv)
|
||||
}
|
||||
rv.skill = role.skill;
|
||||
rv.box_group = BoxSet.HERO;
|
||||
this.add(rv);
|
||||
}
|
||||
move(target: Vec3) {
|
||||
|
||||
@@ -59,6 +59,8 @@ export class RoleViewComp extends CCComp {
|
||||
power_speed: number = 1; //能量回复速度每0.1秒回复量
|
||||
skill:8001;
|
||||
skills:any=[]
|
||||
st_boncus: number = 1; //技能持续时间加成
|
||||
s_boncus: number = 1; //技能效果加成
|
||||
buff_atks:any = [];
|
||||
buff_atk:number = 0;
|
||||
|
||||
@@ -130,6 +132,8 @@ export class RoleViewComp extends CCComp {
|
||||
|
||||
selfCollider.node.setSiblingIndex(otherCollider.node.getSiblingIndex()+1)
|
||||
// console.log("onPreSolve b:"+selfCollider.node.uuid+":"+selfCollider.node.getSiblingIndex()+"/"+otherCollider.node.uuid+":"+otherCollider.node.getSiblingIndex());
|
||||
}else{
|
||||
selfCollider.node.setSiblingIndex(otherCollider.node.getSiblingIndex()-1)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -158,6 +162,9 @@ export class RoleViewComp extends CCComp {
|
||||
|
||||
|
||||
update(dt: number){
|
||||
if(smc.vm_data.game_over||smc.vm_data.game_pause){
|
||||
return
|
||||
}
|
||||
if (this.timer.update(dt)) {
|
||||
|
||||
}
|
||||
@@ -236,7 +243,7 @@ export class RoleViewComp extends CCComp {
|
||||
pos.y=300
|
||||
t_pos.y=t_pos.y-300
|
||||
}
|
||||
skill.load(pos,BoxSet.HERO,this.node,skill_uuid,atk,t_pos);
|
||||
skill.load(pos,this.box_group,this.node,skill_uuid,atk,t_pos);
|
||||
// this.tooltip(3,smc.skills[skill_uuid].name,this.skill_uuid);
|
||||
}
|
||||
//使用max_skill
|
||||
@@ -274,8 +281,8 @@ export class RoleViewComp extends CCComp {
|
||||
this.atk_time = 0;
|
||||
this.as.atk();
|
||||
this.scheduleOnce(()=>{
|
||||
this.shoot(this.skill,-30);
|
||||
},0.2)
|
||||
this.shoot(this.skill,-30,45);
|
||||
},0.3)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -306,6 +313,13 @@ export class RoleViewComp extends CCComp {
|
||||
}
|
||||
heathed(){
|
||||
this.node.getChildByName("heathed").active=true
|
||||
// console.log("role heathed");
|
||||
// var path = "game/skills/heathed";
|
||||
// var prefab: Prefab = oops.res.get(path, Prefab)!;
|
||||
// var node = instantiate(prefab);
|
||||
// let pos = v3(0,0)
|
||||
// node.setPosition(pos)
|
||||
// node.parent = this.node;
|
||||
}
|
||||
add_hp(hp: number=0){
|
||||
this.heathed();
|
||||
|
||||
@@ -73,16 +73,22 @@ export class SingletonModuleComp extends ecs.Comp {
|
||||
vm_data: any = {
|
||||
name : "纸片精灵大乱斗",
|
||||
game_over:false,
|
||||
/**宝石数量 */
|
||||
game_pause:false,
|
||||
gems: 4,
|
||||
unlock:5,
|
||||
game:{
|
||||
|
||||
mission:{
|
||||
once:6, //每波刷新怪物数量
|
||||
total:120, //总怪物数
|
||||
reward:12, //怪物死亡奖励数量
|
||||
reward_num:0, //怪物死亡数
|
||||
t_damge:0,
|
||||
t_dps:0,
|
||||
h_dps:0,
|
||||
m_dps:0,
|
||||
g_level:1,
|
||||
g_time:0,
|
||||
m_less:0,
|
||||
},
|
||||
role:{
|
||||
hp:3000,
|
||||
@@ -101,13 +107,31 @@ export class SingletonModuleComp extends ecs.Comp {
|
||||
power:300,
|
||||
skill:1004,
|
||||
skills:[
|
||||
{uuid:1002,cd:2,alive:true },
|
||||
{uuid:4012,cd:3,alive:true},
|
||||
{uuid:4011,cd:4,alive:true},
|
||||
{uuid:0,cd:2,alive:false },
|
||||
{uuid:0,cd:3,alive:false},
|
||||
{uuid:0,cd:4,alive:false},
|
||||
{uuid:0,cd:0,alive:false},
|
||||
{uuid:0,cd:0,alive:false},
|
||||
]
|
||||
|
||||
],
|
||||
|
||||
},
|
||||
talent:{
|
||||
1:{bonus:3,lv:0,lv_max:5,info:"英雄血量加成",name:""},
|
||||
2:{bonus:3,lv:0,lv_max:5,info:"英雄攻击加成",name:""},
|
||||
3:{bonus:3,lv:0,lv_max:5,info:"英雄攻击加速",name:""},
|
||||
4:{bonus:3,lv:0,lv_max:5,info:"英雄技能cd加速",name:""},
|
||||
5:{bonus:3,lv:0,lv_max:5,info:"英雄技能效果加强",name:""},
|
||||
6:{bonus:3,lv:0,lv_max:5,info:"",name:""},
|
||||
7:{bonus:3,lv:0,lv_max:5,info:"",name:""},
|
||||
8:{bonus:3,lv:0,lv_max:5,info:"",name:""},
|
||||
9:{bonus:3,lv:0,lv_max:5,info:"",name:""},
|
||||
10:{bonus:3,lv:0,lv_max:5,info:"",name:""},
|
||||
11:{bonus:3,lv:0,lv_max:5,info:"血量加成",name:""},
|
||||
12:{bonus:3,lv:0,lv_max:5,info:"攻击加成",name:""},
|
||||
13:{bonus:3,lv:0,lv_max:5,info:"攻击加速",name:""},
|
||||
14:{bonus:3,lv:0,lv_max:5,info:"技能cd加速",name:""},
|
||||
15:{bonus:3,lv:0,lv_max:5,info:"技能效果加强",name:""},
|
||||
16:{bonus:3,lv:0,lv_max:5,info:"技能持续时间",name:""},
|
||||
},
|
||||
/** 当前等级 */
|
||||
cards:{
|
||||
|
||||
@@ -28,7 +28,7 @@ export enum BoxSet {
|
||||
MONSTER_START = 360,
|
||||
END_POINT = 360,
|
||||
//游戏地平线
|
||||
GAME_LINE = 150,
|
||||
GAME_LINE = 180,
|
||||
CSKILL_X = 320,
|
||||
CSKILL_Y = 400,
|
||||
//攻击距离
|
||||
|
||||
@@ -15,13 +15,16 @@ export enum UIID {
|
||||
/** 加载与延时提示界面 */
|
||||
Netinstable,
|
||||
/** 角色控制 */
|
||||
Role_Controller
|
||||
Role_Controller,
|
||||
/** 奖励界面 */
|
||||
Rewards,
|
||||
}
|
||||
|
||||
/** 打开界面方式的配置数据 */
|
||||
export var UIConfigData: { [key: number]: UIConfig } = {
|
||||
[UIID.Loading]: { layer: LayerType.UI, prefab: "loading/prefab/loading", bundle: "resources" },
|
||||
[UIID.Netinstable]: { layer: LayerType.PopUp, prefab: "common/prefab/netinstable" },
|
||||
[UIID.Window]: { layer: LayerType.Dialog, prefab: "common/prefab/window" },
|
||||
[UIID.Window]: { layer: LayerType.Dialog, prefab: "common/prefab/window" },
|
||||
[UIID.Rewards]: { layer: LayerType.Dialog, prefab: "gui/rewards" },
|
||||
[UIID.Role_Controller]: { layer: LayerType.UI, prefab: "gui/role_controller" },
|
||||
}
|
||||
64
assets/script/game/common/config/RewardSet.ts
Normal file
64
assets/script/game/common/config/RewardSet.ts
Normal file
@@ -0,0 +1,64 @@
|
||||
|
||||
export const RewardSet={
|
||||
1:[
|
||||
{uuid: 5001,path: "5001",type: 1,lv: 1,name: "攻击强化1",info:"佣兵攻击提升10%",atk:10,hp:0,atk_cd:0,},
|
||||
{uuid: 5002,path: "5002",type: 1,lv: 1,name: "攻速强化1",info:"佣兵攻击速度提升10%",atk:0,hp:0,atk_cd:10,},
|
||||
{uuid: 5003,path: "5003",type: 1,lv: 1,name: "生命强化1",info:"佣兵生命值10%",atk:0,hp:20,atk_cd:0,},
|
||||
],
|
||||
2:[
|
||||
{uuid: 5001,path: "5001",type: 1,lv: 2,name: "攻击强化2",info:"佣兵攻击速度提升15%",atk:15,hp:0,atk_cd:0,},
|
||||
{uuid: 5002,path: "5002",type: 1,lv: 2,name: "攻速强化2",info:"佣兵攻击速度提升15%",atk:0,hp:0,atk_cd:15,},
|
||||
{uuid: 5003,path: "5003",type: 1,lv: 2,name: "生命强化2",info:"佣兵生命值30%",atk:0,hp:30,atk_cd:0,},
|
||||
],
|
||||
3:[
|
||||
{uuid: 5001,path: "5001",type: 1,lv: 2,name: "攻击强化2",info:"佣兵攻击速度提升15%",atk:15,hp:0,atk_cd:0,},
|
||||
{uuid: 5002,path: "5002",type: 1,lv: 2,name: "攻速强化2",info:"佣兵攻击速度提升15%",atk:0,hp:0,atk_cd:15,},
|
||||
{uuid: 5003,path: "5003",type: 1,lv: 2,name: "生命强化2",info:"佣兵生命值30%",atk:0,hp:30,atk_cd:0,},
|
||||
],
|
||||
4:[
|
||||
{uuid: 5001,path: "5001",type: 1,lv: 2,name: "攻击强化2",info:"佣兵攻击速度提升15%",atk:15,hp:0,atk_cd:0,},
|
||||
{uuid: 5002,path: "5002",type: 1,lv: 2,name: "攻速强化2",info:"佣兵攻击速度提升15%",atk:0,hp:0,atk_cd:15,},
|
||||
{uuid: 5003,path: "5003",type: 1,lv: 2,name: "生命强化2",info:"佣兵生命值30%",atk:0,hp:30,atk_cd:0,},
|
||||
],
|
||||
5:[
|
||||
{uuid: 5001,path: "5001",type: 1,lv: 2,name: "攻击强化2",info:"佣兵攻击速度提升15%",atk:15,hp:0,atk_cd:0,},
|
||||
{uuid: 5002,path: "5002",type: 1,lv: 2,name: "攻速强化2",info:"佣兵攻击速度提升15%",atk:0,hp:0,atk_cd:15,},
|
||||
{uuid: 5003,path: "5003",type: 1,lv: 2,name: "生命强化2",info:"佣兵生命值30%",atk:0,hp:30,atk_cd:0,},
|
||||
],
|
||||
6:[
|
||||
{uuid: 5001,path: "5001",type: 1,lv: 2,name: "攻击强化2",info:"佣兵攻击速度提升15%",atk:15,hp:0,atk_cd:0,},
|
||||
{uuid: 5002,path: "5002",type: 1,lv: 2,name: "攻速强化2",info:"佣兵攻击速度提升15%",atk:0,hp:0,atk_cd:15,},
|
||||
{uuid: 5003,path: "5003",type: 1,lv: 2,name: "生命强化2",info:"佣兵生命值30%",atk:0,hp:30,atk_cd:0,},
|
||||
],
|
||||
7:[
|
||||
{uuid: 5001,path: "5001",type: 1,lv: 2,name: "攻击强化2",info:"佣兵攻击速度提升15%",atk:15,hp:0,atk_cd:0,},
|
||||
{uuid: 5002,path: "5002",type: 1,lv: 2,name: "攻速强化2",info:"佣兵攻击速度提升15%",atk:0,hp:0,atk_cd:15,},
|
||||
{uuid: 5003,path: "5003",type: 1,lv: 2,name: "生命强化2",info:"佣兵生命值30%",atk:0,hp:30,atk_cd:0,},
|
||||
],
|
||||
8:[
|
||||
{uuid: 5001,path: "5001",type: 1,lv: 2,name: "攻击强化2",info:"佣兵攻击速度提升15%",atk:15,hp:0,atk_cd:0,},
|
||||
{uuid: 5002,path: "5002",type: 1,lv: 2,name: "攻速强化2",info:"佣兵攻击速度提升15%",atk:0,hp:0,atk_cd:15,},
|
||||
{uuid: 5003,path: "5003",type: 1,lv: 2,name: "生命强化2",info:"佣兵生命值30%",atk:0,hp:30,atk_cd:0,},
|
||||
],
|
||||
9:[
|
||||
{uuid: 5001,path: "5001",type: 1,lv: 2,name: "攻击强化2",info:"佣兵攻击速度提升15%",atk:15,hp:0,atk_cd:0,},
|
||||
{uuid: 5002,path: "5002",type: 1,lv: 2,name: "攻速强化2",info:"佣兵攻击速度提升15%",atk:0,hp:0,atk_cd:15,},
|
||||
{uuid: 5003,path: "5003",type: 1,lv: 2,name: "生命强化2",info:"佣兵生命值30%",atk:0,hp:30,atk_cd:0,},
|
||||
],
|
||||
10:[
|
||||
{uuid: 5001,path: "5001",type: 1,lv: 2,name: "攻击强化2",info:"佣兵攻击速度提升15%",atk:15,hp:0,atk_cd:0,},
|
||||
{uuid: 5002,path: "5002",type: 1,lv: 2,name: "攻速强化2",info:"佣兵攻击速度提升15%",atk:0,hp:0,atk_cd:15,},
|
||||
{uuid: 5003,path: "5003",type: 1,lv: 2,name: "生命强化2",info:"佣兵生命值30%",atk:0,hp:30,atk_cd:0,},
|
||||
],
|
||||
11:[
|
||||
{uuid: 5001,path: "5001",type: 1,lv: 2,name: "攻击强化2",info:"佣兵攻击速度提升15%",atk:15,hp:0,atk_cd:0,},
|
||||
{uuid: 5002,path: "5002",type: 1,lv: 2,name: "攻速强化2",info:"佣兵攻击速度提升15%",atk:0,hp:0,atk_cd:15,},
|
||||
{uuid: 5003,path: "5003",type: 1,lv: 2,name: "生命强化2",info:"佣兵生命值30%",atk:0,hp:30,atk_cd:0,},
|
||||
],
|
||||
12:[
|
||||
{uuid: 5001,path: "5001",type: 1,lv: 2,name: "攻击强化2",info:"佣兵攻击速度提升15%",atk:15,hp:0,atk_cd:0,},
|
||||
{uuid: 5002,path: "5002",type: 1,lv: 2,name: "攻速强化2",info:"佣兵攻击速度提升15%",atk:0,hp:0,atk_cd:15,},
|
||||
{uuid: 5003,path: "5003",type: 1,lv: 2,name: "生命强化2",info:"佣兵生命值30%",atk:0,hp:30,atk_cd:0,},
|
||||
]
|
||||
}
|
||||
|
||||
9
assets/script/game/common/config/RewardSet.ts.meta
Normal file
9
assets/script/game/common/config/RewardSet.ts.meta
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "4.0.23",
|
||||
"importer": "typescript",
|
||||
"imported": true,
|
||||
"uuid": "0388f0b8-c77d-4020-8b9a-dabf774f6502",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
||||
@@ -36,11 +36,11 @@ export const SkillSet={
|
||||
dis:1,count:1,in:0,run:0,atk:10,hp:0,shield:0,sd:10,cd:1,bsd:0,bcd:0,sk_uuid:1001,sk_count:0,speed:600, },
|
||||
|
||||
2001:{uuid: 2001,path: "2001",type: 91,tg:1,angle:false,level: 1,name: "治愈术",sp_name:"heath",info:"释放一个寒冰箭攻击敌人",
|
||||
dis:1,count:1,in:0,run:1,atk:0,hp:30,shield:0,sd:10,cd:1,bsd:0,bcd:0,sk_uuid:1001,sk_count:0,speed:450, },
|
||||
dis:1,count:1,in:0,run:1,atk:0,hp:3,shield:0,sd:10,cd:1,bsd:0,bcd:0,sk_uuid:1001,sk_count:0,speed:450, },
|
||||
2002:{uuid: 2002,path: "2002",type: 91,tg:0,angle:false,level: 1,name: "魔法盾",sp_name:"shield",info:"释放一个寒冰箭攻击敌人",
|
||||
dis:1,count:1,in:0.2,run:2,atk:0,hp:0,shield:50,sd:0,cd:0,bsd:8,bcd:0,sk_uuid:1001,sk_count:0,speed:450, },
|
||||
dis:1,count:1,in:0.2,run:2,atk:0,hp:0,shield:5,sd:0,cd:0,bsd:8,bcd:0,sk_uuid:1001,sk_count:0,speed:450, },
|
||||
2003:{uuid: 2003,path: "2003",type: 91,tg:0,angle:false,level: 1,name: "狂暴",sp_name:"atkup",info:"释放一个寒冰箭攻击敌人",
|
||||
dis:1,count:1,in:0.2,run:2,atk:10,hp:0,shield:0,sd:0,cd:0,bsd:8,bcd:0,sk_uuid:1001,sk_count:0,speed:450, },
|
||||
dis:1,count:1,in:0.2,run:2,atk:1,hp:0,shield:0,sd:0,cd:0,bsd:8,bcd:0,sk_uuid:1001,sk_count:0,speed:450, },
|
||||
|
||||
|
||||
3001:{uuid: 3001,path: "3001",type: 1,tg:3,angle:true,level: 1,name: "三连击",sp_name:"patk",info:"释放一个魔法球攻击敌人",
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
|
||||
export const HeroSet = {
|
||||
9001: {
|
||||
uuid: 9001, path: "k3", type: 1, level: 1,cost:2, name: "骑士", atk: 4, hp: 60, atk_dis: 40, atk_cd: 1, power: 0, power_max: 20, speed: 30,
|
||||
uuid: 9001, path: "k3", type: 1, level: 1,cost:2, name: "骑士", atk: 4, hp: 60, atk_dis: 40, atk_cd: 1, power: 0, power_max: 20, speed: 40,
|
||||
max_skill: "精准打击", skill_uuid: 9001, max_skill_uuid: 2002, word: "守护", info: "自身护盾", atktype: 1,
|
||||
},
|
||||
|
||||
9002: {
|
||||
uuid: 9002, path: "k1", type: 1, level: 1,cost:2, name: "战士", atk: 8, hp: 30, atk_dis: 40, atk_cd: 1, power: 0, power_max: 20, speed: 30,
|
||||
uuid: 9002, path: "k1", type: 1, level: 1,cost:2, name: "战士", atk: 8, hp: 30, atk_dis: 40, atk_cd: 1, power: 0, power_max: 20, speed: 40,
|
||||
max_skill: "精准打击", skill_uuid: 9001, max_skill_uuid: 2003, word: "守护", info: "自身护盾", atktype: 1,
|
||||
},
|
||||
9011: {
|
||||
@@ -19,7 +19,7 @@ export const HeroSet = {
|
||||
},
|
||||
|
||||
9031: {
|
||||
uuid: 9005, path: "m2", type: 3, level: 1,cost:2, name: "牧师", atk: 3, hp: 20, atk_dis: 260, atk_cd: 2, power: 0, power_max: 20, speed: 30,
|
||||
uuid: 9005, path: "m2", type: 3, level: 1,cost:2, name: "牧师", atk: 3, hp: 20, atk_dis: 260, atk_cd: 2, power: 15, power_max: 20, speed: 30,
|
||||
max_skill: "治愈术", skill_uuid: 9002, max_skill_uuid: 2001, word: "守护", info: "自身护盾", atktype: 2
|
||||
},
|
||||
|
||||
|
||||
@@ -61,13 +61,15 @@ export class Hero extends ecs.Entity {
|
||||
let hero_set= smc.heros[uuid]
|
||||
hv.speed =hv.ospeed = hero_set.speed;
|
||||
hv.hero_name= hero_set.name;
|
||||
hv.hp= hv.hp_max = hero_set.hp;
|
||||
hv.hp= hv.hp_max = hero_set.hp*(1+smc.vm_data.talent[11].bonus*smc.vm_data.talent[11].lv);
|
||||
hv.level = hero_set.level;
|
||||
hv.atk = hero_set.atk;
|
||||
hv.atk_cd = hero_set.atk_cd;
|
||||
hv.atk = hero_set.atk*(1+smc.vm_data.talent[12].bonus*smc.vm_data.talent[12].lv);
|
||||
hv.atk_cd = hero_set.atk_cd*(1-smc.vm_data.talent[13].bonus*smc.vm_data.talent[13].lv);
|
||||
hv.st_boncus=1+smc.vm_data.talent[15].bonus*smc.vm_data.talent[15].lv;
|
||||
hv.s_boncus=1+smc.vm_data.talent[16].bonus*smc.vm_data.talent[16].lv;
|
||||
hv.atk_dis = hero_set.atk_dis;
|
||||
hv.power = hero_set.power;
|
||||
hv.power_max= hero_set.power_max;
|
||||
hv.power_max= hero_set.power_max*(1-smc.vm_data.talent[14].bonus*smc.vm_data.talent[14].lv);;
|
||||
hv.type = hero_set.type;
|
||||
hv.skill_uuid = hero_set.skill_uuid;
|
||||
hv.max_skill_uuid = hero_set.max_skill_uuid;
|
||||
|
||||
@@ -67,7 +67,8 @@ export class HeroViewComp extends CCComp {
|
||||
atk_cd: number = 1.3; /**攻击速度 攻击间隔 */
|
||||
atk_dis: number = 80;
|
||||
atk_time: number = 0; /** 冷却时间 */
|
||||
|
||||
st_boncus: number = 1; //技能持续时间加成
|
||||
s_boncus: number = 1; //技能效果加成
|
||||
speed: number = 100; /** 角色移动速度 */
|
||||
ospeed: number = 100; /** 角色初始速度 */
|
||||
Tpos: Vec3 = v3(0,-60,0);
|
||||
@@ -173,6 +174,9 @@ export class HeroViewComp extends CCComp {
|
||||
|
||||
|
||||
update(dt: number){
|
||||
if(smc.vm_data.game_over||smc.vm_data.game_pause){
|
||||
return
|
||||
}
|
||||
if (this.timer.update(dt)) {
|
||||
this.power_change(this.power_speed)
|
||||
}
|
||||
@@ -194,7 +198,9 @@ export class HeroViewComp extends CCComp {
|
||||
}
|
||||
check_enemy_alive(){
|
||||
let dir = 320
|
||||
this.enemy = v3(720,this.node.position.y)
|
||||
for (let i = 0; i < GameSet.ATK_LINES; i++) {
|
||||
|
||||
let mon:any = smc.enemy_pos[i];
|
||||
let x=Math.abs(mon.x-this.node.position.x)
|
||||
let y = Math.abs(mon.y-this.node.position.y)
|
||||
@@ -211,6 +217,7 @@ export class HeroViewComp extends CCComp {
|
||||
}else{
|
||||
this.is_atking=false
|
||||
}
|
||||
|
||||
}
|
||||
move(dt: number){
|
||||
if(this.stop_cd > 0){
|
||||
@@ -295,15 +302,14 @@ export class HeroViewComp extends CCComp {
|
||||
let {pos,t_pos}=this.get_hero_pos(hero)
|
||||
skill.load(pos,BoxSet.HERO,this.node,this.max_skill_uuid,atk,t_pos);
|
||||
if(smc.skills[s_uuid].hp > 0){ //buff加血
|
||||
hero.HeroView.add_hp(smc.skills[s_uuid].hp)
|
||||
hero.HeroView.add_hp(smc.skills[s_uuid].hp*this.atk*this.s_boncus)
|
||||
}
|
||||
if(smc.skills[s_uuid].atk > 0){ //buff加攻击
|
||||
hero.HeroView.add_atk(smc.skills[s_uuid].atk,smc.skills[s_uuid].bsd)
|
||||
hero.HeroView.add_atk(smc.skills[s_uuid].atk*this.atk*this.s_boncus,smc.skills[s_uuid].bsd*this.st_boncus)
|
||||
}
|
||||
if(smc.skills[s_uuid].shield > 0){ //buff护盾
|
||||
hero.HeroView.add_shield(smc.skills[s_uuid].shield,smc.skills[s_uuid].bsd)
|
||||
hero.HeroView.add_shield(smc.skills[s_uuid].shield*this.atk*this.s_boncus,smc.skills[s_uuid].bsd*this.st_boncus)
|
||||
}
|
||||
|
||||
}
|
||||
push_least_buff(skill:number){
|
||||
let heros:any = ecs.query(ecs.allOf(HeroModelComp));
|
||||
@@ -393,6 +399,12 @@ export class HeroViewComp extends CCComp {
|
||||
|
||||
heathed(){
|
||||
this.node.getChildByName("heathed").active=true
|
||||
// var path = "game/skills/heathed";
|
||||
// var prefab: Prefab = oops.res.get(path, Prefab)!;
|
||||
// var node = instantiate(prefab);
|
||||
// let pos = v3(0,0)
|
||||
// node.setPosition(pos)
|
||||
// node.parent = this.node;
|
||||
}
|
||||
add_hp(hp: number=0){
|
||||
this.heathed();
|
||||
|
||||
@@ -6,6 +6,7 @@ import { oops } from "../../../../extensions/oops-plugin-framework/assets/core/O
|
||||
import { RandomManager } from "../../../../extensions/oops-plugin-framework/assets/core/common/random/RandomManager";
|
||||
import { SkillSet } from "../common/config/SkillSet";
|
||||
import { HeroModelComp } from "../hero/HeroModelComp";
|
||||
import { RewardSet } from "../common/config/RewardSet";
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
/** 视图层对象 */
|
||||
@@ -27,7 +28,17 @@ export class CardControllerComp extends CCComp {
|
||||
5:{uuid:1105,type:1,lv:0,cost:0,alive:false},
|
||||
6:{uuid:1106,type:1,lv:0,cost:0,alive:false},
|
||||
}
|
||||
rewards:any = {
|
||||
1:{uuid: 5001,path: "5001",type: 1,lv: 1,name: "",info:"",atk:0,hp:0,atk_cd:0,},
|
||||
2:{uuid: 5001,path: "5001",type: 1,lv: 1,name: "",info:"",atk:0,hp:0,atk_cd:0,},
|
||||
3:{uuid: 5001,path: "5001",type: 1,lv: 1,name: "",info:"",atk:0,hp:0,atk_cd:0,},
|
||||
}
|
||||
rewards_set:any = []
|
||||
reward_lv = 0;
|
||||
|
||||
protected onLoad(): void {
|
||||
oops.message.on("do_reward", this.do_reward, this);
|
||||
|
||||
let card1 = this.node.getChildByName("cards").getChildByName("card1");
|
||||
let card2 = this.node.getChildByName("cards").getChildByName("card2");
|
||||
let card3 = this.node.getChildByName("cards").getChildByName("card3");
|
||||
@@ -337,14 +348,83 @@ export class CardControllerComp extends CCComp {
|
||||
// }
|
||||
this.remove_card(index)
|
||||
}
|
||||
|
||||
do_reward(){
|
||||
smc.vm_data.game_pause = true;
|
||||
this.reward_lv+=1
|
||||
this.rewards_set=RewardSet[this.reward_lv]
|
||||
let i=RandomManager.instance.getRandomInt(0,this.rewards_set.length-1, 1)
|
||||
console.log("rewards:",i)
|
||||
this.rewards[1]=this.rewards_set[i]
|
||||
this.rewards_set.splice(i,1)
|
||||
i=RandomManager.instance.getRandomInt(0,this.rewards_set.length-1, 1)
|
||||
console.log("rewards:",i)
|
||||
this.rewards[2]=this.rewards_set[i]
|
||||
this.rewards_set.splice(i,1)
|
||||
i=RandomManager.instance.getRandomInt(0,this.rewards_set.length-1, 1)
|
||||
console.log("rewards:",i)
|
||||
this.rewards[3]=this.rewards_set[i]
|
||||
this.rewards_set=[]
|
||||
console.log("rewards:",this.rewards)
|
||||
let re1=this.node.getChildByName('rewards').getChildByName('reward1')
|
||||
let re2=this.node.getChildByName('rewards').getChildByName('reward2')
|
||||
let re3=this.node.getChildByName('rewards').getChildByName('reward3')
|
||||
|
||||
re1.getChildByName('name').getComponent(Label).string=this.rewards[1].name
|
||||
re2.getChildByName('name').getComponent(Label).string=this.rewards[2].name
|
||||
re3.getChildByName('name').getComponent(Label).string=this.rewards[3].name
|
||||
|
||||
re1.getChildByName('info').getComponent(Label).string=this.rewards[1].info
|
||||
re2.getChildByName('info').getComponent(Label).string=this.rewards[2].info
|
||||
re3.getChildByName('info').getComponent(Label).string=this.rewards[3].info
|
||||
|
||||
resources.load("gui/rewards", SpriteAtlas, (err: any, atlas) => {
|
||||
let pathName: string = this.rewards[1].path;
|
||||
let node=re1.getChildByName('icon')
|
||||
node.getComponent(Sprite).spriteFrame = atlas.getSpriteFrame(pathName);
|
||||
pathName=this.rewards[2].path;
|
||||
node=re2.getChildByName('icon')
|
||||
node.getComponent(Sprite).spriteFrame = atlas.getSpriteFrame(pathName);
|
||||
pathName=this.rewards[3].path;
|
||||
node=re3.getChildByName('icon')
|
||||
node.getComponent(Sprite).spriteFrame = atlas.getSpriteFrame(pathName);
|
||||
})
|
||||
|
||||
|
||||
this.node.getChildByName('rewards').active = true;
|
||||
}
|
||||
colse_reward(){
|
||||
this.node.getChildByName('rewards').active = false;
|
||||
smc.vm_data.game_pause = false;
|
||||
}
|
||||
do_reward_1(value:number=1){
|
||||
this.colse_reward()
|
||||
}
|
||||
do_reward_2(value:number=2){
|
||||
this.colse_reward()
|
||||
}
|
||||
do_reward_3(value:number=3){
|
||||
this.colse_reward()
|
||||
}
|
||||
protected update(dt: number): void {
|
||||
if(smc.vm_data.game_over||smc.vm_data.game_pause){
|
||||
return
|
||||
}
|
||||
this.shuaxin(dt)
|
||||
// this.gold_add(dt)
|
||||
|
||||
if(this.in_touch){
|
||||
this.touch_time+=dt
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
gold_add(dt: number) {
|
||||
smc.vm_data.gold.time += dt;
|
||||
if (smc.vm_data.gold.time >= smc.vm_data.gold.cd) {
|
||||
smc.vm_data.gold.min += 1;
|
||||
smc.vm_data.gold.time = 0;
|
||||
}
|
||||
}
|
||||
/** 视图对象通过 ecs.Entity.remove(ControllerComp) 删除组件是触发组件处理自定义释放逻辑 */
|
||||
reset() {
|
||||
this.node.destroy();
|
||||
|
||||
@@ -14,6 +14,7 @@ import { HeroModelComp } from "../hero/HeroModelComp";
|
||||
import { Mon } from "../mon/Mon";
|
||||
import { MonModelComp } from "../mon/MonModelComp";
|
||||
import { Boss} from "../Boss/Boss";
|
||||
import { UIID } from "../common/config/GameUIConfig";
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
/** 视图层对象 */
|
||||
@@ -28,21 +29,23 @@ export class MapMonsterComp extends CCComp {
|
||||
max_monster_level:number = 4; //最高怪物次等级
|
||||
min_monster_num:number = 1; ///最小每次刷新怪物数量
|
||||
max_monster_num:number = 1; //最大每次刷新怪物数量
|
||||
refresh_timer: Timer = new Timer(10); // 刷新怪物定时器
|
||||
refresh_timer: Timer = new Timer(5); // 刷新怪物定时器
|
||||
refresh_cd: Timer = new Timer(0.5);
|
||||
mission_up_timer: Timer = new Timer(30); //波次增加
|
||||
cur_mission:number = 1; //当前关卡方案
|
||||
mission_list:any = []
|
||||
boss_list:any = []
|
||||
setp_timer: Timer = new Timer(0.3);
|
||||
setp_timer: Timer = new Timer(0.2);
|
||||
target_timer: Timer = new Timer(0.1);
|
||||
setp_num:number = 6;
|
||||
setp_num:number = smc.vm_data.mission.once;
|
||||
total:number = smc.vm_data.mission.total;
|
||||
reward:number = 0;
|
||||
reward_num:number = 0;
|
||||
game_over:boolean = false;
|
||||
start_ys:any[] = [70,0,-70];
|
||||
hero_start_ys:any[] = [35,-35];
|
||||
mon_index:number = 0
|
||||
hero_index:number = 0
|
||||
|
||||
|
||||
@property(Node)
|
||||
start_p: Node = null;
|
||||
@@ -64,7 +67,8 @@ export class MapMonsterComp extends CCComp {
|
||||
this.mission_list = MonsetList[this.cur_mission]
|
||||
this.boss_list = BossList[this.cur_mission]
|
||||
// console.log("当前关卡方案",this.cur_mission,this.mission_list)
|
||||
this.refresh_timer= new Timer(smc.vm_data.gold.cd*5);
|
||||
this.refresh_timer= new Timer(smc.vm_data.shuaxin.max);
|
||||
smc.vm_data.mission.m_less=this.total
|
||||
this.monster_refresh()
|
||||
this.load_role()
|
||||
this.load_boss()
|
||||
@@ -72,14 +76,16 @@ export class MapMonsterComp extends CCComp {
|
||||
}
|
||||
|
||||
protected update(dt: number): void {
|
||||
if(smc.vm_data.game_over){
|
||||
if(smc.vm_data.game_over||smc.vm_data.game_pause){
|
||||
return
|
||||
}
|
||||
if(this.setp_timer.update(dt)){
|
||||
if(this.total<=0) return
|
||||
this.monster_refresh()
|
||||
}
|
||||
this.is_reward()
|
||||
if (this.refresh_timer.update(dt)) {
|
||||
this.setp_num = 6
|
||||
this.setp_num=smc.vm_data.mission.once
|
||||
}
|
||||
if (this.mission_up_timer.update(dt)) {
|
||||
// 刷新怪物定时器
|
||||
@@ -87,10 +93,48 @@ export class MapMonsterComp extends CCComp {
|
||||
}
|
||||
this.count_hero_pos()
|
||||
this.count_mon_pos()
|
||||
|
||||
// if (this.game_timer.update(dt)) {
|
||||
// smc.vm_data.game.g_time += 1;
|
||||
// }
|
||||
// this.shuaxin(dt)
|
||||
}
|
||||
monster_refresh(){
|
||||
if (this.setp_num <= 0){
|
||||
return
|
||||
}
|
||||
let m:any = RandomManager.instance.getRandomByObjectList(this.mission_list[this.monster_level],1)
|
||||
var scene = smc.map.MapView.scene;
|
||||
let pos:Vec3 = v3(BoxSet.MONSTER_START,BoxSet.GAME_LINE+this.start_ys[this.mon_index])
|
||||
let monster_layer = scene.entityLayer!.node!
|
||||
this.addMonster(m[0],monster_layer,pos)
|
||||
this.mon_index += 1
|
||||
if(this.mon_index>2){
|
||||
this.mon_index = 0
|
||||
}
|
||||
smc.vm_data.mission.m_less=this.total -= 1
|
||||
this.setp_num -= 1
|
||||
}
|
||||
is_reward(){
|
||||
if(smc.vm_data.mission.reward_num < smc.vm_data.mission.reward) return
|
||||
this.do_reward()
|
||||
smc.vm_data.mission.reward_num = 0
|
||||
}
|
||||
do_reward(){
|
||||
console.log("do_reward")
|
||||
oops.message.dispatchEvent("do_reward");
|
||||
}
|
||||
private addMonster(uuid:number=1001,layer:any,pos:Vec3=v3(0,0,0)) {
|
||||
let monster = ecs.getEntity<Mon>(Mon);
|
||||
let scale = -1
|
||||
monster.load(pos,scale,uuid,layer);
|
||||
}
|
||||
|
||||
private on_other_add_monster(event: string, args: any) {
|
||||
var scene = smc.map.MapView.scene;
|
||||
let pos:Vec3 = v3(BoxSet.MONSTER_START,BoxSet.GAME_LINE)
|
||||
let monster_layer = scene.entityLayer!.node!
|
||||
this.addMonster(args.uuid,monster_layer,pos)
|
||||
}
|
||||
set_start_point(){
|
||||
this.start_p.setPosition(-240,BoxSet.GAME_LINE+this.start_ys[this.hero_index]+30,0)
|
||||
@@ -103,53 +147,48 @@ export class MapMonsterComp extends CCComp {
|
||||
}
|
||||
count_mon_pos(){
|
||||
let monsters:any= ecs.query(ecs.allOf(MonModelComp));
|
||||
let x = 320
|
||||
let x1 = 320
|
||||
let x2 = 320
|
||||
smc.enemy_pos[0].x=320
|
||||
smc.enemy_pos[1].x=320
|
||||
smc.enemy_pos[2].x=320
|
||||
for(let i=0;i<monsters.length;i++){
|
||||
if(monsters[i].MonView == undefined) return
|
||||
let mon:any = monsters[i].MonView.node.position
|
||||
if(mon.x < x&&mon.y == smc.enemy_pos[0].y){
|
||||
x = mon.x
|
||||
if(mon.x < smc.enemy_pos[0].x&&mon.y == smc.enemy_pos[0].y){
|
||||
smc.enemy_pos[0].x = mon.x
|
||||
continue
|
||||
}
|
||||
if(mon.x < x1&&mon.y == smc.enemy_pos[1].y){
|
||||
x1 = mon.x
|
||||
if(mon.x < smc.enemy_pos[1].x&&mon.y == smc.enemy_pos[1].y){
|
||||
smc.enemy_pos[1].x = mon.x
|
||||
continue
|
||||
}
|
||||
if(mon.x < x2&&mon.y == smc.enemy_pos[2].y){
|
||||
x2 = mon.x
|
||||
if(mon.x < smc.enemy_pos[2].x&&mon.y == smc.enemy_pos[2].y){
|
||||
smc.enemy_pos[2].x = mon.x
|
||||
continue
|
||||
}
|
||||
}
|
||||
smc.enemy_pos[0].x=x
|
||||
smc.enemy_pos[1].x=x1
|
||||
smc.enemy_pos[2].x=x2
|
||||
}
|
||||
count_hero_pos(){
|
||||
let heros:any= ecs.query(ecs.allOf(HeroModelComp));
|
||||
let x = -320
|
||||
let x1 = -320
|
||||
let x2 = -320
|
||||
smc.hero_pos[0].x=-320
|
||||
smc.hero_pos[1].x=-320
|
||||
smc.hero_pos[2].x=-320
|
||||
for(let i=0;i<heros.length;i++){
|
||||
if(heros[i].HeroView == undefined) return
|
||||
let ho:any = heros[i].HeroView.node.position
|
||||
if(ho.x > x&&ho.y == smc.hero_pos[0].y){
|
||||
x = ho.x
|
||||
if(ho.x > smc.hero_pos[0].x&&ho.y == smc.hero_pos[0].y){
|
||||
smc.hero_pos[0].x = ho.x
|
||||
continue
|
||||
}
|
||||
if(ho.x > x1&&ho.y == smc.hero_pos[1].y ){
|
||||
x1 = ho.x
|
||||
if(ho.x > smc.hero_pos[0].x&&ho.y == smc.hero_pos[1].y ){
|
||||
smc.hero_pos[1].x = ho.x
|
||||
continue
|
||||
}
|
||||
if(ho.x > x2&&ho.y == smc.hero_pos[2].y){
|
||||
x2 = ho.x
|
||||
if(ho.x > smc.hero_pos[0].x&&ho.y == smc.hero_pos[2].y){
|
||||
smc.hero_pos[2].x = ho.x
|
||||
continue
|
||||
}
|
||||
}
|
||||
smc.hero_pos[0].x=x
|
||||
smc.hero_pos[1].x=x1
|
||||
smc.hero_pos[2].x=x2
|
||||
|
||||
}
|
||||
load_role(){
|
||||
let role = ecs.getEntity<Role>(Role);
|
||||
@@ -175,33 +214,7 @@ export class MapMonsterComp extends CCComp {
|
||||
}
|
||||
this.set_start_point()
|
||||
}
|
||||
monster_refresh(){
|
||||
if (this.setp_num <= 0){
|
||||
return
|
||||
}
|
||||
let m:any = RandomManager.instance.getRandomByObjectList(this.mission_list[this.monster_level],1)
|
||||
var scene = smc.map.MapView.scene;
|
||||
let pos:Vec3 = v3(BoxSet.MONSTER_START,BoxSet.GAME_LINE+this.start_ys[this.mon_index])
|
||||
let monster_layer = scene.entityLayer!.node!
|
||||
this.addMonster(m[0],monster_layer,pos)
|
||||
this.mon_index += 1
|
||||
if(this.mon_index>2){
|
||||
this.mon_index = 0
|
||||
}
|
||||
this.setp_num -= 1
|
||||
}
|
||||
private addMonster(uuid:number=1001,layer:any,pos:Vec3=v3(0,0,0)) {
|
||||
let monster = ecs.getEntity<Mon>(Mon);
|
||||
let scale = -1
|
||||
monster.load(pos,scale,uuid,layer);
|
||||
}
|
||||
|
||||
private on_other_add_monster(event: string, args: any) {
|
||||
var scene = smc.map.MapView.scene;
|
||||
let pos:Vec3 = v3(BoxSet.MONSTER_START,BoxSet.GAME_LINE)
|
||||
let monster_layer = scene.entityLayer!.node!
|
||||
this.addMonster(args.uuid,monster_layer,pos)
|
||||
}
|
||||
|
||||
load_boss(){
|
||||
let bs:any = RandomManager.instance.getRandomByObjectList(this.boss_list[this.monster_level],1)
|
||||
var scene = smc.map.MapView.scene;
|
||||
|
||||
38
assets/script/game/map/RewardsComp.ts
Normal file
38
assets/script/game/map/RewardsComp.ts
Normal file
@@ -0,0 +1,38 @@
|
||||
import { _decorator } from "cc";
|
||||
import { ecs } from "../../../../extensions/oops-plugin-framework/assets/libs/ecs/ECS";
|
||||
import { CCComp } from "../../../../extensions/oops-plugin-framework/assets/module/common/CCComp";
|
||||
import { oops } from "../../../../extensions/oops-plugin-framework/assets/core/Oops";
|
||||
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
/** 视图层对象 */
|
||||
@ccclass('RewardsComp')
|
||||
@ecs.register('Rewards', false)
|
||||
export class RewardsComp extends CCComp {
|
||||
reward_lv = 1;
|
||||
onLoad(){
|
||||
// 监听全局事件
|
||||
oops.message.on("do_reward", this.do_reward, this);
|
||||
}
|
||||
/** 视图层逻辑代码分离演示 */
|
||||
start() {
|
||||
// var entity = this.ent as ecs.Entity; // ecs.Entity 可转为当前模块的具体实体对象
|
||||
// this.on(ModuleEvent.Cmd, this.onHandler, this);
|
||||
}
|
||||
do_reward(){
|
||||
this.node.active = true;
|
||||
}
|
||||
/** 全局消息逻辑处理 */
|
||||
// private onHandler(event: string, args: any) {
|
||||
// switch (event) {
|
||||
// case ModuleEvent.Cmd:
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
|
||||
/** 视图对象通过 ecs.Entity.remove(ModuleViewComp) 删除组件是触发组件处理自定义释放逻辑 */
|
||||
reset() {
|
||||
this.node.destroy();
|
||||
}
|
||||
|
||||
}
|
||||
9
assets/script/game/map/RewardsComp.ts.meta
Normal file
9
assets/script/game/map/RewardsComp.ts.meta
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "4.0.23",
|
||||
"importer": "typescript",
|
||||
"imported": true,
|
||||
"uuid": "df8725c7-a5e8-4dfd-b357-59fb88b68283",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
||||
@@ -29,8 +29,6 @@ export class MapViewComp extends CCComp {
|
||||
|
||||
start() {
|
||||
this.scene = this.getComponent(MapViewScene);
|
||||
this.load_data()
|
||||
// this.load_role()
|
||||
}
|
||||
|
||||
load_data(){
|
||||
@@ -38,20 +36,10 @@ export class MapViewComp extends CCComp {
|
||||
// console.log("heros",heros)
|
||||
}
|
||||
protected update(dt: number): void {
|
||||
// if (this.game_timer.update(dt)) {
|
||||
// smc.vm_data.game.g_time += 1;
|
||||
// }
|
||||
// this.shuaxin(dt)
|
||||
// this.gold_add(dt)
|
||||
|
||||
}
|
||||
// 刷新怪物
|
||||
|
||||
gold_add(dt: number) {
|
||||
smc.vm_data.gold.time += dt;
|
||||
if (smc.vm_data.gold.time >= smc.vm_data.gold.cd) {
|
||||
smc.vm_data.gold.min += 1;
|
||||
smc.vm_data.gold.time = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -155,6 +155,9 @@ export class MonViewComp extends CCComp {
|
||||
|
||||
|
||||
update(dt: number){
|
||||
if(smc.vm_data.game_over||smc.vm_data.game_pause){
|
||||
return
|
||||
}
|
||||
if (this.timer.update(dt)) {
|
||||
this.power_change(this.power_speed)
|
||||
}
|
||||
@@ -306,14 +309,14 @@ export class MonViewComp extends CCComp {
|
||||
if(this.hp <= 0){
|
||||
this.dead();
|
||||
this.is_dead = true;
|
||||
smc.vm_data.mission.reward_num += 1;
|
||||
setTimeout(() => {
|
||||
this.ent.destroy();
|
||||
}, 15);
|
||||
}
|
||||
}
|
||||
|
||||
add_hp(hp: number=0){
|
||||
console.log("hero 加血动画");
|
||||
this.heathed()
|
||||
this.hp+=hp;
|
||||
if(this.hp > this.hp_max){
|
||||
this.hp = this.hp_max;
|
||||
@@ -322,6 +325,10 @@ export class MonViewComp extends CCComp {
|
||||
let hp_progress= this.hp/this.hp_max;
|
||||
this.node.getChildByName("top").getChildByName("hp").getComponent(ProgressBar)!.progress = hp_progress;
|
||||
}
|
||||
heathed(){
|
||||
this.node.getChildByName("heathed").active=true
|
||||
}
|
||||
|
||||
add_atk(atk: number,time:number=0){
|
||||
if(time > 0){
|
||||
let buff={atk:atk,time:time}
|
||||
@@ -330,6 +337,7 @@ export class MonViewComp extends CCComp {
|
||||
this.atk += atk;
|
||||
}
|
||||
}
|
||||
|
||||
check_buff_atks(dt: number){
|
||||
for(let i=0;i<this.buff_atks.length;i++){
|
||||
let buff=this.buff_atks[i];
|
||||
|
||||
@@ -64,7 +64,7 @@ export class SkillCom extends CCComp {
|
||||
time = distance / this.speed;
|
||||
let e_pos=v3(this.node.position.x+this.t_pos.x,this.node.position.y+this.t_pos.y)
|
||||
this.node.getChildByName("skill").setRotationFromEuler(0,0,this.angle)
|
||||
console.log("skill ",this.node.getRotation())
|
||||
// console.log("skill ",this.node.getRotation())
|
||||
tween(this.node).to( time,{ position: e_pos},
|
||||
{
|
||||
easing: "linear",
|
||||
|
||||
@@ -6,12 +6,12 @@ export class once extends Component {
|
||||
private spine!: sp.Skeleton;
|
||||
|
||||
start() {
|
||||
|
||||
this.spine.setAnimation(0, "animation", true);
|
||||
}
|
||||
protected onLoad(): void {
|
||||
this.spine = this.getComponent(sp.Skeleton)!;
|
||||
this.spine = this.node.getChildByName("skill").getComponent(sp.Skeleton)!;
|
||||
this.spine.setCompleteListener(trackEntry => {
|
||||
this.node.destroy()
|
||||
if(this.node.isValid) this.node.active = false;
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user